From 17808ac6408824049c0e5a1b52a0e6c9ff24aed0 Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Mon, 7 Aug 2023 13:04:46 +0300 Subject: [PATCH 001/152] Add LSP 3.17 generated code Refs #1170. --- .../lsp-base_notification_receivers.ads | 22 + .../lsp-base_notification_writers.adb | 34 + .../lsp-base_notification_writers.ads | 27 + .../lsp-client_message_factories.adb | 1194 + .../lsp-client_message_factories.ads | 518 + .../lsp-client_notification_readers.adb | 114 + .../lsp-client_notification_receivers.ads | 45 + .../lsp-client_notification_writers.adb | 68 + .../lsp-client_notification_writers.ads | 38 + ...lsp-client_notifications-cancelrequest.adb | 18 + ...lsp-client_notifications-cancelrequest.ads | 23 + .../lsp-client_notifications-event.adb | 18 + .../lsp-client_notifications-event.ads | 23 + .../lsp-client_notifications-logmessage.adb | 18 + .../lsp-client_notifications-logmessage.ads | 23 + .../lsp-client_notifications-logtrace.adb | 18 + .../lsp-client_notifications-logtrace.ads | 23 + .../lsp-client_notifications-progress.adb | 18 + .../lsp-client_notifications-progress.ads | 23 + ...lient_notifications-publishdiagnostics.adb | 18 + ...lient_notifications-publishdiagnostics.ads | 23 + .../lsp-client_notifications-showmessage.adb | 18 + .../lsp-client_notifications-showmessage.ads | 23 + .../generated/lsp-client_request_readers.adb | 225 + .../lsp-client_request_receivers.ads | 110 + .../generated/lsp-client_request_writers.adb | 150 + .../generated/lsp-client_request_writers.ads | 77 + .../lsp-client_requests-applyedit.adb | 17 + .../lsp-client_requests-applyedit.ads | 21 + .../lsp-client_requests-code_lens_refresh.adb | 17 + .../lsp-client_requests-code_lens_refresh.ads | 19 + .../lsp-client_requests-configuration.adb | 17 + .../lsp-client_requests-configuration.ads | 21 + ...lsp-client_requests-diagnostic_refresh.adb | 17 + ...lsp-client_requests-diagnostic_refresh.ads | 19 + .../lsp-client_requests-inlay_refresh.adb | 17 + .../lsp-client_requests-inlay_refresh.ads | 19 + .../lsp-client_requests-inline_refresh.adb | 17 + .../lsp-client_requests-inline_refresh.ads | 19 + .../lsp-client_requests-progress_create.adb | 17 + .../lsp-client_requests-progress_create.ads | 21 + ...lsp-client_requests-registercapability.adb | 17 + ...lsp-client_requests-registercapability.ads | 21 + .../lsp-client_requests-showdocument.adb | 17 + .../lsp-client_requests-showdocument.ads | 21 + ...lsp-client_requests-showmessagerequest.adb | 17 + ...lsp-client_requests-showmessagerequest.ads | 21 + .../lsp-client_requests-tokens_refresh.adb | 17 + .../lsp-client_requests-tokens_refresh.ads | 19 + ...p-client_requests-unregistercapability.adb | 17 + ...p-client_requests-unregistercapability.ads | 21 + .../lsp-client_requests-workspacefolders.adb | 17 + .../lsp-client_requests-workspacefolders.ads | 19 + .../generated/lsp-client_response_readers.adb | 581 + .../lsp-client_response_receivers.ads | 461 + .../generated/lsp-client_response_writers.adb | 597 + .../generated/lsp-client_response_writers.ads | 280 + ...p-client_responses-code_action_resolve.adb | 17 + ...p-client_responses-code_action_resolve.ads | 21 + ...lsp-client_responses-code_lens_resolve.adb | 17 + ...lsp-client_responses-code_lens_resolve.ads | 21 + .../lsp-client_responses-codeaction.adb | 17 + .../lsp-client_responses-codeaction.ads | 21 + .../lsp-client_responses-codelens.adb | 17 + .../lsp-client_responses-codelens.ads | 21 + ...lsp-client_responses-colorpresentation.adb | 17 + ...lsp-client_responses-colorpresentation.ads | 21 + .../lsp-client_responses-completion.adb | 17 + .../lsp-client_responses-completion.ads | 21 + ...sp-client_responses-completion_resolve.adb | 17 + ...sp-client_responses-completion_resolve.ads | 21 + .../lsp-client_responses-declaration.adb | 17 + .../lsp-client_responses-declaration.ads | 21 + .../lsp-client_responses-definition.adb | 17 + .../lsp-client_responses-definition.ads | 21 + .../lsp-client_responses-diagnostic.adb | 17 + .../lsp-client_responses-diagnostic.ads | 21 + .../lsp-client_responses-documentcolor.adb | 17 + .../lsp-client_responses-documentcolor.ads | 21 + ...lsp-client_responses-documenthighlight.adb | 17 + ...lsp-client_responses-documenthighlight.ads | 21 + .../lsp-client_responses-documentlink.adb | 17 + .../lsp-client_responses-documentlink.ads | 21 + .../lsp-client_responses-documentsymbol.adb | 17 + .../lsp-client_responses-documentsymbol.ads | 21 + .../lsp-client_responses-executecommand.adb | 17 + .../lsp-client_responses-executecommand.ads | 21 + .../lsp-client_responses-foldingrange.adb | 17 + .../lsp-client_responses-foldingrange.ads | 21 + .../lsp-client_responses-formatting.adb | 17 + .../lsp-client_responses-formatting.ads | 21 + .../generated/lsp-client_responses-full.adb | 17 + .../generated/lsp-client_responses-full.ads | 21 + .../generated/lsp-client_responses-hover.adb | 17 + .../generated/lsp-client_responses-hover.ads | 21 + .../lsp-client_responses-implementation.adb | 17 + .../lsp-client_responses-implementation.ads | 21 + .../lsp-client_responses-incomingcalls.adb | 17 + .../lsp-client_responses-incomingcalls.ads | 21 + .../lsp-client_responses-initialize.adb | 17 + .../lsp-client_responses-initialize.ads | 21 + .../lsp-client_responses-inlay_resolve.adb | 17 + .../lsp-client_responses-inlay_resolve.ads | 21 + .../lsp-client_responses-inlayhint.adb | 17 + .../lsp-client_responses-inlayhint.ads | 21 + .../lsp-client_responses-inlinevalue.adb | 17 + .../lsp-client_responses-inlinevalue.ads | 21 + .../lsp-client_responses-link_resolve.adb | 17 + .../lsp-client_responses-link_resolve.ads | 21 + ...sp-client_responses-linkededitingrange.adb | 17 + ...sp-client_responses-linkededitingrange.ads | 21 + .../lsp-client_responses-moniker.adb | 17 + .../lsp-client_responses-moniker.ads | 21 + .../lsp-client_responses-ontypeformatting.adb | 17 + .../lsp-client_responses-ontypeformatting.ads | 21 + .../lsp-client_responses-outgoingcalls.adb | 17 + .../lsp-client_responses-outgoingcalls.ads | 21 + ...-client_responses-preparecallhierarchy.adb | 17 + ...-client_responses-preparecallhierarchy.ads | 21 + .../lsp-client_responses-preparerename.adb | 17 + .../lsp-client_responses-preparerename.ads | 21 + ...-client_responses-preparetypehierarchy.adb | 17 + ...-client_responses-preparetypehierarchy.ads | 21 + .../lsp-client_responses-rangeformatting.adb | 17 + .../lsp-client_responses-rangeformatting.ads | 21 + .../lsp-client_responses-references.adb | 17 + .../lsp-client_responses-references.ads | 21 + .../generated/lsp-client_responses-rename.adb | 17 + .../generated/lsp-client_responses-rename.ads | 21 + .../lsp-client_responses-selectionrange.adb | 17 + .../lsp-client_responses-selectionrange.ads | 21 + .../lsp-client_responses-shutdown.adb | 17 + .../lsp-client_responses-shutdown.ads | 21 + .../lsp-client_responses-signaturehelp.adb | 17 + .../lsp-client_responses-signaturehelp.ads | 21 + .../lsp-client_responses-subtypes.adb | 17 + .../lsp-client_responses-subtypes.ads | 21 + .../lsp-client_responses-supertypes.adb | 17 + .../lsp-client_responses-supertypes.ads | 21 + .../generated/lsp-client_responses-symbol.adb | 17 + .../generated/lsp-client_responses-symbol.ads | 21 + .../lsp-client_responses-symbol_resolve.adb | 17 + .../lsp-client_responses-symbol_resolve.ads | 21 + .../lsp-client_responses-tokens_delta.adb | 17 + .../lsp-client_responses-tokens_delta.ads | 21 + .../lsp-client_responses-tokens_range.adb | 17 + .../lsp-client_responses-tokens_range.ads | 21 + .../lsp-client_responses-typedefinition.adb | 17 + .../lsp-client_responses-typedefinition.ads | 21 + .../lsp-client_responses-willcreatefiles.adb | 17 + .../lsp-client_responses-willcreatefiles.ads | 21 + .../lsp-client_responses-willdeletefiles.adb | 17 + .../lsp-client_responses-willdeletefiles.ads | 21 + .../lsp-client_responses-willrenamefiles.adb | 17 + .../lsp-client_responses-willrenamefiles.ads | 21 + ...lsp-client_responses-willsavewaituntil.adb | 17 + ...lsp-client_responses-willsavewaituntil.ads | 21 + ...-client_responses-workspace_diagnostic.adb | 17 + ...-client_responses-workspace_diagnostic.ads | 21 + .../lsp_3.17/generated/lsp-enumerations.ads | 556 + source/lsp_3.17/generated/lsp-inputs.adb | 23902 ++++++++++++++++ source/lsp_3.17/generated/lsp-inputs.ads | 590 + source/lsp_3.17/generated/lsp-outputs.adb | 11270 ++++++++ source/lsp_3.17/generated/lsp-outputs.ads | 592 + .../generated/lsp-progress_report_readers.adb | 379 + .../lsp-progress_report_receivers.ads | 281 + .../generated/lsp-progress_report_writers.adb | 361 + .../generated/lsp-progress_report_writers.ads | 174 + .../lsp-progress_reports-codeaction.adb | 17 + .../lsp-progress_reports-codeaction.ads | 21 + .../lsp-progress_reports-codelens.adb | 17 + .../lsp-progress_reports-codelens.ads | 21 + ...lsp-progress_reports-colorpresentation.adb | 17 + ...lsp-progress_reports-colorpresentation.ads | 21 + .../lsp-progress_reports-completion.adb | 17 + .../lsp-progress_reports-completion.ads | 21 + .../lsp-progress_reports-declaration.adb | 17 + .../lsp-progress_reports-declaration.ads | 21 + .../lsp-progress_reports-definition.adb | 17 + .../lsp-progress_reports-definition.ads | 21 + .../lsp-progress_reports-diagnostic.adb | 17 + .../lsp-progress_reports-diagnostic.ads | 21 + .../lsp-progress_reports-documentcolor.adb | 17 + .../lsp-progress_reports-documentcolor.ads | 21 + ...lsp-progress_reports-documenthighlight.adb | 17 + ...lsp-progress_reports-documenthighlight.ads | 21 + .../lsp-progress_reports-documentlink.adb | 17 + .../lsp-progress_reports-documentlink.ads | 21 + .../lsp-progress_reports-documentsymbol.adb | 17 + .../lsp-progress_reports-documentsymbol.ads | 21 + .../lsp-progress_reports-foldingrange.adb | 17 + .../lsp-progress_reports-foldingrange.ads | 21 + .../generated/lsp-progress_reports-full.adb | 17 + .../generated/lsp-progress_reports-full.ads | 21 + .../lsp-progress_reports-implementation.adb | 17 + .../lsp-progress_reports-implementation.ads | 21 + .../lsp-progress_reports-incomingcalls.adb | 17 + .../lsp-progress_reports-incomingcalls.ads | 21 + .../lsp-progress_reports-inlayhint.adb | 17 + .../lsp-progress_reports-inlayhint.ads | 21 + .../lsp-progress_reports-inlinevalue.adb | 17 + .../lsp-progress_reports-inlinevalue.ads | 21 + .../lsp-progress_reports-moniker.adb | 17 + .../lsp-progress_reports-moniker.ads | 21 + .../lsp-progress_reports-outgoingcalls.adb | 17 + .../lsp-progress_reports-outgoingcalls.ads | 21 + .../lsp-progress_reports-progressbegin.adb | 17 + .../lsp-progress_reports-progressbegin.ads | 21 + .../lsp-progress_reports-progressend.adb | 17 + .../lsp-progress_reports-progressend.ads | 21 + .../lsp-progress_reports-progressreport.adb | 17 + .../lsp-progress_reports-progressreport.ads | 21 + .../lsp-progress_reports-references.adb | 17 + .../lsp-progress_reports-references.ads | 21 + .../lsp-progress_reports-selectionrange.adb | 17 + .../lsp-progress_reports-selectionrange.ads | 21 + .../lsp-progress_reports-subtypes.adb | 17 + .../lsp-progress_reports-subtypes.ads | 21 + .../lsp-progress_reports-supertypes.adb | 17 + .../lsp-progress_reports-supertypes.ads | 21 + .../generated/lsp-progress_reports-symbol.adb | 17 + .../generated/lsp-progress_reports-symbol.ads | 21 + .../lsp-progress_reports-tokens_delta.adb | 17 + .../lsp-progress_reports-tokens_delta.ads | 22 + .../lsp-progress_reports-tokens_range.adb | 17 + .../lsp-progress_reports-tokens_range.ads | 21 + .../lsp-progress_reports-typedefinition.adb | 17 + .../lsp-progress_reports-typedefinition.ads | 21 + ...-progress_reports-workspace_diagnostic.adb | 17 + ...-progress_reports-workspace_diagnostic.ads | 21 + .../lsp-server_notification_readers.adb | 293 + .../lsp-server_notification_receivers.ads | 150 + .../lsp-server_notification_writers.adb | 221 + .../lsp-server_notification_writers.ads | 94 + .../lsp-server_notifications-cancel.adb | 18 + .../lsp-server_notifications-cancel.ads | 23 + ...lsp-server_notifications-cancelrequest.adb | 18 + ...lsp-server_notifications-cancelrequest.ads | 23 + .../lsp-server_notifications-didchange.adb | 18 + .../lsp-server_notifications-didchange.ads | 23 + ...r_notifications-didchangeconfiguration.adb | 18 + ...r_notifications-didchangeconfiguration.ads | 23 + ...server_notifications-didchangenotebook.adb | 18 + ...server_notifications-didchangenotebook.ads | 23 + ...er_notifications-didchangewatchedfiles.adb | 18 + ...er_notifications-didchangewatchedfiles.ads | 23 + ...otifications-didchangeworkspacefolders.adb | 18 + ...otifications-didchangeworkspacefolders.ads | 23 + .../lsp-server_notifications-didclose.adb | 18 + .../lsp-server_notifications-didclose.ads | 23 + ...-server_notifications-didclosenotebook.adb | 18 + ...-server_notifications-didclosenotebook.ads | 23 + ...sp-server_notifications-didcreatefiles.adb | 18 + ...sp-server_notifications-didcreatefiles.ads | 23 + ...sp-server_notifications-diddeletefiles.adb | 18 + ...sp-server_notifications-diddeletefiles.ads | 23 + .../lsp-server_notifications-didopen.adb | 18 + .../lsp-server_notifications-didopen.ads | 23 + ...p-server_notifications-didopennotebook.adb | 18 + ...p-server_notifications-didopennotebook.ads | 23 + ...sp-server_notifications-didrenamefiles.adb | 18 + ...sp-server_notifications-didrenamefiles.ads | 23 + .../lsp-server_notifications-didsave.adb | 18 + .../lsp-server_notifications-didsave.ads | 23 + ...p-server_notifications-didsavenotebook.adb | 18 + ...p-server_notifications-didsavenotebook.ads | 23 + .../lsp-server_notifications-exits.adb | 18 + .../lsp-server_notifications-exits.ads | 21 + .../lsp-server_notifications-initialized.adb | 18 + .../lsp-server_notifications-initialized.ads | 23 + .../lsp-server_notifications-progress.adb | 18 + .../lsp-server_notifications-progress.ads | 23 + .../lsp-server_notifications-settrace.adb | 18 + .../lsp-server_notifications-settrace.ads | 23 + .../lsp-server_notifications-willsave.adb | 18 + .../lsp-server_notifications-willsave.ads | 23 + .../generated/lsp-server_request_readers.adb | 610 + .../lsp-server_request_receivers.ads | 454 + .../generated/lsp-server_request_writers.adb | 622 + .../generated/lsp-server_request_writers.ads | 272 + ...sp-server_requests-code_action_resolve.adb | 17 + ...sp-server_requests-code_action_resolve.ads | 21 + .../lsp-server_requests-code_lens_resolve.adb | 17 + .../lsp-server_requests-code_lens_resolve.ads | 21 + .../lsp-server_requests-codeaction.adb | 17 + .../lsp-server_requests-codeaction.ads | 21 + .../lsp-server_requests-codelens.adb | 17 + .../lsp-server_requests-codelens.ads | 21 + .../lsp-server_requests-colorpresentation.adb | 17 + .../lsp-server_requests-colorpresentation.ads | 21 + .../lsp-server_requests-completion.adb | 17 + .../lsp-server_requests-completion.ads | 21 + ...lsp-server_requests-completion_resolve.adb | 17 + ...lsp-server_requests-completion_resolve.ads | 21 + .../lsp-server_requests-declaration.adb | 17 + .../lsp-server_requests-declaration.ads | 21 + .../lsp-server_requests-definition.adb | 17 + .../lsp-server_requests-definition.ads | 21 + .../lsp-server_requests-diagnostic.adb | 17 + .../lsp-server_requests-diagnostic.ads | 21 + .../lsp-server_requests-documentcolor.adb | 17 + .../lsp-server_requests-documentcolor.ads | 21 + .../lsp-server_requests-documenthighlight.adb | 17 + .../lsp-server_requests-documenthighlight.ads | 21 + .../lsp-server_requests-documentlink.adb | 17 + .../lsp-server_requests-documentlink.ads | 21 + .../lsp-server_requests-documentsymbol.adb | 17 + .../lsp-server_requests-documentsymbol.ads | 21 + .../lsp-server_requests-executecommand.adb | 17 + .../lsp-server_requests-executecommand.ads | 21 + .../lsp-server_requests-foldingrange.adb | 17 + .../lsp-server_requests-foldingrange.ads | 21 + .../lsp-server_requests-formatting.adb | 17 + .../lsp-server_requests-formatting.ads | 21 + .../generated/lsp-server_requests-full.adb | 17 + .../generated/lsp-server_requests-full.ads | 21 + .../generated/lsp-server_requests-hover.adb | 17 + .../generated/lsp-server_requests-hover.ads | 21 + .../lsp-server_requests-implementation.adb | 17 + .../lsp-server_requests-implementation.ads | 21 + .../lsp-server_requests-incomingcalls.adb | 17 + .../lsp-server_requests-incomingcalls.ads | 21 + .../lsp-server_requests-initialize.adb | 17 + .../lsp-server_requests-initialize.ads | 21 + .../lsp-server_requests-inlay_resolve.adb | 17 + .../lsp-server_requests-inlay_resolve.ads | 21 + .../lsp-server_requests-inlayhint.adb | 17 + .../lsp-server_requests-inlayhint.ads | 21 + .../lsp-server_requests-inlinevalue.adb | 17 + .../lsp-server_requests-inlinevalue.ads | 21 + .../lsp-server_requests-link_resolve.adb | 17 + .../lsp-server_requests-link_resolve.ads | 21 + ...lsp-server_requests-linkededitingrange.adb | 17 + ...lsp-server_requests-linkededitingrange.ads | 21 + .../generated/lsp-server_requests-moniker.adb | 17 + .../generated/lsp-server_requests-moniker.ads | 21 + .../lsp-server_requests-ontypeformatting.adb | 17 + .../lsp-server_requests-ontypeformatting.ads | 21 + .../lsp-server_requests-outgoingcalls.adb | 17 + .../lsp-server_requests-outgoingcalls.ads | 21 + ...p-server_requests-preparecallhierarchy.adb | 17 + ...p-server_requests-preparecallhierarchy.ads | 21 + .../lsp-server_requests-preparerename.adb | 17 + .../lsp-server_requests-preparerename.ads | 21 + ...p-server_requests-preparetypehierarchy.adb | 17 + ...p-server_requests-preparetypehierarchy.ads | 21 + .../lsp-server_requests-rangeformatting.adb | 17 + .../lsp-server_requests-rangeformatting.ads | 21 + .../lsp-server_requests-references.adb | 17 + .../lsp-server_requests-references.ads | 21 + .../generated/lsp-server_requests-rename.adb | 17 + .../generated/lsp-server_requests-rename.ads | 21 + .../lsp-server_requests-selectionrange.adb | 17 + .../lsp-server_requests-selectionrange.ads | 21 + .../lsp-server_requests-shutdown.adb | 17 + .../lsp-server_requests-shutdown.ads | 19 + .../lsp-server_requests-signaturehelp.adb | 17 + .../lsp-server_requests-signaturehelp.ads | 21 + .../lsp-server_requests-subtypes.adb | 17 + .../lsp-server_requests-subtypes.ads | 21 + .../lsp-server_requests-supertypes.adb | 17 + .../lsp-server_requests-supertypes.ads | 21 + .../generated/lsp-server_requests-symbol.adb | 17 + .../generated/lsp-server_requests-symbol.ads | 21 + .../lsp-server_requests-symbol_resolve.adb | 17 + .../lsp-server_requests-symbol_resolve.ads | 21 + .../lsp-server_requests-tokens_delta.adb | 17 + .../lsp-server_requests-tokens_delta.ads | 21 + .../lsp-server_requests-tokens_range.adb | 17 + .../lsp-server_requests-tokens_range.ads | 21 + .../lsp-server_requests-typedefinition.adb | 17 + .../lsp-server_requests-typedefinition.ads | 21 + .../lsp-server_requests-willcreatefiles.adb | 17 + .../lsp-server_requests-willcreatefiles.ads | 21 + .../lsp-server_requests-willdeletefiles.adb | 17 + .../lsp-server_requests-willdeletefiles.ads | 21 + .../lsp-server_requests-willrenamefiles.adb | 17 + .../lsp-server_requests-willrenamefiles.ads | 21 + .../lsp-server_requests-willsavewaituntil.adb | 17 + .../lsp-server_requests-willsavewaituntil.ads | 21 + ...p-server_requests-workspace_diagnostic.adb | 17 + ...p-server_requests-workspace_diagnostic.ads | 21 + .../generated/lsp-server_response_readers.adb | 167 + .../lsp-server_response_receivers.ads | 122 + .../generated/lsp-server_response_writers.adb | 172 + .../generated/lsp-server_response_writers.ads | 90 + .../lsp-server_responses-applyedit.adb | 17 + .../lsp-server_responses-applyedit.ads | 21 + ...lsp-server_responses-code_lens_refresh.adb | 17 + ...lsp-server_responses-code_lens_refresh.ads | 21 + .../lsp-server_responses-configuration.adb | 17 + .../lsp-server_responses-configuration.ads | 21 + ...sp-server_responses-diagnostic_refresh.adb | 17 + ...sp-server_responses-diagnostic_refresh.ads | 21 + .../lsp-server_responses-inlay_refresh.adb | 17 + .../lsp-server_responses-inlay_refresh.ads | 21 + .../lsp-server_responses-inline_refresh.adb | 17 + .../lsp-server_responses-inline_refresh.ads | 21 + .../lsp-server_responses-progress_create.adb | 17 + .../lsp-server_responses-progress_create.ads | 21 + ...sp-server_responses-registercapability.adb | 17 + ...sp-server_responses-registercapability.ads | 21 + .../lsp-server_responses-showdocument.adb | 17 + .../lsp-server_responses-showdocument.ads | 21 + ...sp-server_responses-showmessagerequest.adb | 17 + ...sp-server_responses-showmessagerequest.ads | 21 + .../lsp-server_responses-tokens_refresh.adb | 17 + .../lsp-server_responses-tokens_refresh.ads | 21 + ...-server_responses-unregistercapability.adb | 17 + ...-server_responses-unregistercapability.ads | 21 + .../lsp-server_responses-workspacefolders.adb | 17 + .../lsp-server_responses-workspacefolders.ads | 21 + source/lsp_3.17/generated/lsp-structures.ads | 9057 ++++++ 413 files changed, 62145 insertions(+) create mode 100644 source/lsp_3.17/generated/lsp-base_notification_receivers.ads create mode 100644 source/lsp_3.17/generated/lsp-base_notification_writers.adb create mode 100644 source/lsp_3.17/generated/lsp-base_notification_writers.ads create mode 100644 source/lsp_3.17/generated/lsp-client_message_factories.adb create mode 100644 source/lsp_3.17/generated/lsp-client_message_factories.ads create mode 100644 source/lsp_3.17/generated/lsp-client_notification_readers.adb create mode 100644 source/lsp_3.17/generated/lsp-client_notification_receivers.ads create mode 100644 source/lsp_3.17/generated/lsp-client_notification_writers.adb create mode 100644 source/lsp_3.17/generated/lsp-client_notification_writers.ads create mode 100644 source/lsp_3.17/generated/lsp-client_notifications-cancelrequest.adb create mode 100644 source/lsp_3.17/generated/lsp-client_notifications-cancelrequest.ads create mode 100644 source/lsp_3.17/generated/lsp-client_notifications-event.adb create mode 100644 source/lsp_3.17/generated/lsp-client_notifications-event.ads create mode 100644 source/lsp_3.17/generated/lsp-client_notifications-logmessage.adb create mode 100644 source/lsp_3.17/generated/lsp-client_notifications-logmessage.ads create mode 100644 source/lsp_3.17/generated/lsp-client_notifications-logtrace.adb create mode 100644 source/lsp_3.17/generated/lsp-client_notifications-logtrace.ads create mode 100644 source/lsp_3.17/generated/lsp-client_notifications-progress.adb create mode 100644 source/lsp_3.17/generated/lsp-client_notifications-progress.ads create mode 100644 source/lsp_3.17/generated/lsp-client_notifications-publishdiagnostics.adb create mode 100644 source/lsp_3.17/generated/lsp-client_notifications-publishdiagnostics.ads create mode 100644 source/lsp_3.17/generated/lsp-client_notifications-showmessage.adb create mode 100644 source/lsp_3.17/generated/lsp-client_notifications-showmessage.ads create mode 100644 source/lsp_3.17/generated/lsp-client_request_readers.adb create mode 100644 source/lsp_3.17/generated/lsp-client_request_receivers.ads create mode 100644 source/lsp_3.17/generated/lsp-client_request_writers.adb create mode 100644 source/lsp_3.17/generated/lsp-client_request_writers.ads create mode 100644 source/lsp_3.17/generated/lsp-client_requests-applyedit.adb create mode 100644 source/lsp_3.17/generated/lsp-client_requests-applyedit.ads create mode 100644 source/lsp_3.17/generated/lsp-client_requests-code_lens_refresh.adb create mode 100644 source/lsp_3.17/generated/lsp-client_requests-code_lens_refresh.ads create mode 100644 source/lsp_3.17/generated/lsp-client_requests-configuration.adb create mode 100644 source/lsp_3.17/generated/lsp-client_requests-configuration.ads create mode 100644 source/lsp_3.17/generated/lsp-client_requests-diagnostic_refresh.adb create mode 100644 source/lsp_3.17/generated/lsp-client_requests-diagnostic_refresh.ads create mode 100644 source/lsp_3.17/generated/lsp-client_requests-inlay_refresh.adb create mode 100644 source/lsp_3.17/generated/lsp-client_requests-inlay_refresh.ads create mode 100644 source/lsp_3.17/generated/lsp-client_requests-inline_refresh.adb create mode 100644 source/lsp_3.17/generated/lsp-client_requests-inline_refresh.ads create mode 100644 source/lsp_3.17/generated/lsp-client_requests-progress_create.adb create mode 100644 source/lsp_3.17/generated/lsp-client_requests-progress_create.ads create mode 100644 source/lsp_3.17/generated/lsp-client_requests-registercapability.adb create mode 100644 source/lsp_3.17/generated/lsp-client_requests-registercapability.ads create mode 100644 source/lsp_3.17/generated/lsp-client_requests-showdocument.adb create mode 100644 source/lsp_3.17/generated/lsp-client_requests-showdocument.ads create mode 100644 source/lsp_3.17/generated/lsp-client_requests-showmessagerequest.adb create mode 100644 source/lsp_3.17/generated/lsp-client_requests-showmessagerequest.ads create mode 100644 source/lsp_3.17/generated/lsp-client_requests-tokens_refresh.adb create mode 100644 source/lsp_3.17/generated/lsp-client_requests-tokens_refresh.ads create mode 100644 source/lsp_3.17/generated/lsp-client_requests-unregistercapability.adb create mode 100644 source/lsp_3.17/generated/lsp-client_requests-unregistercapability.ads create mode 100644 source/lsp_3.17/generated/lsp-client_requests-workspacefolders.adb create mode 100644 source/lsp_3.17/generated/lsp-client_requests-workspacefolders.ads create mode 100644 source/lsp_3.17/generated/lsp-client_response_readers.adb create mode 100644 source/lsp_3.17/generated/lsp-client_response_receivers.ads create mode 100644 source/lsp_3.17/generated/lsp-client_response_writers.adb create mode 100644 source/lsp_3.17/generated/lsp-client_response_writers.ads create mode 100644 source/lsp_3.17/generated/lsp-client_responses-code_action_resolve.adb create mode 100644 source/lsp_3.17/generated/lsp-client_responses-code_action_resolve.ads create mode 100644 source/lsp_3.17/generated/lsp-client_responses-code_lens_resolve.adb create mode 100644 source/lsp_3.17/generated/lsp-client_responses-code_lens_resolve.ads create mode 100644 source/lsp_3.17/generated/lsp-client_responses-codeaction.adb create mode 100644 source/lsp_3.17/generated/lsp-client_responses-codeaction.ads create mode 100644 source/lsp_3.17/generated/lsp-client_responses-codelens.adb create mode 100644 source/lsp_3.17/generated/lsp-client_responses-codelens.ads create mode 100644 source/lsp_3.17/generated/lsp-client_responses-colorpresentation.adb create mode 100644 source/lsp_3.17/generated/lsp-client_responses-colorpresentation.ads create mode 100644 source/lsp_3.17/generated/lsp-client_responses-completion.adb create mode 100644 source/lsp_3.17/generated/lsp-client_responses-completion.ads create mode 100644 source/lsp_3.17/generated/lsp-client_responses-completion_resolve.adb create mode 100644 source/lsp_3.17/generated/lsp-client_responses-completion_resolve.ads create mode 100644 source/lsp_3.17/generated/lsp-client_responses-declaration.adb create mode 100644 source/lsp_3.17/generated/lsp-client_responses-declaration.ads create mode 100644 source/lsp_3.17/generated/lsp-client_responses-definition.adb create mode 100644 source/lsp_3.17/generated/lsp-client_responses-definition.ads create mode 100644 source/lsp_3.17/generated/lsp-client_responses-diagnostic.adb create mode 100644 source/lsp_3.17/generated/lsp-client_responses-diagnostic.ads create mode 100644 source/lsp_3.17/generated/lsp-client_responses-documentcolor.adb create mode 100644 source/lsp_3.17/generated/lsp-client_responses-documentcolor.ads create mode 100644 source/lsp_3.17/generated/lsp-client_responses-documenthighlight.adb create mode 100644 source/lsp_3.17/generated/lsp-client_responses-documenthighlight.ads create mode 100644 source/lsp_3.17/generated/lsp-client_responses-documentlink.adb create mode 100644 source/lsp_3.17/generated/lsp-client_responses-documentlink.ads create mode 100644 source/lsp_3.17/generated/lsp-client_responses-documentsymbol.adb create mode 100644 source/lsp_3.17/generated/lsp-client_responses-documentsymbol.ads create mode 100644 source/lsp_3.17/generated/lsp-client_responses-executecommand.adb create mode 100644 source/lsp_3.17/generated/lsp-client_responses-executecommand.ads create mode 100644 source/lsp_3.17/generated/lsp-client_responses-foldingrange.adb create mode 100644 source/lsp_3.17/generated/lsp-client_responses-foldingrange.ads create mode 100644 source/lsp_3.17/generated/lsp-client_responses-formatting.adb create mode 100644 source/lsp_3.17/generated/lsp-client_responses-formatting.ads create mode 100644 source/lsp_3.17/generated/lsp-client_responses-full.adb create mode 100644 source/lsp_3.17/generated/lsp-client_responses-full.ads create mode 100644 source/lsp_3.17/generated/lsp-client_responses-hover.adb create mode 100644 source/lsp_3.17/generated/lsp-client_responses-hover.ads create mode 100644 source/lsp_3.17/generated/lsp-client_responses-implementation.adb create mode 100644 source/lsp_3.17/generated/lsp-client_responses-implementation.ads create mode 100644 source/lsp_3.17/generated/lsp-client_responses-incomingcalls.adb create mode 100644 source/lsp_3.17/generated/lsp-client_responses-incomingcalls.ads create mode 100644 source/lsp_3.17/generated/lsp-client_responses-initialize.adb create mode 100644 source/lsp_3.17/generated/lsp-client_responses-initialize.ads create mode 100644 source/lsp_3.17/generated/lsp-client_responses-inlay_resolve.adb create mode 100644 source/lsp_3.17/generated/lsp-client_responses-inlay_resolve.ads create mode 100644 source/lsp_3.17/generated/lsp-client_responses-inlayhint.adb create mode 100644 source/lsp_3.17/generated/lsp-client_responses-inlayhint.ads create mode 100644 source/lsp_3.17/generated/lsp-client_responses-inlinevalue.adb create mode 100644 source/lsp_3.17/generated/lsp-client_responses-inlinevalue.ads create mode 100644 source/lsp_3.17/generated/lsp-client_responses-link_resolve.adb create mode 100644 source/lsp_3.17/generated/lsp-client_responses-link_resolve.ads create mode 100644 source/lsp_3.17/generated/lsp-client_responses-linkededitingrange.adb create mode 100644 source/lsp_3.17/generated/lsp-client_responses-linkededitingrange.ads create mode 100644 source/lsp_3.17/generated/lsp-client_responses-moniker.adb create mode 100644 source/lsp_3.17/generated/lsp-client_responses-moniker.ads create mode 100644 source/lsp_3.17/generated/lsp-client_responses-ontypeformatting.adb create mode 100644 source/lsp_3.17/generated/lsp-client_responses-ontypeformatting.ads create mode 100644 source/lsp_3.17/generated/lsp-client_responses-outgoingcalls.adb create mode 100644 source/lsp_3.17/generated/lsp-client_responses-outgoingcalls.ads create mode 100644 source/lsp_3.17/generated/lsp-client_responses-preparecallhierarchy.adb create mode 100644 source/lsp_3.17/generated/lsp-client_responses-preparecallhierarchy.ads create mode 100644 source/lsp_3.17/generated/lsp-client_responses-preparerename.adb create mode 100644 source/lsp_3.17/generated/lsp-client_responses-preparerename.ads create mode 100644 source/lsp_3.17/generated/lsp-client_responses-preparetypehierarchy.adb create mode 100644 source/lsp_3.17/generated/lsp-client_responses-preparetypehierarchy.ads create mode 100644 source/lsp_3.17/generated/lsp-client_responses-rangeformatting.adb create mode 100644 source/lsp_3.17/generated/lsp-client_responses-rangeformatting.ads create mode 100644 source/lsp_3.17/generated/lsp-client_responses-references.adb create mode 100644 source/lsp_3.17/generated/lsp-client_responses-references.ads create mode 100644 source/lsp_3.17/generated/lsp-client_responses-rename.adb create mode 100644 source/lsp_3.17/generated/lsp-client_responses-rename.ads create mode 100644 source/lsp_3.17/generated/lsp-client_responses-selectionrange.adb create mode 100644 source/lsp_3.17/generated/lsp-client_responses-selectionrange.ads create mode 100644 source/lsp_3.17/generated/lsp-client_responses-shutdown.adb create mode 100644 source/lsp_3.17/generated/lsp-client_responses-shutdown.ads create mode 100644 source/lsp_3.17/generated/lsp-client_responses-signaturehelp.adb create mode 100644 source/lsp_3.17/generated/lsp-client_responses-signaturehelp.ads create mode 100644 source/lsp_3.17/generated/lsp-client_responses-subtypes.adb create mode 100644 source/lsp_3.17/generated/lsp-client_responses-subtypes.ads create mode 100644 source/lsp_3.17/generated/lsp-client_responses-supertypes.adb create mode 100644 source/lsp_3.17/generated/lsp-client_responses-supertypes.ads create mode 100644 source/lsp_3.17/generated/lsp-client_responses-symbol.adb create mode 100644 source/lsp_3.17/generated/lsp-client_responses-symbol.ads create mode 100644 source/lsp_3.17/generated/lsp-client_responses-symbol_resolve.adb create mode 100644 source/lsp_3.17/generated/lsp-client_responses-symbol_resolve.ads create mode 100644 source/lsp_3.17/generated/lsp-client_responses-tokens_delta.adb create mode 100644 source/lsp_3.17/generated/lsp-client_responses-tokens_delta.ads create mode 100644 source/lsp_3.17/generated/lsp-client_responses-tokens_range.adb create mode 100644 source/lsp_3.17/generated/lsp-client_responses-tokens_range.ads create mode 100644 source/lsp_3.17/generated/lsp-client_responses-typedefinition.adb create mode 100644 source/lsp_3.17/generated/lsp-client_responses-typedefinition.ads create mode 100644 source/lsp_3.17/generated/lsp-client_responses-willcreatefiles.adb create mode 100644 source/lsp_3.17/generated/lsp-client_responses-willcreatefiles.ads create mode 100644 source/lsp_3.17/generated/lsp-client_responses-willdeletefiles.adb create mode 100644 source/lsp_3.17/generated/lsp-client_responses-willdeletefiles.ads create mode 100644 source/lsp_3.17/generated/lsp-client_responses-willrenamefiles.adb create mode 100644 source/lsp_3.17/generated/lsp-client_responses-willrenamefiles.ads create mode 100644 source/lsp_3.17/generated/lsp-client_responses-willsavewaituntil.adb create mode 100644 source/lsp_3.17/generated/lsp-client_responses-willsavewaituntil.ads create mode 100644 source/lsp_3.17/generated/lsp-client_responses-workspace_diagnostic.adb create mode 100644 source/lsp_3.17/generated/lsp-client_responses-workspace_diagnostic.ads create mode 100644 source/lsp_3.17/generated/lsp-enumerations.ads create mode 100644 source/lsp_3.17/generated/lsp-inputs.adb create mode 100644 source/lsp_3.17/generated/lsp-inputs.ads create mode 100644 source/lsp_3.17/generated/lsp-outputs.adb create mode 100644 source/lsp_3.17/generated/lsp-outputs.ads create mode 100644 source/lsp_3.17/generated/lsp-progress_report_readers.adb create mode 100644 source/lsp_3.17/generated/lsp-progress_report_receivers.ads create mode 100644 source/lsp_3.17/generated/lsp-progress_report_writers.adb create mode 100644 source/lsp_3.17/generated/lsp-progress_report_writers.ads create mode 100644 source/lsp_3.17/generated/lsp-progress_reports-codeaction.adb create mode 100644 source/lsp_3.17/generated/lsp-progress_reports-codeaction.ads create mode 100644 source/lsp_3.17/generated/lsp-progress_reports-codelens.adb create mode 100644 source/lsp_3.17/generated/lsp-progress_reports-codelens.ads create mode 100644 source/lsp_3.17/generated/lsp-progress_reports-colorpresentation.adb create mode 100644 source/lsp_3.17/generated/lsp-progress_reports-colorpresentation.ads create mode 100644 source/lsp_3.17/generated/lsp-progress_reports-completion.adb create mode 100644 source/lsp_3.17/generated/lsp-progress_reports-completion.ads create mode 100644 source/lsp_3.17/generated/lsp-progress_reports-declaration.adb create mode 100644 source/lsp_3.17/generated/lsp-progress_reports-declaration.ads create mode 100644 source/lsp_3.17/generated/lsp-progress_reports-definition.adb create mode 100644 source/lsp_3.17/generated/lsp-progress_reports-definition.ads create mode 100644 source/lsp_3.17/generated/lsp-progress_reports-diagnostic.adb create mode 100644 source/lsp_3.17/generated/lsp-progress_reports-diagnostic.ads create mode 100644 source/lsp_3.17/generated/lsp-progress_reports-documentcolor.adb create mode 100644 source/lsp_3.17/generated/lsp-progress_reports-documentcolor.ads create mode 100644 source/lsp_3.17/generated/lsp-progress_reports-documenthighlight.adb create mode 100644 source/lsp_3.17/generated/lsp-progress_reports-documenthighlight.ads create mode 100644 source/lsp_3.17/generated/lsp-progress_reports-documentlink.adb create mode 100644 source/lsp_3.17/generated/lsp-progress_reports-documentlink.ads create mode 100644 source/lsp_3.17/generated/lsp-progress_reports-documentsymbol.adb create mode 100644 source/lsp_3.17/generated/lsp-progress_reports-documentsymbol.ads create mode 100644 source/lsp_3.17/generated/lsp-progress_reports-foldingrange.adb create mode 100644 source/lsp_3.17/generated/lsp-progress_reports-foldingrange.ads create mode 100644 source/lsp_3.17/generated/lsp-progress_reports-full.adb create mode 100644 source/lsp_3.17/generated/lsp-progress_reports-full.ads create mode 100644 source/lsp_3.17/generated/lsp-progress_reports-implementation.adb create mode 100644 source/lsp_3.17/generated/lsp-progress_reports-implementation.ads create mode 100644 source/lsp_3.17/generated/lsp-progress_reports-incomingcalls.adb create mode 100644 source/lsp_3.17/generated/lsp-progress_reports-incomingcalls.ads create mode 100644 source/lsp_3.17/generated/lsp-progress_reports-inlayhint.adb create mode 100644 source/lsp_3.17/generated/lsp-progress_reports-inlayhint.ads create mode 100644 source/lsp_3.17/generated/lsp-progress_reports-inlinevalue.adb create mode 100644 source/lsp_3.17/generated/lsp-progress_reports-inlinevalue.ads create mode 100644 source/lsp_3.17/generated/lsp-progress_reports-moniker.adb create mode 100644 source/lsp_3.17/generated/lsp-progress_reports-moniker.ads create mode 100644 source/lsp_3.17/generated/lsp-progress_reports-outgoingcalls.adb create mode 100644 source/lsp_3.17/generated/lsp-progress_reports-outgoingcalls.ads create mode 100644 source/lsp_3.17/generated/lsp-progress_reports-progressbegin.adb create mode 100644 source/lsp_3.17/generated/lsp-progress_reports-progressbegin.ads create mode 100644 source/lsp_3.17/generated/lsp-progress_reports-progressend.adb create mode 100644 source/lsp_3.17/generated/lsp-progress_reports-progressend.ads create mode 100644 source/lsp_3.17/generated/lsp-progress_reports-progressreport.adb create mode 100644 source/lsp_3.17/generated/lsp-progress_reports-progressreport.ads create mode 100644 source/lsp_3.17/generated/lsp-progress_reports-references.adb create mode 100644 source/lsp_3.17/generated/lsp-progress_reports-references.ads create mode 100644 source/lsp_3.17/generated/lsp-progress_reports-selectionrange.adb create mode 100644 source/lsp_3.17/generated/lsp-progress_reports-selectionrange.ads create mode 100644 source/lsp_3.17/generated/lsp-progress_reports-subtypes.adb create mode 100644 source/lsp_3.17/generated/lsp-progress_reports-subtypes.ads create mode 100644 source/lsp_3.17/generated/lsp-progress_reports-supertypes.adb create mode 100644 source/lsp_3.17/generated/lsp-progress_reports-supertypes.ads create mode 100644 source/lsp_3.17/generated/lsp-progress_reports-symbol.adb create mode 100644 source/lsp_3.17/generated/lsp-progress_reports-symbol.ads create mode 100644 source/lsp_3.17/generated/lsp-progress_reports-tokens_delta.adb create mode 100644 source/lsp_3.17/generated/lsp-progress_reports-tokens_delta.ads create mode 100644 source/lsp_3.17/generated/lsp-progress_reports-tokens_range.adb create mode 100644 source/lsp_3.17/generated/lsp-progress_reports-tokens_range.ads create mode 100644 source/lsp_3.17/generated/lsp-progress_reports-typedefinition.adb create mode 100644 source/lsp_3.17/generated/lsp-progress_reports-typedefinition.ads create mode 100644 source/lsp_3.17/generated/lsp-progress_reports-workspace_diagnostic.adb create mode 100644 source/lsp_3.17/generated/lsp-progress_reports-workspace_diagnostic.ads create mode 100644 source/lsp_3.17/generated/lsp-server_notification_readers.adb create mode 100644 source/lsp_3.17/generated/lsp-server_notification_receivers.ads create mode 100644 source/lsp_3.17/generated/lsp-server_notification_writers.adb create mode 100644 source/lsp_3.17/generated/lsp-server_notification_writers.ads create mode 100644 source/lsp_3.17/generated/lsp-server_notifications-cancel.adb create mode 100644 source/lsp_3.17/generated/lsp-server_notifications-cancel.ads create mode 100644 source/lsp_3.17/generated/lsp-server_notifications-cancelrequest.adb create mode 100644 source/lsp_3.17/generated/lsp-server_notifications-cancelrequest.ads create mode 100644 source/lsp_3.17/generated/lsp-server_notifications-didchange.adb create mode 100644 source/lsp_3.17/generated/lsp-server_notifications-didchange.ads create mode 100644 source/lsp_3.17/generated/lsp-server_notifications-didchangeconfiguration.adb create mode 100644 source/lsp_3.17/generated/lsp-server_notifications-didchangeconfiguration.ads create mode 100644 source/lsp_3.17/generated/lsp-server_notifications-didchangenotebook.adb create mode 100644 source/lsp_3.17/generated/lsp-server_notifications-didchangenotebook.ads create mode 100644 source/lsp_3.17/generated/lsp-server_notifications-didchangewatchedfiles.adb create mode 100644 source/lsp_3.17/generated/lsp-server_notifications-didchangewatchedfiles.ads create mode 100644 source/lsp_3.17/generated/lsp-server_notifications-didchangeworkspacefolders.adb create mode 100644 source/lsp_3.17/generated/lsp-server_notifications-didchangeworkspacefolders.ads create mode 100644 source/lsp_3.17/generated/lsp-server_notifications-didclose.adb create mode 100644 source/lsp_3.17/generated/lsp-server_notifications-didclose.ads create mode 100644 source/lsp_3.17/generated/lsp-server_notifications-didclosenotebook.adb create mode 100644 source/lsp_3.17/generated/lsp-server_notifications-didclosenotebook.ads create mode 100644 source/lsp_3.17/generated/lsp-server_notifications-didcreatefiles.adb create mode 100644 source/lsp_3.17/generated/lsp-server_notifications-didcreatefiles.ads create mode 100644 source/lsp_3.17/generated/lsp-server_notifications-diddeletefiles.adb create mode 100644 source/lsp_3.17/generated/lsp-server_notifications-diddeletefiles.ads create mode 100644 source/lsp_3.17/generated/lsp-server_notifications-didopen.adb create mode 100644 source/lsp_3.17/generated/lsp-server_notifications-didopen.ads create mode 100644 source/lsp_3.17/generated/lsp-server_notifications-didopennotebook.adb create mode 100644 source/lsp_3.17/generated/lsp-server_notifications-didopennotebook.ads create mode 100644 source/lsp_3.17/generated/lsp-server_notifications-didrenamefiles.adb create mode 100644 source/lsp_3.17/generated/lsp-server_notifications-didrenamefiles.ads create mode 100644 source/lsp_3.17/generated/lsp-server_notifications-didsave.adb create mode 100644 source/lsp_3.17/generated/lsp-server_notifications-didsave.ads create mode 100644 source/lsp_3.17/generated/lsp-server_notifications-didsavenotebook.adb create mode 100644 source/lsp_3.17/generated/lsp-server_notifications-didsavenotebook.ads create mode 100644 source/lsp_3.17/generated/lsp-server_notifications-exits.adb create mode 100644 source/lsp_3.17/generated/lsp-server_notifications-exits.ads create mode 100644 source/lsp_3.17/generated/lsp-server_notifications-initialized.adb create mode 100644 source/lsp_3.17/generated/lsp-server_notifications-initialized.ads create mode 100644 source/lsp_3.17/generated/lsp-server_notifications-progress.adb create mode 100644 source/lsp_3.17/generated/lsp-server_notifications-progress.ads create mode 100644 source/lsp_3.17/generated/lsp-server_notifications-settrace.adb create mode 100644 source/lsp_3.17/generated/lsp-server_notifications-settrace.ads create mode 100644 source/lsp_3.17/generated/lsp-server_notifications-willsave.adb create mode 100644 source/lsp_3.17/generated/lsp-server_notifications-willsave.ads create mode 100644 source/lsp_3.17/generated/lsp-server_request_readers.adb create mode 100644 source/lsp_3.17/generated/lsp-server_request_receivers.ads create mode 100644 source/lsp_3.17/generated/lsp-server_request_writers.adb create mode 100644 source/lsp_3.17/generated/lsp-server_request_writers.ads create mode 100644 source/lsp_3.17/generated/lsp-server_requests-code_action_resolve.adb create mode 100644 source/lsp_3.17/generated/lsp-server_requests-code_action_resolve.ads create mode 100644 source/lsp_3.17/generated/lsp-server_requests-code_lens_resolve.adb create mode 100644 source/lsp_3.17/generated/lsp-server_requests-code_lens_resolve.ads create mode 100644 source/lsp_3.17/generated/lsp-server_requests-codeaction.adb create mode 100644 source/lsp_3.17/generated/lsp-server_requests-codeaction.ads create mode 100644 source/lsp_3.17/generated/lsp-server_requests-codelens.adb create mode 100644 source/lsp_3.17/generated/lsp-server_requests-codelens.ads create mode 100644 source/lsp_3.17/generated/lsp-server_requests-colorpresentation.adb create mode 100644 source/lsp_3.17/generated/lsp-server_requests-colorpresentation.ads create mode 100644 source/lsp_3.17/generated/lsp-server_requests-completion.adb create mode 100644 source/lsp_3.17/generated/lsp-server_requests-completion.ads create mode 100644 source/lsp_3.17/generated/lsp-server_requests-completion_resolve.adb create mode 100644 source/lsp_3.17/generated/lsp-server_requests-completion_resolve.ads create mode 100644 source/lsp_3.17/generated/lsp-server_requests-declaration.adb create mode 100644 source/lsp_3.17/generated/lsp-server_requests-declaration.ads create mode 100644 source/lsp_3.17/generated/lsp-server_requests-definition.adb create mode 100644 source/lsp_3.17/generated/lsp-server_requests-definition.ads create mode 100644 source/lsp_3.17/generated/lsp-server_requests-diagnostic.adb create mode 100644 source/lsp_3.17/generated/lsp-server_requests-diagnostic.ads create mode 100644 source/lsp_3.17/generated/lsp-server_requests-documentcolor.adb create mode 100644 source/lsp_3.17/generated/lsp-server_requests-documentcolor.ads create mode 100644 source/lsp_3.17/generated/lsp-server_requests-documenthighlight.adb create mode 100644 source/lsp_3.17/generated/lsp-server_requests-documenthighlight.ads create mode 100644 source/lsp_3.17/generated/lsp-server_requests-documentlink.adb create mode 100644 source/lsp_3.17/generated/lsp-server_requests-documentlink.ads create mode 100644 source/lsp_3.17/generated/lsp-server_requests-documentsymbol.adb create mode 100644 source/lsp_3.17/generated/lsp-server_requests-documentsymbol.ads create mode 100644 source/lsp_3.17/generated/lsp-server_requests-executecommand.adb create mode 100644 source/lsp_3.17/generated/lsp-server_requests-executecommand.ads create mode 100644 source/lsp_3.17/generated/lsp-server_requests-foldingrange.adb create mode 100644 source/lsp_3.17/generated/lsp-server_requests-foldingrange.ads create mode 100644 source/lsp_3.17/generated/lsp-server_requests-formatting.adb create mode 100644 source/lsp_3.17/generated/lsp-server_requests-formatting.ads create mode 100644 source/lsp_3.17/generated/lsp-server_requests-full.adb create mode 100644 source/lsp_3.17/generated/lsp-server_requests-full.ads create mode 100644 source/lsp_3.17/generated/lsp-server_requests-hover.adb create mode 100644 source/lsp_3.17/generated/lsp-server_requests-hover.ads create mode 100644 source/lsp_3.17/generated/lsp-server_requests-implementation.adb create mode 100644 source/lsp_3.17/generated/lsp-server_requests-implementation.ads create mode 100644 source/lsp_3.17/generated/lsp-server_requests-incomingcalls.adb create mode 100644 source/lsp_3.17/generated/lsp-server_requests-incomingcalls.ads create mode 100644 source/lsp_3.17/generated/lsp-server_requests-initialize.adb create mode 100644 source/lsp_3.17/generated/lsp-server_requests-initialize.ads create mode 100644 source/lsp_3.17/generated/lsp-server_requests-inlay_resolve.adb create mode 100644 source/lsp_3.17/generated/lsp-server_requests-inlay_resolve.ads create mode 100644 source/lsp_3.17/generated/lsp-server_requests-inlayhint.adb create mode 100644 source/lsp_3.17/generated/lsp-server_requests-inlayhint.ads create mode 100644 source/lsp_3.17/generated/lsp-server_requests-inlinevalue.adb create mode 100644 source/lsp_3.17/generated/lsp-server_requests-inlinevalue.ads create mode 100644 source/lsp_3.17/generated/lsp-server_requests-link_resolve.adb create mode 100644 source/lsp_3.17/generated/lsp-server_requests-link_resolve.ads create mode 100644 source/lsp_3.17/generated/lsp-server_requests-linkededitingrange.adb create mode 100644 source/lsp_3.17/generated/lsp-server_requests-linkededitingrange.ads create mode 100644 source/lsp_3.17/generated/lsp-server_requests-moniker.adb create mode 100644 source/lsp_3.17/generated/lsp-server_requests-moniker.ads create mode 100644 source/lsp_3.17/generated/lsp-server_requests-ontypeformatting.adb create mode 100644 source/lsp_3.17/generated/lsp-server_requests-ontypeformatting.ads create mode 100644 source/lsp_3.17/generated/lsp-server_requests-outgoingcalls.adb create mode 100644 source/lsp_3.17/generated/lsp-server_requests-outgoingcalls.ads create mode 100644 source/lsp_3.17/generated/lsp-server_requests-preparecallhierarchy.adb create mode 100644 source/lsp_3.17/generated/lsp-server_requests-preparecallhierarchy.ads create mode 100644 source/lsp_3.17/generated/lsp-server_requests-preparerename.adb create mode 100644 source/lsp_3.17/generated/lsp-server_requests-preparerename.ads create mode 100644 source/lsp_3.17/generated/lsp-server_requests-preparetypehierarchy.adb create mode 100644 source/lsp_3.17/generated/lsp-server_requests-preparetypehierarchy.ads create mode 100644 source/lsp_3.17/generated/lsp-server_requests-rangeformatting.adb create mode 100644 source/lsp_3.17/generated/lsp-server_requests-rangeformatting.ads create mode 100644 source/lsp_3.17/generated/lsp-server_requests-references.adb create mode 100644 source/lsp_3.17/generated/lsp-server_requests-references.ads create mode 100644 source/lsp_3.17/generated/lsp-server_requests-rename.adb create mode 100644 source/lsp_3.17/generated/lsp-server_requests-rename.ads create mode 100644 source/lsp_3.17/generated/lsp-server_requests-selectionrange.adb create mode 100644 source/lsp_3.17/generated/lsp-server_requests-selectionrange.ads create mode 100644 source/lsp_3.17/generated/lsp-server_requests-shutdown.adb create mode 100644 source/lsp_3.17/generated/lsp-server_requests-shutdown.ads create mode 100644 source/lsp_3.17/generated/lsp-server_requests-signaturehelp.adb create mode 100644 source/lsp_3.17/generated/lsp-server_requests-signaturehelp.ads create mode 100644 source/lsp_3.17/generated/lsp-server_requests-subtypes.adb create mode 100644 source/lsp_3.17/generated/lsp-server_requests-subtypes.ads create mode 100644 source/lsp_3.17/generated/lsp-server_requests-supertypes.adb create mode 100644 source/lsp_3.17/generated/lsp-server_requests-supertypes.ads create mode 100644 source/lsp_3.17/generated/lsp-server_requests-symbol.adb create mode 100644 source/lsp_3.17/generated/lsp-server_requests-symbol.ads create mode 100644 source/lsp_3.17/generated/lsp-server_requests-symbol_resolve.adb create mode 100644 source/lsp_3.17/generated/lsp-server_requests-symbol_resolve.ads create mode 100644 source/lsp_3.17/generated/lsp-server_requests-tokens_delta.adb create mode 100644 source/lsp_3.17/generated/lsp-server_requests-tokens_delta.ads create mode 100644 source/lsp_3.17/generated/lsp-server_requests-tokens_range.adb create mode 100644 source/lsp_3.17/generated/lsp-server_requests-tokens_range.ads create mode 100644 source/lsp_3.17/generated/lsp-server_requests-typedefinition.adb create mode 100644 source/lsp_3.17/generated/lsp-server_requests-typedefinition.ads create mode 100644 source/lsp_3.17/generated/lsp-server_requests-willcreatefiles.adb create mode 100644 source/lsp_3.17/generated/lsp-server_requests-willcreatefiles.ads create mode 100644 source/lsp_3.17/generated/lsp-server_requests-willdeletefiles.adb create mode 100644 source/lsp_3.17/generated/lsp-server_requests-willdeletefiles.ads create mode 100644 source/lsp_3.17/generated/lsp-server_requests-willrenamefiles.adb create mode 100644 source/lsp_3.17/generated/lsp-server_requests-willrenamefiles.ads create mode 100644 source/lsp_3.17/generated/lsp-server_requests-willsavewaituntil.adb create mode 100644 source/lsp_3.17/generated/lsp-server_requests-willsavewaituntil.ads create mode 100644 source/lsp_3.17/generated/lsp-server_requests-workspace_diagnostic.adb create mode 100644 source/lsp_3.17/generated/lsp-server_requests-workspace_diagnostic.ads create mode 100644 source/lsp_3.17/generated/lsp-server_response_readers.adb create mode 100644 source/lsp_3.17/generated/lsp-server_response_receivers.ads create mode 100644 source/lsp_3.17/generated/lsp-server_response_writers.adb create mode 100644 source/lsp_3.17/generated/lsp-server_response_writers.ads create mode 100644 source/lsp_3.17/generated/lsp-server_responses-applyedit.adb create mode 100644 source/lsp_3.17/generated/lsp-server_responses-applyedit.ads create mode 100644 source/lsp_3.17/generated/lsp-server_responses-code_lens_refresh.adb create mode 100644 source/lsp_3.17/generated/lsp-server_responses-code_lens_refresh.ads create mode 100644 source/lsp_3.17/generated/lsp-server_responses-configuration.adb create mode 100644 source/lsp_3.17/generated/lsp-server_responses-configuration.ads create mode 100644 source/lsp_3.17/generated/lsp-server_responses-diagnostic_refresh.adb create mode 100644 source/lsp_3.17/generated/lsp-server_responses-diagnostic_refresh.ads create mode 100644 source/lsp_3.17/generated/lsp-server_responses-inlay_refresh.adb create mode 100644 source/lsp_3.17/generated/lsp-server_responses-inlay_refresh.ads create mode 100644 source/lsp_3.17/generated/lsp-server_responses-inline_refresh.adb create mode 100644 source/lsp_3.17/generated/lsp-server_responses-inline_refresh.ads create mode 100644 source/lsp_3.17/generated/lsp-server_responses-progress_create.adb create mode 100644 source/lsp_3.17/generated/lsp-server_responses-progress_create.ads create mode 100644 source/lsp_3.17/generated/lsp-server_responses-registercapability.adb create mode 100644 source/lsp_3.17/generated/lsp-server_responses-registercapability.ads create mode 100644 source/lsp_3.17/generated/lsp-server_responses-showdocument.adb create mode 100644 source/lsp_3.17/generated/lsp-server_responses-showdocument.ads create mode 100644 source/lsp_3.17/generated/lsp-server_responses-showmessagerequest.adb create mode 100644 source/lsp_3.17/generated/lsp-server_responses-showmessagerequest.ads create mode 100644 source/lsp_3.17/generated/lsp-server_responses-tokens_refresh.adb create mode 100644 source/lsp_3.17/generated/lsp-server_responses-tokens_refresh.ads create mode 100644 source/lsp_3.17/generated/lsp-server_responses-unregistercapability.adb create mode 100644 source/lsp_3.17/generated/lsp-server_responses-unregistercapability.ads create mode 100644 source/lsp_3.17/generated/lsp-server_responses-workspacefolders.adb create mode 100644 source/lsp_3.17/generated/lsp-server_responses-workspacefolders.ads create mode 100644 source/lsp_3.17/generated/lsp-structures.ads diff --git a/source/lsp_3.17/generated/lsp-base_notification_receivers.ads b/source/lsp_3.17/generated/lsp-base_notification_receivers.ads new file mode 100644 index 000000000..39b7b5860 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-base_notification_receivers.ads @@ -0,0 +1,22 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Base_Notification_Receivers is + pragma Preelaborate; + + type Base_Notification_Receiver is limited interface; + + procedure On_CancelRequest_Notification + (Self : in out Base_Notification_Receiver; + Value : LSP.Structures.CancelParams) is null; + + procedure On_Progress_Notification + (Self : in out Base_Notification_Receiver; + Value : LSP.Structures.ProgressParams) is null; + +end LSP.Base_Notification_Receivers; diff --git a/source/lsp_3.17/generated/lsp-base_notification_writers.adb b/source/lsp_3.17/generated/lsp-base_notification_writers.adb new file mode 100644 index 000000000..de73b59cb --- /dev/null +++ b/source/lsp_3.17/generated/lsp-base_notification_writers.adb @@ -0,0 +1,34 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Output_Tools; +with LSP.Outputs; + +package body LSP.Base_Notification_Writers is + + overriding procedure On_CancelRequest_Notification + (Self : in out Base_Notification_Writer; + Value : LSP.Structures.CancelParams) is + begin + LSP.Output_Tools.Write_Start_Notification + (Self.Output.all, "$/cancelRequest"); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_CancelParams (Self.Output.all, Value); + Self.Output.End_Object; + end On_CancelRequest_Notification; + + overriding procedure On_Progress_Notification + (Self : in out Base_Notification_Writer; + Value : LSP.Structures.ProgressParams) is + begin + LSP.Output_Tools.Write_Start_Notification + (Self.Output.all, "$/progress"); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_ProgressParams (Self.Output.all, Value); + Self.Output.End_Object; + end On_Progress_Notification; + +end LSP.Base_Notification_Writers; diff --git a/source/lsp_3.17/generated/lsp-base_notification_writers.ads b/source/lsp_3.17/generated/lsp-base_notification_writers.ads new file mode 100644 index 000000000..d3d948332 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-base_notification_writers.ads @@ -0,0 +1,27 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with VSS.JSON.Content_Handlers; +with LSP.Structures; +with LSP.Base_Notification_Receivers; + +package LSP.Base_Notification_Writers is + pragma Preelaborate; + + type Base_Notification_Writer + (Output : access VSS.JSON.Content_Handlers.JSON_Content_Handler'Class) is + new LSP.Base_Notification_Receivers.Base_Notification_Receiver with + null record; + + overriding procedure On_CancelRequest_Notification + (Self : in out Base_Notification_Writer; + Value : LSP.Structures.CancelParams); + + overriding procedure On_Progress_Notification + (Self : in out Base_Notification_Writer; + Value : LSP.Structures.ProgressParams); + +end LSP.Base_Notification_Writers; diff --git a/source/lsp_3.17/generated/lsp-client_message_factories.adb b/source/lsp_3.17/generated/lsp-client_message_factories.adb new file mode 100644 index 000000000..496f8a169 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_message_factories.adb @@ -0,0 +1,1194 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Client_Responses.Errors; +with LSP.Client_Notifications.LogTrace; +with LSP.Client_Notifications.Event; +with LSP.Client_Notifications.PublishDiagnostics; +with LSP.Client_Notifications.LogMessage; +with LSP.Client_Notifications.ShowMessage; +with LSP.Client_Requests.RegisterCapability; +with LSP.Client_Requests.UnregisterCapability; +with LSP.Client_Requests.ShowDocument; +with LSP.Client_Requests.ShowMessageRequest; +with LSP.Client_Requests.Progress_Create; +with LSP.Client_Requests.ApplyEdit; +with LSP.Client_Requests.Code_Lens_Refresh; +with LSP.Client_Requests.Configuration; +with LSP.Client_Requests.Diagnostic_Refresh; +with LSP.Client_Requests.Inlay_Refresh; +with LSP.Client_Requests.Inline_Refresh; +with LSP.Client_Requests.Tokens_Refresh; +with LSP.Client_Requests.WorkspaceFolders; +with LSP.Client_Responses.IncomingCalls; +with LSP.Client_Responses.OutgoingCalls; +with LSP.Client_Responses.Code_Action_Resolve; +with LSP.Client_Responses.Code_Lens_Resolve; +with LSP.Client_Responses.Completion_Resolve; +with LSP.Client_Responses.Link_Resolve; +with LSP.Client_Responses.Initialize; +with LSP.Client_Responses.Inlay_Resolve; +with LSP.Client_Responses.Shutdown; +with LSP.Client_Responses.CodeAction; +with LSP.Client_Responses.CodeLens; +with LSP.Client_Responses.ColorPresentation; +with LSP.Client_Responses.Completion; +with LSP.Client_Responses.Declaration; +with LSP.Client_Responses.Definition; +with LSP.Client_Responses.Diagnostic; +with LSP.Client_Responses.DocumentColor; +with LSP.Client_Responses.DocumentHighlight; +with LSP.Client_Responses.DocumentLink; +with LSP.Client_Responses.DocumentSymbol; +with LSP.Client_Responses.FoldingRange; +with LSP.Client_Responses.Formatting; +with LSP.Client_Responses.Hover; +with LSP.Client_Responses.Implementation; +with LSP.Client_Responses.InlayHint; +with LSP.Client_Responses.InlineValue; +with LSP.Client_Responses.LinkedEditingRange; +with LSP.Client_Responses.Moniker; +with LSP.Client_Responses.OnTypeFormatting; +with LSP.Client_Responses.PrepareCallHierarchy; +with LSP.Client_Responses.PrepareRename; +with LSP.Client_Responses.PrepareTypeHierarchy; +with LSP.Client_Responses.RangeFormatting; +with LSP.Client_Responses.References; +with LSP.Client_Responses.Rename; +with LSP.Client_Responses.SelectionRange; +with LSP.Client_Responses.Full; +with LSP.Client_Responses.Tokens_Delta; +with LSP.Client_Responses.Tokens_Range; +with LSP.Client_Responses.SignatureHelp; +with LSP.Client_Responses.TypeDefinition; +with LSP.Client_Responses.WillSaveWaitUntil; +with LSP.Client_Responses.Subtypes; +with LSP.Client_Responses.Supertypes; +with LSP.Client_Responses.Workspace_Diagnostic; +with LSP.Client_Responses.ExecuteCommand; +with LSP.Client_Responses.Symbol; +with LSP.Client_Responses.WillCreateFiles; +with LSP.Client_Responses.WillDeleteFiles; +with LSP.Client_Responses.WillRenameFiles; +with LSP.Client_Responses.Symbol_Resolve; +with LSP.Progress_Reports.IncomingCalls; +with LSP.Progress_Reports.OutgoingCalls; +with LSP.Progress_Reports.CodeAction; +with LSP.Progress_Reports.CodeLens; +with LSP.Progress_Reports.ColorPresentation; +with LSP.Progress_Reports.Completion; +with LSP.Progress_Reports.Declaration; +with LSP.Progress_Reports.Definition; +with LSP.Progress_Reports.Diagnostic; +with LSP.Progress_Reports.DocumentColor; +with LSP.Progress_Reports.DocumentHighlight; +with LSP.Progress_Reports.DocumentLink; +with LSP.Progress_Reports.DocumentSymbol; +with LSP.Progress_Reports.FoldingRange; +with LSP.Progress_Reports.Implementation; +with LSP.Progress_Reports.InlayHint; +with LSP.Progress_Reports.InlineValue; +with LSP.Progress_Reports.Moniker; +with LSP.Progress_Reports.References; +with LSP.Progress_Reports.SelectionRange; +with LSP.Progress_Reports.Full; +with LSP.Progress_Reports.Tokens_Delta; +with LSP.Progress_Reports.Tokens_Range; +with LSP.Progress_Reports.TypeDefinition; +with LSP.Progress_Reports.Subtypes; +with LSP.Progress_Reports.Supertypes; +with LSP.Progress_Reports.Workspace_Diagnostic; +with LSP.Progress_Reports.Symbol; +with LSP.Progress_Reports.ProgressBegin; + +with LSP.Progress_Reports.ProgressReport; + +with LSP.Progress_Reports.ProgressEnd; + +package body LSP.Client_Message_Factories is + + overriding procedure On_Error_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Errors.ResponseError) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Client_Responses.Errors.Response' + (Id => Id, + Error => Value)); + end On_Error_Response; + + overriding procedure On_LogTrace_Notification + (Self : in out Client_Message_Factory; + Value : LSP.Structures.LogTraceParams) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Client_Notifications.LogTrace.Notification'(Params => Value)); + end On_LogTrace_Notification; + + overriding procedure On_Event_Notification + (Self : in out Client_Message_Factory; Value : LSP.Structures.LSPAny) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Client_Notifications.Event.Notification'(Params => Value)); + end On_Event_Notification; + + overriding procedure On_PublishDiagnostics_Notification + (Self : in out Client_Message_Factory; + Value : LSP.Structures.PublishDiagnosticsParams) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Client_Notifications.PublishDiagnostics.Notification' + (Params => Value)); + end On_PublishDiagnostics_Notification; + + overriding procedure On_LogMessage_Notification + (Self : in out Client_Message_Factory; + Value : LSP.Structures.LogMessageParams) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Client_Notifications.LogMessage.Notification' + (Params => Value)); + end On_LogMessage_Notification; + + overriding procedure On_ShowMessage_Notification + (Self : in out Client_Message_Factory; + Value : LSP.Structures.ShowMessageParams) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Client_Notifications.ShowMessage.Notification' + (Params => Value)); + end On_ShowMessage_Notification; + + overriding procedure On_RegisterCapability_Request + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.RegistrationParams) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Client_Requests.RegisterCapability.Request' + (Id => Id, + Params => Value)); + end On_RegisterCapability_Request; + + overriding procedure On_UnregisterCapability_Request + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.UnregistrationParams) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Client_Requests.UnregisterCapability.Request' + (Id => Id, + Params => Value)); + end On_UnregisterCapability_Request; + + overriding procedure On_ShowDocument_Request + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ShowDocumentParams) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Client_Requests.ShowDocument.Request' + (Id => Id, + Params => Value)); + end On_ShowDocument_Request; + + overriding procedure On_ShowMessageRequest_Request + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ShowMessageRequestParams) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Client_Requests.ShowMessageRequest.Request' + (Id => Id, + Params => Value)); + end On_ShowMessageRequest_Request; + + overriding procedure On_Progress_Create_Request + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkDoneProgressCreateParams) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Client_Requests.Progress_Create.Request' + (Id => Id, + Params => Value)); + end On_Progress_Create_Request; + + overriding procedure On_ApplyEdit_Request + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ApplyWorkspaceEditParams) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Client_Requests.ApplyEdit.Request' + (Id => Id, + Params => Value)); + end On_ApplyEdit_Request; + + overriding procedure On_Code_Lens_Refresh_Request + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Client_Requests.Code_Lens_Refresh.Request'(Id => Id)); + end On_Code_Lens_Refresh_Request; + + overriding procedure On_Configuration_Request + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ConfigurationParams) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Client_Requests.Configuration.Request' + (Id => Id, + Params => Value)); + end On_Configuration_Request; + + overriding procedure On_Diagnostic_Refresh_Request + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Client_Requests.Diagnostic_Refresh.Request'(Id => Id)); + end On_Diagnostic_Refresh_Request; + + overriding procedure On_Inlay_Refresh_Request + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Client_Requests.Inlay_Refresh.Request'(Id => Id)); + end On_Inlay_Refresh_Request; + + overriding procedure On_Inline_Refresh_Request + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Client_Requests.Inline_Refresh.Request'(Id => Id)); + end On_Inline_Refresh_Request; + + overriding procedure On_Tokens_Refresh_Request + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Client_Requests.Tokens_Refresh.Request'(Id => Id)); + end On_Tokens_Refresh_Request; + + overriding procedure On_WorkspaceFolders_Request + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Client_Requests.WorkspaceFolders.Request'(Id => Id)); + end On_WorkspaceFolders_Request; + + overriding procedure On_IncomingCalls_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CallHierarchyIncomingCall_Vector_Or_Null) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Client_Responses.IncomingCalls.Response' + (Id => Id, + Result => Value)); + end On_IncomingCalls_Response; + + overriding procedure On_OutgoingCalls_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CallHierarchyOutgoingCall_Vector_Or_Null) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Client_Responses.OutgoingCalls.Response' + (Id => Id, + Result => Value)); + end On_OutgoingCalls_Response; + + overriding procedure On_Code_Action_Resolve_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CodeAction) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Client_Responses.Code_Action_Resolve.Response' + (Id => Id, + Result => Value)); + end On_Code_Action_Resolve_Response; + + overriding procedure On_Code_Lens_Resolve_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CodeLens) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Client_Responses.Code_Lens_Resolve.Response' + (Id => Id, + Result => Value)); + end On_Code_Lens_Resolve_Response; + + overriding procedure On_Completion_Resolve_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CompletionItem) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Client_Responses.Completion_Resolve.Response' + (Id => Id, + Result => Value)); + end On_Completion_Resolve_Response; + + overriding procedure On_Link_Resolve_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentLink) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Client_Responses.Link_Resolve.Response' + (Id => Id, + Result => Value)); + end On_Link_Resolve_Response; + + overriding procedure On_Initialize_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InitializeResult) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Client_Responses.Initialize.Response' + (Id => Id, + Result => Value)); + end On_Initialize_Response; + + overriding procedure On_Inlay_Resolve_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InlayHint) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Client_Responses.Inlay_Resolve.Response' + (Id => Id, + Result => Value)); + end On_Inlay_Resolve_Response; + + overriding procedure On_Shutdown_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Null_Record) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Client_Responses.Shutdown.Response' + (Id => Id, + Result => Value)); + end On_Shutdown_Response; + + overriding procedure On_CodeAction_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Command_Or_CodeAction_Vector_Or_Null) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Client_Responses.CodeAction.Response' + (Id => Id, + Result => Value)); + end On_CodeAction_Response; + + overriding procedure On_CodeLens_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CodeLens_Vector_Or_Null) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Client_Responses.CodeLens.Response' + (Id => Id, + Result => Value)); + end On_CodeLens_Response; + + overriding procedure On_ColorPresentation_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ColorPresentation_Vector) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Client_Responses.ColorPresentation.Response' + (Id => Id, + Result => Value)); + end On_ColorPresentation_Response; + + overriding procedure On_Completion_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Completion_Result) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Client_Responses.Completion.Response' + (Id => Id, + Result => Value)); + end On_Completion_Response; + + overriding procedure On_Declaration_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Declaration_Result) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Client_Responses.Declaration.Response' + (Id => Id, + Result => Value)); + end On_Declaration_Response; + + overriding procedure On_Definition_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Definition_Result) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Client_Responses.Definition.Response' + (Id => Id, + Result => Value)); + end On_Definition_Response; + + overriding procedure On_Diagnostic_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentDiagnosticReport) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Client_Responses.Diagnostic.Response' + (Id => Id, + Result => Value)); + end On_Diagnostic_Response; + + overriding procedure On_DocumentColor_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ColorInformation_Vector) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Client_Responses.DocumentColor.Response' + (Id => Id, + Result => Value)); + end On_DocumentColor_Response; + + overriding procedure On_DocumentHighlight_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentHighlight_Vector_Or_Null) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Client_Responses.DocumentHighlight.Response' + (Id => Id, + Result => Value)); + end On_DocumentHighlight_Response; + + overriding procedure On_DocumentLink_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentLink_Vector_Or_Null) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Client_Responses.DocumentLink.Response' + (Id => Id, + Result => Value)); + end On_DocumentLink_Response; + + overriding procedure On_DocumentSymbol_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentSymbol_Result) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Client_Responses.DocumentSymbol.Response' + (Id => Id, + Result => Value)); + end On_DocumentSymbol_Response; + + overriding procedure On_FoldingRange_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.FoldingRange_Vector_Or_Null) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Client_Responses.FoldingRange.Response' + (Id => Id, + Result => Value)); + end On_FoldingRange_Response; + + overriding procedure On_Formatting_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TextEdit_Vector_Or_Null) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Client_Responses.Formatting.Response' + (Id => Id, + Result => Value)); + end On_Formatting_Response; + + overriding procedure On_Hover_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Hover_Or_Null) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Client_Responses.Hover.Response' + (Id => Id, + Result => Value)); + end On_Hover_Response; + + overriding procedure On_Implementation_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Definition_Result) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Client_Responses.Implementation.Response' + (Id => Id, + Result => Value)); + end On_Implementation_Response; + + overriding procedure On_InlayHint_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InlayHint_Vector_Or_Null) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Client_Responses.InlayHint.Response' + (Id => Id, + Result => Value)); + end On_InlayHint_Response; + + overriding procedure On_InlineValue_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InlineValue_Vector_Or_Null) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Client_Responses.InlineValue.Response' + (Id => Id, + Result => Value)); + end On_InlineValue_Response; + + overriding procedure On_LinkedEditingRange_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.LinkedEditingRanges_Or_Null) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Client_Responses.LinkedEditingRange.Response' + (Id => Id, + Result => Value)); + end On_LinkedEditingRange_Response; + + overriding procedure On_Moniker_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Moniker_Vector_Or_Null) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Client_Responses.Moniker.Response' + (Id => Id, + Result => Value)); + end On_Moniker_Response; + + overriding procedure On_OnTypeFormatting_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TextEdit_Vector_Or_Null) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Client_Responses.OnTypeFormatting.Response' + (Id => Id, + Result => Value)); + end On_OnTypeFormatting_Response; + + overriding procedure On_PrepareCallHierarchy_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CallHierarchyItem_Vector_Or_Null) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Client_Responses.PrepareCallHierarchy.Response' + (Id => Id, + Result => Value)); + end On_PrepareCallHierarchy_Response; + + overriding procedure On_PrepareRename_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.PrepareRenameResult_Or_Null) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Client_Responses.PrepareRename.Response' + (Id => Id, + Result => Value)); + end On_PrepareRename_Response; + + overriding procedure On_PrepareTypeHierarchy_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TypeHierarchyItem_Vector_Or_Null) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Client_Responses.PrepareTypeHierarchy.Response' + (Id => Id, + Result => Value)); + end On_PrepareTypeHierarchy_Response; + + overriding procedure On_RangeFormatting_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TextEdit_Vector_Or_Null) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Client_Responses.RangeFormatting.Response' + (Id => Id, + Result => Value)); + end On_RangeFormatting_Response; + + overriding procedure On_References_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Location_Vector_Or_Null) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Client_Responses.References.Response' + (Id => Id, + Result => Value)); + end On_References_Response; + + overriding procedure On_Rename_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceEdit_Or_Null) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Client_Responses.Rename.Response' + (Id => Id, + Result => Value)); + end On_Rename_Response; + + overriding procedure On_SelectionRange_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SelectionRange_Vector_Or_Null) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Client_Responses.SelectionRange.Response' + (Id => Id, + Result => Value)); + end On_SelectionRange_Response; + + overriding procedure On_Full_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SemanticTokens_Or_Null) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Client_Responses.Full.Response' + (Id => Id, + Result => Value)); + end On_Full_Response; + + overriding procedure On_Tokens_Delta_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Tokens_Delta_Result) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Client_Responses.Tokens_Delta.Response' + (Id => Id, + Result => Value)); + end On_Tokens_Delta_Response; + + overriding procedure On_Tokens_Range_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SemanticTokens_Or_Null) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Client_Responses.Tokens_Range.Response' + (Id => Id, + Result => Value)); + end On_Tokens_Range_Response; + + overriding procedure On_SignatureHelp_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SignatureHelp_Or_Null) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Client_Responses.SignatureHelp.Response' + (Id => Id, + Result => Value)); + end On_SignatureHelp_Response; + + overriding procedure On_TypeDefinition_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Definition_Result) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Client_Responses.TypeDefinition.Response' + (Id => Id, + Result => Value)); + end On_TypeDefinition_Response; + + overriding procedure On_WillSaveWaitUntil_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TextEdit_Vector_Or_Null) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Client_Responses.WillSaveWaitUntil.Response' + (Id => Id, + Result => Value)); + end On_WillSaveWaitUntil_Response; + + overriding procedure On_Subtypes_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TypeHierarchyItem_Vector_Or_Null) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Client_Responses.Subtypes.Response' + (Id => Id, + Result => Value)); + end On_Subtypes_Response; + + overriding procedure On_Supertypes_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TypeHierarchyItem_Vector_Or_Null) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Client_Responses.Supertypes.Response' + (Id => Id, + Result => Value)); + end On_Supertypes_Response; + + overriding procedure On_Workspace_Diagnostic_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceDiagnosticReport) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Client_Responses.Workspace_Diagnostic.Response' + (Id => Id, + Result => Value)); + end On_Workspace_Diagnostic_Response; + + overriding procedure On_ExecuteCommand_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.LSPAny_Or_Null) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Client_Responses.ExecuteCommand.Response' + (Id => Id, + Result => Value)); + end On_ExecuteCommand_Response; + + overriding procedure On_Symbol_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Symbol_Result) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Client_Responses.Symbol.Response' + (Id => Id, + Result => Value)); + end On_Symbol_Response; + + overriding procedure On_WillCreateFiles_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceEdit_Or_Null) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Client_Responses.WillCreateFiles.Response' + (Id => Id, + Result => Value)); + end On_WillCreateFiles_Response; + + overriding procedure On_WillDeleteFiles_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceEdit_Or_Null) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Client_Responses.WillDeleteFiles.Response' + (Id => Id, + Result => Value)); + end On_WillDeleteFiles_Response; + + overriding procedure On_WillRenameFiles_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceEdit_Or_Null) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Client_Responses.WillRenameFiles.Response' + (Id => Id, + Result => Value)); + end On_WillRenameFiles_Response; + + overriding procedure On_Symbol_Resolve_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceSymbol) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Client_Responses.Symbol_Resolve.Response' + (Id => Id, + Result => Value)); + end On_Symbol_Resolve_Response; + + overriding procedure On_IncomingCalls_Partial_Result + (Self : in out Client_Message_Factory; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CallHierarchyIncomingCall_Vector) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Progress_Reports.IncomingCalls.Partial_Result' + (Token => Token, + Params => Value)); + end On_IncomingCalls_Partial_Result; + + overriding procedure On_OutgoingCalls_Partial_Result + (Self : in out Client_Message_Factory; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CallHierarchyOutgoingCall_Vector) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Progress_Reports.OutgoingCalls.Partial_Result' + (Token => Token, + Params => Value)); + end On_OutgoingCalls_Partial_Result; + + overriding procedure On_CodeAction_Partial_Result + (Self : in out Client_Message_Factory; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Command_Or_CodeAction_Vector) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Progress_Reports.CodeAction.Partial_Result' + (Token => Token, + Params => Value)); + end On_CodeAction_Partial_Result; + + overriding procedure On_CodeLens_Partial_Result + (Self : in out Client_Message_Factory; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CodeLens_Vector) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Progress_Reports.CodeLens.Partial_Result' + (Token => Token, + Params => Value)); + end On_CodeLens_Partial_Result; + + overriding procedure On_ColorPresentation_Partial_Result + (Self : in out Client_Message_Factory; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ColorPresentation_Vector) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Progress_Reports.ColorPresentation.Partial_Result' + (Token => Token, + Params => Value)); + end On_ColorPresentation_Partial_Result; + + overriding procedure On_Completion_Partial_Result + (Self : in out Client_Message_Factory; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CompletionItem_Vector) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Progress_Reports.Completion.Partial_Result' + (Token => Token, + Params => Value)); + end On_Completion_Partial_Result; + + overriding procedure On_Declaration_Partial_Result + (Self : in out Client_Message_Factory; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Declaration_Progress_Report) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Progress_Reports.Declaration.Partial_Result' + (Token => Token, + Params => Value)); + end On_Declaration_Partial_Result; + + overriding procedure On_Definition_Partial_Result + (Self : in out Client_Message_Factory; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Definition_Progress_Report) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Progress_Reports.Definition.Partial_Result' + (Token => Token, + Params => Value)); + end On_Definition_Partial_Result; + + overriding procedure On_Diagnostic_Partial_Result + (Self : in out Client_Message_Factory; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentDiagnosticReportPartialResult) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Progress_Reports.Diagnostic.Partial_Result' + (Token => Token, + Params => Value)); + end On_Diagnostic_Partial_Result; + + overriding procedure On_DocumentColor_Partial_Result + (Self : in out Client_Message_Factory; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ColorInformation_Vector) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Progress_Reports.DocumentColor.Partial_Result' + (Token => Token, + Params => Value)); + end On_DocumentColor_Partial_Result; + + overriding procedure On_DocumentHighlight_Partial_Result + (Self : in out Client_Message_Factory; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentHighlight_Vector) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Progress_Reports.DocumentHighlight.Partial_Result' + (Token => Token, + Params => Value)); + end On_DocumentHighlight_Partial_Result; + + overriding procedure On_DocumentLink_Partial_Result + (Self : in out Client_Message_Factory; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentLink_Vector) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Progress_Reports.DocumentLink.Partial_Result' + (Token => Token, + Params => Value)); + end On_DocumentLink_Partial_Result; + + overriding procedure On_DocumentSymbol_Partial_Result + (Self : in out Client_Message_Factory; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentSymbol_Progress_Report) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Progress_Reports.DocumentSymbol.Partial_Result' + (Token => Token, + Params => Value)); + end On_DocumentSymbol_Partial_Result; + + overriding procedure On_FoldingRange_Partial_Result + (Self : in out Client_Message_Factory; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.FoldingRange_Vector) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Progress_Reports.FoldingRange.Partial_Result' + (Token => Token, + Params => Value)); + end On_FoldingRange_Partial_Result; + + overriding procedure On_Implementation_Partial_Result + (Self : in out Client_Message_Factory; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Definition_Progress_Report) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Progress_Reports.Implementation.Partial_Result' + (Token => Token, + Params => Value)); + end On_Implementation_Partial_Result; + + overriding procedure On_InlayHint_Partial_Result + (Self : in out Client_Message_Factory; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InlayHint_Vector) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Progress_Reports.InlayHint.Partial_Result' + (Token => Token, + Params => Value)); + end On_InlayHint_Partial_Result; + + overriding procedure On_InlineValue_Partial_Result + (Self : in out Client_Message_Factory; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InlineValue_Vector) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Progress_Reports.InlineValue.Partial_Result' + (Token => Token, + Params => Value)); + end On_InlineValue_Partial_Result; + + overriding procedure On_Moniker_Partial_Result + (Self : in out Client_Message_Factory; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Moniker_Vector) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Progress_Reports.Moniker.Partial_Result' + (Token => Token, + Params => Value)); + end On_Moniker_Partial_Result; + + overriding procedure On_References_Partial_Result + (Self : in out Client_Message_Factory; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Location_Vector) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Progress_Reports.References.Partial_Result' + (Token => Token, + Params => Value)); + end On_References_Partial_Result; + + overriding procedure On_SelectionRange_Partial_Result + (Self : in out Client_Message_Factory; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SelectionRange_Vector) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Progress_Reports.SelectionRange.Partial_Result' + (Token => Token, + Params => Value)); + end On_SelectionRange_Partial_Result; + + overriding procedure On_Full_Partial_Result + (Self : in out Client_Message_Factory; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SemanticTokensPartialResult) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Progress_Reports.Full.Partial_Result' + (Token => Token, + Params => Value)); + end On_Full_Partial_Result; + + overriding procedure On_Tokens_Delta_Partial_Result + (Self : in out Client_Message_Factory; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures + .SemanticTokensPartialResult_Or_SemanticTokensDeltaPartialResult) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Progress_Reports.Tokens_Delta.Partial_Result' + (Token => Token, + Params => Value)); + end On_Tokens_Delta_Partial_Result; + + overriding procedure On_Tokens_Range_Partial_Result + (Self : in out Client_Message_Factory; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SemanticTokensPartialResult) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Progress_Reports.Tokens_Range.Partial_Result' + (Token => Token, + Params => Value)); + end On_Tokens_Range_Partial_Result; + + overriding procedure On_TypeDefinition_Partial_Result + (Self : in out Client_Message_Factory; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Definition_Progress_Report) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Progress_Reports.TypeDefinition.Partial_Result' + (Token => Token, + Params => Value)); + end On_TypeDefinition_Partial_Result; + + overriding procedure On_Subtypes_Partial_Result + (Self : in out Client_Message_Factory; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TypeHierarchyItem_Vector) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Progress_Reports.Subtypes.Partial_Result' + (Token => Token, + Params => Value)); + end On_Subtypes_Partial_Result; + + overriding procedure On_Supertypes_Partial_Result + (Self : in out Client_Message_Factory; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TypeHierarchyItem_Vector) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Progress_Reports.Supertypes.Partial_Result' + (Token => Token, + Params => Value)); + end On_Supertypes_Partial_Result; + + overriding procedure On_Workspace_Diagnostic_Partial_Result + (Self : in out Client_Message_Factory; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceDiagnosticReportPartialResult) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Progress_Reports.Workspace_Diagnostic.Partial_Result' + (Token => Token, + Params => Value)); + end On_Workspace_Diagnostic_Partial_Result; + + overriding procedure On_Symbol_Partial_Result + (Self : in out Client_Message_Factory; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Symbol_Progress_Report) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Progress_Reports.Symbol.Partial_Result' + (Token => Token, + Params => Value)); + end On_Symbol_Partial_Result; + + overriding procedure On_ProgressBegin_Work_Done + (Self : in out Client_Message_Factory; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkDoneProgressBegin) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Progress_Reports.ProgressBegin.Work_Done' + (Token => Token, + Params => Value)); + end On_ProgressBegin_Work_Done; + + overriding procedure On_ProgressReport_Work_Done + (Self : in out Client_Message_Factory; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkDoneProgressReport) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Progress_Reports.ProgressReport.Work_Done' + (Token => Token, + Params => Value)); + end On_ProgressReport_Work_Done; + + overriding procedure On_ProgressEnd_Work_Done + (Self : in out Client_Message_Factory; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkDoneProgressEnd) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Progress_Reports.ProgressEnd.Work_Done' + (Token => Token, + Params => Value)); + end On_ProgressEnd_Work_Done; + +end LSP.Client_Message_Factories; diff --git a/source/lsp_3.17/generated/lsp-client_message_factories.ads b/source/lsp_3.17/generated/lsp-client_message_factories.ads new file mode 100644 index 000000000..8d2137d14 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_message_factories.ads @@ -0,0 +1,518 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Client_Message_Receivers; +with LSP.Client_Messages; +with LSP.Errors; +with LSP.Structures; + +package LSP.Client_Message_Factories is + pragma Preelaborate; + + type Client_Message_Factory is + abstract limited new LSP.Client_Message_Receivers + .Client_Message_Receiver with + null record; + + procedure On_Message + (Self : in out Client_Message_Factory; + Value : LSP.Client_Messages.Client_Message_Access) is abstract; + + overriding procedure On_Error_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Errors.ResponseError); + + overriding procedure On_LogTrace_Notification + (Self : in out Client_Message_Factory; + Value : LSP.Structures.LogTraceParams); + + overriding procedure On_Event_Notification + (Self : in out Client_Message_Factory; Value : LSP.Structures.LSPAny); + + overriding procedure On_PublishDiagnostics_Notification + (Self : in out Client_Message_Factory; + Value : LSP.Structures.PublishDiagnosticsParams); + + overriding procedure On_LogMessage_Notification + (Self : in out Client_Message_Factory; + Value : LSP.Structures.LogMessageParams); + + overriding procedure On_ShowMessage_Notification + (Self : in out Client_Message_Factory; + Value : LSP.Structures.ShowMessageParams); + + overriding procedure On_RegisterCapability_Request + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.RegistrationParams); + + overriding procedure On_UnregisterCapability_Request + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.UnregistrationParams); + + overriding procedure On_ShowDocument_Request + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ShowDocumentParams); + + overriding procedure On_ShowMessageRequest_Request + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ShowMessageRequestParams); + + overriding procedure On_Progress_Create_Request + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkDoneProgressCreateParams); + + overriding procedure On_ApplyEdit_Request + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ApplyWorkspaceEditParams); + + overriding procedure On_Code_Lens_Refresh_Request + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String); + + overriding procedure On_Configuration_Request + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ConfigurationParams); + + overriding procedure On_Diagnostic_Refresh_Request + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String); + + overriding procedure On_Inlay_Refresh_Request + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String); + + overriding procedure On_Inline_Refresh_Request + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String); + + overriding procedure On_Tokens_Refresh_Request + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String); + + overriding procedure On_WorkspaceFolders_Request + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String); + + overriding procedure On_IncomingCalls_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CallHierarchyIncomingCall_Vector_Or_Null); + + overriding procedure On_OutgoingCalls_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CallHierarchyOutgoingCall_Vector_Or_Null); + + overriding procedure On_Code_Action_Resolve_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CodeAction); + + overriding procedure On_Code_Lens_Resolve_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CodeLens); + + overriding procedure On_Completion_Resolve_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CompletionItem); + + overriding procedure On_Link_Resolve_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentLink); + + overriding procedure On_Initialize_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InitializeResult); + + overriding procedure On_Inlay_Resolve_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InlayHint); + + overriding procedure On_Shutdown_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Null_Record); + + overriding procedure On_CodeAction_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Command_Or_CodeAction_Vector_Or_Null); + + overriding procedure On_CodeLens_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CodeLens_Vector_Or_Null); + + overriding procedure On_ColorPresentation_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ColorPresentation_Vector); + + overriding procedure On_Completion_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Completion_Result); + + overriding procedure On_Declaration_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Declaration_Result); + + overriding procedure On_Definition_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Definition_Result); + + overriding procedure On_Diagnostic_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentDiagnosticReport); + + overriding procedure On_DocumentColor_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ColorInformation_Vector); + + overriding procedure On_DocumentHighlight_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentHighlight_Vector_Or_Null); + + overriding procedure On_DocumentLink_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentLink_Vector_Or_Null); + + overriding procedure On_DocumentSymbol_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentSymbol_Result); + + overriding procedure On_FoldingRange_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.FoldingRange_Vector_Or_Null); + + overriding procedure On_Formatting_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TextEdit_Vector_Or_Null); + + overriding procedure On_Hover_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Hover_Or_Null); + + overriding procedure On_Implementation_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Definition_Result); + + overriding procedure On_InlayHint_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InlayHint_Vector_Or_Null); + + overriding procedure On_InlineValue_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InlineValue_Vector_Or_Null); + + overriding procedure On_LinkedEditingRange_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.LinkedEditingRanges_Or_Null); + + overriding procedure On_Moniker_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Moniker_Vector_Or_Null); + + overriding procedure On_OnTypeFormatting_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TextEdit_Vector_Or_Null); + + overriding procedure On_PrepareCallHierarchy_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CallHierarchyItem_Vector_Or_Null); + + overriding procedure On_PrepareRename_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.PrepareRenameResult_Or_Null); + + overriding procedure On_PrepareTypeHierarchy_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TypeHierarchyItem_Vector_Or_Null); + + overriding procedure On_RangeFormatting_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TextEdit_Vector_Or_Null); + + overriding procedure On_References_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Location_Vector_Or_Null); + + overriding procedure On_Rename_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceEdit_Or_Null); + + overriding procedure On_SelectionRange_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SelectionRange_Vector_Or_Null); + + overriding procedure On_Full_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SemanticTokens_Or_Null); + + overriding procedure On_Tokens_Delta_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Tokens_Delta_Result); + + overriding procedure On_Tokens_Range_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SemanticTokens_Or_Null); + + overriding procedure On_SignatureHelp_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SignatureHelp_Or_Null); + + overriding procedure On_TypeDefinition_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Definition_Result); + + overriding procedure On_WillSaveWaitUntil_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TextEdit_Vector_Or_Null); + + overriding procedure On_Subtypes_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TypeHierarchyItem_Vector_Or_Null); + + overriding procedure On_Supertypes_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TypeHierarchyItem_Vector_Or_Null); + + overriding procedure On_Workspace_Diagnostic_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceDiagnosticReport); + + overriding procedure On_ExecuteCommand_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.LSPAny_Or_Null); + + overriding procedure On_Symbol_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Symbol_Result); + + overriding procedure On_WillCreateFiles_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceEdit_Or_Null); + + overriding procedure On_WillDeleteFiles_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceEdit_Or_Null); + + overriding procedure On_WillRenameFiles_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceEdit_Or_Null); + + overriding procedure On_Symbol_Resolve_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceSymbol); + + overriding procedure On_IncomingCalls_Partial_Result + (Self : in out Client_Message_Factory; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CallHierarchyIncomingCall_Vector); + + overriding procedure On_OutgoingCalls_Partial_Result + (Self : in out Client_Message_Factory; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CallHierarchyOutgoingCall_Vector); + + overriding procedure On_CodeAction_Partial_Result + (Self : in out Client_Message_Factory; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Command_Or_CodeAction_Vector); + + overriding procedure On_CodeLens_Partial_Result + (Self : in out Client_Message_Factory; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CodeLens_Vector); + + overriding procedure On_ColorPresentation_Partial_Result + (Self : in out Client_Message_Factory; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ColorPresentation_Vector); + + overriding procedure On_Completion_Partial_Result + (Self : in out Client_Message_Factory; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CompletionItem_Vector); + + overriding procedure On_Declaration_Partial_Result + (Self : in out Client_Message_Factory; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Declaration_Progress_Report); + + overriding procedure On_Definition_Partial_Result + (Self : in out Client_Message_Factory; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Definition_Progress_Report); + + overriding procedure On_Diagnostic_Partial_Result + (Self : in out Client_Message_Factory; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentDiagnosticReportPartialResult); + + overriding procedure On_DocumentColor_Partial_Result + (Self : in out Client_Message_Factory; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ColorInformation_Vector); + + overriding procedure On_DocumentHighlight_Partial_Result + (Self : in out Client_Message_Factory; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentHighlight_Vector); + + overriding procedure On_DocumentLink_Partial_Result + (Self : in out Client_Message_Factory; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentLink_Vector); + + overriding procedure On_DocumentSymbol_Partial_Result + (Self : in out Client_Message_Factory; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentSymbol_Progress_Report); + + overriding procedure On_FoldingRange_Partial_Result + (Self : in out Client_Message_Factory; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.FoldingRange_Vector); + + overriding procedure On_Implementation_Partial_Result + (Self : in out Client_Message_Factory; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Definition_Progress_Report); + + overriding procedure On_InlayHint_Partial_Result + (Self : in out Client_Message_Factory; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InlayHint_Vector); + + overriding procedure On_InlineValue_Partial_Result + (Self : in out Client_Message_Factory; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InlineValue_Vector); + + overriding procedure On_Moniker_Partial_Result + (Self : in out Client_Message_Factory; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Moniker_Vector); + + overriding procedure On_References_Partial_Result + (Self : in out Client_Message_Factory; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Location_Vector); + + overriding procedure On_SelectionRange_Partial_Result + (Self : in out Client_Message_Factory; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SelectionRange_Vector); + + overriding procedure On_Full_Partial_Result + (Self : in out Client_Message_Factory; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SemanticTokensPartialResult); + + overriding procedure On_Tokens_Delta_Partial_Result + (Self : in out Client_Message_Factory; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures + .SemanticTokensPartialResult_Or_SemanticTokensDeltaPartialResult); + + overriding procedure On_Tokens_Range_Partial_Result + (Self : in out Client_Message_Factory; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SemanticTokensPartialResult); + + overriding procedure On_TypeDefinition_Partial_Result + (Self : in out Client_Message_Factory; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Definition_Progress_Report); + + overriding procedure On_Subtypes_Partial_Result + (Self : in out Client_Message_Factory; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TypeHierarchyItem_Vector); + + overriding procedure On_Supertypes_Partial_Result + (Self : in out Client_Message_Factory; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TypeHierarchyItem_Vector); + + overriding procedure On_Workspace_Diagnostic_Partial_Result + (Self : in out Client_Message_Factory; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceDiagnosticReportPartialResult); + + overriding procedure On_Symbol_Partial_Result + (Self : in out Client_Message_Factory; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Symbol_Progress_Report); + + overriding procedure On_ProgressBegin_Work_Done + (Self : in out Client_Message_Factory; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkDoneProgressBegin); + + overriding procedure On_ProgressReport_Work_Done + (Self : in out Client_Message_Factory; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkDoneProgressReport); + + overriding procedure On_ProgressEnd_Work_Done + (Self : in out Client_Message_Factory; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkDoneProgressEnd); + +end LSP.Client_Message_Factories; diff --git a/source/lsp_3.17/generated/lsp-client_notification_readers.adb b/source/lsp_3.17/generated/lsp-client_notification_readers.adb new file mode 100644 index 000000000..710ae291a --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_notification_readers.adb @@ -0,0 +1,114 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with Minimal_Perfect_Hash; +with LSP.Inputs; +with LSP.Input_Tools; +with LSP.Structures; + +with LSP.Client_Notifications.CancelRequest; +with LSP.Client_Notifications.LogTrace; +with LSP.Client_Notifications.Progress; +with LSP.Client_Notifications.Event; +with LSP.Client_Notifications.PublishDiagnostics; +with LSP.Client_Notifications.LogMessage; +with LSP.Client_Notifications.ShowMessage; + +package body LSP.Client_Notification_Readers is + + package Method_Map is new Minimal_Perfect_Hash + (["$/cancelRequest", + "$/logTrace", + "$/progress", + "telemetry/event", + "textDocument/publishDiagnostics", + "window/logMessage", + "window/showMessage"]); + + procedure Initialize is + begin + Method_Map.Initialize; + end Initialize; + + procedure Read_CancelRequest is new LSP.Input_Tools.Read_Notification + (LSP.Structures.CancelParams, "$/cancelRequest", + LSP.Inputs.Read_CancelParams); + + procedure Read_LogTrace is new LSP.Input_Tools.Read_Notification + (LSP.Structures.LogTraceParams, "$/logTrace", + LSP.Inputs.Read_LogTraceParams); + + procedure Read_Progress is new LSP.Input_Tools.Read_Notification + (LSP.Structures.ProgressParams, "$/progress", + LSP.Inputs.Read_ProgressParams); + + procedure Read_Event is new LSP.Input_Tools.Read_Notification + (LSP.Structures.LSPAny, "telemetry/event", LSP.Input_Tools.Read_LSPAny); + + procedure Read_PublishDiagnostics is new LSP.Input_Tools.Read_Notification + (LSP.Structures.PublishDiagnosticsParams, + "textDocument/publishDiagnostics", + LSP.Inputs.Read_PublishDiagnosticsParams); + + procedure Read_LogMessage is new LSP.Input_Tools.Read_Notification + (LSP.Structures.LogMessageParams, "window/logMessage", + LSP.Inputs.Read_LogMessageParams); + + procedure Read_ShowMessage is new LSP.Input_Tools.Read_Notification + (LSP.Structures.ShowMessageParams, "window/showMessage", + LSP.Inputs.Read_ShowMessageParams); + + function Read_Notification + (Input : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Method : VSS.Strings.Virtual_String) + return LSP.Client_Notifications.Client_Notification'Class is + Index : constant Natural := Method_Map.Get_Index (Method); + begin + case Index is + when 1 => -- $/cancelRequest + return + Result : LSP.Client_Notifications.CancelRequest.Notification do + Read_CancelRequest (Input, Result.Params); + end return; + + when 2 => -- $/logTrace + return Result : LSP.Client_Notifications.LogTrace.Notification do + Read_LogTrace (Input, Result.Params); + end return; + + when 3 => -- $/progress + return Result : LSP.Client_Notifications.Progress.Notification do + Read_Progress (Input, Result.Params); + end return; + + when 4 => -- telemetry/event + return Result : LSP.Client_Notifications.Event.Notification do + Read_Event (Input, Result.Params); + end return; + + when 5 => -- textDocument/publishDiagnostics + return + Result : LSP.Client_Notifications.PublishDiagnostics.Notification + do + Read_PublishDiagnostics (Input, Result.Params); + end return; + + when 6 => -- window/logMessage + return Result : LSP.Client_Notifications.LogMessage.Notification do + Read_LogMessage (Input, Result.Params); + end return; + + when 7 => -- window/showMessage + return + Result : LSP.Client_Notifications.ShowMessage.Notification do + Read_ShowMessage (Input, Result.Params); + end return; + + when others => + return raise Program_Error with "Unknown method"; + end case; + end Read_Notification; +end LSP.Client_Notification_Readers; diff --git a/source/lsp_3.17/generated/lsp-client_notification_receivers.ads b/source/lsp_3.17/generated/lsp-client_notification_receivers.ads new file mode 100644 index 000000000..14eddc380 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_notification_receivers.ads @@ -0,0 +1,45 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Base_Notification_Receivers; +with LSP.Structures; + +package LSP.Client_Notification_Receivers is + pragma Preelaborate; + + type Client_Notification_Receiver is + limited interface and + LSP.Base_Notification_Receivers.Base_Notification_Receiver; + + procedure On_LogTrace_Notification + (Self : in out Client_Notification_Receiver; + Value : LSP.Structures.LogTraceParams) is null; + + procedure On_Event_Notification + (Self : in out Client_Notification_Receiver; + Value : LSP.Structures.LSPAny) is null; + -- The telemetry event notification is sent from the server to the client + -- to ask the client to log telemetry data. + + procedure On_PublishDiagnostics_Notification + (Self : in out Client_Notification_Receiver; + Value : LSP.Structures.PublishDiagnosticsParams) is null; + -- Diagnostics notification are sent from the server to the client to + -- signal results of validation runs. + + procedure On_LogMessage_Notification + (Self : in out Client_Notification_Receiver; + Value : LSP.Structures.LogMessageParams) is null; + -- The log message notification is sent from the server to the client to + -- ask the client to log a particular message. + + procedure On_ShowMessage_Notification + (Self : in out Client_Notification_Receiver; + Value : LSP.Structures.ShowMessageParams) is null; + -- The show message notification is sent from a server to a client to ask + -- the client to display a particular message in the user interface. + +end LSP.Client_Notification_Receivers; diff --git a/source/lsp_3.17/generated/lsp-client_notification_writers.adb b/source/lsp_3.17/generated/lsp-client_notification_writers.adb new file mode 100644 index 000000000..647d1999f --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_notification_writers.adb @@ -0,0 +1,68 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with VSS.JSON.Content_Handlers; +with LSP.Output_Tools; +with LSP.Outputs; + +package body LSP.Client_Notification_Writers is + + overriding procedure On_LogTrace_Notification + (Self : in out Client_Notification_Writer; + Value : LSP.Structures.LogTraceParams) is + begin + LSP.Output_Tools.Write_Start_Notification + (Self.Output.all, "$/logTrace"); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_LogTraceParams (Self.Output.all, Value); + Self.Output.End_Object; + end On_LogTrace_Notification; + + overriding procedure On_Event_Notification + (Self : in out Client_Notification_Writer; + Value : LSP.Structures.LSPAny) is + begin + LSP.Output_Tools.Write_Start_Notification + (Self.Output.all, "telemetry/event"); + Self.Output.Key_Name ("params"); + LSP.Output_Tools.Write_LSPAny (Self.Output.all, Value); + Self.Output.End_Object; + end On_Event_Notification; + + overriding procedure On_PublishDiagnostics_Notification + (Self : in out Client_Notification_Writer; + Value : LSP.Structures.PublishDiagnosticsParams) is + begin + LSP.Output_Tools.Write_Start_Notification + (Self.Output.all, "textDocument/publishDiagnostics"); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_PublishDiagnosticsParams (Self.Output.all, Value); + Self.Output.End_Object; + end On_PublishDiagnostics_Notification; + + overriding procedure On_LogMessage_Notification + (Self : in out Client_Notification_Writer; + Value : LSP.Structures.LogMessageParams) is + begin + LSP.Output_Tools.Write_Start_Notification + (Self.Output.all, "window/logMessage"); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_LogMessageParams (Self.Output.all, Value); + Self.Output.End_Object; + end On_LogMessage_Notification; + + overriding procedure On_ShowMessage_Notification + (Self : in out Client_Notification_Writer; + Value : LSP.Structures.ShowMessageParams) is + begin + LSP.Output_Tools.Write_Start_Notification + (Self.Output.all, "window/showMessage"); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_ShowMessageParams (Self.Output.all, Value); + Self.Output.End_Object; + end On_ShowMessage_Notification; + +end LSP.Client_Notification_Writers; diff --git a/source/lsp_3.17/generated/lsp-client_notification_writers.ads b/source/lsp_3.17/generated/lsp-client_notification_writers.ads new file mode 100644 index 000000000..1a34d1e30 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_notification_writers.ads @@ -0,0 +1,38 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Base_Notification_Writers; +with LSP.Structures; +with LSP.Client_Notification_Receivers; + +package LSP.Client_Notification_Writers is + pragma Preelaborate; + + type Client_Notification_Writer is + new LSP.Base_Notification_Writers.Base_Notification_Writer and + LSP.Client_Notification_Receivers.Client_Notification_Receiver with + null record; + + overriding procedure On_LogTrace_Notification + (Self : in out Client_Notification_Writer; + Value : LSP.Structures.LogTraceParams); + + overriding procedure On_Event_Notification + (Self : in out Client_Notification_Writer; Value : LSP.Structures.LSPAny); + + overriding procedure On_PublishDiagnostics_Notification + (Self : in out Client_Notification_Writer; + Value : LSP.Structures.PublishDiagnosticsParams); + + overriding procedure On_LogMessage_Notification + (Self : in out Client_Notification_Writer; + Value : LSP.Structures.LogMessageParams); + + overriding procedure On_ShowMessage_Notification + (Self : in out Client_Notification_Writer; + Value : LSP.Structures.ShowMessageParams); + +end LSP.Client_Notification_Writers; diff --git a/source/lsp_3.17/generated/lsp-client_notifications-cancelrequest.adb b/source/lsp_3.17/generated/lsp-client_notifications-cancelrequest.adb new file mode 100644 index 000000000..a5322bc4a --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_notifications-cancelrequest.adb @@ -0,0 +1,18 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Client_Notifications.CancelRequest is + + overriding procedure Visit_Client_Receiver + (Self : Notification; + Value : in out LSP.Client_Notification_Receivers + .Client_Notification_Receiver' + Class) is + begin + Value.On_CancelRequest_Notification (Self.Params); + end Visit_Client_Receiver; + +end LSP.Client_Notifications.CancelRequest; diff --git a/source/lsp_3.17/generated/lsp-client_notifications-cancelrequest.ads b/source/lsp_3.17/generated/lsp-client_notifications-cancelrequest.ads new file mode 100644 index 000000000..d1b2e649f --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_notifications-cancelrequest.ads @@ -0,0 +1,23 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Client_Notifications.CancelRequest is + pragma Preelaborate; + + type Notification is + new LSP.Client_Notifications.Client_Notification with record + Params : LSP.Structures.CancelParams; + end record; + + overriding procedure Visit_Client_Receiver + (Self : Notification; + Value : in out LSP.Client_Notification_Receivers + .Client_Notification_Receiver' + Class); + +end LSP.Client_Notifications.CancelRequest; diff --git a/source/lsp_3.17/generated/lsp-client_notifications-event.adb b/source/lsp_3.17/generated/lsp-client_notifications-event.adb new file mode 100644 index 000000000..ccdaa3fc6 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_notifications-event.adb @@ -0,0 +1,18 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Client_Notifications.Event is + + overriding procedure Visit_Client_Receiver + (Self : Notification; + Value : in out LSP.Client_Notification_Receivers + .Client_Notification_Receiver' + Class) is + begin + Value.On_Event_Notification (Self.Params); + end Visit_Client_Receiver; + +end LSP.Client_Notifications.Event; diff --git a/source/lsp_3.17/generated/lsp-client_notifications-event.ads b/source/lsp_3.17/generated/lsp-client_notifications-event.ads new file mode 100644 index 000000000..209a5c12a --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_notifications-event.ads @@ -0,0 +1,23 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Client_Notifications.Event is + pragma Preelaborate; + + type Notification is + new LSP.Client_Notifications.Client_Notification with record + Params : LSP.Structures.LSPAny; + end record; + + overriding procedure Visit_Client_Receiver + (Self : Notification; + Value : in out LSP.Client_Notification_Receivers + .Client_Notification_Receiver' + Class); + +end LSP.Client_Notifications.Event; diff --git a/source/lsp_3.17/generated/lsp-client_notifications-logmessage.adb b/source/lsp_3.17/generated/lsp-client_notifications-logmessage.adb new file mode 100644 index 000000000..1ea0eaf74 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_notifications-logmessage.adb @@ -0,0 +1,18 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Client_Notifications.LogMessage is + + overriding procedure Visit_Client_Receiver + (Self : Notification; + Value : in out LSP.Client_Notification_Receivers + .Client_Notification_Receiver' + Class) is + begin + Value.On_LogMessage_Notification (Self.Params); + end Visit_Client_Receiver; + +end LSP.Client_Notifications.LogMessage; diff --git a/source/lsp_3.17/generated/lsp-client_notifications-logmessage.ads b/source/lsp_3.17/generated/lsp-client_notifications-logmessage.ads new file mode 100644 index 000000000..73c80383d --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_notifications-logmessage.ads @@ -0,0 +1,23 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Client_Notifications.LogMessage is + pragma Preelaborate; + + type Notification is + new LSP.Client_Notifications.Client_Notification with record + Params : LSP.Structures.LogMessageParams; + end record; + + overriding procedure Visit_Client_Receiver + (Self : Notification; + Value : in out LSP.Client_Notification_Receivers + .Client_Notification_Receiver' + Class); + +end LSP.Client_Notifications.LogMessage; diff --git a/source/lsp_3.17/generated/lsp-client_notifications-logtrace.adb b/source/lsp_3.17/generated/lsp-client_notifications-logtrace.adb new file mode 100644 index 000000000..ee848af4a --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_notifications-logtrace.adb @@ -0,0 +1,18 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Client_Notifications.LogTrace is + + overriding procedure Visit_Client_Receiver + (Self : Notification; + Value : in out LSP.Client_Notification_Receivers + .Client_Notification_Receiver' + Class) is + begin + Value.On_LogTrace_Notification (Self.Params); + end Visit_Client_Receiver; + +end LSP.Client_Notifications.LogTrace; diff --git a/source/lsp_3.17/generated/lsp-client_notifications-logtrace.ads b/source/lsp_3.17/generated/lsp-client_notifications-logtrace.ads new file mode 100644 index 000000000..903a7265c --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_notifications-logtrace.ads @@ -0,0 +1,23 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Client_Notifications.LogTrace is + pragma Preelaborate; + + type Notification is + new LSP.Client_Notifications.Client_Notification with record + Params : LSP.Structures.LogTraceParams; + end record; + + overriding procedure Visit_Client_Receiver + (Self : Notification; + Value : in out LSP.Client_Notification_Receivers + .Client_Notification_Receiver' + Class); + +end LSP.Client_Notifications.LogTrace; diff --git a/source/lsp_3.17/generated/lsp-client_notifications-progress.adb b/source/lsp_3.17/generated/lsp-client_notifications-progress.adb new file mode 100644 index 000000000..ab15a7850 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_notifications-progress.adb @@ -0,0 +1,18 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Client_Notifications.Progress is + + overriding procedure Visit_Client_Receiver + (Self : Notification; + Value : in out LSP.Client_Notification_Receivers + .Client_Notification_Receiver' + Class) is + begin + Value.On_Progress_Notification (Self.Params); + end Visit_Client_Receiver; + +end LSP.Client_Notifications.Progress; diff --git a/source/lsp_3.17/generated/lsp-client_notifications-progress.ads b/source/lsp_3.17/generated/lsp-client_notifications-progress.ads new file mode 100644 index 000000000..d45eb77f5 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_notifications-progress.ads @@ -0,0 +1,23 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Client_Notifications.Progress is + pragma Preelaborate; + + type Notification is + new LSP.Client_Notifications.Client_Notification with record + Params : LSP.Structures.ProgressParams; + end record; + + overriding procedure Visit_Client_Receiver + (Self : Notification; + Value : in out LSP.Client_Notification_Receivers + .Client_Notification_Receiver' + Class); + +end LSP.Client_Notifications.Progress; diff --git a/source/lsp_3.17/generated/lsp-client_notifications-publishdiagnostics.adb b/source/lsp_3.17/generated/lsp-client_notifications-publishdiagnostics.adb new file mode 100644 index 000000000..795537458 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_notifications-publishdiagnostics.adb @@ -0,0 +1,18 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Client_Notifications.PublishDiagnostics is + + overriding procedure Visit_Client_Receiver + (Self : Notification; + Value : in out LSP.Client_Notification_Receivers + .Client_Notification_Receiver' + Class) is + begin + Value.On_PublishDiagnostics_Notification (Self.Params); + end Visit_Client_Receiver; + +end LSP.Client_Notifications.PublishDiagnostics; diff --git a/source/lsp_3.17/generated/lsp-client_notifications-publishdiagnostics.ads b/source/lsp_3.17/generated/lsp-client_notifications-publishdiagnostics.ads new file mode 100644 index 000000000..7cfffbff1 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_notifications-publishdiagnostics.ads @@ -0,0 +1,23 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Client_Notifications.PublishDiagnostics is + pragma Preelaborate; + + type Notification is + new LSP.Client_Notifications.Client_Notification with record + Params : LSP.Structures.PublishDiagnosticsParams; + end record; + + overriding procedure Visit_Client_Receiver + (Self : Notification; + Value : in out LSP.Client_Notification_Receivers + .Client_Notification_Receiver' + Class); + +end LSP.Client_Notifications.PublishDiagnostics; diff --git a/source/lsp_3.17/generated/lsp-client_notifications-showmessage.adb b/source/lsp_3.17/generated/lsp-client_notifications-showmessage.adb new file mode 100644 index 000000000..e199737a0 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_notifications-showmessage.adb @@ -0,0 +1,18 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Client_Notifications.ShowMessage is + + overriding procedure Visit_Client_Receiver + (Self : Notification; + Value : in out LSP.Client_Notification_Receivers + .Client_Notification_Receiver' + Class) is + begin + Value.On_ShowMessage_Notification (Self.Params); + end Visit_Client_Receiver; + +end LSP.Client_Notifications.ShowMessage; diff --git a/source/lsp_3.17/generated/lsp-client_notifications-showmessage.ads b/source/lsp_3.17/generated/lsp-client_notifications-showmessage.ads new file mode 100644 index 000000000..9bef1af2f --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_notifications-showmessage.ads @@ -0,0 +1,23 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Client_Notifications.ShowMessage is + pragma Preelaborate; + + type Notification is + new LSP.Client_Notifications.Client_Notification with record + Params : LSP.Structures.ShowMessageParams; + end record; + + overriding procedure Visit_Client_Receiver + (Self : Notification; + Value : in out LSP.Client_Notification_Receivers + .Client_Notification_Receiver' + Class); + +end LSP.Client_Notifications.ShowMessage; diff --git a/source/lsp_3.17/generated/lsp-client_request_readers.adb b/source/lsp_3.17/generated/lsp-client_request_readers.adb new file mode 100644 index 000000000..b4e450606 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_request_readers.adb @@ -0,0 +1,225 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with Minimal_Perfect_Hash; +with LSP.Inputs; +with LSP.Input_Tools; +with LSP.Structures; + +with LSP.Client_Requests.RegisterCapability; +with LSP.Client_Requests.UnregisterCapability; +with LSP.Client_Requests.ShowDocument; +with LSP.Client_Requests.ShowMessageRequest; +with LSP.Client_Requests.Progress_Create; +with LSP.Client_Requests.ApplyEdit; +with LSP.Client_Requests.Code_Lens_Refresh; +with LSP.Client_Requests.Configuration; +with LSP.Client_Requests.Diagnostic_Refresh; +with LSP.Client_Requests.Inlay_Refresh; +with LSP.Client_Requests.Inline_Refresh; +with LSP.Client_Requests.Tokens_Refresh; +with LSP.Client_Requests.WorkspaceFolders; + +package body LSP.Client_Request_Readers is + + package Method_Map is new Minimal_Perfect_Hash + (["client/registerCapability", + "client/unregisterCapability", + "window/showDocument", + "window/showMessageRequest", + "window/workDoneProgress/create", + "workspace/applyEdit", + "workspace/codeLens/refresh", + "workspace/configuration", + "workspace/diagnostic/refresh", + "workspace/inlayHint/refresh", + "workspace/inlineValue/refresh", + "workspace/semanticTokens/refresh", + "workspace/workspaceFolders"]); + + procedure Initialize is + begin + Method_Map.Initialize; + end Initialize; + + procedure Read_RegisterCapability is new LSP.Input_Tools.Read_Request + (LSP.Structures.RegistrationParams, "client/registerCapability", + LSP.Inputs.Read_RegistrationParams); + + procedure Read_UnregisterCapability is new LSP.Input_Tools.Read_Request + (LSP.Structures.UnregistrationParams, "client/unregisterCapability", + LSP.Inputs.Read_UnregistrationParams); + + procedure Read_ShowDocument is new LSP.Input_Tools.Read_Request + (LSP.Structures.ShowDocumentParams, "window/showDocument", + LSP.Inputs.Read_ShowDocumentParams); + + procedure Read_ShowMessageRequest is new LSP.Input_Tools.Read_Request + (LSP.Structures.ShowMessageRequestParams, "window/showMessageRequest", + LSP.Inputs.Read_ShowMessageRequestParams); + + procedure Read_Progress_Create is new LSP.Input_Tools.Read_Request + (LSP.Structures.WorkDoneProgressCreateParams, + "window/workDoneProgress/create", + LSP.Inputs.Read_WorkDoneProgressCreateParams); + + procedure Read_ApplyEdit is new LSP.Input_Tools.Read_Request + (LSP.Structures.ApplyWorkspaceEditParams, "workspace/applyEdit", + LSP.Inputs.Read_ApplyWorkspaceEditParams); + + procedure Read_Code_Lens_Refresh + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Id : in out LSP.Structures.Integer_Or_Virtual_String); + + procedure Read_Code_Lens_Refresh + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Id : in out LSP.Structures.Integer_Or_Virtual_String) is + begin + LSP.Input_Tools.Read_Null_Request + (Handler, "workspace/codeLens/refresh", Id); + end Read_Code_Lens_Refresh; + + procedure Read_Configuration is new LSP.Input_Tools.Read_Request + (LSP.Structures.ConfigurationParams, "workspace/configuration", + LSP.Inputs.Read_ConfigurationParams); + + procedure Read_Diagnostic_Refresh + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Id : in out LSP.Structures.Integer_Or_Virtual_String); + + procedure Read_Diagnostic_Refresh + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Id : in out LSP.Structures.Integer_Or_Virtual_String) is + begin + LSP.Input_Tools.Read_Null_Request + (Handler, "workspace/diagnostic/refresh", Id); + end Read_Diagnostic_Refresh; + + procedure Read_Inlay_Refresh + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Id : in out LSP.Structures.Integer_Or_Virtual_String); + + procedure Read_Inlay_Refresh + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Id : in out LSP.Structures.Integer_Or_Virtual_String) is + begin + LSP.Input_Tools.Read_Null_Request + (Handler, "workspace/inlayHint/refresh", Id); + end Read_Inlay_Refresh; + + procedure Read_Inline_Refresh + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Id : in out LSP.Structures.Integer_Or_Virtual_String); + + procedure Read_Inline_Refresh + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Id : in out LSP.Structures.Integer_Or_Virtual_String) is + begin + LSP.Input_Tools.Read_Null_Request + (Handler, "workspace/inlineValue/refresh", Id); + end Read_Inline_Refresh; + + procedure Read_Tokens_Refresh + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Id : in out LSP.Structures.Integer_Or_Virtual_String); + + procedure Read_Tokens_Refresh + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Id : in out LSP.Structures.Integer_Or_Virtual_String) is + begin + LSP.Input_Tools.Read_Null_Request + (Handler, "workspace/semanticTokens/refresh", Id); + end Read_Tokens_Refresh; + + procedure Read_WorkspaceFolders + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Id : in out LSP.Structures.Integer_Or_Virtual_String); + + procedure Read_WorkspaceFolders + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Id : in out LSP.Structures.Integer_Or_Virtual_String) is + begin + LSP.Input_Tools.Read_Null_Request + (Handler, "workspace/workspaceFolders", Id); + end Read_WorkspaceFolders; + + function Read_Request + (Input : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Method : VSS.Strings.Virtual_String) + return LSP.Client_Requests.Client_Request'Class is + Index : constant Natural := Method_Map.Get_Index (Method); + begin + case Index is + when 1 => -- client/registerCapability + return Result : LSP.Client_Requests.RegisterCapability.Request do + Read_RegisterCapability (Input, Result.Id, Result.Params); + end return; + + when 2 => -- client/unregisterCapability + return Result : LSP.Client_Requests.UnregisterCapability.Request do + Read_UnregisterCapability (Input, Result.Id, Result.Params); + end return; + + when 3 => -- window/showDocument + return Result : LSP.Client_Requests.ShowDocument.Request do + Read_ShowDocument (Input, Result.Id, Result.Params); + end return; + + when 4 => -- window/showMessageRequest + return Result : LSP.Client_Requests.ShowMessageRequest.Request do + Read_ShowMessageRequest (Input, Result.Id, Result.Params); + end return; + + when 5 => -- window/workDoneProgress/create + return Result : LSP.Client_Requests.Progress_Create.Request do + Read_Progress_Create (Input, Result.Id, Result.Params); + end return; + + when 6 => -- workspace/applyEdit + return Result : LSP.Client_Requests.ApplyEdit.Request do + Read_ApplyEdit (Input, Result.Id, Result.Params); + end return; + + when 7 => -- workspace/codeLens/refresh + return Result : LSP.Client_Requests.Code_Lens_Refresh.Request do + Read_Code_Lens_Refresh (Input, Result.Id); + end return; + + when 8 => -- workspace/configuration + return Result : LSP.Client_Requests.Configuration.Request do + Read_Configuration (Input, Result.Id, Result.Params); + end return; + + when 9 => -- workspace/diagnostic/refresh + return Result : LSP.Client_Requests.Diagnostic_Refresh.Request do + Read_Diagnostic_Refresh (Input, Result.Id); + end return; + + when 10 => -- workspace/inlayHint/refresh + return Result : LSP.Client_Requests.Inlay_Refresh.Request do + Read_Inlay_Refresh (Input, Result.Id); + end return; + + when 11 => -- workspace/inlineValue/refresh + return Result : LSP.Client_Requests.Inline_Refresh.Request do + Read_Inline_Refresh (Input, Result.Id); + end return; + + when 12 => -- workspace/semanticTokens/refresh + return Result : LSP.Client_Requests.Tokens_Refresh.Request do + Read_Tokens_Refresh (Input, Result.Id); + end return; + + when 13 => -- workspace/workspaceFolders + return Result : LSP.Client_Requests.WorkspaceFolders.Request do + Read_WorkspaceFolders (Input, Result.Id); + end return; + + when others => + return raise Program_Error with "Unknown method"; + end case; + end Read_Request; +end LSP.Client_Request_Readers; diff --git a/source/lsp_3.17/generated/lsp-client_request_receivers.ads b/source/lsp_3.17/generated/lsp-client_request_receivers.ads new file mode 100644 index 000000000..fd4974240 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_request_receivers.ads @@ -0,0 +1,110 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Client_Request_Receivers is + pragma Preelaborate; + + type Client_Request_Receiver is limited interface; + + procedure On_RegisterCapability_Request + (Self : in out Client_Request_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.RegistrationParams) is null; + -- The `client/registerCapability` request is sent from the server to the + -- client to register a new capability handler on the client side. + + procedure On_UnregisterCapability_Request + (Self : in out Client_Request_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.UnregistrationParams) is null; + -- The `client/unregisterCapability` request is sent from the server to the + -- client to unregister a previously registered capability handler on the + -- client side. + + procedure On_ShowDocument_Request + (Self : in out Client_Request_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ShowDocumentParams) is null; + -- A request to show a document. This request might open an external + -- program depending on the value of the URI to open. For example a request + -- to open `https://code.visualstudio.com/` will very likely open the URI + -- in a WEB browser. + -- + -- @since 3.16.0 + + procedure On_ShowMessageRequest_Request + (Self : in out Client_Request_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ShowMessageRequestParams) is null; + -- The show message request is sent from the server to the client to show a + -- message and a set of options actions to the user. + + procedure On_Progress_Create_Request + (Self : in out Client_Request_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkDoneProgressCreateParams) is null; + -- The `window/workDoneProgress/create` request is sent from the server to + -- the client to initiate progress reporting from the server. + + procedure On_ApplyEdit_Request + (Self : in out Client_Request_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ApplyWorkspaceEditParams) is null; + -- A request sent from the server to the client to modified certain + -- resources. + + procedure On_Code_Lens_Refresh_Request + (Self : in out Client_Request_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String) is null; + -- A request to refresh all code actions + -- + -- @since 3.16.0 + + procedure On_Configuration_Request + (Self : in out Client_Request_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ConfigurationParams) is null; + -- The 'workspace/configuration' request is sent from the server to the + -- client to fetch a certain configuration setting. + -- + -- This pull model replaces the old push model were the client signaled + -- configuration change via an event. If the server still needs to + -- react to configuration changes (since the server caches the result of + -- `workspace/configuration` requests) the server should register for an + -- empty configuration change event and empty the cache if such an event + -- is received. + + procedure On_Diagnostic_Refresh_Request + (Self : in out Client_Request_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String) is null; + -- The diagnostic refresh request definition. + -- + -- @since 3.17.0 + + procedure On_Inlay_Refresh_Request + (Self : in out Client_Request_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String) is null; + -- @since 3.17.0 + + procedure On_Inline_Refresh_Request + (Self : in out Client_Request_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String) is null; + -- @since 3.17.0 + + procedure On_Tokens_Refresh_Request + (Self : in out Client_Request_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String) is null; + -- @since 3.16.0 + + procedure On_WorkspaceFolders_Request + (Self : in out Client_Request_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String) is null; + -- The `workspace/workspaceFolders` is sent from the server to the client + -- to fetch the open workspace folders. + +end LSP.Client_Request_Receivers; diff --git a/source/lsp_3.17/generated/lsp-client_request_writers.adb b/source/lsp_3.17/generated/lsp-client_request_writers.adb new file mode 100644 index 000000000..ca07283c1 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_request_writers.adb @@ -0,0 +1,150 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Output_Tools; +with LSP.Outputs; + +package body LSP.Client_Request_Writers is + + overriding procedure On_RegisterCapability_Request + (Self : in out Client_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.RegistrationParams) is + begin + LSP.Output_Tools.Write_Start_Request + (Self.Output.all, "client/registerCapability", Id); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_RegistrationParams (Self.Output.all, Value); + Self.Output.End_Object; + end On_RegisterCapability_Request; + + overriding procedure On_UnregisterCapability_Request + (Self : in out Client_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.UnregistrationParams) is + begin + LSP.Output_Tools.Write_Start_Request + (Self.Output.all, "client/unregisterCapability", Id); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_UnregistrationParams (Self.Output.all, Value); + Self.Output.End_Object; + end On_UnregisterCapability_Request; + + overriding procedure On_ShowDocument_Request + (Self : in out Client_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ShowDocumentParams) is + begin + LSP.Output_Tools.Write_Start_Request + (Self.Output.all, "window/showDocument", Id); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_ShowDocumentParams (Self.Output.all, Value); + Self.Output.End_Object; + end On_ShowDocument_Request; + + overriding procedure On_ShowMessageRequest_Request + (Self : in out Client_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ShowMessageRequestParams) is + begin + LSP.Output_Tools.Write_Start_Request + (Self.Output.all, "window/showMessageRequest", Id); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_ShowMessageRequestParams (Self.Output.all, Value); + Self.Output.End_Object; + end On_ShowMessageRequest_Request; + + overriding procedure On_Progress_Create_Request + (Self : in out Client_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkDoneProgressCreateParams) is + begin + LSP.Output_Tools.Write_Start_Request + (Self.Output.all, "window/workDoneProgress/create", Id); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_WorkDoneProgressCreateParams (Self.Output.all, Value); + Self.Output.End_Object; + end On_Progress_Create_Request; + + overriding procedure On_ApplyEdit_Request + (Self : in out Client_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ApplyWorkspaceEditParams) is + begin + LSP.Output_Tools.Write_Start_Request + (Self.Output.all, "workspace/applyEdit", Id); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_ApplyWorkspaceEditParams (Self.Output.all, Value); + Self.Output.End_Object; + end On_ApplyEdit_Request; + + overriding procedure On_Code_Lens_Refresh_Request + (Self : in out Client_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String) is + begin + LSP.Output_Tools.Write_Start_Request + (Self.Output.all, "workspace/codeLens/refresh", Id); + Self.Output.End_Object; + end On_Code_Lens_Refresh_Request; + + overriding procedure On_Configuration_Request + (Self : in out Client_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ConfigurationParams) is + begin + LSP.Output_Tools.Write_Start_Request + (Self.Output.all, "workspace/configuration", Id); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_ConfigurationParams (Self.Output.all, Value); + Self.Output.End_Object; + end On_Configuration_Request; + + overriding procedure On_Diagnostic_Refresh_Request + (Self : in out Client_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String) is + begin + LSP.Output_Tools.Write_Start_Request + (Self.Output.all, "workspace/diagnostic/refresh", Id); + Self.Output.End_Object; + end On_Diagnostic_Refresh_Request; + + overriding procedure On_Inlay_Refresh_Request + (Self : in out Client_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String) is + begin + LSP.Output_Tools.Write_Start_Request + (Self.Output.all, "workspace/inlayHint/refresh", Id); + Self.Output.End_Object; + end On_Inlay_Refresh_Request; + + overriding procedure On_Inline_Refresh_Request + (Self : in out Client_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String) is + begin + LSP.Output_Tools.Write_Start_Request + (Self.Output.all, "workspace/inlineValue/refresh", Id); + Self.Output.End_Object; + end On_Inline_Refresh_Request; + + overriding procedure On_Tokens_Refresh_Request + (Self : in out Client_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String) is + begin + LSP.Output_Tools.Write_Start_Request + (Self.Output.all, "workspace/semanticTokens/refresh", Id); + Self.Output.End_Object; + end On_Tokens_Refresh_Request; + + overriding procedure On_WorkspaceFolders_Request + (Self : in out Client_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String) is + begin + LSP.Output_Tools.Write_Start_Request + (Self.Output.all, "workspace/workspaceFolders", Id); + Self.Output.End_Object; + end On_WorkspaceFolders_Request; + +end LSP.Client_Request_Writers; diff --git a/source/lsp_3.17/generated/lsp-client_request_writers.ads b/source/lsp_3.17/generated/lsp-client_request_writers.ads new file mode 100644 index 000000000..ba632feee --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_request_writers.ads @@ -0,0 +1,77 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; +with VSS.JSON.Content_Handlers; +with LSP.Client_Request_Receivers; + +package LSP.Client_Request_Writers is + pragma Preelaborate; + + type Client_Request_Writer + (Output : access VSS.JSON.Content_Handlers.JSON_Content_Handler'Class) is + new LSP.Client_Request_Receivers.Client_Request_Receiver with null record; + + overriding procedure On_RegisterCapability_Request + (Self : in out Client_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.RegistrationParams); + + overriding procedure On_UnregisterCapability_Request + (Self : in out Client_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.UnregistrationParams); + + overriding procedure On_ShowDocument_Request + (Self : in out Client_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ShowDocumentParams); + + overriding procedure On_ShowMessageRequest_Request + (Self : in out Client_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ShowMessageRequestParams); + + overriding procedure On_Progress_Create_Request + (Self : in out Client_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkDoneProgressCreateParams); + + overriding procedure On_ApplyEdit_Request + (Self : in out Client_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ApplyWorkspaceEditParams); + + overriding procedure On_Code_Lens_Refresh_Request + (Self : in out Client_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String); + + overriding procedure On_Configuration_Request + (Self : in out Client_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ConfigurationParams); + + overriding procedure On_Diagnostic_Refresh_Request + (Self : in out Client_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String); + + overriding procedure On_Inlay_Refresh_Request + (Self : in out Client_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String); + + overriding procedure On_Inline_Refresh_Request + (Self : in out Client_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String); + + overriding procedure On_Tokens_Refresh_Request + (Self : in out Client_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String); + + overriding procedure On_WorkspaceFolders_Request + (Self : in out Client_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String); + +end LSP.Client_Request_Writers; diff --git a/source/lsp_3.17/generated/lsp-client_requests-applyedit.adb b/source/lsp_3.17/generated/lsp-client_requests-applyedit.adb new file mode 100644 index 000000000..86ce61f73 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_requests-applyedit.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Client_Requests.ApplyEdit is + + overriding procedure Visit_Client_Receiver + (Self : Request; + Value : in out LSP.Client_Request_Receivers.Client_Request_Receiver' + Class) is + begin + Value.On_ApplyEdit_Request (Self.Id, Self.Params); + end Visit_Client_Receiver; + +end LSP.Client_Requests.ApplyEdit; diff --git a/source/lsp_3.17/generated/lsp-client_requests-applyedit.ads b/source/lsp_3.17/generated/lsp-client_requests-applyedit.ads new file mode 100644 index 000000000..dc8e59c18 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_requests-applyedit.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Client_Requests.ApplyEdit is + pragma Preelaborate; + + type Request is new LSP.Client_Requests.Client_Request with record + Params : LSP.Structures.ApplyWorkspaceEditParams; + end record; + + overriding procedure Visit_Client_Receiver + (Self : Request; + Value : in out LSP.Client_Request_Receivers.Client_Request_Receiver' + Class); + +end LSP.Client_Requests.ApplyEdit; diff --git a/source/lsp_3.17/generated/lsp-client_requests-code_lens_refresh.adb b/source/lsp_3.17/generated/lsp-client_requests-code_lens_refresh.adb new file mode 100644 index 000000000..e7f27e53c --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_requests-code_lens_refresh.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Client_Requests.Code_Lens_Refresh is + + overriding procedure Visit_Client_Receiver + (Self : Request; + Value : in out LSP.Client_Request_Receivers.Client_Request_Receiver' + Class) is + begin + Value.On_Code_Lens_Refresh_Request (Self.Id); + end Visit_Client_Receiver; + +end LSP.Client_Requests.Code_Lens_Refresh; diff --git a/source/lsp_3.17/generated/lsp-client_requests-code_lens_refresh.ads b/source/lsp_3.17/generated/lsp-client_requests-code_lens_refresh.ads new file mode 100644 index 000000000..118a5f17d --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_requests-code_lens_refresh.ads @@ -0,0 +1,19 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package LSP.Client_Requests.Code_Lens_Refresh is + pragma Preelaborate; + + type Request is new LSP.Client_Requests.Client_Request with record + null; + end record; + + overriding procedure Visit_Client_Receiver + (Self : Request; + Value : in out LSP.Client_Request_Receivers.Client_Request_Receiver' + Class); + +end LSP.Client_Requests.Code_Lens_Refresh; diff --git a/source/lsp_3.17/generated/lsp-client_requests-configuration.adb b/source/lsp_3.17/generated/lsp-client_requests-configuration.adb new file mode 100644 index 000000000..ec570e3f9 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_requests-configuration.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Client_Requests.Configuration is + + overriding procedure Visit_Client_Receiver + (Self : Request; + Value : in out LSP.Client_Request_Receivers.Client_Request_Receiver' + Class) is + begin + Value.On_Configuration_Request (Self.Id, Self.Params); + end Visit_Client_Receiver; + +end LSP.Client_Requests.Configuration; diff --git a/source/lsp_3.17/generated/lsp-client_requests-configuration.ads b/source/lsp_3.17/generated/lsp-client_requests-configuration.ads new file mode 100644 index 000000000..8ac81b8e6 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_requests-configuration.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Client_Requests.Configuration is + pragma Preelaborate; + + type Request is new LSP.Client_Requests.Client_Request with record + Params : LSP.Structures.ConfigurationParams; + end record; + + overriding procedure Visit_Client_Receiver + (Self : Request; + Value : in out LSP.Client_Request_Receivers.Client_Request_Receiver' + Class); + +end LSP.Client_Requests.Configuration; diff --git a/source/lsp_3.17/generated/lsp-client_requests-diagnostic_refresh.adb b/source/lsp_3.17/generated/lsp-client_requests-diagnostic_refresh.adb new file mode 100644 index 000000000..f14353ae5 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_requests-diagnostic_refresh.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Client_Requests.Diagnostic_Refresh is + + overriding procedure Visit_Client_Receiver + (Self : Request; + Value : in out LSP.Client_Request_Receivers.Client_Request_Receiver' + Class) is + begin + Value.On_Diagnostic_Refresh_Request (Self.Id); + end Visit_Client_Receiver; + +end LSP.Client_Requests.Diagnostic_Refresh; diff --git a/source/lsp_3.17/generated/lsp-client_requests-diagnostic_refresh.ads b/source/lsp_3.17/generated/lsp-client_requests-diagnostic_refresh.ads new file mode 100644 index 000000000..ae97a736e --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_requests-diagnostic_refresh.ads @@ -0,0 +1,19 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package LSP.Client_Requests.Diagnostic_Refresh is + pragma Preelaborate; + + type Request is new LSP.Client_Requests.Client_Request with record + null; + end record; + + overriding procedure Visit_Client_Receiver + (Self : Request; + Value : in out LSP.Client_Request_Receivers.Client_Request_Receiver' + Class); + +end LSP.Client_Requests.Diagnostic_Refresh; diff --git a/source/lsp_3.17/generated/lsp-client_requests-inlay_refresh.adb b/source/lsp_3.17/generated/lsp-client_requests-inlay_refresh.adb new file mode 100644 index 000000000..e9693ac2a --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_requests-inlay_refresh.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Client_Requests.Inlay_Refresh is + + overriding procedure Visit_Client_Receiver + (Self : Request; + Value : in out LSP.Client_Request_Receivers.Client_Request_Receiver' + Class) is + begin + Value.On_Inlay_Refresh_Request (Self.Id); + end Visit_Client_Receiver; + +end LSP.Client_Requests.Inlay_Refresh; diff --git a/source/lsp_3.17/generated/lsp-client_requests-inlay_refresh.ads b/source/lsp_3.17/generated/lsp-client_requests-inlay_refresh.ads new file mode 100644 index 000000000..2f3c6a35f --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_requests-inlay_refresh.ads @@ -0,0 +1,19 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package LSP.Client_Requests.Inlay_Refresh is + pragma Preelaborate; + + type Request is new LSP.Client_Requests.Client_Request with record + null; + end record; + + overriding procedure Visit_Client_Receiver + (Self : Request; + Value : in out LSP.Client_Request_Receivers.Client_Request_Receiver' + Class); + +end LSP.Client_Requests.Inlay_Refresh; diff --git a/source/lsp_3.17/generated/lsp-client_requests-inline_refresh.adb b/source/lsp_3.17/generated/lsp-client_requests-inline_refresh.adb new file mode 100644 index 000000000..7a85724d1 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_requests-inline_refresh.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Client_Requests.Inline_Refresh is + + overriding procedure Visit_Client_Receiver + (Self : Request; + Value : in out LSP.Client_Request_Receivers.Client_Request_Receiver' + Class) is + begin + Value.On_Inline_Refresh_Request (Self.Id); + end Visit_Client_Receiver; + +end LSP.Client_Requests.Inline_Refresh; diff --git a/source/lsp_3.17/generated/lsp-client_requests-inline_refresh.ads b/source/lsp_3.17/generated/lsp-client_requests-inline_refresh.ads new file mode 100644 index 000000000..7383a1ffc --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_requests-inline_refresh.ads @@ -0,0 +1,19 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package LSP.Client_Requests.Inline_Refresh is + pragma Preelaborate; + + type Request is new LSP.Client_Requests.Client_Request with record + null; + end record; + + overriding procedure Visit_Client_Receiver + (Self : Request; + Value : in out LSP.Client_Request_Receivers.Client_Request_Receiver' + Class); + +end LSP.Client_Requests.Inline_Refresh; diff --git a/source/lsp_3.17/generated/lsp-client_requests-progress_create.adb b/source/lsp_3.17/generated/lsp-client_requests-progress_create.adb new file mode 100644 index 000000000..3d978d4b4 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_requests-progress_create.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Client_Requests.Progress_Create is + + overriding procedure Visit_Client_Receiver + (Self : Request; + Value : in out LSP.Client_Request_Receivers.Client_Request_Receiver' + Class) is + begin + Value.On_Progress_Create_Request (Self.Id, Self.Params); + end Visit_Client_Receiver; + +end LSP.Client_Requests.Progress_Create; diff --git a/source/lsp_3.17/generated/lsp-client_requests-progress_create.ads b/source/lsp_3.17/generated/lsp-client_requests-progress_create.ads new file mode 100644 index 000000000..2cff63624 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_requests-progress_create.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Client_Requests.Progress_Create is + pragma Preelaborate; + + type Request is new LSP.Client_Requests.Client_Request with record + Params : LSP.Structures.WorkDoneProgressCreateParams; + end record; + + overriding procedure Visit_Client_Receiver + (Self : Request; + Value : in out LSP.Client_Request_Receivers.Client_Request_Receiver' + Class); + +end LSP.Client_Requests.Progress_Create; diff --git a/source/lsp_3.17/generated/lsp-client_requests-registercapability.adb b/source/lsp_3.17/generated/lsp-client_requests-registercapability.adb new file mode 100644 index 000000000..4ccc45f6b --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_requests-registercapability.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Client_Requests.RegisterCapability is + + overriding procedure Visit_Client_Receiver + (Self : Request; + Value : in out LSP.Client_Request_Receivers.Client_Request_Receiver' + Class) is + begin + Value.On_RegisterCapability_Request (Self.Id, Self.Params); + end Visit_Client_Receiver; + +end LSP.Client_Requests.RegisterCapability; diff --git a/source/lsp_3.17/generated/lsp-client_requests-registercapability.ads b/source/lsp_3.17/generated/lsp-client_requests-registercapability.ads new file mode 100644 index 000000000..0cf6ca433 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_requests-registercapability.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Client_Requests.RegisterCapability is + pragma Preelaborate; + + type Request is new LSP.Client_Requests.Client_Request with record + Params : LSP.Structures.RegistrationParams; + end record; + + overriding procedure Visit_Client_Receiver + (Self : Request; + Value : in out LSP.Client_Request_Receivers.Client_Request_Receiver' + Class); + +end LSP.Client_Requests.RegisterCapability; diff --git a/source/lsp_3.17/generated/lsp-client_requests-showdocument.adb b/source/lsp_3.17/generated/lsp-client_requests-showdocument.adb new file mode 100644 index 000000000..08fb0aa67 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_requests-showdocument.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Client_Requests.ShowDocument is + + overriding procedure Visit_Client_Receiver + (Self : Request; + Value : in out LSP.Client_Request_Receivers.Client_Request_Receiver' + Class) is + begin + Value.On_ShowDocument_Request (Self.Id, Self.Params); + end Visit_Client_Receiver; + +end LSP.Client_Requests.ShowDocument; diff --git a/source/lsp_3.17/generated/lsp-client_requests-showdocument.ads b/source/lsp_3.17/generated/lsp-client_requests-showdocument.ads new file mode 100644 index 000000000..5ef051908 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_requests-showdocument.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Client_Requests.ShowDocument is + pragma Preelaborate; + + type Request is new LSP.Client_Requests.Client_Request with record + Params : LSP.Structures.ShowDocumentParams; + end record; + + overriding procedure Visit_Client_Receiver + (Self : Request; + Value : in out LSP.Client_Request_Receivers.Client_Request_Receiver' + Class); + +end LSP.Client_Requests.ShowDocument; diff --git a/source/lsp_3.17/generated/lsp-client_requests-showmessagerequest.adb b/source/lsp_3.17/generated/lsp-client_requests-showmessagerequest.adb new file mode 100644 index 000000000..d1ef2582e --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_requests-showmessagerequest.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Client_Requests.ShowMessageRequest is + + overriding procedure Visit_Client_Receiver + (Self : Request; + Value : in out LSP.Client_Request_Receivers.Client_Request_Receiver' + Class) is + begin + Value.On_ShowMessageRequest_Request (Self.Id, Self.Params); + end Visit_Client_Receiver; + +end LSP.Client_Requests.ShowMessageRequest; diff --git a/source/lsp_3.17/generated/lsp-client_requests-showmessagerequest.ads b/source/lsp_3.17/generated/lsp-client_requests-showmessagerequest.ads new file mode 100644 index 000000000..42f3e217f --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_requests-showmessagerequest.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Client_Requests.ShowMessageRequest is + pragma Preelaborate; + + type Request is new LSP.Client_Requests.Client_Request with record + Params : LSP.Structures.ShowMessageRequestParams; + end record; + + overriding procedure Visit_Client_Receiver + (Self : Request; + Value : in out LSP.Client_Request_Receivers.Client_Request_Receiver' + Class); + +end LSP.Client_Requests.ShowMessageRequest; diff --git a/source/lsp_3.17/generated/lsp-client_requests-tokens_refresh.adb b/source/lsp_3.17/generated/lsp-client_requests-tokens_refresh.adb new file mode 100644 index 000000000..cf800e85b --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_requests-tokens_refresh.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Client_Requests.Tokens_Refresh is + + overriding procedure Visit_Client_Receiver + (Self : Request; + Value : in out LSP.Client_Request_Receivers.Client_Request_Receiver' + Class) is + begin + Value.On_Tokens_Refresh_Request (Self.Id); + end Visit_Client_Receiver; + +end LSP.Client_Requests.Tokens_Refresh; diff --git a/source/lsp_3.17/generated/lsp-client_requests-tokens_refresh.ads b/source/lsp_3.17/generated/lsp-client_requests-tokens_refresh.ads new file mode 100644 index 000000000..0c0a28f30 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_requests-tokens_refresh.ads @@ -0,0 +1,19 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package LSP.Client_Requests.Tokens_Refresh is + pragma Preelaborate; + + type Request is new LSP.Client_Requests.Client_Request with record + null; + end record; + + overriding procedure Visit_Client_Receiver + (Self : Request; + Value : in out LSP.Client_Request_Receivers.Client_Request_Receiver' + Class); + +end LSP.Client_Requests.Tokens_Refresh; diff --git a/source/lsp_3.17/generated/lsp-client_requests-unregistercapability.adb b/source/lsp_3.17/generated/lsp-client_requests-unregistercapability.adb new file mode 100644 index 000000000..c959bed57 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_requests-unregistercapability.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Client_Requests.UnregisterCapability is + + overriding procedure Visit_Client_Receiver + (Self : Request; + Value : in out LSP.Client_Request_Receivers.Client_Request_Receiver' + Class) is + begin + Value.On_UnregisterCapability_Request (Self.Id, Self.Params); + end Visit_Client_Receiver; + +end LSP.Client_Requests.UnregisterCapability; diff --git a/source/lsp_3.17/generated/lsp-client_requests-unregistercapability.ads b/source/lsp_3.17/generated/lsp-client_requests-unregistercapability.ads new file mode 100644 index 000000000..689139cdc --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_requests-unregistercapability.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Client_Requests.UnregisterCapability is + pragma Preelaborate; + + type Request is new LSP.Client_Requests.Client_Request with record + Params : LSP.Structures.UnregistrationParams; + end record; + + overriding procedure Visit_Client_Receiver + (Self : Request; + Value : in out LSP.Client_Request_Receivers.Client_Request_Receiver' + Class); + +end LSP.Client_Requests.UnregisterCapability; diff --git a/source/lsp_3.17/generated/lsp-client_requests-workspacefolders.adb b/source/lsp_3.17/generated/lsp-client_requests-workspacefolders.adb new file mode 100644 index 000000000..63a814c4d --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_requests-workspacefolders.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Client_Requests.WorkspaceFolders is + + overriding procedure Visit_Client_Receiver + (Self : Request; + Value : in out LSP.Client_Request_Receivers.Client_Request_Receiver' + Class) is + begin + Value.On_WorkspaceFolders_Request (Self.Id); + end Visit_Client_Receiver; + +end LSP.Client_Requests.WorkspaceFolders; diff --git a/source/lsp_3.17/generated/lsp-client_requests-workspacefolders.ads b/source/lsp_3.17/generated/lsp-client_requests-workspacefolders.ads new file mode 100644 index 000000000..22d1c3a5c --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_requests-workspacefolders.ads @@ -0,0 +1,19 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package LSP.Client_Requests.WorkspaceFolders is + pragma Preelaborate; + + type Request is new LSP.Client_Requests.Client_Request with record + null; + end record; + + overriding procedure Visit_Client_Receiver + (Self : Request; + Value : in out LSP.Client_Request_Receivers.Client_Request_Receiver' + Class); + +end LSP.Client_Requests.WorkspaceFolders; diff --git a/source/lsp_3.17/generated/lsp-client_response_readers.adb b/source/lsp_3.17/generated/lsp-client_response_readers.adb new file mode 100644 index 000000000..31eb3fcd7 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_response_readers.adb @@ -0,0 +1,581 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with Minimal_Perfect_Hash; +with LSP.Inputs; +with LSP.Input_Tools; +with LSP.Structures; + +with LSP.Client_Responses.IncomingCalls; +with LSP.Client_Responses.OutgoingCalls; +with LSP.Client_Responses.Code_Action_Resolve; +with LSP.Client_Responses.Code_Lens_Resolve; +with LSP.Client_Responses.Completion_Resolve; +with LSP.Client_Responses.Link_Resolve; +with LSP.Client_Responses.Initialize; +with LSP.Client_Responses.Inlay_Resolve; +with LSP.Client_Responses.Shutdown; +with LSP.Client_Responses.CodeAction; +with LSP.Client_Responses.CodeLens; +with LSP.Client_Responses.ColorPresentation; +with LSP.Client_Responses.Completion; +with LSP.Client_Responses.Declaration; +with LSP.Client_Responses.Definition; +with LSP.Client_Responses.Diagnostic; +with LSP.Client_Responses.DocumentColor; +with LSP.Client_Responses.DocumentHighlight; +with LSP.Client_Responses.DocumentLink; +with LSP.Client_Responses.DocumentSymbol; +with LSP.Client_Responses.FoldingRange; +with LSP.Client_Responses.Formatting; +with LSP.Client_Responses.Hover; +with LSP.Client_Responses.Implementation; +with LSP.Client_Responses.InlayHint; +with LSP.Client_Responses.InlineValue; +with LSP.Client_Responses.LinkedEditingRange; +with LSP.Client_Responses.Moniker; +with LSP.Client_Responses.OnTypeFormatting; +with LSP.Client_Responses.PrepareCallHierarchy; +with LSP.Client_Responses.PrepareRename; +with LSP.Client_Responses.PrepareTypeHierarchy; +with LSP.Client_Responses.RangeFormatting; +with LSP.Client_Responses.References; +with LSP.Client_Responses.Rename; +with LSP.Client_Responses.SelectionRange; +with LSP.Client_Responses.Full; +with LSP.Client_Responses.Tokens_Delta; +with LSP.Client_Responses.Tokens_Range; +with LSP.Client_Responses.SignatureHelp; +with LSP.Client_Responses.TypeDefinition; +with LSP.Client_Responses.WillSaveWaitUntil; +with LSP.Client_Responses.Subtypes; +with LSP.Client_Responses.Supertypes; +with LSP.Client_Responses.Workspace_Diagnostic; +with LSP.Client_Responses.ExecuteCommand; +with LSP.Client_Responses.Symbol; +with LSP.Client_Responses.WillCreateFiles; +with LSP.Client_Responses.WillDeleteFiles; +with LSP.Client_Responses.WillRenameFiles; +with LSP.Client_Responses.Symbol_Resolve; + +package body LSP.Client_Response_Readers is + + package Method_Map is new Minimal_Perfect_Hash + (["callHierarchy/incomingCalls", + "callHierarchy/outgoingCalls", + "codeAction/resolve", + "codeLens/resolve", + "completionItem/resolve", + "documentLink/resolve", + "initialize", + "inlayHint/resolve", + "shutdown", + "textDocument/codeAction", + "textDocument/codeLens", + "textDocument/colorPresentation", + "textDocument/completion", + "textDocument/declaration", + "textDocument/definition", + "textDocument/diagnostic", + "textDocument/documentColor", + "textDocument/documentHighlight", + "textDocument/documentLink", + "textDocument/documentSymbol", + "textDocument/foldingRange", + "textDocument/formatting", + "textDocument/hover", + "textDocument/implementation", + "textDocument/inlayHint", + "textDocument/inlineValue", + "textDocument/linkedEditingRange", + "textDocument/moniker", + "textDocument/onTypeFormatting", + "textDocument/prepareCallHierarchy", + "textDocument/prepareRename", + "textDocument/prepareTypeHierarchy", + "textDocument/rangeFormatting", + "textDocument/references", + "textDocument/rename", + "textDocument/selectionRange", + "textDocument/semanticTokens/full", + "textDocument/semanticTokens/full/delta", + "textDocument/semanticTokens/range", + "textDocument/signatureHelp", + "textDocument/typeDefinition", + "textDocument/willSaveWaitUntil", + "typeHierarchy/subtypes", + "typeHierarchy/supertypes", + "workspace/diagnostic", + "workspace/executeCommand", + "workspace/symbol", + "workspace/willCreateFiles", + "workspace/willDeleteFiles", + "workspace/willRenameFiles", + "workspaceSymbol/resolve"]); + + procedure Initialize is + begin + Method_Map.Initialize; + end Initialize; + + procedure Read_IncomingCalls is new LSP.Input_Tools.Read_Response + (LSP.Structures.CallHierarchyIncomingCall_Vector_Or_Null, + LSP.Inputs.Read_CallHierarchyIncomingCall_Vector_Or_Null); + + procedure Read_OutgoingCalls is new LSP.Input_Tools.Read_Response + (LSP.Structures.CallHierarchyOutgoingCall_Vector_Or_Null, + LSP.Inputs.Read_CallHierarchyOutgoingCall_Vector_Or_Null); + + procedure Read_Code_Action_Resolve is new LSP.Input_Tools.Read_Response + (LSP.Structures.CodeAction, LSP.Inputs.Read_CodeAction); + + procedure Read_Code_Lens_Resolve is new LSP.Input_Tools.Read_Response + (LSP.Structures.CodeLens, LSP.Inputs.Read_CodeLens); + + procedure Read_Completion_Resolve is new LSP.Input_Tools.Read_Response + (LSP.Structures.CompletionItem, LSP.Inputs.Read_CompletionItem); + + procedure Read_Link_Resolve is new LSP.Input_Tools.Read_Response + (LSP.Structures.DocumentLink, LSP.Inputs.Read_DocumentLink); + + procedure Read_Initialize is new LSP.Input_Tools.Read_Response + (LSP.Structures.InitializeResult, LSP.Inputs.Read_InitializeResult); + + procedure Read_Inlay_Resolve is new LSP.Input_Tools.Read_Response + (LSP.Structures.InlayHint, LSP.Inputs.Read_InlayHint); + + procedure Read_Shutdown is new LSP.Input_Tools.Read_Response + (LSP.Structures.Null_Record, LSP.Inputs.Read_Null_Record); + + procedure Read_CodeAction is new LSP.Input_Tools.Read_Response + (LSP.Structures.Command_Or_CodeAction_Vector_Or_Null, + LSP.Inputs.Read_Command_Or_CodeAction_Vector_Or_Null); + + procedure Read_CodeLens is new LSP.Input_Tools.Read_Response + (LSP.Structures.CodeLens_Vector_Or_Null, + LSP.Inputs.Read_CodeLens_Vector_Or_Null); + + procedure Read_ColorPresentation is new LSP.Input_Tools.Read_Response + (LSP.Structures.ColorPresentation_Vector, + LSP.Inputs.Read_ColorPresentation_Vector); + + procedure Read_Completion is new LSP.Input_Tools.Read_Response + (LSP.Structures.Completion_Result, LSP.Inputs.Read_Completion_Result); + + procedure Read_Declaration is new LSP.Input_Tools.Read_Response + (LSP.Structures.Declaration_Result, LSP.Inputs.Read_Declaration_Result); + + procedure Read_Definition is new LSP.Input_Tools.Read_Response + (LSP.Structures.Definition_Result, LSP.Inputs.Read_Definition_Result); + + procedure Read_Diagnostic is new LSP.Input_Tools.Read_Response + (LSP.Structures.DocumentDiagnosticReport, + LSP.Inputs.Read_DocumentDiagnosticReport); + + procedure Read_DocumentColor is new LSP.Input_Tools.Read_Response + (LSP.Structures.ColorInformation_Vector, + LSP.Inputs.Read_ColorInformation_Vector); + + procedure Read_DocumentHighlight is new LSP.Input_Tools.Read_Response + (LSP.Structures.DocumentHighlight_Vector_Or_Null, + LSP.Inputs.Read_DocumentHighlight_Vector_Or_Null); + + procedure Read_DocumentLink is new LSP.Input_Tools.Read_Response + (LSP.Structures.DocumentLink_Vector_Or_Null, + LSP.Inputs.Read_DocumentLink_Vector_Or_Null); + + procedure Read_DocumentSymbol is new LSP.Input_Tools.Read_Response + (LSP.Structures.DocumentSymbol_Result, + LSP.Inputs.Read_DocumentSymbol_Result); + + procedure Read_FoldingRange is new LSP.Input_Tools.Read_Response + (LSP.Structures.FoldingRange_Vector_Or_Null, + LSP.Inputs.Read_FoldingRange_Vector_Or_Null); + + procedure Read_Formatting is new LSP.Input_Tools.Read_Response + (LSP.Structures.TextEdit_Vector_Or_Null, + LSP.Inputs.Read_TextEdit_Vector_Or_Null); + + procedure Read_Hover is new LSP.Input_Tools.Read_Response + (LSP.Structures.Hover_Or_Null, LSP.Inputs.Read_Hover_Or_Null); + + procedure Read_Implementation is new LSP.Input_Tools.Read_Response + (LSP.Structures.Definition_Result, LSP.Inputs.Read_Definition_Result); + + procedure Read_InlayHint is new LSP.Input_Tools.Read_Response + (LSP.Structures.InlayHint_Vector_Or_Null, + LSP.Inputs.Read_InlayHint_Vector_Or_Null); + + procedure Read_InlineValue is new LSP.Input_Tools.Read_Response + (LSP.Structures.InlineValue_Vector_Or_Null, + LSP.Inputs.Read_InlineValue_Vector_Or_Null); + + procedure Read_LinkedEditingRange is new LSP.Input_Tools.Read_Response + (LSP.Structures.LinkedEditingRanges_Or_Null, + LSP.Inputs.Read_LinkedEditingRanges_Or_Null); + + procedure Read_Moniker is new LSP.Input_Tools.Read_Response + (LSP.Structures.Moniker_Vector_Or_Null, + LSP.Inputs.Read_Moniker_Vector_Or_Null); + + procedure Read_OnTypeFormatting is new LSP.Input_Tools.Read_Response + (LSP.Structures.TextEdit_Vector_Or_Null, + LSP.Inputs.Read_TextEdit_Vector_Or_Null); + + procedure Read_PrepareCallHierarchy is new LSP.Input_Tools.Read_Response + (LSP.Structures.CallHierarchyItem_Vector_Or_Null, + LSP.Inputs.Read_CallHierarchyItem_Vector_Or_Null); + + procedure Read_PrepareRename is new LSP.Input_Tools.Read_Response + (LSP.Structures.PrepareRenameResult_Or_Null, + LSP.Inputs.Read_PrepareRenameResult_Or_Null); + + procedure Read_PrepareTypeHierarchy is new LSP.Input_Tools.Read_Response + (LSP.Structures.TypeHierarchyItem_Vector_Or_Null, + LSP.Inputs.Read_TypeHierarchyItem_Vector_Or_Null); + + procedure Read_RangeFormatting is new LSP.Input_Tools.Read_Response + (LSP.Structures.TextEdit_Vector_Or_Null, + LSP.Inputs.Read_TextEdit_Vector_Or_Null); + + procedure Read_References is new LSP.Input_Tools.Read_Response + (LSP.Structures.Location_Vector_Or_Null, + LSP.Inputs.Read_Location_Vector_Or_Null); + + procedure Read_Rename is new LSP.Input_Tools.Read_Response + (LSP.Structures.WorkspaceEdit_Or_Null, + LSP.Inputs.Read_WorkspaceEdit_Or_Null); + + procedure Read_SelectionRange is new LSP.Input_Tools.Read_Response + (LSP.Structures.SelectionRange_Vector_Or_Null, + LSP.Inputs.Read_SelectionRange_Vector_Or_Null); + + procedure Read_Full is new LSP.Input_Tools.Read_Response + (LSP.Structures.SemanticTokens_Or_Null, + LSP.Inputs.Read_SemanticTokens_Or_Null); + + procedure Read_Tokens_Delta is new LSP.Input_Tools.Read_Response + (LSP.Structures.Tokens_Delta_Result, LSP.Inputs.Read_Tokens_Delta_Result); + + procedure Read_Tokens_Range is new LSP.Input_Tools.Read_Response + (LSP.Structures.SemanticTokens_Or_Null, + LSP.Inputs.Read_SemanticTokens_Or_Null); + + procedure Read_SignatureHelp is new LSP.Input_Tools.Read_Response + (LSP.Structures.SignatureHelp_Or_Null, + LSP.Inputs.Read_SignatureHelp_Or_Null); + + procedure Read_TypeDefinition is new LSP.Input_Tools.Read_Response + (LSP.Structures.Definition_Result, LSP.Inputs.Read_Definition_Result); + + procedure Read_WillSaveWaitUntil is new LSP.Input_Tools.Read_Response + (LSP.Structures.TextEdit_Vector_Or_Null, + LSP.Inputs.Read_TextEdit_Vector_Or_Null); + + procedure Read_Subtypes is new LSP.Input_Tools.Read_Response + (LSP.Structures.TypeHierarchyItem_Vector_Or_Null, + LSP.Inputs.Read_TypeHierarchyItem_Vector_Or_Null); + + procedure Read_Supertypes is new LSP.Input_Tools.Read_Response + (LSP.Structures.TypeHierarchyItem_Vector_Or_Null, + LSP.Inputs.Read_TypeHierarchyItem_Vector_Or_Null); + + procedure Read_Workspace_Diagnostic is new LSP.Input_Tools.Read_Response + (LSP.Structures.WorkspaceDiagnosticReport, + LSP.Inputs.Read_WorkspaceDiagnosticReport); + + procedure Read_ExecuteCommand is new LSP.Input_Tools.Read_Response + (LSP.Structures.LSPAny_Or_Null, LSP.Inputs.Read_LSPAny_Or_Null); + + procedure Read_Symbol is new LSP.Input_Tools.Read_Response + (LSP.Structures.Symbol_Result, LSP.Inputs.Read_Symbol_Result); + + procedure Read_WillCreateFiles is new LSP.Input_Tools.Read_Response + (LSP.Structures.WorkspaceEdit_Or_Null, + LSP.Inputs.Read_WorkspaceEdit_Or_Null); + + procedure Read_WillDeleteFiles is new LSP.Input_Tools.Read_Response + (LSP.Structures.WorkspaceEdit_Or_Null, + LSP.Inputs.Read_WorkspaceEdit_Or_Null); + + procedure Read_WillRenameFiles is new LSP.Input_Tools.Read_Response + (LSP.Structures.WorkspaceEdit_Or_Null, + LSP.Inputs.Read_WorkspaceEdit_Or_Null); + + procedure Read_Symbol_Resolve is new LSP.Input_Tools.Read_Response + (LSP.Structures.WorkspaceSymbol, LSP.Inputs.Read_WorkspaceSymbol); + + function Read_Response + (Input : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Method : VSS.Strings.Virtual_String) + return LSP.Client_Responses.Client_Response'Class is + Index : constant Natural := Method_Map.Get_Index (Method); + begin + case Index is + when 1 => -- callHierarchy/incomingCalls + return Result : LSP.Client_Responses.IncomingCalls.Response do + Read_IncomingCalls (Input, Result.Id, Result.Result); + end return; + + when 2 => -- callHierarchy/outgoingCalls + return Result : LSP.Client_Responses.OutgoingCalls.Response do + Read_OutgoingCalls (Input, Result.Id, Result.Result); + end return; + + when 3 => -- codeAction/resolve + return + Result : LSP.Client_Responses.Code_Action_Resolve.Response do + Read_Code_Action_Resolve (Input, Result.Id, Result.Result); + end return; + + when 4 => -- codeLens/resolve + return Result : LSP.Client_Responses.Code_Lens_Resolve.Response do + Read_Code_Lens_Resolve (Input, Result.Id, Result.Result); + end return; + + when 5 => -- completionItem/resolve + return Result : LSP.Client_Responses.Completion_Resolve.Response do + Read_Completion_Resolve (Input, Result.Id, Result.Result); + end return; + + when 6 => -- documentLink/resolve + return Result : LSP.Client_Responses.Link_Resolve.Response do + Read_Link_Resolve (Input, Result.Id, Result.Result); + end return; + + when 7 => -- initialize + return Result : LSP.Client_Responses.Initialize.Response do + Read_Initialize (Input, Result.Id, Result.Result); + end return; + + when 8 => -- inlayHint/resolve + return Result : LSP.Client_Responses.Inlay_Resolve.Response do + Read_Inlay_Resolve (Input, Result.Id, Result.Result); + end return; + + when 9 => -- shutdown + return Result : LSP.Client_Responses.Shutdown.Response do + Read_Shutdown (Input, Result.Id, Result.Result); + end return; + + when 10 => -- textDocument/codeAction + return Result : LSP.Client_Responses.CodeAction.Response do + Read_CodeAction (Input, Result.Id, Result.Result); + end return; + + when 11 => -- textDocument/codeLens + return Result : LSP.Client_Responses.CodeLens.Response do + Read_CodeLens (Input, Result.Id, Result.Result); + end return; + + when 12 => -- textDocument/colorPresentation + return Result : LSP.Client_Responses.ColorPresentation.Response do + Read_ColorPresentation (Input, Result.Id, Result.Result); + end return; + + when 13 => -- textDocument/completion + return Result : LSP.Client_Responses.Completion.Response do + Read_Completion (Input, Result.Id, Result.Result); + end return; + + when 14 => -- textDocument/declaration + return Result : LSP.Client_Responses.Declaration.Response do + Read_Declaration (Input, Result.Id, Result.Result); + end return; + + when 15 => -- textDocument/definition + return Result : LSP.Client_Responses.Definition.Response do + Read_Definition (Input, Result.Id, Result.Result); + end return; + + when 16 => -- textDocument/diagnostic + return Result : LSP.Client_Responses.Diagnostic.Response do + Read_Diagnostic (Input, Result.Id, Result.Result); + end return; + + when 17 => -- textDocument/documentColor + return Result : LSP.Client_Responses.DocumentColor.Response do + Read_DocumentColor (Input, Result.Id, Result.Result); + end return; + + when 18 => -- textDocument/documentHighlight + return Result : LSP.Client_Responses.DocumentHighlight.Response do + Read_DocumentHighlight (Input, Result.Id, Result.Result); + end return; + + when 19 => -- textDocument/documentLink + return Result : LSP.Client_Responses.DocumentLink.Response do + Read_DocumentLink (Input, Result.Id, Result.Result); + end return; + + when 20 => -- textDocument/documentSymbol + return Result : LSP.Client_Responses.DocumentSymbol.Response do + Read_DocumentSymbol (Input, Result.Id, Result.Result); + end return; + + when 21 => -- textDocument/foldingRange + return Result : LSP.Client_Responses.FoldingRange.Response do + Read_FoldingRange (Input, Result.Id, Result.Result); + end return; + + when 22 => -- textDocument/formatting + return Result : LSP.Client_Responses.Formatting.Response do + Read_Formatting (Input, Result.Id, Result.Result); + end return; + + when 23 => -- textDocument/hover + return Result : LSP.Client_Responses.Hover.Response do + Read_Hover (Input, Result.Id, Result.Result); + end return; + + when 24 => -- textDocument/implementation + return Result : LSP.Client_Responses.Implementation.Response do + Read_Implementation (Input, Result.Id, Result.Result); + end return; + + when 25 => -- textDocument/inlayHint + return Result : LSP.Client_Responses.InlayHint.Response do + Read_InlayHint (Input, Result.Id, Result.Result); + end return; + + when 26 => -- textDocument/inlineValue + return Result : LSP.Client_Responses.InlineValue.Response do + Read_InlineValue (Input, Result.Id, Result.Result); + end return; + + when 27 => -- textDocument/linkedEditingRange + return Result : LSP.Client_Responses.LinkedEditingRange.Response do + Read_LinkedEditingRange (Input, Result.Id, Result.Result); + end return; + + when 28 => -- textDocument/moniker + return Result : LSP.Client_Responses.Moniker.Response do + Read_Moniker (Input, Result.Id, Result.Result); + end return; + + when 29 => -- textDocument/onTypeFormatting + return Result : LSP.Client_Responses.OnTypeFormatting.Response do + Read_OnTypeFormatting (Input, Result.Id, Result.Result); + end return; + + when 30 => -- textDocument/prepareCallHierarchy + return + Result : LSP.Client_Responses.PrepareCallHierarchy.Response do + Read_PrepareCallHierarchy (Input, Result.Id, Result.Result); + end return; + + when 31 => -- textDocument/prepareRename + return Result : LSP.Client_Responses.PrepareRename.Response do + Read_PrepareRename (Input, Result.Id, Result.Result); + end return; + + when 32 => -- textDocument/prepareTypeHierarchy + return + Result : LSP.Client_Responses.PrepareTypeHierarchy.Response do + Read_PrepareTypeHierarchy (Input, Result.Id, Result.Result); + end return; + + when 33 => -- textDocument/rangeFormatting + return Result : LSP.Client_Responses.RangeFormatting.Response do + Read_RangeFormatting (Input, Result.Id, Result.Result); + end return; + + when 34 => -- textDocument/references + return Result : LSP.Client_Responses.References.Response do + Read_References (Input, Result.Id, Result.Result); + end return; + + when 35 => -- textDocument/rename + return Result : LSP.Client_Responses.Rename.Response do + Read_Rename (Input, Result.Id, Result.Result); + end return; + + when 36 => -- textDocument/selectionRange + return Result : LSP.Client_Responses.SelectionRange.Response do + Read_SelectionRange (Input, Result.Id, Result.Result); + end return; + + when 37 => -- textDocument/semanticTokens/full + return Result : LSP.Client_Responses.Full.Response do + Read_Full (Input, Result.Id, Result.Result); + end return; + + when 38 => -- textDocument/semanticTokens/full/delta + return Result : LSP.Client_Responses.Tokens_Delta.Response do + Read_Tokens_Delta (Input, Result.Id, Result.Result); + end return; + + when 39 => -- textDocument/semanticTokens/range + return Result : LSP.Client_Responses.Tokens_Range.Response do + Read_Tokens_Range (Input, Result.Id, Result.Result); + end return; + + when 40 => -- textDocument/signatureHelp + return Result : LSP.Client_Responses.SignatureHelp.Response do + Read_SignatureHelp (Input, Result.Id, Result.Result); + end return; + + when 41 => -- textDocument/typeDefinition + return Result : LSP.Client_Responses.TypeDefinition.Response do + Read_TypeDefinition (Input, Result.Id, Result.Result); + end return; + + when 42 => -- textDocument/willSaveWaitUntil + return Result : LSP.Client_Responses.WillSaveWaitUntil.Response do + Read_WillSaveWaitUntil (Input, Result.Id, Result.Result); + end return; + + when 43 => -- typeHierarchy/subtypes + return Result : LSP.Client_Responses.Subtypes.Response do + Read_Subtypes (Input, Result.Id, Result.Result); + end return; + + when 44 => -- typeHierarchy/supertypes + return Result : LSP.Client_Responses.Supertypes.Response do + Read_Supertypes (Input, Result.Id, Result.Result); + end return; + + when 45 => -- workspace/diagnostic + return + Result : LSP.Client_Responses.Workspace_Diagnostic.Response do + Read_Workspace_Diagnostic (Input, Result.Id, Result.Result); + end return; + + when 46 => -- workspace/executeCommand + return Result : LSP.Client_Responses.ExecuteCommand.Response do + Read_ExecuteCommand (Input, Result.Id, Result.Result); + end return; + + when 47 => -- workspace/symbol + return Result : LSP.Client_Responses.Symbol.Response do + Read_Symbol (Input, Result.Id, Result.Result); + end return; + + when 48 => -- workspace/willCreateFiles + return Result : LSP.Client_Responses.WillCreateFiles.Response do + Read_WillCreateFiles (Input, Result.Id, Result.Result); + end return; + + when 49 => -- workspace/willDeleteFiles + return Result : LSP.Client_Responses.WillDeleteFiles.Response do + Read_WillDeleteFiles (Input, Result.Id, Result.Result); + end return; + + when 50 => -- workspace/willRenameFiles + return Result : LSP.Client_Responses.WillRenameFiles.Response do + Read_WillRenameFiles (Input, Result.Id, Result.Result); + end return; + + when 51 => -- workspaceSymbol/resolve + return Result : LSP.Client_Responses.Symbol_Resolve.Response do + Read_Symbol_Resolve (Input, Result.Id, Result.Result); + end return; + + when others => + return raise Program_Error with "Unknown method"; + end case; + end Read_Response; +end LSP.Client_Response_Readers; diff --git a/source/lsp_3.17/generated/lsp-client_response_receivers.ads b/source/lsp_3.17/generated/lsp-client_response_receivers.ads new file mode 100644 index 000000000..c1d689d4f --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_response_receivers.ads @@ -0,0 +1,461 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Errors; +with LSP.Structures; + +package LSP.Client_Response_Receivers is + pragma Preelaborate; + + type Client_Response_Receiver is limited interface; + + procedure On_IncomingCalls_Response + (Self : in out Client_Response_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CallHierarchyIncomingCall_Vector_Or_Null) is null; + -- A request to resolve the incoming calls for a given `CallHierarchyItem`. + -- + -- @since 3.16.0 + + procedure On_OutgoingCalls_Response + (Self : in out Client_Response_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CallHierarchyOutgoingCall_Vector_Or_Null) is null; + -- A request to resolve the outgoing calls for a given `CallHierarchyItem`. + -- + -- @since 3.16.0 + + procedure On_Code_Action_Resolve_Response + (Self : in out Client_Response_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CodeAction) is null; + -- Request to resolve additional information for a given code action.The + -- request's parameter is of type [CodeAction](#CodeAction) the response is + -- of type [CodeAction](#CodeAction) or a Thenable that resolves to such. + + procedure On_Code_Lens_Resolve_Response + (Self : in out Client_Response_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CodeLens) is null; + -- A request to resolve a command for a given code lens. + + procedure On_Completion_Resolve_Response + (Self : in out Client_Response_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CompletionItem) is null; + -- Request to resolve additional information for a given + -- completion item.The request's parameter is of type + -- [CompletionItem](#CompletionItem) the response is of type + -- [CompletionItem](#CompletionItem) or a Thenable that resolves to such. + + procedure On_Link_Resolve_Response + (Self : in out Client_Response_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentLink) is null; + -- Request to resolve additional information for a given document link. + -- The request's parameter is of type [DocumentLink](#DocumentLink) the + -- response is of type [DocumentLink](#DocumentLink) or a Thenable that + -- resolves to such. + + procedure On_Initialize_Response + (Self : in out Client_Response_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InitializeResult) is null; + -- The initialize request is sent from the client to the server. It is sent + -- once as the request after starting up the server. The requests parameter + -- is of type [InitializeParams](#InitializeParams) the response if of type + -- [InitializeResult](#InitializeResult) of a Thenable that resolves to + -- such. + + procedure On_Inlay_Resolve_Response + (Self : in out Client_Response_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InlayHint) is null; + -- A request to resolve additional properties for an inlay hint. The + -- request's parameter is of type [InlayHint](#InlayHint), the response + -- is of type [InlayHint](#InlayHint) or a Thenable that resolves to such. + -- + -- @since 3.17.0 + + procedure On_Shutdown_Response + (Self : in out Client_Response_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Null_Record) is null; + -- A shutdown request is sent from the client to the server. It is + -- sent once when the client decides to shutdown the server. The only + -- notification that is sent after a shutdown request is the exit event. + + procedure On_CodeAction_Response + (Self : in out Client_Response_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Command_Or_CodeAction_Vector_Or_Null) is null; + -- A request to provide commands for the given text document and range. + + procedure On_CodeLens_Response + (Self : in out Client_Response_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CodeLens_Vector_Or_Null) is null; + -- A request to provide code lens for the given text document. + + procedure On_ColorPresentation_Response + (Self : in out Client_Response_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ColorPresentation_Vector) is null; + -- A request to list all presentation for a color. The request's parameter + -- is of type [ColorPresentationParams](#ColorPresentationParams) the + -- response is of type [ColorInformation[]](#ColorInformation) or a + -- Thenable that resolves to such. + + procedure On_Completion_Response + (Self : in out Client_Response_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Completion_Result) is null; + -- Request to request completion at a given text + -- document position. The request's parameter is of type + -- [TextDocumentPosition](#TextDocumentPosition) the response is of type + -- [CompletionItem[]](#CompletionItem) or [CompletionList](#CompletionList) + -- or a Thenable that resolves to such. + -- + -- The request can delay the computation of + -- the [`detail`](#CompletionItem.detail) and + -- [`documentation`](#CompletionItem.documentation) properties to the + -- `completionItem/resolve` request. However, properties that are needed + -- for the initial sorting and filtering, like `sortText`, `filterText`, + -- `insertText`, and `textEdit`, must not be changed during resolve. + + procedure On_Declaration_Response + (Self : in out Client_Response_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Declaration_Result) is null; + -- A request to resolve the type definition locations of a symbol at + -- a given text document position. The request's parameter is of type + -- [TextDocumentPositionParams] (#TextDocumentPositionParams) the + -- response is of type [Declaration](#Declaration) or a typed array of + -- [DeclarationLink](#DeclarationLink) or a Thenable that resolves to such. + + procedure On_Definition_Response + (Self : in out Client_Response_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Definition_Result) is null; + -- A request to resolve the definition location of a symbol at a + -- given text document position. The request's parameter is of type + -- [TextDocumentPosition] (#TextDocumentPosition) the response is + -- of either type [Definition](#Definition) or a typed array of + -- [DefinitionLink](#DefinitionLink) or a Thenable that resolves to such. + + procedure On_Diagnostic_Response + (Self : in out Client_Response_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentDiagnosticReport) is null; + -- The document diagnostic request definition. + -- + -- @since 3.17.0 + + procedure On_DocumentColor_Response + (Self : in out Client_Response_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ColorInformation_Vector) is null; + -- A request to list all color symbols found in a given + -- text document. The request's parameter is of type + -- [DocumentColorParams](#DocumentColorParams) the response is of type + -- [ColorInformation[]](#ColorInformation) or a Thenable that resolves + -- to such. + + procedure On_DocumentHighlight_Response + (Self : in out Client_Response_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentHighlight_Vector_Or_Null) is null; + -- Request to resolve a [DocumentHighlight](#DocumentHighlight) for + -- a given text document position. The request's parameter is of type + -- [TextDocumentPosition] (#TextDocumentPosition) the request response is + -- of type [DocumentHighlight[]] (#DocumentHighlight) or a Thenable that + -- resolves to such. + + procedure On_DocumentLink_Response + (Self : in out Client_Response_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentLink_Vector_Or_Null) is null; + -- A request to provide document links + + procedure On_DocumentSymbol_Response + (Self : in out Client_Response_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentSymbol_Result) is null; + -- A request to list all symbols found in a given + -- text document. The request's parameter is of type + -- [TextDocumentIdentifier](#TextDocumentIdentifier) the response is + -- of type [SymbolInformation[]](#SymbolInformation) or a Thenable + -- that resolves to such. + + procedure On_FoldingRange_Response + (Self : in out Client_Response_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.FoldingRange_Vector_Or_Null) is null; + -- A request to provide folding ranges in a document. The request's + -- parameter is of type [FoldingRangeParams](#FoldingRangeParams), the + -- response is of type [FoldingRangeList](#FoldingRangeList) or a Thenable + -- that resolves to such. + + procedure On_Formatting_Response + (Self : in out Client_Response_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TextEdit_Vector_Or_Null) is null; + -- A request to to format a whole document. + + procedure On_Hover_Response + (Self : in out Client_Response_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Hover_Or_Null) is null; + -- Request to request hover information at a given text + -- document position. The request's parameter is of type + -- [TextDocumentPosition](#TextDocumentPosition) the response is of + -- type [Hover](#Hover) or a Thenable that resolves to such. + + procedure On_Implementation_Response + (Self : in out Client_Response_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Definition_Result) is null; + -- A request to resolve the implementation locations of a symbol at + -- a given text document position. The request's parameter is of type + -- [TextDocumentPositionParams] (#TextDocumentPositionParams) the response + -- is of type [Definition](#Definition) or a Thenable that resolves to + -- such. + + procedure On_InlayHint_Response + (Self : in out Client_Response_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InlayHint_Vector_Or_Null) is null; + -- A request to provide inlay hints in a document. The request's parameter + -- is of type [InlayHintsParams](#InlayHintsParams), the response is of + -- type [InlayHint[]](#InlayHint[]) or a Thenable that resolves to such. + -- + -- @since 3.17.0 + + procedure On_InlineValue_Response + (Self : in out Client_Response_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InlineValue_Vector_Or_Null) is null; + -- A request to provide inline values in a document. The request's + -- parameter is of type [InlineValueParams](#InlineValueParams), the + -- response is of type [InlineValue[]](#InlineValue[]) or a Thenable + -- that resolves to such. + -- + -- @since 3.17.0 + + procedure On_LinkedEditingRange_Response + (Self : in out Client_Response_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.LinkedEditingRanges_Or_Null) is null; + -- A request to provide ranges that can be edited together. + -- + -- @since 3.16.0 + + procedure On_Moniker_Response + (Self : in out Client_Response_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Moniker_Vector_Or_Null) is null; + -- A request to get the moniker of a symbol at a given + -- text document position. The request parameter is of type + -- [TextDocumentPositionParams](#TextDocumentPositionParams). The + -- response is of type [Moniker[]](#Moniker[]) or `null`. + + procedure On_OnTypeFormatting_Response + (Self : in out Client_Response_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TextEdit_Vector_Or_Null) is null; + -- A request to format a document on type. + + procedure On_PrepareCallHierarchy_Response + (Self : in out Client_Response_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CallHierarchyItem_Vector_Or_Null) is null; + -- A request to result a `CallHierarchyItem` in a document at a given + -- position. Can be used as an input to an incoming or outgoing call + -- hierarchy. + -- + -- @since 3.16.0 + + procedure On_PrepareRename_Response + (Self : in out Client_Response_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.PrepareRenameResult_Or_Null) is null; + -- A request to test and perform the setup necessary for a rename. + -- + -- @since 3.16 - support for default behavior + + procedure On_PrepareTypeHierarchy_Response + (Self : in out Client_Response_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TypeHierarchyItem_Vector_Or_Null) is null; + -- A request to result a `TypeHierarchyItem` in a document at a given + -- position. Can be used as an input to a subtypes or supertypes type + -- hierarchy. + -- + -- @since 3.17.0 + + procedure On_RangeFormatting_Response + (Self : in out Client_Response_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TextEdit_Vector_Or_Null) is null; + -- A request to to format a range in a document. + + procedure On_References_Response + (Self : in out Client_Response_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Location_Vector_Or_Null) is null; + -- A request to resolve project-wide references for the symbol denoted + -- by the given text document position. The request's parameter is of + -- type [ReferenceParams](#ReferenceParams) the response is of type + -- [Location[]](#Location) or a Thenable that resolves to such. + + procedure On_Rename_Response + (Self : in out Client_Response_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceEdit_Or_Null) is null; + -- A request to rename a symbol. + + procedure On_SelectionRange_Response + (Self : in out Client_Response_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SelectionRange_Vector_Or_Null) is null; + -- A request to provide selection ranges in a document. The request's + -- parameter is of type [SelectionRangeParams](#SelectionRangeParams), the + -- response is of type [SelectionRange[]](#SelectionRange[]) or a Thenable + -- that resolves to such. + + procedure On_Full_Response + (Self : in out Client_Response_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SemanticTokens_Or_Null) is null; + -- @since 3.16.0 + + procedure On_Tokens_Delta_Response + (Self : in out Client_Response_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Tokens_Delta_Result) is null; + -- @since 3.16.0 + + procedure On_Tokens_Range_Response + (Self : in out Client_Response_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SemanticTokens_Or_Null) is null; + -- @since 3.16.0 + + procedure On_SignatureHelp_Response + (Self : in out Client_Response_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SignatureHelp_Or_Null) is null; + + procedure On_TypeDefinition_Response + (Self : in out Client_Response_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Definition_Result) is null; + -- A request to resolve the type definition locations of a symbol at + -- a given text document position. The request's parameter is of type + -- [TextDocumentPositionParams] (#TextDocumentPositionParams) the response + -- is of type [Definition](#Definition) or a Thenable that resolves to + -- such. + + procedure On_WillSaveWaitUntil_Response + (Self : in out Client_Response_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TextEdit_Vector_Or_Null) is null; + -- A document will save request is sent from the client to the server + -- before the document is actually saved. The request can return an array + -- of TextEdits which will be applied to the text document before it is + -- saved. Please note that clients might drop results if computing the text + -- edits took too long or if a server constantly fails on this request. + -- This is done to keep the save fast and reliable. + + procedure On_Subtypes_Response + (Self : in out Client_Response_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TypeHierarchyItem_Vector_Or_Null) is null; + -- A request to resolve the subtypes for a given `TypeHierarchyItem`. + -- + -- @since 3.17.0 + + procedure On_Supertypes_Response + (Self : in out Client_Response_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TypeHierarchyItem_Vector_Or_Null) is null; + -- A request to resolve the supertypes for a given `TypeHierarchyItem`. + -- + -- @since 3.17.0 + + procedure On_Workspace_Diagnostic_Response + (Self : in out Client_Response_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceDiagnosticReport) is null; + -- The workspace diagnostic request definition. + -- + -- @since 3.17.0 + + procedure On_ExecuteCommand_Response + (Self : in out Client_Response_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.LSPAny_Or_Null) is null; + -- A request send from the client to the server to execute a command. The + -- request might return a workspace edit which the client will apply to the + -- workspace. + + procedure On_Symbol_Response + (Self : in out Client_Response_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Symbol_Result) is null; + -- A request to list project-wide symbols matching the query string given + -- by the [WorkspaceSymbolParams](#WorkspaceSymbolParams). The response + -- is of type [SymbolInformation[]](#SymbolInformation) or a Thenable + -- that resolves to such. + -- + -- @since 3.17.0 - support for WorkspaceSymbol in the returned data. + -- Clients + -- need to advertise support for WorkspaceSymbols via the client capability + -- `workspace.symbol.resolveSupport`. + + procedure On_WillCreateFiles_Response + (Self : in out Client_Response_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceEdit_Or_Null) is null; + -- The will create files request is sent from the client to the server + -- before files are actually created as long as the creation is triggered + -- from within the client. + -- + -- @since 3.16.0 + + procedure On_WillDeleteFiles_Response + (Self : in out Client_Response_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceEdit_Or_Null) is null; + -- The did delete files notification is sent from the client to the server + -- when files were deleted from within the client. + -- + -- @since 3.16.0 + + procedure On_WillRenameFiles_Response + (Self : in out Client_Response_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceEdit_Or_Null) is null; + -- The will rename files request is sent from the client to the server + -- before files are actually renamed as long as the rename is triggered + -- from within the client. + -- + -- @since 3.16.0 + + procedure On_Symbol_Resolve_Response + (Self : in out Client_Response_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceSymbol) is null; + -- A request to resolve the range inside the workspace symbol's location. + -- + -- @since 3.17.0 + + procedure On_Error_Response + (Self : in out Client_Response_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Errors.ResponseError) is null; + +end LSP.Client_Response_Receivers; diff --git a/source/lsp_3.17/generated/lsp-client_response_writers.adb b/source/lsp_3.17/generated/lsp-client_response_writers.adb new file mode 100644 index 000000000..2488e58ed --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_response_writers.adb @@ -0,0 +1,597 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Output_Tools; +with LSP.Outputs; + +package body LSP.Client_Response_Writers is + + overriding procedure On_IncomingCalls_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CallHierarchyIncomingCall_Vector_Or_Null) is + begin + LSP.Output_Tools.Write_Start_Response (Self.Output.all, Id); + Self.Output.Key_Name ("result"); + LSP.Outputs.Write_CallHierarchyIncomingCall_Vector_Or_Null + (Self.Output.all, Value); + Self.Output.End_Object; + end On_IncomingCalls_Response; + + overriding procedure On_OutgoingCalls_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CallHierarchyOutgoingCall_Vector_Or_Null) is + begin + LSP.Output_Tools.Write_Start_Response (Self.Output.all, Id); + Self.Output.Key_Name ("result"); + LSP.Outputs.Write_CallHierarchyOutgoingCall_Vector_Or_Null + (Self.Output.all, Value); + Self.Output.End_Object; + end On_OutgoingCalls_Response; + + overriding procedure On_Code_Action_Resolve_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CodeAction) is + begin + LSP.Output_Tools.Write_Start_Response (Self.Output.all, Id); + Self.Output.Key_Name ("result"); + LSP.Outputs.Write_CodeAction (Self.Output.all, Value); + Self.Output.End_Object; + end On_Code_Action_Resolve_Response; + + overriding procedure On_Code_Lens_Resolve_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CodeLens) is + begin + LSP.Output_Tools.Write_Start_Response (Self.Output.all, Id); + Self.Output.Key_Name ("result"); + LSP.Outputs.Write_CodeLens (Self.Output.all, Value); + Self.Output.End_Object; + end On_Code_Lens_Resolve_Response; + + overriding procedure On_Completion_Resolve_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CompletionItem) is + begin + LSP.Output_Tools.Write_Start_Response (Self.Output.all, Id); + Self.Output.Key_Name ("result"); + LSP.Outputs.Write_CompletionItem (Self.Output.all, Value); + Self.Output.End_Object; + end On_Completion_Resolve_Response; + + overriding procedure On_Link_Resolve_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentLink) is + begin + LSP.Output_Tools.Write_Start_Response (Self.Output.all, Id); + Self.Output.Key_Name ("result"); + LSP.Outputs.Write_DocumentLink (Self.Output.all, Value); + Self.Output.End_Object; + end On_Link_Resolve_Response; + + overriding procedure On_Initialize_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InitializeResult) is + begin + LSP.Output_Tools.Write_Start_Response (Self.Output.all, Id); + Self.Output.Key_Name ("result"); + LSP.Outputs.Write_InitializeResult (Self.Output.all, Value); + Self.Output.End_Object; + end On_Initialize_Response; + + overriding procedure On_Inlay_Resolve_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InlayHint) is + begin + LSP.Output_Tools.Write_Start_Response (Self.Output.all, Id); + Self.Output.Key_Name ("result"); + LSP.Outputs.Write_InlayHint (Self.Output.all, Value); + Self.Output.End_Object; + end On_Inlay_Resolve_Response; + + overriding procedure On_Shutdown_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Null_Record) is + begin + LSP.Output_Tools.Write_Start_Response (Self.Output.all, Id); + Self.Output.Key_Name ("result"); + LSP.Outputs.Write_Null_Record (Self.Output.all, Value); + Self.Output.End_Object; + end On_Shutdown_Response; + + overriding procedure On_CodeAction_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Command_Or_CodeAction_Vector_Or_Null) is + begin + LSP.Output_Tools.Write_Start_Response (Self.Output.all, Id); + Self.Output.Key_Name ("result"); + LSP.Outputs.Write_Command_Or_CodeAction_Vector_Or_Null + (Self.Output.all, Value); + Self.Output.End_Object; + end On_CodeAction_Response; + + overriding procedure On_CodeLens_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CodeLens_Vector_Or_Null) is + begin + LSP.Output_Tools.Write_Start_Response (Self.Output.all, Id); + Self.Output.Key_Name ("result"); + LSP.Outputs.Write_CodeLens_Vector_Or_Null (Self.Output.all, Value); + Self.Output.End_Object; + end On_CodeLens_Response; + + overriding procedure On_ColorPresentation_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ColorPresentation_Vector) is + begin + LSP.Output_Tools.Write_Start_Response (Self.Output.all, Id); + Self.Output.Key_Name ("result"); + LSP.Outputs.Write_ColorPresentation_Vector (Self.Output.all, Value); + Self.Output.End_Object; + end On_ColorPresentation_Response; + + overriding procedure On_Completion_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Completion_Result) is + begin + LSP.Output_Tools.Write_Start_Response (Self.Output.all, Id); + Self.Output.Key_Name ("result"); + LSP.Outputs.Write_Completion_Result (Self.Output.all, Value); + Self.Output.End_Object; + end On_Completion_Response; + + overriding procedure On_Declaration_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Declaration_Result) is + begin + LSP.Output_Tools.Write_Start_Response (Self.Output.all, Id); + Self.Output.Key_Name ("result"); + LSP.Outputs.Write_Declaration_Result (Self.Output.all, Value); + Self.Output.End_Object; + end On_Declaration_Response; + + overriding procedure On_Definition_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Definition_Result) is + begin + LSP.Output_Tools.Write_Start_Response (Self.Output.all, Id); + Self.Output.Key_Name ("result"); + LSP.Outputs.Write_Definition_Result (Self.Output.all, Value); + Self.Output.End_Object; + end On_Definition_Response; + + overriding procedure On_Diagnostic_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentDiagnosticReport) is + begin + LSP.Output_Tools.Write_Start_Response (Self.Output.all, Id); + Self.Output.Key_Name ("result"); + LSP.Outputs.Write_DocumentDiagnosticReport (Self.Output.all, Value); + Self.Output.End_Object; + end On_Diagnostic_Response; + + overriding procedure On_DocumentColor_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ColorInformation_Vector) is + begin + LSP.Output_Tools.Write_Start_Response (Self.Output.all, Id); + Self.Output.Key_Name ("result"); + LSP.Outputs.Write_ColorInformation_Vector (Self.Output.all, Value); + Self.Output.End_Object; + end On_DocumentColor_Response; + + overriding procedure On_DocumentHighlight_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentHighlight_Vector_Or_Null) is + begin + LSP.Output_Tools.Write_Start_Response (Self.Output.all, Id); + Self.Output.Key_Name ("result"); + LSP.Outputs.Write_DocumentHighlight_Vector_Or_Null + (Self.Output.all, Value); + Self.Output.End_Object; + end On_DocumentHighlight_Response; + + overriding procedure On_DocumentLink_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentLink_Vector_Or_Null) is + begin + LSP.Output_Tools.Write_Start_Response (Self.Output.all, Id); + Self.Output.Key_Name ("result"); + LSP.Outputs.Write_DocumentLink_Vector_Or_Null (Self.Output.all, Value); + Self.Output.End_Object; + end On_DocumentLink_Response; + + overriding procedure On_DocumentSymbol_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentSymbol_Result) is + begin + LSP.Output_Tools.Write_Start_Response (Self.Output.all, Id); + Self.Output.Key_Name ("result"); + LSP.Outputs.Write_DocumentSymbol_Result (Self.Output.all, Value); + Self.Output.End_Object; + end On_DocumentSymbol_Response; + + overriding procedure On_FoldingRange_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.FoldingRange_Vector_Or_Null) is + begin + LSP.Output_Tools.Write_Start_Response (Self.Output.all, Id); + Self.Output.Key_Name ("result"); + LSP.Outputs.Write_FoldingRange_Vector_Or_Null (Self.Output.all, Value); + Self.Output.End_Object; + end On_FoldingRange_Response; + + overriding procedure On_Formatting_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TextEdit_Vector_Or_Null) is + begin + LSP.Output_Tools.Write_Start_Response (Self.Output.all, Id); + Self.Output.Key_Name ("result"); + LSP.Outputs.Write_TextEdit_Vector_Or_Null (Self.Output.all, Value); + Self.Output.End_Object; + end On_Formatting_Response; + + overriding procedure On_Hover_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Hover_Or_Null) is + begin + LSP.Output_Tools.Write_Start_Response (Self.Output.all, Id); + Self.Output.Key_Name ("result"); + LSP.Outputs.Write_Hover_Or_Null (Self.Output.all, Value); + Self.Output.End_Object; + end On_Hover_Response; + + overriding procedure On_Implementation_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Definition_Result) is + begin + LSP.Output_Tools.Write_Start_Response (Self.Output.all, Id); + Self.Output.Key_Name ("result"); + LSP.Outputs.Write_Definition_Result (Self.Output.all, Value); + Self.Output.End_Object; + end On_Implementation_Response; + + overriding procedure On_InlayHint_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InlayHint_Vector_Or_Null) is + begin + LSP.Output_Tools.Write_Start_Response (Self.Output.all, Id); + Self.Output.Key_Name ("result"); + LSP.Outputs.Write_InlayHint_Vector_Or_Null (Self.Output.all, Value); + Self.Output.End_Object; + end On_InlayHint_Response; + + overriding procedure On_InlineValue_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InlineValue_Vector_Or_Null) is + begin + LSP.Output_Tools.Write_Start_Response (Self.Output.all, Id); + Self.Output.Key_Name ("result"); + LSP.Outputs.Write_InlineValue_Vector_Or_Null (Self.Output.all, Value); + Self.Output.End_Object; + end On_InlineValue_Response; + + overriding procedure On_LinkedEditingRange_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.LinkedEditingRanges_Or_Null) is + begin + LSP.Output_Tools.Write_Start_Response (Self.Output.all, Id); + Self.Output.Key_Name ("result"); + LSP.Outputs.Write_LinkedEditingRanges_Or_Null (Self.Output.all, Value); + Self.Output.End_Object; + end On_LinkedEditingRange_Response; + + overriding procedure On_Moniker_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Moniker_Vector_Or_Null) is + begin + LSP.Output_Tools.Write_Start_Response (Self.Output.all, Id); + Self.Output.Key_Name ("result"); + LSP.Outputs.Write_Moniker_Vector_Or_Null (Self.Output.all, Value); + Self.Output.End_Object; + end On_Moniker_Response; + + overriding procedure On_OnTypeFormatting_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TextEdit_Vector_Or_Null) is + begin + LSP.Output_Tools.Write_Start_Response (Self.Output.all, Id); + Self.Output.Key_Name ("result"); + LSP.Outputs.Write_TextEdit_Vector_Or_Null (Self.Output.all, Value); + Self.Output.End_Object; + end On_OnTypeFormatting_Response; + + overriding procedure On_PrepareCallHierarchy_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CallHierarchyItem_Vector_Or_Null) is + begin + LSP.Output_Tools.Write_Start_Response (Self.Output.all, Id); + Self.Output.Key_Name ("result"); + LSP.Outputs.Write_CallHierarchyItem_Vector_Or_Null + (Self.Output.all, Value); + Self.Output.End_Object; + end On_PrepareCallHierarchy_Response; + + overriding procedure On_PrepareRename_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.PrepareRenameResult_Or_Null) is + begin + LSP.Output_Tools.Write_Start_Response (Self.Output.all, Id); + Self.Output.Key_Name ("result"); + LSP.Outputs.Write_PrepareRenameResult_Or_Null (Self.Output.all, Value); + Self.Output.End_Object; + end On_PrepareRename_Response; + + overriding procedure On_PrepareTypeHierarchy_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TypeHierarchyItem_Vector_Or_Null) is + begin + LSP.Output_Tools.Write_Start_Response (Self.Output.all, Id); + Self.Output.Key_Name ("result"); + LSP.Outputs.Write_TypeHierarchyItem_Vector_Or_Null + (Self.Output.all, Value); + Self.Output.End_Object; + end On_PrepareTypeHierarchy_Response; + + overriding procedure On_RangeFormatting_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TextEdit_Vector_Or_Null) is + begin + LSP.Output_Tools.Write_Start_Response (Self.Output.all, Id); + Self.Output.Key_Name ("result"); + LSP.Outputs.Write_TextEdit_Vector_Or_Null (Self.Output.all, Value); + Self.Output.End_Object; + end On_RangeFormatting_Response; + + overriding procedure On_References_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Location_Vector_Or_Null) is + begin + LSP.Output_Tools.Write_Start_Response (Self.Output.all, Id); + Self.Output.Key_Name ("result"); + LSP.Outputs.Write_Location_Vector_Or_Null (Self.Output.all, Value); + Self.Output.End_Object; + end On_References_Response; + + overriding procedure On_Rename_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceEdit_Or_Null) is + begin + LSP.Output_Tools.Write_Start_Response (Self.Output.all, Id); + Self.Output.Key_Name ("result"); + LSP.Outputs.Write_WorkspaceEdit_Or_Null (Self.Output.all, Value); + Self.Output.End_Object; + end On_Rename_Response; + + overriding procedure On_SelectionRange_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SelectionRange_Vector_Or_Null) is + begin + LSP.Output_Tools.Write_Start_Response (Self.Output.all, Id); + Self.Output.Key_Name ("result"); + LSP.Outputs.Write_SelectionRange_Vector_Or_Null (Self.Output.all, Value); + Self.Output.End_Object; + end On_SelectionRange_Response; + + overriding procedure On_Full_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SemanticTokens_Or_Null) is + begin + LSP.Output_Tools.Write_Start_Response (Self.Output.all, Id); + Self.Output.Key_Name ("result"); + LSP.Outputs.Write_SemanticTokens_Or_Null (Self.Output.all, Value); + Self.Output.End_Object; + end On_Full_Response; + + overriding procedure On_Tokens_Delta_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Tokens_Delta_Result) is + begin + LSP.Output_Tools.Write_Start_Response (Self.Output.all, Id); + Self.Output.Key_Name ("result"); + LSP.Outputs.Write_Tokens_Delta_Result (Self.Output.all, Value); + Self.Output.End_Object; + end On_Tokens_Delta_Response; + + overriding procedure On_Tokens_Range_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SemanticTokens_Or_Null) is + begin + LSP.Output_Tools.Write_Start_Response (Self.Output.all, Id); + Self.Output.Key_Name ("result"); + LSP.Outputs.Write_SemanticTokens_Or_Null (Self.Output.all, Value); + Self.Output.End_Object; + end On_Tokens_Range_Response; + + overriding procedure On_SignatureHelp_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SignatureHelp_Or_Null) is + begin + LSP.Output_Tools.Write_Start_Response (Self.Output.all, Id); + Self.Output.Key_Name ("result"); + LSP.Outputs.Write_SignatureHelp_Or_Null (Self.Output.all, Value); + Self.Output.End_Object; + end On_SignatureHelp_Response; + + overriding procedure On_TypeDefinition_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Definition_Result) is + begin + LSP.Output_Tools.Write_Start_Response (Self.Output.all, Id); + Self.Output.Key_Name ("result"); + LSP.Outputs.Write_Definition_Result (Self.Output.all, Value); + Self.Output.End_Object; + end On_TypeDefinition_Response; + + overriding procedure On_WillSaveWaitUntil_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TextEdit_Vector_Or_Null) is + begin + LSP.Output_Tools.Write_Start_Response (Self.Output.all, Id); + Self.Output.Key_Name ("result"); + LSP.Outputs.Write_TextEdit_Vector_Or_Null (Self.Output.all, Value); + Self.Output.End_Object; + end On_WillSaveWaitUntil_Response; + + overriding procedure On_Subtypes_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TypeHierarchyItem_Vector_Or_Null) is + begin + LSP.Output_Tools.Write_Start_Response (Self.Output.all, Id); + Self.Output.Key_Name ("result"); + LSP.Outputs.Write_TypeHierarchyItem_Vector_Or_Null + (Self.Output.all, Value); + Self.Output.End_Object; + end On_Subtypes_Response; + + overriding procedure On_Supertypes_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TypeHierarchyItem_Vector_Or_Null) is + begin + LSP.Output_Tools.Write_Start_Response (Self.Output.all, Id); + Self.Output.Key_Name ("result"); + LSP.Outputs.Write_TypeHierarchyItem_Vector_Or_Null + (Self.Output.all, Value); + Self.Output.End_Object; + end On_Supertypes_Response; + + overriding procedure On_Workspace_Diagnostic_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceDiagnosticReport) is + begin + LSP.Output_Tools.Write_Start_Response (Self.Output.all, Id); + Self.Output.Key_Name ("result"); + LSP.Outputs.Write_WorkspaceDiagnosticReport (Self.Output.all, Value); + Self.Output.End_Object; + end On_Workspace_Diagnostic_Response; + + overriding procedure On_ExecuteCommand_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.LSPAny_Or_Null) is + begin + LSP.Output_Tools.Write_Start_Response (Self.Output.all, Id); + Self.Output.Key_Name ("result"); + LSP.Outputs.Write_LSPAny_Or_Null (Self.Output.all, Value); + Self.Output.End_Object; + end On_ExecuteCommand_Response; + + overriding procedure On_Symbol_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Symbol_Result) is + begin + LSP.Output_Tools.Write_Start_Response (Self.Output.all, Id); + Self.Output.Key_Name ("result"); + LSP.Outputs.Write_Symbol_Result (Self.Output.all, Value); + Self.Output.End_Object; + end On_Symbol_Response; + + overriding procedure On_WillCreateFiles_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceEdit_Or_Null) is + begin + LSP.Output_Tools.Write_Start_Response (Self.Output.all, Id); + Self.Output.Key_Name ("result"); + LSP.Outputs.Write_WorkspaceEdit_Or_Null (Self.Output.all, Value); + Self.Output.End_Object; + end On_WillCreateFiles_Response; + + overriding procedure On_WillDeleteFiles_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceEdit_Or_Null) is + begin + LSP.Output_Tools.Write_Start_Response (Self.Output.all, Id); + Self.Output.Key_Name ("result"); + LSP.Outputs.Write_WorkspaceEdit_Or_Null (Self.Output.all, Value); + Self.Output.End_Object; + end On_WillDeleteFiles_Response; + + overriding procedure On_WillRenameFiles_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceEdit_Or_Null) is + begin + LSP.Output_Tools.Write_Start_Response (Self.Output.all, Id); + Self.Output.Key_Name ("result"); + LSP.Outputs.Write_WorkspaceEdit_Or_Null (Self.Output.all, Value); + Self.Output.End_Object; + end On_WillRenameFiles_Response; + + overriding procedure On_Symbol_Resolve_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceSymbol) is + begin + LSP.Output_Tools.Write_Start_Response (Self.Output.all, Id); + Self.Output.Key_Name ("result"); + LSP.Outputs.Write_WorkspaceSymbol (Self.Output.all, Value); + Self.Output.End_Object; + end On_Symbol_Resolve_Response; + + overriding procedure On_Error_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Errors.ResponseError) is + begin + LSP.Output_Tools.Write_Start_Response (Self.Output.all, Id); + Self.Output.Key_Name ("error"); + Self.Output.Start_Object; + Self.Output.Key_Name ("code"); + LSP.Outputs.Write_ErrorCodes (Self.Output.all, Value.code); + Self.Output.Key_Name ("message"); + Self.Output.String_Value (Value.message); + Self.Output.End_Object; + Self.Output.End_Object; + end On_Error_Response; + +end LSP.Client_Response_Writers; diff --git a/source/lsp_3.17/generated/lsp-client_response_writers.ads b/source/lsp_3.17/generated/lsp-client_response_writers.ads new file mode 100644 index 000000000..d79bd7706 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_response_writers.ads @@ -0,0 +1,280 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with VSS.JSON.Content_Handlers; + +with LSP.Errors; +with LSP.Structures; +with LSP.Client_Response_Receivers; + +package LSP.Client_Response_Writers is + pragma Preelaborate; + + type Client_Response_Writer + (Output : access VSS.JSON.Content_Handlers.JSON_Content_Handler'Class) is + new LSP.Client_Response_Receivers.Client_Response_Receiver with null record; + + overriding procedure On_IncomingCalls_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CallHierarchyIncomingCall_Vector_Or_Null); + + overriding procedure On_OutgoingCalls_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CallHierarchyOutgoingCall_Vector_Or_Null); + + overriding procedure On_Code_Action_Resolve_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CodeAction); + + overriding procedure On_Code_Lens_Resolve_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CodeLens); + + overriding procedure On_Completion_Resolve_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CompletionItem); + + overriding procedure On_Link_Resolve_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentLink); + + overriding procedure On_Initialize_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InitializeResult); + + overriding procedure On_Inlay_Resolve_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InlayHint); + + overriding procedure On_Shutdown_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Null_Record); + + overriding procedure On_CodeAction_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Command_Or_CodeAction_Vector_Or_Null); + + overriding procedure On_CodeLens_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CodeLens_Vector_Or_Null); + + overriding procedure On_ColorPresentation_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ColorPresentation_Vector); + + overriding procedure On_Completion_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Completion_Result); + + overriding procedure On_Declaration_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Declaration_Result); + + overriding procedure On_Definition_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Definition_Result); + + overriding procedure On_Diagnostic_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentDiagnosticReport); + + overriding procedure On_DocumentColor_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ColorInformation_Vector); + + overriding procedure On_DocumentHighlight_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentHighlight_Vector_Or_Null); + + overriding procedure On_DocumentLink_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentLink_Vector_Or_Null); + + overriding procedure On_DocumentSymbol_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentSymbol_Result); + + overriding procedure On_FoldingRange_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.FoldingRange_Vector_Or_Null); + + overriding procedure On_Formatting_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TextEdit_Vector_Or_Null); + + overriding procedure On_Hover_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Hover_Or_Null); + + overriding procedure On_Implementation_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Definition_Result); + + overriding procedure On_InlayHint_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InlayHint_Vector_Or_Null); + + overriding procedure On_InlineValue_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InlineValue_Vector_Or_Null); + + overriding procedure On_LinkedEditingRange_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.LinkedEditingRanges_Or_Null); + + overriding procedure On_Moniker_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Moniker_Vector_Or_Null); + + overriding procedure On_OnTypeFormatting_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TextEdit_Vector_Or_Null); + + overriding procedure On_PrepareCallHierarchy_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CallHierarchyItem_Vector_Or_Null); + + overriding procedure On_PrepareRename_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.PrepareRenameResult_Or_Null); + + overriding procedure On_PrepareTypeHierarchy_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TypeHierarchyItem_Vector_Or_Null); + + overriding procedure On_RangeFormatting_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TextEdit_Vector_Or_Null); + + overriding procedure On_References_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Location_Vector_Or_Null); + + overriding procedure On_Rename_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceEdit_Or_Null); + + overriding procedure On_SelectionRange_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SelectionRange_Vector_Or_Null); + + overriding procedure On_Full_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SemanticTokens_Or_Null); + + overriding procedure On_Tokens_Delta_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Tokens_Delta_Result); + + overriding procedure On_Tokens_Range_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SemanticTokens_Or_Null); + + overriding procedure On_SignatureHelp_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SignatureHelp_Or_Null); + + overriding procedure On_TypeDefinition_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Definition_Result); + + overriding procedure On_WillSaveWaitUntil_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TextEdit_Vector_Or_Null); + + overriding procedure On_Subtypes_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TypeHierarchyItem_Vector_Or_Null); + + overriding procedure On_Supertypes_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TypeHierarchyItem_Vector_Or_Null); + + overriding procedure On_Workspace_Diagnostic_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceDiagnosticReport); + + overriding procedure On_ExecuteCommand_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.LSPAny_Or_Null); + + overriding procedure On_Symbol_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Symbol_Result); + + overriding procedure On_WillCreateFiles_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceEdit_Or_Null); + + overriding procedure On_WillDeleteFiles_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceEdit_Or_Null); + + overriding procedure On_WillRenameFiles_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceEdit_Or_Null); + + overriding procedure On_Symbol_Resolve_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceSymbol); + + overriding procedure On_Error_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Errors.ResponseError); + +end LSP.Client_Response_Writers; diff --git a/source/lsp_3.17/generated/lsp-client_responses-code_action_resolve.adb b/source/lsp_3.17/generated/lsp-client_responses-code_action_resolve.adb new file mode 100644 index 000000000..3d7093e0e --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-code_action_resolve.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Client_Responses.Code_Action_Resolve is + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class) is + begin + Value.On_Code_Action_Resolve_Response (Self.Id, Self.Result); + end Visit_Client_Receiver; + +end LSP.Client_Responses.Code_Action_Resolve; diff --git a/source/lsp_3.17/generated/lsp-client_responses-code_action_resolve.ads b/source/lsp_3.17/generated/lsp-client_responses-code_action_resolve.ads new file mode 100644 index 000000000..9fecf0362 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-code_action_resolve.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Client_Responses.Code_Action_Resolve is + pragma Preelaborate; + + type Response is new LSP.Client_Responses.Client_Response with record + Result : LSP.Structures.CodeAction; + end record; + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class); + +end LSP.Client_Responses.Code_Action_Resolve; diff --git a/source/lsp_3.17/generated/lsp-client_responses-code_lens_resolve.adb b/source/lsp_3.17/generated/lsp-client_responses-code_lens_resolve.adb new file mode 100644 index 000000000..8088be401 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-code_lens_resolve.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Client_Responses.Code_Lens_Resolve is + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class) is + begin + Value.On_Code_Lens_Resolve_Response (Self.Id, Self.Result); + end Visit_Client_Receiver; + +end LSP.Client_Responses.Code_Lens_Resolve; diff --git a/source/lsp_3.17/generated/lsp-client_responses-code_lens_resolve.ads b/source/lsp_3.17/generated/lsp-client_responses-code_lens_resolve.ads new file mode 100644 index 000000000..c4b130223 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-code_lens_resolve.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Client_Responses.Code_Lens_Resolve is + pragma Preelaborate; + + type Response is new LSP.Client_Responses.Client_Response with record + Result : LSP.Structures.CodeLens; + end record; + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class); + +end LSP.Client_Responses.Code_Lens_Resolve; diff --git a/source/lsp_3.17/generated/lsp-client_responses-codeaction.adb b/source/lsp_3.17/generated/lsp-client_responses-codeaction.adb new file mode 100644 index 000000000..e410b8b52 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-codeaction.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Client_Responses.CodeAction is + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class) is + begin + Value.On_CodeAction_Response (Self.Id, Self.Result); + end Visit_Client_Receiver; + +end LSP.Client_Responses.CodeAction; diff --git a/source/lsp_3.17/generated/lsp-client_responses-codeaction.ads b/source/lsp_3.17/generated/lsp-client_responses-codeaction.ads new file mode 100644 index 000000000..4fe038754 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-codeaction.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Client_Responses.CodeAction is + pragma Preelaborate; + + type Response is new LSP.Client_Responses.Client_Response with record + Result : LSP.Structures.Command_Or_CodeAction_Vector_Or_Null; + end record; + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class); + +end LSP.Client_Responses.CodeAction; diff --git a/source/lsp_3.17/generated/lsp-client_responses-codelens.adb b/source/lsp_3.17/generated/lsp-client_responses-codelens.adb new file mode 100644 index 000000000..90deecf23 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-codelens.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Client_Responses.CodeLens is + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class) is + begin + Value.On_CodeLens_Response (Self.Id, Self.Result); + end Visit_Client_Receiver; + +end LSP.Client_Responses.CodeLens; diff --git a/source/lsp_3.17/generated/lsp-client_responses-codelens.ads b/source/lsp_3.17/generated/lsp-client_responses-codelens.ads new file mode 100644 index 000000000..07f84c819 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-codelens.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Client_Responses.CodeLens is + pragma Preelaborate; + + type Response is new LSP.Client_Responses.Client_Response with record + Result : LSP.Structures.CodeLens_Vector_Or_Null; + end record; + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class); + +end LSP.Client_Responses.CodeLens; diff --git a/source/lsp_3.17/generated/lsp-client_responses-colorpresentation.adb b/source/lsp_3.17/generated/lsp-client_responses-colorpresentation.adb new file mode 100644 index 000000000..857b2dc7f --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-colorpresentation.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Client_Responses.ColorPresentation is + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class) is + begin + Value.On_ColorPresentation_Response (Self.Id, Self.Result); + end Visit_Client_Receiver; + +end LSP.Client_Responses.ColorPresentation; diff --git a/source/lsp_3.17/generated/lsp-client_responses-colorpresentation.ads b/source/lsp_3.17/generated/lsp-client_responses-colorpresentation.ads new file mode 100644 index 000000000..4b820cf34 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-colorpresentation.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Client_Responses.ColorPresentation is + pragma Preelaborate; + + type Response is new LSP.Client_Responses.Client_Response with record + Result : LSP.Structures.ColorPresentation_Vector; + end record; + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class); + +end LSP.Client_Responses.ColorPresentation; diff --git a/source/lsp_3.17/generated/lsp-client_responses-completion.adb b/source/lsp_3.17/generated/lsp-client_responses-completion.adb new file mode 100644 index 000000000..87a3def86 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-completion.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Client_Responses.Completion is + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class) is + begin + Value.On_Completion_Response (Self.Id, Self.Result); + end Visit_Client_Receiver; + +end LSP.Client_Responses.Completion; diff --git a/source/lsp_3.17/generated/lsp-client_responses-completion.ads b/source/lsp_3.17/generated/lsp-client_responses-completion.ads new file mode 100644 index 000000000..dfbb344b1 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-completion.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Client_Responses.Completion is + pragma Preelaborate; + + type Response is new LSP.Client_Responses.Client_Response with record + Result : LSP.Structures.Completion_Result; + end record; + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class); + +end LSP.Client_Responses.Completion; diff --git a/source/lsp_3.17/generated/lsp-client_responses-completion_resolve.adb b/source/lsp_3.17/generated/lsp-client_responses-completion_resolve.adb new file mode 100644 index 000000000..062c52763 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-completion_resolve.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Client_Responses.Completion_Resolve is + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class) is + begin + Value.On_Completion_Resolve_Response (Self.Id, Self.Result); + end Visit_Client_Receiver; + +end LSP.Client_Responses.Completion_Resolve; diff --git a/source/lsp_3.17/generated/lsp-client_responses-completion_resolve.ads b/source/lsp_3.17/generated/lsp-client_responses-completion_resolve.ads new file mode 100644 index 000000000..caf8eba45 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-completion_resolve.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Client_Responses.Completion_Resolve is + pragma Preelaborate; + + type Response is new LSP.Client_Responses.Client_Response with record + Result : LSP.Structures.CompletionItem; + end record; + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class); + +end LSP.Client_Responses.Completion_Resolve; diff --git a/source/lsp_3.17/generated/lsp-client_responses-declaration.adb b/source/lsp_3.17/generated/lsp-client_responses-declaration.adb new file mode 100644 index 000000000..aa98b1c91 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-declaration.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Client_Responses.Declaration is + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class) is + begin + Value.On_Declaration_Response (Self.Id, Self.Result); + end Visit_Client_Receiver; + +end LSP.Client_Responses.Declaration; diff --git a/source/lsp_3.17/generated/lsp-client_responses-declaration.ads b/source/lsp_3.17/generated/lsp-client_responses-declaration.ads new file mode 100644 index 000000000..0417c1b87 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-declaration.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Client_Responses.Declaration is + pragma Preelaborate; + + type Response is new LSP.Client_Responses.Client_Response with record + Result : LSP.Structures.Declaration_Result; + end record; + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class); + +end LSP.Client_Responses.Declaration; diff --git a/source/lsp_3.17/generated/lsp-client_responses-definition.adb b/source/lsp_3.17/generated/lsp-client_responses-definition.adb new file mode 100644 index 000000000..d141a90f6 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-definition.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Client_Responses.Definition is + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class) is + begin + Value.On_Definition_Response (Self.Id, Self.Result); + end Visit_Client_Receiver; + +end LSP.Client_Responses.Definition; diff --git a/source/lsp_3.17/generated/lsp-client_responses-definition.ads b/source/lsp_3.17/generated/lsp-client_responses-definition.ads new file mode 100644 index 000000000..566644f2d --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-definition.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Client_Responses.Definition is + pragma Preelaborate; + + type Response is new LSP.Client_Responses.Client_Response with record + Result : LSP.Structures.Definition_Result; + end record; + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class); + +end LSP.Client_Responses.Definition; diff --git a/source/lsp_3.17/generated/lsp-client_responses-diagnostic.adb b/source/lsp_3.17/generated/lsp-client_responses-diagnostic.adb new file mode 100644 index 000000000..0f5e58b39 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-diagnostic.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Client_Responses.Diagnostic is + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class) is + begin + Value.On_Diagnostic_Response (Self.Id, Self.Result); + end Visit_Client_Receiver; + +end LSP.Client_Responses.Diagnostic; diff --git a/source/lsp_3.17/generated/lsp-client_responses-diagnostic.ads b/source/lsp_3.17/generated/lsp-client_responses-diagnostic.ads new file mode 100644 index 000000000..26202a1d3 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-diagnostic.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Client_Responses.Diagnostic is + pragma Preelaborate; + + type Response is new LSP.Client_Responses.Client_Response with record + Result : LSP.Structures.DocumentDiagnosticReport; + end record; + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class); + +end LSP.Client_Responses.Diagnostic; diff --git a/source/lsp_3.17/generated/lsp-client_responses-documentcolor.adb b/source/lsp_3.17/generated/lsp-client_responses-documentcolor.adb new file mode 100644 index 000000000..147f64d67 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-documentcolor.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Client_Responses.DocumentColor is + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class) is + begin + Value.On_DocumentColor_Response (Self.Id, Self.Result); + end Visit_Client_Receiver; + +end LSP.Client_Responses.DocumentColor; diff --git a/source/lsp_3.17/generated/lsp-client_responses-documentcolor.ads b/source/lsp_3.17/generated/lsp-client_responses-documentcolor.ads new file mode 100644 index 000000000..73395de58 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-documentcolor.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Client_Responses.DocumentColor is + pragma Preelaborate; + + type Response is new LSP.Client_Responses.Client_Response with record + Result : LSP.Structures.ColorInformation_Vector; + end record; + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class); + +end LSP.Client_Responses.DocumentColor; diff --git a/source/lsp_3.17/generated/lsp-client_responses-documenthighlight.adb b/source/lsp_3.17/generated/lsp-client_responses-documenthighlight.adb new file mode 100644 index 000000000..1cc3e93f6 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-documenthighlight.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Client_Responses.DocumentHighlight is + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class) is + begin + Value.On_DocumentHighlight_Response (Self.Id, Self.Result); + end Visit_Client_Receiver; + +end LSP.Client_Responses.DocumentHighlight; diff --git a/source/lsp_3.17/generated/lsp-client_responses-documenthighlight.ads b/source/lsp_3.17/generated/lsp-client_responses-documenthighlight.ads new file mode 100644 index 000000000..17c85024b --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-documenthighlight.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Client_Responses.DocumentHighlight is + pragma Preelaborate; + + type Response is new LSP.Client_Responses.Client_Response with record + Result : LSP.Structures.DocumentHighlight_Vector_Or_Null; + end record; + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class); + +end LSP.Client_Responses.DocumentHighlight; diff --git a/source/lsp_3.17/generated/lsp-client_responses-documentlink.adb b/source/lsp_3.17/generated/lsp-client_responses-documentlink.adb new file mode 100644 index 000000000..e5b954996 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-documentlink.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Client_Responses.DocumentLink is + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class) is + begin + Value.On_DocumentLink_Response (Self.Id, Self.Result); + end Visit_Client_Receiver; + +end LSP.Client_Responses.DocumentLink; diff --git a/source/lsp_3.17/generated/lsp-client_responses-documentlink.ads b/source/lsp_3.17/generated/lsp-client_responses-documentlink.ads new file mode 100644 index 000000000..8d3cdf079 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-documentlink.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Client_Responses.DocumentLink is + pragma Preelaborate; + + type Response is new LSP.Client_Responses.Client_Response with record + Result : LSP.Structures.DocumentLink_Vector_Or_Null; + end record; + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class); + +end LSP.Client_Responses.DocumentLink; diff --git a/source/lsp_3.17/generated/lsp-client_responses-documentsymbol.adb b/source/lsp_3.17/generated/lsp-client_responses-documentsymbol.adb new file mode 100644 index 000000000..416aeaf54 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-documentsymbol.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Client_Responses.DocumentSymbol is + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class) is + begin + Value.On_DocumentSymbol_Response (Self.Id, Self.Result); + end Visit_Client_Receiver; + +end LSP.Client_Responses.DocumentSymbol; diff --git a/source/lsp_3.17/generated/lsp-client_responses-documentsymbol.ads b/source/lsp_3.17/generated/lsp-client_responses-documentsymbol.ads new file mode 100644 index 000000000..faee86f21 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-documentsymbol.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Client_Responses.DocumentSymbol is + pragma Preelaborate; + + type Response is new LSP.Client_Responses.Client_Response with record + Result : LSP.Structures.DocumentSymbol_Result; + end record; + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class); + +end LSP.Client_Responses.DocumentSymbol; diff --git a/source/lsp_3.17/generated/lsp-client_responses-executecommand.adb b/source/lsp_3.17/generated/lsp-client_responses-executecommand.adb new file mode 100644 index 000000000..f28f32ccb --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-executecommand.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Client_Responses.ExecuteCommand is + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class) is + begin + Value.On_ExecuteCommand_Response (Self.Id, Self.Result); + end Visit_Client_Receiver; + +end LSP.Client_Responses.ExecuteCommand; diff --git a/source/lsp_3.17/generated/lsp-client_responses-executecommand.ads b/source/lsp_3.17/generated/lsp-client_responses-executecommand.ads new file mode 100644 index 000000000..93d6a83d9 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-executecommand.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Client_Responses.ExecuteCommand is + pragma Preelaborate; + + type Response is new LSP.Client_Responses.Client_Response with record + Result : LSP.Structures.LSPAny_Or_Null; + end record; + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class); + +end LSP.Client_Responses.ExecuteCommand; diff --git a/source/lsp_3.17/generated/lsp-client_responses-foldingrange.adb b/source/lsp_3.17/generated/lsp-client_responses-foldingrange.adb new file mode 100644 index 000000000..9b79eb404 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-foldingrange.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Client_Responses.FoldingRange is + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class) is + begin + Value.On_FoldingRange_Response (Self.Id, Self.Result); + end Visit_Client_Receiver; + +end LSP.Client_Responses.FoldingRange; diff --git a/source/lsp_3.17/generated/lsp-client_responses-foldingrange.ads b/source/lsp_3.17/generated/lsp-client_responses-foldingrange.ads new file mode 100644 index 000000000..e4f3a2198 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-foldingrange.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Client_Responses.FoldingRange is + pragma Preelaborate; + + type Response is new LSP.Client_Responses.Client_Response with record + Result : LSP.Structures.FoldingRange_Vector_Or_Null; + end record; + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class); + +end LSP.Client_Responses.FoldingRange; diff --git a/source/lsp_3.17/generated/lsp-client_responses-formatting.adb b/source/lsp_3.17/generated/lsp-client_responses-formatting.adb new file mode 100644 index 000000000..ca855264d --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-formatting.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Client_Responses.Formatting is + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class) is + begin + Value.On_Formatting_Response (Self.Id, Self.Result); + end Visit_Client_Receiver; + +end LSP.Client_Responses.Formatting; diff --git a/source/lsp_3.17/generated/lsp-client_responses-formatting.ads b/source/lsp_3.17/generated/lsp-client_responses-formatting.ads new file mode 100644 index 000000000..c0894518e --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-formatting.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Client_Responses.Formatting is + pragma Preelaborate; + + type Response is new LSP.Client_Responses.Client_Response with record + Result : LSP.Structures.TextEdit_Vector_Or_Null; + end record; + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class); + +end LSP.Client_Responses.Formatting; diff --git a/source/lsp_3.17/generated/lsp-client_responses-full.adb b/source/lsp_3.17/generated/lsp-client_responses-full.adb new file mode 100644 index 000000000..14a762b25 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-full.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Client_Responses.Full is + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class) is + begin + Value.On_Full_Response (Self.Id, Self.Result); + end Visit_Client_Receiver; + +end LSP.Client_Responses.Full; diff --git a/source/lsp_3.17/generated/lsp-client_responses-full.ads b/source/lsp_3.17/generated/lsp-client_responses-full.ads new file mode 100644 index 000000000..e20e2640a --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-full.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Client_Responses.Full is + pragma Preelaborate; + + type Response is new LSP.Client_Responses.Client_Response with record + Result : LSP.Structures.SemanticTokens_Or_Null; + end record; + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class); + +end LSP.Client_Responses.Full; diff --git a/source/lsp_3.17/generated/lsp-client_responses-hover.adb b/source/lsp_3.17/generated/lsp-client_responses-hover.adb new file mode 100644 index 000000000..44a89da66 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-hover.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Client_Responses.Hover is + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class) is + begin + Value.On_Hover_Response (Self.Id, Self.Result); + end Visit_Client_Receiver; + +end LSP.Client_Responses.Hover; diff --git a/source/lsp_3.17/generated/lsp-client_responses-hover.ads b/source/lsp_3.17/generated/lsp-client_responses-hover.ads new file mode 100644 index 000000000..50f617d02 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-hover.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Client_Responses.Hover is + pragma Preelaborate; + + type Response is new LSP.Client_Responses.Client_Response with record + Result : LSP.Structures.Hover_Or_Null; + end record; + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class); + +end LSP.Client_Responses.Hover; diff --git a/source/lsp_3.17/generated/lsp-client_responses-implementation.adb b/source/lsp_3.17/generated/lsp-client_responses-implementation.adb new file mode 100644 index 000000000..e35af4a2d --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-implementation.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Client_Responses.Implementation is + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class) is + begin + Value.On_Implementation_Response (Self.Id, Self.Result); + end Visit_Client_Receiver; + +end LSP.Client_Responses.Implementation; diff --git a/source/lsp_3.17/generated/lsp-client_responses-implementation.ads b/source/lsp_3.17/generated/lsp-client_responses-implementation.ads new file mode 100644 index 000000000..faf1d6cac --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-implementation.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Client_Responses.Implementation is + pragma Preelaborate; + + type Response is new LSP.Client_Responses.Client_Response with record + Result : LSP.Structures.Definition_Result; + end record; + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class); + +end LSP.Client_Responses.Implementation; diff --git a/source/lsp_3.17/generated/lsp-client_responses-incomingcalls.adb b/source/lsp_3.17/generated/lsp-client_responses-incomingcalls.adb new file mode 100644 index 000000000..e1e825554 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-incomingcalls.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Client_Responses.IncomingCalls is + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class) is + begin + Value.On_IncomingCalls_Response (Self.Id, Self.Result); + end Visit_Client_Receiver; + +end LSP.Client_Responses.IncomingCalls; diff --git a/source/lsp_3.17/generated/lsp-client_responses-incomingcalls.ads b/source/lsp_3.17/generated/lsp-client_responses-incomingcalls.ads new file mode 100644 index 000000000..b2255d6f5 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-incomingcalls.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Client_Responses.IncomingCalls is + pragma Preelaborate; + + type Response is new LSP.Client_Responses.Client_Response with record + Result : LSP.Structures.CallHierarchyIncomingCall_Vector_Or_Null; + end record; + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class); + +end LSP.Client_Responses.IncomingCalls; diff --git a/source/lsp_3.17/generated/lsp-client_responses-initialize.adb b/source/lsp_3.17/generated/lsp-client_responses-initialize.adb new file mode 100644 index 000000000..a2c3771cd --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-initialize.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Client_Responses.Initialize is + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class) is + begin + Value.On_Initialize_Response (Self.Id, Self.Result); + end Visit_Client_Receiver; + +end LSP.Client_Responses.Initialize; diff --git a/source/lsp_3.17/generated/lsp-client_responses-initialize.ads b/source/lsp_3.17/generated/lsp-client_responses-initialize.ads new file mode 100644 index 000000000..c32794c1c --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-initialize.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Client_Responses.Initialize is + pragma Preelaborate; + + type Response is new LSP.Client_Responses.Client_Response with record + Result : LSP.Structures.InitializeResult; + end record; + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class); + +end LSP.Client_Responses.Initialize; diff --git a/source/lsp_3.17/generated/lsp-client_responses-inlay_resolve.adb b/source/lsp_3.17/generated/lsp-client_responses-inlay_resolve.adb new file mode 100644 index 000000000..03079266e --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-inlay_resolve.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Client_Responses.Inlay_Resolve is + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class) is + begin + Value.On_Inlay_Resolve_Response (Self.Id, Self.Result); + end Visit_Client_Receiver; + +end LSP.Client_Responses.Inlay_Resolve; diff --git a/source/lsp_3.17/generated/lsp-client_responses-inlay_resolve.ads b/source/lsp_3.17/generated/lsp-client_responses-inlay_resolve.ads new file mode 100644 index 000000000..77a556aee --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-inlay_resolve.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Client_Responses.Inlay_Resolve is + pragma Preelaborate; + + type Response is new LSP.Client_Responses.Client_Response with record + Result : LSP.Structures.InlayHint; + end record; + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class); + +end LSP.Client_Responses.Inlay_Resolve; diff --git a/source/lsp_3.17/generated/lsp-client_responses-inlayhint.adb b/source/lsp_3.17/generated/lsp-client_responses-inlayhint.adb new file mode 100644 index 000000000..41ad7e0c9 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-inlayhint.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Client_Responses.InlayHint is + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class) is + begin + Value.On_InlayHint_Response (Self.Id, Self.Result); + end Visit_Client_Receiver; + +end LSP.Client_Responses.InlayHint; diff --git a/source/lsp_3.17/generated/lsp-client_responses-inlayhint.ads b/source/lsp_3.17/generated/lsp-client_responses-inlayhint.ads new file mode 100644 index 000000000..7eb906493 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-inlayhint.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Client_Responses.InlayHint is + pragma Preelaborate; + + type Response is new LSP.Client_Responses.Client_Response with record + Result : LSP.Structures.InlayHint_Vector_Or_Null; + end record; + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class); + +end LSP.Client_Responses.InlayHint; diff --git a/source/lsp_3.17/generated/lsp-client_responses-inlinevalue.adb b/source/lsp_3.17/generated/lsp-client_responses-inlinevalue.adb new file mode 100644 index 000000000..54ca41cc3 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-inlinevalue.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Client_Responses.InlineValue is + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class) is + begin + Value.On_InlineValue_Response (Self.Id, Self.Result); + end Visit_Client_Receiver; + +end LSP.Client_Responses.InlineValue; diff --git a/source/lsp_3.17/generated/lsp-client_responses-inlinevalue.ads b/source/lsp_3.17/generated/lsp-client_responses-inlinevalue.ads new file mode 100644 index 000000000..800622743 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-inlinevalue.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Client_Responses.InlineValue is + pragma Preelaborate; + + type Response is new LSP.Client_Responses.Client_Response with record + Result : LSP.Structures.InlineValue_Vector_Or_Null; + end record; + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class); + +end LSP.Client_Responses.InlineValue; diff --git a/source/lsp_3.17/generated/lsp-client_responses-link_resolve.adb b/source/lsp_3.17/generated/lsp-client_responses-link_resolve.adb new file mode 100644 index 000000000..8f7481e56 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-link_resolve.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Client_Responses.Link_Resolve is + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class) is + begin + Value.On_Link_Resolve_Response (Self.Id, Self.Result); + end Visit_Client_Receiver; + +end LSP.Client_Responses.Link_Resolve; diff --git a/source/lsp_3.17/generated/lsp-client_responses-link_resolve.ads b/source/lsp_3.17/generated/lsp-client_responses-link_resolve.ads new file mode 100644 index 000000000..57f0107ba --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-link_resolve.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Client_Responses.Link_Resolve is + pragma Preelaborate; + + type Response is new LSP.Client_Responses.Client_Response with record + Result : LSP.Structures.DocumentLink; + end record; + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class); + +end LSP.Client_Responses.Link_Resolve; diff --git a/source/lsp_3.17/generated/lsp-client_responses-linkededitingrange.adb b/source/lsp_3.17/generated/lsp-client_responses-linkededitingrange.adb new file mode 100644 index 000000000..8e217c77f --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-linkededitingrange.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Client_Responses.LinkedEditingRange is + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class) is + begin + Value.On_LinkedEditingRange_Response (Self.Id, Self.Result); + end Visit_Client_Receiver; + +end LSP.Client_Responses.LinkedEditingRange; diff --git a/source/lsp_3.17/generated/lsp-client_responses-linkededitingrange.ads b/source/lsp_3.17/generated/lsp-client_responses-linkededitingrange.ads new file mode 100644 index 000000000..47fb8e438 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-linkededitingrange.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Client_Responses.LinkedEditingRange is + pragma Preelaborate; + + type Response is new LSP.Client_Responses.Client_Response with record + Result : LSP.Structures.LinkedEditingRanges_Or_Null; + end record; + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class); + +end LSP.Client_Responses.LinkedEditingRange; diff --git a/source/lsp_3.17/generated/lsp-client_responses-moniker.adb b/source/lsp_3.17/generated/lsp-client_responses-moniker.adb new file mode 100644 index 000000000..87e2b4805 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-moniker.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Client_Responses.Moniker is + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class) is + begin + Value.On_Moniker_Response (Self.Id, Self.Result); + end Visit_Client_Receiver; + +end LSP.Client_Responses.Moniker; diff --git a/source/lsp_3.17/generated/lsp-client_responses-moniker.ads b/source/lsp_3.17/generated/lsp-client_responses-moniker.ads new file mode 100644 index 000000000..25ee78113 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-moniker.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Client_Responses.Moniker is + pragma Preelaborate; + + type Response is new LSP.Client_Responses.Client_Response with record + Result : LSP.Structures.Moniker_Vector_Or_Null; + end record; + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class); + +end LSP.Client_Responses.Moniker; diff --git a/source/lsp_3.17/generated/lsp-client_responses-ontypeformatting.adb b/source/lsp_3.17/generated/lsp-client_responses-ontypeformatting.adb new file mode 100644 index 000000000..44b943207 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-ontypeformatting.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Client_Responses.OnTypeFormatting is + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class) is + begin + Value.On_OnTypeFormatting_Response (Self.Id, Self.Result); + end Visit_Client_Receiver; + +end LSP.Client_Responses.OnTypeFormatting; diff --git a/source/lsp_3.17/generated/lsp-client_responses-ontypeformatting.ads b/source/lsp_3.17/generated/lsp-client_responses-ontypeformatting.ads new file mode 100644 index 000000000..0847531d3 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-ontypeformatting.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Client_Responses.OnTypeFormatting is + pragma Preelaborate; + + type Response is new LSP.Client_Responses.Client_Response with record + Result : LSP.Structures.TextEdit_Vector_Or_Null; + end record; + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class); + +end LSP.Client_Responses.OnTypeFormatting; diff --git a/source/lsp_3.17/generated/lsp-client_responses-outgoingcalls.adb b/source/lsp_3.17/generated/lsp-client_responses-outgoingcalls.adb new file mode 100644 index 000000000..3bc0fe0d6 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-outgoingcalls.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Client_Responses.OutgoingCalls is + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class) is + begin + Value.On_OutgoingCalls_Response (Self.Id, Self.Result); + end Visit_Client_Receiver; + +end LSP.Client_Responses.OutgoingCalls; diff --git a/source/lsp_3.17/generated/lsp-client_responses-outgoingcalls.ads b/source/lsp_3.17/generated/lsp-client_responses-outgoingcalls.ads new file mode 100644 index 000000000..6259a1d05 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-outgoingcalls.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Client_Responses.OutgoingCalls is + pragma Preelaborate; + + type Response is new LSP.Client_Responses.Client_Response with record + Result : LSP.Structures.CallHierarchyOutgoingCall_Vector_Or_Null; + end record; + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class); + +end LSP.Client_Responses.OutgoingCalls; diff --git a/source/lsp_3.17/generated/lsp-client_responses-preparecallhierarchy.adb b/source/lsp_3.17/generated/lsp-client_responses-preparecallhierarchy.adb new file mode 100644 index 000000000..0591c4b90 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-preparecallhierarchy.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Client_Responses.PrepareCallHierarchy is + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class) is + begin + Value.On_PrepareCallHierarchy_Response (Self.Id, Self.Result); + end Visit_Client_Receiver; + +end LSP.Client_Responses.PrepareCallHierarchy; diff --git a/source/lsp_3.17/generated/lsp-client_responses-preparecallhierarchy.ads b/source/lsp_3.17/generated/lsp-client_responses-preparecallhierarchy.ads new file mode 100644 index 000000000..254c56c42 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-preparecallhierarchy.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Client_Responses.PrepareCallHierarchy is + pragma Preelaborate; + + type Response is new LSP.Client_Responses.Client_Response with record + Result : LSP.Structures.CallHierarchyItem_Vector_Or_Null; + end record; + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class); + +end LSP.Client_Responses.PrepareCallHierarchy; diff --git a/source/lsp_3.17/generated/lsp-client_responses-preparerename.adb b/source/lsp_3.17/generated/lsp-client_responses-preparerename.adb new file mode 100644 index 000000000..316dc5166 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-preparerename.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Client_Responses.PrepareRename is + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class) is + begin + Value.On_PrepareRename_Response (Self.Id, Self.Result); + end Visit_Client_Receiver; + +end LSP.Client_Responses.PrepareRename; diff --git a/source/lsp_3.17/generated/lsp-client_responses-preparerename.ads b/source/lsp_3.17/generated/lsp-client_responses-preparerename.ads new file mode 100644 index 000000000..e633db602 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-preparerename.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Client_Responses.PrepareRename is + pragma Preelaborate; + + type Response is new LSP.Client_Responses.Client_Response with record + Result : LSP.Structures.PrepareRenameResult_Or_Null; + end record; + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class); + +end LSP.Client_Responses.PrepareRename; diff --git a/source/lsp_3.17/generated/lsp-client_responses-preparetypehierarchy.adb b/source/lsp_3.17/generated/lsp-client_responses-preparetypehierarchy.adb new file mode 100644 index 000000000..77c8b39b3 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-preparetypehierarchy.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Client_Responses.PrepareTypeHierarchy is + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class) is + begin + Value.On_PrepareTypeHierarchy_Response (Self.Id, Self.Result); + end Visit_Client_Receiver; + +end LSP.Client_Responses.PrepareTypeHierarchy; diff --git a/source/lsp_3.17/generated/lsp-client_responses-preparetypehierarchy.ads b/source/lsp_3.17/generated/lsp-client_responses-preparetypehierarchy.ads new file mode 100644 index 000000000..267f3694c --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-preparetypehierarchy.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Client_Responses.PrepareTypeHierarchy is + pragma Preelaborate; + + type Response is new LSP.Client_Responses.Client_Response with record + Result : LSP.Structures.TypeHierarchyItem_Vector_Or_Null; + end record; + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class); + +end LSP.Client_Responses.PrepareTypeHierarchy; diff --git a/source/lsp_3.17/generated/lsp-client_responses-rangeformatting.adb b/source/lsp_3.17/generated/lsp-client_responses-rangeformatting.adb new file mode 100644 index 000000000..514b28928 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-rangeformatting.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Client_Responses.RangeFormatting is + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class) is + begin + Value.On_RangeFormatting_Response (Self.Id, Self.Result); + end Visit_Client_Receiver; + +end LSP.Client_Responses.RangeFormatting; diff --git a/source/lsp_3.17/generated/lsp-client_responses-rangeformatting.ads b/source/lsp_3.17/generated/lsp-client_responses-rangeformatting.ads new file mode 100644 index 000000000..4d2146209 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-rangeformatting.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Client_Responses.RangeFormatting is + pragma Preelaborate; + + type Response is new LSP.Client_Responses.Client_Response with record + Result : LSP.Structures.TextEdit_Vector_Or_Null; + end record; + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class); + +end LSP.Client_Responses.RangeFormatting; diff --git a/source/lsp_3.17/generated/lsp-client_responses-references.adb b/source/lsp_3.17/generated/lsp-client_responses-references.adb new file mode 100644 index 000000000..62995d47f --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-references.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Client_Responses.References is + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class) is + begin + Value.On_References_Response (Self.Id, Self.Result); + end Visit_Client_Receiver; + +end LSP.Client_Responses.References; diff --git a/source/lsp_3.17/generated/lsp-client_responses-references.ads b/source/lsp_3.17/generated/lsp-client_responses-references.ads new file mode 100644 index 000000000..2c66b2491 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-references.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Client_Responses.References is + pragma Preelaborate; + + type Response is new LSP.Client_Responses.Client_Response with record + Result : LSP.Structures.Location_Vector_Or_Null; + end record; + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class); + +end LSP.Client_Responses.References; diff --git a/source/lsp_3.17/generated/lsp-client_responses-rename.adb b/source/lsp_3.17/generated/lsp-client_responses-rename.adb new file mode 100644 index 000000000..7b246010d --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-rename.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Client_Responses.Rename is + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class) is + begin + Value.On_Rename_Response (Self.Id, Self.Result); + end Visit_Client_Receiver; + +end LSP.Client_Responses.Rename; diff --git a/source/lsp_3.17/generated/lsp-client_responses-rename.ads b/source/lsp_3.17/generated/lsp-client_responses-rename.ads new file mode 100644 index 000000000..25db1fad1 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-rename.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Client_Responses.Rename is + pragma Preelaborate; + + type Response is new LSP.Client_Responses.Client_Response with record + Result : LSP.Structures.WorkspaceEdit_Or_Null; + end record; + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class); + +end LSP.Client_Responses.Rename; diff --git a/source/lsp_3.17/generated/lsp-client_responses-selectionrange.adb b/source/lsp_3.17/generated/lsp-client_responses-selectionrange.adb new file mode 100644 index 000000000..ec190c1ac --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-selectionrange.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Client_Responses.SelectionRange is + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class) is + begin + Value.On_SelectionRange_Response (Self.Id, Self.Result); + end Visit_Client_Receiver; + +end LSP.Client_Responses.SelectionRange; diff --git a/source/lsp_3.17/generated/lsp-client_responses-selectionrange.ads b/source/lsp_3.17/generated/lsp-client_responses-selectionrange.ads new file mode 100644 index 000000000..60adb3b15 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-selectionrange.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Client_Responses.SelectionRange is + pragma Preelaborate; + + type Response is new LSP.Client_Responses.Client_Response with record + Result : LSP.Structures.SelectionRange_Vector_Or_Null; + end record; + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class); + +end LSP.Client_Responses.SelectionRange; diff --git a/source/lsp_3.17/generated/lsp-client_responses-shutdown.adb b/source/lsp_3.17/generated/lsp-client_responses-shutdown.adb new file mode 100644 index 000000000..02f4c9a65 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-shutdown.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Client_Responses.Shutdown is + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class) is + begin + Value.On_Shutdown_Response (Self.Id, Self.Result); + end Visit_Client_Receiver; + +end LSP.Client_Responses.Shutdown; diff --git a/source/lsp_3.17/generated/lsp-client_responses-shutdown.ads b/source/lsp_3.17/generated/lsp-client_responses-shutdown.ads new file mode 100644 index 000000000..19dc81ef6 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-shutdown.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Client_Responses.Shutdown is + pragma Preelaborate; + + type Response is new LSP.Client_Responses.Client_Response with record + Result : LSP.Structures.Null_Record; + end record; + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class); + +end LSP.Client_Responses.Shutdown; diff --git a/source/lsp_3.17/generated/lsp-client_responses-signaturehelp.adb b/source/lsp_3.17/generated/lsp-client_responses-signaturehelp.adb new file mode 100644 index 000000000..fa489ab3a --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-signaturehelp.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Client_Responses.SignatureHelp is + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class) is + begin + Value.On_SignatureHelp_Response (Self.Id, Self.Result); + end Visit_Client_Receiver; + +end LSP.Client_Responses.SignatureHelp; diff --git a/source/lsp_3.17/generated/lsp-client_responses-signaturehelp.ads b/source/lsp_3.17/generated/lsp-client_responses-signaturehelp.ads new file mode 100644 index 000000000..ea1ea95d7 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-signaturehelp.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Client_Responses.SignatureHelp is + pragma Preelaborate; + + type Response is new LSP.Client_Responses.Client_Response with record + Result : LSP.Structures.SignatureHelp_Or_Null; + end record; + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class); + +end LSP.Client_Responses.SignatureHelp; diff --git a/source/lsp_3.17/generated/lsp-client_responses-subtypes.adb b/source/lsp_3.17/generated/lsp-client_responses-subtypes.adb new file mode 100644 index 000000000..8dab461a9 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-subtypes.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Client_Responses.Subtypes is + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class) is + begin + Value.On_Subtypes_Response (Self.Id, Self.Result); + end Visit_Client_Receiver; + +end LSP.Client_Responses.Subtypes; diff --git a/source/lsp_3.17/generated/lsp-client_responses-subtypes.ads b/source/lsp_3.17/generated/lsp-client_responses-subtypes.ads new file mode 100644 index 000000000..4bcdb3b5f --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-subtypes.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Client_Responses.Subtypes is + pragma Preelaborate; + + type Response is new LSP.Client_Responses.Client_Response with record + Result : LSP.Structures.TypeHierarchyItem_Vector_Or_Null; + end record; + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class); + +end LSP.Client_Responses.Subtypes; diff --git a/source/lsp_3.17/generated/lsp-client_responses-supertypes.adb b/source/lsp_3.17/generated/lsp-client_responses-supertypes.adb new file mode 100644 index 000000000..dda0d621b --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-supertypes.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Client_Responses.Supertypes is + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class) is + begin + Value.On_Supertypes_Response (Self.Id, Self.Result); + end Visit_Client_Receiver; + +end LSP.Client_Responses.Supertypes; diff --git a/source/lsp_3.17/generated/lsp-client_responses-supertypes.ads b/source/lsp_3.17/generated/lsp-client_responses-supertypes.ads new file mode 100644 index 000000000..780b9bb2b --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-supertypes.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Client_Responses.Supertypes is + pragma Preelaborate; + + type Response is new LSP.Client_Responses.Client_Response with record + Result : LSP.Structures.TypeHierarchyItem_Vector_Or_Null; + end record; + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class); + +end LSP.Client_Responses.Supertypes; diff --git a/source/lsp_3.17/generated/lsp-client_responses-symbol.adb b/source/lsp_3.17/generated/lsp-client_responses-symbol.adb new file mode 100644 index 000000000..4249a9423 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-symbol.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Client_Responses.Symbol is + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class) is + begin + Value.On_Symbol_Response (Self.Id, Self.Result); + end Visit_Client_Receiver; + +end LSP.Client_Responses.Symbol; diff --git a/source/lsp_3.17/generated/lsp-client_responses-symbol.ads b/source/lsp_3.17/generated/lsp-client_responses-symbol.ads new file mode 100644 index 000000000..a56fd3c61 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-symbol.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Client_Responses.Symbol is + pragma Preelaborate; + + type Response is new LSP.Client_Responses.Client_Response with record + Result : LSP.Structures.Symbol_Result; + end record; + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class); + +end LSP.Client_Responses.Symbol; diff --git a/source/lsp_3.17/generated/lsp-client_responses-symbol_resolve.adb b/source/lsp_3.17/generated/lsp-client_responses-symbol_resolve.adb new file mode 100644 index 000000000..6493aa3cc --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-symbol_resolve.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Client_Responses.Symbol_Resolve is + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class) is + begin + Value.On_Symbol_Resolve_Response (Self.Id, Self.Result); + end Visit_Client_Receiver; + +end LSP.Client_Responses.Symbol_Resolve; diff --git a/source/lsp_3.17/generated/lsp-client_responses-symbol_resolve.ads b/source/lsp_3.17/generated/lsp-client_responses-symbol_resolve.ads new file mode 100644 index 000000000..dfedea14a --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-symbol_resolve.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Client_Responses.Symbol_Resolve is + pragma Preelaborate; + + type Response is new LSP.Client_Responses.Client_Response with record + Result : LSP.Structures.WorkspaceSymbol; + end record; + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class); + +end LSP.Client_Responses.Symbol_Resolve; diff --git a/source/lsp_3.17/generated/lsp-client_responses-tokens_delta.adb b/source/lsp_3.17/generated/lsp-client_responses-tokens_delta.adb new file mode 100644 index 000000000..a47f4457a --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-tokens_delta.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Client_Responses.Tokens_Delta is + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class) is + begin + Value.On_Tokens_Delta_Response (Self.Id, Self.Result); + end Visit_Client_Receiver; + +end LSP.Client_Responses.Tokens_Delta; diff --git a/source/lsp_3.17/generated/lsp-client_responses-tokens_delta.ads b/source/lsp_3.17/generated/lsp-client_responses-tokens_delta.ads new file mode 100644 index 000000000..3a9c4b8b3 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-tokens_delta.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Client_Responses.Tokens_Delta is + pragma Preelaborate; + + type Response is new LSP.Client_Responses.Client_Response with record + Result : LSP.Structures.Tokens_Delta_Result; + end record; + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class); + +end LSP.Client_Responses.Tokens_Delta; diff --git a/source/lsp_3.17/generated/lsp-client_responses-tokens_range.adb b/source/lsp_3.17/generated/lsp-client_responses-tokens_range.adb new file mode 100644 index 000000000..8a2d7dbf1 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-tokens_range.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Client_Responses.Tokens_Range is + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class) is + begin + Value.On_Tokens_Range_Response (Self.Id, Self.Result); + end Visit_Client_Receiver; + +end LSP.Client_Responses.Tokens_Range; diff --git a/source/lsp_3.17/generated/lsp-client_responses-tokens_range.ads b/source/lsp_3.17/generated/lsp-client_responses-tokens_range.ads new file mode 100644 index 000000000..5626482a1 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-tokens_range.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Client_Responses.Tokens_Range is + pragma Preelaborate; + + type Response is new LSP.Client_Responses.Client_Response with record + Result : LSP.Structures.SemanticTokens_Or_Null; + end record; + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class); + +end LSP.Client_Responses.Tokens_Range; diff --git a/source/lsp_3.17/generated/lsp-client_responses-typedefinition.adb b/source/lsp_3.17/generated/lsp-client_responses-typedefinition.adb new file mode 100644 index 000000000..43906ba64 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-typedefinition.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Client_Responses.TypeDefinition is + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class) is + begin + Value.On_TypeDefinition_Response (Self.Id, Self.Result); + end Visit_Client_Receiver; + +end LSP.Client_Responses.TypeDefinition; diff --git a/source/lsp_3.17/generated/lsp-client_responses-typedefinition.ads b/source/lsp_3.17/generated/lsp-client_responses-typedefinition.ads new file mode 100644 index 000000000..2284c11f0 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-typedefinition.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Client_Responses.TypeDefinition is + pragma Preelaborate; + + type Response is new LSP.Client_Responses.Client_Response with record + Result : LSP.Structures.Definition_Result; + end record; + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class); + +end LSP.Client_Responses.TypeDefinition; diff --git a/source/lsp_3.17/generated/lsp-client_responses-willcreatefiles.adb b/source/lsp_3.17/generated/lsp-client_responses-willcreatefiles.adb new file mode 100644 index 000000000..fb2a86882 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-willcreatefiles.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Client_Responses.WillCreateFiles is + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class) is + begin + Value.On_WillCreateFiles_Response (Self.Id, Self.Result); + end Visit_Client_Receiver; + +end LSP.Client_Responses.WillCreateFiles; diff --git a/source/lsp_3.17/generated/lsp-client_responses-willcreatefiles.ads b/source/lsp_3.17/generated/lsp-client_responses-willcreatefiles.ads new file mode 100644 index 000000000..cfd928955 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-willcreatefiles.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Client_Responses.WillCreateFiles is + pragma Preelaborate; + + type Response is new LSP.Client_Responses.Client_Response with record + Result : LSP.Structures.WorkspaceEdit_Or_Null; + end record; + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class); + +end LSP.Client_Responses.WillCreateFiles; diff --git a/source/lsp_3.17/generated/lsp-client_responses-willdeletefiles.adb b/source/lsp_3.17/generated/lsp-client_responses-willdeletefiles.adb new file mode 100644 index 000000000..f472e6be4 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-willdeletefiles.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Client_Responses.WillDeleteFiles is + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class) is + begin + Value.On_WillDeleteFiles_Response (Self.Id, Self.Result); + end Visit_Client_Receiver; + +end LSP.Client_Responses.WillDeleteFiles; diff --git a/source/lsp_3.17/generated/lsp-client_responses-willdeletefiles.ads b/source/lsp_3.17/generated/lsp-client_responses-willdeletefiles.ads new file mode 100644 index 000000000..ab8942516 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-willdeletefiles.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Client_Responses.WillDeleteFiles is + pragma Preelaborate; + + type Response is new LSP.Client_Responses.Client_Response with record + Result : LSP.Structures.WorkspaceEdit_Or_Null; + end record; + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class); + +end LSP.Client_Responses.WillDeleteFiles; diff --git a/source/lsp_3.17/generated/lsp-client_responses-willrenamefiles.adb b/source/lsp_3.17/generated/lsp-client_responses-willrenamefiles.adb new file mode 100644 index 000000000..62ff06054 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-willrenamefiles.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Client_Responses.WillRenameFiles is + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class) is + begin + Value.On_WillRenameFiles_Response (Self.Id, Self.Result); + end Visit_Client_Receiver; + +end LSP.Client_Responses.WillRenameFiles; diff --git a/source/lsp_3.17/generated/lsp-client_responses-willrenamefiles.ads b/source/lsp_3.17/generated/lsp-client_responses-willrenamefiles.ads new file mode 100644 index 000000000..5cc76eaeb --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-willrenamefiles.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Client_Responses.WillRenameFiles is + pragma Preelaborate; + + type Response is new LSP.Client_Responses.Client_Response with record + Result : LSP.Structures.WorkspaceEdit_Or_Null; + end record; + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class); + +end LSP.Client_Responses.WillRenameFiles; diff --git a/source/lsp_3.17/generated/lsp-client_responses-willsavewaituntil.adb b/source/lsp_3.17/generated/lsp-client_responses-willsavewaituntil.adb new file mode 100644 index 000000000..435f99623 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-willsavewaituntil.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Client_Responses.WillSaveWaitUntil is + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class) is + begin + Value.On_WillSaveWaitUntil_Response (Self.Id, Self.Result); + end Visit_Client_Receiver; + +end LSP.Client_Responses.WillSaveWaitUntil; diff --git a/source/lsp_3.17/generated/lsp-client_responses-willsavewaituntil.ads b/source/lsp_3.17/generated/lsp-client_responses-willsavewaituntil.ads new file mode 100644 index 000000000..29072c637 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-willsavewaituntil.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Client_Responses.WillSaveWaitUntil is + pragma Preelaborate; + + type Response is new LSP.Client_Responses.Client_Response with record + Result : LSP.Structures.TextEdit_Vector_Or_Null; + end record; + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class); + +end LSP.Client_Responses.WillSaveWaitUntil; diff --git a/source/lsp_3.17/generated/lsp-client_responses-workspace_diagnostic.adb b/source/lsp_3.17/generated/lsp-client_responses-workspace_diagnostic.adb new file mode 100644 index 000000000..fc98fce17 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-workspace_diagnostic.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Client_Responses.Workspace_Diagnostic is + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class) is + begin + Value.On_Workspace_Diagnostic_Response (Self.Id, Self.Result); + end Visit_Client_Receiver; + +end LSP.Client_Responses.Workspace_Diagnostic; diff --git a/source/lsp_3.17/generated/lsp-client_responses-workspace_diagnostic.ads b/source/lsp_3.17/generated/lsp-client_responses-workspace_diagnostic.ads new file mode 100644 index 000000000..ce1628272 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-workspace_diagnostic.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Client_Responses.Workspace_Diagnostic is + pragma Preelaborate; + + type Response is new LSP.Client_Responses.Client_Response with record + Result : LSP.Structures.WorkspaceDiagnosticReport; + end record; + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class); + +end LSP.Client_Responses.Workspace_Diagnostic; diff --git a/source/lsp_3.17/generated/lsp-enumerations.ads b/source/lsp_3.17/generated/lsp-enumerations.ads new file mode 100644 index 000000000..c2579230c --- /dev/null +++ b/source/lsp_3.17/generated/lsp-enumerations.ads @@ -0,0 +1,556 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package LSP.Enumerations is + pragma Preelaborate; + + type CodeActionKind is + (Empty, QuickFix, Refactor, RefactorExtract, RefactorInline, + RefactorRewrite, Source, SourceOrganizeImports, SourceFixAll); + -- A set of predefined code action kinds + -- + -- @value Empty + -- Empty kind. + -- + -- @value QuickFix + -- Base kind for quickfix actions: 'quickfix' + -- + -- @value Refactor + -- Base kind for refactoring actions: 'refactor' + -- + -- @value RefactorExtract + -- Base kind for refactoring extraction actions: 'refactor.extract' + -- + -- Example extract actions: + -- + -- - Extract method + -- - Extract function + -- - Extract variable + -- - Extract interface from class - ... + -- + -- @value RefactorInline + -- Base kind for refactoring inline actions: 'refactor.inline' + -- + -- Example inline actions: + -- + -- - Inline function + -- - Inline variable + -- - Inline constant + -- - ... + -- + -- @value RefactorRewrite + -- Base kind for refactoring rewrite actions: 'refactor.rewrite' + -- + -- Example rewrite actions: + -- + -- - Convert JavaScript function to class - Add or remove parameter - + -- Encapsulate field - Make method static - Move method to base class - ... + -- + -- @value Source + -- Base kind for source actions: `source` + -- + -- Source code actions apply to the entire file. + -- + -- @value SourceOrganizeImports + -- Base kind for an organize imports source action: + -- `source.organizeImports` + -- + -- @value SourceFixAll + -- Base kind for auto-fix source actions: `source.fixAll`. + -- + -- Fix all actions automatically fix errors that have a clear fix that + -- do not require user input. They should not suppress errors or perform + -- unsafe fixes such as generating new types or classes. + -- + -- @since 3.15.0 + + type CodeActionTriggerKind is (Invoked, Automatic); + -- The reason why code actions were requested. + -- + -- @since 3.17.0 + -- + -- @value Invoked + -- Code actions were explicitly requested by the user or by an extension. + -- + -- @value Automatic + -- Code actions were requested automatically. + -- + -- This typically happens when current selection in a file changes, but can + -- also be triggered when file content changes. + + type CompletionItemKind is + (Text, Method, A_Function, Constructor, Field, Variable, Class, + An_Interface, Module, Property, Unit, Value, Enum, Keyword, Snippet, + Color, File, Reference, Folder, EnumMember, A_Constant, Struct, Event, + Operator, TypeParameter); + -- The kind of a completion entry. + + type CompletionItemTag is (Deprecated); + -- Completion item tags are extra annotations that tweak the rendering of a + -- completion item. + -- + -- @since 3.15.0 + -- + -- @value Deprecated + -- Render a completion as obsolete, usually using a strike-out. + + type CompletionTriggerKind is + (Invoked, TriggerCharacter, TriggerForIncompleteCompletions); + -- How a completion was triggered + -- + -- @value Invoked + -- Completion was triggered by typing an identifier (24x7 code complete), + -- manual invocation (e.g Ctrl+Space) or via API. + -- + -- @value TriggerCharacter + -- Completion was triggered by a trigger character specified by the + -- `triggerCharacters` properties of the `CompletionRegistrationOptions`. + -- + -- @value TriggerForIncompleteCompletions + -- Completion was re-triggered as current completion list is incomplete + + type DiagnosticSeverity is (Error, Warning, Information, Hint); + -- The diagnostic's severity. + -- + -- @value Error + -- Reports an error. + -- + -- @value Warning + -- Reports a warning. + -- + -- @value Information + -- Reports an information. + -- + -- @value Hint + -- Reports a hint. + + type DiagnosticTag is (Unnecessary, Deprecated); + -- The diagnostic tags. + -- + -- @since 3.15.0 + -- + -- @value Unnecessary + -- Unused or unnecessary code. + -- + -- Clients are allowed to render diagnostics with this tag faded out + -- instead of having an error squiggle. + -- + -- @value Deprecated + -- Deprecated or obsolete code. + -- + -- Clients are allowed to rendered diagnostics with this tag strike + -- through. + + type DocumentHighlightKind is (Text, Read, Write); + -- A document highlight kind. + -- + -- @value Text + -- A textual occurrence. + -- + -- @value Read + -- Read-access of a symbol, like reading a variable. + -- + -- @value Write + -- Write-access of a symbol, like writing to a variable. + + type ErrorCodes is + (ParseError, InvalidRequest, MethodNotFound, InvalidParams, InternalError, + jsonrpcReservedErrorRangeStart, serverErrorStart, ServerNotInitialized, + UnknownErrorCode, jsonrpcReservedErrorRangeEnd, serverErrorEnd); + -- Predefined error codes. + -- + -- @value jsonrpcReservedErrorRangeStart + -- This is the start range of JSON RPC reserved error codes. It doesn't + -- denote a real error code. No application error codes should be defined + -- between the start and end range. For backwards compatibility the + -- `ServerNotInitialized` and the `UnknownErrorCode` are left in the range. + -- + -- @since 3.16.0 + -- + -- @value serverErrorStart + -- @deprecated use jsonrpcReservedErrorRangeStart */ + -- + -- @value ServerNotInitialized + -- Error code indicating that a server received a notification or request + -- before the server has received the `initialize` request. + -- + -- @value jsonrpcReservedErrorRangeEnd + -- This is the end range of JSON RPC reserved error codes. It doesn't + -- denote a real error code. + -- + -- @since 3.16.0 + -- + -- @value serverErrorEnd + -- @deprecated use jsonrpcReservedErrorRangeEnd */ + + type FailureHandlingKind is + (An_Abort, Transactional, TextOnlyTransactional, Undo); + -- + -- @value An_Abort + -- Applying the workspace change is simply aborted if one of the changes + -- provided fails. All operations executed before the failing operation + -- stay executed. + -- + -- @value Transactional + -- All operations are executed transactional. That means they either all + -- succeed or no changes at all are applied to the workspace. + -- + -- @value TextOnlyTransactional + -- If the workspace edit contains only textual file changes they are + -- executed transactional. If resource changes (create, rename or delete + -- file) are part of the change the failure handling strategy is abort. + -- + -- @value Undo + -- The client tries to undo the operations already executed. But there is + -- no guarantee that this is succeeding. + + type FileChangeType is (Created, Changed, Deleted); + -- The file event type + -- + -- @value Created + -- The file got created. + -- + -- @value Changed + -- The file got changed. + -- + -- @value Deleted + -- The file got deleted. + + type FileOperationPatternKind is (file, folder); + -- A pattern kind describing if a glob pattern matches a file a folder or + -- both. + -- + -- @since 3.16.0 + -- + -- @value file + -- The pattern matches a file only. + -- + -- @value folder + -- The pattern matches a folder only. + + type FoldingRangeKind is (Comment, Imports, Region); + -- A set of predefined range kinds. + -- + -- @value Comment + -- Folding range for a comment + -- + -- @value Imports + -- Folding range for an import or include + -- + -- @value Region + -- Folding range for a region (e.g. `#region`) + + type InlayHintKind is (A_Type, Parameter); + -- Inlay hint kinds. + -- + -- @since 3.17.0 + -- + -- @value A_Type + -- An inlay hint that for a type annotation. + -- + -- @value Parameter + -- An inlay hint that is for a parameter. + + type InsertTextFormat is (PlainText, Snippet); + -- Defines whether the insert text in a completion item should be + -- interpreted as plain text or a snippet. + -- + -- @value PlainText + -- The primary text to be inserted is treated as a plain string. + -- + -- @value Snippet + -- The primary text to be inserted is treated as a snippet. + -- + -- A snippet can define tab stops and placeholders with `$1`, `$2` and + -- `${3:foo}`. `$0` defines the final tab stop, it defaults to the end of + -- the snippet. Placeholders with equal identifiers are linked, that is + -- typing in one will update others too. + -- + -- See also: + -- https://microsoft.github.io/language-server-protocol/specifications/specification-current/#snippet_syntax + + type InsertTextMode is (asIs, adjustIndentation); + -- How whitespace and indentation is handled during completion item + -- insertion. + -- + -- @since 3.16.0 + -- + -- @value asIs + -- The insertion or replace strings is taken as it is. If the value + -- is multi line the lines below the cursor will be inserted using the + -- indentation defined in the string value. The client will not apply + -- any kind of adjustments to the string. + -- + -- @value adjustIndentation + -- The editor adjusts leading whitespace of new lines so that they match + -- the indentation up to the cursor of the line for which the item is + -- accepted. + -- + -- Consider a line like this: <2tabs><3tabs>foo. Accepting a multi + -- line completion item is indented using 2 tabs and all following lines + -- inserted will be indented using 2 tabs as well. + + type LSPErrorCodes is + (lspReservedErrorRangeStart, RequestFailed, ServerCancelled, + ContentModified, RequestCancelled, lspReservedErrorRangeEnd); + -- + -- @value lspReservedErrorRangeStart + -- This is the start range of LSP reserved error codes. It doesn't denote a + -- real error code. + -- + -- @since 3.16.0 + -- + -- @value RequestFailed + -- A request failed but it was syntactically correct, e.g the method + -- name was known and the parameters were valid. The error message + -- should contain human readable information about why the request failed. + -- + -- @since 3.17.0 + -- + -- @value ServerCancelled + -- The server cancelled the request. This error code should only be used + -- for requests that explicitly support being server cancellable. + -- + -- @since 3.17.0 + -- + -- @value ContentModified + -- The server detected that the content of a document got modified outside + -- normal conditions. A server should NOT send this error code if it + -- detects a content change in it unprocessed messages. The result + -- even computed on an older state might still be useful for the client. + -- + -- If a client decides that a result is not of any use anymore the client + -- should cancel the request. + -- + -- @value RequestCancelled + -- The client has canceled a request and a server as detected the cancel. + -- + -- @value lspReservedErrorRangeEnd + -- This is the end range of LSP reserved error codes. It doesn't denote a + -- real error code. + -- + -- @since 3.16.0 + + type MarkupKind is (PlainText, Markdown); + -- Describes the content type that a client supports in various result + -- literals like `Hover`, `ParameterInfo` or `CompletionItem`. + -- + -- Please note that `MarkupKinds` must not start with a `$`. This kinds are + -- reserved for internal usage. + -- + -- @value PlainText + -- Plain text is supported as a content format + -- + -- @value Markdown + -- Markdown is supported as a content format + + type MessageType is (Error, Warning, Info, Log); + -- The message type + -- + -- @value Error + -- An error message. + -- + -- @value Warning + -- A warning message. + -- + -- @value Info + -- An information message. + -- + -- @value Log + -- A log message. + + type MonikerKind is (import, export, local); + -- The moniker kind. + -- + -- @since 3.16.0 + -- + -- @value import + -- The moniker represent a symbol that is imported into a project + -- + -- @value export + -- The moniker represents a symbol that is exported from a project + -- + -- @value local + -- The moniker represents a symbol that is local to a project (e.g. a local + -- variable of a function, a class not visible outside the project, ...) + + type NotebookCellKind is (Markup, Code); + -- A notebook cell kind. + -- + -- @since 3.17.0 + -- + -- @value Markup + -- A markup-cell is formatted source that is used for display. + -- + -- @value Code + -- A code-cell is source code. + + type PositionEncodingKind is (UTF8, UTF16, UTF32); + -- A set of predefined position encoding kinds. + -- + -- @since 3.17.0 + -- + -- @value UTF8 + -- Character offsets count UTF-8 code units. + -- + -- @value UTF16 + -- Character offsets count UTF-16 code units. + -- + -- This is the default and must always be supported by servers + -- + -- @value UTF32 + -- Character offsets count UTF-32 code units. + -- + -- Implementation note: these are the same as Unicode code points, so + -- this `PositionEncodingKind` may also be used for an encoding-agnostic + -- representation of character offsets. + + type PrepareSupportDefaultBehavior is (Identifier); + -- + -- @value Identifier + -- The client's default behavior is to select the identifier according the + -- to language's syntax rule. + + type ResourceOperationKind is (Create, Rename, Delete); + -- + -- @value Create + -- Supports creating new files and folders. + -- + -- @value Rename + -- Supports renaming existing files and folders. + -- + -- @value Delete + -- Supports deleting existing files and folders. + + type SemanticTokenModifiers is + (declaration, definition, readonly, static, deprecated, an_abstract, + async, modification, documentation, defaultLibrary); + -- A set of predefined token modifiers. This set is not fixed an clients + -- can specify additional token types via the corresponding client + -- capabilities. + -- + -- @since 3.16.0 + + type SemanticTokenTypes is + (namespace, a_type, class, enum, an_interface, struct, typeParameter, + parameter, variable, property, enumMember, event, a_function, method, + macro, keyword, modifier, comment, string, number, regexp, operator, + decorator); + -- A set of predefined token types. This set is not fixed an clients + -- can specify additional token types via the corresponding client + -- capabilities. + -- + -- @since 3.16.0 + -- + -- @value a_type + -- Represents a generic type. Acts as a fallback for types which can't be + -- mapped to a specific type like class or enum. + -- + -- @value decorator + -- @since 3.17.0 + + type SignatureHelpTriggerKind is (Invoked, TriggerCharacter, ContentChange); + -- How a signature help was triggered. + -- + -- @since 3.15.0 + -- + -- @value Invoked + -- Signature help was invoked manually by the user or by a command. + -- + -- @value TriggerCharacter + -- Signature help was triggered by a trigger character. + -- + -- @value ContentChange + -- Signature help was triggered by the cursor moving or by the document + -- content changing. + + type SymbolKind is + (File, Module, Namespace, A_Package, Class, Method, Property, Field, + Constructor, Enum, An_Interface, A_Function, Variable, A_Constant, + String, Number, Boolean, An_Array, Object, Key, A_Null, EnumMember, + Struct, Event, Operator, TypeParameter); + -- A symbol kind. + + type SymbolTag is (Deprecated); + -- Symbol tags are extra annotations that tweak the rendering of a symbol. + -- + -- @since 3.16 + -- + -- @value Deprecated + -- Render a symbol as obsolete, usually using a strike-out. + + type TextDocumentSaveReason is (Manual, AfterDelay, FocusOut); + -- Represents reasons why a text document is saved. + -- + -- @value Manual + -- Manually triggered, e.g. by the user pressing save, by starting + -- debugging, or by an API call. + -- + -- @value AfterDelay + -- Automatic after a delay. + -- + -- @value FocusOut + -- When the editor lost focus. + + type TextDocumentSyncKind is (None, Full, Incremental); + -- Defines how the host (editor) should sync document changes to the + -- language server. + -- + -- @value None + -- Documents should not be synced at all. + -- + -- @value Full + -- Documents are synced by always sending the full content of the document. + -- + -- @value Incremental + -- Documents are synced by sending the full content on open. After that + -- only incremental updates to the document are sent. + + type TokenFormat is (Relative); + + type TraceValues is (Off, Messages, Verbose); + -- + -- @value Off + -- Turn tracing off. + -- + -- @value Messages + -- Trace messages only. + -- + -- @value Verbose + -- Verbose message tracing. + + type UniquenessLevel is (document, project, group, scheme, global); + -- Moniker uniqueness level to define scope of the moniker. + -- + -- @since 3.16.0 + -- + -- @value document + -- The moniker is only unique inside a document + -- + -- @value project + -- The moniker is unique inside a project for which a dump got created + -- + -- @value group + -- The moniker is unique inside the group to which a project belongs + -- + -- @value scheme + -- The moniker is unique inside the moniker scheme. + -- + -- @value global + -- The moniker is globally unique + + type WatchKind is (Create, Change, Delete); + -- + -- @value Create + -- Interested in create events. + -- + -- @value Change + -- Interested in change events + -- + -- @value Delete + -- Interested in delete events + +end LSP.Enumerations; diff --git a/source/lsp_3.17/generated/lsp-inputs.adb b/source/lsp_3.17/generated/lsp-inputs.adb new file mode 100644 index 000000000..b96aa99f5 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-inputs.adb @@ -0,0 +1,23902 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +pragma Ada_2022; +with Interfaces; +with LSP.Input_Tools; +with VSS.Strings; +with VSS.JSON.Pull_Readers.Buffered; +with Minimal_Perfect_Hash; + +package body LSP.Inputs is + + pragma Warnings (Off, "is not referenced"); + use type Interfaces.Integer_64; + + procedure Read_ClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ClientCapabilities); + + procedure Read_FileChangeType + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.FileChangeType); + + procedure Read_Virtual_String + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Virtual_String); + + procedure Read_Declaration + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Declaration); + + procedure Read_FileOperationRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.FileOperationRegistrationOptions); + + procedure Read_WorkspaceFolder_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.WorkspaceFolder_Vector); + + procedure Read_TextDocumentContentChangeEvent_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.TextDocumentContentChangeEvent_Vector); + + procedure Read_FoldingRangeClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.FoldingRangeClientCapabilities); + + procedure Read_CreateFile + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CreateFile); + + procedure Read_CompletionContext + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CompletionContext); + + procedure Read_NotebookCell_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.NotebookCell_Vector); + + procedure Read_CodeActionKind + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.CodeActionKind); + + procedure Read_RelatedUnchangedDocumentDiagnosticReport + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.RelatedUnchangedDocumentDiagnosticReport); + + procedure Read_DidChangeWatchedFilesClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DidChangeWatchedFilesClientCapabilities); + + procedure Read_SemanticTokenTypes + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.SemanticTokenTypes); + + procedure Read_AnnotatedTextEdit + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.AnnotatedTextEdit); + + procedure Read_DeclarationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DeclarationOptions); + + procedure Read_SignatureInformation + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SignatureInformation); + + procedure Read_TextDocumentSaveReason + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.TextDocumentSaveReason); + + procedure Read_SemanticTokens + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SemanticTokens); + + procedure Read_TokenFormat + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.TokenFormat); + + procedure Read_TextDocumentRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.TextDocumentRegistrationOptions); + + procedure Read_URI + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.URI); + + procedure Read_SemanticTokenModifiers + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.SemanticTokenModifiers); + + procedure Read_ConfigurationItem + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ConfigurationItem); + + procedure Read_DocumentOnTypeFormattingClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentOnTypeFormattingClientCapabilities); + + procedure Read_SymbolKind + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.SymbolKind); + + procedure Read_SelectionRangeClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SelectionRangeClientCapabilities); + + procedure Read_Range_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Range_Vector); + + procedure Read_Definition + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Definition); + + procedure Read_NotebookDocumentFilter + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.NotebookDocumentFilter); + + procedure Read_Color + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Color); + + procedure Read_FileOperationPattern + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.FileOperationPattern); + + procedure Read_LinkedEditingRanges + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.LinkedEditingRanges); + + procedure Read_Virtual_String_Or_MarkupContent + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Virtual_String_Or_MarkupContent); + + procedure Read_ServerCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ServerCapabilities); + + procedure Read_DidChangeWatchedFilesRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DidChangeWatchedFilesRegistrationOptions); + + procedure Read_CallHierarchyOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CallHierarchyOptions); + + procedure Read_ImplementationRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ImplementationRegistrationOptions); + + procedure Read_FoldingRangeRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.FoldingRangeRegistrationOptions); + + procedure Read_InlineValueContext + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.InlineValueContext); + + procedure Read_TextDocumentIdentifier_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.TextDocumentIdentifier_Vector); + + procedure Read_DefinitionLink + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DefinitionLink); + + procedure Read_DocumentFormattingOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentFormattingOptions); + + procedure Read_SymbolInformation_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SymbolInformation_Vector); + + procedure Read_RenameFile + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.RenameFile); + + procedure Read_DidChangeConfigurationRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DidChangeConfigurationRegistrationOptions); + + procedure Read_CallHierarchyItem + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CallHierarchyItem); + + procedure Read_SymbolTag_Set + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SymbolTag_Set); + + procedure Read_RelativePattern + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.RelativePattern); + + procedure Read_tagSupport_OfWorkspaceSymbolClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .tagSupport_OfWorkspaceSymbolClientCapabilities); + + procedure Read_ReferenceOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ReferenceOptions); + + procedure Read_TextDocumentClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.TextDocumentClientCapabilities); + + procedure Read_DocumentSymbol_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSymbol_Vector); + + procedure Read_GlobPattern + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.GlobPattern); + + procedure Read_NotebookDocumentIdentifier + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.NotebookDocumentIdentifier); + + procedure Read_InsertReplaceEdit + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.InsertReplaceEdit); + + procedure Read_InlineValueVariableLookup + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.InlineValueVariableLookup); + + procedure Read_FileEvent + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.FileEvent); + + procedure Read_SignatureHelpClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SignatureHelpClientCapabilities); + + procedure Read_NotebookDocumentSyncClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.NotebookDocumentSyncClientCapabilities); + + procedure Read_ProgressToken + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ProgressToken); + + procedure Read_DiagnosticOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DiagnosticOptions); + + procedure Read_WindowClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.WindowClientCapabilities); + + procedure Read_GeneralClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.GeneralClientCapabilities); + + procedure Read_SemanticTokensWorkspaceClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SemanticTokensWorkspaceClientCapabilities); + + procedure Read_LinkedEditingRangeClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.LinkedEditingRangeClientCapabilities); + + procedure Read_SignatureHelp + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SignatureHelp); + + procedure Read_Diagnostic_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Diagnostic_Vector); + + procedure Read_DocumentHighlightKind + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.DocumentHighlightKind); + + procedure Read_ResourceOperationKind + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.ResourceOperationKind); + + procedure Read_InlineValueClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.InlineValueClientCapabilities); + + procedure Read_PrepareRenameResult + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.PrepareRenameResult); + + procedure Read_DocumentLinkClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentLinkClientCapabilities); + + procedure Read_MarkupKind_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.MarkupKind_Vector); + + procedure Read_CodeActionContext + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CodeActionContext); + + procedure Read_InlayHintRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.InlayHintRegistrationOptions); + + procedure Read_Natural_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Natural_Vector); + + procedure Read_CodeDescription + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CodeDescription); + + procedure Read_Virtual_String_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Virtual_String_Vector); + + procedure Read_LSPObject + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.LSPObject); + + procedure Read_TextDocumentPositionParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.TextDocumentPositionParams); + + procedure Read_CodeLensRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CodeLensRegistrationOptions); + + procedure Read_SelectionRange + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SelectionRange); + + procedure Read_NotebookCellTextDocumentFilter + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.NotebookCellTextDocumentFilter); + + procedure Read_WorkspaceFoldersInitializeParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.WorkspaceFoldersInitializeParams); + + procedure Read_FileSystemWatcher + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.FileSystemWatcher); + + procedure Read_CodeActionKind_Set + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CodeActionKind_Set); + + procedure Read_NotebookDocumentSyncOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.NotebookDocumentSyncOptions); + + procedure Read_CodeActionRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CodeActionRegistrationOptions); + + procedure Read_NotebookDocumentSyncRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.NotebookDocumentSyncRegistrationOptions); + + procedure Read_WorkspaceUnchangedDocumentDiagnosticReport + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.WorkspaceUnchangedDocumentDiagnosticReport); + + procedure Read_HoverClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.HoverClientCapabilities); + + procedure Read_RenameClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.RenameClientCapabilities); + + procedure Read_DefinitionOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DefinitionOptions); + + procedure Read_InlayHintKind + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.InlayHintKind); + + procedure Read_symbolKind_OfWorkspaceSymbolClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .symbolKind_OfWorkspaceSymbolClientCapabilities); + + procedure Read_FailureHandlingKind + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.FailureHandlingKind); + + procedure Read_FileOperationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.FileOperationOptions); + + procedure Read_DocumentSelector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSelector); + + procedure Read_CompletionClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CompletionClientCapabilities); + + procedure Read_CodeLensWorkspaceClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CodeLensWorkspaceClientCapabilities); + + procedure Read_RenameOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.RenameOptions); + + procedure Read_SymbolKind_Set + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SymbolKind_Set); + + procedure Read_DidChangeConfigurationClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DidChangeConfigurationClientCapabilities); + + procedure Read_DocumentHighlightRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentHighlightRegistrationOptions); + + procedure Read_DeclarationLink + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DeclarationLink); + + procedure Read_T + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.T); + + procedure Read_FullDocumentDiagnosticReport + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.FullDocumentDiagnosticReport); + + procedure Read_DocumentSymbolRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSymbolRegistrationOptions); + + procedure Read_DeclarationRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DeclarationRegistrationOptions); + + procedure Read_DeleteFileOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DeleteFileOptions); + + procedure Read_WatchKind + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.WatchKind); + + procedure Read_TypeHierarchyRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.TypeHierarchyRegistrationOptions); + + procedure Read_DiagnosticSeverity + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.DiagnosticSeverity); + + procedure Read_CodeActionTriggerKind + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.CodeActionTriggerKind); + + procedure Read_CodeActionClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CodeActionClientCapabilities); + + procedure Read_MarkdownClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.MarkdownClientCapabilities); + + procedure Read_DefinitionLink_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DefinitionLink_Vector); + + procedure Read_ImplementationClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ImplementationClientCapabilities); + + procedure Read_TextDocumentItem + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.TextDocumentItem); + + procedure Read_InsertTextFormat + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.InsertTextFormat); + + procedure Read_relatedDocuments_OfDocumentDiagnosticReportPartialResult_Item + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .relatedDocuments_OfDocumentDiagnosticReportPartialResult_Item); + + procedure Read_ExecuteCommandClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ExecuteCommandClientCapabilities); + + procedure Read_CallHierarchyItem_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CallHierarchyItem_Vector); + + procedure Read_DeleteFile + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DeleteFile); + + procedure Read_SaveOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SaveOptions); + + procedure Read_NotebookDocument + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.NotebookDocument); + + procedure Read_RelatedFullDocumentDiagnosticReport + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.RelatedFullDocumentDiagnosticReport); + + procedure Read_CodeLensClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CodeLensClientCapabilities); + + procedure Read_DocumentSymbolOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSymbolOptions); + + procedure Read_CompletionRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CompletionRegistrationOptions); + + procedure Read_InlayHintClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.InlayHintClientCapabilities); + + procedure Read_ReferenceContext + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ReferenceContext); + + procedure Read_WorkspaceEditClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.WorkspaceEditClientCapabilities); + + procedure Read_WorkspaceSymbolOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.WorkspaceSymbolOptions); + + procedure Read_ChangeAnnotation + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ChangeAnnotation); + + procedure Read_FileOperationPatternOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.FileOperationPatternOptions); + + procedure Read_VersionedTextDocumentIdentifier + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.VersionedTextDocumentIdentifier); + + procedure Read_SemanticTokensDelta + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SemanticTokensDelta); + + procedure Read_ShowDocumentClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ShowDocumentClientCapabilities); + + procedure Read_InlayHintLabelPart + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.InlayHintLabelPart); + + procedure Read_SelectionRangeOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SelectionRangeOptions); + + procedure Read_LocationLink + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.LocationLink); + + procedure Read_CompletionList + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CompletionList); + + procedure Read_DiagnosticRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DiagnosticRegistrationOptions); + + procedure Read_SignatureHelpTriggerKind + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.SignatureHelpTriggerKind); + + procedure Read_TypeHierarchyClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.TypeHierarchyClientCapabilities); + + procedure Read_DocumentOnTypeFormattingOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentOnTypeFormattingOptions); + + procedure Read_WorkspaceSymbolRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.WorkspaceSymbolRegistrationOptions); + + procedure Read_FileDelete + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.FileDelete); + + procedure Read_DocumentFormattingRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentFormattingRegistrationOptions); + + procedure Read_ColorPresentation + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ColorPresentation); + + procedure Read_TypeHierarchyItem + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.TypeHierarchyItem); + + procedure Read_Boolean_Or_Any + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Boolean_Or_Any); + + procedure Read_Location + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Location); + + procedure Read_RenameRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.RenameRegistrationOptions); + + procedure Read_ParameterInformation + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ParameterInformation); + + procedure Read_PositionEncodingKind + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.PositionEncodingKind); + + procedure Read_MessageType + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.MessageType); + + procedure Read_An_InitializeParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.An_InitializeParams); + + procedure Read_FileOperationFilter + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.FileOperationFilter); + + procedure Read_MonikerOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.MonikerOptions); + + procedure Read_InlineValue + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.InlineValue); + + procedure Read_Virtual_String_Or_NotebookDocumentFilter + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Virtual_String_Or_NotebookDocumentFilter); + + procedure Read_MonikerKind + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.MonikerKind); + + procedure Read_NotebookCellKind + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.NotebookCellKind); + + procedure Read_HoverRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.HoverRegistrationOptions); + + procedure Read_CompletionItemTag + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.CompletionItemTag); + + procedure Read_DefinitionRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DefinitionRegistrationOptions); + + procedure Read_clientInfo_Of_InitializeParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.clientInfo_Of_InitializeParams); + + procedure Read_DiagnosticTag + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.DiagnosticTag); + + procedure Read_DiagnosticClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DiagnosticClientCapabilities); + + procedure Read_MonikerRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.MonikerRegistrationOptions); + + procedure Read_ExecutionSummary + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ExecutionSummary); + + procedure Read_PreviousResultId + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.PreviousResultId); + + procedure Read_FoldingRangeKind + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.FoldingRangeKind); + + procedure Read_DocumentFilter + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentFilter); + + procedure Read_CallHierarchyIncomingCall + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CallHierarchyIncomingCall); + + procedure Read_TextDocumentChangeRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.TextDocumentChangeRegistrationOptions); + + procedure Read_DeclarationLink_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DeclarationLink_Vector); + + procedure Read_DocumentFormattingClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentFormattingClientCapabilities); + + procedure Read_NotebookDocumentChangeEvent + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.NotebookDocumentChangeEvent); + + procedure Read_FormattingOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.FormattingOptions); + + procedure Read_resolveSupport_OfWorkspaceSymbolClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .resolveSupport_OfWorkspaceSymbolClientCapabilities); + + procedure Read_WorkspaceSymbol_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.WorkspaceSymbol_Vector); + + procedure Read_TypeDefinitionRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.TypeDefinitionRegistrationOptions); + + procedure Read_CodeLensOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CodeLensOptions); + + procedure Read_FileRename + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.FileRename); + + procedure Read_DocumentRangeFormattingClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentRangeFormattingClientCapabilities); + + procedure Read_Moniker + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Moniker); + + procedure Read_DiagnosticWorkspaceClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DiagnosticWorkspaceClientCapabilities); + + procedure Read_DefinitionClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DefinitionClientCapabilities); + + procedure Read_SignatureHelpRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SignatureHelpRegistrationOptions); + + procedure Read_TypeDefinitionOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.TypeDefinitionOptions); + + procedure Read_MarkupContent + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.MarkupContent); + + procedure Read_WorkspaceEdit + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.WorkspaceEdit); + + procedure Read_DocumentHighlight + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentHighlight); + + procedure Read_MessageActionItem + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.MessageActionItem); + + procedure Read_TextDocumentItem_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.TextDocumentItem_Vector); + + procedure Read_InlineValueRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.InlineValueRegistrationOptions); + + procedure Read_VersionedNotebookDocumentIdentifier + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.VersionedNotebookDocumentIdentifier); + + procedure Read_BaseSymbolInformation + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.BaseSymbolInformation); + + procedure Read_TextEdit + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.TextEdit); + + procedure Read_DeclarationClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DeclarationClientCapabilities); + + procedure Read_SignatureHelpOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SignatureHelpOptions); + + procedure Read_SemanticTokensEdit + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SemanticTokensEdit); + + procedure Read_FileCreate + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.FileCreate); + + procedure Read_WorkspaceFullDocumentDiagnosticReport + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.WorkspaceFullDocumentDiagnosticReport); + + procedure Read_FoldingRange + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.FoldingRange); + + procedure Read_SemanticTokensDeltaPartialResult + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SemanticTokensDeltaPartialResult); + + procedure Read_NotebookDocumentClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.NotebookDocumentClientCapabilities); + + procedure Read_WorkspaceSymbolClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.WorkspaceSymbolClientCapabilities); + + procedure Read_Boolean_Or_Something + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Boolean_Or_Something); + + procedure Read_TypeHierarchyOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.TypeHierarchyOptions); + + procedure Read_SelectionRangeRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SelectionRangeRegistrationOptions); + + procedure Read_RegularExpressionsClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.RegularExpressionsClientCapabilities); + + procedure Read_WorkspaceDocumentDiagnosticReport + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.WorkspaceDocumentDiagnosticReport); + + procedure Read_WorkspaceClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.WorkspaceClientCapabilities); + + procedure Read_TextDocumentSyncKind + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.TextDocumentSyncKind); + + procedure Read_InlayHintOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.InlayHintOptions); + + procedure Read_InlineValueOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.InlineValueOptions); + + procedure Read_WorkspaceFoldersChangeEvent + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.WorkspaceFoldersChangeEvent); + + procedure Read_TypeDefinitionClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.TypeDefinitionClientCapabilities); + + procedure Read_CreateFileOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CreateFileOptions); + + procedure Read_DiagnosticRelatedInformation + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DiagnosticRelatedInformation); + + procedure Read_InsertTextMode + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.InsertTextMode); + + procedure Read_ImplementationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ImplementationOptions); + + procedure Read_DocumentColorRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentColorRegistrationOptions); + + procedure Read_CodeActionOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CodeActionOptions); + + procedure Read_CompletionItemKind + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.CompletionItemKind); + + procedure Read_Command_Or_CodeAction + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Command_Or_CodeAction); + + procedure Read_ChangeAnnotationIdentifier + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ChangeAnnotationIdentifier); + + procedure Read_SignatureHelpContext + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SignatureHelpContext); + + procedure Read_CallHierarchyOutgoingCall + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CallHierarchyOutgoingCall); + + procedure Read_TextDocumentContentChangeEvent + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.TextDocumentContentChangeEvent); + + procedure Read_WorkspaceFolder + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.WorkspaceFolder); + + procedure Read_MarkedString + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.MarkedString); + + procedure Read_NotebookCell + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.NotebookCell); + + procedure Read_WorkspaceFoldersServerCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.WorkspaceFoldersServerCapabilities); + + procedure Read_SemanticTokensRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SemanticTokensRegistrationOptions); + + procedure Read_CompletionTriggerKind + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.CompletionTriggerKind); + + procedure Read_CallHierarchyRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CallHierarchyRegistrationOptions); + + procedure Read_CallHierarchyClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CallHierarchyClientCapabilities); + + procedure Read_DocumentRangeFormattingOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentRangeFormattingOptions); + + procedure Read_InlayHintWorkspaceClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.InlayHintWorkspaceClientCapabilities); + + procedure Read_DiagnosticServerCancellationData + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DiagnosticServerCancellationData); + + procedure Read_DocumentColorOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentColorOptions); + + procedure Read_FileOperationPatternKind + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.FileOperationPatternKind); + + procedure Read_Unregistration + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Unregistration); + + procedure Read_HoverOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.HoverOptions); + + procedure Read_DocumentOnTypeFormattingRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentOnTypeFormattingRegistrationOptions); + + procedure Read_relatedDocuments_OfDocumentDiagnosticReportPartialResult + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .relatedDocuments_OfDocumentDiagnosticReportPartialResult); + + procedure Read_ReferenceClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ReferenceClientCapabilities); + + procedure Read_MonikerClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.MonikerClientCapabilities); + + procedure Read_CompletionItemTag_Set + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CompletionItemTag_Set); + + procedure Read_ColorInformation + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ColorInformation); + + procedure Read_A_Range + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.A_Range); + + procedure Read_DocumentColorClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentColorClientCapabilities); + + procedure Read_InlineValueEvaluatableExpression + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.InlineValueEvaluatableExpression); + + procedure Read_Pattern + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Pattern); + + procedure Read_DiagnosticTag_Set + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DiagnosticTag_Set); + + procedure Read_NotebookCellArrayChange + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.NotebookCellArrayChange); + + procedure Read_DocumentLinkRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentLinkRegistrationOptions); + + procedure Read_DocumentLinkOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentLinkOptions); + + procedure Read_PrepareSupportDefaultBehavior + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.PrepareSupportDefaultBehavior); + + procedure Read_TextDocumentIdentifier + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.TextDocumentIdentifier); + + procedure Read_TraceValues + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.TraceValues); + + procedure Read_SymbolInformation + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SymbolInformation); + + procedure Read_FileOperationClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.FileOperationClientCapabilities); + + procedure Read_DocumentHighlightClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentHighlightClientCapabilities); + + procedure Read_InlineValueText + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.InlineValueText); + + procedure Read_UnchangedDocumentDiagnosticReport + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.UnchangedDocumentDiagnosticReport); + + procedure Read_SymbolTag + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.SymbolTag); + + procedure Read_Registration + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Registration); + + procedure Read_DocumentRangeFormattingRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentRangeFormattingRegistrationOptions); + + procedure Read_RenameFileOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.RenameFileOptions); + + procedure Read_DocumentSymbol + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSymbol); + + procedure Read_DocumentSymbolClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSymbolClientCapabilities); + + procedure Read_InitializeError + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.InitializeError); + + procedure Read_LinkedEditingRangeRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.LinkedEditingRangeRegistrationOptions); + + procedure Read_SemanticTokensClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SemanticTokensClientCapabilities); + + procedure Read_Hover + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Hover); + + procedure Read_InlineValueWorkspaceClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.InlineValueWorkspaceClientCapabilities); + + procedure Read_ResourceOperation + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ResourceOperation); + + procedure Read_PublishDiagnosticsClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.PublishDiagnosticsClientCapabilities); + + procedure Read_SemanticTokensOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SemanticTokensOptions); + + procedure Read_DocumentHighlightOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentHighlightOptions); + + procedure Read_FoldingRangeOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.FoldingRangeOptions); + + procedure Read_Integer_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Integer_Or_Null); + + procedure Read_TextEdit_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.TextEdit_Vector); + + procedure Read_ShowMessageRequestClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ShowMessageRequestClientCapabilities); + + procedure Read_SemanticTokensEdit_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SemanticTokensEdit_Vector); + + procedure Read_Position + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Position); + + procedure Read_TextDocumentSaveRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.TextDocumentSaveRegistrationOptions); + + procedure Read_Command + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Command); + + procedure Read_TextDocumentFilter + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.TextDocumentFilter); + + procedure Read_ExecuteCommandRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ExecuteCommandRegistrationOptions); + + procedure Read_UniquenessLevel + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.UniquenessLevel); + + procedure Read_TextDocumentEdit + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.TextDocumentEdit); + + procedure Read_CompletionItemLabelDetails + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CompletionItemLabelDetails); + + procedure Read_CompletionOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CompletionOptions); + + procedure Read_Diagnostic + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Diagnostic); + + procedure Read_TextDocumentSyncOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.TextDocumentSyncOptions); + + procedure Read_OptionalVersionedTextDocumentIdentifier + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.OptionalVersionedTextDocumentIdentifier); + + procedure Read_SemanticTokensLegend + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SemanticTokensLegend); + + procedure Read_WorkspaceDocumentDiagnosticReport_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.WorkspaceDocumentDiagnosticReport_Vector); + + procedure Read_ExecuteCommandOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ExecuteCommandOptions); + + procedure Read_TextDocumentSyncClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.TextDocumentSyncClientCapabilities); + + procedure Read_MarkupKind + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.MarkupKind); + + procedure Read_LSPErrorCodes + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.LSPErrorCodes); + + procedure Read_ReferenceRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ReferenceRegistrationOptions); + + procedure Read_LinkedEditingRangeOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.LinkedEditingRangeOptions); + + package ClientCapabilities_Scope is + package ClientCapabilities_Map is new Minimal_Perfect_Hash + (["workspace", + "textDocument", + "notebookDocument", + "window", + "general", + "experimental"]); + + end ClientCapabilities_Scope; + + procedure Read_ClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ClientCapabilities) is + use ClientCapabilities_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case ClientCapabilities_Map.Get_Index (Key) is + when 1 => -- workspace + Value.workspace := + (Is_Set => True, + Value => <>); + Read_WorkspaceClientCapabilities + (Handler, Value.workspace.Value); + when 2 => -- textDocument + Value.textDocument := + (Is_Set => True, + Value => <>); + Read_TextDocumentClientCapabilities + (Handler, Value.textDocument.Value); + when 3 => -- notebookDocument + Value.notebookDocument := + (Is_Set => True, + Value => <>); + Read_NotebookDocumentClientCapabilities + (Handler, Value.notebookDocument.Value); + when 4 => -- window + Value.window := + (Is_Set => True, + Value => <>); + Read_WindowClientCapabilities (Handler, Value.window.Value); + when 5 => -- general + Value.general := + (Is_Set => True, + Value => <>); + Read_GeneralClientCapabilities + (Handler, Value.general.Value); + when 6 => -- experimental + Read_LSPAny (Handler, Value.experimental); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_ClientCapabilities; + + procedure Read_FileChangeType + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.FileChangeType) is + begin + Value := + LSP.Enumerations.FileChangeType'Val + (Handler.Number_Value.Integer_Value - 1); + Handler.Read_Next; + end Read_FileChangeType; + + package InitializeParams_Scope is + package InitializeParams_Map is new Minimal_Perfect_Hash + (["workDoneToken", + "processId", + "clientInfo", + "locale", + "rootPath", + "rootUri", + "capabilities", + "initializationOptions", + "trace", + "workspaceFolders"]); + + package trace_Of_InitializeParams_Scope is + package trace_Of_InitializeParams_Map is new Minimal_Perfect_Hash + (["off", + "messages", + "compact", + "verbose"]); + + end trace_Of_InitializeParams_Scope; + + end InitializeParams_Scope; + + procedure Read_InitializeParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.InitializeParams) is + use InitializeParams_Scope; + procedure Read_trace_Of_InitializeParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.trace_Of_InitializeParams); + + procedure Read_Virtual_String_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Virtual_String_Or_Null); + + procedure Read_DocumentUri_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentUri_Or_Null); + + procedure Read_trace_Of_InitializeParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.trace_Of_InitializeParams) is + use trace_Of_InitializeParams_Scope; + begin + Value := + LSP.Structures.trace_Of_InitializeParams'Val + (trace_Of_InitializeParams_Map.Get_Index (Handler.String_Value) - + 1); + Handler.Read_Next; + end Read_trace_Of_InitializeParams; + + procedure Read_Virtual_String_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Virtual_String_Or_Null) is + begin + if Handler.Is_Null_Value then + Handler.Read_Next; + else + Value := + (Is_Null => False, + Value => <>); + Value.Value.Clear; + Value.Value.Append (Handler.String_Value); + Handler.Read_Next; + end if; + end Read_Virtual_String_Or_Null; + + procedure Read_DocumentUri_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentUri_Or_Null) is + begin + if Handler.Is_Null_Value then + Handler.Read_Next; + else + Value := + (Is_Null => False, + Value => <>); + Value.Value := (Handler.String_Value with null record); + Handler.Read_Next; + end if; + end Read_DocumentUri_Or_Null; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case InitializeParams_Map.Get_Index (Key) is + when 1 => -- workDoneToken + Value.workDoneToken := + (Is_Set => True, + Value => <>); + Read_ProgressToken (Handler, Value.workDoneToken.Value); + when 2 => -- processId + Read_Integer_Or_Null (Handler, Value.processId); + when 3 => -- clientInfo + Value.clientInfo := + (Is_Set => True, + Value => <>); + Read_clientInfo_Of_InitializeParams + (Handler, Value.clientInfo.Value); + when 4 => -- locale + Value.locale.Clear; + Value.locale.Append (Handler.String_Value); + Handler.Read_Next; + when 5 => -- rootPath + Value.rootPath := + (Is_Set => True, + Value => <>); + Read_Virtual_String_Or_Null (Handler, Value.rootPath.Value); + when 6 => -- rootUri + Read_DocumentUri_Or_Null (Handler, Value.rootUri); + when 7 => -- capabilities + Read_ClientCapabilities (Handler, Value.capabilities); + when 8 => -- initializationOptions + Read_LSPAny (Handler, Value.initializationOptions); + when 9 => -- trace + Value.trace := + (Is_Set => True, + Value => <>); + Read_trace_Of_InitializeParams (Handler, Value.trace.Value); + when 10 => -- workspaceFolders + Value.Parent.workspaceFolders := + (Is_Set => True, + Value => <>); + Read_WorkspaceFolder_Vector_Or_Null + (Handler, Value.Parent.workspaceFolders.Value); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_InitializeParams; + + procedure Read_DocumentLink_Vector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentLink_Vector_Or_Null) is + begin + if Handler.Is_Null_Value then + Handler.Read_Next; + else + Value.Clear; + Read_DocumentLink_Vector (Handler, Value); + end if; + end Read_DocumentLink_Vector_Or_Null; + + procedure Read_Command_Or_CodeAction_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Command_Or_CodeAction_Vector) is + begin + pragma Assert (Handler.Is_Start_Array); + Handler.Read_Next; + + declare + Set : LSP.Structures.Command_Or_CodeAction_Vector renames Value; + Value : LSP.Structures.Command_Or_CodeAction; + begin + Set.Clear; + while not Handler.Is_End_Array loop + Read_Command_Or_CodeAction (Handler, Value); + Set.Append (Value); + end loop; + end; + + Handler.Read_Next; + end Read_Command_Or_CodeAction_Vector; + + procedure Read_Virtual_String + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Virtual_String) is + begin + Value.Clear; + Value.Append (Handler.String_Value); + Handler.Read_Next; + end Read_Virtual_String; + + procedure Read_Declaration + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Declaration) is + begin + declare + Set : LSP.Structures.Declaration renames Value; + Value : LSP.Structures.Location; + begin + Set.Clear; + if Handler.Is_Start_Array then + Handler.Read_Next; + while not Handler.Is_End_Array loop + Read_Location (Handler, Value); + Set.Append (Value); + end loop; + Handler.Read_Next; + + else + Read_Location (Handler, Value); + Set.Append (Value); + end if; + end; + + end Read_Declaration; + + procedure Read_Null_Record + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Null_Record) is + begin + null; -- #null_value + Handler.Read_Next; + end Read_Null_Record; + + package FileOperationRegistrationOptions_Scope is + package FileOperationRegistrationOptions_Map is new Minimal_Perfect_Hash + (["filters"]); + + end FileOperationRegistrationOptions_Scope; + + procedure Read_FileOperationRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.FileOperationRegistrationOptions) is + use FileOperationRegistrationOptions_Scope; + procedure Read_FileOperationFilter_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.FileOperationFilter_Vector); + + procedure Read_FileOperationFilter_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.FileOperationFilter_Vector) is + begin + pragma Assert (Handler.Is_Start_Array); + Handler.Read_Next; + + declare + Set : LSP.Structures.FileOperationFilter_Vector renames Value; + Value : LSP.Structures.FileOperationFilter; + begin + Set.Clear; + while not Handler.Is_End_Array loop + Read_FileOperationFilter (Handler, Value); + Set.Append (Value); + end loop; + end; + + Handler.Read_Next; + end Read_FileOperationFilter_Vector; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case FileOperationRegistrationOptions_Map.Get_Index (Key) is + when 1 => -- filters + Read_FileOperationFilter_Vector (Handler, Value.filters); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_FileOperationRegistrationOptions; + + procedure Read_CallHierarchyOutgoingCall_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CallHierarchyOutgoingCall_Vector) is + begin + pragma Assert (Handler.Is_Start_Array); + Handler.Read_Next; + + declare + Set : LSP.Structures.CallHierarchyOutgoingCall_Vector renames Value; + Value : LSP.Structures.CallHierarchyOutgoingCall; + begin + Set.Clear; + while not Handler.Is_End_Array loop + Read_CallHierarchyOutgoingCall (Handler, Value); + Set.Append (Value); + end loop; + end; + + Handler.Read_Next; + end Read_CallHierarchyOutgoingCall_Vector; + + procedure Read_WorkspaceFolder_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.WorkspaceFolder_Vector) is + begin + pragma Assert (Handler.Is_Start_Array); + Handler.Read_Next; + + declare + Set : LSP.Structures.WorkspaceFolder_Vector renames Value; + Value : LSP.Structures.WorkspaceFolder; + begin + Set.Clear; + while not Handler.Is_End_Array loop + Read_WorkspaceFolder (Handler, Value); + Set.Append (Value); + end loop; + end; + + Handler.Read_Next; + end Read_WorkspaceFolder_Vector; + + procedure Read_TextDocumentContentChangeEvent_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.TextDocumentContentChangeEvent_Vector) is + begin + pragma Assert (Handler.Is_Start_Array); + Handler.Read_Next; + + declare + Set : + LSP.Structures.TextDocumentContentChangeEvent_Vector renames Value; + Value : LSP.Structures.TextDocumentContentChangeEvent; + begin + Set.Clear; + while not Handler.Is_End_Array loop + Read_TextDocumentContentChangeEvent (Handler, Value); + Set.Append (Value); + end loop; + end; + + Handler.Read_Next; + end Read_TextDocumentContentChangeEvent_Vector; + + package FoldingRangeClientCapabilities_Scope is + package FoldingRangeClientCapabilities_Map is new Minimal_Perfect_Hash + (["dynamicRegistration", + "rangeLimit", + "lineFoldingOnly", + "foldingRangeKind", + "foldingRange"]); + + package foldingRange_OfFoldingRangeClientCapabilities_Scope is + package foldingRange_OfFoldingRangeClientCapabilities_Map is new Minimal_Perfect_Hash + (["collapsedText"]); + + end foldingRange_OfFoldingRangeClientCapabilities_Scope; + + package foldingRangeKind_OfFoldingRangeClientCapabilities_Scope is + package foldingRangeKind_OfFoldingRangeClientCapabilities_Map is new Minimal_Perfect_Hash + (["valueSet"]); + + end foldingRangeKind_OfFoldingRangeClientCapabilities_Scope; + + end FoldingRangeClientCapabilities_Scope; + + procedure Read_FoldingRangeClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.FoldingRangeClientCapabilities) is + use FoldingRangeClientCapabilities_Scope; + procedure Read_foldingRange_OfFoldingRangeClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .foldingRange_OfFoldingRangeClientCapabilities); + + procedure Read_FoldingRangeKind_Set + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.FoldingRangeKind_Set); + + procedure Read_foldingRangeKind_OfFoldingRangeClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .foldingRangeKind_OfFoldingRangeClientCapabilities); + + procedure Read_foldingRange_OfFoldingRangeClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .foldingRange_OfFoldingRangeClientCapabilities) is + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while Handler.Is_Key_Name loop + declare + use foldingRange_OfFoldingRangeClientCapabilities_Scope; + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case foldingRange_OfFoldingRangeClientCapabilities_Map.Get_Index + (Key) is + when 1 => -- collapsedText + Value.collapsedText := + (Is_Set => True, + Value => <>); + Value.collapsedText.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_foldingRange_OfFoldingRangeClientCapabilities; + + procedure Read_FoldingRangeKind_Set + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.FoldingRangeKind_Set) is + begin + pragma Assert (Handler.Is_Start_Array); + Handler.Read_Next; + + declare + Set : LSP.Structures.FoldingRangeKind_Set renames Value; + Value : LSP.Enumerations.FoldingRangeKind; + begin + Set := (others => False); + while not Handler.Is_End_Array loop + Read_FoldingRangeKind (Handler, Value); + Set (Value) := True; + end loop; + end; + + Handler.Read_Next; + end Read_FoldingRangeKind_Set; + + procedure Read_foldingRangeKind_OfFoldingRangeClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .foldingRangeKind_OfFoldingRangeClientCapabilities) is + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while Handler.Is_Key_Name loop + declare + use foldingRangeKind_OfFoldingRangeClientCapabilities_Scope; + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case foldingRangeKind_OfFoldingRangeClientCapabilities_Map + .Get_Index + (Key) is + when 1 => -- valueSet + Read_FoldingRangeKind_Set (Handler, Value.valueSet); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_foldingRangeKind_OfFoldingRangeClientCapabilities; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case FoldingRangeClientCapabilities_Map.Get_Index (Key) is + when 1 => -- dynamicRegistration + Value.dynamicRegistration := + (Is_Set => True, + Value => <>); + Value.dynamicRegistration.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 2 => -- rangeLimit + Value.rangeLimit := + (Is_Set => True, + Value => <>); + Value.rangeLimit.Value := + Integer (Handler.Number_Value.Integer_Value); + Handler.Read_Next; + when 3 => -- lineFoldingOnly + Value.lineFoldingOnly := + (Is_Set => True, + Value => <>); + Value.lineFoldingOnly.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 4 => -- foldingRangeKind + Value.foldingRangeKind := + (Is_Set => True, + Value => <>); + Read_foldingRangeKind_OfFoldingRangeClientCapabilities + (Handler, Value.foldingRangeKind.Value); + when 5 => -- foldingRange + Value.foldingRange := + (Is_Set => True, + Value => <>); + Read_foldingRange_OfFoldingRangeClientCapabilities + (Handler, Value.foldingRange.Value); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_FoldingRangeClientCapabilities; + + package CreateFile_Scope is + package CreateFile_Map is new Minimal_Perfect_Hash + (["kind", + "annotationId", + "uri", + "options"]); + + end CreateFile_Scope; + + procedure Read_CreateFile + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CreateFile) is + use CreateFile_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case CreateFile_Map.Get_Index (Key) is + when 2 => -- annotationId + Value.annotationId := + (Is_Set => True, + Value => <>); + Read_ChangeAnnotationIdentifier + (Handler, Value.annotationId.Value); + when 1 => -- kind + Handler.Read_Next; -- Skip string literal: create + when 3 => -- uri + Value.uri := (Handler.String_Value with null record); + Handler.Read_Next; + when 4 => -- options + Value.options := + (Is_Set => True, + Value => <>); + Read_CreateFileOptions (Handler, Value.options.Value); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_CreateFile; + + package CompletionContext_Scope is + package CompletionContext_Map is new Minimal_Perfect_Hash + (["triggerKind", + "triggerCharacter"]); + + end CompletionContext_Scope; + + procedure Read_CompletionContext + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CompletionContext) is + use CompletionContext_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case CompletionContext_Map.Get_Index (Key) is + when 1 => -- triggerKind + Read_CompletionTriggerKind (Handler, Value.triggerKind); + when 2 => -- triggerCharacter + Value.triggerCharacter.Clear; + Value.triggerCharacter.Append (Handler.String_Value); + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_CompletionContext; + + procedure Read_NotebookCell_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.NotebookCell_Vector) is + begin + pragma Assert (Handler.Is_Start_Array); + Handler.Read_Next; + + declare + Set : LSP.Structures.NotebookCell_Vector renames Value; + Value : LSP.Structures.NotebookCell; + begin + Set.Clear; + while not Handler.Is_End_Array loop + Read_NotebookCell (Handler, Value); + Set.Append (Value); + end loop; + end; + + Handler.Read_Next; + end Read_NotebookCell_Vector; + + package DocumentDiagnosticParams_Scope is + package DocumentDiagnosticParams_Map is new Minimal_Perfect_Hash + (["workDoneToken", + "partialResultToken", + "textDocument", + "identifier", + "previousResultId"]); + + end DocumentDiagnosticParams_Scope; + + procedure Read_DocumentDiagnosticParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentDiagnosticParams) is + use DocumentDiagnosticParams_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case DocumentDiagnosticParams_Map.Get_Index (Key) is + when 1 => -- workDoneToken + Value.workDoneToken := + (Is_Set => True, + Value => <>); + Read_ProgressToken (Handler, Value.workDoneToken.Value); + when 2 => -- partialResultToken + Value.partialResultToken := + (Is_Set => True, + Value => <>); + Read_ProgressToken (Handler, Value.partialResultToken.Value); + when 3 => -- textDocument + Read_TextDocumentIdentifier (Handler, Value.textDocument); + when 4 => -- identifier + Value.identifier.Clear; + Value.identifier.Append (Handler.String_Value); + Handler.Read_Next; + when 5 => -- previousResultId + Value.previousResultId.Clear; + Value.previousResultId.Append (Handler.String_Value); + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_DocumentDiagnosticParams; + + procedure Read_DocumentLink_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentLink_Vector) is + begin + pragma Assert (Handler.Is_Start_Array); + Handler.Read_Next; + + declare + Set : LSP.Structures.DocumentLink_Vector renames Value; + Value : LSP.Structures.DocumentLink; + begin + Set.Clear; + while not Handler.Is_End_Array loop + Read_DocumentLink (Handler, Value); + Set.Append (Value); + end loop; + end; + + Handler.Read_Next; + end Read_DocumentLink_Vector; + + package CodeActionKind_Map is new Minimal_Perfect_Hash + (["", + "quickfix", + "refactor", + "refactor.extract", + "refactor.inline", + "refactor.rewrite", + "source", + "source.organizeImports", + "source.fixAll"]); + + procedure Read_CodeActionKind + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.CodeActionKind) is + begin + Value := + LSP.Enumerations.CodeActionKind'Val + (CodeActionKind_Map.Get_Index (Handler.String_Value) - 1); + Handler.Read_Next; + end Read_CodeActionKind; + + package RelatedUnchangedDocumentDiagnosticReport_Scope is + package RelatedUnchangedDocumentDiagnosticReport_Map is new Minimal_Perfect_Hash + (["kind", + "resultId", + "relatedDocuments"]); + + end RelatedUnchangedDocumentDiagnosticReport_Scope; + + procedure Read_RelatedUnchangedDocumentDiagnosticReport + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.RelatedUnchangedDocumentDiagnosticReport) is + use RelatedUnchangedDocumentDiagnosticReport_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case RelatedUnchangedDocumentDiagnosticReport_Map.Get_Index + (Key) is + when 1 => -- kind + Handler.Read_Next; -- Skip string literal: unchanged + when 2 => -- resultId + Value.resultId.Clear; + Value.resultId.Append (Handler.String_Value); + Handler.Read_Next; + when 3 => -- relatedDocuments + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + declare + Map : + LSP.Structures + .relatedDocuments_OfDocumentDiagnosticReportPartialResult renames + Value.relatedDocuments; + Key : LSP.Structures.DocumentUri; + Value : + LSP.Structures + .relatedDocuments_OfDocumentDiagnosticReportPartialResult_Item; + begin + Key := (Handler.Key_Name with null record); + Handler.Read_Next; + Read_relatedDocuments_OfDocumentDiagnosticReportPartialResult_Item + (Handler, Value); + Map.Insert (Key, Value); + end; + end loop; + + Handler.Read_Next; + + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_RelatedUnchangedDocumentDiagnosticReport; + + package DidChangeWatchedFilesClientCapabilities_Scope is + package DidChangeWatchedFilesClientCapabilities_Map is new Minimal_Perfect_Hash + (["dynamicRegistration", + "relativePatternSupport"]); + + end DidChangeWatchedFilesClientCapabilities_Scope; + + procedure Read_DidChangeWatchedFilesClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DidChangeWatchedFilesClientCapabilities) is + use DidChangeWatchedFilesClientCapabilities_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case DidChangeWatchedFilesClientCapabilities_Map.Get_Index (Key) is + when 1 => -- dynamicRegistration + Value.dynamicRegistration := + (Is_Set => True, + Value => <>); + Value.dynamicRegistration.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 2 => -- relativePatternSupport + Value.relativePatternSupport := + (Is_Set => True, + Value => <>); + Value.relativePatternSupport.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_DidChangeWatchedFilesClientCapabilities; + + package SemanticTokenTypes_Map is new Minimal_Perfect_Hash + (["namespace", + "type", + "class", + "enum", + "interface", + "struct", + "typeParameter", + "parameter", + "variable", + "property", + "enumMember", + "event", + "function", + "method", + "macro", + "keyword", + "modifier", + "comment", + "string", + "number", + "regexp", + "operator", + "decorator"]); + + procedure Read_SemanticTokenTypes + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.SemanticTokenTypes) is + begin + Value := + LSP.Enumerations.SemanticTokenTypes'Val + (SemanticTokenTypes_Map.Get_Index (Handler.String_Value) - 1); + Handler.Read_Next; + end Read_SemanticTokenTypes; + + package AnnotatedTextEdit_Scope is + package AnnotatedTextEdit_Map is new Minimal_Perfect_Hash + (["range", + "newText", + "annotationId"]); + + end AnnotatedTextEdit_Scope; + + procedure Read_AnnotatedTextEdit + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.AnnotatedTextEdit) is + use AnnotatedTextEdit_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case AnnotatedTextEdit_Map.Get_Index (Key) is + when 1 => -- range + Read_A_Range (Handler, Value.a_range); + when 2 => -- newText + Value.newText.Clear; + Value.newText.Append (Handler.String_Value); + Handler.Read_Next; + when 3 => -- annotationId + Read_ChangeAnnotationIdentifier + (Handler, Value.annotationId); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_AnnotatedTextEdit; + + package DeclarationOptions_Scope is + package DeclarationOptions_Map is new Minimal_Perfect_Hash + (["workDoneProgress"]); + + end DeclarationOptions_Scope; + + procedure Read_DeclarationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DeclarationOptions) is + use DeclarationOptions_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case DeclarationOptions_Map.Get_Index (Key) is + when 1 => -- workDoneProgress + Value.workDoneProgress := + (Is_Set => True, + Value => <>); + Value.workDoneProgress.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_DeclarationOptions; + + package SignatureInformation_Scope is + package SignatureInformation_Map is new Minimal_Perfect_Hash + (["label", + "documentation", + "parameters", + "activeParameter"]); + + end SignatureInformation_Scope; + + procedure Read_SignatureInformation + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SignatureInformation) is + use SignatureInformation_Scope; + procedure Read_ParameterInformation_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ParameterInformation_Vector); + + procedure Read_ParameterInformation_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ParameterInformation_Vector) is + begin + pragma Assert (Handler.Is_Start_Array); + Handler.Read_Next; + + declare + Set : LSP.Structures.ParameterInformation_Vector renames Value; + Value : LSP.Structures.ParameterInformation; + begin + Set.Clear; + while not Handler.Is_End_Array loop + Read_ParameterInformation (Handler, Value); + Set.Append (Value); + end loop; + end; + + Handler.Read_Next; + end Read_ParameterInformation_Vector; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case SignatureInformation_Map.Get_Index (Key) is + when 1 => -- label + Value.label.Clear; + Value.label.Append (Handler.String_Value); + Handler.Read_Next; + when 2 => -- documentation + Value.documentation := + (Is_Set => True, + Value => <>); + Read_Virtual_String_Or_MarkupContent + (Handler, Value.documentation.Value); + when 3 => -- parameters + Read_ParameterInformation_Vector (Handler, Value.parameters); + when 4 => -- activeParameter + Value.activeParameter := + (Is_Set => True, + Value => <>); + Value.activeParameter.Value := + Integer (Handler.Number_Value.Integer_Value); + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_SignatureInformation; + + procedure Read_TextDocumentSaveReason + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.TextDocumentSaveReason) is + begin + Value := + LSP.Enumerations.TextDocumentSaveReason'Val + (Handler.Number_Value.Integer_Value - 1); + Handler.Read_Next; + end Read_TextDocumentSaveReason; + + package SemanticTokens_Scope is + package SemanticTokens_Map is new Minimal_Perfect_Hash + (["resultId", + "data"]); + + end SemanticTokens_Scope; + + procedure Read_SemanticTokens + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SemanticTokens) is + use SemanticTokens_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case SemanticTokens_Map.Get_Index (Key) is + when 1 => -- resultId + Value.resultId.Clear; + Value.resultId.Append (Handler.String_Value); + Handler.Read_Next; + when 2 => -- data + Read_Natural_Vector (Handler, Value.data); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_SemanticTokens; + + package InlineValueParams_Scope is + package InlineValueParams_Map is new Minimal_Perfect_Hash + (["workDoneToken", + "textDocument", + "range", + "context"]); + + end InlineValueParams_Scope; + + procedure Read_InlineValueParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.InlineValueParams) is + use InlineValueParams_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case InlineValueParams_Map.Get_Index (Key) is + when 1 => -- workDoneToken + Value.workDoneToken := + (Is_Set => True, + Value => <>); + Read_ProgressToken (Handler, Value.workDoneToken.Value); + when 2 => -- textDocument + Read_TextDocumentIdentifier (Handler, Value.textDocument); + when 3 => -- range + Read_A_Range (Handler, Value.a_range); + when 4 => -- context + Read_InlineValueContext (Handler, Value.context); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_InlineValueParams; + + package TokenFormat_Map is new Minimal_Perfect_Hash (["relative"]); + + procedure Read_TokenFormat + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.TokenFormat) is + begin + Value := + LSP.Enumerations.TokenFormat'Val + (TokenFormat_Map.Get_Index (Handler.String_Value) - 1); + Handler.Read_Next; + end Read_TokenFormat; + + package TextDocumentRegistrationOptions_Scope is + package TextDocumentRegistrationOptions_Map is new Minimal_Perfect_Hash + (["documentSelector"]); + + end TextDocumentRegistrationOptions_Scope; + + procedure Read_TextDocumentRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.TextDocumentRegistrationOptions) is + use TextDocumentRegistrationOptions_Scope; + procedure Read_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSelector_Or_Null); + + procedure Read_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSelector_Or_Null) is + begin + if Handler.Is_Null_Value then + Handler.Read_Next; + else + Value := + (Is_Null => False, + Value => <>); + Read_DocumentSelector (Handler, Value.Value); + end if; + end Read_DocumentSelector_Or_Null; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case TextDocumentRegistrationOptions_Map.Get_Index (Key) is + when 1 => -- documentSelector + Read_DocumentSelector_Or_Null + (Handler, Value.documentSelector); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_TextDocumentRegistrationOptions; + + procedure Read_URI + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.URI) is + begin + Value.Clear; + Value.Append (Handler.String_Value); + Handler.Read_Next; + end Read_URI; + + package SemanticTokenModifiers_Map is new Minimal_Perfect_Hash + (["declaration", + "definition", + "readonly", + "static", + "deprecated", + "abstract", + "async", + "modification", + "documentation", + "defaultLibrary"]); + + procedure Read_SemanticTokenModifiers + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.SemanticTokenModifiers) is + begin + Value := + LSP.Enumerations.SemanticTokenModifiers'Val + (SemanticTokenModifiers_Map.Get_Index (Handler.String_Value) - 1); + Handler.Read_Next; + end Read_SemanticTokenModifiers; + + package ConfigurationItem_Scope is + package ConfigurationItem_Map is new Minimal_Perfect_Hash + (["scopeUri", + "section"]); + + end ConfigurationItem_Scope; + + procedure Read_ConfigurationItem + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ConfigurationItem) is + use ConfigurationItem_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case ConfigurationItem_Map.Get_Index (Key) is + when 1 => -- scopeUri + Value.scopeUri.Clear; + Value.scopeUri.Append (Handler.String_Value); + Handler.Read_Next; + when 2 => -- section + Value.section.Clear; + Value.section.Append (Handler.String_Value); + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_ConfigurationItem; + + package DocumentOnTypeFormattingClientCapabilities_Scope is + package DocumentOnTypeFormattingClientCapabilities_Map is new Minimal_Perfect_Hash + (["dynamicRegistration"]); + + end DocumentOnTypeFormattingClientCapabilities_Scope; + + procedure Read_DocumentOnTypeFormattingClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentOnTypeFormattingClientCapabilities) is + use DocumentOnTypeFormattingClientCapabilities_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case DocumentOnTypeFormattingClientCapabilities_Map.Get_Index + (Key) is + when 1 => -- dynamicRegistration + Value.dynamicRegistration := + (Is_Set => True, + Value => <>); + Value.dynamicRegistration.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_DocumentOnTypeFormattingClientCapabilities; + + procedure Read_SymbolKind + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.SymbolKind) is + begin + Value := + LSP.Enumerations.SymbolKind'Val + (Handler.Number_Value.Integer_Value - 1); + Handler.Read_Next; + end Read_SymbolKind; + + package DidSaveNotebookDocumentParams_Scope is + package DidSaveNotebookDocumentParams_Map is new Minimal_Perfect_Hash + (["notebookDocument"]); + + end DidSaveNotebookDocumentParams_Scope; + + procedure Read_DidSaveNotebookDocumentParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DidSaveNotebookDocumentParams) is + use DidSaveNotebookDocumentParams_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case DidSaveNotebookDocumentParams_Map.Get_Index (Key) is + when 1 => -- notebookDocument + Read_NotebookDocumentIdentifier + (Handler, Value.notebookDocument); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_DidSaveNotebookDocumentParams; + + package Declaration_Result_Scope is + package Declaration_Result_Map is new Minimal_Perfect_Hash + (["uri", + "range"]); + + end Declaration_Result_Scope; + + procedure Read_Declaration_Result + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Declaration_Result) is + use Declaration_Result_Scope; + begin + declare + Parent : + constant not null access VSS.JSON.Pull_Readers.JSON_Pull_Reader' + Class := + Handler'Access; + Handler : + VSS.JSON.Pull_Readers.Buffered.JSON_Buffered_Pull_Reader (Parent); + begin + Handler.Mark; + if Handler.Is_Null_Value then + Value := + (Kind => LSP.Structures.Varian_3, + others => <>); + elsif Handler.Is_Start_Object then + Handler.Read_Next; + Value := + (Kind => LSP.Structures.Varian_2, + others => <>); + while Handler.Is_Key_Name loop + declare + Key : constant VSS.Strings.Virtual_String := + Handler.Key_Name; + Index : constant Natural := + Declaration_Result_Map.Get_Index (Key); + begin + Handler.Read_Next; + case Index is + when 1 => -- uri + Value := + (Kind => LSP.Structures.Varian_1, + others => <>); + exit; + when 2 => -- range + Value := + (Kind => LSP.Structures.Varian_1, + others => <>); + exit; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + else + raise Program_Error; -- Unexpected JSON value + end if; + + Handler.Reset; + Handler.Unmark; + + case Value.Kind is + when LSP.Structures.Varian_1 => + Read_Declaration (Handler, Value.Varian_1); + when LSP.Structures.Varian_2 => + Read_DeclarationLink_Vector (Handler, Value.Varian_2); + when LSP.Structures.Varian_3 => + null; -- #null_value + Handler.Read_Next; + end case; + end; + end Read_Declaration_Result; + + package Definition_Progress_Report_Scope is + package Definition_Progress_Report_Map is new Minimal_Perfect_Hash + (["uri", + "range", + "originSelectionRange", + "targetUri", + "targetRange", + "targetSelectionRange"]); + + end Definition_Progress_Report_Scope; + + procedure Read_Definition_Progress_Report + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Definition_Progress_Report) is + use Definition_Progress_Report_Scope; + begin + declare + Parent : + constant not null access VSS.JSON.Pull_Readers.JSON_Pull_Reader' + Class := + Handler'Access; + Handler : + VSS.JSON.Pull_Readers.Buffered.JSON_Buffered_Pull_Reader (Parent); + begin + Handler.Mark; + if Handler.Is_Start_Array then + Handler.Read_Next; + end if; + if Handler.Is_Start_Object then + Handler.Read_Next; + while Handler.Is_Key_Name loop + declare + Key : constant VSS.Strings.Virtual_String := + Handler.Key_Name; + Index : constant Natural := + Definition_Progress_Report_Map.Get_Index (Key); + begin + Handler.Read_Next; + case Index is + when 1 => -- uri + Value := + (Kind => LSP.Structures.Varian_1, + others => <>); + exit; + when 2 => -- range + Value := + (Kind => LSP.Structures.Varian_1, + others => <>); + exit; + when 3 => -- originSelectionRange + Value := + (Kind => LSP.Structures.Varian_2, + others => <>); + exit; + when 4 => -- targetUri + Value := + (Kind => LSP.Structures.Varian_2, + others => <>); + exit; + when 5 => -- targetRange + Value := + (Kind => LSP.Structures.Varian_2, + others => <>); + exit; + when 6 => -- targetSelectionRange + Value := + (Kind => LSP.Structures.Varian_2, + others => <>); + exit; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + else + raise Program_Error; -- Unexpected JSON value + end if; + + Handler.Reset; + Handler.Unmark; + + case Value.Kind is + when LSP.Structures.Varian_1 => + Read_Location_Vector (Handler, Value.Varian_1); + when LSP.Structures.Varian_2 => + Read_DefinitionLink_Vector (Handler, Value.Varian_2); + end case; + end; + end Read_Definition_Progress_Report; + + package SemanticTokensParams_Scope is + package SemanticTokensParams_Map is new Minimal_Perfect_Hash + (["workDoneToken", + "partialResultToken", + "textDocument"]); + + end SemanticTokensParams_Scope; + + procedure Read_SemanticTokensParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SemanticTokensParams) is + use SemanticTokensParams_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case SemanticTokensParams_Map.Get_Index (Key) is + when 1 => -- workDoneToken + Value.workDoneToken := + (Is_Set => True, + Value => <>); + Read_ProgressToken (Handler, Value.workDoneToken.Value); + when 2 => -- partialResultToken + Value.partialResultToken := + (Is_Set => True, + Value => <>); + Read_ProgressToken (Handler, Value.partialResultToken.Value); + when 3 => -- textDocument + Read_TextDocumentIdentifier (Handler, Value.textDocument); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_SemanticTokensParams; + + procedure Read_ColorInformation_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ColorInformation_Vector) is + begin + pragma Assert (Handler.Is_Start_Array); + Handler.Read_Next; + + declare + Set : LSP.Structures.ColorInformation_Vector renames Value; + Value : LSP.Structures.ColorInformation; + begin + Set.Clear; + while not Handler.Is_End_Array loop + Read_ColorInformation (Handler, Value); + Set.Append (Value); + end loop; + end; + + Handler.Read_Next; + end Read_ColorInformation_Vector; + + package SelectionRangeClientCapabilities_Scope is + package SelectionRangeClientCapabilities_Map is new Minimal_Perfect_Hash + (["dynamicRegistration"]); + + end SelectionRangeClientCapabilities_Scope; + + procedure Read_SelectionRangeClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SelectionRangeClientCapabilities) is + use SelectionRangeClientCapabilities_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case SelectionRangeClientCapabilities_Map.Get_Index (Key) is + when 1 => -- dynamicRegistration + Value.dynamicRegistration := + (Is_Set => True, + Value => <>); + Value.dynamicRegistration.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_SelectionRangeClientCapabilities; + + package DocumentSymbol_Progress_Report_Scope is + package DocumentSymbol_Progress_Report_Map is new Minimal_Perfect_Hash + (["location", + "containerName", + "detail", + "range", + "selectionRange", + "children"]); + + end DocumentSymbol_Progress_Report_Scope; + + procedure Read_DocumentSymbol_Progress_Report + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSymbol_Progress_Report) is + use DocumentSymbol_Progress_Report_Scope; + begin + declare + Parent : + constant not null access VSS.JSON.Pull_Readers.JSON_Pull_Reader' + Class := + Handler'Access; + Handler : + VSS.JSON.Pull_Readers.Buffered.JSON_Buffered_Pull_Reader (Parent); + begin + Handler.Mark; + if Handler.Is_Start_Array then + Handler.Read_Next; + end if; + if Handler.Is_Start_Object then + Handler.Read_Next; + while Handler.Is_Key_Name loop + declare + Key : constant VSS.Strings.Virtual_String := + Handler.Key_Name; + Index : constant Natural := + DocumentSymbol_Progress_Report_Map.Get_Index (Key); + begin + Handler.Read_Next; + case Index is + when 1 => -- location + Value := + (Kind => LSP.Structures.Varian_1, + others => <>); + exit; + when 2 => -- containerName + Value := + (Kind => LSP.Structures.Varian_1, + others => <>); + exit; + when 3 => -- detail + Value := + (Kind => LSP.Structures.Varian_2, + others => <>); + exit; + when 4 => -- range + Value := + (Kind => LSP.Structures.Varian_2, + others => <>); + exit; + when 5 => -- selectionRange + Value := + (Kind => LSP.Structures.Varian_2, + others => <>); + exit; + when 6 => -- children + Value := + (Kind => LSP.Structures.Varian_2, + others => <>); + exit; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + else + raise Program_Error; -- Unexpected JSON value + end if; + + Handler.Reset; + Handler.Unmark; + + case Value.Kind is + when LSP.Structures.Varian_1 => + Read_SymbolInformation_Vector (Handler, Value.Varian_1); + when LSP.Structures.Varian_2 => + Read_DocumentSymbol_Vector (Handler, Value.Varian_2); + end case; + end; + end Read_DocumentSymbol_Progress_Report; + + procedure Read_CallHierarchyIncomingCall_Vector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CallHierarchyIncomingCall_Vector_Or_Null) is + begin + if Handler.Is_Null_Value then + Handler.Read_Next; + else + Value.Clear; + Read_CallHierarchyIncomingCall_Vector (Handler, Value); + end if; + end Read_CallHierarchyIncomingCall_Vector_Or_Null; + + procedure Read_Range_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Range_Vector) is + begin + pragma Assert (Handler.Is_Start_Array); + Handler.Read_Next; + + declare + Set : LSP.Structures.Range_Vector renames Value; + Value : LSP.Structures.A_Range; + begin + Set.Clear; + while not Handler.Is_End_Array loop + Read_A_Range (Handler, Value); + Set.Append (Value); + end loop; + end; + + Handler.Read_Next; + end Read_Range_Vector; + + procedure Read_Definition + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Definition) is + begin + declare + Set : LSP.Structures.Definition renames Value; + Value : LSP.Structures.Location; + begin + Set.Clear; + if Handler.Is_Start_Array then + Handler.Read_Next; + while not Handler.Is_End_Array loop + Read_Location (Handler, Value); + Set.Append (Value); + end loop; + Handler.Read_Next; + + else + Read_Location (Handler, Value); + Set.Append (Value); + end if; + end; + + end Read_Definition; + + package NotebookDocumentFilter_Scope is + package NotebookDocumentFilter_Map is new Minimal_Perfect_Hash + (["notebookType", + "scheme", + "pattern"]); + + end NotebookDocumentFilter_Scope; + + procedure Read_NotebookDocumentFilter + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.NotebookDocumentFilter) is + use NotebookDocumentFilter_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while Handler.Is_Key_Name loop + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case NotebookDocumentFilter_Map.Get_Index (Key) is + when 1 => -- notebookType + Value.notebookType.Clear; + Value.notebookType.Append (Handler.String_Value); + Handler.Read_Next; + when 2 => -- scheme + Value.scheme.Clear; + Value.scheme.Append (Handler.String_Value); + Handler.Read_Next; + when 3 => -- pattern + Value.pattern.Clear; + Value.pattern.Append (Handler.String_Value); + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_NotebookDocumentFilter; + + package Color_Scope is + package Color_Map is new Minimal_Perfect_Hash + (["red", + "green", + "blue", + "alpha"]); + + end Color_Scope; + + procedure Read_Color + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Color) is + use Color_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case Color_Map.Get_Index (Key) is + when 1 => -- red + Value.red := Float (Handler.Number_Value.Float_Value); + Handler.Read_Next; + when 2 => -- green + Value.green := Float (Handler.Number_Value.Float_Value); + Handler.Read_Next; + when 3 => -- blue + Value.blue := Float (Handler.Number_Value.Float_Value); + Handler.Read_Next; + when 4 => -- alpha + Value.alpha := Float (Handler.Number_Value.Float_Value); + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_Color; + + package FileOperationPattern_Scope is + package FileOperationPattern_Map is new Minimal_Perfect_Hash + (["glob", + "matches", + "options"]); + + end FileOperationPattern_Scope; + + procedure Read_FileOperationPattern + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.FileOperationPattern) is + use FileOperationPattern_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case FileOperationPattern_Map.Get_Index (Key) is + when 1 => -- glob + Value.glob.Clear; + Value.glob.Append (Handler.String_Value); + Handler.Read_Next; + when 2 => -- matches + Value.matches := + (Is_Set => True, + Value => <>); + Read_FileOperationPatternKind (Handler, Value.matches.Value); + when 3 => -- options + Value.options := + (Is_Set => True, + Value => <>); + Read_FileOperationPatternOptions + (Handler, Value.options.Value); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_FileOperationPattern; + + package LinkedEditingRanges_Scope is + package LinkedEditingRanges_Map is new Minimal_Perfect_Hash + (["ranges", + "wordPattern"]); + + end LinkedEditingRanges_Scope; + + procedure Read_LinkedEditingRanges + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.LinkedEditingRanges) is + use LinkedEditingRanges_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case LinkedEditingRanges_Map.Get_Index (Key) is + when 1 => -- ranges + Read_Range_Vector (Handler, Value.ranges); + when 2 => -- wordPattern + Value.wordPattern.Clear; + Value.wordPattern.Append (Handler.String_Value); + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_LinkedEditingRanges; + + procedure Read_Virtual_String_Or_MarkupContent + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Virtual_String_Or_MarkupContent) is + begin + if Handler.Is_String_Value then + Value := + (Is_Virtual_String => True, + others => <>); + else + Value := + (Is_Virtual_String => False, + others => <>); + end if; + + case Value.Is_Virtual_String is + when True => + Value.Virtual_String.Clear; + Value.Virtual_String.Append (Handler.String_Value); + Handler.Read_Next; + when False => + Read_MarkupContent (Handler, Value.MarkupContent); + end case; + end Read_Virtual_String_Or_MarkupContent; + + procedure Read_CodeLens_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CodeLens_Vector) is + begin + pragma Assert (Handler.Is_Start_Array); + Handler.Read_Next; + + declare + Set : LSP.Structures.CodeLens_Vector renames Value; + Value : LSP.Structures.CodeLens; + begin + Set.Clear; + while not Handler.Is_End_Array loop + Read_CodeLens (Handler, Value); + Set.Append (Value); + end loop; + end; + + Handler.Read_Next; + end Read_CodeLens_Vector; + + package ServerCapabilities_Scope is + package ServerCapabilities_Map is new Minimal_Perfect_Hash + (["positionEncoding", + "textDocumentSync", + "notebookDocumentSync", + "completionProvider", + "hoverProvider", + "signatureHelpProvider", + "declarationProvider", + "definitionProvider", + "typeDefinitionProvider", + "implementationProvider", + "referencesProvider", + "documentHighlightProvider", + "documentSymbolProvider", + "codeActionProvider", + "codeLensProvider", + "documentLinkProvider", + "colorProvider", + "workspaceSymbolProvider", + "documentFormattingProvider", + "documentRangeFormattingProvider", + "documentOnTypeFormattingProvider", + "renameProvider", + "foldingRangeProvider", + "selectionRangeProvider", + "executeCommandProvider", + "callHierarchyProvider", + "linkedEditingRangeProvider", + "semanticTokensProvider", + "monikerProvider", + "typeHierarchyProvider", + "inlineValueProvider", + "inlayHintProvider", + "diagnosticProvider", + "workspace", + "experimental"]); + + package NotebookDocumentSyncOptions_Or_NotebookDocumentSyncRegistrationOptions_Scope + is + package NotebookDocumentSyncOptions_Or_NotebookDocumentSyncRegistrationOptions_Map is new Minimal_Perfect_Hash + (["id"]); + + end NotebookDocumentSyncOptions_Or_NotebookDocumentSyncRegistrationOptions_Scope; + + package implementationProvider_OfServerCapabilities_Scope is + package implementationProvider_OfServerCapabilities_Map is new Minimal_Perfect_Hash + (["documentSelector", + "id"]); + + end implementationProvider_OfServerCapabilities_Scope; + + package typeHierarchyProvider_OfServerCapabilities_Scope is + package typeHierarchyProvider_OfServerCapabilities_Map is new Minimal_Perfect_Hash + (["documentSelector", + "id"]); + + end typeHierarchyProvider_OfServerCapabilities_Scope; + + package DiagnosticOptions_Or_DiagnosticRegistrationOptions_Scope is + package DiagnosticOptions_Or_DiagnosticRegistrationOptions_Map is new Minimal_Perfect_Hash + (["documentSelector", + "id"]); + + end DiagnosticOptions_Or_DiagnosticRegistrationOptions_Scope; + + package inlayHintProvider_OfServerCapabilities_Scope is + package inlayHintProvider_OfServerCapabilities_Map is new Minimal_Perfect_Hash + (["documentSelector", + "id"]); + + end inlayHintProvider_OfServerCapabilities_Scope; + + package SemanticTokensOptions_Or_SemanticTokensRegistrationOptions_Scope + is + package SemanticTokensOptions_Or_SemanticTokensRegistrationOptions_Map is new Minimal_Perfect_Hash + (["documentSelector", + "id"]); + + end SemanticTokensOptions_Or_SemanticTokensRegistrationOptions_Scope; + + package monikerProvider_OfServerCapabilities_Scope is + package monikerProvider_OfServerCapabilities_Map is new Minimal_Perfect_Hash + (["documentSelector"]); + + end monikerProvider_OfServerCapabilities_Scope; + + package selectionRangeProvider_OfServerCapabilities_Scope is + package selectionRangeProvider_OfServerCapabilities_Map is new Minimal_Perfect_Hash + (["documentSelector", + "id"]); + + end selectionRangeProvider_OfServerCapabilities_Scope; + + package workspace_OfServerCapabilities_Scope is + package workspace_OfServerCapabilities_Map is new Minimal_Perfect_Hash + (["workspaceFolders", + "fileOperations"]); + + end workspace_OfServerCapabilities_Scope; + + package declarationProvider_OfServerCapabilities_Scope is + package declarationProvider_OfServerCapabilities_Map is new Minimal_Perfect_Hash + (["documentSelector", + "id"]); + + end declarationProvider_OfServerCapabilities_Scope; + + package callHierarchyProvider_OfServerCapabilities_Scope is + package callHierarchyProvider_OfServerCapabilities_Map is new Minimal_Perfect_Hash + (["documentSelector", + "id"]); + + end callHierarchyProvider_OfServerCapabilities_Scope; + + package linkedEditingRangeProvider_OfServerCapabilities_Scope is + package linkedEditingRangeProvider_OfServerCapabilities_Map is new Minimal_Perfect_Hash + (["documentSelector", + "id"]); + + end linkedEditingRangeProvider_OfServerCapabilities_Scope; + + package foldingRangeProvider_OfServerCapabilities_Scope is + package foldingRangeProvider_OfServerCapabilities_Map is new Minimal_Perfect_Hash + (["documentSelector", + "id"]); + + end foldingRangeProvider_OfServerCapabilities_Scope; + + package typeDefinitionProvider_OfServerCapabilities_Scope is + package typeDefinitionProvider_OfServerCapabilities_Map is new Minimal_Perfect_Hash + (["documentSelector", + "id"]); + + end typeDefinitionProvider_OfServerCapabilities_Scope; + + package inlineValueProvider_OfServerCapabilities_Scope is + package inlineValueProvider_OfServerCapabilities_Map is new Minimal_Perfect_Hash + (["documentSelector", + "id"]); + + end inlineValueProvider_OfServerCapabilities_Scope; + + package colorProvider_OfServerCapabilities_Scope is + package colorProvider_OfServerCapabilities_Map is new Minimal_Perfect_Hash + (["documentSelector", + "id"]); + + end colorProvider_OfServerCapabilities_Scope; + + end ServerCapabilities_Scope; + + procedure Read_ServerCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ServerCapabilities) is + use ServerCapabilities_Scope; + procedure Read_Boolean_Or_DocumentSymbolOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Boolean_Or_DocumentSymbolOptions); + + procedure Read_NotebookDocumentSyncOptions_Or_NotebookDocumentSyncRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .NotebookDocumentSyncOptions_Or_NotebookDocumentSyncRegistrationOptions); + + procedure Read_Boolean_Or_WorkspaceSymbolOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Boolean_Or_WorkspaceSymbolOptions); + + procedure Read_implementationProvider_OfServerCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .implementationProvider_OfServerCapabilities); + + procedure Read_typeHierarchyProvider_OfServerCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .typeHierarchyProvider_OfServerCapabilities); + + procedure Read_DiagnosticOptions_Or_DiagnosticRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .DiagnosticOptions_Or_DiagnosticRegistrationOptions); + + procedure Read_inlayHintProvider_OfServerCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.inlayHintProvider_OfServerCapabilities); + + procedure Read_SemanticTokensOptions_Or_SemanticTokensRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .SemanticTokensOptions_Or_SemanticTokensRegistrationOptions); + + procedure Read_monikerProvider_OfServerCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.monikerProvider_OfServerCapabilities); + + procedure Read_Boolean_Or_CodeActionOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Boolean_Or_CodeActionOptions); + + procedure Read_selectionRangeProvider_OfServerCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .selectionRangeProvider_OfServerCapabilities); + + procedure Read_Boolean_Or_DocumentRangeFormattingOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Boolean_Or_DocumentRangeFormattingOptions); + + procedure Read_Boolean_Or_HoverOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Boolean_Or_HoverOptions); + + procedure Read_workspace_OfServerCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.workspace_OfServerCapabilities); + + procedure Read_declarationProvider_OfServerCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.declarationProvider_OfServerCapabilities); + + procedure Read_callHierarchyProvider_OfServerCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .callHierarchyProvider_OfServerCapabilities); + + procedure Read_Boolean_Or_DocumentHighlightOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Boolean_Or_DocumentHighlightOptions); + + procedure Read_TextDocumentSyncOptions_Or_TextDocumentSyncKind + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .TextDocumentSyncOptions_Or_TextDocumentSyncKind); + + procedure Read_linkedEditingRangeProvider_OfServerCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .linkedEditingRangeProvider_OfServerCapabilities); + + procedure Read_Boolean_Or_DocumentFormattingOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Boolean_Or_DocumentFormattingOptions); + + procedure Read_Boolean_Or_ReferenceOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Boolean_Or_ReferenceOptions); + + procedure Read_foldingRangeProvider_OfServerCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.foldingRangeProvider_OfServerCapabilities); + + procedure Read_typeDefinitionProvider_OfServerCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .typeDefinitionProvider_OfServerCapabilities); + + procedure Read_inlineValueProvider_OfServerCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.inlineValueProvider_OfServerCapabilities); + + procedure Read_colorProvider_OfServerCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.colorProvider_OfServerCapabilities); + + procedure Read_Boolean_Or_DefinitionOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Boolean_Or_DefinitionOptions); + + procedure Read_Boolean_Or_RenameOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Boolean_Or_RenameOptions); + + procedure Read_Boolean_Or_DocumentSymbolOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Boolean_Or_DocumentSymbolOptions) is + begin + if Handler.Is_Boolean_Value then + Value := + (Is_Boolean => True, + others => <>); + else + Value := + (Is_Boolean => False, + others => <>); + end if; + + case Value.Is_Boolean is + when True => + Value.Boolean := Handler.Boolean_Value; + Handler.Read_Next; + when False => + Read_DocumentSymbolOptions + (Handler, Value.DocumentSymbolOptions); + end case; + end Read_Boolean_Or_DocumentSymbolOptions; + + procedure Read_NotebookDocumentSyncOptions_Or_NotebookDocumentSyncRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .NotebookDocumentSyncOptions_Or_NotebookDocumentSyncRegistrationOptions) is + use + NotebookDocumentSyncOptions_Or_NotebookDocumentSyncRegistrationOptions_Scope; + begin + declare + Parent : + constant not null access VSS.JSON.Pull_Readers.JSON_Pull_Reader' + Class := + Handler'Access; + Handler : + VSS.JSON.Pull_Readers.Buffered.JSON_Buffered_Pull_Reader + (Parent); + begin + Handler.Mark; + if Handler.Is_Start_Object then + Handler.Read_Next; + Value := + (Is_NotebookDocumentSyncOptions => True, + others => <>); + while Handler.Is_Key_Name loop + declare + Key : constant VSS.Strings.Virtual_String := + Handler.Key_Name; + Index : constant Natural := + NotebookDocumentSyncOptions_Or_NotebookDocumentSyncRegistrationOptions_Map + .Get_Index + (Key); + begin + Handler.Read_Next; + case Index is + when 1 => -- id + Value := + (Is_NotebookDocumentSyncOptions => False, + others => <>); + exit; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + else + raise Program_Error; -- Unexpected JSON value + end if; + + Handler.Reset; + Handler.Unmark; + + case Value.Is_NotebookDocumentSyncOptions is + when True => + Read_NotebookDocumentSyncOptions + (Handler, Value.NotebookDocumentSyncOptions); + when False => + Read_NotebookDocumentSyncRegistrationOptions + (Handler, Value.NotebookDocumentSyncRegistrationOptions); + end case; + end; + end Read_NotebookDocumentSyncOptions_Or_NotebookDocumentSyncRegistrationOptions; + + procedure Read_Boolean_Or_WorkspaceSymbolOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Boolean_Or_WorkspaceSymbolOptions) is + begin + if Handler.Is_Boolean_Value then + Value := + (Is_Boolean => True, + others => <>); + else + Value := + (Is_Boolean => False, + others => <>); + end if; + + case Value.Is_Boolean is + when True => + Value.Boolean := Handler.Boolean_Value; + Handler.Read_Next; + when False => + Read_WorkspaceSymbolOptions + (Handler, Value.WorkspaceSymbolOptions); + end case; + end Read_Boolean_Or_WorkspaceSymbolOptions; + + procedure Read_implementationProvider_OfServerCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .implementationProvider_OfServerCapabilities) is + use implementationProvider_OfServerCapabilities_Scope; + begin + declare + Parent : + constant not null access VSS.JSON.Pull_Readers.JSON_Pull_Reader' + Class := + Handler'Access; + Handler : + VSS.JSON.Pull_Readers.Buffered.JSON_Buffered_Pull_Reader + (Parent); + begin + Handler.Mark; + if Handler.Is_Boolean_Value then + Value := + (Kind => LSP.Structures.Varian_1, + others => <>); + elsif Handler.Is_Start_Object then + Handler.Read_Next; + Value := + (Kind => LSP.Structures.Varian_2, + others => <>); + while Handler.Is_Key_Name loop + declare + Key : constant VSS.Strings.Virtual_String := + Handler.Key_Name; + Index : constant Natural := + implementationProvider_OfServerCapabilities_Map + .Get_Index + (Key); + begin + Handler.Read_Next; + case Index is + when 1 => -- documentSelector + Value := + (Kind => LSP.Structures.Varian_3, + others => <>); + exit; + when 2 => -- id + Value := + (Kind => LSP.Structures.Varian_3, + others => <>); + exit; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + else + raise Program_Error; -- Unexpected JSON value + end if; + + Handler.Reset; + Handler.Unmark; + + case Value.Kind is + when LSP.Structures.Varian_1 => + Value.Varian_1 := Handler.Boolean_Value; + Handler.Read_Next; + when LSP.Structures.Varian_2 => + Read_ImplementationOptions (Handler, Value.Varian_2); + when LSP.Structures.Varian_3 => + Read_ImplementationRegistrationOptions + (Handler, Value.Varian_3); + end case; + end; + end Read_implementationProvider_OfServerCapabilities; + + procedure Read_typeHierarchyProvider_OfServerCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .typeHierarchyProvider_OfServerCapabilities) is + use typeHierarchyProvider_OfServerCapabilities_Scope; + begin + declare + Parent : + constant not null access VSS.JSON.Pull_Readers.JSON_Pull_Reader' + Class := + Handler'Access; + Handler : + VSS.JSON.Pull_Readers.Buffered.JSON_Buffered_Pull_Reader + (Parent); + begin + Handler.Mark; + if Handler.Is_Boolean_Value then + Value := + (Kind => LSP.Structures.Varian_1, + others => <>); + elsif Handler.Is_Start_Object then + Handler.Read_Next; + Value := + (Kind => LSP.Structures.Varian_2, + others => <>); + while Handler.Is_Key_Name loop + declare + Key : constant VSS.Strings.Virtual_String := + Handler.Key_Name; + Index : constant Natural := + typeHierarchyProvider_OfServerCapabilities_Map.Get_Index + (Key); + begin + Handler.Read_Next; + case Index is + when 1 => -- documentSelector + Value := + (Kind => LSP.Structures.Varian_3, + others => <>); + exit; + when 2 => -- id + Value := + (Kind => LSP.Structures.Varian_3, + others => <>); + exit; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + else + raise Program_Error; -- Unexpected JSON value + end if; + + Handler.Reset; + Handler.Unmark; + + case Value.Kind is + when LSP.Structures.Varian_1 => + Value.Varian_1 := Handler.Boolean_Value; + Handler.Read_Next; + when LSP.Structures.Varian_2 => + Read_TypeHierarchyOptions (Handler, Value.Varian_2); + when LSP.Structures.Varian_3 => + Read_TypeHierarchyRegistrationOptions + (Handler, Value.Varian_3); + end case; + end; + end Read_typeHierarchyProvider_OfServerCapabilities; + + procedure Read_DiagnosticOptions_Or_DiagnosticRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .DiagnosticOptions_Or_DiagnosticRegistrationOptions) is + use DiagnosticOptions_Or_DiagnosticRegistrationOptions_Scope; + begin + declare + Parent : + constant not null access VSS.JSON.Pull_Readers.JSON_Pull_Reader' + Class := + Handler'Access; + Handler : + VSS.JSON.Pull_Readers.Buffered.JSON_Buffered_Pull_Reader + (Parent); + begin + Handler.Mark; + if Handler.Is_Start_Object then + Handler.Read_Next; + Value := + (Is_DiagnosticOptions => True, + others => <>); + while Handler.Is_Key_Name loop + declare + Key : constant VSS.Strings.Virtual_String := + Handler.Key_Name; + Index : constant Natural := + DiagnosticOptions_Or_DiagnosticRegistrationOptions_Map + .Get_Index + (Key); + begin + Handler.Read_Next; + case Index is + when 1 => -- documentSelector + Value := + (Is_DiagnosticOptions => False, + others => <>); + exit; + when 2 => -- id + Value := + (Is_DiagnosticOptions => False, + others => <>); + exit; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + else + raise Program_Error; -- Unexpected JSON value + end if; + + Handler.Reset; + Handler.Unmark; + + case Value.Is_DiagnosticOptions is + when True => + Read_DiagnosticOptions (Handler, Value.DiagnosticOptions); + when False => + Read_DiagnosticRegistrationOptions + (Handler, Value.DiagnosticRegistrationOptions); + end case; + end; + end Read_DiagnosticOptions_Or_DiagnosticRegistrationOptions; + + procedure Read_inlayHintProvider_OfServerCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.inlayHintProvider_OfServerCapabilities) is + use inlayHintProvider_OfServerCapabilities_Scope; + begin + declare + Parent : + constant not null access VSS.JSON.Pull_Readers.JSON_Pull_Reader' + Class := + Handler'Access; + Handler : + VSS.JSON.Pull_Readers.Buffered.JSON_Buffered_Pull_Reader + (Parent); + begin + Handler.Mark; + if Handler.Is_Boolean_Value then + Value := + (Kind => LSP.Structures.Varian_1, + others => <>); + elsif Handler.Is_Start_Object then + Handler.Read_Next; + Value := + (Kind => LSP.Structures.Varian_2, + others => <>); + while Handler.Is_Key_Name loop + declare + Key : constant VSS.Strings.Virtual_String := + Handler.Key_Name; + Index : constant Natural := + inlayHintProvider_OfServerCapabilities_Map.Get_Index + (Key); + begin + Handler.Read_Next; + case Index is + when 1 => -- documentSelector + Value := + (Kind => LSP.Structures.Varian_3, + others => <>); + exit; + when 2 => -- id + Value := + (Kind => LSP.Structures.Varian_3, + others => <>); + exit; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + else + raise Program_Error; -- Unexpected JSON value + end if; + + Handler.Reset; + Handler.Unmark; + + case Value.Kind is + when LSP.Structures.Varian_1 => + Value.Varian_1 := Handler.Boolean_Value; + Handler.Read_Next; + when LSP.Structures.Varian_2 => + Read_InlayHintOptions (Handler, Value.Varian_2); + when LSP.Structures.Varian_3 => + Read_InlayHintRegistrationOptions (Handler, Value.Varian_3); + end case; + end; + end Read_inlayHintProvider_OfServerCapabilities; + + procedure Read_SemanticTokensOptions_Or_SemanticTokensRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .SemanticTokensOptions_Or_SemanticTokensRegistrationOptions) is + use SemanticTokensOptions_Or_SemanticTokensRegistrationOptions_Scope; + begin + declare + Parent : + constant not null access VSS.JSON.Pull_Readers.JSON_Pull_Reader' + Class := + Handler'Access; + Handler : + VSS.JSON.Pull_Readers.Buffered.JSON_Buffered_Pull_Reader + (Parent); + begin + Handler.Mark; + if Handler.Is_Start_Object then + Handler.Read_Next; + Value := + (Is_SemanticTokensOptions => True, + others => <>); + while Handler.Is_Key_Name loop + declare + Key : constant VSS.Strings.Virtual_String := + Handler.Key_Name; + Index : constant Natural := + SemanticTokensOptions_Or_SemanticTokensRegistrationOptions_Map + .Get_Index + (Key); + begin + Handler.Read_Next; + case Index is + when 1 => -- documentSelector + Value := + (Is_SemanticTokensOptions => False, + others => <>); + exit; + when 2 => -- id + Value := + (Is_SemanticTokensOptions => False, + others => <>); + exit; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + else + raise Program_Error; -- Unexpected JSON value + end if; + + Handler.Reset; + Handler.Unmark; + + case Value.Is_SemanticTokensOptions is + when True => + Read_SemanticTokensOptions + (Handler, Value.SemanticTokensOptions); + when False => + Read_SemanticTokensRegistrationOptions + (Handler, Value.SemanticTokensRegistrationOptions); + end case; + end; + end Read_SemanticTokensOptions_Or_SemanticTokensRegistrationOptions; + + procedure Read_monikerProvider_OfServerCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.monikerProvider_OfServerCapabilities) is + use monikerProvider_OfServerCapabilities_Scope; + begin + declare + Parent : + constant not null access VSS.JSON.Pull_Readers.JSON_Pull_Reader' + Class := + Handler'Access; + Handler : + VSS.JSON.Pull_Readers.Buffered.JSON_Buffered_Pull_Reader + (Parent); + begin + Handler.Mark; + if Handler.Is_Boolean_Value then + Value := + (Kind => LSP.Structures.Varian_1, + others => <>); + elsif Handler.Is_Start_Object then + Handler.Read_Next; + Value := + (Kind => LSP.Structures.Varian_2, + others => <>); + while Handler.Is_Key_Name loop + declare + Key : constant VSS.Strings.Virtual_String := + Handler.Key_Name; + Index : constant Natural := + monikerProvider_OfServerCapabilities_Map.Get_Index + (Key); + begin + Handler.Read_Next; + case Index is + when 1 => -- documentSelector + Value := + (Kind => LSP.Structures.Varian_3, + others => <>); + exit; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + else + raise Program_Error; -- Unexpected JSON value + end if; + + Handler.Reset; + Handler.Unmark; + + case Value.Kind is + when LSP.Structures.Varian_1 => + Value.Varian_1 := Handler.Boolean_Value; + Handler.Read_Next; + when LSP.Structures.Varian_2 => + Read_MonikerOptions (Handler, Value.Varian_2); + when LSP.Structures.Varian_3 => + Read_MonikerRegistrationOptions (Handler, Value.Varian_3); + end case; + end; + end Read_monikerProvider_OfServerCapabilities; + + procedure Read_Boolean_Or_CodeActionOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Boolean_Or_CodeActionOptions) is + begin + if Handler.Is_Boolean_Value then + Value := + (Is_Boolean => True, + others => <>); + else + Value := + (Is_Boolean => False, + others => <>); + end if; + + case Value.Is_Boolean is + when True => + Value.Boolean := Handler.Boolean_Value; + Handler.Read_Next; + when False => + Read_CodeActionOptions (Handler, Value.CodeActionOptions); + end case; + end Read_Boolean_Or_CodeActionOptions; + + procedure Read_selectionRangeProvider_OfServerCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .selectionRangeProvider_OfServerCapabilities) is + use selectionRangeProvider_OfServerCapabilities_Scope; + begin + declare + Parent : + constant not null access VSS.JSON.Pull_Readers.JSON_Pull_Reader' + Class := + Handler'Access; + Handler : + VSS.JSON.Pull_Readers.Buffered.JSON_Buffered_Pull_Reader + (Parent); + begin + Handler.Mark; + if Handler.Is_Boolean_Value then + Value := + (Kind => LSP.Structures.Varian_1, + others => <>); + elsif Handler.Is_Start_Object then + Handler.Read_Next; + Value := + (Kind => LSP.Structures.Varian_2, + others => <>); + while Handler.Is_Key_Name loop + declare + Key : constant VSS.Strings.Virtual_String := + Handler.Key_Name; + Index : constant Natural := + selectionRangeProvider_OfServerCapabilities_Map + .Get_Index + (Key); + begin + Handler.Read_Next; + case Index is + when 1 => -- documentSelector + Value := + (Kind => LSP.Structures.Varian_3, + others => <>); + exit; + when 2 => -- id + Value := + (Kind => LSP.Structures.Varian_3, + others => <>); + exit; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + else + raise Program_Error; -- Unexpected JSON value + end if; + + Handler.Reset; + Handler.Unmark; + + case Value.Kind is + when LSP.Structures.Varian_1 => + Value.Varian_1 := Handler.Boolean_Value; + Handler.Read_Next; + when LSP.Structures.Varian_2 => + Read_SelectionRangeOptions (Handler, Value.Varian_2); + when LSP.Structures.Varian_3 => + Read_SelectionRangeRegistrationOptions + (Handler, Value.Varian_3); + end case; + end; + end Read_selectionRangeProvider_OfServerCapabilities; + + procedure Read_Boolean_Or_DocumentRangeFormattingOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .Boolean_Or_DocumentRangeFormattingOptions) is + begin + if Handler.Is_Boolean_Value then + Value := + (Is_Boolean => True, + others => <>); + else + Value := + (Is_Boolean => False, + others => <>); + end if; + + case Value.Is_Boolean is + when True => + Value.Boolean := Handler.Boolean_Value; + Handler.Read_Next; + when False => + Read_DocumentRangeFormattingOptions + (Handler, Value.DocumentRangeFormattingOptions); + end case; + end Read_Boolean_Or_DocumentRangeFormattingOptions; + + procedure Read_Boolean_Or_HoverOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Boolean_Or_HoverOptions) is + begin + if Handler.Is_Boolean_Value then + Value := + (Is_Boolean => True, + others => <>); + else + Value := + (Is_Boolean => False, + others => <>); + end if; + + case Value.Is_Boolean is + when True => + Value.Boolean := Handler.Boolean_Value; + Handler.Read_Next; + when False => + Read_HoverOptions (Handler, Value.HoverOptions); + end case; + end Read_Boolean_Or_HoverOptions; + + procedure Read_workspace_OfServerCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.workspace_OfServerCapabilities) is + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while Handler.Is_Key_Name loop + declare + use workspace_OfServerCapabilities_Scope; + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case workspace_OfServerCapabilities_Map.Get_Index (Key) is + when 1 => -- workspaceFolders + Value.workspaceFolders := + (Is_Set => True, + Value => <>); + Read_WorkspaceFoldersServerCapabilities + (Handler, Value.workspaceFolders.Value); + when 2 => -- fileOperations + Value.fileOperations := + (Is_Set => True, + Value => <>); + Read_FileOperationOptions + (Handler, Value.fileOperations.Value); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_workspace_OfServerCapabilities; + + procedure Read_declarationProvider_OfServerCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .declarationProvider_OfServerCapabilities) is + use declarationProvider_OfServerCapabilities_Scope; + begin + declare + Parent : + constant not null access VSS.JSON.Pull_Readers.JSON_Pull_Reader' + Class := + Handler'Access; + Handler : + VSS.JSON.Pull_Readers.Buffered.JSON_Buffered_Pull_Reader + (Parent); + begin + Handler.Mark; + if Handler.Is_Boolean_Value then + Value := + (Kind => LSP.Structures.Varian_1, + others => <>); + elsif Handler.Is_Start_Object then + Handler.Read_Next; + Value := + (Kind => LSP.Structures.Varian_2, + others => <>); + while Handler.Is_Key_Name loop + declare + Key : constant VSS.Strings.Virtual_String := + Handler.Key_Name; + Index : constant Natural := + declarationProvider_OfServerCapabilities_Map.Get_Index + (Key); + begin + Handler.Read_Next; + case Index is + when 1 => -- documentSelector + Value := + (Kind => LSP.Structures.Varian_3, + others => <>); + exit; + when 2 => -- id + Value := + (Kind => LSP.Structures.Varian_3, + others => <>); + exit; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + else + raise Program_Error; -- Unexpected JSON value + end if; + + Handler.Reset; + Handler.Unmark; + + case Value.Kind is + when LSP.Structures.Varian_1 => + Value.Varian_1 := Handler.Boolean_Value; + Handler.Read_Next; + when LSP.Structures.Varian_2 => + Read_DeclarationOptions (Handler, Value.Varian_2); + when LSP.Structures.Varian_3 => + Read_DeclarationRegistrationOptions + (Handler, Value.Varian_3); + end case; + end; + end Read_declarationProvider_OfServerCapabilities; + + procedure Read_callHierarchyProvider_OfServerCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .callHierarchyProvider_OfServerCapabilities) is + use callHierarchyProvider_OfServerCapabilities_Scope; + begin + declare + Parent : + constant not null access VSS.JSON.Pull_Readers.JSON_Pull_Reader' + Class := + Handler'Access; + Handler : + VSS.JSON.Pull_Readers.Buffered.JSON_Buffered_Pull_Reader + (Parent); + begin + Handler.Mark; + if Handler.Is_Boolean_Value then + Value := + (Kind => LSP.Structures.Varian_1, + others => <>); + elsif Handler.Is_Start_Object then + Handler.Read_Next; + Value := + (Kind => LSP.Structures.Varian_2, + others => <>); + while Handler.Is_Key_Name loop + declare + Key : constant VSS.Strings.Virtual_String := + Handler.Key_Name; + Index : constant Natural := + callHierarchyProvider_OfServerCapabilities_Map.Get_Index + (Key); + begin + Handler.Read_Next; + case Index is + when 1 => -- documentSelector + Value := + (Kind => LSP.Structures.Varian_3, + others => <>); + exit; + when 2 => -- id + Value := + (Kind => LSP.Structures.Varian_3, + others => <>); + exit; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + else + raise Program_Error; -- Unexpected JSON value + end if; + + Handler.Reset; + Handler.Unmark; + + case Value.Kind is + when LSP.Structures.Varian_1 => + Value.Varian_1 := Handler.Boolean_Value; + Handler.Read_Next; + when LSP.Structures.Varian_2 => + Read_CallHierarchyOptions (Handler, Value.Varian_2); + when LSP.Structures.Varian_3 => + Read_CallHierarchyRegistrationOptions + (Handler, Value.Varian_3); + end case; + end; + end Read_callHierarchyProvider_OfServerCapabilities; + + procedure Read_Boolean_Or_DocumentHighlightOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Boolean_Or_DocumentHighlightOptions) is + begin + if Handler.Is_Boolean_Value then + Value := + (Is_Boolean => True, + others => <>); + else + Value := + (Is_Boolean => False, + others => <>); + end if; + + case Value.Is_Boolean is + when True => + Value.Boolean := Handler.Boolean_Value; + Handler.Read_Next; + when False => + Read_DocumentHighlightOptions + (Handler, Value.DocumentHighlightOptions); + end case; + end Read_Boolean_Or_DocumentHighlightOptions; + + procedure Read_TextDocumentSyncOptions_Or_TextDocumentSyncKind + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .TextDocumentSyncOptions_Or_TextDocumentSyncKind) is + begin + if Handler.Is_Number_Value then + Value := + (Is_TextDocumentSyncOptions => False, + others => <>); + else + Value := + (Is_TextDocumentSyncOptions => True, + others => <>); + end if; + + case Value.Is_TextDocumentSyncOptions is + when True => + Read_TextDocumentSyncOptions + (Handler, Value.TextDocumentSyncOptions); + when False => + Read_TextDocumentSyncKind (Handler, Value.TextDocumentSyncKind); + end case; + end Read_TextDocumentSyncOptions_Or_TextDocumentSyncKind; + + procedure Read_linkedEditingRangeProvider_OfServerCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .linkedEditingRangeProvider_OfServerCapabilities) is + use linkedEditingRangeProvider_OfServerCapabilities_Scope; + begin + declare + Parent : + constant not null access VSS.JSON.Pull_Readers.JSON_Pull_Reader' + Class := + Handler'Access; + Handler : + VSS.JSON.Pull_Readers.Buffered.JSON_Buffered_Pull_Reader + (Parent); + begin + Handler.Mark; + if Handler.Is_Boolean_Value then + Value := + (Kind => LSP.Structures.Varian_1, + others => <>); + elsif Handler.Is_Start_Object then + Handler.Read_Next; + Value := + (Kind => LSP.Structures.Varian_2, + others => <>); + while Handler.Is_Key_Name loop + declare + Key : constant VSS.Strings.Virtual_String := + Handler.Key_Name; + Index : constant Natural := + linkedEditingRangeProvider_OfServerCapabilities_Map + .Get_Index + (Key); + begin + Handler.Read_Next; + case Index is + when 1 => -- documentSelector + Value := + (Kind => LSP.Structures.Varian_3, + others => <>); + exit; + when 2 => -- id + Value := + (Kind => LSP.Structures.Varian_3, + others => <>); + exit; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + else + raise Program_Error; -- Unexpected JSON value + end if; + + Handler.Reset; + Handler.Unmark; + + case Value.Kind is + when LSP.Structures.Varian_1 => + Value.Varian_1 := Handler.Boolean_Value; + Handler.Read_Next; + when LSP.Structures.Varian_2 => + Read_LinkedEditingRangeOptions (Handler, Value.Varian_2); + when LSP.Structures.Varian_3 => + Read_LinkedEditingRangeRegistrationOptions + (Handler, Value.Varian_3); + end case; + end; + end Read_linkedEditingRangeProvider_OfServerCapabilities; + + procedure Read_Boolean_Or_DocumentFormattingOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Boolean_Or_DocumentFormattingOptions) is + begin + if Handler.Is_Boolean_Value then + Value := + (Is_Boolean => True, + others => <>); + else + Value := + (Is_Boolean => False, + others => <>); + end if; + + case Value.Is_Boolean is + when True => + Value.Boolean := Handler.Boolean_Value; + Handler.Read_Next; + when False => + Read_DocumentFormattingOptions + (Handler, Value.DocumentFormattingOptions); + end case; + end Read_Boolean_Or_DocumentFormattingOptions; + + procedure Read_Boolean_Or_ReferenceOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Boolean_Or_ReferenceOptions) is + begin + if Handler.Is_Boolean_Value then + Value := + (Is_Boolean => True, + others => <>); + else + Value := + (Is_Boolean => False, + others => <>); + end if; + + case Value.Is_Boolean is + when True => + Value.Boolean := Handler.Boolean_Value; + Handler.Read_Next; + when False => + Read_ReferenceOptions (Handler, Value.ReferenceOptions); + end case; + end Read_Boolean_Or_ReferenceOptions; + + procedure Read_foldingRangeProvider_OfServerCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .foldingRangeProvider_OfServerCapabilities) is + use foldingRangeProvider_OfServerCapabilities_Scope; + begin + declare + Parent : + constant not null access VSS.JSON.Pull_Readers.JSON_Pull_Reader' + Class := + Handler'Access; + Handler : + VSS.JSON.Pull_Readers.Buffered.JSON_Buffered_Pull_Reader + (Parent); + begin + Handler.Mark; + if Handler.Is_Boolean_Value then + Value := + (Kind => LSP.Structures.Varian_1, + others => <>); + elsif Handler.Is_Start_Object then + Handler.Read_Next; + Value := + (Kind => LSP.Structures.Varian_2, + others => <>); + while Handler.Is_Key_Name loop + declare + Key : constant VSS.Strings.Virtual_String := + Handler.Key_Name; + Index : constant Natural := + foldingRangeProvider_OfServerCapabilities_Map.Get_Index + (Key); + begin + Handler.Read_Next; + case Index is + when 1 => -- documentSelector + Value := + (Kind => LSP.Structures.Varian_3, + others => <>); + exit; + when 2 => -- id + Value := + (Kind => LSP.Structures.Varian_3, + others => <>); + exit; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + else + raise Program_Error; -- Unexpected JSON value + end if; + + Handler.Reset; + Handler.Unmark; + + case Value.Kind is + when LSP.Structures.Varian_1 => + Value.Varian_1 := Handler.Boolean_Value; + Handler.Read_Next; + when LSP.Structures.Varian_2 => + Read_FoldingRangeOptions (Handler, Value.Varian_2); + when LSP.Structures.Varian_3 => + Read_FoldingRangeRegistrationOptions + (Handler, Value.Varian_3); + end case; + end; + end Read_foldingRangeProvider_OfServerCapabilities; + + procedure Read_typeDefinitionProvider_OfServerCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .typeDefinitionProvider_OfServerCapabilities) is + use typeDefinitionProvider_OfServerCapabilities_Scope; + begin + declare + Parent : + constant not null access VSS.JSON.Pull_Readers.JSON_Pull_Reader' + Class := + Handler'Access; + Handler : + VSS.JSON.Pull_Readers.Buffered.JSON_Buffered_Pull_Reader + (Parent); + begin + Handler.Mark; + if Handler.Is_Boolean_Value then + Value := + (Kind => LSP.Structures.Varian_1, + others => <>); + elsif Handler.Is_Start_Object then + Handler.Read_Next; + Value := + (Kind => LSP.Structures.Varian_2, + others => <>); + while Handler.Is_Key_Name loop + declare + Key : constant VSS.Strings.Virtual_String := + Handler.Key_Name; + Index : constant Natural := + typeDefinitionProvider_OfServerCapabilities_Map + .Get_Index + (Key); + begin + Handler.Read_Next; + case Index is + when 1 => -- documentSelector + Value := + (Kind => LSP.Structures.Varian_3, + others => <>); + exit; + when 2 => -- id + Value := + (Kind => LSP.Structures.Varian_3, + others => <>); + exit; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + else + raise Program_Error; -- Unexpected JSON value + end if; + + Handler.Reset; + Handler.Unmark; + + case Value.Kind is + when LSP.Structures.Varian_1 => + Value.Varian_1 := Handler.Boolean_Value; + Handler.Read_Next; + when LSP.Structures.Varian_2 => + Read_TypeDefinitionOptions (Handler, Value.Varian_2); + when LSP.Structures.Varian_3 => + Read_TypeDefinitionRegistrationOptions + (Handler, Value.Varian_3); + end case; + end; + end Read_typeDefinitionProvider_OfServerCapabilities; + + procedure Read_inlineValueProvider_OfServerCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .inlineValueProvider_OfServerCapabilities) is + use inlineValueProvider_OfServerCapabilities_Scope; + begin + declare + Parent : + constant not null access VSS.JSON.Pull_Readers.JSON_Pull_Reader' + Class := + Handler'Access; + Handler : + VSS.JSON.Pull_Readers.Buffered.JSON_Buffered_Pull_Reader + (Parent); + begin + Handler.Mark; + if Handler.Is_Boolean_Value then + Value := + (Kind => LSP.Structures.Varian_1, + others => <>); + elsif Handler.Is_Start_Object then + Handler.Read_Next; + Value := + (Kind => LSP.Structures.Varian_2, + others => <>); + while Handler.Is_Key_Name loop + declare + Key : constant VSS.Strings.Virtual_String := + Handler.Key_Name; + Index : constant Natural := + inlineValueProvider_OfServerCapabilities_Map.Get_Index + (Key); + begin + Handler.Read_Next; + case Index is + when 1 => -- documentSelector + Value := + (Kind => LSP.Structures.Varian_3, + others => <>); + exit; + when 2 => -- id + Value := + (Kind => LSP.Structures.Varian_3, + others => <>); + exit; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + else + raise Program_Error; -- Unexpected JSON value + end if; + + Handler.Reset; + Handler.Unmark; + + case Value.Kind is + when LSP.Structures.Varian_1 => + Value.Varian_1 := Handler.Boolean_Value; + Handler.Read_Next; + when LSP.Structures.Varian_2 => + Read_InlineValueOptions (Handler, Value.Varian_2); + when LSP.Structures.Varian_3 => + Read_InlineValueRegistrationOptions + (Handler, Value.Varian_3); + end case; + end; + end Read_inlineValueProvider_OfServerCapabilities; + + procedure Read_colorProvider_OfServerCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.colorProvider_OfServerCapabilities) is + use colorProvider_OfServerCapabilities_Scope; + begin + declare + Parent : + constant not null access VSS.JSON.Pull_Readers.JSON_Pull_Reader' + Class := + Handler'Access; + Handler : + VSS.JSON.Pull_Readers.Buffered.JSON_Buffered_Pull_Reader + (Parent); + begin + Handler.Mark; + if Handler.Is_Boolean_Value then + Value := + (Kind => LSP.Structures.Varian_1, + others => <>); + elsif Handler.Is_Start_Object then + Handler.Read_Next; + Value := + (Kind => LSP.Structures.Varian_2, + others => <>); + while Handler.Is_Key_Name loop + declare + Key : constant VSS.Strings.Virtual_String := + Handler.Key_Name; + Index : constant Natural := + colorProvider_OfServerCapabilities_Map.Get_Index (Key); + begin + Handler.Read_Next; + case Index is + when 1 => -- documentSelector + Value := + (Kind => LSP.Structures.Varian_3, + others => <>); + exit; + when 2 => -- id + Value := + (Kind => LSP.Structures.Varian_3, + others => <>); + exit; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + else + raise Program_Error; -- Unexpected JSON value + end if; + + Handler.Reset; + Handler.Unmark; + + case Value.Kind is + when LSP.Structures.Varian_1 => + Value.Varian_1 := Handler.Boolean_Value; + Handler.Read_Next; + when LSP.Structures.Varian_2 => + Read_DocumentColorOptions (Handler, Value.Varian_2); + when LSP.Structures.Varian_3 => + Read_DocumentColorRegistrationOptions + (Handler, Value.Varian_3); + end case; + end; + end Read_colorProvider_OfServerCapabilities; + + procedure Read_Boolean_Or_DefinitionOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Boolean_Or_DefinitionOptions) is + begin + if Handler.Is_Boolean_Value then + Value := + (Is_Boolean => True, + others => <>); + else + Value := + (Is_Boolean => False, + others => <>); + end if; + + case Value.Is_Boolean is + when True => + Value.Boolean := Handler.Boolean_Value; + Handler.Read_Next; + when False => + Read_DefinitionOptions (Handler, Value.DefinitionOptions); + end case; + end Read_Boolean_Or_DefinitionOptions; + + procedure Read_Boolean_Or_RenameOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Boolean_Or_RenameOptions) is + begin + if Handler.Is_Boolean_Value then + Value := + (Is_Boolean => True, + others => <>); + else + Value := + (Is_Boolean => False, + others => <>); + end if; + + case Value.Is_Boolean is + when True => + Value.Boolean := Handler.Boolean_Value; + Handler.Read_Next; + when False => + Read_RenameOptions (Handler, Value.RenameOptions); + end case; + end Read_Boolean_Or_RenameOptions; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case ServerCapabilities_Map.Get_Index (Key) is + when 1 => -- positionEncoding + Value.positionEncoding := + (Is_Set => True, + Value => <>); + Read_PositionEncodingKind + (Handler, Value.positionEncoding.Value); + when 2 => -- textDocumentSync + Value.textDocumentSync := + (Is_Set => True, + Value => <>); + Read_TextDocumentSyncOptions_Or_TextDocumentSyncKind + (Handler, Value.textDocumentSync.Value); + when 3 => -- notebookDocumentSync + Value.notebookDocumentSync := + (Is_Set => True, + Value => <>); + Read_NotebookDocumentSyncOptions_Or_NotebookDocumentSyncRegistrationOptions + (Handler, Value.notebookDocumentSync.Value); + when 4 => -- completionProvider + Value.completionProvider := + (Is_Set => True, + Value => <>); + Read_CompletionOptions + (Handler, Value.completionProvider.Value); + when 5 => -- hoverProvider + Value.hoverProvider := + (Is_Set => True, + Value => <>); + Read_Boolean_Or_HoverOptions + (Handler, Value.hoverProvider.Value); + when 6 => -- signatureHelpProvider + Value.signatureHelpProvider := + (Is_Set => True, + Value => <>); + Read_SignatureHelpOptions + (Handler, Value.signatureHelpProvider.Value); + when 7 => -- declarationProvider + Value.declarationProvider := + (Is_Set => True, + Value => <>); + Read_declarationProvider_OfServerCapabilities + (Handler, Value.declarationProvider.Value); + when 8 => -- definitionProvider + Value.definitionProvider := + (Is_Set => True, + Value => <>); + Read_Boolean_Or_DefinitionOptions + (Handler, Value.definitionProvider.Value); + when 9 => -- typeDefinitionProvider + Value.typeDefinitionProvider := + (Is_Set => True, + Value => <>); + Read_typeDefinitionProvider_OfServerCapabilities + (Handler, Value.typeDefinitionProvider.Value); + when 10 => -- implementationProvider + Value.implementationProvider := + (Is_Set => True, + Value => <>); + Read_implementationProvider_OfServerCapabilities + (Handler, Value.implementationProvider.Value); + when 11 => -- referencesProvider + Value.referencesProvider := + (Is_Set => True, + Value => <>); + Read_Boolean_Or_ReferenceOptions + (Handler, Value.referencesProvider.Value); + when 12 => -- documentHighlightProvider + Value.documentHighlightProvider := + (Is_Set => True, + Value => <>); + Read_Boolean_Or_DocumentHighlightOptions + (Handler, Value.documentHighlightProvider.Value); + when 13 => -- documentSymbolProvider + Value.documentSymbolProvider := + (Is_Set => True, + Value => <>); + Read_Boolean_Or_DocumentSymbolOptions + (Handler, Value.documentSymbolProvider.Value); + when 14 => -- codeActionProvider + Value.codeActionProvider := + (Is_Set => True, + Value => <>); + Read_Boolean_Or_CodeActionOptions + (Handler, Value.codeActionProvider.Value); + when 15 => -- codeLensProvider + Value.codeLensProvider := + (Is_Set => True, + Value => <>); + Read_CodeLensOptions (Handler, Value.codeLensProvider.Value); + when 16 => -- documentLinkProvider + Value.documentLinkProvider := + (Is_Set => True, + Value => <>); + Read_DocumentLinkOptions + (Handler, Value.documentLinkProvider.Value); + when 17 => -- colorProvider + Value.colorProvider := + (Is_Set => True, + Value => <>); + Read_colorProvider_OfServerCapabilities + (Handler, Value.colorProvider.Value); + when 18 => -- workspaceSymbolProvider + Value.workspaceSymbolProvider := + (Is_Set => True, + Value => <>); + Read_Boolean_Or_WorkspaceSymbolOptions + (Handler, Value.workspaceSymbolProvider.Value); + when 19 => -- documentFormattingProvider + Value.documentFormattingProvider := + (Is_Set => True, + Value => <>); + Read_Boolean_Or_DocumentFormattingOptions + (Handler, Value.documentFormattingProvider.Value); + when 20 => -- documentRangeFormattingProvider + Value.documentRangeFormattingProvider := + (Is_Set => True, + Value => <>); + Read_Boolean_Or_DocumentRangeFormattingOptions + (Handler, Value.documentRangeFormattingProvider.Value); + when 21 => -- documentOnTypeFormattingProvider + Value.documentOnTypeFormattingProvider := + (Is_Set => True, + Value => <>); + Read_DocumentOnTypeFormattingOptions + (Handler, Value.documentOnTypeFormattingProvider.Value); + when 22 => -- renameProvider + Value.renameProvider := + (Is_Set => True, + Value => <>); + Read_Boolean_Or_RenameOptions + (Handler, Value.renameProvider.Value); + when 23 => -- foldingRangeProvider + Value.foldingRangeProvider := + (Is_Set => True, + Value => <>); + Read_foldingRangeProvider_OfServerCapabilities + (Handler, Value.foldingRangeProvider.Value); + when 24 => -- selectionRangeProvider + Value.selectionRangeProvider := + (Is_Set => True, + Value => <>); + Read_selectionRangeProvider_OfServerCapabilities + (Handler, Value.selectionRangeProvider.Value); + when 25 => -- executeCommandProvider + Value.executeCommandProvider := + (Is_Set => True, + Value => <>); + Read_ExecuteCommandOptions + (Handler, Value.executeCommandProvider.Value); + when 26 => -- callHierarchyProvider + Value.callHierarchyProvider := + (Is_Set => True, + Value => <>); + Read_callHierarchyProvider_OfServerCapabilities + (Handler, Value.callHierarchyProvider.Value); + when 27 => -- linkedEditingRangeProvider + Value.linkedEditingRangeProvider := + (Is_Set => True, + Value => <>); + Read_linkedEditingRangeProvider_OfServerCapabilities + (Handler, Value.linkedEditingRangeProvider.Value); + when 28 => -- semanticTokensProvider + Value.semanticTokensProvider := + (Is_Set => True, + Value => <>); + Read_SemanticTokensOptions_Or_SemanticTokensRegistrationOptions + (Handler, Value.semanticTokensProvider.Value); + when 29 => -- monikerProvider + Value.monikerProvider := + (Is_Set => True, + Value => <>); + Read_monikerProvider_OfServerCapabilities + (Handler, Value.monikerProvider.Value); + when 30 => -- typeHierarchyProvider + Value.typeHierarchyProvider := + (Is_Set => True, + Value => <>); + Read_typeHierarchyProvider_OfServerCapabilities + (Handler, Value.typeHierarchyProvider.Value); + when 31 => -- inlineValueProvider + Value.inlineValueProvider := + (Is_Set => True, + Value => <>); + Read_inlineValueProvider_OfServerCapabilities + (Handler, Value.inlineValueProvider.Value); + when 32 => -- inlayHintProvider + Value.inlayHintProvider := + (Is_Set => True, + Value => <>); + Read_inlayHintProvider_OfServerCapabilities + (Handler, Value.inlayHintProvider.Value); + when 33 => -- diagnosticProvider + Value.diagnosticProvider := + (Is_Set => True, + Value => <>); + Read_DiagnosticOptions_Or_DiagnosticRegistrationOptions + (Handler, Value.diagnosticProvider.Value); + when 34 => -- workspace + Value.workspace := + (Is_Set => True, + Value => <>); + Read_workspace_OfServerCapabilities + (Handler, Value.workspace.Value); + when 35 => -- experimental + Value.experimental := + (Is_Set => True, + Value => <>); + Read_T (Handler, Value.experimental.Value); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_ServerCapabilities; + + package DidChangeWatchedFilesRegistrationOptions_Scope is + package DidChangeWatchedFilesRegistrationOptions_Map is new Minimal_Perfect_Hash + (["watchers"]); + + end DidChangeWatchedFilesRegistrationOptions_Scope; + + procedure Read_DidChangeWatchedFilesRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DidChangeWatchedFilesRegistrationOptions) is + use DidChangeWatchedFilesRegistrationOptions_Scope; + procedure Read_FileSystemWatcher_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.FileSystemWatcher_Vector); + + procedure Read_FileSystemWatcher_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.FileSystemWatcher_Vector) is + begin + pragma Assert (Handler.Is_Start_Array); + Handler.Read_Next; + + declare + Set : LSP.Structures.FileSystemWatcher_Vector renames Value; + Value : LSP.Structures.FileSystemWatcher; + begin + Set.Clear; + while not Handler.Is_End_Array loop + Read_FileSystemWatcher (Handler, Value); + Set.Append (Value); + end loop; + end; + + Handler.Read_Next; + end Read_FileSystemWatcher_Vector; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case DidChangeWatchedFilesRegistrationOptions_Map.Get_Index + (Key) is + when 1 => -- watchers + Read_FileSystemWatcher_Vector (Handler, Value.watchers); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_DidChangeWatchedFilesRegistrationOptions; + + package CallHierarchyOptions_Scope is + package CallHierarchyOptions_Map is new Minimal_Perfect_Hash + (["workDoneProgress"]); + + end CallHierarchyOptions_Scope; + + procedure Read_CallHierarchyOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CallHierarchyOptions) is + use CallHierarchyOptions_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case CallHierarchyOptions_Map.Get_Index (Key) is + when 1 => -- workDoneProgress + Value.workDoneProgress := + (Is_Set => True, + Value => <>); + Value.workDoneProgress.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_CallHierarchyOptions; + + procedure Read_LSPAny + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.LSPAny) is + begin + LSP.Input_Tools.Read_LSPAny_Class (Handler, Value); + end Read_LSPAny; + + package ImplementationRegistrationOptions_Scope is + package ImplementationRegistrationOptions_Map is new Minimal_Perfect_Hash + (["documentSelector", + "workDoneProgress", + "id"]); + + end ImplementationRegistrationOptions_Scope; + + procedure Read_ImplementationRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ImplementationRegistrationOptions) is + use ImplementationRegistrationOptions_Scope; + procedure Read_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSelector_Or_Null); + + procedure Read_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSelector_Or_Null) is + begin + if Handler.Is_Null_Value then + Handler.Read_Next; + else + Value := + (Is_Null => False, + Value => <>); + Read_DocumentSelector (Handler, Value.Value); + end if; + end Read_DocumentSelector_Or_Null; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case ImplementationRegistrationOptions_Map.Get_Index (Key) is + when 1 => -- documentSelector + Read_DocumentSelector_Or_Null + (Handler, Value.Parent.documentSelector); + when 2 => -- workDoneProgress + Value.workDoneProgress := + (Is_Set => True, + Value => <>); + Value.workDoneProgress.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 3 => -- id + Value.id.Clear; + Value.id.Append (Handler.String_Value); + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_ImplementationRegistrationOptions; + + package LogTraceParams_Scope is + package LogTraceParams_Map is new Minimal_Perfect_Hash + (["message", + "verbose"]); + + end LogTraceParams_Scope; + + procedure Read_LogTraceParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.LogTraceParams) is + use LogTraceParams_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case LogTraceParams_Map.Get_Index (Key) is + when 1 => -- message + Value.message.Clear; + Value.message.Append (Handler.String_Value); + Handler.Read_Next; + when 2 => -- verbose + Value.verbose.Clear; + Value.verbose.Append (Handler.String_Value); + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_LogTraceParams; + + package FoldingRangeRegistrationOptions_Scope is + package FoldingRangeRegistrationOptions_Map is new Minimal_Perfect_Hash + (["documentSelector", + "workDoneProgress", + "id"]); + + end FoldingRangeRegistrationOptions_Scope; + + procedure Read_FoldingRangeRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.FoldingRangeRegistrationOptions) is + use FoldingRangeRegistrationOptions_Scope; + procedure Read_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSelector_Or_Null); + + procedure Read_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSelector_Or_Null) is + begin + if Handler.Is_Null_Value then + Handler.Read_Next; + else + Value := + (Is_Null => False, + Value => <>); + Read_DocumentSelector (Handler, Value.Value); + end if; + end Read_DocumentSelector_Or_Null; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case FoldingRangeRegistrationOptions_Map.Get_Index (Key) is + when 1 => -- documentSelector + Read_DocumentSelector_Or_Null + (Handler, Value.Parent.documentSelector); + when 2 => -- workDoneProgress + Value.workDoneProgress := + (Is_Set => True, + Value => <>); + Value.workDoneProgress.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 3 => -- id + Value.id.Clear; + Value.id.Append (Handler.String_Value); + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_FoldingRangeRegistrationOptions; + + package InlineValueContext_Scope is + package InlineValueContext_Map is new Minimal_Perfect_Hash + (["frameId", + "stoppedLocation"]); + + end InlineValueContext_Scope; + + procedure Read_InlineValueContext + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.InlineValueContext) is + use InlineValueContext_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case InlineValueContext_Map.Get_Index (Key) is + when 1 => -- frameId + Value.frameId := + Integer (Handler.Number_Value.Integer_Value); + Handler.Read_Next; + when 2 => -- stoppedLocation + Read_A_Range (Handler, Value.stoppedLocation); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_InlineValueContext; + + procedure Read_TextDocumentIdentifier_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.TextDocumentIdentifier_Vector) is + begin + pragma Assert (Handler.Is_Start_Array); + Handler.Read_Next; + + declare + Set : LSP.Structures.TextDocumentIdentifier_Vector renames Value; + Value : LSP.Structures.TextDocumentIdentifier; + begin + Set.Clear; + while not Handler.Is_End_Array loop + Read_TextDocumentIdentifier (Handler, Value); + Set.Append (Value); + end loop; + end; + + Handler.Read_Next; + end Read_TextDocumentIdentifier_Vector; + + procedure Read_DefinitionLink + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DefinitionLink) renames + Read_LocationLink; + + package DocumentFormattingOptions_Scope is + package DocumentFormattingOptions_Map is new Minimal_Perfect_Hash + (["workDoneProgress"]); + + end DocumentFormattingOptions_Scope; + + procedure Read_DocumentFormattingOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentFormattingOptions) is + use DocumentFormattingOptions_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case DocumentFormattingOptions_Map.Get_Index (Key) is + when 1 => -- workDoneProgress + Value.workDoneProgress := + (Is_Set => True, + Value => <>); + Value.workDoneProgress.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_DocumentFormattingOptions; + + procedure Read_SymbolInformation_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SymbolInformation_Vector) is + begin + pragma Assert (Handler.Is_Start_Array); + Handler.Read_Next; + + declare + Set : LSP.Structures.SymbolInformation_Vector renames Value; + Value : LSP.Structures.SymbolInformation; + begin + Set.Clear; + while not Handler.Is_End_Array loop + Read_SymbolInformation (Handler, Value); + Set.Append (Value); + end loop; + end; + + Handler.Read_Next; + end Read_SymbolInformation_Vector; + + package RenameFile_Scope is + package RenameFile_Map is new Minimal_Perfect_Hash + (["kind", + "annotationId", + "oldUri", + "newUri", + "options"]); + + end RenameFile_Scope; + + procedure Read_RenameFile + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.RenameFile) is + use RenameFile_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case RenameFile_Map.Get_Index (Key) is + when 2 => -- annotationId + Value.annotationId := + (Is_Set => True, + Value => <>); + Read_ChangeAnnotationIdentifier + (Handler, Value.annotationId.Value); + when 1 => -- kind + Handler.Read_Next; -- Skip string literal: rename + when 3 => -- oldUri + Value.oldUri := (Handler.String_Value with null record); + Handler.Read_Next; + when 4 => -- newUri + Value.newUri := (Handler.String_Value with null record); + Handler.Read_Next; + when 5 => -- options + Value.options := + (Is_Set => True, + Value => <>); + Read_RenameFileOptions (Handler, Value.options.Value); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_RenameFile; + + procedure Read_PrepareRenameResult_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.PrepareRenameResult_Or_Null) is + begin + if Handler.Is_Null_Value then + Handler.Read_Next; + else + Value := + (Is_Null => False, + Value => <>); + Read_PrepareRenameResult (Handler, Value.Value); + end if; + end Read_PrepareRenameResult_Or_Null; + + package DidChangeConfigurationRegistrationOptions_Scope is + package DidChangeConfigurationRegistrationOptions_Map is new Minimal_Perfect_Hash + (["section"]); + + end DidChangeConfigurationRegistrationOptions_Scope; + + procedure Read_DidChangeConfigurationRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DidChangeConfigurationRegistrationOptions) is + use DidChangeConfigurationRegistrationOptions_Scope; + procedure Read_Virtual_String_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Virtual_String_Vector); + + procedure Read_Virtual_String_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Virtual_String_Vector) is + begin + declare + Set : LSP.Structures.Virtual_String_Vector renames Value; + Value : LSP.Structures.Virtual_String; + begin + Set.Clear; + if Handler.Is_Start_Array then + Handler.Read_Next; + while not Handler.Is_End_Array loop + Value.Clear; + Value.Append (Handler.String_Value); + Handler.Read_Next; + Set.Append (Value); + end loop; + Handler.Read_Next; + + else + Value.Clear; + Value.Append (Handler.String_Value); + Handler.Read_Next; + Set.Append (Value); + end if; + end; + + end Read_Virtual_String_Vector; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case DidChangeConfigurationRegistrationOptions_Map.Get_Index + (Key) is + when 1 => -- section + Value.section := + (Is_Set => True, + Value => <>); + Read_Virtual_String_Vector (Handler, Value.section.Value); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_DidChangeConfigurationRegistrationOptions; + + package CallHierarchyItem_Scope is + package CallHierarchyItem_Map is new Minimal_Perfect_Hash + (["name", + "kind", + "tags", + "detail", + "uri", + "range", + "selectionRange", + "data"]); + + end CallHierarchyItem_Scope; + + procedure Read_CallHierarchyItem + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CallHierarchyItem) is + use CallHierarchyItem_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case CallHierarchyItem_Map.Get_Index (Key) is + when 1 => -- name + Value.name.Clear; + Value.name.Append (Handler.String_Value); + Handler.Read_Next; + when 2 => -- kind + Read_SymbolKind (Handler, Value.kind); + when 3 => -- tags + Read_SymbolTag_Set (Handler, Value.tags); + when 4 => -- detail + Value.detail.Clear; + Value.detail.Append (Handler.String_Value); + Handler.Read_Next; + when 5 => -- uri + Value.uri := (Handler.String_Value with null record); + Handler.Read_Next; + when 6 => -- range + Read_A_Range (Handler, Value.a_range); + when 7 => -- selectionRange + Read_A_Range (Handler, Value.selectionRange); + when 8 => -- data + Read_LSPAny (Handler, Value.data); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_CallHierarchyItem; + + procedure Read_SymbolTag_Set + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SymbolTag_Set) is + begin + pragma Assert (Handler.Is_Start_Array); + Handler.Read_Next; + + declare + Set : LSP.Structures.SymbolTag_Set renames Value; + Value : LSP.Enumerations.SymbolTag; + begin + Set := (others => False); + while not Handler.Is_End_Array loop + Read_SymbolTag (Handler, Value); + Set (Value) := True; + end loop; + end; + + Handler.Read_Next; + end Read_SymbolTag_Set; + + procedure Read_CompletionItem_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CompletionItem_Vector) is + begin + pragma Assert (Handler.Is_Start_Array); + Handler.Read_Next; + + declare + Set : LSP.Structures.CompletionItem_Vector renames Value; + Value : LSP.Structures.CompletionItem; + begin + Set.Clear; + while not Handler.Is_End_Array loop + Read_CompletionItem (Handler, Value); + Set.Append (Value); + end loop; + end; + + Handler.Read_Next; + end Read_CompletionItem_Vector; + + package RelativePattern_Scope is + package RelativePattern_Map is new Minimal_Perfect_Hash + (["baseUri", + "pattern"]); + + end RelativePattern_Scope; + + procedure Read_RelativePattern + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.RelativePattern) is + use RelativePattern_Scope; + procedure Read_WorkspaceFolder_Or_URI + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.WorkspaceFolder_Or_URI); + + procedure Read_WorkspaceFolder_Or_URI + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.WorkspaceFolder_Or_URI) is + begin + if Handler.Is_String_Value then + Value := + (Is_WorkspaceFolder => False, + others => <>); + else + Value := + (Is_WorkspaceFolder => True, + others => <>); + end if; + + case Value.Is_WorkspaceFolder is + when True => + Read_WorkspaceFolder (Handler, Value.WorkspaceFolder); + when False => + Read_URI (Handler, Value.URI); + end case; + end Read_WorkspaceFolder_Or_URI; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case RelativePattern_Map.Get_Index (Key) is + when 1 => -- baseUri + Read_WorkspaceFolder_Or_URI (Handler, Value.baseUri); + when 2 => -- pattern + Read_Pattern (Handler, Value.pattern); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_RelativePattern; + + procedure Read_Moniker_Vector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Moniker_Vector_Or_Null) is + begin + if Handler.Is_Null_Value then + Handler.Read_Next; + else + Value.Clear; + Read_Moniker_Vector (Handler, Value); + end if; + end Read_Moniker_Vector_Or_Null; + + package WorkDoneProgressReport_Scope is + package WorkDoneProgressReport_Map is new Minimal_Perfect_Hash + (["kind", + "cancellable", + "message", + "percentage"]); + + end WorkDoneProgressReport_Scope; + + procedure Read_WorkDoneProgressReport + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.WorkDoneProgressReport) is + use WorkDoneProgressReport_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case WorkDoneProgressReport_Map.Get_Index (Key) is + when 1 => -- kind + Handler.Read_Next; -- Skip string literal: report + when 2 => -- cancellable + Value.cancellable := + (Is_Set => True, + Value => <>); + Value.cancellable.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 3 => -- message + Value.message.Clear; + Value.message.Append (Handler.String_Value); + Handler.Read_Next; + when 4 => -- percentage + Value.percentage := + (Is_Set => True, + Value => <>); + Value.percentage.Value := + Integer (Handler.Number_Value.Integer_Value); + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_WorkDoneProgressReport; + + package tagSupport_OfWorkspaceSymbolClientCapabilities_Scope is + package tagSupport_OfWorkspaceSymbolClientCapabilities_Map is new Minimal_Perfect_Hash + (["valueSet"]); + + end tagSupport_OfWorkspaceSymbolClientCapabilities_Scope; + + procedure Read_tagSupport_OfWorkspaceSymbolClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .tagSupport_OfWorkspaceSymbolClientCapabilities) is + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while Handler.Is_Key_Name loop + declare + use tagSupport_OfWorkspaceSymbolClientCapabilities_Scope; + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case tagSupport_OfWorkspaceSymbolClientCapabilities_Map.Get_Index + (Key) is + when 1 => -- valueSet + Read_SymbolTag_Set (Handler, Value.valueSet); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_tagSupport_OfWorkspaceSymbolClientCapabilities; + + package ReferenceOptions_Scope is + package ReferenceOptions_Map is new Minimal_Perfect_Hash + (["workDoneProgress"]); + + end ReferenceOptions_Scope; + + procedure Read_ReferenceOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ReferenceOptions) is + use ReferenceOptions_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case ReferenceOptions_Map.Get_Index (Key) is + when 1 => -- workDoneProgress + Value.workDoneProgress := + (Is_Set => True, + Value => <>); + Value.workDoneProgress.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_ReferenceOptions; + + package TextDocumentClientCapabilities_Scope is + package TextDocumentClientCapabilities_Map is new Minimal_Perfect_Hash + (["synchronization", + "completion", + "hover", + "signatureHelp", + "declaration", + "definition", + "typeDefinition", + "implementation", + "references", + "documentHighlight", + "documentSymbol", + "codeAction", + "codeLens", + "documentLink", + "colorProvider", + "formatting", + "rangeFormatting", + "onTypeFormatting", + "rename", + "foldingRange", + "selectionRange", + "publishDiagnostics", + "callHierarchy", + "semanticTokens", + "linkedEditingRange", + "moniker", + "typeHierarchy", + "inlineValue", + "inlayHint", + "diagnostic"]); + + end TextDocumentClientCapabilities_Scope; + + procedure Read_TextDocumentClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.TextDocumentClientCapabilities) is + use TextDocumentClientCapabilities_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case TextDocumentClientCapabilities_Map.Get_Index (Key) is + when 1 => -- synchronization + Value.synchronization := + (Is_Set => True, + Value => <>); + Read_TextDocumentSyncClientCapabilities + (Handler, Value.synchronization.Value); + when 2 => -- completion + Value.completion := + (Is_Set => True, + Value => <>); + Read_CompletionClientCapabilities + (Handler, Value.completion.Value); + when 3 => -- hover + Value.hover := + (Is_Set => True, + Value => <>); + Read_HoverClientCapabilities (Handler, Value.hover.Value); + when 4 => -- signatureHelp + Value.signatureHelp := + (Is_Set => True, + Value => <>); + Read_SignatureHelpClientCapabilities + (Handler, Value.signatureHelp.Value); + when 5 => -- declaration + Value.declaration := + (Is_Set => True, + Value => <>); + Read_DeclarationClientCapabilities + (Handler, Value.declaration.Value); + when 6 => -- definition + Value.definition := + (Is_Set => True, + Value => <>); + Read_DefinitionClientCapabilities + (Handler, Value.definition.Value); + when 7 => -- typeDefinition + Value.typeDefinition := + (Is_Set => True, + Value => <>); + Read_TypeDefinitionClientCapabilities + (Handler, Value.typeDefinition.Value); + when 8 => -- implementation + Value.implementation := + (Is_Set => True, + Value => <>); + Read_ImplementationClientCapabilities + (Handler, Value.implementation.Value); + when 9 => -- references + Value.references := + (Is_Set => True, + Value => <>); + Read_ReferenceClientCapabilities + (Handler, Value.references.Value); + when 10 => -- documentHighlight + Value.documentHighlight := + (Is_Set => True, + Value => <>); + Read_DocumentHighlightClientCapabilities + (Handler, Value.documentHighlight.Value); + when 11 => -- documentSymbol + Value.documentSymbol := + (Is_Set => True, + Value => <>); + Read_DocumentSymbolClientCapabilities + (Handler, Value.documentSymbol.Value); + when 12 => -- codeAction + Value.codeAction := + (Is_Set => True, + Value => <>); + Read_CodeActionClientCapabilities + (Handler, Value.codeAction.Value); + when 13 => -- codeLens + Value.codeLens := + (Is_Set => True, + Value => <>); + Read_CodeLensClientCapabilities + (Handler, Value.codeLens.Value); + when 14 => -- documentLink + Value.documentLink := + (Is_Set => True, + Value => <>); + Read_DocumentLinkClientCapabilities + (Handler, Value.documentLink.Value); + when 15 => -- colorProvider + Value.colorProvider := + (Is_Set => True, + Value => <>); + Read_DocumentColorClientCapabilities + (Handler, Value.colorProvider.Value); + when 16 => -- formatting + Value.formatting := + (Is_Set => True, + Value => <>); + Read_DocumentFormattingClientCapabilities + (Handler, Value.formatting.Value); + when 17 => -- rangeFormatting + Value.rangeFormatting := + (Is_Set => True, + Value => <>); + Read_DocumentRangeFormattingClientCapabilities + (Handler, Value.rangeFormatting.Value); + when 18 => -- onTypeFormatting + Value.onTypeFormatting := + (Is_Set => True, + Value => <>); + Read_DocumentOnTypeFormattingClientCapabilities + (Handler, Value.onTypeFormatting.Value); + when 19 => -- rename + Value.rename := + (Is_Set => True, + Value => <>); + Read_RenameClientCapabilities (Handler, Value.rename.Value); + when 20 => -- foldingRange + Value.foldingRange := + (Is_Set => True, + Value => <>); + Read_FoldingRangeClientCapabilities + (Handler, Value.foldingRange.Value); + when 21 => -- selectionRange + Value.selectionRange := + (Is_Set => True, + Value => <>); + Read_SelectionRangeClientCapabilities + (Handler, Value.selectionRange.Value); + when 22 => -- publishDiagnostics + Value.publishDiagnostics := + (Is_Set => True, + Value => <>); + Read_PublishDiagnosticsClientCapabilities + (Handler, Value.publishDiagnostics.Value); + when 23 => -- callHierarchy + Value.callHierarchy := + (Is_Set => True, + Value => <>); + Read_CallHierarchyClientCapabilities + (Handler, Value.callHierarchy.Value); + when 24 => -- semanticTokens + Value.semanticTokens := + (Is_Set => True, + Value => <>); + Read_SemanticTokensClientCapabilities + (Handler, Value.semanticTokens.Value); + when 25 => -- linkedEditingRange + Value.linkedEditingRange := + (Is_Set => True, + Value => <>); + Read_LinkedEditingRangeClientCapabilities + (Handler, Value.linkedEditingRange.Value); + when 26 => -- moniker + Value.moniker := + (Is_Set => True, + Value => <>); + Read_MonikerClientCapabilities + (Handler, Value.moniker.Value); + when 27 => -- typeHierarchy + Value.typeHierarchy := + (Is_Set => True, + Value => <>); + Read_TypeHierarchyClientCapabilities + (Handler, Value.typeHierarchy.Value); + when 28 => -- inlineValue + Value.inlineValue := + (Is_Set => True, + Value => <>); + Read_InlineValueClientCapabilities + (Handler, Value.inlineValue.Value); + when 29 => -- inlayHint + Value.inlayHint := + (Is_Set => True, + Value => <>); + Read_InlayHintClientCapabilities + (Handler, Value.inlayHint.Value); + when 30 => -- diagnostic + Value.diagnostic := + (Is_Set => True, + Value => <>); + Read_DiagnosticClientCapabilities + (Handler, Value.diagnostic.Value); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_TextDocumentClientCapabilities; + + package WorkspaceSymbolParams_Scope is + package WorkspaceSymbolParams_Map is new Minimal_Perfect_Hash + (["workDoneToken", + "partialResultToken", + "query"]); + + end WorkspaceSymbolParams_Scope; + + procedure Read_WorkspaceSymbolParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.WorkspaceSymbolParams) is + use WorkspaceSymbolParams_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case WorkspaceSymbolParams_Map.Get_Index (Key) is + when 1 => -- workDoneToken + Value.workDoneToken := + (Is_Set => True, + Value => <>); + Read_ProgressToken (Handler, Value.workDoneToken.Value); + when 2 => -- partialResultToken + Value.partialResultToken := + (Is_Set => True, + Value => <>); + Read_ProgressToken (Handler, Value.partialResultToken.Value); + when 3 => -- query + Value.query.Clear; + Value.query.Append (Handler.String_Value); + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_WorkspaceSymbolParams; + + procedure Read_DocumentSymbol_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSymbol_Vector) is + begin + pragma Assert (Handler.Is_Start_Array); + Handler.Read_Next; + + declare + Set : LSP.Structures.DocumentSymbol_Vector renames Value; + Value : LSP.Structures.DocumentSymbol; + begin + Set.Clear; + while not Handler.Is_End_Array loop + Read_DocumentSymbol (Handler, Value); + Set.Append (Value); + end loop; + end; + + Handler.Read_Next; + end Read_DocumentSymbol_Vector; + + procedure Read_GlobPattern + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.GlobPattern) is + begin + if Handler.Is_String_Value then + Value := + (Is_Pattern => True, + others => <>); + else + Value := + (Is_Pattern => False, + others => <>); + end if; + + case Value.Is_Pattern is + when True => + Read_Pattern (Handler, Value.Pattern); + when False => + Read_RelativePattern (Handler, Value.RelativePattern); + end case; + end Read_GlobPattern; + + package NotebookDocumentIdentifier_Scope is + package NotebookDocumentIdentifier_Map is new Minimal_Perfect_Hash + (["uri"]); + + end NotebookDocumentIdentifier_Scope; + + procedure Read_NotebookDocumentIdentifier + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.NotebookDocumentIdentifier) is + use NotebookDocumentIdentifier_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case NotebookDocumentIdentifier_Map.Get_Index (Key) is + when 1 => -- uri + Read_URI (Handler, Value.uri); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_NotebookDocumentIdentifier; + + package InsertReplaceEdit_Scope is + package InsertReplaceEdit_Map is new Minimal_Perfect_Hash + (["newText", + "insert", + "replace"]); + + end InsertReplaceEdit_Scope; + + procedure Read_InsertReplaceEdit + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.InsertReplaceEdit) is + use InsertReplaceEdit_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case InsertReplaceEdit_Map.Get_Index (Key) is + when 1 => -- newText + Value.newText.Clear; + Value.newText.Append (Handler.String_Value); + Handler.Read_Next; + when 2 => -- insert + Read_A_Range (Handler, Value.insert); + when 3 => -- replace + Read_A_Range (Handler, Value.replace); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_InsertReplaceEdit; + + package InitializeResult_Scope is + package InitializeResult_Map is new Minimal_Perfect_Hash + (["capabilities", + "serverInfo"]); + + end InitializeResult_Scope; + + procedure Read_InitializeResult + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.InitializeResult) is + use InitializeResult_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case InitializeResult_Map.Get_Index (Key) is + when 1 => -- capabilities + Read_ServerCapabilities (Handler, Value.capabilities); + when 2 => -- serverInfo + Value.serverInfo := + (Is_Set => True, + Value => <>); + Read_clientInfo_Of_InitializeParams + (Handler, Value.serverInfo.Value); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_InitializeResult; + + package InlineValueVariableLookup_Scope is + package InlineValueVariableLookup_Map is new Minimal_Perfect_Hash + (["range", + "variableName", + "caseSensitiveLookup"]); + + end InlineValueVariableLookup_Scope; + + procedure Read_InlineValueVariableLookup + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.InlineValueVariableLookup) is + use InlineValueVariableLookup_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case InlineValueVariableLookup_Map.Get_Index (Key) is + when 1 => -- range + Read_A_Range (Handler, Value.a_range); + when 2 => -- variableName + Value.variableName.Clear; + Value.variableName.Append (Handler.String_Value); + Handler.Read_Next; + when 3 => -- caseSensitiveLookup + Value.caseSensitiveLookup := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_InlineValueVariableLookup; + + package FileEvent_Scope is + package FileEvent_Map is new Minimal_Perfect_Hash + (["uri", + "type"]); + + end FileEvent_Scope; + + procedure Read_FileEvent + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.FileEvent) is + use FileEvent_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case FileEvent_Map.Get_Index (Key) is + when 1 => -- uri + Value.uri := (Handler.String_Value with null record); + Handler.Read_Next; + when 2 => -- type + Read_FileChangeType (Handler, Value.a_type); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_FileEvent; + + package SignatureHelpClientCapabilities_Scope is + package SignatureHelpClientCapabilities_Map is new Minimal_Perfect_Hash + (["dynamicRegistration", + "signatureInformation", + "contextSupport"]); + + package signatureInformation_OfSignatureHelpClientCapabilities_Scope is + package signatureInformation_OfSignatureHelpClientCapabilities_Map is new Minimal_Perfect_Hash + (["documentationFormat", + "parameterInformation", + "activeParameterSupport"]); + + end signatureInformation_OfSignatureHelpClientCapabilities_Scope; + + package parameterInformation_OfsignatureInformation_OfSignatureHelpClientCapabilities_Scope + is + package parameterInformation_OfsignatureInformation_OfSignatureHelpClientCapabilities_Map is new Minimal_Perfect_Hash + (["labelOffsetSupport"]); + + end parameterInformation_OfsignatureInformation_OfSignatureHelpClientCapabilities_Scope; + + end SignatureHelpClientCapabilities_Scope; + + procedure Read_SignatureHelpClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SignatureHelpClientCapabilities) is + use SignatureHelpClientCapabilities_Scope; + procedure Read_signatureInformation_OfSignatureHelpClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .signatureInformation_OfSignatureHelpClientCapabilities); + + procedure Read_parameterInformation_OfsignatureInformation_OfSignatureHelpClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .parameterInformation_OfsignatureInformation_OfSignatureHelpClientCapabilities); + + procedure Read_signatureInformation_OfSignatureHelpClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .signatureInformation_OfSignatureHelpClientCapabilities) is + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while Handler.Is_Key_Name loop + declare + use + signatureInformation_OfSignatureHelpClientCapabilities_Scope; + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case signatureInformation_OfSignatureHelpClientCapabilities_Map + .Get_Index + (Key) is + when 1 => -- documentationFormat + Read_MarkupKind_Vector + (Handler, Value.documentationFormat); + when 2 => -- parameterInformation + Value.parameterInformation := + (Is_Set => True, + Value => <>); + Read_parameterInformation_OfsignatureInformation_OfSignatureHelpClientCapabilities + (Handler, Value.parameterInformation.Value); + when 3 => -- activeParameterSupport + Value.activeParameterSupport := + (Is_Set => True, + Value => <>); + Value.activeParameterSupport.Value := + Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_signatureInformation_OfSignatureHelpClientCapabilities; + + procedure Read_parameterInformation_OfsignatureInformation_OfSignatureHelpClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .parameterInformation_OfsignatureInformation_OfSignatureHelpClientCapabilities) is + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while Handler.Is_Key_Name loop + declare + use + parameterInformation_OfsignatureInformation_OfSignatureHelpClientCapabilities_Scope; + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case parameterInformation_OfsignatureInformation_OfSignatureHelpClientCapabilities_Map + .Get_Index + (Key) is + when 1 => -- labelOffsetSupport + Value.labelOffsetSupport := + (Is_Set => True, + Value => <>); + Value.labelOffsetSupport.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_parameterInformation_OfsignatureInformation_OfSignatureHelpClientCapabilities; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case SignatureHelpClientCapabilities_Map.Get_Index (Key) is + when 1 => -- dynamicRegistration + Value.dynamicRegistration := + (Is_Set => True, + Value => <>); + Value.dynamicRegistration.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 2 => -- signatureInformation + Value.signatureInformation := + (Is_Set => True, + Value => <>); + Read_signatureInformation_OfSignatureHelpClientCapabilities + (Handler, Value.signatureInformation.Value); + when 3 => -- contextSupport + Value.contextSupport := + (Is_Set => True, + Value => <>); + Value.contextSupport.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_SignatureHelpClientCapabilities; + + package WorkDoneProgressCancelParams_Scope is + package WorkDoneProgressCancelParams_Map is new Minimal_Perfect_Hash + (["token"]); + + end WorkDoneProgressCancelParams_Scope; + + procedure Read_WorkDoneProgressCancelParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.WorkDoneProgressCancelParams) is + use WorkDoneProgressCancelParams_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case WorkDoneProgressCancelParams_Map.Get_Index (Key) is + when 1 => -- token + Read_ProgressToken (Handler, Value.token); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_WorkDoneProgressCancelParams; + + package NotebookDocumentSyncClientCapabilities_Scope is + package NotebookDocumentSyncClientCapabilities_Map is new Minimal_Perfect_Hash + (["dynamicRegistration", + "executionSummarySupport"]); + + end NotebookDocumentSyncClientCapabilities_Scope; + + procedure Read_NotebookDocumentSyncClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.NotebookDocumentSyncClientCapabilities) is + use NotebookDocumentSyncClientCapabilities_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case NotebookDocumentSyncClientCapabilities_Map.Get_Index (Key) is + when 1 => -- dynamicRegistration + Value.dynamicRegistration := + (Is_Set => True, + Value => <>); + Value.dynamicRegistration.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 2 => -- executionSummarySupport + Value.executionSummarySupport := + (Is_Set => True, + Value => <>); + Value.executionSummarySupport.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_NotebookDocumentSyncClientCapabilities; + + procedure Read_ProgressToken + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ProgressToken) is + begin + if Handler.Is_Number_Value then + Value := + (Is_Integer => True, + others => <>); + else + Value := + (Is_Integer => False, + others => <>); + end if; + + case Value.Is_Integer is + when True => + Value.Integer := Integer (Handler.Number_Value.Integer_Value); + Handler.Read_Next; + when False => + Value.Virtual_String.Clear; + Value.Virtual_String.Append (Handler.String_Value); + Handler.Read_Next; + end case; + end Read_ProgressToken; + + package DiagnosticOptions_Scope is + package DiagnosticOptions_Map is new Minimal_Perfect_Hash + (["workDoneProgress", + "identifier", + "interFileDependencies", + "workspaceDiagnostics"]); + + end DiagnosticOptions_Scope; + + procedure Read_DiagnosticOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DiagnosticOptions) is + use DiagnosticOptions_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case DiagnosticOptions_Map.Get_Index (Key) is + when 1 => -- workDoneProgress + Value.workDoneProgress := + (Is_Set => True, + Value => <>); + Value.workDoneProgress.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 2 => -- identifier + Value.identifier.Clear; + Value.identifier.Append (Handler.String_Value); + Handler.Read_Next; + when 3 => -- interFileDependencies + Value.interFileDependencies := Handler.Boolean_Value; + Handler.Read_Next; + when 4 => -- workspaceDiagnostics + Value.workspaceDiagnostics := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_DiagnosticOptions; + + package WindowClientCapabilities_Scope is + package WindowClientCapabilities_Map is new Minimal_Perfect_Hash + (["workDoneProgress", + "showMessage", + "showDocument"]); + + end WindowClientCapabilities_Scope; + + procedure Read_WindowClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.WindowClientCapabilities) is + use WindowClientCapabilities_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case WindowClientCapabilities_Map.Get_Index (Key) is + when 1 => -- workDoneProgress + Value.workDoneProgress := + (Is_Set => True, + Value => <>); + Value.workDoneProgress.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 2 => -- showMessage + Value.showMessage := + (Is_Set => True, + Value => <>); + Read_ShowMessageRequestClientCapabilities + (Handler, Value.showMessage.Value); + when 3 => -- showDocument + Value.showDocument := + (Is_Set => True, + Value => <>); + Read_ShowDocumentClientCapabilities + (Handler, Value.showDocument.Value); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_WindowClientCapabilities; + + package GeneralClientCapabilities_Scope is + package GeneralClientCapabilities_Map is new Minimal_Perfect_Hash + (["staleRequestSupport", + "regularExpressions", + "markdown", + "positionEncodings"]); + + package staleRequestSupport_OfGeneralClientCapabilities_Scope is + package staleRequestSupport_OfGeneralClientCapabilities_Map is new Minimal_Perfect_Hash + (["cancel", + "retryOnContentModified"]); + + end staleRequestSupport_OfGeneralClientCapabilities_Scope; + + end GeneralClientCapabilities_Scope; + + procedure Read_GeneralClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.GeneralClientCapabilities) is + use GeneralClientCapabilities_Scope; + procedure Read_PositionEncodingKind_Set + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.PositionEncodingKind_Set); + + procedure Read_staleRequestSupport_OfGeneralClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .staleRequestSupport_OfGeneralClientCapabilities); + + procedure Read_PositionEncodingKind_Set + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.PositionEncodingKind_Set) is + begin + pragma Assert (Handler.Is_Start_Array); + Handler.Read_Next; + + declare + Set : LSP.Structures.PositionEncodingKind_Set renames Value; + Value : LSP.Enumerations.PositionEncodingKind; + begin + Set := (others => False); + while not Handler.Is_End_Array loop + Read_PositionEncodingKind (Handler, Value); + Set (Value) := True; + end loop; + end; + + Handler.Read_Next; + end Read_PositionEncodingKind_Set; + + procedure Read_staleRequestSupport_OfGeneralClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .staleRequestSupport_OfGeneralClientCapabilities) is + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while Handler.Is_Key_Name loop + declare + use staleRequestSupport_OfGeneralClientCapabilities_Scope; + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case staleRequestSupport_OfGeneralClientCapabilities_Map + .Get_Index + (Key) is + when 1 => -- cancel + Value.cancel := Handler.Boolean_Value; + Handler.Read_Next; + when 2 => -- retryOnContentModified + Read_Virtual_String_Vector + (Handler, Value.retryOnContentModified); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_staleRequestSupport_OfGeneralClientCapabilities; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case GeneralClientCapabilities_Map.Get_Index (Key) is + when 1 => -- staleRequestSupport + Value.staleRequestSupport := + (Is_Set => True, + Value => <>); + Read_staleRequestSupport_OfGeneralClientCapabilities + (Handler, Value.staleRequestSupport.Value); + when 2 => -- regularExpressions + Value.regularExpressions := + (Is_Set => True, + Value => <>); + Read_RegularExpressionsClientCapabilities + (Handler, Value.regularExpressions.Value); + when 3 => -- markdown + Value.markdown := + (Is_Set => True, + Value => <>); + Read_MarkdownClientCapabilities + (Handler, Value.markdown.Value); + when 4 => -- positionEncodings + Read_PositionEncodingKind_Set + (Handler, Value.positionEncodings); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_GeneralClientCapabilities; + + package SemanticTokensWorkspaceClientCapabilities_Scope is + package SemanticTokensWorkspaceClientCapabilities_Map is new Minimal_Perfect_Hash + (["refreshSupport"]); + + end SemanticTokensWorkspaceClientCapabilities_Scope; + + procedure Read_SemanticTokensWorkspaceClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SemanticTokensWorkspaceClientCapabilities) is + use SemanticTokensWorkspaceClientCapabilities_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case SemanticTokensWorkspaceClientCapabilities_Map.Get_Index + (Key) is + when 1 => -- refreshSupport + Value.refreshSupport := + (Is_Set => True, + Value => <>); + Value.refreshSupport.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_SemanticTokensWorkspaceClientCapabilities; + + package LinkedEditingRangeClientCapabilities_Scope is + package LinkedEditingRangeClientCapabilities_Map is new Minimal_Perfect_Hash + (["dynamicRegistration"]); + + end LinkedEditingRangeClientCapabilities_Scope; + + procedure Read_LinkedEditingRangeClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.LinkedEditingRangeClientCapabilities) is + use LinkedEditingRangeClientCapabilities_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case LinkedEditingRangeClientCapabilities_Map.Get_Index (Key) is + when 1 => -- dynamicRegistration + Value.dynamicRegistration := + (Is_Set => True, + Value => <>); + Value.dynamicRegistration.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_LinkedEditingRangeClientCapabilities; + + package SignatureHelp_Scope is + package SignatureHelp_Map is new Minimal_Perfect_Hash + (["signatures", + "activeSignature", + "activeParameter"]); + + end SignatureHelp_Scope; + + procedure Read_SignatureHelp + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SignatureHelp) is + use SignatureHelp_Scope; + procedure Read_SignatureInformation_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SignatureInformation_Vector); + + procedure Read_SignatureInformation_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SignatureInformation_Vector) is + begin + pragma Assert (Handler.Is_Start_Array); + Handler.Read_Next; + + declare + Set : LSP.Structures.SignatureInformation_Vector renames Value; + Value : LSP.Structures.SignatureInformation; + begin + Set.Clear; + while not Handler.Is_End_Array loop + Read_SignatureInformation (Handler, Value); + Set.Append (Value); + end loop; + end; + + Handler.Read_Next; + end Read_SignatureInformation_Vector; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case SignatureHelp_Map.Get_Index (Key) is + when 1 => -- signatures + Read_SignatureInformation_Vector (Handler, Value.signatures); + when 2 => -- activeSignature + Value.activeSignature := + (Is_Set => True, + Value => <>); + Value.activeSignature.Value := + Integer (Handler.Number_Value.Integer_Value); + Handler.Read_Next; + when 3 => -- activeParameter + Value.activeParameter := + (Is_Set => True, + Value => <>); + Value.activeParameter.Value := + Integer (Handler.Number_Value.Integer_Value); + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_SignatureHelp; + + package DidChangeWatchedFilesParams_Scope is + package DidChangeWatchedFilesParams_Map is new Minimal_Perfect_Hash + (["changes"]); + + end DidChangeWatchedFilesParams_Scope; + + procedure Read_DidChangeWatchedFilesParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DidChangeWatchedFilesParams) is + use DidChangeWatchedFilesParams_Scope; + procedure Read_FileEvent_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.FileEvent_Vector); + + procedure Read_FileEvent_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.FileEvent_Vector) is + begin + pragma Assert (Handler.Is_Start_Array); + Handler.Read_Next; + + declare + Set : LSP.Structures.FileEvent_Vector renames Value; + Value : LSP.Structures.FileEvent; + begin + Set.Clear; + while not Handler.Is_End_Array loop + Read_FileEvent (Handler, Value); + Set.Append (Value); + end loop; + end; + + Handler.Read_Next; + end Read_FileEvent_Vector; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case DidChangeWatchedFilesParams_Map.Get_Index (Key) is + when 1 => -- changes + Read_FileEvent_Vector (Handler, Value.changes); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_DidChangeWatchedFilesParams; + + package DidOpenNotebookDocumentParams_Scope is + package DidOpenNotebookDocumentParams_Map is new Minimal_Perfect_Hash + (["notebookDocument", + "cellTextDocuments"]); + + end DidOpenNotebookDocumentParams_Scope; + + procedure Read_DidOpenNotebookDocumentParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DidOpenNotebookDocumentParams) is + use DidOpenNotebookDocumentParams_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case DidOpenNotebookDocumentParams_Map.Get_Index (Key) is + when 1 => -- notebookDocument + Read_NotebookDocument (Handler, Value.notebookDocument); + when 2 => -- cellTextDocuments + Read_TextDocumentItem_Vector + (Handler, Value.cellTextDocuments); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_DidOpenNotebookDocumentParams; + + procedure Read_SignatureHelp_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SignatureHelp_Or_Null) is + begin + if Handler.Is_Null_Value then + Handler.Read_Next; + else + Value := + (Is_Null => False, + Value => <>); + Read_SignatureHelp (Handler, Value.Value); + end if; + end Read_SignatureHelp_Or_Null; + + procedure Read_Diagnostic_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Diagnostic_Vector) is + begin + pragma Assert (Handler.Is_Start_Array); + Handler.Read_Next; + + declare + Set : LSP.Structures.Diagnostic_Vector renames Value; + Value : LSP.Structures.Diagnostic; + begin + Set.Clear; + while not Handler.Is_End_Array loop + Read_Diagnostic (Handler, Value); + Set.Append (Value); + end loop; + end; + + Handler.Read_Next; + end Read_Diagnostic_Vector; + + procedure Read_DocumentHighlightKind + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.DocumentHighlightKind) is + begin + Value := + LSP.Enumerations.DocumentHighlightKind'Val + (Handler.Number_Value.Integer_Value - 1); + Handler.Read_Next; + end Read_DocumentHighlightKind; + + procedure Read_CodeLens_Vector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CodeLens_Vector_Or_Null) is + begin + if Handler.Is_Null_Value then + Handler.Read_Next; + else + Value.Clear; + Read_CodeLens_Vector (Handler, Value); + end if; + end Read_CodeLens_Vector_Or_Null; + + package ResourceOperationKind_Map is new Minimal_Perfect_Hash + (["create", + "rename", + "delete"]); + + procedure Read_ResourceOperationKind + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.ResourceOperationKind) is + begin + Value := + LSP.Enumerations.ResourceOperationKind'Val + (ResourceOperationKind_Map.Get_Index (Handler.String_Value) - 1); + Handler.Read_Next; + end Read_ResourceOperationKind; + + procedure Read_WorkspaceFolder_Vector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.WorkspaceFolder_Vector_Or_Null) is + begin + if Handler.Is_Null_Value then + Handler.Read_Next; + else + Value.Clear; + Read_WorkspaceFolder_Vector (Handler, Value); + end if; + end Read_WorkspaceFolder_Vector_Or_Null; + + package InlineValueClientCapabilities_Scope is + package InlineValueClientCapabilities_Map is new Minimal_Perfect_Hash + (["dynamicRegistration"]); + + end InlineValueClientCapabilities_Scope; + + procedure Read_InlineValueClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.InlineValueClientCapabilities) is + use InlineValueClientCapabilities_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case InlineValueClientCapabilities_Map.Get_Index (Key) is + when 1 => -- dynamicRegistration + Value.dynamicRegistration := + (Is_Set => True, + Value => <>); + Value.dynamicRegistration.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_InlineValueClientCapabilities; + + package PrepareRenameResult_Scope is + package PrepareRenameResult_Map is new Minimal_Perfect_Hash + (["start", + "end", + "range", + "placeholder", + "defaultBehavior"]); + + package PrepareRenameResult_2_Scope is + package PrepareRenameResult_2_Map is new Minimal_Perfect_Hash + (["range", + "placeholder"]); + + end PrepareRenameResult_2_Scope; + + package PrepareRenameResult_3_Scope is + package PrepareRenameResult_3_Map is new Minimal_Perfect_Hash + (["defaultBehavior"]); + + end PrepareRenameResult_3_Scope; + + end PrepareRenameResult_Scope; + + procedure Read_PrepareRenameResult + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.PrepareRenameResult) is + use PrepareRenameResult_Scope; + procedure Read_PrepareRenameResult_2 + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.PrepareRenameResult_2); + + procedure Read_PrepareRenameResult_3 + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.PrepareRenameResult_3); + + procedure Read_PrepareRenameResult_2 + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.PrepareRenameResult_2) is + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while Handler.Is_Key_Name loop + declare + use PrepareRenameResult_2_Scope; + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case PrepareRenameResult_2_Map.Get_Index (Key) is + when 1 => -- range + Read_A_Range (Handler, Value.a_range); + when 2 => -- placeholder + Value.placeholder.Clear; + Value.placeholder.Append (Handler.String_Value); + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_PrepareRenameResult_2; + + procedure Read_PrepareRenameResult_3 + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.PrepareRenameResult_3) is + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while Handler.Is_Key_Name loop + declare + use PrepareRenameResult_3_Scope; + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case PrepareRenameResult_3_Map.Get_Index (Key) is + when 1 => -- defaultBehavior + Value.defaultBehavior := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_PrepareRenameResult_3; + + begin + declare + Parent : + constant not null access VSS.JSON.Pull_Readers.JSON_Pull_Reader' + Class := + Handler'Access; + Handler : + VSS.JSON.Pull_Readers.Buffered.JSON_Buffered_Pull_Reader (Parent); + begin + Handler.Mark; + if Handler.Is_Start_Object then + Handler.Read_Next; + while Handler.Is_Key_Name loop + declare + Key : constant VSS.Strings.Virtual_String := + Handler.Key_Name; + Index : constant Natural := + PrepareRenameResult_Map.Get_Index (Key); + begin + Handler.Read_Next; + case Index is + when 1 => -- start + Value := + (Kind => LSP.Structures.Varian_1, + others => <>); + exit; + when 2 => -- end + Value := + (Kind => LSP.Structures.Varian_1, + others => <>); + exit; + when 3 => -- range + Value := + (Kind => LSP.Structures.Varian_2, + others => <>); + exit; + when 4 => -- placeholder + Value := + (Kind => LSP.Structures.Varian_2, + others => <>); + exit; + when 5 => -- defaultBehavior + Value := + (Kind => LSP.Structures.Varian_3, + others => <>); + exit; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + else + raise Program_Error; -- Unexpected JSON value + end if; + + Handler.Reset; + Handler.Unmark; + + case Value.Kind is + when LSP.Structures.Varian_1 => + Read_A_Range (Handler, Value.Varian_1); + when LSP.Structures.Varian_2 => + Read_PrepareRenameResult_2 (Handler, Value.Varian_2); + when LSP.Structures.Varian_3 => + Read_PrepareRenameResult_3 (Handler, Value.Varian_3); + end case; + end; + end Read_PrepareRenameResult; + + package DocumentLinkParams_Scope is + package DocumentLinkParams_Map is new Minimal_Perfect_Hash + (["workDoneToken", + "partialResultToken", + "textDocument"]); + + end DocumentLinkParams_Scope; + + procedure Read_DocumentLinkParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentLinkParams) is + use DocumentLinkParams_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case DocumentLinkParams_Map.Get_Index (Key) is + when 1 => -- workDoneToken + Value.workDoneToken := + (Is_Set => True, + Value => <>); + Read_ProgressToken (Handler, Value.workDoneToken.Value); + when 2 => -- partialResultToken + Value.partialResultToken := + (Is_Set => True, + Value => <>); + Read_ProgressToken (Handler, Value.partialResultToken.Value); + when 3 => -- textDocument + Read_TextDocumentIdentifier (Handler, Value.textDocument); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_DocumentLinkParams; + + package DocumentLinkClientCapabilities_Scope is + package DocumentLinkClientCapabilities_Map is new Minimal_Perfect_Hash + (["dynamicRegistration", + "tooltipSupport"]); + + end DocumentLinkClientCapabilities_Scope; + + procedure Read_DocumentLinkClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentLinkClientCapabilities) is + use DocumentLinkClientCapabilities_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case DocumentLinkClientCapabilities_Map.Get_Index (Key) is + when 1 => -- dynamicRegistration + Value.dynamicRegistration := + (Is_Set => True, + Value => <>); + Value.dynamicRegistration.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 2 => -- tooltipSupport + Value.tooltipSupport := + (Is_Set => True, + Value => <>); + Value.tooltipSupport.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_DocumentLinkClientCapabilities; + + procedure Read_MarkupKind_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.MarkupKind_Vector) is + begin + pragma Assert (Handler.Is_Start_Array); + Handler.Read_Next; + + declare + Set : LSP.Structures.MarkupKind_Vector renames Value; + Value : LSP.Enumerations.MarkupKind; + begin + Set.Clear; + while not Handler.Is_End_Array loop + Read_MarkupKind (Handler, Value); + Set.Append (Value); + end loop; + end; + + Handler.Read_Next; + end Read_MarkupKind_Vector; + + package CodeActionContext_Scope is + package CodeActionContext_Map is new Minimal_Perfect_Hash + (["diagnostics", + "only", + "triggerKind"]); + + end CodeActionContext_Scope; + + procedure Read_CodeActionContext + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CodeActionContext) is + use CodeActionContext_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case CodeActionContext_Map.Get_Index (Key) is + when 1 => -- diagnostics + Read_Diagnostic_Vector (Handler, Value.diagnostics); + when 2 => -- only + Read_CodeActionKind_Set (Handler, Value.only); + when 3 => -- triggerKind + Value.triggerKind := + (Is_Set => True, + Value => <>); + Read_CodeActionTriggerKind + (Handler, Value.triggerKind.Value); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_CodeActionContext; + + package ConfigurationParams_Scope is + package ConfigurationParams_Map is new Minimal_Perfect_Hash (["items"]); + + end ConfigurationParams_Scope; + + procedure Read_ConfigurationParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ConfigurationParams) is + use ConfigurationParams_Scope; + procedure Read_ConfigurationItem_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ConfigurationItem_Vector); + + procedure Read_ConfigurationItem_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ConfigurationItem_Vector) is + begin + pragma Assert (Handler.Is_Start_Array); + Handler.Read_Next; + + declare + Set : LSP.Structures.ConfigurationItem_Vector renames Value; + Value : LSP.Structures.ConfigurationItem; + begin + Set.Clear; + while not Handler.Is_End_Array loop + Read_ConfigurationItem (Handler, Value); + Set.Append (Value); + end loop; + end; + + Handler.Read_Next; + end Read_ConfigurationItem_Vector; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case ConfigurationParams_Map.Get_Index (Key) is + when 1 => -- items + Read_ConfigurationItem_Vector (Handler, Value.items); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_ConfigurationParams; + + package DidChangeTextDocumentParams_Scope is + package DidChangeTextDocumentParams_Map is new Minimal_Perfect_Hash + (["textDocument", + "contentChanges"]); + + end DidChangeTextDocumentParams_Scope; + + procedure Read_DidChangeTextDocumentParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DidChangeTextDocumentParams) is + use DidChangeTextDocumentParams_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case DidChangeTextDocumentParams_Map.Get_Index (Key) is + when 1 => -- textDocument + Read_VersionedTextDocumentIdentifier + (Handler, Value.textDocument); + when 2 => -- contentChanges + Read_TextDocumentContentChangeEvent_Vector + (Handler, Value.contentChanges); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_DidChangeTextDocumentParams; + + package InlayHintRegistrationOptions_Scope is + package InlayHintRegistrationOptions_Map is new Minimal_Perfect_Hash + (["workDoneProgress", + "resolveProvider", + "documentSelector", + "id"]); + + end InlayHintRegistrationOptions_Scope; + + procedure Read_InlayHintRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.InlayHintRegistrationOptions) is + use InlayHintRegistrationOptions_Scope; + procedure Read_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSelector_Or_Null); + + procedure Read_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSelector_Or_Null) is + begin + if Handler.Is_Null_Value then + Handler.Read_Next; + else + Value := + (Is_Null => False, + Value => <>); + Read_DocumentSelector (Handler, Value.Value); + end if; + end Read_DocumentSelector_Or_Null; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case InlayHintRegistrationOptions_Map.Get_Index (Key) is + when 1 => -- workDoneProgress + Value.workDoneProgress := + (Is_Set => True, + Value => <>); + Value.workDoneProgress.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 2 => -- resolveProvider + Value.resolveProvider := + (Is_Set => True, + Value => <>); + Value.resolveProvider.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 3 => -- documentSelector + Read_DocumentSelector_Or_Null + (Handler, Value.Parent.documentSelector); + when 4 => -- id + Value.id.Clear; + Value.id.Append (Handler.String_Value); + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_InlayHintRegistrationOptions; + + package Declaration_Progress_Report_Scope is + package Declaration_Progress_Report_Map is new Minimal_Perfect_Hash + (["uri", + "range", + "originSelectionRange", + "targetUri", + "targetRange", + "targetSelectionRange"]); + + end Declaration_Progress_Report_Scope; + + procedure Read_Declaration_Progress_Report + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Declaration_Progress_Report) is + use Declaration_Progress_Report_Scope; + begin + declare + Parent : + constant not null access VSS.JSON.Pull_Readers.JSON_Pull_Reader' + Class := + Handler'Access; + Handler : + VSS.JSON.Pull_Readers.Buffered.JSON_Buffered_Pull_Reader (Parent); + begin + Handler.Mark; + if Handler.Is_Start_Array then + Handler.Read_Next; + end if; + if Handler.Is_Start_Object then + Handler.Read_Next; + while Handler.Is_Key_Name loop + declare + Key : constant VSS.Strings.Virtual_String := + Handler.Key_Name; + Index : constant Natural := + Declaration_Progress_Report_Map.Get_Index (Key); + begin + Handler.Read_Next; + case Index is + when 1 => -- uri + Value := + (Kind => LSP.Structures.Varian_1, + others => <>); + exit; + when 2 => -- range + Value := + (Kind => LSP.Structures.Varian_1, + others => <>); + exit; + when 3 => -- originSelectionRange + Value := + (Kind => LSP.Structures.Varian_2, + others => <>); + exit; + when 4 => -- targetUri + Value := + (Kind => LSP.Structures.Varian_2, + others => <>); + exit; + when 5 => -- targetRange + Value := + (Kind => LSP.Structures.Varian_2, + others => <>); + exit; + when 6 => -- targetSelectionRange + Value := + (Kind => LSP.Structures.Varian_2, + others => <>); + exit; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + else + raise Program_Error; -- Unexpected JSON value + end if; + + Handler.Reset; + Handler.Unmark; + + case Value.Kind is + when LSP.Structures.Varian_1 => + Read_Location_Vector (Handler, Value.Varian_1); + when LSP.Structures.Varian_2 => + Read_DeclarationLink_Vector (Handler, Value.Varian_2); + end case; + end; + end Read_Declaration_Progress_Report; + + procedure Read_Natural_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Natural_Vector) is + begin + pragma Assert (Handler.Is_Start_Array); + Handler.Read_Next; + + declare + Set : LSP.Structures.Natural_Vector renames Value; + Value : Natural; + begin + Set.Clear; + while not Handler.Is_End_Array loop + Value := Integer (Handler.Number_Value.Integer_Value); + Handler.Read_Next; + Set.Append (Value); + end loop; + end; + + Handler.Read_Next; + end Read_Natural_Vector; + + package CodeDescription_Scope is + package CodeDescription_Map is new Minimal_Perfect_Hash (["href"]); + + end CodeDescription_Scope; + + procedure Read_CodeDescription + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CodeDescription) is + use CodeDescription_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case CodeDescription_Map.Get_Index (Key) is + when 1 => -- href + Read_URI (Handler, Value.href); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_CodeDescription; + + procedure Read_Virtual_String_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Virtual_String_Vector) is + begin + pragma Assert (Handler.Is_Start_Array); + Handler.Read_Next; + + declare + Set : LSP.Structures.Virtual_String_Vector renames Value; + Value : LSP.Structures.Virtual_String; + begin + Set.Clear; + while not Handler.Is_End_Array loop + Value.Clear; + Value.Append (Handler.String_Value); + Handler.Read_Next; + Set.Append (Value); + end loop; + end; + + Handler.Read_Next; + end Read_Virtual_String_Vector; + + procedure Read_LSPObject + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.LSPObject) is + begin + pragma Assert (Handler.Is_Start_Object); + LSP.Input_Tools.Read_LSPAny_Class (Handler, Value); + + end Read_LSPObject; + + package TextDocumentPositionParams_Scope is + package TextDocumentPositionParams_Map is new Minimal_Perfect_Hash + (["textDocument", + "position"]); + + end TextDocumentPositionParams_Scope; + + procedure Read_TextDocumentPositionParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.TextDocumentPositionParams) is + use TextDocumentPositionParams_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case TextDocumentPositionParams_Map.Get_Index (Key) is + when 1 => -- textDocument + Read_TextDocumentIdentifier (Handler, Value.textDocument); + when 2 => -- position + Read_Position (Handler, Value.position); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_TextDocumentPositionParams; + + package DidSaveTextDocumentParams_Scope is + package DidSaveTextDocumentParams_Map is new Minimal_Perfect_Hash + (["textDocument", + "text"]); + + end DidSaveTextDocumentParams_Scope; + + procedure Read_DidSaveTextDocumentParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DidSaveTextDocumentParams) is + use DidSaveTextDocumentParams_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case DidSaveTextDocumentParams_Map.Get_Index (Key) is + when 1 => -- textDocument + Read_TextDocumentIdentifier (Handler, Value.textDocument); + when 2 => -- text + Value.text.Clear; + Value.text.Append (Handler.String_Value); + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_DidSaveTextDocumentParams; + + package CodeLensRegistrationOptions_Scope is + package CodeLensRegistrationOptions_Map is new Minimal_Perfect_Hash + (["documentSelector", + "workDoneProgress", + "resolveProvider"]); + + end CodeLensRegistrationOptions_Scope; + + procedure Read_CodeLensRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CodeLensRegistrationOptions) is + use CodeLensRegistrationOptions_Scope; + procedure Read_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSelector_Or_Null); + + procedure Read_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSelector_Or_Null) is + begin + if Handler.Is_Null_Value then + Handler.Read_Next; + else + Value := + (Is_Null => False, + Value => <>); + Read_DocumentSelector (Handler, Value.Value); + end if; + end Read_DocumentSelector_Or_Null; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case CodeLensRegistrationOptions_Map.Get_Index (Key) is + when 1 => -- documentSelector + Read_DocumentSelector_Or_Null + (Handler, Value.Parent.documentSelector); + when 2 => -- workDoneProgress + Value.workDoneProgress := + (Is_Set => True, + Value => <>); + Value.workDoneProgress.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 3 => -- resolveProvider + Value.resolveProvider := + (Is_Set => True, + Value => <>); + Value.resolveProvider.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_CodeLensRegistrationOptions; + + package SelectionRange_Scope is + package SelectionRange_Map is new Minimal_Perfect_Hash + (["range", + "parent"]); + + end SelectionRange_Scope; + + procedure Read_SelectionRange + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SelectionRange) is + use SelectionRange_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case SelectionRange_Map.Get_Index (Key) is + when 1 => -- range + Read_A_Range (Handler, Value.a_range); + when 2 => -- parent + declare + Value_parent : LSP.Structures.SelectionRange; + begin + Read_SelectionRange (Handler, Value_parent); + Value.parent.Set (Value_parent); + end; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_SelectionRange; + + package NotebookCellTextDocumentFilter_Scope is + package NotebookCellTextDocumentFilter_Map is new Minimal_Perfect_Hash + (["notebook", + "language"]); + + end NotebookCellTextDocumentFilter_Scope; + + procedure Read_NotebookCellTextDocumentFilter + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.NotebookCellTextDocumentFilter) is + use NotebookCellTextDocumentFilter_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case NotebookCellTextDocumentFilter_Map.Get_Index (Key) is + when 1 => -- notebook + Read_Virtual_String_Or_NotebookDocumentFilter + (Handler, Value.notebook); + when 2 => -- language + Value.language.Clear; + Value.language.Append (Handler.String_Value); + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_NotebookCellTextDocumentFilter; + + package WorkspaceFoldersInitializeParams_Scope is + package WorkspaceFoldersInitializeParams_Map is new Minimal_Perfect_Hash + (["workspaceFolders"]); + + end WorkspaceFoldersInitializeParams_Scope; + + procedure Read_WorkspaceFoldersInitializeParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.WorkspaceFoldersInitializeParams) is + use WorkspaceFoldersInitializeParams_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case WorkspaceFoldersInitializeParams_Map.Get_Index (Key) is + when 1 => -- workspaceFolders + Value.workspaceFolders := + (Is_Set => True, + Value => <>); + Read_WorkspaceFolder_Vector_Or_Null + (Handler, Value.workspaceFolders.Value); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_WorkspaceFoldersInitializeParams; + + package ShowMessageParams_Scope is + package ShowMessageParams_Map is new Minimal_Perfect_Hash + (["type", + "message"]); + + end ShowMessageParams_Scope; + + procedure Read_ShowMessageParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ShowMessageParams) is + use ShowMessageParams_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case ShowMessageParams_Map.Get_Index (Key) is + when 1 => -- type + Read_MessageType (Handler, Value.a_type); + when 2 => -- message + Value.message.Clear; + Value.message.Append (Handler.String_Value); + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_ShowMessageParams; + + package FileSystemWatcher_Scope is + package FileSystemWatcher_Map is new Minimal_Perfect_Hash + (["globPattern", + "kind"]); + + end FileSystemWatcher_Scope; + + procedure Read_FileSystemWatcher + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.FileSystemWatcher) is + use FileSystemWatcher_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case FileSystemWatcher_Map.Get_Index (Key) is + when 1 => -- globPattern + Read_GlobPattern (Handler, Value.globPattern); + when 2 => -- kind + Value.kind := + (Is_Set => True, + Value => <>); + Read_WatchKind (Handler, Value.kind.Value); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_FileSystemWatcher; + + procedure Read_CodeActionKind_Set + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CodeActionKind_Set) is + begin + pragma Assert (Handler.Is_Start_Array); + Handler.Read_Next; + + declare + Set : LSP.Structures.CodeActionKind_Set renames Value; + Value : LSP.Enumerations.CodeActionKind; + begin + Set := (others => False); + while not Handler.Is_End_Array loop + Read_CodeActionKind (Handler, Value); + Set (Value) := True; + end loop; + end; + + Handler.Read_Next; + end Read_CodeActionKind_Set; + + package NotebookDocumentSyncOptions_Scope is + package NotebookDocumentSyncOptions_Map is new Minimal_Perfect_Hash + (["notebookSelector", + "save"]); + + package cells_OfnotebookSelector_OfNotebookDocumentSyncOptions_Item_Item_Scope + is + package cells_OfnotebookSelector_OfNotebookDocumentSyncOptions_Item_Item_Map is new Minimal_Perfect_Hash + (["language"]); + + end cells_OfnotebookSelector_OfNotebookDocumentSyncOptions_Item_Item_Scope; + + package notebookSelector_OfNotebookDocumentSyncOptions_Item_Scope is + package notebookSelector_OfNotebookDocumentSyncOptions_Item_Map is new Minimal_Perfect_Hash + (["notebook", + "cells"]); + + end notebookSelector_OfNotebookDocumentSyncOptions_Item_Scope; + + end NotebookDocumentSyncOptions_Scope; + + procedure Read_NotebookDocumentSyncOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.NotebookDocumentSyncOptions) is + use NotebookDocumentSyncOptions_Scope; + procedure Read_cells_OfnotebookSelector_OfNotebookDocumentSyncOptions_Item_Item + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .cells_OfnotebookSelector_OfNotebookDocumentSyncOptions_Item_Item); + + procedure Read_notebookSelector_OfNotebookDocumentSyncOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .notebookSelector_OfNotebookDocumentSyncOptions); + + procedure Read_cells_OfnotebookSelector_OfNotebookDocumentSyncOptions_Item + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .cells_OfnotebookSelector_OfNotebookDocumentSyncOptions_Item); + + procedure Read_notebookSelector_OfNotebookDocumentSyncOptions_Item + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .notebookSelector_OfNotebookDocumentSyncOptions_Item); + + procedure Read_cells_OfnotebookSelector_OfNotebookDocumentSyncOptions_Item_Item + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .cells_OfnotebookSelector_OfNotebookDocumentSyncOptions_Item_Item) is + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while Handler.Is_Key_Name loop + declare + use + cells_OfnotebookSelector_OfNotebookDocumentSyncOptions_Item_Item_Scope; + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case cells_OfnotebookSelector_OfNotebookDocumentSyncOptions_Item_Item_Map + .Get_Index + (Key) is + when 1 => -- language + Value.language.Clear; + Value.language.Append (Handler.String_Value); + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_cells_OfnotebookSelector_OfNotebookDocumentSyncOptions_Item_Item; + + procedure Read_notebookSelector_OfNotebookDocumentSyncOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .notebookSelector_OfNotebookDocumentSyncOptions) is + begin + pragma Assert (Handler.Is_Start_Array); + Handler.Read_Next; + + declare + Set : + LSP.Structures + .notebookSelector_OfNotebookDocumentSyncOptions renames + Value; + Value : + LSP.Structures + .notebookSelector_OfNotebookDocumentSyncOptions_Item; + begin + Set.Clear; + while not Handler.Is_End_Array loop + Read_notebookSelector_OfNotebookDocumentSyncOptions_Item + (Handler, Value); + Set.Append (Value); + end loop; + end; + + Handler.Read_Next; + end Read_notebookSelector_OfNotebookDocumentSyncOptions; + + procedure Read_cells_OfnotebookSelector_OfNotebookDocumentSyncOptions_Item + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .cells_OfnotebookSelector_OfNotebookDocumentSyncOptions_Item) is + begin + pragma Assert (Handler.Is_Start_Array); + Handler.Read_Next; + + declare + Set : + LSP.Structures + .cells_OfnotebookSelector_OfNotebookDocumentSyncOptions_Item renames + Value; + Value : + LSP.Structures + .cells_OfnotebookSelector_OfNotebookDocumentSyncOptions_Item_Item; + begin + Set.Clear; + while not Handler.Is_End_Array loop + Read_cells_OfnotebookSelector_OfNotebookDocumentSyncOptions_Item_Item + (Handler, Value); + Set.Append (Value); + end loop; + end; + + Handler.Read_Next; + end Read_cells_OfnotebookSelector_OfNotebookDocumentSyncOptions_Item; + + procedure Read_notebookSelector_OfNotebookDocumentSyncOptions_Item + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .notebookSelector_OfNotebookDocumentSyncOptions_Item) is + use notebookSelector_OfNotebookDocumentSyncOptions_Item_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while Handler.Is_Key_Name loop + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case notebookSelector_OfNotebookDocumentSyncOptions_Item_Map + .Get_Index + (Key) is + when 1 => -- notebook + Value.notebook := + (Is_Set => True, + Value => <>); + Read_Virtual_String_Or_NotebookDocumentFilter + (Handler, Value.notebook.Value); + when 2 => -- cells + Read_cells_OfnotebookSelector_OfNotebookDocumentSyncOptions_Item + (Handler, Value.cells); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_notebookSelector_OfNotebookDocumentSyncOptions_Item; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case NotebookDocumentSyncOptions_Map.Get_Index (Key) is + when 1 => -- notebookSelector + Read_notebookSelector_OfNotebookDocumentSyncOptions + (Handler, Value.notebookSelector); + when 2 => -- save + Value.save := + (Is_Set => True, + Value => <>); + Value.save.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_NotebookDocumentSyncOptions; + + package CodeActionRegistrationOptions_Scope is + package CodeActionRegistrationOptions_Map is new Minimal_Perfect_Hash + (["documentSelector", + "workDoneProgress", + "codeActionKinds", + "resolveProvider"]); + + end CodeActionRegistrationOptions_Scope; + + procedure Read_CodeActionRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CodeActionRegistrationOptions) is + use CodeActionRegistrationOptions_Scope; + procedure Read_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSelector_Or_Null); + + procedure Read_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSelector_Or_Null) is + begin + if Handler.Is_Null_Value then + Handler.Read_Next; + else + Value := + (Is_Null => False, + Value => <>); + Read_DocumentSelector (Handler, Value.Value); + end if; + end Read_DocumentSelector_Or_Null; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case CodeActionRegistrationOptions_Map.Get_Index (Key) is + when 1 => -- documentSelector + Read_DocumentSelector_Or_Null + (Handler, Value.Parent.documentSelector); + when 2 => -- workDoneProgress + Value.workDoneProgress := + (Is_Set => True, + Value => <>); + Value.workDoneProgress.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 3 => -- codeActionKinds + Read_CodeActionKind_Set (Handler, Value.codeActionKinds); + when 4 => -- resolveProvider + Value.resolveProvider := + (Is_Set => True, + Value => <>); + Value.resolveProvider.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_CodeActionRegistrationOptions; + + package NotebookDocumentSyncRegistrationOptions_Scope is + package NotebookDocumentSyncRegistrationOptions_Map is new Minimal_Perfect_Hash + (["notebookSelector", + "save", + "id"]); + + package cells_OfnotebookSelector_OfNotebookDocumentSyncOptions_Item_Item_Scope + is + package cells_OfnotebookSelector_OfNotebookDocumentSyncOptions_Item_Item_Map is new Minimal_Perfect_Hash + (["language"]); + + end cells_OfnotebookSelector_OfNotebookDocumentSyncOptions_Item_Item_Scope; + + package notebookSelector_OfNotebookDocumentSyncOptions_Item_Scope is + package notebookSelector_OfNotebookDocumentSyncOptions_Item_Map is new Minimal_Perfect_Hash + (["notebook", + "cells"]); + + end notebookSelector_OfNotebookDocumentSyncOptions_Item_Scope; + + end NotebookDocumentSyncRegistrationOptions_Scope; + + procedure Read_NotebookDocumentSyncRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.NotebookDocumentSyncRegistrationOptions) is + use NotebookDocumentSyncRegistrationOptions_Scope; + procedure Read_cells_OfnotebookSelector_OfNotebookDocumentSyncOptions_Item_Item + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .cells_OfnotebookSelector_OfNotebookDocumentSyncOptions_Item_Item); + + procedure Read_notebookSelector_OfNotebookDocumentSyncOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .notebookSelector_OfNotebookDocumentSyncOptions); + + procedure Read_cells_OfnotebookSelector_OfNotebookDocumentSyncOptions_Item + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .cells_OfnotebookSelector_OfNotebookDocumentSyncOptions_Item); + + procedure Read_notebookSelector_OfNotebookDocumentSyncOptions_Item + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .notebookSelector_OfNotebookDocumentSyncOptions_Item); + + procedure Read_cells_OfnotebookSelector_OfNotebookDocumentSyncOptions_Item_Item + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .cells_OfnotebookSelector_OfNotebookDocumentSyncOptions_Item_Item) is + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while Handler.Is_Key_Name loop + declare + use + cells_OfnotebookSelector_OfNotebookDocumentSyncOptions_Item_Item_Scope; + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case cells_OfnotebookSelector_OfNotebookDocumentSyncOptions_Item_Item_Map + .Get_Index + (Key) is + when 1 => -- language + Value.language.Clear; + Value.language.Append (Handler.String_Value); + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_cells_OfnotebookSelector_OfNotebookDocumentSyncOptions_Item_Item; + + procedure Read_notebookSelector_OfNotebookDocumentSyncOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .notebookSelector_OfNotebookDocumentSyncOptions) is + begin + pragma Assert (Handler.Is_Start_Array); + Handler.Read_Next; + + declare + Set : + LSP.Structures + .notebookSelector_OfNotebookDocumentSyncOptions renames + Value; + Value : + LSP.Structures + .notebookSelector_OfNotebookDocumentSyncOptions_Item; + begin + Set.Clear; + while not Handler.Is_End_Array loop + Read_notebookSelector_OfNotebookDocumentSyncOptions_Item + (Handler, Value); + Set.Append (Value); + end loop; + end; + + Handler.Read_Next; + end Read_notebookSelector_OfNotebookDocumentSyncOptions; + + procedure Read_cells_OfnotebookSelector_OfNotebookDocumentSyncOptions_Item + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .cells_OfnotebookSelector_OfNotebookDocumentSyncOptions_Item) is + begin + pragma Assert (Handler.Is_Start_Array); + Handler.Read_Next; + + declare + Set : + LSP.Structures + .cells_OfnotebookSelector_OfNotebookDocumentSyncOptions_Item renames + Value; + Value : + LSP.Structures + .cells_OfnotebookSelector_OfNotebookDocumentSyncOptions_Item_Item; + begin + Set.Clear; + while not Handler.Is_End_Array loop + Read_cells_OfnotebookSelector_OfNotebookDocumentSyncOptions_Item_Item + (Handler, Value); + Set.Append (Value); + end loop; + end; + + Handler.Read_Next; + end Read_cells_OfnotebookSelector_OfNotebookDocumentSyncOptions_Item; + + procedure Read_notebookSelector_OfNotebookDocumentSyncOptions_Item + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .notebookSelector_OfNotebookDocumentSyncOptions_Item) is + use notebookSelector_OfNotebookDocumentSyncOptions_Item_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while Handler.Is_Key_Name loop + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case notebookSelector_OfNotebookDocumentSyncOptions_Item_Map + .Get_Index + (Key) is + when 1 => -- notebook + Value.notebook := + (Is_Set => True, + Value => <>); + Read_Virtual_String_Or_NotebookDocumentFilter + (Handler, Value.notebook.Value); + when 2 => -- cells + Read_cells_OfnotebookSelector_OfNotebookDocumentSyncOptions_Item + (Handler, Value.cells); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_notebookSelector_OfNotebookDocumentSyncOptions_Item; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case NotebookDocumentSyncRegistrationOptions_Map.Get_Index (Key) is + when 1 => -- notebookSelector + Read_notebookSelector_OfNotebookDocumentSyncOptions + (Handler, Value.notebookSelector); + when 2 => -- save + Value.save := + (Is_Set => True, + Value => <>); + Value.save.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 3 => -- id + Value.id.Clear; + Value.id.Append (Handler.String_Value); + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_NotebookDocumentSyncRegistrationOptions; + + package WorkspaceUnchangedDocumentDiagnosticReport_Scope is + package WorkspaceUnchangedDocumentDiagnosticReport_Map is new Minimal_Perfect_Hash + (["kind", + "resultId", + "uri", + "version"]); + + end WorkspaceUnchangedDocumentDiagnosticReport_Scope; + + procedure Read_WorkspaceUnchangedDocumentDiagnosticReport + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.WorkspaceUnchangedDocumentDiagnosticReport) is + use WorkspaceUnchangedDocumentDiagnosticReport_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case WorkspaceUnchangedDocumentDiagnosticReport_Map.Get_Index + (Key) is + when 1 => -- kind + Handler.Read_Next; -- Skip string literal: unchanged + when 2 => -- resultId + Value.resultId.Clear; + Value.resultId.Append (Handler.String_Value); + Handler.Read_Next; + when 3 => -- uri + Value.uri := (Handler.String_Value with null record); + Handler.Read_Next; + when 4 => -- version + Read_Integer_Or_Null (Handler, Value.version); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_WorkspaceUnchangedDocumentDiagnosticReport; + + package ReferenceParams_Scope is + package ReferenceParams_Map is new Minimal_Perfect_Hash + (["textDocument", + "position", + "workDoneToken", + "partialResultToken", + "context"]); + + end ReferenceParams_Scope; + + procedure Read_ReferenceParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ReferenceParams) is + use ReferenceParams_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case ReferenceParams_Map.Get_Index (Key) is + when 1 => -- textDocument + Read_TextDocumentIdentifier (Handler, Value.textDocument); + when 2 => -- position + Read_Position (Handler, Value.position); + when 3 => -- workDoneToken + Value.workDoneToken := + (Is_Set => True, + Value => <>); + Read_ProgressToken (Handler, Value.workDoneToken.Value); + when 4 => -- partialResultToken + Value.partialResultToken := + (Is_Set => True, + Value => <>); + Read_ProgressToken (Handler, Value.partialResultToken.Value); + when 5 => -- context + Read_ReferenceContext (Handler, Value.context); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_ReferenceParams; + + package HoverClientCapabilities_Scope is + package HoverClientCapabilities_Map is new Minimal_Perfect_Hash + (["dynamicRegistration", + "contentFormat"]); + + end HoverClientCapabilities_Scope; + + procedure Read_HoverClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.HoverClientCapabilities) is + use HoverClientCapabilities_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case HoverClientCapabilities_Map.Get_Index (Key) is + when 1 => -- dynamicRegistration + Value.dynamicRegistration := + (Is_Set => True, + Value => <>); + Value.dynamicRegistration.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 2 => -- contentFormat + Read_MarkupKind_Vector (Handler, Value.contentFormat); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_HoverClientCapabilities; + + package RenameClientCapabilities_Scope is + package RenameClientCapabilities_Map is new Minimal_Perfect_Hash + (["dynamicRegistration", + "prepareSupport", + "prepareSupportDefaultBehavior", + "honorsChangeAnnotations"]); + + end RenameClientCapabilities_Scope; + + procedure Read_RenameClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.RenameClientCapabilities) is + use RenameClientCapabilities_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case RenameClientCapabilities_Map.Get_Index (Key) is + when 1 => -- dynamicRegistration + Value.dynamicRegistration := + (Is_Set => True, + Value => <>); + Value.dynamicRegistration.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 2 => -- prepareSupport + Value.prepareSupport := + (Is_Set => True, + Value => <>); + Value.prepareSupport.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 3 => -- prepareSupportDefaultBehavior + Value.prepareSupportDefaultBehavior := + (Is_Set => True, + Value => <>); + Read_PrepareSupportDefaultBehavior + (Handler, Value.prepareSupportDefaultBehavior.Value); + when 4 => -- honorsChangeAnnotations + Value.honorsChangeAnnotations := + (Is_Set => True, + Value => <>); + Value.honorsChangeAnnotations.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_RenameClientCapabilities; + + package DidChangeConfigurationParams_Scope is + package DidChangeConfigurationParams_Map is new Minimal_Perfect_Hash + (["settings"]); + + end DidChangeConfigurationParams_Scope; + + procedure Read_DidChangeConfigurationParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DidChangeConfigurationParams) is + use DidChangeConfigurationParams_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case DidChangeConfigurationParams_Map.Get_Index (Key) is + when 1 => -- settings + Read_LSPAny (Handler, Value.settings); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_DidChangeConfigurationParams; + + package DefinitionOptions_Scope is + package DefinitionOptions_Map is new Minimal_Perfect_Hash + (["workDoneProgress"]); + + end DefinitionOptions_Scope; + + procedure Read_DefinitionOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DefinitionOptions) is + use DefinitionOptions_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case DefinitionOptions_Map.Get_Index (Key) is + when 1 => -- workDoneProgress + Value.workDoneProgress := + (Is_Set => True, + Value => <>); + Value.workDoneProgress.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_DefinitionOptions; + + procedure Read_Hover_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Hover_Or_Null) is + begin + if Handler.Is_Null_Value then + Handler.Read_Next; + else + Value := + (Is_Null => False, + Value => <>); + Read_Hover (Handler, Value.Value); + end if; + end Read_Hover_Or_Null; + + procedure Read_InlayHintKind + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.InlayHintKind) is + begin + Value := + LSP.Enumerations.InlayHintKind'Val + (Handler.Number_Value.Integer_Value - 1); + Handler.Read_Next; + end Read_InlayHintKind; + + package symbolKind_OfWorkspaceSymbolClientCapabilities_Scope is + package symbolKind_OfWorkspaceSymbolClientCapabilities_Map is new Minimal_Perfect_Hash + (["valueSet"]); + + end symbolKind_OfWorkspaceSymbolClientCapabilities_Scope; + + procedure Read_symbolKind_OfWorkspaceSymbolClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .symbolKind_OfWorkspaceSymbolClientCapabilities) is + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while Handler.Is_Key_Name loop + declare + use symbolKind_OfWorkspaceSymbolClientCapabilities_Scope; + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case symbolKind_OfWorkspaceSymbolClientCapabilities_Map.Get_Index + (Key) is + when 1 => -- valueSet + Read_SymbolKind_Set (Handler, Value.valueSet); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_symbolKind_OfWorkspaceSymbolClientCapabilities; + + procedure Read_CallHierarchyOutgoingCall_Vector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CallHierarchyOutgoingCall_Vector_Or_Null) is + begin + if Handler.Is_Null_Value then + Handler.Read_Next; + else + Value.Clear; + Read_CallHierarchyOutgoingCall_Vector (Handler, Value); + end if; + end Read_CallHierarchyOutgoingCall_Vector_Or_Null; + + package FailureHandlingKind_Map is new Minimal_Perfect_Hash + (["abort", + "transactional", + "textOnlyTransactional", + "undo"]); + + procedure Read_FailureHandlingKind + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.FailureHandlingKind) is + begin + Value := + LSP.Enumerations.FailureHandlingKind'Val + (FailureHandlingKind_Map.Get_Index (Handler.String_Value) - 1); + Handler.Read_Next; + end Read_FailureHandlingKind; + + package FileOperationOptions_Scope is + package FileOperationOptions_Map is new Minimal_Perfect_Hash + (["didCreate", + "willCreate", + "didRename", + "willRename", + "didDelete", + "willDelete"]); + + end FileOperationOptions_Scope; + + procedure Read_FileOperationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.FileOperationOptions) is + use FileOperationOptions_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case FileOperationOptions_Map.Get_Index (Key) is + when 1 => -- didCreate + Value.didCreate := + (Is_Set => True, + Value => <>); + Read_FileOperationRegistrationOptions + (Handler, Value.didCreate.Value); + when 2 => -- willCreate + Value.willCreate := + (Is_Set => True, + Value => <>); + Read_FileOperationRegistrationOptions + (Handler, Value.willCreate.Value); + when 3 => -- didRename + Value.didRename := + (Is_Set => True, + Value => <>); + Read_FileOperationRegistrationOptions + (Handler, Value.didRename.Value); + when 4 => -- willRename + Value.willRename := + (Is_Set => True, + Value => <>); + Read_FileOperationRegistrationOptions + (Handler, Value.willRename.Value); + when 5 => -- didDelete + Value.didDelete := + (Is_Set => True, + Value => <>); + Read_FileOperationRegistrationOptions + (Handler, Value.didDelete.Value); + when 6 => -- willDelete + Value.willDelete := + (Is_Set => True, + Value => <>); + Read_FileOperationRegistrationOptions + (Handler, Value.willDelete.Value); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_FileOperationOptions; + + package ShowDocumentResult_Scope is + package ShowDocumentResult_Map is new Minimal_Perfect_Hash (["success"]); + + end ShowDocumentResult_Scope; + + procedure Read_ShowDocumentResult + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ShowDocumentResult) is + use ShowDocumentResult_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case ShowDocumentResult_Map.Get_Index (Key) is + when 1 => -- success + Value.success := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_ShowDocumentResult; + + package TypeDefinitionParams_Scope is + package TypeDefinitionParams_Map is new Minimal_Perfect_Hash + (["textDocument", + "position", + "workDoneToken", + "partialResultToken"]); + + end TypeDefinitionParams_Scope; + + procedure Read_TypeDefinitionParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.TypeDefinitionParams) is + use TypeDefinitionParams_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case TypeDefinitionParams_Map.Get_Index (Key) is + when 1 => -- textDocument + Read_TextDocumentIdentifier (Handler, Value.textDocument); + when 2 => -- position + Read_Position (Handler, Value.position); + when 3 => -- workDoneToken + Value.workDoneToken := + (Is_Set => True, + Value => <>); + Read_ProgressToken (Handler, Value.workDoneToken.Value); + when 4 => -- partialResultToken + Value.partialResultToken := + (Is_Set => True, + Value => <>); + Read_ProgressToken (Handler, Value.partialResultToken.Value); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_TypeDefinitionParams; + + procedure Read_DocumentSelector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSelector) is + procedure Read_Virtual_String_Or_DocumentFilter + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Virtual_String_Or_DocumentFilter); + + procedure Read_Virtual_String_Or_DocumentFilter + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Virtual_String_Or_DocumentFilter) is + begin + if Handler.Is_String_Value then + Value := + (Is_Virtual_String => True, + others => <>); + else + Value := + (Is_Virtual_String => False, + others => <>); + end if; + + case Value.Is_Virtual_String is + when True => + Value.Virtual_String.Clear; + Value.Virtual_String.Append (Handler.String_Value); + Handler.Read_Next; + when False => + Read_DocumentFilter (Handler, Value.DocumentFilter); + end case; + end Read_Virtual_String_Or_DocumentFilter; + + begin + pragma Assert (Handler.Is_Start_Array); + Handler.Read_Next; + + declare + Set : LSP.Structures.DocumentSelector renames Value; + Value : LSP.Structures.Virtual_String_Or_DocumentFilter; + begin + Set.Clear; + while not Handler.Is_End_Array loop + Read_Virtual_String_Or_DocumentFilter (Handler, Value); + Set.Append (Value); + end loop; + end; + + Handler.Read_Next; + end Read_DocumentSelector; + + package CompletionClientCapabilities_Scope is + package CompletionClientCapabilities_Map is new Minimal_Perfect_Hash + (["dynamicRegistration", + "completionItem", + "completionItemKind", + "insertTextMode", + "contextSupport", + "completionList"]); + + package completionItem_OfCompletionClientCapabilities_Scope is + package completionItem_OfCompletionClientCapabilities_Map is new Minimal_Perfect_Hash + (["snippetSupport", + "commitCharactersSupport", + "documentationFormat", + "deprecatedSupport", + "preselectSupport", + "tagSupport", + "insertReplaceSupport", + "resolveSupport", + "insertTextModeSupport", + "labelDetailsSupport"]); + + end completionItem_OfCompletionClientCapabilities_Scope; + + package completionList_OfCompletionClientCapabilities_Scope is + package completionList_OfCompletionClientCapabilities_Map is new Minimal_Perfect_Hash + (["itemDefaults"]); + + end completionList_OfCompletionClientCapabilities_Scope; + + package tagSupport_OfcompletionItem_OfCompletionClientCapabilities_Scope + is + package tagSupport_OfcompletionItem_OfCompletionClientCapabilities_Map is new Minimal_Perfect_Hash + (["valueSet"]); + + end tagSupport_OfcompletionItem_OfCompletionClientCapabilities_Scope; + + package completionItemKind_OfCompletionClientCapabilities_Scope is + package completionItemKind_OfCompletionClientCapabilities_Map is new Minimal_Perfect_Hash + (["valueSet"]); + + end completionItemKind_OfCompletionClientCapabilities_Scope; + + package insertTextModeSupport_OfcompletionItem_OfCompletionClientCapabilities_Scope + is + package insertTextModeSupport_OfcompletionItem_OfCompletionClientCapabilities_Map is new Minimal_Perfect_Hash + (["valueSet"]); + + end insertTextModeSupport_OfcompletionItem_OfCompletionClientCapabilities_Scope; + + end CompletionClientCapabilities_Scope; + + procedure Read_CompletionClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CompletionClientCapabilities) is + use CompletionClientCapabilities_Scope; + procedure Read_CompletionItemKind_Set + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CompletionItemKind_Set); + + procedure Read_completionItem_OfCompletionClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .completionItem_OfCompletionClientCapabilities); + + procedure Read_completionList_OfCompletionClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .completionList_OfCompletionClientCapabilities); + + procedure Read_tagSupport_OfcompletionItem_OfCompletionClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .tagSupport_OfcompletionItem_OfCompletionClientCapabilities); + + procedure Read_InsertTextMode_Set + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.InsertTextMode_Set); + + procedure Read_completionItemKind_OfCompletionClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .completionItemKind_OfCompletionClientCapabilities); + + procedure Read_insertTextModeSupport_OfcompletionItem_OfCompletionClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .insertTextModeSupport_OfcompletionItem_OfCompletionClientCapabilities); + + procedure Read_CompletionItemKind_Set + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CompletionItemKind_Set) is + begin + pragma Assert (Handler.Is_Start_Array); + Handler.Read_Next; + + declare + Set : LSP.Structures.CompletionItemKind_Set renames Value; + Value : LSP.Enumerations.CompletionItemKind; + begin + Set := (others => False); + while not Handler.Is_End_Array loop + Read_CompletionItemKind (Handler, Value); + Set (Value) := True; + end loop; + end; + + Handler.Read_Next; + end Read_CompletionItemKind_Set; + + procedure Read_completionItem_OfCompletionClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .completionItem_OfCompletionClientCapabilities) is + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while Handler.Is_Key_Name loop + declare + use completionItem_OfCompletionClientCapabilities_Scope; + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case completionItem_OfCompletionClientCapabilities_Map.Get_Index + (Key) is + when 1 => -- snippetSupport + Value.snippetSupport := + (Is_Set => True, + Value => <>); + Value.snippetSupport.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 2 => -- commitCharactersSupport + Value.commitCharactersSupport := + (Is_Set => True, + Value => <>); + Value.commitCharactersSupport.Value := + Handler.Boolean_Value; + Handler.Read_Next; + when 3 => -- documentationFormat + Read_MarkupKind_Vector + (Handler, Value.documentationFormat); + when 4 => -- deprecatedSupport + Value.deprecatedSupport := + (Is_Set => True, + Value => <>); + Value.deprecatedSupport.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 5 => -- preselectSupport + Value.preselectSupport := + (Is_Set => True, + Value => <>); + Value.preselectSupport.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 6 => -- tagSupport + Value.tagSupport := + (Is_Set => True, + Value => <>); + Read_tagSupport_OfcompletionItem_OfCompletionClientCapabilities + (Handler, Value.tagSupport.Value); + when 7 => -- insertReplaceSupport + Value.insertReplaceSupport := + (Is_Set => True, + Value => <>); + Value.insertReplaceSupport.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 8 => -- resolveSupport + Value.resolveSupport := + (Is_Set => True, + Value => <>); + Read_resolveSupport_OfWorkspaceSymbolClientCapabilities + (Handler, Value.resolveSupport.Value); + when 9 => -- insertTextModeSupport + Value.insertTextModeSupport := + (Is_Set => True, + Value => <>); + Read_insertTextModeSupport_OfcompletionItem_OfCompletionClientCapabilities + (Handler, Value.insertTextModeSupport.Value); + when 10 => -- labelDetailsSupport + Value.labelDetailsSupport := + (Is_Set => True, + Value => <>); + Value.labelDetailsSupport.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_completionItem_OfCompletionClientCapabilities; + + procedure Read_completionList_OfCompletionClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .completionList_OfCompletionClientCapabilities) is + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while Handler.Is_Key_Name loop + declare + use completionList_OfCompletionClientCapabilities_Scope; + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case completionList_OfCompletionClientCapabilities_Map.Get_Index + (Key) is + when 1 => -- itemDefaults + Read_Virtual_String_Vector (Handler, Value.itemDefaults); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_completionList_OfCompletionClientCapabilities; + + procedure Read_tagSupport_OfcompletionItem_OfCompletionClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .tagSupport_OfcompletionItem_OfCompletionClientCapabilities) is + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while Handler.Is_Key_Name loop + declare + use + tagSupport_OfcompletionItem_OfCompletionClientCapabilities_Scope; + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case tagSupport_OfcompletionItem_OfCompletionClientCapabilities_Map + .Get_Index + (Key) is + when 1 => -- valueSet + Read_CompletionItemTag_Set (Handler, Value.valueSet); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_tagSupport_OfcompletionItem_OfCompletionClientCapabilities; + + procedure Read_InsertTextMode_Set + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.InsertTextMode_Set) is + begin + pragma Assert (Handler.Is_Start_Array); + Handler.Read_Next; + + declare + Set : LSP.Structures.InsertTextMode_Set renames Value; + Value : LSP.Enumerations.InsertTextMode; + begin + Set := (others => False); + while not Handler.Is_End_Array loop + Read_InsertTextMode (Handler, Value); + Set (Value) := True; + end loop; + end; + + Handler.Read_Next; + end Read_InsertTextMode_Set; + + procedure Read_completionItemKind_OfCompletionClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .completionItemKind_OfCompletionClientCapabilities) is + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while Handler.Is_Key_Name loop + declare + use completionItemKind_OfCompletionClientCapabilities_Scope; + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case completionItemKind_OfCompletionClientCapabilities_Map + .Get_Index + (Key) is + when 1 => -- valueSet + Read_CompletionItemKind_Set (Handler, Value.valueSet); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_completionItemKind_OfCompletionClientCapabilities; + + procedure Read_insertTextModeSupport_OfcompletionItem_OfCompletionClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .insertTextModeSupport_OfcompletionItem_OfCompletionClientCapabilities) is + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while Handler.Is_Key_Name loop + declare + use + insertTextModeSupport_OfcompletionItem_OfCompletionClientCapabilities_Scope; + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case insertTextModeSupport_OfcompletionItem_OfCompletionClientCapabilities_Map + .Get_Index + (Key) is + when 1 => -- valueSet + Read_InsertTextMode_Set (Handler, Value.valueSet); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_insertTextModeSupport_OfcompletionItem_OfCompletionClientCapabilities; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case CompletionClientCapabilities_Map.Get_Index (Key) is + when 1 => -- dynamicRegistration + Value.dynamicRegistration := + (Is_Set => True, + Value => <>); + Value.dynamicRegistration.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 2 => -- completionItem + Value.completionItem := + (Is_Set => True, + Value => <>); + Read_completionItem_OfCompletionClientCapabilities + (Handler, Value.completionItem.Value); + when 3 => -- completionItemKind + Value.completionItemKind := + (Is_Set => True, + Value => <>); + Read_completionItemKind_OfCompletionClientCapabilities + (Handler, Value.completionItemKind.Value); + when 4 => -- insertTextMode + Value.insertTextMode := + (Is_Set => True, + Value => <>); + Read_InsertTextMode (Handler, Value.insertTextMode.Value); + when 5 => -- contextSupport + Value.contextSupport := + (Is_Set => True, + Value => <>); + Value.contextSupport.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 6 => -- completionList + Value.completionList := + (Is_Set => True, + Value => <>); + Read_completionList_OfCompletionClientCapabilities + (Handler, Value.completionList.Value); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_CompletionClientCapabilities; + + package CodeLensWorkspaceClientCapabilities_Scope is + package CodeLensWorkspaceClientCapabilities_Map is new Minimal_Perfect_Hash + (["refreshSupport"]); + + end CodeLensWorkspaceClientCapabilities_Scope; + + procedure Read_CodeLensWorkspaceClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CodeLensWorkspaceClientCapabilities) is + use CodeLensWorkspaceClientCapabilities_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case CodeLensWorkspaceClientCapabilities_Map.Get_Index (Key) is + when 1 => -- refreshSupport + Value.refreshSupport := + (Is_Set => True, + Value => <>); + Value.refreshSupport.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_CodeLensWorkspaceClientCapabilities; + + package RenameOptions_Scope is + package RenameOptions_Map is new Minimal_Perfect_Hash + (["workDoneProgress", + "prepareProvider"]); + + end RenameOptions_Scope; + + procedure Read_RenameOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.RenameOptions) is + use RenameOptions_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case RenameOptions_Map.Get_Index (Key) is + when 1 => -- workDoneProgress + Value.workDoneProgress := + (Is_Set => True, + Value => <>); + Value.workDoneProgress.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 2 => -- prepareProvider + Value.prepareProvider := + (Is_Set => True, + Value => <>); + Value.prepareProvider.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_RenameOptions; + + procedure Read_SymbolKind_Set + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SymbolKind_Set) is + begin + pragma Assert (Handler.Is_Start_Array); + Handler.Read_Next; + + declare + Set : LSP.Structures.SymbolKind_Set renames Value; + Value : LSP.Enumerations.SymbolKind; + begin + Set := (others => False); + while not Handler.Is_End_Array loop + Read_SymbolKind (Handler, Value); + Set (Value) := True; + end loop; + end; + + Handler.Read_Next; + end Read_SymbolKind_Set; + + package DidChangeConfigurationClientCapabilities_Scope is + package DidChangeConfigurationClientCapabilities_Map is new Minimal_Perfect_Hash + (["dynamicRegistration"]); + + end DidChangeConfigurationClientCapabilities_Scope; + + procedure Read_DidChangeConfigurationClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DidChangeConfigurationClientCapabilities) is + use DidChangeConfigurationClientCapabilities_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case DidChangeConfigurationClientCapabilities_Map.Get_Index + (Key) is + when 1 => -- dynamicRegistration + Value.dynamicRegistration := + (Is_Set => True, + Value => <>); + Value.dynamicRegistration.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_DidChangeConfigurationClientCapabilities; + + package DocumentHighlightRegistrationOptions_Scope is + package DocumentHighlightRegistrationOptions_Map is new Minimal_Perfect_Hash + (["documentSelector", + "workDoneProgress"]); + + end DocumentHighlightRegistrationOptions_Scope; + + procedure Read_DocumentHighlightRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentHighlightRegistrationOptions) is + use DocumentHighlightRegistrationOptions_Scope; + procedure Read_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSelector_Or_Null); + + procedure Read_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSelector_Or_Null) is + begin + if Handler.Is_Null_Value then + Handler.Read_Next; + else + Value := + (Is_Null => False, + Value => <>); + Read_DocumentSelector (Handler, Value.Value); + end if; + end Read_DocumentSelector_Or_Null; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case DocumentHighlightRegistrationOptions_Map.Get_Index (Key) is + when 1 => -- documentSelector + Read_DocumentSelector_Or_Null + (Handler, Value.Parent.documentSelector); + when 2 => -- workDoneProgress + Value.workDoneProgress := + (Is_Set => True, + Value => <>); + Value.workDoneProgress.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_DocumentHighlightRegistrationOptions; + + procedure Read_DeclarationLink + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DeclarationLink) renames + Read_LocationLink; + + procedure Read_T + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.T) is + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + Handler.Skip_Current_Value; + end; + end loop; + + Handler.Read_Next; + end Read_T; + + package FullDocumentDiagnosticReport_Scope is + package FullDocumentDiagnosticReport_Map is new Minimal_Perfect_Hash + (["kind", + "resultId", + "items"]); + + end FullDocumentDiagnosticReport_Scope; + + procedure Read_FullDocumentDiagnosticReport + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.FullDocumentDiagnosticReport) is + use FullDocumentDiagnosticReport_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case FullDocumentDiagnosticReport_Map.Get_Index (Key) is + when 1 => -- kind + Handler.Read_Next; -- Skip string literal: full + when 2 => -- resultId + Value.resultId.Clear; + Value.resultId.Append (Handler.String_Value); + Handler.Read_Next; + when 3 => -- items + Read_Diagnostic_Vector (Handler, Value.items); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_FullDocumentDiagnosticReport; + + package RenameParams_Scope is + package RenameParams_Map is new Minimal_Perfect_Hash + (["workDoneToken", + "textDocument", + "position", + "newName"]); + + end RenameParams_Scope; + + procedure Read_RenameParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.RenameParams) is + use RenameParams_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case RenameParams_Map.Get_Index (Key) is + when 1 => -- workDoneToken + Value.workDoneToken := + (Is_Set => True, + Value => <>); + Read_ProgressToken (Handler, Value.workDoneToken.Value); + when 2 => -- textDocument + Read_TextDocumentIdentifier (Handler, Value.textDocument); + when 3 => -- position + Read_Position (Handler, Value.position); + when 4 => -- newName + Value.newName.Clear; + Value.newName.Append (Handler.String_Value); + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_RenameParams; + + package DocumentSymbolRegistrationOptions_Scope is + package DocumentSymbolRegistrationOptions_Map is new Minimal_Perfect_Hash + (["documentSelector", + "workDoneProgress", + "label"]); + + end DocumentSymbolRegistrationOptions_Scope; + + procedure Read_DocumentSymbolRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSymbolRegistrationOptions) is + use DocumentSymbolRegistrationOptions_Scope; + procedure Read_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSelector_Or_Null); + + procedure Read_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSelector_Or_Null) is + begin + if Handler.Is_Null_Value then + Handler.Read_Next; + else + Value := + (Is_Null => False, + Value => <>); + Read_DocumentSelector (Handler, Value.Value); + end if; + end Read_DocumentSelector_Or_Null; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case DocumentSymbolRegistrationOptions_Map.Get_Index (Key) is + when 1 => -- documentSelector + Read_DocumentSelector_Or_Null + (Handler, Value.Parent.documentSelector); + when 2 => -- workDoneProgress + Value.workDoneProgress := + (Is_Set => True, + Value => <>); + Value.workDoneProgress.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 3 => -- label + Value.label.Clear; + Value.label.Append (Handler.String_Value); + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_DocumentSymbolRegistrationOptions; + + procedure Read_LSPAny_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.LSPAny_Or_Null) is + begin + if Handler.Is_Null_Value then + Handler.Read_Next; + else + Value := + (Is_Null => False, + Value => <>); + Read_LSPAny (Handler, Value.Value); + end if; + end Read_LSPAny_Or_Null; + + package DeclarationRegistrationOptions_Scope is + package DeclarationRegistrationOptions_Map is new Minimal_Perfect_Hash + (["workDoneProgress", + "documentSelector", + "id"]); + + end DeclarationRegistrationOptions_Scope; + + procedure Read_DeclarationRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DeclarationRegistrationOptions) is + use DeclarationRegistrationOptions_Scope; + procedure Read_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSelector_Or_Null); + + procedure Read_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSelector_Or_Null) is + begin + if Handler.Is_Null_Value then + Handler.Read_Next; + else + Value := + (Is_Null => False, + Value => <>); + Read_DocumentSelector (Handler, Value.Value); + end if; + end Read_DocumentSelector_Or_Null; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case DeclarationRegistrationOptions_Map.Get_Index (Key) is + when 1 => -- workDoneProgress + Value.workDoneProgress := + (Is_Set => True, + Value => <>); + Value.workDoneProgress.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 2 => -- documentSelector + Read_DocumentSelector_Or_Null + (Handler, Value.Parent.documentSelector); + when 3 => -- id + Value.id.Clear; + Value.id.Append (Handler.String_Value); + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_DeclarationRegistrationOptions; + + package WorkspaceSymbol_Scope is + package WorkspaceSymbol_Map is new Minimal_Perfect_Hash + (["name", + "kind", + "tags", + "containerName", + "location", + "data"]); + + package Location_Or_Something_Scope is + package Location_Or_Something_Map is new Minimal_Perfect_Hash + (["range", + "uri"]); + + end Location_Or_Something_Scope; + + end WorkspaceSymbol_Scope; + + procedure Read_WorkspaceSymbol + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.WorkspaceSymbol) is + use WorkspaceSymbol_Scope; + procedure Read_Location_Or_Something + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Location_Or_Something); + + procedure Read_Location_Or_Something + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Location_Or_Something) is + use Location_Or_Something_Scope; + begin + declare + Parent : + constant not null access VSS.JSON.Pull_Readers.JSON_Pull_Reader' + Class := + Handler'Access; + Handler : + VSS.JSON.Pull_Readers.Buffered.JSON_Buffered_Pull_Reader + (Parent); + begin + Handler.Mark; + if Handler.Is_Start_Object then + Handler.Read_Next; + Value := + (Is_Location => False, + others => <>); + while Handler.Is_Key_Name loop + declare + Key : constant VSS.Strings.Virtual_String := + Handler.Key_Name; + Index : constant Natural := + Location_Or_Something_Map.Get_Index (Key); + begin + Handler.Read_Next; + case Index is + when 1 => -- range + Value := + (Is_Location => True, + others => <>); + exit; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + else + raise Program_Error; -- Unexpected JSON value + end if; + + Handler.Reset; + Handler.Unmark; + + case Value.Is_Location is + when True => + Read_Location (Handler, Value.Location); + when False => + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while Handler.Is_Key_Name loop + declare + Key : constant VSS.Strings.Virtual_String := + Handler.Key_Name; + begin + Handler.Read_Next; + case Location_Or_Something_Map.Get_Index (Key) is + when 2 => -- uri + Value.uri := + (Handler.String_Value with null record); + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end case; + end; + end Read_Location_Or_Something; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case WorkspaceSymbol_Map.Get_Index (Key) is + when 1 => -- name + Value.name.Clear; + Value.name.Append (Handler.String_Value); + Handler.Read_Next; + when 2 => -- kind + Read_SymbolKind (Handler, Value.kind); + when 3 => -- tags + Read_SymbolTag_Set (Handler, Value.tags); + when 4 => -- containerName + Value.containerName.Clear; + Value.containerName.Append (Handler.String_Value); + Handler.Read_Next; + when 5 => -- location + Read_Location_Or_Something (Handler, Value.location); + when 6 => -- data + Read_LSPAny (Handler, Value.data); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_WorkspaceSymbol; + + package DeleteFileOptions_Scope is + package DeleteFileOptions_Map is new Minimal_Perfect_Hash + (["recursive", + "ignoreIfNotExists"]); + + end DeleteFileOptions_Scope; + + procedure Read_DeleteFileOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DeleteFileOptions) is + use DeleteFileOptions_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case DeleteFileOptions_Map.Get_Index (Key) is + when 1 => -- recursive + Value.recursive := + (Is_Set => True, + Value => <>); + Value.recursive.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 2 => -- ignoreIfNotExists + Value.ignoreIfNotExists := + (Is_Set => True, + Value => <>); + Value.ignoreIfNotExists.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_DeleteFileOptions; + + procedure Read_WatchKind + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.WatchKind) is + begin + Value := + LSP.Enumerations.WatchKind'Val + (Handler.Number_Value.Integer_Value - 1); + Handler.Read_Next; + end Read_WatchKind; + + package TypeHierarchyRegistrationOptions_Scope is + package TypeHierarchyRegistrationOptions_Map is new Minimal_Perfect_Hash + (["documentSelector", + "workDoneProgress", + "id"]); + + end TypeHierarchyRegistrationOptions_Scope; + + procedure Read_TypeHierarchyRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.TypeHierarchyRegistrationOptions) is + use TypeHierarchyRegistrationOptions_Scope; + procedure Read_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSelector_Or_Null); + + procedure Read_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSelector_Or_Null) is + begin + if Handler.Is_Null_Value then + Handler.Read_Next; + else + Value := + (Is_Null => False, + Value => <>); + Read_DocumentSelector (Handler, Value.Value); + end if; + end Read_DocumentSelector_Or_Null; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case TypeHierarchyRegistrationOptions_Map.Get_Index (Key) is + when 1 => -- documentSelector + Read_DocumentSelector_Or_Null + (Handler, Value.Parent.documentSelector); + when 2 => -- workDoneProgress + Value.workDoneProgress := + (Is_Set => True, + Value => <>); + Value.workDoneProgress.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 3 => -- id + Value.id.Clear; + Value.id.Append (Handler.String_Value); + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_TypeHierarchyRegistrationOptions; + + procedure Read_DiagnosticSeverity + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.DiagnosticSeverity) is + begin + Value := + LSP.Enumerations.DiagnosticSeverity'Val + (Handler.Number_Value.Integer_Value - 1); + Handler.Read_Next; + end Read_DiagnosticSeverity; + + procedure Read_LSPAny_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.LSPAny_Vector) is + begin + LSP.Input_Tools.Read_LSPAny_Class (Handler, Value); + end Read_LSPAny_Vector; + + package PrepareRenameParams_Scope is + package PrepareRenameParams_Map is new Minimal_Perfect_Hash + (["textDocument", + "position", + "workDoneToken"]); + + end PrepareRenameParams_Scope; + + procedure Read_PrepareRenameParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.PrepareRenameParams) is + use PrepareRenameParams_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case PrepareRenameParams_Map.Get_Index (Key) is + when 1 => -- textDocument + Read_TextDocumentIdentifier (Handler, Value.textDocument); + when 2 => -- position + Read_Position (Handler, Value.position); + when 3 => -- workDoneToken + Value.workDoneToken := + (Is_Set => True, + Value => <>); + Read_ProgressToken (Handler, Value.workDoneToken.Value); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_PrepareRenameParams; + + procedure Read_CodeActionTriggerKind + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.CodeActionTriggerKind) is + begin + Value := + LSP.Enumerations.CodeActionTriggerKind'Val + (Handler.Number_Value.Integer_Value - 1); + Handler.Read_Next; + end Read_CodeActionTriggerKind; + + package CodeActionClientCapabilities_Scope is + package CodeActionClientCapabilities_Map is new Minimal_Perfect_Hash + (["dynamicRegistration", + "codeActionLiteralSupport", + "isPreferredSupport", + "disabledSupport", + "dataSupport", + "resolveSupport", + "honorsChangeAnnotations"]); + + package codeActionKind_OfcodeActionLiteralSupport_OfCodeActionClientCapabilities_Scope + is + package codeActionKind_OfcodeActionLiteralSupport_OfCodeActionClientCapabilities_Map is new Minimal_Perfect_Hash + (["valueSet"]); + + end codeActionKind_OfcodeActionLiteralSupport_OfCodeActionClientCapabilities_Scope; + + package codeActionLiteralSupport_OfCodeActionClientCapabilities_Scope is + package codeActionLiteralSupport_OfCodeActionClientCapabilities_Map is new Minimal_Perfect_Hash + (["codeActionKind"]); + + end codeActionLiteralSupport_OfCodeActionClientCapabilities_Scope; + + end CodeActionClientCapabilities_Scope; + + procedure Read_CodeActionClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CodeActionClientCapabilities) is + use CodeActionClientCapabilities_Scope; + procedure Read_codeActionKind_OfcodeActionLiteralSupport_OfCodeActionClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .codeActionKind_OfcodeActionLiteralSupport_OfCodeActionClientCapabilities); + + procedure Read_codeActionLiteralSupport_OfCodeActionClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .codeActionLiteralSupport_OfCodeActionClientCapabilities); + + procedure Read_codeActionKind_OfcodeActionLiteralSupport_OfCodeActionClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .codeActionKind_OfcodeActionLiteralSupport_OfCodeActionClientCapabilities) is + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while Handler.Is_Key_Name loop + declare + use + codeActionKind_OfcodeActionLiteralSupport_OfCodeActionClientCapabilities_Scope; + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case codeActionKind_OfcodeActionLiteralSupport_OfCodeActionClientCapabilities_Map + .Get_Index + (Key) is + when 1 => -- valueSet + Read_CodeActionKind_Set (Handler, Value.valueSet); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_codeActionKind_OfcodeActionLiteralSupport_OfCodeActionClientCapabilities; + + procedure Read_codeActionLiteralSupport_OfCodeActionClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .codeActionLiteralSupport_OfCodeActionClientCapabilities) is + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while Handler.Is_Key_Name loop + declare + use + codeActionLiteralSupport_OfCodeActionClientCapabilities_Scope; + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case codeActionLiteralSupport_OfCodeActionClientCapabilities_Map + .Get_Index + (Key) is + when 1 => -- codeActionKind + Read_codeActionKind_OfcodeActionLiteralSupport_OfCodeActionClientCapabilities + (Handler, Value.codeActionKind); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_codeActionLiteralSupport_OfCodeActionClientCapabilities; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case CodeActionClientCapabilities_Map.Get_Index (Key) is + when 1 => -- dynamicRegistration + Value.dynamicRegistration := + (Is_Set => True, + Value => <>); + Value.dynamicRegistration.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 2 => -- codeActionLiteralSupport + Value.codeActionLiteralSupport := + (Is_Set => True, + Value => <>); + Read_codeActionLiteralSupport_OfCodeActionClientCapabilities + (Handler, Value.codeActionLiteralSupport.Value); + when 3 => -- isPreferredSupport + Value.isPreferredSupport := + (Is_Set => True, + Value => <>); + Value.isPreferredSupport.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 4 => -- disabledSupport + Value.disabledSupport := + (Is_Set => True, + Value => <>); + Value.disabledSupport.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 5 => -- dataSupport + Value.dataSupport := + (Is_Set => True, + Value => <>); + Value.dataSupport.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 6 => -- resolveSupport + Value.resolveSupport := + (Is_Set => True, + Value => <>); + Read_resolveSupport_OfWorkspaceSymbolClientCapabilities + (Handler, Value.resolveSupport.Value); + when 7 => -- honorsChangeAnnotations + Value.honorsChangeAnnotations := + (Is_Set => True, + Value => <>); + Value.honorsChangeAnnotations.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_CodeActionClientCapabilities; + + package MarkdownClientCapabilities_Scope is + package MarkdownClientCapabilities_Map is new Minimal_Perfect_Hash + (["parser", + "version", + "allowedTags"]); + + end MarkdownClientCapabilities_Scope; + + procedure Read_MarkdownClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.MarkdownClientCapabilities) is + use MarkdownClientCapabilities_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case MarkdownClientCapabilities_Map.Get_Index (Key) is + when 1 => -- parser + Value.parser.Clear; + Value.parser.Append (Handler.String_Value); + Handler.Read_Next; + when 2 => -- version + Value.version.Clear; + Value.version.Append (Handler.String_Value); + Handler.Read_Next; + when 3 => -- allowedTags + Read_Virtual_String_Vector (Handler, Value.allowedTags); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_MarkdownClientCapabilities; + + package CancelParams_Scope is + package CancelParams_Map is new Minimal_Perfect_Hash (["id"]); + + end CancelParams_Scope; + + procedure Read_CancelParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CancelParams) is + use CancelParams_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case CancelParams_Map.Get_Index (Key) is + when 1 => -- id + Read_Integer_Or_Virtual_String (Handler, Value.id); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_CancelParams; + + procedure Read_DefinitionLink_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DefinitionLink_Vector) is + begin + pragma Assert (Handler.Is_Start_Array); + Handler.Read_Next; + + declare + Set : LSP.Structures.DefinitionLink_Vector renames Value; + Value : LSP.Structures.DefinitionLink; + begin + Set.Clear; + while not Handler.Is_End_Array loop + Read_DefinitionLink (Handler, Value); + Set.Append (Value); + end loop; + end; + + Handler.Read_Next; + end Read_DefinitionLink_Vector; + + package DefinitionParams_Scope is + package DefinitionParams_Map is new Minimal_Perfect_Hash + (["textDocument", + "position", + "workDoneToken", + "partialResultToken"]); + + end DefinitionParams_Scope; + + procedure Read_DefinitionParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DefinitionParams) is + use DefinitionParams_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case DefinitionParams_Map.Get_Index (Key) is + when 1 => -- textDocument + Read_TextDocumentIdentifier (Handler, Value.textDocument); + when 2 => -- position + Read_Position (Handler, Value.position); + when 3 => -- workDoneToken + Value.workDoneToken := + (Is_Set => True, + Value => <>); + Read_ProgressToken (Handler, Value.workDoneToken.Value); + when 4 => -- partialResultToken + Value.partialResultToken := + (Is_Set => True, + Value => <>); + Read_ProgressToken (Handler, Value.partialResultToken.Value); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_DefinitionParams; + + package ImplementationClientCapabilities_Scope is + package ImplementationClientCapabilities_Map is new Minimal_Perfect_Hash + (["dynamicRegistration", + "linkSupport"]); + + end ImplementationClientCapabilities_Scope; + + procedure Read_ImplementationClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ImplementationClientCapabilities) is + use ImplementationClientCapabilities_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case ImplementationClientCapabilities_Map.Get_Index (Key) is + when 1 => -- dynamicRegistration + Value.dynamicRegistration := + (Is_Set => True, + Value => <>); + Value.dynamicRegistration.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 2 => -- linkSupport + Value.linkSupport := + (Is_Set => True, + Value => <>); + Value.linkSupport.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_ImplementationClientCapabilities; + + package TextDocumentItem_Scope is + package TextDocumentItem_Map is new Minimal_Perfect_Hash + (["uri", + "languageId", + "version", + "text"]); + + end TextDocumentItem_Scope; + + procedure Read_TextDocumentItem + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.TextDocumentItem) is + use TextDocumentItem_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case TextDocumentItem_Map.Get_Index (Key) is + when 1 => -- uri + Value.uri := (Handler.String_Value with null record); + Handler.Read_Next; + when 2 => -- languageId + Value.languageId.Clear; + Value.languageId.Append (Handler.String_Value); + Handler.Read_Next; + when 3 => -- version + Value.version := + Integer (Handler.Number_Value.Integer_Value); + Handler.Read_Next; + when 4 => -- text + Value.text.Clear; + Value.text.Append (Handler.String_Value); + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_TextDocumentItem; + + package ColorPresentationParams_Scope is + package ColorPresentationParams_Map is new Minimal_Perfect_Hash + (["workDoneToken", + "partialResultToken", + "textDocument", + "color", + "range"]); + + end ColorPresentationParams_Scope; + + procedure Read_ColorPresentationParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ColorPresentationParams) is + use ColorPresentationParams_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case ColorPresentationParams_Map.Get_Index (Key) is + when 1 => -- workDoneToken + Value.workDoneToken := + (Is_Set => True, + Value => <>); + Read_ProgressToken (Handler, Value.workDoneToken.Value); + when 2 => -- partialResultToken + Value.partialResultToken := + (Is_Set => True, + Value => <>); + Read_ProgressToken (Handler, Value.partialResultToken.Value); + when 3 => -- textDocument + Read_TextDocumentIdentifier (Handler, Value.textDocument); + when 4 => -- color + Read_Color (Handler, Value.color); + when 5 => -- range + Read_A_Range (Handler, Value.a_range); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_ColorPresentationParams; + + procedure Read_ErrorCodes + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.ErrorCodes) is + begin + Value := + LSP.Enumerations.ErrorCodes'Val + (Handler.Number_Value.Integer_Value + 32_700); + Handler.Read_Next; + end Read_ErrorCodes; + + procedure Read_InsertTextFormat + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.InsertTextFormat) is + begin + Value := + LSP.Enumerations.InsertTextFormat'Val + (Handler.Number_Value.Integer_Value - 1); + Handler.Read_Next; + end Read_InsertTextFormat; + + package relatedDocuments_OfDocumentDiagnosticReportPartialResult_Item_Scope + is + package relatedDocuments_OfDocumentDiagnosticReportPartialResult_Item_Map is new Minimal_Perfect_Hash + (["full", + "unchanged"]); + + end relatedDocuments_OfDocumentDiagnosticReportPartialResult_Item_Scope; + + procedure Read_relatedDocuments_OfDocumentDiagnosticReportPartialResult_Item + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .relatedDocuments_OfDocumentDiagnosticReportPartialResult_Item) is + use relatedDocuments_OfDocumentDiagnosticReportPartialResult_Item_Scope; + begin + declare + Parent : + constant not null access VSS.JSON.Pull_Readers.JSON_Pull_Reader' + Class := + Handler'Access; + Handler : + VSS.JSON.Pull_Readers.Buffered.JSON_Buffered_Pull_Reader (Parent); + Kind : Natural; + begin + Handler.Mark; + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + while Handler.Is_Key_Name loop + declare + use type VSS.Strings.Virtual_String; + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + if Key = "kind" then + pragma Assert (Handler.Is_String_Value); + Kind := + relatedDocuments_OfDocumentDiagnosticReportPartialResult_Item_Map + .Get_Index + (Handler.String_Value); + case Kind is + when 1 => -- full + Value := + (Kind => LSP.Structures.full, + others => <>); + when 2 => -- unchanged + Value := + (Kind => LSP.Structures.unchanged, + others => <>); + when others => + raise Constraint_Error; + end case; + exit; + else + Handler.Skip_Current_Value; + end if; + end; + end loop; + + Handler.Reset; + Handler.Unmark; + + case Value.Kind is + when LSP.Structures.full => + Read_FullDocumentDiagnosticReport (Handler, Value.full); + when LSP.Structures.unchanged => + Read_UnchangedDocumentDiagnosticReport + (Handler, Value.unchanged); + end case; + end; + end Read_relatedDocuments_OfDocumentDiagnosticReportPartialResult_Item; + + package ExecuteCommandClientCapabilities_Scope is + package ExecuteCommandClientCapabilities_Map is new Minimal_Perfect_Hash + (["dynamicRegistration"]); + + end ExecuteCommandClientCapabilities_Scope; + + procedure Read_ExecuteCommandClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ExecuteCommandClientCapabilities) is + use ExecuteCommandClientCapabilities_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case ExecuteCommandClientCapabilities_Map.Get_Index (Key) is + when 1 => -- dynamicRegistration + Value.dynamicRegistration := + (Is_Set => True, + Value => <>); + Value.dynamicRegistration.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_ExecuteCommandClientCapabilities; + + procedure Read_FoldingRange_Vector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.FoldingRange_Vector_Or_Null) is + begin + if Handler.Is_Null_Value then + Handler.Read_Next; + else + Value.Clear; + Read_FoldingRange_Vector (Handler, Value); + end if; + end Read_FoldingRange_Vector_Or_Null; + + procedure Read_CallHierarchyItem_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CallHierarchyItem_Vector) is + begin + pragma Assert (Handler.Is_Start_Array); + Handler.Read_Next; + + declare + Set : LSP.Structures.CallHierarchyItem_Vector renames Value; + Value : LSP.Structures.CallHierarchyItem; + begin + Set.Clear; + while not Handler.Is_End_Array loop + Read_CallHierarchyItem (Handler, Value); + Set.Append (Value); + end loop; + end; + + Handler.Read_Next; + end Read_CallHierarchyItem_Vector; + + package DeleteFile_Scope is + package DeleteFile_Map is new Minimal_Perfect_Hash + (["kind", + "annotationId", + "uri", + "options"]); + + end DeleteFile_Scope; + + procedure Read_DeleteFile + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DeleteFile) is + use DeleteFile_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case DeleteFile_Map.Get_Index (Key) is + when 2 => -- annotationId + Value.annotationId := + (Is_Set => True, + Value => <>); + Read_ChangeAnnotationIdentifier + (Handler, Value.annotationId.Value); + when 1 => -- kind + Handler.Read_Next; -- Skip string literal: delete + when 3 => -- uri + Value.uri := (Handler.String_Value with null record); + Handler.Read_Next; + when 4 => -- options + Value.options := + (Is_Set => True, + Value => <>); + Read_DeleteFileOptions (Handler, Value.options.Value); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_DeleteFile; + + package SaveOptions_Scope is + package SaveOptions_Map is new Minimal_Perfect_Hash (["includeText"]); + + end SaveOptions_Scope; + + procedure Read_SaveOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SaveOptions) is + use SaveOptions_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case SaveOptions_Map.Get_Index (Key) is + when 1 => -- includeText + Value.includeText := + (Is_Set => True, + Value => <>); + Value.includeText.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_SaveOptions; + + package NotebookDocument_Scope is + package NotebookDocument_Map is new Minimal_Perfect_Hash + (["uri", + "notebookType", + "version", + "metadata", + "cells"]); + + end NotebookDocument_Scope; + + procedure Read_NotebookDocument + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.NotebookDocument) is + use NotebookDocument_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case NotebookDocument_Map.Get_Index (Key) is + when 1 => -- uri + Read_URI (Handler, Value.uri); + when 2 => -- notebookType + Value.notebookType.Clear; + Value.notebookType.Append (Handler.String_Value); + Handler.Read_Next; + when 3 => -- version + Value.version := + Integer (Handler.Number_Value.Integer_Value); + Handler.Read_Next; + when 4 => -- metadata + Value.metadata := + (Is_Set => True, + Value => <>); + Read_LSPObject (Handler, Value.metadata.Value); + when 5 => -- cells + Read_NotebookCell_Vector (Handler, Value.cells); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_NotebookDocument; + + package RelatedFullDocumentDiagnosticReport_Scope is + package RelatedFullDocumentDiagnosticReport_Map is new Minimal_Perfect_Hash + (["kind", + "resultId", + "items", + "relatedDocuments"]); + + end RelatedFullDocumentDiagnosticReport_Scope; + + procedure Read_RelatedFullDocumentDiagnosticReport + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.RelatedFullDocumentDiagnosticReport) is + use RelatedFullDocumentDiagnosticReport_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case RelatedFullDocumentDiagnosticReport_Map.Get_Index (Key) is + when 1 => -- kind + Handler.Read_Next; -- Skip string literal: full + when 2 => -- resultId + Value.resultId.Clear; + Value.resultId.Append (Handler.String_Value); + Handler.Read_Next; + when 3 => -- items + Read_Diagnostic_Vector (Handler, Value.items); + when 4 => -- relatedDocuments + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + declare + Map : + LSP.Structures + .relatedDocuments_OfDocumentDiagnosticReportPartialResult renames + Value.relatedDocuments; + Key : LSP.Structures.DocumentUri; + Value : + LSP.Structures + .relatedDocuments_OfDocumentDiagnosticReportPartialResult_Item; + begin + Key := (Handler.Key_Name with null record); + Handler.Read_Next; + Read_relatedDocuments_OfDocumentDiagnosticReportPartialResult_Item + (Handler, Value); + Map.Insert (Key, Value); + end; + end loop; + + Handler.Read_Next; + + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_RelatedFullDocumentDiagnosticReport; + + package CodeLensClientCapabilities_Scope is + package CodeLensClientCapabilities_Map is new Minimal_Perfect_Hash + (["dynamicRegistration"]); + + end CodeLensClientCapabilities_Scope; + + procedure Read_CodeLensClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CodeLensClientCapabilities) is + use CodeLensClientCapabilities_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case CodeLensClientCapabilities_Map.Get_Index (Key) is + when 1 => -- dynamicRegistration + Value.dynamicRegistration := + (Is_Set => True, + Value => <>); + Value.dynamicRegistration.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_CodeLensClientCapabilities; + + package DocumentSymbolOptions_Scope is + package DocumentSymbolOptions_Map is new Minimal_Perfect_Hash + (["workDoneProgress", + "label"]); + + end DocumentSymbolOptions_Scope; + + procedure Read_DocumentSymbolOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSymbolOptions) is + use DocumentSymbolOptions_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case DocumentSymbolOptions_Map.Get_Index (Key) is + when 1 => -- workDoneProgress + Value.workDoneProgress := + (Is_Set => True, + Value => <>); + Value.workDoneProgress.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 2 => -- label + Value.label.Clear; + Value.label.Append (Handler.String_Value); + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_DocumentSymbolOptions; + + package CompletionRegistrationOptions_Scope is + package CompletionRegistrationOptions_Map is new Minimal_Perfect_Hash + (["documentSelector", + "workDoneProgress", + "triggerCharacters", + "allCommitCharacters", + "resolveProvider", + "completionItem"]); + + package completionItem_OfCompletionOptions_Scope is + package completionItem_OfCompletionOptions_Map is new Minimal_Perfect_Hash + (["labelDetailsSupport"]); + + end completionItem_OfCompletionOptions_Scope; + + end CompletionRegistrationOptions_Scope; + + procedure Read_CompletionRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CompletionRegistrationOptions) is + use CompletionRegistrationOptions_Scope; + procedure Read_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSelector_Or_Null); + + procedure Read_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSelector_Or_Null) is + begin + if Handler.Is_Null_Value then + Handler.Read_Next; + else + Value := + (Is_Null => False, + Value => <>); + Read_DocumentSelector (Handler, Value.Value); + end if; + end Read_DocumentSelector_Or_Null; + + procedure Read_completionItem_OfCompletionOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.completionItem_OfCompletionOptions); + + procedure Read_completionItem_OfCompletionOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.completionItem_OfCompletionOptions) is + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while Handler.Is_Key_Name loop + declare + use completionItem_OfCompletionOptions_Scope; + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case completionItem_OfCompletionOptions_Map.Get_Index (Key) is + when 1 => -- labelDetailsSupport + Value.labelDetailsSupport := + (Is_Set => True, + Value => <>); + Value.labelDetailsSupport.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_completionItem_OfCompletionOptions; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case CompletionRegistrationOptions_Map.Get_Index (Key) is + when 1 => -- documentSelector + Read_DocumentSelector_Or_Null + (Handler, Value.Parent.documentSelector); + when 2 => -- workDoneProgress + Value.workDoneProgress := + (Is_Set => True, + Value => <>); + Value.workDoneProgress.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 3 => -- triggerCharacters + Read_Virtual_String_Vector + (Handler, Value.triggerCharacters); + when 4 => -- allCommitCharacters + Read_Virtual_String_Vector + (Handler, Value.allCommitCharacters); + when 5 => -- resolveProvider + Value.resolveProvider := + (Is_Set => True, + Value => <>); + Value.resolveProvider.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 6 => -- completionItem + Value.completionItem := + (Is_Set => True, + Value => <>); + Read_completionItem_OfCompletionOptions + (Handler, Value.completionItem.Value); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_CompletionRegistrationOptions; + + package InlayHintClientCapabilities_Scope is + package InlayHintClientCapabilities_Map is new Minimal_Perfect_Hash + (["dynamicRegistration", + "resolveSupport"]); + + end InlayHintClientCapabilities_Scope; + + procedure Read_InlayHintClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.InlayHintClientCapabilities) is + use InlayHintClientCapabilities_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case InlayHintClientCapabilities_Map.Get_Index (Key) is + when 1 => -- dynamicRegistration + Value.dynamicRegistration := + (Is_Set => True, + Value => <>); + Value.dynamicRegistration.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 2 => -- resolveSupport + Value.resolveSupport := + (Is_Set => True, + Value => <>); + Read_resolveSupport_OfWorkspaceSymbolClientCapabilities + (Handler, Value.resolveSupport.Value); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_InlayHintClientCapabilities; + + package ReferenceContext_Scope is + package ReferenceContext_Map is new Minimal_Perfect_Hash + (["includeDeclaration"]); + + end ReferenceContext_Scope; + + procedure Read_ReferenceContext + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ReferenceContext) is + use ReferenceContext_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case ReferenceContext_Map.Get_Index (Key) is + when 1 => -- includeDeclaration + Value.includeDeclaration := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_ReferenceContext; + + package WorkspaceEditClientCapabilities_Scope is + package WorkspaceEditClientCapabilities_Map is new Minimal_Perfect_Hash + (["documentChanges", + "resourceOperations", + "failureHandling", + "normalizesLineEndings", + "changeAnnotationSupport"]); + + package changeAnnotationSupport_OfWorkspaceEditClientCapabilities_Scope + is + package changeAnnotationSupport_OfWorkspaceEditClientCapabilities_Map is new Minimal_Perfect_Hash + (["groupsOnLabel"]); + + end changeAnnotationSupport_OfWorkspaceEditClientCapabilities_Scope; + + end WorkspaceEditClientCapabilities_Scope; + + procedure Read_WorkspaceEditClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.WorkspaceEditClientCapabilities) is + use WorkspaceEditClientCapabilities_Scope; + procedure Read_ResourceOperationKind_Set + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ResourceOperationKind_Set); + + procedure Read_changeAnnotationSupport_OfWorkspaceEditClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .changeAnnotationSupport_OfWorkspaceEditClientCapabilities); + + procedure Read_ResourceOperationKind_Set + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ResourceOperationKind_Set) is + begin + pragma Assert (Handler.Is_Start_Array); + Handler.Read_Next; + + declare + Set : LSP.Structures.ResourceOperationKind_Set renames Value; + Value : LSP.Enumerations.ResourceOperationKind; + begin + Set := (others => False); + while not Handler.Is_End_Array loop + Read_ResourceOperationKind (Handler, Value); + Set (Value) := True; + end loop; + end; + + Handler.Read_Next; + end Read_ResourceOperationKind_Set; + + procedure Read_changeAnnotationSupport_OfWorkspaceEditClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .changeAnnotationSupport_OfWorkspaceEditClientCapabilities) is + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while Handler.Is_Key_Name loop + declare + use + changeAnnotationSupport_OfWorkspaceEditClientCapabilities_Scope; + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case changeAnnotationSupport_OfWorkspaceEditClientCapabilities_Map + .Get_Index + (Key) is + when 1 => -- groupsOnLabel + Value.groupsOnLabel := + (Is_Set => True, + Value => <>); + Value.groupsOnLabel.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_changeAnnotationSupport_OfWorkspaceEditClientCapabilities; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case WorkspaceEditClientCapabilities_Map.Get_Index (Key) is + when 1 => -- documentChanges + Value.documentChanges := + (Is_Set => True, + Value => <>); + Value.documentChanges.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 2 => -- resourceOperations + Read_ResourceOperationKind_Set + (Handler, Value.resourceOperations); + when 3 => -- failureHandling + Value.failureHandling := + (Is_Set => True, + Value => <>); + Read_FailureHandlingKind + (Handler, Value.failureHandling.Value); + when 4 => -- normalizesLineEndings + Value.normalizesLineEndings := + (Is_Set => True, + Value => <>); + Value.normalizesLineEndings.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 5 => -- changeAnnotationSupport + Value.changeAnnotationSupport := + (Is_Set => True, + Value => <>); + Read_changeAnnotationSupport_OfWorkspaceEditClientCapabilities + (Handler, Value.changeAnnotationSupport.Value); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_WorkspaceEditClientCapabilities; + + package WorkspaceSymbolOptions_Scope is + package WorkspaceSymbolOptions_Map is new Minimal_Perfect_Hash + (["workDoneProgress", + "resolveProvider"]); + + end WorkspaceSymbolOptions_Scope; + + procedure Read_WorkspaceSymbolOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.WorkspaceSymbolOptions) is + use WorkspaceSymbolOptions_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case WorkspaceSymbolOptions_Map.Get_Index (Key) is + when 1 => -- workDoneProgress + Value.workDoneProgress := + (Is_Set => True, + Value => <>); + Value.workDoneProgress.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 2 => -- resolveProvider + Value.resolveProvider := + (Is_Set => True, + Value => <>); + Value.resolveProvider.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_WorkspaceSymbolOptions; + + procedure Read_MessageActionItem_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.MessageActionItem_Or_Null) is + begin + if Handler.Is_Null_Value then + Handler.Read_Next; + else + Value := + (Is_Null => False, + Value => <>); + Read_MessageActionItem (Handler, Value.Value); + end if; + end Read_MessageActionItem_Or_Null; + + package ChangeAnnotation_Scope is + package ChangeAnnotation_Map is new Minimal_Perfect_Hash + (["label", + "needsConfirmation", + "description"]); + + end ChangeAnnotation_Scope; + + procedure Read_ChangeAnnotation + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ChangeAnnotation) is + use ChangeAnnotation_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case ChangeAnnotation_Map.Get_Index (Key) is + when 1 => -- label + Value.label.Clear; + Value.label.Append (Handler.String_Value); + Handler.Read_Next; + when 2 => -- needsConfirmation + Value.needsConfirmation := + (Is_Set => True, + Value => <>); + Value.needsConfirmation.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 3 => -- description + Value.description.Clear; + Value.description.Append (Handler.String_Value); + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_ChangeAnnotation; + + package FileOperationPatternOptions_Scope is + package FileOperationPatternOptions_Map is new Minimal_Perfect_Hash + (["ignoreCase"]); + + end FileOperationPatternOptions_Scope; + + procedure Read_FileOperationPatternOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.FileOperationPatternOptions) is + use FileOperationPatternOptions_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case FileOperationPatternOptions_Map.Get_Index (Key) is + when 1 => -- ignoreCase + Value.ignoreCase := + (Is_Set => True, + Value => <>); + Value.ignoreCase.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_FileOperationPatternOptions; + + package VersionedTextDocumentIdentifier_Scope is + package VersionedTextDocumentIdentifier_Map is new Minimal_Perfect_Hash + (["uri", + "version"]); + + end VersionedTextDocumentIdentifier_Scope; + + procedure Read_VersionedTextDocumentIdentifier + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.VersionedTextDocumentIdentifier) is + use VersionedTextDocumentIdentifier_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case VersionedTextDocumentIdentifier_Map.Get_Index (Key) is + when 1 => -- uri + Value.uri := (Handler.String_Value with null record); + Handler.Read_Next; + when 2 => -- version + Value.version := + Integer (Handler.Number_Value.Integer_Value); + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_VersionedTextDocumentIdentifier; + + package SemanticTokensDelta_Scope is + package SemanticTokensDelta_Map is new Minimal_Perfect_Hash + (["resultId", + "edits"]); + + end SemanticTokensDelta_Scope; + + procedure Read_SemanticTokensDelta + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SemanticTokensDelta) is + use SemanticTokensDelta_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case SemanticTokensDelta_Map.Get_Index (Key) is + when 1 => -- resultId + Value.resultId.Clear; + Value.resultId.Append (Handler.String_Value); + Handler.Read_Next; + when 2 => -- edits + Read_SemanticTokensEdit_Vector (Handler, Value.edits); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_SemanticTokensDelta; + + package ShowDocumentClientCapabilities_Scope is + package ShowDocumentClientCapabilities_Map is new Minimal_Perfect_Hash + (["support"]); + + end ShowDocumentClientCapabilities_Scope; + + procedure Read_ShowDocumentClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ShowDocumentClientCapabilities) is + use ShowDocumentClientCapabilities_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case ShowDocumentClientCapabilities_Map.Get_Index (Key) is + when 1 => -- support + Value.support := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_ShowDocumentClientCapabilities; + + package ApplyWorkspaceEditParams_Scope is + package ApplyWorkspaceEditParams_Map is new Minimal_Perfect_Hash + (["label", + "edit"]); + + end ApplyWorkspaceEditParams_Scope; + + procedure Read_ApplyWorkspaceEditParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ApplyWorkspaceEditParams) is + use ApplyWorkspaceEditParams_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case ApplyWorkspaceEditParams_Map.Get_Index (Key) is + when 1 => -- label + Value.label.Clear; + Value.label.Append (Handler.String_Value); + Handler.Read_Next; + when 2 => -- edit + Read_WorkspaceEdit (Handler, Value.edit); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_ApplyWorkspaceEditParams; + + package InlayHintLabelPart_Scope is + package InlayHintLabelPart_Map is new Minimal_Perfect_Hash + (["value", + "tooltip", + "location", + "command"]); + + end InlayHintLabelPart_Scope; + + procedure Read_InlayHintLabelPart + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.InlayHintLabelPart) is + use InlayHintLabelPart_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case InlayHintLabelPart_Map.Get_Index (Key) is + when 1 => -- value + Value.value.Clear; + Value.value.Append (Handler.String_Value); + Handler.Read_Next; + when 2 => -- tooltip + Value.tooltip := + (Is_Set => True, + Value => <>); + Read_Virtual_String_Or_MarkupContent + (Handler, Value.tooltip.Value); + when 3 => -- location + Value.location := + (Is_Set => True, + Value => <>); + Read_Location (Handler, Value.location.Value); + when 4 => -- command + Value.command := + (Is_Set => True, + Value => <>); + Read_Command (Handler, Value.command.Value); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_InlayHintLabelPart; + + package SelectionRangeOptions_Scope is + package SelectionRangeOptions_Map is new Minimal_Perfect_Hash + (["workDoneProgress"]); + + end SelectionRangeOptions_Scope; + + procedure Read_SelectionRangeOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SelectionRangeOptions) is + use SelectionRangeOptions_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case SelectionRangeOptions_Map.Get_Index (Key) is + when 1 => -- workDoneProgress + Value.workDoneProgress := + (Is_Set => True, + Value => <>); + Value.workDoneProgress.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_SelectionRangeOptions; + + package LocationLink_Scope is + package LocationLink_Map is new Minimal_Perfect_Hash + (["originSelectionRange", + "targetUri", + "targetRange", + "targetSelectionRange"]); + + end LocationLink_Scope; + + procedure Read_LocationLink + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.LocationLink) is + use LocationLink_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case LocationLink_Map.Get_Index (Key) is + when 1 => -- originSelectionRange + Value.originSelectionRange := + (Is_Set => True, + Value => <>); + Read_A_Range (Handler, Value.originSelectionRange.Value); + when 2 => -- targetUri + Value.targetUri := (Handler.String_Value with null record); + Handler.Read_Next; + when 3 => -- targetRange + Read_A_Range (Handler, Value.targetRange); + when 4 => -- targetSelectionRange + Read_A_Range (Handler, Value.targetSelectionRange); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_LocationLink; + + package CompletionList_Scope is + package CompletionList_Map is new Minimal_Perfect_Hash + (["isIncomplete", + "itemDefaults", + "items"]); + + package itemDefaults_OfCompletionList_Scope is + package itemDefaults_OfCompletionList_Map is new Minimal_Perfect_Hash + (["commitCharacters", + "editRange", + "insertTextFormat", + "insertTextMode", + "data"]); + + end itemDefaults_OfCompletionList_Scope; + + package Range_Or_Something_Scope is + package Range_Or_Something_Map is new Minimal_Perfect_Hash + (["start", + "end", + "insert", + "replace"]); + + end Range_Or_Something_Scope; + + end CompletionList_Scope; + + procedure Read_CompletionList + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CompletionList) is + use CompletionList_Scope; + procedure Read_itemDefaults_OfCompletionList + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.itemDefaults_OfCompletionList); + + procedure Read_Range_Or_Something + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Range_Or_Something); + + procedure Read_itemDefaults_OfCompletionList + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.itemDefaults_OfCompletionList) is + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while Handler.Is_Key_Name loop + declare + use itemDefaults_OfCompletionList_Scope; + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case itemDefaults_OfCompletionList_Map.Get_Index (Key) is + when 1 => -- commitCharacters + Read_Virtual_String_Vector + (Handler, Value.commitCharacters); + when 2 => -- editRange + Value.editRange := + (Is_Set => True, + Value => <>); + Read_Range_Or_Something (Handler, Value.editRange.Value); + when 3 => -- insertTextFormat + Value.insertTextFormat := + (Is_Set => True, + Value => <>); + Read_InsertTextFormat + (Handler, Value.insertTextFormat.Value); + when 4 => -- insertTextMode + Value.insertTextMode := + (Is_Set => True, + Value => <>); + Read_InsertTextMode (Handler, Value.insertTextMode.Value); + when 5 => -- data + Read_LSPAny (Handler, Value.data); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_itemDefaults_OfCompletionList; + + procedure Read_Range_Or_Something + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Range_Or_Something) is + use Range_Or_Something_Scope; + begin + declare + Parent : + constant not null access VSS.JSON.Pull_Readers.JSON_Pull_Reader' + Class := + Handler'Access; + Handler : + VSS.JSON.Pull_Readers.Buffered.JSON_Buffered_Pull_Reader + (Parent); + begin + Handler.Mark; + if Handler.Is_Start_Object then + Handler.Read_Next; + while Handler.Is_Key_Name loop + declare + Key : constant VSS.Strings.Virtual_String := + Handler.Key_Name; + Index : constant Natural := + Range_Or_Something_Map.Get_Index (Key); + begin + Handler.Read_Next; + case Index is + when 1 => -- start + Value := + (Is_A_Range => True, + others => <>); + exit; + when 2 => -- end + Value := + (Is_A_Range => True, + others => <>); + exit; + when 3 => -- insert + Value := + (Is_A_Range => False, + others => <>); + exit; + when 4 => -- replace + Value := + (Is_A_Range => False, + others => <>); + exit; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + else + raise Program_Error; -- Unexpected JSON value + end if; + + Handler.Reset; + Handler.Unmark; + + case Value.Is_A_Range is + when True => + Read_A_Range (Handler, Value.A_Range); + when False => + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while Handler.Is_Key_Name loop + declare + Key : constant VSS.Strings.Virtual_String := + Handler.Key_Name; + begin + Handler.Read_Next; + case Range_Or_Something_Map.Get_Index (Key) is + when 3 => -- insert + Read_A_Range (Handler, Value.insert); + when 4 => -- replace + Read_A_Range (Handler, Value.replace); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end case; + end; + end Read_Range_Or_Something; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case CompletionList_Map.Get_Index (Key) is + when 1 => -- isIncomplete + Value.isIncomplete := Handler.Boolean_Value; + Handler.Read_Next; + when 2 => -- itemDefaults + Value.itemDefaults := + (Is_Set => True, + Value => <>); + Read_itemDefaults_OfCompletionList + (Handler, Value.itemDefaults.Value); + when 3 => -- items + Read_CompletionItem_Vector (Handler, Value.items); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_CompletionList; + + package DiagnosticRegistrationOptions_Scope is + package DiagnosticRegistrationOptions_Map is new Minimal_Perfect_Hash + (["documentSelector", + "workDoneProgress", + "identifier", + "interFileDependencies", + "workspaceDiagnostics", + "id"]); + + end DiagnosticRegistrationOptions_Scope; + + procedure Read_DiagnosticRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DiagnosticRegistrationOptions) is + use DiagnosticRegistrationOptions_Scope; + procedure Read_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSelector_Or_Null); + + procedure Read_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSelector_Or_Null) is + begin + if Handler.Is_Null_Value then + Handler.Read_Next; + else + Value := + (Is_Null => False, + Value => <>); + Read_DocumentSelector (Handler, Value.Value); + end if; + end Read_DocumentSelector_Or_Null; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case DiagnosticRegistrationOptions_Map.Get_Index (Key) is + when 1 => -- documentSelector + Read_DocumentSelector_Or_Null + (Handler, Value.Parent.documentSelector); + when 2 => -- workDoneProgress + Value.workDoneProgress := + (Is_Set => True, + Value => <>); + Value.workDoneProgress.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 3 => -- identifier + Value.identifier.Clear; + Value.identifier.Append (Handler.String_Value); + Handler.Read_Next; + when 4 => -- interFileDependencies + Value.interFileDependencies := Handler.Boolean_Value; + Handler.Read_Next; + when 5 => -- workspaceDiagnostics + Value.workspaceDiagnostics := Handler.Boolean_Value; + Handler.Read_Next; + when 6 => -- id + Value.id.Clear; + Value.id.Append (Handler.String_Value); + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_DiagnosticRegistrationOptions; + + procedure Read_SignatureHelpTriggerKind + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.SignatureHelpTriggerKind) is + begin + Value := + LSP.Enumerations.SignatureHelpTriggerKind'Val + (Handler.Number_Value.Integer_Value - 1); + Handler.Read_Next; + end Read_SignatureHelpTriggerKind; + + package CodeAction_Scope is + package CodeAction_Map is new Minimal_Perfect_Hash + (["title", + "kind", + "diagnostics", + "isPreferred", + "disabled", + "edit", + "command", + "data"]); + + package disabled_OfCodeAction_Scope is + package disabled_OfCodeAction_Map is new Minimal_Perfect_Hash + (["reason"]); + + end disabled_OfCodeAction_Scope; + + end CodeAction_Scope; + + procedure Read_CodeAction + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CodeAction) is + use CodeAction_Scope; + procedure Read_disabled_OfCodeAction + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.disabled_OfCodeAction); + + procedure Read_disabled_OfCodeAction + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.disabled_OfCodeAction) is + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while Handler.Is_Key_Name loop + declare + use disabled_OfCodeAction_Scope; + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case disabled_OfCodeAction_Map.Get_Index (Key) is + when 1 => -- reason + Value.reason.Clear; + Value.reason.Append (Handler.String_Value); + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_disabled_OfCodeAction; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case CodeAction_Map.Get_Index (Key) is + when 1 => -- title + Value.title.Clear; + Value.title.Append (Handler.String_Value); + Handler.Read_Next; + when 2 => -- kind + Value.kind := + (Is_Set => True, + Value => <>); + Read_CodeActionKind (Handler, Value.kind.Value); + when 3 => -- diagnostics + Read_Diagnostic_Vector (Handler, Value.diagnostics); + when 4 => -- isPreferred + Value.isPreferred := + (Is_Set => True, + Value => <>); + Value.isPreferred.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 5 => -- disabled + Value.disabled := + (Is_Set => True, + Value => <>); + Read_disabled_OfCodeAction (Handler, Value.disabled.Value); + when 6 => -- edit + Value.edit := + (Is_Set => True, + Value => <>); + Read_WorkspaceEdit (Handler, Value.edit.Value); + when 7 => -- command + Value.command := + (Is_Set => True, + Value => <>); + Read_Command (Handler, Value.command.Value); + when 8 => -- data + Read_LSPAny (Handler, Value.data); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_CodeAction; + + procedure Read_InlayHint_Vector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.InlayHint_Vector_Or_Null) is + begin + if Handler.Is_Null_Value then + Handler.Read_Next; + else + Value.Clear; + Read_InlayHint_Vector (Handler, Value); + end if; + end Read_InlayHint_Vector_Or_Null; + + package DeclarationParams_Scope is + package DeclarationParams_Map is new Minimal_Perfect_Hash + (["textDocument", + "position", + "workDoneToken", + "partialResultToken"]); + + end DeclarationParams_Scope; + + procedure Read_DeclarationParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DeclarationParams) is + use DeclarationParams_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case DeclarationParams_Map.Get_Index (Key) is + when 1 => -- textDocument + Read_TextDocumentIdentifier (Handler, Value.textDocument); + when 2 => -- position + Read_Position (Handler, Value.position); + when 3 => -- workDoneToken + Value.workDoneToken := + (Is_Set => True, + Value => <>); + Read_ProgressToken (Handler, Value.workDoneToken.Value); + when 4 => -- partialResultToken + Value.partialResultToken := + (Is_Set => True, + Value => <>); + Read_ProgressToken (Handler, Value.partialResultToken.Value); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_DeclarationParams; + + package DocumentRangeFormattingParams_Scope is + package DocumentRangeFormattingParams_Map is new Minimal_Perfect_Hash + (["workDoneToken", + "textDocument", + "range", + "options"]); + + end DocumentRangeFormattingParams_Scope; + + procedure Read_DocumentRangeFormattingParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentRangeFormattingParams) is + use DocumentRangeFormattingParams_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case DocumentRangeFormattingParams_Map.Get_Index (Key) is + when 1 => -- workDoneToken + Value.workDoneToken := + (Is_Set => True, + Value => <>); + Read_ProgressToken (Handler, Value.workDoneToken.Value); + when 2 => -- textDocument + Read_TextDocumentIdentifier (Handler, Value.textDocument); + when 3 => -- range + Read_A_Range (Handler, Value.a_range); + when 4 => -- options + Read_FormattingOptions (Handler, Value.options); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_DocumentRangeFormattingParams; + + package TypeHierarchyClientCapabilities_Scope is + package TypeHierarchyClientCapabilities_Map is new Minimal_Perfect_Hash + (["dynamicRegistration"]); + + end TypeHierarchyClientCapabilities_Scope; + + procedure Read_TypeHierarchyClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.TypeHierarchyClientCapabilities) is + use TypeHierarchyClientCapabilities_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case TypeHierarchyClientCapabilities_Map.Get_Index (Key) is + when 1 => -- dynamicRegistration + Value.dynamicRegistration := + (Is_Set => True, + Value => <>); + Value.dynamicRegistration.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_TypeHierarchyClientCapabilities; + + package DocumentOnTypeFormattingOptions_Scope is + package DocumentOnTypeFormattingOptions_Map is new Minimal_Perfect_Hash + (["firstTriggerCharacter", + "moreTriggerCharacter"]); + + end DocumentOnTypeFormattingOptions_Scope; + + procedure Read_DocumentOnTypeFormattingOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentOnTypeFormattingOptions) is + use DocumentOnTypeFormattingOptions_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case DocumentOnTypeFormattingOptions_Map.Get_Index (Key) is + when 1 => -- firstTriggerCharacter + Value.firstTriggerCharacter.Clear; + Value.firstTriggerCharacter.Append (Handler.String_Value); + Handler.Read_Next; + when 2 => -- moreTriggerCharacter + Read_Virtual_String_Vector + (Handler, Value.moreTriggerCharacter); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_DocumentOnTypeFormattingOptions; + + package WorkspaceSymbolRegistrationOptions_Scope is + package WorkspaceSymbolRegistrationOptions_Map is new Minimal_Perfect_Hash + (["workDoneProgress", + "resolveProvider"]); + + end WorkspaceSymbolRegistrationOptions_Scope; + + procedure Read_WorkspaceSymbolRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.WorkspaceSymbolRegistrationOptions) is + use WorkspaceSymbolRegistrationOptions_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case WorkspaceSymbolRegistrationOptions_Map.Get_Index (Key) is + when 1 => -- workDoneProgress + Value.workDoneProgress := + (Is_Set => True, + Value => <>); + Value.workDoneProgress.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 2 => -- resolveProvider + Value.resolveProvider := + (Is_Set => True, + Value => <>); + Value.resolveProvider.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_WorkspaceSymbolRegistrationOptions; + + package MonikerParams_Scope is + package MonikerParams_Map is new Minimal_Perfect_Hash + (["textDocument", + "position", + "workDoneToken", + "partialResultToken"]); + + end MonikerParams_Scope; + + procedure Read_MonikerParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.MonikerParams) is + use MonikerParams_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case MonikerParams_Map.Get_Index (Key) is + when 1 => -- textDocument + Read_TextDocumentIdentifier (Handler, Value.textDocument); + when 2 => -- position + Read_Position (Handler, Value.position); + when 3 => -- workDoneToken + Value.workDoneToken := + (Is_Set => True, + Value => <>); + Read_ProgressToken (Handler, Value.workDoneToken.Value); + when 4 => -- partialResultToken + Value.partialResultToken := + (Is_Set => True, + Value => <>); + Read_ProgressToken (Handler, Value.partialResultToken.Value); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_MonikerParams; + + package InlayHint_Scope is + package InlayHint_Map is new Minimal_Perfect_Hash + (["position", + "label", + "kind", + "textEdits", + "tooltip", + "paddingLeft", + "paddingRight", + "data"]); + + end InlayHint_Scope; + + procedure Read_InlayHint + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.InlayHint) is + use InlayHint_Scope; + procedure Read_Virtual_String_Or_InlayHintLabelPart_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .Virtual_String_Or_InlayHintLabelPart_Vector); + + procedure Read_InlayHintLabelPart_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.InlayHintLabelPart_Vector); + + procedure Read_Virtual_String_Or_InlayHintLabelPart_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .Virtual_String_Or_InlayHintLabelPart_Vector) is + begin + if Handler.Is_String_Value then + Value := + (Is_Virtual_String => True, + others => <>); + else + Value := + (Is_Virtual_String => False, + others => <>); + end if; + + case Value.Is_Virtual_String is + when True => + Value.Virtual_String.Clear; + Value.Virtual_String.Append (Handler.String_Value); + Handler.Read_Next; + when False => + Read_InlayHintLabelPart_Vector + (Handler, Value.InlayHintLabelPart_Vector); + end case; + end Read_Virtual_String_Or_InlayHintLabelPart_Vector; + + procedure Read_InlayHintLabelPart_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.InlayHintLabelPart_Vector) is + begin + pragma Assert (Handler.Is_Start_Array); + Handler.Read_Next; + + declare + Set : LSP.Structures.InlayHintLabelPart_Vector renames Value; + Value : LSP.Structures.InlayHintLabelPart; + begin + Set.Clear; + while not Handler.Is_End_Array loop + Read_InlayHintLabelPart (Handler, Value); + Set.Append (Value); + end loop; + end; + + Handler.Read_Next; + end Read_InlayHintLabelPart_Vector; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case InlayHint_Map.Get_Index (Key) is + when 1 => -- position + Read_Position (Handler, Value.position); + when 2 => -- label + Read_Virtual_String_Or_InlayHintLabelPart_Vector + (Handler, Value.label); + when 3 => -- kind + Value.kind := + (Is_Set => True, + Value => <>); + Read_InlayHintKind (Handler, Value.kind.Value); + when 4 => -- textEdits + Read_TextEdit_Vector (Handler, Value.textEdits); + when 5 => -- tooltip + Value.tooltip := + (Is_Set => True, + Value => <>); + Read_Virtual_String_Or_MarkupContent + (Handler, Value.tooltip.Value); + when 6 => -- paddingLeft + Value.paddingLeft := + (Is_Set => True, + Value => <>); + Value.paddingLeft.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 7 => -- paddingRight + Value.paddingRight := + (Is_Set => True, + Value => <>); + Value.paddingRight.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 8 => -- data + Read_LSPAny (Handler, Value.data); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_InlayHint; + + package FileDelete_Scope is + package FileDelete_Map is new Minimal_Perfect_Hash (["uri"]); + + end FileDelete_Scope; + + procedure Read_FileDelete + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.FileDelete) is + use FileDelete_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case FileDelete_Map.Get_Index (Key) is + when 1 => -- uri + Value.uri.Clear; + Value.uri.Append (Handler.String_Value); + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_FileDelete; + + package DocumentFormattingRegistrationOptions_Scope is + package DocumentFormattingRegistrationOptions_Map is new Minimal_Perfect_Hash + (["documentSelector", + "workDoneProgress"]); + + end DocumentFormattingRegistrationOptions_Scope; + + procedure Read_DocumentFormattingRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentFormattingRegistrationOptions) is + use DocumentFormattingRegistrationOptions_Scope; + procedure Read_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSelector_Or_Null); + + procedure Read_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSelector_Or_Null) is + begin + if Handler.Is_Null_Value then + Handler.Read_Next; + else + Value := + (Is_Null => False, + Value => <>); + Read_DocumentSelector (Handler, Value.Value); + end if; + end Read_DocumentSelector_Or_Null; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case DocumentFormattingRegistrationOptions_Map.Get_Index (Key) is + when 1 => -- documentSelector + Read_DocumentSelector_Or_Null + (Handler, Value.Parent.documentSelector); + when 2 => -- workDoneProgress + Value.workDoneProgress := + (Is_Set => True, + Value => <>); + Value.workDoneProgress.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_DocumentFormattingRegistrationOptions; + + package ColorPresentation_Scope is + package ColorPresentation_Map is new Minimal_Perfect_Hash + (["label", + "textEdit", + "additionalTextEdits"]); + + end ColorPresentation_Scope; + + procedure Read_ColorPresentation + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ColorPresentation) is + use ColorPresentation_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case ColorPresentation_Map.Get_Index (Key) is + when 1 => -- label + Value.label.Clear; + Value.label.Append (Handler.String_Value); + Handler.Read_Next; + when 2 => -- textEdit + Value.textEdit := + (Is_Set => True, + Value => <>); + Read_TextEdit (Handler, Value.textEdit.Value); + when 3 => -- additionalTextEdits + Read_TextEdit_Vector (Handler, Value.additionalTextEdits); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_ColorPresentation; + + package UnregistrationParams_Scope is + package UnregistrationParams_Map is new Minimal_Perfect_Hash + (["unregisterations"]); + + end UnregistrationParams_Scope; + + procedure Read_UnregistrationParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.UnregistrationParams) is + use UnregistrationParams_Scope; + procedure Read_Unregistration_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Unregistration_Vector); + + procedure Read_Unregistration_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Unregistration_Vector) is + begin + pragma Assert (Handler.Is_Start_Array); + Handler.Read_Next; + + declare + Set : LSP.Structures.Unregistration_Vector renames Value; + Value : LSP.Structures.Unregistration; + begin + Set.Clear; + while not Handler.Is_End_Array loop + Read_Unregistration (Handler, Value); + Set.Append (Value); + end loop; + end; + + Handler.Read_Next; + end Read_Unregistration_Vector; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case UnregistrationParams_Map.Get_Index (Key) is + when 1 => -- unregisterations + Read_Unregistration_Vector (Handler, Value.unregisterations); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_UnregistrationParams; + + package SelectionRangeParams_Scope is + package SelectionRangeParams_Map is new Minimal_Perfect_Hash + (["workDoneToken", + "partialResultToken", + "textDocument", + "positions"]); + + end SelectionRangeParams_Scope; + + procedure Read_SelectionRangeParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SelectionRangeParams) is + use SelectionRangeParams_Scope; + procedure Read_Position_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Position_Vector); + + procedure Read_Position_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Position_Vector) is + begin + pragma Assert (Handler.Is_Start_Array); + Handler.Read_Next; + + declare + Set : LSP.Structures.Position_Vector renames Value; + Value : LSP.Structures.Position; + begin + Set.Clear; + while not Handler.Is_End_Array loop + Read_Position (Handler, Value); + Set.Append (Value); + end loop; + end; + + Handler.Read_Next; + end Read_Position_Vector; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case SelectionRangeParams_Map.Get_Index (Key) is + when 1 => -- workDoneToken + Value.workDoneToken := + (Is_Set => True, + Value => <>); + Read_ProgressToken (Handler, Value.workDoneToken.Value); + when 2 => -- partialResultToken + Value.partialResultToken := + (Is_Set => True, + Value => <>); + Read_ProgressToken (Handler, Value.partialResultToken.Value); + when 3 => -- textDocument + Read_TextDocumentIdentifier (Handler, Value.textDocument); + when 4 => -- positions + Read_Position_Vector (Handler, Value.positions); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_SelectionRangeParams; + + package Tokens_Delta_Result_Scope is + package Tokens_Delta_Result_Map is new Minimal_Perfect_Hash + (["data", + "edits"]); + + end Tokens_Delta_Result_Scope; + + procedure Read_Tokens_Delta_Result + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Tokens_Delta_Result) is + use Tokens_Delta_Result_Scope; + begin + declare + Parent : + constant not null access VSS.JSON.Pull_Readers.JSON_Pull_Reader' + Class := + Handler'Access; + Handler : + VSS.JSON.Pull_Readers.Buffered.JSON_Buffered_Pull_Reader (Parent); + begin + Handler.Mark; + if Handler.Is_Null_Value then + Value := + (Kind => LSP.Structures.Varian_3, + others => <>); + elsif Handler.Is_Start_Object then + Handler.Read_Next; + while Handler.Is_Key_Name loop + declare + Key : constant VSS.Strings.Virtual_String := + Handler.Key_Name; + Index : constant Natural := + Tokens_Delta_Result_Map.Get_Index (Key); + begin + Handler.Read_Next; + case Index is + when 1 => -- data + Value := + (Kind => LSP.Structures.Varian_1, + others => <>); + exit; + when 2 => -- edits + Value := + (Kind => LSP.Structures.Varian_2, + others => <>); + exit; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + else + raise Program_Error; -- Unexpected JSON value + end if; + + Handler.Reset; + Handler.Unmark; + + case Value.Kind is + when LSP.Structures.Varian_1 => + Read_SemanticTokens (Handler, Value.Varian_1); + when LSP.Structures.Varian_2 => + Read_SemanticTokensDelta (Handler, Value.Varian_2); + when LSP.Structures.Varian_3 => + null; -- #null_value + Handler.Read_Next; + end case; + end; + end Read_Tokens_Delta_Result; + + package RenameFilesParams_Scope is + package RenameFilesParams_Map is new Minimal_Perfect_Hash (["files"]); + + end RenameFilesParams_Scope; + + procedure Read_RenameFilesParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.RenameFilesParams) is + use RenameFilesParams_Scope; + procedure Read_FileRename_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.FileRename_Vector); + + procedure Read_FileRename_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.FileRename_Vector) is + begin + pragma Assert (Handler.Is_Start_Array); + Handler.Read_Next; + + declare + Set : LSP.Structures.FileRename_Vector renames Value; + Value : LSP.Structures.FileRename; + begin + Set.Clear; + while not Handler.Is_End_Array loop + Read_FileRename (Handler, Value); + Set.Append (Value); + end loop; + end; + + Handler.Read_Next; + end Read_FileRename_Vector; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case RenameFilesParams_Map.Get_Index (Key) is + when 1 => -- files + Read_FileRename_Vector (Handler, Value.files); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_RenameFilesParams; + + package TypeHierarchyItem_Scope is + package TypeHierarchyItem_Map is new Minimal_Perfect_Hash + (["name", + "kind", + "tags", + "detail", + "uri", + "range", + "selectionRange", + "data"]); + + end TypeHierarchyItem_Scope; + + procedure Read_TypeHierarchyItem + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.TypeHierarchyItem) is + use TypeHierarchyItem_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case TypeHierarchyItem_Map.Get_Index (Key) is + when 1 => -- name + Value.name.Clear; + Value.name.Append (Handler.String_Value); + Handler.Read_Next; + when 2 => -- kind + Read_SymbolKind (Handler, Value.kind); + when 3 => -- tags + Read_SymbolTag_Set (Handler, Value.tags); + when 4 => -- detail + Value.detail.Clear; + Value.detail.Append (Handler.String_Value); + Handler.Read_Next; + when 5 => -- uri + Value.uri := (Handler.String_Value with null record); + Handler.Read_Next; + when 6 => -- range + Read_A_Range (Handler, Value.a_range); + when 7 => -- selectionRange + Read_A_Range (Handler, Value.selectionRange); + when 8 => -- data + Read_LSPAny (Handler, Value.data); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_TypeHierarchyItem; + + procedure Read_Boolean_Or_Any + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Boolean_Or_Any) is + begin + LSP.Input_Tools.Read_LSPAny_Class (Handler, Value); + end Read_Boolean_Or_Any; + + package Location_Scope is + package Location_Map is new Minimal_Perfect_Hash + (["uri", + "range"]); + + end Location_Scope; + + procedure Read_Location + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Location) is + use Location_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case Location_Map.Get_Index (Key) is + when 1 => -- uri + Value.uri := (Handler.String_Value with null record); + Handler.Read_Next; + when 2 => -- range + Read_A_Range (Handler, Value.a_range); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_Location; + + package RenameRegistrationOptions_Scope is + package RenameRegistrationOptions_Map is new Minimal_Perfect_Hash + (["documentSelector", + "workDoneProgress", + "prepareProvider"]); + + end RenameRegistrationOptions_Scope; + + procedure Read_RenameRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.RenameRegistrationOptions) is + use RenameRegistrationOptions_Scope; + procedure Read_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSelector_Or_Null); + + procedure Read_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSelector_Or_Null) is + begin + if Handler.Is_Null_Value then + Handler.Read_Next; + else + Value := + (Is_Null => False, + Value => <>); + Read_DocumentSelector (Handler, Value.Value); + end if; + end Read_DocumentSelector_Or_Null; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case RenameRegistrationOptions_Map.Get_Index (Key) is + when 1 => -- documentSelector + Read_DocumentSelector_Or_Null + (Handler, Value.Parent.documentSelector); + when 2 => -- workDoneProgress + Value.workDoneProgress := + (Is_Set => True, + Value => <>); + Value.workDoneProgress.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 3 => -- prepareProvider + Value.prepareProvider := + (Is_Set => True, + Value => <>); + Value.prepareProvider.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_RenameRegistrationOptions; + + package ParameterInformation_Scope is + package ParameterInformation_Map is new Minimal_Perfect_Hash + (["label", + "documentation"]); + + end ParameterInformation_Scope; + + procedure Read_ParameterInformation + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ParameterInformation) is + use ParameterInformation_Scope; + procedure Read_Natural_Tuple + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Natural_Tuple); + + procedure Read_String_Or_Natural_Tuple + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.String_Or_Natural_Tuple); + + procedure Read_Natural_Tuple + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Natural_Tuple) is + begin + pragma Assert (Handler.Is_Start_Array); + Handler.Read_Next; + for J in Value'Range loop + Value (J) := Integer (Handler.Number_Value.Integer_Value); + Handler.Read_Next; + end loop; + pragma Assert (Handler.Is_End_Array); + Handler.Read_Next; + end Read_Natural_Tuple; + + procedure Read_String_Or_Natural_Tuple + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.String_Or_Natural_Tuple) is + begin + if Handler.Is_String_Value then + Value := + (Is_Virtual_String => True, + others => <>); + else + Value := + (Is_Virtual_String => False, + others => <>); + end if; + + case Value.Is_Virtual_String is + when True => + Value.Virtual_String.Clear; + Value.Virtual_String.Append (Handler.String_Value); + Handler.Read_Next; + when False => + Read_Natural_Tuple (Handler, Value.Natural_Tuple); + end case; + end Read_String_Or_Natural_Tuple; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case ParameterInformation_Map.Get_Index (Key) is + when 1 => -- label + Read_String_Or_Natural_Tuple (Handler, Value.label); + when 2 => -- documentation + Value.documentation := + (Is_Set => True, + Value => <>); + Read_Virtual_String_Or_MarkupContent + (Handler, Value.documentation.Value); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_ParameterInformation; + + package PositionEncodingKind_Map is new Minimal_Perfect_Hash + (["utf-8", + "utf-16", + "utf-32"]); + + procedure Read_PositionEncodingKind + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.PositionEncodingKind) is + begin + Value := + LSP.Enumerations.PositionEncodingKind'Val + (PositionEncodingKind_Map.Get_Index (Handler.String_Value) - 1); + Handler.Read_Next; + end Read_PositionEncodingKind; + + package Symbol_Progress_Report_Scope is + package Symbol_Progress_Report_Map is new Minimal_Perfect_Hash + (["deprecated", + "data"]); + + end Symbol_Progress_Report_Scope; + + procedure Read_Symbol_Progress_Report + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Symbol_Progress_Report) is + use Symbol_Progress_Report_Scope; + begin + declare + Parent : + constant not null access VSS.JSON.Pull_Readers.JSON_Pull_Reader' + Class := + Handler'Access; + Handler : + VSS.JSON.Pull_Readers.Buffered.JSON_Buffered_Pull_Reader (Parent); + begin + Handler.Mark; + if Handler.Is_Start_Array then + Handler.Read_Next; + end if; + if Handler.Is_Start_Object then + Handler.Read_Next; + while Handler.Is_Key_Name loop + declare + Key : constant VSS.Strings.Virtual_String := + Handler.Key_Name; + Index : constant Natural := + Symbol_Progress_Report_Map.Get_Index (Key); + begin + Handler.Read_Next; + case Index is + when 1 => -- deprecated + Value := + (Kind => LSP.Structures.Varian_1, + others => <>); + exit; + when 2 => -- data + Value := + (Kind => LSP.Structures.Varian_2, + others => <>); + exit; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + else + raise Program_Error; -- Unexpected JSON value + end if; + + Handler.Reset; + Handler.Unmark; + + case Value.Kind is + when LSP.Structures.Varian_1 => + Read_SymbolInformation_Vector (Handler, Value.Varian_1); + when LSP.Structures.Varian_2 => + Read_WorkspaceSymbol_Vector (Handler, Value.Varian_2); + end case; + end; + end Read_Symbol_Progress_Report; + + procedure Read_MessageType + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.MessageType) is + begin + Value := + LSP.Enumerations.MessageType'Val + (Handler.Number_Value.Integer_Value - 1); + Handler.Read_Next; + end Read_MessageType; + + package An_InitializeParams_Scope is + package An_InitializeParams_Map is new Minimal_Perfect_Hash + (["workDoneToken", + "processId", + "clientInfo", + "locale", + "rootPath", + "rootUri", + "capabilities", + "initializationOptions", + "trace"]); + + package trace_Of_InitializeParams_Scope is + package trace_Of_InitializeParams_Map is new Minimal_Perfect_Hash + (["off", + "messages", + "compact", + "verbose"]); + + end trace_Of_InitializeParams_Scope; + + end An_InitializeParams_Scope; + + procedure Read_An_InitializeParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.An_InitializeParams) is + use An_InitializeParams_Scope; + procedure Read_trace_Of_InitializeParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.trace_Of_InitializeParams); + + procedure Read_Virtual_String_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Virtual_String_Or_Null); + + procedure Read_DocumentUri_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentUri_Or_Null); + + procedure Read_trace_Of_InitializeParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.trace_Of_InitializeParams) is + use trace_Of_InitializeParams_Scope; + begin + Value := + LSP.Structures.trace_Of_InitializeParams'Val + (trace_Of_InitializeParams_Map.Get_Index (Handler.String_Value) - + 1); + Handler.Read_Next; + end Read_trace_Of_InitializeParams; + + procedure Read_Virtual_String_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Virtual_String_Or_Null) is + begin + if Handler.Is_Null_Value then + Handler.Read_Next; + else + Value := + (Is_Null => False, + Value => <>); + Value.Value.Clear; + Value.Value.Append (Handler.String_Value); + Handler.Read_Next; + end if; + end Read_Virtual_String_Or_Null; + + procedure Read_DocumentUri_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentUri_Or_Null) is + begin + if Handler.Is_Null_Value then + Handler.Read_Next; + else + Value := + (Is_Null => False, + Value => <>); + Value.Value := (Handler.String_Value with null record); + Handler.Read_Next; + end if; + end Read_DocumentUri_Or_Null; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case An_InitializeParams_Map.Get_Index (Key) is + when 1 => -- workDoneToken + Value.workDoneToken := + (Is_Set => True, + Value => <>); + Read_ProgressToken (Handler, Value.workDoneToken.Value); + when 2 => -- processId + Read_Integer_Or_Null (Handler, Value.processId); + when 3 => -- clientInfo + Value.clientInfo := + (Is_Set => True, + Value => <>); + Read_clientInfo_Of_InitializeParams + (Handler, Value.clientInfo.Value); + when 4 => -- locale + Value.locale.Clear; + Value.locale.Append (Handler.String_Value); + Handler.Read_Next; + when 5 => -- rootPath + Value.rootPath := + (Is_Set => True, + Value => <>); + Read_Virtual_String_Or_Null (Handler, Value.rootPath.Value); + when 6 => -- rootUri + Read_DocumentUri_Or_Null (Handler, Value.rootUri); + when 7 => -- capabilities + Read_ClientCapabilities (Handler, Value.capabilities); + when 8 => -- initializationOptions + Read_LSPAny (Handler, Value.initializationOptions); + when 9 => -- trace + Value.trace := + (Is_Set => True, + Value => <>); + Read_trace_Of_InitializeParams (Handler, Value.trace.Value); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_An_InitializeParams; + + package TypeHierarchySubtypesParams_Scope is + package TypeHierarchySubtypesParams_Map is new Minimal_Perfect_Hash + (["workDoneToken", + "partialResultToken", + "item"]); + + end TypeHierarchySubtypesParams_Scope; + + procedure Read_TypeHierarchySubtypesParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.TypeHierarchySubtypesParams) is + use TypeHierarchySubtypesParams_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case TypeHierarchySubtypesParams_Map.Get_Index (Key) is + when 1 => -- workDoneToken + Value.workDoneToken := + (Is_Set => True, + Value => <>); + Read_ProgressToken (Handler, Value.workDoneToken.Value); + when 2 => -- partialResultToken + Value.partialResultToken := + (Is_Set => True, + Value => <>); + Read_ProgressToken (Handler, Value.partialResultToken.Value); + when 3 => -- item + Read_TypeHierarchyItem (Handler, Value.item); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_TypeHierarchySubtypesParams; + + package FileOperationFilter_Scope is + package FileOperationFilter_Map is new Minimal_Perfect_Hash + (["scheme", + "pattern"]); + + end FileOperationFilter_Scope; + + procedure Read_FileOperationFilter + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.FileOperationFilter) is + use FileOperationFilter_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case FileOperationFilter_Map.Get_Index (Key) is + when 1 => -- scheme + Value.scheme.Clear; + Value.scheme.Append (Handler.String_Value); + Handler.Read_Next; + when 2 => -- pattern + Read_FileOperationPattern (Handler, Value.pattern); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_FileOperationFilter; + + package ApplyWorkspaceEditResult_Scope is + package ApplyWorkspaceEditResult_Map is new Minimal_Perfect_Hash + (["applied", + "failureReason", + "failedChange"]); + + end ApplyWorkspaceEditResult_Scope; + + procedure Read_ApplyWorkspaceEditResult + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ApplyWorkspaceEditResult) is + use ApplyWorkspaceEditResult_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case ApplyWorkspaceEditResult_Map.Get_Index (Key) is + when 1 => -- applied + Value.applied := Handler.Boolean_Value; + Handler.Read_Next; + when 2 => -- failureReason + Value.failureReason.Clear; + Value.failureReason.Append (Handler.String_Value); + Handler.Read_Next; + when 3 => -- failedChange + Value.failedChange := + (Is_Set => True, + Value => <>); + Value.failedChange.Value := + Integer (Handler.Number_Value.Integer_Value); + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_ApplyWorkspaceEditResult; + + package SemanticTokensPartialResult_Scope is + package SemanticTokensPartialResult_Map is new Minimal_Perfect_Hash + (["data"]); + + end SemanticTokensPartialResult_Scope; + + procedure Read_SemanticTokensPartialResult + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SemanticTokensPartialResult) is + use SemanticTokensPartialResult_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case SemanticTokensPartialResult_Map.Get_Index (Key) is + when 1 => -- data + Read_Natural_Vector (Handler, Value.data); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_SemanticTokensPartialResult; + + package Completion_Result_Scope is + package Completion_Result_Map is new Minimal_Perfect_Hash + (["isIncomplete", + "itemDefaults", + "items"]); + + end Completion_Result_Scope; + + procedure Read_Completion_Result + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Completion_Result) is + use Completion_Result_Scope; + begin + declare + Parent : + constant not null access VSS.JSON.Pull_Readers.JSON_Pull_Reader' + Class := + Handler'Access; + Handler : + VSS.JSON.Pull_Readers.Buffered.JSON_Buffered_Pull_Reader (Parent); + begin + Handler.Mark; + if Handler.Is_Null_Value then + Value := + (Kind => LSP.Structures.Varian_3, + others => <>); + elsif Handler.Is_Start_Object then + Handler.Read_Next; + Value := + (Kind => LSP.Structures.Varian_1, + others => <>); + while Handler.Is_Key_Name loop + declare + Key : constant VSS.Strings.Virtual_String := + Handler.Key_Name; + Index : constant Natural := + Completion_Result_Map.Get_Index (Key); + begin + Handler.Read_Next; + case Index is + when 1 => -- isIncomplete + Value := + (Kind => LSP.Structures.Varian_2, + others => <>); + exit; + when 2 => -- itemDefaults + Value := + (Kind => LSP.Structures.Varian_2, + others => <>); + exit; + when 3 => -- items + Value := + (Kind => LSP.Structures.Varian_2, + others => <>); + exit; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + else + raise Program_Error; -- Unexpected JSON value + end if; + + Handler.Reset; + Handler.Unmark; + + case Value.Kind is + when LSP.Structures.Varian_1 => + Read_CompletionItem_Vector (Handler, Value.Varian_1); + when LSP.Structures.Varian_2 => + Read_CompletionList (Handler, Value.Varian_2); + when LSP.Structures.Varian_3 => + null; -- #null_value + Handler.Read_Next; + end case; + end; + end Read_Completion_Result; + + package MonikerOptions_Scope is + package MonikerOptions_Map is new Minimal_Perfect_Hash + (["workDoneProgress"]); + + end MonikerOptions_Scope; + + procedure Read_MonikerOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.MonikerOptions) is + use MonikerOptions_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case MonikerOptions_Map.Get_Index (Key) is + when 1 => -- workDoneProgress + Value.workDoneProgress := + (Is_Set => True, + Value => <>); + Value.workDoneProgress.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_MonikerOptions; + + package InlineValue_Scope is + package InlineValue_Map is new Minimal_Perfect_Hash + (["text", + "variableName", + "caseSensitiveLookup", + "expression"]); + + end InlineValue_Scope; + + procedure Read_InlineValue + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.InlineValue) is + use InlineValue_Scope; + begin + declare + Parent : + constant not null access VSS.JSON.Pull_Readers.JSON_Pull_Reader' + Class := + Handler'Access; + Handler : + VSS.JSON.Pull_Readers.Buffered.JSON_Buffered_Pull_Reader (Parent); + begin + Handler.Mark; + if Handler.Is_Start_Object then + Handler.Read_Next; + while Handler.Is_Key_Name loop + declare + Key : constant VSS.Strings.Virtual_String := + Handler.Key_Name; + Index : constant Natural := InlineValue_Map.Get_Index (Key); + begin + Handler.Read_Next; + case Index is + when 1 => -- text + Value := + (Kind => LSP.Structures.Varian_1, + others => <>); + exit; + when 2 => -- variableName + Value := + (Kind => LSP.Structures.Varian_2, + others => <>); + exit; + when 3 => -- caseSensitiveLookup + Value := + (Kind => LSP.Structures.Varian_2, + others => <>); + exit; + when 4 => -- expression + Value := + (Kind => LSP.Structures.Varian_3, + others => <>); + exit; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + else + raise Program_Error; -- Unexpected JSON value + end if; + + Handler.Reset; + Handler.Unmark; + + case Value.Kind is + when LSP.Structures.Varian_1 => + Read_InlineValueText (Handler, Value.Varian_1); + when LSP.Structures.Varian_2 => + Read_InlineValueVariableLookup (Handler, Value.Varian_2); + when LSP.Structures.Varian_3 => + Read_InlineValueEvaluatableExpression (Handler, Value.Varian_3); + end case; + end; + end Read_InlineValue; + + procedure Read_Virtual_String_Or_NotebookDocumentFilter + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Virtual_String_Or_NotebookDocumentFilter) is + begin + if Handler.Is_String_Value then + Value := + (Is_Virtual_String => True, + others => <>); + else + Value := + (Is_Virtual_String => False, + others => <>); + end if; + + case Value.Is_Virtual_String is + when True => + Value.Virtual_String.Clear; + Value.Virtual_String.Append (Handler.String_Value); + Handler.Read_Next; + when False => + Read_NotebookDocumentFilter + (Handler, Value.NotebookDocumentFilter); + end case; + end Read_Virtual_String_Or_NotebookDocumentFilter; + + package MonikerKind_Map is new Minimal_Perfect_Hash + (["import", + "export", + "local"]); + + procedure Read_MonikerKind + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.MonikerKind) is + begin + Value := + LSP.Enumerations.MonikerKind'Val + (MonikerKind_Map.Get_Index (Handler.String_Value) - 1); + Handler.Read_Next; + end Read_MonikerKind; + + procedure Read_NotebookCellKind + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.NotebookCellKind) is + begin + Value := + LSP.Enumerations.NotebookCellKind'Val + (Handler.Number_Value.Integer_Value - 1); + Handler.Read_Next; + end Read_NotebookCellKind; + + procedure Read_CallHierarchyItem_Vector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CallHierarchyItem_Vector_Or_Null) is + begin + if Handler.Is_Null_Value then + Handler.Read_Next; + else + Value.Clear; + Read_CallHierarchyItem_Vector (Handler, Value); + end if; + end Read_CallHierarchyItem_Vector_Or_Null; + + package DidCloseTextDocumentParams_Scope is + package DidCloseTextDocumentParams_Map is new Minimal_Perfect_Hash + (["textDocument"]); + + end DidCloseTextDocumentParams_Scope; + + procedure Read_DidCloseTextDocumentParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DidCloseTextDocumentParams) is + use DidCloseTextDocumentParams_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case DidCloseTextDocumentParams_Map.Get_Index (Key) is + when 1 => -- textDocument + Read_TextDocumentIdentifier (Handler, Value.textDocument); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_DidCloseTextDocumentParams; + + package CallHierarchyOutgoingCallsParams_Scope is + package CallHierarchyOutgoingCallsParams_Map is new Minimal_Perfect_Hash + (["workDoneToken", + "partialResultToken", + "item"]); + + end CallHierarchyOutgoingCallsParams_Scope; + + procedure Read_CallHierarchyOutgoingCallsParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CallHierarchyOutgoingCallsParams) is + use CallHierarchyOutgoingCallsParams_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case CallHierarchyOutgoingCallsParams_Map.Get_Index (Key) is + when 1 => -- workDoneToken + Value.workDoneToken := + (Is_Set => True, + Value => <>); + Read_ProgressToken (Handler, Value.workDoneToken.Value); + when 2 => -- partialResultToken + Value.partialResultToken := + (Is_Set => True, + Value => <>); + Read_ProgressToken (Handler, Value.partialResultToken.Value); + when 3 => -- item + Read_CallHierarchyItem (Handler, Value.item); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_CallHierarchyOutgoingCallsParams; + + procedure Read_SelectionRange_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SelectionRange_Vector) is + begin + pragma Assert (Handler.Is_Start_Array); + Handler.Read_Next; + + declare + Set : LSP.Structures.SelectionRange_Vector renames Value; + Value : LSP.Structures.SelectionRange; + begin + Set.Clear; + while not Handler.Is_End_Array loop + Read_SelectionRange (Handler, Value); + Set.Append (Value); + end loop; + end; + + Handler.Read_Next; + end Read_SelectionRange_Vector; + + package HoverRegistrationOptions_Scope is + package HoverRegistrationOptions_Map is new Minimal_Perfect_Hash + (["documentSelector", + "workDoneProgress"]); + + end HoverRegistrationOptions_Scope; + + procedure Read_HoverRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.HoverRegistrationOptions) is + use HoverRegistrationOptions_Scope; + procedure Read_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSelector_Or_Null); + + procedure Read_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSelector_Or_Null) is + begin + if Handler.Is_Null_Value then + Handler.Read_Next; + else + Value := + (Is_Null => False, + Value => <>); + Read_DocumentSelector (Handler, Value.Value); + end if; + end Read_DocumentSelector_Or_Null; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case HoverRegistrationOptions_Map.Get_Index (Key) is + when 1 => -- documentSelector + Read_DocumentSelector_Or_Null + (Handler, Value.Parent.documentSelector); + when 2 => -- workDoneProgress + Value.workDoneProgress := + (Is_Set => True, + Value => <>); + Value.workDoneProgress.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_HoverRegistrationOptions; + + procedure Read_CompletionItemTag + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.CompletionItemTag) is + begin + Value := + LSP.Enumerations.CompletionItemTag'Val + (Handler.Number_Value.Integer_Value - 1); + Handler.Read_Next; + end Read_CompletionItemTag; + + package SemanticTokensDeltaParams_Scope is + package SemanticTokensDeltaParams_Map is new Minimal_Perfect_Hash + (["workDoneToken", + "partialResultToken", + "textDocument", + "previousResultId"]); + + end SemanticTokensDeltaParams_Scope; + + procedure Read_SemanticTokensDeltaParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SemanticTokensDeltaParams) is + use SemanticTokensDeltaParams_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case SemanticTokensDeltaParams_Map.Get_Index (Key) is + when 1 => -- workDoneToken + Value.workDoneToken := + (Is_Set => True, + Value => <>); + Read_ProgressToken (Handler, Value.workDoneToken.Value); + when 2 => -- partialResultToken + Value.partialResultToken := + (Is_Set => True, + Value => <>); + Read_ProgressToken (Handler, Value.partialResultToken.Value); + when 3 => -- textDocument + Read_TextDocumentIdentifier (Handler, Value.textDocument); + when 4 => -- previousResultId + Value.previousResultId.Clear; + Value.previousResultId.Append (Handler.String_Value); + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_SemanticTokensDeltaParams; + + package DidChangeWorkspaceFoldersParams_Scope is + package DidChangeWorkspaceFoldersParams_Map is new Minimal_Perfect_Hash + (["event"]); + + end DidChangeWorkspaceFoldersParams_Scope; + + procedure Read_DidChangeWorkspaceFoldersParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DidChangeWorkspaceFoldersParams) is + use DidChangeWorkspaceFoldersParams_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case DidChangeWorkspaceFoldersParams_Map.Get_Index (Key) is + when 1 => -- event + Read_WorkspaceFoldersChangeEvent (Handler, Value.event); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_DidChangeWorkspaceFoldersParams; + + package DefinitionRegistrationOptions_Scope is + package DefinitionRegistrationOptions_Map is new Minimal_Perfect_Hash + (["documentSelector", + "workDoneProgress"]); + + end DefinitionRegistrationOptions_Scope; + + procedure Read_DefinitionRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DefinitionRegistrationOptions) is + use DefinitionRegistrationOptions_Scope; + procedure Read_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSelector_Or_Null); + + procedure Read_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSelector_Or_Null) is + begin + if Handler.Is_Null_Value then + Handler.Read_Next; + else + Value := + (Is_Null => False, + Value => <>); + Read_DocumentSelector (Handler, Value.Value); + end if; + end Read_DocumentSelector_Or_Null; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case DefinitionRegistrationOptions_Map.Get_Index (Key) is + when 1 => -- documentSelector + Read_DocumentSelector_Or_Null + (Handler, Value.Parent.documentSelector); + when 2 => -- workDoneProgress + Value.workDoneProgress := + (Is_Set => True, + Value => <>); + Value.workDoneProgress.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_DefinitionRegistrationOptions; + + package clientInfo_Of_InitializeParams_Scope is + package clientInfo_Of_InitializeParams_Map is new Minimal_Perfect_Hash + (["name", + "version"]); + + end clientInfo_Of_InitializeParams_Scope; + + procedure Read_clientInfo_Of_InitializeParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.clientInfo_Of_InitializeParams) is + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while Handler.Is_Key_Name loop + declare + use clientInfo_Of_InitializeParams_Scope; + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case clientInfo_Of_InitializeParams_Map.Get_Index (Key) is + when 1 => -- name + Value.name.Clear; + Value.name.Append (Handler.String_Value); + Handler.Read_Next; + when 2 => -- version + Value.version.Clear; + Value.version.Append (Handler.String_Value); + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_clientInfo_Of_InitializeParams; + + package CodeLensParams_Scope is + package CodeLensParams_Map is new Minimal_Perfect_Hash + (["workDoneToken", + "partialResultToken", + "textDocument"]); + + end CodeLensParams_Scope; + + procedure Read_CodeLensParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CodeLensParams) is + use CodeLensParams_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case CodeLensParams_Map.Get_Index (Key) is + when 1 => -- workDoneToken + Value.workDoneToken := + (Is_Set => True, + Value => <>); + Read_ProgressToken (Handler, Value.workDoneToken.Value); + when 2 => -- partialResultToken + Value.partialResultToken := + (Is_Set => True, + Value => <>); + Read_ProgressToken (Handler, Value.partialResultToken.Value); + when 3 => -- textDocument + Read_TextDocumentIdentifier (Handler, Value.textDocument); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_CodeLensParams; + + procedure Read_DiagnosticTag + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.DiagnosticTag) is + begin + Value := + LSP.Enumerations.DiagnosticTag'Val + (Handler.Number_Value.Integer_Value - 1); + Handler.Read_Next; + end Read_DiagnosticTag; + + procedure Read_TypeHierarchyItem_Vector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.TypeHierarchyItem_Vector_Or_Null) is + begin + if Handler.Is_Null_Value then + Handler.Read_Next; + else + Value.Clear; + Read_TypeHierarchyItem_Vector (Handler, Value); + end if; + end Read_TypeHierarchyItem_Vector_Or_Null; + + package Symbol_Result_Scope is + package Symbol_Result_Map is new Minimal_Perfect_Hash + (["deprecated", + "data"]); + + end Symbol_Result_Scope; + + procedure Read_Symbol_Result + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Symbol_Result) is + use Symbol_Result_Scope; + begin + declare + Parent : + constant not null access VSS.JSON.Pull_Readers.JSON_Pull_Reader' + Class := + Handler'Access; + Handler : + VSS.JSON.Pull_Readers.Buffered.JSON_Buffered_Pull_Reader (Parent); + begin + Handler.Mark; + if Handler.Is_Start_Array then + Handler.Read_Next; + end if; + if Handler.Is_Null_Value then + Value := + (Kind => LSP.Structures.Varian_3, + others => <>); + elsif Handler.Is_Start_Object then + Handler.Read_Next; + while Handler.Is_Key_Name loop + declare + Key : constant VSS.Strings.Virtual_String := + Handler.Key_Name; + Index : constant Natural := + Symbol_Result_Map.Get_Index (Key); + begin + Handler.Read_Next; + case Index is + when 1 => -- deprecated + Value := + (Kind => LSP.Structures.Varian_1, + others => <>); + exit; + when 2 => -- data + Value := + (Kind => LSP.Structures.Varian_2, + others => <>); + exit; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + else + raise Program_Error; -- Unexpected JSON value + end if; + + Handler.Reset; + Handler.Unmark; + + case Value.Kind is + when LSP.Structures.Varian_1 => + Read_SymbolInformation_Vector (Handler, Value.Varian_1); + when LSP.Structures.Varian_2 => + Read_WorkspaceSymbol_Vector (Handler, Value.Varian_2); + when LSP.Structures.Varian_3 => + null; -- #null_value + Handler.Read_Next; + end case; + end; + end Read_Symbol_Result; + + package DiagnosticClientCapabilities_Scope is + package DiagnosticClientCapabilities_Map is new Minimal_Perfect_Hash + (["dynamicRegistration", + "relatedDocumentSupport"]); + + end DiagnosticClientCapabilities_Scope; + + procedure Read_DiagnosticClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DiagnosticClientCapabilities) is + use DiagnosticClientCapabilities_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case DiagnosticClientCapabilities_Map.Get_Index (Key) is + when 1 => -- dynamicRegistration + Value.dynamicRegistration := + (Is_Set => True, + Value => <>); + Value.dynamicRegistration.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 2 => -- relatedDocumentSupport + Value.relatedDocumentSupport := + (Is_Set => True, + Value => <>); + Value.relatedDocumentSupport.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_DiagnosticClientCapabilities; + + package MonikerRegistrationOptions_Scope is + package MonikerRegistrationOptions_Map is new Minimal_Perfect_Hash + (["documentSelector", + "workDoneProgress"]); + + end MonikerRegistrationOptions_Scope; + + procedure Read_MonikerRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.MonikerRegistrationOptions) is + use MonikerRegistrationOptions_Scope; + procedure Read_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSelector_Or_Null); + + procedure Read_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSelector_Or_Null) is + begin + if Handler.Is_Null_Value then + Handler.Read_Next; + else + Value := + (Is_Null => False, + Value => <>); + Read_DocumentSelector (Handler, Value.Value); + end if; + end Read_DocumentSelector_Or_Null; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case MonikerRegistrationOptions_Map.Get_Index (Key) is + when 1 => -- documentSelector + Read_DocumentSelector_Or_Null + (Handler, Value.Parent.documentSelector); + when 2 => -- workDoneProgress + Value.workDoneProgress := + (Is_Set => True, + Value => <>); + Value.workDoneProgress.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_MonikerRegistrationOptions; + + package ExecutionSummary_Scope is + package ExecutionSummary_Map is new Minimal_Perfect_Hash + (["executionOrder", + "success"]); + + end ExecutionSummary_Scope; + + procedure Read_ExecutionSummary + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ExecutionSummary) is + use ExecutionSummary_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case ExecutionSummary_Map.Get_Index (Key) is + when 1 => -- executionOrder + Value.executionOrder := + Integer (Handler.Number_Value.Integer_Value); + Handler.Read_Next; + when 2 => -- success + Value.success := + (Is_Set => True, + Value => <>); + Value.success.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_ExecutionSummary; + + package TypeHierarchySupertypesParams_Scope is + package TypeHierarchySupertypesParams_Map is new Minimal_Perfect_Hash + (["workDoneToken", + "partialResultToken", + "item"]); + + end TypeHierarchySupertypesParams_Scope; + + procedure Read_TypeHierarchySupertypesParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.TypeHierarchySupertypesParams) is + use TypeHierarchySupertypesParams_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case TypeHierarchySupertypesParams_Map.Get_Index (Key) is + when 1 => -- workDoneToken + Value.workDoneToken := + (Is_Set => True, + Value => <>); + Read_ProgressToken (Handler, Value.workDoneToken.Value); + when 2 => -- partialResultToken + Value.partialResultToken := + (Is_Set => True, + Value => <>); + Read_ProgressToken (Handler, Value.partialResultToken.Value); + when 3 => -- item + Read_TypeHierarchyItem (Handler, Value.item); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_TypeHierarchySupertypesParams; + + package PreviousResultId_Scope is + package PreviousResultId_Map is new Minimal_Perfect_Hash + (["uri", + "value"]); + + end PreviousResultId_Scope; + + procedure Read_PreviousResultId + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.PreviousResultId) is + use PreviousResultId_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case PreviousResultId_Map.Get_Index (Key) is + when 1 => -- uri + Value.uri := (Handler.String_Value with null record); + Handler.Read_Next; + when 2 => -- value + Value.value.Clear; + Value.value.Append (Handler.String_Value); + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_PreviousResultId; + + package FoldingRangeKind_Map is new Minimal_Perfect_Hash + (["comment", + "imports", + "region"]); + + procedure Read_FoldingRangeKind + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.FoldingRangeKind) is + begin + Value := + LSP.Enumerations.FoldingRangeKind'Val + (FoldingRangeKind_Map.Get_Index (Handler.String_Value) - 1); + Handler.Read_Next; + end Read_FoldingRangeKind; + + package PublishDiagnosticsParams_Scope is + package PublishDiagnosticsParams_Map is new Minimal_Perfect_Hash + (["uri", + "version", + "diagnostics"]); + + end PublishDiagnosticsParams_Scope; + + procedure Read_PublishDiagnosticsParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.PublishDiagnosticsParams) is + use PublishDiagnosticsParams_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case PublishDiagnosticsParams_Map.Get_Index (Key) is + when 1 => -- uri + Value.uri := (Handler.String_Value with null record); + Handler.Read_Next; + when 2 => -- version + Value.version := + (Is_Set => True, + Value => <>); + Value.version.Value := + Integer (Handler.Number_Value.Integer_Value); + Handler.Read_Next; + when 3 => -- diagnostics + Read_Diagnostic_Vector (Handler, Value.diagnostics); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_PublishDiagnosticsParams; + + package DocumentFilter_Scope is + package DocumentFilter_Map is new Minimal_Perfect_Hash (["notebook"]); + + end DocumentFilter_Scope; + + procedure Read_DocumentFilter + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentFilter) is + use DocumentFilter_Scope; + begin + declare + Parent : + constant not null access VSS.JSON.Pull_Readers.JSON_Pull_Reader' + Class := + Handler'Access; + Handler : + VSS.JSON.Pull_Readers.Buffered.JSON_Buffered_Pull_Reader (Parent); + begin + Handler.Mark; + if Handler.Is_Start_Object then + Handler.Read_Next; + Value := + (Is_TextDocumentFilter => True, + others => <>); + while Handler.Is_Key_Name loop + declare + Key : constant VSS.Strings.Virtual_String := + Handler.Key_Name; + Index : constant Natural := + DocumentFilter_Map.Get_Index (Key); + begin + Handler.Read_Next; + case Index is + when 1 => -- notebook + Value := + (Is_TextDocumentFilter => False, + others => <>); + exit; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + else + raise Program_Error; -- Unexpected JSON value + end if; + + Handler.Reset; + Handler.Unmark; + + case Value.Is_TextDocumentFilter is + when True => + Read_TextDocumentFilter (Handler, Value.TextDocumentFilter); + when False => + Read_NotebookCellTextDocumentFilter + (Handler, Value.NotebookCellTextDocumentFilter); + end case; + end; + end Read_DocumentFilter; + + package WorkspaceDiagnosticReport_Scope is + package WorkspaceDiagnosticReport_Map is new Minimal_Perfect_Hash + (["items"]); + + end WorkspaceDiagnosticReport_Scope; + + procedure Read_WorkspaceDiagnosticReport + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.WorkspaceDiagnosticReport) is + use WorkspaceDiagnosticReport_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case WorkspaceDiagnosticReport_Map.Get_Index (Key) is + when 1 => -- items + Read_WorkspaceDocumentDiagnosticReport_Vector + (Handler, Value.items); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_WorkspaceDiagnosticReport; + + package CallHierarchyIncomingCall_Scope is + package CallHierarchyIncomingCall_Map is new Minimal_Perfect_Hash + (["from", + "fromRanges"]); + + end CallHierarchyIncomingCall_Scope; + + procedure Read_CallHierarchyIncomingCall + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CallHierarchyIncomingCall) is + use CallHierarchyIncomingCall_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case CallHierarchyIncomingCall_Map.Get_Index (Key) is + when 1 => -- from + Read_CallHierarchyItem (Handler, Value.from); + when 2 => -- fromRanges + Read_Range_Vector (Handler, Value.fromRanges); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_CallHierarchyIncomingCall; + + procedure Read_TextEdit_Vector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.TextEdit_Vector_Or_Null) is + begin + if Handler.Is_Null_Value then + Handler.Read_Next; + else + Value.Clear; + Read_TextEdit_Vector (Handler, Value); + end if; + end Read_TextEdit_Vector_Or_Null; + + procedure Read_LinkedEditingRanges_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.LinkedEditingRanges_Or_Null) is + begin + if Handler.Is_Null_Value then + Handler.Read_Next; + else + Value := + (Is_Null => False, + Value => <>); + Read_LinkedEditingRanges (Handler, Value.Value); + end if; + end Read_LinkedEditingRanges_Or_Null; + + package TextDocumentChangeRegistrationOptions_Scope is + package TextDocumentChangeRegistrationOptions_Map is new Minimal_Perfect_Hash + (["documentSelector", + "syncKind"]); + + end TextDocumentChangeRegistrationOptions_Scope; + + procedure Read_TextDocumentChangeRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.TextDocumentChangeRegistrationOptions) is + use TextDocumentChangeRegistrationOptions_Scope; + procedure Read_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSelector_Or_Null); + + procedure Read_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSelector_Or_Null) is + begin + if Handler.Is_Null_Value then + Handler.Read_Next; + else + Value := + (Is_Null => False, + Value => <>); + Read_DocumentSelector (Handler, Value.Value); + end if; + end Read_DocumentSelector_Or_Null; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case TextDocumentChangeRegistrationOptions_Map.Get_Index (Key) is + when 1 => -- documentSelector + Read_DocumentSelector_Or_Null + (Handler, Value.documentSelector); + when 2 => -- syncKind + Read_TextDocumentSyncKind (Handler, Value.syncKind); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_TextDocumentChangeRegistrationOptions; + + procedure Read_DeclarationLink_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DeclarationLink_Vector) is + begin + pragma Assert (Handler.Is_Start_Array); + Handler.Read_Next; + + declare + Set : LSP.Structures.DeclarationLink_Vector renames Value; + Value : LSP.Structures.DeclarationLink; + begin + Set.Clear; + while not Handler.Is_End_Array loop + Read_DeclarationLink (Handler, Value); + Set.Append (Value); + end loop; + end; + + Handler.Read_Next; + end Read_DeclarationLink_Vector; + + package SetTraceParams_Scope is + package SetTraceParams_Map is new Minimal_Perfect_Hash (["value"]); + + end SetTraceParams_Scope; + + procedure Read_SetTraceParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SetTraceParams) is + use SetTraceParams_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case SetTraceParams_Map.Get_Index (Key) is + when 1 => -- value + Read_TraceValues (Handler, Value.value); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_SetTraceParams; + + package DocumentFormattingClientCapabilities_Scope is + package DocumentFormattingClientCapabilities_Map is new Minimal_Perfect_Hash + (["dynamicRegistration"]); + + end DocumentFormattingClientCapabilities_Scope; + + procedure Read_DocumentFormattingClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentFormattingClientCapabilities) is + use DocumentFormattingClientCapabilities_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case DocumentFormattingClientCapabilities_Map.Get_Index (Key) is + when 1 => -- dynamicRegistration + Value.dynamicRegistration := + (Is_Set => True, + Value => <>); + Value.dynamicRegistration.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_DocumentFormattingClientCapabilities; + + package NotebookDocumentChangeEvent_Scope is + package NotebookDocumentChangeEvent_Map is new Minimal_Perfect_Hash + (["metadata", + "cells"]); + + package textContent_Ofcells_OfNotebookDocumentChangeEvent_Item_Scope is + package textContent_Ofcells_OfNotebookDocumentChangeEvent_Item_Map is new Minimal_Perfect_Hash + (["document", + "changes"]); + + end textContent_Ofcells_OfNotebookDocumentChangeEvent_Item_Scope; + + package cells_OfNotebookDocumentChangeEvent_Scope is + package cells_OfNotebookDocumentChangeEvent_Map is new Minimal_Perfect_Hash + (["structure", + "data", + "textContent"]); + + end cells_OfNotebookDocumentChangeEvent_Scope; + + package structure_Ofcells_OfNotebookDocumentChangeEvent_Scope is + package structure_Ofcells_OfNotebookDocumentChangeEvent_Map is new Minimal_Perfect_Hash + (["array", + "didOpen", + "didClose"]); + + end structure_Ofcells_OfNotebookDocumentChangeEvent_Scope; + + end NotebookDocumentChangeEvent_Scope; + + procedure Read_NotebookDocumentChangeEvent + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.NotebookDocumentChangeEvent) is + use NotebookDocumentChangeEvent_Scope; + procedure Read_textContent_Ofcells_OfNotebookDocumentChangeEvent_Item + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .textContent_Ofcells_OfNotebookDocumentChangeEvent_Item); + + procedure Read_cells_OfNotebookDocumentChangeEvent + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.cells_OfNotebookDocumentChangeEvent); + + procedure Read_textContent_Ofcells_OfNotebookDocumentChangeEvent + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .textContent_Ofcells_OfNotebookDocumentChangeEvent); + + procedure Read_structure_Ofcells_OfNotebookDocumentChangeEvent + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .structure_Ofcells_OfNotebookDocumentChangeEvent); + + procedure Read_textContent_Ofcells_OfNotebookDocumentChangeEvent_Item + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .textContent_Ofcells_OfNotebookDocumentChangeEvent_Item) is + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while Handler.Is_Key_Name loop + declare + use + textContent_Ofcells_OfNotebookDocumentChangeEvent_Item_Scope; + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case textContent_Ofcells_OfNotebookDocumentChangeEvent_Item_Map + .Get_Index + (Key) is + when 1 => -- document + Read_VersionedTextDocumentIdentifier + (Handler, Value.document); + when 2 => -- changes + Read_TextDocumentContentChangeEvent_Vector + (Handler, Value.changes); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_textContent_Ofcells_OfNotebookDocumentChangeEvent_Item; + + procedure Read_cells_OfNotebookDocumentChangeEvent + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.cells_OfNotebookDocumentChangeEvent) is + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while Handler.Is_Key_Name loop + declare + use cells_OfNotebookDocumentChangeEvent_Scope; + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case cells_OfNotebookDocumentChangeEvent_Map.Get_Index (Key) is + when 1 => -- structure + Value.structure := + (Is_Set => True, + Value => <>); + Read_structure_Ofcells_OfNotebookDocumentChangeEvent + (Handler, Value.structure.Value); + when 2 => -- data + Read_NotebookCell_Vector (Handler, Value.data); + when 3 => -- textContent + Read_textContent_Ofcells_OfNotebookDocumentChangeEvent + (Handler, Value.textContent); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_cells_OfNotebookDocumentChangeEvent; + + procedure Read_textContent_Ofcells_OfNotebookDocumentChangeEvent + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .textContent_Ofcells_OfNotebookDocumentChangeEvent) is + begin + pragma Assert (Handler.Is_Start_Array); + Handler.Read_Next; + + declare + Set : + LSP.Structures + .textContent_Ofcells_OfNotebookDocumentChangeEvent renames + Value; + Value : + LSP.Structures + .textContent_Ofcells_OfNotebookDocumentChangeEvent_Item; + begin + Set.Clear; + while not Handler.Is_End_Array loop + Read_textContent_Ofcells_OfNotebookDocumentChangeEvent_Item + (Handler, Value); + Set.Append (Value); + end loop; + end; + + Handler.Read_Next; + end Read_textContent_Ofcells_OfNotebookDocumentChangeEvent; + + procedure Read_structure_Ofcells_OfNotebookDocumentChangeEvent + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .structure_Ofcells_OfNotebookDocumentChangeEvent) is + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while Handler.Is_Key_Name loop + declare + use structure_Ofcells_OfNotebookDocumentChangeEvent_Scope; + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case structure_Ofcells_OfNotebookDocumentChangeEvent_Map + .Get_Index + (Key) is + when 1 => -- array + Read_NotebookCellArrayChange (Handler, Value.an_array); + when 2 => -- didOpen + Read_TextDocumentItem_Vector (Handler, Value.didOpen); + when 3 => -- didClose + Read_TextDocumentIdentifier_Vector + (Handler, Value.didClose); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_structure_Ofcells_OfNotebookDocumentChangeEvent; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case NotebookDocumentChangeEvent_Map.Get_Index (Key) is + when 1 => -- metadata + Value.metadata := + (Is_Set => True, + Value => <>); + Read_LSPObject (Handler, Value.metadata.Value); + when 2 => -- cells + Value.cells := + (Is_Set => True, + Value => <>); + Read_cells_OfNotebookDocumentChangeEvent + (Handler, Value.cells.Value); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_NotebookDocumentChangeEvent; + + package FormattingOptions_Scope is + package FormattingOptions_Map is new Minimal_Perfect_Hash + (["tabSize", + "insertSpaces", + "trimTrailingWhitespace", + "insertFinalNewline", + "trimFinalNewlines"]); + + end FormattingOptions_Scope; + + procedure Read_FormattingOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.FormattingOptions) is + use FormattingOptions_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case FormattingOptions_Map.Get_Index (Key) is + when 1 => -- tabSize + Value.tabSize := + Integer (Handler.Number_Value.Integer_Value); + Handler.Read_Next; + when 2 => -- insertSpaces + Value.insertSpaces := Handler.Boolean_Value; + Handler.Read_Next; + when 3 => -- trimTrailingWhitespace + Value.trimTrailingWhitespace := + (Is_Set => True, + Value => <>); + Value.trimTrailingWhitespace.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 4 => -- insertFinalNewline + Value.insertFinalNewline := + (Is_Set => True, + Value => <>); + Value.insertFinalNewline.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 5 => -- trimFinalNewlines + Value.trimFinalNewlines := + (Is_Set => True, + Value => <>); + Value.trimFinalNewlines.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_FormattingOptions; + + package WorkspaceDiagnosticReportPartialResult_Scope is + package WorkspaceDiagnosticReportPartialResult_Map is new Minimal_Perfect_Hash + (["items"]); + + end WorkspaceDiagnosticReportPartialResult_Scope; + + procedure Read_WorkspaceDiagnosticReportPartialResult + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.WorkspaceDiagnosticReportPartialResult) is + use WorkspaceDiagnosticReportPartialResult_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case WorkspaceDiagnosticReportPartialResult_Map.Get_Index (Key) is + when 1 => -- items + Read_WorkspaceDocumentDiagnosticReport_Vector + (Handler, Value.items); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_WorkspaceDiagnosticReportPartialResult; + + package resolveSupport_OfWorkspaceSymbolClientCapabilities_Scope is + package resolveSupport_OfWorkspaceSymbolClientCapabilities_Map is new Minimal_Perfect_Hash + (["properties"]); + + end resolveSupport_OfWorkspaceSymbolClientCapabilities_Scope; + + procedure Read_resolveSupport_OfWorkspaceSymbolClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .resolveSupport_OfWorkspaceSymbolClientCapabilities) is + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while Handler.Is_Key_Name loop + declare + use resolveSupport_OfWorkspaceSymbolClientCapabilities_Scope; + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case resolveSupport_OfWorkspaceSymbolClientCapabilities_Map + .Get_Index + (Key) is + when 1 => -- properties + Read_Virtual_String_Vector (Handler, Value.properties); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_resolveSupport_OfWorkspaceSymbolClientCapabilities; + + package DidOpenTextDocumentParams_Scope is + package DidOpenTextDocumentParams_Map is new Minimal_Perfect_Hash + (["textDocument"]); + + end DidOpenTextDocumentParams_Scope; + + procedure Read_DidOpenTextDocumentParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DidOpenTextDocumentParams) is + use DidOpenTextDocumentParams_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case DidOpenTextDocumentParams_Map.Get_Index (Key) is + when 1 => -- textDocument + Read_TextDocumentItem (Handler, Value.textDocument); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_DidOpenTextDocumentParams; + + procedure Read_WorkspaceSymbol_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.WorkspaceSymbol_Vector) is + begin + pragma Assert (Handler.Is_Start_Array); + Handler.Read_Next; + + declare + Set : LSP.Structures.WorkspaceSymbol_Vector renames Value; + Value : LSP.Structures.WorkspaceSymbol; + begin + Set.Clear; + while not Handler.Is_End_Array loop + Read_WorkspaceSymbol (Handler, Value); + Set.Append (Value); + end loop; + end; + + Handler.Read_Next; + end Read_WorkspaceSymbol_Vector; + + package TypeDefinitionRegistrationOptions_Scope is + package TypeDefinitionRegistrationOptions_Map is new Minimal_Perfect_Hash + (["documentSelector", + "workDoneProgress", + "id"]); + + end TypeDefinitionRegistrationOptions_Scope; + + procedure Read_TypeDefinitionRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.TypeDefinitionRegistrationOptions) is + use TypeDefinitionRegistrationOptions_Scope; + procedure Read_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSelector_Or_Null); + + procedure Read_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSelector_Or_Null) is + begin + if Handler.Is_Null_Value then + Handler.Read_Next; + else + Value := + (Is_Null => False, + Value => <>); + Read_DocumentSelector (Handler, Value.Value); + end if; + end Read_DocumentSelector_Or_Null; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case TypeDefinitionRegistrationOptions_Map.Get_Index (Key) is + when 1 => -- documentSelector + Read_DocumentSelector_Or_Null + (Handler, Value.Parent.documentSelector); + when 2 => -- workDoneProgress + Value.workDoneProgress := + (Is_Set => True, + Value => <>); + Value.workDoneProgress.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 3 => -- id + Value.id.Clear; + Value.id.Append (Handler.String_Value); + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_TypeDefinitionRegistrationOptions; + + package CodeLensOptions_Scope is + package CodeLensOptions_Map is new Minimal_Perfect_Hash + (["workDoneProgress", + "resolveProvider"]); + + end CodeLensOptions_Scope; + + procedure Read_CodeLensOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CodeLensOptions) is + use CodeLensOptions_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case CodeLensOptions_Map.Get_Index (Key) is + when 1 => -- workDoneProgress + Value.workDoneProgress := + (Is_Set => True, + Value => <>); + Value.workDoneProgress.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 2 => -- resolveProvider + Value.resolveProvider := + (Is_Set => True, + Value => <>); + Value.resolveProvider.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_CodeLensOptions; + + package FileRename_Scope is + package FileRename_Map is new Minimal_Perfect_Hash + (["oldUri", + "newUri"]); + + end FileRename_Scope; + + procedure Read_FileRename + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.FileRename) is + use FileRename_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case FileRename_Map.Get_Index (Key) is + when 1 => -- oldUri + Value.oldUri.Clear; + Value.oldUri.Append (Handler.String_Value); + Handler.Read_Next; + when 2 => -- newUri + Value.newUri.Clear; + Value.newUri.Append (Handler.String_Value); + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_FileRename; + + package SemanticTokensPartialResult_Or_SemanticTokensDeltaPartialResult_Scope + is + package SemanticTokensPartialResult_Or_SemanticTokensDeltaPartialResult_Map is new Minimal_Perfect_Hash + (["data", + "edits"]); + + end SemanticTokensPartialResult_Or_SemanticTokensDeltaPartialResult_Scope; + + procedure Read_SemanticTokensPartialResult_Or_SemanticTokensDeltaPartialResult + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .SemanticTokensPartialResult_Or_SemanticTokensDeltaPartialResult) is + use + SemanticTokensPartialResult_Or_SemanticTokensDeltaPartialResult_Scope; + begin + declare + Parent : + constant not null access VSS.JSON.Pull_Readers.JSON_Pull_Reader' + Class := + Handler'Access; + Handler : + VSS.JSON.Pull_Readers.Buffered.JSON_Buffered_Pull_Reader (Parent); + begin + Handler.Mark; + if Handler.Is_Start_Object then + Handler.Read_Next; + while Handler.Is_Key_Name loop + declare + Key : constant VSS.Strings.Virtual_String := + Handler.Key_Name; + Index : constant Natural := + SemanticTokensPartialResult_Or_SemanticTokensDeltaPartialResult_Map + .Get_Index + (Key); + begin + Handler.Read_Next; + case Index is + when 1 => -- data + Value := + (Is_SemanticTokensPartialResult => True, + others => <>); + exit; + when 2 => -- edits + Value := + (Is_SemanticTokensPartialResult => False, + others => <>); + exit; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + else + raise Program_Error; -- Unexpected JSON value + end if; + + Handler.Reset; + Handler.Unmark; + + case Value.Is_SemanticTokensPartialResult is + when True => + Read_SemanticTokensPartialResult + (Handler, Value.SemanticTokensPartialResult); + when False => + Read_SemanticTokensDeltaPartialResult + (Handler, Value.SemanticTokensDeltaPartialResult); + end case; + end; + end Read_SemanticTokensPartialResult_Or_SemanticTokensDeltaPartialResult; + + package DocumentDiagnosticReport_Scope is + package DocumentDiagnosticReport_Map is new Minimal_Perfect_Hash + (["full", + "unchanged"]); + + end DocumentDiagnosticReport_Scope; + + procedure Read_DocumentDiagnosticReport + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentDiagnosticReport) is + use DocumentDiagnosticReport_Scope; + begin + declare + Parent : + constant not null access VSS.JSON.Pull_Readers.JSON_Pull_Reader' + Class := + Handler'Access; + Handler : + VSS.JSON.Pull_Readers.Buffered.JSON_Buffered_Pull_Reader (Parent); + Kind : Natural; + begin + Handler.Mark; + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + while Handler.Is_Key_Name loop + declare + use type VSS.Strings.Virtual_String; + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + if Key = "kind" then + pragma Assert (Handler.Is_String_Value); + Kind := + DocumentDiagnosticReport_Map.Get_Index + (Handler.String_Value); + case Kind is + when 1 => -- full + Value := + (Kind => LSP.Structures.full, + others => <>); + when 2 => -- unchanged + Value := + (Kind => LSP.Structures.unchanged, + others => <>); + when others => + raise Constraint_Error; + end case; + exit; + else + Handler.Skip_Current_Value; + end if; + end; + end loop; + + Handler.Reset; + Handler.Unmark; + + case Value.Kind is + when LSP.Structures.full => + Read_RelatedFullDocumentDiagnosticReport (Handler, Value.full); + when LSP.Structures.unchanged => + Read_RelatedUnchangedDocumentDiagnosticReport + (Handler, Value.unchanged); + end case; + end; + end Read_DocumentDiagnosticReport; + + package DocumentRangeFormattingClientCapabilities_Scope is + package DocumentRangeFormattingClientCapabilities_Map is new Minimal_Perfect_Hash + (["dynamicRegistration"]); + + end DocumentRangeFormattingClientCapabilities_Scope; + + procedure Read_DocumentRangeFormattingClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentRangeFormattingClientCapabilities) is + use DocumentRangeFormattingClientCapabilities_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case DocumentRangeFormattingClientCapabilities_Map.Get_Index + (Key) is + when 1 => -- dynamicRegistration + Value.dynamicRegistration := + (Is_Set => True, + Value => <>); + Value.dynamicRegistration.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_DocumentRangeFormattingClientCapabilities; + + package Moniker_Scope is + package Moniker_Map is new Minimal_Perfect_Hash + (["scheme", + "identifier", + "unique", + "kind"]); + + end Moniker_Scope; + + procedure Read_Moniker + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Moniker) is + use Moniker_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case Moniker_Map.Get_Index (Key) is + when 1 => -- scheme + Value.scheme.Clear; + Value.scheme.Append (Handler.String_Value); + Handler.Read_Next; + when 2 => -- identifier + Value.identifier.Clear; + Value.identifier.Append (Handler.String_Value); + Handler.Read_Next; + when 3 => -- unique + Read_UniquenessLevel (Handler, Value.unique); + when 4 => -- kind + Value.kind := + (Is_Set => True, + Value => <>); + Read_MonikerKind (Handler, Value.kind.Value); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_Moniker; + + package ExecuteCommandParams_Scope is + package ExecuteCommandParams_Map is new Minimal_Perfect_Hash + (["workDoneToken", + "command", + "arguments"]); + + end ExecuteCommandParams_Scope; + + procedure Read_ExecuteCommandParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ExecuteCommandParams) is + use ExecuteCommandParams_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case ExecuteCommandParams_Map.Get_Index (Key) is + when 1 => -- workDoneToken + Value.workDoneToken := + (Is_Set => True, + Value => <>); + Read_ProgressToken (Handler, Value.workDoneToken.Value); + when 2 => -- command + Value.command.Clear; + Value.command.Append (Handler.String_Value); + Handler.Read_Next; + when 3 => -- arguments + Read_LSPAny_Vector (Handler, Value.arguments); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_ExecuteCommandParams; + + package WorkDoneProgressBegin_Scope is + package WorkDoneProgressBegin_Map is new Minimal_Perfect_Hash + (["kind", + "title", + "cancellable", + "message", + "percentage"]); + + end WorkDoneProgressBegin_Scope; + + procedure Read_WorkDoneProgressBegin + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.WorkDoneProgressBegin) is + use WorkDoneProgressBegin_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case WorkDoneProgressBegin_Map.Get_Index (Key) is + when 1 => -- kind + Handler.Read_Next; -- Skip string literal: begin + when 2 => -- title + Value.title.Clear; + Value.title.Append (Handler.String_Value); + Handler.Read_Next; + when 3 => -- cancellable + Value.cancellable := + (Is_Set => True, + Value => <>); + Value.cancellable.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 4 => -- message + Value.message.Clear; + Value.message.Append (Handler.String_Value); + Handler.Read_Next; + when 5 => -- percentage + Value.percentage := + (Is_Set => True, + Value => <>); + Value.percentage.Value := + Integer (Handler.Number_Value.Integer_Value); + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_WorkDoneProgressBegin; + + package DiagnosticWorkspaceClientCapabilities_Scope is + package DiagnosticWorkspaceClientCapabilities_Map is new Minimal_Perfect_Hash + (["refreshSupport"]); + + end DiagnosticWorkspaceClientCapabilities_Scope; + + procedure Read_DiagnosticWorkspaceClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DiagnosticWorkspaceClientCapabilities) is + use DiagnosticWorkspaceClientCapabilities_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case DiagnosticWorkspaceClientCapabilities_Map.Get_Index (Key) is + when 1 => -- refreshSupport + Value.refreshSupport := + (Is_Set => True, + Value => <>); + Value.refreshSupport.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_DiagnosticWorkspaceClientCapabilities; + + package DefinitionClientCapabilities_Scope is + package DefinitionClientCapabilities_Map is new Minimal_Perfect_Hash + (["dynamicRegistration", + "linkSupport"]); + + end DefinitionClientCapabilities_Scope; + + procedure Read_DefinitionClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DefinitionClientCapabilities) is + use DefinitionClientCapabilities_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case DefinitionClientCapabilities_Map.Get_Index (Key) is + when 1 => -- dynamicRegistration + Value.dynamicRegistration := + (Is_Set => True, + Value => <>); + Value.dynamicRegistration.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 2 => -- linkSupport + Value.linkSupport := + (Is_Set => True, + Value => <>); + Value.linkSupport.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_DefinitionClientCapabilities; + + package SignatureHelpRegistrationOptions_Scope is + package SignatureHelpRegistrationOptions_Map is new Minimal_Perfect_Hash + (["documentSelector", + "workDoneProgress", + "triggerCharacters", + "retriggerCharacters"]); + + end SignatureHelpRegistrationOptions_Scope; + + procedure Read_SignatureHelpRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SignatureHelpRegistrationOptions) is + use SignatureHelpRegistrationOptions_Scope; + procedure Read_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSelector_Or_Null); + + procedure Read_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSelector_Or_Null) is + begin + if Handler.Is_Null_Value then + Handler.Read_Next; + else + Value := + (Is_Null => False, + Value => <>); + Read_DocumentSelector (Handler, Value.Value); + end if; + end Read_DocumentSelector_Or_Null; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case SignatureHelpRegistrationOptions_Map.Get_Index (Key) is + when 1 => -- documentSelector + Read_DocumentSelector_Or_Null + (Handler, Value.Parent.documentSelector); + when 2 => -- workDoneProgress + Value.workDoneProgress := + (Is_Set => True, + Value => <>); + Value.workDoneProgress.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 3 => -- triggerCharacters + Read_Virtual_String_Vector + (Handler, Value.triggerCharacters); + when 4 => -- retriggerCharacters + Read_Virtual_String_Vector + (Handler, Value.retriggerCharacters); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_SignatureHelpRegistrationOptions; + + package TypeDefinitionOptions_Scope is + package TypeDefinitionOptions_Map is new Minimal_Perfect_Hash + (["workDoneProgress"]); + + end TypeDefinitionOptions_Scope; + + procedure Read_TypeDefinitionOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.TypeDefinitionOptions) is + use TypeDefinitionOptions_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case TypeDefinitionOptions_Map.Get_Index (Key) is + when 1 => -- workDoneProgress + Value.workDoneProgress := + (Is_Set => True, + Value => <>); + Value.workDoneProgress.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_TypeDefinitionOptions; + + package MarkupContent_Scope is + package MarkupContent_Map is new Minimal_Perfect_Hash + (["kind", + "value"]); + + end MarkupContent_Scope; + + procedure Read_MarkupContent + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.MarkupContent) is + use MarkupContent_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case MarkupContent_Map.Get_Index (Key) is + when 1 => -- kind + Read_MarkupKind (Handler, Value.kind); + when 2 => -- value + Value.value.Clear; + Value.value.Append (Handler.String_Value); + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_MarkupContent; + + package WorkspaceEdit_Scope is + package WorkspaceEdit_Map is new Minimal_Perfect_Hash + (["changes", + "documentChanges", + "changeAnnotations"]); + + package documentChanges_OfWorkspaceEdit_Item_Scope is + package documentChanges_OfWorkspaceEdit_Item_Map is new Minimal_Perfect_Hash + (["create", + "rename", + "delete"]); + + end documentChanges_OfWorkspaceEdit_Item_Scope; + + end WorkspaceEdit_Scope; + + procedure Read_WorkspaceEdit + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.WorkspaceEdit) is + use WorkspaceEdit_Scope; + procedure Read_changes_OfWorkspaceEdit + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.changes_OfWorkspaceEdit); + + procedure Read_documentChanges_OfWorkspaceEdit_Item + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.documentChanges_OfWorkspaceEdit_Item); + + procedure Read_changeAnnotations_OfWorkspaceEdit + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.changeAnnotations_OfWorkspaceEdit); + + procedure Read_documentChanges_OfWorkspaceEdit + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.documentChanges_OfWorkspaceEdit); + + procedure Read_changes_OfWorkspaceEdit + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.changes_OfWorkspaceEdit) is + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + declare + Map : LSP.Structures.changes_OfWorkspaceEdit renames Value; + Key : LSP.Structures.DocumentUri; + Value : LSP.Structures.TextEdit_Vector; + begin + Key := (Handler.Key_Name with null record); + Handler.Read_Next; + Read_TextEdit_Vector (Handler, Value); + Map.Insert (Key, Value); + end; + end loop; + + Handler.Read_Next; + + end Read_changes_OfWorkspaceEdit; + + procedure Read_documentChanges_OfWorkspaceEdit_Item + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.documentChanges_OfWorkspaceEdit_Item) is + use documentChanges_OfWorkspaceEdit_Item_Scope; + begin + declare + Parent : + constant not null access VSS.JSON.Pull_Readers.JSON_Pull_Reader' + Class := + Handler'Access; + Handler : + VSS.JSON.Pull_Readers.Buffered.JSON_Buffered_Pull_Reader + (Parent); + Kind : Natural; + begin + Handler.Mark; + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + while Handler.Is_Key_Name loop + declare + use type VSS.Strings.Virtual_String; + Key : constant VSS.Strings.Virtual_String := + Handler.Key_Name; + begin + Handler.Read_Next; + if Key = "kind" then + pragma Assert (Handler.Is_String_Value); + Kind := + documentChanges_OfWorkspaceEdit_Item_Map.Get_Index + (Handler.String_Value); + case Kind is + when 1 => -- create + Value := + (Kind => LSP.Structures.create, + others => <>); + when 2 => -- rename + Value := + (Kind => LSP.Structures.rename, + others => <>); + when 3 => -- delete + Value := + (Kind => LSP.Structures.delete, + others => <>); + when others => + raise Constraint_Error; + end case; + exit; + else + Handler.Skip_Current_Value; + end if; + end; + end loop; + + Handler.Reset; + Handler.Unmark; + + case Value.Kind is + when LSP.Structures.Varian_1 => + Read_TextDocumentEdit (Handler, Value.Varian_1); + when LSP.Structures.create => + Read_CreateFile (Handler, Value.create); + when LSP.Structures.rename => + Read_RenameFile (Handler, Value.rename); + when LSP.Structures.delete => + Read_DeleteFile (Handler, Value.delete); + end case; + end; + end Read_documentChanges_OfWorkspaceEdit_Item; + + procedure Read_changeAnnotations_OfWorkspaceEdit + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.changeAnnotations_OfWorkspaceEdit) is + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + declare + Map : + LSP.Structures.changeAnnotations_OfWorkspaceEdit renames + Value; + Key : LSP.Structures.ChangeAnnotationIdentifier; + Value : LSP.Structures.ChangeAnnotation; + begin + Key := (Handler.Key_Name with null record); + Handler.Read_Next; + Read_ChangeAnnotation (Handler, Value); + Map.Insert (Key, Value); + end; + end loop; + + Handler.Read_Next; + + end Read_changeAnnotations_OfWorkspaceEdit; + + procedure Read_documentChanges_OfWorkspaceEdit + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.documentChanges_OfWorkspaceEdit) is + begin + pragma Assert (Handler.Is_Start_Array); + Handler.Read_Next; + + declare + Set : LSP.Structures.documentChanges_OfWorkspaceEdit renames Value; + Value : LSP.Structures.documentChanges_OfWorkspaceEdit_Item; + begin + Set.Clear; + while not Handler.Is_End_Array loop + Read_documentChanges_OfWorkspaceEdit_Item (Handler, Value); + Set.Append (Value); + end loop; + end; + + Handler.Read_Next; + end Read_documentChanges_OfWorkspaceEdit; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case WorkspaceEdit_Map.Get_Index (Key) is + when 1 => -- changes + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + declare + Map : + LSP.Structures.changes_OfWorkspaceEdit renames + Value.changes; + Key : LSP.Structures.DocumentUri; + Value : LSP.Structures.TextEdit_Vector; + begin + Key := (Handler.Key_Name with null record); + Handler.Read_Next; + Read_TextEdit_Vector (Handler, Value); + Map.Insert (Key, Value); + end; + end loop; + + Handler.Read_Next; + + when 2 => -- documentChanges + Read_documentChanges_OfWorkspaceEdit + (Handler, Value.documentChanges); + when 3 => -- changeAnnotations + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + declare + Map : + LSP.Structures + .changeAnnotations_OfWorkspaceEdit renames + Value.changeAnnotations; + Key : LSP.Structures.ChangeAnnotationIdentifier; + Value : LSP.Structures.ChangeAnnotation; + begin + Key := (Handler.Key_Name with null record); + Handler.Read_Next; + Read_ChangeAnnotation (Handler, Value); + Map.Insert (Key, Value); + end; + end loop; + + Handler.Read_Next; + + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_WorkspaceEdit; + + package DocumentHighlight_Scope is + package DocumentHighlight_Map is new Minimal_Perfect_Hash + (["range", + "kind"]); + + end DocumentHighlight_Scope; + + procedure Read_DocumentHighlight + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentHighlight) is + use DocumentHighlight_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case DocumentHighlight_Map.Get_Index (Key) is + when 1 => -- range + Read_A_Range (Handler, Value.a_range); + when 2 => -- kind + Value.kind := + (Is_Set => True, + Value => <>); + Read_DocumentHighlightKind (Handler, Value.kind.Value); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_DocumentHighlight; + + package MessageActionItem_Scope is + package MessageActionItem_Map is new Minimal_Perfect_Hash (["title"]); + + end MessageActionItem_Scope; + + procedure Read_MessageActionItem + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.MessageActionItem) is + use MessageActionItem_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case MessageActionItem_Map.Get_Index (Key) is + when 1 => -- title + Value.title.Clear; + Value.title.Append (Handler.String_Value); + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_MessageActionItem; + + procedure Read_TextDocumentItem_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.TextDocumentItem_Vector) is + begin + pragma Assert (Handler.Is_Start_Array); + Handler.Read_Next; + + declare + Set : LSP.Structures.TextDocumentItem_Vector renames Value; + Value : LSP.Structures.TextDocumentItem; + begin + Set.Clear; + while not Handler.Is_End_Array loop + Read_TextDocumentItem (Handler, Value); + Set.Append (Value); + end loop; + end; + + Handler.Read_Next; + end Read_TextDocumentItem_Vector; + + package InlineValueRegistrationOptions_Scope is + package InlineValueRegistrationOptions_Map is new Minimal_Perfect_Hash + (["workDoneProgress", + "documentSelector", + "id"]); + + end InlineValueRegistrationOptions_Scope; + + procedure Read_InlineValueRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.InlineValueRegistrationOptions) is + use InlineValueRegistrationOptions_Scope; + procedure Read_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSelector_Or_Null); + + procedure Read_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSelector_Or_Null) is + begin + if Handler.Is_Null_Value then + Handler.Read_Next; + else + Value := + (Is_Null => False, + Value => <>); + Read_DocumentSelector (Handler, Value.Value); + end if; + end Read_DocumentSelector_Or_Null; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case InlineValueRegistrationOptions_Map.Get_Index (Key) is + when 1 => -- workDoneProgress + Value.workDoneProgress := + (Is_Set => True, + Value => <>); + Value.workDoneProgress.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 2 => -- documentSelector + Read_DocumentSelector_Or_Null + (Handler, Value.Parent.documentSelector); + when 3 => -- id + Value.id.Clear; + Value.id.Append (Handler.String_Value); + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_InlineValueRegistrationOptions; + + package VersionedNotebookDocumentIdentifier_Scope is + package VersionedNotebookDocumentIdentifier_Map is new Minimal_Perfect_Hash + (["version", + "uri"]); + + end VersionedNotebookDocumentIdentifier_Scope; + + procedure Read_VersionedNotebookDocumentIdentifier + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.VersionedNotebookDocumentIdentifier) is + use VersionedNotebookDocumentIdentifier_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case VersionedNotebookDocumentIdentifier_Map.Get_Index (Key) is + when 1 => -- version + Value.version := + Integer (Handler.Number_Value.Integer_Value); + Handler.Read_Next; + when 2 => -- uri + Read_URI (Handler, Value.uri); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_VersionedNotebookDocumentIdentifier; + + package BaseSymbolInformation_Scope is + package BaseSymbolInformation_Map is new Minimal_Perfect_Hash + (["name", + "kind", + "tags", + "containerName"]); + + end BaseSymbolInformation_Scope; + + procedure Read_BaseSymbolInformation + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.BaseSymbolInformation) is + use BaseSymbolInformation_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case BaseSymbolInformation_Map.Get_Index (Key) is + when 1 => -- name + Value.name.Clear; + Value.name.Append (Handler.String_Value); + Handler.Read_Next; + when 2 => -- kind + Read_SymbolKind (Handler, Value.kind); + when 3 => -- tags + Read_SymbolTag_Set (Handler, Value.tags); + when 4 => -- containerName + Value.containerName.Clear; + Value.containerName.Append (Handler.String_Value); + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_BaseSymbolInformation; + + package InlayHintParams_Scope is + package InlayHintParams_Map is new Minimal_Perfect_Hash + (["workDoneToken", + "textDocument", + "range"]); + + end InlayHintParams_Scope; + + procedure Read_InlayHintParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.InlayHintParams) is + use InlayHintParams_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case InlayHintParams_Map.Get_Index (Key) is + when 1 => -- workDoneToken + Value.workDoneToken := + (Is_Set => True, + Value => <>); + Read_ProgressToken (Handler, Value.workDoneToken.Value); + when 2 => -- textDocument + Read_TextDocumentIdentifier (Handler, Value.textDocument); + when 3 => -- range + Read_A_Range (Handler, Value.a_range); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_InlayHintParams; + + package WorkDoneProgressCreateParams_Scope is + package WorkDoneProgressCreateParams_Map is new Minimal_Perfect_Hash + (["token"]); + + end WorkDoneProgressCreateParams_Scope; + + procedure Read_WorkDoneProgressCreateParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.WorkDoneProgressCreateParams) is + use WorkDoneProgressCreateParams_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case WorkDoneProgressCreateParams_Map.Get_Index (Key) is + when 1 => -- token + Read_ProgressToken (Handler, Value.token); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_WorkDoneProgressCreateParams; + + package TextEdit_Scope is + package TextEdit_Map is new Minimal_Perfect_Hash + (["range", + "newText"]); + + end TextEdit_Scope; + + procedure Read_TextEdit + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.TextEdit) is + use TextEdit_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case TextEdit_Map.Get_Index (Key) is + when 1 => -- range + Read_A_Range (Handler, Value.a_range); + when 2 => -- newText + Value.newText.Clear; + Value.newText.Append (Handler.String_Value); + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_TextEdit; + + package DeclarationClientCapabilities_Scope is + package DeclarationClientCapabilities_Map is new Minimal_Perfect_Hash + (["dynamicRegistration", + "linkSupport"]); + + end DeclarationClientCapabilities_Scope; + + procedure Read_DeclarationClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DeclarationClientCapabilities) is + use DeclarationClientCapabilities_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case DeclarationClientCapabilities_Map.Get_Index (Key) is + when 1 => -- dynamicRegistration + Value.dynamicRegistration := + (Is_Set => True, + Value => <>); + Value.dynamicRegistration.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 2 => -- linkSupport + Value.linkSupport := + (Is_Set => True, + Value => <>); + Value.linkSupport.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_DeclarationClientCapabilities; + + package SignatureHelpOptions_Scope is + package SignatureHelpOptions_Map is new Minimal_Perfect_Hash + (["workDoneProgress", + "triggerCharacters", + "retriggerCharacters"]); + + end SignatureHelpOptions_Scope; + + procedure Read_SignatureHelpOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SignatureHelpOptions) is + use SignatureHelpOptions_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case SignatureHelpOptions_Map.Get_Index (Key) is + when 1 => -- workDoneProgress + Value.workDoneProgress := + (Is_Set => True, + Value => <>); + Value.workDoneProgress.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 2 => -- triggerCharacters + Read_Virtual_String_Vector + (Handler, Value.triggerCharacters); + when 3 => -- retriggerCharacters + Read_Virtual_String_Vector + (Handler, Value.retriggerCharacters); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_SignatureHelpOptions; + + package SemanticTokensEdit_Scope is + package SemanticTokensEdit_Map is new Minimal_Perfect_Hash + (["start", + "deleteCount", + "data"]); + + end SemanticTokensEdit_Scope; + + procedure Read_SemanticTokensEdit + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SemanticTokensEdit) is + use SemanticTokensEdit_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case SemanticTokensEdit_Map.Get_Index (Key) is + when 1 => -- start + Value.start := Integer (Handler.Number_Value.Integer_Value); + Handler.Read_Next; + when 2 => -- deleteCount + Value.deleteCount := + Integer (Handler.Number_Value.Integer_Value); + Handler.Read_Next; + when 3 => -- data + Read_Natural_Vector (Handler, Value.data); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_SemanticTokensEdit; + + package DocumentHighlightParams_Scope is + package DocumentHighlightParams_Map is new Minimal_Perfect_Hash + (["textDocument", + "position", + "workDoneToken", + "partialResultToken"]); + + end DocumentHighlightParams_Scope; + + procedure Read_DocumentHighlightParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentHighlightParams) is + use DocumentHighlightParams_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case DocumentHighlightParams_Map.Get_Index (Key) is + when 1 => -- textDocument + Read_TextDocumentIdentifier (Handler, Value.textDocument); + when 2 => -- position + Read_Position (Handler, Value.position); + when 3 => -- workDoneToken + Value.workDoneToken := + (Is_Set => True, + Value => <>); + Read_ProgressToken (Handler, Value.workDoneToken.Value); + when 4 => -- partialResultToken + Value.partialResultToken := + (Is_Set => True, + Value => <>); + Read_ProgressToken (Handler, Value.partialResultToken.Value); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_DocumentHighlightParams; + + package FileCreate_Scope is + package FileCreate_Map is new Minimal_Perfect_Hash (["uri"]); + + end FileCreate_Scope; + + procedure Read_FileCreate + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.FileCreate) is + use FileCreate_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case FileCreate_Map.Get_Index (Key) is + when 1 => -- uri + Value.uri.Clear; + Value.uri.Append (Handler.String_Value); + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_FileCreate; + + package WorkspaceFullDocumentDiagnosticReport_Scope is + package WorkspaceFullDocumentDiagnosticReport_Map is new Minimal_Perfect_Hash + (["kind", + "resultId", + "items", + "uri", + "version"]); + + end WorkspaceFullDocumentDiagnosticReport_Scope; + + procedure Read_WorkspaceFullDocumentDiagnosticReport + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.WorkspaceFullDocumentDiagnosticReport) is + use WorkspaceFullDocumentDiagnosticReport_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case WorkspaceFullDocumentDiagnosticReport_Map.Get_Index (Key) is + when 1 => -- kind + Handler.Read_Next; -- Skip string literal: full + when 2 => -- resultId + Value.resultId.Clear; + Value.resultId.Append (Handler.String_Value); + Handler.Read_Next; + when 3 => -- items + Read_Diagnostic_Vector (Handler, Value.items); + when 4 => -- uri + Value.uri := (Handler.String_Value with null record); + Handler.Read_Next; + when 5 => -- version + Read_Integer_Or_Null (Handler, Value.version); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_WorkspaceFullDocumentDiagnosticReport; + + procedure Read_SemanticTokens_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SemanticTokens_Or_Null) is + begin + if Handler.Is_Null_Value then + Handler.Read_Next; + else + Value := + (Is_Null => False, + Value => <>); + Read_SemanticTokens (Handler, Value.Value); + end if; + end Read_SemanticTokens_Or_Null; + + package SemanticTokensRangeParams_Scope is + package SemanticTokensRangeParams_Map is new Minimal_Perfect_Hash + (["workDoneToken", + "partialResultToken", + "textDocument", + "range"]); + + end SemanticTokensRangeParams_Scope; + + procedure Read_SemanticTokensRangeParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SemanticTokensRangeParams) is + use SemanticTokensRangeParams_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case SemanticTokensRangeParams_Map.Get_Index (Key) is + when 1 => -- workDoneToken + Value.workDoneToken := + (Is_Set => True, + Value => <>); + Read_ProgressToken (Handler, Value.workDoneToken.Value); + when 2 => -- partialResultToken + Value.partialResultToken := + (Is_Set => True, + Value => <>); + Read_ProgressToken (Handler, Value.partialResultToken.Value); + when 3 => -- textDocument + Read_TextDocumentIdentifier (Handler, Value.textDocument); + when 4 => -- range + Read_A_Range (Handler, Value.a_range); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_SemanticTokensRangeParams; + + package FoldingRange_Scope is + package FoldingRange_Map is new Minimal_Perfect_Hash + (["startLine", + "startCharacter", + "endLine", + "endCharacter", + "kind", + "collapsedText"]); + + end FoldingRange_Scope; + + procedure Read_FoldingRange + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.FoldingRange) is + use FoldingRange_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case FoldingRange_Map.Get_Index (Key) is + when 1 => -- startLine + Value.startLine := + Integer (Handler.Number_Value.Integer_Value); + Handler.Read_Next; + when 2 => -- startCharacter + Value.startCharacter := + (Is_Set => True, + Value => <>); + Value.startCharacter.Value := + Integer (Handler.Number_Value.Integer_Value); + Handler.Read_Next; + when 3 => -- endLine + Value.endLine := + Integer (Handler.Number_Value.Integer_Value); + Handler.Read_Next; + when 4 => -- endCharacter + Value.endCharacter := + (Is_Set => True, + Value => <>); + Value.endCharacter.Value := + Integer (Handler.Number_Value.Integer_Value); + Handler.Read_Next; + when 5 => -- kind + Value.kind := + (Is_Set => True, + Value => <>); + Read_FoldingRangeKind (Handler, Value.kind.Value); + when 6 => -- collapsedText + Value.collapsedText.Clear; + Value.collapsedText.Append (Handler.String_Value); + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_FoldingRange; + + package SemanticTokensDeltaPartialResult_Scope is + package SemanticTokensDeltaPartialResult_Map is new Minimal_Perfect_Hash + (["edits"]); + + end SemanticTokensDeltaPartialResult_Scope; + + procedure Read_SemanticTokensDeltaPartialResult + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SemanticTokensDeltaPartialResult) is + use SemanticTokensDeltaPartialResult_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case SemanticTokensDeltaPartialResult_Map.Get_Index (Key) is + when 1 => -- edits + Read_SemanticTokensEdit_Vector (Handler, Value.edits); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_SemanticTokensDeltaPartialResult; + + package NotebookDocumentClientCapabilities_Scope is + package NotebookDocumentClientCapabilities_Map is new Minimal_Perfect_Hash + (["synchronization"]); + + end NotebookDocumentClientCapabilities_Scope; + + procedure Read_NotebookDocumentClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.NotebookDocumentClientCapabilities) is + use NotebookDocumentClientCapabilities_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case NotebookDocumentClientCapabilities_Map.Get_Index (Key) is + when 1 => -- synchronization + Read_NotebookDocumentSyncClientCapabilities + (Handler, Value.synchronization); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_NotebookDocumentClientCapabilities; + + package CompletionParams_Scope is + package CompletionParams_Map is new Minimal_Perfect_Hash + (["textDocument", + "position", + "workDoneToken", + "partialResultToken", + "context"]); + + end CompletionParams_Scope; + + procedure Read_CompletionParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CompletionParams) is + use CompletionParams_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case CompletionParams_Map.Get_Index (Key) is + when 1 => -- textDocument + Read_TextDocumentIdentifier (Handler, Value.textDocument); + when 2 => -- position + Read_Position (Handler, Value.position); + when 3 => -- workDoneToken + Value.workDoneToken := + (Is_Set => True, + Value => <>); + Read_ProgressToken (Handler, Value.workDoneToken.Value); + when 4 => -- partialResultToken + Value.partialResultToken := + (Is_Set => True, + Value => <>); + Read_ProgressToken (Handler, Value.partialResultToken.Value); + when 5 => -- context + Value.context := + (Is_Set => True, + Value => <>); + Read_CompletionContext (Handler, Value.context.Value); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_CompletionParams; + + package CallHierarchyIncomingCallsParams_Scope is + package CallHierarchyIncomingCallsParams_Map is new Minimal_Perfect_Hash + (["workDoneToken", + "partialResultToken", + "item"]); + + end CallHierarchyIncomingCallsParams_Scope; + + procedure Read_CallHierarchyIncomingCallsParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CallHierarchyIncomingCallsParams) is + use CallHierarchyIncomingCallsParams_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case CallHierarchyIncomingCallsParams_Map.Get_Index (Key) is + when 1 => -- workDoneToken + Value.workDoneToken := + (Is_Set => True, + Value => <>); + Read_ProgressToken (Handler, Value.workDoneToken.Value); + when 2 => -- partialResultToken + Value.partialResultToken := + (Is_Set => True, + Value => <>); + Read_ProgressToken (Handler, Value.partialResultToken.Value); + when 3 => -- item + Read_CallHierarchyItem (Handler, Value.item); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_CallHierarchyIncomingCallsParams; + + procedure Read_Location_Vector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Location_Vector_Or_Null) is + begin + if Handler.Is_Null_Value then + Handler.Read_Next; + else + Value.Clear; + Read_Location_Vector (Handler, Value); + end if; + end Read_Location_Vector_Or_Null; + + package WorkspaceSymbolClientCapabilities_Scope is + package WorkspaceSymbolClientCapabilities_Map is new Minimal_Perfect_Hash + (["dynamicRegistration", + "symbolKind", + "tagSupport", + "resolveSupport"]); + + end WorkspaceSymbolClientCapabilities_Scope; + + procedure Read_WorkspaceSymbolClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.WorkspaceSymbolClientCapabilities) is + use WorkspaceSymbolClientCapabilities_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case WorkspaceSymbolClientCapabilities_Map.Get_Index (Key) is + when 1 => -- dynamicRegistration + Value.dynamicRegistration := + (Is_Set => True, + Value => <>); + Value.dynamicRegistration.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 2 => -- symbolKind + Value.symbolKind := + (Is_Set => True, + Value => <>); + Read_symbolKind_OfWorkspaceSymbolClientCapabilities + (Handler, Value.symbolKind.Value); + when 3 => -- tagSupport + Value.tagSupport := + (Is_Set => True, + Value => <>); + Read_tagSupport_OfWorkspaceSymbolClientCapabilities + (Handler, Value.tagSupport.Value); + when 4 => -- resolveSupport + Value.resolveSupport := + (Is_Set => True, + Value => <>); + Read_resolveSupport_OfWorkspaceSymbolClientCapabilities + (Handler, Value.resolveSupport.Value); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_WorkspaceSymbolClientCapabilities; + + package Boolean_Or_Something_Scope is + package Boolean_Or_Something_Map is new Minimal_Perfect_Hash (["delta"]); + + end Boolean_Or_Something_Scope; + + procedure Read_Boolean_Or_Something + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Boolean_Or_Something) is + use Boolean_Or_Something_Scope; + begin + if Handler.Is_Boolean_Value then + Value := + (Is_Boolean => True, + others => <>); + else + Value := + (Is_Boolean => False, + others => <>); + end if; + + case Value.Is_Boolean is + when True => + Value.Boolean := Handler.Boolean_Value; + Handler.Read_Next; + when False => + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while Handler.Is_Key_Name loop + declare + Key : constant VSS.Strings.Virtual_String := + Handler.Key_Name; + begin + Handler.Read_Next; + case Boolean_Or_Something_Map.Get_Index (Key) is + when 1 => -- delta + Value.a_delta := + (Is_Set => True, + Value => <>); + Value.a_delta.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end case; + end Read_Boolean_Or_Something; + + package TypeHierarchyOptions_Scope is + package TypeHierarchyOptions_Map is new Minimal_Perfect_Hash + (["workDoneProgress"]); + + end TypeHierarchyOptions_Scope; + + procedure Read_TypeHierarchyOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.TypeHierarchyOptions) is + use TypeHierarchyOptions_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case TypeHierarchyOptions_Map.Get_Index (Key) is + when 1 => -- workDoneProgress + Value.workDoneProgress := + (Is_Set => True, + Value => <>); + Value.workDoneProgress.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_TypeHierarchyOptions; + + package SelectionRangeRegistrationOptions_Scope is + package SelectionRangeRegistrationOptions_Map is new Minimal_Perfect_Hash + (["workDoneProgress", + "documentSelector", + "id"]); + + end SelectionRangeRegistrationOptions_Scope; + + procedure Read_SelectionRangeRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SelectionRangeRegistrationOptions) is + use SelectionRangeRegistrationOptions_Scope; + procedure Read_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSelector_Or_Null); + + procedure Read_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSelector_Or_Null) is + begin + if Handler.Is_Null_Value then + Handler.Read_Next; + else + Value := + (Is_Null => False, + Value => <>); + Read_DocumentSelector (Handler, Value.Value); + end if; + end Read_DocumentSelector_Or_Null; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case SelectionRangeRegistrationOptions_Map.Get_Index (Key) is + when 1 => -- workDoneProgress + Value.workDoneProgress := + (Is_Set => True, + Value => <>); + Value.workDoneProgress.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 2 => -- documentSelector + Read_DocumentSelector_Or_Null + (Handler, Value.Parent.documentSelector); + when 3 => -- id + Value.id.Clear; + Value.id.Append (Handler.String_Value); + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_SelectionRangeRegistrationOptions; + + package DidChangeNotebookDocumentParams_Scope is + package DidChangeNotebookDocumentParams_Map is new Minimal_Perfect_Hash + (["notebookDocument", + "change"]); + + end DidChangeNotebookDocumentParams_Scope; + + procedure Read_DidChangeNotebookDocumentParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DidChangeNotebookDocumentParams) is + use DidChangeNotebookDocumentParams_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case DidChangeNotebookDocumentParams_Map.Get_Index (Key) is + when 1 => -- notebookDocument + Read_VersionedNotebookDocumentIdentifier + (Handler, Value.notebookDocument); + when 2 => -- change + Read_NotebookDocumentChangeEvent (Handler, Value.change); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_DidChangeNotebookDocumentParams; + + package RegularExpressionsClientCapabilities_Scope is + package RegularExpressionsClientCapabilities_Map is new Minimal_Perfect_Hash + (["engine", + "version"]); + + end RegularExpressionsClientCapabilities_Scope; + + procedure Read_RegularExpressionsClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.RegularExpressionsClientCapabilities) is + use RegularExpressionsClientCapabilities_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case RegularExpressionsClientCapabilities_Map.Get_Index (Key) is + when 1 => -- engine + Value.engine.Clear; + Value.engine.Append (Handler.String_Value); + Handler.Read_Next; + when 2 => -- version + Value.version.Clear; + Value.version.Append (Handler.String_Value); + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_RegularExpressionsClientCapabilities; + + package WorkspaceDocumentDiagnosticReport_Scope is + package WorkspaceDocumentDiagnosticReport_Map is new Minimal_Perfect_Hash + (["full", + "unchanged"]); + + end WorkspaceDocumentDiagnosticReport_Scope; + + procedure Read_WorkspaceDocumentDiagnosticReport + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.WorkspaceDocumentDiagnosticReport) is + use WorkspaceDocumentDiagnosticReport_Scope; + begin + declare + Parent : + constant not null access VSS.JSON.Pull_Readers.JSON_Pull_Reader' + Class := + Handler'Access; + Handler : + VSS.JSON.Pull_Readers.Buffered.JSON_Buffered_Pull_Reader (Parent); + Kind : Natural; + begin + Handler.Mark; + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + while Handler.Is_Key_Name loop + declare + use type VSS.Strings.Virtual_String; + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + if Key = "kind" then + pragma Assert (Handler.Is_String_Value); + Kind := + WorkspaceDocumentDiagnosticReport_Map.Get_Index + (Handler.String_Value); + case Kind is + when 1 => -- full + Value := + (Kind => LSP.Structures.full, + others => <>); + when 2 => -- unchanged + Value := + (Kind => LSP.Structures.unchanged, + others => <>); + when others => + raise Constraint_Error; + end case; + exit; + else + Handler.Skip_Current_Value; + end if; + end; + end loop; + + Handler.Reset; + Handler.Unmark; + + case Value.Kind is + when LSP.Structures.full => + Read_WorkspaceFullDocumentDiagnosticReport + (Handler, Value.full); + when LSP.Structures.unchanged => + Read_WorkspaceUnchangedDocumentDiagnosticReport + (Handler, Value.unchanged); + end case; + end; + end Read_WorkspaceDocumentDiagnosticReport; + + package WorkspaceClientCapabilities_Scope is + package WorkspaceClientCapabilities_Map is new Minimal_Perfect_Hash + (["applyEdit", + "workspaceEdit", + "didChangeConfiguration", + "didChangeWatchedFiles", + "symbol", + "executeCommand", + "workspaceFolders", + "configuration", + "semanticTokens", + "codeLens", + "fileOperations", + "inlineValue", + "inlayHint", + "diagnostics"]); + + end WorkspaceClientCapabilities_Scope; + + procedure Read_WorkspaceClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.WorkspaceClientCapabilities) is + use WorkspaceClientCapabilities_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case WorkspaceClientCapabilities_Map.Get_Index (Key) is + when 1 => -- applyEdit + Value.applyEdit := + (Is_Set => True, + Value => <>); + Value.applyEdit.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 2 => -- workspaceEdit + Value.workspaceEdit := + (Is_Set => True, + Value => <>); + Read_WorkspaceEditClientCapabilities + (Handler, Value.workspaceEdit.Value); + when 3 => -- didChangeConfiguration + Value.didChangeConfiguration := + (Is_Set => True, + Value => <>); + Read_DidChangeConfigurationClientCapabilities + (Handler, Value.didChangeConfiguration.Value); + when 4 => -- didChangeWatchedFiles + Value.didChangeWatchedFiles := + (Is_Set => True, + Value => <>); + Read_DidChangeWatchedFilesClientCapabilities + (Handler, Value.didChangeWatchedFiles.Value); + when 5 => -- symbol + Value.symbol := + (Is_Set => True, + Value => <>); + Read_WorkspaceSymbolClientCapabilities + (Handler, Value.symbol.Value); + when 6 => -- executeCommand + Value.executeCommand := + (Is_Set => True, + Value => <>); + Read_ExecuteCommandClientCapabilities + (Handler, Value.executeCommand.Value); + when 7 => -- workspaceFolders + Value.workspaceFolders := + (Is_Set => True, + Value => <>); + Value.workspaceFolders.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 8 => -- configuration + Value.configuration := + (Is_Set => True, + Value => <>); + Value.configuration.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 9 => -- semanticTokens + Value.semanticTokens := + (Is_Set => True, + Value => <>); + Read_SemanticTokensWorkspaceClientCapabilities + (Handler, Value.semanticTokens.Value); + when 10 => -- codeLens + Value.codeLens := + (Is_Set => True, + Value => <>); + Read_CodeLensWorkspaceClientCapabilities + (Handler, Value.codeLens.Value); + when 11 => -- fileOperations + Value.fileOperations := + (Is_Set => True, + Value => <>); + Read_FileOperationClientCapabilities + (Handler, Value.fileOperations.Value); + when 12 => -- inlineValue + Value.inlineValue := + (Is_Set => True, + Value => <>); + Read_InlineValueWorkspaceClientCapabilities + (Handler, Value.inlineValue.Value); + when 13 => -- inlayHint + Value.inlayHint := + (Is_Set => True, + Value => <>); + Read_InlayHintWorkspaceClientCapabilities + (Handler, Value.inlayHint.Value); + when 14 => -- diagnostics + Value.diagnostics := + (Is_Set => True, + Value => <>); + Read_DiagnosticWorkspaceClientCapabilities + (Handler, Value.diagnostics.Value); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_WorkspaceClientCapabilities; + + package WorkspaceDiagnosticParams_Scope is + package WorkspaceDiagnosticParams_Map is new Minimal_Perfect_Hash + (["workDoneToken", + "partialResultToken", + "identifier", + "previousResultIds"]); + + end WorkspaceDiagnosticParams_Scope; + + procedure Read_WorkspaceDiagnosticParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.WorkspaceDiagnosticParams) is + use WorkspaceDiagnosticParams_Scope; + procedure Read_PreviousResultId_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.PreviousResultId_Vector); + + procedure Read_PreviousResultId_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.PreviousResultId_Vector) is + begin + pragma Assert (Handler.Is_Start_Array); + Handler.Read_Next; + + declare + Set : LSP.Structures.PreviousResultId_Vector renames Value; + Value : LSP.Structures.PreviousResultId; + begin + Set.Clear; + while not Handler.Is_End_Array loop + Read_PreviousResultId (Handler, Value); + Set.Append (Value); + end loop; + end; + + Handler.Read_Next; + end Read_PreviousResultId_Vector; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case WorkspaceDiagnosticParams_Map.Get_Index (Key) is + when 1 => -- workDoneToken + Value.workDoneToken := + (Is_Set => True, + Value => <>); + Read_ProgressToken (Handler, Value.workDoneToken.Value); + when 2 => -- partialResultToken + Value.partialResultToken := + (Is_Set => True, + Value => <>); + Read_ProgressToken (Handler, Value.partialResultToken.Value); + when 3 => -- identifier + Value.identifier.Clear; + Value.identifier.Append (Handler.String_Value); + Handler.Read_Next; + when 4 => -- previousResultIds + Read_PreviousResultId_Vector + (Handler, Value.previousResultIds); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_WorkspaceDiagnosticParams; + + procedure Read_TextDocumentSyncKind + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.TextDocumentSyncKind) is + begin + Value := + LSP.Enumerations.TextDocumentSyncKind'Val + (Handler.Number_Value.Integer_Value + 0); + Handler.Read_Next; + end Read_TextDocumentSyncKind; + + package InlayHintOptions_Scope is + package InlayHintOptions_Map is new Minimal_Perfect_Hash + (["workDoneProgress", + "resolveProvider"]); + + end InlayHintOptions_Scope; + + procedure Read_InlayHintOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.InlayHintOptions) is + use InlayHintOptions_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case InlayHintOptions_Map.Get_Index (Key) is + when 1 => -- workDoneProgress + Value.workDoneProgress := + (Is_Set => True, + Value => <>); + Value.workDoneProgress.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 2 => -- resolveProvider + Value.resolveProvider := + (Is_Set => True, + Value => <>); + Value.resolveProvider.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_InlayHintOptions; + + package InlineValueOptions_Scope is + package InlineValueOptions_Map is new Minimal_Perfect_Hash + (["workDoneProgress"]); + + end InlineValueOptions_Scope; + + procedure Read_InlineValueOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.InlineValueOptions) is + use InlineValueOptions_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case InlineValueOptions_Map.Get_Index (Key) is + when 1 => -- workDoneProgress + Value.workDoneProgress := + (Is_Set => True, + Value => <>); + Value.workDoneProgress.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_InlineValueOptions; + + package WorkspaceFoldersChangeEvent_Scope is + package WorkspaceFoldersChangeEvent_Map is new Minimal_Perfect_Hash + (["added", + "removed"]); + + end WorkspaceFoldersChangeEvent_Scope; + + procedure Read_WorkspaceFoldersChangeEvent + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.WorkspaceFoldersChangeEvent) is + use WorkspaceFoldersChangeEvent_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case WorkspaceFoldersChangeEvent_Map.Get_Index (Key) is + when 1 => -- added + Read_WorkspaceFolder_Vector (Handler, Value.added); + when 2 => -- removed + Read_WorkspaceFolder_Vector (Handler, Value.removed); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_WorkspaceFoldersChangeEvent; + + package TypeDefinitionClientCapabilities_Scope is + package TypeDefinitionClientCapabilities_Map is new Minimal_Perfect_Hash + (["dynamicRegistration", + "linkSupport"]); + + end TypeDefinitionClientCapabilities_Scope; + + procedure Read_TypeDefinitionClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.TypeDefinitionClientCapabilities) is + use TypeDefinitionClientCapabilities_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case TypeDefinitionClientCapabilities_Map.Get_Index (Key) is + when 1 => -- dynamicRegistration + Value.dynamicRegistration := + (Is_Set => True, + Value => <>); + Value.dynamicRegistration.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 2 => -- linkSupport + Value.linkSupport := + (Is_Set => True, + Value => <>); + Value.linkSupport.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_TypeDefinitionClientCapabilities; + + package CreateFileOptions_Scope is + package CreateFileOptions_Map is new Minimal_Perfect_Hash + (["overwrite", + "ignoreIfExists"]); + + end CreateFileOptions_Scope; + + procedure Read_CreateFileOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CreateFileOptions) is + use CreateFileOptions_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case CreateFileOptions_Map.Get_Index (Key) is + when 1 => -- overwrite + Value.overwrite := + (Is_Set => True, + Value => <>); + Value.overwrite.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 2 => -- ignoreIfExists + Value.ignoreIfExists := + (Is_Set => True, + Value => <>); + Value.ignoreIfExists.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_CreateFileOptions; + + package DiagnosticRelatedInformation_Scope is + package DiagnosticRelatedInformation_Map is new Minimal_Perfect_Hash + (["location", + "message"]); + + end DiagnosticRelatedInformation_Scope; + + procedure Read_DiagnosticRelatedInformation + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DiagnosticRelatedInformation) is + use DiagnosticRelatedInformation_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case DiagnosticRelatedInformation_Map.Get_Index (Key) is + when 1 => -- location + Read_Location (Handler, Value.location); + when 2 => -- message + Value.message.Clear; + Value.message.Append (Handler.String_Value); + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_DiagnosticRelatedInformation; + + procedure Read_InsertTextMode + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.InsertTextMode) is + begin + Value := + LSP.Enumerations.InsertTextMode'Val + (Handler.Number_Value.Integer_Value - 1); + Handler.Read_Next; + end Read_InsertTextMode; + + procedure Read_InlineValue_Vector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.InlineValue_Vector_Or_Null) is + begin + if Handler.Is_Null_Value then + Handler.Read_Next; + else + Value.Clear; + Read_InlineValue_Vector (Handler, Value); + end if; + end Read_InlineValue_Vector_Or_Null; + + package DidCloseNotebookDocumentParams_Scope is + package DidCloseNotebookDocumentParams_Map is new Minimal_Perfect_Hash + (["notebookDocument", + "cellTextDocuments"]); + + end DidCloseNotebookDocumentParams_Scope; + + procedure Read_DidCloseNotebookDocumentParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DidCloseNotebookDocumentParams) is + use DidCloseNotebookDocumentParams_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case DidCloseNotebookDocumentParams_Map.Get_Index (Key) is + when 1 => -- notebookDocument + Read_NotebookDocumentIdentifier + (Handler, Value.notebookDocument); + when 2 => -- cellTextDocuments + Read_TextDocumentIdentifier_Vector + (Handler, Value.cellTextDocuments); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_DidCloseNotebookDocumentParams; + + package ImplementationOptions_Scope is + package ImplementationOptions_Map is new Minimal_Perfect_Hash + (["workDoneProgress"]); + + end ImplementationOptions_Scope; + + procedure Read_ImplementationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ImplementationOptions) is + use ImplementationOptions_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case ImplementationOptions_Map.Get_Index (Key) is + when 1 => -- workDoneProgress + Value.workDoneProgress := + (Is_Set => True, + Value => <>); + Value.workDoneProgress.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_ImplementationOptions; + + procedure Read_InlayHint_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.InlayHint_Vector) is + begin + pragma Assert (Handler.Is_Start_Array); + Handler.Read_Next; + + declare + Set : LSP.Structures.InlayHint_Vector renames Value; + Value : LSP.Structures.InlayHint; + begin + Set.Clear; + while not Handler.Is_End_Array loop + Read_InlayHint (Handler, Value); + Set.Append (Value); + end loop; + end; + + Handler.Read_Next; + end Read_InlayHint_Vector; + + package DocumentColorRegistrationOptions_Scope is + package DocumentColorRegistrationOptions_Map is new Minimal_Perfect_Hash + (["documentSelector", + "workDoneProgress", + "id"]); + + end DocumentColorRegistrationOptions_Scope; + + procedure Read_DocumentColorRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentColorRegistrationOptions) is + use DocumentColorRegistrationOptions_Scope; + procedure Read_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSelector_Or_Null); + + procedure Read_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSelector_Or_Null) is + begin + if Handler.Is_Null_Value then + Handler.Read_Next; + else + Value := + (Is_Null => False, + Value => <>); + Read_DocumentSelector (Handler, Value.Value); + end if; + end Read_DocumentSelector_Or_Null; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case DocumentColorRegistrationOptions_Map.Get_Index (Key) is + when 1 => -- documentSelector + Read_DocumentSelector_Or_Null + (Handler, Value.Parent.documentSelector); + when 2 => -- workDoneProgress + Value.workDoneProgress := + (Is_Set => True, + Value => <>); + Value.workDoneProgress.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 3 => -- id + Value.id.Clear; + Value.id.Append (Handler.String_Value); + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_DocumentColorRegistrationOptions; + + package CodeActionOptions_Scope is + package CodeActionOptions_Map is new Minimal_Perfect_Hash + (["workDoneProgress", + "codeActionKinds", + "resolveProvider"]); + + end CodeActionOptions_Scope; + + procedure Read_CodeActionOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CodeActionOptions) is + use CodeActionOptions_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case CodeActionOptions_Map.Get_Index (Key) is + when 1 => -- workDoneProgress + Value.workDoneProgress := + (Is_Set => True, + Value => <>); + Value.workDoneProgress.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 2 => -- codeActionKinds + Read_CodeActionKind_Set (Handler, Value.codeActionKinds); + when 3 => -- resolveProvider + Value.resolveProvider := + (Is_Set => True, + Value => <>); + Value.resolveProvider.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_CodeActionOptions; + + procedure Read_CompletionItemKind + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.CompletionItemKind) is + begin + Value := + LSP.Enumerations.CompletionItemKind'Val + (Handler.Number_Value.Integer_Value - 1); + Handler.Read_Next; + end Read_CompletionItemKind; + + package ShowDocumentParams_Scope is + package ShowDocumentParams_Map is new Minimal_Perfect_Hash + (["uri", + "external", + "takeFocus", + "selection"]); + + end ShowDocumentParams_Scope; + + procedure Read_ShowDocumentParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ShowDocumentParams) is + use ShowDocumentParams_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case ShowDocumentParams_Map.Get_Index (Key) is + when 1 => -- uri + Read_URI (Handler, Value.uri); + when 2 => -- external + Value.external := + (Is_Set => True, + Value => <>); + Value.external.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 3 => -- takeFocus + Value.takeFocus := + (Is_Set => True, + Value => <>); + Value.takeFocus.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 4 => -- selection + Value.selection := + (Is_Set => True, + Value => <>); + Read_A_Range (Handler, Value.selection.Value); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_ShowDocumentParams; + + package Command_Or_CodeAction_Scope is + package Command_Or_CodeAction_Map is new Minimal_Perfect_Hash + (["arguments", + "kind", + "diagnostics", + "isPreferred", + "disabled", + "edit", + "data"]); + + end Command_Or_CodeAction_Scope; + + procedure Read_Command_Or_CodeAction + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Command_Or_CodeAction) is + use Command_Or_CodeAction_Scope; + begin + declare + Parent : + constant not null access VSS.JSON.Pull_Readers.JSON_Pull_Reader' + Class := + Handler'Access; + Handler : + VSS.JSON.Pull_Readers.Buffered.JSON_Buffered_Pull_Reader (Parent); + begin + Handler.Mark; + if Handler.Is_Start_Object then + Handler.Read_Next; + while Handler.Is_Key_Name loop + declare + Key : constant VSS.Strings.Virtual_String := + Handler.Key_Name; + Index : constant Natural := + Command_Or_CodeAction_Map.Get_Index (Key); + begin + Handler.Read_Next; + case Index is + when 1 => -- arguments + Value := + (Is_Command => True, + others => <>); + exit; + when 2 => -- kind + Value := + (Is_Command => False, + others => <>); + exit; + when 3 => -- diagnostics + Value := + (Is_Command => False, + others => <>); + exit; + when 4 => -- isPreferred + Value := + (Is_Command => False, + others => <>); + exit; + when 5 => -- disabled + Value := + (Is_Command => False, + others => <>); + exit; + when 6 => -- edit + Value := + (Is_Command => False, + others => <>); + exit; + when 7 => -- data + Value := + (Is_Command => False, + others => <>); + exit; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + else + raise Program_Error; -- Unexpected JSON value + end if; + + Handler.Reset; + Handler.Unmark; + + case Value.Is_Command is + when True => + Read_Command (Handler, Value.Command); + when False => + Read_CodeAction (Handler, Value.CodeAction); + end case; + end; + end Read_Command_Or_CodeAction; + + package CreateFilesParams_Scope is + package CreateFilesParams_Map is new Minimal_Perfect_Hash (["files"]); + + end CreateFilesParams_Scope; + + procedure Read_CreateFilesParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CreateFilesParams) is + use CreateFilesParams_Scope; + procedure Read_FileCreate_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.FileCreate_Vector); + + procedure Read_FileCreate_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.FileCreate_Vector) is + begin + pragma Assert (Handler.Is_Start_Array); + Handler.Read_Next; + + declare + Set : LSP.Structures.FileCreate_Vector renames Value; + Value : LSP.Structures.FileCreate; + begin + Set.Clear; + while not Handler.Is_End_Array loop + Read_FileCreate (Handler, Value); + Set.Append (Value); + end loop; + end; + + Handler.Read_Next; + end Read_FileCreate_Vector; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case CreateFilesParams_Map.Get_Index (Key) is + when 1 => -- files + Read_FileCreate_Vector (Handler, Value.files); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_CreateFilesParams; + + procedure Read_ColorPresentation_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ColorPresentation_Vector) is + begin + pragma Assert (Handler.Is_Start_Array); + Handler.Read_Next; + + declare + Set : LSP.Structures.ColorPresentation_Vector renames Value; + Value : LSP.Structures.ColorPresentation; + begin + Set.Clear; + while not Handler.Is_End_Array loop + Read_ColorPresentation (Handler, Value); + Set.Append (Value); + end loop; + end; + + Handler.Read_Next; + end Read_ColorPresentation_Vector; + + procedure Read_ChangeAnnotationIdentifier + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ChangeAnnotationIdentifier) is + begin + Value.Clear; + Value.Append (Handler.String_Value); + Handler.Read_Next; + end Read_ChangeAnnotationIdentifier; + + package DocumentFormattingParams_Scope is + package DocumentFormattingParams_Map is new Minimal_Perfect_Hash + (["workDoneToken", + "textDocument", + "options"]); + + end DocumentFormattingParams_Scope; + + procedure Read_DocumentFormattingParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentFormattingParams) is + use DocumentFormattingParams_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case DocumentFormattingParams_Map.Get_Index (Key) is + when 1 => -- workDoneToken + Value.workDoneToken := + (Is_Set => True, + Value => <>); + Read_ProgressToken (Handler, Value.workDoneToken.Value); + when 2 => -- textDocument + Read_TextDocumentIdentifier (Handler, Value.textDocument); + when 3 => -- options + Read_FormattingOptions (Handler, Value.options); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_DocumentFormattingParams; + + package SignatureHelpContext_Scope is + package SignatureHelpContext_Map is new Minimal_Perfect_Hash + (["triggerKind", + "triggerCharacter", + "isRetrigger", + "activeSignatureHelp"]); + + end SignatureHelpContext_Scope; + + procedure Read_SignatureHelpContext + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SignatureHelpContext) is + use SignatureHelpContext_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case SignatureHelpContext_Map.Get_Index (Key) is + when 1 => -- triggerKind + Read_SignatureHelpTriggerKind (Handler, Value.triggerKind); + when 2 => -- triggerCharacter + Value.triggerCharacter.Clear; + Value.triggerCharacter.Append (Handler.String_Value); + Handler.Read_Next; + when 3 => -- isRetrigger + Value.isRetrigger := Handler.Boolean_Value; + Handler.Read_Next; + when 4 => -- activeSignatureHelp + Value.activeSignatureHelp := + (Is_Set => True, + Value => <>); + Read_SignatureHelp + (Handler, Value.activeSignatureHelp.Value); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_SignatureHelpContext; + + package DeleteFilesParams_Scope is + package DeleteFilesParams_Map is new Minimal_Perfect_Hash (["files"]); + + end DeleteFilesParams_Scope; + + procedure Read_DeleteFilesParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DeleteFilesParams) is + use DeleteFilesParams_Scope; + procedure Read_FileDelete_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.FileDelete_Vector); + + procedure Read_FileDelete_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.FileDelete_Vector) is + begin + pragma Assert (Handler.Is_Start_Array); + Handler.Read_Next; + + declare + Set : LSP.Structures.FileDelete_Vector renames Value; + Value : LSP.Structures.FileDelete; + begin + Set.Clear; + while not Handler.Is_End_Array loop + Read_FileDelete (Handler, Value); + Set.Append (Value); + end loop; + end; + + Handler.Read_Next; + end Read_FileDelete_Vector; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case DeleteFilesParams_Map.Get_Index (Key) is + when 1 => -- files + Read_FileDelete_Vector (Handler, Value.files); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_DeleteFilesParams; + + procedure Read_TypeHierarchyItem_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.TypeHierarchyItem_Vector) is + begin + pragma Assert (Handler.Is_Start_Array); + Handler.Read_Next; + + declare + Set : LSP.Structures.TypeHierarchyItem_Vector renames Value; + Value : LSP.Structures.TypeHierarchyItem; + begin + Set.Clear; + while not Handler.Is_End_Array loop + Read_TypeHierarchyItem (Handler, Value); + Set.Append (Value); + end loop; + end; + + Handler.Read_Next; + end Read_TypeHierarchyItem_Vector; + + package DocumentOnTypeFormattingParams_Scope is + package DocumentOnTypeFormattingParams_Map is new Minimal_Perfect_Hash + (["textDocument", + "position", + "ch", + "options"]); + + end DocumentOnTypeFormattingParams_Scope; + + procedure Read_DocumentOnTypeFormattingParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentOnTypeFormattingParams) is + use DocumentOnTypeFormattingParams_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case DocumentOnTypeFormattingParams_Map.Get_Index (Key) is + when 1 => -- textDocument + Read_TextDocumentIdentifier (Handler, Value.textDocument); + when 2 => -- position + Read_Position (Handler, Value.position); + when 3 => -- ch + Value.ch.Clear; + Value.ch.Append (Handler.String_Value); + Handler.Read_Next; + when 4 => -- options + Read_FormattingOptions (Handler, Value.options); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_DocumentOnTypeFormattingParams; + + package CallHierarchyOutgoingCall_Scope is + package CallHierarchyOutgoingCall_Map is new Minimal_Perfect_Hash + (["to", + "fromRanges"]); + + end CallHierarchyOutgoingCall_Scope; + + procedure Read_CallHierarchyOutgoingCall + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CallHierarchyOutgoingCall) is + use CallHierarchyOutgoingCall_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case CallHierarchyOutgoingCall_Map.Get_Index (Key) is + when 1 => -- to + Read_CallHierarchyItem (Handler, Value.to); + when 2 => -- fromRanges + Read_Range_Vector (Handler, Value.fromRanges); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_CallHierarchyOutgoingCall; + + procedure Read_Location_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Location_Vector) is + begin + pragma Assert (Handler.Is_Start_Array); + Handler.Read_Next; + + declare + Set : LSP.Structures.Location_Vector renames Value; + Value : LSP.Structures.Location; + begin + Set.Clear; + while not Handler.Is_End_Array loop + Read_Location (Handler, Value); + Set.Append (Value); + end loop; + end; + + Handler.Read_Next; + end Read_Location_Vector; + + package TextDocumentContentChangeEvent_Scope is + package TextDocumentContentChangeEvent_Map is new Minimal_Perfect_Hash + (["range", + "rangeLength", + "text"]); + + end TextDocumentContentChangeEvent_Scope; + + procedure Read_TextDocumentContentChangeEvent + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.TextDocumentContentChangeEvent) is + use TextDocumentContentChangeEvent_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while Handler.Is_Key_Name loop + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case TextDocumentContentChangeEvent_Map.Get_Index (Key) is + when 1 => -- range + Value.a_range := + (Is_Set => True, + Value => <>); + Read_A_Range (Handler, Value.a_range.Value); + when 2 => -- rangeLength + Value.rangeLength := + (Is_Set => True, + Value => <>); + Value.rangeLength.Value := + Integer (Handler.Number_Value.Integer_Value); + Handler.Read_Next; + when 3 => -- text + Value.text.Clear; + Value.text.Append (Handler.String_Value); + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_TextDocumentContentChangeEvent; + + package DocumentColorParams_Scope is + package DocumentColorParams_Map is new Minimal_Perfect_Hash + (["workDoneToken", + "partialResultToken", + "textDocument"]); + + end DocumentColorParams_Scope; + + procedure Read_DocumentColorParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentColorParams) is + use DocumentColorParams_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case DocumentColorParams_Map.Get_Index (Key) is + when 1 => -- workDoneToken + Value.workDoneToken := + (Is_Set => True, + Value => <>); + Read_ProgressToken (Handler, Value.workDoneToken.Value); + when 2 => -- partialResultToken + Value.partialResultToken := + (Is_Set => True, + Value => <>); + Read_ProgressToken (Handler, Value.partialResultToken.Value); + when 3 => -- textDocument + Read_TextDocumentIdentifier (Handler, Value.textDocument); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_DocumentColorParams; + + package WorkspaceFolder_Scope is + package WorkspaceFolder_Map is new Minimal_Perfect_Hash + (["uri", + "name"]); + + end WorkspaceFolder_Scope; + + procedure Read_WorkspaceFolder + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.WorkspaceFolder) is + use WorkspaceFolder_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case WorkspaceFolder_Map.Get_Index (Key) is + when 1 => -- uri + Read_URI (Handler, Value.uri); + when 2 => -- name + Value.name.Clear; + Value.name.Append (Handler.String_Value); + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_WorkspaceFolder; + + package MarkedString_Scope is + package MarkedString_Map is new Minimal_Perfect_Hash + (["language", + "value"]); + + end MarkedString_Scope; + + procedure Read_MarkedString + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.MarkedString) is + use MarkedString_Scope; + begin + if Handler.Is_String_Value then + Value := + (Is_Virtual_String => True, + others => <>); + else + Value := + (Is_Virtual_String => False, + others => <>); + end if; + + case Value.Is_Virtual_String is + when True => + Value.Virtual_String.Clear; + Value.Virtual_String.Append (Handler.String_Value); + Handler.Read_Next; + when False => + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while Handler.Is_Key_Name loop + declare + Key : constant VSS.Strings.Virtual_String := + Handler.Key_Name; + begin + Handler.Read_Next; + case MarkedString_Map.Get_Index (Key) is + when 1 => -- language + Value.language.Clear; + Value.language.Append (Handler.String_Value); + Handler.Read_Next; + when 2 => -- value + Value.value.Clear; + Value.value.Append (Handler.String_Value); + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end case; + end Read_MarkedString; + + package NotebookCell_Scope is + package NotebookCell_Map is new Minimal_Perfect_Hash + (["kind", + "document", + "metadata", + "executionSummary"]); + + end NotebookCell_Scope; + + procedure Read_NotebookCell + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.NotebookCell) is + use NotebookCell_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case NotebookCell_Map.Get_Index (Key) is + when 1 => -- kind + Read_NotebookCellKind (Handler, Value.kind); + when 2 => -- document + Value.document := (Handler.String_Value with null record); + Handler.Read_Next; + when 3 => -- metadata + Value.metadata := + (Is_Set => True, + Value => <>); + Read_LSPObject (Handler, Value.metadata.Value); + when 4 => -- executionSummary + Value.executionSummary := + (Is_Set => True, + Value => <>); + Read_ExecutionSummary + (Handler, Value.executionSummary.Value); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_NotebookCell; + + package DocumentLink_Scope is + package DocumentLink_Map is new Minimal_Perfect_Hash + (["range", + "target", + "tooltip", + "data"]); + + end DocumentLink_Scope; + + procedure Read_DocumentLink + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentLink) is + use DocumentLink_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case DocumentLink_Map.Get_Index (Key) is + when 1 => -- range + Read_A_Range (Handler, Value.a_range); + when 2 => -- target + Value.target.Clear; + Value.target.Append (Handler.String_Value); + Handler.Read_Next; + when 3 => -- tooltip + Value.tooltip.Clear; + Value.tooltip.Append (Handler.String_Value); + Handler.Read_Next; + when 4 => -- data + Read_LSPAny (Handler, Value.data); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_DocumentLink; + + package WorkspaceFoldersServerCapabilities_Scope is + package WorkspaceFoldersServerCapabilities_Map is new Minimal_Perfect_Hash + (["supported", + "changeNotifications"]); + + end WorkspaceFoldersServerCapabilities_Scope; + + procedure Read_WorkspaceFoldersServerCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.WorkspaceFoldersServerCapabilities) is + use WorkspaceFoldersServerCapabilities_Scope; + procedure Read_Virtual_String_Or_Boolean + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Virtual_String_Or_Boolean); + + procedure Read_Virtual_String_Or_Boolean + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Virtual_String_Or_Boolean) is + begin + if Handler.Is_String_Value then + Value := + (Is_Virtual_String => True, + others => <>); + else + Value := + (Is_Virtual_String => False, + others => <>); + end if; + + case Value.Is_Virtual_String is + when True => + Value.Virtual_String.Clear; + Value.Virtual_String.Append (Handler.String_Value); + Handler.Read_Next; + when False => + Value.Boolean := Handler.Boolean_Value; + Handler.Read_Next; + end case; + end Read_Virtual_String_Or_Boolean; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case WorkspaceFoldersServerCapabilities_Map.Get_Index (Key) is + when 1 => -- supported + Value.supported := + (Is_Set => True, + Value => <>); + Value.supported.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 2 => -- changeNotifications + Value.changeNotifications := + (Is_Set => True, + Value => <>); + Read_Virtual_String_Or_Boolean + (Handler, Value.changeNotifications.Value); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_WorkspaceFoldersServerCapabilities; + + package WorkDoneProgressEnd_Scope is + package WorkDoneProgressEnd_Map is new Minimal_Perfect_Hash + (["kind", + "message"]); + + end WorkDoneProgressEnd_Scope; + + procedure Read_WorkDoneProgressEnd + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.WorkDoneProgressEnd) is + use WorkDoneProgressEnd_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case WorkDoneProgressEnd_Map.Get_Index (Key) is + when 1 => -- kind + Handler.Read_Next; -- Skip string literal: end + when 2 => -- message + Value.message.Clear; + Value.message.Append (Handler.String_Value); + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_WorkDoneProgressEnd; + + package SemanticTokensRegistrationOptions_Scope is + package SemanticTokensRegistrationOptions_Map is new Minimal_Perfect_Hash + (["documentSelector", + "workDoneProgress", + "legend", + "range", + "full", + "id"]); + + end SemanticTokensRegistrationOptions_Scope; + + procedure Read_SemanticTokensRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SemanticTokensRegistrationOptions) is + use SemanticTokensRegistrationOptions_Scope; + procedure Read_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSelector_Or_Null); + + procedure Read_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSelector_Or_Null) is + begin + if Handler.Is_Null_Value then + Handler.Read_Next; + else + Value := + (Is_Null => False, + Value => <>); + Read_DocumentSelector (Handler, Value.Value); + end if; + end Read_DocumentSelector_Or_Null; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case SemanticTokensRegistrationOptions_Map.Get_Index (Key) is + when 1 => -- documentSelector + Read_DocumentSelector_Or_Null + (Handler, Value.Parent.documentSelector); + when 2 => -- workDoneProgress + Value.workDoneProgress := + (Is_Set => True, + Value => <>); + Value.workDoneProgress.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 3 => -- legend + Read_SemanticTokensLegend (Handler, Value.legend); + when 4 => -- range + Value.a_range := + (Is_Set => True, + Value => <>); + Read_Boolean_Or_Any (Handler, Value.a_range.Value); + when 5 => -- full + Value.full := + (Is_Set => True, + Value => <>); + Read_Boolean_Or_Something (Handler, Value.full.Value); + when 6 => -- id + Value.id.Clear; + Value.id.Append (Handler.String_Value); + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_SemanticTokensRegistrationOptions; + + procedure Read_CompletionTriggerKind + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.CompletionTriggerKind) is + begin + Value := + LSP.Enumerations.CompletionTriggerKind'Val + (Handler.Number_Value.Integer_Value - 1); + Handler.Read_Next; + end Read_CompletionTriggerKind; + + package CallHierarchyRegistrationOptions_Scope is + package CallHierarchyRegistrationOptions_Map is new Minimal_Perfect_Hash + (["documentSelector", + "workDoneProgress", + "id"]); + + end CallHierarchyRegistrationOptions_Scope; + + procedure Read_CallHierarchyRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CallHierarchyRegistrationOptions) is + use CallHierarchyRegistrationOptions_Scope; + procedure Read_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSelector_Or_Null); + + procedure Read_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSelector_Or_Null) is + begin + if Handler.Is_Null_Value then + Handler.Read_Next; + else + Value := + (Is_Null => False, + Value => <>); + Read_DocumentSelector (Handler, Value.Value); + end if; + end Read_DocumentSelector_Or_Null; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case CallHierarchyRegistrationOptions_Map.Get_Index (Key) is + when 1 => -- documentSelector + Read_DocumentSelector_Or_Null + (Handler, Value.Parent.documentSelector); + when 2 => -- workDoneProgress + Value.workDoneProgress := + (Is_Set => True, + Value => <>); + Value.workDoneProgress.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 3 => -- id + Value.id.Clear; + Value.id.Append (Handler.String_Value); + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_CallHierarchyRegistrationOptions; + + package CallHierarchyClientCapabilities_Scope is + package CallHierarchyClientCapabilities_Map is new Minimal_Perfect_Hash + (["dynamicRegistration"]); + + end CallHierarchyClientCapabilities_Scope; + + procedure Read_CallHierarchyClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CallHierarchyClientCapabilities) is + use CallHierarchyClientCapabilities_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case CallHierarchyClientCapabilities_Map.Get_Index (Key) is + when 1 => -- dynamicRegistration + Value.dynamicRegistration := + (Is_Set => True, + Value => <>); + Value.dynamicRegistration.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_CallHierarchyClientCapabilities; + + package DocumentSymbolParams_Scope is + package DocumentSymbolParams_Map is new Minimal_Perfect_Hash + (["workDoneToken", + "partialResultToken", + "textDocument"]); + + end DocumentSymbolParams_Scope; + + procedure Read_DocumentSymbolParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSymbolParams) is + use DocumentSymbolParams_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case DocumentSymbolParams_Map.Get_Index (Key) is + when 1 => -- workDoneToken + Value.workDoneToken := + (Is_Set => True, + Value => <>); + Read_ProgressToken (Handler, Value.workDoneToken.Value); + when 2 => -- partialResultToken + Value.partialResultToken := + (Is_Set => True, + Value => <>); + Read_ProgressToken (Handler, Value.partialResultToken.Value); + when 3 => -- textDocument + Read_TextDocumentIdentifier (Handler, Value.textDocument); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_DocumentSymbolParams; + + package DocumentRangeFormattingOptions_Scope is + package DocumentRangeFormattingOptions_Map is new Minimal_Perfect_Hash + (["workDoneProgress"]); + + end DocumentRangeFormattingOptions_Scope; + + procedure Read_DocumentRangeFormattingOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentRangeFormattingOptions) is + use DocumentRangeFormattingOptions_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case DocumentRangeFormattingOptions_Map.Get_Index (Key) is + when 1 => -- workDoneProgress + Value.workDoneProgress := + (Is_Set => True, + Value => <>); + Value.workDoneProgress.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_DocumentRangeFormattingOptions; + + package InlayHintWorkspaceClientCapabilities_Scope is + package InlayHintWorkspaceClientCapabilities_Map is new Minimal_Perfect_Hash + (["refreshSupport"]); + + end InlayHintWorkspaceClientCapabilities_Scope; + + procedure Read_InlayHintWorkspaceClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.InlayHintWorkspaceClientCapabilities) is + use InlayHintWorkspaceClientCapabilities_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case InlayHintWorkspaceClientCapabilities_Map.Get_Index (Key) is + when 1 => -- refreshSupport + Value.refreshSupport := + (Is_Set => True, + Value => <>); + Value.refreshSupport.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_InlayHintWorkspaceClientCapabilities; + + procedure Read_InlineValue_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.InlineValue_Vector) is + begin + pragma Assert (Handler.Is_Start_Array); + Handler.Read_Next; + + declare + Set : LSP.Structures.InlineValue_Vector renames Value; + Value : LSP.Structures.InlineValue; + begin + Set.Clear; + while not Handler.Is_End_Array loop + Read_InlineValue (Handler, Value); + Set.Append (Value); + end loop; + end; + + Handler.Read_Next; + end Read_InlineValue_Vector; + + package DiagnosticServerCancellationData_Scope is + package DiagnosticServerCancellationData_Map is new Minimal_Perfect_Hash + (["retriggerRequest"]); + + end DiagnosticServerCancellationData_Scope; + + procedure Read_DiagnosticServerCancellationData + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DiagnosticServerCancellationData) is + use DiagnosticServerCancellationData_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case DiagnosticServerCancellationData_Map.Get_Index (Key) is + when 1 => -- retriggerRequest + Value.retriggerRequest := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_DiagnosticServerCancellationData; + + package DocumentColorOptions_Scope is + package DocumentColorOptions_Map is new Minimal_Perfect_Hash + (["workDoneProgress"]); + + end DocumentColorOptions_Scope; + + procedure Read_DocumentColorOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentColorOptions) is + use DocumentColorOptions_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case DocumentColorOptions_Map.Get_Index (Key) is + when 1 => -- workDoneProgress + Value.workDoneProgress := + (Is_Set => True, + Value => <>); + Value.workDoneProgress.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_DocumentColorOptions; + + procedure Read_InitializedParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.InitializedParams) is + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + Handler.Skip_Current_Value; + end; + end loop; + + Handler.Read_Next; + end Read_InitializedParams; + + package FileOperationPatternKind_Map is new Minimal_Perfect_Hash + (["file", + "folder"]); + + procedure Read_FileOperationPatternKind + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.FileOperationPatternKind) is + begin + Value := + LSP.Enumerations.FileOperationPatternKind'Val + (FileOperationPatternKind_Map.Get_Index (Handler.String_Value) - 1); + Handler.Read_Next; + end Read_FileOperationPatternKind; + + package Unregistration_Scope is + package Unregistration_Map is new Minimal_Perfect_Hash + (["id", + "method"]); + + end Unregistration_Scope; + + procedure Read_Unregistration + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Unregistration) is + use Unregistration_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case Unregistration_Map.Get_Index (Key) is + when 1 => -- id + Value.id.Clear; + Value.id.Append (Handler.String_Value); + Handler.Read_Next; + when 2 => -- method + Value.method.Clear; + Value.method.Append (Handler.String_Value); + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_Unregistration; + + package HoverOptions_Scope is + package HoverOptions_Map is new Minimal_Perfect_Hash + (["workDoneProgress"]); + + end HoverOptions_Scope; + + procedure Read_HoverOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.HoverOptions) is + use HoverOptions_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case HoverOptions_Map.Get_Index (Key) is + when 1 => -- workDoneProgress + Value.workDoneProgress := + (Is_Set => True, + Value => <>); + Value.workDoneProgress.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_HoverOptions; + + package DocumentOnTypeFormattingRegistrationOptions_Scope is + package DocumentOnTypeFormattingRegistrationOptions_Map is new Minimal_Perfect_Hash + (["documentSelector", + "firstTriggerCharacter", + "moreTriggerCharacter"]); + + end DocumentOnTypeFormattingRegistrationOptions_Scope; + + procedure Read_DocumentOnTypeFormattingRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .DocumentOnTypeFormattingRegistrationOptions) is + use DocumentOnTypeFormattingRegistrationOptions_Scope; + procedure Read_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSelector_Or_Null); + + procedure Read_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSelector_Or_Null) is + begin + if Handler.Is_Null_Value then + Handler.Read_Next; + else + Value := + (Is_Null => False, + Value => <>); + Read_DocumentSelector (Handler, Value.Value); + end if; + end Read_DocumentSelector_Or_Null; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case DocumentOnTypeFormattingRegistrationOptions_Map.Get_Index + (Key) is + when 1 => -- documentSelector + Read_DocumentSelector_Or_Null + (Handler, Value.Parent.documentSelector); + when 2 => -- firstTriggerCharacter + Value.firstTriggerCharacter.Clear; + Value.firstTriggerCharacter.Append (Handler.String_Value); + Handler.Read_Next; + when 3 => -- moreTriggerCharacter + Read_Virtual_String_Vector + (Handler, Value.moreTriggerCharacter); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_DocumentOnTypeFormattingRegistrationOptions; + + procedure Read_relatedDocuments_OfDocumentDiagnosticReportPartialResult + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .relatedDocuments_OfDocumentDiagnosticReportPartialResult) is + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + declare + Map : + LSP.Structures + .relatedDocuments_OfDocumentDiagnosticReportPartialResult renames + Value; + Key : LSP.Structures.DocumentUri; + Value : + LSP.Structures + .relatedDocuments_OfDocumentDiagnosticReportPartialResult_Item; + begin + Key := (Handler.Key_Name with null record); + Handler.Read_Next; + Read_relatedDocuments_OfDocumentDiagnosticReportPartialResult_Item + (Handler, Value); + Map.Insert (Key, Value); + end; + end loop; + + Handler.Read_Next; + + end Read_relatedDocuments_OfDocumentDiagnosticReportPartialResult; + + package ReferenceClientCapabilities_Scope is + package ReferenceClientCapabilities_Map is new Minimal_Perfect_Hash + (["dynamicRegistration"]); + + end ReferenceClientCapabilities_Scope; + + procedure Read_ReferenceClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ReferenceClientCapabilities) is + use ReferenceClientCapabilities_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case ReferenceClientCapabilities_Map.Get_Index (Key) is + when 1 => -- dynamicRegistration + Value.dynamicRegistration := + (Is_Set => True, + Value => <>); + Value.dynamicRegistration.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_ReferenceClientCapabilities; + + package MonikerClientCapabilities_Scope is + package MonikerClientCapabilities_Map is new Minimal_Perfect_Hash + (["dynamicRegistration"]); + + end MonikerClientCapabilities_Scope; + + procedure Read_MonikerClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.MonikerClientCapabilities) is + use MonikerClientCapabilities_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case MonikerClientCapabilities_Map.Get_Index (Key) is + when 1 => -- dynamicRegistration + Value.dynamicRegistration := + (Is_Set => True, + Value => <>); + Value.dynamicRegistration.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_MonikerClientCapabilities; + + procedure Read_CompletionItemTag_Set + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CompletionItemTag_Set) is + begin + pragma Assert (Handler.Is_Start_Array); + Handler.Read_Next; + + declare + Set : LSP.Structures.CompletionItemTag_Set renames Value; + Value : LSP.Enumerations.CompletionItemTag; + begin + Set := (others => False); + while not Handler.Is_End_Array loop + Read_CompletionItemTag (Handler, Value); + Set (Value) := True; + end loop; + end; + + Handler.Read_Next; + end Read_CompletionItemTag_Set; + + package ColorInformation_Scope is + package ColorInformation_Map is new Minimal_Perfect_Hash + (["range", + "color"]); + + end ColorInformation_Scope; + + procedure Read_ColorInformation + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ColorInformation) is + use ColorInformation_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case ColorInformation_Map.Get_Index (Key) is + when 1 => -- range + Read_A_Range (Handler, Value.a_range); + when 2 => -- color + Read_Color (Handler, Value.color); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_ColorInformation; + + package A_Range_Scope is + package A_Range_Map is new Minimal_Perfect_Hash + (["start", + "end"]); + + end A_Range_Scope; + + procedure Read_A_Range + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.A_Range) is + use A_Range_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case A_Range_Map.Get_Index (Key) is + when 1 => -- start + Read_Position (Handler, Value.start); + when 2 => -- end + Read_Position (Handler, Value.an_end); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_A_Range; + + package ShowMessageRequestParams_Scope is + package ShowMessageRequestParams_Map is new Minimal_Perfect_Hash + (["type", + "message", + "actions"]); + + end ShowMessageRequestParams_Scope; + + procedure Read_ShowMessageRequestParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ShowMessageRequestParams) is + use ShowMessageRequestParams_Scope; + procedure Read_MessageActionItem_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.MessageActionItem_Vector); + + procedure Read_MessageActionItem_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.MessageActionItem_Vector) is + begin + pragma Assert (Handler.Is_Start_Array); + Handler.Read_Next; + + declare + Set : LSP.Structures.MessageActionItem_Vector renames Value; + Value : LSP.Structures.MessageActionItem; + begin + Set.Clear; + while not Handler.Is_End_Array loop + Read_MessageActionItem (Handler, Value); + Set.Append (Value); + end loop; + end; + + Handler.Read_Next; + end Read_MessageActionItem_Vector; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case ShowMessageRequestParams_Map.Get_Index (Key) is + when 1 => -- type + Read_MessageType (Handler, Value.a_type); + when 2 => -- message + Value.message.Clear; + Value.message.Append (Handler.String_Value); + Handler.Read_Next; + when 3 => -- actions + Read_MessageActionItem_Vector (Handler, Value.actions); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_ShowMessageRequestParams; + + package DocumentColorClientCapabilities_Scope is + package DocumentColorClientCapabilities_Map is new Minimal_Perfect_Hash + (["dynamicRegistration"]); + + end DocumentColorClientCapabilities_Scope; + + procedure Read_DocumentColorClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentColorClientCapabilities) is + use DocumentColorClientCapabilities_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case DocumentColorClientCapabilities_Map.Get_Index (Key) is + when 1 => -- dynamicRegistration + Value.dynamicRegistration := + (Is_Set => True, + Value => <>); + Value.dynamicRegistration.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_DocumentColorClientCapabilities; + + procedure Read_WorkspaceEdit_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.WorkspaceEdit_Or_Null) is + begin + if Handler.Is_Null_Value then + Handler.Read_Next; + else + Value := + (Is_Null => False, + Value => <>); + Read_WorkspaceEdit (Handler, Value.Value); + end if; + end Read_WorkspaceEdit_Or_Null; + + package InlineValueEvaluatableExpression_Scope is + package InlineValueEvaluatableExpression_Map is new Minimal_Perfect_Hash + (["range", + "expression"]); + + end InlineValueEvaluatableExpression_Scope; + + procedure Read_InlineValueEvaluatableExpression + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.InlineValueEvaluatableExpression) is + use InlineValueEvaluatableExpression_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case InlineValueEvaluatableExpression_Map.Get_Index (Key) is + when 1 => -- range + Read_A_Range (Handler, Value.a_range); + when 2 => -- expression + Value.expression.Clear; + Value.expression.Append (Handler.String_Value); + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_InlineValueEvaluatableExpression; + + procedure Read_Pattern + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Pattern) is + begin + Value.Clear; + Value.Append (Handler.String_Value); + Handler.Read_Next; + end Read_Pattern; + + procedure Read_DiagnosticTag_Set + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DiagnosticTag_Set) is + begin + pragma Assert (Handler.Is_Start_Array); + Handler.Read_Next; + + declare + Set : LSP.Structures.DiagnosticTag_Set renames Value; + Value : LSP.Enumerations.DiagnosticTag; + begin + Set := (others => False); + while not Handler.Is_End_Array loop + Read_DiagnosticTag (Handler, Value); + Set (Value) := True; + end loop; + end; + + Handler.Read_Next; + end Read_DiagnosticTag_Set; + + package NotebookCellArrayChange_Scope is + package NotebookCellArrayChange_Map is new Minimal_Perfect_Hash + (["start", + "deleteCount", + "cells"]); + + end NotebookCellArrayChange_Scope; + + procedure Read_NotebookCellArrayChange + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.NotebookCellArrayChange) is + use NotebookCellArrayChange_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case NotebookCellArrayChange_Map.Get_Index (Key) is + when 1 => -- start + Value.start := Integer (Handler.Number_Value.Integer_Value); + Handler.Read_Next; + when 2 => -- deleteCount + Value.deleteCount := + Integer (Handler.Number_Value.Integer_Value); + Handler.Read_Next; + when 3 => -- cells + Read_NotebookCell_Vector (Handler, Value.cells); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_NotebookCellArrayChange; + + package DocumentLinkRegistrationOptions_Scope is + package DocumentLinkRegistrationOptions_Map is new Minimal_Perfect_Hash + (["documentSelector", + "workDoneProgress", + "resolveProvider"]); + + end DocumentLinkRegistrationOptions_Scope; + + procedure Read_DocumentLinkRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentLinkRegistrationOptions) is + use DocumentLinkRegistrationOptions_Scope; + procedure Read_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSelector_Or_Null); + + procedure Read_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSelector_Or_Null) is + begin + if Handler.Is_Null_Value then + Handler.Read_Next; + else + Value := + (Is_Null => False, + Value => <>); + Read_DocumentSelector (Handler, Value.Value); + end if; + end Read_DocumentSelector_Or_Null; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case DocumentLinkRegistrationOptions_Map.Get_Index (Key) is + when 1 => -- documentSelector + Read_DocumentSelector_Or_Null + (Handler, Value.Parent.documentSelector); + when 2 => -- workDoneProgress + Value.workDoneProgress := + (Is_Set => True, + Value => <>); + Value.workDoneProgress.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 3 => -- resolveProvider + Value.resolveProvider := + (Is_Set => True, + Value => <>); + Value.resolveProvider.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_DocumentLinkRegistrationOptions; + + procedure Read_DocumentHighlight_Vector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentHighlight_Vector_Or_Null) is + begin + if Handler.Is_Null_Value then + Handler.Read_Next; + else + Value.Clear; + Read_DocumentHighlight_Vector (Handler, Value); + end if; + end Read_DocumentHighlight_Vector_Or_Null; + + package LogMessageParams_Scope is + package LogMessageParams_Map is new Minimal_Perfect_Hash + (["type", + "message"]); + + end LogMessageParams_Scope; + + procedure Read_LogMessageParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.LogMessageParams) is + use LogMessageParams_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case LogMessageParams_Map.Get_Index (Key) is + when 1 => -- type + Read_MessageType (Handler, Value.a_type); + when 2 => -- message + Value.message.Clear; + Value.message.Append (Handler.String_Value); + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_LogMessageParams; + + package CodeLens_Scope is + package CodeLens_Map is new Minimal_Perfect_Hash + (["range", + "command", + "data"]); + + end CodeLens_Scope; + + procedure Read_CodeLens + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CodeLens) is + use CodeLens_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case CodeLens_Map.Get_Index (Key) is + when 1 => -- range + Read_A_Range (Handler, Value.a_range); + when 2 => -- command + Value.command := + (Is_Set => True, + Value => <>); + Read_Command (Handler, Value.command.Value); + when 3 => -- data + Read_LSPAny (Handler, Value.data); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_CodeLens; + + package DocumentDiagnosticReportPartialResult_Scope is + package DocumentDiagnosticReportPartialResult_Map is new Minimal_Perfect_Hash + (["relatedDocuments"]); + + end DocumentDiagnosticReportPartialResult_Scope; + + procedure Read_DocumentDiagnosticReportPartialResult + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentDiagnosticReportPartialResult) is + use DocumentDiagnosticReportPartialResult_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case DocumentDiagnosticReportPartialResult_Map.Get_Index (Key) is + when 1 => -- relatedDocuments + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + declare + Map : + LSP.Structures + .relatedDocuments_OfDocumentDiagnosticReportPartialResult renames + Value.relatedDocuments; + Key : LSP.Structures.DocumentUri; + Value : + LSP.Structures + .relatedDocuments_OfDocumentDiagnosticReportPartialResult_Item; + begin + Key := (Handler.Key_Name with null record); + Handler.Read_Next; + Read_relatedDocuments_OfDocumentDiagnosticReportPartialResult_Item + (Handler, Value); + Map.Insert (Key, Value); + end; + end loop; + + Handler.Read_Next; + + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_DocumentDiagnosticReportPartialResult; + + procedure Read_CallHierarchyIncomingCall_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CallHierarchyIncomingCall_Vector) is + begin + pragma Assert (Handler.Is_Start_Array); + Handler.Read_Next; + + declare + Set : LSP.Structures.CallHierarchyIncomingCall_Vector renames Value; + Value : LSP.Structures.CallHierarchyIncomingCall; + begin + Set.Clear; + while not Handler.Is_End_Array loop + Read_CallHierarchyIncomingCall (Handler, Value); + Set.Append (Value); + end loop; + end; + + Handler.Read_Next; + end Read_CallHierarchyIncomingCall_Vector; + + package ProgressParams_Scope is + package ProgressParams_Map is new Minimal_Perfect_Hash + (["token", + "value"]); + + end ProgressParams_Scope; + + procedure Read_ProgressParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ProgressParams) is + use ProgressParams_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case ProgressParams_Map.Get_Index (Key) is + when 1 => -- token + Read_ProgressToken (Handler, Value.token); + when 2 => -- value + Read_LSPAny (Handler, Value.value); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_ProgressParams; + + package DocumentLinkOptions_Scope is + package DocumentLinkOptions_Map is new Minimal_Perfect_Hash + (["workDoneProgress", + "resolveProvider"]); + + end DocumentLinkOptions_Scope; + + procedure Read_DocumentLinkOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentLinkOptions) is + use DocumentLinkOptions_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case DocumentLinkOptions_Map.Get_Index (Key) is + when 1 => -- workDoneProgress + Value.workDoneProgress := + (Is_Set => True, + Value => <>); + Value.workDoneProgress.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 2 => -- resolveProvider + Value.resolveProvider := + (Is_Set => True, + Value => <>); + Value.resolveProvider.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_DocumentLinkOptions; + + procedure Read_PrepareSupportDefaultBehavior + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.PrepareSupportDefaultBehavior) is + begin + Value := + LSP.Enumerations.PrepareSupportDefaultBehavior'Val + (Handler.Number_Value.Integer_Value - 1); + Handler.Read_Next; + end Read_PrepareSupportDefaultBehavior; + + package TextDocumentIdentifier_Scope is + package TextDocumentIdentifier_Map is new Minimal_Perfect_Hash (["uri"]); + + end TextDocumentIdentifier_Scope; + + procedure Read_TextDocumentIdentifier + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.TextDocumentIdentifier) is + use TextDocumentIdentifier_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case TextDocumentIdentifier_Map.Get_Index (Key) is + when 1 => -- uri + Value.uri := (Handler.String_Value with null record); + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_TextDocumentIdentifier; + + package DocumentSymbol_Result_Scope is + package DocumentSymbol_Result_Map is new Minimal_Perfect_Hash + (["location", + "containerName", + "detail", + "range", + "selectionRange", + "children"]); + + end DocumentSymbol_Result_Scope; + + procedure Read_DocumentSymbol_Result + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSymbol_Result) is + use DocumentSymbol_Result_Scope; + begin + declare + Parent : + constant not null access VSS.JSON.Pull_Readers.JSON_Pull_Reader' + Class := + Handler'Access; + Handler : + VSS.JSON.Pull_Readers.Buffered.JSON_Buffered_Pull_Reader (Parent); + begin + Handler.Mark; + if Handler.Is_Start_Array then + Handler.Read_Next; + end if; + if Handler.Is_Null_Value then + Value := + (Kind => LSP.Structures.Varian_3, + others => <>); + elsif Handler.Is_Start_Object then + Handler.Read_Next; + while Handler.Is_Key_Name loop + declare + Key : constant VSS.Strings.Virtual_String := + Handler.Key_Name; + Index : constant Natural := + DocumentSymbol_Result_Map.Get_Index (Key); + begin + Handler.Read_Next; + case Index is + when 1 => -- location + Value := + (Kind => LSP.Structures.Varian_1, + others => <>); + exit; + when 2 => -- containerName + Value := + (Kind => LSP.Structures.Varian_1, + others => <>); + exit; + when 3 => -- detail + Value := + (Kind => LSP.Structures.Varian_2, + others => <>); + exit; + when 4 => -- range + Value := + (Kind => LSP.Structures.Varian_2, + others => <>); + exit; + when 5 => -- selectionRange + Value := + (Kind => LSP.Structures.Varian_2, + others => <>); + exit; + when 6 => -- children + Value := + (Kind => LSP.Structures.Varian_2, + others => <>); + exit; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + else + raise Program_Error; -- Unexpected JSON value + end if; + + Handler.Reset; + Handler.Unmark; + + case Value.Kind is + when LSP.Structures.Varian_1 => + Read_SymbolInformation_Vector (Handler, Value.Varian_1); + when LSP.Structures.Varian_2 => + Read_DocumentSymbol_Vector (Handler, Value.Varian_2); + when LSP.Structures.Varian_3 => + null; -- #null_value + Handler.Read_Next; + end case; + end; + end Read_DocumentSymbol_Result; + + package TraceValues_Map is new Minimal_Perfect_Hash + (["off", + "messages", + "verbose"]); + + procedure Read_TraceValues + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.TraceValues) is + begin + Value := + LSP.Enumerations.TraceValues'Val + (TraceValues_Map.Get_Index (Handler.String_Value) - 1); + Handler.Read_Next; + end Read_TraceValues; + + package TypeHierarchyPrepareParams_Scope is + package TypeHierarchyPrepareParams_Map is new Minimal_Perfect_Hash + (["textDocument", + "position", + "workDoneToken"]); + + end TypeHierarchyPrepareParams_Scope; + + procedure Read_TypeHierarchyPrepareParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.TypeHierarchyPrepareParams) is + use TypeHierarchyPrepareParams_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case TypeHierarchyPrepareParams_Map.Get_Index (Key) is + when 1 => -- textDocument + Read_TextDocumentIdentifier (Handler, Value.textDocument); + when 2 => -- position + Read_Position (Handler, Value.position); + when 3 => -- workDoneToken + Value.workDoneToken := + (Is_Set => True, + Value => <>); + Read_ProgressToken (Handler, Value.workDoneToken.Value); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_TypeHierarchyPrepareParams; + + package SymbolInformation_Scope is + package SymbolInformation_Map is new Minimal_Perfect_Hash + (["name", + "kind", + "tags", + "containerName", + "deprecated", + "location"]); + + end SymbolInformation_Scope; + + procedure Read_SymbolInformation + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SymbolInformation) is + use SymbolInformation_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case SymbolInformation_Map.Get_Index (Key) is + when 1 => -- name + Value.name.Clear; + Value.name.Append (Handler.String_Value); + Handler.Read_Next; + when 2 => -- kind + Read_SymbolKind (Handler, Value.kind); + when 3 => -- tags + Read_SymbolTag_Set (Handler, Value.tags); + when 4 => -- containerName + Value.containerName.Clear; + Value.containerName.Append (Handler.String_Value); + Handler.Read_Next; + when 5 => -- deprecated + Value.deprecated := + (Is_Set => True, + Value => <>); + Value.deprecated.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 6 => -- location + Read_Location (Handler, Value.location); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_SymbolInformation; + + package WillSaveTextDocumentParams_Scope is + package WillSaveTextDocumentParams_Map is new Minimal_Perfect_Hash + (["textDocument", + "reason"]); + + end WillSaveTextDocumentParams_Scope; + + procedure Read_WillSaveTextDocumentParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.WillSaveTextDocumentParams) is + use WillSaveTextDocumentParams_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case WillSaveTextDocumentParams_Map.Get_Index (Key) is + when 1 => -- textDocument + Read_TextDocumentIdentifier (Handler, Value.textDocument); + when 2 => -- reason + Read_TextDocumentSaveReason (Handler, Value.reason); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_WillSaveTextDocumentParams; + + procedure Read_Command_Or_CodeAction_Vector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Command_Or_CodeAction_Vector_Or_Null) is + begin + if Handler.Is_Null_Value then + Handler.Read_Next; + else + Value.Clear; + Read_Command_Or_CodeAction_Vector (Handler, Value); + end if; + end Read_Command_Or_CodeAction_Vector_Or_Null; + + package FileOperationClientCapabilities_Scope is + package FileOperationClientCapabilities_Map is new Minimal_Perfect_Hash + (["dynamicRegistration", + "didCreate", + "willCreate", + "didRename", + "willRename", + "didDelete", + "willDelete"]); + + end FileOperationClientCapabilities_Scope; + + procedure Read_FileOperationClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.FileOperationClientCapabilities) is + use FileOperationClientCapabilities_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case FileOperationClientCapabilities_Map.Get_Index (Key) is + when 1 => -- dynamicRegistration + Value.dynamicRegistration := + (Is_Set => True, + Value => <>); + Value.dynamicRegistration.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 2 => -- didCreate + Value.didCreate := + (Is_Set => True, + Value => <>); + Value.didCreate.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 3 => -- willCreate + Value.willCreate := + (Is_Set => True, + Value => <>); + Value.willCreate.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 4 => -- didRename + Value.didRename := + (Is_Set => True, + Value => <>); + Value.didRename.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 5 => -- willRename + Value.willRename := + (Is_Set => True, + Value => <>); + Value.willRename.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 6 => -- didDelete + Value.didDelete := + (Is_Set => True, + Value => <>); + Value.didDelete.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 7 => -- willDelete + Value.willDelete := + (Is_Set => True, + Value => <>); + Value.willDelete.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_FileOperationClientCapabilities; + + package Definition_Result_Scope is + package Definition_Result_Map is new Minimal_Perfect_Hash + (["uri", + "range"]); + + end Definition_Result_Scope; + + procedure Read_Definition_Result + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Definition_Result) is + use Definition_Result_Scope; + begin + declare + Parent : + constant not null access VSS.JSON.Pull_Readers.JSON_Pull_Reader' + Class := + Handler'Access; + Handler : + VSS.JSON.Pull_Readers.Buffered.JSON_Buffered_Pull_Reader (Parent); + begin + Handler.Mark; + if Handler.Is_Null_Value then + Value := + (Kind => LSP.Structures.Varian_3, + others => <>); + elsif Handler.Is_Start_Object then + Handler.Read_Next; + Value := + (Kind => LSP.Structures.Varian_2, + others => <>); + while Handler.Is_Key_Name loop + declare + Key : constant VSS.Strings.Virtual_String := + Handler.Key_Name; + Index : constant Natural := + Definition_Result_Map.Get_Index (Key); + begin + Handler.Read_Next; + case Index is + when 1 => -- uri + Value := + (Kind => LSP.Structures.Varian_1, + others => <>); + exit; + when 2 => -- range + Value := + (Kind => LSP.Structures.Varian_1, + others => <>); + exit; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + else + raise Program_Error; -- Unexpected JSON value + end if; + + Handler.Reset; + Handler.Unmark; + + case Value.Kind is + when LSP.Structures.Varian_1 => + Read_Definition (Handler, Value.Varian_1); + when LSP.Structures.Varian_2 => + Read_DefinitionLink_Vector (Handler, Value.Varian_2); + when LSP.Structures.Varian_3 => + null; -- #null_value + Handler.Read_Next; + end case; + end; + end Read_Definition_Result; + + package DocumentHighlightClientCapabilities_Scope is + package DocumentHighlightClientCapabilities_Map is new Minimal_Perfect_Hash + (["dynamicRegistration"]); + + end DocumentHighlightClientCapabilities_Scope; + + procedure Read_DocumentHighlightClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentHighlightClientCapabilities) is + use DocumentHighlightClientCapabilities_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case DocumentHighlightClientCapabilities_Map.Get_Index (Key) is + when 1 => -- dynamicRegistration + Value.dynamicRegistration := + (Is_Set => True, + Value => <>); + Value.dynamicRegistration.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_DocumentHighlightClientCapabilities; + + package InlineValueText_Scope is + package InlineValueText_Map is new Minimal_Perfect_Hash + (["range", + "text"]); + + end InlineValueText_Scope; + + procedure Read_InlineValueText + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.InlineValueText) is + use InlineValueText_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case InlineValueText_Map.Get_Index (Key) is + when 1 => -- range + Read_A_Range (Handler, Value.a_range); + when 2 => -- text + Value.text.Clear; + Value.text.Append (Handler.String_Value); + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_InlineValueText; + + package UnchangedDocumentDiagnosticReport_Scope is + package UnchangedDocumentDiagnosticReport_Map is new Minimal_Perfect_Hash + (["kind", + "resultId"]); + + end UnchangedDocumentDiagnosticReport_Scope; + + procedure Read_UnchangedDocumentDiagnosticReport + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.UnchangedDocumentDiagnosticReport) is + use UnchangedDocumentDiagnosticReport_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case UnchangedDocumentDiagnosticReport_Map.Get_Index (Key) is + when 1 => -- kind + Handler.Read_Next; -- Skip string literal: unchanged + when 2 => -- resultId + Value.resultId.Clear; + Value.resultId.Append (Handler.String_Value); + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_UnchangedDocumentDiagnosticReport; + + procedure Read_SymbolTag + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.SymbolTag) is + begin + Value := + LSP.Enumerations.SymbolTag'Val + (Handler.Number_Value.Integer_Value - 1); + Handler.Read_Next; + end Read_SymbolTag; + + package Registration_Scope is + package Registration_Map is new Minimal_Perfect_Hash + (["id", + "method", + "registerOptions"]); + + end Registration_Scope; + + procedure Read_Registration + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Registration) is + use Registration_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case Registration_Map.Get_Index (Key) is + when 1 => -- id + Value.id.Clear; + Value.id.Append (Handler.String_Value); + Handler.Read_Next; + when 2 => -- method + Value.method.Clear; + Value.method.Append (Handler.String_Value); + Handler.Read_Next; + when 3 => -- registerOptions + Read_LSPAny (Handler, Value.registerOptions); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_Registration; + + package CompletionItem_Scope is + package CompletionItem_Map is new Minimal_Perfect_Hash + (["label", + "labelDetails", + "kind", + "tags", + "detail", + "documentation", + "deprecated", + "preselect", + "sortText", + "filterText", + "insertText", + "insertTextFormat", + "insertTextMode", + "textEdit", + "textEditText", + "additionalTextEdits", + "commitCharacters", + "command", + "data"]); + + package TextEdit_Or_InsertReplaceEdit_Scope is + package TextEdit_Or_InsertReplaceEdit_Map is new Minimal_Perfect_Hash + (["range", + "insert", + "replace"]); + + end TextEdit_Or_InsertReplaceEdit_Scope; + + end CompletionItem_Scope; + + procedure Read_CompletionItem + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CompletionItem) is + use CompletionItem_Scope; + procedure Read_TextEdit_Or_InsertReplaceEdit + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.TextEdit_Or_InsertReplaceEdit); + + procedure Read_TextEdit_Or_InsertReplaceEdit + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.TextEdit_Or_InsertReplaceEdit) is + use TextEdit_Or_InsertReplaceEdit_Scope; + begin + declare + Parent : + constant not null access VSS.JSON.Pull_Readers.JSON_Pull_Reader' + Class := + Handler'Access; + Handler : + VSS.JSON.Pull_Readers.Buffered.JSON_Buffered_Pull_Reader + (Parent); + begin + Handler.Mark; + if Handler.Is_Start_Object then + Handler.Read_Next; + while Handler.Is_Key_Name loop + declare + Key : constant VSS.Strings.Virtual_String := + Handler.Key_Name; + Index : constant Natural := + TextEdit_Or_InsertReplaceEdit_Map.Get_Index (Key); + begin + Handler.Read_Next; + case Index is + when 1 => -- range + Value := + (Is_TextEdit => True, + others => <>); + exit; + when 2 => -- insert + Value := + (Is_TextEdit => False, + others => <>); + exit; + when 3 => -- replace + Value := + (Is_TextEdit => False, + others => <>); + exit; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + else + raise Program_Error; -- Unexpected JSON value + end if; + + Handler.Reset; + Handler.Unmark; + + case Value.Is_TextEdit is + when True => + Read_TextEdit (Handler, Value.TextEdit); + when False => + Read_InsertReplaceEdit (Handler, Value.InsertReplaceEdit); + end case; + end; + end Read_TextEdit_Or_InsertReplaceEdit; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case CompletionItem_Map.Get_Index (Key) is + when 1 => -- label + Value.label.Clear; + Value.label.Append (Handler.String_Value); + Handler.Read_Next; + when 2 => -- labelDetails + Value.labelDetails := + (Is_Set => True, + Value => <>); + Read_CompletionItemLabelDetails + (Handler, Value.labelDetails.Value); + when 3 => -- kind + Value.kind := + (Is_Set => True, + Value => <>); + Read_CompletionItemKind (Handler, Value.kind.Value); + when 4 => -- tags + Read_CompletionItemTag_Set (Handler, Value.tags); + when 5 => -- detail + Value.detail.Clear; + Value.detail.Append (Handler.String_Value); + Handler.Read_Next; + when 6 => -- documentation + Value.documentation := + (Is_Set => True, + Value => <>); + Read_Virtual_String_Or_MarkupContent + (Handler, Value.documentation.Value); + when 7 => -- deprecated + Value.deprecated := + (Is_Set => True, + Value => <>); + Value.deprecated.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 8 => -- preselect + Value.preselect := + (Is_Set => True, + Value => <>); + Value.preselect.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 9 => -- sortText + Value.sortText.Clear; + Value.sortText.Append (Handler.String_Value); + Handler.Read_Next; + when 10 => -- filterText + Value.filterText.Clear; + Value.filterText.Append (Handler.String_Value); + Handler.Read_Next; + when 11 => -- insertText + Value.insertText.Clear; + Value.insertText.Append (Handler.String_Value); + Handler.Read_Next; + when 12 => -- insertTextFormat + Value.insertTextFormat := + (Is_Set => True, + Value => <>); + Read_InsertTextFormat + (Handler, Value.insertTextFormat.Value); + when 13 => -- insertTextMode + Value.insertTextMode := + (Is_Set => True, + Value => <>); + Read_InsertTextMode (Handler, Value.insertTextMode.Value); + when 14 => -- textEdit + Value.textEdit := + (Is_Set => True, + Value => <>); + Read_TextEdit_Or_InsertReplaceEdit + (Handler, Value.textEdit.Value); + when 15 => -- textEditText + Value.textEditText.Clear; + Value.textEditText.Append (Handler.String_Value); + Handler.Read_Next; + when 16 => -- additionalTextEdits + Read_TextEdit_Vector (Handler, Value.additionalTextEdits); + when 17 => -- commitCharacters + Read_Virtual_String_Vector (Handler, Value.commitCharacters); + when 18 => -- command + Value.command := + (Is_Set => True, + Value => <>); + Read_Command (Handler, Value.command.Value); + when 19 => -- data + Read_LSPAny (Handler, Value.data); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_CompletionItem; + + package DocumentRangeFormattingRegistrationOptions_Scope is + package DocumentRangeFormattingRegistrationOptions_Map is new Minimal_Perfect_Hash + (["documentSelector", + "workDoneProgress"]); + + end DocumentRangeFormattingRegistrationOptions_Scope; + + procedure Read_DocumentRangeFormattingRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentRangeFormattingRegistrationOptions) is + use DocumentRangeFormattingRegistrationOptions_Scope; + procedure Read_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSelector_Or_Null); + + procedure Read_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSelector_Or_Null) is + begin + if Handler.Is_Null_Value then + Handler.Read_Next; + else + Value := + (Is_Null => False, + Value => <>); + Read_DocumentSelector (Handler, Value.Value); + end if; + end Read_DocumentSelector_Or_Null; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case DocumentRangeFormattingRegistrationOptions_Map.Get_Index + (Key) is + when 1 => -- documentSelector + Read_DocumentSelector_Or_Null + (Handler, Value.Parent.documentSelector); + when 2 => -- workDoneProgress + Value.workDoneProgress := + (Is_Set => True, + Value => <>); + Value.workDoneProgress.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_DocumentRangeFormattingRegistrationOptions; + + procedure Read_Moniker_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Moniker_Vector) is + begin + pragma Assert (Handler.Is_Start_Array); + Handler.Read_Next; + + declare + Set : LSP.Structures.Moniker_Vector renames Value; + Value : LSP.Structures.Moniker; + begin + Set.Clear; + while not Handler.Is_End_Array loop + Read_Moniker (Handler, Value); + Set.Append (Value); + end loop; + end; + + Handler.Read_Next; + end Read_Moniker_Vector; + + package RenameFileOptions_Scope is + package RenameFileOptions_Map is new Minimal_Perfect_Hash + (["overwrite", + "ignoreIfExists"]); + + end RenameFileOptions_Scope; + + procedure Read_RenameFileOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.RenameFileOptions) is + use RenameFileOptions_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case RenameFileOptions_Map.Get_Index (Key) is + when 1 => -- overwrite + Value.overwrite := + (Is_Set => True, + Value => <>); + Value.overwrite.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 2 => -- ignoreIfExists + Value.ignoreIfExists := + (Is_Set => True, + Value => <>); + Value.ignoreIfExists.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_RenameFileOptions; + + package HoverParams_Scope is + package HoverParams_Map is new Minimal_Perfect_Hash + (["textDocument", + "position", + "workDoneToken"]); + + end HoverParams_Scope; + + procedure Read_HoverParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.HoverParams) is + use HoverParams_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case HoverParams_Map.Get_Index (Key) is + when 1 => -- textDocument + Read_TextDocumentIdentifier (Handler, Value.textDocument); + when 2 => -- position + Read_Position (Handler, Value.position); + when 3 => -- workDoneToken + Value.workDoneToken := + (Is_Set => True, + Value => <>); + Read_ProgressToken (Handler, Value.workDoneToken.Value); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_HoverParams; + + package DocumentSymbol_Scope is + package DocumentSymbol_Map is new Minimal_Perfect_Hash + (["name", + "detail", + "kind", + "tags", + "deprecated", + "range", + "selectionRange", + "children"]); + + end DocumentSymbol_Scope; + + procedure Read_DocumentSymbol + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSymbol) is + use DocumentSymbol_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case DocumentSymbol_Map.Get_Index (Key) is + when 1 => -- name + Value.name.Clear; + Value.name.Append (Handler.String_Value); + Handler.Read_Next; + when 2 => -- detail + Value.detail.Clear; + Value.detail.Append (Handler.String_Value); + Handler.Read_Next; + when 3 => -- kind + Read_SymbolKind (Handler, Value.kind); + when 4 => -- tags + Read_SymbolTag_Set (Handler, Value.tags); + when 5 => -- deprecated + Value.deprecated := + (Is_Set => True, + Value => <>); + Value.deprecated.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 6 => -- range + Read_A_Range (Handler, Value.a_range); + when 7 => -- selectionRange + Read_A_Range (Handler, Value.selectionRange); + when 8 => -- children + Read_DocumentSymbol_Vector (Handler, Value.children); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_DocumentSymbol; + + package DocumentSymbolClientCapabilities_Scope is + package DocumentSymbolClientCapabilities_Map is new Minimal_Perfect_Hash + (["dynamicRegistration", + "symbolKind", + "hierarchicalDocumentSymbolSupport", + "tagSupport", + "labelSupport"]); + + end DocumentSymbolClientCapabilities_Scope; + + procedure Read_DocumentSymbolClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSymbolClientCapabilities) is + use DocumentSymbolClientCapabilities_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case DocumentSymbolClientCapabilities_Map.Get_Index (Key) is + when 1 => -- dynamicRegistration + Value.dynamicRegistration := + (Is_Set => True, + Value => <>); + Value.dynamicRegistration.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 2 => -- symbolKind + Value.symbolKind := + (Is_Set => True, + Value => <>); + Read_symbolKind_OfWorkspaceSymbolClientCapabilities + (Handler, Value.symbolKind.Value); + when 3 => -- hierarchicalDocumentSymbolSupport + Value.hierarchicalDocumentSymbolSupport := + (Is_Set => True, + Value => <>); + Value.hierarchicalDocumentSymbolSupport.Value := + Handler.Boolean_Value; + Handler.Read_Next; + when 4 => -- tagSupport + Value.tagSupport := + (Is_Set => True, + Value => <>); + Read_tagSupport_OfWorkspaceSymbolClientCapabilities + (Handler, Value.tagSupport.Value); + when 5 => -- labelSupport + Value.labelSupport := + (Is_Set => True, + Value => <>); + Value.labelSupport.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_DocumentSymbolClientCapabilities; + + package InitializeError_Scope is + package InitializeError_Map is new Minimal_Perfect_Hash (["retry"]); + + end InitializeError_Scope; + + procedure Read_InitializeError + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.InitializeError) is + use InitializeError_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case InitializeError_Map.Get_Index (Key) is + when 1 => -- retry + Value.retry := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_InitializeError; + + package LinkedEditingRangeRegistrationOptions_Scope is + package LinkedEditingRangeRegistrationOptions_Map is new Minimal_Perfect_Hash + (["documentSelector", + "workDoneProgress", + "id"]); + + end LinkedEditingRangeRegistrationOptions_Scope; + + procedure Read_LinkedEditingRangeRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.LinkedEditingRangeRegistrationOptions) is + use LinkedEditingRangeRegistrationOptions_Scope; + procedure Read_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSelector_Or_Null); + + procedure Read_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSelector_Or_Null) is + begin + if Handler.Is_Null_Value then + Handler.Read_Next; + else + Value := + (Is_Null => False, + Value => <>); + Read_DocumentSelector (Handler, Value.Value); + end if; + end Read_DocumentSelector_Or_Null; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case LinkedEditingRangeRegistrationOptions_Map.Get_Index (Key) is + when 1 => -- documentSelector + Read_DocumentSelector_Or_Null + (Handler, Value.Parent.documentSelector); + when 2 => -- workDoneProgress + Value.workDoneProgress := + (Is_Set => True, + Value => <>); + Value.workDoneProgress.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 3 => -- id + Value.id.Clear; + Value.id.Append (Handler.String_Value); + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_LinkedEditingRangeRegistrationOptions; + + package SemanticTokensClientCapabilities_Scope is + package SemanticTokensClientCapabilities_Map is new Minimal_Perfect_Hash + (["dynamicRegistration", + "requests", + "tokenTypes", + "tokenModifiers", + "formats", + "overlappingTokenSupport", + "multilineTokenSupport", + "serverCancelSupport", + "augmentsSyntaxTokens"]); + + package requests_OfSemanticTokensClientCapabilities_Scope is + package requests_OfSemanticTokensClientCapabilities_Map is new Minimal_Perfect_Hash + (["range", + "full"]); + + end requests_OfSemanticTokensClientCapabilities_Scope; + + end SemanticTokensClientCapabilities_Scope; + + procedure Read_SemanticTokensClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SemanticTokensClientCapabilities) is + use SemanticTokensClientCapabilities_Scope; + procedure Read_requests_OfSemanticTokensClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .requests_OfSemanticTokensClientCapabilities); + + procedure Read_TokenFormat_Set + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.TokenFormat_Set); + + procedure Read_requests_OfSemanticTokensClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .requests_OfSemanticTokensClientCapabilities) is + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while Handler.Is_Key_Name loop + declare + use requests_OfSemanticTokensClientCapabilities_Scope; + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case requests_OfSemanticTokensClientCapabilities_Map.Get_Index + (Key) is + when 1 => -- range + Value.a_range := + (Is_Set => True, + Value => <>); + Read_Boolean_Or_Any (Handler, Value.a_range.Value); + when 2 => -- full + Value.full := + (Is_Set => True, + Value => <>); + Read_Boolean_Or_Something (Handler, Value.full.Value); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_requests_OfSemanticTokensClientCapabilities; + + procedure Read_TokenFormat_Set + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.TokenFormat_Set) is + begin + pragma Assert (Handler.Is_Start_Array); + Handler.Read_Next; + + declare + Set : LSP.Structures.TokenFormat_Set renames Value; + Value : LSP.Enumerations.TokenFormat; + begin + Set := (others => False); + while not Handler.Is_End_Array loop + Read_TokenFormat (Handler, Value); + Set (Value) := True; + end loop; + end; + + Handler.Read_Next; + end Read_TokenFormat_Set; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case SemanticTokensClientCapabilities_Map.Get_Index (Key) is + when 1 => -- dynamicRegistration + Value.dynamicRegistration := + (Is_Set => True, + Value => <>); + Value.dynamicRegistration.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 2 => -- requests + Read_requests_OfSemanticTokensClientCapabilities + (Handler, Value.requests); + when 3 => -- tokenTypes + Read_Virtual_String_Vector (Handler, Value.tokenTypes); + when 4 => -- tokenModifiers + Read_Virtual_String_Vector (Handler, Value.tokenModifiers); + when 5 => -- formats + Read_TokenFormat_Set (Handler, Value.formats); + when 6 => -- overlappingTokenSupport + Value.overlappingTokenSupport := + (Is_Set => True, + Value => <>); + Value.overlappingTokenSupport.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 7 => -- multilineTokenSupport + Value.multilineTokenSupport := + (Is_Set => True, + Value => <>); + Value.multilineTokenSupport.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 8 => -- serverCancelSupport + Value.serverCancelSupport := + (Is_Set => True, + Value => <>); + Value.serverCancelSupport.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 9 => -- augmentsSyntaxTokens + Value.augmentsSyntaxTokens := + (Is_Set => True, + Value => <>); + Value.augmentsSyntaxTokens.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_SemanticTokensClientCapabilities; + + package Hover_Scope is + package Hover_Map is new Minimal_Perfect_Hash + (["contents", + "range"]); + + package MarkupContent_Or_MarkedString_Vector_Scope is + package MarkupContent_Or_MarkedString_Vector_Map is new Minimal_Perfect_Hash + (["kind", + "language"]); + + end MarkupContent_Or_MarkedString_Vector_Scope; + + end Hover_Scope; + + procedure Read_Hover + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Hover) is + use Hover_Scope; + procedure Read_MarkedString_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.MarkedString_Vector); + + procedure Read_MarkupContent_Or_MarkedString_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.MarkupContent_Or_MarkedString_Vector); + + procedure Read_MarkedString_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.MarkedString_Vector) is + begin + pragma Assert (Handler.Is_Start_Array); + Handler.Read_Next; + + declare + Set : LSP.Structures.MarkedString_Vector renames Value; + Value : LSP.Structures.MarkedString; + begin + Set.Clear; + while not Handler.Is_End_Array loop + Read_MarkedString (Handler, Value); + Set.Append (Value); + end loop; + end; + + Handler.Read_Next; + end Read_MarkedString_Vector; + + procedure Read_MarkupContent_Or_MarkedString_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.MarkupContent_Or_MarkedString_Vector) is + -- use MarkupContent_Or_MarkedString_Vector_Scope; + begin + declare + Parent : + constant not null access VSS.JSON.Pull_Readers.JSON_Pull_Reader' + Class := + Handler'Access; + Handler : + VSS.JSON.Pull_Readers.Buffered.JSON_Buffered_Pull_Reader + (Parent); + begin + Handler.Mark; + LSP.Input_Tools.Look_For_MarkupContent_Or_MarkedString_Vector + (Handler, Value); + Handler.Reset; + Handler.Unmark; + if not Value.Is_MarkupContent and not Handler.Is_Start_Array then + Read_MarkedString (Handler, Value.MarkedString_Vector (1)); + return; + end if; + + case Value.Is_MarkupContent is + when True => + Read_MarkupContent (Handler, Value.MarkupContent); + when False => + Read_MarkedString_Vector + (Handler, Value.MarkedString_Vector); + end case; + end; + end Read_MarkupContent_Or_MarkedString_Vector; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case Hover_Map.Get_Index (Key) is + when 1 => -- contents + Read_MarkupContent_Or_MarkedString_Vector + (Handler, Value.contents); + when 2 => -- range + Value.a_range := + (Is_Set => True, + Value => <>); + Read_A_Range (Handler, Value.a_range.Value); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_Hover; + + package InlineValueWorkspaceClientCapabilities_Scope is + package InlineValueWorkspaceClientCapabilities_Map is new Minimal_Perfect_Hash + (["refreshSupport"]); + + end InlineValueWorkspaceClientCapabilities_Scope; + + procedure Read_InlineValueWorkspaceClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.InlineValueWorkspaceClientCapabilities) is + use InlineValueWorkspaceClientCapabilities_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case InlineValueWorkspaceClientCapabilities_Map.Get_Index (Key) is + when 1 => -- refreshSupport + Value.refreshSupport := + (Is_Set => True, + Value => <>); + Value.refreshSupport.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_InlineValueWorkspaceClientCapabilities; + + package ResourceOperation_Scope is + package ResourceOperation_Map is new Minimal_Perfect_Hash + (["kind", + "annotationId"]); + + end ResourceOperation_Scope; + + procedure Read_ResourceOperation + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ResourceOperation) is + use ResourceOperation_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case ResourceOperation_Map.Get_Index (Key) is + when 1 => -- kind + Value.kind.Clear; + Value.kind.Append (Handler.String_Value); + Handler.Read_Next; + when 2 => -- annotationId + Value.annotationId := + (Is_Set => True, + Value => <>); + Read_ChangeAnnotationIdentifier + (Handler, Value.annotationId.Value); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_ResourceOperation; + + package PublishDiagnosticsClientCapabilities_Scope is + package PublishDiagnosticsClientCapabilities_Map is new Minimal_Perfect_Hash + (["relatedInformation", + "tagSupport", + "versionSupport", + "codeDescriptionSupport", + "dataSupport"]); + + package tagSupport_OfPublishDiagnosticsClientCapabilities_Scope is + package tagSupport_OfPublishDiagnosticsClientCapabilities_Map is new Minimal_Perfect_Hash + (["valueSet"]); + + end tagSupport_OfPublishDiagnosticsClientCapabilities_Scope; + + end PublishDiagnosticsClientCapabilities_Scope; + + procedure Read_PublishDiagnosticsClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.PublishDiagnosticsClientCapabilities) is + use PublishDiagnosticsClientCapabilities_Scope; + procedure Read_tagSupport_OfPublishDiagnosticsClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .tagSupport_OfPublishDiagnosticsClientCapabilities); + + procedure Read_tagSupport_OfPublishDiagnosticsClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .tagSupport_OfPublishDiagnosticsClientCapabilities) is + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while Handler.Is_Key_Name loop + declare + use tagSupport_OfPublishDiagnosticsClientCapabilities_Scope; + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case tagSupport_OfPublishDiagnosticsClientCapabilities_Map + .Get_Index + (Key) is + when 1 => -- valueSet + Read_DiagnosticTag_Set (Handler, Value.valueSet); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_tagSupport_OfPublishDiagnosticsClientCapabilities; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case PublishDiagnosticsClientCapabilities_Map.Get_Index (Key) is + when 1 => -- relatedInformation + Value.relatedInformation := + (Is_Set => True, + Value => <>); + Value.relatedInformation.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 2 => -- tagSupport + Value.tagSupport := + (Is_Set => True, + Value => <>); + Read_tagSupport_OfPublishDiagnosticsClientCapabilities + (Handler, Value.tagSupport.Value); + when 3 => -- versionSupport + Value.versionSupport := + (Is_Set => True, + Value => <>); + Value.versionSupport.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 4 => -- codeDescriptionSupport + Value.codeDescriptionSupport := + (Is_Set => True, + Value => <>); + Value.codeDescriptionSupport.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 5 => -- dataSupport + Value.dataSupport := + (Is_Set => True, + Value => <>); + Value.dataSupport.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_PublishDiagnosticsClientCapabilities; + + procedure Read_DocumentHighlight_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentHighlight_Vector) is + begin + pragma Assert (Handler.Is_Start_Array); + Handler.Read_Next; + + declare + Set : LSP.Structures.DocumentHighlight_Vector renames Value; + Value : LSP.Structures.DocumentHighlight; + begin + Set.Clear; + while not Handler.Is_End_Array loop + Read_DocumentHighlight (Handler, Value); + Set.Append (Value); + end loop; + end; + + Handler.Read_Next; + end Read_DocumentHighlight_Vector; + + package SemanticTokensOptions_Scope is + package SemanticTokensOptions_Map is new Minimal_Perfect_Hash + (["workDoneProgress", + "legend", + "range", + "full"]); + + end SemanticTokensOptions_Scope; + + procedure Read_SemanticTokensOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SemanticTokensOptions) is + use SemanticTokensOptions_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case SemanticTokensOptions_Map.Get_Index (Key) is + when 1 => -- workDoneProgress + Value.workDoneProgress := + (Is_Set => True, + Value => <>); + Value.workDoneProgress.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 2 => -- legend + Read_SemanticTokensLegend (Handler, Value.legend); + when 3 => -- range + Value.a_range := + (Is_Set => True, + Value => <>); + Read_Boolean_Or_Any (Handler, Value.a_range.Value); + when 4 => -- full + Value.full := + (Is_Set => True, + Value => <>); + Read_Boolean_Or_Something (Handler, Value.full.Value); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_SemanticTokensOptions; + + package DocumentHighlightOptions_Scope is + package DocumentHighlightOptions_Map is new Minimal_Perfect_Hash + (["workDoneProgress"]); + + end DocumentHighlightOptions_Scope; + + procedure Read_DocumentHighlightOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentHighlightOptions) is + use DocumentHighlightOptions_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case DocumentHighlightOptions_Map.Get_Index (Key) is + when 1 => -- workDoneProgress + Value.workDoneProgress := + (Is_Set => True, + Value => <>); + Value.workDoneProgress.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_DocumentHighlightOptions; + + procedure Read_Integer_Or_Virtual_String + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Integer_Or_Virtual_String) is + begin + if Handler.Is_Number_Value then + Value := + (Is_Integer => True, + others => <>); + else + Value := + (Is_Integer => False, + others => <>); + end if; + + case Value.Is_Integer is + when True => + Value.Integer := Integer (Handler.Number_Value.Integer_Value); + Handler.Read_Next; + when False => + Value.Virtual_String.Clear; + Value.Virtual_String.Append (Handler.String_Value); + Handler.Read_Next; + end case; + end Read_Integer_Or_Virtual_String; + + package FoldingRangeParams_Scope is + package FoldingRangeParams_Map is new Minimal_Perfect_Hash + (["workDoneToken", + "partialResultToken", + "textDocument"]); + + end FoldingRangeParams_Scope; + + procedure Read_FoldingRangeParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.FoldingRangeParams) is + use FoldingRangeParams_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case FoldingRangeParams_Map.Get_Index (Key) is + when 1 => -- workDoneToken + Value.workDoneToken := + (Is_Set => True, + Value => <>); + Read_ProgressToken (Handler, Value.workDoneToken.Value); + when 2 => -- partialResultToken + Value.partialResultToken := + (Is_Set => True, + Value => <>); + Read_ProgressToken (Handler, Value.partialResultToken.Value); + when 3 => -- textDocument + Read_TextDocumentIdentifier (Handler, Value.textDocument); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_FoldingRangeParams; + + package FoldingRangeOptions_Scope is + package FoldingRangeOptions_Map is new Minimal_Perfect_Hash + (["workDoneProgress"]); + + end FoldingRangeOptions_Scope; + + procedure Read_FoldingRangeOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.FoldingRangeOptions) is + use FoldingRangeOptions_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case FoldingRangeOptions_Map.Get_Index (Key) is + when 1 => -- workDoneProgress + Value.workDoneProgress := + (Is_Set => True, + Value => <>); + Value.workDoneProgress.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_FoldingRangeOptions; + + procedure Read_Integer_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Integer_Or_Null) is + begin + if Handler.Is_Null_Value then + Handler.Read_Next; + else + Value := + (Is_Null => False, + Value => <>); + Value.Value := Integer (Handler.Number_Value.Integer_Value); + Handler.Read_Next; + end if; + end Read_Integer_Or_Null; + + package RegistrationParams_Scope is + package RegistrationParams_Map is new Minimal_Perfect_Hash + (["registrations"]); + + end RegistrationParams_Scope; + + procedure Read_RegistrationParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.RegistrationParams) is + use RegistrationParams_Scope; + procedure Read_Registration_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Registration_Vector); + + procedure Read_Registration_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Registration_Vector) is + begin + pragma Assert (Handler.Is_Start_Array); + Handler.Read_Next; + + declare + Set : LSP.Structures.Registration_Vector renames Value; + Value : LSP.Structures.Registration; + begin + Set.Clear; + while not Handler.Is_End_Array loop + Read_Registration (Handler, Value); + Set.Append (Value); + end loop; + end; + + Handler.Read_Next; + end Read_Registration_Vector; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case RegistrationParams_Map.Get_Index (Key) is + when 1 => -- registrations + Read_Registration_Vector (Handler, Value.registrations); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_RegistrationParams; + + package SignatureHelpParams_Scope is + package SignatureHelpParams_Map is new Minimal_Perfect_Hash + (["textDocument", + "position", + "workDoneToken", + "context"]); + + end SignatureHelpParams_Scope; + + procedure Read_SignatureHelpParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SignatureHelpParams) is + use SignatureHelpParams_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case SignatureHelpParams_Map.Get_Index (Key) is + when 1 => -- textDocument + Read_TextDocumentIdentifier (Handler, Value.textDocument); + when 2 => -- position + Read_Position (Handler, Value.position); + when 3 => -- workDoneToken + Value.workDoneToken := + (Is_Set => True, + Value => <>); + Read_ProgressToken (Handler, Value.workDoneToken.Value); + when 4 => -- context + Value.context := + (Is_Set => True, + Value => <>); + Read_SignatureHelpContext (Handler, Value.context.Value); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_SignatureHelpParams; + + procedure Read_TextEdit_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.TextEdit_Vector) is + begin + pragma Assert (Handler.Is_Start_Array); + Handler.Read_Next; + + declare + Set : LSP.Structures.TextEdit_Vector renames Value; + Value : LSP.Structures.TextEdit; + begin + Set.Clear; + while not Handler.Is_End_Array loop + Read_TextEdit (Handler, Value); + Set.Append (Value); + end loop; + end; + + Handler.Read_Next; + end Read_TextEdit_Vector; + + package ShowMessageRequestClientCapabilities_Scope is + package ShowMessageRequestClientCapabilities_Map is new Minimal_Perfect_Hash + (["messageActionItem"]); + + package messageActionItem_OfShowMessageRequestClientCapabilities_Scope is + package messageActionItem_OfShowMessageRequestClientCapabilities_Map is new Minimal_Perfect_Hash + (["additionalPropertiesSupport"]); + + end messageActionItem_OfShowMessageRequestClientCapabilities_Scope; + + end ShowMessageRequestClientCapabilities_Scope; + + procedure Read_ShowMessageRequestClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ShowMessageRequestClientCapabilities) is + use ShowMessageRequestClientCapabilities_Scope; + procedure Read_messageActionItem_OfShowMessageRequestClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .messageActionItem_OfShowMessageRequestClientCapabilities); + + procedure Read_messageActionItem_OfShowMessageRequestClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .messageActionItem_OfShowMessageRequestClientCapabilities) is + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while Handler.Is_Key_Name loop + declare + use + messageActionItem_OfShowMessageRequestClientCapabilities_Scope; + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case messageActionItem_OfShowMessageRequestClientCapabilities_Map + .Get_Index + (Key) is + when 1 => -- additionalPropertiesSupport + Value.additionalPropertiesSupport := + (Is_Set => True, + Value => <>); + Value.additionalPropertiesSupport.Value := + Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_messageActionItem_OfShowMessageRequestClientCapabilities; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case ShowMessageRequestClientCapabilities_Map.Get_Index (Key) is + when 1 => -- messageActionItem + Value.messageActionItem := + (Is_Set => True, + Value => <>); + Read_messageActionItem_OfShowMessageRequestClientCapabilities + (Handler, Value.messageActionItem.Value); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_ShowMessageRequestClientCapabilities; + + procedure Read_SemanticTokensEdit_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SemanticTokensEdit_Vector) is + begin + pragma Assert (Handler.Is_Start_Array); + Handler.Read_Next; + + declare + Set : LSP.Structures.SemanticTokensEdit_Vector renames Value; + Value : LSP.Structures.SemanticTokensEdit; + begin + Set.Clear; + while not Handler.Is_End_Array loop + Read_SemanticTokensEdit (Handler, Value); + Set.Append (Value); + end loop; + end; + + Handler.Read_Next; + end Read_SemanticTokensEdit_Vector; + + package Position_Scope is + package Position_Map is new Minimal_Perfect_Hash + (["line", + "character"]); + + end Position_Scope; + + procedure Read_Position + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Position) is + use Position_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case Position_Map.Get_Index (Key) is + when 1 => -- line + Value.line := Integer (Handler.Number_Value.Integer_Value); + Handler.Read_Next; + when 2 => -- character + Value.character := + Integer (Handler.Number_Value.Integer_Value); + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_Position; + + package TextDocumentSaveRegistrationOptions_Scope is + package TextDocumentSaveRegistrationOptions_Map is new Minimal_Perfect_Hash + (["documentSelector", + "includeText"]); + + end TextDocumentSaveRegistrationOptions_Scope; + + procedure Read_TextDocumentSaveRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.TextDocumentSaveRegistrationOptions) is + use TextDocumentSaveRegistrationOptions_Scope; + procedure Read_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSelector_Or_Null); + + procedure Read_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSelector_Or_Null) is + begin + if Handler.Is_Null_Value then + Handler.Read_Next; + else + Value := + (Is_Null => False, + Value => <>); + Read_DocumentSelector (Handler, Value.Value); + end if; + end Read_DocumentSelector_Or_Null; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case TextDocumentSaveRegistrationOptions_Map.Get_Index (Key) is + when 1 => -- documentSelector + Read_DocumentSelector_Or_Null + (Handler, Value.Parent.documentSelector); + when 2 => -- includeText + Value.includeText := + (Is_Set => True, + Value => <>); + Value.includeText.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_TextDocumentSaveRegistrationOptions; + + package CodeActionParams_Scope is + package CodeActionParams_Map is new Minimal_Perfect_Hash + (["workDoneToken", + "partialResultToken", + "textDocument", + "range", + "context"]); + + end CodeActionParams_Scope; + + procedure Read_CodeActionParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CodeActionParams) is + use CodeActionParams_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case CodeActionParams_Map.Get_Index (Key) is + when 1 => -- workDoneToken + Value.workDoneToken := + (Is_Set => True, + Value => <>); + Read_ProgressToken (Handler, Value.workDoneToken.Value); + when 2 => -- partialResultToken + Value.partialResultToken := + (Is_Set => True, + Value => <>); + Read_ProgressToken (Handler, Value.partialResultToken.Value); + when 3 => -- textDocument + Read_TextDocumentIdentifier (Handler, Value.textDocument); + when 4 => -- range + Read_A_Range (Handler, Value.a_range); + when 5 => -- context + Read_CodeActionContext (Handler, Value.context); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_CodeActionParams; + + package Command_Scope is + package Command_Map is new Minimal_Perfect_Hash + (["title", + "command", + "arguments"]); + + end Command_Scope; + + procedure Read_Command + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Command) is + use Command_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case Command_Map.Get_Index (Key) is + when 1 => -- title + Value.title.Clear; + Value.title.Append (Handler.String_Value); + Handler.Read_Next; + when 2 => -- command + Value.command.Clear; + Value.command.Append (Handler.String_Value); + Handler.Read_Next; + when 3 => -- arguments + Read_LSPAny_Vector (Handler, Value.arguments); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_Command; + + package TextDocumentFilter_Scope is + package TextDocumentFilter_Map is new Minimal_Perfect_Hash + (["language", + "scheme", + "pattern"]); + + end TextDocumentFilter_Scope; + + procedure Read_TextDocumentFilter + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.TextDocumentFilter) is + use TextDocumentFilter_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while Handler.Is_Key_Name loop + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case TextDocumentFilter_Map.Get_Index (Key) is + when 1 => -- language + Value.language.Clear; + Value.language.Append (Handler.String_Value); + Handler.Read_Next; + when 2 => -- scheme + Value.scheme.Clear; + Value.scheme.Append (Handler.String_Value); + Handler.Read_Next; + when 3 => -- pattern + Value.pattern.Clear; + Value.pattern.Append (Handler.String_Value); + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_TextDocumentFilter; + + procedure Read_FoldingRange_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.FoldingRange_Vector) is + begin + pragma Assert (Handler.Is_Start_Array); + Handler.Read_Next; + + declare + Set : LSP.Structures.FoldingRange_Vector renames Value; + Value : LSP.Structures.FoldingRange; + begin + Set.Clear; + while not Handler.Is_End_Array loop + Read_FoldingRange (Handler, Value); + Set.Append (Value); + end loop; + end; + + Handler.Read_Next; + end Read_FoldingRange_Vector; + + procedure Read_SelectionRange_Vector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SelectionRange_Vector_Or_Null) is + begin + if Handler.Is_Null_Value then + Handler.Read_Next; + else + Value.Clear; + Read_SelectionRange_Vector (Handler, Value); + end if; + end Read_SelectionRange_Vector_Or_Null; + + package ExecuteCommandRegistrationOptions_Scope is + package ExecuteCommandRegistrationOptions_Map is new Minimal_Perfect_Hash + (["workDoneProgress", + "commands"]); + + end ExecuteCommandRegistrationOptions_Scope; + + procedure Read_ExecuteCommandRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ExecuteCommandRegistrationOptions) is + use ExecuteCommandRegistrationOptions_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case ExecuteCommandRegistrationOptions_Map.Get_Index (Key) is + when 1 => -- workDoneProgress + Value.workDoneProgress := + (Is_Set => True, + Value => <>); + Value.workDoneProgress.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 2 => -- commands + Read_Virtual_String_Vector (Handler, Value.commands); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_ExecuteCommandRegistrationOptions; + + package UniquenessLevel_Map is new Minimal_Perfect_Hash + (["document", + "project", + "group", + "scheme", + "global"]); + + procedure Read_UniquenessLevel + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.UniquenessLevel) is + begin + Value := + LSP.Enumerations.UniquenessLevel'Val + (UniquenessLevel_Map.Get_Index (Handler.String_Value) - 1); + Handler.Read_Next; + end Read_UniquenessLevel; + + package TextDocumentEdit_Scope is + package TextDocumentEdit_Map is new Minimal_Perfect_Hash + (["textDocument", + "edits"]); + + package TextEdit_Or_AnnotatedTextEdit_Scope is + package TextEdit_Or_AnnotatedTextEdit_Map is new Minimal_Perfect_Hash + (["annotationId"]); + + end TextEdit_Or_AnnotatedTextEdit_Scope; + + end TextDocumentEdit_Scope; + + procedure Read_TextDocumentEdit + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.TextDocumentEdit) is + use TextDocumentEdit_Scope; + procedure Read_TextEdit_Or_AnnotatedTextEdit + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.TextEdit_Or_AnnotatedTextEdit); + + procedure Read_TextEdit_Or_AnnotatedTextEdit_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.TextEdit_Or_AnnotatedTextEdit_Vector); + + procedure Read_TextEdit_Or_AnnotatedTextEdit + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.TextEdit_Or_AnnotatedTextEdit) is + use TextEdit_Or_AnnotatedTextEdit_Scope; + begin + declare + Parent : + constant not null access VSS.JSON.Pull_Readers.JSON_Pull_Reader' + Class := + Handler'Access; + Handler : + VSS.JSON.Pull_Readers.Buffered.JSON_Buffered_Pull_Reader + (Parent); + begin + Handler.Mark; + if Handler.Is_Start_Object then + Handler.Read_Next; + Value := + (Is_TextEdit => True, + others => <>); + while Handler.Is_Key_Name loop + declare + Key : constant VSS.Strings.Virtual_String := + Handler.Key_Name; + Index : constant Natural := + TextEdit_Or_AnnotatedTextEdit_Map.Get_Index (Key); + begin + Handler.Read_Next; + case Index is + when 1 => -- annotationId + Value := + (Is_TextEdit => False, + others => <>); + exit; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + else + raise Program_Error; -- Unexpected JSON value + end if; + + Handler.Reset; + Handler.Unmark; + + case Value.Is_TextEdit is + when True => + Read_TextEdit (Handler, Value.TextEdit); + when False => + Read_AnnotatedTextEdit (Handler, Value.AnnotatedTextEdit); + end case; + end; + end Read_TextEdit_Or_AnnotatedTextEdit; + + procedure Read_TextEdit_Or_AnnotatedTextEdit_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.TextEdit_Or_AnnotatedTextEdit_Vector) is + begin + pragma Assert (Handler.Is_Start_Array); + Handler.Read_Next; + + declare + Set : + LSP.Structures.TextEdit_Or_AnnotatedTextEdit_Vector renames + Value; + Value : LSP.Structures.TextEdit_Or_AnnotatedTextEdit; + begin + Set.Clear; + while not Handler.Is_End_Array loop + Read_TextEdit_Or_AnnotatedTextEdit (Handler, Value); + Set.Append (Value); + end loop; + end; + + Handler.Read_Next; + end Read_TextEdit_Or_AnnotatedTextEdit_Vector; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case TextDocumentEdit_Map.Get_Index (Key) is + when 1 => -- textDocument + Read_OptionalVersionedTextDocumentIdentifier + (Handler, Value.textDocument); + when 2 => -- edits + Read_TextEdit_Or_AnnotatedTextEdit_Vector + (Handler, Value.edits); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_TextDocumentEdit; + + package CompletionItemLabelDetails_Scope is + package CompletionItemLabelDetails_Map is new Minimal_Perfect_Hash + (["detail", + "description"]); + + end CompletionItemLabelDetails_Scope; + + procedure Read_CompletionItemLabelDetails + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CompletionItemLabelDetails) is + use CompletionItemLabelDetails_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case CompletionItemLabelDetails_Map.Get_Index (Key) is + when 1 => -- detail + Value.detail.Clear; + Value.detail.Append (Handler.String_Value); + Handler.Read_Next; + when 2 => -- description + Value.description.Clear; + Value.description.Append (Handler.String_Value); + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_CompletionItemLabelDetails; + + package CompletionOptions_Scope is + package CompletionOptions_Map is new Minimal_Perfect_Hash + (["workDoneProgress", + "triggerCharacters", + "allCommitCharacters", + "resolveProvider", + "completionItem"]); + + package completionItem_OfCompletionOptions_Scope is + package completionItem_OfCompletionOptions_Map is new Minimal_Perfect_Hash + (["labelDetailsSupport"]); + + end completionItem_OfCompletionOptions_Scope; + + end CompletionOptions_Scope; + + procedure Read_CompletionOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CompletionOptions) is + use CompletionOptions_Scope; + procedure Read_completionItem_OfCompletionOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.completionItem_OfCompletionOptions); + + procedure Read_completionItem_OfCompletionOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.completionItem_OfCompletionOptions) is + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while Handler.Is_Key_Name loop + declare + use completionItem_OfCompletionOptions_Scope; + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case completionItem_OfCompletionOptions_Map.Get_Index (Key) is + when 1 => -- labelDetailsSupport + Value.labelDetailsSupport := + (Is_Set => True, + Value => <>); + Value.labelDetailsSupport.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_completionItem_OfCompletionOptions; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case CompletionOptions_Map.Get_Index (Key) is + when 1 => -- workDoneProgress + Value.workDoneProgress := + (Is_Set => True, + Value => <>); + Value.workDoneProgress.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 2 => -- triggerCharacters + Read_Virtual_String_Vector + (Handler, Value.triggerCharacters); + when 3 => -- allCommitCharacters + Read_Virtual_String_Vector + (Handler, Value.allCommitCharacters); + when 4 => -- resolveProvider + Value.resolveProvider := + (Is_Set => True, + Value => <>); + Value.resolveProvider.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 5 => -- completionItem + Value.completionItem := + (Is_Set => True, + Value => <>); + Read_completionItem_OfCompletionOptions + (Handler, Value.completionItem.Value); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_CompletionOptions; + + package Diagnostic_Scope is + package Diagnostic_Map is new Minimal_Perfect_Hash + (["range", + "severity", + "code", + "codeDescription", + "source", + "message", + "tags", + "relatedInformation", + "data"]); + + end Diagnostic_Scope; + + procedure Read_Diagnostic + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Diagnostic) is + use Diagnostic_Scope; + procedure Read_DiagnosticRelatedInformation_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DiagnosticRelatedInformation_Vector); + + procedure Read_DiagnosticRelatedInformation_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DiagnosticRelatedInformation_Vector) is + begin + pragma Assert (Handler.Is_Start_Array); + Handler.Read_Next; + + declare + Set : + LSP.Structures.DiagnosticRelatedInformation_Vector renames Value; + Value : LSP.Structures.DiagnosticRelatedInformation; + begin + Set.Clear; + while not Handler.Is_End_Array loop + Read_DiagnosticRelatedInformation (Handler, Value); + Set.Append (Value); + end loop; + end; + + Handler.Read_Next; + end Read_DiagnosticRelatedInformation_Vector; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case Diagnostic_Map.Get_Index (Key) is + when 1 => -- range + Read_A_Range (Handler, Value.a_range); + when 2 => -- severity + Value.severity := + (Is_Set => True, + Value => <>); + Read_DiagnosticSeverity (Handler, Value.severity.Value); + when 3 => -- code + Value.code := + (Is_Set => True, + Value => <>); + Read_Integer_Or_Virtual_String (Handler, Value.code.Value); + when 4 => -- codeDescription + Value.codeDescription := + (Is_Set => True, + Value => <>); + Read_CodeDescription (Handler, Value.codeDescription.Value); + when 5 => -- source + Value.source.Clear; + Value.source.Append (Handler.String_Value); + Handler.Read_Next; + when 6 => -- message + Value.message.Clear; + Value.message.Append (Handler.String_Value); + Handler.Read_Next; + when 7 => -- tags + Read_DiagnosticTag_Set (Handler, Value.tags); + when 8 => -- relatedInformation + Read_DiagnosticRelatedInformation_Vector + (Handler, Value.relatedInformation); + when 9 => -- data + Read_LSPAny (Handler, Value.data); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_Diagnostic; + + package LinkedEditingRangeParams_Scope is + package LinkedEditingRangeParams_Map is new Minimal_Perfect_Hash + (["textDocument", + "position", + "workDoneToken"]); + + end LinkedEditingRangeParams_Scope; + + procedure Read_LinkedEditingRangeParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.LinkedEditingRangeParams) is + use LinkedEditingRangeParams_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case LinkedEditingRangeParams_Map.Get_Index (Key) is + when 1 => -- textDocument + Read_TextDocumentIdentifier (Handler, Value.textDocument); + when 2 => -- position + Read_Position (Handler, Value.position); + when 3 => -- workDoneToken + Value.workDoneToken := + (Is_Set => True, + Value => <>); + Read_ProgressToken (Handler, Value.workDoneToken.Value); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_LinkedEditingRangeParams; + + package TextDocumentSyncOptions_Scope is + package TextDocumentSyncOptions_Map is new Minimal_Perfect_Hash + (["openClose", + "change", + "willSave", + "willSaveWaitUntil", + "save"]); + + end TextDocumentSyncOptions_Scope; + + procedure Read_TextDocumentSyncOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.TextDocumentSyncOptions) is + use TextDocumentSyncOptions_Scope; + procedure Read_Boolean_Or_SaveOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Boolean_Or_SaveOptions); + + procedure Read_Boolean_Or_SaveOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Boolean_Or_SaveOptions) is + begin + if Handler.Is_Boolean_Value then + Value := + (Is_Boolean => True, + others => <>); + else + Value := + (Is_Boolean => False, + others => <>); + end if; + + case Value.Is_Boolean is + when True => + Value.Boolean := Handler.Boolean_Value; + Handler.Read_Next; + when False => + Read_SaveOptions (Handler, Value.SaveOptions); + end case; + end Read_Boolean_Or_SaveOptions; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case TextDocumentSyncOptions_Map.Get_Index (Key) is + when 1 => -- openClose + Value.openClose := + (Is_Set => True, + Value => <>); + Value.openClose.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 2 => -- change + Value.change := + (Is_Set => True, + Value => <>); + Read_TextDocumentSyncKind (Handler, Value.change.Value); + when 3 => -- willSave + Value.willSave := + (Is_Set => True, + Value => <>); + Value.willSave.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 4 => -- willSaveWaitUntil + Value.willSaveWaitUntil := + (Is_Set => True, + Value => <>); + Value.willSaveWaitUntil.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 5 => -- save + Value.save := + (Is_Set => True, + Value => <>); + Read_Boolean_Or_SaveOptions (Handler, Value.save.Value); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_TextDocumentSyncOptions; + + package ImplementationParams_Scope is + package ImplementationParams_Map is new Minimal_Perfect_Hash + (["textDocument", + "position", + "workDoneToken", + "partialResultToken"]); + + end ImplementationParams_Scope; + + procedure Read_ImplementationParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ImplementationParams) is + use ImplementationParams_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case ImplementationParams_Map.Get_Index (Key) is + when 1 => -- textDocument + Read_TextDocumentIdentifier (Handler, Value.textDocument); + when 2 => -- position + Read_Position (Handler, Value.position); + when 3 => -- workDoneToken + Value.workDoneToken := + (Is_Set => True, + Value => <>); + Read_ProgressToken (Handler, Value.workDoneToken.Value); + when 4 => -- partialResultToken + Value.partialResultToken := + (Is_Set => True, + Value => <>); + Read_ProgressToken (Handler, Value.partialResultToken.Value); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_ImplementationParams; + + package OptionalVersionedTextDocumentIdentifier_Scope is + package OptionalVersionedTextDocumentIdentifier_Map is new Minimal_Perfect_Hash + (["uri", + "version"]); + + end OptionalVersionedTextDocumentIdentifier_Scope; + + procedure Read_OptionalVersionedTextDocumentIdentifier + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.OptionalVersionedTextDocumentIdentifier) is + use OptionalVersionedTextDocumentIdentifier_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case OptionalVersionedTextDocumentIdentifier_Map.Get_Index (Key) is + when 1 => -- uri + Value.uri := (Handler.String_Value with null record); + Handler.Read_Next; + when 2 => -- version + Read_Integer_Or_Null (Handler, Value.version); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_OptionalVersionedTextDocumentIdentifier; + + package SemanticTokensLegend_Scope is + package SemanticTokensLegend_Map is new Minimal_Perfect_Hash + (["tokenTypes", + "tokenModifiers"]); + + end SemanticTokensLegend_Scope; + + procedure Read_SemanticTokensLegend + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SemanticTokensLegend) is + use SemanticTokensLegend_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case SemanticTokensLegend_Map.Get_Index (Key) is + when 1 => -- tokenTypes + Read_Virtual_String_Vector (Handler, Value.tokenTypes); + when 2 => -- tokenModifiers + Read_Virtual_String_Vector (Handler, Value.tokenModifiers); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_SemanticTokensLegend; + + procedure Read_WorkspaceDocumentDiagnosticReport_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.WorkspaceDocumentDiagnosticReport_Vector) is + begin + pragma Assert (Handler.Is_Start_Array); + Handler.Read_Next; + + declare + Set : + LSP.Structures.WorkspaceDocumentDiagnosticReport_Vector renames + Value; + Value : LSP.Structures.WorkspaceDocumentDiagnosticReport; + begin + Set.Clear; + while not Handler.Is_End_Array loop + Read_WorkspaceDocumentDiagnosticReport (Handler, Value); + Set.Append (Value); + end loop; + end; + + Handler.Read_Next; + end Read_WorkspaceDocumentDiagnosticReport_Vector; + + package ExecuteCommandOptions_Scope is + package ExecuteCommandOptions_Map is new Minimal_Perfect_Hash + (["workDoneProgress", + "commands"]); + + end ExecuteCommandOptions_Scope; + + procedure Read_ExecuteCommandOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ExecuteCommandOptions) is + use ExecuteCommandOptions_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case ExecuteCommandOptions_Map.Get_Index (Key) is + when 1 => -- workDoneProgress + Value.workDoneProgress := + (Is_Set => True, + Value => <>); + Value.workDoneProgress.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 2 => -- commands + Read_Virtual_String_Vector (Handler, Value.commands); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_ExecuteCommandOptions; + + package TextDocumentSyncClientCapabilities_Scope is + package TextDocumentSyncClientCapabilities_Map is new Minimal_Perfect_Hash + (["dynamicRegistration", + "willSave", + "willSaveWaitUntil", + "didSave"]); + + end TextDocumentSyncClientCapabilities_Scope; + + procedure Read_TextDocumentSyncClientCapabilities + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.TextDocumentSyncClientCapabilities) is + use TextDocumentSyncClientCapabilities_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case TextDocumentSyncClientCapabilities_Map.Get_Index (Key) is + when 1 => -- dynamicRegistration + Value.dynamicRegistration := + (Is_Set => True, + Value => <>); + Value.dynamicRegistration.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 2 => -- willSave + Value.willSave := + (Is_Set => True, + Value => <>); + Value.willSave.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 3 => -- willSaveWaitUntil + Value.willSaveWaitUntil := + (Is_Set => True, + Value => <>); + Value.willSaveWaitUntil.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 4 => -- didSave + Value.didSave := + (Is_Set => True, + Value => <>); + Value.didSave.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_TextDocumentSyncClientCapabilities; + + package MarkupKind_Map is new Minimal_Perfect_Hash + (["plaintext", + "markdown"]); + + procedure Read_MarkupKind + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.MarkupKind) is + begin + Value := + LSP.Enumerations.MarkupKind'Val + (MarkupKind_Map.Get_Index (Handler.String_Value) - 1); + Handler.Read_Next; + end Read_MarkupKind; + + package CallHierarchyPrepareParams_Scope is + package CallHierarchyPrepareParams_Map is new Minimal_Perfect_Hash + (["textDocument", + "position", + "workDoneToken"]); + + end CallHierarchyPrepareParams_Scope; + + procedure Read_CallHierarchyPrepareParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CallHierarchyPrepareParams) is + use CallHierarchyPrepareParams_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case CallHierarchyPrepareParams_Map.Get_Index (Key) is + when 1 => -- textDocument + Read_TextDocumentIdentifier (Handler, Value.textDocument); + when 2 => -- position + Read_Position (Handler, Value.position); + when 3 => -- workDoneToken + Value.workDoneToken := + (Is_Set => True, + Value => <>); + Read_ProgressToken (Handler, Value.workDoneToken.Value); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_CallHierarchyPrepareParams; + + procedure Read_LSPErrorCodes + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.LSPErrorCodes) is + begin + Value := + LSP.Enumerations.LSPErrorCodes'Val + (Handler.Number_Value.Integer_Value + 32_899); + Handler.Read_Next; + end Read_LSPErrorCodes; + + package ReferenceRegistrationOptions_Scope is + package ReferenceRegistrationOptions_Map is new Minimal_Perfect_Hash + (["documentSelector", + "workDoneProgress"]); + + end ReferenceRegistrationOptions_Scope; + + procedure Read_ReferenceRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ReferenceRegistrationOptions) is + use ReferenceRegistrationOptions_Scope; + procedure Read_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSelector_Or_Null); + + procedure Read_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSelector_Or_Null) is + begin + if Handler.Is_Null_Value then + Handler.Read_Next; + else + Value := + (Is_Null => False, + Value => <>); + Read_DocumentSelector (Handler, Value.Value); + end if; + end Read_DocumentSelector_Or_Null; + + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case ReferenceRegistrationOptions_Map.Get_Index (Key) is + when 1 => -- documentSelector + Read_DocumentSelector_Or_Null + (Handler, Value.Parent.documentSelector); + when 2 => -- workDoneProgress + Value.workDoneProgress := + (Is_Set => True, + Value => <>); + Value.workDoneProgress.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_ReferenceRegistrationOptions; + + package LinkedEditingRangeOptions_Scope is + package LinkedEditingRangeOptions_Map is new Minimal_Perfect_Hash + (["workDoneProgress"]); + + end LinkedEditingRangeOptions_Scope; + + procedure Read_LinkedEditingRangeOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.LinkedEditingRangeOptions) is + use LinkedEditingRangeOptions_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case LinkedEditingRangeOptions_Map.Get_Index (Key) is + when 1 => -- workDoneProgress + Value.workDoneProgress := + (Is_Set => True, + Value => <>); + Value.workDoneProgress.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_LinkedEditingRangeOptions; + +end LSP.Inputs; diff --git a/source/lsp_3.17/generated/lsp-inputs.ads b/source/lsp_3.17/generated/lsp-inputs.ads new file mode 100644 index 000000000..7d1407a2e --- /dev/null +++ b/source/lsp_3.17/generated/lsp-inputs.ads @@ -0,0 +1,590 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with VSS.JSON.Pull_Readers; + +with LSP.Enumerations; +with LSP.Structures; + +package LSP.Inputs is + procedure Read_InitializeParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.InitializeParams); + + procedure Read_DocumentLink_Vector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentLink_Vector_Or_Null); + + procedure Read_Command_Or_CodeAction_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Command_Or_CodeAction_Vector); + + procedure Read_Null_Record + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Null_Record); + + procedure Read_CallHierarchyOutgoingCall_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CallHierarchyOutgoingCall_Vector); + + procedure Read_DocumentDiagnosticParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentDiagnosticParams); + + procedure Read_DocumentLink_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentLink_Vector); + + procedure Read_InlineValueParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.InlineValueParams); + + procedure Read_DidSaveNotebookDocumentParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DidSaveNotebookDocumentParams); + + procedure Read_Declaration_Result + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Declaration_Result); + + procedure Read_Definition_Progress_Report + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Definition_Progress_Report); + + procedure Read_SemanticTokensParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SemanticTokensParams); + + procedure Read_ColorInformation_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ColorInformation_Vector); + + procedure Read_DocumentSymbol_Progress_Report + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSymbol_Progress_Report); + + procedure Read_CallHierarchyIncomingCall_Vector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CallHierarchyIncomingCall_Vector_Or_Null); + + procedure Read_CodeLens_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CodeLens_Vector); + + procedure Read_LSPAny + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.LSPAny); + + procedure Read_LogTraceParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.LogTraceParams); + + procedure Read_PrepareRenameResult_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.PrepareRenameResult_Or_Null); + + procedure Read_CompletionItem_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CompletionItem_Vector); + + procedure Read_Moniker_Vector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Moniker_Vector_Or_Null); + + procedure Read_WorkDoneProgressReport + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.WorkDoneProgressReport); + + procedure Read_WorkspaceSymbolParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.WorkspaceSymbolParams); + + procedure Read_InitializeResult + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.InitializeResult); + + procedure Read_WorkDoneProgressCancelParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.WorkDoneProgressCancelParams); + + procedure Read_DidChangeWatchedFilesParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DidChangeWatchedFilesParams); + + procedure Read_DidOpenNotebookDocumentParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DidOpenNotebookDocumentParams); + + procedure Read_SignatureHelp_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SignatureHelp_Or_Null); + + procedure Read_CodeLens_Vector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CodeLens_Vector_Or_Null); + + procedure Read_WorkspaceFolder_Vector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.WorkspaceFolder_Vector_Or_Null); + + procedure Read_DocumentLinkParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentLinkParams); + + procedure Read_ConfigurationParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ConfigurationParams); + + procedure Read_DidChangeTextDocumentParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DidChangeTextDocumentParams); + + procedure Read_Declaration_Progress_Report + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Declaration_Progress_Report); + + procedure Read_DidSaveTextDocumentParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DidSaveTextDocumentParams); + + procedure Read_ShowMessageParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ShowMessageParams); + + procedure Read_ReferenceParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ReferenceParams); + + procedure Read_DidChangeConfigurationParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DidChangeConfigurationParams); + + procedure Read_Hover_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Hover_Or_Null); + + procedure Read_CallHierarchyOutgoingCall_Vector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CallHierarchyOutgoingCall_Vector_Or_Null); + + procedure Read_ShowDocumentResult + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ShowDocumentResult); + + procedure Read_TypeDefinitionParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.TypeDefinitionParams); + + procedure Read_RenameParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.RenameParams); + + procedure Read_LSPAny_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.LSPAny_Or_Null); + + procedure Read_WorkspaceSymbol + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.WorkspaceSymbol); + + procedure Read_LSPAny_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.LSPAny_Vector); + + procedure Read_PrepareRenameParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.PrepareRenameParams); + + procedure Read_CancelParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CancelParams); + + procedure Read_DefinitionParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DefinitionParams); + + procedure Read_ColorPresentationParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ColorPresentationParams); + + procedure Read_ErrorCodes + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.ErrorCodes); + + procedure Read_FoldingRange_Vector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.FoldingRange_Vector_Or_Null); + + procedure Read_MessageActionItem_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.MessageActionItem_Or_Null); + + procedure Read_ApplyWorkspaceEditParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ApplyWorkspaceEditParams); + + procedure Read_CodeAction + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CodeAction); + + procedure Read_InlayHint_Vector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.InlayHint_Vector_Or_Null); + + procedure Read_DeclarationParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DeclarationParams); + + procedure Read_DocumentRangeFormattingParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentRangeFormattingParams); + + procedure Read_MonikerParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.MonikerParams); + + procedure Read_InlayHint + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.InlayHint); + + procedure Read_UnregistrationParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.UnregistrationParams); + + procedure Read_SelectionRangeParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SelectionRangeParams); + + procedure Read_Tokens_Delta_Result + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Tokens_Delta_Result); + + procedure Read_RenameFilesParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.RenameFilesParams); + + procedure Read_Symbol_Progress_Report + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Symbol_Progress_Report); + + procedure Read_TypeHierarchySubtypesParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.TypeHierarchySubtypesParams); + + procedure Read_ApplyWorkspaceEditResult + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ApplyWorkspaceEditResult); + + procedure Read_SemanticTokensPartialResult + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SemanticTokensPartialResult); + + procedure Read_Completion_Result + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Completion_Result); + + procedure Read_CallHierarchyItem_Vector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CallHierarchyItem_Vector_Or_Null); + + procedure Read_DidCloseTextDocumentParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DidCloseTextDocumentParams); + + procedure Read_CallHierarchyOutgoingCallsParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CallHierarchyOutgoingCallsParams); + + procedure Read_SelectionRange_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SelectionRange_Vector); + + procedure Read_SemanticTokensDeltaParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SemanticTokensDeltaParams); + + procedure Read_DidChangeWorkspaceFoldersParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DidChangeWorkspaceFoldersParams); + + procedure Read_CodeLensParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CodeLensParams); + + procedure Read_TypeHierarchyItem_Vector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.TypeHierarchyItem_Vector_Or_Null); + + procedure Read_Symbol_Result + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Symbol_Result); + + procedure Read_TypeHierarchySupertypesParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.TypeHierarchySupertypesParams); + + procedure Read_PublishDiagnosticsParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.PublishDiagnosticsParams); + + procedure Read_WorkspaceDiagnosticReport + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.WorkspaceDiagnosticReport); + + procedure Read_TextEdit_Vector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.TextEdit_Vector_Or_Null); + + procedure Read_LinkedEditingRanges_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.LinkedEditingRanges_Or_Null); + + procedure Read_SetTraceParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SetTraceParams); + + procedure Read_WorkspaceDiagnosticReportPartialResult + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.WorkspaceDiagnosticReportPartialResult); + + procedure Read_DidOpenTextDocumentParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DidOpenTextDocumentParams); + + procedure Read_SemanticTokensPartialResult_Or_SemanticTokensDeltaPartialResult + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures + .SemanticTokensPartialResult_Or_SemanticTokensDeltaPartialResult); + + procedure Read_DocumentDiagnosticReport + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentDiagnosticReport); + + procedure Read_ExecuteCommandParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ExecuteCommandParams); + + procedure Read_WorkDoneProgressBegin + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.WorkDoneProgressBegin); + + procedure Read_InlayHintParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.InlayHintParams); + + procedure Read_WorkDoneProgressCreateParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.WorkDoneProgressCreateParams); + + procedure Read_DocumentHighlightParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentHighlightParams); + + procedure Read_SemanticTokens_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SemanticTokens_Or_Null); + + procedure Read_SemanticTokensRangeParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SemanticTokensRangeParams); + + procedure Read_CompletionParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CompletionParams); + + procedure Read_CallHierarchyIncomingCallsParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CallHierarchyIncomingCallsParams); + + procedure Read_Location_Vector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Location_Vector_Or_Null); + + procedure Read_DidChangeNotebookDocumentParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DidChangeNotebookDocumentParams); + + procedure Read_WorkspaceDiagnosticParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.WorkspaceDiagnosticParams); + + procedure Read_InlineValue_Vector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.InlineValue_Vector_Or_Null); + + procedure Read_DidCloseNotebookDocumentParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DidCloseNotebookDocumentParams); + + procedure Read_InlayHint_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.InlayHint_Vector); + + procedure Read_ShowDocumentParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ShowDocumentParams); + + procedure Read_CreateFilesParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CreateFilesParams); + + procedure Read_ColorPresentation_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ColorPresentation_Vector); + + procedure Read_DocumentFormattingParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentFormattingParams); + + procedure Read_DeleteFilesParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DeleteFilesParams); + + procedure Read_TypeHierarchyItem_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.TypeHierarchyItem_Vector); + + procedure Read_DocumentOnTypeFormattingParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentOnTypeFormattingParams); + + procedure Read_Location_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Location_Vector); + + procedure Read_DocumentColorParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentColorParams); + + procedure Read_DocumentLink + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentLink); + + procedure Read_WorkDoneProgressEnd + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.WorkDoneProgressEnd); + + procedure Read_DocumentSymbolParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSymbolParams); + + procedure Read_InlineValue_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.InlineValue_Vector); + + procedure Read_InitializedParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.InitializedParams); + + procedure Read_ShowMessageRequestParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ShowMessageRequestParams); + + procedure Read_WorkspaceEdit_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.WorkspaceEdit_Or_Null); + + procedure Read_DocumentHighlight_Vector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentHighlight_Vector_Or_Null); + + procedure Read_LogMessageParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.LogMessageParams); + + procedure Read_CodeLens + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CodeLens); + + procedure Read_DocumentDiagnosticReportPartialResult + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentDiagnosticReportPartialResult); + + procedure Read_CallHierarchyIncomingCall_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CallHierarchyIncomingCall_Vector); + + procedure Read_ProgressParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ProgressParams); + + procedure Read_DocumentSymbol_Result + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentSymbol_Result); + + procedure Read_TypeHierarchyPrepareParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.TypeHierarchyPrepareParams); + + procedure Read_WillSaveTextDocumentParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.WillSaveTextDocumentParams); + + procedure Read_Command_Or_CodeAction_Vector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Command_Or_CodeAction_Vector_Or_Null); + + procedure Read_Definition_Result + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Definition_Result); + + procedure Read_CompletionItem + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CompletionItem); + + procedure Read_Moniker_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Moniker_Vector); + + procedure Read_HoverParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.HoverParams); + + procedure Read_DocumentHighlight_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DocumentHighlight_Vector); + + procedure Read_Integer_Or_Virtual_String + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.Integer_Or_Virtual_String); + + procedure Read_FoldingRangeParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.FoldingRangeParams); + + procedure Read_RegistrationParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.RegistrationParams); + + procedure Read_SignatureHelpParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SignatureHelpParams); + + procedure Read_CodeActionParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CodeActionParams); + + procedure Read_FoldingRange_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.FoldingRange_Vector); + + procedure Read_SelectionRange_Vector_Or_Null + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.SelectionRange_Vector_Or_Null); + + procedure Read_LinkedEditingRangeParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.LinkedEditingRangeParams); + + procedure Read_ImplementationParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ImplementationParams); + + procedure Read_CallHierarchyPrepareParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.CallHierarchyPrepareParams); + +end LSP.Inputs; diff --git a/source/lsp_3.17/generated/lsp-outputs.adb b/source/lsp_3.17/generated/lsp-outputs.adb new file mode 100644 index 000000000..6782a6183 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-outputs.adb @@ -0,0 +1,11270 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with Ada.Containers; +with Interfaces; +with LSP.Output_Tools; + +package body LSP.Outputs is + + pragma Warnings (Off, "is not referenced"); + use type Interfaces.Integer_64; + + use type Ada.Containers.Count_Type; + + procedure Write_ClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ClientCapabilities); + + procedure Write_FileChangeType + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.FileChangeType); + + procedure Write_Virtual_String + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Virtual_String); + + procedure Write_Declaration + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Declaration); + + procedure Write_FileOperationRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.FileOperationRegistrationOptions); + + procedure Write_WorkspaceFolder_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.WorkspaceFolder_Vector); + + procedure Write_TextDocumentContentChangeEvent_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.TextDocumentContentChangeEvent_Vector); + + procedure Write_FoldingRangeClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.FoldingRangeClientCapabilities); + + procedure Write_CreateFile + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CreateFile); + + procedure Write_CompletionContext + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CompletionContext); + + procedure Write_NotebookCell_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.NotebookCell_Vector); + + procedure Write_CodeActionKind + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.CodeActionKind); + + procedure Write_RelatedUnchangedDocumentDiagnosticReport + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.RelatedUnchangedDocumentDiagnosticReport); + + procedure Write_DidChangeWatchedFilesClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DidChangeWatchedFilesClientCapabilities); + + procedure Write_SemanticTokenTypes + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.SemanticTokenTypes); + + procedure Write_AnnotatedTextEdit + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.AnnotatedTextEdit); + + procedure Write_DeclarationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DeclarationOptions); + + procedure Write_SignatureInformation + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SignatureInformation); + + procedure Write_TextDocumentSaveReason + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.TextDocumentSaveReason); + + procedure Write_SemanticTokens + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SemanticTokens); + + procedure Write_TokenFormat + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.TokenFormat); + + procedure Write_TextDocumentRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.TextDocumentRegistrationOptions); + + procedure Write_URI + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.URI); + + procedure Write_SemanticTokenModifiers + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.SemanticTokenModifiers); + + procedure Write_ConfigurationItem + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ConfigurationItem); + + procedure Write_DocumentOnTypeFormattingClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentOnTypeFormattingClientCapabilities); + + procedure Write_SymbolKind + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.SymbolKind); + + procedure Write_SelectionRangeClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SelectionRangeClientCapabilities); + + procedure Write_Range_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Range_Vector); + + procedure Write_Definition + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Definition); + + procedure Write_NotebookDocumentFilter + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.NotebookDocumentFilter); + + procedure Write_Color + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Color); + + procedure Write_FileOperationPattern + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.FileOperationPattern); + + procedure Write_LinkedEditingRanges + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.LinkedEditingRanges); + + procedure Write_Virtual_String_Or_MarkupContent + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Virtual_String_Or_MarkupContent); + + procedure Write_ServerCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ServerCapabilities); + + procedure Write_DidChangeWatchedFilesRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DidChangeWatchedFilesRegistrationOptions); + + procedure Write_CallHierarchyOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CallHierarchyOptions); + + procedure Write_ImplementationRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ImplementationRegistrationOptions); + + procedure Write_FoldingRangeRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.FoldingRangeRegistrationOptions); + + procedure Write_InlineValueContext + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.InlineValueContext); + + procedure Write_TextDocumentIdentifier_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.TextDocumentIdentifier_Vector); + + procedure Write_DefinitionLink + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DefinitionLink); + + procedure Write_DocumentFormattingOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentFormattingOptions); + + procedure Write_SymbolInformation_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SymbolInformation_Vector); + + procedure Write_RenameFile + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.RenameFile); + + procedure Write_DidChangeConfigurationRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DidChangeConfigurationRegistrationOptions); + + procedure Write_CallHierarchyItem + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CallHierarchyItem); + + procedure Write_SymbolTag_Set + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SymbolTag_Set); + + procedure Write_RelativePattern + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.RelativePattern); + + procedure Write_tagSupport_OfWorkspaceSymbolClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.tagSupport_OfWorkspaceSymbolClientCapabilities); + + procedure Write_ReferenceOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ReferenceOptions); + + procedure Write_TextDocumentClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.TextDocumentClientCapabilities); + + procedure Write_DocumentSymbol_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSymbol_Vector); + + procedure Write_GlobPattern + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.GlobPattern); + + procedure Write_NotebookDocumentIdentifier + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.NotebookDocumentIdentifier); + + procedure Write_InsertReplaceEdit + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.InsertReplaceEdit); + + procedure Write_InlineValueVariableLookup + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.InlineValueVariableLookup); + + procedure Write_FileEvent + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.FileEvent); + + procedure Write_SignatureHelpClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SignatureHelpClientCapabilities); + + procedure Write_NotebookDocumentSyncClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.NotebookDocumentSyncClientCapabilities); + + procedure Write_ProgressToken + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ProgressToken); + + procedure Write_DiagnosticOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DiagnosticOptions); + + procedure Write_WindowClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.WindowClientCapabilities); + + procedure Write_GeneralClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.GeneralClientCapabilities); + + procedure Write_SemanticTokensWorkspaceClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SemanticTokensWorkspaceClientCapabilities); + + procedure Write_LinkedEditingRangeClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.LinkedEditingRangeClientCapabilities); + + procedure Write_SignatureHelp + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SignatureHelp); + + procedure Write_Diagnostic_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Diagnostic_Vector); + + procedure Write_DocumentHighlightKind + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.DocumentHighlightKind); + + procedure Write_ResourceOperationKind + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.ResourceOperationKind); + + procedure Write_InlineValueClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.InlineValueClientCapabilities); + + procedure Write_PrepareRenameResult + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.PrepareRenameResult); + + procedure Write_DocumentLinkClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentLinkClientCapabilities); + + procedure Write_MarkupKind_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.MarkupKind_Vector); + + procedure Write_CodeActionContext + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CodeActionContext); + + procedure Write_InlayHintRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.InlayHintRegistrationOptions); + + procedure Write_Natural_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Natural_Vector); + + procedure Write_CodeDescription + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CodeDescription); + + procedure Write_Virtual_String_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Virtual_String_Vector); + + procedure Write_LSPObject + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.LSPObject); + + procedure Write_TextDocumentPositionParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.TextDocumentPositionParams); + + procedure Write_CodeLensRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CodeLensRegistrationOptions); + + procedure Write_SelectionRange + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SelectionRange); + + procedure Write_NotebookCellTextDocumentFilter + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.NotebookCellTextDocumentFilter); + + procedure Write_WorkspaceFoldersInitializeParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.WorkspaceFoldersInitializeParams); + + procedure Write_FileSystemWatcher + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.FileSystemWatcher); + + procedure Write_CodeActionKind_Set + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CodeActionKind_Set); + + procedure Write_NotebookDocumentSyncOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.NotebookDocumentSyncOptions); + + procedure Write_CodeActionRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CodeActionRegistrationOptions); + + procedure Write_NotebookDocumentSyncRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.NotebookDocumentSyncRegistrationOptions); + + procedure Write_WorkspaceUnchangedDocumentDiagnosticReport + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.WorkspaceUnchangedDocumentDiagnosticReport); + + procedure Write_HoverClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.HoverClientCapabilities); + + procedure Write_RenameClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.RenameClientCapabilities); + + procedure Write_DefinitionOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DefinitionOptions); + + procedure Write_InlayHintKind + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.InlayHintKind); + + procedure Write_symbolKind_OfWorkspaceSymbolClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.symbolKind_OfWorkspaceSymbolClientCapabilities); + + procedure Write_FailureHandlingKind + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.FailureHandlingKind); + + procedure Write_FileOperationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.FileOperationOptions); + + procedure Write_DocumentSelector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSelector); + + procedure Write_CompletionClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CompletionClientCapabilities); + + procedure Write_CodeLensWorkspaceClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CodeLensWorkspaceClientCapabilities); + + procedure Write_RenameOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.RenameOptions); + + procedure Write_SymbolKind_Set + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SymbolKind_Set); + + procedure Write_DidChangeConfigurationClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DidChangeConfigurationClientCapabilities); + + procedure Write_DocumentHighlightRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentHighlightRegistrationOptions); + + procedure Write_DeclarationLink + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DeclarationLink); + + procedure Write_T + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.T); + + procedure Write_FullDocumentDiagnosticReport + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.FullDocumentDiagnosticReport); + + procedure Write_DocumentSymbolRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSymbolRegistrationOptions); + + procedure Write_DeclarationRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DeclarationRegistrationOptions); + + procedure Write_DeleteFileOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DeleteFileOptions); + + procedure Write_WatchKind + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.WatchKind); + + procedure Write_TypeHierarchyRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.TypeHierarchyRegistrationOptions); + + procedure Write_DiagnosticSeverity + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.DiagnosticSeverity); + + procedure Write_CodeActionTriggerKind + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.CodeActionTriggerKind); + + procedure Write_CodeActionClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CodeActionClientCapabilities); + + procedure Write_MarkdownClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.MarkdownClientCapabilities); + + procedure Write_DefinitionLink_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DefinitionLink_Vector); + + procedure Write_ImplementationClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ImplementationClientCapabilities); + + procedure Write_TextDocumentItem + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.TextDocumentItem); + + procedure Write_InsertTextFormat + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.InsertTextFormat); + + procedure Write_relatedDocuments_OfDocumentDiagnosticReportPartialResult_Item + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures + .relatedDocuments_OfDocumentDiagnosticReportPartialResult_Item); + + procedure Write_ExecuteCommandClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ExecuteCommandClientCapabilities); + + procedure Write_CallHierarchyItem_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CallHierarchyItem_Vector); + + procedure Write_DeleteFile + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DeleteFile); + + procedure Write_SaveOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SaveOptions); + + procedure Write_NotebookDocument + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.NotebookDocument); + + procedure Write_RelatedFullDocumentDiagnosticReport + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.RelatedFullDocumentDiagnosticReport); + + procedure Write_CodeLensClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CodeLensClientCapabilities); + + procedure Write_DocumentSymbolOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSymbolOptions); + + procedure Write_CompletionRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CompletionRegistrationOptions); + + procedure Write_InlayHintClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.InlayHintClientCapabilities); + + procedure Write_ReferenceContext + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ReferenceContext); + + procedure Write_WorkspaceEditClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.WorkspaceEditClientCapabilities); + + procedure Write_WorkspaceSymbolOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.WorkspaceSymbolOptions); + + procedure Write_ChangeAnnotation + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ChangeAnnotation); + + procedure Write_FileOperationPatternOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.FileOperationPatternOptions); + + procedure Write_VersionedTextDocumentIdentifier + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.VersionedTextDocumentIdentifier); + + procedure Write_SemanticTokensDelta + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SemanticTokensDelta); + + procedure Write_ShowDocumentClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ShowDocumentClientCapabilities); + + procedure Write_InlayHintLabelPart + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.InlayHintLabelPart); + + procedure Write_SelectionRangeOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SelectionRangeOptions); + + procedure Write_LocationLink + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.LocationLink); + + procedure Write_CompletionList + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CompletionList); + + procedure Write_DiagnosticRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DiagnosticRegistrationOptions); + + procedure Write_SignatureHelpTriggerKind + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.SignatureHelpTriggerKind); + + procedure Write_TypeHierarchyClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.TypeHierarchyClientCapabilities); + + procedure Write_DocumentOnTypeFormattingOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentOnTypeFormattingOptions); + + procedure Write_WorkspaceSymbolRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.WorkspaceSymbolRegistrationOptions); + + procedure Write_FileDelete + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.FileDelete); + + procedure Write_DocumentFormattingRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentFormattingRegistrationOptions); + + procedure Write_ColorPresentation + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ColorPresentation); + + procedure Write_TypeHierarchyItem + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.TypeHierarchyItem); + + procedure Write_Boolean_Or_Any + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Boolean_Or_Any); + + procedure Write_Location + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Location); + + procedure Write_RenameRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.RenameRegistrationOptions); + + procedure Write_ParameterInformation + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ParameterInformation); + + procedure Write_PositionEncodingKind + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.PositionEncodingKind); + + procedure Write_MessageType + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.MessageType); + + procedure Write_An_InitializeParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.An_InitializeParams); + + procedure Write_FileOperationFilter + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.FileOperationFilter); + + procedure Write_MonikerOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.MonikerOptions); + + procedure Write_InlineValue + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.InlineValue); + + procedure Write_Virtual_String_Or_NotebookDocumentFilter + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Virtual_String_Or_NotebookDocumentFilter); + + procedure Write_MonikerKind + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.MonikerKind); + + procedure Write_NotebookCellKind + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.NotebookCellKind); + + procedure Write_HoverRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.HoverRegistrationOptions); + + procedure Write_CompletionItemTag + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.CompletionItemTag); + + procedure Write_DefinitionRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DefinitionRegistrationOptions); + + procedure Write_clientInfo_Of_InitializeParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.clientInfo_Of_InitializeParams); + + procedure Write_DiagnosticTag + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.DiagnosticTag); + + procedure Write_DiagnosticClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DiagnosticClientCapabilities); + + procedure Write_MonikerRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.MonikerRegistrationOptions); + + procedure Write_ExecutionSummary + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ExecutionSummary); + + procedure Write_PreviousResultId + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.PreviousResultId); + + procedure Write_FoldingRangeKind + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.FoldingRangeKind); + + procedure Write_DocumentFilter + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentFilter); + + procedure Write_CallHierarchyIncomingCall + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CallHierarchyIncomingCall); + + procedure Write_TextDocumentChangeRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.TextDocumentChangeRegistrationOptions); + + procedure Write_DeclarationLink_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DeclarationLink_Vector); + + procedure Write_DocumentFormattingClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentFormattingClientCapabilities); + + procedure Write_NotebookDocumentChangeEvent + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.NotebookDocumentChangeEvent); + + procedure Write_FormattingOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.FormattingOptions); + + procedure Write_resolveSupport_OfWorkspaceSymbolClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures + .resolveSupport_OfWorkspaceSymbolClientCapabilities); + + procedure Write_WorkspaceSymbol_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.WorkspaceSymbol_Vector); + + procedure Write_TypeDefinitionRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.TypeDefinitionRegistrationOptions); + + procedure Write_CodeLensOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CodeLensOptions); + + procedure Write_FileRename + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.FileRename); + + procedure Write_DocumentRangeFormattingClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentRangeFormattingClientCapabilities); + + procedure Write_Moniker + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Moniker); + + procedure Write_DiagnosticWorkspaceClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DiagnosticWorkspaceClientCapabilities); + + procedure Write_DefinitionClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DefinitionClientCapabilities); + + procedure Write_SignatureHelpRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SignatureHelpRegistrationOptions); + + procedure Write_TypeDefinitionOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.TypeDefinitionOptions); + + procedure Write_MarkupContent + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.MarkupContent); + + procedure Write_WorkspaceEdit + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.WorkspaceEdit); + + procedure Write_DocumentHighlight + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentHighlight); + + procedure Write_MessageActionItem + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.MessageActionItem); + + procedure Write_TextDocumentItem_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.TextDocumentItem_Vector); + + procedure Write_InlineValueRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.InlineValueRegistrationOptions); + + procedure Write_VersionedNotebookDocumentIdentifier + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.VersionedNotebookDocumentIdentifier); + + procedure Write_BaseSymbolInformation + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.BaseSymbolInformation); + + procedure Write_TextEdit + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.TextEdit); + + procedure Write_DeclarationClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DeclarationClientCapabilities); + + procedure Write_SignatureHelpOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SignatureHelpOptions); + + procedure Write_SemanticTokensEdit + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SemanticTokensEdit); + + procedure Write_FileCreate + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.FileCreate); + + procedure Write_WorkspaceFullDocumentDiagnosticReport + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.WorkspaceFullDocumentDiagnosticReport); + + procedure Write_FoldingRange + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.FoldingRange); + + procedure Write_SemanticTokensDeltaPartialResult + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SemanticTokensDeltaPartialResult); + + procedure Write_NotebookDocumentClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.NotebookDocumentClientCapabilities); + + procedure Write_WorkspaceSymbolClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.WorkspaceSymbolClientCapabilities); + + procedure Write_Boolean_Or_Something + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Boolean_Or_Something); + + procedure Write_TypeHierarchyOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.TypeHierarchyOptions); + + procedure Write_SelectionRangeRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SelectionRangeRegistrationOptions); + + procedure Write_RegularExpressionsClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.RegularExpressionsClientCapabilities); + + procedure Write_WorkspaceDocumentDiagnosticReport + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.WorkspaceDocumentDiagnosticReport); + + procedure Write_WorkspaceClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.WorkspaceClientCapabilities); + + procedure Write_TextDocumentSyncKind + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.TextDocumentSyncKind); + + procedure Write_InlayHintOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.InlayHintOptions); + + procedure Write_InlineValueOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.InlineValueOptions); + + procedure Write_WorkspaceFoldersChangeEvent + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.WorkspaceFoldersChangeEvent); + + procedure Write_TypeDefinitionClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.TypeDefinitionClientCapabilities); + + procedure Write_CreateFileOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CreateFileOptions); + + procedure Write_DiagnosticRelatedInformation + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DiagnosticRelatedInformation); + + procedure Write_InsertTextMode + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.InsertTextMode); + + procedure Write_ImplementationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ImplementationOptions); + + procedure Write_DocumentColorRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentColorRegistrationOptions); + + procedure Write_CodeActionOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CodeActionOptions); + + procedure Write_CompletionItemKind + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.CompletionItemKind); + + procedure Write_Command_Or_CodeAction + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Command_Or_CodeAction); + + procedure Write_ChangeAnnotationIdentifier + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ChangeAnnotationIdentifier); + + procedure Write_SignatureHelpContext + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SignatureHelpContext); + + procedure Write_CallHierarchyOutgoingCall + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CallHierarchyOutgoingCall); + + procedure Write_TextDocumentContentChangeEvent + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.TextDocumentContentChangeEvent); + + procedure Write_WorkspaceFolder + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.WorkspaceFolder); + + procedure Write_MarkedString + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.MarkedString); + + procedure Write_NotebookCell + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.NotebookCell); + + procedure Write_WorkspaceFoldersServerCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.WorkspaceFoldersServerCapabilities); + + procedure Write_SemanticTokensRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SemanticTokensRegistrationOptions); + + procedure Write_CompletionTriggerKind + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.CompletionTriggerKind); + + procedure Write_CallHierarchyRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CallHierarchyRegistrationOptions); + + procedure Write_CallHierarchyClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CallHierarchyClientCapabilities); + + procedure Write_DocumentRangeFormattingOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentRangeFormattingOptions); + + procedure Write_InlayHintWorkspaceClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.InlayHintWorkspaceClientCapabilities); + + procedure Write_DiagnosticServerCancellationData + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DiagnosticServerCancellationData); + + procedure Write_DocumentColorOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentColorOptions); + + procedure Write_FileOperationPatternKind + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.FileOperationPatternKind); + + procedure Write_Unregistration + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Unregistration); + + procedure Write_HoverOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.HoverOptions); + + procedure Write_DocumentOnTypeFormattingRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentOnTypeFormattingRegistrationOptions); + + procedure Write_relatedDocuments_OfDocumentDiagnosticReportPartialResult + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures + .relatedDocuments_OfDocumentDiagnosticReportPartialResult); + + procedure Write_ReferenceClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ReferenceClientCapabilities); + + procedure Write_MonikerClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.MonikerClientCapabilities); + + procedure Write_CompletionItemTag_Set + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CompletionItemTag_Set); + + procedure Write_ColorInformation + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ColorInformation); + + procedure Write_A_Range + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.A_Range); + + procedure Write_DocumentColorClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentColorClientCapabilities); + + procedure Write_InlineValueEvaluatableExpression + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.InlineValueEvaluatableExpression); + + procedure Write_Pattern + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Pattern); + + procedure Write_DiagnosticTag_Set + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DiagnosticTag_Set); + + procedure Write_NotebookCellArrayChange + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.NotebookCellArrayChange); + + procedure Write_DocumentLinkRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentLinkRegistrationOptions); + + procedure Write_DocumentLinkOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentLinkOptions); + + procedure Write_PrepareSupportDefaultBehavior + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.PrepareSupportDefaultBehavior); + + procedure Write_TextDocumentIdentifier + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.TextDocumentIdentifier); + + procedure Write_TraceValues + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.TraceValues); + + procedure Write_SymbolInformation + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SymbolInformation); + + procedure Write_FileOperationClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.FileOperationClientCapabilities); + + procedure Write_DocumentHighlightClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentHighlightClientCapabilities); + + procedure Write_InlineValueText + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.InlineValueText); + + procedure Write_UnchangedDocumentDiagnosticReport + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.UnchangedDocumentDiagnosticReport); + + procedure Write_SymbolTag + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.SymbolTag); + + procedure Write_Registration + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Registration); + + procedure Write_DocumentRangeFormattingRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentRangeFormattingRegistrationOptions); + + procedure Write_RenameFileOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.RenameFileOptions); + + procedure Write_DocumentSymbol + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSymbol); + + procedure Write_DocumentSymbolClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSymbolClientCapabilities); + + procedure Write_InitializeError + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.InitializeError); + + procedure Write_LinkedEditingRangeRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.LinkedEditingRangeRegistrationOptions); + + procedure Write_SemanticTokensClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SemanticTokensClientCapabilities); + + procedure Write_Hover + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Hover); + + procedure Write_InlineValueWorkspaceClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.InlineValueWorkspaceClientCapabilities); + + procedure Write_ResourceOperation + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ResourceOperation); + + procedure Write_PublishDiagnosticsClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.PublishDiagnosticsClientCapabilities); + + procedure Write_SemanticTokensOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SemanticTokensOptions); + + procedure Write_DocumentHighlightOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentHighlightOptions); + + procedure Write_FoldingRangeOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.FoldingRangeOptions); + + procedure Write_Integer_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Integer_Or_Null); + + procedure Write_TextEdit_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.TextEdit_Vector); + + procedure Write_ShowMessageRequestClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ShowMessageRequestClientCapabilities); + + procedure Write_SemanticTokensEdit_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SemanticTokensEdit_Vector); + + procedure Write_Position + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Position); + + procedure Write_TextDocumentSaveRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.TextDocumentSaveRegistrationOptions); + + procedure Write_Command + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Command); + + procedure Write_TextDocumentFilter + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.TextDocumentFilter); + + procedure Write_ExecuteCommandRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ExecuteCommandRegistrationOptions); + + procedure Write_UniquenessLevel + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.UniquenessLevel); + + procedure Write_TextDocumentEdit + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.TextDocumentEdit); + + procedure Write_CompletionItemLabelDetails + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CompletionItemLabelDetails); + + procedure Write_CompletionOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CompletionOptions); + + procedure Write_Diagnostic + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Diagnostic); + + procedure Write_TextDocumentSyncOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.TextDocumentSyncOptions); + + procedure Write_OptionalVersionedTextDocumentIdentifier + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.OptionalVersionedTextDocumentIdentifier); + + procedure Write_SemanticTokensLegend + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SemanticTokensLegend); + + procedure Write_WorkspaceDocumentDiagnosticReport_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.WorkspaceDocumentDiagnosticReport_Vector); + + procedure Write_ExecuteCommandOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ExecuteCommandOptions); + + procedure Write_TextDocumentSyncClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.TextDocumentSyncClientCapabilities); + + procedure Write_MarkupKind + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.MarkupKind); + + procedure Write_LSPErrorCodes + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.LSPErrorCodes); + + procedure Write_ReferenceRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ReferenceRegistrationOptions); + + procedure Write_LinkedEditingRangeOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.LinkedEditingRangeOptions); + + procedure Write_ClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ClientCapabilities) is + begin + Handler.Start_Object; + if Value.workspace.Is_Set then + Handler.Key_Name ("workspace"); + Write_WorkspaceClientCapabilities (Handler, Value.workspace.Value); + end if; + if Value.textDocument.Is_Set then + Handler.Key_Name ("textDocument"); + Write_TextDocumentClientCapabilities + (Handler, Value.textDocument.Value); + end if; + if Value.notebookDocument.Is_Set then + Handler.Key_Name ("notebookDocument"); + Write_NotebookDocumentClientCapabilities + (Handler, Value.notebookDocument.Value); + end if; + if Value.window.Is_Set then + Handler.Key_Name ("window"); + Write_WindowClientCapabilities (Handler, Value.window.Value); + end if; + if Value.general.Is_Set then + Handler.Key_Name ("general"); + Write_GeneralClientCapabilities (Handler, Value.general.Value); + end if; + if not Value.experimental.Is_Empty then + Handler.Key_Name ("experimental"); + Write_LSPAny (Handler, Value.experimental); + end if; + Handler.End_Object; + end Write_ClientCapabilities; + + procedure Write_FileChangeType + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.FileChangeType) is + begin + case Value is + when LSP.Enumerations.Created => + Handler.Integer_Value (1); + when LSP.Enumerations.Changed => + Handler.Integer_Value (2); + when LSP.Enumerations.Deleted => + Handler.Integer_Value (3); + end case; + end Write_FileChangeType; + + procedure Write_InitializeParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.InitializeParams) is + procedure Write_trace_Of_InitializeParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.trace_Of_InitializeParams); + + procedure Write_Virtual_String_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Virtual_String_Or_Null); + + procedure Write_DocumentUri_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentUri_Or_Null); + + procedure Write_trace_Of_InitializeParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.trace_Of_InitializeParams) is + begin + case Value is + when LSP.Structures.off => + Handler.String_Value ("off"); + when LSP.Structures.messages => + Handler.String_Value ("messages"); + when LSP.Structures.compact => + Handler.String_Value ("compact"); + when LSP.Structures.verbose => + Handler.String_Value ("verbose"); + end case; + end Write_trace_Of_InitializeParams; + + procedure Write_Virtual_String_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Virtual_String_Or_Null) is + begin + if Value.Is_Null then + Handler.Null_Value; + else + Handler.String_Value (Value.Value); + end if; + end Write_Virtual_String_Or_Null; + + procedure Write_DocumentUri_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentUri_Or_Null) is + begin + if Value.Is_Null then + Handler.Null_Value; + else + Handler.String_Value (Value.Value); + end if; + end Write_DocumentUri_Or_Null; + + begin + Handler.Start_Object; + if Value.workDoneToken.Is_Set then + Handler.Key_Name ("workDoneToken"); + Write_ProgressToken (Handler, Value.workDoneToken.Value); + end if; + Handler.Key_Name ("processId"); + Write_Integer_Or_Null (Handler, Value.processId); + if Value.clientInfo.Is_Set then + Handler.Key_Name ("clientInfo"); + Write_clientInfo_Of_InitializeParams + (Handler, Value.clientInfo.Value); + end if; + if not Value.locale.Is_Null then + Handler.Key_Name ("locale"); + Handler.String_Value (Value.locale); + end if; + if Value.rootPath.Is_Set then + Handler.Key_Name ("rootPath"); + Write_Virtual_String_Or_Null (Handler, Value.rootPath.Value); + end if; + Handler.Key_Name ("rootUri"); + Write_DocumentUri_Or_Null (Handler, Value.rootUri); + Handler.Key_Name ("capabilities"); + Write_ClientCapabilities (Handler, Value.capabilities); + if not Value.initializationOptions.Is_Empty then + Handler.Key_Name ("initializationOptions"); + Write_LSPAny (Handler, Value.initializationOptions); + end if; + if Value.trace.Is_Set then + Handler.Key_Name ("trace"); + Write_trace_Of_InitializeParams (Handler, Value.trace.Value); + end if; + if Value.Parent.workspaceFolders.Is_Set then + Handler.Key_Name ("workspaceFolders"); + Write_WorkspaceFolder_Vector_Or_Null + (Handler, Value.Parent.workspaceFolders.Value); + end if; + Handler.End_Object; + end Write_InitializeParams; + + procedure Write_DocumentLink_Vector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentLink_Vector_Or_Null) is + begin + if Value.Is_Empty then + Handler.Null_Value; + else + Write_DocumentLink_Vector (Handler, Value); + end if; + end Write_DocumentLink_Vector_Or_Null; + + procedure Write_Command_Or_CodeAction_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Command_Or_CodeAction_Vector) is + begin + Handler.Start_Array; + for J in Value.First_Index .. Value.Last_Index loop + Write_Command_Or_CodeAction (Handler, Value (J)); + end loop; + Handler.End_Array; + end Write_Command_Or_CodeAction_Vector; + + procedure Write_Virtual_String + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Virtual_String) is + begin + Handler.String_Value (Value); + end Write_Virtual_String; + + procedure Write_Declaration + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Declaration) is + begin + if Value.Length = 1 then + Write_Location (Handler, Value (1)); + + else + Handler.Start_Array; + for J in 1 .. Value.Last_Index loop + Write_Location (Handler, Value (J)); + + end loop; + Handler.End_Array; + end if; + end Write_Declaration; + + procedure Write_Null_Record + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Null_Record) is + begin + Handler.Null_Value; + end Write_Null_Record; + + procedure Write_FileOperationRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.FileOperationRegistrationOptions) is + procedure Write_FileOperationFilter_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.FileOperationFilter_Vector); + + procedure Write_FileOperationFilter_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.FileOperationFilter_Vector) is + begin + Handler.Start_Array; + for J in Value.First_Index .. Value.Last_Index loop + Write_FileOperationFilter (Handler, Value (J)); + end loop; + Handler.End_Array; + end Write_FileOperationFilter_Vector; + + begin + Handler.Start_Object; + Handler.Key_Name ("filters"); + Write_FileOperationFilter_Vector (Handler, Value.filters); + Handler.End_Object; + end Write_FileOperationRegistrationOptions; + + procedure Write_CallHierarchyOutgoingCall_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CallHierarchyOutgoingCall_Vector) is + begin + Handler.Start_Array; + for J in Value.First_Index .. Value.Last_Index loop + Write_CallHierarchyOutgoingCall (Handler, Value (J)); + end loop; + Handler.End_Array; + end Write_CallHierarchyOutgoingCall_Vector; + + procedure Write_WorkspaceFolder_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.WorkspaceFolder_Vector) is + begin + Handler.Start_Array; + for J in Value.First_Index .. Value.Last_Index loop + Write_WorkspaceFolder (Handler, Value (J)); + end loop; + Handler.End_Array; + end Write_WorkspaceFolder_Vector; + + procedure Write_TextDocumentContentChangeEvent_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.TextDocumentContentChangeEvent_Vector) is + begin + Handler.Start_Array; + for J in Value.First_Index .. Value.Last_Index loop + Write_TextDocumentContentChangeEvent (Handler, Value (J)); + end loop; + Handler.End_Array; + end Write_TextDocumentContentChangeEvent_Vector; + + procedure Write_FoldingRangeClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.FoldingRangeClientCapabilities) is + procedure Write_foldingRange_OfFoldingRangeClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.foldingRange_OfFoldingRangeClientCapabilities); + + procedure Write_FoldingRangeKind_Set + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.FoldingRangeKind_Set); + + procedure Write_foldingRangeKind_OfFoldingRangeClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures + .foldingRangeKind_OfFoldingRangeClientCapabilities); + + procedure Write_foldingRange_OfFoldingRangeClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures + .foldingRange_OfFoldingRangeClientCapabilities) is + begin + Handler.Start_Object; + if Value.collapsedText.Is_Set then + Handler.Key_Name ("collapsedText"); + Handler.Boolean_Value (Value.collapsedText.Value); + end if; + Handler.End_Object; + end Write_foldingRange_OfFoldingRangeClientCapabilities; + + procedure Write_FoldingRangeKind_Set + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.FoldingRangeKind_Set) is + begin + Handler.Start_Array; + declare + Set : LSP.Structures.FoldingRangeKind_Set renames Value; + begin + for Value in Set'Range loop + if Set (Value) then + Write_FoldingRangeKind (Handler, Value); + end if; + end loop; + end; + Handler.End_Array; + end Write_FoldingRangeKind_Set; + + procedure Write_foldingRangeKind_OfFoldingRangeClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures + .foldingRangeKind_OfFoldingRangeClientCapabilities) is + begin + Handler.Start_Object; + if (for some Item of Value.valueSet => Item) then + Handler.Key_Name ("valueSet"); + Write_FoldingRangeKind_Set (Handler, Value.valueSet); + end if; + Handler.End_Object; + end Write_foldingRangeKind_OfFoldingRangeClientCapabilities; + + begin + Handler.Start_Object; + if Value.dynamicRegistration.Is_Set then + Handler.Key_Name ("dynamicRegistration"); + Handler.Boolean_Value (Value.dynamicRegistration.Value); + end if; + if Value.rangeLimit.Is_Set then + Handler.Key_Name ("rangeLimit"); + Handler.Integer_Value (Integer'Pos (Value.rangeLimit.Value)); + end if; + if Value.lineFoldingOnly.Is_Set then + Handler.Key_Name ("lineFoldingOnly"); + Handler.Boolean_Value (Value.lineFoldingOnly.Value); + end if; + if Value.foldingRangeKind.Is_Set then + Handler.Key_Name ("foldingRangeKind"); + Write_foldingRangeKind_OfFoldingRangeClientCapabilities + (Handler, Value.foldingRangeKind.Value); + end if; + if Value.foldingRange.Is_Set then + Handler.Key_Name ("foldingRange"); + Write_foldingRange_OfFoldingRangeClientCapabilities + (Handler, Value.foldingRange.Value); + end if; + Handler.End_Object; + end Write_FoldingRangeClientCapabilities; + + procedure Write_CreateFile + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CreateFile) is + begin + Handler.Start_Object; + Handler.Key_Name ("kind"); + Handler.String_Value ("create"); + if Value.annotationId.Is_Set then + Handler.Key_Name ("annotationId"); + Write_ChangeAnnotationIdentifier (Handler, Value.annotationId.Value); + end if; + Handler.Key_Name ("uri"); + Handler.String_Value (Value.uri); + if Value.options.Is_Set then + Handler.Key_Name ("options"); + Write_CreateFileOptions (Handler, Value.options.Value); + end if; + Handler.End_Object; + end Write_CreateFile; + + procedure Write_CompletionContext + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CompletionContext) is + begin + Handler.Start_Object; + Handler.Key_Name ("triggerKind"); + Write_CompletionTriggerKind (Handler, Value.triggerKind); + if not Value.triggerCharacter.Is_Null then + Handler.Key_Name ("triggerCharacter"); + Handler.String_Value (Value.triggerCharacter); + end if; + Handler.End_Object; + end Write_CompletionContext; + + procedure Write_NotebookCell_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.NotebookCell_Vector) is + begin + Handler.Start_Array; + for J in Value.First_Index .. Value.Last_Index loop + Write_NotebookCell (Handler, Value (J)); + end loop; + Handler.End_Array; + end Write_NotebookCell_Vector; + + procedure Write_DocumentDiagnosticParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentDiagnosticParams) is + begin + Handler.Start_Object; + if Value.workDoneToken.Is_Set then + Handler.Key_Name ("workDoneToken"); + Write_ProgressToken (Handler, Value.workDoneToken.Value); + end if; + if Value.partialResultToken.Is_Set then + Handler.Key_Name ("partialResultToken"); + Write_ProgressToken (Handler, Value.partialResultToken.Value); + end if; + Handler.Key_Name ("textDocument"); + Write_TextDocumentIdentifier (Handler, Value.textDocument); + if not Value.identifier.Is_Null then + Handler.Key_Name ("identifier"); + Handler.String_Value (Value.identifier); + end if; + if not Value.previousResultId.Is_Null then + Handler.Key_Name ("previousResultId"); + Handler.String_Value (Value.previousResultId); + end if; + Handler.End_Object; + end Write_DocumentDiagnosticParams; + + procedure Write_DocumentLink_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentLink_Vector) is + begin + Handler.Start_Array; + for J in Value.First_Index .. Value.Last_Index loop + Write_DocumentLink (Handler, Value (J)); + end loop; + Handler.End_Array; + end Write_DocumentLink_Vector; + + procedure Write_CodeActionKind + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.CodeActionKind) is + begin + case Value is + when LSP.Enumerations.Empty => + Handler.String_Value (""); + when LSP.Enumerations.QuickFix => + Handler.String_Value ("quickfix"); + when LSP.Enumerations.Refactor => + Handler.String_Value ("refactor"); + when LSP.Enumerations.RefactorExtract => + Handler.String_Value ("refactor.extract"); + when LSP.Enumerations.RefactorInline => + Handler.String_Value ("refactor.inline"); + when LSP.Enumerations.RefactorRewrite => + Handler.String_Value ("refactor.rewrite"); + when LSP.Enumerations.Source => + Handler.String_Value ("source"); + when LSP.Enumerations.SourceOrganizeImports => + Handler.String_Value ("source.organizeImports"); + when LSP.Enumerations.SourceFixAll => + Handler.String_Value ("source.fixAll"); + end case; + end Write_CodeActionKind; + + procedure Write_RelatedUnchangedDocumentDiagnosticReport + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.RelatedUnchangedDocumentDiagnosticReport) is + begin + Handler.Start_Object; + Handler.Key_Name ("kind"); + Handler.String_Value ("unchanged"); + Handler.Key_Name ("resultId"); + Handler.String_Value (Value.resultId); + if not Value.relatedDocuments.Is_Empty then + Handler.Key_Name ("relatedDocuments"); + declare + use + LSP.Structures + .relatedDocuments_OfDocumentDiagnosticReportPartialResult_Item_Maps; + begin + Handler.Start_Object; + for Cursor in Value.relatedDocuments.Iterate loop + Handler.Key_Name (Key (Cursor)); + Write_relatedDocuments_OfDocumentDiagnosticReportPartialResult_Item + (Handler, Value.relatedDocuments (Cursor)); + end loop; + Handler.End_Object; + end; + end if; + Handler.End_Object; + end Write_RelatedUnchangedDocumentDiagnosticReport; + + procedure Write_DidChangeWatchedFilesClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DidChangeWatchedFilesClientCapabilities) is + begin + Handler.Start_Object; + if Value.dynamicRegistration.Is_Set then + Handler.Key_Name ("dynamicRegistration"); + Handler.Boolean_Value (Value.dynamicRegistration.Value); + end if; + if Value.relativePatternSupport.Is_Set then + Handler.Key_Name ("relativePatternSupport"); + Handler.Boolean_Value (Value.relativePatternSupport.Value); + end if; + Handler.End_Object; + end Write_DidChangeWatchedFilesClientCapabilities; + + procedure Write_SemanticTokenTypes + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.SemanticTokenTypes) is + begin + case Value is + when LSP.Enumerations.namespace => + Handler.String_Value ("namespace"); + when LSP.Enumerations.a_type => + Handler.String_Value ("type"); + when LSP.Enumerations.class => + Handler.String_Value ("class"); + when LSP.Enumerations.enum => + Handler.String_Value ("enum"); + when LSP.Enumerations.an_interface => + Handler.String_Value ("interface"); + when LSP.Enumerations.struct => + Handler.String_Value ("struct"); + when LSP.Enumerations.typeParameter => + Handler.String_Value ("typeParameter"); + when LSP.Enumerations.parameter => + Handler.String_Value ("parameter"); + when LSP.Enumerations.variable => + Handler.String_Value ("variable"); + when LSP.Enumerations.property => + Handler.String_Value ("property"); + when LSP.Enumerations.enumMember => + Handler.String_Value ("enumMember"); + when LSP.Enumerations.event => + Handler.String_Value ("event"); + when LSP.Enumerations.a_function => + Handler.String_Value ("function"); + when LSP.Enumerations.method => + Handler.String_Value ("method"); + when LSP.Enumerations.macro => + Handler.String_Value ("macro"); + when LSP.Enumerations.keyword => + Handler.String_Value ("keyword"); + when LSP.Enumerations.modifier => + Handler.String_Value ("modifier"); + when LSP.Enumerations.comment => + Handler.String_Value ("comment"); + when LSP.Enumerations.string => + Handler.String_Value ("string"); + when LSP.Enumerations.number => + Handler.String_Value ("number"); + when LSP.Enumerations.regexp => + Handler.String_Value ("regexp"); + when LSP.Enumerations.operator => + Handler.String_Value ("operator"); + when LSP.Enumerations.decorator => + Handler.String_Value ("decorator"); + end case; + end Write_SemanticTokenTypes; + + procedure Write_AnnotatedTextEdit + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.AnnotatedTextEdit) is + begin + Handler.Start_Object; + Handler.Key_Name ("range"); + Write_A_Range (Handler, Value.a_range); + Handler.Key_Name ("newText"); + Handler.String_Value (Value.newText); + Handler.Key_Name ("annotationId"); + Write_ChangeAnnotationIdentifier (Handler, Value.annotationId); + Handler.End_Object; + end Write_AnnotatedTextEdit; + + procedure Write_DeclarationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DeclarationOptions) is + begin + Handler.Start_Object; + if Value.workDoneProgress.Is_Set then + Handler.Key_Name ("workDoneProgress"); + Handler.Boolean_Value (Value.workDoneProgress.Value); + end if; + Handler.End_Object; + end Write_DeclarationOptions; + + procedure Write_SignatureInformation + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SignatureInformation) is + procedure Write_ParameterInformation_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ParameterInformation_Vector); + + procedure Write_ParameterInformation_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ParameterInformation_Vector) is + begin + Handler.Start_Array; + for J in Value.First_Index .. Value.Last_Index loop + Write_ParameterInformation (Handler, Value (J)); + end loop; + Handler.End_Array; + end Write_ParameterInformation_Vector; + + begin + Handler.Start_Object; + Handler.Key_Name ("label"); + Handler.String_Value (Value.label); + if Value.documentation.Is_Set then + Handler.Key_Name ("documentation"); + Write_Virtual_String_Or_MarkupContent + (Handler, Value.documentation.Value); + end if; + if not Value.parameters.Is_Empty then + Handler.Key_Name ("parameters"); + Write_ParameterInformation_Vector (Handler, Value.parameters); + end if; + if Value.activeParameter.Is_Set then + Handler.Key_Name ("activeParameter"); + Handler.Integer_Value (Integer'Pos (Value.activeParameter.Value)); + end if; + Handler.End_Object; + end Write_SignatureInformation; + + procedure Write_TextDocumentSaveReason + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.TextDocumentSaveReason) is + begin + case Value is + when LSP.Enumerations.Manual => + Handler.Integer_Value (1); + when LSP.Enumerations.AfterDelay => + Handler.Integer_Value (2); + when LSP.Enumerations.FocusOut => + Handler.Integer_Value (3); + end case; + end Write_TextDocumentSaveReason; + + procedure Write_SemanticTokens + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SemanticTokens) is + begin + Handler.Start_Object; + if not Value.resultId.Is_Null then + Handler.Key_Name ("resultId"); + Handler.String_Value (Value.resultId); + end if; + Handler.Key_Name ("data"); + Write_Natural_Vector (Handler, Value.data); + Handler.End_Object; + end Write_SemanticTokens; + + procedure Write_InlineValueParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.InlineValueParams) is + begin + Handler.Start_Object; + if Value.workDoneToken.Is_Set then + Handler.Key_Name ("workDoneToken"); + Write_ProgressToken (Handler, Value.workDoneToken.Value); + end if; + Handler.Key_Name ("textDocument"); + Write_TextDocumentIdentifier (Handler, Value.textDocument); + Handler.Key_Name ("range"); + Write_A_Range (Handler, Value.a_range); + Handler.Key_Name ("context"); + Write_InlineValueContext (Handler, Value.context); + Handler.End_Object; + end Write_InlineValueParams; + + procedure Write_TokenFormat + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.TokenFormat) is + begin + case Value is + when LSP.Enumerations.Relative => + Handler.String_Value ("relative"); + end case; + end Write_TokenFormat; + + procedure Write_TextDocumentRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.TextDocumentRegistrationOptions) is + procedure Write_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSelector_Or_Null); + + procedure Write_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSelector_Or_Null) is + begin + if Value.Is_Null then + Handler.Null_Value; + else + Write_DocumentSelector (Handler, Value.Value); + end if; + end Write_DocumentSelector_Or_Null; + + begin + Handler.Start_Object; + Handler.Key_Name ("documentSelector"); + Write_DocumentSelector_Or_Null (Handler, Value.documentSelector); + Handler.End_Object; + end Write_TextDocumentRegistrationOptions; + + procedure Write_URI + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.URI) is + begin + Handler.String_Value (Value); + end Write_URI; + + procedure Write_SemanticTokenModifiers + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.SemanticTokenModifiers) is + begin + case Value is + when LSP.Enumerations.declaration => + Handler.String_Value ("declaration"); + when LSP.Enumerations.definition => + Handler.String_Value ("definition"); + when LSP.Enumerations.readonly => + Handler.String_Value ("readonly"); + when LSP.Enumerations.static => + Handler.String_Value ("static"); + when LSP.Enumerations.deprecated => + Handler.String_Value ("deprecated"); + when LSP.Enumerations.an_abstract => + Handler.String_Value ("abstract"); + when LSP.Enumerations.async => + Handler.String_Value ("async"); + when LSP.Enumerations.modification => + Handler.String_Value ("modification"); + when LSP.Enumerations.documentation => + Handler.String_Value ("documentation"); + when LSP.Enumerations.defaultLibrary => + Handler.String_Value ("defaultLibrary"); + end case; + end Write_SemanticTokenModifiers; + + procedure Write_ConfigurationItem + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ConfigurationItem) is + begin + Handler.Start_Object; + if not Value.scopeUri.Is_Null then + Handler.Key_Name ("scopeUri"); + Handler.String_Value (Value.scopeUri); + end if; + if not Value.section.Is_Null then + Handler.Key_Name ("section"); + Handler.String_Value (Value.section); + end if; + Handler.End_Object; + end Write_ConfigurationItem; + + procedure Write_DocumentOnTypeFormattingClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentOnTypeFormattingClientCapabilities) is + begin + Handler.Start_Object; + if Value.dynamicRegistration.Is_Set then + Handler.Key_Name ("dynamicRegistration"); + Handler.Boolean_Value (Value.dynamicRegistration.Value); + end if; + Handler.End_Object; + end Write_DocumentOnTypeFormattingClientCapabilities; + + procedure Write_SymbolKind + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.SymbolKind) is + begin + case Value is + when LSP.Enumerations.File => + Handler.Integer_Value (1); + when LSP.Enumerations.Module => + Handler.Integer_Value (2); + when LSP.Enumerations.Namespace => + Handler.Integer_Value (3); + when LSP.Enumerations.A_Package => + Handler.Integer_Value (4); + when LSP.Enumerations.Class => + Handler.Integer_Value (5); + when LSP.Enumerations.Method => + Handler.Integer_Value (6); + when LSP.Enumerations.Property => + Handler.Integer_Value (7); + when LSP.Enumerations.Field => + Handler.Integer_Value (8); + when LSP.Enumerations.Constructor => + Handler.Integer_Value (9); + when LSP.Enumerations.Enum => + Handler.Integer_Value (10); + when LSP.Enumerations.An_Interface => + Handler.Integer_Value (11); + when LSP.Enumerations.A_Function => + Handler.Integer_Value (12); + when LSP.Enumerations.Variable => + Handler.Integer_Value (13); + when LSP.Enumerations.A_Constant => + Handler.Integer_Value (14); + when LSP.Enumerations.String => + Handler.Integer_Value (15); + when LSP.Enumerations.Number => + Handler.Integer_Value (16); + when LSP.Enumerations.Boolean => + Handler.Integer_Value (17); + when LSP.Enumerations.An_Array => + Handler.Integer_Value (18); + when LSP.Enumerations.Object => + Handler.Integer_Value (19); + when LSP.Enumerations.Key => + Handler.Integer_Value (20); + when LSP.Enumerations.A_Null => + Handler.Integer_Value (21); + when LSP.Enumerations.EnumMember => + Handler.Integer_Value (22); + when LSP.Enumerations.Struct => + Handler.Integer_Value (23); + when LSP.Enumerations.Event => + Handler.Integer_Value (24); + when LSP.Enumerations.Operator => + Handler.Integer_Value (25); + when LSP.Enumerations.TypeParameter => + Handler.Integer_Value (26); + end case; + end Write_SymbolKind; + + procedure Write_DidSaveNotebookDocumentParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DidSaveNotebookDocumentParams) is + begin + Handler.Start_Object; + Handler.Key_Name ("notebookDocument"); + Write_NotebookDocumentIdentifier (Handler, Value.notebookDocument); + Handler.End_Object; + end Write_DidSaveNotebookDocumentParams; + + procedure Write_Declaration_Result + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Declaration_Result) is + begin + case Value.Kind is + when LSP.Structures.Varian_1 => + Write_Declaration (Handler, Value.Varian_1); + when LSP.Structures.Varian_2 => + Write_DeclarationLink_Vector (Handler, Value.Varian_2); + when LSP.Structures.Varian_3 => + Handler.Null_Value; + end case; + end Write_Declaration_Result; + + procedure Write_Definition_Progress_Report + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Definition_Progress_Report) is + begin + case Value.Kind is + when LSP.Structures.Varian_1 => + Write_Location_Vector (Handler, Value.Varian_1); + when LSP.Structures.Varian_2 => + Write_DefinitionLink_Vector (Handler, Value.Varian_2); + end case; + end Write_Definition_Progress_Report; + + procedure Write_SemanticTokensParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SemanticTokensParams) is + begin + Handler.Start_Object; + if Value.workDoneToken.Is_Set then + Handler.Key_Name ("workDoneToken"); + Write_ProgressToken (Handler, Value.workDoneToken.Value); + end if; + if Value.partialResultToken.Is_Set then + Handler.Key_Name ("partialResultToken"); + Write_ProgressToken (Handler, Value.partialResultToken.Value); + end if; + Handler.Key_Name ("textDocument"); + Write_TextDocumentIdentifier (Handler, Value.textDocument); + Handler.End_Object; + end Write_SemanticTokensParams; + + procedure Write_ColorInformation_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ColorInformation_Vector) is + begin + Handler.Start_Array; + for J in Value.First_Index .. Value.Last_Index loop + Write_ColorInformation (Handler, Value (J)); + end loop; + Handler.End_Array; + end Write_ColorInformation_Vector; + + procedure Write_SelectionRangeClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SelectionRangeClientCapabilities) is + begin + Handler.Start_Object; + if Value.dynamicRegistration.Is_Set then + Handler.Key_Name ("dynamicRegistration"); + Handler.Boolean_Value (Value.dynamicRegistration.Value); + end if; + Handler.End_Object; + end Write_SelectionRangeClientCapabilities; + + procedure Write_DocumentSymbol_Progress_Report + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSymbol_Progress_Report) is + begin + case Value.Kind is + when LSP.Structures.Varian_1 => + Write_SymbolInformation_Vector (Handler, Value.Varian_1); + when LSP.Structures.Varian_2 => + Write_DocumentSymbol_Vector (Handler, Value.Varian_2); + end case; + end Write_DocumentSymbol_Progress_Report; + + procedure Write_CallHierarchyIncomingCall_Vector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CallHierarchyIncomingCall_Vector_Or_Null) is + begin + if Value.Is_Empty then + Handler.Null_Value; + else + Write_CallHierarchyIncomingCall_Vector (Handler, Value); + end if; + end Write_CallHierarchyIncomingCall_Vector_Or_Null; + + procedure Write_Range_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Range_Vector) is + begin + Handler.Start_Array; + for J in Value.First_Index .. Value.Last_Index loop + Write_A_Range (Handler, Value (J)); + end loop; + Handler.End_Array; + end Write_Range_Vector; + + procedure Write_Definition + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Definition) is + begin + if Value.Length = 1 then + Write_Location (Handler, Value (1)); + + else + Handler.Start_Array; + for J in 1 .. Value.Last_Index loop + Write_Location (Handler, Value (J)); + + end loop; + Handler.End_Array; + end if; + end Write_Definition; + + procedure Write_NotebookDocumentFilter + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.NotebookDocumentFilter) is + begin + Handler.Start_Object; + if not Value.notebookType.Is_Null then + Handler.Key_Name ("notebookType"); + Handler.String_Value (Value.notebookType); + end if; + if not Value.scheme.Is_Null then + Handler.Key_Name ("scheme"); + Handler.String_Value (Value.scheme); + end if; + if not Value.pattern.Is_Null then + Handler.Key_Name ("pattern"); + Handler.String_Value (Value.pattern); + end if; + Handler.End_Object; + end Write_NotebookDocumentFilter; + + procedure Write_Color + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Color) is + begin + Handler.Start_Object; + Handler.Key_Name ("red"); + Handler.Float_Value (Interfaces.IEEE_Float_64 (Value.red)); + Handler.Key_Name ("green"); + Handler.Float_Value (Interfaces.IEEE_Float_64 (Value.green)); + Handler.Key_Name ("blue"); + Handler.Float_Value (Interfaces.IEEE_Float_64 (Value.blue)); + Handler.Key_Name ("alpha"); + Handler.Float_Value (Interfaces.IEEE_Float_64 (Value.alpha)); + Handler.End_Object; + end Write_Color; + + procedure Write_FileOperationPattern + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.FileOperationPattern) is + begin + Handler.Start_Object; + Handler.Key_Name ("glob"); + Handler.String_Value (Value.glob); + if Value.matches.Is_Set then + Handler.Key_Name ("matches"); + Write_FileOperationPatternKind (Handler, Value.matches.Value); + end if; + if Value.options.Is_Set then + Handler.Key_Name ("options"); + Write_FileOperationPatternOptions (Handler, Value.options.Value); + end if; + Handler.End_Object; + end Write_FileOperationPattern; + + procedure Write_LinkedEditingRanges + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.LinkedEditingRanges) is + begin + Handler.Start_Object; + Handler.Key_Name ("ranges"); + Write_Range_Vector (Handler, Value.ranges); + if not Value.wordPattern.Is_Null then + Handler.Key_Name ("wordPattern"); + Handler.String_Value (Value.wordPattern); + end if; + Handler.End_Object; + end Write_LinkedEditingRanges; + + procedure Write_Virtual_String_Or_MarkupContent + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Virtual_String_Or_MarkupContent) is + begin + case Value.Is_Virtual_String is + when True => + Handler.String_Value (Value.Virtual_String); + when False => + Write_MarkupContent (Handler, Value.MarkupContent); + end case; + end Write_Virtual_String_Or_MarkupContent; + + procedure Write_CodeLens_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CodeLens_Vector) is + begin + Handler.Start_Array; + for J in Value.First_Index .. Value.Last_Index loop + Write_CodeLens (Handler, Value (J)); + end loop; + Handler.End_Array; + end Write_CodeLens_Vector; + + procedure Write_ServerCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ServerCapabilities) is + procedure Write_Boolean_Or_DocumentSymbolOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Boolean_Or_DocumentSymbolOptions); + + procedure Write_NotebookDocumentSyncOptions_Or_NotebookDocumentSyncRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures + .NotebookDocumentSyncOptions_Or_NotebookDocumentSyncRegistrationOptions); + + procedure Write_Boolean_Or_WorkspaceSymbolOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Boolean_Or_WorkspaceSymbolOptions); + + procedure Write_implementationProvider_OfServerCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.implementationProvider_OfServerCapabilities); + + procedure Write_typeHierarchyProvider_OfServerCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.typeHierarchyProvider_OfServerCapabilities); + + procedure Write_DiagnosticOptions_Or_DiagnosticRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures + .DiagnosticOptions_Or_DiagnosticRegistrationOptions); + + procedure Write_inlayHintProvider_OfServerCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.inlayHintProvider_OfServerCapabilities); + + procedure Write_SemanticTokensOptions_Or_SemanticTokensRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures + .SemanticTokensOptions_Or_SemanticTokensRegistrationOptions); + + procedure Write_monikerProvider_OfServerCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.monikerProvider_OfServerCapabilities); + + procedure Write_Boolean_Or_CodeActionOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Boolean_Or_CodeActionOptions); + + procedure Write_selectionRangeProvider_OfServerCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.selectionRangeProvider_OfServerCapabilities); + + procedure Write_Boolean_Or_DocumentRangeFormattingOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Boolean_Or_DocumentRangeFormattingOptions); + + procedure Write_Boolean_Or_HoverOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Boolean_Or_HoverOptions); + + procedure Write_workspace_OfServerCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.workspace_OfServerCapabilities); + + procedure Write_declarationProvider_OfServerCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.declarationProvider_OfServerCapabilities); + + procedure Write_callHierarchyProvider_OfServerCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.callHierarchyProvider_OfServerCapabilities); + + procedure Write_Boolean_Or_DocumentHighlightOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Boolean_Or_DocumentHighlightOptions); + + procedure Write_TextDocumentSyncOptions_Or_TextDocumentSyncKind + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures + .TextDocumentSyncOptions_Or_TextDocumentSyncKind); + + procedure Write_linkedEditingRangeProvider_OfServerCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures + .linkedEditingRangeProvider_OfServerCapabilities); + + procedure Write_Boolean_Or_DocumentFormattingOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Boolean_Or_DocumentFormattingOptions); + + procedure Write_Boolean_Or_ReferenceOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Boolean_Or_ReferenceOptions); + + procedure Write_foldingRangeProvider_OfServerCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.foldingRangeProvider_OfServerCapabilities); + + procedure Write_typeDefinitionProvider_OfServerCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.typeDefinitionProvider_OfServerCapabilities); + + procedure Write_inlineValueProvider_OfServerCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.inlineValueProvider_OfServerCapabilities); + + procedure Write_colorProvider_OfServerCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.colorProvider_OfServerCapabilities); + + procedure Write_Boolean_Or_DefinitionOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Boolean_Or_DefinitionOptions); + + procedure Write_Boolean_Or_RenameOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Boolean_Or_RenameOptions); + + procedure Write_Boolean_Or_DocumentSymbolOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Boolean_Or_DocumentSymbolOptions) is + begin + case Value.Is_Boolean is + when True => + Handler.Boolean_Value (Value.Boolean); + when False => + Write_DocumentSymbolOptions + (Handler, Value.DocumentSymbolOptions); + end case; + end Write_Boolean_Or_DocumentSymbolOptions; + + procedure Write_NotebookDocumentSyncOptions_Or_NotebookDocumentSyncRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures + .NotebookDocumentSyncOptions_Or_NotebookDocumentSyncRegistrationOptions) is + begin + case Value.Is_NotebookDocumentSyncOptions is + when True => + Write_NotebookDocumentSyncOptions + (Handler, Value.NotebookDocumentSyncOptions); + when False => + Write_NotebookDocumentSyncRegistrationOptions + (Handler, Value.NotebookDocumentSyncRegistrationOptions); + end case; + end Write_NotebookDocumentSyncOptions_Or_NotebookDocumentSyncRegistrationOptions; + + procedure Write_Boolean_Or_WorkspaceSymbolOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Boolean_Or_WorkspaceSymbolOptions) is + begin + case Value.Is_Boolean is + when True => + Handler.Boolean_Value (Value.Boolean); + when False => + Write_WorkspaceSymbolOptions + (Handler, Value.WorkspaceSymbolOptions); + end case; + end Write_Boolean_Or_WorkspaceSymbolOptions; + + procedure Write_implementationProvider_OfServerCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.implementationProvider_OfServerCapabilities) is + begin + case Value.Kind is + when LSP.Structures.Varian_1 => + Handler.Boolean_Value (Value.Varian_1); + when LSP.Structures.Varian_2 => + Write_ImplementationOptions (Handler, Value.Varian_2); + when LSP.Structures.Varian_3 => + Write_ImplementationRegistrationOptions + (Handler, Value.Varian_3); + end case; + end Write_implementationProvider_OfServerCapabilities; + + procedure Write_typeHierarchyProvider_OfServerCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.typeHierarchyProvider_OfServerCapabilities) is + begin + case Value.Kind is + when LSP.Structures.Varian_1 => + Handler.Boolean_Value (Value.Varian_1); + when LSP.Structures.Varian_2 => + Write_TypeHierarchyOptions (Handler, Value.Varian_2); + when LSP.Structures.Varian_3 => + Write_TypeHierarchyRegistrationOptions + (Handler, Value.Varian_3); + end case; + end Write_typeHierarchyProvider_OfServerCapabilities; + + procedure Write_DiagnosticOptions_Or_DiagnosticRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures + .DiagnosticOptions_Or_DiagnosticRegistrationOptions) is + begin + case Value.Is_DiagnosticOptions is + when True => + Write_DiagnosticOptions (Handler, Value.DiagnosticOptions); + when False => + Write_DiagnosticRegistrationOptions + (Handler, Value.DiagnosticRegistrationOptions); + end case; + end Write_DiagnosticOptions_Or_DiagnosticRegistrationOptions; + + procedure Write_inlayHintProvider_OfServerCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.inlayHintProvider_OfServerCapabilities) is + begin + case Value.Kind is + when LSP.Structures.Varian_1 => + Handler.Boolean_Value (Value.Varian_1); + when LSP.Structures.Varian_2 => + Write_InlayHintOptions (Handler, Value.Varian_2); + when LSP.Structures.Varian_3 => + Write_InlayHintRegistrationOptions (Handler, Value.Varian_3); + end case; + end Write_inlayHintProvider_OfServerCapabilities; + + procedure Write_SemanticTokensOptions_Or_SemanticTokensRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures + .SemanticTokensOptions_Or_SemanticTokensRegistrationOptions) is + begin + case Value.Is_SemanticTokensOptions is + when True => + Write_SemanticTokensOptions + (Handler, Value.SemanticTokensOptions); + when False => + Write_SemanticTokensRegistrationOptions + (Handler, Value.SemanticTokensRegistrationOptions); + end case; + end Write_SemanticTokensOptions_Or_SemanticTokensRegistrationOptions; + + procedure Write_monikerProvider_OfServerCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.monikerProvider_OfServerCapabilities) is + begin + case Value.Kind is + when LSP.Structures.Varian_1 => + Handler.Boolean_Value (Value.Varian_1); + when LSP.Structures.Varian_2 => + Write_MonikerOptions (Handler, Value.Varian_2); + when LSP.Structures.Varian_3 => + Write_MonikerRegistrationOptions (Handler, Value.Varian_3); + end case; + end Write_monikerProvider_OfServerCapabilities; + + procedure Write_Boolean_Or_CodeActionOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Boolean_Or_CodeActionOptions) is + begin + case Value.Is_Boolean is + when True => + Handler.Boolean_Value (Value.Boolean); + when False => + Write_CodeActionOptions (Handler, Value.CodeActionOptions); + end case; + end Write_Boolean_Or_CodeActionOptions; + + procedure Write_selectionRangeProvider_OfServerCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.selectionRangeProvider_OfServerCapabilities) is + begin + case Value.Kind is + when LSP.Structures.Varian_1 => + Handler.Boolean_Value (Value.Varian_1); + when LSP.Structures.Varian_2 => + Write_SelectionRangeOptions (Handler, Value.Varian_2); + when LSP.Structures.Varian_3 => + Write_SelectionRangeRegistrationOptions + (Handler, Value.Varian_3); + end case; + end Write_selectionRangeProvider_OfServerCapabilities; + + procedure Write_Boolean_Or_DocumentRangeFormattingOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Boolean_Or_DocumentRangeFormattingOptions) is + begin + case Value.Is_Boolean is + when True => + Handler.Boolean_Value (Value.Boolean); + when False => + Write_DocumentRangeFormattingOptions + (Handler, Value.DocumentRangeFormattingOptions); + end case; + end Write_Boolean_Or_DocumentRangeFormattingOptions; + + procedure Write_Boolean_Or_HoverOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Boolean_Or_HoverOptions) is + begin + case Value.Is_Boolean is + when True => + Handler.Boolean_Value (Value.Boolean); + when False => + Write_HoverOptions (Handler, Value.HoverOptions); + end case; + end Write_Boolean_Or_HoverOptions; + + procedure Write_workspace_OfServerCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.workspace_OfServerCapabilities) is + begin + Handler.Start_Object; + if Value.workspaceFolders.Is_Set then + Handler.Key_Name ("workspaceFolders"); + Write_WorkspaceFoldersServerCapabilities + (Handler, Value.workspaceFolders.Value); + end if; + if Value.fileOperations.Is_Set then + Handler.Key_Name ("fileOperations"); + Write_FileOperationOptions (Handler, Value.fileOperations.Value); + end if; + Handler.End_Object; + end Write_workspace_OfServerCapabilities; + + procedure Write_declarationProvider_OfServerCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.declarationProvider_OfServerCapabilities) is + begin + case Value.Kind is + when LSP.Structures.Varian_1 => + Handler.Boolean_Value (Value.Varian_1); + when LSP.Structures.Varian_2 => + Write_DeclarationOptions (Handler, Value.Varian_2); + when LSP.Structures.Varian_3 => + Write_DeclarationRegistrationOptions (Handler, Value.Varian_3); + end case; + end Write_declarationProvider_OfServerCapabilities; + + procedure Write_callHierarchyProvider_OfServerCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.callHierarchyProvider_OfServerCapabilities) is + begin + case Value.Kind is + when LSP.Structures.Varian_1 => + Handler.Boolean_Value (Value.Varian_1); + when LSP.Structures.Varian_2 => + Write_CallHierarchyOptions (Handler, Value.Varian_2); + when LSP.Structures.Varian_3 => + Write_CallHierarchyRegistrationOptions + (Handler, Value.Varian_3); + end case; + end Write_callHierarchyProvider_OfServerCapabilities; + + procedure Write_Boolean_Or_DocumentHighlightOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Boolean_Or_DocumentHighlightOptions) is + begin + case Value.Is_Boolean is + when True => + Handler.Boolean_Value (Value.Boolean); + when False => + Write_DocumentHighlightOptions + (Handler, Value.DocumentHighlightOptions); + end case; + end Write_Boolean_Or_DocumentHighlightOptions; + + procedure Write_TextDocumentSyncOptions_Or_TextDocumentSyncKind + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures + .TextDocumentSyncOptions_Or_TextDocumentSyncKind) is + begin + case Value.Is_TextDocumentSyncOptions is + when True => + Write_TextDocumentSyncOptions + (Handler, Value.TextDocumentSyncOptions); + when False => + Write_TextDocumentSyncKind + (Handler, Value.TextDocumentSyncKind); + end case; + end Write_TextDocumentSyncOptions_Or_TextDocumentSyncKind; + + procedure Write_linkedEditingRangeProvider_OfServerCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures + .linkedEditingRangeProvider_OfServerCapabilities) is + begin + case Value.Kind is + when LSP.Structures.Varian_1 => + Handler.Boolean_Value (Value.Varian_1); + when LSP.Structures.Varian_2 => + Write_LinkedEditingRangeOptions (Handler, Value.Varian_2); + when LSP.Structures.Varian_3 => + Write_LinkedEditingRangeRegistrationOptions + (Handler, Value.Varian_3); + end case; + end Write_linkedEditingRangeProvider_OfServerCapabilities; + + procedure Write_Boolean_Or_DocumentFormattingOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Boolean_Or_DocumentFormattingOptions) is + begin + case Value.Is_Boolean is + when True => + Handler.Boolean_Value (Value.Boolean); + when False => + Write_DocumentFormattingOptions + (Handler, Value.DocumentFormattingOptions); + end case; + end Write_Boolean_Or_DocumentFormattingOptions; + + procedure Write_Boolean_Or_ReferenceOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Boolean_Or_ReferenceOptions) is + begin + case Value.Is_Boolean is + when True => + Handler.Boolean_Value (Value.Boolean); + when False => + Write_ReferenceOptions (Handler, Value.ReferenceOptions); + end case; + end Write_Boolean_Or_ReferenceOptions; + + procedure Write_foldingRangeProvider_OfServerCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.foldingRangeProvider_OfServerCapabilities) is + begin + case Value.Kind is + when LSP.Structures.Varian_1 => + Handler.Boolean_Value (Value.Varian_1); + when LSP.Structures.Varian_2 => + Write_FoldingRangeOptions (Handler, Value.Varian_2); + when LSP.Structures.Varian_3 => + Write_FoldingRangeRegistrationOptions (Handler, Value.Varian_3); + end case; + end Write_foldingRangeProvider_OfServerCapabilities; + + procedure Write_typeDefinitionProvider_OfServerCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.typeDefinitionProvider_OfServerCapabilities) is + begin + case Value.Kind is + when LSP.Structures.Varian_1 => + Handler.Boolean_Value (Value.Varian_1); + when LSP.Structures.Varian_2 => + Write_TypeDefinitionOptions (Handler, Value.Varian_2); + when LSP.Structures.Varian_3 => + Write_TypeDefinitionRegistrationOptions + (Handler, Value.Varian_3); + end case; + end Write_typeDefinitionProvider_OfServerCapabilities; + + procedure Write_inlineValueProvider_OfServerCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.inlineValueProvider_OfServerCapabilities) is + begin + case Value.Kind is + when LSP.Structures.Varian_1 => + Handler.Boolean_Value (Value.Varian_1); + when LSP.Structures.Varian_2 => + Write_InlineValueOptions (Handler, Value.Varian_2); + when LSP.Structures.Varian_3 => + Write_InlineValueRegistrationOptions (Handler, Value.Varian_3); + end case; + end Write_inlineValueProvider_OfServerCapabilities; + + procedure Write_colorProvider_OfServerCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.colorProvider_OfServerCapabilities) is + begin + case Value.Kind is + when LSP.Structures.Varian_1 => + Handler.Boolean_Value (Value.Varian_1); + when LSP.Structures.Varian_2 => + Write_DocumentColorOptions (Handler, Value.Varian_2); + when LSP.Structures.Varian_3 => + Write_DocumentColorRegistrationOptions + (Handler, Value.Varian_3); + end case; + end Write_colorProvider_OfServerCapabilities; + + procedure Write_Boolean_Or_DefinitionOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Boolean_Or_DefinitionOptions) is + begin + case Value.Is_Boolean is + when True => + Handler.Boolean_Value (Value.Boolean); + when False => + Write_DefinitionOptions (Handler, Value.DefinitionOptions); + end case; + end Write_Boolean_Or_DefinitionOptions; + + procedure Write_Boolean_Or_RenameOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Boolean_Or_RenameOptions) is + begin + case Value.Is_Boolean is + when True => + Handler.Boolean_Value (Value.Boolean); + when False => + Write_RenameOptions (Handler, Value.RenameOptions); + end case; + end Write_Boolean_Or_RenameOptions; + + begin + Handler.Start_Object; + if Value.positionEncoding.Is_Set then + Handler.Key_Name ("positionEncoding"); + Write_PositionEncodingKind (Handler, Value.positionEncoding.Value); + end if; + if Value.textDocumentSync.Is_Set then + Handler.Key_Name ("textDocumentSync"); + Write_TextDocumentSyncOptions_Or_TextDocumentSyncKind + (Handler, Value.textDocumentSync.Value); + end if; + if Value.notebookDocumentSync.Is_Set then + Handler.Key_Name ("notebookDocumentSync"); + Write_NotebookDocumentSyncOptions_Or_NotebookDocumentSyncRegistrationOptions + (Handler, Value.notebookDocumentSync.Value); + end if; + if Value.completionProvider.Is_Set then + Handler.Key_Name ("completionProvider"); + Write_CompletionOptions (Handler, Value.completionProvider.Value); + end if; + if Value.hoverProvider.Is_Set then + Handler.Key_Name ("hoverProvider"); + Write_Boolean_Or_HoverOptions (Handler, Value.hoverProvider.Value); + end if; + if Value.signatureHelpProvider.Is_Set then + Handler.Key_Name ("signatureHelpProvider"); + Write_SignatureHelpOptions + (Handler, Value.signatureHelpProvider.Value); + end if; + if Value.declarationProvider.Is_Set then + Handler.Key_Name ("declarationProvider"); + Write_declarationProvider_OfServerCapabilities + (Handler, Value.declarationProvider.Value); + end if; + if Value.definitionProvider.Is_Set then + Handler.Key_Name ("definitionProvider"); + Write_Boolean_Or_DefinitionOptions + (Handler, Value.definitionProvider.Value); + end if; + if Value.typeDefinitionProvider.Is_Set then + Handler.Key_Name ("typeDefinitionProvider"); + Write_typeDefinitionProvider_OfServerCapabilities + (Handler, Value.typeDefinitionProvider.Value); + end if; + if Value.implementationProvider.Is_Set then + Handler.Key_Name ("implementationProvider"); + Write_implementationProvider_OfServerCapabilities + (Handler, Value.implementationProvider.Value); + end if; + if Value.referencesProvider.Is_Set then + Handler.Key_Name ("referencesProvider"); + Write_Boolean_Or_ReferenceOptions + (Handler, Value.referencesProvider.Value); + end if; + if Value.documentHighlightProvider.Is_Set then + Handler.Key_Name ("documentHighlightProvider"); + Write_Boolean_Or_DocumentHighlightOptions + (Handler, Value.documentHighlightProvider.Value); + end if; + if Value.documentSymbolProvider.Is_Set then + Handler.Key_Name ("documentSymbolProvider"); + Write_Boolean_Or_DocumentSymbolOptions + (Handler, Value.documentSymbolProvider.Value); + end if; + if Value.codeActionProvider.Is_Set then + Handler.Key_Name ("codeActionProvider"); + Write_Boolean_Or_CodeActionOptions + (Handler, Value.codeActionProvider.Value); + end if; + if Value.codeLensProvider.Is_Set then + Handler.Key_Name ("codeLensProvider"); + Write_CodeLensOptions (Handler, Value.codeLensProvider.Value); + end if; + if Value.documentLinkProvider.Is_Set then + Handler.Key_Name ("documentLinkProvider"); + Write_DocumentLinkOptions (Handler, Value.documentLinkProvider.Value); + end if; + if Value.colorProvider.Is_Set then + Handler.Key_Name ("colorProvider"); + Write_colorProvider_OfServerCapabilities + (Handler, Value.colorProvider.Value); + end if; + if Value.workspaceSymbolProvider.Is_Set then + Handler.Key_Name ("workspaceSymbolProvider"); + Write_Boolean_Or_WorkspaceSymbolOptions + (Handler, Value.workspaceSymbolProvider.Value); + end if; + if Value.documentFormattingProvider.Is_Set then + Handler.Key_Name ("documentFormattingProvider"); + Write_Boolean_Or_DocumentFormattingOptions + (Handler, Value.documentFormattingProvider.Value); + end if; + if Value.documentRangeFormattingProvider.Is_Set then + Handler.Key_Name ("documentRangeFormattingProvider"); + Write_Boolean_Or_DocumentRangeFormattingOptions + (Handler, Value.documentRangeFormattingProvider.Value); + end if; + if Value.documentOnTypeFormattingProvider.Is_Set then + Handler.Key_Name ("documentOnTypeFormattingProvider"); + Write_DocumentOnTypeFormattingOptions + (Handler, Value.documentOnTypeFormattingProvider.Value); + end if; + if Value.renameProvider.Is_Set then + Handler.Key_Name ("renameProvider"); + Write_Boolean_Or_RenameOptions (Handler, Value.renameProvider.Value); + end if; + if Value.foldingRangeProvider.Is_Set then + Handler.Key_Name ("foldingRangeProvider"); + Write_foldingRangeProvider_OfServerCapabilities + (Handler, Value.foldingRangeProvider.Value); + end if; + if Value.selectionRangeProvider.Is_Set then + Handler.Key_Name ("selectionRangeProvider"); + Write_selectionRangeProvider_OfServerCapabilities + (Handler, Value.selectionRangeProvider.Value); + end if; + if Value.executeCommandProvider.Is_Set then + Handler.Key_Name ("executeCommandProvider"); + Write_ExecuteCommandOptions + (Handler, Value.executeCommandProvider.Value); + end if; + if Value.callHierarchyProvider.Is_Set then + Handler.Key_Name ("callHierarchyProvider"); + Write_callHierarchyProvider_OfServerCapabilities + (Handler, Value.callHierarchyProvider.Value); + end if; + if Value.linkedEditingRangeProvider.Is_Set then + Handler.Key_Name ("linkedEditingRangeProvider"); + Write_linkedEditingRangeProvider_OfServerCapabilities + (Handler, Value.linkedEditingRangeProvider.Value); + end if; + if Value.semanticTokensProvider.Is_Set then + Handler.Key_Name ("semanticTokensProvider"); + Write_SemanticTokensOptions_Or_SemanticTokensRegistrationOptions + (Handler, Value.semanticTokensProvider.Value); + end if; + if Value.monikerProvider.Is_Set then + Handler.Key_Name ("monikerProvider"); + Write_monikerProvider_OfServerCapabilities + (Handler, Value.monikerProvider.Value); + end if; + if Value.typeHierarchyProvider.Is_Set then + Handler.Key_Name ("typeHierarchyProvider"); + Write_typeHierarchyProvider_OfServerCapabilities + (Handler, Value.typeHierarchyProvider.Value); + end if; + if Value.inlineValueProvider.Is_Set then + Handler.Key_Name ("inlineValueProvider"); + Write_inlineValueProvider_OfServerCapabilities + (Handler, Value.inlineValueProvider.Value); + end if; + if Value.inlayHintProvider.Is_Set then + Handler.Key_Name ("inlayHintProvider"); + Write_inlayHintProvider_OfServerCapabilities + (Handler, Value.inlayHintProvider.Value); + end if; + if Value.diagnosticProvider.Is_Set then + Handler.Key_Name ("diagnosticProvider"); + Write_DiagnosticOptions_Or_DiagnosticRegistrationOptions + (Handler, Value.diagnosticProvider.Value); + end if; + if Value.workspace.Is_Set then + Handler.Key_Name ("workspace"); + Write_workspace_OfServerCapabilities (Handler, Value.workspace.Value); + end if; + if Value.experimental.Is_Set then + Handler.Key_Name ("experimental"); + Write_T (Handler, Value.experimental.Value); + end if; + Handler.End_Object; + end Write_ServerCapabilities; + + procedure Write_DidChangeWatchedFilesRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DidChangeWatchedFilesRegistrationOptions) is + procedure Write_FileSystemWatcher_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.FileSystemWatcher_Vector); + + procedure Write_FileSystemWatcher_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.FileSystemWatcher_Vector) is + begin + Handler.Start_Array; + for J in Value.First_Index .. Value.Last_Index loop + Write_FileSystemWatcher (Handler, Value (J)); + end loop; + Handler.End_Array; + end Write_FileSystemWatcher_Vector; + + begin + Handler.Start_Object; + Handler.Key_Name ("watchers"); + Write_FileSystemWatcher_Vector (Handler, Value.watchers); + Handler.End_Object; + end Write_DidChangeWatchedFilesRegistrationOptions; + + procedure Write_CallHierarchyOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CallHierarchyOptions) is + begin + Handler.Start_Object; + if Value.workDoneProgress.Is_Set then + Handler.Key_Name ("workDoneProgress"); + Handler.Boolean_Value (Value.workDoneProgress.Value); + end if; + Handler.End_Object; + end Write_CallHierarchyOptions; + + procedure Write_LSPAny + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.LSPAny) renames + LSP.Output_Tools.Write_LSPAny; + + procedure Write_ImplementationRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ImplementationRegistrationOptions) is + procedure Write_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSelector_Or_Null); + + procedure Write_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSelector_Or_Null) is + begin + if Value.Is_Null then + Handler.Null_Value; + else + Write_DocumentSelector (Handler, Value.Value); + end if; + end Write_DocumentSelector_Or_Null; + + begin + Handler.Start_Object; + Handler.Key_Name ("documentSelector"); + Write_DocumentSelector_Or_Null (Handler, Value.Parent.documentSelector); + if Value.workDoneProgress.Is_Set then + Handler.Key_Name ("workDoneProgress"); + Handler.Boolean_Value (Value.workDoneProgress.Value); + end if; + if not Value.id.Is_Null then + Handler.Key_Name ("id"); + Handler.String_Value (Value.id); + end if; + Handler.End_Object; + end Write_ImplementationRegistrationOptions; + + procedure Write_LogTraceParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.LogTraceParams) is + begin + Handler.Start_Object; + Handler.Key_Name ("message"); + Handler.String_Value (Value.message); + if not Value.verbose.Is_Null then + Handler.Key_Name ("verbose"); + Handler.String_Value (Value.verbose); + end if; + Handler.End_Object; + end Write_LogTraceParams; + + procedure Write_FoldingRangeRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.FoldingRangeRegistrationOptions) is + procedure Write_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSelector_Or_Null); + + procedure Write_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSelector_Or_Null) is + begin + if Value.Is_Null then + Handler.Null_Value; + else + Write_DocumentSelector (Handler, Value.Value); + end if; + end Write_DocumentSelector_Or_Null; + + begin + Handler.Start_Object; + Handler.Key_Name ("documentSelector"); + Write_DocumentSelector_Or_Null (Handler, Value.Parent.documentSelector); + if Value.workDoneProgress.Is_Set then + Handler.Key_Name ("workDoneProgress"); + Handler.Boolean_Value (Value.workDoneProgress.Value); + end if; + if not Value.id.Is_Null then + Handler.Key_Name ("id"); + Handler.String_Value (Value.id); + end if; + Handler.End_Object; + end Write_FoldingRangeRegistrationOptions; + + procedure Write_InlineValueContext + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.InlineValueContext) is + begin + Handler.Start_Object; + Handler.Key_Name ("frameId"); + Handler.Integer_Value (Integer'Pos (Value.frameId)); + Handler.Key_Name ("stoppedLocation"); + Write_A_Range (Handler, Value.stoppedLocation); + Handler.End_Object; + end Write_InlineValueContext; + + procedure Write_TextDocumentIdentifier_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.TextDocumentIdentifier_Vector) is + begin + Handler.Start_Array; + for J in Value.First_Index .. Value.Last_Index loop + Write_TextDocumentIdentifier (Handler, Value (J)); + end loop; + Handler.End_Array; + end Write_TextDocumentIdentifier_Vector; + + procedure Write_DefinitionLink + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DefinitionLink) renames + Write_LocationLink; + + procedure Write_DocumentFormattingOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentFormattingOptions) is + begin + Handler.Start_Object; + if Value.workDoneProgress.Is_Set then + Handler.Key_Name ("workDoneProgress"); + Handler.Boolean_Value (Value.workDoneProgress.Value); + end if; + Handler.End_Object; + end Write_DocumentFormattingOptions; + + procedure Write_SymbolInformation_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SymbolInformation_Vector) is + begin + Handler.Start_Array; + for J in Value.First_Index .. Value.Last_Index loop + Write_SymbolInformation (Handler, Value (J)); + end loop; + Handler.End_Array; + end Write_SymbolInformation_Vector; + + procedure Write_RenameFile + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.RenameFile) is + begin + Handler.Start_Object; + Handler.Key_Name ("kind"); + Handler.String_Value ("rename"); + if Value.annotationId.Is_Set then + Handler.Key_Name ("annotationId"); + Write_ChangeAnnotationIdentifier (Handler, Value.annotationId.Value); + end if; + Handler.Key_Name ("oldUri"); + Handler.String_Value (Value.oldUri); + Handler.Key_Name ("newUri"); + Handler.String_Value (Value.newUri); + if Value.options.Is_Set then + Handler.Key_Name ("options"); + Write_RenameFileOptions (Handler, Value.options.Value); + end if; + Handler.End_Object; + end Write_RenameFile; + + procedure Write_PrepareRenameResult_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.PrepareRenameResult_Or_Null) is + begin + if Value.Is_Null then + Handler.Null_Value; + else + Write_PrepareRenameResult (Handler, Value.Value); + end if; + end Write_PrepareRenameResult_Or_Null; + + procedure Write_DidChangeConfigurationRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DidChangeConfigurationRegistrationOptions) is + procedure Write_Virtual_String_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Virtual_String_Vector); + + procedure Write_Virtual_String_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Virtual_String_Vector) is + begin + if Value.Length = 1 then + Handler.String_Value (Value (1)); + + else + Handler.Start_Array; + for J in 1 .. Value.Length loop + Handler.String_Value (Value (J)); + + end loop; + Handler.End_Array; + end if; + end Write_Virtual_String_Vector; + + begin + Handler.Start_Object; + if Value.section.Is_Set then + Handler.Key_Name ("section"); + Write_Virtual_String_Vector (Handler, Value.section.Value); + end if; + Handler.End_Object; + end Write_DidChangeConfigurationRegistrationOptions; + + procedure Write_CallHierarchyItem + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CallHierarchyItem) is + begin + Handler.Start_Object; + Handler.Key_Name ("name"); + Handler.String_Value (Value.name); + Handler.Key_Name ("kind"); + Write_SymbolKind (Handler, Value.kind); + if (for some Item of Value.tags => Item) then + Handler.Key_Name ("tags"); + Write_SymbolTag_Set (Handler, Value.tags); + end if; + if not Value.detail.Is_Null then + Handler.Key_Name ("detail"); + Handler.String_Value (Value.detail); + end if; + Handler.Key_Name ("uri"); + Handler.String_Value (Value.uri); + Handler.Key_Name ("range"); + Write_A_Range (Handler, Value.a_range); + Handler.Key_Name ("selectionRange"); + Write_A_Range (Handler, Value.selectionRange); + if not Value.data.Is_Empty then + Handler.Key_Name ("data"); + Write_LSPAny (Handler, Value.data); + end if; + Handler.End_Object; + end Write_CallHierarchyItem; + + procedure Write_SymbolTag_Set + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SymbolTag_Set) is + begin + Handler.Start_Array; + declare + Set : LSP.Structures.SymbolTag_Set renames Value; + begin + for Value in Set'Range loop + if Set (Value) then + Write_SymbolTag (Handler, Value); + end if; + end loop; + end; + Handler.End_Array; + end Write_SymbolTag_Set; + + procedure Write_CompletionItem_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CompletionItem_Vector) is + begin + Handler.Start_Array; + for J in Value.First_Index .. Value.Last_Index loop + Write_CompletionItem (Handler, Value (J)); + end loop; + Handler.End_Array; + end Write_CompletionItem_Vector; + + procedure Write_RelativePattern + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.RelativePattern) is + procedure Write_WorkspaceFolder_Or_URI + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.WorkspaceFolder_Or_URI); + + procedure Write_WorkspaceFolder_Or_URI + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.WorkspaceFolder_Or_URI) is + begin + case Value.Is_WorkspaceFolder is + when True => + Write_WorkspaceFolder (Handler, Value.WorkspaceFolder); + when False => + Write_URI (Handler, Value.URI); + end case; + end Write_WorkspaceFolder_Or_URI; + + begin + Handler.Start_Object; + Handler.Key_Name ("baseUri"); + Write_WorkspaceFolder_Or_URI (Handler, Value.baseUri); + Handler.Key_Name ("pattern"); + Write_Pattern (Handler, Value.pattern); + Handler.End_Object; + end Write_RelativePattern; + + procedure Write_Moniker_Vector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Moniker_Vector_Or_Null) is + begin + if Value.Is_Empty then + Handler.Null_Value; + else + Write_Moniker_Vector (Handler, Value); + end if; + end Write_Moniker_Vector_Or_Null; + + procedure Write_WorkDoneProgressReport + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.WorkDoneProgressReport) is + begin + Handler.Start_Object; + Handler.Key_Name ("kind"); + Handler.String_Value ("report"); + if Value.cancellable.Is_Set then + Handler.Key_Name ("cancellable"); + Handler.Boolean_Value (Value.cancellable.Value); + end if; + if not Value.message.Is_Null then + Handler.Key_Name ("message"); + Handler.String_Value (Value.message); + end if; + if Value.percentage.Is_Set then + Handler.Key_Name ("percentage"); + Handler.Integer_Value (Integer'Pos (Value.percentage.Value)); + end if; + Handler.End_Object; + end Write_WorkDoneProgressReport; + + procedure Write_tagSupport_OfWorkspaceSymbolClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.tagSupport_OfWorkspaceSymbolClientCapabilities) is + begin + Handler.Start_Object; + Handler.Key_Name ("valueSet"); + Write_SymbolTag_Set (Handler, Value.valueSet); + Handler.End_Object; + end Write_tagSupport_OfWorkspaceSymbolClientCapabilities; + + procedure Write_ReferenceOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ReferenceOptions) is + begin + Handler.Start_Object; + if Value.workDoneProgress.Is_Set then + Handler.Key_Name ("workDoneProgress"); + Handler.Boolean_Value (Value.workDoneProgress.Value); + end if; + Handler.End_Object; + end Write_ReferenceOptions; + + procedure Write_TextDocumentClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.TextDocumentClientCapabilities) is + begin + Handler.Start_Object; + if Value.synchronization.Is_Set then + Handler.Key_Name ("synchronization"); + Write_TextDocumentSyncClientCapabilities + (Handler, Value.synchronization.Value); + end if; + if Value.completion.Is_Set then + Handler.Key_Name ("completion"); + Write_CompletionClientCapabilities (Handler, Value.completion.Value); + end if; + if Value.hover.Is_Set then + Handler.Key_Name ("hover"); + Write_HoverClientCapabilities (Handler, Value.hover.Value); + end if; + if Value.signatureHelp.Is_Set then + Handler.Key_Name ("signatureHelp"); + Write_SignatureHelpClientCapabilities + (Handler, Value.signatureHelp.Value); + end if; + if Value.declaration.Is_Set then + Handler.Key_Name ("declaration"); + Write_DeclarationClientCapabilities + (Handler, Value.declaration.Value); + end if; + if Value.definition.Is_Set then + Handler.Key_Name ("definition"); + Write_DefinitionClientCapabilities (Handler, Value.definition.Value); + end if; + if Value.typeDefinition.Is_Set then + Handler.Key_Name ("typeDefinition"); + Write_TypeDefinitionClientCapabilities + (Handler, Value.typeDefinition.Value); + end if; + if Value.implementation.Is_Set then + Handler.Key_Name ("implementation"); + Write_ImplementationClientCapabilities + (Handler, Value.implementation.Value); + end if; + if Value.references.Is_Set then + Handler.Key_Name ("references"); + Write_ReferenceClientCapabilities (Handler, Value.references.Value); + end if; + if Value.documentHighlight.Is_Set then + Handler.Key_Name ("documentHighlight"); + Write_DocumentHighlightClientCapabilities + (Handler, Value.documentHighlight.Value); + end if; + if Value.documentSymbol.Is_Set then + Handler.Key_Name ("documentSymbol"); + Write_DocumentSymbolClientCapabilities + (Handler, Value.documentSymbol.Value); + end if; + if Value.codeAction.Is_Set then + Handler.Key_Name ("codeAction"); + Write_CodeActionClientCapabilities (Handler, Value.codeAction.Value); + end if; + if Value.codeLens.Is_Set then + Handler.Key_Name ("codeLens"); + Write_CodeLensClientCapabilities (Handler, Value.codeLens.Value); + end if; + if Value.documentLink.Is_Set then + Handler.Key_Name ("documentLink"); + Write_DocumentLinkClientCapabilities + (Handler, Value.documentLink.Value); + end if; + if Value.colorProvider.Is_Set then + Handler.Key_Name ("colorProvider"); + Write_DocumentColorClientCapabilities + (Handler, Value.colorProvider.Value); + end if; + if Value.formatting.Is_Set then + Handler.Key_Name ("formatting"); + Write_DocumentFormattingClientCapabilities + (Handler, Value.formatting.Value); + end if; + if Value.rangeFormatting.Is_Set then + Handler.Key_Name ("rangeFormatting"); + Write_DocumentRangeFormattingClientCapabilities + (Handler, Value.rangeFormatting.Value); + end if; + if Value.onTypeFormatting.Is_Set then + Handler.Key_Name ("onTypeFormatting"); + Write_DocumentOnTypeFormattingClientCapabilities + (Handler, Value.onTypeFormatting.Value); + end if; + if Value.rename.Is_Set then + Handler.Key_Name ("rename"); + Write_RenameClientCapabilities (Handler, Value.rename.Value); + end if; + if Value.foldingRange.Is_Set then + Handler.Key_Name ("foldingRange"); + Write_FoldingRangeClientCapabilities + (Handler, Value.foldingRange.Value); + end if; + if Value.selectionRange.Is_Set then + Handler.Key_Name ("selectionRange"); + Write_SelectionRangeClientCapabilities + (Handler, Value.selectionRange.Value); + end if; + if Value.publishDiagnostics.Is_Set then + Handler.Key_Name ("publishDiagnostics"); + Write_PublishDiagnosticsClientCapabilities + (Handler, Value.publishDiagnostics.Value); + end if; + if Value.callHierarchy.Is_Set then + Handler.Key_Name ("callHierarchy"); + Write_CallHierarchyClientCapabilities + (Handler, Value.callHierarchy.Value); + end if; + if Value.semanticTokens.Is_Set then + Handler.Key_Name ("semanticTokens"); + Write_SemanticTokensClientCapabilities + (Handler, Value.semanticTokens.Value); + end if; + if Value.linkedEditingRange.Is_Set then + Handler.Key_Name ("linkedEditingRange"); + Write_LinkedEditingRangeClientCapabilities + (Handler, Value.linkedEditingRange.Value); + end if; + if Value.moniker.Is_Set then + Handler.Key_Name ("moniker"); + Write_MonikerClientCapabilities (Handler, Value.moniker.Value); + end if; + if Value.typeHierarchy.Is_Set then + Handler.Key_Name ("typeHierarchy"); + Write_TypeHierarchyClientCapabilities + (Handler, Value.typeHierarchy.Value); + end if; + if Value.inlineValue.Is_Set then + Handler.Key_Name ("inlineValue"); + Write_InlineValueClientCapabilities + (Handler, Value.inlineValue.Value); + end if; + if Value.inlayHint.Is_Set then + Handler.Key_Name ("inlayHint"); + Write_InlayHintClientCapabilities (Handler, Value.inlayHint.Value); + end if; + if Value.diagnostic.Is_Set then + Handler.Key_Name ("diagnostic"); + Write_DiagnosticClientCapabilities (Handler, Value.diagnostic.Value); + end if; + Handler.End_Object; + end Write_TextDocumentClientCapabilities; + + procedure Write_WorkspaceSymbolParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.WorkspaceSymbolParams) is + begin + Handler.Start_Object; + if Value.workDoneToken.Is_Set then + Handler.Key_Name ("workDoneToken"); + Write_ProgressToken (Handler, Value.workDoneToken.Value); + end if; + if Value.partialResultToken.Is_Set then + Handler.Key_Name ("partialResultToken"); + Write_ProgressToken (Handler, Value.partialResultToken.Value); + end if; + Handler.Key_Name ("query"); + Handler.String_Value (Value.query); + Handler.End_Object; + end Write_WorkspaceSymbolParams; + + procedure Write_DocumentSymbol_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSymbol_Vector) is + begin + Handler.Start_Array; + for J in 1 .. Value.Length loop + Write_DocumentSymbol (Handler, Value (J)); + end loop; + Handler.End_Array; + end Write_DocumentSymbol_Vector; + + procedure Write_GlobPattern + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.GlobPattern) is + begin + case Value.Is_Pattern is + when True => + Write_Pattern (Handler, Value.Pattern); + when False => + Write_RelativePattern (Handler, Value.RelativePattern); + end case; + end Write_GlobPattern; + + procedure Write_NotebookDocumentIdentifier + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.NotebookDocumentIdentifier) is + begin + Handler.Start_Object; + Handler.Key_Name ("uri"); + Write_URI (Handler, Value.uri); + Handler.End_Object; + end Write_NotebookDocumentIdentifier; + + procedure Write_InsertReplaceEdit + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.InsertReplaceEdit) is + begin + Handler.Start_Object; + Handler.Key_Name ("newText"); + Handler.String_Value (Value.newText); + Handler.Key_Name ("insert"); + Write_A_Range (Handler, Value.insert); + Handler.Key_Name ("replace"); + Write_A_Range (Handler, Value.replace); + Handler.End_Object; + end Write_InsertReplaceEdit; + + procedure Write_InitializeResult + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.InitializeResult) is + begin + Handler.Start_Object; + Handler.Key_Name ("capabilities"); + Write_ServerCapabilities (Handler, Value.capabilities); + if Value.serverInfo.Is_Set then + Handler.Key_Name ("serverInfo"); + Write_clientInfo_Of_InitializeParams + (Handler, Value.serverInfo.Value); + end if; + Handler.End_Object; + end Write_InitializeResult; + + procedure Write_InlineValueVariableLookup + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.InlineValueVariableLookup) is + begin + Handler.Start_Object; + Handler.Key_Name ("range"); + Write_A_Range (Handler, Value.a_range); + if not Value.variableName.Is_Null then + Handler.Key_Name ("variableName"); + Handler.String_Value (Value.variableName); + end if; + Handler.Key_Name ("caseSensitiveLookup"); + Handler.Boolean_Value (Value.caseSensitiveLookup); + Handler.End_Object; + end Write_InlineValueVariableLookup; + + procedure Write_FileEvent + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.FileEvent) is + begin + Handler.Start_Object; + Handler.Key_Name ("uri"); + Handler.String_Value (Value.uri); + Handler.Key_Name ("type"); + Write_FileChangeType (Handler, Value.a_type); + Handler.End_Object; + end Write_FileEvent; + + procedure Write_SignatureHelpClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SignatureHelpClientCapabilities) is + procedure Write_signatureInformation_OfSignatureHelpClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures + .signatureInformation_OfSignatureHelpClientCapabilities); + + procedure Write_parameterInformation_OfsignatureInformation_OfSignatureHelpClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures + .parameterInformation_OfsignatureInformation_OfSignatureHelpClientCapabilities); + + procedure Write_signatureInformation_OfSignatureHelpClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures + .signatureInformation_OfSignatureHelpClientCapabilities) is + begin + Handler.Start_Object; + if not Value.documentationFormat.Is_Empty then + Handler.Key_Name ("documentationFormat"); + Write_MarkupKind_Vector (Handler, Value.documentationFormat); + end if; + if Value.parameterInformation.Is_Set then + Handler.Key_Name ("parameterInformation"); + Write_parameterInformation_OfsignatureInformation_OfSignatureHelpClientCapabilities + (Handler, Value.parameterInformation.Value); + end if; + if Value.activeParameterSupport.Is_Set then + Handler.Key_Name ("activeParameterSupport"); + Handler.Boolean_Value (Value.activeParameterSupport.Value); + end if; + Handler.End_Object; + end Write_signatureInformation_OfSignatureHelpClientCapabilities; + + procedure Write_parameterInformation_OfsignatureInformation_OfSignatureHelpClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures + .parameterInformation_OfsignatureInformation_OfSignatureHelpClientCapabilities) is + begin + Handler.Start_Object; + if Value.labelOffsetSupport.Is_Set then + Handler.Key_Name ("labelOffsetSupport"); + Handler.Boolean_Value (Value.labelOffsetSupport.Value); + end if; + Handler.End_Object; + end Write_parameterInformation_OfsignatureInformation_OfSignatureHelpClientCapabilities; + + begin + Handler.Start_Object; + if Value.dynamicRegistration.Is_Set then + Handler.Key_Name ("dynamicRegistration"); + Handler.Boolean_Value (Value.dynamicRegistration.Value); + end if; + if Value.signatureInformation.Is_Set then + Handler.Key_Name ("signatureInformation"); + Write_signatureInformation_OfSignatureHelpClientCapabilities + (Handler, Value.signatureInformation.Value); + end if; + if Value.contextSupport.Is_Set then + Handler.Key_Name ("contextSupport"); + Handler.Boolean_Value (Value.contextSupport.Value); + end if; + Handler.End_Object; + end Write_SignatureHelpClientCapabilities; + + procedure Write_WorkDoneProgressCancelParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.WorkDoneProgressCancelParams) is + begin + Handler.Start_Object; + Handler.Key_Name ("token"); + Write_ProgressToken (Handler, Value.token); + Handler.End_Object; + end Write_WorkDoneProgressCancelParams; + + procedure Write_NotebookDocumentSyncClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.NotebookDocumentSyncClientCapabilities) is + begin + Handler.Start_Object; + if Value.dynamicRegistration.Is_Set then + Handler.Key_Name ("dynamicRegistration"); + Handler.Boolean_Value (Value.dynamicRegistration.Value); + end if; + if Value.executionSummarySupport.Is_Set then + Handler.Key_Name ("executionSummarySupport"); + Handler.Boolean_Value (Value.executionSummarySupport.Value); + end if; + Handler.End_Object; + end Write_NotebookDocumentSyncClientCapabilities; + + procedure Write_ProgressToken + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ProgressToken) is + begin + case Value.Is_Integer is + when True => + Handler.Integer_Value (Integer'Pos (Value.Integer)); + when False => + Handler.String_Value (Value.Virtual_String); + end case; + end Write_ProgressToken; + + procedure Write_DiagnosticOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DiagnosticOptions) is + begin + Handler.Start_Object; + if Value.workDoneProgress.Is_Set then + Handler.Key_Name ("workDoneProgress"); + Handler.Boolean_Value (Value.workDoneProgress.Value); + end if; + if not Value.identifier.Is_Null then + Handler.Key_Name ("identifier"); + Handler.String_Value (Value.identifier); + end if; + Handler.Key_Name ("interFileDependencies"); + Handler.Boolean_Value (Value.interFileDependencies); + Handler.Key_Name ("workspaceDiagnostics"); + Handler.Boolean_Value (Value.workspaceDiagnostics); + Handler.End_Object; + end Write_DiagnosticOptions; + + procedure Write_WindowClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.WindowClientCapabilities) is + begin + Handler.Start_Object; + if Value.workDoneProgress.Is_Set then + Handler.Key_Name ("workDoneProgress"); + Handler.Boolean_Value (Value.workDoneProgress.Value); + end if; + if Value.showMessage.Is_Set then + Handler.Key_Name ("showMessage"); + Write_ShowMessageRequestClientCapabilities + (Handler, Value.showMessage.Value); + end if; + if Value.showDocument.Is_Set then + Handler.Key_Name ("showDocument"); + Write_ShowDocumentClientCapabilities + (Handler, Value.showDocument.Value); + end if; + Handler.End_Object; + end Write_WindowClientCapabilities; + + procedure Write_GeneralClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.GeneralClientCapabilities) is + procedure Write_PositionEncodingKind_Set + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.PositionEncodingKind_Set); + + procedure Write_staleRequestSupport_OfGeneralClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures + .staleRequestSupport_OfGeneralClientCapabilities); + + procedure Write_PositionEncodingKind_Set + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.PositionEncodingKind_Set) is + begin + Handler.Start_Array; + declare + Set : LSP.Structures.PositionEncodingKind_Set renames Value; + begin + for Value in Set'Range loop + if Set (Value) then + Write_PositionEncodingKind (Handler, Value); + end if; + end loop; + end; + Handler.End_Array; + end Write_PositionEncodingKind_Set; + + procedure Write_staleRequestSupport_OfGeneralClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures + .staleRequestSupport_OfGeneralClientCapabilities) is + begin + Handler.Start_Object; + Handler.Key_Name ("cancel"); + Handler.Boolean_Value (Value.cancel); + Handler.Key_Name ("retryOnContentModified"); + Write_Virtual_String_Vector (Handler, Value.retryOnContentModified); + Handler.End_Object; + end Write_staleRequestSupport_OfGeneralClientCapabilities; + + begin + Handler.Start_Object; + if Value.staleRequestSupport.Is_Set then + Handler.Key_Name ("staleRequestSupport"); + Write_staleRequestSupport_OfGeneralClientCapabilities + (Handler, Value.staleRequestSupport.Value); + end if; + if Value.regularExpressions.Is_Set then + Handler.Key_Name ("regularExpressions"); + Write_RegularExpressionsClientCapabilities + (Handler, Value.regularExpressions.Value); + end if; + if Value.markdown.Is_Set then + Handler.Key_Name ("markdown"); + Write_MarkdownClientCapabilities (Handler, Value.markdown.Value); + end if; + if (for some Item of Value.positionEncodings => Item) then + Handler.Key_Name ("positionEncodings"); + Write_PositionEncodingKind_Set (Handler, Value.positionEncodings); + end if; + Handler.End_Object; + end Write_GeneralClientCapabilities; + + procedure Write_SemanticTokensWorkspaceClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SemanticTokensWorkspaceClientCapabilities) is + begin + Handler.Start_Object; + if Value.refreshSupport.Is_Set then + Handler.Key_Name ("refreshSupport"); + Handler.Boolean_Value (Value.refreshSupport.Value); + end if; + Handler.End_Object; + end Write_SemanticTokensWorkspaceClientCapabilities; + + procedure Write_LinkedEditingRangeClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.LinkedEditingRangeClientCapabilities) is + begin + Handler.Start_Object; + if Value.dynamicRegistration.Is_Set then + Handler.Key_Name ("dynamicRegistration"); + Handler.Boolean_Value (Value.dynamicRegistration.Value); + end if; + Handler.End_Object; + end Write_LinkedEditingRangeClientCapabilities; + + procedure Write_SignatureHelp + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SignatureHelp) is + procedure Write_SignatureInformation_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SignatureInformation_Vector); + + procedure Write_SignatureInformation_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SignatureInformation_Vector) is + begin + Handler.Start_Array; + for J in Value.First_Index .. Value.Last_Index loop + Write_SignatureInformation (Handler, Value (J)); + end loop; + Handler.End_Array; + end Write_SignatureInformation_Vector; + + begin + Handler.Start_Object; + Handler.Key_Name ("signatures"); + Write_SignatureInformation_Vector (Handler, Value.signatures); + if Value.activeSignature.Is_Set then + Handler.Key_Name ("activeSignature"); + Handler.Integer_Value (Integer'Pos (Value.activeSignature.Value)); + end if; + if Value.activeParameter.Is_Set then + Handler.Key_Name ("activeParameter"); + Handler.Integer_Value (Integer'Pos (Value.activeParameter.Value)); + end if; + Handler.End_Object; + end Write_SignatureHelp; + + procedure Write_DidChangeWatchedFilesParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DidChangeWatchedFilesParams) is + procedure Write_FileEvent_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.FileEvent_Vector); + + procedure Write_FileEvent_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.FileEvent_Vector) is + begin + Handler.Start_Array; + for J in Value.First_Index .. Value.Last_Index loop + Write_FileEvent (Handler, Value (J)); + end loop; + Handler.End_Array; + end Write_FileEvent_Vector; + + begin + Handler.Start_Object; + Handler.Key_Name ("changes"); + Write_FileEvent_Vector (Handler, Value.changes); + Handler.End_Object; + end Write_DidChangeWatchedFilesParams; + + procedure Write_DidOpenNotebookDocumentParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DidOpenNotebookDocumentParams) is + begin + Handler.Start_Object; + Handler.Key_Name ("notebookDocument"); + Write_NotebookDocument (Handler, Value.notebookDocument); + Handler.Key_Name ("cellTextDocuments"); + Write_TextDocumentItem_Vector (Handler, Value.cellTextDocuments); + Handler.End_Object; + end Write_DidOpenNotebookDocumentParams; + + procedure Write_SignatureHelp_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SignatureHelp_Or_Null) is + begin + if Value.Is_Null then + Handler.Null_Value; + else + Write_SignatureHelp (Handler, Value.Value); + end if; + end Write_SignatureHelp_Or_Null; + + procedure Write_Diagnostic_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Diagnostic_Vector) is + begin + Handler.Start_Array; + for J in Value.First_Index .. Value.Last_Index loop + Write_Diagnostic (Handler, Value (J)); + end loop; + Handler.End_Array; + end Write_Diagnostic_Vector; + + procedure Write_DocumentHighlightKind + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.DocumentHighlightKind) is + begin + case Value is + when LSP.Enumerations.Text => + Handler.Integer_Value (1); + when LSP.Enumerations.Read => + Handler.Integer_Value (2); + when LSP.Enumerations.Write => + Handler.Integer_Value (3); + end case; + end Write_DocumentHighlightKind; + + procedure Write_CodeLens_Vector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CodeLens_Vector_Or_Null) is + begin + if Value.Is_Empty then + Handler.Null_Value; + else + Write_CodeLens_Vector (Handler, Value); + end if; + end Write_CodeLens_Vector_Or_Null; + + procedure Write_ResourceOperationKind + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.ResourceOperationKind) is + begin + case Value is + when LSP.Enumerations.Create => + Handler.String_Value ("create"); + when LSP.Enumerations.Rename => + Handler.String_Value ("rename"); + when LSP.Enumerations.Delete => + Handler.String_Value ("delete"); + end case; + end Write_ResourceOperationKind; + + procedure Write_WorkspaceFolder_Vector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.WorkspaceFolder_Vector_Or_Null) is + begin + if Value.Is_Empty then + Handler.Null_Value; + else + Write_WorkspaceFolder_Vector (Handler, Value); + end if; + end Write_WorkspaceFolder_Vector_Or_Null; + + procedure Write_InlineValueClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.InlineValueClientCapabilities) is + begin + Handler.Start_Object; + if Value.dynamicRegistration.Is_Set then + Handler.Key_Name ("dynamicRegistration"); + Handler.Boolean_Value (Value.dynamicRegistration.Value); + end if; + Handler.End_Object; + end Write_InlineValueClientCapabilities; + + procedure Write_PrepareRenameResult + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.PrepareRenameResult) is + procedure Write_PrepareRenameResult_2 + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.PrepareRenameResult_2); + + procedure Write_PrepareRenameResult_3 + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.PrepareRenameResult_3); + + procedure Write_PrepareRenameResult_2 + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.PrepareRenameResult_2) is + begin + Handler.Start_Object; + Handler.Key_Name ("range"); + Write_A_Range (Handler, Value.a_range); + Handler.Key_Name ("placeholder"); + Handler.String_Value (Value.placeholder); + Handler.End_Object; + end Write_PrepareRenameResult_2; + + procedure Write_PrepareRenameResult_3 + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.PrepareRenameResult_3) is + begin + Handler.Start_Object; + Handler.Key_Name ("defaultBehavior"); + Handler.Boolean_Value (Value.defaultBehavior); + Handler.End_Object; + end Write_PrepareRenameResult_3; + + begin + case Value.Kind is + when LSP.Structures.Varian_1 => + Write_A_Range (Handler, Value.Varian_1); + when LSP.Structures.Varian_2 => + Write_PrepareRenameResult_2 (Handler, Value.Varian_2); + when LSP.Structures.Varian_3 => + Write_PrepareRenameResult_3 (Handler, Value.Varian_3); + end case; + end Write_PrepareRenameResult; + + procedure Write_DocumentLinkParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentLinkParams) is + begin + Handler.Start_Object; + if Value.workDoneToken.Is_Set then + Handler.Key_Name ("workDoneToken"); + Write_ProgressToken (Handler, Value.workDoneToken.Value); + end if; + if Value.partialResultToken.Is_Set then + Handler.Key_Name ("partialResultToken"); + Write_ProgressToken (Handler, Value.partialResultToken.Value); + end if; + Handler.Key_Name ("textDocument"); + Write_TextDocumentIdentifier (Handler, Value.textDocument); + Handler.End_Object; + end Write_DocumentLinkParams; + + procedure Write_DocumentLinkClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentLinkClientCapabilities) is + begin + Handler.Start_Object; + if Value.dynamicRegistration.Is_Set then + Handler.Key_Name ("dynamicRegistration"); + Handler.Boolean_Value (Value.dynamicRegistration.Value); + end if; + if Value.tooltipSupport.Is_Set then + Handler.Key_Name ("tooltipSupport"); + Handler.Boolean_Value (Value.tooltipSupport.Value); + end if; + Handler.End_Object; + end Write_DocumentLinkClientCapabilities; + + procedure Write_MarkupKind_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.MarkupKind_Vector) is + begin + Handler.Start_Array; + for J in Value.First_Index .. Value.Last_Index loop + Write_MarkupKind (Handler, Value (J)); + end loop; + Handler.End_Array; + end Write_MarkupKind_Vector; + + procedure Write_CodeActionContext + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CodeActionContext) is + begin + Handler.Start_Object; + Handler.Key_Name ("diagnostics"); + Write_Diagnostic_Vector (Handler, Value.diagnostics); + if (for some Item of Value.only => Item) then + Handler.Key_Name ("only"); + Write_CodeActionKind_Set (Handler, Value.only); + end if; + if Value.triggerKind.Is_Set then + Handler.Key_Name ("triggerKind"); + Write_CodeActionTriggerKind (Handler, Value.triggerKind.Value); + end if; + Handler.End_Object; + end Write_CodeActionContext; + + procedure Write_ConfigurationParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ConfigurationParams) is + procedure Write_ConfigurationItem_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ConfigurationItem_Vector); + + procedure Write_ConfigurationItem_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ConfigurationItem_Vector) is + begin + Handler.Start_Array; + for J in Value.First_Index .. Value.Last_Index loop + Write_ConfigurationItem (Handler, Value (J)); + end loop; + Handler.End_Array; + end Write_ConfigurationItem_Vector; + + begin + Handler.Start_Object; + Handler.Key_Name ("items"); + Write_ConfigurationItem_Vector (Handler, Value.items); + Handler.End_Object; + end Write_ConfigurationParams; + + procedure Write_DidChangeTextDocumentParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DidChangeTextDocumentParams) is + begin + Handler.Start_Object; + Handler.Key_Name ("textDocument"); + Write_VersionedTextDocumentIdentifier (Handler, Value.textDocument); + Handler.Key_Name ("contentChanges"); + Write_TextDocumentContentChangeEvent_Vector + (Handler, Value.contentChanges); + Handler.End_Object; + end Write_DidChangeTextDocumentParams; + + procedure Write_InlayHintRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.InlayHintRegistrationOptions) is + procedure Write_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSelector_Or_Null); + + procedure Write_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSelector_Or_Null) is + begin + if Value.Is_Null then + Handler.Null_Value; + else + Write_DocumentSelector (Handler, Value.Value); + end if; + end Write_DocumentSelector_Or_Null; + + begin + Handler.Start_Object; + if Value.workDoneProgress.Is_Set then + Handler.Key_Name ("workDoneProgress"); + Handler.Boolean_Value (Value.workDoneProgress.Value); + end if; + if Value.resolveProvider.Is_Set then + Handler.Key_Name ("resolveProvider"); + Handler.Boolean_Value (Value.resolveProvider.Value); + end if; + Handler.Key_Name ("documentSelector"); + Write_DocumentSelector_Or_Null (Handler, Value.Parent.documentSelector); + if not Value.id.Is_Null then + Handler.Key_Name ("id"); + Handler.String_Value (Value.id); + end if; + Handler.End_Object; + end Write_InlayHintRegistrationOptions; + + procedure Write_Declaration_Progress_Report + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Declaration_Progress_Report) is + begin + case Value.Kind is + when LSP.Structures.Varian_1 => + Write_Location_Vector (Handler, Value.Varian_1); + when LSP.Structures.Varian_2 => + Write_DeclarationLink_Vector (Handler, Value.Varian_2); + end case; + end Write_Declaration_Progress_Report; + + procedure Write_Natural_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Natural_Vector) is + begin + Handler.Start_Array; + for J in Value.First_Index .. Value.Last_Index loop + Handler.Integer_Value (Integer'Pos (Value (J))); + end loop; + Handler.End_Array; + end Write_Natural_Vector; + + procedure Write_CodeDescription + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CodeDescription) is + begin + Handler.Start_Object; + Handler.Key_Name ("href"); + Write_URI (Handler, Value.href); + Handler.End_Object; + end Write_CodeDescription; + + procedure Write_Virtual_String_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Virtual_String_Vector) is + begin + Handler.Start_Array; + for J in 1 .. Value.Length loop + Handler.String_Value (Value (J)); + end loop; + Handler.End_Array; + end Write_Virtual_String_Vector; + + procedure Write_LSPObject + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.LSPObject) is + begin + Handler.Start_Object; + LSP.Output_Tools.Write_LSPAny (Handler, LSP.Structures.LSPAny (Value)); + Handler.End_Object; + end Write_LSPObject; + + procedure Write_TextDocumentPositionParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.TextDocumentPositionParams) is + begin + Handler.Start_Object; + Handler.Key_Name ("textDocument"); + Write_TextDocumentIdentifier (Handler, Value.textDocument); + Handler.Key_Name ("position"); + Write_Position (Handler, Value.position); + Handler.End_Object; + end Write_TextDocumentPositionParams; + + procedure Write_DidSaveTextDocumentParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DidSaveTextDocumentParams) is + begin + Handler.Start_Object; + Handler.Key_Name ("textDocument"); + Write_TextDocumentIdentifier (Handler, Value.textDocument); + if not Value.text.Is_Null then + Handler.Key_Name ("text"); + Handler.String_Value (Value.text); + end if; + Handler.End_Object; + end Write_DidSaveTextDocumentParams; + + procedure Write_CodeLensRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CodeLensRegistrationOptions) is + procedure Write_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSelector_Or_Null); + + procedure Write_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSelector_Or_Null) is + begin + if Value.Is_Null then + Handler.Null_Value; + else + Write_DocumentSelector (Handler, Value.Value); + end if; + end Write_DocumentSelector_Or_Null; + + begin + Handler.Start_Object; + Handler.Key_Name ("documentSelector"); + Write_DocumentSelector_Or_Null (Handler, Value.Parent.documentSelector); + if Value.workDoneProgress.Is_Set then + Handler.Key_Name ("workDoneProgress"); + Handler.Boolean_Value (Value.workDoneProgress.Value); + end if; + if Value.resolveProvider.Is_Set then + Handler.Key_Name ("resolveProvider"); + Handler.Boolean_Value (Value.resolveProvider.Value); + end if; + Handler.End_Object; + end Write_CodeLensRegistrationOptions; + + procedure Write_SelectionRange + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SelectionRange) is + begin + Handler.Start_Object; + Handler.Key_Name ("range"); + Write_A_Range (Handler, Value.a_range); + if Value.parent.Is_Set then + Handler.Key_Name ("parent"); + Write_SelectionRange (Handler, Value.parent.Value); + end if; + Handler.End_Object; + end Write_SelectionRange; + + procedure Write_NotebookCellTextDocumentFilter + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.NotebookCellTextDocumentFilter) is + begin + Handler.Start_Object; + Handler.Key_Name ("notebook"); + Write_Virtual_String_Or_NotebookDocumentFilter (Handler, Value.notebook); + if not Value.language.Is_Null then + Handler.Key_Name ("language"); + Handler.String_Value (Value.language); + end if; + Handler.End_Object; + end Write_NotebookCellTextDocumentFilter; + + procedure Write_WorkspaceFoldersInitializeParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.WorkspaceFoldersInitializeParams) is + begin + Handler.Start_Object; + if Value.workspaceFolders.Is_Set then + Handler.Key_Name ("workspaceFolders"); + Write_WorkspaceFolder_Vector_Or_Null + (Handler, Value.workspaceFolders.Value); + end if; + Handler.End_Object; + end Write_WorkspaceFoldersInitializeParams; + + procedure Write_ShowMessageParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ShowMessageParams) is + begin + Handler.Start_Object; + Handler.Key_Name ("type"); + Write_MessageType (Handler, Value.a_type); + Handler.Key_Name ("message"); + Handler.String_Value (Value.message); + Handler.End_Object; + end Write_ShowMessageParams; + + procedure Write_FileSystemWatcher + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.FileSystemWatcher) is + begin + Handler.Start_Object; + Handler.Key_Name ("globPattern"); + Write_GlobPattern (Handler, Value.globPattern); + if Value.kind.Is_Set then + Handler.Key_Name ("kind"); + Write_WatchKind (Handler, Value.kind.Value); + end if; + Handler.End_Object; + end Write_FileSystemWatcher; + + procedure Write_CodeActionKind_Set + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CodeActionKind_Set) is + begin + Handler.Start_Array; + declare + Set : LSP.Structures.CodeActionKind_Set renames Value; + begin + for Value in Set'Range loop + if Set (Value) then + Write_CodeActionKind (Handler, Value); + end if; + end loop; + end; + Handler.End_Array; + end Write_CodeActionKind_Set; + + procedure Write_NotebookDocumentSyncOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.NotebookDocumentSyncOptions) is + procedure Write_cells_OfnotebookSelector_OfNotebookDocumentSyncOptions_Item_Item + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures + .cells_OfnotebookSelector_OfNotebookDocumentSyncOptions_Item_Item); + + procedure Write_notebookSelector_OfNotebookDocumentSyncOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures + .notebookSelector_OfNotebookDocumentSyncOptions); + + procedure Write_cells_OfnotebookSelector_OfNotebookDocumentSyncOptions_Item + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures + .cells_OfnotebookSelector_OfNotebookDocumentSyncOptions_Item); + + procedure Write_notebookSelector_OfNotebookDocumentSyncOptions_Item + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures + .notebookSelector_OfNotebookDocumentSyncOptions_Item); + + procedure Write_cells_OfnotebookSelector_OfNotebookDocumentSyncOptions_Item_Item + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures + .cells_OfnotebookSelector_OfNotebookDocumentSyncOptions_Item_Item) is + begin + Handler.Start_Object; + Handler.Key_Name ("language"); + Handler.String_Value (Value.language); + Handler.End_Object; + end Write_cells_OfnotebookSelector_OfNotebookDocumentSyncOptions_Item_Item; + + procedure Write_notebookSelector_OfNotebookDocumentSyncOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures + .notebookSelector_OfNotebookDocumentSyncOptions) is + begin + Handler.Start_Array; + for J in Value.First_Index .. Value.Last_Index loop + Write_notebookSelector_OfNotebookDocumentSyncOptions_Item + (Handler, Value (J)); + end loop; + Handler.End_Array; + end Write_notebookSelector_OfNotebookDocumentSyncOptions; + + procedure Write_cells_OfnotebookSelector_OfNotebookDocumentSyncOptions_Item + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures + .cells_OfnotebookSelector_OfNotebookDocumentSyncOptions_Item) is + begin + Handler.Start_Array; + for J in Value.First_Index .. Value.Last_Index loop + Write_cells_OfnotebookSelector_OfNotebookDocumentSyncOptions_Item_Item + (Handler, Value (J)); + end loop; + Handler.End_Array; + end Write_cells_OfnotebookSelector_OfNotebookDocumentSyncOptions_Item; + + procedure Write_notebookSelector_OfNotebookDocumentSyncOptions_Item + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures + .notebookSelector_OfNotebookDocumentSyncOptions_Item) is + begin + Handler.Start_Object; + if Value.notebook.Is_Set then + Handler.Key_Name ("notebook"); + Write_Virtual_String_Or_NotebookDocumentFilter + (Handler, Value.notebook.Value); + end if; + if not Value.cells.Is_Empty then + Handler.Key_Name ("cells"); + Write_cells_OfnotebookSelector_OfNotebookDocumentSyncOptions_Item + (Handler, Value.cells); + end if; + Handler.End_Object; + end Write_notebookSelector_OfNotebookDocumentSyncOptions_Item; + + begin + Handler.Start_Object; + Handler.Key_Name ("notebookSelector"); + Write_notebookSelector_OfNotebookDocumentSyncOptions + (Handler, Value.notebookSelector); + if Value.save.Is_Set then + Handler.Key_Name ("save"); + Handler.Boolean_Value (Value.save.Value); + end if; + Handler.End_Object; + end Write_NotebookDocumentSyncOptions; + + procedure Write_CodeActionRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CodeActionRegistrationOptions) is + procedure Write_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSelector_Or_Null); + + procedure Write_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSelector_Or_Null) is + begin + if Value.Is_Null then + Handler.Null_Value; + else + Write_DocumentSelector (Handler, Value.Value); + end if; + end Write_DocumentSelector_Or_Null; + + begin + Handler.Start_Object; + Handler.Key_Name ("documentSelector"); + Write_DocumentSelector_Or_Null (Handler, Value.Parent.documentSelector); + if Value.workDoneProgress.Is_Set then + Handler.Key_Name ("workDoneProgress"); + Handler.Boolean_Value (Value.workDoneProgress.Value); + end if; + if (for some Item of Value.codeActionKinds => Item) then + Handler.Key_Name ("codeActionKinds"); + Write_CodeActionKind_Set (Handler, Value.codeActionKinds); + end if; + if Value.resolveProvider.Is_Set then + Handler.Key_Name ("resolveProvider"); + Handler.Boolean_Value (Value.resolveProvider.Value); + end if; + Handler.End_Object; + end Write_CodeActionRegistrationOptions; + + procedure Write_NotebookDocumentSyncRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.NotebookDocumentSyncRegistrationOptions) is + procedure Write_cells_OfnotebookSelector_OfNotebookDocumentSyncOptions_Item_Item + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures + .cells_OfnotebookSelector_OfNotebookDocumentSyncOptions_Item_Item); + + procedure Write_notebookSelector_OfNotebookDocumentSyncOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures + .notebookSelector_OfNotebookDocumentSyncOptions); + + procedure Write_cells_OfnotebookSelector_OfNotebookDocumentSyncOptions_Item + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures + .cells_OfnotebookSelector_OfNotebookDocumentSyncOptions_Item); + + procedure Write_notebookSelector_OfNotebookDocumentSyncOptions_Item + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures + .notebookSelector_OfNotebookDocumentSyncOptions_Item); + + procedure Write_cells_OfnotebookSelector_OfNotebookDocumentSyncOptions_Item_Item + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures + .cells_OfnotebookSelector_OfNotebookDocumentSyncOptions_Item_Item) is + begin + Handler.Start_Object; + Handler.Key_Name ("language"); + Handler.String_Value (Value.language); + Handler.End_Object; + end Write_cells_OfnotebookSelector_OfNotebookDocumentSyncOptions_Item_Item; + + procedure Write_notebookSelector_OfNotebookDocumentSyncOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures + .notebookSelector_OfNotebookDocumentSyncOptions) is + begin + Handler.Start_Array; + for J in Value.First_Index .. Value.Last_Index loop + Write_notebookSelector_OfNotebookDocumentSyncOptions_Item + (Handler, Value (J)); + end loop; + Handler.End_Array; + end Write_notebookSelector_OfNotebookDocumentSyncOptions; + + procedure Write_cells_OfnotebookSelector_OfNotebookDocumentSyncOptions_Item + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures + .cells_OfnotebookSelector_OfNotebookDocumentSyncOptions_Item) is + begin + Handler.Start_Array; + for J in Value.First_Index .. Value.Last_Index loop + Write_cells_OfnotebookSelector_OfNotebookDocumentSyncOptions_Item_Item + (Handler, Value (J)); + end loop; + Handler.End_Array; + end Write_cells_OfnotebookSelector_OfNotebookDocumentSyncOptions_Item; + + procedure Write_notebookSelector_OfNotebookDocumentSyncOptions_Item + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures + .notebookSelector_OfNotebookDocumentSyncOptions_Item) is + begin + Handler.Start_Object; + if Value.notebook.Is_Set then + Handler.Key_Name ("notebook"); + Write_Virtual_String_Or_NotebookDocumentFilter + (Handler, Value.notebook.Value); + end if; + if not Value.cells.Is_Empty then + Handler.Key_Name ("cells"); + Write_cells_OfnotebookSelector_OfNotebookDocumentSyncOptions_Item + (Handler, Value.cells); + end if; + Handler.End_Object; + end Write_notebookSelector_OfNotebookDocumentSyncOptions_Item; + + begin + Handler.Start_Object; + Handler.Key_Name ("notebookSelector"); + Write_notebookSelector_OfNotebookDocumentSyncOptions + (Handler, Value.notebookSelector); + if Value.save.Is_Set then + Handler.Key_Name ("save"); + Handler.Boolean_Value (Value.save.Value); + end if; + if not Value.id.Is_Null then + Handler.Key_Name ("id"); + Handler.String_Value (Value.id); + end if; + Handler.End_Object; + end Write_NotebookDocumentSyncRegistrationOptions; + + procedure Write_WorkspaceUnchangedDocumentDiagnosticReport + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.WorkspaceUnchangedDocumentDiagnosticReport) is + begin + Handler.Start_Object; + Handler.Key_Name ("kind"); + Handler.String_Value ("unchanged"); + Handler.Key_Name ("resultId"); + Handler.String_Value (Value.resultId); + Handler.Key_Name ("uri"); + Handler.String_Value (Value.uri); + Handler.Key_Name ("version"); + Write_Integer_Or_Null (Handler, Value.version); + Handler.End_Object; + end Write_WorkspaceUnchangedDocumentDiagnosticReport; + + procedure Write_ReferenceParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ReferenceParams) is + begin + Handler.Start_Object; + Handler.Key_Name ("textDocument"); + Write_TextDocumentIdentifier (Handler, Value.textDocument); + Handler.Key_Name ("position"); + Write_Position (Handler, Value.position); + if Value.workDoneToken.Is_Set then + Handler.Key_Name ("workDoneToken"); + Write_ProgressToken (Handler, Value.workDoneToken.Value); + end if; + if Value.partialResultToken.Is_Set then + Handler.Key_Name ("partialResultToken"); + Write_ProgressToken (Handler, Value.partialResultToken.Value); + end if; + Handler.Key_Name ("context"); + Write_ReferenceContext (Handler, Value.context); + Handler.End_Object; + end Write_ReferenceParams; + + procedure Write_HoverClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.HoverClientCapabilities) is + begin + Handler.Start_Object; + if Value.dynamicRegistration.Is_Set then + Handler.Key_Name ("dynamicRegistration"); + Handler.Boolean_Value (Value.dynamicRegistration.Value); + end if; + if not Value.contentFormat.Is_Empty then + Handler.Key_Name ("contentFormat"); + Write_MarkupKind_Vector (Handler, Value.contentFormat); + end if; + Handler.End_Object; + end Write_HoverClientCapabilities; + + procedure Write_RenameClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.RenameClientCapabilities) is + begin + Handler.Start_Object; + if Value.dynamicRegistration.Is_Set then + Handler.Key_Name ("dynamicRegistration"); + Handler.Boolean_Value (Value.dynamicRegistration.Value); + end if; + if Value.prepareSupport.Is_Set then + Handler.Key_Name ("prepareSupport"); + Handler.Boolean_Value (Value.prepareSupport.Value); + end if; + if Value.prepareSupportDefaultBehavior.Is_Set then + Handler.Key_Name ("prepareSupportDefaultBehavior"); + Write_PrepareSupportDefaultBehavior + (Handler, Value.prepareSupportDefaultBehavior.Value); + end if; + if Value.honorsChangeAnnotations.Is_Set then + Handler.Key_Name ("honorsChangeAnnotations"); + Handler.Boolean_Value (Value.honorsChangeAnnotations.Value); + end if; + Handler.End_Object; + end Write_RenameClientCapabilities; + + procedure Write_DidChangeConfigurationParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DidChangeConfigurationParams) is + begin + Handler.Start_Object; + Handler.Key_Name ("settings"); + Write_LSPAny (Handler, Value.settings); + Handler.End_Object; + end Write_DidChangeConfigurationParams; + + procedure Write_DefinitionOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DefinitionOptions) is + begin + Handler.Start_Object; + if Value.workDoneProgress.Is_Set then + Handler.Key_Name ("workDoneProgress"); + Handler.Boolean_Value (Value.workDoneProgress.Value); + end if; + Handler.End_Object; + end Write_DefinitionOptions; + + procedure Write_Hover_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Hover_Or_Null) is + begin + if Value.Is_Null then + Handler.Null_Value; + else + Write_Hover (Handler, Value.Value); + end if; + end Write_Hover_Or_Null; + + procedure Write_InlayHintKind + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.InlayHintKind) is + begin + case Value is + when LSP.Enumerations.A_Type => + Handler.Integer_Value (1); + when LSP.Enumerations.Parameter => + Handler.Integer_Value (2); + end case; + end Write_InlayHintKind; + + procedure Write_symbolKind_OfWorkspaceSymbolClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.symbolKind_OfWorkspaceSymbolClientCapabilities) is + begin + Handler.Start_Object; + if (for some Item of Value.valueSet => Item) then + Handler.Key_Name ("valueSet"); + Write_SymbolKind_Set (Handler, Value.valueSet); + end if; + Handler.End_Object; + end Write_symbolKind_OfWorkspaceSymbolClientCapabilities; + + procedure Write_CallHierarchyOutgoingCall_Vector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CallHierarchyOutgoingCall_Vector_Or_Null) is + begin + if Value.Is_Empty then + Handler.Null_Value; + else + Write_CallHierarchyOutgoingCall_Vector (Handler, Value); + end if; + end Write_CallHierarchyOutgoingCall_Vector_Or_Null; + + procedure Write_FailureHandlingKind + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.FailureHandlingKind) is + begin + case Value is + when LSP.Enumerations.An_Abort => + Handler.String_Value ("abort"); + when LSP.Enumerations.Transactional => + Handler.String_Value ("transactional"); + when LSP.Enumerations.TextOnlyTransactional => + Handler.String_Value ("textOnlyTransactional"); + when LSP.Enumerations.Undo => + Handler.String_Value ("undo"); + end case; + end Write_FailureHandlingKind; + + procedure Write_FileOperationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.FileOperationOptions) is + begin + Handler.Start_Object; + if Value.didCreate.Is_Set then + Handler.Key_Name ("didCreate"); + Write_FileOperationRegistrationOptions + (Handler, Value.didCreate.Value); + end if; + if Value.willCreate.Is_Set then + Handler.Key_Name ("willCreate"); + Write_FileOperationRegistrationOptions + (Handler, Value.willCreate.Value); + end if; + if Value.didRename.Is_Set then + Handler.Key_Name ("didRename"); + Write_FileOperationRegistrationOptions + (Handler, Value.didRename.Value); + end if; + if Value.willRename.Is_Set then + Handler.Key_Name ("willRename"); + Write_FileOperationRegistrationOptions + (Handler, Value.willRename.Value); + end if; + if Value.didDelete.Is_Set then + Handler.Key_Name ("didDelete"); + Write_FileOperationRegistrationOptions + (Handler, Value.didDelete.Value); + end if; + if Value.willDelete.Is_Set then + Handler.Key_Name ("willDelete"); + Write_FileOperationRegistrationOptions + (Handler, Value.willDelete.Value); + end if; + Handler.End_Object; + end Write_FileOperationOptions; + + procedure Write_ShowDocumentResult + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ShowDocumentResult) is + begin + Handler.Start_Object; + Handler.Key_Name ("success"); + Handler.Boolean_Value (Value.success); + Handler.End_Object; + end Write_ShowDocumentResult; + + procedure Write_TypeDefinitionParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.TypeDefinitionParams) is + begin + Handler.Start_Object; + Handler.Key_Name ("textDocument"); + Write_TextDocumentIdentifier (Handler, Value.textDocument); + Handler.Key_Name ("position"); + Write_Position (Handler, Value.position); + if Value.workDoneToken.Is_Set then + Handler.Key_Name ("workDoneToken"); + Write_ProgressToken (Handler, Value.workDoneToken.Value); + end if; + if Value.partialResultToken.Is_Set then + Handler.Key_Name ("partialResultToken"); + Write_ProgressToken (Handler, Value.partialResultToken.Value); + end if; + Handler.End_Object; + end Write_TypeDefinitionParams; + + procedure Write_DocumentSelector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSelector) is + procedure Write_Virtual_String_Or_DocumentFilter + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Virtual_String_Or_DocumentFilter); + + procedure Write_Virtual_String_Or_DocumentFilter + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Virtual_String_Or_DocumentFilter) is + begin + case Value.Is_Virtual_String is + when True => + Handler.String_Value (Value.Virtual_String); + when False => + Write_DocumentFilter (Handler, Value.DocumentFilter); + end case; + end Write_Virtual_String_Or_DocumentFilter; + + begin + Handler.Start_Array; + for J in Value.First_Index .. Value.Last_Index loop + Write_Virtual_String_Or_DocumentFilter (Handler, Value (J)); + end loop; + Handler.End_Array; + end Write_DocumentSelector; + + procedure Write_CompletionClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CompletionClientCapabilities) is + procedure Write_CompletionItemKind_Set + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CompletionItemKind_Set); + + procedure Write_completionItem_OfCompletionClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.completionItem_OfCompletionClientCapabilities); + + procedure Write_completionList_OfCompletionClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.completionList_OfCompletionClientCapabilities); + + procedure Write_tagSupport_OfcompletionItem_OfCompletionClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures + .tagSupport_OfcompletionItem_OfCompletionClientCapabilities); + + procedure Write_InsertTextMode_Set + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.InsertTextMode_Set); + + procedure Write_completionItemKind_OfCompletionClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures + .completionItemKind_OfCompletionClientCapabilities); + + procedure Write_insertTextModeSupport_OfcompletionItem_OfCompletionClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures + .insertTextModeSupport_OfcompletionItem_OfCompletionClientCapabilities); + + procedure Write_CompletionItemKind_Set + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CompletionItemKind_Set) is + begin + Handler.Start_Array; + declare + Set : LSP.Structures.CompletionItemKind_Set renames Value; + begin + for Value in Set'Range loop + if Set (Value) then + Write_CompletionItemKind (Handler, Value); + end if; + end loop; + end; + Handler.End_Array; + end Write_CompletionItemKind_Set; + + procedure Write_completionItem_OfCompletionClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures + .completionItem_OfCompletionClientCapabilities) is + begin + Handler.Start_Object; + if Value.snippetSupport.Is_Set then + Handler.Key_Name ("snippetSupport"); + Handler.Boolean_Value (Value.snippetSupport.Value); + end if; + if Value.commitCharactersSupport.Is_Set then + Handler.Key_Name ("commitCharactersSupport"); + Handler.Boolean_Value (Value.commitCharactersSupport.Value); + end if; + if not Value.documentationFormat.Is_Empty then + Handler.Key_Name ("documentationFormat"); + Write_MarkupKind_Vector (Handler, Value.documentationFormat); + end if; + if Value.deprecatedSupport.Is_Set then + Handler.Key_Name ("deprecatedSupport"); + Handler.Boolean_Value (Value.deprecatedSupport.Value); + end if; + if Value.preselectSupport.Is_Set then + Handler.Key_Name ("preselectSupport"); + Handler.Boolean_Value (Value.preselectSupport.Value); + end if; + if Value.tagSupport.Is_Set then + Handler.Key_Name ("tagSupport"); + Write_tagSupport_OfcompletionItem_OfCompletionClientCapabilities + (Handler, Value.tagSupport.Value); + end if; + if Value.insertReplaceSupport.Is_Set then + Handler.Key_Name ("insertReplaceSupport"); + Handler.Boolean_Value (Value.insertReplaceSupport.Value); + end if; + if Value.resolveSupport.Is_Set then + Handler.Key_Name ("resolveSupport"); + Write_resolveSupport_OfWorkspaceSymbolClientCapabilities + (Handler, Value.resolveSupport.Value); + end if; + if Value.insertTextModeSupport.Is_Set then + Handler.Key_Name ("insertTextModeSupport"); + Write_insertTextModeSupport_OfcompletionItem_OfCompletionClientCapabilities + (Handler, Value.insertTextModeSupport.Value); + end if; + if Value.labelDetailsSupport.Is_Set then + Handler.Key_Name ("labelDetailsSupport"); + Handler.Boolean_Value (Value.labelDetailsSupport.Value); + end if; + Handler.End_Object; + end Write_completionItem_OfCompletionClientCapabilities; + + procedure Write_completionList_OfCompletionClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures + .completionList_OfCompletionClientCapabilities) is + begin + Handler.Start_Object; + if not Value.itemDefaults.Is_Empty then + Handler.Key_Name ("itemDefaults"); + Write_Virtual_String_Vector (Handler, Value.itemDefaults); + end if; + Handler.End_Object; + end Write_completionList_OfCompletionClientCapabilities; + + procedure Write_tagSupport_OfcompletionItem_OfCompletionClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures + .tagSupport_OfcompletionItem_OfCompletionClientCapabilities) is + begin + Handler.Start_Object; + Handler.Key_Name ("valueSet"); + Write_CompletionItemTag_Set (Handler, Value.valueSet); + Handler.End_Object; + end Write_tagSupport_OfcompletionItem_OfCompletionClientCapabilities; + + procedure Write_InsertTextMode_Set + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.InsertTextMode_Set) is + begin + Handler.Start_Array; + declare + Set : LSP.Structures.InsertTextMode_Set renames Value; + begin + for Value in Set'Range loop + if Set (Value) then + Write_InsertTextMode (Handler, Value); + end if; + end loop; + end; + Handler.End_Array; + end Write_InsertTextMode_Set; + + procedure Write_completionItemKind_OfCompletionClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures + .completionItemKind_OfCompletionClientCapabilities) is + begin + Handler.Start_Object; + if (for some Item of Value.valueSet => Item) then + Handler.Key_Name ("valueSet"); + Write_CompletionItemKind_Set (Handler, Value.valueSet); + end if; + Handler.End_Object; + end Write_completionItemKind_OfCompletionClientCapabilities; + + procedure Write_insertTextModeSupport_OfcompletionItem_OfCompletionClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures + .insertTextModeSupport_OfcompletionItem_OfCompletionClientCapabilities) is + begin + Handler.Start_Object; + Handler.Key_Name ("valueSet"); + Write_InsertTextMode_Set (Handler, Value.valueSet); + Handler.End_Object; + end Write_insertTextModeSupport_OfcompletionItem_OfCompletionClientCapabilities; + + begin + Handler.Start_Object; + if Value.dynamicRegistration.Is_Set then + Handler.Key_Name ("dynamicRegistration"); + Handler.Boolean_Value (Value.dynamicRegistration.Value); + end if; + if Value.completionItem.Is_Set then + Handler.Key_Name ("completionItem"); + Write_completionItem_OfCompletionClientCapabilities + (Handler, Value.completionItem.Value); + end if; + if Value.completionItemKind.Is_Set then + Handler.Key_Name ("completionItemKind"); + Write_completionItemKind_OfCompletionClientCapabilities + (Handler, Value.completionItemKind.Value); + end if; + if Value.insertTextMode.Is_Set then + Handler.Key_Name ("insertTextMode"); + Write_InsertTextMode (Handler, Value.insertTextMode.Value); + end if; + if Value.contextSupport.Is_Set then + Handler.Key_Name ("contextSupport"); + Handler.Boolean_Value (Value.contextSupport.Value); + end if; + if Value.completionList.Is_Set then + Handler.Key_Name ("completionList"); + Write_completionList_OfCompletionClientCapabilities + (Handler, Value.completionList.Value); + end if; + Handler.End_Object; + end Write_CompletionClientCapabilities; + + procedure Write_CodeLensWorkspaceClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CodeLensWorkspaceClientCapabilities) is + begin + Handler.Start_Object; + if Value.refreshSupport.Is_Set then + Handler.Key_Name ("refreshSupport"); + Handler.Boolean_Value (Value.refreshSupport.Value); + end if; + Handler.End_Object; + end Write_CodeLensWorkspaceClientCapabilities; + + procedure Write_RenameOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.RenameOptions) is + begin + Handler.Start_Object; + if Value.workDoneProgress.Is_Set then + Handler.Key_Name ("workDoneProgress"); + Handler.Boolean_Value (Value.workDoneProgress.Value); + end if; + if Value.prepareProvider.Is_Set then + Handler.Key_Name ("prepareProvider"); + Handler.Boolean_Value (Value.prepareProvider.Value); + end if; + Handler.End_Object; + end Write_RenameOptions; + + procedure Write_SymbolKind_Set + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SymbolKind_Set) is + begin + Handler.Start_Array; + declare + Set : LSP.Structures.SymbolKind_Set renames Value; + begin + for Value in Set'Range loop + if Set (Value) then + Write_SymbolKind (Handler, Value); + end if; + end loop; + end; + Handler.End_Array; + end Write_SymbolKind_Set; + + procedure Write_DidChangeConfigurationClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DidChangeConfigurationClientCapabilities) is + begin + Handler.Start_Object; + if Value.dynamicRegistration.Is_Set then + Handler.Key_Name ("dynamicRegistration"); + Handler.Boolean_Value (Value.dynamicRegistration.Value); + end if; + Handler.End_Object; + end Write_DidChangeConfigurationClientCapabilities; + + procedure Write_DocumentHighlightRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentHighlightRegistrationOptions) is + procedure Write_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSelector_Or_Null); + + procedure Write_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSelector_Or_Null) is + begin + if Value.Is_Null then + Handler.Null_Value; + else + Write_DocumentSelector (Handler, Value.Value); + end if; + end Write_DocumentSelector_Or_Null; + + begin + Handler.Start_Object; + Handler.Key_Name ("documentSelector"); + Write_DocumentSelector_Or_Null (Handler, Value.Parent.documentSelector); + if Value.workDoneProgress.Is_Set then + Handler.Key_Name ("workDoneProgress"); + Handler.Boolean_Value (Value.workDoneProgress.Value); + end if; + Handler.End_Object; + end Write_DocumentHighlightRegistrationOptions; + + procedure Write_DeclarationLink + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DeclarationLink) renames + Write_LocationLink; + + procedure Write_T + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.T) is + begin + Handler.Start_Object; + null; + Handler.End_Object; + end Write_T; + + procedure Write_FullDocumentDiagnosticReport + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.FullDocumentDiagnosticReport) is + begin + Handler.Start_Object; + Handler.Key_Name ("kind"); + Handler.String_Value ("full"); + if not Value.resultId.Is_Null then + Handler.Key_Name ("resultId"); + Handler.String_Value (Value.resultId); + end if; + Handler.Key_Name ("items"); + Write_Diagnostic_Vector (Handler, Value.items); + Handler.End_Object; + end Write_FullDocumentDiagnosticReport; + + procedure Write_RenameParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.RenameParams) is + begin + Handler.Start_Object; + if Value.workDoneToken.Is_Set then + Handler.Key_Name ("workDoneToken"); + Write_ProgressToken (Handler, Value.workDoneToken.Value); + end if; + Handler.Key_Name ("textDocument"); + Write_TextDocumentIdentifier (Handler, Value.textDocument); + Handler.Key_Name ("position"); + Write_Position (Handler, Value.position); + Handler.Key_Name ("newName"); + Handler.String_Value (Value.newName); + Handler.End_Object; + end Write_RenameParams; + + procedure Write_DocumentSymbolRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSymbolRegistrationOptions) is + procedure Write_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSelector_Or_Null); + + procedure Write_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSelector_Or_Null) is + begin + if Value.Is_Null then + Handler.Null_Value; + else + Write_DocumentSelector (Handler, Value.Value); + end if; + end Write_DocumentSelector_Or_Null; + + begin + Handler.Start_Object; + Handler.Key_Name ("documentSelector"); + Write_DocumentSelector_Or_Null (Handler, Value.Parent.documentSelector); + if Value.workDoneProgress.Is_Set then + Handler.Key_Name ("workDoneProgress"); + Handler.Boolean_Value (Value.workDoneProgress.Value); + end if; + if not Value.label.Is_Null then + Handler.Key_Name ("label"); + Handler.String_Value (Value.label); + end if; + Handler.End_Object; + end Write_DocumentSymbolRegistrationOptions; + + procedure Write_LSPAny_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.LSPAny_Or_Null) is + begin + if Value.Is_Null then + Handler.Null_Value; + else + Write_LSPAny (Handler, Value.Value); + end if; + end Write_LSPAny_Or_Null; + + procedure Write_DeclarationRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DeclarationRegistrationOptions) is + procedure Write_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSelector_Or_Null); + + procedure Write_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSelector_Or_Null) is + begin + if Value.Is_Null then + Handler.Null_Value; + else + Write_DocumentSelector (Handler, Value.Value); + end if; + end Write_DocumentSelector_Or_Null; + + begin + Handler.Start_Object; + if Value.workDoneProgress.Is_Set then + Handler.Key_Name ("workDoneProgress"); + Handler.Boolean_Value (Value.workDoneProgress.Value); + end if; + Handler.Key_Name ("documentSelector"); + Write_DocumentSelector_Or_Null (Handler, Value.Parent.documentSelector); + if not Value.id.Is_Null then + Handler.Key_Name ("id"); + Handler.String_Value (Value.id); + end if; + Handler.End_Object; + end Write_DeclarationRegistrationOptions; + + procedure Write_WorkspaceSymbol + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.WorkspaceSymbol) is + procedure Write_Location_Or_Something + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Location_Or_Something); + + procedure Write_Location_Or_Something + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Location_Or_Something) is + begin + case Value.Is_Location is + when True => + Write_Location (Handler, Value.Location); + when False => + Handler.Start_Object; + Handler.Key_Name ("uri"); + Handler.String_Value (Value.uri); + Handler.End_Object; + end case; + end Write_Location_Or_Something; + + begin + Handler.Start_Object; + Handler.Key_Name ("name"); + Handler.String_Value (Value.name); + Handler.Key_Name ("kind"); + Write_SymbolKind (Handler, Value.kind); + if (for some Item of Value.tags => Item) then + Handler.Key_Name ("tags"); + Write_SymbolTag_Set (Handler, Value.tags); + end if; + if not Value.containerName.Is_Null then + Handler.Key_Name ("containerName"); + Handler.String_Value (Value.containerName); + end if; + Handler.Key_Name ("location"); + Write_Location_Or_Something (Handler, Value.location); + if not Value.data.Is_Empty then + Handler.Key_Name ("data"); + Write_LSPAny (Handler, Value.data); + end if; + Handler.End_Object; + end Write_WorkspaceSymbol; + + procedure Write_DeleteFileOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DeleteFileOptions) is + begin + Handler.Start_Object; + if Value.recursive.Is_Set then + Handler.Key_Name ("recursive"); + Handler.Boolean_Value (Value.recursive.Value); + end if; + if Value.ignoreIfNotExists.Is_Set then + Handler.Key_Name ("ignoreIfNotExists"); + Handler.Boolean_Value (Value.ignoreIfNotExists.Value); + end if; + Handler.End_Object; + end Write_DeleteFileOptions; + + procedure Write_WatchKind + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.WatchKind) is + begin + case Value is + when LSP.Enumerations.Create => + Handler.Integer_Value (1); + when LSP.Enumerations.Change => + Handler.Integer_Value (2); + when LSP.Enumerations.Delete => + Handler.Integer_Value (4); + end case; + end Write_WatchKind; + + procedure Write_TypeHierarchyRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.TypeHierarchyRegistrationOptions) is + procedure Write_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSelector_Or_Null); + + procedure Write_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSelector_Or_Null) is + begin + if Value.Is_Null then + Handler.Null_Value; + else + Write_DocumentSelector (Handler, Value.Value); + end if; + end Write_DocumentSelector_Or_Null; + + begin + Handler.Start_Object; + Handler.Key_Name ("documentSelector"); + Write_DocumentSelector_Or_Null (Handler, Value.Parent.documentSelector); + if Value.workDoneProgress.Is_Set then + Handler.Key_Name ("workDoneProgress"); + Handler.Boolean_Value (Value.workDoneProgress.Value); + end if; + if not Value.id.Is_Null then + Handler.Key_Name ("id"); + Handler.String_Value (Value.id); + end if; + Handler.End_Object; + end Write_TypeHierarchyRegistrationOptions; + + procedure Write_DiagnosticSeverity + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.DiagnosticSeverity) is + begin + case Value is + when LSP.Enumerations.Error => + Handler.Integer_Value (1); + when LSP.Enumerations.Warning => + Handler.Integer_Value (2); + when LSP.Enumerations.Information => + Handler.Integer_Value (3); + when LSP.Enumerations.Hint => + Handler.Integer_Value (4); + end case; + end Write_DiagnosticSeverity; + + procedure Write_LSPAny_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.LSPAny_Vector) renames + LSP.Output_Tools.Write_LSPAny; + + procedure Write_PrepareRenameParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.PrepareRenameParams) is + begin + Handler.Start_Object; + Handler.Key_Name ("textDocument"); + Write_TextDocumentIdentifier (Handler, Value.textDocument); + Handler.Key_Name ("position"); + Write_Position (Handler, Value.position); + if Value.workDoneToken.Is_Set then + Handler.Key_Name ("workDoneToken"); + Write_ProgressToken (Handler, Value.workDoneToken.Value); + end if; + Handler.End_Object; + end Write_PrepareRenameParams; + + procedure Write_CodeActionTriggerKind + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.CodeActionTriggerKind) is + begin + case Value is + when LSP.Enumerations.Invoked => + Handler.Integer_Value (1); + when LSP.Enumerations.Automatic => + Handler.Integer_Value (2); + end case; + end Write_CodeActionTriggerKind; + + procedure Write_CodeActionClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CodeActionClientCapabilities) is + procedure Write_codeActionKind_OfcodeActionLiteralSupport_OfCodeActionClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures + .codeActionKind_OfcodeActionLiteralSupport_OfCodeActionClientCapabilities); + + procedure Write_codeActionLiteralSupport_OfCodeActionClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures + .codeActionLiteralSupport_OfCodeActionClientCapabilities); + + procedure Write_codeActionKind_OfcodeActionLiteralSupport_OfCodeActionClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures + .codeActionKind_OfcodeActionLiteralSupport_OfCodeActionClientCapabilities) is + begin + Handler.Start_Object; + Handler.Key_Name ("valueSet"); + Write_CodeActionKind_Set (Handler, Value.valueSet); + Handler.End_Object; + end Write_codeActionKind_OfcodeActionLiteralSupport_OfCodeActionClientCapabilities; + + procedure Write_codeActionLiteralSupport_OfCodeActionClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures + .codeActionLiteralSupport_OfCodeActionClientCapabilities) is + begin + Handler.Start_Object; + Handler.Key_Name ("codeActionKind"); + Write_codeActionKind_OfcodeActionLiteralSupport_OfCodeActionClientCapabilities + (Handler, Value.codeActionKind); + Handler.End_Object; + end Write_codeActionLiteralSupport_OfCodeActionClientCapabilities; + + begin + Handler.Start_Object; + if Value.dynamicRegistration.Is_Set then + Handler.Key_Name ("dynamicRegistration"); + Handler.Boolean_Value (Value.dynamicRegistration.Value); + end if; + if Value.codeActionLiteralSupport.Is_Set then + Handler.Key_Name ("codeActionLiteralSupport"); + Write_codeActionLiteralSupport_OfCodeActionClientCapabilities + (Handler, Value.codeActionLiteralSupport.Value); + end if; + if Value.isPreferredSupport.Is_Set then + Handler.Key_Name ("isPreferredSupport"); + Handler.Boolean_Value (Value.isPreferredSupport.Value); + end if; + if Value.disabledSupport.Is_Set then + Handler.Key_Name ("disabledSupport"); + Handler.Boolean_Value (Value.disabledSupport.Value); + end if; + if Value.dataSupport.Is_Set then + Handler.Key_Name ("dataSupport"); + Handler.Boolean_Value (Value.dataSupport.Value); + end if; + if Value.resolveSupport.Is_Set then + Handler.Key_Name ("resolveSupport"); + Write_resolveSupport_OfWorkspaceSymbolClientCapabilities + (Handler, Value.resolveSupport.Value); + end if; + if Value.honorsChangeAnnotations.Is_Set then + Handler.Key_Name ("honorsChangeAnnotations"); + Handler.Boolean_Value (Value.honorsChangeAnnotations.Value); + end if; + Handler.End_Object; + end Write_CodeActionClientCapabilities; + + procedure Write_MarkdownClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.MarkdownClientCapabilities) is + begin + Handler.Start_Object; + Handler.Key_Name ("parser"); + Handler.String_Value (Value.parser); + if not Value.version.Is_Null then + Handler.Key_Name ("version"); + Handler.String_Value (Value.version); + end if; + if not Value.allowedTags.Is_Empty then + Handler.Key_Name ("allowedTags"); + Write_Virtual_String_Vector (Handler, Value.allowedTags); + end if; + Handler.End_Object; + end Write_MarkdownClientCapabilities; + + procedure Write_CancelParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CancelParams) is + begin + Handler.Start_Object; + Handler.Key_Name ("id"); + Write_Integer_Or_Virtual_String (Handler, Value.id); + Handler.End_Object; + end Write_CancelParams; + + procedure Write_DefinitionLink_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DefinitionLink_Vector) is + begin + Handler.Start_Array; + for J in Value.First_Index .. Value.Last_Index loop + Write_DefinitionLink (Handler, Value (J)); + end loop; + Handler.End_Array; + end Write_DefinitionLink_Vector; + + procedure Write_DefinitionParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DefinitionParams) is + begin + Handler.Start_Object; + Handler.Key_Name ("textDocument"); + Write_TextDocumentIdentifier (Handler, Value.textDocument); + Handler.Key_Name ("position"); + Write_Position (Handler, Value.position); + if Value.workDoneToken.Is_Set then + Handler.Key_Name ("workDoneToken"); + Write_ProgressToken (Handler, Value.workDoneToken.Value); + end if; + if Value.partialResultToken.Is_Set then + Handler.Key_Name ("partialResultToken"); + Write_ProgressToken (Handler, Value.partialResultToken.Value); + end if; + Handler.End_Object; + end Write_DefinitionParams; + + procedure Write_ImplementationClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ImplementationClientCapabilities) is + begin + Handler.Start_Object; + if Value.dynamicRegistration.Is_Set then + Handler.Key_Name ("dynamicRegistration"); + Handler.Boolean_Value (Value.dynamicRegistration.Value); + end if; + if Value.linkSupport.Is_Set then + Handler.Key_Name ("linkSupport"); + Handler.Boolean_Value (Value.linkSupport.Value); + end if; + Handler.End_Object; + end Write_ImplementationClientCapabilities; + + procedure Write_TextDocumentItem + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.TextDocumentItem) is + begin + Handler.Start_Object; + Handler.Key_Name ("uri"); + Handler.String_Value (Value.uri); + Handler.Key_Name ("languageId"); + Handler.String_Value (Value.languageId); + Handler.Key_Name ("version"); + Handler.Integer_Value (Integer'Pos (Value.version)); + Handler.Key_Name ("text"); + Handler.String_Value (Value.text); + Handler.End_Object; + end Write_TextDocumentItem; + + procedure Write_ColorPresentationParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ColorPresentationParams) is + begin + Handler.Start_Object; + if Value.workDoneToken.Is_Set then + Handler.Key_Name ("workDoneToken"); + Write_ProgressToken (Handler, Value.workDoneToken.Value); + end if; + if Value.partialResultToken.Is_Set then + Handler.Key_Name ("partialResultToken"); + Write_ProgressToken (Handler, Value.partialResultToken.Value); + end if; + Handler.Key_Name ("textDocument"); + Write_TextDocumentIdentifier (Handler, Value.textDocument); + Handler.Key_Name ("color"); + Write_Color (Handler, Value.color); + Handler.Key_Name ("range"); + Write_A_Range (Handler, Value.a_range); + Handler.End_Object; + end Write_ColorPresentationParams; + + procedure Write_ErrorCodes + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.ErrorCodes) is + begin + case Value is + when LSP.Enumerations.ParseError => + Handler.Integer_Value (-32_700); + when LSP.Enumerations.InvalidRequest => + Handler.Integer_Value (-32_600); + when LSP.Enumerations.MethodNotFound => + Handler.Integer_Value (-32_601); + when LSP.Enumerations.InvalidParams => + Handler.Integer_Value (-32_602); + when LSP.Enumerations.InternalError => + Handler.Integer_Value (-32_603); + when LSP.Enumerations.jsonrpcReservedErrorRangeStart => + Handler.Integer_Value (-32_099); + when LSP.Enumerations.serverErrorStart => + Handler.Integer_Value (-32_099); + when LSP.Enumerations.ServerNotInitialized => + Handler.Integer_Value (-32_002); + when LSP.Enumerations.UnknownErrorCode => + Handler.Integer_Value (-32_001); + when LSP.Enumerations.jsonrpcReservedErrorRangeEnd => + Handler.Integer_Value (-32_000); + when LSP.Enumerations.serverErrorEnd => + Handler.Integer_Value (-32_000); + end case; + end Write_ErrorCodes; + + procedure Write_InsertTextFormat + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.InsertTextFormat) is + begin + case Value is + when LSP.Enumerations.PlainText => + Handler.Integer_Value (1); + when LSP.Enumerations.Snippet => + Handler.Integer_Value (2); + end case; + end Write_InsertTextFormat; + + procedure Write_relatedDocuments_OfDocumentDiagnosticReportPartialResult_Item + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures + .relatedDocuments_OfDocumentDiagnosticReportPartialResult_Item) is + begin + case Value.Kind is + when LSP.Structures.full => + Write_FullDocumentDiagnosticReport (Handler, Value.full); + when LSP.Structures.unchanged => + Write_UnchangedDocumentDiagnosticReport (Handler, Value.unchanged); + end case; + end Write_relatedDocuments_OfDocumentDiagnosticReportPartialResult_Item; + + procedure Write_ExecuteCommandClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ExecuteCommandClientCapabilities) is + begin + Handler.Start_Object; + if Value.dynamicRegistration.Is_Set then + Handler.Key_Name ("dynamicRegistration"); + Handler.Boolean_Value (Value.dynamicRegistration.Value); + end if; + Handler.End_Object; + end Write_ExecuteCommandClientCapabilities; + + procedure Write_FoldingRange_Vector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.FoldingRange_Vector_Or_Null) is + begin + if Value.Is_Empty then + Handler.Null_Value; + else + Write_FoldingRange_Vector (Handler, Value); + end if; + end Write_FoldingRange_Vector_Or_Null; + + procedure Write_CallHierarchyItem_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CallHierarchyItem_Vector) is + begin + Handler.Start_Array; + for J in Value.First_Index .. Value.Last_Index loop + Write_CallHierarchyItem (Handler, Value (J)); + end loop; + Handler.End_Array; + end Write_CallHierarchyItem_Vector; + + procedure Write_DeleteFile + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DeleteFile) is + begin + Handler.Start_Object; + Handler.Key_Name ("kind"); + Handler.String_Value ("delete"); + if Value.annotationId.Is_Set then + Handler.Key_Name ("annotationId"); + Write_ChangeAnnotationIdentifier (Handler, Value.annotationId.Value); + end if; + Handler.Key_Name ("uri"); + Handler.String_Value (Value.uri); + if Value.options.Is_Set then + Handler.Key_Name ("options"); + Write_DeleteFileOptions (Handler, Value.options.Value); + end if; + Handler.End_Object; + end Write_DeleteFile; + + procedure Write_SaveOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SaveOptions) is + begin + Handler.Start_Object; + if Value.includeText.Is_Set then + Handler.Key_Name ("includeText"); + Handler.Boolean_Value (Value.includeText.Value); + end if; + Handler.End_Object; + end Write_SaveOptions; + + procedure Write_NotebookDocument + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.NotebookDocument) is + begin + Handler.Start_Object; + Handler.Key_Name ("uri"); + Write_URI (Handler, Value.uri); + Handler.Key_Name ("notebookType"); + Handler.String_Value (Value.notebookType); + Handler.Key_Name ("version"); + Handler.Integer_Value (Integer'Pos (Value.version)); + if Value.metadata.Is_Set then + Handler.Key_Name ("metadata"); + Write_LSPObject (Handler, Value.metadata.Value); + end if; + Handler.Key_Name ("cells"); + Write_NotebookCell_Vector (Handler, Value.cells); + Handler.End_Object; + end Write_NotebookDocument; + + procedure Write_RelatedFullDocumentDiagnosticReport + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.RelatedFullDocumentDiagnosticReport) is + begin + Handler.Start_Object; + Handler.Key_Name ("kind"); + Handler.String_Value ("full"); + if not Value.resultId.Is_Null then + Handler.Key_Name ("resultId"); + Handler.String_Value (Value.resultId); + end if; + Handler.Key_Name ("items"); + Write_Diagnostic_Vector (Handler, Value.items); + if not Value.relatedDocuments.Is_Empty then + Handler.Key_Name ("relatedDocuments"); + declare + use + LSP.Structures + .relatedDocuments_OfDocumentDiagnosticReportPartialResult_Item_Maps; + begin + Handler.Start_Object; + for Cursor in Value.relatedDocuments.Iterate loop + Handler.Key_Name (Key (Cursor)); + Write_relatedDocuments_OfDocumentDiagnosticReportPartialResult_Item + (Handler, Value.relatedDocuments (Cursor)); + end loop; + Handler.End_Object; + end; + end if; + Handler.End_Object; + end Write_RelatedFullDocumentDiagnosticReport; + + procedure Write_CodeLensClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CodeLensClientCapabilities) is + begin + Handler.Start_Object; + if Value.dynamicRegistration.Is_Set then + Handler.Key_Name ("dynamicRegistration"); + Handler.Boolean_Value (Value.dynamicRegistration.Value); + end if; + Handler.End_Object; + end Write_CodeLensClientCapabilities; + + procedure Write_DocumentSymbolOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSymbolOptions) is + begin + Handler.Start_Object; + if Value.workDoneProgress.Is_Set then + Handler.Key_Name ("workDoneProgress"); + Handler.Boolean_Value (Value.workDoneProgress.Value); + end if; + if not Value.label.Is_Null then + Handler.Key_Name ("label"); + Handler.String_Value (Value.label); + end if; + Handler.End_Object; + end Write_DocumentSymbolOptions; + + procedure Write_CompletionRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CompletionRegistrationOptions) is + procedure Write_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSelector_Or_Null); + + procedure Write_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSelector_Or_Null) is + begin + if Value.Is_Null then + Handler.Null_Value; + else + Write_DocumentSelector (Handler, Value.Value); + end if; + end Write_DocumentSelector_Or_Null; + + procedure Write_completionItem_OfCompletionOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.completionItem_OfCompletionOptions); + + procedure Write_completionItem_OfCompletionOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.completionItem_OfCompletionOptions) is + begin + Handler.Start_Object; + if Value.labelDetailsSupport.Is_Set then + Handler.Key_Name ("labelDetailsSupport"); + Handler.Boolean_Value (Value.labelDetailsSupport.Value); + end if; + Handler.End_Object; + end Write_completionItem_OfCompletionOptions; + + begin + Handler.Start_Object; + Handler.Key_Name ("documentSelector"); + Write_DocumentSelector_Or_Null (Handler, Value.Parent.documentSelector); + if Value.workDoneProgress.Is_Set then + Handler.Key_Name ("workDoneProgress"); + Handler.Boolean_Value (Value.workDoneProgress.Value); + end if; + if not Value.triggerCharacters.Is_Empty then + Handler.Key_Name ("triggerCharacters"); + Write_Virtual_String_Vector (Handler, Value.triggerCharacters); + end if; + if not Value.allCommitCharacters.Is_Empty then + Handler.Key_Name ("allCommitCharacters"); + Write_Virtual_String_Vector (Handler, Value.allCommitCharacters); + end if; + if Value.resolveProvider.Is_Set then + Handler.Key_Name ("resolveProvider"); + Handler.Boolean_Value (Value.resolveProvider.Value); + end if; + if Value.completionItem.Is_Set then + Handler.Key_Name ("completionItem"); + Write_completionItem_OfCompletionOptions + (Handler, Value.completionItem.Value); + end if; + Handler.End_Object; + end Write_CompletionRegistrationOptions; + + procedure Write_InlayHintClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.InlayHintClientCapabilities) is + begin + Handler.Start_Object; + if Value.dynamicRegistration.Is_Set then + Handler.Key_Name ("dynamicRegistration"); + Handler.Boolean_Value (Value.dynamicRegistration.Value); + end if; + if Value.resolveSupport.Is_Set then + Handler.Key_Name ("resolveSupport"); + Write_resolveSupport_OfWorkspaceSymbolClientCapabilities + (Handler, Value.resolveSupport.Value); + end if; + Handler.End_Object; + end Write_InlayHintClientCapabilities; + + procedure Write_ReferenceContext + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ReferenceContext) is + begin + Handler.Start_Object; + Handler.Key_Name ("includeDeclaration"); + Handler.Boolean_Value (Value.includeDeclaration); + Handler.End_Object; + end Write_ReferenceContext; + + procedure Write_WorkspaceEditClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.WorkspaceEditClientCapabilities) is + procedure Write_ResourceOperationKind_Set + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ResourceOperationKind_Set); + + procedure Write_changeAnnotationSupport_OfWorkspaceEditClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures + .changeAnnotationSupport_OfWorkspaceEditClientCapabilities); + + procedure Write_ResourceOperationKind_Set + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ResourceOperationKind_Set) is + begin + Handler.Start_Array; + declare + Set : LSP.Structures.ResourceOperationKind_Set renames Value; + begin + for Value in Set'Range loop + if Set (Value) then + Write_ResourceOperationKind (Handler, Value); + end if; + end loop; + end; + Handler.End_Array; + end Write_ResourceOperationKind_Set; + + procedure Write_changeAnnotationSupport_OfWorkspaceEditClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures + .changeAnnotationSupport_OfWorkspaceEditClientCapabilities) is + begin + Handler.Start_Object; + if Value.groupsOnLabel.Is_Set then + Handler.Key_Name ("groupsOnLabel"); + Handler.Boolean_Value (Value.groupsOnLabel.Value); + end if; + Handler.End_Object; + end Write_changeAnnotationSupport_OfWorkspaceEditClientCapabilities; + + begin + Handler.Start_Object; + if Value.documentChanges.Is_Set then + Handler.Key_Name ("documentChanges"); + Handler.Boolean_Value (Value.documentChanges.Value); + end if; + if (for some Item of Value.resourceOperations => Item) then + Handler.Key_Name ("resourceOperations"); + Write_ResourceOperationKind_Set (Handler, Value.resourceOperations); + end if; + if Value.failureHandling.Is_Set then + Handler.Key_Name ("failureHandling"); + Write_FailureHandlingKind (Handler, Value.failureHandling.Value); + end if; + if Value.normalizesLineEndings.Is_Set then + Handler.Key_Name ("normalizesLineEndings"); + Handler.Boolean_Value (Value.normalizesLineEndings.Value); + end if; + if Value.changeAnnotationSupport.Is_Set then + Handler.Key_Name ("changeAnnotationSupport"); + Write_changeAnnotationSupport_OfWorkspaceEditClientCapabilities + (Handler, Value.changeAnnotationSupport.Value); + end if; + Handler.End_Object; + end Write_WorkspaceEditClientCapabilities; + + procedure Write_WorkspaceSymbolOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.WorkspaceSymbolOptions) is + begin + Handler.Start_Object; + if Value.workDoneProgress.Is_Set then + Handler.Key_Name ("workDoneProgress"); + Handler.Boolean_Value (Value.workDoneProgress.Value); + end if; + if Value.resolveProvider.Is_Set then + Handler.Key_Name ("resolveProvider"); + Handler.Boolean_Value (Value.resolveProvider.Value); + end if; + Handler.End_Object; + end Write_WorkspaceSymbolOptions; + + procedure Write_MessageActionItem_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.MessageActionItem_Or_Null) is + begin + if Value.Is_Null then + Handler.Null_Value; + else + Write_MessageActionItem (Handler, Value.Value); + end if; + end Write_MessageActionItem_Or_Null; + + procedure Write_ChangeAnnotation + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ChangeAnnotation) is + begin + Handler.Start_Object; + Handler.Key_Name ("label"); + Handler.String_Value (Value.label); + if Value.needsConfirmation.Is_Set then + Handler.Key_Name ("needsConfirmation"); + Handler.Boolean_Value (Value.needsConfirmation.Value); + end if; + if not Value.description.Is_Null then + Handler.Key_Name ("description"); + Handler.String_Value (Value.description); + end if; + Handler.End_Object; + end Write_ChangeAnnotation; + + procedure Write_FileOperationPatternOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.FileOperationPatternOptions) is + begin + Handler.Start_Object; + if Value.ignoreCase.Is_Set then + Handler.Key_Name ("ignoreCase"); + Handler.Boolean_Value (Value.ignoreCase.Value); + end if; + Handler.End_Object; + end Write_FileOperationPatternOptions; + + procedure Write_VersionedTextDocumentIdentifier + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.VersionedTextDocumentIdentifier) is + begin + Handler.Start_Object; + Handler.Key_Name ("uri"); + Handler.String_Value (Value.uri); + Handler.Key_Name ("version"); + Handler.Integer_Value (Integer'Pos (Value.version)); + Handler.End_Object; + end Write_VersionedTextDocumentIdentifier; + + procedure Write_SemanticTokensDelta + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SemanticTokensDelta) is + begin + Handler.Start_Object; + if not Value.resultId.Is_Null then + Handler.Key_Name ("resultId"); + Handler.String_Value (Value.resultId); + end if; + Handler.Key_Name ("edits"); + Write_SemanticTokensEdit_Vector (Handler, Value.edits); + Handler.End_Object; + end Write_SemanticTokensDelta; + + procedure Write_ShowDocumentClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ShowDocumentClientCapabilities) is + begin + Handler.Start_Object; + Handler.Key_Name ("support"); + Handler.Boolean_Value (Value.support); + Handler.End_Object; + end Write_ShowDocumentClientCapabilities; + + procedure Write_ApplyWorkspaceEditParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ApplyWorkspaceEditParams) is + begin + Handler.Start_Object; + if not Value.label.Is_Null then + Handler.Key_Name ("label"); + Handler.String_Value (Value.label); + end if; + Handler.Key_Name ("edit"); + Write_WorkspaceEdit (Handler, Value.edit); + Handler.End_Object; + end Write_ApplyWorkspaceEditParams; + + procedure Write_InlayHintLabelPart + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.InlayHintLabelPart) is + begin + Handler.Start_Object; + Handler.Key_Name ("value"); + Handler.String_Value (Value.value); + if Value.tooltip.Is_Set then + Handler.Key_Name ("tooltip"); + Write_Virtual_String_Or_MarkupContent (Handler, Value.tooltip.Value); + end if; + if Value.location.Is_Set then + Handler.Key_Name ("location"); + Write_Location (Handler, Value.location.Value); + end if; + if Value.command.Is_Set then + Handler.Key_Name ("command"); + Write_Command (Handler, Value.command.Value); + end if; + Handler.End_Object; + end Write_InlayHintLabelPart; + + procedure Write_SelectionRangeOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SelectionRangeOptions) is + begin + Handler.Start_Object; + if Value.workDoneProgress.Is_Set then + Handler.Key_Name ("workDoneProgress"); + Handler.Boolean_Value (Value.workDoneProgress.Value); + end if; + Handler.End_Object; + end Write_SelectionRangeOptions; + + procedure Write_LocationLink + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.LocationLink) is + begin + Handler.Start_Object; + if Value.originSelectionRange.Is_Set then + Handler.Key_Name ("originSelectionRange"); + Write_A_Range (Handler, Value.originSelectionRange.Value); + end if; + Handler.Key_Name ("targetUri"); + Handler.String_Value (Value.targetUri); + Handler.Key_Name ("targetRange"); + Write_A_Range (Handler, Value.targetRange); + Handler.Key_Name ("targetSelectionRange"); + Write_A_Range (Handler, Value.targetSelectionRange); + Handler.End_Object; + end Write_LocationLink; + + procedure Write_CompletionList + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CompletionList) is + procedure Write_itemDefaults_OfCompletionList + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.itemDefaults_OfCompletionList); + + procedure Write_Range_Or_Something + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Range_Or_Something); + + procedure Write_itemDefaults_OfCompletionList + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.itemDefaults_OfCompletionList) is + begin + Handler.Start_Object; + if not Value.commitCharacters.Is_Empty then + Handler.Key_Name ("commitCharacters"); + Write_Virtual_String_Vector (Handler, Value.commitCharacters); + end if; + if Value.editRange.Is_Set then + Handler.Key_Name ("editRange"); + Write_Range_Or_Something (Handler, Value.editRange.Value); + end if; + if Value.insertTextFormat.Is_Set then + Handler.Key_Name ("insertTextFormat"); + Write_InsertTextFormat (Handler, Value.insertTextFormat.Value); + end if; + if Value.insertTextMode.Is_Set then + Handler.Key_Name ("insertTextMode"); + Write_InsertTextMode (Handler, Value.insertTextMode.Value); + end if; + if not Value.data.Is_Empty then + Handler.Key_Name ("data"); + Write_LSPAny (Handler, Value.data); + end if; + Handler.End_Object; + end Write_itemDefaults_OfCompletionList; + + procedure Write_Range_Or_Something + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Range_Or_Something) is + begin + case Value.Is_A_Range is + when True => + Write_A_Range (Handler, Value.A_Range); + when False => + Handler.Start_Object; + Handler.Key_Name ("insert"); + Write_A_Range (Handler, Value.insert); + Handler.Key_Name ("replace"); + Write_A_Range (Handler, Value.replace); + Handler.End_Object; + end case; + end Write_Range_Or_Something; + + begin + Handler.Start_Object; + Handler.Key_Name ("isIncomplete"); + Handler.Boolean_Value (Value.isIncomplete); + if Value.itemDefaults.Is_Set then + Handler.Key_Name ("itemDefaults"); + Write_itemDefaults_OfCompletionList + (Handler, Value.itemDefaults.Value); + end if; + Handler.Key_Name ("items"); + Write_CompletionItem_Vector (Handler, Value.items); + Handler.End_Object; + end Write_CompletionList; + + procedure Write_DiagnosticRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DiagnosticRegistrationOptions) is + procedure Write_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSelector_Or_Null); + + procedure Write_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSelector_Or_Null) is + begin + if Value.Is_Null then + Handler.Null_Value; + else + Write_DocumentSelector (Handler, Value.Value); + end if; + end Write_DocumentSelector_Or_Null; + + begin + Handler.Start_Object; + Handler.Key_Name ("documentSelector"); + Write_DocumentSelector_Or_Null (Handler, Value.Parent.documentSelector); + if Value.workDoneProgress.Is_Set then + Handler.Key_Name ("workDoneProgress"); + Handler.Boolean_Value (Value.workDoneProgress.Value); + end if; + if not Value.identifier.Is_Null then + Handler.Key_Name ("identifier"); + Handler.String_Value (Value.identifier); + end if; + Handler.Key_Name ("interFileDependencies"); + Handler.Boolean_Value (Value.interFileDependencies); + Handler.Key_Name ("workspaceDiagnostics"); + Handler.Boolean_Value (Value.workspaceDiagnostics); + if not Value.id.Is_Null then + Handler.Key_Name ("id"); + Handler.String_Value (Value.id); + end if; + Handler.End_Object; + end Write_DiagnosticRegistrationOptions; + + procedure Write_SignatureHelpTriggerKind + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.SignatureHelpTriggerKind) is + begin + case Value is + when LSP.Enumerations.Invoked => + Handler.Integer_Value (1); + when LSP.Enumerations.TriggerCharacter => + Handler.Integer_Value (2); + when LSP.Enumerations.ContentChange => + Handler.Integer_Value (3); + end case; + end Write_SignatureHelpTriggerKind; + + procedure Write_CodeAction + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CodeAction) is + procedure Write_disabled_OfCodeAction + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.disabled_OfCodeAction); + + procedure Write_disabled_OfCodeAction + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.disabled_OfCodeAction) is + begin + Handler.Start_Object; + Handler.Key_Name ("reason"); + Handler.String_Value (Value.reason); + Handler.End_Object; + end Write_disabled_OfCodeAction; + + begin + Handler.Start_Object; + Handler.Key_Name ("title"); + Handler.String_Value (Value.title); + if Value.kind.Is_Set then + Handler.Key_Name ("kind"); + Write_CodeActionKind (Handler, Value.kind.Value); + end if; + if not Value.diagnostics.Is_Empty then + Handler.Key_Name ("diagnostics"); + Write_Diagnostic_Vector (Handler, Value.diagnostics); + end if; + if Value.isPreferred.Is_Set then + Handler.Key_Name ("isPreferred"); + Handler.Boolean_Value (Value.isPreferred.Value); + end if; + if Value.disabled.Is_Set then + Handler.Key_Name ("disabled"); + Write_disabled_OfCodeAction (Handler, Value.disabled.Value); + end if; + if Value.edit.Is_Set then + Handler.Key_Name ("edit"); + Write_WorkspaceEdit (Handler, Value.edit.Value); + end if; + if Value.command.Is_Set then + Handler.Key_Name ("command"); + Write_Command (Handler, Value.command.Value); + end if; + if not Value.data.Is_Empty then + Handler.Key_Name ("data"); + Write_LSPAny (Handler, Value.data); + end if; + Handler.End_Object; + end Write_CodeAction; + + procedure Write_InlayHint_Vector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.InlayHint_Vector_Or_Null) is + begin + if Value.Is_Empty then + Handler.Null_Value; + else + Write_InlayHint_Vector (Handler, Value); + end if; + end Write_InlayHint_Vector_Or_Null; + + procedure Write_DeclarationParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DeclarationParams) is + begin + Handler.Start_Object; + Handler.Key_Name ("textDocument"); + Write_TextDocumentIdentifier (Handler, Value.textDocument); + Handler.Key_Name ("position"); + Write_Position (Handler, Value.position); + if Value.workDoneToken.Is_Set then + Handler.Key_Name ("workDoneToken"); + Write_ProgressToken (Handler, Value.workDoneToken.Value); + end if; + if Value.partialResultToken.Is_Set then + Handler.Key_Name ("partialResultToken"); + Write_ProgressToken (Handler, Value.partialResultToken.Value); + end if; + Handler.End_Object; + end Write_DeclarationParams; + + procedure Write_DocumentRangeFormattingParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentRangeFormattingParams) is + begin + Handler.Start_Object; + if Value.workDoneToken.Is_Set then + Handler.Key_Name ("workDoneToken"); + Write_ProgressToken (Handler, Value.workDoneToken.Value); + end if; + Handler.Key_Name ("textDocument"); + Write_TextDocumentIdentifier (Handler, Value.textDocument); + Handler.Key_Name ("range"); + Write_A_Range (Handler, Value.a_range); + Handler.Key_Name ("options"); + Write_FormattingOptions (Handler, Value.options); + Handler.End_Object; + end Write_DocumentRangeFormattingParams; + + procedure Write_TypeHierarchyClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.TypeHierarchyClientCapabilities) is + begin + Handler.Start_Object; + if Value.dynamicRegistration.Is_Set then + Handler.Key_Name ("dynamicRegistration"); + Handler.Boolean_Value (Value.dynamicRegistration.Value); + end if; + Handler.End_Object; + end Write_TypeHierarchyClientCapabilities; + + procedure Write_DocumentOnTypeFormattingOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentOnTypeFormattingOptions) is + begin + Handler.Start_Object; + Handler.Key_Name ("firstTriggerCharacter"); + Handler.String_Value (Value.firstTriggerCharacter); + if not Value.moreTriggerCharacter.Is_Empty then + Handler.Key_Name ("moreTriggerCharacter"); + Write_Virtual_String_Vector (Handler, Value.moreTriggerCharacter); + end if; + Handler.End_Object; + end Write_DocumentOnTypeFormattingOptions; + + procedure Write_WorkspaceSymbolRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.WorkspaceSymbolRegistrationOptions) is + begin + Handler.Start_Object; + if Value.workDoneProgress.Is_Set then + Handler.Key_Name ("workDoneProgress"); + Handler.Boolean_Value (Value.workDoneProgress.Value); + end if; + if Value.resolveProvider.Is_Set then + Handler.Key_Name ("resolveProvider"); + Handler.Boolean_Value (Value.resolveProvider.Value); + end if; + Handler.End_Object; + end Write_WorkspaceSymbolRegistrationOptions; + + procedure Write_MonikerParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.MonikerParams) is + begin + Handler.Start_Object; + Handler.Key_Name ("textDocument"); + Write_TextDocumentIdentifier (Handler, Value.textDocument); + Handler.Key_Name ("position"); + Write_Position (Handler, Value.position); + if Value.workDoneToken.Is_Set then + Handler.Key_Name ("workDoneToken"); + Write_ProgressToken (Handler, Value.workDoneToken.Value); + end if; + if Value.partialResultToken.Is_Set then + Handler.Key_Name ("partialResultToken"); + Write_ProgressToken (Handler, Value.partialResultToken.Value); + end if; + Handler.End_Object; + end Write_MonikerParams; + + procedure Write_InlayHint + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.InlayHint) is + procedure Write_Virtual_String_Or_InlayHintLabelPart_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Virtual_String_Or_InlayHintLabelPart_Vector); + + procedure Write_InlayHintLabelPart_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.InlayHintLabelPart_Vector); + + procedure Write_Virtual_String_Or_InlayHintLabelPart_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Virtual_String_Or_InlayHintLabelPart_Vector) is + begin + case Value.Is_Virtual_String is + when True => + Handler.String_Value (Value.Virtual_String); + when False => + Write_InlayHintLabelPart_Vector + (Handler, Value.InlayHintLabelPart_Vector); + end case; + end Write_Virtual_String_Or_InlayHintLabelPart_Vector; + + procedure Write_InlayHintLabelPart_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.InlayHintLabelPart_Vector) is + begin + Handler.Start_Array; + for J in Value.First_Index .. Value.Last_Index loop + Write_InlayHintLabelPart (Handler, Value (J)); + end loop; + Handler.End_Array; + end Write_InlayHintLabelPart_Vector; + + begin + Handler.Start_Object; + Handler.Key_Name ("position"); + Write_Position (Handler, Value.position); + Handler.Key_Name ("label"); + Write_Virtual_String_Or_InlayHintLabelPart_Vector (Handler, Value.label); + if Value.kind.Is_Set then + Handler.Key_Name ("kind"); + Write_InlayHintKind (Handler, Value.kind.Value); + end if; + if not Value.textEdits.Is_Empty then + Handler.Key_Name ("textEdits"); + Write_TextEdit_Vector (Handler, Value.textEdits); + end if; + if Value.tooltip.Is_Set then + Handler.Key_Name ("tooltip"); + Write_Virtual_String_Or_MarkupContent (Handler, Value.tooltip.Value); + end if; + if Value.paddingLeft.Is_Set then + Handler.Key_Name ("paddingLeft"); + Handler.Boolean_Value (Value.paddingLeft.Value); + end if; + if Value.paddingRight.Is_Set then + Handler.Key_Name ("paddingRight"); + Handler.Boolean_Value (Value.paddingRight.Value); + end if; + if not Value.data.Is_Empty then + Handler.Key_Name ("data"); + Write_LSPAny (Handler, Value.data); + end if; + Handler.End_Object; + end Write_InlayHint; + + procedure Write_FileDelete + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.FileDelete) is + begin + Handler.Start_Object; + Handler.Key_Name ("uri"); + Handler.String_Value (Value.uri); + Handler.End_Object; + end Write_FileDelete; + + procedure Write_DocumentFormattingRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentFormattingRegistrationOptions) is + procedure Write_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSelector_Or_Null); + + procedure Write_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSelector_Or_Null) is + begin + if Value.Is_Null then + Handler.Null_Value; + else + Write_DocumentSelector (Handler, Value.Value); + end if; + end Write_DocumentSelector_Or_Null; + + begin + Handler.Start_Object; + Handler.Key_Name ("documentSelector"); + Write_DocumentSelector_Or_Null (Handler, Value.Parent.documentSelector); + if Value.workDoneProgress.Is_Set then + Handler.Key_Name ("workDoneProgress"); + Handler.Boolean_Value (Value.workDoneProgress.Value); + end if; + Handler.End_Object; + end Write_DocumentFormattingRegistrationOptions; + + procedure Write_ColorPresentation + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ColorPresentation) is + begin + Handler.Start_Object; + Handler.Key_Name ("label"); + Handler.String_Value (Value.label); + if Value.textEdit.Is_Set then + Handler.Key_Name ("textEdit"); + Write_TextEdit (Handler, Value.textEdit.Value); + end if; + if not Value.additionalTextEdits.Is_Empty then + Handler.Key_Name ("additionalTextEdits"); + Write_TextEdit_Vector (Handler, Value.additionalTextEdits); + end if; + Handler.End_Object; + end Write_ColorPresentation; + + procedure Write_UnregistrationParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.UnregistrationParams) is + procedure Write_Unregistration_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Unregistration_Vector); + + procedure Write_Unregistration_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Unregistration_Vector) is + begin + Handler.Start_Array; + for J in Value.First_Index .. Value.Last_Index loop + Write_Unregistration (Handler, Value (J)); + end loop; + Handler.End_Array; + end Write_Unregistration_Vector; + + begin + Handler.Start_Object; + Handler.Key_Name ("unregisterations"); + Write_Unregistration_Vector (Handler, Value.unregisterations); + Handler.End_Object; + end Write_UnregistrationParams; + + procedure Write_SelectionRangeParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SelectionRangeParams) is + procedure Write_Position_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Position_Vector); + + procedure Write_Position_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Position_Vector) is + begin + Handler.Start_Array; + for J in Value.First_Index .. Value.Last_Index loop + Write_Position (Handler, Value (J)); + end loop; + Handler.End_Array; + end Write_Position_Vector; + + begin + Handler.Start_Object; + if Value.workDoneToken.Is_Set then + Handler.Key_Name ("workDoneToken"); + Write_ProgressToken (Handler, Value.workDoneToken.Value); + end if; + if Value.partialResultToken.Is_Set then + Handler.Key_Name ("partialResultToken"); + Write_ProgressToken (Handler, Value.partialResultToken.Value); + end if; + Handler.Key_Name ("textDocument"); + Write_TextDocumentIdentifier (Handler, Value.textDocument); + Handler.Key_Name ("positions"); + Write_Position_Vector (Handler, Value.positions); + Handler.End_Object; + end Write_SelectionRangeParams; + + procedure Write_Tokens_Delta_Result + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Tokens_Delta_Result) is + begin + case Value.Kind is + when LSP.Structures.Varian_1 => + Write_SemanticTokens (Handler, Value.Varian_1); + when LSP.Structures.Varian_2 => + Write_SemanticTokensDelta (Handler, Value.Varian_2); + when LSP.Structures.Varian_3 => + Handler.Null_Value; + end case; + end Write_Tokens_Delta_Result; + + procedure Write_RenameFilesParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.RenameFilesParams) is + procedure Write_FileRename_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.FileRename_Vector); + + procedure Write_FileRename_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.FileRename_Vector) is + begin + Handler.Start_Array; + for J in Value.First_Index .. Value.Last_Index loop + Write_FileRename (Handler, Value (J)); + end loop; + Handler.End_Array; + end Write_FileRename_Vector; + + begin + Handler.Start_Object; + Handler.Key_Name ("files"); + Write_FileRename_Vector (Handler, Value.files); + Handler.End_Object; + end Write_RenameFilesParams; + + procedure Write_TypeHierarchyItem + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.TypeHierarchyItem) is + begin + Handler.Start_Object; + Handler.Key_Name ("name"); + Handler.String_Value (Value.name); + Handler.Key_Name ("kind"); + Write_SymbolKind (Handler, Value.kind); + if (for some Item of Value.tags => Item) then + Handler.Key_Name ("tags"); + Write_SymbolTag_Set (Handler, Value.tags); + end if; + if not Value.detail.Is_Null then + Handler.Key_Name ("detail"); + Handler.String_Value (Value.detail); + end if; + Handler.Key_Name ("uri"); + Handler.String_Value (Value.uri); + Handler.Key_Name ("range"); + Write_A_Range (Handler, Value.a_range); + Handler.Key_Name ("selectionRange"); + Write_A_Range (Handler, Value.selectionRange); + if not Value.data.Is_Empty then + Handler.Key_Name ("data"); + Write_LSPAny (Handler, Value.data); + end if; + Handler.End_Object; + end Write_TypeHierarchyItem; + + procedure Write_Boolean_Or_Any + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Boolean_Or_Any) is + begin + LSP.Output_Tools.Write_LSPAny (Handler, (Value with null record)); + end Write_Boolean_Or_Any; + + procedure Write_Location + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Location) is + begin + Handler.Start_Object; + Handler.Key_Name ("uri"); + Handler.String_Value (Value.uri); + Handler.Key_Name ("range"); + Write_A_Range (Handler, Value.a_range); + Handler.End_Object; + end Write_Location; + + procedure Write_RenameRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.RenameRegistrationOptions) is + procedure Write_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSelector_Or_Null); + + procedure Write_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSelector_Or_Null) is + begin + if Value.Is_Null then + Handler.Null_Value; + else + Write_DocumentSelector (Handler, Value.Value); + end if; + end Write_DocumentSelector_Or_Null; + + begin + Handler.Start_Object; + Handler.Key_Name ("documentSelector"); + Write_DocumentSelector_Or_Null (Handler, Value.Parent.documentSelector); + if Value.workDoneProgress.Is_Set then + Handler.Key_Name ("workDoneProgress"); + Handler.Boolean_Value (Value.workDoneProgress.Value); + end if; + if Value.prepareProvider.Is_Set then + Handler.Key_Name ("prepareProvider"); + Handler.Boolean_Value (Value.prepareProvider.Value); + end if; + Handler.End_Object; + end Write_RenameRegistrationOptions; + + procedure Write_ParameterInformation + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ParameterInformation) is + procedure Write_Natural_Tuple + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Natural_Tuple); + + procedure Write_String_Or_Natural_Tuple + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.String_Or_Natural_Tuple); + + procedure Write_Natural_Tuple + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Natural_Tuple) is + begin + Handler.Start_Array; + for J in Value'Range loop + Handler.Integer_Value (Integer'Pos (Value (J))); + end loop; + Handler.End_Array; + end Write_Natural_Tuple; + + procedure Write_String_Or_Natural_Tuple + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.String_Or_Natural_Tuple) is + begin + case Value.Is_Virtual_String is + when True => + Handler.String_Value (Value.Virtual_String); + when False => + Write_Natural_Tuple (Handler, Value.Natural_Tuple); + end case; + end Write_String_Or_Natural_Tuple; + + begin + Handler.Start_Object; + Handler.Key_Name ("label"); + Write_String_Or_Natural_Tuple (Handler, Value.label); + if Value.documentation.Is_Set then + Handler.Key_Name ("documentation"); + Write_Virtual_String_Or_MarkupContent + (Handler, Value.documentation.Value); + end if; + Handler.End_Object; + end Write_ParameterInformation; + + procedure Write_PositionEncodingKind + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.PositionEncodingKind) is + begin + case Value is + when LSP.Enumerations.UTF8 => + Handler.String_Value ("utf-8"); + when LSP.Enumerations.UTF16 => + Handler.String_Value ("utf-16"); + when LSP.Enumerations.UTF32 => + Handler.String_Value ("utf-32"); + end case; + end Write_PositionEncodingKind; + + procedure Write_Symbol_Progress_Report + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Symbol_Progress_Report) is + begin + case Value.Kind is + when LSP.Structures.Varian_1 => + Write_SymbolInformation_Vector (Handler, Value.Varian_1); + when LSP.Structures.Varian_2 => + Write_WorkspaceSymbol_Vector (Handler, Value.Varian_2); + end case; + end Write_Symbol_Progress_Report; + + procedure Write_MessageType + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.MessageType) is + begin + case Value is + when LSP.Enumerations.Error => + Handler.Integer_Value (1); + when LSP.Enumerations.Warning => + Handler.Integer_Value (2); + when LSP.Enumerations.Info => + Handler.Integer_Value (3); + when LSP.Enumerations.Log => + Handler.Integer_Value (4); + end case; + end Write_MessageType; + + procedure Write_An_InitializeParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.An_InitializeParams) is + procedure Write_trace_Of_InitializeParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.trace_Of_InitializeParams); + + procedure Write_Virtual_String_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Virtual_String_Or_Null); + + procedure Write_DocumentUri_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentUri_Or_Null); + + procedure Write_trace_Of_InitializeParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.trace_Of_InitializeParams) is + begin + case Value is + when LSP.Structures.off => + Handler.String_Value ("off"); + when LSP.Structures.messages => + Handler.String_Value ("messages"); + when LSP.Structures.compact => + Handler.String_Value ("compact"); + when LSP.Structures.verbose => + Handler.String_Value ("verbose"); + end case; + end Write_trace_Of_InitializeParams; + + procedure Write_Virtual_String_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Virtual_String_Or_Null) is + begin + if Value.Is_Null then + Handler.Null_Value; + else + Handler.String_Value (Value.Value); + end if; + end Write_Virtual_String_Or_Null; + + procedure Write_DocumentUri_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentUri_Or_Null) is + begin + if Value.Is_Null then + Handler.Null_Value; + else + Handler.String_Value (Value.Value); + end if; + end Write_DocumentUri_Or_Null; + + begin + Handler.Start_Object; + if Value.workDoneToken.Is_Set then + Handler.Key_Name ("workDoneToken"); + Write_ProgressToken (Handler, Value.workDoneToken.Value); + end if; + Handler.Key_Name ("processId"); + Write_Integer_Or_Null (Handler, Value.processId); + if Value.clientInfo.Is_Set then + Handler.Key_Name ("clientInfo"); + Write_clientInfo_Of_InitializeParams + (Handler, Value.clientInfo.Value); + end if; + if not Value.locale.Is_Null then + Handler.Key_Name ("locale"); + Handler.String_Value (Value.locale); + end if; + if Value.rootPath.Is_Set then + Handler.Key_Name ("rootPath"); + Write_Virtual_String_Or_Null (Handler, Value.rootPath.Value); + end if; + Handler.Key_Name ("rootUri"); + Write_DocumentUri_Or_Null (Handler, Value.rootUri); + Handler.Key_Name ("capabilities"); + Write_ClientCapabilities (Handler, Value.capabilities); + if not Value.initializationOptions.Is_Empty then + Handler.Key_Name ("initializationOptions"); + Write_LSPAny (Handler, Value.initializationOptions); + end if; + if Value.trace.Is_Set then + Handler.Key_Name ("trace"); + Write_trace_Of_InitializeParams (Handler, Value.trace.Value); + end if; + Handler.End_Object; + end Write_An_InitializeParams; + + procedure Write_TypeHierarchySubtypesParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.TypeHierarchySubtypesParams) is + begin + Handler.Start_Object; + if Value.workDoneToken.Is_Set then + Handler.Key_Name ("workDoneToken"); + Write_ProgressToken (Handler, Value.workDoneToken.Value); + end if; + if Value.partialResultToken.Is_Set then + Handler.Key_Name ("partialResultToken"); + Write_ProgressToken (Handler, Value.partialResultToken.Value); + end if; + Handler.Key_Name ("item"); + Write_TypeHierarchyItem (Handler, Value.item); + Handler.End_Object; + end Write_TypeHierarchySubtypesParams; + + procedure Write_FileOperationFilter + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.FileOperationFilter) is + begin + Handler.Start_Object; + if not Value.scheme.Is_Null then + Handler.Key_Name ("scheme"); + Handler.String_Value (Value.scheme); + end if; + Handler.Key_Name ("pattern"); + Write_FileOperationPattern (Handler, Value.pattern); + Handler.End_Object; + end Write_FileOperationFilter; + + procedure Write_ApplyWorkspaceEditResult + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ApplyWorkspaceEditResult) is + begin + Handler.Start_Object; + Handler.Key_Name ("applied"); + Handler.Boolean_Value (Value.applied); + if not Value.failureReason.Is_Null then + Handler.Key_Name ("failureReason"); + Handler.String_Value (Value.failureReason); + end if; + if Value.failedChange.Is_Set then + Handler.Key_Name ("failedChange"); + Handler.Integer_Value (Integer'Pos (Value.failedChange.Value)); + end if; + Handler.End_Object; + end Write_ApplyWorkspaceEditResult; + + procedure Write_SemanticTokensPartialResult + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SemanticTokensPartialResult) is + begin + Handler.Start_Object; + Handler.Key_Name ("data"); + Write_Natural_Vector (Handler, Value.data); + Handler.End_Object; + end Write_SemanticTokensPartialResult; + + procedure Write_Completion_Result + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Completion_Result) is + begin + case Value.Kind is + when LSP.Structures.Varian_1 => + Write_CompletionItem_Vector (Handler, Value.Varian_1); + when LSP.Structures.Varian_2 => + Write_CompletionList (Handler, Value.Varian_2); + when LSP.Structures.Varian_3 => + Handler.Null_Value; + end case; + end Write_Completion_Result; + + procedure Write_MonikerOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.MonikerOptions) is + begin + Handler.Start_Object; + if Value.workDoneProgress.Is_Set then + Handler.Key_Name ("workDoneProgress"); + Handler.Boolean_Value (Value.workDoneProgress.Value); + end if; + Handler.End_Object; + end Write_MonikerOptions; + + procedure Write_InlineValue + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.InlineValue) is + begin + case Value.Kind is + when LSP.Structures.Varian_1 => + Write_InlineValueText (Handler, Value.Varian_1); + when LSP.Structures.Varian_2 => + Write_InlineValueVariableLookup (Handler, Value.Varian_2); + when LSP.Structures.Varian_3 => + Write_InlineValueEvaluatableExpression (Handler, Value.Varian_3); + end case; + end Write_InlineValue; + + procedure Write_Virtual_String_Or_NotebookDocumentFilter + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Virtual_String_Or_NotebookDocumentFilter) is + begin + case Value.Is_Virtual_String is + when True => + Handler.String_Value (Value.Virtual_String); + when False => + Write_NotebookDocumentFilter + (Handler, Value.NotebookDocumentFilter); + end case; + end Write_Virtual_String_Or_NotebookDocumentFilter; + + procedure Write_MonikerKind + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.MonikerKind) is + begin + case Value is + when LSP.Enumerations.import => + Handler.String_Value ("import"); + when LSP.Enumerations.export => + Handler.String_Value ("export"); + when LSP.Enumerations.local => + Handler.String_Value ("local"); + end case; + end Write_MonikerKind; + + procedure Write_NotebookCellKind + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.NotebookCellKind) is + begin + case Value is + when LSP.Enumerations.Markup => + Handler.Integer_Value (1); + when LSP.Enumerations.Code => + Handler.Integer_Value (2); + end case; + end Write_NotebookCellKind; + + procedure Write_CallHierarchyItem_Vector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CallHierarchyItem_Vector_Or_Null) is + begin + if Value.Is_Empty then + Handler.Null_Value; + else + Write_CallHierarchyItem_Vector (Handler, Value); + end if; + end Write_CallHierarchyItem_Vector_Or_Null; + + procedure Write_DidCloseTextDocumentParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DidCloseTextDocumentParams) is + begin + Handler.Start_Object; + Handler.Key_Name ("textDocument"); + Write_TextDocumentIdentifier (Handler, Value.textDocument); + Handler.End_Object; + end Write_DidCloseTextDocumentParams; + + procedure Write_CallHierarchyOutgoingCallsParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CallHierarchyOutgoingCallsParams) is + begin + Handler.Start_Object; + if Value.workDoneToken.Is_Set then + Handler.Key_Name ("workDoneToken"); + Write_ProgressToken (Handler, Value.workDoneToken.Value); + end if; + if Value.partialResultToken.Is_Set then + Handler.Key_Name ("partialResultToken"); + Write_ProgressToken (Handler, Value.partialResultToken.Value); + end if; + Handler.Key_Name ("item"); + Write_CallHierarchyItem (Handler, Value.item); + Handler.End_Object; + end Write_CallHierarchyOutgoingCallsParams; + + procedure Write_SelectionRange_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SelectionRange_Vector) is + begin + Handler.Start_Array; + for J in 1 .. Value.Length loop + Write_SelectionRange (Handler, Value (J)); + end loop; + Handler.End_Array; + end Write_SelectionRange_Vector; + + procedure Write_HoverRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.HoverRegistrationOptions) is + procedure Write_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSelector_Or_Null); + + procedure Write_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSelector_Or_Null) is + begin + if Value.Is_Null then + Handler.Null_Value; + else + Write_DocumentSelector (Handler, Value.Value); + end if; + end Write_DocumentSelector_Or_Null; + + begin + Handler.Start_Object; + Handler.Key_Name ("documentSelector"); + Write_DocumentSelector_Or_Null (Handler, Value.Parent.documentSelector); + if Value.workDoneProgress.Is_Set then + Handler.Key_Name ("workDoneProgress"); + Handler.Boolean_Value (Value.workDoneProgress.Value); + end if; + Handler.End_Object; + end Write_HoverRegistrationOptions; + + procedure Write_CompletionItemTag + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.CompletionItemTag) is + begin + case Value is + when LSP.Enumerations.Deprecated => + Handler.Integer_Value (1); + end case; + end Write_CompletionItemTag; + + procedure Write_SemanticTokensDeltaParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SemanticTokensDeltaParams) is + begin + Handler.Start_Object; + if Value.workDoneToken.Is_Set then + Handler.Key_Name ("workDoneToken"); + Write_ProgressToken (Handler, Value.workDoneToken.Value); + end if; + if Value.partialResultToken.Is_Set then + Handler.Key_Name ("partialResultToken"); + Write_ProgressToken (Handler, Value.partialResultToken.Value); + end if; + Handler.Key_Name ("textDocument"); + Write_TextDocumentIdentifier (Handler, Value.textDocument); + Handler.Key_Name ("previousResultId"); + Handler.String_Value (Value.previousResultId); + Handler.End_Object; + end Write_SemanticTokensDeltaParams; + + procedure Write_DidChangeWorkspaceFoldersParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DidChangeWorkspaceFoldersParams) is + begin + Handler.Start_Object; + Handler.Key_Name ("event"); + Write_WorkspaceFoldersChangeEvent (Handler, Value.event); + Handler.End_Object; + end Write_DidChangeWorkspaceFoldersParams; + + procedure Write_DefinitionRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DefinitionRegistrationOptions) is + procedure Write_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSelector_Or_Null); + + procedure Write_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSelector_Or_Null) is + begin + if Value.Is_Null then + Handler.Null_Value; + else + Write_DocumentSelector (Handler, Value.Value); + end if; + end Write_DocumentSelector_Or_Null; + + begin + Handler.Start_Object; + Handler.Key_Name ("documentSelector"); + Write_DocumentSelector_Or_Null (Handler, Value.Parent.documentSelector); + if Value.workDoneProgress.Is_Set then + Handler.Key_Name ("workDoneProgress"); + Handler.Boolean_Value (Value.workDoneProgress.Value); + end if; + Handler.End_Object; + end Write_DefinitionRegistrationOptions; + + procedure Write_clientInfo_Of_InitializeParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.clientInfo_Of_InitializeParams) is + begin + Handler.Start_Object; + Handler.Key_Name ("name"); + Handler.String_Value (Value.name); + if not Value.version.Is_Null then + Handler.Key_Name ("version"); + Handler.String_Value (Value.version); + end if; + Handler.End_Object; + end Write_clientInfo_Of_InitializeParams; + + procedure Write_CodeLensParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CodeLensParams) is + begin + Handler.Start_Object; + if Value.workDoneToken.Is_Set then + Handler.Key_Name ("workDoneToken"); + Write_ProgressToken (Handler, Value.workDoneToken.Value); + end if; + if Value.partialResultToken.Is_Set then + Handler.Key_Name ("partialResultToken"); + Write_ProgressToken (Handler, Value.partialResultToken.Value); + end if; + Handler.Key_Name ("textDocument"); + Write_TextDocumentIdentifier (Handler, Value.textDocument); + Handler.End_Object; + end Write_CodeLensParams; + + procedure Write_DiagnosticTag + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.DiagnosticTag) is + begin + case Value is + when LSP.Enumerations.Unnecessary => + Handler.Integer_Value (1); + when LSP.Enumerations.Deprecated => + Handler.Integer_Value (2); + end case; + end Write_DiagnosticTag; + + procedure Write_TypeHierarchyItem_Vector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.TypeHierarchyItem_Vector_Or_Null) is + begin + if Value.Is_Empty then + Handler.Null_Value; + else + Write_TypeHierarchyItem_Vector (Handler, Value); + end if; + end Write_TypeHierarchyItem_Vector_Or_Null; + + procedure Write_Symbol_Result + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Symbol_Result) is + begin + case Value.Kind is + when LSP.Structures.Varian_1 => + Write_SymbolInformation_Vector (Handler, Value.Varian_1); + when LSP.Structures.Varian_2 => + Write_WorkspaceSymbol_Vector (Handler, Value.Varian_2); + when LSP.Structures.Varian_3 => + Handler.Null_Value; + end case; + end Write_Symbol_Result; + + procedure Write_DiagnosticClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DiagnosticClientCapabilities) is + begin + Handler.Start_Object; + if Value.dynamicRegistration.Is_Set then + Handler.Key_Name ("dynamicRegistration"); + Handler.Boolean_Value (Value.dynamicRegistration.Value); + end if; + if Value.relatedDocumentSupport.Is_Set then + Handler.Key_Name ("relatedDocumentSupport"); + Handler.Boolean_Value (Value.relatedDocumentSupport.Value); + end if; + Handler.End_Object; + end Write_DiagnosticClientCapabilities; + + procedure Write_MonikerRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.MonikerRegistrationOptions) is + procedure Write_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSelector_Or_Null); + + procedure Write_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSelector_Or_Null) is + begin + if Value.Is_Null then + Handler.Null_Value; + else + Write_DocumentSelector (Handler, Value.Value); + end if; + end Write_DocumentSelector_Or_Null; + + begin + Handler.Start_Object; + Handler.Key_Name ("documentSelector"); + Write_DocumentSelector_Or_Null (Handler, Value.Parent.documentSelector); + if Value.workDoneProgress.Is_Set then + Handler.Key_Name ("workDoneProgress"); + Handler.Boolean_Value (Value.workDoneProgress.Value); + end if; + Handler.End_Object; + end Write_MonikerRegistrationOptions; + + procedure Write_ExecutionSummary + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ExecutionSummary) is + begin + Handler.Start_Object; + Handler.Key_Name ("executionOrder"); + Handler.Integer_Value (Integer'Pos (Value.executionOrder)); + if Value.success.Is_Set then + Handler.Key_Name ("success"); + Handler.Boolean_Value (Value.success.Value); + end if; + Handler.End_Object; + end Write_ExecutionSummary; + + procedure Write_TypeHierarchySupertypesParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.TypeHierarchySupertypesParams) is + begin + Handler.Start_Object; + if Value.workDoneToken.Is_Set then + Handler.Key_Name ("workDoneToken"); + Write_ProgressToken (Handler, Value.workDoneToken.Value); + end if; + if Value.partialResultToken.Is_Set then + Handler.Key_Name ("partialResultToken"); + Write_ProgressToken (Handler, Value.partialResultToken.Value); + end if; + Handler.Key_Name ("item"); + Write_TypeHierarchyItem (Handler, Value.item); + Handler.End_Object; + end Write_TypeHierarchySupertypesParams; + + procedure Write_PreviousResultId + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.PreviousResultId) is + begin + Handler.Start_Object; + Handler.Key_Name ("uri"); + Handler.String_Value (Value.uri); + Handler.Key_Name ("value"); + Handler.String_Value (Value.value); + Handler.End_Object; + end Write_PreviousResultId; + + procedure Write_FoldingRangeKind + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.FoldingRangeKind) is + begin + case Value is + when LSP.Enumerations.Comment => + Handler.String_Value ("comment"); + when LSP.Enumerations.Imports => + Handler.String_Value ("imports"); + when LSP.Enumerations.Region => + Handler.String_Value ("region"); + end case; + end Write_FoldingRangeKind; + + procedure Write_PublishDiagnosticsParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.PublishDiagnosticsParams) is + begin + Handler.Start_Object; + Handler.Key_Name ("uri"); + Handler.String_Value (Value.uri); + if Value.version.Is_Set then + Handler.Key_Name ("version"); + Handler.Integer_Value (Integer'Pos (Value.version.Value)); + end if; + Handler.Key_Name ("diagnostics"); + Write_Diagnostic_Vector (Handler, Value.diagnostics); + Handler.End_Object; + end Write_PublishDiagnosticsParams; + + procedure Write_DocumentFilter + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentFilter) is + begin + case Value.Is_TextDocumentFilter is + when True => + Write_TextDocumentFilter (Handler, Value.TextDocumentFilter); + when False => + Write_NotebookCellTextDocumentFilter + (Handler, Value.NotebookCellTextDocumentFilter); + end case; + end Write_DocumentFilter; + + procedure Write_WorkspaceDiagnosticReport + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.WorkspaceDiagnosticReport) is + begin + Handler.Start_Object; + Handler.Key_Name ("items"); + Write_WorkspaceDocumentDiagnosticReport_Vector (Handler, Value.items); + Handler.End_Object; + end Write_WorkspaceDiagnosticReport; + + procedure Write_CallHierarchyIncomingCall + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CallHierarchyIncomingCall) is + begin + Handler.Start_Object; + Handler.Key_Name ("from"); + Write_CallHierarchyItem (Handler, Value.from); + Handler.Key_Name ("fromRanges"); + Write_Range_Vector (Handler, Value.fromRanges); + Handler.End_Object; + end Write_CallHierarchyIncomingCall; + + procedure Write_TextEdit_Vector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.TextEdit_Vector_Or_Null) is + begin + if Value.Is_Empty then + Handler.Null_Value; + else + Write_TextEdit_Vector (Handler, Value); + end if; + end Write_TextEdit_Vector_Or_Null; + + procedure Write_LinkedEditingRanges_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.LinkedEditingRanges_Or_Null) is + begin + if Value.Is_Null then + Handler.Null_Value; + else + Write_LinkedEditingRanges (Handler, Value.Value); + end if; + end Write_LinkedEditingRanges_Or_Null; + + procedure Write_TextDocumentChangeRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.TextDocumentChangeRegistrationOptions) is + procedure Write_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSelector_Or_Null); + + procedure Write_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSelector_Or_Null) is + begin + if Value.Is_Null then + Handler.Null_Value; + else + Write_DocumentSelector (Handler, Value.Value); + end if; + end Write_DocumentSelector_Or_Null; + + begin + Handler.Start_Object; + Handler.Key_Name ("documentSelector"); + Write_DocumentSelector_Or_Null (Handler, Value.documentSelector); + Handler.Key_Name ("syncKind"); + Write_TextDocumentSyncKind (Handler, Value.syncKind); + Handler.End_Object; + end Write_TextDocumentChangeRegistrationOptions; + + procedure Write_DeclarationLink_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DeclarationLink_Vector) is + begin + Handler.Start_Array; + for J in Value.First_Index .. Value.Last_Index loop + Write_DeclarationLink (Handler, Value (J)); + end loop; + Handler.End_Array; + end Write_DeclarationLink_Vector; + + procedure Write_SetTraceParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SetTraceParams) is + begin + Handler.Start_Object; + Handler.Key_Name ("value"); + Write_TraceValues (Handler, Value.value); + Handler.End_Object; + end Write_SetTraceParams; + + procedure Write_DocumentFormattingClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentFormattingClientCapabilities) is + begin + Handler.Start_Object; + if Value.dynamicRegistration.Is_Set then + Handler.Key_Name ("dynamicRegistration"); + Handler.Boolean_Value (Value.dynamicRegistration.Value); + end if; + Handler.End_Object; + end Write_DocumentFormattingClientCapabilities; + + procedure Write_NotebookDocumentChangeEvent + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.NotebookDocumentChangeEvent) is + procedure Write_textContent_Ofcells_OfNotebookDocumentChangeEvent_Item + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures + .textContent_Ofcells_OfNotebookDocumentChangeEvent_Item); + + procedure Write_cells_OfNotebookDocumentChangeEvent + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.cells_OfNotebookDocumentChangeEvent); + + procedure Write_textContent_Ofcells_OfNotebookDocumentChangeEvent + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures + .textContent_Ofcells_OfNotebookDocumentChangeEvent); + + procedure Write_structure_Ofcells_OfNotebookDocumentChangeEvent + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures + .structure_Ofcells_OfNotebookDocumentChangeEvent); + + procedure Write_textContent_Ofcells_OfNotebookDocumentChangeEvent_Item + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures + .textContent_Ofcells_OfNotebookDocumentChangeEvent_Item) is + begin + Handler.Start_Object; + Handler.Key_Name ("document"); + Write_VersionedTextDocumentIdentifier (Handler, Value.document); + Handler.Key_Name ("changes"); + Write_TextDocumentContentChangeEvent_Vector (Handler, Value.changes); + Handler.End_Object; + end Write_textContent_Ofcells_OfNotebookDocumentChangeEvent_Item; + + procedure Write_cells_OfNotebookDocumentChangeEvent + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.cells_OfNotebookDocumentChangeEvent) is + begin + Handler.Start_Object; + if Value.structure.Is_Set then + Handler.Key_Name ("structure"); + Write_structure_Ofcells_OfNotebookDocumentChangeEvent + (Handler, Value.structure.Value); + end if; + if not Value.data.Is_Empty then + Handler.Key_Name ("data"); + Write_NotebookCell_Vector (Handler, Value.data); + end if; + if not Value.textContent.Is_Empty then + Handler.Key_Name ("textContent"); + Write_textContent_Ofcells_OfNotebookDocumentChangeEvent + (Handler, Value.textContent); + end if; + Handler.End_Object; + end Write_cells_OfNotebookDocumentChangeEvent; + + procedure Write_textContent_Ofcells_OfNotebookDocumentChangeEvent + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures + .textContent_Ofcells_OfNotebookDocumentChangeEvent) is + begin + Handler.Start_Array; + for J in Value.First_Index .. Value.Last_Index loop + Write_textContent_Ofcells_OfNotebookDocumentChangeEvent_Item + (Handler, Value (J)); + end loop; + Handler.End_Array; + end Write_textContent_Ofcells_OfNotebookDocumentChangeEvent; + + procedure Write_structure_Ofcells_OfNotebookDocumentChangeEvent + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures + .structure_Ofcells_OfNotebookDocumentChangeEvent) is + begin + Handler.Start_Object; + Handler.Key_Name ("array"); + Write_NotebookCellArrayChange (Handler, Value.an_array); + if not Value.didOpen.Is_Empty then + Handler.Key_Name ("didOpen"); + Write_TextDocumentItem_Vector (Handler, Value.didOpen); + end if; + if not Value.didClose.Is_Empty then + Handler.Key_Name ("didClose"); + Write_TextDocumentIdentifier_Vector (Handler, Value.didClose); + end if; + Handler.End_Object; + end Write_structure_Ofcells_OfNotebookDocumentChangeEvent; + + begin + Handler.Start_Object; + if Value.metadata.Is_Set then + Handler.Key_Name ("metadata"); + Write_LSPObject (Handler, Value.metadata.Value); + end if; + if Value.cells.Is_Set then + Handler.Key_Name ("cells"); + Write_cells_OfNotebookDocumentChangeEvent + (Handler, Value.cells.Value); + end if; + Handler.End_Object; + end Write_NotebookDocumentChangeEvent; + + procedure Write_FormattingOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.FormattingOptions) is + begin + Handler.Start_Object; + Handler.Key_Name ("tabSize"); + Handler.Integer_Value (Integer'Pos (Value.tabSize)); + Handler.Key_Name ("insertSpaces"); + Handler.Boolean_Value (Value.insertSpaces); + if Value.trimTrailingWhitespace.Is_Set then + Handler.Key_Name ("trimTrailingWhitespace"); + Handler.Boolean_Value (Value.trimTrailingWhitespace.Value); + end if; + if Value.insertFinalNewline.Is_Set then + Handler.Key_Name ("insertFinalNewline"); + Handler.Boolean_Value (Value.insertFinalNewline.Value); + end if; + if Value.trimFinalNewlines.Is_Set then + Handler.Key_Name ("trimFinalNewlines"); + Handler.Boolean_Value (Value.trimFinalNewlines.Value); + end if; + Handler.End_Object; + end Write_FormattingOptions; + + procedure Write_WorkspaceDiagnosticReportPartialResult + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.WorkspaceDiagnosticReportPartialResult) is + begin + Handler.Start_Object; + Handler.Key_Name ("items"); + Write_WorkspaceDocumentDiagnosticReport_Vector (Handler, Value.items); + Handler.End_Object; + end Write_WorkspaceDiagnosticReportPartialResult; + + procedure Write_resolveSupport_OfWorkspaceSymbolClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures + .resolveSupport_OfWorkspaceSymbolClientCapabilities) is + begin + Handler.Start_Object; + Handler.Key_Name ("properties"); + Write_Virtual_String_Vector (Handler, Value.properties); + Handler.End_Object; + end Write_resolveSupport_OfWorkspaceSymbolClientCapabilities; + + procedure Write_DidOpenTextDocumentParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DidOpenTextDocumentParams) is + begin + Handler.Start_Object; + Handler.Key_Name ("textDocument"); + Write_TextDocumentItem (Handler, Value.textDocument); + Handler.End_Object; + end Write_DidOpenTextDocumentParams; + + procedure Write_WorkspaceSymbol_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.WorkspaceSymbol_Vector) is + begin + Handler.Start_Array; + for J in Value.First_Index .. Value.Last_Index loop + Write_WorkspaceSymbol (Handler, Value (J)); + end loop; + Handler.End_Array; + end Write_WorkspaceSymbol_Vector; + + procedure Write_TypeDefinitionRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.TypeDefinitionRegistrationOptions) is + procedure Write_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSelector_Or_Null); + + procedure Write_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSelector_Or_Null) is + begin + if Value.Is_Null then + Handler.Null_Value; + else + Write_DocumentSelector (Handler, Value.Value); + end if; + end Write_DocumentSelector_Or_Null; + + begin + Handler.Start_Object; + Handler.Key_Name ("documentSelector"); + Write_DocumentSelector_Or_Null (Handler, Value.Parent.documentSelector); + if Value.workDoneProgress.Is_Set then + Handler.Key_Name ("workDoneProgress"); + Handler.Boolean_Value (Value.workDoneProgress.Value); + end if; + if not Value.id.Is_Null then + Handler.Key_Name ("id"); + Handler.String_Value (Value.id); + end if; + Handler.End_Object; + end Write_TypeDefinitionRegistrationOptions; + + procedure Write_CodeLensOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CodeLensOptions) is + begin + Handler.Start_Object; + if Value.workDoneProgress.Is_Set then + Handler.Key_Name ("workDoneProgress"); + Handler.Boolean_Value (Value.workDoneProgress.Value); + end if; + if Value.resolveProvider.Is_Set then + Handler.Key_Name ("resolveProvider"); + Handler.Boolean_Value (Value.resolveProvider.Value); + end if; + Handler.End_Object; + end Write_CodeLensOptions; + + procedure Write_FileRename + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.FileRename) is + begin + Handler.Start_Object; + Handler.Key_Name ("oldUri"); + Handler.String_Value (Value.oldUri); + Handler.Key_Name ("newUri"); + Handler.String_Value (Value.newUri); + Handler.End_Object; + end Write_FileRename; + + procedure Write_SemanticTokensPartialResult_Or_SemanticTokensDeltaPartialResult + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures + .SemanticTokensPartialResult_Or_SemanticTokensDeltaPartialResult) is + begin + case Value.Is_SemanticTokensPartialResult is + when True => + Write_SemanticTokensPartialResult + (Handler, Value.SemanticTokensPartialResult); + when False => + Write_SemanticTokensDeltaPartialResult + (Handler, Value.SemanticTokensDeltaPartialResult); + end case; + end Write_SemanticTokensPartialResult_Or_SemanticTokensDeltaPartialResult; + + procedure Write_DocumentDiagnosticReport + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentDiagnosticReport) is + begin + case Value.Kind is + when LSP.Structures.full => + Write_RelatedFullDocumentDiagnosticReport (Handler, Value.full); + when LSP.Structures.unchanged => + Write_RelatedUnchangedDocumentDiagnosticReport + (Handler, Value.unchanged); + end case; + end Write_DocumentDiagnosticReport; + + procedure Write_DocumentRangeFormattingClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentRangeFormattingClientCapabilities) is + begin + Handler.Start_Object; + if Value.dynamicRegistration.Is_Set then + Handler.Key_Name ("dynamicRegistration"); + Handler.Boolean_Value (Value.dynamicRegistration.Value); + end if; + Handler.End_Object; + end Write_DocumentRangeFormattingClientCapabilities; + + procedure Write_Moniker + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Moniker) is + begin + Handler.Start_Object; + Handler.Key_Name ("scheme"); + Handler.String_Value (Value.scheme); + Handler.Key_Name ("identifier"); + Handler.String_Value (Value.identifier); + Handler.Key_Name ("unique"); + Write_UniquenessLevel (Handler, Value.unique); + if Value.kind.Is_Set then + Handler.Key_Name ("kind"); + Write_MonikerKind (Handler, Value.kind.Value); + end if; + Handler.End_Object; + end Write_Moniker; + + procedure Write_ExecuteCommandParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ExecuteCommandParams) is + begin + Handler.Start_Object; + if Value.workDoneToken.Is_Set then + Handler.Key_Name ("workDoneToken"); + Write_ProgressToken (Handler, Value.workDoneToken.Value); + end if; + Handler.Key_Name ("command"); + Handler.String_Value (Value.command); + if not Value.arguments.Is_Empty then + Handler.Key_Name ("arguments"); + Write_LSPAny_Vector (Handler, Value.arguments); + end if; + Handler.End_Object; + end Write_ExecuteCommandParams; + + procedure Write_WorkDoneProgressBegin + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.WorkDoneProgressBegin) is + begin + Handler.Start_Object; + Handler.Key_Name ("kind"); + Handler.String_Value ("begin"); + Handler.Key_Name ("title"); + Handler.String_Value (Value.title); + if Value.cancellable.Is_Set then + Handler.Key_Name ("cancellable"); + Handler.Boolean_Value (Value.cancellable.Value); + end if; + if not Value.message.Is_Null then + Handler.Key_Name ("message"); + Handler.String_Value (Value.message); + end if; + if Value.percentage.Is_Set then + Handler.Key_Name ("percentage"); + Handler.Integer_Value (Integer'Pos (Value.percentage.Value)); + end if; + Handler.End_Object; + end Write_WorkDoneProgressBegin; + + procedure Write_DiagnosticWorkspaceClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DiagnosticWorkspaceClientCapabilities) is + begin + Handler.Start_Object; + if Value.refreshSupport.Is_Set then + Handler.Key_Name ("refreshSupport"); + Handler.Boolean_Value (Value.refreshSupport.Value); + end if; + Handler.End_Object; + end Write_DiagnosticWorkspaceClientCapabilities; + + procedure Write_DefinitionClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DefinitionClientCapabilities) is + begin + Handler.Start_Object; + if Value.dynamicRegistration.Is_Set then + Handler.Key_Name ("dynamicRegistration"); + Handler.Boolean_Value (Value.dynamicRegistration.Value); + end if; + if Value.linkSupport.Is_Set then + Handler.Key_Name ("linkSupport"); + Handler.Boolean_Value (Value.linkSupport.Value); + end if; + Handler.End_Object; + end Write_DefinitionClientCapabilities; + + procedure Write_SignatureHelpRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SignatureHelpRegistrationOptions) is + procedure Write_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSelector_Or_Null); + + procedure Write_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSelector_Or_Null) is + begin + if Value.Is_Null then + Handler.Null_Value; + else + Write_DocumentSelector (Handler, Value.Value); + end if; + end Write_DocumentSelector_Or_Null; + + begin + Handler.Start_Object; + Handler.Key_Name ("documentSelector"); + Write_DocumentSelector_Or_Null (Handler, Value.Parent.documentSelector); + if Value.workDoneProgress.Is_Set then + Handler.Key_Name ("workDoneProgress"); + Handler.Boolean_Value (Value.workDoneProgress.Value); + end if; + if not Value.triggerCharacters.Is_Empty then + Handler.Key_Name ("triggerCharacters"); + Write_Virtual_String_Vector (Handler, Value.triggerCharacters); + end if; + if not Value.retriggerCharacters.Is_Empty then + Handler.Key_Name ("retriggerCharacters"); + Write_Virtual_String_Vector (Handler, Value.retriggerCharacters); + end if; + Handler.End_Object; + end Write_SignatureHelpRegistrationOptions; + + procedure Write_TypeDefinitionOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.TypeDefinitionOptions) is + begin + Handler.Start_Object; + if Value.workDoneProgress.Is_Set then + Handler.Key_Name ("workDoneProgress"); + Handler.Boolean_Value (Value.workDoneProgress.Value); + end if; + Handler.End_Object; + end Write_TypeDefinitionOptions; + + procedure Write_MarkupContent + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.MarkupContent) is + begin + Handler.Start_Object; + Handler.Key_Name ("kind"); + Write_MarkupKind (Handler, Value.kind); + Handler.Key_Name ("value"); + Handler.String_Value (Value.value); + Handler.End_Object; + end Write_MarkupContent; + + procedure Write_WorkspaceEdit + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.WorkspaceEdit) is + procedure Write_changes_OfWorkspaceEdit + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.changes_OfWorkspaceEdit); + + procedure Write_documentChanges_OfWorkspaceEdit_Item + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.documentChanges_OfWorkspaceEdit_Item); + + procedure Write_changeAnnotations_OfWorkspaceEdit + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.changeAnnotations_OfWorkspaceEdit); + + procedure Write_documentChanges_OfWorkspaceEdit + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.documentChanges_OfWorkspaceEdit); + + procedure Write_changes_OfWorkspaceEdit + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.changes_OfWorkspaceEdit) is + begin + declare + use LSP.Structures.TextEdit_Vector_Maps; + begin + Handler.Start_Object; + for Cursor in Value.Iterate loop + Handler.Key_Name (Key (Cursor)); + Write_TextEdit_Vector (Handler, Value (Cursor)); + end loop; + Handler.End_Object; + end; + end Write_changes_OfWorkspaceEdit; + + procedure Write_documentChanges_OfWorkspaceEdit_Item + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.documentChanges_OfWorkspaceEdit_Item) is + begin + case Value.Kind is + when LSP.Structures.Varian_1 => + Write_TextDocumentEdit (Handler, Value.Varian_1); + when LSP.Structures.create => + Write_CreateFile (Handler, Value.create); + when LSP.Structures.rename => + Write_RenameFile (Handler, Value.rename); + when LSP.Structures.delete => + Write_DeleteFile (Handler, Value.delete); + end case; + end Write_documentChanges_OfWorkspaceEdit_Item; + + procedure Write_changeAnnotations_OfWorkspaceEdit + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.changeAnnotations_OfWorkspaceEdit) is + begin + declare + use LSP.Structures.ChangeAnnotation_Maps; + begin + Handler.Start_Object; + for Cursor in Value.Iterate loop + Handler.Key_Name (Key (Cursor)); + Write_ChangeAnnotation (Handler, Value (Cursor)); + end loop; + Handler.End_Object; + end; + end Write_changeAnnotations_OfWorkspaceEdit; + + procedure Write_documentChanges_OfWorkspaceEdit + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.documentChanges_OfWorkspaceEdit) is + begin + Handler.Start_Array; + for J in Value.First_Index .. Value.Last_Index loop + Write_documentChanges_OfWorkspaceEdit_Item (Handler, Value (J)); + end loop; + Handler.End_Array; + end Write_documentChanges_OfWorkspaceEdit; + + begin + Handler.Start_Object; + if not Value.changes.Is_Empty then + Handler.Key_Name ("changes"); + declare + use LSP.Structures.TextEdit_Vector_Maps; + begin + Handler.Start_Object; + for Cursor in Value.changes.Iterate loop + Handler.Key_Name (Key (Cursor)); + Write_TextEdit_Vector (Handler, Value.changes (Cursor)); + end loop; + Handler.End_Object; + end; + end if; + if not Value.documentChanges.Is_Empty then + Handler.Key_Name ("documentChanges"); + Write_documentChanges_OfWorkspaceEdit + (Handler, Value.documentChanges); + end if; + if not Value.changeAnnotations.Is_Empty then + Handler.Key_Name ("changeAnnotations"); + declare + use LSP.Structures.ChangeAnnotation_Maps; + begin + Handler.Start_Object; + for Cursor in Value.changeAnnotations.Iterate loop + Handler.Key_Name (Key (Cursor)); + Write_ChangeAnnotation + (Handler, Value.changeAnnotations (Cursor)); + end loop; + Handler.End_Object; + end; + end if; + Handler.End_Object; + end Write_WorkspaceEdit; + + procedure Write_DocumentHighlight + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentHighlight) is + begin + Handler.Start_Object; + Handler.Key_Name ("range"); + Write_A_Range (Handler, Value.a_range); + if Value.kind.Is_Set then + Handler.Key_Name ("kind"); + Write_DocumentHighlightKind (Handler, Value.kind.Value); + end if; + Handler.End_Object; + end Write_DocumentHighlight; + + procedure Write_MessageActionItem + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.MessageActionItem) is + begin + Handler.Start_Object; + Handler.Key_Name ("title"); + Handler.String_Value (Value.title); + Handler.End_Object; + end Write_MessageActionItem; + + procedure Write_TextDocumentItem_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.TextDocumentItem_Vector) is + begin + Handler.Start_Array; + for J in Value.First_Index .. Value.Last_Index loop + Write_TextDocumentItem (Handler, Value (J)); + end loop; + Handler.End_Array; + end Write_TextDocumentItem_Vector; + + procedure Write_InlineValueRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.InlineValueRegistrationOptions) is + procedure Write_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSelector_Or_Null); + + procedure Write_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSelector_Or_Null) is + begin + if Value.Is_Null then + Handler.Null_Value; + else + Write_DocumentSelector (Handler, Value.Value); + end if; + end Write_DocumentSelector_Or_Null; + + begin + Handler.Start_Object; + if Value.workDoneProgress.Is_Set then + Handler.Key_Name ("workDoneProgress"); + Handler.Boolean_Value (Value.workDoneProgress.Value); + end if; + Handler.Key_Name ("documentSelector"); + Write_DocumentSelector_Or_Null (Handler, Value.Parent.documentSelector); + if not Value.id.Is_Null then + Handler.Key_Name ("id"); + Handler.String_Value (Value.id); + end if; + Handler.End_Object; + end Write_InlineValueRegistrationOptions; + + procedure Write_VersionedNotebookDocumentIdentifier + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.VersionedNotebookDocumentIdentifier) is + begin + Handler.Start_Object; + Handler.Key_Name ("version"); + Handler.Integer_Value (Integer'Pos (Value.version)); + Handler.Key_Name ("uri"); + Write_URI (Handler, Value.uri); + Handler.End_Object; + end Write_VersionedNotebookDocumentIdentifier; + + procedure Write_BaseSymbolInformation + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.BaseSymbolInformation) is + begin + Handler.Start_Object; + Handler.Key_Name ("name"); + Handler.String_Value (Value.name); + Handler.Key_Name ("kind"); + Write_SymbolKind (Handler, Value.kind); + if (for some Item of Value.tags => Item) then + Handler.Key_Name ("tags"); + Write_SymbolTag_Set (Handler, Value.tags); + end if; + if not Value.containerName.Is_Null then + Handler.Key_Name ("containerName"); + Handler.String_Value (Value.containerName); + end if; + Handler.End_Object; + end Write_BaseSymbolInformation; + + procedure Write_InlayHintParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.InlayHintParams) is + begin + Handler.Start_Object; + if Value.workDoneToken.Is_Set then + Handler.Key_Name ("workDoneToken"); + Write_ProgressToken (Handler, Value.workDoneToken.Value); + end if; + Handler.Key_Name ("textDocument"); + Write_TextDocumentIdentifier (Handler, Value.textDocument); + Handler.Key_Name ("range"); + Write_A_Range (Handler, Value.a_range); + Handler.End_Object; + end Write_InlayHintParams; + + procedure Write_WorkDoneProgressCreateParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.WorkDoneProgressCreateParams) is + begin + Handler.Start_Object; + Handler.Key_Name ("token"); + Write_ProgressToken (Handler, Value.token); + Handler.End_Object; + end Write_WorkDoneProgressCreateParams; + + procedure Write_TextEdit + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.TextEdit) is + begin + Handler.Start_Object; + Handler.Key_Name ("range"); + Write_A_Range (Handler, Value.a_range); + Handler.Key_Name ("newText"); + Handler.String_Value (Value.newText); + Handler.End_Object; + end Write_TextEdit; + + procedure Write_DeclarationClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DeclarationClientCapabilities) is + begin + Handler.Start_Object; + if Value.dynamicRegistration.Is_Set then + Handler.Key_Name ("dynamicRegistration"); + Handler.Boolean_Value (Value.dynamicRegistration.Value); + end if; + if Value.linkSupport.Is_Set then + Handler.Key_Name ("linkSupport"); + Handler.Boolean_Value (Value.linkSupport.Value); + end if; + Handler.End_Object; + end Write_DeclarationClientCapabilities; + + procedure Write_SignatureHelpOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SignatureHelpOptions) is + begin + Handler.Start_Object; + if Value.workDoneProgress.Is_Set then + Handler.Key_Name ("workDoneProgress"); + Handler.Boolean_Value (Value.workDoneProgress.Value); + end if; + if not Value.triggerCharacters.Is_Empty then + Handler.Key_Name ("triggerCharacters"); + Write_Virtual_String_Vector (Handler, Value.triggerCharacters); + end if; + if not Value.retriggerCharacters.Is_Empty then + Handler.Key_Name ("retriggerCharacters"); + Write_Virtual_String_Vector (Handler, Value.retriggerCharacters); + end if; + Handler.End_Object; + end Write_SignatureHelpOptions; + + procedure Write_SemanticTokensEdit + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SemanticTokensEdit) is + begin + Handler.Start_Object; + Handler.Key_Name ("start"); + Handler.Integer_Value (Integer'Pos (Value.start)); + Handler.Key_Name ("deleteCount"); + Handler.Integer_Value (Integer'Pos (Value.deleteCount)); + if not Value.data.Is_Empty then + Handler.Key_Name ("data"); + Write_Natural_Vector (Handler, Value.data); + end if; + Handler.End_Object; + end Write_SemanticTokensEdit; + + procedure Write_DocumentHighlightParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentHighlightParams) is + begin + Handler.Start_Object; + Handler.Key_Name ("textDocument"); + Write_TextDocumentIdentifier (Handler, Value.textDocument); + Handler.Key_Name ("position"); + Write_Position (Handler, Value.position); + if Value.workDoneToken.Is_Set then + Handler.Key_Name ("workDoneToken"); + Write_ProgressToken (Handler, Value.workDoneToken.Value); + end if; + if Value.partialResultToken.Is_Set then + Handler.Key_Name ("partialResultToken"); + Write_ProgressToken (Handler, Value.partialResultToken.Value); + end if; + Handler.End_Object; + end Write_DocumentHighlightParams; + + procedure Write_FileCreate + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.FileCreate) is + begin + Handler.Start_Object; + Handler.Key_Name ("uri"); + Handler.String_Value (Value.uri); + Handler.End_Object; + end Write_FileCreate; + + procedure Write_WorkspaceFullDocumentDiagnosticReport + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.WorkspaceFullDocumentDiagnosticReport) is + begin + Handler.Start_Object; + Handler.Key_Name ("kind"); + Handler.String_Value ("full"); + if not Value.resultId.Is_Null then + Handler.Key_Name ("resultId"); + Handler.String_Value (Value.resultId); + end if; + Handler.Key_Name ("items"); + Write_Diagnostic_Vector (Handler, Value.items); + Handler.Key_Name ("uri"); + Handler.String_Value (Value.uri); + Handler.Key_Name ("version"); + Write_Integer_Or_Null (Handler, Value.version); + Handler.End_Object; + end Write_WorkspaceFullDocumentDiagnosticReport; + + procedure Write_SemanticTokens_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SemanticTokens_Or_Null) is + begin + if Value.Is_Null then + Handler.Null_Value; + else + Write_SemanticTokens (Handler, Value.Value); + end if; + end Write_SemanticTokens_Or_Null; + + procedure Write_SemanticTokensRangeParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SemanticTokensRangeParams) is + begin + Handler.Start_Object; + if Value.workDoneToken.Is_Set then + Handler.Key_Name ("workDoneToken"); + Write_ProgressToken (Handler, Value.workDoneToken.Value); + end if; + if Value.partialResultToken.Is_Set then + Handler.Key_Name ("partialResultToken"); + Write_ProgressToken (Handler, Value.partialResultToken.Value); + end if; + Handler.Key_Name ("textDocument"); + Write_TextDocumentIdentifier (Handler, Value.textDocument); + Handler.Key_Name ("range"); + Write_A_Range (Handler, Value.a_range); + Handler.End_Object; + end Write_SemanticTokensRangeParams; + + procedure Write_FoldingRange + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.FoldingRange) is + begin + Handler.Start_Object; + Handler.Key_Name ("startLine"); + Handler.Integer_Value (Integer'Pos (Value.startLine)); + if Value.startCharacter.Is_Set then + Handler.Key_Name ("startCharacter"); + Handler.Integer_Value (Integer'Pos (Value.startCharacter.Value)); + end if; + Handler.Key_Name ("endLine"); + Handler.Integer_Value (Integer'Pos (Value.endLine)); + if Value.endCharacter.Is_Set then + Handler.Key_Name ("endCharacter"); + Handler.Integer_Value (Integer'Pos (Value.endCharacter.Value)); + end if; + if Value.kind.Is_Set then + Handler.Key_Name ("kind"); + Write_FoldingRangeKind (Handler, Value.kind.Value); + end if; + if not Value.collapsedText.Is_Null then + Handler.Key_Name ("collapsedText"); + Handler.String_Value (Value.collapsedText); + end if; + Handler.End_Object; + end Write_FoldingRange; + + procedure Write_SemanticTokensDeltaPartialResult + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SemanticTokensDeltaPartialResult) is + begin + Handler.Start_Object; + Handler.Key_Name ("edits"); + Write_SemanticTokensEdit_Vector (Handler, Value.edits); + Handler.End_Object; + end Write_SemanticTokensDeltaPartialResult; + + procedure Write_NotebookDocumentClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.NotebookDocumentClientCapabilities) is + begin + Handler.Start_Object; + Handler.Key_Name ("synchronization"); + Write_NotebookDocumentSyncClientCapabilities + (Handler, Value.synchronization); + Handler.End_Object; + end Write_NotebookDocumentClientCapabilities; + + procedure Write_CompletionParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CompletionParams) is + begin + Handler.Start_Object; + Handler.Key_Name ("textDocument"); + Write_TextDocumentIdentifier (Handler, Value.textDocument); + Handler.Key_Name ("position"); + Write_Position (Handler, Value.position); + if Value.workDoneToken.Is_Set then + Handler.Key_Name ("workDoneToken"); + Write_ProgressToken (Handler, Value.workDoneToken.Value); + end if; + if Value.partialResultToken.Is_Set then + Handler.Key_Name ("partialResultToken"); + Write_ProgressToken (Handler, Value.partialResultToken.Value); + end if; + if Value.context.Is_Set then + Handler.Key_Name ("context"); + Write_CompletionContext (Handler, Value.context.Value); + end if; + Handler.End_Object; + end Write_CompletionParams; + + procedure Write_CallHierarchyIncomingCallsParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CallHierarchyIncomingCallsParams) is + begin + Handler.Start_Object; + if Value.workDoneToken.Is_Set then + Handler.Key_Name ("workDoneToken"); + Write_ProgressToken (Handler, Value.workDoneToken.Value); + end if; + if Value.partialResultToken.Is_Set then + Handler.Key_Name ("partialResultToken"); + Write_ProgressToken (Handler, Value.partialResultToken.Value); + end if; + Handler.Key_Name ("item"); + Write_CallHierarchyItem (Handler, Value.item); + Handler.End_Object; + end Write_CallHierarchyIncomingCallsParams; + + procedure Write_Location_Vector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Location_Vector_Or_Null) is + begin + if Value.Is_Empty then + Handler.Null_Value; + else + Write_Location_Vector (Handler, Value); + end if; + end Write_Location_Vector_Or_Null; + + procedure Write_WorkspaceSymbolClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.WorkspaceSymbolClientCapabilities) is + begin + Handler.Start_Object; + if Value.dynamicRegistration.Is_Set then + Handler.Key_Name ("dynamicRegistration"); + Handler.Boolean_Value (Value.dynamicRegistration.Value); + end if; + if Value.symbolKind.Is_Set then + Handler.Key_Name ("symbolKind"); + Write_symbolKind_OfWorkspaceSymbolClientCapabilities + (Handler, Value.symbolKind.Value); + end if; + if Value.tagSupport.Is_Set then + Handler.Key_Name ("tagSupport"); + Write_tagSupport_OfWorkspaceSymbolClientCapabilities + (Handler, Value.tagSupport.Value); + end if; + if Value.resolveSupport.Is_Set then + Handler.Key_Name ("resolveSupport"); + Write_resolveSupport_OfWorkspaceSymbolClientCapabilities + (Handler, Value.resolveSupport.Value); + end if; + Handler.End_Object; + end Write_WorkspaceSymbolClientCapabilities; + + procedure Write_Boolean_Or_Something + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Boolean_Or_Something) is + begin + case Value.Is_Boolean is + when True => + Handler.Boolean_Value (Value.Boolean); + when False => + Handler.Start_Object; + if Value.a_delta.Is_Set then + Handler.Key_Name ("delta"); + Handler.Boolean_Value (Value.a_delta.Value); + end if; + Handler.End_Object; + end case; + end Write_Boolean_Or_Something; + + procedure Write_TypeHierarchyOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.TypeHierarchyOptions) is + begin + Handler.Start_Object; + if Value.workDoneProgress.Is_Set then + Handler.Key_Name ("workDoneProgress"); + Handler.Boolean_Value (Value.workDoneProgress.Value); + end if; + Handler.End_Object; + end Write_TypeHierarchyOptions; + + procedure Write_SelectionRangeRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SelectionRangeRegistrationOptions) is + procedure Write_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSelector_Or_Null); + + procedure Write_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSelector_Or_Null) is + begin + if Value.Is_Null then + Handler.Null_Value; + else + Write_DocumentSelector (Handler, Value.Value); + end if; + end Write_DocumentSelector_Or_Null; + + begin + Handler.Start_Object; + if Value.workDoneProgress.Is_Set then + Handler.Key_Name ("workDoneProgress"); + Handler.Boolean_Value (Value.workDoneProgress.Value); + end if; + Handler.Key_Name ("documentSelector"); + Write_DocumentSelector_Or_Null (Handler, Value.Parent.documentSelector); + if not Value.id.Is_Null then + Handler.Key_Name ("id"); + Handler.String_Value (Value.id); + end if; + Handler.End_Object; + end Write_SelectionRangeRegistrationOptions; + + procedure Write_DidChangeNotebookDocumentParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DidChangeNotebookDocumentParams) is + begin + Handler.Start_Object; + Handler.Key_Name ("notebookDocument"); + Write_VersionedNotebookDocumentIdentifier + (Handler, Value.notebookDocument); + Handler.Key_Name ("change"); + Write_NotebookDocumentChangeEvent (Handler, Value.change); + Handler.End_Object; + end Write_DidChangeNotebookDocumentParams; + + procedure Write_RegularExpressionsClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.RegularExpressionsClientCapabilities) is + begin + Handler.Start_Object; + Handler.Key_Name ("engine"); + Handler.String_Value (Value.engine); + if not Value.version.Is_Null then + Handler.Key_Name ("version"); + Handler.String_Value (Value.version); + end if; + Handler.End_Object; + end Write_RegularExpressionsClientCapabilities; + + procedure Write_WorkspaceDocumentDiagnosticReport + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.WorkspaceDocumentDiagnosticReport) is + begin + case Value.Kind is + when LSP.Structures.full => + Write_WorkspaceFullDocumentDiagnosticReport (Handler, Value.full); + when LSP.Structures.unchanged => + Write_WorkspaceUnchangedDocumentDiagnosticReport + (Handler, Value.unchanged); + end case; + end Write_WorkspaceDocumentDiagnosticReport; + + procedure Write_WorkspaceClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.WorkspaceClientCapabilities) is + begin + Handler.Start_Object; + if Value.applyEdit.Is_Set then + Handler.Key_Name ("applyEdit"); + Handler.Boolean_Value (Value.applyEdit.Value); + end if; + if Value.workspaceEdit.Is_Set then + Handler.Key_Name ("workspaceEdit"); + Write_WorkspaceEditClientCapabilities + (Handler, Value.workspaceEdit.Value); + end if; + if Value.didChangeConfiguration.Is_Set then + Handler.Key_Name ("didChangeConfiguration"); + Write_DidChangeConfigurationClientCapabilities + (Handler, Value.didChangeConfiguration.Value); + end if; + if Value.didChangeWatchedFiles.Is_Set then + Handler.Key_Name ("didChangeWatchedFiles"); + Write_DidChangeWatchedFilesClientCapabilities + (Handler, Value.didChangeWatchedFiles.Value); + end if; + if Value.symbol.Is_Set then + Handler.Key_Name ("symbol"); + Write_WorkspaceSymbolClientCapabilities (Handler, Value.symbol.Value); + end if; + if Value.executeCommand.Is_Set then + Handler.Key_Name ("executeCommand"); + Write_ExecuteCommandClientCapabilities + (Handler, Value.executeCommand.Value); + end if; + if Value.workspaceFolders.Is_Set then + Handler.Key_Name ("workspaceFolders"); + Handler.Boolean_Value (Value.workspaceFolders.Value); + end if; + if Value.configuration.Is_Set then + Handler.Key_Name ("configuration"); + Handler.Boolean_Value (Value.configuration.Value); + end if; + if Value.semanticTokens.Is_Set then + Handler.Key_Name ("semanticTokens"); + Write_SemanticTokensWorkspaceClientCapabilities + (Handler, Value.semanticTokens.Value); + end if; + if Value.codeLens.Is_Set then + Handler.Key_Name ("codeLens"); + Write_CodeLensWorkspaceClientCapabilities + (Handler, Value.codeLens.Value); + end if; + if Value.fileOperations.Is_Set then + Handler.Key_Name ("fileOperations"); + Write_FileOperationClientCapabilities + (Handler, Value.fileOperations.Value); + end if; + if Value.inlineValue.Is_Set then + Handler.Key_Name ("inlineValue"); + Write_InlineValueWorkspaceClientCapabilities + (Handler, Value.inlineValue.Value); + end if; + if Value.inlayHint.Is_Set then + Handler.Key_Name ("inlayHint"); + Write_InlayHintWorkspaceClientCapabilities + (Handler, Value.inlayHint.Value); + end if; + if Value.diagnostics.Is_Set then + Handler.Key_Name ("diagnostics"); + Write_DiagnosticWorkspaceClientCapabilities + (Handler, Value.diagnostics.Value); + end if; + Handler.End_Object; + end Write_WorkspaceClientCapabilities; + + procedure Write_WorkspaceDiagnosticParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.WorkspaceDiagnosticParams) is + procedure Write_PreviousResultId_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.PreviousResultId_Vector); + + procedure Write_PreviousResultId_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.PreviousResultId_Vector) is + begin + Handler.Start_Array; + for J in Value.First_Index .. Value.Last_Index loop + Write_PreviousResultId (Handler, Value (J)); + end loop; + Handler.End_Array; + end Write_PreviousResultId_Vector; + + begin + Handler.Start_Object; + if Value.workDoneToken.Is_Set then + Handler.Key_Name ("workDoneToken"); + Write_ProgressToken (Handler, Value.workDoneToken.Value); + end if; + if Value.partialResultToken.Is_Set then + Handler.Key_Name ("partialResultToken"); + Write_ProgressToken (Handler, Value.partialResultToken.Value); + end if; + if not Value.identifier.Is_Null then + Handler.Key_Name ("identifier"); + Handler.String_Value (Value.identifier); + end if; + Handler.Key_Name ("previousResultIds"); + Write_PreviousResultId_Vector (Handler, Value.previousResultIds); + Handler.End_Object; + end Write_WorkspaceDiagnosticParams; + + procedure Write_TextDocumentSyncKind + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.TextDocumentSyncKind) is + begin + case Value is + when LSP.Enumerations.None => + Handler.Integer_Value (0); + when LSP.Enumerations.Full => + Handler.Integer_Value (1); + when LSP.Enumerations.Incremental => + Handler.Integer_Value (2); + end case; + end Write_TextDocumentSyncKind; + + procedure Write_InlayHintOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.InlayHintOptions) is + begin + Handler.Start_Object; + if Value.workDoneProgress.Is_Set then + Handler.Key_Name ("workDoneProgress"); + Handler.Boolean_Value (Value.workDoneProgress.Value); + end if; + if Value.resolveProvider.Is_Set then + Handler.Key_Name ("resolveProvider"); + Handler.Boolean_Value (Value.resolveProvider.Value); + end if; + Handler.End_Object; + end Write_InlayHintOptions; + + procedure Write_InlineValueOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.InlineValueOptions) is + begin + Handler.Start_Object; + if Value.workDoneProgress.Is_Set then + Handler.Key_Name ("workDoneProgress"); + Handler.Boolean_Value (Value.workDoneProgress.Value); + end if; + Handler.End_Object; + end Write_InlineValueOptions; + + procedure Write_WorkspaceFoldersChangeEvent + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.WorkspaceFoldersChangeEvent) is + begin + Handler.Start_Object; + Handler.Key_Name ("added"); + Write_WorkspaceFolder_Vector (Handler, Value.added); + Handler.Key_Name ("removed"); + Write_WorkspaceFolder_Vector (Handler, Value.removed); + Handler.End_Object; + end Write_WorkspaceFoldersChangeEvent; + + procedure Write_TypeDefinitionClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.TypeDefinitionClientCapabilities) is + begin + Handler.Start_Object; + if Value.dynamicRegistration.Is_Set then + Handler.Key_Name ("dynamicRegistration"); + Handler.Boolean_Value (Value.dynamicRegistration.Value); + end if; + if Value.linkSupport.Is_Set then + Handler.Key_Name ("linkSupport"); + Handler.Boolean_Value (Value.linkSupport.Value); + end if; + Handler.End_Object; + end Write_TypeDefinitionClientCapabilities; + + procedure Write_CreateFileOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CreateFileOptions) is + begin + Handler.Start_Object; + if Value.overwrite.Is_Set then + Handler.Key_Name ("overwrite"); + Handler.Boolean_Value (Value.overwrite.Value); + end if; + if Value.ignoreIfExists.Is_Set then + Handler.Key_Name ("ignoreIfExists"); + Handler.Boolean_Value (Value.ignoreIfExists.Value); + end if; + Handler.End_Object; + end Write_CreateFileOptions; + + procedure Write_DiagnosticRelatedInformation + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DiagnosticRelatedInformation) is + begin + Handler.Start_Object; + Handler.Key_Name ("location"); + Write_Location (Handler, Value.location); + Handler.Key_Name ("message"); + Handler.String_Value (Value.message); + Handler.End_Object; + end Write_DiagnosticRelatedInformation; + + procedure Write_InsertTextMode + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.InsertTextMode) is + begin + case Value is + when LSP.Enumerations.asIs => + Handler.Integer_Value (1); + when LSP.Enumerations.adjustIndentation => + Handler.Integer_Value (2); + end case; + end Write_InsertTextMode; + + procedure Write_InlineValue_Vector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.InlineValue_Vector_Or_Null) is + begin + if Value.Is_Empty then + Handler.Null_Value; + else + Write_InlineValue_Vector (Handler, Value); + end if; + end Write_InlineValue_Vector_Or_Null; + + procedure Write_DidCloseNotebookDocumentParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DidCloseNotebookDocumentParams) is + begin + Handler.Start_Object; + Handler.Key_Name ("notebookDocument"); + Write_NotebookDocumentIdentifier (Handler, Value.notebookDocument); + Handler.Key_Name ("cellTextDocuments"); + Write_TextDocumentIdentifier_Vector (Handler, Value.cellTextDocuments); + Handler.End_Object; + end Write_DidCloseNotebookDocumentParams; + + procedure Write_ImplementationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ImplementationOptions) is + begin + Handler.Start_Object; + if Value.workDoneProgress.Is_Set then + Handler.Key_Name ("workDoneProgress"); + Handler.Boolean_Value (Value.workDoneProgress.Value); + end if; + Handler.End_Object; + end Write_ImplementationOptions; + + procedure Write_InlayHint_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.InlayHint_Vector) is + begin + Handler.Start_Array; + for J in Value.First_Index .. Value.Last_Index loop + Write_InlayHint (Handler, Value (J)); + end loop; + Handler.End_Array; + end Write_InlayHint_Vector; + + procedure Write_DocumentColorRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentColorRegistrationOptions) is + procedure Write_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSelector_Or_Null); + + procedure Write_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSelector_Or_Null) is + begin + if Value.Is_Null then + Handler.Null_Value; + else + Write_DocumentSelector (Handler, Value.Value); + end if; + end Write_DocumentSelector_Or_Null; + + begin + Handler.Start_Object; + Handler.Key_Name ("documentSelector"); + Write_DocumentSelector_Or_Null (Handler, Value.Parent.documentSelector); + if Value.workDoneProgress.Is_Set then + Handler.Key_Name ("workDoneProgress"); + Handler.Boolean_Value (Value.workDoneProgress.Value); + end if; + if not Value.id.Is_Null then + Handler.Key_Name ("id"); + Handler.String_Value (Value.id); + end if; + Handler.End_Object; + end Write_DocumentColorRegistrationOptions; + + procedure Write_CodeActionOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CodeActionOptions) is + begin + Handler.Start_Object; + if Value.workDoneProgress.Is_Set then + Handler.Key_Name ("workDoneProgress"); + Handler.Boolean_Value (Value.workDoneProgress.Value); + end if; + if (for some Item of Value.codeActionKinds => Item) then + Handler.Key_Name ("codeActionKinds"); + Write_CodeActionKind_Set (Handler, Value.codeActionKinds); + end if; + if Value.resolveProvider.Is_Set then + Handler.Key_Name ("resolveProvider"); + Handler.Boolean_Value (Value.resolveProvider.Value); + end if; + Handler.End_Object; + end Write_CodeActionOptions; + + procedure Write_CompletionItemKind + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.CompletionItemKind) is + begin + case Value is + when LSP.Enumerations.Text => + Handler.Integer_Value (1); + when LSP.Enumerations.Method => + Handler.Integer_Value (2); + when LSP.Enumerations.A_Function => + Handler.Integer_Value (3); + when LSP.Enumerations.Constructor => + Handler.Integer_Value (4); + when LSP.Enumerations.Field => + Handler.Integer_Value (5); + when LSP.Enumerations.Variable => + Handler.Integer_Value (6); + when LSP.Enumerations.Class => + Handler.Integer_Value (7); + when LSP.Enumerations.An_Interface => + Handler.Integer_Value (8); + when LSP.Enumerations.Module => + Handler.Integer_Value (9); + when LSP.Enumerations.Property => + Handler.Integer_Value (10); + when LSP.Enumerations.Unit => + Handler.Integer_Value (11); + when LSP.Enumerations.Value => + Handler.Integer_Value (12); + when LSP.Enumerations.Enum => + Handler.Integer_Value (13); + when LSP.Enumerations.Keyword => + Handler.Integer_Value (14); + when LSP.Enumerations.Snippet => + Handler.Integer_Value (15); + when LSP.Enumerations.Color => + Handler.Integer_Value (16); + when LSP.Enumerations.File => + Handler.Integer_Value (17); + when LSP.Enumerations.Reference => + Handler.Integer_Value (18); + when LSP.Enumerations.Folder => + Handler.Integer_Value (19); + when LSP.Enumerations.EnumMember => + Handler.Integer_Value (20); + when LSP.Enumerations.A_Constant => + Handler.Integer_Value (21); + when LSP.Enumerations.Struct => + Handler.Integer_Value (22); + when LSP.Enumerations.Event => + Handler.Integer_Value (23); + when LSP.Enumerations.Operator => + Handler.Integer_Value (24); + when LSP.Enumerations.TypeParameter => + Handler.Integer_Value (25); + end case; + end Write_CompletionItemKind; + + procedure Write_ShowDocumentParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ShowDocumentParams) is + begin + Handler.Start_Object; + Handler.Key_Name ("uri"); + Write_URI (Handler, Value.uri); + if Value.external.Is_Set then + Handler.Key_Name ("external"); + Handler.Boolean_Value (Value.external.Value); + end if; + if Value.takeFocus.Is_Set then + Handler.Key_Name ("takeFocus"); + Handler.Boolean_Value (Value.takeFocus.Value); + end if; + if Value.selection.Is_Set then + Handler.Key_Name ("selection"); + Write_A_Range (Handler, Value.selection.Value); + end if; + Handler.End_Object; + end Write_ShowDocumentParams; + + procedure Write_Command_Or_CodeAction + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Command_Or_CodeAction) is + begin + case Value.Is_Command is + when True => + Write_Command (Handler, Value.Command); + when False => + Write_CodeAction (Handler, Value.CodeAction); + end case; + end Write_Command_Or_CodeAction; + + procedure Write_CreateFilesParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CreateFilesParams) is + procedure Write_FileCreate_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.FileCreate_Vector); + + procedure Write_FileCreate_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.FileCreate_Vector) is + begin + Handler.Start_Array; + for J in Value.First_Index .. Value.Last_Index loop + Write_FileCreate (Handler, Value (J)); + end loop; + Handler.End_Array; + end Write_FileCreate_Vector; + + begin + Handler.Start_Object; + Handler.Key_Name ("files"); + Write_FileCreate_Vector (Handler, Value.files); + Handler.End_Object; + end Write_CreateFilesParams; + + procedure Write_ColorPresentation_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ColorPresentation_Vector) is + begin + Handler.Start_Array; + for J in Value.First_Index .. Value.Last_Index loop + Write_ColorPresentation (Handler, Value (J)); + end loop; + Handler.End_Array; + end Write_ColorPresentation_Vector; + + procedure Write_ChangeAnnotationIdentifier + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ChangeAnnotationIdentifier) is + begin + Handler.String_Value (Value); + end Write_ChangeAnnotationIdentifier; + + procedure Write_DocumentFormattingParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentFormattingParams) is + begin + Handler.Start_Object; + if Value.workDoneToken.Is_Set then + Handler.Key_Name ("workDoneToken"); + Write_ProgressToken (Handler, Value.workDoneToken.Value); + end if; + Handler.Key_Name ("textDocument"); + Write_TextDocumentIdentifier (Handler, Value.textDocument); + Handler.Key_Name ("options"); + Write_FormattingOptions (Handler, Value.options); + Handler.End_Object; + end Write_DocumentFormattingParams; + + procedure Write_SignatureHelpContext + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SignatureHelpContext) is + begin + Handler.Start_Object; + Handler.Key_Name ("triggerKind"); + Write_SignatureHelpTriggerKind (Handler, Value.triggerKind); + if not Value.triggerCharacter.Is_Null then + Handler.Key_Name ("triggerCharacter"); + Handler.String_Value (Value.triggerCharacter); + end if; + Handler.Key_Name ("isRetrigger"); + Handler.Boolean_Value (Value.isRetrigger); + if Value.activeSignatureHelp.Is_Set then + Handler.Key_Name ("activeSignatureHelp"); + Write_SignatureHelp (Handler, Value.activeSignatureHelp.Value); + end if; + Handler.End_Object; + end Write_SignatureHelpContext; + + procedure Write_DeleteFilesParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DeleteFilesParams) is + procedure Write_FileDelete_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.FileDelete_Vector); + + procedure Write_FileDelete_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.FileDelete_Vector) is + begin + Handler.Start_Array; + for J in Value.First_Index .. Value.Last_Index loop + Write_FileDelete (Handler, Value (J)); + end loop; + Handler.End_Array; + end Write_FileDelete_Vector; + + begin + Handler.Start_Object; + Handler.Key_Name ("files"); + Write_FileDelete_Vector (Handler, Value.files); + Handler.End_Object; + end Write_DeleteFilesParams; + + procedure Write_TypeHierarchyItem_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.TypeHierarchyItem_Vector) is + begin + Handler.Start_Array; + for J in Value.First_Index .. Value.Last_Index loop + Write_TypeHierarchyItem (Handler, Value (J)); + end loop; + Handler.End_Array; + end Write_TypeHierarchyItem_Vector; + + procedure Write_DocumentOnTypeFormattingParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentOnTypeFormattingParams) is + begin + Handler.Start_Object; + Handler.Key_Name ("textDocument"); + Write_TextDocumentIdentifier (Handler, Value.textDocument); + Handler.Key_Name ("position"); + Write_Position (Handler, Value.position); + Handler.Key_Name ("ch"); + Handler.String_Value (Value.ch); + Handler.Key_Name ("options"); + Write_FormattingOptions (Handler, Value.options); + Handler.End_Object; + end Write_DocumentOnTypeFormattingParams; + + procedure Write_CallHierarchyOutgoingCall + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CallHierarchyOutgoingCall) is + begin + Handler.Start_Object; + Handler.Key_Name ("to"); + Write_CallHierarchyItem (Handler, Value.to); + Handler.Key_Name ("fromRanges"); + Write_Range_Vector (Handler, Value.fromRanges); + Handler.End_Object; + end Write_CallHierarchyOutgoingCall; + + procedure Write_Location_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Location_Vector) is + begin + Handler.Start_Array; + for J in Value.First_Index .. Value.Last_Index loop + Write_Location (Handler, Value (J)); + end loop; + Handler.End_Array; + end Write_Location_Vector; + + procedure Write_TextDocumentContentChangeEvent + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.TextDocumentContentChangeEvent) is + begin + Handler.Start_Object; + if Value.a_range.Is_Set then + Handler.Key_Name ("range"); + Write_A_Range (Handler, Value.a_range.Value); + end if; + if Value.rangeLength.Is_Set then + Handler.Key_Name ("rangeLength"); + Handler.Integer_Value (Integer'Pos (Value.rangeLength.Value)); + end if; + Handler.Key_Name ("text"); + Handler.String_Value (Value.text); + Handler.End_Object; + end Write_TextDocumentContentChangeEvent; + + procedure Write_DocumentColorParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentColorParams) is + begin + Handler.Start_Object; + if Value.workDoneToken.Is_Set then + Handler.Key_Name ("workDoneToken"); + Write_ProgressToken (Handler, Value.workDoneToken.Value); + end if; + if Value.partialResultToken.Is_Set then + Handler.Key_Name ("partialResultToken"); + Write_ProgressToken (Handler, Value.partialResultToken.Value); + end if; + Handler.Key_Name ("textDocument"); + Write_TextDocumentIdentifier (Handler, Value.textDocument); + Handler.End_Object; + end Write_DocumentColorParams; + + procedure Write_WorkspaceFolder + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.WorkspaceFolder) is + begin + Handler.Start_Object; + Handler.Key_Name ("uri"); + Write_URI (Handler, Value.uri); + Handler.Key_Name ("name"); + Handler.String_Value (Value.name); + Handler.End_Object; + end Write_WorkspaceFolder; + + procedure Write_MarkedString + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.MarkedString) is + begin + case Value.Is_Virtual_String is + when True => + Handler.String_Value (Value.Virtual_String); + when False => + Handler.Start_Object; + Handler.Key_Name ("language"); + Handler.String_Value (Value.language); + Handler.Key_Name ("value"); + Handler.String_Value (Value.value); + Handler.End_Object; + end case; + end Write_MarkedString; + + procedure Write_NotebookCell + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.NotebookCell) is + begin + Handler.Start_Object; + Handler.Key_Name ("kind"); + Write_NotebookCellKind (Handler, Value.kind); + Handler.Key_Name ("document"); + Handler.String_Value (Value.document); + if Value.metadata.Is_Set then + Handler.Key_Name ("metadata"); + Write_LSPObject (Handler, Value.metadata.Value); + end if; + if Value.executionSummary.Is_Set then + Handler.Key_Name ("executionSummary"); + Write_ExecutionSummary (Handler, Value.executionSummary.Value); + end if; + Handler.End_Object; + end Write_NotebookCell; + + procedure Write_DocumentLink + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentLink) is + begin + Handler.Start_Object; + Handler.Key_Name ("range"); + Write_A_Range (Handler, Value.a_range); + if not Value.target.Is_Null then + Handler.Key_Name ("target"); + Handler.String_Value (Value.target); + end if; + if not Value.tooltip.Is_Null then + Handler.Key_Name ("tooltip"); + Handler.String_Value (Value.tooltip); + end if; + if not Value.data.Is_Empty then + Handler.Key_Name ("data"); + Write_LSPAny (Handler, Value.data); + end if; + Handler.End_Object; + end Write_DocumentLink; + + procedure Write_WorkspaceFoldersServerCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.WorkspaceFoldersServerCapabilities) is + procedure Write_Virtual_String_Or_Boolean + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Virtual_String_Or_Boolean); + + procedure Write_Virtual_String_Or_Boolean + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Virtual_String_Or_Boolean) is + begin + case Value.Is_Virtual_String is + when True => + Handler.String_Value (Value.Virtual_String); + when False => + Handler.Boolean_Value (Value.Boolean); + end case; + end Write_Virtual_String_Or_Boolean; + + begin + Handler.Start_Object; + if Value.supported.Is_Set then + Handler.Key_Name ("supported"); + Handler.Boolean_Value (Value.supported.Value); + end if; + if Value.changeNotifications.Is_Set then + Handler.Key_Name ("changeNotifications"); + Write_Virtual_String_Or_Boolean + (Handler, Value.changeNotifications.Value); + end if; + Handler.End_Object; + end Write_WorkspaceFoldersServerCapabilities; + + procedure Write_WorkDoneProgressEnd + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.WorkDoneProgressEnd) is + begin + Handler.Start_Object; + Handler.Key_Name ("kind"); + Handler.String_Value ("end"); + if not Value.message.Is_Null then + Handler.Key_Name ("message"); + Handler.String_Value (Value.message); + end if; + Handler.End_Object; + end Write_WorkDoneProgressEnd; + + procedure Write_SemanticTokensRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SemanticTokensRegistrationOptions) is + procedure Write_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSelector_Or_Null); + + procedure Write_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSelector_Or_Null) is + begin + if Value.Is_Null then + Handler.Null_Value; + else + Write_DocumentSelector (Handler, Value.Value); + end if; + end Write_DocumentSelector_Or_Null; + + begin + Handler.Start_Object; + Handler.Key_Name ("documentSelector"); + Write_DocumentSelector_Or_Null (Handler, Value.Parent.documentSelector); + if Value.workDoneProgress.Is_Set then + Handler.Key_Name ("workDoneProgress"); + Handler.Boolean_Value (Value.workDoneProgress.Value); + end if; + Handler.Key_Name ("legend"); + Write_SemanticTokensLegend (Handler, Value.legend); + if Value.a_range.Is_Set then + Handler.Key_Name ("range"); + Write_Boolean_Or_Any (Handler, Value.a_range.Value); + end if; + if Value.full.Is_Set then + Handler.Key_Name ("full"); + Write_Boolean_Or_Something (Handler, Value.full.Value); + end if; + if not Value.id.Is_Null then + Handler.Key_Name ("id"); + Handler.String_Value (Value.id); + end if; + Handler.End_Object; + end Write_SemanticTokensRegistrationOptions; + + procedure Write_CompletionTriggerKind + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.CompletionTriggerKind) is + begin + case Value is + when LSP.Enumerations.Invoked => + Handler.Integer_Value (1); + when LSP.Enumerations.TriggerCharacter => + Handler.Integer_Value (2); + when LSP.Enumerations.TriggerForIncompleteCompletions => + Handler.Integer_Value (3); + end case; + end Write_CompletionTriggerKind; + + procedure Write_CallHierarchyRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CallHierarchyRegistrationOptions) is + procedure Write_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSelector_Or_Null); + + procedure Write_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSelector_Or_Null) is + begin + if Value.Is_Null then + Handler.Null_Value; + else + Write_DocumentSelector (Handler, Value.Value); + end if; + end Write_DocumentSelector_Or_Null; + + begin + Handler.Start_Object; + Handler.Key_Name ("documentSelector"); + Write_DocumentSelector_Or_Null (Handler, Value.Parent.documentSelector); + if Value.workDoneProgress.Is_Set then + Handler.Key_Name ("workDoneProgress"); + Handler.Boolean_Value (Value.workDoneProgress.Value); + end if; + if not Value.id.Is_Null then + Handler.Key_Name ("id"); + Handler.String_Value (Value.id); + end if; + Handler.End_Object; + end Write_CallHierarchyRegistrationOptions; + + procedure Write_CallHierarchyClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CallHierarchyClientCapabilities) is + begin + Handler.Start_Object; + if Value.dynamicRegistration.Is_Set then + Handler.Key_Name ("dynamicRegistration"); + Handler.Boolean_Value (Value.dynamicRegistration.Value); + end if; + Handler.End_Object; + end Write_CallHierarchyClientCapabilities; + + procedure Write_DocumentSymbolParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSymbolParams) is + begin + Handler.Start_Object; + if Value.workDoneToken.Is_Set then + Handler.Key_Name ("workDoneToken"); + Write_ProgressToken (Handler, Value.workDoneToken.Value); + end if; + if Value.partialResultToken.Is_Set then + Handler.Key_Name ("partialResultToken"); + Write_ProgressToken (Handler, Value.partialResultToken.Value); + end if; + Handler.Key_Name ("textDocument"); + Write_TextDocumentIdentifier (Handler, Value.textDocument); + Handler.End_Object; + end Write_DocumentSymbolParams; + + procedure Write_DocumentRangeFormattingOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentRangeFormattingOptions) is + begin + Handler.Start_Object; + if Value.workDoneProgress.Is_Set then + Handler.Key_Name ("workDoneProgress"); + Handler.Boolean_Value (Value.workDoneProgress.Value); + end if; + Handler.End_Object; + end Write_DocumentRangeFormattingOptions; + + procedure Write_InlayHintWorkspaceClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.InlayHintWorkspaceClientCapabilities) is + begin + Handler.Start_Object; + if Value.refreshSupport.Is_Set then + Handler.Key_Name ("refreshSupport"); + Handler.Boolean_Value (Value.refreshSupport.Value); + end if; + Handler.End_Object; + end Write_InlayHintWorkspaceClientCapabilities; + + procedure Write_InlineValue_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.InlineValue_Vector) is + begin + Handler.Start_Array; + for J in Value.First_Index .. Value.Last_Index loop + Write_InlineValue (Handler, Value (J)); + end loop; + Handler.End_Array; + end Write_InlineValue_Vector; + + procedure Write_DiagnosticServerCancellationData + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DiagnosticServerCancellationData) is + begin + Handler.Start_Object; + Handler.Key_Name ("retriggerRequest"); + Handler.Boolean_Value (Value.retriggerRequest); + Handler.End_Object; + end Write_DiagnosticServerCancellationData; + + procedure Write_DocumentColorOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentColorOptions) is + begin + Handler.Start_Object; + if Value.workDoneProgress.Is_Set then + Handler.Key_Name ("workDoneProgress"); + Handler.Boolean_Value (Value.workDoneProgress.Value); + end if; + Handler.End_Object; + end Write_DocumentColorOptions; + + procedure Write_InitializedParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.InitializedParams) is + begin + Handler.Start_Object; + null; + Handler.End_Object; + end Write_InitializedParams; + + procedure Write_FileOperationPatternKind + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.FileOperationPatternKind) is + begin + case Value is + when LSP.Enumerations.file => + Handler.String_Value ("file"); + when LSP.Enumerations.folder => + Handler.String_Value ("folder"); + end case; + end Write_FileOperationPatternKind; + + procedure Write_Unregistration + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Unregistration) is + begin + Handler.Start_Object; + Handler.Key_Name ("id"); + Handler.String_Value (Value.id); + Handler.Key_Name ("method"); + Handler.String_Value (Value.method); + Handler.End_Object; + end Write_Unregistration; + + procedure Write_HoverOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.HoverOptions) is + begin + Handler.Start_Object; + if Value.workDoneProgress.Is_Set then + Handler.Key_Name ("workDoneProgress"); + Handler.Boolean_Value (Value.workDoneProgress.Value); + end if; + Handler.End_Object; + end Write_HoverOptions; + + procedure Write_DocumentOnTypeFormattingRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentOnTypeFormattingRegistrationOptions) is + procedure Write_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSelector_Or_Null); + + procedure Write_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSelector_Or_Null) is + begin + if Value.Is_Null then + Handler.Null_Value; + else + Write_DocumentSelector (Handler, Value.Value); + end if; + end Write_DocumentSelector_Or_Null; + + begin + Handler.Start_Object; + Handler.Key_Name ("documentSelector"); + Write_DocumentSelector_Or_Null (Handler, Value.Parent.documentSelector); + Handler.Key_Name ("firstTriggerCharacter"); + Handler.String_Value (Value.firstTriggerCharacter); + if not Value.moreTriggerCharacter.Is_Empty then + Handler.Key_Name ("moreTriggerCharacter"); + Write_Virtual_String_Vector (Handler, Value.moreTriggerCharacter); + end if; + Handler.End_Object; + end Write_DocumentOnTypeFormattingRegistrationOptions; + + procedure Write_relatedDocuments_OfDocumentDiagnosticReportPartialResult + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures + .relatedDocuments_OfDocumentDiagnosticReportPartialResult) is + begin + declare + use + LSP.Structures + .relatedDocuments_OfDocumentDiagnosticReportPartialResult_Item_Maps; + begin + Handler.Start_Object; + for Cursor in Value.Iterate loop + Handler.Key_Name (Key (Cursor)); + Write_relatedDocuments_OfDocumentDiagnosticReportPartialResult_Item + (Handler, Value (Cursor)); + end loop; + Handler.End_Object; + end; + end Write_relatedDocuments_OfDocumentDiagnosticReportPartialResult; + + procedure Write_ReferenceClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ReferenceClientCapabilities) is + begin + Handler.Start_Object; + if Value.dynamicRegistration.Is_Set then + Handler.Key_Name ("dynamicRegistration"); + Handler.Boolean_Value (Value.dynamicRegistration.Value); + end if; + Handler.End_Object; + end Write_ReferenceClientCapabilities; + + procedure Write_MonikerClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.MonikerClientCapabilities) is + begin + Handler.Start_Object; + if Value.dynamicRegistration.Is_Set then + Handler.Key_Name ("dynamicRegistration"); + Handler.Boolean_Value (Value.dynamicRegistration.Value); + end if; + Handler.End_Object; + end Write_MonikerClientCapabilities; + + procedure Write_CompletionItemTag_Set + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CompletionItemTag_Set) is + begin + Handler.Start_Array; + declare + Set : LSP.Structures.CompletionItemTag_Set renames Value; + begin + for Value in Set'Range loop + if Set (Value) then + Write_CompletionItemTag (Handler, Value); + end if; + end loop; + end; + Handler.End_Array; + end Write_CompletionItemTag_Set; + + procedure Write_ColorInformation + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ColorInformation) is + begin + Handler.Start_Object; + Handler.Key_Name ("range"); + Write_A_Range (Handler, Value.a_range); + Handler.Key_Name ("color"); + Write_Color (Handler, Value.color); + Handler.End_Object; + end Write_ColorInformation; + + procedure Write_A_Range + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.A_Range) is + begin + Handler.Start_Object; + Handler.Key_Name ("start"); + Write_Position (Handler, Value.start); + Handler.Key_Name ("end"); + Write_Position (Handler, Value.an_end); + Handler.End_Object; + end Write_A_Range; + + procedure Write_ShowMessageRequestParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ShowMessageRequestParams) is + procedure Write_MessageActionItem_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.MessageActionItem_Vector); + + procedure Write_MessageActionItem_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.MessageActionItem_Vector) is + begin + Handler.Start_Array; + for J in Value.First_Index .. Value.Last_Index loop + Write_MessageActionItem (Handler, Value (J)); + end loop; + Handler.End_Array; + end Write_MessageActionItem_Vector; + + begin + Handler.Start_Object; + Handler.Key_Name ("type"); + Write_MessageType (Handler, Value.a_type); + Handler.Key_Name ("message"); + Handler.String_Value (Value.message); + if not Value.actions.Is_Empty then + Handler.Key_Name ("actions"); + Write_MessageActionItem_Vector (Handler, Value.actions); + end if; + Handler.End_Object; + end Write_ShowMessageRequestParams; + + procedure Write_DocumentColorClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentColorClientCapabilities) is + begin + Handler.Start_Object; + if Value.dynamicRegistration.Is_Set then + Handler.Key_Name ("dynamicRegistration"); + Handler.Boolean_Value (Value.dynamicRegistration.Value); + end if; + Handler.End_Object; + end Write_DocumentColorClientCapabilities; + + procedure Write_WorkspaceEdit_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.WorkspaceEdit_Or_Null) is + begin + if Value.Is_Null then + Handler.Null_Value; + else + Write_WorkspaceEdit (Handler, Value.Value); + end if; + end Write_WorkspaceEdit_Or_Null; + + procedure Write_InlineValueEvaluatableExpression + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.InlineValueEvaluatableExpression) is + begin + Handler.Start_Object; + Handler.Key_Name ("range"); + Write_A_Range (Handler, Value.a_range); + if not Value.expression.Is_Null then + Handler.Key_Name ("expression"); + Handler.String_Value (Value.expression); + end if; + Handler.End_Object; + end Write_InlineValueEvaluatableExpression; + + procedure Write_Pattern + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Pattern) is + begin + Handler.String_Value (Value); + end Write_Pattern; + + procedure Write_DiagnosticTag_Set + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DiagnosticTag_Set) is + begin + Handler.Start_Array; + declare + Set : LSP.Structures.DiagnosticTag_Set renames Value; + begin + for Value in Set'Range loop + if Set (Value) then + Write_DiagnosticTag (Handler, Value); + end if; + end loop; + end; + Handler.End_Array; + end Write_DiagnosticTag_Set; + + procedure Write_NotebookCellArrayChange + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.NotebookCellArrayChange) is + begin + Handler.Start_Object; + Handler.Key_Name ("start"); + Handler.Integer_Value (Integer'Pos (Value.start)); + Handler.Key_Name ("deleteCount"); + Handler.Integer_Value (Integer'Pos (Value.deleteCount)); + if not Value.cells.Is_Empty then + Handler.Key_Name ("cells"); + Write_NotebookCell_Vector (Handler, Value.cells); + end if; + Handler.End_Object; + end Write_NotebookCellArrayChange; + + procedure Write_DocumentLinkRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentLinkRegistrationOptions) is + procedure Write_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSelector_Or_Null); + + procedure Write_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSelector_Or_Null) is + begin + if Value.Is_Null then + Handler.Null_Value; + else + Write_DocumentSelector (Handler, Value.Value); + end if; + end Write_DocumentSelector_Or_Null; + + begin + Handler.Start_Object; + Handler.Key_Name ("documentSelector"); + Write_DocumentSelector_Or_Null (Handler, Value.Parent.documentSelector); + if Value.workDoneProgress.Is_Set then + Handler.Key_Name ("workDoneProgress"); + Handler.Boolean_Value (Value.workDoneProgress.Value); + end if; + if Value.resolveProvider.Is_Set then + Handler.Key_Name ("resolveProvider"); + Handler.Boolean_Value (Value.resolveProvider.Value); + end if; + Handler.End_Object; + end Write_DocumentLinkRegistrationOptions; + + procedure Write_DocumentHighlight_Vector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentHighlight_Vector_Or_Null) is + begin + if Value.Is_Empty then + Handler.Null_Value; + else + Write_DocumentHighlight_Vector (Handler, Value); + end if; + end Write_DocumentHighlight_Vector_Or_Null; + + procedure Write_LogMessageParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.LogMessageParams) is + begin + Handler.Start_Object; + Handler.Key_Name ("type"); + Write_MessageType (Handler, Value.a_type); + Handler.Key_Name ("message"); + Handler.String_Value (Value.message); + Handler.End_Object; + end Write_LogMessageParams; + + procedure Write_CodeLens + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CodeLens) is + begin + Handler.Start_Object; + Handler.Key_Name ("range"); + Write_A_Range (Handler, Value.a_range); + if Value.command.Is_Set then + Handler.Key_Name ("command"); + Write_Command (Handler, Value.command.Value); + end if; + if not Value.data.Is_Empty then + Handler.Key_Name ("data"); + Write_LSPAny (Handler, Value.data); + end if; + Handler.End_Object; + end Write_CodeLens; + + procedure Write_DocumentDiagnosticReportPartialResult + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentDiagnosticReportPartialResult) is + begin + Handler.Start_Object; + Handler.Key_Name ("relatedDocuments"); + declare + use + LSP.Structures + .relatedDocuments_OfDocumentDiagnosticReportPartialResult_Item_Maps; + begin + Handler.Start_Object; + for Cursor in Value.relatedDocuments.Iterate loop + Handler.Key_Name (Key (Cursor)); + Write_relatedDocuments_OfDocumentDiagnosticReportPartialResult_Item + (Handler, Value.relatedDocuments (Cursor)); + end loop; + Handler.End_Object; + end; + Handler.End_Object; + end Write_DocumentDiagnosticReportPartialResult; + + procedure Write_CallHierarchyIncomingCall_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CallHierarchyIncomingCall_Vector) is + begin + Handler.Start_Array; + for J in Value.First_Index .. Value.Last_Index loop + Write_CallHierarchyIncomingCall (Handler, Value (J)); + end loop; + Handler.End_Array; + end Write_CallHierarchyIncomingCall_Vector; + + procedure Write_ProgressParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ProgressParams) is + begin + Handler.Start_Object; + Handler.Key_Name ("token"); + Write_ProgressToken (Handler, Value.token); + Handler.Key_Name ("value"); + Write_LSPAny (Handler, Value.value); + Handler.End_Object; + end Write_ProgressParams; + + procedure Write_DocumentLinkOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentLinkOptions) is + begin + Handler.Start_Object; + if Value.workDoneProgress.Is_Set then + Handler.Key_Name ("workDoneProgress"); + Handler.Boolean_Value (Value.workDoneProgress.Value); + end if; + if Value.resolveProvider.Is_Set then + Handler.Key_Name ("resolveProvider"); + Handler.Boolean_Value (Value.resolveProvider.Value); + end if; + Handler.End_Object; + end Write_DocumentLinkOptions; + + procedure Write_PrepareSupportDefaultBehavior + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.PrepareSupportDefaultBehavior) is + begin + case Value is + when LSP.Enumerations.Identifier => + Handler.Integer_Value (1); + end case; + end Write_PrepareSupportDefaultBehavior; + + procedure Write_TextDocumentIdentifier + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.TextDocumentIdentifier) is + begin + Handler.Start_Object; + Handler.Key_Name ("uri"); + Handler.String_Value (Value.uri); + Handler.End_Object; + end Write_TextDocumentIdentifier; + + procedure Write_DocumentSymbol_Result + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSymbol_Result) is + begin + case Value.Kind is + when LSP.Structures.Varian_1 => + Write_SymbolInformation_Vector (Handler, Value.Varian_1); + when LSP.Structures.Varian_2 => + Write_DocumentSymbol_Vector (Handler, Value.Varian_2); + when LSP.Structures.Varian_3 => + Handler.Null_Value; + end case; + end Write_DocumentSymbol_Result; + + procedure Write_TraceValues + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.TraceValues) is + begin + case Value is + when LSP.Enumerations.Off => + Handler.String_Value ("off"); + when LSP.Enumerations.Messages => + Handler.String_Value ("messages"); + when LSP.Enumerations.Verbose => + Handler.String_Value ("verbose"); + end case; + end Write_TraceValues; + + procedure Write_TypeHierarchyPrepareParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.TypeHierarchyPrepareParams) is + begin + Handler.Start_Object; + Handler.Key_Name ("textDocument"); + Write_TextDocumentIdentifier (Handler, Value.textDocument); + Handler.Key_Name ("position"); + Write_Position (Handler, Value.position); + if Value.workDoneToken.Is_Set then + Handler.Key_Name ("workDoneToken"); + Write_ProgressToken (Handler, Value.workDoneToken.Value); + end if; + Handler.End_Object; + end Write_TypeHierarchyPrepareParams; + + procedure Write_SymbolInformation + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SymbolInformation) is + begin + Handler.Start_Object; + Handler.Key_Name ("name"); + Handler.String_Value (Value.name); + Handler.Key_Name ("kind"); + Write_SymbolKind (Handler, Value.kind); + if (for some Item of Value.tags => Item) then + Handler.Key_Name ("tags"); + Write_SymbolTag_Set (Handler, Value.tags); + end if; + if not Value.containerName.Is_Null then + Handler.Key_Name ("containerName"); + Handler.String_Value (Value.containerName); + end if; + if Value.deprecated.Is_Set then + Handler.Key_Name ("deprecated"); + Handler.Boolean_Value (Value.deprecated.Value); + end if; + Handler.Key_Name ("location"); + Write_Location (Handler, Value.location); + Handler.End_Object; + end Write_SymbolInformation; + + procedure Write_WillSaveTextDocumentParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.WillSaveTextDocumentParams) is + begin + Handler.Start_Object; + Handler.Key_Name ("textDocument"); + Write_TextDocumentIdentifier (Handler, Value.textDocument); + Handler.Key_Name ("reason"); + Write_TextDocumentSaveReason (Handler, Value.reason); + Handler.End_Object; + end Write_WillSaveTextDocumentParams; + + procedure Write_Command_Or_CodeAction_Vector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Command_Or_CodeAction_Vector_Or_Null) is + begin + if Value.Is_Empty then + Handler.Null_Value; + else + Write_Command_Or_CodeAction_Vector (Handler, Value); + end if; + end Write_Command_Or_CodeAction_Vector_Or_Null; + + procedure Write_FileOperationClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.FileOperationClientCapabilities) is + begin + Handler.Start_Object; + if Value.dynamicRegistration.Is_Set then + Handler.Key_Name ("dynamicRegistration"); + Handler.Boolean_Value (Value.dynamicRegistration.Value); + end if; + if Value.didCreate.Is_Set then + Handler.Key_Name ("didCreate"); + Handler.Boolean_Value (Value.didCreate.Value); + end if; + if Value.willCreate.Is_Set then + Handler.Key_Name ("willCreate"); + Handler.Boolean_Value (Value.willCreate.Value); + end if; + if Value.didRename.Is_Set then + Handler.Key_Name ("didRename"); + Handler.Boolean_Value (Value.didRename.Value); + end if; + if Value.willRename.Is_Set then + Handler.Key_Name ("willRename"); + Handler.Boolean_Value (Value.willRename.Value); + end if; + if Value.didDelete.Is_Set then + Handler.Key_Name ("didDelete"); + Handler.Boolean_Value (Value.didDelete.Value); + end if; + if Value.willDelete.Is_Set then + Handler.Key_Name ("willDelete"); + Handler.Boolean_Value (Value.willDelete.Value); + end if; + Handler.End_Object; + end Write_FileOperationClientCapabilities; + + procedure Write_Definition_Result + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Definition_Result) is + begin + case Value.Kind is + when LSP.Structures.Varian_1 => + Write_Definition (Handler, Value.Varian_1); + when LSP.Structures.Varian_2 => + Write_DefinitionLink_Vector (Handler, Value.Varian_2); + when LSP.Structures.Varian_3 => + Handler.Null_Value; + end case; + end Write_Definition_Result; + + procedure Write_DocumentHighlightClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentHighlightClientCapabilities) is + begin + Handler.Start_Object; + if Value.dynamicRegistration.Is_Set then + Handler.Key_Name ("dynamicRegistration"); + Handler.Boolean_Value (Value.dynamicRegistration.Value); + end if; + Handler.End_Object; + end Write_DocumentHighlightClientCapabilities; + + procedure Write_InlineValueText + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.InlineValueText) is + begin + Handler.Start_Object; + Handler.Key_Name ("range"); + Write_A_Range (Handler, Value.a_range); + Handler.Key_Name ("text"); + Handler.String_Value (Value.text); + Handler.End_Object; + end Write_InlineValueText; + + procedure Write_UnchangedDocumentDiagnosticReport + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.UnchangedDocumentDiagnosticReport) is + begin + Handler.Start_Object; + Handler.Key_Name ("kind"); + Handler.String_Value ("unchanged"); + Handler.Key_Name ("resultId"); + Handler.String_Value (Value.resultId); + Handler.End_Object; + end Write_UnchangedDocumentDiagnosticReport; + + procedure Write_SymbolTag + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.SymbolTag) is + begin + case Value is + when LSP.Enumerations.Deprecated => + Handler.Integer_Value (1); + end case; + end Write_SymbolTag; + + procedure Write_Registration + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Registration) is + begin + Handler.Start_Object; + Handler.Key_Name ("id"); + Handler.String_Value (Value.id); + Handler.Key_Name ("method"); + Handler.String_Value (Value.method); + if not Value.registerOptions.Is_Empty then + Handler.Key_Name ("registerOptions"); + Write_LSPAny (Handler, Value.registerOptions); + end if; + Handler.End_Object; + end Write_Registration; + + procedure Write_CompletionItem + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CompletionItem) is + procedure Write_TextEdit_Or_InsertReplaceEdit + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.TextEdit_Or_InsertReplaceEdit); + + procedure Write_TextEdit_Or_InsertReplaceEdit + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.TextEdit_Or_InsertReplaceEdit) is + begin + case Value.Is_TextEdit is + when True => + Write_TextEdit (Handler, Value.TextEdit); + when False => + Write_InsertReplaceEdit (Handler, Value.InsertReplaceEdit); + end case; + end Write_TextEdit_Or_InsertReplaceEdit; + + begin + Handler.Start_Object; + Handler.Key_Name ("label"); + Handler.String_Value (Value.label); + if Value.labelDetails.Is_Set then + Handler.Key_Name ("labelDetails"); + Write_CompletionItemLabelDetails (Handler, Value.labelDetails.Value); + end if; + if Value.kind.Is_Set then + Handler.Key_Name ("kind"); + Write_CompletionItemKind (Handler, Value.kind.Value); + end if; + if (for some Item of Value.tags => Item) then + Handler.Key_Name ("tags"); + Write_CompletionItemTag_Set (Handler, Value.tags); + end if; + if not Value.detail.Is_Null then + Handler.Key_Name ("detail"); + Handler.String_Value (Value.detail); + end if; + if Value.documentation.Is_Set then + Handler.Key_Name ("documentation"); + Write_Virtual_String_Or_MarkupContent + (Handler, Value.documentation.Value); + end if; + if Value.deprecated.Is_Set then + Handler.Key_Name ("deprecated"); + Handler.Boolean_Value (Value.deprecated.Value); + end if; + if Value.preselect.Is_Set then + Handler.Key_Name ("preselect"); + Handler.Boolean_Value (Value.preselect.Value); + end if; + if not Value.sortText.Is_Null then + Handler.Key_Name ("sortText"); + Handler.String_Value (Value.sortText); + end if; + if not Value.filterText.Is_Null then + Handler.Key_Name ("filterText"); + Handler.String_Value (Value.filterText); + end if; + if not Value.insertText.Is_Null then + Handler.Key_Name ("insertText"); + Handler.String_Value (Value.insertText); + end if; + if Value.insertTextFormat.Is_Set then + Handler.Key_Name ("insertTextFormat"); + Write_InsertTextFormat (Handler, Value.insertTextFormat.Value); + end if; + if Value.insertTextMode.Is_Set then + Handler.Key_Name ("insertTextMode"); + Write_InsertTextMode (Handler, Value.insertTextMode.Value); + end if; + if Value.textEdit.Is_Set then + Handler.Key_Name ("textEdit"); + Write_TextEdit_Or_InsertReplaceEdit (Handler, Value.textEdit.Value); + end if; + if not Value.textEditText.Is_Null then + Handler.Key_Name ("textEditText"); + Handler.String_Value (Value.textEditText); + end if; + if not Value.additionalTextEdits.Is_Empty then + Handler.Key_Name ("additionalTextEdits"); + Write_TextEdit_Vector (Handler, Value.additionalTextEdits); + end if; + if not Value.commitCharacters.Is_Empty then + Handler.Key_Name ("commitCharacters"); + Write_Virtual_String_Vector (Handler, Value.commitCharacters); + end if; + if Value.command.Is_Set then + Handler.Key_Name ("command"); + Write_Command (Handler, Value.command.Value); + end if; + if not Value.data.Is_Empty then + Handler.Key_Name ("data"); + Write_LSPAny (Handler, Value.data); + end if; + Handler.End_Object; + end Write_CompletionItem; + + procedure Write_DocumentRangeFormattingRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentRangeFormattingRegistrationOptions) is + procedure Write_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSelector_Or_Null); + + procedure Write_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSelector_Or_Null) is + begin + if Value.Is_Null then + Handler.Null_Value; + else + Write_DocumentSelector (Handler, Value.Value); + end if; + end Write_DocumentSelector_Or_Null; + + begin + Handler.Start_Object; + Handler.Key_Name ("documentSelector"); + Write_DocumentSelector_Or_Null (Handler, Value.Parent.documentSelector); + if Value.workDoneProgress.Is_Set then + Handler.Key_Name ("workDoneProgress"); + Handler.Boolean_Value (Value.workDoneProgress.Value); + end if; + Handler.End_Object; + end Write_DocumentRangeFormattingRegistrationOptions; + + procedure Write_Moniker_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Moniker_Vector) is + begin + Handler.Start_Array; + for J in Value.First_Index .. Value.Last_Index loop + Write_Moniker (Handler, Value (J)); + end loop; + Handler.End_Array; + end Write_Moniker_Vector; + + procedure Write_RenameFileOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.RenameFileOptions) is + begin + Handler.Start_Object; + if Value.overwrite.Is_Set then + Handler.Key_Name ("overwrite"); + Handler.Boolean_Value (Value.overwrite.Value); + end if; + if Value.ignoreIfExists.Is_Set then + Handler.Key_Name ("ignoreIfExists"); + Handler.Boolean_Value (Value.ignoreIfExists.Value); + end if; + Handler.End_Object; + end Write_RenameFileOptions; + + procedure Write_HoverParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.HoverParams) is + begin + Handler.Start_Object; + Handler.Key_Name ("textDocument"); + Write_TextDocumentIdentifier (Handler, Value.textDocument); + Handler.Key_Name ("position"); + Write_Position (Handler, Value.position); + if Value.workDoneToken.Is_Set then + Handler.Key_Name ("workDoneToken"); + Write_ProgressToken (Handler, Value.workDoneToken.Value); + end if; + Handler.End_Object; + end Write_HoverParams; + + procedure Write_DocumentSymbol + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSymbol) is + begin + Handler.Start_Object; + Handler.Key_Name ("name"); + Handler.String_Value (Value.name); + if not Value.detail.Is_Null then + Handler.Key_Name ("detail"); + Handler.String_Value (Value.detail); + end if; + Handler.Key_Name ("kind"); + Write_SymbolKind (Handler, Value.kind); + if (for some Item of Value.tags => Item) then + Handler.Key_Name ("tags"); + Write_SymbolTag_Set (Handler, Value.tags); + end if; + if Value.deprecated.Is_Set then + Handler.Key_Name ("deprecated"); + Handler.Boolean_Value (Value.deprecated.Value); + end if; + Handler.Key_Name ("range"); + Write_A_Range (Handler, Value.a_range); + Handler.Key_Name ("selectionRange"); + Write_A_Range (Handler, Value.selectionRange); + if Value.children.Length > 0 then + Handler.Key_Name ("children"); + Write_DocumentSymbol_Vector (Handler, Value.children); + end if; + Handler.End_Object; + end Write_DocumentSymbol; + + procedure Write_DocumentSymbolClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSymbolClientCapabilities) is + begin + Handler.Start_Object; + if Value.dynamicRegistration.Is_Set then + Handler.Key_Name ("dynamicRegistration"); + Handler.Boolean_Value (Value.dynamicRegistration.Value); + end if; + if Value.symbolKind.Is_Set then + Handler.Key_Name ("symbolKind"); + Write_symbolKind_OfWorkspaceSymbolClientCapabilities + (Handler, Value.symbolKind.Value); + end if; + if Value.hierarchicalDocumentSymbolSupport.Is_Set then + Handler.Key_Name ("hierarchicalDocumentSymbolSupport"); + Handler.Boolean_Value (Value.hierarchicalDocumentSymbolSupport.Value); + end if; + if Value.tagSupport.Is_Set then + Handler.Key_Name ("tagSupport"); + Write_tagSupport_OfWorkspaceSymbolClientCapabilities + (Handler, Value.tagSupport.Value); + end if; + if Value.labelSupport.Is_Set then + Handler.Key_Name ("labelSupport"); + Handler.Boolean_Value (Value.labelSupport.Value); + end if; + Handler.End_Object; + end Write_DocumentSymbolClientCapabilities; + + procedure Write_InitializeError + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.InitializeError) is + begin + Handler.Start_Object; + Handler.Key_Name ("retry"); + Handler.Boolean_Value (Value.retry); + Handler.End_Object; + end Write_InitializeError; + + procedure Write_LinkedEditingRangeRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.LinkedEditingRangeRegistrationOptions) is + procedure Write_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSelector_Or_Null); + + procedure Write_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSelector_Or_Null) is + begin + if Value.Is_Null then + Handler.Null_Value; + else + Write_DocumentSelector (Handler, Value.Value); + end if; + end Write_DocumentSelector_Or_Null; + + begin + Handler.Start_Object; + Handler.Key_Name ("documentSelector"); + Write_DocumentSelector_Or_Null (Handler, Value.Parent.documentSelector); + if Value.workDoneProgress.Is_Set then + Handler.Key_Name ("workDoneProgress"); + Handler.Boolean_Value (Value.workDoneProgress.Value); + end if; + if not Value.id.Is_Null then + Handler.Key_Name ("id"); + Handler.String_Value (Value.id); + end if; + Handler.End_Object; + end Write_LinkedEditingRangeRegistrationOptions; + + procedure Write_SemanticTokensClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SemanticTokensClientCapabilities) is + procedure Write_requests_OfSemanticTokensClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.requests_OfSemanticTokensClientCapabilities); + + procedure Write_TokenFormat_Set + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.TokenFormat_Set); + + procedure Write_requests_OfSemanticTokensClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.requests_OfSemanticTokensClientCapabilities) is + begin + Handler.Start_Object; + if Value.a_range.Is_Set then + Handler.Key_Name ("range"); + Write_Boolean_Or_Any (Handler, Value.a_range.Value); + end if; + if Value.full.Is_Set then + Handler.Key_Name ("full"); + Write_Boolean_Or_Something (Handler, Value.full.Value); + end if; + Handler.End_Object; + end Write_requests_OfSemanticTokensClientCapabilities; + + procedure Write_TokenFormat_Set + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.TokenFormat_Set) is + begin + Handler.Start_Array; + declare + Set : LSP.Structures.TokenFormat_Set renames Value; + begin + for Value in Set'Range loop + if Set (Value) then + Write_TokenFormat (Handler, Value); + end if; + end loop; + end; + Handler.End_Array; + end Write_TokenFormat_Set; + + begin + Handler.Start_Object; + if Value.dynamicRegistration.Is_Set then + Handler.Key_Name ("dynamicRegistration"); + Handler.Boolean_Value (Value.dynamicRegistration.Value); + end if; + Handler.Key_Name ("requests"); + Write_requests_OfSemanticTokensClientCapabilities + (Handler, Value.requests); + Handler.Key_Name ("tokenTypes"); + Write_Virtual_String_Vector (Handler, Value.tokenTypes); + Handler.Key_Name ("tokenModifiers"); + Write_Virtual_String_Vector (Handler, Value.tokenModifiers); + Handler.Key_Name ("formats"); + Write_TokenFormat_Set (Handler, Value.formats); + if Value.overlappingTokenSupport.Is_Set then + Handler.Key_Name ("overlappingTokenSupport"); + Handler.Boolean_Value (Value.overlappingTokenSupport.Value); + end if; + if Value.multilineTokenSupport.Is_Set then + Handler.Key_Name ("multilineTokenSupport"); + Handler.Boolean_Value (Value.multilineTokenSupport.Value); + end if; + if Value.serverCancelSupport.Is_Set then + Handler.Key_Name ("serverCancelSupport"); + Handler.Boolean_Value (Value.serverCancelSupport.Value); + end if; + if Value.augmentsSyntaxTokens.Is_Set then + Handler.Key_Name ("augmentsSyntaxTokens"); + Handler.Boolean_Value (Value.augmentsSyntaxTokens.Value); + end if; + Handler.End_Object; + end Write_SemanticTokensClientCapabilities; + + procedure Write_Hover + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Hover) is + procedure Write_MarkedString_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.MarkedString_Vector); + + procedure Write_MarkupContent_Or_MarkedString_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.MarkupContent_Or_MarkedString_Vector); + + procedure Write_MarkedString_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.MarkedString_Vector) is + begin + Handler.Start_Array; + for J in Value.First_Index .. Value.Last_Index loop + Write_MarkedString (Handler, Value (J)); + end loop; + Handler.End_Array; + end Write_MarkedString_Vector; + + procedure Write_MarkupContent_Or_MarkedString_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.MarkupContent_Or_MarkedString_Vector) is + begin + case Value.Is_MarkupContent is + when True => + Write_MarkupContent (Handler, Value.MarkupContent); + when False => + Write_MarkedString_Vector (Handler, Value.MarkedString_Vector); + end case; + end Write_MarkupContent_Or_MarkedString_Vector; + + begin + Handler.Start_Object; + Handler.Key_Name ("contents"); + Write_MarkupContent_Or_MarkedString_Vector (Handler, Value.contents); + if Value.a_range.Is_Set then + Handler.Key_Name ("range"); + Write_A_Range (Handler, Value.a_range.Value); + end if; + Handler.End_Object; + end Write_Hover; + + procedure Write_InlineValueWorkspaceClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.InlineValueWorkspaceClientCapabilities) is + begin + Handler.Start_Object; + if Value.refreshSupport.Is_Set then + Handler.Key_Name ("refreshSupport"); + Handler.Boolean_Value (Value.refreshSupport.Value); + end if; + Handler.End_Object; + end Write_InlineValueWorkspaceClientCapabilities; + + procedure Write_ResourceOperation + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ResourceOperation) is + begin + Handler.Start_Object; + Handler.Key_Name ("kind"); + Handler.String_Value (Value.kind); + if Value.annotationId.Is_Set then + Handler.Key_Name ("annotationId"); + Write_ChangeAnnotationIdentifier (Handler, Value.annotationId.Value); + end if; + Handler.End_Object; + end Write_ResourceOperation; + + procedure Write_PublishDiagnosticsClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.PublishDiagnosticsClientCapabilities) is + procedure Write_tagSupport_OfPublishDiagnosticsClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures + .tagSupport_OfPublishDiagnosticsClientCapabilities); + + procedure Write_tagSupport_OfPublishDiagnosticsClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures + .tagSupport_OfPublishDiagnosticsClientCapabilities) is + begin + Handler.Start_Object; + Handler.Key_Name ("valueSet"); + Write_DiagnosticTag_Set (Handler, Value.valueSet); + Handler.End_Object; + end Write_tagSupport_OfPublishDiagnosticsClientCapabilities; + + begin + Handler.Start_Object; + if Value.relatedInformation.Is_Set then + Handler.Key_Name ("relatedInformation"); + Handler.Boolean_Value (Value.relatedInformation.Value); + end if; + if Value.tagSupport.Is_Set then + Handler.Key_Name ("tagSupport"); + Write_tagSupport_OfPublishDiagnosticsClientCapabilities + (Handler, Value.tagSupport.Value); + end if; + if Value.versionSupport.Is_Set then + Handler.Key_Name ("versionSupport"); + Handler.Boolean_Value (Value.versionSupport.Value); + end if; + if Value.codeDescriptionSupport.Is_Set then + Handler.Key_Name ("codeDescriptionSupport"); + Handler.Boolean_Value (Value.codeDescriptionSupport.Value); + end if; + if Value.dataSupport.Is_Set then + Handler.Key_Name ("dataSupport"); + Handler.Boolean_Value (Value.dataSupport.Value); + end if; + Handler.End_Object; + end Write_PublishDiagnosticsClientCapabilities; + + procedure Write_DocumentHighlight_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentHighlight_Vector) is + begin + Handler.Start_Array; + for J in Value.First_Index .. Value.Last_Index loop + Write_DocumentHighlight (Handler, Value (J)); + end loop; + Handler.End_Array; + end Write_DocumentHighlight_Vector; + + procedure Write_SemanticTokensOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SemanticTokensOptions) is + begin + Handler.Start_Object; + if Value.workDoneProgress.Is_Set then + Handler.Key_Name ("workDoneProgress"); + Handler.Boolean_Value (Value.workDoneProgress.Value); + end if; + Handler.Key_Name ("legend"); + Write_SemanticTokensLegend (Handler, Value.legend); + if Value.a_range.Is_Set then + Handler.Key_Name ("range"); + Write_Boolean_Or_Any (Handler, Value.a_range.Value); + end if; + if Value.full.Is_Set then + Handler.Key_Name ("full"); + Write_Boolean_Or_Something (Handler, Value.full.Value); + end if; + Handler.End_Object; + end Write_SemanticTokensOptions; + + procedure Write_DocumentHighlightOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentHighlightOptions) is + begin + Handler.Start_Object; + if Value.workDoneProgress.Is_Set then + Handler.Key_Name ("workDoneProgress"); + Handler.Boolean_Value (Value.workDoneProgress.Value); + end if; + Handler.End_Object; + end Write_DocumentHighlightOptions; + + procedure Write_Integer_Or_Virtual_String + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Integer_Or_Virtual_String) is + begin + case Value.Is_Integer is + when True => + Handler.Integer_Value (Integer'Pos (Value.Integer)); + when False => + Handler.String_Value (Value.Virtual_String); + end case; + end Write_Integer_Or_Virtual_String; + + procedure Write_FoldingRangeParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.FoldingRangeParams) is + begin + Handler.Start_Object; + if Value.workDoneToken.Is_Set then + Handler.Key_Name ("workDoneToken"); + Write_ProgressToken (Handler, Value.workDoneToken.Value); + end if; + if Value.partialResultToken.Is_Set then + Handler.Key_Name ("partialResultToken"); + Write_ProgressToken (Handler, Value.partialResultToken.Value); + end if; + Handler.Key_Name ("textDocument"); + Write_TextDocumentIdentifier (Handler, Value.textDocument); + Handler.End_Object; + end Write_FoldingRangeParams; + + procedure Write_FoldingRangeOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.FoldingRangeOptions) is + begin + Handler.Start_Object; + if Value.workDoneProgress.Is_Set then + Handler.Key_Name ("workDoneProgress"); + Handler.Boolean_Value (Value.workDoneProgress.Value); + end if; + Handler.End_Object; + end Write_FoldingRangeOptions; + + procedure Write_Integer_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Integer_Or_Null) is + begin + if Value.Is_Null then + Handler.Null_Value; + else + Handler.Integer_Value (Integer'Pos (Value.Value)); + end if; + end Write_Integer_Or_Null; + + procedure Write_RegistrationParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.RegistrationParams) is + procedure Write_Registration_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Registration_Vector); + + procedure Write_Registration_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Registration_Vector) is + begin + Handler.Start_Array; + for J in Value.First_Index .. Value.Last_Index loop + Write_Registration (Handler, Value (J)); + end loop; + Handler.End_Array; + end Write_Registration_Vector; + + begin + Handler.Start_Object; + Handler.Key_Name ("registrations"); + Write_Registration_Vector (Handler, Value.registrations); + Handler.End_Object; + end Write_RegistrationParams; + + procedure Write_SignatureHelpParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SignatureHelpParams) is + begin + Handler.Start_Object; + Handler.Key_Name ("textDocument"); + Write_TextDocumentIdentifier (Handler, Value.textDocument); + Handler.Key_Name ("position"); + Write_Position (Handler, Value.position); + if Value.workDoneToken.Is_Set then + Handler.Key_Name ("workDoneToken"); + Write_ProgressToken (Handler, Value.workDoneToken.Value); + end if; + if Value.context.Is_Set then + Handler.Key_Name ("context"); + Write_SignatureHelpContext (Handler, Value.context.Value); + end if; + Handler.End_Object; + end Write_SignatureHelpParams; + + procedure Write_TextEdit_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.TextEdit_Vector) is + begin + Handler.Start_Array; + for J in Value.First_Index .. Value.Last_Index loop + Write_TextEdit (Handler, Value (J)); + end loop; + Handler.End_Array; + end Write_TextEdit_Vector; + + procedure Write_ShowMessageRequestClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ShowMessageRequestClientCapabilities) is + procedure Write_messageActionItem_OfShowMessageRequestClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures + .messageActionItem_OfShowMessageRequestClientCapabilities); + + procedure Write_messageActionItem_OfShowMessageRequestClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures + .messageActionItem_OfShowMessageRequestClientCapabilities) is + begin + Handler.Start_Object; + if Value.additionalPropertiesSupport.Is_Set then + Handler.Key_Name ("additionalPropertiesSupport"); + Handler.Boolean_Value (Value.additionalPropertiesSupport.Value); + end if; + Handler.End_Object; + end Write_messageActionItem_OfShowMessageRequestClientCapabilities; + + begin + Handler.Start_Object; + if Value.messageActionItem.Is_Set then + Handler.Key_Name ("messageActionItem"); + Write_messageActionItem_OfShowMessageRequestClientCapabilities + (Handler, Value.messageActionItem.Value); + end if; + Handler.End_Object; + end Write_ShowMessageRequestClientCapabilities; + + procedure Write_SemanticTokensEdit_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SemanticTokensEdit_Vector) is + begin + Handler.Start_Array; + for J in Value.First_Index .. Value.Last_Index loop + Write_SemanticTokensEdit (Handler, Value (J)); + end loop; + Handler.End_Array; + end Write_SemanticTokensEdit_Vector; + + procedure Write_Position + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Position) is + begin + Handler.Start_Object; + Handler.Key_Name ("line"); + Handler.Integer_Value (Integer'Pos (Value.line)); + Handler.Key_Name ("character"); + Handler.Integer_Value (Integer'Pos (Value.character)); + Handler.End_Object; + end Write_Position; + + procedure Write_TextDocumentSaveRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.TextDocumentSaveRegistrationOptions) is + procedure Write_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSelector_Or_Null); + + procedure Write_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSelector_Or_Null) is + begin + if Value.Is_Null then + Handler.Null_Value; + else + Write_DocumentSelector (Handler, Value.Value); + end if; + end Write_DocumentSelector_Or_Null; + + begin + Handler.Start_Object; + Handler.Key_Name ("documentSelector"); + Write_DocumentSelector_Or_Null (Handler, Value.Parent.documentSelector); + if Value.includeText.Is_Set then + Handler.Key_Name ("includeText"); + Handler.Boolean_Value (Value.includeText.Value); + end if; + Handler.End_Object; + end Write_TextDocumentSaveRegistrationOptions; + + procedure Write_CodeActionParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CodeActionParams) is + begin + Handler.Start_Object; + if Value.workDoneToken.Is_Set then + Handler.Key_Name ("workDoneToken"); + Write_ProgressToken (Handler, Value.workDoneToken.Value); + end if; + if Value.partialResultToken.Is_Set then + Handler.Key_Name ("partialResultToken"); + Write_ProgressToken (Handler, Value.partialResultToken.Value); + end if; + Handler.Key_Name ("textDocument"); + Write_TextDocumentIdentifier (Handler, Value.textDocument); + Handler.Key_Name ("range"); + Write_A_Range (Handler, Value.a_range); + Handler.Key_Name ("context"); + Write_CodeActionContext (Handler, Value.context); + Handler.End_Object; + end Write_CodeActionParams; + + procedure Write_Command + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Command) is + begin + Handler.Start_Object; + Handler.Key_Name ("title"); + Handler.String_Value (Value.title); + Handler.Key_Name ("command"); + Handler.String_Value (Value.command); + if not Value.arguments.Is_Empty then + Handler.Key_Name ("arguments"); + Write_LSPAny_Vector (Handler, Value.arguments); + end if; + Handler.End_Object; + end Write_Command; + + procedure Write_TextDocumentFilter + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.TextDocumentFilter) is + begin + Handler.Start_Object; + if not Value.language.Is_Null then + Handler.Key_Name ("language"); + Handler.String_Value (Value.language); + end if; + if not Value.scheme.Is_Null then + Handler.Key_Name ("scheme"); + Handler.String_Value (Value.scheme); + end if; + if not Value.pattern.Is_Null then + Handler.Key_Name ("pattern"); + Handler.String_Value (Value.pattern); + end if; + Handler.End_Object; + end Write_TextDocumentFilter; + + procedure Write_FoldingRange_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.FoldingRange_Vector) is + begin + Handler.Start_Array; + for J in Value.First_Index .. Value.Last_Index loop + Write_FoldingRange (Handler, Value (J)); + end loop; + Handler.End_Array; + end Write_FoldingRange_Vector; + + procedure Write_SelectionRange_Vector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SelectionRange_Vector_Or_Null) is + begin + if Value.Length = 0 then + Handler.Null_Value; + else + Write_SelectionRange_Vector (Handler, Value); + end if; + end Write_SelectionRange_Vector_Or_Null; + + procedure Write_ExecuteCommandRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ExecuteCommandRegistrationOptions) is + begin + Handler.Start_Object; + if Value.workDoneProgress.Is_Set then + Handler.Key_Name ("workDoneProgress"); + Handler.Boolean_Value (Value.workDoneProgress.Value); + end if; + Handler.Key_Name ("commands"); + Write_Virtual_String_Vector (Handler, Value.commands); + Handler.End_Object; + end Write_ExecuteCommandRegistrationOptions; + + procedure Write_UniquenessLevel + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.UniquenessLevel) is + begin + case Value is + when LSP.Enumerations.document => + Handler.String_Value ("document"); + when LSP.Enumerations.project => + Handler.String_Value ("project"); + when LSP.Enumerations.group => + Handler.String_Value ("group"); + when LSP.Enumerations.scheme => + Handler.String_Value ("scheme"); + when LSP.Enumerations.global => + Handler.String_Value ("global"); + end case; + end Write_UniquenessLevel; + + procedure Write_TextDocumentEdit + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.TextDocumentEdit) is + procedure Write_TextEdit_Or_AnnotatedTextEdit + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.TextEdit_Or_AnnotatedTextEdit); + + procedure Write_TextEdit_Or_AnnotatedTextEdit_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.TextEdit_Or_AnnotatedTextEdit_Vector); + + procedure Write_TextEdit_Or_AnnotatedTextEdit + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.TextEdit_Or_AnnotatedTextEdit) is + begin + case Value.Is_TextEdit is + when True => + Write_TextEdit (Handler, Value.TextEdit); + when False => + Write_AnnotatedTextEdit (Handler, Value.AnnotatedTextEdit); + end case; + end Write_TextEdit_Or_AnnotatedTextEdit; + + procedure Write_TextEdit_Or_AnnotatedTextEdit_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.TextEdit_Or_AnnotatedTextEdit_Vector) is + begin + Handler.Start_Array; + for J in Value.First_Index .. Value.Last_Index loop + Write_TextEdit_Or_AnnotatedTextEdit (Handler, Value (J)); + end loop; + Handler.End_Array; + end Write_TextEdit_Or_AnnotatedTextEdit_Vector; + + begin + Handler.Start_Object; + Handler.Key_Name ("textDocument"); + Write_OptionalVersionedTextDocumentIdentifier + (Handler, Value.textDocument); + Handler.Key_Name ("edits"); + Write_TextEdit_Or_AnnotatedTextEdit_Vector (Handler, Value.edits); + Handler.End_Object; + end Write_TextDocumentEdit; + + procedure Write_CompletionItemLabelDetails + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CompletionItemLabelDetails) is + begin + Handler.Start_Object; + if not Value.detail.Is_Null then + Handler.Key_Name ("detail"); + Handler.String_Value (Value.detail); + end if; + if not Value.description.Is_Null then + Handler.Key_Name ("description"); + Handler.String_Value (Value.description); + end if; + Handler.End_Object; + end Write_CompletionItemLabelDetails; + + procedure Write_CompletionOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CompletionOptions) is + procedure Write_completionItem_OfCompletionOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.completionItem_OfCompletionOptions); + + procedure Write_completionItem_OfCompletionOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.completionItem_OfCompletionOptions) is + begin + Handler.Start_Object; + if Value.labelDetailsSupport.Is_Set then + Handler.Key_Name ("labelDetailsSupport"); + Handler.Boolean_Value (Value.labelDetailsSupport.Value); + end if; + Handler.End_Object; + end Write_completionItem_OfCompletionOptions; + + begin + Handler.Start_Object; + if Value.workDoneProgress.Is_Set then + Handler.Key_Name ("workDoneProgress"); + Handler.Boolean_Value (Value.workDoneProgress.Value); + end if; + if not Value.triggerCharacters.Is_Empty then + Handler.Key_Name ("triggerCharacters"); + Write_Virtual_String_Vector (Handler, Value.triggerCharacters); + end if; + if not Value.allCommitCharacters.Is_Empty then + Handler.Key_Name ("allCommitCharacters"); + Write_Virtual_String_Vector (Handler, Value.allCommitCharacters); + end if; + if Value.resolveProvider.Is_Set then + Handler.Key_Name ("resolveProvider"); + Handler.Boolean_Value (Value.resolveProvider.Value); + end if; + if Value.completionItem.Is_Set then + Handler.Key_Name ("completionItem"); + Write_completionItem_OfCompletionOptions + (Handler, Value.completionItem.Value); + end if; + Handler.End_Object; + end Write_CompletionOptions; + + procedure Write_Diagnostic + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Diagnostic) is + procedure Write_DiagnosticRelatedInformation_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DiagnosticRelatedInformation_Vector); + + procedure Write_DiagnosticRelatedInformation_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DiagnosticRelatedInformation_Vector) is + begin + Handler.Start_Array; + for J in Value.First_Index .. Value.Last_Index loop + Write_DiagnosticRelatedInformation (Handler, Value (J)); + end loop; + Handler.End_Array; + end Write_DiagnosticRelatedInformation_Vector; + + begin + Handler.Start_Object; + Handler.Key_Name ("range"); + Write_A_Range (Handler, Value.a_range); + if Value.severity.Is_Set then + Handler.Key_Name ("severity"); + Write_DiagnosticSeverity (Handler, Value.severity.Value); + end if; + if Value.code.Is_Set then + Handler.Key_Name ("code"); + Write_Integer_Or_Virtual_String (Handler, Value.code.Value); + end if; + if Value.codeDescription.Is_Set then + Handler.Key_Name ("codeDescription"); + Write_CodeDescription (Handler, Value.codeDescription.Value); + end if; + if not Value.source.Is_Null then + Handler.Key_Name ("source"); + Handler.String_Value (Value.source); + end if; + Handler.Key_Name ("message"); + Handler.String_Value (Value.message); + if (for some Item of Value.tags => Item) then + Handler.Key_Name ("tags"); + Write_DiagnosticTag_Set (Handler, Value.tags); + end if; + if not Value.relatedInformation.Is_Empty then + Handler.Key_Name ("relatedInformation"); + Write_DiagnosticRelatedInformation_Vector + (Handler, Value.relatedInformation); + end if; + if not Value.data.Is_Empty then + Handler.Key_Name ("data"); + Write_LSPAny (Handler, Value.data); + end if; + Handler.End_Object; + end Write_Diagnostic; + + procedure Write_LinkedEditingRangeParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.LinkedEditingRangeParams) is + begin + Handler.Start_Object; + Handler.Key_Name ("textDocument"); + Write_TextDocumentIdentifier (Handler, Value.textDocument); + Handler.Key_Name ("position"); + Write_Position (Handler, Value.position); + if Value.workDoneToken.Is_Set then + Handler.Key_Name ("workDoneToken"); + Write_ProgressToken (Handler, Value.workDoneToken.Value); + end if; + Handler.End_Object; + end Write_LinkedEditingRangeParams; + + procedure Write_TextDocumentSyncOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.TextDocumentSyncOptions) is + procedure Write_Boolean_Or_SaveOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Boolean_Or_SaveOptions); + + procedure Write_Boolean_Or_SaveOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Boolean_Or_SaveOptions) is + begin + case Value.Is_Boolean is + when True => + Handler.Boolean_Value (Value.Boolean); + when False => + Write_SaveOptions (Handler, Value.SaveOptions); + end case; + end Write_Boolean_Or_SaveOptions; + + begin + Handler.Start_Object; + if Value.openClose.Is_Set then + Handler.Key_Name ("openClose"); + Handler.Boolean_Value (Value.openClose.Value); + end if; + if Value.change.Is_Set then + Handler.Key_Name ("change"); + Write_TextDocumentSyncKind (Handler, Value.change.Value); + end if; + if Value.willSave.Is_Set then + Handler.Key_Name ("willSave"); + Handler.Boolean_Value (Value.willSave.Value); + end if; + if Value.willSaveWaitUntil.Is_Set then + Handler.Key_Name ("willSaveWaitUntil"); + Handler.Boolean_Value (Value.willSaveWaitUntil.Value); + end if; + if Value.save.Is_Set then + Handler.Key_Name ("save"); + Write_Boolean_Or_SaveOptions (Handler, Value.save.Value); + end if; + Handler.End_Object; + end Write_TextDocumentSyncOptions; + + procedure Write_ImplementationParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ImplementationParams) is + begin + Handler.Start_Object; + Handler.Key_Name ("textDocument"); + Write_TextDocumentIdentifier (Handler, Value.textDocument); + Handler.Key_Name ("position"); + Write_Position (Handler, Value.position); + if Value.workDoneToken.Is_Set then + Handler.Key_Name ("workDoneToken"); + Write_ProgressToken (Handler, Value.workDoneToken.Value); + end if; + if Value.partialResultToken.Is_Set then + Handler.Key_Name ("partialResultToken"); + Write_ProgressToken (Handler, Value.partialResultToken.Value); + end if; + Handler.End_Object; + end Write_ImplementationParams; + + procedure Write_OptionalVersionedTextDocumentIdentifier + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.OptionalVersionedTextDocumentIdentifier) is + begin + Handler.Start_Object; + Handler.Key_Name ("uri"); + Handler.String_Value (Value.uri); + Handler.Key_Name ("version"); + Write_Integer_Or_Null (Handler, Value.version); + Handler.End_Object; + end Write_OptionalVersionedTextDocumentIdentifier; + + procedure Write_SemanticTokensLegend + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SemanticTokensLegend) is + begin + Handler.Start_Object; + Handler.Key_Name ("tokenTypes"); + Write_Virtual_String_Vector (Handler, Value.tokenTypes); + Handler.Key_Name ("tokenModifiers"); + Write_Virtual_String_Vector (Handler, Value.tokenModifiers); + Handler.End_Object; + end Write_SemanticTokensLegend; + + procedure Write_WorkspaceDocumentDiagnosticReport_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.WorkspaceDocumentDiagnosticReport_Vector) is + begin + Handler.Start_Array; + for J in Value.First_Index .. Value.Last_Index loop + Write_WorkspaceDocumentDiagnosticReport (Handler, Value (J)); + end loop; + Handler.End_Array; + end Write_WorkspaceDocumentDiagnosticReport_Vector; + + procedure Write_ExecuteCommandOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ExecuteCommandOptions) is + begin + Handler.Start_Object; + if Value.workDoneProgress.Is_Set then + Handler.Key_Name ("workDoneProgress"); + Handler.Boolean_Value (Value.workDoneProgress.Value); + end if; + Handler.Key_Name ("commands"); + Write_Virtual_String_Vector (Handler, Value.commands); + Handler.End_Object; + end Write_ExecuteCommandOptions; + + procedure Write_TextDocumentSyncClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.TextDocumentSyncClientCapabilities) is + begin + Handler.Start_Object; + if Value.dynamicRegistration.Is_Set then + Handler.Key_Name ("dynamicRegistration"); + Handler.Boolean_Value (Value.dynamicRegistration.Value); + end if; + if Value.willSave.Is_Set then + Handler.Key_Name ("willSave"); + Handler.Boolean_Value (Value.willSave.Value); + end if; + if Value.willSaveWaitUntil.Is_Set then + Handler.Key_Name ("willSaveWaitUntil"); + Handler.Boolean_Value (Value.willSaveWaitUntil.Value); + end if; + if Value.didSave.Is_Set then + Handler.Key_Name ("didSave"); + Handler.Boolean_Value (Value.didSave.Value); + end if; + Handler.End_Object; + end Write_TextDocumentSyncClientCapabilities; + + procedure Write_MarkupKind + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.MarkupKind) is + begin + case Value is + when LSP.Enumerations.PlainText => + Handler.String_Value ("plaintext"); + when LSP.Enumerations.Markdown => + Handler.String_Value ("markdown"); + end case; + end Write_MarkupKind; + + procedure Write_CallHierarchyPrepareParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CallHierarchyPrepareParams) is + begin + Handler.Start_Object; + Handler.Key_Name ("textDocument"); + Write_TextDocumentIdentifier (Handler, Value.textDocument); + Handler.Key_Name ("position"); + Write_Position (Handler, Value.position); + if Value.workDoneToken.Is_Set then + Handler.Key_Name ("workDoneToken"); + Write_ProgressToken (Handler, Value.workDoneToken.Value); + end if; + Handler.End_Object; + end Write_CallHierarchyPrepareParams; + + procedure Write_LSPErrorCodes + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.LSPErrorCodes) is + begin + case Value is + when LSP.Enumerations.lspReservedErrorRangeStart => + Handler.Integer_Value (-32_899); + when LSP.Enumerations.RequestFailed => + Handler.Integer_Value (-32_803); + when LSP.Enumerations.ServerCancelled => + Handler.Integer_Value (-32_802); + when LSP.Enumerations.ContentModified => + Handler.Integer_Value (-32_801); + when LSP.Enumerations.RequestCancelled => + Handler.Integer_Value (-32_800); + when LSP.Enumerations.lspReservedErrorRangeEnd => + Handler.Integer_Value (-32_800); + end case; + end Write_LSPErrorCodes; + + procedure Write_ReferenceRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ReferenceRegistrationOptions) is + procedure Write_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSelector_Or_Null); + + procedure Write_DocumentSelector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSelector_Or_Null) is + begin + if Value.Is_Null then + Handler.Null_Value; + else + Write_DocumentSelector (Handler, Value.Value); + end if; + end Write_DocumentSelector_Or_Null; + + begin + Handler.Start_Object; + Handler.Key_Name ("documentSelector"); + Write_DocumentSelector_Or_Null (Handler, Value.Parent.documentSelector); + if Value.workDoneProgress.Is_Set then + Handler.Key_Name ("workDoneProgress"); + Handler.Boolean_Value (Value.workDoneProgress.Value); + end if; + Handler.End_Object; + end Write_ReferenceRegistrationOptions; + + procedure Write_LinkedEditingRangeOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.LinkedEditingRangeOptions) is + begin + Handler.Start_Object; + if Value.workDoneProgress.Is_Set then + Handler.Key_Name ("workDoneProgress"); + Handler.Boolean_Value (Value.workDoneProgress.Value); + end if; + Handler.End_Object; + end Write_LinkedEditingRangeOptions; + +end LSP.Outputs; diff --git a/source/lsp_3.17/generated/lsp-outputs.ads b/source/lsp_3.17/generated/lsp-outputs.ads new file mode 100644 index 000000000..40139db80 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-outputs.ads @@ -0,0 +1,592 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with VSS.JSON.Content_Handlers; + +with LSP.Enumerations; +with LSP.Structures; + +package LSP.Outputs is + pragma Preelaborate; + + procedure Write_InitializeParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.InitializeParams); + + procedure Write_DocumentLink_Vector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentLink_Vector_Or_Null); + + procedure Write_Command_Or_CodeAction_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Command_Or_CodeAction_Vector); + + procedure Write_Null_Record + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Null_Record); + + procedure Write_CallHierarchyOutgoingCall_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CallHierarchyOutgoingCall_Vector); + + procedure Write_DocumentDiagnosticParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentDiagnosticParams); + + procedure Write_DocumentLink_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentLink_Vector); + + procedure Write_InlineValueParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.InlineValueParams); + + procedure Write_DidSaveNotebookDocumentParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DidSaveNotebookDocumentParams); + + procedure Write_Declaration_Result + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Declaration_Result); + + procedure Write_Definition_Progress_Report + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Definition_Progress_Report); + + procedure Write_SemanticTokensParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SemanticTokensParams); + + procedure Write_ColorInformation_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ColorInformation_Vector); + + procedure Write_DocumentSymbol_Progress_Report + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSymbol_Progress_Report); + + procedure Write_CallHierarchyIncomingCall_Vector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CallHierarchyIncomingCall_Vector_Or_Null); + + procedure Write_CodeLens_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CodeLens_Vector); + + procedure Write_LSPAny + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.LSPAny); + + procedure Write_LogTraceParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.LogTraceParams); + + procedure Write_PrepareRenameResult_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.PrepareRenameResult_Or_Null); + + procedure Write_CompletionItem_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CompletionItem_Vector); + + procedure Write_Moniker_Vector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Moniker_Vector_Or_Null); + + procedure Write_WorkDoneProgressReport + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.WorkDoneProgressReport); + + procedure Write_WorkspaceSymbolParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.WorkspaceSymbolParams); + + procedure Write_InitializeResult + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.InitializeResult); + + procedure Write_WorkDoneProgressCancelParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.WorkDoneProgressCancelParams); + + procedure Write_DidChangeWatchedFilesParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DidChangeWatchedFilesParams); + + procedure Write_DidOpenNotebookDocumentParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DidOpenNotebookDocumentParams); + + procedure Write_SignatureHelp_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SignatureHelp_Or_Null); + + procedure Write_CodeLens_Vector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CodeLens_Vector_Or_Null); + + procedure Write_WorkspaceFolder_Vector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.WorkspaceFolder_Vector_Or_Null); + + procedure Write_DocumentLinkParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentLinkParams); + + procedure Write_ConfigurationParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ConfigurationParams); + + procedure Write_DidChangeTextDocumentParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DidChangeTextDocumentParams); + + procedure Write_Declaration_Progress_Report + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Declaration_Progress_Report); + + procedure Write_DidSaveTextDocumentParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DidSaveTextDocumentParams); + + procedure Write_ShowMessageParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ShowMessageParams); + + procedure Write_ReferenceParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ReferenceParams); + + procedure Write_DidChangeConfigurationParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DidChangeConfigurationParams); + + procedure Write_Hover_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Hover_Or_Null); + + procedure Write_CallHierarchyOutgoingCall_Vector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CallHierarchyOutgoingCall_Vector_Or_Null); + + procedure Write_ShowDocumentResult + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ShowDocumentResult); + + procedure Write_TypeDefinitionParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.TypeDefinitionParams); + + procedure Write_RenameParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.RenameParams); + + procedure Write_LSPAny_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.LSPAny_Or_Null); + + procedure Write_WorkspaceSymbol + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.WorkspaceSymbol); + + procedure Write_LSPAny_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.LSPAny_Vector); + + procedure Write_PrepareRenameParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.PrepareRenameParams); + + procedure Write_CancelParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CancelParams); + + procedure Write_DefinitionParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DefinitionParams); + + procedure Write_ColorPresentationParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ColorPresentationParams); + + procedure Write_ErrorCodes + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.ErrorCodes); + + procedure Write_FoldingRange_Vector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.FoldingRange_Vector_Or_Null); + + procedure Write_MessageActionItem_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.MessageActionItem_Or_Null); + + procedure Write_ApplyWorkspaceEditParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ApplyWorkspaceEditParams); + + procedure Write_CodeAction + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CodeAction); + + procedure Write_InlayHint_Vector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.InlayHint_Vector_Or_Null); + + procedure Write_DeclarationParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DeclarationParams); + + procedure Write_DocumentRangeFormattingParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentRangeFormattingParams); + + procedure Write_MonikerParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.MonikerParams); + + procedure Write_InlayHint + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.InlayHint); + + procedure Write_UnregistrationParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.UnregistrationParams); + + procedure Write_SelectionRangeParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SelectionRangeParams); + + procedure Write_Tokens_Delta_Result + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Tokens_Delta_Result); + + procedure Write_RenameFilesParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.RenameFilesParams); + + procedure Write_Symbol_Progress_Report + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Symbol_Progress_Report); + + procedure Write_TypeHierarchySubtypesParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.TypeHierarchySubtypesParams); + + procedure Write_ApplyWorkspaceEditResult + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ApplyWorkspaceEditResult); + + procedure Write_SemanticTokensPartialResult + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SemanticTokensPartialResult); + + procedure Write_Completion_Result + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Completion_Result); + + procedure Write_CallHierarchyItem_Vector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CallHierarchyItem_Vector_Or_Null); + + procedure Write_DidCloseTextDocumentParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DidCloseTextDocumentParams); + + procedure Write_CallHierarchyOutgoingCallsParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CallHierarchyOutgoingCallsParams); + + procedure Write_SelectionRange_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SelectionRange_Vector); + + procedure Write_SemanticTokensDeltaParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SemanticTokensDeltaParams); + + procedure Write_DidChangeWorkspaceFoldersParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DidChangeWorkspaceFoldersParams); + + procedure Write_CodeLensParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CodeLensParams); + + procedure Write_TypeHierarchyItem_Vector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.TypeHierarchyItem_Vector_Or_Null); + + procedure Write_Symbol_Result + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Symbol_Result); + + procedure Write_TypeHierarchySupertypesParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.TypeHierarchySupertypesParams); + + procedure Write_PublishDiagnosticsParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.PublishDiagnosticsParams); + + procedure Write_WorkspaceDiagnosticReport + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.WorkspaceDiagnosticReport); + + procedure Write_TextEdit_Vector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.TextEdit_Vector_Or_Null); + + procedure Write_LinkedEditingRanges_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.LinkedEditingRanges_Or_Null); + + procedure Write_SetTraceParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SetTraceParams); + + procedure Write_WorkspaceDiagnosticReportPartialResult + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.WorkspaceDiagnosticReportPartialResult); + + procedure Write_DidOpenTextDocumentParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DidOpenTextDocumentParams); + + procedure Write_SemanticTokensPartialResult_Or_SemanticTokensDeltaPartialResult + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures + .SemanticTokensPartialResult_Or_SemanticTokensDeltaPartialResult); + + procedure Write_DocumentDiagnosticReport + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentDiagnosticReport); + + procedure Write_ExecuteCommandParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ExecuteCommandParams); + + procedure Write_WorkDoneProgressBegin + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.WorkDoneProgressBegin); + + procedure Write_InlayHintParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.InlayHintParams); + + procedure Write_WorkDoneProgressCreateParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.WorkDoneProgressCreateParams); + + procedure Write_DocumentHighlightParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentHighlightParams); + + procedure Write_SemanticTokens_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SemanticTokens_Or_Null); + + procedure Write_SemanticTokensRangeParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SemanticTokensRangeParams); + + procedure Write_CompletionParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CompletionParams); + + procedure Write_CallHierarchyIncomingCallsParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CallHierarchyIncomingCallsParams); + + procedure Write_Location_Vector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Location_Vector_Or_Null); + + procedure Write_DidChangeNotebookDocumentParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DidChangeNotebookDocumentParams); + + procedure Write_WorkspaceDiagnosticParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.WorkspaceDiagnosticParams); + + procedure Write_InlineValue_Vector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.InlineValue_Vector_Or_Null); + + procedure Write_DidCloseNotebookDocumentParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DidCloseNotebookDocumentParams); + + procedure Write_InlayHint_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.InlayHint_Vector); + + procedure Write_ShowDocumentParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ShowDocumentParams); + + procedure Write_CreateFilesParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CreateFilesParams); + + procedure Write_ColorPresentation_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ColorPresentation_Vector); + + procedure Write_DocumentFormattingParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentFormattingParams); + + procedure Write_DeleteFilesParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DeleteFilesParams); + + procedure Write_TypeHierarchyItem_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.TypeHierarchyItem_Vector); + + procedure Write_DocumentOnTypeFormattingParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentOnTypeFormattingParams); + + procedure Write_Location_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Location_Vector); + + procedure Write_DocumentColorParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentColorParams); + + procedure Write_DocumentLink + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentLink); + + procedure Write_WorkDoneProgressEnd + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.WorkDoneProgressEnd); + + procedure Write_DocumentSymbolParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSymbolParams); + + procedure Write_InlineValue_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.InlineValue_Vector); + + procedure Write_InitializedParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.InitializedParams); + + procedure Write_ShowMessageRequestParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ShowMessageRequestParams); + + procedure Write_WorkspaceEdit_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.WorkspaceEdit_Or_Null); + + procedure Write_DocumentHighlight_Vector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentHighlight_Vector_Or_Null); + + procedure Write_LogMessageParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.LogMessageParams); + + procedure Write_CodeLens + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CodeLens); + + procedure Write_DocumentDiagnosticReportPartialResult + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentDiagnosticReportPartialResult); + + procedure Write_CallHierarchyIncomingCall_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CallHierarchyIncomingCall_Vector); + + procedure Write_ProgressParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ProgressParams); + + procedure Write_DocumentSymbol_Result + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentSymbol_Result); + + procedure Write_TypeHierarchyPrepareParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.TypeHierarchyPrepareParams); + + procedure Write_WillSaveTextDocumentParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.WillSaveTextDocumentParams); + + procedure Write_Command_Or_CodeAction_Vector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Command_Or_CodeAction_Vector_Or_Null); + + procedure Write_Definition_Result + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Definition_Result); + + procedure Write_CompletionItem + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CompletionItem); + + procedure Write_Moniker_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Moniker_Vector); + + procedure Write_HoverParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.HoverParams); + + procedure Write_DocumentHighlight_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DocumentHighlight_Vector); + + procedure Write_Integer_Or_Virtual_String + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.Integer_Or_Virtual_String); + + procedure Write_FoldingRangeParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.FoldingRangeParams); + + procedure Write_RegistrationParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.RegistrationParams); + + procedure Write_SignatureHelpParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SignatureHelpParams); + + procedure Write_CodeActionParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CodeActionParams); + + procedure Write_FoldingRange_Vector + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.FoldingRange_Vector); + + procedure Write_SelectionRange_Vector_Or_Null + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.SelectionRange_Vector_Or_Null); + + procedure Write_LinkedEditingRangeParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.LinkedEditingRangeParams); + + procedure Write_ImplementationParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ImplementationParams); + + procedure Write_CallHierarchyPrepareParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.CallHierarchyPrepareParams); + +end LSP.Outputs; diff --git a/source/lsp_3.17/generated/lsp-progress_report_readers.adb b/source/lsp_3.17/generated/lsp-progress_report_readers.adb new file mode 100644 index 000000000..c716a3896 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-progress_report_readers.adb @@ -0,0 +1,379 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with Minimal_Perfect_Hash; +with LSP.Inputs; +with LSP.Input_Tools; +with LSP.Structures; + +with LSP.Progress_Reports.IncomingCalls; +with LSP.Progress_Reports.OutgoingCalls; +with LSP.Progress_Reports.CodeAction; +with LSP.Progress_Reports.CodeLens; +with LSP.Progress_Reports.ColorPresentation; +with LSP.Progress_Reports.Completion; +with LSP.Progress_Reports.Declaration; +with LSP.Progress_Reports.Definition; +with LSP.Progress_Reports.Diagnostic; +with LSP.Progress_Reports.DocumentColor; +with LSP.Progress_Reports.DocumentHighlight; +with LSP.Progress_Reports.DocumentLink; +with LSP.Progress_Reports.DocumentSymbol; +with LSP.Progress_Reports.FoldingRange; +with LSP.Progress_Reports.Implementation; +with LSP.Progress_Reports.InlayHint; +with LSP.Progress_Reports.InlineValue; +with LSP.Progress_Reports.Moniker; +with LSP.Progress_Reports.References; +with LSP.Progress_Reports.SelectionRange; +with LSP.Progress_Reports.Full; +with LSP.Progress_Reports.Tokens_Delta; +with LSP.Progress_Reports.Tokens_Range; +with LSP.Progress_Reports.TypeDefinition; +with LSP.Progress_Reports.Subtypes; +with LSP.Progress_Reports.Supertypes; +with LSP.Progress_Reports.Workspace_Diagnostic; +with LSP.Progress_Reports.Symbol; +with LSP.Progress_Reports.ProgressBegin; +with LSP.Progress_Reports.ProgressReport; +with LSP.Progress_Reports.ProgressEnd; + +package body LSP.Progress_Report_Readers is + package Method_Map is new Minimal_Perfect_Hash + (["callHierarchy/incomingCalls", + "callHierarchy/outgoingCalls", + "textDocument/codeAction", + "textDocument/codeLens", + "textDocument/colorPresentation", + "textDocument/completion", + "textDocument/declaration", + "textDocument/definition", + "textDocument/diagnostic", + "textDocument/documentColor", + "textDocument/documentHighlight", + "textDocument/documentLink", + "textDocument/documentSymbol", + "textDocument/foldingRange", + "textDocument/implementation", + "textDocument/inlayHint", + "textDocument/inlineValue", + "textDocument/moniker", + "textDocument/references", + "textDocument/selectionRange", + "textDocument/semanticTokens/full", + "textDocument/semanticTokens/full/delta", + "textDocument/semanticTokens/range", + "textDocument/typeDefinition", + "typeHierarchy/subtypes", + "typeHierarchy/supertypes", + "workspace/diagnostic", + "workspace/symbol", + "WorkDoneProgressBegin", + "WorkDoneProgressReport", + "WorkDoneProgressEnd"]); + + procedure Initialize is + begin + Method_Map.Initialize; + end Initialize; + + procedure Read_IncomingCalls is new LSP.Input_Tools.Read_Progress_Report + (LSP.Structures.CallHierarchyIncomingCall_Vector, + LSP.Inputs.Read_CallHierarchyIncomingCall_Vector); + + procedure Read_OutgoingCalls is new LSP.Input_Tools.Read_Progress_Report + (LSP.Structures.CallHierarchyOutgoingCall_Vector, + LSP.Inputs.Read_CallHierarchyOutgoingCall_Vector); + + procedure Read_CodeAction is new LSP.Input_Tools.Read_Progress_Report + (LSP.Structures.Command_Or_CodeAction_Vector, + LSP.Inputs.Read_Command_Or_CodeAction_Vector); + + procedure Read_CodeLens is new LSP.Input_Tools.Read_Progress_Report + (LSP.Structures.CodeLens_Vector, LSP.Inputs.Read_CodeLens_Vector); + + procedure Read_ColorPresentation is new LSP.Input_Tools.Read_Progress_Report + (LSP.Structures.ColorPresentation_Vector, + LSP.Inputs.Read_ColorPresentation_Vector); + + procedure Read_Completion is new LSP.Input_Tools.Read_Progress_Report + (LSP.Structures.CompletionItem_Vector, + LSP.Inputs.Read_CompletionItem_Vector); + + procedure Read_Declaration is new LSP.Input_Tools.Read_Progress_Report + (LSP.Structures.Declaration_Progress_Report, + LSP.Inputs.Read_Declaration_Progress_Report); + + procedure Read_Definition is new LSP.Input_Tools.Read_Progress_Report + (LSP.Structures.Definition_Progress_Report, + LSP.Inputs.Read_Definition_Progress_Report); + + procedure Read_Diagnostic is new LSP.Input_Tools.Read_Progress_Report + (LSP.Structures.DocumentDiagnosticReportPartialResult, + LSP.Inputs.Read_DocumentDiagnosticReportPartialResult); + + procedure Read_DocumentColor is new LSP.Input_Tools.Read_Progress_Report + (LSP.Structures.ColorInformation_Vector, + LSP.Inputs.Read_ColorInformation_Vector); + + procedure Read_DocumentHighlight is new LSP.Input_Tools.Read_Progress_Report + (LSP.Structures.DocumentHighlight_Vector, + LSP.Inputs.Read_DocumentHighlight_Vector); + + procedure Read_DocumentLink is new LSP.Input_Tools.Read_Progress_Report + (LSP.Structures.DocumentLink_Vector, LSP.Inputs.Read_DocumentLink_Vector); + + procedure Read_DocumentSymbol is new LSP.Input_Tools.Read_Progress_Report + (LSP.Structures.DocumentSymbol_Progress_Report, + LSP.Inputs.Read_DocumentSymbol_Progress_Report); + + procedure Read_FoldingRange is new LSP.Input_Tools.Read_Progress_Report + (LSP.Structures.FoldingRange_Vector, LSP.Inputs.Read_FoldingRange_Vector); + + procedure Read_Implementation is new LSP.Input_Tools.Read_Progress_Report + (LSP.Structures.Definition_Progress_Report, + LSP.Inputs.Read_Definition_Progress_Report); + + procedure Read_InlayHint is new LSP.Input_Tools.Read_Progress_Report + (LSP.Structures.InlayHint_Vector, LSP.Inputs.Read_InlayHint_Vector); + + procedure Read_InlineValue is new LSP.Input_Tools.Read_Progress_Report + (LSP.Structures.InlineValue_Vector, LSP.Inputs.Read_InlineValue_Vector); + + procedure Read_Moniker is new LSP.Input_Tools.Read_Progress_Report + (LSP.Structures.Moniker_Vector, LSP.Inputs.Read_Moniker_Vector); + + procedure Read_References is new LSP.Input_Tools.Read_Progress_Report + (LSP.Structures.Location_Vector, LSP.Inputs.Read_Location_Vector); + + procedure Read_SelectionRange is new LSP.Input_Tools.Read_Progress_Report + (LSP.Structures.SelectionRange_Vector, + LSP.Inputs.Read_SelectionRange_Vector); + + procedure Read_Full is new LSP.Input_Tools.Read_Progress_Report + (LSP.Structures.SemanticTokensPartialResult, + LSP.Inputs.Read_SemanticTokensPartialResult); + + procedure Read_Tokens_Delta is new LSP.Input_Tools.Read_Progress_Report + (LSP.Structures + .SemanticTokensPartialResult_Or_SemanticTokensDeltaPartialResult, + LSP.Inputs + .Read_SemanticTokensPartialResult_Or_SemanticTokensDeltaPartialResult); + + procedure Read_Tokens_Range is new LSP.Input_Tools.Read_Progress_Report + (LSP.Structures.SemanticTokensPartialResult, + LSP.Inputs.Read_SemanticTokensPartialResult); + + procedure Read_TypeDefinition is new LSP.Input_Tools.Read_Progress_Report + (LSP.Structures.Definition_Progress_Report, + LSP.Inputs.Read_Definition_Progress_Report); + + procedure Read_Subtypes is new LSP.Input_Tools.Read_Progress_Report + (LSP.Structures.TypeHierarchyItem_Vector, + LSP.Inputs.Read_TypeHierarchyItem_Vector); + + procedure Read_Supertypes is new LSP.Input_Tools.Read_Progress_Report + (LSP.Structures.TypeHierarchyItem_Vector, + LSP.Inputs.Read_TypeHierarchyItem_Vector); + + procedure Read_Workspace_Diagnostic is new LSP.Input_Tools + .Read_Progress_Report + (LSP.Structures.WorkspaceDiagnosticReportPartialResult, + LSP.Inputs.Read_WorkspaceDiagnosticReportPartialResult); + + procedure Read_Symbol is new LSP.Input_Tools.Read_Progress_Report + (LSP.Structures.Symbol_Progress_Report, + LSP.Inputs.Read_Symbol_Progress_Report); + + procedure Read_ProgressBegin is new LSP.Input_Tools.Read_Progress_Report + (LSP.Structures.WorkDoneProgressBegin, + LSP.Inputs.Read_WorkDoneProgressBegin); + + procedure Read_ProgressReport is new LSP.Input_Tools.Read_Progress_Report + (LSP.Structures.WorkDoneProgressReport, + LSP.Inputs.Read_WorkDoneProgressReport); + + procedure Read_ProgressEnd is new LSP.Input_Tools.Read_Progress_Report + (LSP.Structures.WorkDoneProgressEnd, LSP.Inputs.Read_WorkDoneProgressEnd); + + function Read_Progress_Report + (Input : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Method : VSS.Strings.Virtual_String) + return LSP.Progress_Reports.Progress_Report'Class is + Index : constant Natural := Method_Map.Get_Index (Method); + begin + case Index is + when 1 => -- callHierarchy/incomingCalls + return + Result : LSP.Progress_Reports.IncomingCalls.Partial_Result do + Read_IncomingCalls (Input, Result.Token, Result.Params); + end return; + + when 2 => -- callHierarchy/outgoingCalls + return + Result : LSP.Progress_Reports.OutgoingCalls.Partial_Result do + Read_OutgoingCalls (Input, Result.Token, Result.Params); + end return; + + when 3 => -- textDocument/codeAction + return Result : LSP.Progress_Reports.CodeAction.Partial_Result do + Read_CodeAction (Input, Result.Token, Result.Params); + end return; + + when 4 => -- textDocument/codeLens + return Result : LSP.Progress_Reports.CodeLens.Partial_Result do + Read_CodeLens (Input, Result.Token, Result.Params); + end return; + + when 5 => -- textDocument/colorPresentation + return + Result : LSP.Progress_Reports.ColorPresentation.Partial_Result do + Read_ColorPresentation (Input, Result.Token, Result.Params); + end return; + + when 6 => -- textDocument/completion + return Result : LSP.Progress_Reports.Completion.Partial_Result do + Read_Completion (Input, Result.Token, Result.Params); + end return; + + when 7 => -- textDocument/declaration + return Result : LSP.Progress_Reports.Declaration.Partial_Result do + Read_Declaration (Input, Result.Token, Result.Params); + end return; + + when 8 => -- textDocument/definition + return Result : LSP.Progress_Reports.Definition.Partial_Result do + Read_Definition (Input, Result.Token, Result.Params); + end return; + + when 9 => -- textDocument/diagnostic + return Result : LSP.Progress_Reports.Diagnostic.Partial_Result do + Read_Diagnostic (Input, Result.Token, Result.Params); + end return; + + when 10 => -- textDocument/documentColor + return + Result : LSP.Progress_Reports.DocumentColor.Partial_Result do + Read_DocumentColor (Input, Result.Token, Result.Params); + end return; + + when 11 => -- textDocument/documentHighlight + return + Result : LSP.Progress_Reports.DocumentHighlight.Partial_Result do + Read_DocumentHighlight (Input, Result.Token, Result.Params); + end return; + + when 12 => -- textDocument/documentLink + return Result : LSP.Progress_Reports.DocumentLink.Partial_Result do + Read_DocumentLink (Input, Result.Token, Result.Params); + end return; + + when 13 => -- textDocument/documentSymbol + return + Result : LSP.Progress_Reports.DocumentSymbol.Partial_Result do + Read_DocumentSymbol (Input, Result.Token, Result.Params); + end return; + + when 14 => -- textDocument/foldingRange + return Result : LSP.Progress_Reports.FoldingRange.Partial_Result do + Read_FoldingRange (Input, Result.Token, Result.Params); + end return; + + when 15 => -- textDocument/implementation + return + Result : LSP.Progress_Reports.Implementation.Partial_Result do + Read_Implementation (Input, Result.Token, Result.Params); + end return; + + when 16 => -- textDocument/inlayHint + return Result : LSP.Progress_Reports.InlayHint.Partial_Result do + Read_InlayHint (Input, Result.Token, Result.Params); + end return; + + when 17 => -- textDocument/inlineValue + return Result : LSP.Progress_Reports.InlineValue.Partial_Result do + Read_InlineValue (Input, Result.Token, Result.Params); + end return; + + when 18 => -- textDocument/moniker + return Result : LSP.Progress_Reports.Moniker.Partial_Result do + Read_Moniker (Input, Result.Token, Result.Params); + end return; + + when 19 => -- textDocument/references + return Result : LSP.Progress_Reports.References.Partial_Result do + Read_References (Input, Result.Token, Result.Params); + end return; + + when 20 => -- textDocument/selectionRange + return + Result : LSP.Progress_Reports.SelectionRange.Partial_Result do + Read_SelectionRange (Input, Result.Token, Result.Params); + end return; + + when 21 => -- textDocument/semanticTokens/full + return Result : LSP.Progress_Reports.Full.Partial_Result do + Read_Full (Input, Result.Token, Result.Params); + end return; + + when 22 => -- textDocument/semanticTokens/full/delta + return Result : LSP.Progress_Reports.Tokens_Delta.Partial_Result do + Read_Tokens_Delta (Input, Result.Token, Result.Params); + end return; + + when 23 => -- textDocument/semanticTokens/range + return Result : LSP.Progress_Reports.Tokens_Range.Partial_Result do + Read_Tokens_Range (Input, Result.Token, Result.Params); + end return; + + when 24 => -- textDocument/typeDefinition + return + Result : LSP.Progress_Reports.TypeDefinition.Partial_Result do + Read_TypeDefinition (Input, Result.Token, Result.Params); + end return; + + when 25 => -- typeHierarchy/subtypes + return Result : LSP.Progress_Reports.Subtypes.Partial_Result do + Read_Subtypes (Input, Result.Token, Result.Params); + end return; + + when 26 => -- typeHierarchy/supertypes + return Result : LSP.Progress_Reports.Supertypes.Partial_Result do + Read_Supertypes (Input, Result.Token, Result.Params); + end return; + + when 27 => -- workspace/diagnostic + return + Result : LSP.Progress_Reports.Workspace_Diagnostic.Partial_Result + do + Read_Workspace_Diagnostic (Input, Result.Token, Result.Params); + end return; + + when 28 => -- workspace/symbol + return Result : LSP.Progress_Reports.Symbol.Partial_Result do + Read_Symbol (Input, Result.Token, Result.Params); + end return; + + when 29 => -- WorkDoneProgressBegin + return Result : LSP.Progress_Reports.ProgressBegin.Work_Done do + Read_ProgressBegin (Input, Result.Token, Result.Params); + end return; + + when 30 => -- WorkDoneProgressReport + return Result : LSP.Progress_Reports.ProgressReport.Work_Done do + Read_ProgressReport (Input, Result.Token, Result.Params); + end return; + + when 31 => -- WorkDoneProgressEnd + return Result : LSP.Progress_Reports.ProgressEnd.Work_Done do + Read_ProgressEnd (Input, Result.Token, Result.Params); + end return; + + when others => + return raise Program_Error with "Unknown method"; + end case; + end Read_Progress_Report; +end LSP.Progress_Report_Readers; diff --git a/source/lsp_3.17/generated/lsp-progress_report_receivers.ads b/source/lsp_3.17/generated/lsp-progress_report_receivers.ads new file mode 100644 index 000000000..70a4b6112 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-progress_report_receivers.ads @@ -0,0 +1,281 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Progress_Report_Receivers is + pragma Preelaborate; + + type Progress_Report_Receiver is limited interface; + + procedure On_IncomingCalls_Partial_Result + (Self : in out Progress_Report_Receiver; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CallHierarchyIncomingCall_Vector) is null; + -- A request to resolve the incoming calls for a given `CallHierarchyItem`. + -- + -- @since 3.16.0 + + procedure On_OutgoingCalls_Partial_Result + (Self : in out Progress_Report_Receiver; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CallHierarchyOutgoingCall_Vector) is null; + -- A request to resolve the outgoing calls for a given `CallHierarchyItem`. + -- + -- @since 3.16.0 + + procedure On_CodeAction_Partial_Result + (Self : in out Progress_Report_Receiver; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Command_Or_CodeAction_Vector) is null; + -- A request to provide commands for the given text document and range. + + procedure On_CodeLens_Partial_Result + (Self : in out Progress_Report_Receiver; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CodeLens_Vector) is null; + -- A request to provide code lens for the given text document. + + procedure On_ColorPresentation_Partial_Result + (Self : in out Progress_Report_Receiver; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ColorPresentation_Vector) is null; + -- A request to list all presentation for a color. The request's parameter + -- is of type [ColorPresentationParams](#ColorPresentationParams) the + -- response is of type [ColorInformation[]](#ColorInformation) or a + -- Thenable that resolves to such. + + procedure On_Completion_Partial_Result + (Self : in out Progress_Report_Receiver; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CompletionItem_Vector) is null; + -- Request to request completion at a given text + -- document position. The request's parameter is of type + -- [TextDocumentPosition](#TextDocumentPosition) the response is of type + -- [CompletionItem[]](#CompletionItem) or [CompletionList](#CompletionList) + -- or a Thenable that resolves to such. + -- + -- The request can delay the computation of + -- the [`detail`](#CompletionItem.detail) and + -- [`documentation`](#CompletionItem.documentation) properties to the + -- `completionItem/resolve` request. However, properties that are needed + -- for the initial sorting and filtering, like `sortText`, `filterText`, + -- `insertText`, and `textEdit`, must not be changed during resolve. + + procedure On_Declaration_Partial_Result + (Self : in out Progress_Report_Receiver; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Declaration_Progress_Report) is null; + -- A request to resolve the type definition locations of a symbol at + -- a given text document position. The request's parameter is of type + -- [TextDocumentPositionParams] (#TextDocumentPositionParams) the + -- response is of type [Declaration](#Declaration) or a typed array of + -- [DeclarationLink](#DeclarationLink) or a Thenable that resolves to such. + + procedure On_Definition_Partial_Result + (Self : in out Progress_Report_Receiver; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Definition_Progress_Report) is null; + -- A request to resolve the definition location of a symbol at a + -- given text document position. The request's parameter is of type + -- [TextDocumentPosition] (#TextDocumentPosition) the response is + -- of either type [Definition](#Definition) or a typed array of + -- [DefinitionLink](#DefinitionLink) or a Thenable that resolves to such. + + procedure On_Diagnostic_Partial_Result + (Self : in out Progress_Report_Receiver; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentDiagnosticReportPartialResult) is null; + -- The document diagnostic request definition. + -- + -- @since 3.17.0 + + procedure On_DocumentColor_Partial_Result + (Self : in out Progress_Report_Receiver; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ColorInformation_Vector) is null; + -- A request to list all color symbols found in a given + -- text document. The request's parameter is of type + -- [DocumentColorParams](#DocumentColorParams) the response is of type + -- [ColorInformation[]](#ColorInformation) or a Thenable that resolves + -- to such. + + procedure On_DocumentHighlight_Partial_Result + (Self : in out Progress_Report_Receiver; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentHighlight_Vector) is null; + -- Request to resolve a [DocumentHighlight](#DocumentHighlight) for + -- a given text document position. The request's parameter is of type + -- [TextDocumentPosition] (#TextDocumentPosition) the request response is + -- of type [DocumentHighlight[]] (#DocumentHighlight) or a Thenable that + -- resolves to such. + + procedure On_DocumentLink_Partial_Result + (Self : in out Progress_Report_Receiver; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentLink_Vector) is null; + -- A request to provide document links + + procedure On_DocumentSymbol_Partial_Result + (Self : in out Progress_Report_Receiver; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentSymbol_Progress_Report) is null; + -- A request to list all symbols found in a given + -- text document. The request's parameter is of type + -- [TextDocumentIdentifier](#TextDocumentIdentifier) the response is + -- of type [SymbolInformation[]](#SymbolInformation) or a Thenable + -- that resolves to such. + + procedure On_FoldingRange_Partial_Result + (Self : in out Progress_Report_Receiver; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.FoldingRange_Vector) is null; + -- A request to provide folding ranges in a document. The request's + -- parameter is of type [FoldingRangeParams](#FoldingRangeParams), the + -- response is of type [FoldingRangeList](#FoldingRangeList) or a Thenable + -- that resolves to such. + + procedure On_Implementation_Partial_Result + (Self : in out Progress_Report_Receiver; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Definition_Progress_Report) is null; + -- A request to resolve the implementation locations of a symbol at + -- a given text document position. The request's parameter is of type + -- [TextDocumentPositionParams] (#TextDocumentPositionParams) the response + -- is of type [Definition](#Definition) or a Thenable that resolves to + -- such. + + procedure On_InlayHint_Partial_Result + (Self : in out Progress_Report_Receiver; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InlayHint_Vector) is null; + -- A request to provide inlay hints in a document. The request's parameter + -- is of type [InlayHintsParams](#InlayHintsParams), the response is of + -- type [InlayHint[]](#InlayHint[]) or a Thenable that resolves to such. + -- + -- @since 3.17.0 + + procedure On_InlineValue_Partial_Result + (Self : in out Progress_Report_Receiver; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InlineValue_Vector) is null; + -- A request to provide inline values in a document. The request's + -- parameter is of type [InlineValueParams](#InlineValueParams), the + -- response is of type [InlineValue[]](#InlineValue[]) or a Thenable + -- that resolves to such. + -- + -- @since 3.17.0 + + procedure On_Moniker_Partial_Result + (Self : in out Progress_Report_Receiver; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Moniker_Vector) is null; + -- A request to get the moniker of a symbol at a given + -- text document position. The request parameter is of type + -- [TextDocumentPositionParams](#TextDocumentPositionParams). The + -- response is of type [Moniker[]](#Moniker[]) or `null`. + + procedure On_References_Partial_Result + (Self : in out Progress_Report_Receiver; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Location_Vector) is null; + -- A request to resolve project-wide references for the symbol denoted + -- by the given text document position. The request's parameter is of + -- type [ReferenceParams](#ReferenceParams) the response is of type + -- [Location[]](#Location) or a Thenable that resolves to such. + + procedure On_SelectionRange_Partial_Result + (Self : in out Progress_Report_Receiver; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SelectionRange_Vector) is null; + -- A request to provide selection ranges in a document. The request's + -- parameter is of type [SelectionRangeParams](#SelectionRangeParams), the + -- response is of type [SelectionRange[]](#SelectionRange[]) or a Thenable + -- that resolves to such. + + procedure On_Full_Partial_Result + (Self : in out Progress_Report_Receiver; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SemanticTokensPartialResult) is null; + -- @since 3.16.0 + + procedure On_Tokens_Delta_Partial_Result + (Self : in out Progress_Report_Receiver; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures + .SemanticTokensPartialResult_Or_SemanticTokensDeltaPartialResult) is null; + -- @since 3.16.0 + + procedure On_Tokens_Range_Partial_Result + (Self : in out Progress_Report_Receiver; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SemanticTokensPartialResult) is null; + -- @since 3.16.0 + + procedure On_TypeDefinition_Partial_Result + (Self : in out Progress_Report_Receiver; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Definition_Progress_Report) is null; + -- A request to resolve the type definition locations of a symbol at + -- a given text document position. The request's parameter is of type + -- [TextDocumentPositionParams] (#TextDocumentPositionParams) the response + -- is of type [Definition](#Definition) or a Thenable that resolves to + -- such. + + procedure On_Subtypes_Partial_Result + (Self : in out Progress_Report_Receiver; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TypeHierarchyItem_Vector) is null; + -- A request to resolve the subtypes for a given `TypeHierarchyItem`. + -- + -- @since 3.17.0 + + procedure On_Supertypes_Partial_Result + (Self : in out Progress_Report_Receiver; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TypeHierarchyItem_Vector) is null; + -- A request to resolve the supertypes for a given `TypeHierarchyItem`. + -- + -- @since 3.17.0 + + procedure On_Workspace_Diagnostic_Partial_Result + (Self : in out Progress_Report_Receiver; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceDiagnosticReportPartialResult) is null; + -- The workspace diagnostic request definition. + -- + -- @since 3.17.0 + + procedure On_Symbol_Partial_Result + (Self : in out Progress_Report_Receiver; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Symbol_Progress_Report) is null; + -- A request to list project-wide symbols matching the query string given + -- by the [WorkspaceSymbolParams](#WorkspaceSymbolParams). The response + -- is of type [SymbolInformation[]](#SymbolInformation) or a Thenable + -- that resolves to such. + -- + -- @since 3.17.0 - support for WorkspaceSymbol in the returned data. + -- Clients + -- need to advertise support for WorkspaceSymbols via the client capability + -- `workspace.symbol.resolveSupport`. + + procedure On_ProgressBegin_Work_Done + (Self : in out Progress_Report_Receiver; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkDoneProgressBegin) is null; + + procedure On_ProgressReport_Work_Done + (Self : in out Progress_Report_Receiver; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkDoneProgressReport) is null; + + procedure On_ProgressEnd_Work_Done + (Self : in out Progress_Report_Receiver; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkDoneProgressEnd) is null; + +end LSP.Progress_Report_Receivers; diff --git a/source/lsp_3.17/generated/lsp-progress_report_writers.adb b/source/lsp_3.17/generated/lsp-progress_report_writers.adb new file mode 100644 index 000000000..691bc407a --- /dev/null +++ b/source/lsp_3.17/generated/lsp-progress_report_writers.adb @@ -0,0 +1,361 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Output_Tools; +with LSP.Outputs; + +package body LSP.Progress_Report_Writers is + + overriding procedure On_IncomingCalls_Partial_Result + (Self : in out Progress_Report_Writer; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CallHierarchyIncomingCall_Vector) is + begin + LSP.Output_Tools.Write_Start_Progress_Report (Self.Output.all, Token); + LSP.Outputs.Write_CallHierarchyIncomingCall_Vector + (Self.Output.all, Value); + Self.Output.End_Object; + Self.Output.End_Object; + end On_IncomingCalls_Partial_Result; + + overriding procedure On_OutgoingCalls_Partial_Result + (Self : in out Progress_Report_Writer; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CallHierarchyOutgoingCall_Vector) is + begin + LSP.Output_Tools.Write_Start_Progress_Report (Self.Output.all, Token); + LSP.Outputs.Write_CallHierarchyOutgoingCall_Vector + (Self.Output.all, Value); + Self.Output.End_Object; + Self.Output.End_Object; + end On_OutgoingCalls_Partial_Result; + + overriding procedure On_CodeAction_Partial_Result + (Self : in out Progress_Report_Writer; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Command_Or_CodeAction_Vector) is + begin + LSP.Output_Tools.Write_Start_Progress_Report (Self.Output.all, Token); + LSP.Outputs.Write_Command_Or_CodeAction_Vector (Self.Output.all, Value); + Self.Output.End_Object; + Self.Output.End_Object; + end On_CodeAction_Partial_Result; + + overriding procedure On_CodeLens_Partial_Result + (Self : in out Progress_Report_Writer; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CodeLens_Vector) is + begin + LSP.Output_Tools.Write_Start_Progress_Report (Self.Output.all, Token); + LSP.Outputs.Write_CodeLens_Vector (Self.Output.all, Value); + Self.Output.End_Object; + Self.Output.End_Object; + end On_CodeLens_Partial_Result; + + overriding procedure On_ColorPresentation_Partial_Result + (Self : in out Progress_Report_Writer; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ColorPresentation_Vector) is + begin + LSP.Output_Tools.Write_Start_Progress_Report (Self.Output.all, Token); + LSP.Outputs.Write_ColorPresentation_Vector (Self.Output.all, Value); + Self.Output.End_Object; + Self.Output.End_Object; + end On_ColorPresentation_Partial_Result; + + overriding procedure On_Completion_Partial_Result + (Self : in out Progress_Report_Writer; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CompletionItem_Vector) is + begin + LSP.Output_Tools.Write_Start_Progress_Report (Self.Output.all, Token); + LSP.Outputs.Write_CompletionItem_Vector (Self.Output.all, Value); + Self.Output.End_Object; + Self.Output.End_Object; + end On_Completion_Partial_Result; + + overriding procedure On_Declaration_Partial_Result + (Self : in out Progress_Report_Writer; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Declaration_Progress_Report) is + begin + LSP.Output_Tools.Write_Start_Progress_Report (Self.Output.all, Token); + LSP.Outputs.Write_Declaration_Progress_Report (Self.Output.all, Value); + Self.Output.End_Object; + Self.Output.End_Object; + end On_Declaration_Partial_Result; + + overriding procedure On_Definition_Partial_Result + (Self : in out Progress_Report_Writer; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Definition_Progress_Report) is + begin + LSP.Output_Tools.Write_Start_Progress_Report (Self.Output.all, Token); + LSP.Outputs.Write_Definition_Progress_Report (Self.Output.all, Value); + Self.Output.End_Object; + Self.Output.End_Object; + end On_Definition_Partial_Result; + + overriding procedure On_Diagnostic_Partial_Result + (Self : in out Progress_Report_Writer; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentDiagnosticReportPartialResult) is + begin + LSP.Output_Tools.Write_Start_Progress_Report (Self.Output.all, Token); + LSP.Outputs.Write_DocumentDiagnosticReportPartialResult + (Self.Output.all, Value); + Self.Output.End_Object; + Self.Output.End_Object; + end On_Diagnostic_Partial_Result; + + overriding procedure On_DocumentColor_Partial_Result + (Self : in out Progress_Report_Writer; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ColorInformation_Vector) is + begin + LSP.Output_Tools.Write_Start_Progress_Report (Self.Output.all, Token); + LSP.Outputs.Write_ColorInformation_Vector (Self.Output.all, Value); + Self.Output.End_Object; + Self.Output.End_Object; + end On_DocumentColor_Partial_Result; + + overriding procedure On_DocumentHighlight_Partial_Result + (Self : in out Progress_Report_Writer; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentHighlight_Vector) is + begin + LSP.Output_Tools.Write_Start_Progress_Report (Self.Output.all, Token); + LSP.Outputs.Write_DocumentHighlight_Vector (Self.Output.all, Value); + Self.Output.End_Object; + Self.Output.End_Object; + end On_DocumentHighlight_Partial_Result; + + overriding procedure On_DocumentLink_Partial_Result + (Self : in out Progress_Report_Writer; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentLink_Vector) is + begin + LSP.Output_Tools.Write_Start_Progress_Report (Self.Output.all, Token); + LSP.Outputs.Write_DocumentLink_Vector (Self.Output.all, Value); + Self.Output.End_Object; + Self.Output.End_Object; + end On_DocumentLink_Partial_Result; + + overriding procedure On_DocumentSymbol_Partial_Result + (Self : in out Progress_Report_Writer; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentSymbol_Progress_Report) is + begin + LSP.Output_Tools.Write_Start_Progress_Report (Self.Output.all, Token); + LSP.Outputs.Write_DocumentSymbol_Progress_Report + (Self.Output.all, Value); + Self.Output.End_Object; + Self.Output.End_Object; + end On_DocumentSymbol_Partial_Result; + + overriding procedure On_FoldingRange_Partial_Result + (Self : in out Progress_Report_Writer; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.FoldingRange_Vector) is + begin + LSP.Output_Tools.Write_Start_Progress_Report (Self.Output.all, Token); + LSP.Outputs.Write_FoldingRange_Vector (Self.Output.all, Value); + Self.Output.End_Object; + Self.Output.End_Object; + end On_FoldingRange_Partial_Result; + + overriding procedure On_Implementation_Partial_Result + (Self : in out Progress_Report_Writer; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Definition_Progress_Report) is + begin + LSP.Output_Tools.Write_Start_Progress_Report (Self.Output.all, Token); + LSP.Outputs.Write_Definition_Progress_Report (Self.Output.all, Value); + Self.Output.End_Object; + Self.Output.End_Object; + end On_Implementation_Partial_Result; + + overriding procedure On_InlayHint_Partial_Result + (Self : in out Progress_Report_Writer; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InlayHint_Vector) is + begin + LSP.Output_Tools.Write_Start_Progress_Report (Self.Output.all, Token); + LSP.Outputs.Write_InlayHint_Vector (Self.Output.all, Value); + Self.Output.End_Object; + Self.Output.End_Object; + end On_InlayHint_Partial_Result; + + overriding procedure On_InlineValue_Partial_Result + (Self : in out Progress_Report_Writer; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InlineValue_Vector) is + begin + LSP.Output_Tools.Write_Start_Progress_Report (Self.Output.all, Token); + LSP.Outputs.Write_InlineValue_Vector (Self.Output.all, Value); + Self.Output.End_Object; + Self.Output.End_Object; + end On_InlineValue_Partial_Result; + + overriding procedure On_Moniker_Partial_Result + (Self : in out Progress_Report_Writer; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Moniker_Vector) is + begin + LSP.Output_Tools.Write_Start_Progress_Report (Self.Output.all, Token); + LSP.Outputs.Write_Moniker_Vector (Self.Output.all, Value); + Self.Output.End_Object; + Self.Output.End_Object; + end On_Moniker_Partial_Result; + + overriding procedure On_References_Partial_Result + (Self : in out Progress_Report_Writer; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Location_Vector) is + begin + LSP.Output_Tools.Write_Start_Progress_Report (Self.Output.all, Token); + LSP.Outputs.Write_Location_Vector (Self.Output.all, Value); + Self.Output.End_Object; + Self.Output.End_Object; + end On_References_Partial_Result; + + overriding procedure On_SelectionRange_Partial_Result + (Self : in out Progress_Report_Writer; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SelectionRange_Vector) is + begin + LSP.Output_Tools.Write_Start_Progress_Report (Self.Output.all, Token); + LSP.Outputs.Write_SelectionRange_Vector (Self.Output.all, Value); + Self.Output.End_Object; + Self.Output.End_Object; + end On_SelectionRange_Partial_Result; + + overriding procedure On_Full_Partial_Result + (Self : in out Progress_Report_Writer; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SemanticTokensPartialResult) is + begin + LSP.Output_Tools.Write_Start_Progress_Report (Self.Output.all, Token); + LSP.Outputs.Write_SemanticTokensPartialResult (Self.Output.all, Value); + Self.Output.End_Object; + Self.Output.End_Object; + end On_Full_Partial_Result; + + overriding procedure On_Tokens_Delta_Partial_Result + (Self : in out Progress_Report_Writer; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures + .SemanticTokensPartialResult_Or_SemanticTokensDeltaPartialResult) is + begin + LSP.Output_Tools.Write_Start_Progress_Report (Self.Output.all, Token); + LSP.Outputs + .Write_SemanticTokensPartialResult_Or_SemanticTokensDeltaPartialResult + (Self.Output.all, Value); + Self.Output.End_Object; + Self.Output.End_Object; + end On_Tokens_Delta_Partial_Result; + + overriding procedure On_Tokens_Range_Partial_Result + (Self : in out Progress_Report_Writer; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SemanticTokensPartialResult) is + begin + LSP.Output_Tools.Write_Start_Progress_Report (Self.Output.all, Token); + LSP.Outputs.Write_SemanticTokensPartialResult (Self.Output.all, Value); + Self.Output.End_Object; + Self.Output.End_Object; + end On_Tokens_Range_Partial_Result; + + overriding procedure On_TypeDefinition_Partial_Result + (Self : in out Progress_Report_Writer; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Definition_Progress_Report) is + begin + LSP.Output_Tools.Write_Start_Progress_Report (Self.Output.all, Token); + LSP.Outputs.Write_Definition_Progress_Report (Self.Output.all, Value); + Self.Output.End_Object; + Self.Output.End_Object; + end On_TypeDefinition_Partial_Result; + + overriding procedure On_Subtypes_Partial_Result + (Self : in out Progress_Report_Writer; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TypeHierarchyItem_Vector) is + begin + LSP.Output_Tools.Write_Start_Progress_Report (Self.Output.all, Token); + LSP.Outputs.Write_TypeHierarchyItem_Vector (Self.Output.all, Value); + Self.Output.End_Object; + Self.Output.End_Object; + end On_Subtypes_Partial_Result; + + overriding procedure On_Supertypes_Partial_Result + (Self : in out Progress_Report_Writer; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TypeHierarchyItem_Vector) is + begin + LSP.Output_Tools.Write_Start_Progress_Report (Self.Output.all, Token); + LSP.Outputs.Write_TypeHierarchyItem_Vector (Self.Output.all, Value); + Self.Output.End_Object; + Self.Output.End_Object; + end On_Supertypes_Partial_Result; + + overriding procedure On_Workspace_Diagnostic_Partial_Result + (Self : in out Progress_Report_Writer; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceDiagnosticReportPartialResult) is + begin + LSP.Output_Tools.Write_Start_Progress_Report (Self.Output.all, Token); + LSP.Outputs.Write_WorkspaceDiagnosticReportPartialResult + (Self.Output.all, Value); + Self.Output.End_Object; + Self.Output.End_Object; + end On_Workspace_Diagnostic_Partial_Result; + + overriding procedure On_Symbol_Partial_Result + (Self : in out Progress_Report_Writer; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Symbol_Progress_Report) is + begin + LSP.Output_Tools.Write_Start_Progress_Report (Self.Output.all, Token); + LSP.Outputs.Write_Symbol_Progress_Report (Self.Output.all, Value); + Self.Output.End_Object; + Self.Output.End_Object; + end On_Symbol_Partial_Result; + + overriding procedure On_ProgressBegin_Work_Done + (Self : in out Progress_Report_Writer; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkDoneProgressBegin) is + begin + LSP.Output_Tools.Write_Start_Progress_Report (Self.Output.all, Token); + LSP.Outputs.Write_WorkDoneProgressBegin (Self.Output.all, Value); + Self.Output.End_Object; + Self.Output.End_Object; + end On_ProgressBegin_Work_Done; + + overriding procedure On_ProgressReport_Work_Done + (Self : in out Progress_Report_Writer; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkDoneProgressReport) is + begin + LSP.Output_Tools.Write_Start_Progress_Report (Self.Output.all, Token); + LSP.Outputs.Write_WorkDoneProgressReport (Self.Output.all, Value); + Self.Output.End_Object; + Self.Output.End_Object; + end On_ProgressReport_Work_Done; + + overriding procedure On_ProgressEnd_Work_Done + (Self : in out Progress_Report_Writer; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkDoneProgressEnd) is + begin + LSP.Output_Tools.Write_Start_Progress_Report (Self.Output.all, Token); + LSP.Outputs.Write_WorkDoneProgressEnd (Self.Output.all, Value); + Self.Output.End_Object; + Self.Output.End_Object; + end On_ProgressEnd_Work_Done; + +end LSP.Progress_Report_Writers; diff --git a/source/lsp_3.17/generated/lsp-progress_report_writers.ads b/source/lsp_3.17/generated/lsp-progress_report_writers.ads new file mode 100644 index 000000000..8109874fe --- /dev/null +++ b/source/lsp_3.17/generated/lsp-progress_report_writers.ads @@ -0,0 +1,174 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; +with VSS.JSON.Content_Handlers; +with LSP.Progress_Report_Receivers; + +package LSP.Progress_Report_Writers is + pragma Preelaborate; + + type Progress_Report_Writer + (Output : access VSS.JSON.Content_Handlers.JSON_Content_Handler'Class) is + new LSP.Progress_Report_Receivers.Progress_Report_Receiver with null record; + + overriding procedure On_IncomingCalls_Partial_Result + (Self : in out Progress_Report_Writer; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CallHierarchyIncomingCall_Vector); + + overriding procedure On_OutgoingCalls_Partial_Result + (Self : in out Progress_Report_Writer; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CallHierarchyOutgoingCall_Vector); + + overriding procedure On_CodeAction_Partial_Result + (Self : in out Progress_Report_Writer; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Command_Or_CodeAction_Vector); + + overriding procedure On_CodeLens_Partial_Result + (Self : in out Progress_Report_Writer; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CodeLens_Vector); + + overriding procedure On_ColorPresentation_Partial_Result + (Self : in out Progress_Report_Writer; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ColorPresentation_Vector); + + overriding procedure On_Completion_Partial_Result + (Self : in out Progress_Report_Writer; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CompletionItem_Vector); + + overriding procedure On_Declaration_Partial_Result + (Self : in out Progress_Report_Writer; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Declaration_Progress_Report); + + overriding procedure On_Definition_Partial_Result + (Self : in out Progress_Report_Writer; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Definition_Progress_Report); + + overriding procedure On_Diagnostic_Partial_Result + (Self : in out Progress_Report_Writer; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentDiagnosticReportPartialResult); + + overriding procedure On_DocumentColor_Partial_Result + (Self : in out Progress_Report_Writer; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ColorInformation_Vector); + + overriding procedure On_DocumentHighlight_Partial_Result + (Self : in out Progress_Report_Writer; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentHighlight_Vector); + + overriding procedure On_DocumentLink_Partial_Result + (Self : in out Progress_Report_Writer; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentLink_Vector); + + overriding procedure On_DocumentSymbol_Partial_Result + (Self : in out Progress_Report_Writer; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentSymbol_Progress_Report); + + overriding procedure On_FoldingRange_Partial_Result + (Self : in out Progress_Report_Writer; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.FoldingRange_Vector); + + overriding procedure On_Implementation_Partial_Result + (Self : in out Progress_Report_Writer; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Definition_Progress_Report); + + overriding procedure On_InlayHint_Partial_Result + (Self : in out Progress_Report_Writer; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InlayHint_Vector); + + overriding procedure On_InlineValue_Partial_Result + (Self : in out Progress_Report_Writer; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InlineValue_Vector); + + overriding procedure On_Moniker_Partial_Result + (Self : in out Progress_Report_Writer; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Moniker_Vector); + + overriding procedure On_References_Partial_Result + (Self : in out Progress_Report_Writer; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Location_Vector); + + overriding procedure On_SelectionRange_Partial_Result + (Self : in out Progress_Report_Writer; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SelectionRange_Vector); + + overriding procedure On_Full_Partial_Result + (Self : in out Progress_Report_Writer; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SemanticTokensPartialResult); + + overriding procedure On_Tokens_Delta_Partial_Result + (Self : in out Progress_Report_Writer; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures + .SemanticTokensPartialResult_Or_SemanticTokensDeltaPartialResult); + + overriding procedure On_Tokens_Range_Partial_Result + (Self : in out Progress_Report_Writer; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SemanticTokensPartialResult); + + overriding procedure On_TypeDefinition_Partial_Result + (Self : in out Progress_Report_Writer; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Definition_Progress_Report); + + overriding procedure On_Subtypes_Partial_Result + (Self : in out Progress_Report_Writer; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TypeHierarchyItem_Vector); + + overriding procedure On_Supertypes_Partial_Result + (Self : in out Progress_Report_Writer; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TypeHierarchyItem_Vector); + + overriding procedure On_Workspace_Diagnostic_Partial_Result + (Self : in out Progress_Report_Writer; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceDiagnosticReportPartialResult); + + overriding procedure On_Symbol_Partial_Result + (Self : in out Progress_Report_Writer; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Symbol_Progress_Report); + + overriding procedure On_ProgressBegin_Work_Done + (Self : in out Progress_Report_Writer; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkDoneProgressBegin); + + overriding procedure On_ProgressReport_Work_Done + (Self : in out Progress_Report_Writer; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkDoneProgressReport); + + overriding procedure On_ProgressEnd_Work_Done + (Self : in out Progress_Report_Writer; + Token : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkDoneProgressEnd); + +end LSP.Progress_Report_Writers; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-codeaction.adb b/source/lsp_3.17/generated/lsp-progress_reports-codeaction.adb new file mode 100644 index 000000000..b9ec353d7 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-progress_reports-codeaction.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Progress_Reports.CodeAction is + + overriding procedure Visit_Receiver + (Self : Partial_Result; + Value : in out LSP.Progress_Report_Receivers.Progress_Report_Receiver' + Class) is + begin + Value.On_CodeAction_Partial_Result (Self.Token, Self.Params); + end Visit_Receiver; + +end LSP.Progress_Reports.CodeAction; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-codeaction.ads b/source/lsp_3.17/generated/lsp-progress_reports-codeaction.ads new file mode 100644 index 000000000..16d2e023a --- /dev/null +++ b/source/lsp_3.17/generated/lsp-progress_reports-codeaction.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Progress_Reports.CodeAction is + pragma Preelaborate; + + type Partial_Result is new LSP.Progress_Reports.Progress_Report with record + Params : LSP.Structures.Command_Or_CodeAction_Vector; + end record; + + overriding procedure Visit_Receiver + (Self : Partial_Result; + Value : in out LSP.Progress_Report_Receivers.Progress_Report_Receiver' + Class); + +end LSP.Progress_Reports.CodeAction; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-codelens.adb b/source/lsp_3.17/generated/lsp-progress_reports-codelens.adb new file mode 100644 index 000000000..fdedc80ec --- /dev/null +++ b/source/lsp_3.17/generated/lsp-progress_reports-codelens.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Progress_Reports.CodeLens is + + overriding procedure Visit_Receiver + (Self : Partial_Result; + Value : in out LSP.Progress_Report_Receivers.Progress_Report_Receiver' + Class) is + begin + Value.On_CodeLens_Partial_Result (Self.Token, Self.Params); + end Visit_Receiver; + +end LSP.Progress_Reports.CodeLens; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-codelens.ads b/source/lsp_3.17/generated/lsp-progress_reports-codelens.ads new file mode 100644 index 000000000..6e4a1e6dd --- /dev/null +++ b/source/lsp_3.17/generated/lsp-progress_reports-codelens.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Progress_Reports.CodeLens is + pragma Preelaborate; + + type Partial_Result is new LSP.Progress_Reports.Progress_Report with record + Params : LSP.Structures.CodeLens_Vector; + end record; + + overriding procedure Visit_Receiver + (Self : Partial_Result; + Value : in out LSP.Progress_Report_Receivers.Progress_Report_Receiver' + Class); + +end LSP.Progress_Reports.CodeLens; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-colorpresentation.adb b/source/lsp_3.17/generated/lsp-progress_reports-colorpresentation.adb new file mode 100644 index 000000000..cf7322938 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-progress_reports-colorpresentation.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Progress_Reports.ColorPresentation is + + overriding procedure Visit_Receiver + (Self : Partial_Result; + Value : in out LSP.Progress_Report_Receivers.Progress_Report_Receiver' + Class) is + begin + Value.On_ColorPresentation_Partial_Result (Self.Token, Self.Params); + end Visit_Receiver; + +end LSP.Progress_Reports.ColorPresentation; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-colorpresentation.ads b/source/lsp_3.17/generated/lsp-progress_reports-colorpresentation.ads new file mode 100644 index 000000000..18b27f147 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-progress_reports-colorpresentation.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Progress_Reports.ColorPresentation is + pragma Preelaborate; + + type Partial_Result is new LSP.Progress_Reports.Progress_Report with record + Params : LSP.Structures.ColorPresentation_Vector; + end record; + + overriding procedure Visit_Receiver + (Self : Partial_Result; + Value : in out LSP.Progress_Report_Receivers.Progress_Report_Receiver' + Class); + +end LSP.Progress_Reports.ColorPresentation; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-completion.adb b/source/lsp_3.17/generated/lsp-progress_reports-completion.adb new file mode 100644 index 000000000..e7c9d83fa --- /dev/null +++ b/source/lsp_3.17/generated/lsp-progress_reports-completion.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Progress_Reports.Completion is + + overriding procedure Visit_Receiver + (Self : Partial_Result; + Value : in out LSP.Progress_Report_Receivers.Progress_Report_Receiver' + Class) is + begin + Value.On_Completion_Partial_Result (Self.Token, Self.Params); + end Visit_Receiver; + +end LSP.Progress_Reports.Completion; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-completion.ads b/source/lsp_3.17/generated/lsp-progress_reports-completion.ads new file mode 100644 index 000000000..316b2258e --- /dev/null +++ b/source/lsp_3.17/generated/lsp-progress_reports-completion.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Progress_Reports.Completion is + pragma Preelaborate; + + type Partial_Result is new LSP.Progress_Reports.Progress_Report with record + Params : LSP.Structures.CompletionItem_Vector; + end record; + + overriding procedure Visit_Receiver + (Self : Partial_Result; + Value : in out LSP.Progress_Report_Receivers.Progress_Report_Receiver' + Class); + +end LSP.Progress_Reports.Completion; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-declaration.adb b/source/lsp_3.17/generated/lsp-progress_reports-declaration.adb new file mode 100644 index 000000000..85fe87d6b --- /dev/null +++ b/source/lsp_3.17/generated/lsp-progress_reports-declaration.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Progress_Reports.Declaration is + + overriding procedure Visit_Receiver + (Self : Partial_Result; + Value : in out LSP.Progress_Report_Receivers.Progress_Report_Receiver' + Class) is + begin + Value.On_Declaration_Partial_Result (Self.Token, Self.Params); + end Visit_Receiver; + +end LSP.Progress_Reports.Declaration; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-declaration.ads b/source/lsp_3.17/generated/lsp-progress_reports-declaration.ads new file mode 100644 index 000000000..a17fd4922 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-progress_reports-declaration.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Progress_Reports.Declaration is + pragma Preelaborate; + + type Partial_Result is new LSP.Progress_Reports.Progress_Report with record + Params : LSP.Structures.Declaration_Progress_Report; + end record; + + overriding procedure Visit_Receiver + (Self : Partial_Result; + Value : in out LSP.Progress_Report_Receivers.Progress_Report_Receiver' + Class); + +end LSP.Progress_Reports.Declaration; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-definition.adb b/source/lsp_3.17/generated/lsp-progress_reports-definition.adb new file mode 100644 index 000000000..ffc9d17a2 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-progress_reports-definition.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Progress_Reports.Definition is + + overriding procedure Visit_Receiver + (Self : Partial_Result; + Value : in out LSP.Progress_Report_Receivers.Progress_Report_Receiver' + Class) is + begin + Value.On_Definition_Partial_Result (Self.Token, Self.Params); + end Visit_Receiver; + +end LSP.Progress_Reports.Definition; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-definition.ads b/source/lsp_3.17/generated/lsp-progress_reports-definition.ads new file mode 100644 index 000000000..d7b03ba9b --- /dev/null +++ b/source/lsp_3.17/generated/lsp-progress_reports-definition.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Progress_Reports.Definition is + pragma Preelaborate; + + type Partial_Result is new LSP.Progress_Reports.Progress_Report with record + Params : LSP.Structures.Definition_Progress_Report; + end record; + + overriding procedure Visit_Receiver + (Self : Partial_Result; + Value : in out LSP.Progress_Report_Receivers.Progress_Report_Receiver' + Class); + +end LSP.Progress_Reports.Definition; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-diagnostic.adb b/source/lsp_3.17/generated/lsp-progress_reports-diagnostic.adb new file mode 100644 index 000000000..31928a348 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-progress_reports-diagnostic.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Progress_Reports.Diagnostic is + + overriding procedure Visit_Receiver + (Self : Partial_Result; + Value : in out LSP.Progress_Report_Receivers.Progress_Report_Receiver' + Class) is + begin + Value.On_Diagnostic_Partial_Result (Self.Token, Self.Params); + end Visit_Receiver; + +end LSP.Progress_Reports.Diagnostic; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-diagnostic.ads b/source/lsp_3.17/generated/lsp-progress_reports-diagnostic.ads new file mode 100644 index 000000000..3826a4aea --- /dev/null +++ b/source/lsp_3.17/generated/lsp-progress_reports-diagnostic.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Progress_Reports.Diagnostic is + pragma Preelaborate; + + type Partial_Result is new LSP.Progress_Reports.Progress_Report with record + Params : LSP.Structures.DocumentDiagnosticReportPartialResult; + end record; + + overriding procedure Visit_Receiver + (Self : Partial_Result; + Value : in out LSP.Progress_Report_Receivers.Progress_Report_Receiver' + Class); + +end LSP.Progress_Reports.Diagnostic; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-documentcolor.adb b/source/lsp_3.17/generated/lsp-progress_reports-documentcolor.adb new file mode 100644 index 000000000..2c6ce7fba --- /dev/null +++ b/source/lsp_3.17/generated/lsp-progress_reports-documentcolor.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Progress_Reports.DocumentColor is + + overriding procedure Visit_Receiver + (Self : Partial_Result; + Value : in out LSP.Progress_Report_Receivers.Progress_Report_Receiver' + Class) is + begin + Value.On_DocumentColor_Partial_Result (Self.Token, Self.Params); + end Visit_Receiver; + +end LSP.Progress_Reports.DocumentColor; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-documentcolor.ads b/source/lsp_3.17/generated/lsp-progress_reports-documentcolor.ads new file mode 100644 index 000000000..e77102063 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-progress_reports-documentcolor.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Progress_Reports.DocumentColor is + pragma Preelaborate; + + type Partial_Result is new LSP.Progress_Reports.Progress_Report with record + Params : LSP.Structures.ColorInformation_Vector; + end record; + + overriding procedure Visit_Receiver + (Self : Partial_Result; + Value : in out LSP.Progress_Report_Receivers.Progress_Report_Receiver' + Class); + +end LSP.Progress_Reports.DocumentColor; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-documenthighlight.adb b/source/lsp_3.17/generated/lsp-progress_reports-documenthighlight.adb new file mode 100644 index 000000000..a979ef88d --- /dev/null +++ b/source/lsp_3.17/generated/lsp-progress_reports-documenthighlight.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Progress_Reports.DocumentHighlight is + + overriding procedure Visit_Receiver + (Self : Partial_Result; + Value : in out LSP.Progress_Report_Receivers.Progress_Report_Receiver' + Class) is + begin + Value.On_DocumentHighlight_Partial_Result (Self.Token, Self.Params); + end Visit_Receiver; + +end LSP.Progress_Reports.DocumentHighlight; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-documenthighlight.ads b/source/lsp_3.17/generated/lsp-progress_reports-documenthighlight.ads new file mode 100644 index 000000000..e0479e335 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-progress_reports-documenthighlight.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Progress_Reports.DocumentHighlight is + pragma Preelaborate; + + type Partial_Result is new LSP.Progress_Reports.Progress_Report with record + Params : LSP.Structures.DocumentHighlight_Vector; + end record; + + overriding procedure Visit_Receiver + (Self : Partial_Result; + Value : in out LSP.Progress_Report_Receivers.Progress_Report_Receiver' + Class); + +end LSP.Progress_Reports.DocumentHighlight; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-documentlink.adb b/source/lsp_3.17/generated/lsp-progress_reports-documentlink.adb new file mode 100644 index 000000000..beb29da9e --- /dev/null +++ b/source/lsp_3.17/generated/lsp-progress_reports-documentlink.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Progress_Reports.DocumentLink is + + overriding procedure Visit_Receiver + (Self : Partial_Result; + Value : in out LSP.Progress_Report_Receivers.Progress_Report_Receiver' + Class) is + begin + Value.On_DocumentLink_Partial_Result (Self.Token, Self.Params); + end Visit_Receiver; + +end LSP.Progress_Reports.DocumentLink; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-documentlink.ads b/source/lsp_3.17/generated/lsp-progress_reports-documentlink.ads new file mode 100644 index 000000000..965ae91b5 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-progress_reports-documentlink.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Progress_Reports.DocumentLink is + pragma Preelaborate; + + type Partial_Result is new LSP.Progress_Reports.Progress_Report with record + Params : LSP.Structures.DocumentLink_Vector; + end record; + + overriding procedure Visit_Receiver + (Self : Partial_Result; + Value : in out LSP.Progress_Report_Receivers.Progress_Report_Receiver' + Class); + +end LSP.Progress_Reports.DocumentLink; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-documentsymbol.adb b/source/lsp_3.17/generated/lsp-progress_reports-documentsymbol.adb new file mode 100644 index 000000000..ed9e1766e --- /dev/null +++ b/source/lsp_3.17/generated/lsp-progress_reports-documentsymbol.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Progress_Reports.DocumentSymbol is + + overriding procedure Visit_Receiver + (Self : Partial_Result; + Value : in out LSP.Progress_Report_Receivers.Progress_Report_Receiver' + Class) is + begin + Value.On_DocumentSymbol_Partial_Result (Self.Token, Self.Params); + end Visit_Receiver; + +end LSP.Progress_Reports.DocumentSymbol; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-documentsymbol.ads b/source/lsp_3.17/generated/lsp-progress_reports-documentsymbol.ads new file mode 100644 index 000000000..55641a52d --- /dev/null +++ b/source/lsp_3.17/generated/lsp-progress_reports-documentsymbol.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Progress_Reports.DocumentSymbol is + pragma Preelaborate; + + type Partial_Result is new LSP.Progress_Reports.Progress_Report with record + Params : LSP.Structures.DocumentSymbol_Progress_Report; + end record; + + overriding procedure Visit_Receiver + (Self : Partial_Result; + Value : in out LSP.Progress_Report_Receivers.Progress_Report_Receiver' + Class); + +end LSP.Progress_Reports.DocumentSymbol; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-foldingrange.adb b/source/lsp_3.17/generated/lsp-progress_reports-foldingrange.adb new file mode 100644 index 000000000..ac4dd30aa --- /dev/null +++ b/source/lsp_3.17/generated/lsp-progress_reports-foldingrange.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Progress_Reports.FoldingRange is + + overriding procedure Visit_Receiver + (Self : Partial_Result; + Value : in out LSP.Progress_Report_Receivers.Progress_Report_Receiver' + Class) is + begin + Value.On_FoldingRange_Partial_Result (Self.Token, Self.Params); + end Visit_Receiver; + +end LSP.Progress_Reports.FoldingRange; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-foldingrange.ads b/source/lsp_3.17/generated/lsp-progress_reports-foldingrange.ads new file mode 100644 index 000000000..627193da6 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-progress_reports-foldingrange.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Progress_Reports.FoldingRange is + pragma Preelaborate; + + type Partial_Result is new LSP.Progress_Reports.Progress_Report with record + Params : LSP.Structures.FoldingRange_Vector; + end record; + + overriding procedure Visit_Receiver + (Self : Partial_Result; + Value : in out LSP.Progress_Report_Receivers.Progress_Report_Receiver' + Class); + +end LSP.Progress_Reports.FoldingRange; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-full.adb b/source/lsp_3.17/generated/lsp-progress_reports-full.adb new file mode 100644 index 000000000..54690cadd --- /dev/null +++ b/source/lsp_3.17/generated/lsp-progress_reports-full.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Progress_Reports.Full is + + overriding procedure Visit_Receiver + (Self : Partial_Result; + Value : in out LSP.Progress_Report_Receivers.Progress_Report_Receiver' + Class) is + begin + Value.On_Full_Partial_Result (Self.Token, Self.Params); + end Visit_Receiver; + +end LSP.Progress_Reports.Full; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-full.ads b/source/lsp_3.17/generated/lsp-progress_reports-full.ads new file mode 100644 index 000000000..01083e886 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-progress_reports-full.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Progress_Reports.Full is + pragma Preelaborate; + + type Partial_Result is new LSP.Progress_Reports.Progress_Report with record + Params : LSP.Structures.SemanticTokensPartialResult; + end record; + + overriding procedure Visit_Receiver + (Self : Partial_Result; + Value : in out LSP.Progress_Report_Receivers.Progress_Report_Receiver' + Class); + +end LSP.Progress_Reports.Full; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-implementation.adb b/source/lsp_3.17/generated/lsp-progress_reports-implementation.adb new file mode 100644 index 000000000..7a073a947 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-progress_reports-implementation.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Progress_Reports.Implementation is + + overriding procedure Visit_Receiver + (Self : Partial_Result; + Value : in out LSP.Progress_Report_Receivers.Progress_Report_Receiver' + Class) is + begin + Value.On_Implementation_Partial_Result (Self.Token, Self.Params); + end Visit_Receiver; + +end LSP.Progress_Reports.Implementation; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-implementation.ads b/source/lsp_3.17/generated/lsp-progress_reports-implementation.ads new file mode 100644 index 000000000..613131b03 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-progress_reports-implementation.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Progress_Reports.Implementation is + pragma Preelaborate; + + type Partial_Result is new LSP.Progress_Reports.Progress_Report with record + Params : LSP.Structures.Definition_Progress_Report; + end record; + + overriding procedure Visit_Receiver + (Self : Partial_Result; + Value : in out LSP.Progress_Report_Receivers.Progress_Report_Receiver' + Class); + +end LSP.Progress_Reports.Implementation; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-incomingcalls.adb b/source/lsp_3.17/generated/lsp-progress_reports-incomingcalls.adb new file mode 100644 index 000000000..8703418f7 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-progress_reports-incomingcalls.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Progress_Reports.IncomingCalls is + + overriding procedure Visit_Receiver + (Self : Partial_Result; + Value : in out LSP.Progress_Report_Receivers.Progress_Report_Receiver' + Class) is + begin + Value.On_IncomingCalls_Partial_Result (Self.Token, Self.Params); + end Visit_Receiver; + +end LSP.Progress_Reports.IncomingCalls; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-incomingcalls.ads b/source/lsp_3.17/generated/lsp-progress_reports-incomingcalls.ads new file mode 100644 index 000000000..3aa76eb46 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-progress_reports-incomingcalls.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Progress_Reports.IncomingCalls is + pragma Preelaborate; + + type Partial_Result is new LSP.Progress_Reports.Progress_Report with record + Params : LSP.Structures.CallHierarchyIncomingCall_Vector; + end record; + + overriding procedure Visit_Receiver + (Self : Partial_Result; + Value : in out LSP.Progress_Report_Receivers.Progress_Report_Receiver' + Class); + +end LSP.Progress_Reports.IncomingCalls; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-inlayhint.adb b/source/lsp_3.17/generated/lsp-progress_reports-inlayhint.adb new file mode 100644 index 000000000..8e67f2173 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-progress_reports-inlayhint.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Progress_Reports.InlayHint is + + overriding procedure Visit_Receiver + (Self : Partial_Result; + Value : in out LSP.Progress_Report_Receivers.Progress_Report_Receiver' + Class) is + begin + Value.On_InlayHint_Partial_Result (Self.Token, Self.Params); + end Visit_Receiver; + +end LSP.Progress_Reports.InlayHint; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-inlayhint.ads b/source/lsp_3.17/generated/lsp-progress_reports-inlayhint.ads new file mode 100644 index 000000000..3219b77a1 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-progress_reports-inlayhint.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Progress_Reports.InlayHint is + pragma Preelaborate; + + type Partial_Result is new LSP.Progress_Reports.Progress_Report with record + Params : LSP.Structures.InlayHint_Vector; + end record; + + overriding procedure Visit_Receiver + (Self : Partial_Result; + Value : in out LSP.Progress_Report_Receivers.Progress_Report_Receiver' + Class); + +end LSP.Progress_Reports.InlayHint; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-inlinevalue.adb b/source/lsp_3.17/generated/lsp-progress_reports-inlinevalue.adb new file mode 100644 index 000000000..51dc51ef0 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-progress_reports-inlinevalue.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Progress_Reports.InlineValue is + + overriding procedure Visit_Receiver + (Self : Partial_Result; + Value : in out LSP.Progress_Report_Receivers.Progress_Report_Receiver' + Class) is + begin + Value.On_InlineValue_Partial_Result (Self.Token, Self.Params); + end Visit_Receiver; + +end LSP.Progress_Reports.InlineValue; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-inlinevalue.ads b/source/lsp_3.17/generated/lsp-progress_reports-inlinevalue.ads new file mode 100644 index 000000000..8c075682f --- /dev/null +++ b/source/lsp_3.17/generated/lsp-progress_reports-inlinevalue.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Progress_Reports.InlineValue is + pragma Preelaborate; + + type Partial_Result is new LSP.Progress_Reports.Progress_Report with record + Params : LSP.Structures.InlineValue_Vector; + end record; + + overriding procedure Visit_Receiver + (Self : Partial_Result; + Value : in out LSP.Progress_Report_Receivers.Progress_Report_Receiver' + Class); + +end LSP.Progress_Reports.InlineValue; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-moniker.adb b/source/lsp_3.17/generated/lsp-progress_reports-moniker.adb new file mode 100644 index 000000000..da7df72df --- /dev/null +++ b/source/lsp_3.17/generated/lsp-progress_reports-moniker.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Progress_Reports.Moniker is + + overriding procedure Visit_Receiver + (Self : Partial_Result; + Value : in out LSP.Progress_Report_Receivers.Progress_Report_Receiver' + Class) is + begin + Value.On_Moniker_Partial_Result (Self.Token, Self.Params); + end Visit_Receiver; + +end LSP.Progress_Reports.Moniker; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-moniker.ads b/source/lsp_3.17/generated/lsp-progress_reports-moniker.ads new file mode 100644 index 000000000..f352ca929 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-progress_reports-moniker.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Progress_Reports.Moniker is + pragma Preelaborate; + + type Partial_Result is new LSP.Progress_Reports.Progress_Report with record + Params : LSP.Structures.Moniker_Vector; + end record; + + overriding procedure Visit_Receiver + (Self : Partial_Result; + Value : in out LSP.Progress_Report_Receivers.Progress_Report_Receiver' + Class); + +end LSP.Progress_Reports.Moniker; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-outgoingcalls.adb b/source/lsp_3.17/generated/lsp-progress_reports-outgoingcalls.adb new file mode 100644 index 000000000..ee3c1e931 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-progress_reports-outgoingcalls.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Progress_Reports.OutgoingCalls is + + overriding procedure Visit_Receiver + (Self : Partial_Result; + Value : in out LSP.Progress_Report_Receivers.Progress_Report_Receiver' + Class) is + begin + Value.On_OutgoingCalls_Partial_Result (Self.Token, Self.Params); + end Visit_Receiver; + +end LSP.Progress_Reports.OutgoingCalls; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-outgoingcalls.ads b/source/lsp_3.17/generated/lsp-progress_reports-outgoingcalls.ads new file mode 100644 index 000000000..445fa108f --- /dev/null +++ b/source/lsp_3.17/generated/lsp-progress_reports-outgoingcalls.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Progress_Reports.OutgoingCalls is + pragma Preelaborate; + + type Partial_Result is new LSP.Progress_Reports.Progress_Report with record + Params : LSP.Structures.CallHierarchyOutgoingCall_Vector; + end record; + + overriding procedure Visit_Receiver + (Self : Partial_Result; + Value : in out LSP.Progress_Report_Receivers.Progress_Report_Receiver' + Class); + +end LSP.Progress_Reports.OutgoingCalls; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-progressbegin.adb b/source/lsp_3.17/generated/lsp-progress_reports-progressbegin.adb new file mode 100644 index 000000000..350bde951 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-progress_reports-progressbegin.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Progress_Reports.ProgressBegin is + + overriding procedure Visit_Receiver + (Self : Work_Done; + Value : in out LSP.Progress_Report_Receivers.Progress_Report_Receiver' + Class) is + begin + Value.On_ProgressBegin_Work_Done (Self.Token, Self.Params); + end Visit_Receiver; + +end LSP.Progress_Reports.ProgressBegin; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-progressbegin.ads b/source/lsp_3.17/generated/lsp-progress_reports-progressbegin.ads new file mode 100644 index 000000000..1d105f518 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-progress_reports-progressbegin.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Progress_Reports.ProgressBegin is + pragma Preelaborate; + + type Work_Done is new LSP.Progress_Reports.Progress_Report with record + Params : LSP.Structures.WorkDoneProgressBegin; + end record; + + overriding procedure Visit_Receiver + (Self : Work_Done; + Value : in out LSP.Progress_Report_Receivers.Progress_Report_Receiver' + Class); + +end LSP.Progress_Reports.ProgressBegin; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-progressend.adb b/source/lsp_3.17/generated/lsp-progress_reports-progressend.adb new file mode 100644 index 000000000..f4bd31adc --- /dev/null +++ b/source/lsp_3.17/generated/lsp-progress_reports-progressend.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Progress_Reports.ProgressEnd is + + overriding procedure Visit_Receiver + (Self : Work_Done; + Value : in out LSP.Progress_Report_Receivers.Progress_Report_Receiver' + Class) is + begin + Value.On_ProgressEnd_Work_Done (Self.Token, Self.Params); + end Visit_Receiver; + +end LSP.Progress_Reports.ProgressEnd; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-progressend.ads b/source/lsp_3.17/generated/lsp-progress_reports-progressend.ads new file mode 100644 index 000000000..ba854847f --- /dev/null +++ b/source/lsp_3.17/generated/lsp-progress_reports-progressend.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Progress_Reports.ProgressEnd is + pragma Preelaborate; + + type Work_Done is new LSP.Progress_Reports.Progress_Report with record + Params : LSP.Structures.WorkDoneProgressEnd; + end record; + + overriding procedure Visit_Receiver + (Self : Work_Done; + Value : in out LSP.Progress_Report_Receivers.Progress_Report_Receiver' + Class); + +end LSP.Progress_Reports.ProgressEnd; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-progressreport.adb b/source/lsp_3.17/generated/lsp-progress_reports-progressreport.adb new file mode 100644 index 000000000..ad8ae1847 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-progress_reports-progressreport.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Progress_Reports.ProgressReport is + + overriding procedure Visit_Receiver + (Self : Work_Done; + Value : in out LSP.Progress_Report_Receivers.Progress_Report_Receiver' + Class) is + begin + Value.On_ProgressReport_Work_Done (Self.Token, Self.Params); + end Visit_Receiver; + +end LSP.Progress_Reports.ProgressReport; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-progressreport.ads b/source/lsp_3.17/generated/lsp-progress_reports-progressreport.ads new file mode 100644 index 000000000..a8111f14c --- /dev/null +++ b/source/lsp_3.17/generated/lsp-progress_reports-progressreport.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Progress_Reports.ProgressReport is + pragma Preelaborate; + + type Work_Done is new LSP.Progress_Reports.Progress_Report with record + Params : LSP.Structures.WorkDoneProgressReport; + end record; + + overriding procedure Visit_Receiver + (Self : Work_Done; + Value : in out LSP.Progress_Report_Receivers.Progress_Report_Receiver' + Class); + +end LSP.Progress_Reports.ProgressReport; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-references.adb b/source/lsp_3.17/generated/lsp-progress_reports-references.adb new file mode 100644 index 000000000..4157d800f --- /dev/null +++ b/source/lsp_3.17/generated/lsp-progress_reports-references.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Progress_Reports.References is + + overriding procedure Visit_Receiver + (Self : Partial_Result; + Value : in out LSP.Progress_Report_Receivers.Progress_Report_Receiver' + Class) is + begin + Value.On_References_Partial_Result (Self.Token, Self.Params); + end Visit_Receiver; + +end LSP.Progress_Reports.References; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-references.ads b/source/lsp_3.17/generated/lsp-progress_reports-references.ads new file mode 100644 index 000000000..9dafab220 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-progress_reports-references.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Progress_Reports.References is + pragma Preelaborate; + + type Partial_Result is new LSP.Progress_Reports.Progress_Report with record + Params : LSP.Structures.Location_Vector; + end record; + + overriding procedure Visit_Receiver + (Self : Partial_Result; + Value : in out LSP.Progress_Report_Receivers.Progress_Report_Receiver' + Class); + +end LSP.Progress_Reports.References; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-selectionrange.adb b/source/lsp_3.17/generated/lsp-progress_reports-selectionrange.adb new file mode 100644 index 000000000..ec9a4b6f3 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-progress_reports-selectionrange.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Progress_Reports.SelectionRange is + + overriding procedure Visit_Receiver + (Self : Partial_Result; + Value : in out LSP.Progress_Report_Receivers.Progress_Report_Receiver' + Class) is + begin + Value.On_SelectionRange_Partial_Result (Self.Token, Self.Params); + end Visit_Receiver; + +end LSP.Progress_Reports.SelectionRange; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-selectionrange.ads b/source/lsp_3.17/generated/lsp-progress_reports-selectionrange.ads new file mode 100644 index 000000000..cc8af8be8 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-progress_reports-selectionrange.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Progress_Reports.SelectionRange is + pragma Preelaborate; + + type Partial_Result is new LSP.Progress_Reports.Progress_Report with record + Params : LSP.Structures.SelectionRange_Vector; + end record; + + overriding procedure Visit_Receiver + (Self : Partial_Result; + Value : in out LSP.Progress_Report_Receivers.Progress_Report_Receiver' + Class); + +end LSP.Progress_Reports.SelectionRange; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-subtypes.adb b/source/lsp_3.17/generated/lsp-progress_reports-subtypes.adb new file mode 100644 index 000000000..916d1af57 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-progress_reports-subtypes.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Progress_Reports.Subtypes is + + overriding procedure Visit_Receiver + (Self : Partial_Result; + Value : in out LSP.Progress_Report_Receivers.Progress_Report_Receiver' + Class) is + begin + Value.On_Subtypes_Partial_Result (Self.Token, Self.Params); + end Visit_Receiver; + +end LSP.Progress_Reports.Subtypes; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-subtypes.ads b/source/lsp_3.17/generated/lsp-progress_reports-subtypes.ads new file mode 100644 index 000000000..52a9d4b60 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-progress_reports-subtypes.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Progress_Reports.Subtypes is + pragma Preelaborate; + + type Partial_Result is new LSP.Progress_Reports.Progress_Report with record + Params : LSP.Structures.TypeHierarchyItem_Vector; + end record; + + overriding procedure Visit_Receiver + (Self : Partial_Result; + Value : in out LSP.Progress_Report_Receivers.Progress_Report_Receiver' + Class); + +end LSP.Progress_Reports.Subtypes; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-supertypes.adb b/source/lsp_3.17/generated/lsp-progress_reports-supertypes.adb new file mode 100644 index 000000000..0df223504 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-progress_reports-supertypes.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Progress_Reports.Supertypes is + + overriding procedure Visit_Receiver + (Self : Partial_Result; + Value : in out LSP.Progress_Report_Receivers.Progress_Report_Receiver' + Class) is + begin + Value.On_Supertypes_Partial_Result (Self.Token, Self.Params); + end Visit_Receiver; + +end LSP.Progress_Reports.Supertypes; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-supertypes.ads b/source/lsp_3.17/generated/lsp-progress_reports-supertypes.ads new file mode 100644 index 000000000..e5452e630 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-progress_reports-supertypes.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Progress_Reports.Supertypes is + pragma Preelaborate; + + type Partial_Result is new LSP.Progress_Reports.Progress_Report with record + Params : LSP.Structures.TypeHierarchyItem_Vector; + end record; + + overriding procedure Visit_Receiver + (Self : Partial_Result; + Value : in out LSP.Progress_Report_Receivers.Progress_Report_Receiver' + Class); + +end LSP.Progress_Reports.Supertypes; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-symbol.adb b/source/lsp_3.17/generated/lsp-progress_reports-symbol.adb new file mode 100644 index 000000000..86db718d6 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-progress_reports-symbol.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Progress_Reports.Symbol is + + overriding procedure Visit_Receiver + (Self : Partial_Result; + Value : in out LSP.Progress_Report_Receivers.Progress_Report_Receiver' + Class) is + begin + Value.On_Symbol_Partial_Result (Self.Token, Self.Params); + end Visit_Receiver; + +end LSP.Progress_Reports.Symbol; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-symbol.ads b/source/lsp_3.17/generated/lsp-progress_reports-symbol.ads new file mode 100644 index 000000000..40d5e1ceb --- /dev/null +++ b/source/lsp_3.17/generated/lsp-progress_reports-symbol.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Progress_Reports.Symbol is + pragma Preelaborate; + + type Partial_Result is new LSP.Progress_Reports.Progress_Report with record + Params : LSP.Structures.Symbol_Progress_Report; + end record; + + overriding procedure Visit_Receiver + (Self : Partial_Result; + Value : in out LSP.Progress_Report_Receivers.Progress_Report_Receiver' + Class); + +end LSP.Progress_Reports.Symbol; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-tokens_delta.adb b/source/lsp_3.17/generated/lsp-progress_reports-tokens_delta.adb new file mode 100644 index 000000000..b04520226 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-progress_reports-tokens_delta.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Progress_Reports.Tokens_Delta is + + overriding procedure Visit_Receiver + (Self : Partial_Result; + Value : in out LSP.Progress_Report_Receivers.Progress_Report_Receiver' + Class) is + begin + Value.On_Tokens_Delta_Partial_Result (Self.Token, Self.Params); + end Visit_Receiver; + +end LSP.Progress_Reports.Tokens_Delta; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-tokens_delta.ads b/source/lsp_3.17/generated/lsp-progress_reports-tokens_delta.ads new file mode 100644 index 000000000..d46ffd7d5 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-progress_reports-tokens_delta.ads @@ -0,0 +1,22 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Progress_Reports.Tokens_Delta is + pragma Preelaborate; + + type Partial_Result is new LSP.Progress_Reports.Progress_Report with record + Params : LSP.Structures + .SemanticTokensPartialResult_Or_SemanticTokensDeltaPartialResult; + end record; + + overriding procedure Visit_Receiver + (Self : Partial_Result; + Value : in out LSP.Progress_Report_Receivers.Progress_Report_Receiver' + Class); + +end LSP.Progress_Reports.Tokens_Delta; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-tokens_range.adb b/source/lsp_3.17/generated/lsp-progress_reports-tokens_range.adb new file mode 100644 index 000000000..63fc26488 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-progress_reports-tokens_range.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Progress_Reports.Tokens_Range is + + overriding procedure Visit_Receiver + (Self : Partial_Result; + Value : in out LSP.Progress_Report_Receivers.Progress_Report_Receiver' + Class) is + begin + Value.On_Tokens_Range_Partial_Result (Self.Token, Self.Params); + end Visit_Receiver; + +end LSP.Progress_Reports.Tokens_Range; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-tokens_range.ads b/source/lsp_3.17/generated/lsp-progress_reports-tokens_range.ads new file mode 100644 index 000000000..0cfa579bc --- /dev/null +++ b/source/lsp_3.17/generated/lsp-progress_reports-tokens_range.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Progress_Reports.Tokens_Range is + pragma Preelaborate; + + type Partial_Result is new LSP.Progress_Reports.Progress_Report with record + Params : LSP.Structures.SemanticTokensPartialResult; + end record; + + overriding procedure Visit_Receiver + (Self : Partial_Result; + Value : in out LSP.Progress_Report_Receivers.Progress_Report_Receiver' + Class); + +end LSP.Progress_Reports.Tokens_Range; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-typedefinition.adb b/source/lsp_3.17/generated/lsp-progress_reports-typedefinition.adb new file mode 100644 index 000000000..396b72e5e --- /dev/null +++ b/source/lsp_3.17/generated/lsp-progress_reports-typedefinition.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Progress_Reports.TypeDefinition is + + overriding procedure Visit_Receiver + (Self : Partial_Result; + Value : in out LSP.Progress_Report_Receivers.Progress_Report_Receiver' + Class) is + begin + Value.On_TypeDefinition_Partial_Result (Self.Token, Self.Params); + end Visit_Receiver; + +end LSP.Progress_Reports.TypeDefinition; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-typedefinition.ads b/source/lsp_3.17/generated/lsp-progress_reports-typedefinition.ads new file mode 100644 index 000000000..930d62a9a --- /dev/null +++ b/source/lsp_3.17/generated/lsp-progress_reports-typedefinition.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Progress_Reports.TypeDefinition is + pragma Preelaborate; + + type Partial_Result is new LSP.Progress_Reports.Progress_Report with record + Params : LSP.Structures.Definition_Progress_Report; + end record; + + overriding procedure Visit_Receiver + (Self : Partial_Result; + Value : in out LSP.Progress_Report_Receivers.Progress_Report_Receiver' + Class); + +end LSP.Progress_Reports.TypeDefinition; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-workspace_diagnostic.adb b/source/lsp_3.17/generated/lsp-progress_reports-workspace_diagnostic.adb new file mode 100644 index 000000000..56fd571a8 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-progress_reports-workspace_diagnostic.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Progress_Reports.Workspace_Diagnostic is + + overriding procedure Visit_Receiver + (Self : Partial_Result; + Value : in out LSP.Progress_Report_Receivers.Progress_Report_Receiver' + Class) is + begin + Value.On_Workspace_Diagnostic_Partial_Result (Self.Token, Self.Params); + end Visit_Receiver; + +end LSP.Progress_Reports.Workspace_Diagnostic; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-workspace_diagnostic.ads b/source/lsp_3.17/generated/lsp-progress_reports-workspace_diagnostic.ads new file mode 100644 index 000000000..5bbeb04bf --- /dev/null +++ b/source/lsp_3.17/generated/lsp-progress_reports-workspace_diagnostic.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Progress_Reports.Workspace_Diagnostic is + pragma Preelaborate; + + type Partial_Result is new LSP.Progress_Reports.Progress_Report with record + Params : LSP.Structures.WorkspaceDiagnosticReportPartialResult; + end record; + + overriding procedure Visit_Receiver + (Self : Partial_Result; + Value : in out LSP.Progress_Report_Receivers.Progress_Report_Receiver' + Class); + +end LSP.Progress_Reports.Workspace_Diagnostic; diff --git a/source/lsp_3.17/generated/lsp-server_notification_readers.adb b/source/lsp_3.17/generated/lsp-server_notification_readers.adb new file mode 100644 index 000000000..74bafa6ad --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_notification_readers.adb @@ -0,0 +1,293 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with Minimal_Perfect_Hash; +with LSP.Inputs; +with LSP.Input_Tools; +with LSP.Structures; + +with LSP.Server_Notifications.CancelRequest; +with LSP.Server_Notifications.Progress; +with LSP.Server_Notifications.SetTrace; +with LSP.Server_Notifications.Exits; +with LSP.Server_Notifications.Initialized; +with LSP.Server_Notifications.DidChangeNotebook; +with LSP.Server_Notifications.DidCloseNotebook; +with LSP.Server_Notifications.DidOpenNotebook; +with LSP.Server_Notifications.DidSaveNotebook; +with LSP.Server_Notifications.DidChange; +with LSP.Server_Notifications.DidClose; +with LSP.Server_Notifications.DidOpen; +with LSP.Server_Notifications.DidSave; +with LSP.Server_Notifications.WillSave; +with LSP.Server_Notifications.Cancel; +with LSP.Server_Notifications.DidChangeConfiguration; +with LSP.Server_Notifications.DidChangeWatchedFiles; +with LSP.Server_Notifications.DidChangeWorkspaceFolders; +with LSP.Server_Notifications.DidCreateFiles; +with LSP.Server_Notifications.DidDeleteFiles; +with LSP.Server_Notifications.DidRenameFiles; + +package body LSP.Server_Notification_Readers is + + package Method_Map is new Minimal_Perfect_Hash + (["$/cancelRequest", + "$/progress", + "$/setTrace", + "exit", + "initialized", + "notebookDocument/didChange", + "notebookDocument/didClose", + "notebookDocument/didOpen", + "notebookDocument/didSave", + "textDocument/didChange", + "textDocument/didClose", + "textDocument/didOpen", + "textDocument/didSave", + "textDocument/willSave", + "window/workDoneProgress/cancel", + "workspace/didChangeConfiguration", + "workspace/didChangeWatchedFiles", + "workspace/didChangeWorkspaceFolders", + "workspace/didCreateFiles", + "workspace/didDeleteFiles", + "workspace/didRenameFiles"]); + + procedure Initialize is + begin + Method_Map.Initialize; + end Initialize; + + procedure Read_CancelRequest is new LSP.Input_Tools.Read_Notification + (LSP.Structures.CancelParams, "$/cancelRequest", + LSP.Inputs.Read_CancelParams); + + procedure Read_Progress is new LSP.Input_Tools.Read_Notification + (LSP.Structures.ProgressParams, "$/progress", + LSP.Inputs.Read_ProgressParams); + + procedure Read_SetTrace is new LSP.Input_Tools.Read_Notification + (LSP.Structures.SetTraceParams, "$/setTrace", + LSP.Inputs.Read_SetTraceParams); + + procedure Read_Exits + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Method : VSS.Strings.Virtual_String := "exit") is null; + + procedure Read_Initialized is new LSP.Input_Tools.Read_Notification + (LSP.Structures.InitializedParams, "initialized", + LSP.Inputs.Read_InitializedParams); + + procedure Read_DidChangeNotebook is new LSP.Input_Tools.Read_Notification + (LSP.Structures.DidChangeNotebookDocumentParams, + "notebookDocument/didChange", + LSP.Inputs.Read_DidChangeNotebookDocumentParams); + + procedure Read_DidCloseNotebook is new LSP.Input_Tools.Read_Notification + (LSP.Structures.DidCloseNotebookDocumentParams, + "notebookDocument/didClose", + LSP.Inputs.Read_DidCloseNotebookDocumentParams); + + procedure Read_DidOpenNotebook is new LSP.Input_Tools.Read_Notification + (LSP.Structures.DidOpenNotebookDocumentParams, "notebookDocument/didOpen", + LSP.Inputs.Read_DidOpenNotebookDocumentParams); + + procedure Read_DidSaveNotebook is new LSP.Input_Tools.Read_Notification + (LSP.Structures.DidSaveNotebookDocumentParams, "notebookDocument/didSave", + LSP.Inputs.Read_DidSaveNotebookDocumentParams); + + procedure Read_DidChange is new LSP.Input_Tools.Read_Notification + (LSP.Structures.DidChangeTextDocumentParams, "textDocument/didChange", + LSP.Inputs.Read_DidChangeTextDocumentParams); + + procedure Read_DidClose is new LSP.Input_Tools.Read_Notification + (LSP.Structures.DidCloseTextDocumentParams, "textDocument/didClose", + LSP.Inputs.Read_DidCloseTextDocumentParams); + + procedure Read_DidOpen is new LSP.Input_Tools.Read_Notification + (LSP.Structures.DidOpenTextDocumentParams, "textDocument/didOpen", + LSP.Inputs.Read_DidOpenTextDocumentParams); + + procedure Read_DidSave is new LSP.Input_Tools.Read_Notification + (LSP.Structures.DidSaveTextDocumentParams, "textDocument/didSave", + LSP.Inputs.Read_DidSaveTextDocumentParams); + + procedure Read_WillSave is new LSP.Input_Tools.Read_Notification + (LSP.Structures.WillSaveTextDocumentParams, "textDocument/willSave", + LSP.Inputs.Read_WillSaveTextDocumentParams); + + procedure Read_Cancel is new LSP.Input_Tools.Read_Notification + (LSP.Structures.WorkDoneProgressCancelParams, + "window/workDoneProgress/cancel", + LSP.Inputs.Read_WorkDoneProgressCancelParams); + + procedure Read_DidChangeConfiguration is new LSP.Input_Tools + .Read_Notification + (LSP.Structures.DidChangeConfigurationParams, + "workspace/didChangeConfiguration", + LSP.Inputs.Read_DidChangeConfigurationParams); + + procedure Read_DidChangeWatchedFiles is new LSP.Input_Tools + .Read_Notification + (LSP.Structures.DidChangeWatchedFilesParams, + "workspace/didChangeWatchedFiles", + LSP.Inputs.Read_DidChangeWatchedFilesParams); + + procedure Read_DidChangeWorkspaceFolders is new LSP.Input_Tools + .Read_Notification + (LSP.Structures.DidChangeWorkspaceFoldersParams, + "workspace/didChangeWorkspaceFolders", + LSP.Inputs.Read_DidChangeWorkspaceFoldersParams); + + procedure Read_DidCreateFiles is new LSP.Input_Tools.Read_Notification + (LSP.Structures.CreateFilesParams, "workspace/didCreateFiles", + LSP.Inputs.Read_CreateFilesParams); + + procedure Read_DidDeleteFiles is new LSP.Input_Tools.Read_Notification + (LSP.Structures.DeleteFilesParams, "workspace/didDeleteFiles", + LSP.Inputs.Read_DeleteFilesParams); + + procedure Read_DidRenameFiles is new LSP.Input_Tools.Read_Notification + (LSP.Structures.RenameFilesParams, "workspace/didRenameFiles", + LSP.Inputs.Read_RenameFilesParams); + + function Read_Notification + (Input : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Method : VSS.Strings.Virtual_String) + return LSP.Server_Notifications.Server_Notification'Class is + Index : constant Natural := Method_Map.Get_Index (Method); + begin + case Index is + when 1 => -- $/cancelRequest + return + Result : LSP.Server_Notifications.CancelRequest.Notification do + Read_CancelRequest (Input, Result.Params); + end return; + + when 2 => -- $/progress + return Result : LSP.Server_Notifications.Progress.Notification do + Read_Progress (Input, Result.Params); + end return; + + when 3 => -- $/setTrace + return Result : LSP.Server_Notifications.SetTrace.Notification do + Read_SetTrace (Input, Result.Params); + end return; + + when 4 => -- exit + return Result : LSP.Server_Notifications.Exits.Notification do + Read_Exits (Input); + end return; + + when 5 => -- initialized + return + Result : LSP.Server_Notifications.Initialized.Notification do + Read_Initialized (Input, Result.Params); + end return; + + when 6 => -- notebookDocument/didChange + return + Result : LSP.Server_Notifications.DidChangeNotebook.Notification + do + Read_DidChangeNotebook (Input, Result.Params); + end return; + + when 7 => -- notebookDocument/didClose + return + Result : LSP.Server_Notifications.DidCloseNotebook.Notification + do + Read_DidCloseNotebook (Input, Result.Params); + end return; + + when 8 => -- notebookDocument/didOpen + return + Result : LSP.Server_Notifications.DidOpenNotebook.Notification do + Read_DidOpenNotebook (Input, Result.Params); + end return; + + when 9 => -- notebookDocument/didSave + return + Result : LSP.Server_Notifications.DidSaveNotebook.Notification do + Read_DidSaveNotebook (Input, Result.Params); + end return; + + when 10 => -- textDocument/didChange + return Result : LSP.Server_Notifications.DidChange.Notification do + Read_DidChange (Input, Result.Params); + end return; + + when 11 => -- textDocument/didClose + return Result : LSP.Server_Notifications.DidClose.Notification do + Read_DidClose (Input, Result.Params); + end return; + + when 12 => -- textDocument/didOpen + return Result : LSP.Server_Notifications.DidOpen.Notification do + Read_DidOpen (Input, Result.Params); + end return; + + when 13 => -- textDocument/didSave + return Result : LSP.Server_Notifications.DidSave.Notification do + Read_DidSave (Input, Result.Params); + end return; + + when 14 => -- textDocument/willSave + return Result : LSP.Server_Notifications.WillSave.Notification do + Read_WillSave (Input, Result.Params); + end return; + + when 15 => -- window/workDoneProgress/cancel + return Result : LSP.Server_Notifications.Cancel.Notification do + Read_Cancel (Input, Result.Params); + end return; + + when 16 => -- workspace/didChangeConfiguration + return + Result : LSP.Server_Notifications.DidChangeConfiguration + .Notification + do + Read_DidChangeConfiguration (Input, Result.Params); + end return; + + when 17 => -- workspace/didChangeWatchedFiles + return + Result : LSP.Server_Notifications.DidChangeWatchedFiles + .Notification + do + Read_DidChangeWatchedFiles (Input, Result.Params); + end return; + + when 18 => -- workspace/didChangeWorkspaceFolders + return + Result : LSP.Server_Notifications.DidChangeWorkspaceFolders + .Notification + do + Read_DidChangeWorkspaceFolders (Input, Result.Params); + end return; + + when 19 => -- workspace/didCreateFiles + return + Result : LSP.Server_Notifications.DidCreateFiles.Notification do + Read_DidCreateFiles (Input, Result.Params); + end return; + + when 20 => -- workspace/didDeleteFiles + return + Result : LSP.Server_Notifications.DidDeleteFiles.Notification do + Read_DidDeleteFiles (Input, Result.Params); + end return; + + when 21 => -- workspace/didRenameFiles + return + Result : LSP.Server_Notifications.DidRenameFiles.Notification do + Read_DidRenameFiles (Input, Result.Params); + end return; + + when others => + return raise Program_Error with "Unknown method"; + end case; + end Read_Notification; +end LSP.Server_Notification_Readers; diff --git a/source/lsp_3.17/generated/lsp-server_notification_receivers.ads b/source/lsp_3.17/generated/lsp-server_notification_receivers.ads new file mode 100644 index 000000000..5195116f3 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_notification_receivers.ads @@ -0,0 +1,150 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Base_Notification_Receivers; +with LSP.Structures; + +package LSP.Server_Notification_Receivers is + pragma Preelaborate; + + type Server_Notification_Receiver is + limited interface and + LSP.Base_Notification_Receivers.Base_Notification_Receiver; + + procedure On_SetTrace_Notification + (Self : in out Server_Notification_Receiver; + Value : LSP.Structures.SetTraceParams) is null; + + procedure On_Exits_Notification + (Self : in out Server_Notification_Receiver) is null; + -- The exit event is sent from the client to the server to ask the server + -- to exit its process. + + procedure On_Initialized_Notification + (Self : in out Server_Notification_Receiver; + Value : LSP.Structures.InitializedParams) is null; + -- The initialized notification is sent from the client to the server + -- after the client is fully initialized and the server is allowed to + -- send requests from the server to the client. + + procedure On_DidChangeNotebook_Notification + (Self : in out Server_Notification_Receiver; + Value : LSP.Structures.DidChangeNotebookDocumentParams) is null; + + procedure On_DidCloseNotebook_Notification + (Self : in out Server_Notification_Receiver; + Value : LSP.Structures.DidCloseNotebookDocumentParams) is null; + -- A notification sent when a notebook closes. + -- + -- @since 3.17.0 + + procedure On_DidOpenNotebook_Notification + (Self : in out Server_Notification_Receiver; + Value : LSP.Structures.DidOpenNotebookDocumentParams) is null; + -- A notification sent when a notebook opens. + -- + -- @since 3.17.0 + + procedure On_DidSaveNotebook_Notification + (Self : in out Server_Notification_Receiver; + Value : LSP.Structures.DidSaveNotebookDocumentParams) is null; + -- A notification sent when a notebook document is saved. + -- + -- @since 3.17.0 + + procedure On_DidChange_Notification + (Self : in out Server_Notification_Receiver; + Value : LSP.Structures.DidChangeTextDocumentParams) is null; + -- The document change notification is sent from the client to the server + -- to signal changes to a text document. + + procedure On_DidClose_Notification + (Self : in out Server_Notification_Receiver; + Value : LSP.Structures.DidCloseTextDocumentParams) is null; + -- The document close notification is sent from the client to the server + -- when the document got closed in the client. The document's truth now + -- exists where the document's uri points to (e.g. if the document's uri is + -- a file uri the truth now exists on disk). As with the open notification + -- the close notification is about managing the document's content. + -- Receiving a close notification doesn't mean that the document was open + -- in an editor before. A close notification requires a previous open + -- notification to be sent. + + procedure On_DidOpen_Notification + (Self : in out Server_Notification_Receiver; + Value : LSP.Structures.DidOpenTextDocumentParams) is null; + -- The document open notification is sent from the client to the server to + -- signal newly opened text documents. The document's truth is now managed + -- by the client and the server must not try to read the document's truth + -- using the document's uri. Open in this sense means it is managed by the + -- client. It doesn't necessarily mean that its content is presented in an + -- editor. An open notification must not be sent more than once without a + -- corresponding close notification send before. This means open and close + -- notification must be balanced and the max open count is one. + + procedure On_DidSave_Notification + (Self : in out Server_Notification_Receiver; + Value : LSP.Structures.DidSaveTextDocumentParams) is null; + -- The document save notification is sent from the client to the server + -- when the document got saved in the client. + + procedure On_WillSave_Notification + (Self : in out Server_Notification_Receiver; + Value : LSP.Structures.WillSaveTextDocumentParams) is null; + -- A document will save notification is sent from the client to the server + -- before the document is actually saved. + + procedure On_Cancel_Notification + (Self : in out Server_Notification_Receiver; + Value : LSP.Structures.WorkDoneProgressCancelParams) is null; + -- The `window/workDoneProgress/cancel` notification is sent from the + -- client to the server to cancel a progress initiated on the server side. + + procedure On_DidChangeConfiguration_Notification + (Self : in out Server_Notification_Receiver; + Value : LSP.Structures.DidChangeConfigurationParams) is null; + -- The configuration change notification is sent from the client to the + -- server when the client's configuration has changed. The notification + -- contains the changed configuration as defined by the language client. + + procedure On_DidChangeWatchedFiles_Notification + (Self : in out Server_Notification_Receiver; + Value : LSP.Structures.DidChangeWatchedFilesParams) is null; + -- The watched files notification is sent from the client to the server + -- when the client detects changes to file watched by the language client. + + procedure On_DidChangeWorkspaceFolders_Notification + (Self : in out Server_Notification_Receiver; + Value : LSP.Structures.DidChangeWorkspaceFoldersParams) is null; + -- The `workspace/didChangeWorkspaceFolders` notification is sent from the + -- client to the server when the workspace folder configuration changes. + + procedure On_DidCreateFiles_Notification + (Self : in out Server_Notification_Receiver; + Value : LSP.Structures.CreateFilesParams) is null; + -- The did create files notification is sent from the client to the server + -- when files were created from within the client. + -- + -- @since 3.16.0 + + procedure On_DidDeleteFiles_Notification + (Self : in out Server_Notification_Receiver; + Value : LSP.Structures.DeleteFilesParams) is null; + -- The will delete files request is sent from the client to the server + -- before files are actually deleted as long as the deletion is triggered + -- from within the client. + -- + -- @since 3.16.0 + + procedure On_DidRenameFiles_Notification + (Self : in out Server_Notification_Receiver; + Value : LSP.Structures.RenameFilesParams) is null; + -- The did rename files notification is sent from the client to the server + -- when files were renamed from within the client. + -- + -- @since 3.16.0 + +end LSP.Server_Notification_Receivers; diff --git a/source/lsp_3.17/generated/lsp-server_notification_writers.adb b/source/lsp_3.17/generated/lsp-server_notification_writers.adb new file mode 100644 index 000000000..33096f413 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_notification_writers.adb @@ -0,0 +1,221 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with VSS.JSON.Content_Handlers; +with LSP.Output_Tools; +with LSP.Outputs; + +package body LSP.Server_Notification_Writers is + + overriding procedure On_SetTrace_Notification + (Self : in out Server_Notification_Writer; + Value : LSP.Structures.SetTraceParams) is + begin + LSP.Output_Tools.Write_Start_Notification + (Self.Output.all, "$/setTrace"); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_SetTraceParams (Self.Output.all, Value); + Self.Output.End_Object; + end On_SetTrace_Notification; + + overriding procedure On_Exits_Notification + (Self : in out Server_Notification_Writer) is + begin + LSP.Output_Tools.Write_Start_Notification (Self.Output.all, "exit"); + Self.Output.End_Object; + end On_Exits_Notification; + + overriding procedure On_Initialized_Notification + (Self : in out Server_Notification_Writer; + Value : LSP.Structures.InitializedParams) is + begin + LSP.Output_Tools.Write_Start_Notification + (Self.Output.all, "initialized"); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_InitializedParams (Self.Output.all, Value); + Self.Output.End_Object; + end On_Initialized_Notification; + + overriding procedure On_DidChangeNotebook_Notification + (Self : in out Server_Notification_Writer; + Value : LSP.Structures.DidChangeNotebookDocumentParams) is + begin + LSP.Output_Tools.Write_Start_Notification + (Self.Output.all, "notebookDocument/didChange"); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_DidChangeNotebookDocumentParams + (Self.Output.all, Value); + Self.Output.End_Object; + end On_DidChangeNotebook_Notification; + + overriding procedure On_DidCloseNotebook_Notification + (Self : in out Server_Notification_Writer; + Value : LSP.Structures.DidCloseNotebookDocumentParams) is + begin + LSP.Output_Tools.Write_Start_Notification + (Self.Output.all, "notebookDocument/didClose"); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_DidCloseNotebookDocumentParams + (Self.Output.all, Value); + Self.Output.End_Object; + end On_DidCloseNotebook_Notification; + + overriding procedure On_DidOpenNotebook_Notification + (Self : in out Server_Notification_Writer; + Value : LSP.Structures.DidOpenNotebookDocumentParams) is + begin + LSP.Output_Tools.Write_Start_Notification + (Self.Output.all, "notebookDocument/didOpen"); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_DidOpenNotebookDocumentParams (Self.Output.all, Value); + Self.Output.End_Object; + end On_DidOpenNotebook_Notification; + + overriding procedure On_DidSaveNotebook_Notification + (Self : in out Server_Notification_Writer; + Value : LSP.Structures.DidSaveNotebookDocumentParams) is + begin + LSP.Output_Tools.Write_Start_Notification + (Self.Output.all, "notebookDocument/didSave"); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_DidSaveNotebookDocumentParams (Self.Output.all, Value); + Self.Output.End_Object; + end On_DidSaveNotebook_Notification; + + overriding procedure On_DidChange_Notification + (Self : in out Server_Notification_Writer; + Value : LSP.Structures.DidChangeTextDocumentParams) is + begin + LSP.Output_Tools.Write_Start_Notification + (Self.Output.all, "textDocument/didChange"); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_DidChangeTextDocumentParams (Self.Output.all, Value); + Self.Output.End_Object; + end On_DidChange_Notification; + + overriding procedure On_DidClose_Notification + (Self : in out Server_Notification_Writer; + Value : LSP.Structures.DidCloseTextDocumentParams) is + begin + LSP.Output_Tools.Write_Start_Notification + (Self.Output.all, "textDocument/didClose"); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_DidCloseTextDocumentParams (Self.Output.all, Value); + Self.Output.End_Object; + end On_DidClose_Notification; + + overriding procedure On_DidOpen_Notification + (Self : in out Server_Notification_Writer; + Value : LSP.Structures.DidOpenTextDocumentParams) is + begin + LSP.Output_Tools.Write_Start_Notification + (Self.Output.all, "textDocument/didOpen"); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_DidOpenTextDocumentParams (Self.Output.all, Value); + Self.Output.End_Object; + end On_DidOpen_Notification; + + overriding procedure On_DidSave_Notification + (Self : in out Server_Notification_Writer; + Value : LSP.Structures.DidSaveTextDocumentParams) is + begin + LSP.Output_Tools.Write_Start_Notification + (Self.Output.all, "textDocument/didSave"); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_DidSaveTextDocumentParams (Self.Output.all, Value); + Self.Output.End_Object; + end On_DidSave_Notification; + + overriding procedure On_WillSave_Notification + (Self : in out Server_Notification_Writer; + Value : LSP.Structures.WillSaveTextDocumentParams) is + begin + LSP.Output_Tools.Write_Start_Notification + (Self.Output.all, "textDocument/willSave"); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_WillSaveTextDocumentParams (Self.Output.all, Value); + Self.Output.End_Object; + end On_WillSave_Notification; + + overriding procedure On_Cancel_Notification + (Self : in out Server_Notification_Writer; + Value : LSP.Structures.WorkDoneProgressCancelParams) is + begin + LSP.Output_Tools.Write_Start_Notification + (Self.Output.all, "window/workDoneProgress/cancel"); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_WorkDoneProgressCancelParams (Self.Output.all, Value); + Self.Output.End_Object; + end On_Cancel_Notification; + + overriding procedure On_DidChangeConfiguration_Notification + (Self : in out Server_Notification_Writer; + Value : LSP.Structures.DidChangeConfigurationParams) is + begin + LSP.Output_Tools.Write_Start_Notification + (Self.Output.all, "workspace/didChangeConfiguration"); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_DidChangeConfigurationParams (Self.Output.all, Value); + Self.Output.End_Object; + end On_DidChangeConfiguration_Notification; + + overriding procedure On_DidChangeWatchedFiles_Notification + (Self : in out Server_Notification_Writer; + Value : LSP.Structures.DidChangeWatchedFilesParams) is + begin + LSP.Output_Tools.Write_Start_Notification + (Self.Output.all, "workspace/didChangeWatchedFiles"); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_DidChangeWatchedFilesParams (Self.Output.all, Value); + Self.Output.End_Object; + end On_DidChangeWatchedFiles_Notification; + + overriding procedure On_DidChangeWorkspaceFolders_Notification + (Self : in out Server_Notification_Writer; + Value : LSP.Structures.DidChangeWorkspaceFoldersParams) is + begin + LSP.Output_Tools.Write_Start_Notification + (Self.Output.all, "workspace/didChangeWorkspaceFolders"); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_DidChangeWorkspaceFoldersParams + (Self.Output.all, Value); + Self.Output.End_Object; + end On_DidChangeWorkspaceFolders_Notification; + + overriding procedure On_DidCreateFiles_Notification + (Self : in out Server_Notification_Writer; + Value : LSP.Structures.CreateFilesParams) is + begin + LSP.Output_Tools.Write_Start_Notification + (Self.Output.all, "workspace/didCreateFiles"); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_CreateFilesParams (Self.Output.all, Value); + Self.Output.End_Object; + end On_DidCreateFiles_Notification; + + overriding procedure On_DidDeleteFiles_Notification + (Self : in out Server_Notification_Writer; + Value : LSP.Structures.DeleteFilesParams) is + begin + LSP.Output_Tools.Write_Start_Notification + (Self.Output.all, "workspace/didDeleteFiles"); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_DeleteFilesParams (Self.Output.all, Value); + Self.Output.End_Object; + end On_DidDeleteFiles_Notification; + + overriding procedure On_DidRenameFiles_Notification + (Self : in out Server_Notification_Writer; + Value : LSP.Structures.RenameFilesParams) is + begin + LSP.Output_Tools.Write_Start_Notification + (Self.Output.all, "workspace/didRenameFiles"); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_RenameFilesParams (Self.Output.all, Value); + Self.Output.End_Object; + end On_DidRenameFiles_Notification; + +end LSP.Server_Notification_Writers; diff --git a/source/lsp_3.17/generated/lsp-server_notification_writers.ads b/source/lsp_3.17/generated/lsp-server_notification_writers.ads new file mode 100644 index 000000000..3c582af42 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_notification_writers.ads @@ -0,0 +1,94 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Base_Notification_Writers; +with LSP.Structures; +with LSP.Server_Notification_Receivers; + +package LSP.Server_Notification_Writers is + pragma Preelaborate; + + type Server_Notification_Writer is + new LSP.Base_Notification_Writers.Base_Notification_Writer and + LSP.Server_Notification_Receivers.Server_Notification_Receiver with + null record; + + overriding procedure On_SetTrace_Notification + (Self : in out Server_Notification_Writer; + Value : LSP.Structures.SetTraceParams); + + overriding procedure On_Exits_Notification + (Self : in out Server_Notification_Writer); + + overriding procedure On_Initialized_Notification + (Self : in out Server_Notification_Writer; + Value : LSP.Structures.InitializedParams); + + overriding procedure On_DidChangeNotebook_Notification + (Self : in out Server_Notification_Writer; + Value : LSP.Structures.DidChangeNotebookDocumentParams); + + overriding procedure On_DidCloseNotebook_Notification + (Self : in out Server_Notification_Writer; + Value : LSP.Structures.DidCloseNotebookDocumentParams); + + overriding procedure On_DidOpenNotebook_Notification + (Self : in out Server_Notification_Writer; + Value : LSP.Structures.DidOpenNotebookDocumentParams); + + overriding procedure On_DidSaveNotebook_Notification + (Self : in out Server_Notification_Writer; + Value : LSP.Structures.DidSaveNotebookDocumentParams); + + overriding procedure On_DidChange_Notification + (Self : in out Server_Notification_Writer; + Value : LSP.Structures.DidChangeTextDocumentParams); + + overriding procedure On_DidClose_Notification + (Self : in out Server_Notification_Writer; + Value : LSP.Structures.DidCloseTextDocumentParams); + + overriding procedure On_DidOpen_Notification + (Self : in out Server_Notification_Writer; + Value : LSP.Structures.DidOpenTextDocumentParams); + + overriding procedure On_DidSave_Notification + (Self : in out Server_Notification_Writer; + Value : LSP.Structures.DidSaveTextDocumentParams); + + overriding procedure On_WillSave_Notification + (Self : in out Server_Notification_Writer; + Value : LSP.Structures.WillSaveTextDocumentParams); + + overriding procedure On_Cancel_Notification + (Self : in out Server_Notification_Writer; + Value : LSP.Structures.WorkDoneProgressCancelParams); + + overriding procedure On_DidChangeConfiguration_Notification + (Self : in out Server_Notification_Writer; + Value : LSP.Structures.DidChangeConfigurationParams); + + overriding procedure On_DidChangeWatchedFiles_Notification + (Self : in out Server_Notification_Writer; + Value : LSP.Structures.DidChangeWatchedFilesParams); + + overriding procedure On_DidChangeWorkspaceFolders_Notification + (Self : in out Server_Notification_Writer; + Value : LSP.Structures.DidChangeWorkspaceFoldersParams); + + overriding procedure On_DidCreateFiles_Notification + (Self : in out Server_Notification_Writer; + Value : LSP.Structures.CreateFilesParams); + + overriding procedure On_DidDeleteFiles_Notification + (Self : in out Server_Notification_Writer; + Value : LSP.Structures.DeleteFilesParams); + + overriding procedure On_DidRenameFiles_Notification + (Self : in out Server_Notification_Writer; + Value : LSP.Structures.RenameFilesParams); + +end LSP.Server_Notification_Writers; diff --git a/source/lsp_3.17/generated/lsp-server_notifications-cancel.adb b/source/lsp_3.17/generated/lsp-server_notifications-cancel.adb new file mode 100644 index 000000000..298ebb578 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_notifications-cancel.adb @@ -0,0 +1,18 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Notifications.Cancel is + + overriding procedure Visit_Server_Receiver + (Self : Notification; + Value : in out LSP.Server_Notification_Receivers + .Server_Notification_Receiver' + Class) is + begin + Value.On_Cancel_Notification (Self.Params); + end Visit_Server_Receiver; + +end LSP.Server_Notifications.Cancel; diff --git a/source/lsp_3.17/generated/lsp-server_notifications-cancel.ads b/source/lsp_3.17/generated/lsp-server_notifications-cancel.ads new file mode 100644 index 000000000..bb9e04ce4 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_notifications-cancel.ads @@ -0,0 +1,23 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Notifications.Cancel is + pragma Preelaborate; + + type Notification is + new LSP.Server_Notifications.Server_Notification with record + Params : LSP.Structures.WorkDoneProgressCancelParams; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Notification; + Value : in out LSP.Server_Notification_Receivers + .Server_Notification_Receiver' + Class); + +end LSP.Server_Notifications.Cancel; diff --git a/source/lsp_3.17/generated/lsp-server_notifications-cancelrequest.adb b/source/lsp_3.17/generated/lsp-server_notifications-cancelrequest.adb new file mode 100644 index 000000000..afd5683f9 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_notifications-cancelrequest.adb @@ -0,0 +1,18 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Notifications.CancelRequest is + + overriding procedure Visit_Server_Receiver + (Self : Notification; + Value : in out LSP.Server_Notification_Receivers + .Server_Notification_Receiver' + Class) is + begin + Value.On_CancelRequest_Notification (Self.Params); + end Visit_Server_Receiver; + +end LSP.Server_Notifications.CancelRequest; diff --git a/source/lsp_3.17/generated/lsp-server_notifications-cancelrequest.ads b/source/lsp_3.17/generated/lsp-server_notifications-cancelrequest.ads new file mode 100644 index 000000000..3521454c4 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_notifications-cancelrequest.ads @@ -0,0 +1,23 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Notifications.CancelRequest is + pragma Preelaborate; + + type Notification is + new LSP.Server_Notifications.Server_Notification with record + Params : LSP.Structures.CancelParams; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Notification; + Value : in out LSP.Server_Notification_Receivers + .Server_Notification_Receiver' + Class); + +end LSP.Server_Notifications.CancelRequest; diff --git a/source/lsp_3.17/generated/lsp-server_notifications-didchange.adb b/source/lsp_3.17/generated/lsp-server_notifications-didchange.adb new file mode 100644 index 000000000..bbcdd8239 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_notifications-didchange.adb @@ -0,0 +1,18 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Notifications.DidChange is + + overriding procedure Visit_Server_Receiver + (Self : Notification; + Value : in out LSP.Server_Notification_Receivers + .Server_Notification_Receiver' + Class) is + begin + Value.On_DidChange_Notification (Self.Params); + end Visit_Server_Receiver; + +end LSP.Server_Notifications.DidChange; diff --git a/source/lsp_3.17/generated/lsp-server_notifications-didchange.ads b/source/lsp_3.17/generated/lsp-server_notifications-didchange.ads new file mode 100644 index 000000000..a061d2ae3 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_notifications-didchange.ads @@ -0,0 +1,23 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Notifications.DidChange is + pragma Preelaborate; + + type Notification is + new LSP.Server_Notifications.Server_Notification with record + Params : LSP.Structures.DidChangeTextDocumentParams; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Notification; + Value : in out LSP.Server_Notification_Receivers + .Server_Notification_Receiver' + Class); + +end LSP.Server_Notifications.DidChange; diff --git a/source/lsp_3.17/generated/lsp-server_notifications-didchangeconfiguration.adb b/source/lsp_3.17/generated/lsp-server_notifications-didchangeconfiguration.adb new file mode 100644 index 000000000..7f5564d4c --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_notifications-didchangeconfiguration.adb @@ -0,0 +1,18 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Notifications.DidChangeConfiguration is + + overriding procedure Visit_Server_Receiver + (Self : Notification; + Value : in out LSP.Server_Notification_Receivers + .Server_Notification_Receiver' + Class) is + begin + Value.On_DidChangeConfiguration_Notification (Self.Params); + end Visit_Server_Receiver; + +end LSP.Server_Notifications.DidChangeConfiguration; diff --git a/source/lsp_3.17/generated/lsp-server_notifications-didchangeconfiguration.ads b/source/lsp_3.17/generated/lsp-server_notifications-didchangeconfiguration.ads new file mode 100644 index 000000000..14932fb82 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_notifications-didchangeconfiguration.ads @@ -0,0 +1,23 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Notifications.DidChangeConfiguration is + pragma Preelaborate; + + type Notification is + new LSP.Server_Notifications.Server_Notification with record + Params : LSP.Structures.DidChangeConfigurationParams; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Notification; + Value : in out LSP.Server_Notification_Receivers + .Server_Notification_Receiver' + Class); + +end LSP.Server_Notifications.DidChangeConfiguration; diff --git a/source/lsp_3.17/generated/lsp-server_notifications-didchangenotebook.adb b/source/lsp_3.17/generated/lsp-server_notifications-didchangenotebook.adb new file mode 100644 index 000000000..80bb391bf --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_notifications-didchangenotebook.adb @@ -0,0 +1,18 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Notifications.DidChangeNotebook is + + overriding procedure Visit_Server_Receiver + (Self : Notification; + Value : in out LSP.Server_Notification_Receivers + .Server_Notification_Receiver' + Class) is + begin + Value.On_DidChangeNotebook_Notification (Self.Params); + end Visit_Server_Receiver; + +end LSP.Server_Notifications.DidChangeNotebook; diff --git a/source/lsp_3.17/generated/lsp-server_notifications-didchangenotebook.ads b/source/lsp_3.17/generated/lsp-server_notifications-didchangenotebook.ads new file mode 100644 index 000000000..7791c65fc --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_notifications-didchangenotebook.ads @@ -0,0 +1,23 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Notifications.DidChangeNotebook is + pragma Preelaborate; + + type Notification is + new LSP.Server_Notifications.Server_Notification with record + Params : LSP.Structures.DidChangeNotebookDocumentParams; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Notification; + Value : in out LSP.Server_Notification_Receivers + .Server_Notification_Receiver' + Class); + +end LSP.Server_Notifications.DidChangeNotebook; diff --git a/source/lsp_3.17/generated/lsp-server_notifications-didchangewatchedfiles.adb b/source/lsp_3.17/generated/lsp-server_notifications-didchangewatchedfiles.adb new file mode 100644 index 000000000..c157b4ed0 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_notifications-didchangewatchedfiles.adb @@ -0,0 +1,18 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Notifications.DidChangeWatchedFiles is + + overriding procedure Visit_Server_Receiver + (Self : Notification; + Value : in out LSP.Server_Notification_Receivers + .Server_Notification_Receiver' + Class) is + begin + Value.On_DidChangeWatchedFiles_Notification (Self.Params); + end Visit_Server_Receiver; + +end LSP.Server_Notifications.DidChangeWatchedFiles; diff --git a/source/lsp_3.17/generated/lsp-server_notifications-didchangewatchedfiles.ads b/source/lsp_3.17/generated/lsp-server_notifications-didchangewatchedfiles.ads new file mode 100644 index 000000000..bf4e06957 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_notifications-didchangewatchedfiles.ads @@ -0,0 +1,23 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Notifications.DidChangeWatchedFiles is + pragma Preelaborate; + + type Notification is + new LSP.Server_Notifications.Server_Notification with record + Params : LSP.Structures.DidChangeWatchedFilesParams; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Notification; + Value : in out LSP.Server_Notification_Receivers + .Server_Notification_Receiver' + Class); + +end LSP.Server_Notifications.DidChangeWatchedFiles; diff --git a/source/lsp_3.17/generated/lsp-server_notifications-didchangeworkspacefolders.adb b/source/lsp_3.17/generated/lsp-server_notifications-didchangeworkspacefolders.adb new file mode 100644 index 000000000..73410ac16 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_notifications-didchangeworkspacefolders.adb @@ -0,0 +1,18 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Notifications.DidChangeWorkspaceFolders is + + overriding procedure Visit_Server_Receiver + (Self : Notification; + Value : in out LSP.Server_Notification_Receivers + .Server_Notification_Receiver' + Class) is + begin + Value.On_DidChangeWorkspaceFolders_Notification (Self.Params); + end Visit_Server_Receiver; + +end LSP.Server_Notifications.DidChangeWorkspaceFolders; diff --git a/source/lsp_3.17/generated/lsp-server_notifications-didchangeworkspacefolders.ads b/source/lsp_3.17/generated/lsp-server_notifications-didchangeworkspacefolders.ads new file mode 100644 index 000000000..30d43a613 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_notifications-didchangeworkspacefolders.ads @@ -0,0 +1,23 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Notifications.DidChangeWorkspaceFolders is + pragma Preelaborate; + + type Notification is + new LSP.Server_Notifications.Server_Notification with record + Params : LSP.Structures.DidChangeWorkspaceFoldersParams; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Notification; + Value : in out LSP.Server_Notification_Receivers + .Server_Notification_Receiver' + Class); + +end LSP.Server_Notifications.DidChangeWorkspaceFolders; diff --git a/source/lsp_3.17/generated/lsp-server_notifications-didclose.adb b/source/lsp_3.17/generated/lsp-server_notifications-didclose.adb new file mode 100644 index 000000000..1e3c53ae0 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_notifications-didclose.adb @@ -0,0 +1,18 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Notifications.DidClose is + + overriding procedure Visit_Server_Receiver + (Self : Notification; + Value : in out LSP.Server_Notification_Receivers + .Server_Notification_Receiver' + Class) is + begin + Value.On_DidClose_Notification (Self.Params); + end Visit_Server_Receiver; + +end LSP.Server_Notifications.DidClose; diff --git a/source/lsp_3.17/generated/lsp-server_notifications-didclose.ads b/source/lsp_3.17/generated/lsp-server_notifications-didclose.ads new file mode 100644 index 000000000..5da60c81c --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_notifications-didclose.ads @@ -0,0 +1,23 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Notifications.DidClose is + pragma Preelaborate; + + type Notification is + new LSP.Server_Notifications.Server_Notification with record + Params : LSP.Structures.DidCloseTextDocumentParams; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Notification; + Value : in out LSP.Server_Notification_Receivers + .Server_Notification_Receiver' + Class); + +end LSP.Server_Notifications.DidClose; diff --git a/source/lsp_3.17/generated/lsp-server_notifications-didclosenotebook.adb b/source/lsp_3.17/generated/lsp-server_notifications-didclosenotebook.adb new file mode 100644 index 000000000..8ff356c80 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_notifications-didclosenotebook.adb @@ -0,0 +1,18 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Notifications.DidCloseNotebook is + + overriding procedure Visit_Server_Receiver + (Self : Notification; + Value : in out LSP.Server_Notification_Receivers + .Server_Notification_Receiver' + Class) is + begin + Value.On_DidCloseNotebook_Notification (Self.Params); + end Visit_Server_Receiver; + +end LSP.Server_Notifications.DidCloseNotebook; diff --git a/source/lsp_3.17/generated/lsp-server_notifications-didclosenotebook.ads b/source/lsp_3.17/generated/lsp-server_notifications-didclosenotebook.ads new file mode 100644 index 000000000..e36055991 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_notifications-didclosenotebook.ads @@ -0,0 +1,23 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Notifications.DidCloseNotebook is + pragma Preelaborate; + + type Notification is + new LSP.Server_Notifications.Server_Notification with record + Params : LSP.Structures.DidCloseNotebookDocumentParams; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Notification; + Value : in out LSP.Server_Notification_Receivers + .Server_Notification_Receiver' + Class); + +end LSP.Server_Notifications.DidCloseNotebook; diff --git a/source/lsp_3.17/generated/lsp-server_notifications-didcreatefiles.adb b/source/lsp_3.17/generated/lsp-server_notifications-didcreatefiles.adb new file mode 100644 index 000000000..eb010f80a --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_notifications-didcreatefiles.adb @@ -0,0 +1,18 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Notifications.DidCreateFiles is + + overriding procedure Visit_Server_Receiver + (Self : Notification; + Value : in out LSP.Server_Notification_Receivers + .Server_Notification_Receiver' + Class) is + begin + Value.On_DidCreateFiles_Notification (Self.Params); + end Visit_Server_Receiver; + +end LSP.Server_Notifications.DidCreateFiles; diff --git a/source/lsp_3.17/generated/lsp-server_notifications-didcreatefiles.ads b/source/lsp_3.17/generated/lsp-server_notifications-didcreatefiles.ads new file mode 100644 index 000000000..86e68f48d --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_notifications-didcreatefiles.ads @@ -0,0 +1,23 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Notifications.DidCreateFiles is + pragma Preelaborate; + + type Notification is + new LSP.Server_Notifications.Server_Notification with record + Params : LSP.Structures.CreateFilesParams; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Notification; + Value : in out LSP.Server_Notification_Receivers + .Server_Notification_Receiver' + Class); + +end LSP.Server_Notifications.DidCreateFiles; diff --git a/source/lsp_3.17/generated/lsp-server_notifications-diddeletefiles.adb b/source/lsp_3.17/generated/lsp-server_notifications-diddeletefiles.adb new file mode 100644 index 000000000..8761f2fcc --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_notifications-diddeletefiles.adb @@ -0,0 +1,18 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Notifications.DidDeleteFiles is + + overriding procedure Visit_Server_Receiver + (Self : Notification; + Value : in out LSP.Server_Notification_Receivers + .Server_Notification_Receiver' + Class) is + begin + Value.On_DidDeleteFiles_Notification (Self.Params); + end Visit_Server_Receiver; + +end LSP.Server_Notifications.DidDeleteFiles; diff --git a/source/lsp_3.17/generated/lsp-server_notifications-diddeletefiles.ads b/source/lsp_3.17/generated/lsp-server_notifications-diddeletefiles.ads new file mode 100644 index 000000000..eacc02ae0 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_notifications-diddeletefiles.ads @@ -0,0 +1,23 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Notifications.DidDeleteFiles is + pragma Preelaborate; + + type Notification is + new LSP.Server_Notifications.Server_Notification with record + Params : LSP.Structures.DeleteFilesParams; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Notification; + Value : in out LSP.Server_Notification_Receivers + .Server_Notification_Receiver' + Class); + +end LSP.Server_Notifications.DidDeleteFiles; diff --git a/source/lsp_3.17/generated/lsp-server_notifications-didopen.adb b/source/lsp_3.17/generated/lsp-server_notifications-didopen.adb new file mode 100644 index 000000000..1950f7d14 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_notifications-didopen.adb @@ -0,0 +1,18 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Notifications.DidOpen is + + overriding procedure Visit_Server_Receiver + (Self : Notification; + Value : in out LSP.Server_Notification_Receivers + .Server_Notification_Receiver' + Class) is + begin + Value.On_DidOpen_Notification (Self.Params); + end Visit_Server_Receiver; + +end LSP.Server_Notifications.DidOpen; diff --git a/source/lsp_3.17/generated/lsp-server_notifications-didopen.ads b/source/lsp_3.17/generated/lsp-server_notifications-didopen.ads new file mode 100644 index 000000000..cd545fb5c --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_notifications-didopen.ads @@ -0,0 +1,23 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Notifications.DidOpen is + pragma Preelaborate; + + type Notification is + new LSP.Server_Notifications.Server_Notification with record + Params : LSP.Structures.DidOpenTextDocumentParams; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Notification; + Value : in out LSP.Server_Notification_Receivers + .Server_Notification_Receiver' + Class); + +end LSP.Server_Notifications.DidOpen; diff --git a/source/lsp_3.17/generated/lsp-server_notifications-didopennotebook.adb b/source/lsp_3.17/generated/lsp-server_notifications-didopennotebook.adb new file mode 100644 index 000000000..f319e4f2b --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_notifications-didopennotebook.adb @@ -0,0 +1,18 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Notifications.DidOpenNotebook is + + overriding procedure Visit_Server_Receiver + (Self : Notification; + Value : in out LSP.Server_Notification_Receivers + .Server_Notification_Receiver' + Class) is + begin + Value.On_DidOpenNotebook_Notification (Self.Params); + end Visit_Server_Receiver; + +end LSP.Server_Notifications.DidOpenNotebook; diff --git a/source/lsp_3.17/generated/lsp-server_notifications-didopennotebook.ads b/source/lsp_3.17/generated/lsp-server_notifications-didopennotebook.ads new file mode 100644 index 000000000..8418d85aa --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_notifications-didopennotebook.ads @@ -0,0 +1,23 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Notifications.DidOpenNotebook is + pragma Preelaborate; + + type Notification is + new LSP.Server_Notifications.Server_Notification with record + Params : LSP.Structures.DidOpenNotebookDocumentParams; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Notification; + Value : in out LSP.Server_Notification_Receivers + .Server_Notification_Receiver' + Class); + +end LSP.Server_Notifications.DidOpenNotebook; diff --git a/source/lsp_3.17/generated/lsp-server_notifications-didrenamefiles.adb b/source/lsp_3.17/generated/lsp-server_notifications-didrenamefiles.adb new file mode 100644 index 000000000..bb7052d29 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_notifications-didrenamefiles.adb @@ -0,0 +1,18 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Notifications.DidRenameFiles is + + overriding procedure Visit_Server_Receiver + (Self : Notification; + Value : in out LSP.Server_Notification_Receivers + .Server_Notification_Receiver' + Class) is + begin + Value.On_DidRenameFiles_Notification (Self.Params); + end Visit_Server_Receiver; + +end LSP.Server_Notifications.DidRenameFiles; diff --git a/source/lsp_3.17/generated/lsp-server_notifications-didrenamefiles.ads b/source/lsp_3.17/generated/lsp-server_notifications-didrenamefiles.ads new file mode 100644 index 000000000..f6dc6f546 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_notifications-didrenamefiles.ads @@ -0,0 +1,23 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Notifications.DidRenameFiles is + pragma Preelaborate; + + type Notification is + new LSP.Server_Notifications.Server_Notification with record + Params : LSP.Structures.RenameFilesParams; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Notification; + Value : in out LSP.Server_Notification_Receivers + .Server_Notification_Receiver' + Class); + +end LSP.Server_Notifications.DidRenameFiles; diff --git a/source/lsp_3.17/generated/lsp-server_notifications-didsave.adb b/source/lsp_3.17/generated/lsp-server_notifications-didsave.adb new file mode 100644 index 000000000..91c1e2ca1 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_notifications-didsave.adb @@ -0,0 +1,18 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Notifications.DidSave is + + overriding procedure Visit_Server_Receiver + (Self : Notification; + Value : in out LSP.Server_Notification_Receivers + .Server_Notification_Receiver' + Class) is + begin + Value.On_DidSave_Notification (Self.Params); + end Visit_Server_Receiver; + +end LSP.Server_Notifications.DidSave; diff --git a/source/lsp_3.17/generated/lsp-server_notifications-didsave.ads b/source/lsp_3.17/generated/lsp-server_notifications-didsave.ads new file mode 100644 index 000000000..98314f5db --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_notifications-didsave.ads @@ -0,0 +1,23 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Notifications.DidSave is + pragma Preelaborate; + + type Notification is + new LSP.Server_Notifications.Server_Notification with record + Params : LSP.Structures.DidSaveTextDocumentParams; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Notification; + Value : in out LSP.Server_Notification_Receivers + .Server_Notification_Receiver' + Class); + +end LSP.Server_Notifications.DidSave; diff --git a/source/lsp_3.17/generated/lsp-server_notifications-didsavenotebook.adb b/source/lsp_3.17/generated/lsp-server_notifications-didsavenotebook.adb new file mode 100644 index 000000000..48d10d935 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_notifications-didsavenotebook.adb @@ -0,0 +1,18 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Notifications.DidSaveNotebook is + + overriding procedure Visit_Server_Receiver + (Self : Notification; + Value : in out LSP.Server_Notification_Receivers + .Server_Notification_Receiver' + Class) is + begin + Value.On_DidSaveNotebook_Notification (Self.Params); + end Visit_Server_Receiver; + +end LSP.Server_Notifications.DidSaveNotebook; diff --git a/source/lsp_3.17/generated/lsp-server_notifications-didsavenotebook.ads b/source/lsp_3.17/generated/lsp-server_notifications-didsavenotebook.ads new file mode 100644 index 000000000..05df8ad01 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_notifications-didsavenotebook.ads @@ -0,0 +1,23 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Notifications.DidSaveNotebook is + pragma Preelaborate; + + type Notification is + new LSP.Server_Notifications.Server_Notification with record + Params : LSP.Structures.DidSaveNotebookDocumentParams; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Notification; + Value : in out LSP.Server_Notification_Receivers + .Server_Notification_Receiver' + Class); + +end LSP.Server_Notifications.DidSaveNotebook; diff --git a/source/lsp_3.17/generated/lsp-server_notifications-exits.adb b/source/lsp_3.17/generated/lsp-server_notifications-exits.adb new file mode 100644 index 000000000..fea7074d6 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_notifications-exits.adb @@ -0,0 +1,18 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Notifications.Exits is + + overriding procedure Visit_Server_Receiver + (Self : Notification; + Value : in out LSP.Server_Notification_Receivers + .Server_Notification_Receiver' + Class) is + begin + Value.On_Exits_Notification; + end Visit_Server_Receiver; + +end LSP.Server_Notifications.Exits; diff --git a/source/lsp_3.17/generated/lsp-server_notifications-exits.ads b/source/lsp_3.17/generated/lsp-server_notifications-exits.ads new file mode 100644 index 000000000..00ff8be89 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_notifications-exits.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package LSP.Server_Notifications.Exits is + pragma Preelaborate; + + type Notification is + new LSP.Server_Notifications.Server_Notification with record + null; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Notification; + Value : in out LSP.Server_Notification_Receivers + .Server_Notification_Receiver' + Class); + +end LSP.Server_Notifications.Exits; diff --git a/source/lsp_3.17/generated/lsp-server_notifications-initialized.adb b/source/lsp_3.17/generated/lsp-server_notifications-initialized.adb new file mode 100644 index 000000000..84ed418da --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_notifications-initialized.adb @@ -0,0 +1,18 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Notifications.Initialized is + + overriding procedure Visit_Server_Receiver + (Self : Notification; + Value : in out LSP.Server_Notification_Receivers + .Server_Notification_Receiver' + Class) is + begin + Value.On_Initialized_Notification (Self.Params); + end Visit_Server_Receiver; + +end LSP.Server_Notifications.Initialized; diff --git a/source/lsp_3.17/generated/lsp-server_notifications-initialized.ads b/source/lsp_3.17/generated/lsp-server_notifications-initialized.ads new file mode 100644 index 000000000..50e2efa1b --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_notifications-initialized.ads @@ -0,0 +1,23 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Notifications.Initialized is + pragma Preelaborate; + + type Notification is + new LSP.Server_Notifications.Server_Notification with record + Params : LSP.Structures.InitializedParams; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Notification; + Value : in out LSP.Server_Notification_Receivers + .Server_Notification_Receiver' + Class); + +end LSP.Server_Notifications.Initialized; diff --git a/source/lsp_3.17/generated/lsp-server_notifications-progress.adb b/source/lsp_3.17/generated/lsp-server_notifications-progress.adb new file mode 100644 index 000000000..3ca0f584b --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_notifications-progress.adb @@ -0,0 +1,18 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Notifications.Progress is + + overriding procedure Visit_Server_Receiver + (Self : Notification; + Value : in out LSP.Server_Notification_Receivers + .Server_Notification_Receiver' + Class) is + begin + Value.On_Progress_Notification (Self.Params); + end Visit_Server_Receiver; + +end LSP.Server_Notifications.Progress; diff --git a/source/lsp_3.17/generated/lsp-server_notifications-progress.ads b/source/lsp_3.17/generated/lsp-server_notifications-progress.ads new file mode 100644 index 000000000..12f0ac509 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_notifications-progress.ads @@ -0,0 +1,23 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Notifications.Progress is + pragma Preelaborate; + + type Notification is + new LSP.Server_Notifications.Server_Notification with record + Params : LSP.Structures.ProgressParams; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Notification; + Value : in out LSP.Server_Notification_Receivers + .Server_Notification_Receiver' + Class); + +end LSP.Server_Notifications.Progress; diff --git a/source/lsp_3.17/generated/lsp-server_notifications-settrace.adb b/source/lsp_3.17/generated/lsp-server_notifications-settrace.adb new file mode 100644 index 000000000..61d349181 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_notifications-settrace.adb @@ -0,0 +1,18 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Notifications.SetTrace is + + overriding procedure Visit_Server_Receiver + (Self : Notification; + Value : in out LSP.Server_Notification_Receivers + .Server_Notification_Receiver' + Class) is + begin + Value.On_SetTrace_Notification (Self.Params); + end Visit_Server_Receiver; + +end LSP.Server_Notifications.SetTrace; diff --git a/source/lsp_3.17/generated/lsp-server_notifications-settrace.ads b/source/lsp_3.17/generated/lsp-server_notifications-settrace.ads new file mode 100644 index 000000000..0b00253ca --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_notifications-settrace.ads @@ -0,0 +1,23 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Notifications.SetTrace is + pragma Preelaborate; + + type Notification is + new LSP.Server_Notifications.Server_Notification with record + Params : LSP.Structures.SetTraceParams; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Notification; + Value : in out LSP.Server_Notification_Receivers + .Server_Notification_Receiver' + Class); + +end LSP.Server_Notifications.SetTrace; diff --git a/source/lsp_3.17/generated/lsp-server_notifications-willsave.adb b/source/lsp_3.17/generated/lsp-server_notifications-willsave.adb new file mode 100644 index 000000000..9ddf98fc0 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_notifications-willsave.adb @@ -0,0 +1,18 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Notifications.WillSave is + + overriding procedure Visit_Server_Receiver + (Self : Notification; + Value : in out LSP.Server_Notification_Receivers + .Server_Notification_Receiver' + Class) is + begin + Value.On_WillSave_Notification (Self.Params); + end Visit_Server_Receiver; + +end LSP.Server_Notifications.WillSave; diff --git a/source/lsp_3.17/generated/lsp-server_notifications-willsave.ads b/source/lsp_3.17/generated/lsp-server_notifications-willsave.ads new file mode 100644 index 000000000..52af4d68d --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_notifications-willsave.ads @@ -0,0 +1,23 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Notifications.WillSave is + pragma Preelaborate; + + type Notification is + new LSP.Server_Notifications.Server_Notification with record + Params : LSP.Structures.WillSaveTextDocumentParams; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Notification; + Value : in out LSP.Server_Notification_Receivers + .Server_Notification_Receiver' + Class); + +end LSP.Server_Notifications.WillSave; diff --git a/source/lsp_3.17/generated/lsp-server_request_readers.adb b/source/lsp_3.17/generated/lsp-server_request_readers.adb new file mode 100644 index 000000000..c5bea6a4f --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_request_readers.adb @@ -0,0 +1,610 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with Minimal_Perfect_Hash; +with LSP.Inputs; +with LSP.Input_Tools; +with LSP.Structures; + +with LSP.Server_Requests.IncomingCalls; +with LSP.Server_Requests.OutgoingCalls; +with LSP.Server_Requests.Code_Action_Resolve; +with LSP.Server_Requests.Code_Lens_Resolve; +with LSP.Server_Requests.Completion_Resolve; +with LSP.Server_Requests.Link_Resolve; +with LSP.Server_Requests.Initialize; +with LSP.Server_Requests.Inlay_Resolve; +with LSP.Server_Requests.Shutdown; +with LSP.Server_Requests.CodeAction; +with LSP.Server_Requests.CodeLens; +with LSP.Server_Requests.ColorPresentation; +with LSP.Server_Requests.Completion; +with LSP.Server_Requests.Declaration; +with LSP.Server_Requests.Definition; +with LSP.Server_Requests.Diagnostic; +with LSP.Server_Requests.DocumentColor; +with LSP.Server_Requests.DocumentHighlight; +with LSP.Server_Requests.DocumentLink; +with LSP.Server_Requests.DocumentSymbol; +with LSP.Server_Requests.FoldingRange; +with LSP.Server_Requests.Formatting; +with LSP.Server_Requests.Hover; +with LSP.Server_Requests.Implementation; +with LSP.Server_Requests.InlayHint; +with LSP.Server_Requests.InlineValue; +with LSP.Server_Requests.LinkedEditingRange; +with LSP.Server_Requests.Moniker; +with LSP.Server_Requests.OnTypeFormatting; +with LSP.Server_Requests.PrepareCallHierarchy; +with LSP.Server_Requests.PrepareRename; +with LSP.Server_Requests.PrepareTypeHierarchy; +with LSP.Server_Requests.RangeFormatting; +with LSP.Server_Requests.References; +with LSP.Server_Requests.Rename; +with LSP.Server_Requests.SelectionRange; +with LSP.Server_Requests.Full; +with LSP.Server_Requests.Tokens_Delta; +with LSP.Server_Requests.Tokens_Range; +with LSP.Server_Requests.SignatureHelp; +with LSP.Server_Requests.TypeDefinition; +with LSP.Server_Requests.WillSaveWaitUntil; +with LSP.Server_Requests.Subtypes; +with LSP.Server_Requests.Supertypes; +with LSP.Server_Requests.Workspace_Diagnostic; +with LSP.Server_Requests.ExecuteCommand; +with LSP.Server_Requests.Symbol; +with LSP.Server_Requests.WillCreateFiles; +with LSP.Server_Requests.WillDeleteFiles; +with LSP.Server_Requests.WillRenameFiles; +with LSP.Server_Requests.Symbol_Resolve; + +package body LSP.Server_Request_Readers is + + package Method_Map is new Minimal_Perfect_Hash + (["callHierarchy/incomingCalls", + "callHierarchy/outgoingCalls", + "codeAction/resolve", + "codeLens/resolve", + "completionItem/resolve", + "documentLink/resolve", + "initialize", + "inlayHint/resolve", + "shutdown", + "textDocument/codeAction", + "textDocument/codeLens", + "textDocument/colorPresentation", + "textDocument/completion", + "textDocument/declaration", + "textDocument/definition", + "textDocument/diagnostic", + "textDocument/documentColor", + "textDocument/documentHighlight", + "textDocument/documentLink", + "textDocument/documentSymbol", + "textDocument/foldingRange", + "textDocument/formatting", + "textDocument/hover", + "textDocument/implementation", + "textDocument/inlayHint", + "textDocument/inlineValue", + "textDocument/linkedEditingRange", + "textDocument/moniker", + "textDocument/onTypeFormatting", + "textDocument/prepareCallHierarchy", + "textDocument/prepareRename", + "textDocument/prepareTypeHierarchy", + "textDocument/rangeFormatting", + "textDocument/references", + "textDocument/rename", + "textDocument/selectionRange", + "textDocument/semanticTokens/full", + "textDocument/semanticTokens/full/delta", + "textDocument/semanticTokens/range", + "textDocument/signatureHelp", + "textDocument/typeDefinition", + "textDocument/willSaveWaitUntil", + "typeHierarchy/subtypes", + "typeHierarchy/supertypes", + "workspace/diagnostic", + "workspace/executeCommand", + "workspace/symbol", + "workspace/willCreateFiles", + "workspace/willDeleteFiles", + "workspace/willRenameFiles", + "workspaceSymbol/resolve"]); + + procedure Initialize is + begin + Method_Map.Initialize; + end Initialize; + + procedure Read_IncomingCalls is new LSP.Input_Tools.Read_Request + (LSP.Structures.CallHierarchyIncomingCallsParams, + "callHierarchy/incomingCalls", + LSP.Inputs.Read_CallHierarchyIncomingCallsParams); + + procedure Read_OutgoingCalls is new LSP.Input_Tools.Read_Request + (LSP.Structures.CallHierarchyOutgoingCallsParams, + "callHierarchy/outgoingCalls", + LSP.Inputs.Read_CallHierarchyOutgoingCallsParams); + + procedure Read_Code_Action_Resolve is new LSP.Input_Tools.Read_Request + (LSP.Structures.CodeAction, "codeAction/resolve", + LSP.Inputs.Read_CodeAction); + + procedure Read_Code_Lens_Resolve is new LSP.Input_Tools.Read_Request + (LSP.Structures.CodeLens, "codeLens/resolve", LSP.Inputs.Read_CodeLens); + + procedure Read_Completion_Resolve is new LSP.Input_Tools.Read_Request + (LSP.Structures.CompletionItem, "completionItem/resolve", + LSP.Inputs.Read_CompletionItem); + + procedure Read_Link_Resolve is new LSP.Input_Tools.Read_Request + (LSP.Structures.DocumentLink, "documentLink/resolve", + LSP.Inputs.Read_DocumentLink); + + procedure Read_Initialize is new LSP.Input_Tools.Read_Request + (LSP.Structures.InitializeParams, "initialize", + LSP.Inputs.Read_InitializeParams); + + procedure Read_Inlay_Resolve is new LSP.Input_Tools.Read_Request + (LSP.Structures.InlayHint, "inlayHint/resolve", + LSP.Inputs.Read_InlayHint); + + procedure Read_Shutdown + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Id : in out LSP.Structures.Integer_Or_Virtual_String); + + procedure Read_Shutdown + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Id : in out LSP.Structures.Integer_Or_Virtual_String) is + begin + LSP.Input_Tools.Read_Null_Request (Handler, "shutdown", Id); + end Read_Shutdown; + + procedure Read_CodeAction is new LSP.Input_Tools.Read_Request + (LSP.Structures.CodeActionParams, "textDocument/codeAction", + LSP.Inputs.Read_CodeActionParams); + + procedure Read_CodeLens is new LSP.Input_Tools.Read_Request + (LSP.Structures.CodeLensParams, "textDocument/codeLens", + LSP.Inputs.Read_CodeLensParams); + + procedure Read_ColorPresentation is new LSP.Input_Tools.Read_Request + (LSP.Structures.ColorPresentationParams, "textDocument/colorPresentation", + LSP.Inputs.Read_ColorPresentationParams); + + procedure Read_Completion is new LSP.Input_Tools.Read_Request + (LSP.Structures.CompletionParams, "textDocument/completion", + LSP.Inputs.Read_CompletionParams); + + procedure Read_Declaration is new LSP.Input_Tools.Read_Request + (LSP.Structures.DeclarationParams, "textDocument/declaration", + LSP.Inputs.Read_DeclarationParams); + + procedure Read_Definition is new LSP.Input_Tools.Read_Request + (LSP.Structures.DefinitionParams, "textDocument/definition", + LSP.Inputs.Read_DefinitionParams); + + procedure Read_Diagnostic is new LSP.Input_Tools.Read_Request + (LSP.Structures.DocumentDiagnosticParams, "textDocument/diagnostic", + LSP.Inputs.Read_DocumentDiagnosticParams); + + procedure Read_DocumentColor is new LSP.Input_Tools.Read_Request + (LSP.Structures.DocumentColorParams, "textDocument/documentColor", + LSP.Inputs.Read_DocumentColorParams); + + procedure Read_DocumentHighlight is new LSP.Input_Tools.Read_Request + (LSP.Structures.DocumentHighlightParams, "textDocument/documentHighlight", + LSP.Inputs.Read_DocumentHighlightParams); + + procedure Read_DocumentLink is new LSP.Input_Tools.Read_Request + (LSP.Structures.DocumentLinkParams, "textDocument/documentLink", + LSP.Inputs.Read_DocumentLinkParams); + + procedure Read_DocumentSymbol is new LSP.Input_Tools.Read_Request + (LSP.Structures.DocumentSymbolParams, "textDocument/documentSymbol", + LSP.Inputs.Read_DocumentSymbolParams); + + procedure Read_FoldingRange is new LSP.Input_Tools.Read_Request + (LSP.Structures.FoldingRangeParams, "textDocument/foldingRange", + LSP.Inputs.Read_FoldingRangeParams); + + procedure Read_Formatting is new LSP.Input_Tools.Read_Request + (LSP.Structures.DocumentFormattingParams, "textDocument/formatting", + LSP.Inputs.Read_DocumentFormattingParams); + + procedure Read_Hover is new LSP.Input_Tools.Read_Request + (LSP.Structures.HoverParams, "textDocument/hover", + LSP.Inputs.Read_HoverParams); + + procedure Read_Implementation is new LSP.Input_Tools.Read_Request + (LSP.Structures.ImplementationParams, "textDocument/implementation", + LSP.Inputs.Read_ImplementationParams); + + procedure Read_InlayHint is new LSP.Input_Tools.Read_Request + (LSP.Structures.InlayHintParams, "textDocument/inlayHint", + LSP.Inputs.Read_InlayHintParams); + + procedure Read_InlineValue is new LSP.Input_Tools.Read_Request + (LSP.Structures.InlineValueParams, "textDocument/inlineValue", + LSP.Inputs.Read_InlineValueParams); + + procedure Read_LinkedEditingRange is new LSP.Input_Tools.Read_Request + (LSP.Structures.LinkedEditingRangeParams, + "textDocument/linkedEditingRange", + LSP.Inputs.Read_LinkedEditingRangeParams); + + procedure Read_Moniker is new LSP.Input_Tools.Read_Request + (LSP.Structures.MonikerParams, "textDocument/moniker", + LSP.Inputs.Read_MonikerParams); + + procedure Read_OnTypeFormatting is new LSP.Input_Tools.Read_Request + (LSP.Structures.DocumentOnTypeFormattingParams, + "textDocument/onTypeFormatting", + LSP.Inputs.Read_DocumentOnTypeFormattingParams); + + procedure Read_PrepareCallHierarchy is new LSP.Input_Tools.Read_Request + (LSP.Structures.CallHierarchyPrepareParams, + "textDocument/prepareCallHierarchy", + LSP.Inputs.Read_CallHierarchyPrepareParams); + + procedure Read_PrepareRename is new LSP.Input_Tools.Read_Request + (LSP.Structures.PrepareRenameParams, "textDocument/prepareRename", + LSP.Inputs.Read_PrepareRenameParams); + + procedure Read_PrepareTypeHierarchy is new LSP.Input_Tools.Read_Request + (LSP.Structures.TypeHierarchyPrepareParams, + "textDocument/prepareTypeHierarchy", + LSP.Inputs.Read_TypeHierarchyPrepareParams); + + procedure Read_RangeFormatting is new LSP.Input_Tools.Read_Request + (LSP.Structures.DocumentRangeFormattingParams, + "textDocument/rangeFormatting", + LSP.Inputs.Read_DocumentRangeFormattingParams); + + procedure Read_References is new LSP.Input_Tools.Read_Request + (LSP.Structures.ReferenceParams, "textDocument/references", + LSP.Inputs.Read_ReferenceParams); + + procedure Read_Rename is new LSP.Input_Tools.Read_Request + (LSP.Structures.RenameParams, "textDocument/rename", + LSP.Inputs.Read_RenameParams); + + procedure Read_SelectionRange is new LSP.Input_Tools.Read_Request + (LSP.Structures.SelectionRangeParams, "textDocument/selectionRange", + LSP.Inputs.Read_SelectionRangeParams); + + procedure Read_Full is new LSP.Input_Tools.Read_Request + (LSP.Structures.SemanticTokensParams, "textDocument/semanticTokens/full", + LSP.Inputs.Read_SemanticTokensParams); + + procedure Read_Tokens_Delta is new LSP.Input_Tools.Read_Request + (LSP.Structures.SemanticTokensDeltaParams, + "textDocument/semanticTokens/full/delta", + LSP.Inputs.Read_SemanticTokensDeltaParams); + + procedure Read_Tokens_Range is new LSP.Input_Tools.Read_Request + (LSP.Structures.SemanticTokensRangeParams, + "textDocument/semanticTokens/range", + LSP.Inputs.Read_SemanticTokensRangeParams); + + procedure Read_SignatureHelp is new LSP.Input_Tools.Read_Request + (LSP.Structures.SignatureHelpParams, "textDocument/signatureHelp", + LSP.Inputs.Read_SignatureHelpParams); + + procedure Read_TypeDefinition is new LSP.Input_Tools.Read_Request + (LSP.Structures.TypeDefinitionParams, "textDocument/typeDefinition", + LSP.Inputs.Read_TypeDefinitionParams); + + procedure Read_WillSaveWaitUntil is new LSP.Input_Tools.Read_Request + (LSP.Structures.WillSaveTextDocumentParams, + "textDocument/willSaveWaitUntil", + LSP.Inputs.Read_WillSaveTextDocumentParams); + + procedure Read_Subtypes is new LSP.Input_Tools.Read_Request + (LSP.Structures.TypeHierarchySubtypesParams, "typeHierarchy/subtypes", + LSP.Inputs.Read_TypeHierarchySubtypesParams); + + procedure Read_Supertypes is new LSP.Input_Tools.Read_Request + (LSP.Structures.TypeHierarchySupertypesParams, "typeHierarchy/supertypes", + LSP.Inputs.Read_TypeHierarchySupertypesParams); + + procedure Read_Workspace_Diagnostic is new LSP.Input_Tools.Read_Request + (LSP.Structures.WorkspaceDiagnosticParams, "workspace/diagnostic", + LSP.Inputs.Read_WorkspaceDiagnosticParams); + + procedure Read_ExecuteCommand is new LSP.Input_Tools.Read_Request + (LSP.Structures.ExecuteCommandParams, "workspace/executeCommand", + LSP.Inputs.Read_ExecuteCommandParams); + + procedure Read_Symbol is new LSP.Input_Tools.Read_Request + (LSP.Structures.WorkspaceSymbolParams, "workspace/symbol", + LSP.Inputs.Read_WorkspaceSymbolParams); + + procedure Read_WillCreateFiles is new LSP.Input_Tools.Read_Request + (LSP.Structures.CreateFilesParams, "workspace/willCreateFiles", + LSP.Inputs.Read_CreateFilesParams); + + procedure Read_WillDeleteFiles is new LSP.Input_Tools.Read_Request + (LSP.Structures.DeleteFilesParams, "workspace/willDeleteFiles", + LSP.Inputs.Read_DeleteFilesParams); + + procedure Read_WillRenameFiles is new LSP.Input_Tools.Read_Request + (LSP.Structures.RenameFilesParams, "workspace/willRenameFiles", + LSP.Inputs.Read_RenameFilesParams); + + procedure Read_Symbol_Resolve is new LSP.Input_Tools.Read_Request + (LSP.Structures.WorkspaceSymbol, "workspaceSymbol/resolve", + LSP.Inputs.Read_WorkspaceSymbol); + + function Read_Request + (Input : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Method : VSS.Strings.Virtual_String) + return LSP.Server_Requests.Server_Request'Class is + Index : constant Natural := Method_Map.Get_Index (Method); + begin + case Index is + when 1 => -- callHierarchy/incomingCalls + return Result : LSP.Server_Requests.IncomingCalls.Request do + Read_IncomingCalls (Input, Result.Id, Result.Params); + end return; + + when 2 => -- callHierarchy/outgoingCalls + return Result : LSP.Server_Requests.OutgoingCalls.Request do + Read_OutgoingCalls (Input, Result.Id, Result.Params); + end return; + + when 3 => -- codeAction/resolve + return Result : LSP.Server_Requests.Code_Action_Resolve.Request do + Read_Code_Action_Resolve (Input, Result.Id, Result.Params); + end return; + + when 4 => -- codeLens/resolve + return Result : LSP.Server_Requests.Code_Lens_Resolve.Request do + Read_Code_Lens_Resolve (Input, Result.Id, Result.Params); + end return; + + when 5 => -- completionItem/resolve + return Result : LSP.Server_Requests.Completion_Resolve.Request do + Read_Completion_Resolve (Input, Result.Id, Result.Params); + end return; + + when 6 => -- documentLink/resolve + return Result : LSP.Server_Requests.Link_Resolve.Request do + Read_Link_Resolve (Input, Result.Id, Result.Params); + end return; + + when 7 => -- initialize + return Result : LSP.Server_Requests.Initialize.Request do + Read_Initialize (Input, Result.Id, Result.Params); + end return; + + when 8 => -- inlayHint/resolve + return Result : LSP.Server_Requests.Inlay_Resolve.Request do + Read_Inlay_Resolve (Input, Result.Id, Result.Params); + end return; + + when 9 => -- shutdown + return Result : LSP.Server_Requests.Shutdown.Request do + Read_Shutdown (Input, Result.Id); + end return; + + when 10 => -- textDocument/codeAction + return Result : LSP.Server_Requests.CodeAction.Request do + Read_CodeAction (Input, Result.Id, Result.Params); + end return; + + when 11 => -- textDocument/codeLens + return Result : LSP.Server_Requests.CodeLens.Request do + Read_CodeLens (Input, Result.Id, Result.Params); + end return; + + when 12 => -- textDocument/colorPresentation + return Result : LSP.Server_Requests.ColorPresentation.Request do + Read_ColorPresentation (Input, Result.Id, Result.Params); + end return; + + when 13 => -- textDocument/completion + return Result : LSP.Server_Requests.Completion.Request do + Read_Completion (Input, Result.Id, Result.Params); + end return; + + when 14 => -- textDocument/declaration + return Result : LSP.Server_Requests.Declaration.Request do + Read_Declaration (Input, Result.Id, Result.Params); + end return; + + when 15 => -- textDocument/definition + return Result : LSP.Server_Requests.Definition.Request do + Read_Definition (Input, Result.Id, Result.Params); + end return; + + when 16 => -- textDocument/diagnostic + return Result : LSP.Server_Requests.Diagnostic.Request do + Read_Diagnostic (Input, Result.Id, Result.Params); + end return; + + when 17 => -- textDocument/documentColor + return Result : LSP.Server_Requests.DocumentColor.Request do + Read_DocumentColor (Input, Result.Id, Result.Params); + end return; + + when 18 => -- textDocument/documentHighlight + return Result : LSP.Server_Requests.DocumentHighlight.Request do + Read_DocumentHighlight (Input, Result.Id, Result.Params); + end return; + + when 19 => -- textDocument/documentLink + return Result : LSP.Server_Requests.DocumentLink.Request do + Read_DocumentLink (Input, Result.Id, Result.Params); + end return; + + when 20 => -- textDocument/documentSymbol + return Result : LSP.Server_Requests.DocumentSymbol.Request do + Read_DocumentSymbol (Input, Result.Id, Result.Params); + end return; + + when 21 => -- textDocument/foldingRange + return Result : LSP.Server_Requests.FoldingRange.Request do + Read_FoldingRange (Input, Result.Id, Result.Params); + end return; + + when 22 => -- textDocument/formatting + return Result : LSP.Server_Requests.Formatting.Request do + Read_Formatting (Input, Result.Id, Result.Params); + end return; + + when 23 => -- textDocument/hover + return Result : LSP.Server_Requests.Hover.Request do + Read_Hover (Input, Result.Id, Result.Params); + end return; + + when 24 => -- textDocument/implementation + return Result : LSP.Server_Requests.Implementation.Request do + Read_Implementation (Input, Result.Id, Result.Params); + end return; + + when 25 => -- textDocument/inlayHint + return Result : LSP.Server_Requests.InlayHint.Request do + Read_InlayHint (Input, Result.Id, Result.Params); + end return; + + when 26 => -- textDocument/inlineValue + return Result : LSP.Server_Requests.InlineValue.Request do + Read_InlineValue (Input, Result.Id, Result.Params); + end return; + + when 27 => -- textDocument/linkedEditingRange + return Result : LSP.Server_Requests.LinkedEditingRange.Request do + Read_LinkedEditingRange (Input, Result.Id, Result.Params); + end return; + + when 28 => -- textDocument/moniker + return Result : LSP.Server_Requests.Moniker.Request do + Read_Moniker (Input, Result.Id, Result.Params); + end return; + + when 29 => -- textDocument/onTypeFormatting + return Result : LSP.Server_Requests.OnTypeFormatting.Request do + Read_OnTypeFormatting (Input, Result.Id, Result.Params); + end return; + + when 30 => -- textDocument/prepareCallHierarchy + return Result : LSP.Server_Requests.PrepareCallHierarchy.Request do + Read_PrepareCallHierarchy (Input, Result.Id, Result.Params); + end return; + + when 31 => -- textDocument/prepareRename + return Result : LSP.Server_Requests.PrepareRename.Request do + Read_PrepareRename (Input, Result.Id, Result.Params); + end return; + + when 32 => -- textDocument/prepareTypeHierarchy + return Result : LSP.Server_Requests.PrepareTypeHierarchy.Request do + Read_PrepareTypeHierarchy (Input, Result.Id, Result.Params); + end return; + + when 33 => -- textDocument/rangeFormatting + return Result : LSP.Server_Requests.RangeFormatting.Request do + Read_RangeFormatting (Input, Result.Id, Result.Params); + end return; + + when 34 => -- textDocument/references + return Result : LSP.Server_Requests.References.Request do + Read_References (Input, Result.Id, Result.Params); + end return; + + when 35 => -- textDocument/rename + return Result : LSP.Server_Requests.Rename.Request do + Read_Rename (Input, Result.Id, Result.Params); + end return; + + when 36 => -- textDocument/selectionRange + return Result : LSP.Server_Requests.SelectionRange.Request do + Read_SelectionRange (Input, Result.Id, Result.Params); + end return; + + when 37 => -- textDocument/semanticTokens/full + return Result : LSP.Server_Requests.Full.Request do + Read_Full (Input, Result.Id, Result.Params); + end return; + + when 38 => -- textDocument/semanticTokens/full/delta + return Result : LSP.Server_Requests.Tokens_Delta.Request do + Read_Tokens_Delta (Input, Result.Id, Result.Params); + end return; + + when 39 => -- textDocument/semanticTokens/range + return Result : LSP.Server_Requests.Tokens_Range.Request do + Read_Tokens_Range (Input, Result.Id, Result.Params); + end return; + + when 40 => -- textDocument/signatureHelp + return Result : LSP.Server_Requests.SignatureHelp.Request do + Read_SignatureHelp (Input, Result.Id, Result.Params); + end return; + + when 41 => -- textDocument/typeDefinition + return Result : LSP.Server_Requests.TypeDefinition.Request do + Read_TypeDefinition (Input, Result.Id, Result.Params); + end return; + + when 42 => -- textDocument/willSaveWaitUntil + return Result : LSP.Server_Requests.WillSaveWaitUntil.Request do + Read_WillSaveWaitUntil (Input, Result.Id, Result.Params); + end return; + + when 43 => -- typeHierarchy/subtypes + return Result : LSP.Server_Requests.Subtypes.Request do + Read_Subtypes (Input, Result.Id, Result.Params); + end return; + + when 44 => -- typeHierarchy/supertypes + return Result : LSP.Server_Requests.Supertypes.Request do + Read_Supertypes (Input, Result.Id, Result.Params); + end return; + + when 45 => -- workspace/diagnostic + return Result : LSP.Server_Requests.Workspace_Diagnostic.Request do + Read_Workspace_Diagnostic (Input, Result.Id, Result.Params); + end return; + + when 46 => -- workspace/executeCommand + return Result : LSP.Server_Requests.ExecuteCommand.Request do + Read_ExecuteCommand (Input, Result.Id, Result.Params); + end return; + + when 47 => -- workspace/symbol + return Result : LSP.Server_Requests.Symbol.Request do + Read_Symbol (Input, Result.Id, Result.Params); + end return; + + when 48 => -- workspace/willCreateFiles + return Result : LSP.Server_Requests.WillCreateFiles.Request do + Read_WillCreateFiles (Input, Result.Id, Result.Params); + end return; + + when 49 => -- workspace/willDeleteFiles + return Result : LSP.Server_Requests.WillDeleteFiles.Request do + Read_WillDeleteFiles (Input, Result.Id, Result.Params); + end return; + + when 50 => -- workspace/willRenameFiles + return Result : LSP.Server_Requests.WillRenameFiles.Request do + Read_WillRenameFiles (Input, Result.Id, Result.Params); + end return; + + when 51 => -- workspaceSymbol/resolve + return Result : LSP.Server_Requests.Symbol_Resolve.Request do + Read_Symbol_Resolve (Input, Result.Id, Result.Params); + end return; + + when others => + return raise Program_Error with "Unknown method"; + end case; + end Read_Request; +end LSP.Server_Request_Readers; diff --git a/source/lsp_3.17/generated/lsp-server_request_receivers.ads b/source/lsp_3.17/generated/lsp-server_request_receivers.ads new file mode 100644 index 000000000..5fe0a9651 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_request_receivers.ads @@ -0,0 +1,454 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Request_Receivers is + pragma Preelaborate; + + type Server_Request_Receiver is limited interface; + + procedure On_IncomingCalls_Request + (Self : in out Server_Request_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CallHierarchyIncomingCallsParams) is null; + -- A request to resolve the incoming calls for a given `CallHierarchyItem`. + -- + -- @since 3.16.0 + + procedure On_OutgoingCalls_Request + (Self : in out Server_Request_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CallHierarchyOutgoingCallsParams) is null; + -- A request to resolve the outgoing calls for a given `CallHierarchyItem`. + -- + -- @since 3.16.0 + + procedure On_Code_Action_Resolve_Request + (Self : in out Server_Request_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CodeAction) is null; + -- Request to resolve additional information for a given code action.The + -- request's parameter is of type [CodeAction](#CodeAction) the response is + -- of type [CodeAction](#CodeAction) or a Thenable that resolves to such. + + procedure On_Code_Lens_Resolve_Request + (Self : in out Server_Request_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CodeLens) is null; + -- A request to resolve a command for a given code lens. + + procedure On_Completion_Resolve_Request + (Self : in out Server_Request_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CompletionItem) is null; + -- Request to resolve additional information for a given + -- completion item.The request's parameter is of type + -- [CompletionItem](#CompletionItem) the response is of type + -- [CompletionItem](#CompletionItem) or a Thenable that resolves to such. + + procedure On_Link_Resolve_Request + (Self : in out Server_Request_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentLink) is null; + -- Request to resolve additional information for a given document link. + -- The request's parameter is of type [DocumentLink](#DocumentLink) the + -- response is of type [DocumentLink](#DocumentLink) or a Thenable that + -- resolves to such. + + procedure On_Initialize_Request + (Self : in out Server_Request_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InitializeParams) is null; + -- The initialize request is sent from the client to the server. It is sent + -- once as the request after starting up the server. The requests parameter + -- is of type [InitializeParams](#InitializeParams) the response if of type + -- [InitializeResult](#InitializeResult) of a Thenable that resolves to + -- such. + + procedure On_Inlay_Resolve_Request + (Self : in out Server_Request_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InlayHint) is null; + -- A request to resolve additional properties for an inlay hint. The + -- request's parameter is of type [InlayHint](#InlayHint), the response + -- is of type [InlayHint](#InlayHint) or a Thenable that resolves to such. + -- + -- @since 3.17.0 + + procedure On_Shutdown_Request + (Self : in out Server_Request_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String) is null; + -- A shutdown request is sent from the client to the server. It is + -- sent once when the client decides to shutdown the server. The only + -- notification that is sent after a shutdown request is the exit event. + + procedure On_CodeAction_Request + (Self : in out Server_Request_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CodeActionParams) is null; + -- A request to provide commands for the given text document and range. + + procedure On_CodeLens_Request + (Self : in out Server_Request_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CodeLensParams) is null; + -- A request to provide code lens for the given text document. + + procedure On_ColorPresentation_Request + (Self : in out Server_Request_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ColorPresentationParams) is null; + -- A request to list all presentation for a color. The request's parameter + -- is of type [ColorPresentationParams](#ColorPresentationParams) the + -- response is of type [ColorInformation[]](#ColorInformation) or a + -- Thenable that resolves to such. + + procedure On_Completion_Request + (Self : in out Server_Request_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CompletionParams) is null; + -- Request to request completion at a given text + -- document position. The request's parameter is of type + -- [TextDocumentPosition](#TextDocumentPosition) the response is of type + -- [CompletionItem[]](#CompletionItem) or [CompletionList](#CompletionList) + -- or a Thenable that resolves to such. + -- + -- The request can delay the computation of + -- the [`detail`](#CompletionItem.detail) and + -- [`documentation`](#CompletionItem.documentation) properties to the + -- `completionItem/resolve` request. However, properties that are needed + -- for the initial sorting and filtering, like `sortText`, `filterText`, + -- `insertText`, and `textEdit`, must not be changed during resolve. + + procedure On_Declaration_Request + (Self : in out Server_Request_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DeclarationParams) is null; + -- A request to resolve the type definition locations of a symbol at + -- a given text document position. The request's parameter is of type + -- [TextDocumentPositionParams] (#TextDocumentPositionParams) the + -- response is of type [Declaration](#Declaration) or a typed array of + -- [DeclarationLink](#DeclarationLink) or a Thenable that resolves to such. + + procedure On_Definition_Request + (Self : in out Server_Request_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DefinitionParams) is null; + -- A request to resolve the definition location of a symbol at a + -- given text document position. The request's parameter is of type + -- [TextDocumentPosition] (#TextDocumentPosition) the response is + -- of either type [Definition](#Definition) or a typed array of + -- [DefinitionLink](#DefinitionLink) or a Thenable that resolves to such. + + procedure On_Diagnostic_Request + (Self : in out Server_Request_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentDiagnosticParams) is null; + -- The document diagnostic request definition. + -- + -- @since 3.17.0 + + procedure On_DocumentColor_Request + (Self : in out Server_Request_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentColorParams) is null; + -- A request to list all color symbols found in a given + -- text document. The request's parameter is of type + -- [DocumentColorParams](#DocumentColorParams) the response is of type + -- [ColorInformation[]](#ColorInformation) or a Thenable that resolves + -- to such. + + procedure On_DocumentHighlight_Request + (Self : in out Server_Request_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentHighlightParams) is null; + -- Request to resolve a [DocumentHighlight](#DocumentHighlight) for + -- a given text document position. The request's parameter is of type + -- [TextDocumentPosition] (#TextDocumentPosition) the request response is + -- of type [DocumentHighlight[]] (#DocumentHighlight) or a Thenable that + -- resolves to such. + + procedure On_DocumentLink_Request + (Self : in out Server_Request_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentLinkParams) is null; + -- A request to provide document links + + procedure On_DocumentSymbol_Request + (Self : in out Server_Request_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentSymbolParams) is null; + -- A request to list all symbols found in a given + -- text document. The request's parameter is of type + -- [TextDocumentIdentifier](#TextDocumentIdentifier) the response is + -- of type [SymbolInformation[]](#SymbolInformation) or a Thenable + -- that resolves to such. + + procedure On_FoldingRange_Request + (Self : in out Server_Request_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.FoldingRangeParams) is null; + -- A request to provide folding ranges in a document. The request's + -- parameter is of type [FoldingRangeParams](#FoldingRangeParams), the + -- response is of type [FoldingRangeList](#FoldingRangeList) or a Thenable + -- that resolves to such. + + procedure On_Formatting_Request + (Self : in out Server_Request_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentFormattingParams) is null; + -- A request to to format a whole document. + + procedure On_Hover_Request + (Self : in out Server_Request_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.HoverParams) is null; + -- Request to request hover information at a given text + -- document position. The request's parameter is of type + -- [TextDocumentPosition](#TextDocumentPosition) the response is of + -- type [Hover](#Hover) or a Thenable that resolves to such. + + procedure On_Implementation_Request + (Self : in out Server_Request_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ImplementationParams) is null; + -- A request to resolve the implementation locations of a symbol at + -- a given text document position. The request's parameter is of type + -- [TextDocumentPositionParams] (#TextDocumentPositionParams) the response + -- is of type [Definition](#Definition) or a Thenable that resolves to + -- such. + + procedure On_InlayHint_Request + (Self : in out Server_Request_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InlayHintParams) is null; + -- A request to provide inlay hints in a document. The request's parameter + -- is of type [InlayHintsParams](#InlayHintsParams), the response is of + -- type [InlayHint[]](#InlayHint[]) or a Thenable that resolves to such. + -- + -- @since 3.17.0 + + procedure On_InlineValue_Request + (Self : in out Server_Request_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InlineValueParams) is null; + -- A request to provide inline values in a document. The request's + -- parameter is of type [InlineValueParams](#InlineValueParams), the + -- response is of type [InlineValue[]](#InlineValue[]) or a Thenable + -- that resolves to such. + -- + -- @since 3.17.0 + + procedure On_LinkedEditingRange_Request + (Self : in out Server_Request_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.LinkedEditingRangeParams) is null; + -- A request to provide ranges that can be edited together. + -- + -- @since 3.16.0 + + procedure On_Moniker_Request + (Self : in out Server_Request_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.MonikerParams) is null; + -- A request to get the moniker of a symbol at a given + -- text document position. The request parameter is of type + -- [TextDocumentPositionParams](#TextDocumentPositionParams). The + -- response is of type [Moniker[]](#Moniker[]) or `null`. + + procedure On_OnTypeFormatting_Request + (Self : in out Server_Request_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentOnTypeFormattingParams) is null; + -- A request to format a document on type. + + procedure On_PrepareCallHierarchy_Request + (Self : in out Server_Request_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CallHierarchyPrepareParams) is null; + -- A request to result a `CallHierarchyItem` in a document at a given + -- position. Can be used as an input to an incoming or outgoing call + -- hierarchy. + -- + -- @since 3.16.0 + + procedure On_PrepareRename_Request + (Self : in out Server_Request_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.PrepareRenameParams) is null; + -- A request to test and perform the setup necessary for a rename. + -- + -- @since 3.16 - support for default behavior + + procedure On_PrepareTypeHierarchy_Request + (Self : in out Server_Request_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TypeHierarchyPrepareParams) is null; + -- A request to result a `TypeHierarchyItem` in a document at a given + -- position. Can be used as an input to a subtypes or supertypes type + -- hierarchy. + -- + -- @since 3.17.0 + + procedure On_RangeFormatting_Request + (Self : in out Server_Request_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentRangeFormattingParams) is null; + -- A request to to format a range in a document. + + procedure On_References_Request + (Self : in out Server_Request_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ReferenceParams) is null; + -- A request to resolve project-wide references for the symbol denoted + -- by the given text document position. The request's parameter is of + -- type [ReferenceParams](#ReferenceParams) the response is of type + -- [Location[]](#Location) or a Thenable that resolves to such. + + procedure On_Rename_Request + (Self : in out Server_Request_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.RenameParams) is null; + -- A request to rename a symbol. + + procedure On_SelectionRange_Request + (Self : in out Server_Request_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SelectionRangeParams) is null; + -- A request to provide selection ranges in a document. The request's + -- parameter is of type [SelectionRangeParams](#SelectionRangeParams), the + -- response is of type [SelectionRange[]](#SelectionRange[]) or a Thenable + -- that resolves to such. + + procedure On_Full_Request + (Self : in out Server_Request_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SemanticTokensParams) is null; + -- @since 3.16.0 + + procedure On_Tokens_Delta_Request + (Self : in out Server_Request_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SemanticTokensDeltaParams) is null; + -- @since 3.16.0 + + procedure On_Tokens_Range_Request + (Self : in out Server_Request_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SemanticTokensRangeParams) is null; + -- @since 3.16.0 + + procedure On_SignatureHelp_Request + (Self : in out Server_Request_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SignatureHelpParams) is null; + + procedure On_TypeDefinition_Request + (Self : in out Server_Request_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TypeDefinitionParams) is null; + -- A request to resolve the type definition locations of a symbol at + -- a given text document position. The request's parameter is of type + -- [TextDocumentPositionParams] (#TextDocumentPositionParams) the response + -- is of type [Definition](#Definition) or a Thenable that resolves to + -- such. + + procedure On_WillSaveWaitUntil_Request + (Self : in out Server_Request_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WillSaveTextDocumentParams) is null; + -- A document will save request is sent from the client to the server + -- before the document is actually saved. The request can return an array + -- of TextEdits which will be applied to the text document before it is + -- saved. Please note that clients might drop results if computing the text + -- edits took too long or if a server constantly fails on this request. + -- This is done to keep the save fast and reliable. + + procedure On_Subtypes_Request + (Self : in out Server_Request_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TypeHierarchySubtypesParams) is null; + -- A request to resolve the subtypes for a given `TypeHierarchyItem`. + -- + -- @since 3.17.0 + + procedure On_Supertypes_Request + (Self : in out Server_Request_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TypeHierarchySupertypesParams) is null; + -- A request to resolve the supertypes for a given `TypeHierarchyItem`. + -- + -- @since 3.17.0 + + procedure On_Workspace_Diagnostic_Request + (Self : in out Server_Request_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceDiagnosticParams) is null; + -- The workspace diagnostic request definition. + -- + -- @since 3.17.0 + + procedure On_ExecuteCommand_Request + (Self : in out Server_Request_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ExecuteCommandParams) is null; + -- A request send from the client to the server to execute a command. The + -- request might return a workspace edit which the client will apply to the + -- workspace. + + procedure On_Symbol_Request + (Self : in out Server_Request_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceSymbolParams) is null; + -- A request to list project-wide symbols matching the query string given + -- by the [WorkspaceSymbolParams](#WorkspaceSymbolParams). The response + -- is of type [SymbolInformation[]](#SymbolInformation) or a Thenable + -- that resolves to such. + -- + -- @since 3.17.0 - support for WorkspaceSymbol in the returned data. + -- Clients + -- need to advertise support for WorkspaceSymbols via the client capability + -- `workspace.symbol.resolveSupport`. + + procedure On_WillCreateFiles_Request + (Self : in out Server_Request_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CreateFilesParams) is null; + -- The will create files request is sent from the client to the server + -- before files are actually created as long as the creation is triggered + -- from within the client. + -- + -- @since 3.16.0 + + procedure On_WillDeleteFiles_Request + (Self : in out Server_Request_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DeleteFilesParams) is null; + -- The did delete files notification is sent from the client to the server + -- when files were deleted from within the client. + -- + -- @since 3.16.0 + + procedure On_WillRenameFiles_Request + (Self : in out Server_Request_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.RenameFilesParams) is null; + -- The will rename files request is sent from the client to the server + -- before files are actually renamed as long as the rename is triggered + -- from within the client. + -- + -- @since 3.16.0 + + procedure On_Symbol_Resolve_Request + (Self : in out Server_Request_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceSymbol) is null; + -- A request to resolve the range inside the workspace symbol's location. + -- + -- @since 3.17.0 + +end LSP.Server_Request_Receivers; diff --git a/source/lsp_3.17/generated/lsp-server_request_writers.adb b/source/lsp_3.17/generated/lsp-server_request_writers.adb new file mode 100644 index 000000000..d8e47459d --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_request_writers.adb @@ -0,0 +1,622 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Output_Tools; +with LSP.Outputs; + +package body LSP.Server_Request_Writers is + + overriding procedure On_IncomingCalls_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CallHierarchyIncomingCallsParams) is + begin + LSP.Output_Tools.Write_Start_Request + (Self.Output.all, "callHierarchy/incomingCalls", Id); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_CallHierarchyIncomingCallsParams + (Self.Output.all, Value); + Self.Output.End_Object; + end On_IncomingCalls_Request; + + overriding procedure On_OutgoingCalls_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CallHierarchyOutgoingCallsParams) is + begin + LSP.Output_Tools.Write_Start_Request + (Self.Output.all, "callHierarchy/outgoingCalls", Id); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_CallHierarchyOutgoingCallsParams + (Self.Output.all, Value); + Self.Output.End_Object; + end On_OutgoingCalls_Request; + + overriding procedure On_Code_Action_Resolve_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CodeAction) is + begin + LSP.Output_Tools.Write_Start_Request + (Self.Output.all, "codeAction/resolve", Id); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_CodeAction (Self.Output.all, Value); + Self.Output.End_Object; + end On_Code_Action_Resolve_Request; + + overriding procedure On_Code_Lens_Resolve_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CodeLens) is + begin + LSP.Output_Tools.Write_Start_Request + (Self.Output.all, "codeLens/resolve", Id); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_CodeLens (Self.Output.all, Value); + Self.Output.End_Object; + end On_Code_Lens_Resolve_Request; + + overriding procedure On_Completion_Resolve_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CompletionItem) is + begin + LSP.Output_Tools.Write_Start_Request + (Self.Output.all, "completionItem/resolve", Id); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_CompletionItem (Self.Output.all, Value); + Self.Output.End_Object; + end On_Completion_Resolve_Request; + + overriding procedure On_Link_Resolve_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentLink) is + begin + LSP.Output_Tools.Write_Start_Request + (Self.Output.all, "documentLink/resolve", Id); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_DocumentLink (Self.Output.all, Value); + Self.Output.End_Object; + end On_Link_Resolve_Request; + + overriding procedure On_Initialize_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InitializeParams) is + begin + LSP.Output_Tools.Write_Start_Request (Self.Output.all, "initialize", Id); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_InitializeParams (Self.Output.all, Value); + Self.Output.End_Object; + end On_Initialize_Request; + + overriding procedure On_Inlay_Resolve_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InlayHint) is + begin + LSP.Output_Tools.Write_Start_Request + (Self.Output.all, "inlayHint/resolve", Id); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_InlayHint (Self.Output.all, Value); + Self.Output.End_Object; + end On_Inlay_Resolve_Request; + + overriding procedure On_Shutdown_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String) is + begin + LSP.Output_Tools.Write_Start_Request (Self.Output.all, "shutdown", Id); + Self.Output.End_Object; + end On_Shutdown_Request; + + overriding procedure On_CodeAction_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CodeActionParams) is + begin + LSP.Output_Tools.Write_Start_Request + (Self.Output.all, "textDocument/codeAction", Id); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_CodeActionParams (Self.Output.all, Value); + Self.Output.End_Object; + end On_CodeAction_Request; + + overriding procedure On_CodeLens_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CodeLensParams) is + begin + LSP.Output_Tools.Write_Start_Request + (Self.Output.all, "textDocument/codeLens", Id); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_CodeLensParams (Self.Output.all, Value); + Self.Output.End_Object; + end On_CodeLens_Request; + + overriding procedure On_ColorPresentation_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ColorPresentationParams) is + begin + LSP.Output_Tools.Write_Start_Request + (Self.Output.all, "textDocument/colorPresentation", Id); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_ColorPresentationParams (Self.Output.all, Value); + Self.Output.End_Object; + end On_ColorPresentation_Request; + + overriding procedure On_Completion_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CompletionParams) is + begin + LSP.Output_Tools.Write_Start_Request + (Self.Output.all, "textDocument/completion", Id); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_CompletionParams (Self.Output.all, Value); + Self.Output.End_Object; + end On_Completion_Request; + + overriding procedure On_Declaration_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DeclarationParams) is + begin + LSP.Output_Tools.Write_Start_Request + (Self.Output.all, "textDocument/declaration", Id); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_DeclarationParams (Self.Output.all, Value); + Self.Output.End_Object; + end On_Declaration_Request; + + overriding procedure On_Definition_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DefinitionParams) is + begin + LSP.Output_Tools.Write_Start_Request + (Self.Output.all, "textDocument/definition", Id); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_DefinitionParams (Self.Output.all, Value); + Self.Output.End_Object; + end On_Definition_Request; + + overriding procedure On_Diagnostic_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentDiagnosticParams) is + begin + LSP.Output_Tools.Write_Start_Request + (Self.Output.all, "textDocument/diagnostic", Id); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_DocumentDiagnosticParams (Self.Output.all, Value); + Self.Output.End_Object; + end On_Diagnostic_Request; + + overriding procedure On_DocumentColor_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentColorParams) is + begin + LSP.Output_Tools.Write_Start_Request + (Self.Output.all, "textDocument/documentColor", Id); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_DocumentColorParams (Self.Output.all, Value); + Self.Output.End_Object; + end On_DocumentColor_Request; + + overriding procedure On_DocumentHighlight_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentHighlightParams) is + begin + LSP.Output_Tools.Write_Start_Request + (Self.Output.all, "textDocument/documentHighlight", Id); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_DocumentHighlightParams (Self.Output.all, Value); + Self.Output.End_Object; + end On_DocumentHighlight_Request; + + overriding procedure On_DocumentLink_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentLinkParams) is + begin + LSP.Output_Tools.Write_Start_Request + (Self.Output.all, "textDocument/documentLink", Id); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_DocumentLinkParams (Self.Output.all, Value); + Self.Output.End_Object; + end On_DocumentLink_Request; + + overriding procedure On_DocumentSymbol_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentSymbolParams) is + begin + LSP.Output_Tools.Write_Start_Request + (Self.Output.all, "textDocument/documentSymbol", Id); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_DocumentSymbolParams (Self.Output.all, Value); + Self.Output.End_Object; + end On_DocumentSymbol_Request; + + overriding procedure On_FoldingRange_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.FoldingRangeParams) is + begin + LSP.Output_Tools.Write_Start_Request + (Self.Output.all, "textDocument/foldingRange", Id); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_FoldingRangeParams (Self.Output.all, Value); + Self.Output.End_Object; + end On_FoldingRange_Request; + + overriding procedure On_Formatting_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentFormattingParams) is + begin + LSP.Output_Tools.Write_Start_Request + (Self.Output.all, "textDocument/formatting", Id); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_DocumentFormattingParams (Self.Output.all, Value); + Self.Output.End_Object; + end On_Formatting_Request; + + overriding procedure On_Hover_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.HoverParams) is + begin + LSP.Output_Tools.Write_Start_Request + (Self.Output.all, "textDocument/hover", Id); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_HoverParams (Self.Output.all, Value); + Self.Output.End_Object; + end On_Hover_Request; + + overriding procedure On_Implementation_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ImplementationParams) is + begin + LSP.Output_Tools.Write_Start_Request + (Self.Output.all, "textDocument/implementation", Id); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_ImplementationParams (Self.Output.all, Value); + Self.Output.End_Object; + end On_Implementation_Request; + + overriding procedure On_InlayHint_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InlayHintParams) is + begin + LSP.Output_Tools.Write_Start_Request + (Self.Output.all, "textDocument/inlayHint", Id); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_InlayHintParams (Self.Output.all, Value); + Self.Output.End_Object; + end On_InlayHint_Request; + + overriding procedure On_InlineValue_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InlineValueParams) is + begin + LSP.Output_Tools.Write_Start_Request + (Self.Output.all, "textDocument/inlineValue", Id); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_InlineValueParams (Self.Output.all, Value); + Self.Output.End_Object; + end On_InlineValue_Request; + + overriding procedure On_LinkedEditingRange_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.LinkedEditingRangeParams) is + begin + LSP.Output_Tools.Write_Start_Request + (Self.Output.all, "textDocument/linkedEditingRange", Id); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_LinkedEditingRangeParams (Self.Output.all, Value); + Self.Output.End_Object; + end On_LinkedEditingRange_Request; + + overriding procedure On_Moniker_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.MonikerParams) is + begin + LSP.Output_Tools.Write_Start_Request + (Self.Output.all, "textDocument/moniker", Id); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_MonikerParams (Self.Output.all, Value); + Self.Output.End_Object; + end On_Moniker_Request; + + overriding procedure On_OnTypeFormatting_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentOnTypeFormattingParams) is + begin + LSP.Output_Tools.Write_Start_Request + (Self.Output.all, "textDocument/onTypeFormatting", Id); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_DocumentOnTypeFormattingParams + (Self.Output.all, Value); + Self.Output.End_Object; + end On_OnTypeFormatting_Request; + + overriding procedure On_PrepareCallHierarchy_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CallHierarchyPrepareParams) is + begin + LSP.Output_Tools.Write_Start_Request + (Self.Output.all, "textDocument/prepareCallHierarchy", Id); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_CallHierarchyPrepareParams (Self.Output.all, Value); + Self.Output.End_Object; + end On_PrepareCallHierarchy_Request; + + overriding procedure On_PrepareRename_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.PrepareRenameParams) is + begin + LSP.Output_Tools.Write_Start_Request + (Self.Output.all, "textDocument/prepareRename", Id); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_PrepareRenameParams (Self.Output.all, Value); + Self.Output.End_Object; + end On_PrepareRename_Request; + + overriding procedure On_PrepareTypeHierarchy_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TypeHierarchyPrepareParams) is + begin + LSP.Output_Tools.Write_Start_Request + (Self.Output.all, "textDocument/prepareTypeHierarchy", Id); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_TypeHierarchyPrepareParams (Self.Output.all, Value); + Self.Output.End_Object; + end On_PrepareTypeHierarchy_Request; + + overriding procedure On_RangeFormatting_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentRangeFormattingParams) is + begin + LSP.Output_Tools.Write_Start_Request + (Self.Output.all, "textDocument/rangeFormatting", Id); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_DocumentRangeFormattingParams (Self.Output.all, Value); + Self.Output.End_Object; + end On_RangeFormatting_Request; + + overriding procedure On_References_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ReferenceParams) is + begin + LSP.Output_Tools.Write_Start_Request + (Self.Output.all, "textDocument/references", Id); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_ReferenceParams (Self.Output.all, Value); + Self.Output.End_Object; + end On_References_Request; + + overriding procedure On_Rename_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.RenameParams) is + begin + LSP.Output_Tools.Write_Start_Request + (Self.Output.all, "textDocument/rename", Id); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_RenameParams (Self.Output.all, Value); + Self.Output.End_Object; + end On_Rename_Request; + + overriding procedure On_SelectionRange_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SelectionRangeParams) is + begin + LSP.Output_Tools.Write_Start_Request + (Self.Output.all, "textDocument/selectionRange", Id); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_SelectionRangeParams (Self.Output.all, Value); + Self.Output.End_Object; + end On_SelectionRange_Request; + + overriding procedure On_Full_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SemanticTokensParams) is + begin + LSP.Output_Tools.Write_Start_Request + (Self.Output.all, "textDocument/semanticTokens/full", Id); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_SemanticTokensParams (Self.Output.all, Value); + Self.Output.End_Object; + end On_Full_Request; + + overriding procedure On_Tokens_Delta_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SemanticTokensDeltaParams) is + begin + LSP.Output_Tools.Write_Start_Request + (Self.Output.all, "textDocument/semanticTokens/full/delta", Id); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_SemanticTokensDeltaParams (Self.Output.all, Value); + Self.Output.End_Object; + end On_Tokens_Delta_Request; + + overriding procedure On_Tokens_Range_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SemanticTokensRangeParams) is + begin + LSP.Output_Tools.Write_Start_Request + (Self.Output.all, "textDocument/semanticTokens/range", Id); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_SemanticTokensRangeParams (Self.Output.all, Value); + Self.Output.End_Object; + end On_Tokens_Range_Request; + + overriding procedure On_SignatureHelp_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SignatureHelpParams) is + begin + LSP.Output_Tools.Write_Start_Request + (Self.Output.all, "textDocument/signatureHelp", Id); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_SignatureHelpParams (Self.Output.all, Value); + Self.Output.End_Object; + end On_SignatureHelp_Request; + + overriding procedure On_TypeDefinition_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TypeDefinitionParams) is + begin + LSP.Output_Tools.Write_Start_Request + (Self.Output.all, "textDocument/typeDefinition", Id); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_TypeDefinitionParams (Self.Output.all, Value); + Self.Output.End_Object; + end On_TypeDefinition_Request; + + overriding procedure On_WillSaveWaitUntil_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WillSaveTextDocumentParams) is + begin + LSP.Output_Tools.Write_Start_Request + (Self.Output.all, "textDocument/willSaveWaitUntil", Id); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_WillSaveTextDocumentParams (Self.Output.all, Value); + Self.Output.End_Object; + end On_WillSaveWaitUntil_Request; + + overriding procedure On_Subtypes_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TypeHierarchySubtypesParams) is + begin + LSP.Output_Tools.Write_Start_Request + (Self.Output.all, "typeHierarchy/subtypes", Id); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_TypeHierarchySubtypesParams (Self.Output.all, Value); + Self.Output.End_Object; + end On_Subtypes_Request; + + overriding procedure On_Supertypes_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TypeHierarchySupertypesParams) is + begin + LSP.Output_Tools.Write_Start_Request + (Self.Output.all, "typeHierarchy/supertypes", Id); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_TypeHierarchySupertypesParams (Self.Output.all, Value); + Self.Output.End_Object; + end On_Supertypes_Request; + + overriding procedure On_Workspace_Diagnostic_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceDiagnosticParams) is + begin + LSP.Output_Tools.Write_Start_Request + (Self.Output.all, "workspace/diagnostic", Id); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_WorkspaceDiagnosticParams (Self.Output.all, Value); + Self.Output.End_Object; + end On_Workspace_Diagnostic_Request; + + overriding procedure On_ExecuteCommand_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ExecuteCommandParams) is + begin + LSP.Output_Tools.Write_Start_Request + (Self.Output.all, "workspace/executeCommand", Id); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_ExecuteCommandParams (Self.Output.all, Value); + Self.Output.End_Object; + end On_ExecuteCommand_Request; + + overriding procedure On_Symbol_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceSymbolParams) is + begin + LSP.Output_Tools.Write_Start_Request + (Self.Output.all, "workspace/symbol", Id); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_WorkspaceSymbolParams (Self.Output.all, Value); + Self.Output.End_Object; + end On_Symbol_Request; + + overriding procedure On_WillCreateFiles_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CreateFilesParams) is + begin + LSP.Output_Tools.Write_Start_Request + (Self.Output.all, "workspace/willCreateFiles", Id); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_CreateFilesParams (Self.Output.all, Value); + Self.Output.End_Object; + end On_WillCreateFiles_Request; + + overriding procedure On_WillDeleteFiles_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DeleteFilesParams) is + begin + LSP.Output_Tools.Write_Start_Request + (Self.Output.all, "workspace/willDeleteFiles", Id); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_DeleteFilesParams (Self.Output.all, Value); + Self.Output.End_Object; + end On_WillDeleteFiles_Request; + + overriding procedure On_WillRenameFiles_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.RenameFilesParams) is + begin + LSP.Output_Tools.Write_Start_Request + (Self.Output.all, "workspace/willRenameFiles", Id); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_RenameFilesParams (Self.Output.all, Value); + Self.Output.End_Object; + end On_WillRenameFiles_Request; + + overriding procedure On_Symbol_Resolve_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceSymbol) is + begin + LSP.Output_Tools.Write_Start_Request + (Self.Output.all, "workspaceSymbol/resolve", Id); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_WorkspaceSymbol (Self.Output.all, Value); + Self.Output.End_Object; + end On_Symbol_Resolve_Request; + +end LSP.Server_Request_Writers; diff --git a/source/lsp_3.17/generated/lsp-server_request_writers.ads b/source/lsp_3.17/generated/lsp-server_request_writers.ads new file mode 100644 index 000000000..2016ebb18 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_request_writers.ads @@ -0,0 +1,272 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; +with VSS.JSON.Content_Handlers; +with LSP.Server_Request_Receivers; + +package LSP.Server_Request_Writers is + pragma Preelaborate; + + type Server_Request_Writer + (Output : access VSS.JSON.Content_Handlers.JSON_Content_Handler'Class) is + new LSP.Server_Request_Receivers.Server_Request_Receiver with null record; + + overriding procedure On_IncomingCalls_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CallHierarchyIncomingCallsParams); + + overriding procedure On_OutgoingCalls_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CallHierarchyOutgoingCallsParams); + + overriding procedure On_Code_Action_Resolve_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CodeAction); + + overriding procedure On_Code_Lens_Resolve_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CodeLens); + + overriding procedure On_Completion_Resolve_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CompletionItem); + + overriding procedure On_Link_Resolve_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentLink); + + overriding procedure On_Initialize_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InitializeParams); + + overriding procedure On_Inlay_Resolve_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InlayHint); + + overriding procedure On_Shutdown_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String); + + overriding procedure On_CodeAction_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CodeActionParams); + + overriding procedure On_CodeLens_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CodeLensParams); + + overriding procedure On_ColorPresentation_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ColorPresentationParams); + + overriding procedure On_Completion_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CompletionParams); + + overriding procedure On_Declaration_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DeclarationParams); + + overriding procedure On_Definition_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DefinitionParams); + + overriding procedure On_Diagnostic_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentDiagnosticParams); + + overriding procedure On_DocumentColor_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentColorParams); + + overriding procedure On_DocumentHighlight_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentHighlightParams); + + overriding procedure On_DocumentLink_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentLinkParams); + + overriding procedure On_DocumentSymbol_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentSymbolParams); + + overriding procedure On_FoldingRange_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.FoldingRangeParams); + + overriding procedure On_Formatting_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentFormattingParams); + + overriding procedure On_Hover_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.HoverParams); + + overriding procedure On_Implementation_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ImplementationParams); + + overriding procedure On_InlayHint_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InlayHintParams); + + overriding procedure On_InlineValue_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InlineValueParams); + + overriding procedure On_LinkedEditingRange_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.LinkedEditingRangeParams); + + overriding procedure On_Moniker_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.MonikerParams); + + overriding procedure On_OnTypeFormatting_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentOnTypeFormattingParams); + + overriding procedure On_PrepareCallHierarchy_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CallHierarchyPrepareParams); + + overriding procedure On_PrepareRename_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.PrepareRenameParams); + + overriding procedure On_PrepareTypeHierarchy_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TypeHierarchyPrepareParams); + + overriding procedure On_RangeFormatting_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentRangeFormattingParams); + + overriding procedure On_References_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ReferenceParams); + + overriding procedure On_Rename_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.RenameParams); + + overriding procedure On_SelectionRange_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SelectionRangeParams); + + overriding procedure On_Full_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SemanticTokensParams); + + overriding procedure On_Tokens_Delta_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SemanticTokensDeltaParams); + + overriding procedure On_Tokens_Range_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SemanticTokensRangeParams); + + overriding procedure On_SignatureHelp_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SignatureHelpParams); + + overriding procedure On_TypeDefinition_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TypeDefinitionParams); + + overriding procedure On_WillSaveWaitUntil_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WillSaveTextDocumentParams); + + overriding procedure On_Subtypes_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TypeHierarchySubtypesParams); + + overriding procedure On_Supertypes_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TypeHierarchySupertypesParams); + + overriding procedure On_Workspace_Diagnostic_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceDiagnosticParams); + + overriding procedure On_ExecuteCommand_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ExecuteCommandParams); + + overriding procedure On_Symbol_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceSymbolParams); + + overriding procedure On_WillCreateFiles_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CreateFilesParams); + + overriding procedure On_WillDeleteFiles_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DeleteFilesParams); + + overriding procedure On_WillRenameFiles_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.RenameFilesParams); + + overriding procedure On_Symbol_Resolve_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceSymbol); + +end LSP.Server_Request_Writers; diff --git a/source/lsp_3.17/generated/lsp-server_requests-code_action_resolve.adb b/source/lsp_3.17/generated/lsp-server_requests-code_action_resolve.adb new file mode 100644 index 000000000..90e24680f --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-code_action_resolve.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Requests.Code_Action_Resolve is + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class) is + begin + Value.On_Code_Action_Resolve_Request (Self.Id, Self.Params); + end Visit_Server_Receiver; + +end LSP.Server_Requests.Code_Action_Resolve; diff --git a/source/lsp_3.17/generated/lsp-server_requests-code_action_resolve.ads b/source/lsp_3.17/generated/lsp-server_requests-code_action_resolve.ads new file mode 100644 index 000000000..afa38d751 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-code_action_resolve.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Requests.Code_Action_Resolve is + pragma Preelaborate; + + type Request is new LSP.Server_Requests.Server_Request with record + Params : LSP.Structures.CodeAction; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class); + +end LSP.Server_Requests.Code_Action_Resolve; diff --git a/source/lsp_3.17/generated/lsp-server_requests-code_lens_resolve.adb b/source/lsp_3.17/generated/lsp-server_requests-code_lens_resolve.adb new file mode 100644 index 000000000..5084e6d50 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-code_lens_resolve.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Requests.Code_Lens_Resolve is + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class) is + begin + Value.On_Code_Lens_Resolve_Request (Self.Id, Self.Params); + end Visit_Server_Receiver; + +end LSP.Server_Requests.Code_Lens_Resolve; diff --git a/source/lsp_3.17/generated/lsp-server_requests-code_lens_resolve.ads b/source/lsp_3.17/generated/lsp-server_requests-code_lens_resolve.ads new file mode 100644 index 000000000..c1161d864 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-code_lens_resolve.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Requests.Code_Lens_Resolve is + pragma Preelaborate; + + type Request is new LSP.Server_Requests.Server_Request with record + Params : LSP.Structures.CodeLens; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class); + +end LSP.Server_Requests.Code_Lens_Resolve; diff --git a/source/lsp_3.17/generated/lsp-server_requests-codeaction.adb b/source/lsp_3.17/generated/lsp-server_requests-codeaction.adb new file mode 100644 index 000000000..ada50cfdd --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-codeaction.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Requests.CodeAction is + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class) is + begin + Value.On_CodeAction_Request (Self.Id, Self.Params); + end Visit_Server_Receiver; + +end LSP.Server_Requests.CodeAction; diff --git a/source/lsp_3.17/generated/lsp-server_requests-codeaction.ads b/source/lsp_3.17/generated/lsp-server_requests-codeaction.ads new file mode 100644 index 000000000..e0d52cc5a --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-codeaction.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Requests.CodeAction is + pragma Preelaborate; + + type Request is new LSP.Server_Requests.Server_Request with record + Params : LSP.Structures.CodeActionParams; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class); + +end LSP.Server_Requests.CodeAction; diff --git a/source/lsp_3.17/generated/lsp-server_requests-codelens.adb b/source/lsp_3.17/generated/lsp-server_requests-codelens.adb new file mode 100644 index 000000000..218dff411 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-codelens.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Requests.CodeLens is + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class) is + begin + Value.On_CodeLens_Request (Self.Id, Self.Params); + end Visit_Server_Receiver; + +end LSP.Server_Requests.CodeLens; diff --git a/source/lsp_3.17/generated/lsp-server_requests-codelens.ads b/source/lsp_3.17/generated/lsp-server_requests-codelens.ads new file mode 100644 index 000000000..0e7bae335 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-codelens.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Requests.CodeLens is + pragma Preelaborate; + + type Request is new LSP.Server_Requests.Server_Request with record + Params : LSP.Structures.CodeLensParams; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class); + +end LSP.Server_Requests.CodeLens; diff --git a/source/lsp_3.17/generated/lsp-server_requests-colorpresentation.adb b/source/lsp_3.17/generated/lsp-server_requests-colorpresentation.adb new file mode 100644 index 000000000..e167c354b --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-colorpresentation.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Requests.ColorPresentation is + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class) is + begin + Value.On_ColorPresentation_Request (Self.Id, Self.Params); + end Visit_Server_Receiver; + +end LSP.Server_Requests.ColorPresentation; diff --git a/source/lsp_3.17/generated/lsp-server_requests-colorpresentation.ads b/source/lsp_3.17/generated/lsp-server_requests-colorpresentation.ads new file mode 100644 index 000000000..2792fdbef --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-colorpresentation.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Requests.ColorPresentation is + pragma Preelaborate; + + type Request is new LSP.Server_Requests.Server_Request with record + Params : LSP.Structures.ColorPresentationParams; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class); + +end LSP.Server_Requests.ColorPresentation; diff --git a/source/lsp_3.17/generated/lsp-server_requests-completion.adb b/source/lsp_3.17/generated/lsp-server_requests-completion.adb new file mode 100644 index 000000000..8823648a4 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-completion.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Requests.Completion is + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class) is + begin + Value.On_Completion_Request (Self.Id, Self.Params); + end Visit_Server_Receiver; + +end LSP.Server_Requests.Completion; diff --git a/source/lsp_3.17/generated/lsp-server_requests-completion.ads b/source/lsp_3.17/generated/lsp-server_requests-completion.ads new file mode 100644 index 000000000..480f3b558 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-completion.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Requests.Completion is + pragma Preelaborate; + + type Request is new LSP.Server_Requests.Server_Request with record + Params : LSP.Structures.CompletionParams; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class); + +end LSP.Server_Requests.Completion; diff --git a/source/lsp_3.17/generated/lsp-server_requests-completion_resolve.adb b/source/lsp_3.17/generated/lsp-server_requests-completion_resolve.adb new file mode 100644 index 000000000..7bb796a3a --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-completion_resolve.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Requests.Completion_Resolve is + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class) is + begin + Value.On_Completion_Resolve_Request (Self.Id, Self.Params); + end Visit_Server_Receiver; + +end LSP.Server_Requests.Completion_Resolve; diff --git a/source/lsp_3.17/generated/lsp-server_requests-completion_resolve.ads b/source/lsp_3.17/generated/lsp-server_requests-completion_resolve.ads new file mode 100644 index 000000000..573655217 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-completion_resolve.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Requests.Completion_Resolve is + pragma Preelaborate; + + type Request is new LSP.Server_Requests.Server_Request with record + Params : LSP.Structures.CompletionItem; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class); + +end LSP.Server_Requests.Completion_Resolve; diff --git a/source/lsp_3.17/generated/lsp-server_requests-declaration.adb b/source/lsp_3.17/generated/lsp-server_requests-declaration.adb new file mode 100644 index 000000000..1ddfc2834 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-declaration.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Requests.Declaration is + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class) is + begin + Value.On_Declaration_Request (Self.Id, Self.Params); + end Visit_Server_Receiver; + +end LSP.Server_Requests.Declaration; diff --git a/source/lsp_3.17/generated/lsp-server_requests-declaration.ads b/source/lsp_3.17/generated/lsp-server_requests-declaration.ads new file mode 100644 index 000000000..cf4c2133a --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-declaration.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Requests.Declaration is + pragma Preelaborate; + + type Request is new LSP.Server_Requests.Server_Request with record + Params : LSP.Structures.DeclarationParams; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class); + +end LSP.Server_Requests.Declaration; diff --git a/source/lsp_3.17/generated/lsp-server_requests-definition.adb b/source/lsp_3.17/generated/lsp-server_requests-definition.adb new file mode 100644 index 000000000..2b32cc05b --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-definition.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Requests.Definition is + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class) is + begin + Value.On_Definition_Request (Self.Id, Self.Params); + end Visit_Server_Receiver; + +end LSP.Server_Requests.Definition; diff --git a/source/lsp_3.17/generated/lsp-server_requests-definition.ads b/source/lsp_3.17/generated/lsp-server_requests-definition.ads new file mode 100644 index 000000000..cc392d76b --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-definition.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Requests.Definition is + pragma Preelaborate; + + type Request is new LSP.Server_Requests.Server_Request with record + Params : LSP.Structures.DefinitionParams; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class); + +end LSP.Server_Requests.Definition; diff --git a/source/lsp_3.17/generated/lsp-server_requests-diagnostic.adb b/source/lsp_3.17/generated/lsp-server_requests-diagnostic.adb new file mode 100644 index 000000000..8e7a5e82e --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-diagnostic.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Requests.Diagnostic is + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class) is + begin + Value.On_Diagnostic_Request (Self.Id, Self.Params); + end Visit_Server_Receiver; + +end LSP.Server_Requests.Diagnostic; diff --git a/source/lsp_3.17/generated/lsp-server_requests-diagnostic.ads b/source/lsp_3.17/generated/lsp-server_requests-diagnostic.ads new file mode 100644 index 000000000..e79abbb3a --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-diagnostic.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Requests.Diagnostic is + pragma Preelaborate; + + type Request is new LSP.Server_Requests.Server_Request with record + Params : LSP.Structures.DocumentDiagnosticParams; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class); + +end LSP.Server_Requests.Diagnostic; diff --git a/source/lsp_3.17/generated/lsp-server_requests-documentcolor.adb b/source/lsp_3.17/generated/lsp-server_requests-documentcolor.adb new file mode 100644 index 000000000..12d97ce37 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-documentcolor.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Requests.DocumentColor is + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class) is + begin + Value.On_DocumentColor_Request (Self.Id, Self.Params); + end Visit_Server_Receiver; + +end LSP.Server_Requests.DocumentColor; diff --git a/source/lsp_3.17/generated/lsp-server_requests-documentcolor.ads b/source/lsp_3.17/generated/lsp-server_requests-documentcolor.ads new file mode 100644 index 000000000..5ae57cda3 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-documentcolor.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Requests.DocumentColor is + pragma Preelaborate; + + type Request is new LSP.Server_Requests.Server_Request with record + Params : LSP.Structures.DocumentColorParams; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class); + +end LSP.Server_Requests.DocumentColor; diff --git a/source/lsp_3.17/generated/lsp-server_requests-documenthighlight.adb b/source/lsp_3.17/generated/lsp-server_requests-documenthighlight.adb new file mode 100644 index 000000000..dbf4d237a --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-documenthighlight.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Requests.DocumentHighlight is + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class) is + begin + Value.On_DocumentHighlight_Request (Self.Id, Self.Params); + end Visit_Server_Receiver; + +end LSP.Server_Requests.DocumentHighlight; diff --git a/source/lsp_3.17/generated/lsp-server_requests-documenthighlight.ads b/source/lsp_3.17/generated/lsp-server_requests-documenthighlight.ads new file mode 100644 index 000000000..07d6233a8 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-documenthighlight.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Requests.DocumentHighlight is + pragma Preelaborate; + + type Request is new LSP.Server_Requests.Server_Request with record + Params : LSP.Structures.DocumentHighlightParams; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class); + +end LSP.Server_Requests.DocumentHighlight; diff --git a/source/lsp_3.17/generated/lsp-server_requests-documentlink.adb b/source/lsp_3.17/generated/lsp-server_requests-documentlink.adb new file mode 100644 index 000000000..c6baf0408 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-documentlink.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Requests.DocumentLink is + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class) is + begin + Value.On_DocumentLink_Request (Self.Id, Self.Params); + end Visit_Server_Receiver; + +end LSP.Server_Requests.DocumentLink; diff --git a/source/lsp_3.17/generated/lsp-server_requests-documentlink.ads b/source/lsp_3.17/generated/lsp-server_requests-documentlink.ads new file mode 100644 index 000000000..d37f95c72 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-documentlink.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Requests.DocumentLink is + pragma Preelaborate; + + type Request is new LSP.Server_Requests.Server_Request with record + Params : LSP.Structures.DocumentLinkParams; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class); + +end LSP.Server_Requests.DocumentLink; diff --git a/source/lsp_3.17/generated/lsp-server_requests-documentsymbol.adb b/source/lsp_3.17/generated/lsp-server_requests-documentsymbol.adb new file mode 100644 index 000000000..0e046c245 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-documentsymbol.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Requests.DocumentSymbol is + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class) is + begin + Value.On_DocumentSymbol_Request (Self.Id, Self.Params); + end Visit_Server_Receiver; + +end LSP.Server_Requests.DocumentSymbol; diff --git a/source/lsp_3.17/generated/lsp-server_requests-documentsymbol.ads b/source/lsp_3.17/generated/lsp-server_requests-documentsymbol.ads new file mode 100644 index 000000000..c5bbfe9aa --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-documentsymbol.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Requests.DocumentSymbol is + pragma Preelaborate; + + type Request is new LSP.Server_Requests.Server_Request with record + Params : LSP.Structures.DocumentSymbolParams; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class); + +end LSP.Server_Requests.DocumentSymbol; diff --git a/source/lsp_3.17/generated/lsp-server_requests-executecommand.adb b/source/lsp_3.17/generated/lsp-server_requests-executecommand.adb new file mode 100644 index 000000000..89e4e4ea9 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-executecommand.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Requests.ExecuteCommand is + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class) is + begin + Value.On_ExecuteCommand_Request (Self.Id, Self.Params); + end Visit_Server_Receiver; + +end LSP.Server_Requests.ExecuteCommand; diff --git a/source/lsp_3.17/generated/lsp-server_requests-executecommand.ads b/source/lsp_3.17/generated/lsp-server_requests-executecommand.ads new file mode 100644 index 000000000..a7afe999c --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-executecommand.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Requests.ExecuteCommand is + pragma Preelaborate; + + type Request is new LSP.Server_Requests.Server_Request with record + Params : LSP.Structures.ExecuteCommandParams; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class); + +end LSP.Server_Requests.ExecuteCommand; diff --git a/source/lsp_3.17/generated/lsp-server_requests-foldingrange.adb b/source/lsp_3.17/generated/lsp-server_requests-foldingrange.adb new file mode 100644 index 000000000..2e694519c --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-foldingrange.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Requests.FoldingRange is + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class) is + begin + Value.On_FoldingRange_Request (Self.Id, Self.Params); + end Visit_Server_Receiver; + +end LSP.Server_Requests.FoldingRange; diff --git a/source/lsp_3.17/generated/lsp-server_requests-foldingrange.ads b/source/lsp_3.17/generated/lsp-server_requests-foldingrange.ads new file mode 100644 index 000000000..82a186158 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-foldingrange.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Requests.FoldingRange is + pragma Preelaborate; + + type Request is new LSP.Server_Requests.Server_Request with record + Params : LSP.Structures.FoldingRangeParams; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class); + +end LSP.Server_Requests.FoldingRange; diff --git a/source/lsp_3.17/generated/lsp-server_requests-formatting.adb b/source/lsp_3.17/generated/lsp-server_requests-formatting.adb new file mode 100644 index 000000000..2bb2bbd3b --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-formatting.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Requests.Formatting is + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class) is + begin + Value.On_Formatting_Request (Self.Id, Self.Params); + end Visit_Server_Receiver; + +end LSP.Server_Requests.Formatting; diff --git a/source/lsp_3.17/generated/lsp-server_requests-formatting.ads b/source/lsp_3.17/generated/lsp-server_requests-formatting.ads new file mode 100644 index 000000000..76f41f6fc --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-formatting.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Requests.Formatting is + pragma Preelaborate; + + type Request is new LSP.Server_Requests.Server_Request with record + Params : LSP.Structures.DocumentFormattingParams; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class); + +end LSP.Server_Requests.Formatting; diff --git a/source/lsp_3.17/generated/lsp-server_requests-full.adb b/source/lsp_3.17/generated/lsp-server_requests-full.adb new file mode 100644 index 000000000..4681dbdc3 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-full.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Requests.Full is + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class) is + begin + Value.On_Full_Request (Self.Id, Self.Params); + end Visit_Server_Receiver; + +end LSP.Server_Requests.Full; diff --git a/source/lsp_3.17/generated/lsp-server_requests-full.ads b/source/lsp_3.17/generated/lsp-server_requests-full.ads new file mode 100644 index 000000000..a156b6049 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-full.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Requests.Full is + pragma Preelaborate; + + type Request is new LSP.Server_Requests.Server_Request with record + Params : LSP.Structures.SemanticTokensParams; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class); + +end LSP.Server_Requests.Full; diff --git a/source/lsp_3.17/generated/lsp-server_requests-hover.adb b/source/lsp_3.17/generated/lsp-server_requests-hover.adb new file mode 100644 index 000000000..4ccde0ebe --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-hover.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Requests.Hover is + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class) is + begin + Value.On_Hover_Request (Self.Id, Self.Params); + end Visit_Server_Receiver; + +end LSP.Server_Requests.Hover; diff --git a/source/lsp_3.17/generated/lsp-server_requests-hover.ads b/source/lsp_3.17/generated/lsp-server_requests-hover.ads new file mode 100644 index 000000000..bf63b6e01 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-hover.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Requests.Hover is + pragma Preelaborate; + + type Request is new LSP.Server_Requests.Server_Request with record + Params : LSP.Structures.HoverParams; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class); + +end LSP.Server_Requests.Hover; diff --git a/source/lsp_3.17/generated/lsp-server_requests-implementation.adb b/source/lsp_3.17/generated/lsp-server_requests-implementation.adb new file mode 100644 index 000000000..d84bf4611 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-implementation.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Requests.Implementation is + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class) is + begin + Value.On_Implementation_Request (Self.Id, Self.Params); + end Visit_Server_Receiver; + +end LSP.Server_Requests.Implementation; diff --git a/source/lsp_3.17/generated/lsp-server_requests-implementation.ads b/source/lsp_3.17/generated/lsp-server_requests-implementation.ads new file mode 100644 index 000000000..10cacb336 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-implementation.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Requests.Implementation is + pragma Preelaborate; + + type Request is new LSP.Server_Requests.Server_Request with record + Params : LSP.Structures.ImplementationParams; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class); + +end LSP.Server_Requests.Implementation; diff --git a/source/lsp_3.17/generated/lsp-server_requests-incomingcalls.adb b/source/lsp_3.17/generated/lsp-server_requests-incomingcalls.adb new file mode 100644 index 000000000..834727d9e --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-incomingcalls.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Requests.IncomingCalls is + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class) is + begin + Value.On_IncomingCalls_Request (Self.Id, Self.Params); + end Visit_Server_Receiver; + +end LSP.Server_Requests.IncomingCalls; diff --git a/source/lsp_3.17/generated/lsp-server_requests-incomingcalls.ads b/source/lsp_3.17/generated/lsp-server_requests-incomingcalls.ads new file mode 100644 index 000000000..f52cc7661 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-incomingcalls.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Requests.IncomingCalls is + pragma Preelaborate; + + type Request is new LSP.Server_Requests.Server_Request with record + Params : LSP.Structures.CallHierarchyIncomingCallsParams; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class); + +end LSP.Server_Requests.IncomingCalls; diff --git a/source/lsp_3.17/generated/lsp-server_requests-initialize.adb b/source/lsp_3.17/generated/lsp-server_requests-initialize.adb new file mode 100644 index 000000000..50d159962 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-initialize.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Requests.Initialize is + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class) is + begin + Value.On_Initialize_Request (Self.Id, Self.Params); + end Visit_Server_Receiver; + +end LSP.Server_Requests.Initialize; diff --git a/source/lsp_3.17/generated/lsp-server_requests-initialize.ads b/source/lsp_3.17/generated/lsp-server_requests-initialize.ads new file mode 100644 index 000000000..c2f245055 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-initialize.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Requests.Initialize is + pragma Preelaborate; + + type Request is new LSP.Server_Requests.Server_Request with record + Params : LSP.Structures.InitializeParams; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class); + +end LSP.Server_Requests.Initialize; diff --git a/source/lsp_3.17/generated/lsp-server_requests-inlay_resolve.adb b/source/lsp_3.17/generated/lsp-server_requests-inlay_resolve.adb new file mode 100644 index 000000000..e7eae43a4 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-inlay_resolve.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Requests.Inlay_Resolve is + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class) is + begin + Value.On_Inlay_Resolve_Request (Self.Id, Self.Params); + end Visit_Server_Receiver; + +end LSP.Server_Requests.Inlay_Resolve; diff --git a/source/lsp_3.17/generated/lsp-server_requests-inlay_resolve.ads b/source/lsp_3.17/generated/lsp-server_requests-inlay_resolve.ads new file mode 100644 index 000000000..9245c3edf --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-inlay_resolve.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Requests.Inlay_Resolve is + pragma Preelaborate; + + type Request is new LSP.Server_Requests.Server_Request with record + Params : LSP.Structures.InlayHint; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class); + +end LSP.Server_Requests.Inlay_Resolve; diff --git a/source/lsp_3.17/generated/lsp-server_requests-inlayhint.adb b/source/lsp_3.17/generated/lsp-server_requests-inlayhint.adb new file mode 100644 index 000000000..4a552727d --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-inlayhint.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Requests.InlayHint is + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class) is + begin + Value.On_InlayHint_Request (Self.Id, Self.Params); + end Visit_Server_Receiver; + +end LSP.Server_Requests.InlayHint; diff --git a/source/lsp_3.17/generated/lsp-server_requests-inlayhint.ads b/source/lsp_3.17/generated/lsp-server_requests-inlayhint.ads new file mode 100644 index 000000000..7d97b2b90 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-inlayhint.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Requests.InlayHint is + pragma Preelaborate; + + type Request is new LSP.Server_Requests.Server_Request with record + Params : LSP.Structures.InlayHintParams; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class); + +end LSP.Server_Requests.InlayHint; diff --git a/source/lsp_3.17/generated/lsp-server_requests-inlinevalue.adb b/source/lsp_3.17/generated/lsp-server_requests-inlinevalue.adb new file mode 100644 index 000000000..acd785c6c --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-inlinevalue.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Requests.InlineValue is + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class) is + begin + Value.On_InlineValue_Request (Self.Id, Self.Params); + end Visit_Server_Receiver; + +end LSP.Server_Requests.InlineValue; diff --git a/source/lsp_3.17/generated/lsp-server_requests-inlinevalue.ads b/source/lsp_3.17/generated/lsp-server_requests-inlinevalue.ads new file mode 100644 index 000000000..c5091e0c5 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-inlinevalue.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Requests.InlineValue is + pragma Preelaborate; + + type Request is new LSP.Server_Requests.Server_Request with record + Params : LSP.Structures.InlineValueParams; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class); + +end LSP.Server_Requests.InlineValue; diff --git a/source/lsp_3.17/generated/lsp-server_requests-link_resolve.adb b/source/lsp_3.17/generated/lsp-server_requests-link_resolve.adb new file mode 100644 index 000000000..8988d656f --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-link_resolve.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Requests.Link_Resolve is + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class) is + begin + Value.On_Link_Resolve_Request (Self.Id, Self.Params); + end Visit_Server_Receiver; + +end LSP.Server_Requests.Link_Resolve; diff --git a/source/lsp_3.17/generated/lsp-server_requests-link_resolve.ads b/source/lsp_3.17/generated/lsp-server_requests-link_resolve.ads new file mode 100644 index 000000000..3e42b2b9a --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-link_resolve.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Requests.Link_Resolve is + pragma Preelaborate; + + type Request is new LSP.Server_Requests.Server_Request with record + Params : LSP.Structures.DocumentLink; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class); + +end LSP.Server_Requests.Link_Resolve; diff --git a/source/lsp_3.17/generated/lsp-server_requests-linkededitingrange.adb b/source/lsp_3.17/generated/lsp-server_requests-linkededitingrange.adb new file mode 100644 index 000000000..10328fdc3 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-linkededitingrange.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Requests.LinkedEditingRange is + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class) is + begin + Value.On_LinkedEditingRange_Request (Self.Id, Self.Params); + end Visit_Server_Receiver; + +end LSP.Server_Requests.LinkedEditingRange; diff --git a/source/lsp_3.17/generated/lsp-server_requests-linkededitingrange.ads b/source/lsp_3.17/generated/lsp-server_requests-linkededitingrange.ads new file mode 100644 index 000000000..ef3a994cd --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-linkededitingrange.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Requests.LinkedEditingRange is + pragma Preelaborate; + + type Request is new LSP.Server_Requests.Server_Request with record + Params : LSP.Structures.LinkedEditingRangeParams; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class); + +end LSP.Server_Requests.LinkedEditingRange; diff --git a/source/lsp_3.17/generated/lsp-server_requests-moniker.adb b/source/lsp_3.17/generated/lsp-server_requests-moniker.adb new file mode 100644 index 000000000..661bd891c --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-moniker.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Requests.Moniker is + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class) is + begin + Value.On_Moniker_Request (Self.Id, Self.Params); + end Visit_Server_Receiver; + +end LSP.Server_Requests.Moniker; diff --git a/source/lsp_3.17/generated/lsp-server_requests-moniker.ads b/source/lsp_3.17/generated/lsp-server_requests-moniker.ads new file mode 100644 index 000000000..7521e2a38 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-moniker.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Requests.Moniker is + pragma Preelaborate; + + type Request is new LSP.Server_Requests.Server_Request with record + Params : LSP.Structures.MonikerParams; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class); + +end LSP.Server_Requests.Moniker; diff --git a/source/lsp_3.17/generated/lsp-server_requests-ontypeformatting.adb b/source/lsp_3.17/generated/lsp-server_requests-ontypeformatting.adb new file mode 100644 index 000000000..99fd91e5b --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-ontypeformatting.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Requests.OnTypeFormatting is + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class) is + begin + Value.On_OnTypeFormatting_Request (Self.Id, Self.Params); + end Visit_Server_Receiver; + +end LSP.Server_Requests.OnTypeFormatting; diff --git a/source/lsp_3.17/generated/lsp-server_requests-ontypeformatting.ads b/source/lsp_3.17/generated/lsp-server_requests-ontypeformatting.ads new file mode 100644 index 000000000..90a7f6af7 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-ontypeformatting.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Requests.OnTypeFormatting is + pragma Preelaborate; + + type Request is new LSP.Server_Requests.Server_Request with record + Params : LSP.Structures.DocumentOnTypeFormattingParams; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class); + +end LSP.Server_Requests.OnTypeFormatting; diff --git a/source/lsp_3.17/generated/lsp-server_requests-outgoingcalls.adb b/source/lsp_3.17/generated/lsp-server_requests-outgoingcalls.adb new file mode 100644 index 000000000..67024881b --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-outgoingcalls.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Requests.OutgoingCalls is + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class) is + begin + Value.On_OutgoingCalls_Request (Self.Id, Self.Params); + end Visit_Server_Receiver; + +end LSP.Server_Requests.OutgoingCalls; diff --git a/source/lsp_3.17/generated/lsp-server_requests-outgoingcalls.ads b/source/lsp_3.17/generated/lsp-server_requests-outgoingcalls.ads new file mode 100644 index 000000000..b0be0d8b9 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-outgoingcalls.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Requests.OutgoingCalls is + pragma Preelaborate; + + type Request is new LSP.Server_Requests.Server_Request with record + Params : LSP.Structures.CallHierarchyOutgoingCallsParams; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class); + +end LSP.Server_Requests.OutgoingCalls; diff --git a/source/lsp_3.17/generated/lsp-server_requests-preparecallhierarchy.adb b/source/lsp_3.17/generated/lsp-server_requests-preparecallhierarchy.adb new file mode 100644 index 000000000..7a36ee24f --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-preparecallhierarchy.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Requests.PrepareCallHierarchy is + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class) is + begin + Value.On_PrepareCallHierarchy_Request (Self.Id, Self.Params); + end Visit_Server_Receiver; + +end LSP.Server_Requests.PrepareCallHierarchy; diff --git a/source/lsp_3.17/generated/lsp-server_requests-preparecallhierarchy.ads b/source/lsp_3.17/generated/lsp-server_requests-preparecallhierarchy.ads new file mode 100644 index 000000000..b366d7449 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-preparecallhierarchy.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Requests.PrepareCallHierarchy is + pragma Preelaborate; + + type Request is new LSP.Server_Requests.Server_Request with record + Params : LSP.Structures.CallHierarchyPrepareParams; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class); + +end LSP.Server_Requests.PrepareCallHierarchy; diff --git a/source/lsp_3.17/generated/lsp-server_requests-preparerename.adb b/source/lsp_3.17/generated/lsp-server_requests-preparerename.adb new file mode 100644 index 000000000..da6afaa97 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-preparerename.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Requests.PrepareRename is + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class) is + begin + Value.On_PrepareRename_Request (Self.Id, Self.Params); + end Visit_Server_Receiver; + +end LSP.Server_Requests.PrepareRename; diff --git a/source/lsp_3.17/generated/lsp-server_requests-preparerename.ads b/source/lsp_3.17/generated/lsp-server_requests-preparerename.ads new file mode 100644 index 000000000..05aab8243 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-preparerename.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Requests.PrepareRename is + pragma Preelaborate; + + type Request is new LSP.Server_Requests.Server_Request with record + Params : LSP.Structures.PrepareRenameParams; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class); + +end LSP.Server_Requests.PrepareRename; diff --git a/source/lsp_3.17/generated/lsp-server_requests-preparetypehierarchy.adb b/source/lsp_3.17/generated/lsp-server_requests-preparetypehierarchy.adb new file mode 100644 index 000000000..be317b5cc --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-preparetypehierarchy.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Requests.PrepareTypeHierarchy is + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class) is + begin + Value.On_PrepareTypeHierarchy_Request (Self.Id, Self.Params); + end Visit_Server_Receiver; + +end LSP.Server_Requests.PrepareTypeHierarchy; diff --git a/source/lsp_3.17/generated/lsp-server_requests-preparetypehierarchy.ads b/source/lsp_3.17/generated/lsp-server_requests-preparetypehierarchy.ads new file mode 100644 index 000000000..263370245 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-preparetypehierarchy.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Requests.PrepareTypeHierarchy is + pragma Preelaborate; + + type Request is new LSP.Server_Requests.Server_Request with record + Params : LSP.Structures.TypeHierarchyPrepareParams; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class); + +end LSP.Server_Requests.PrepareTypeHierarchy; diff --git a/source/lsp_3.17/generated/lsp-server_requests-rangeformatting.adb b/source/lsp_3.17/generated/lsp-server_requests-rangeformatting.adb new file mode 100644 index 000000000..3c295545e --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-rangeformatting.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Requests.RangeFormatting is + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class) is + begin + Value.On_RangeFormatting_Request (Self.Id, Self.Params); + end Visit_Server_Receiver; + +end LSP.Server_Requests.RangeFormatting; diff --git a/source/lsp_3.17/generated/lsp-server_requests-rangeformatting.ads b/source/lsp_3.17/generated/lsp-server_requests-rangeformatting.ads new file mode 100644 index 000000000..534776d33 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-rangeformatting.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Requests.RangeFormatting is + pragma Preelaborate; + + type Request is new LSP.Server_Requests.Server_Request with record + Params : LSP.Structures.DocumentRangeFormattingParams; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class); + +end LSP.Server_Requests.RangeFormatting; diff --git a/source/lsp_3.17/generated/lsp-server_requests-references.adb b/source/lsp_3.17/generated/lsp-server_requests-references.adb new file mode 100644 index 000000000..bebb95712 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-references.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Requests.References is + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class) is + begin + Value.On_References_Request (Self.Id, Self.Params); + end Visit_Server_Receiver; + +end LSP.Server_Requests.References; diff --git a/source/lsp_3.17/generated/lsp-server_requests-references.ads b/source/lsp_3.17/generated/lsp-server_requests-references.ads new file mode 100644 index 000000000..33be4802b --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-references.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Requests.References is + pragma Preelaborate; + + type Request is new LSP.Server_Requests.Server_Request with record + Params : LSP.Structures.ReferenceParams; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class); + +end LSP.Server_Requests.References; diff --git a/source/lsp_3.17/generated/lsp-server_requests-rename.adb b/source/lsp_3.17/generated/lsp-server_requests-rename.adb new file mode 100644 index 000000000..4bccb0996 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-rename.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Requests.Rename is + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class) is + begin + Value.On_Rename_Request (Self.Id, Self.Params); + end Visit_Server_Receiver; + +end LSP.Server_Requests.Rename; diff --git a/source/lsp_3.17/generated/lsp-server_requests-rename.ads b/source/lsp_3.17/generated/lsp-server_requests-rename.ads new file mode 100644 index 000000000..87e261be1 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-rename.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Requests.Rename is + pragma Preelaborate; + + type Request is new LSP.Server_Requests.Server_Request with record + Params : LSP.Structures.RenameParams; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class); + +end LSP.Server_Requests.Rename; diff --git a/source/lsp_3.17/generated/lsp-server_requests-selectionrange.adb b/source/lsp_3.17/generated/lsp-server_requests-selectionrange.adb new file mode 100644 index 000000000..94c91dc6b --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-selectionrange.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Requests.SelectionRange is + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class) is + begin + Value.On_SelectionRange_Request (Self.Id, Self.Params); + end Visit_Server_Receiver; + +end LSP.Server_Requests.SelectionRange; diff --git a/source/lsp_3.17/generated/lsp-server_requests-selectionrange.ads b/source/lsp_3.17/generated/lsp-server_requests-selectionrange.ads new file mode 100644 index 000000000..21ebbbd81 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-selectionrange.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Requests.SelectionRange is + pragma Preelaborate; + + type Request is new LSP.Server_Requests.Server_Request with record + Params : LSP.Structures.SelectionRangeParams; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class); + +end LSP.Server_Requests.SelectionRange; diff --git a/source/lsp_3.17/generated/lsp-server_requests-shutdown.adb b/source/lsp_3.17/generated/lsp-server_requests-shutdown.adb new file mode 100644 index 000000000..ae064350a --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-shutdown.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Requests.Shutdown is + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class) is + begin + Value.On_Shutdown_Request (Self.Id); + end Visit_Server_Receiver; + +end LSP.Server_Requests.Shutdown; diff --git a/source/lsp_3.17/generated/lsp-server_requests-shutdown.ads b/source/lsp_3.17/generated/lsp-server_requests-shutdown.ads new file mode 100644 index 000000000..412009ab5 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-shutdown.ads @@ -0,0 +1,19 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package LSP.Server_Requests.Shutdown is + pragma Preelaborate; + + type Request is new LSP.Server_Requests.Server_Request with record + null; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class); + +end LSP.Server_Requests.Shutdown; diff --git a/source/lsp_3.17/generated/lsp-server_requests-signaturehelp.adb b/source/lsp_3.17/generated/lsp-server_requests-signaturehelp.adb new file mode 100644 index 000000000..727f5d537 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-signaturehelp.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Requests.SignatureHelp is + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class) is + begin + Value.On_SignatureHelp_Request (Self.Id, Self.Params); + end Visit_Server_Receiver; + +end LSP.Server_Requests.SignatureHelp; diff --git a/source/lsp_3.17/generated/lsp-server_requests-signaturehelp.ads b/source/lsp_3.17/generated/lsp-server_requests-signaturehelp.ads new file mode 100644 index 000000000..e5dd80920 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-signaturehelp.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Requests.SignatureHelp is + pragma Preelaborate; + + type Request is new LSP.Server_Requests.Server_Request with record + Params : LSP.Structures.SignatureHelpParams; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class); + +end LSP.Server_Requests.SignatureHelp; diff --git a/source/lsp_3.17/generated/lsp-server_requests-subtypes.adb b/source/lsp_3.17/generated/lsp-server_requests-subtypes.adb new file mode 100644 index 000000000..513329e6c --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-subtypes.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Requests.Subtypes is + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class) is + begin + Value.On_Subtypes_Request (Self.Id, Self.Params); + end Visit_Server_Receiver; + +end LSP.Server_Requests.Subtypes; diff --git a/source/lsp_3.17/generated/lsp-server_requests-subtypes.ads b/source/lsp_3.17/generated/lsp-server_requests-subtypes.ads new file mode 100644 index 000000000..39a9a70eb --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-subtypes.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Requests.Subtypes is + pragma Preelaborate; + + type Request is new LSP.Server_Requests.Server_Request with record + Params : LSP.Structures.TypeHierarchySubtypesParams; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class); + +end LSP.Server_Requests.Subtypes; diff --git a/source/lsp_3.17/generated/lsp-server_requests-supertypes.adb b/source/lsp_3.17/generated/lsp-server_requests-supertypes.adb new file mode 100644 index 000000000..6264649f1 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-supertypes.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Requests.Supertypes is + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class) is + begin + Value.On_Supertypes_Request (Self.Id, Self.Params); + end Visit_Server_Receiver; + +end LSP.Server_Requests.Supertypes; diff --git a/source/lsp_3.17/generated/lsp-server_requests-supertypes.ads b/source/lsp_3.17/generated/lsp-server_requests-supertypes.ads new file mode 100644 index 000000000..b22d59ca8 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-supertypes.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Requests.Supertypes is + pragma Preelaborate; + + type Request is new LSP.Server_Requests.Server_Request with record + Params : LSP.Structures.TypeHierarchySupertypesParams; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class); + +end LSP.Server_Requests.Supertypes; diff --git a/source/lsp_3.17/generated/lsp-server_requests-symbol.adb b/source/lsp_3.17/generated/lsp-server_requests-symbol.adb new file mode 100644 index 000000000..04faefeaf --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-symbol.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Requests.Symbol is + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class) is + begin + Value.On_Symbol_Request (Self.Id, Self.Params); + end Visit_Server_Receiver; + +end LSP.Server_Requests.Symbol; diff --git a/source/lsp_3.17/generated/lsp-server_requests-symbol.ads b/source/lsp_3.17/generated/lsp-server_requests-symbol.ads new file mode 100644 index 000000000..073ec2349 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-symbol.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Requests.Symbol is + pragma Preelaborate; + + type Request is new LSP.Server_Requests.Server_Request with record + Params : LSP.Structures.WorkspaceSymbolParams; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class); + +end LSP.Server_Requests.Symbol; diff --git a/source/lsp_3.17/generated/lsp-server_requests-symbol_resolve.adb b/source/lsp_3.17/generated/lsp-server_requests-symbol_resolve.adb new file mode 100644 index 000000000..31fa3987f --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-symbol_resolve.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Requests.Symbol_Resolve is + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class) is + begin + Value.On_Symbol_Resolve_Request (Self.Id, Self.Params); + end Visit_Server_Receiver; + +end LSP.Server_Requests.Symbol_Resolve; diff --git a/source/lsp_3.17/generated/lsp-server_requests-symbol_resolve.ads b/source/lsp_3.17/generated/lsp-server_requests-symbol_resolve.ads new file mode 100644 index 000000000..e1aa3627a --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-symbol_resolve.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Requests.Symbol_Resolve is + pragma Preelaborate; + + type Request is new LSP.Server_Requests.Server_Request with record + Params : LSP.Structures.WorkspaceSymbol; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class); + +end LSP.Server_Requests.Symbol_Resolve; diff --git a/source/lsp_3.17/generated/lsp-server_requests-tokens_delta.adb b/source/lsp_3.17/generated/lsp-server_requests-tokens_delta.adb new file mode 100644 index 000000000..8703a1688 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-tokens_delta.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Requests.Tokens_Delta is + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class) is + begin + Value.On_Tokens_Delta_Request (Self.Id, Self.Params); + end Visit_Server_Receiver; + +end LSP.Server_Requests.Tokens_Delta; diff --git a/source/lsp_3.17/generated/lsp-server_requests-tokens_delta.ads b/source/lsp_3.17/generated/lsp-server_requests-tokens_delta.ads new file mode 100644 index 000000000..92683bc6a --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-tokens_delta.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Requests.Tokens_Delta is + pragma Preelaborate; + + type Request is new LSP.Server_Requests.Server_Request with record + Params : LSP.Structures.SemanticTokensDeltaParams; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class); + +end LSP.Server_Requests.Tokens_Delta; diff --git a/source/lsp_3.17/generated/lsp-server_requests-tokens_range.adb b/source/lsp_3.17/generated/lsp-server_requests-tokens_range.adb new file mode 100644 index 000000000..fe3e3dd54 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-tokens_range.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Requests.Tokens_Range is + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class) is + begin + Value.On_Tokens_Range_Request (Self.Id, Self.Params); + end Visit_Server_Receiver; + +end LSP.Server_Requests.Tokens_Range; diff --git a/source/lsp_3.17/generated/lsp-server_requests-tokens_range.ads b/source/lsp_3.17/generated/lsp-server_requests-tokens_range.ads new file mode 100644 index 000000000..3745ec8e0 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-tokens_range.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Requests.Tokens_Range is + pragma Preelaborate; + + type Request is new LSP.Server_Requests.Server_Request with record + Params : LSP.Structures.SemanticTokensRangeParams; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class); + +end LSP.Server_Requests.Tokens_Range; diff --git a/source/lsp_3.17/generated/lsp-server_requests-typedefinition.adb b/source/lsp_3.17/generated/lsp-server_requests-typedefinition.adb new file mode 100644 index 000000000..75262a401 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-typedefinition.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Requests.TypeDefinition is + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class) is + begin + Value.On_TypeDefinition_Request (Self.Id, Self.Params); + end Visit_Server_Receiver; + +end LSP.Server_Requests.TypeDefinition; diff --git a/source/lsp_3.17/generated/lsp-server_requests-typedefinition.ads b/source/lsp_3.17/generated/lsp-server_requests-typedefinition.ads new file mode 100644 index 000000000..f7576c7b4 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-typedefinition.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Requests.TypeDefinition is + pragma Preelaborate; + + type Request is new LSP.Server_Requests.Server_Request with record + Params : LSP.Structures.TypeDefinitionParams; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class); + +end LSP.Server_Requests.TypeDefinition; diff --git a/source/lsp_3.17/generated/lsp-server_requests-willcreatefiles.adb b/source/lsp_3.17/generated/lsp-server_requests-willcreatefiles.adb new file mode 100644 index 000000000..8b03a5a81 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-willcreatefiles.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Requests.WillCreateFiles is + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class) is + begin + Value.On_WillCreateFiles_Request (Self.Id, Self.Params); + end Visit_Server_Receiver; + +end LSP.Server_Requests.WillCreateFiles; diff --git a/source/lsp_3.17/generated/lsp-server_requests-willcreatefiles.ads b/source/lsp_3.17/generated/lsp-server_requests-willcreatefiles.ads new file mode 100644 index 000000000..293ccd061 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-willcreatefiles.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Requests.WillCreateFiles is + pragma Preelaborate; + + type Request is new LSP.Server_Requests.Server_Request with record + Params : LSP.Structures.CreateFilesParams; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class); + +end LSP.Server_Requests.WillCreateFiles; diff --git a/source/lsp_3.17/generated/lsp-server_requests-willdeletefiles.adb b/source/lsp_3.17/generated/lsp-server_requests-willdeletefiles.adb new file mode 100644 index 000000000..3fcb5ef69 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-willdeletefiles.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Requests.WillDeleteFiles is + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class) is + begin + Value.On_WillDeleteFiles_Request (Self.Id, Self.Params); + end Visit_Server_Receiver; + +end LSP.Server_Requests.WillDeleteFiles; diff --git a/source/lsp_3.17/generated/lsp-server_requests-willdeletefiles.ads b/source/lsp_3.17/generated/lsp-server_requests-willdeletefiles.ads new file mode 100644 index 000000000..d58149557 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-willdeletefiles.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Requests.WillDeleteFiles is + pragma Preelaborate; + + type Request is new LSP.Server_Requests.Server_Request with record + Params : LSP.Structures.DeleteFilesParams; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class); + +end LSP.Server_Requests.WillDeleteFiles; diff --git a/source/lsp_3.17/generated/lsp-server_requests-willrenamefiles.adb b/source/lsp_3.17/generated/lsp-server_requests-willrenamefiles.adb new file mode 100644 index 000000000..8c413e053 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-willrenamefiles.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Requests.WillRenameFiles is + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class) is + begin + Value.On_WillRenameFiles_Request (Self.Id, Self.Params); + end Visit_Server_Receiver; + +end LSP.Server_Requests.WillRenameFiles; diff --git a/source/lsp_3.17/generated/lsp-server_requests-willrenamefiles.ads b/source/lsp_3.17/generated/lsp-server_requests-willrenamefiles.ads new file mode 100644 index 000000000..4a81249f5 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-willrenamefiles.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Requests.WillRenameFiles is + pragma Preelaborate; + + type Request is new LSP.Server_Requests.Server_Request with record + Params : LSP.Structures.RenameFilesParams; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class); + +end LSP.Server_Requests.WillRenameFiles; diff --git a/source/lsp_3.17/generated/lsp-server_requests-willsavewaituntil.adb b/source/lsp_3.17/generated/lsp-server_requests-willsavewaituntil.adb new file mode 100644 index 000000000..7b091c9fa --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-willsavewaituntil.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Requests.WillSaveWaitUntil is + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class) is + begin + Value.On_WillSaveWaitUntil_Request (Self.Id, Self.Params); + end Visit_Server_Receiver; + +end LSP.Server_Requests.WillSaveWaitUntil; diff --git a/source/lsp_3.17/generated/lsp-server_requests-willsavewaituntil.ads b/source/lsp_3.17/generated/lsp-server_requests-willsavewaituntil.ads new file mode 100644 index 000000000..a7cf07dfc --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-willsavewaituntil.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Requests.WillSaveWaitUntil is + pragma Preelaborate; + + type Request is new LSP.Server_Requests.Server_Request with record + Params : LSP.Structures.WillSaveTextDocumentParams; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class); + +end LSP.Server_Requests.WillSaveWaitUntil; diff --git a/source/lsp_3.17/generated/lsp-server_requests-workspace_diagnostic.adb b/source/lsp_3.17/generated/lsp-server_requests-workspace_diagnostic.adb new file mode 100644 index 000000000..82d59cc60 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-workspace_diagnostic.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Requests.Workspace_Diagnostic is + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class) is + begin + Value.On_Workspace_Diagnostic_Request (Self.Id, Self.Params); + end Visit_Server_Receiver; + +end LSP.Server_Requests.Workspace_Diagnostic; diff --git a/source/lsp_3.17/generated/lsp-server_requests-workspace_diagnostic.ads b/source/lsp_3.17/generated/lsp-server_requests-workspace_diagnostic.ads new file mode 100644 index 000000000..7bbcf9d1e --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-workspace_diagnostic.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Requests.Workspace_Diagnostic is + pragma Preelaborate; + + type Request is new LSP.Server_Requests.Server_Request with record + Params : LSP.Structures.WorkspaceDiagnosticParams; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class); + +end LSP.Server_Requests.Workspace_Diagnostic; diff --git a/source/lsp_3.17/generated/lsp-server_response_readers.adb b/source/lsp_3.17/generated/lsp-server_response_readers.adb new file mode 100644 index 000000000..ccbe07ce1 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_response_readers.adb @@ -0,0 +1,167 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with Minimal_Perfect_Hash; +with LSP.Inputs; +with LSP.Input_Tools; +with LSP.Structures; + +with LSP.Server_Responses.RegisterCapability; +with LSP.Server_Responses.UnregisterCapability; +with LSP.Server_Responses.ShowDocument; +with LSP.Server_Responses.ShowMessageRequest; +with LSP.Server_Responses.Progress_Create; +with LSP.Server_Responses.ApplyEdit; +with LSP.Server_Responses.Code_Lens_Refresh; +with LSP.Server_Responses.Configuration; +with LSP.Server_Responses.Diagnostic_Refresh; +with LSP.Server_Responses.Inlay_Refresh; +with LSP.Server_Responses.Inline_Refresh; +with LSP.Server_Responses.Tokens_Refresh; +with LSP.Server_Responses.WorkspaceFolders; + +package body LSP.Server_Response_Readers is + + package Method_Map is new Minimal_Perfect_Hash + (["client/registerCapability", + "client/unregisterCapability", + "window/showDocument", + "window/showMessageRequest", + "window/workDoneProgress/create", + "workspace/applyEdit", + "workspace/codeLens/refresh", + "workspace/configuration", + "workspace/diagnostic/refresh", + "workspace/inlayHint/refresh", + "workspace/inlineValue/refresh", + "workspace/semanticTokens/refresh", + "workspace/workspaceFolders"]); + + procedure Initialize is + begin + Method_Map.Initialize; + end Initialize; + + procedure Read_RegisterCapability is new LSP.Input_Tools.Read_Response + (LSP.Structures.Null_Record, LSP.Inputs.Read_Null_Record); + + procedure Read_UnregisterCapability is new LSP.Input_Tools.Read_Response + (LSP.Structures.Null_Record, LSP.Inputs.Read_Null_Record); + + procedure Read_ShowDocument is new LSP.Input_Tools.Read_Response + (LSP.Structures.ShowDocumentResult, LSP.Inputs.Read_ShowDocumentResult); + + procedure Read_ShowMessageRequest is new LSP.Input_Tools.Read_Response + (LSP.Structures.MessageActionItem_Or_Null, + LSP.Inputs.Read_MessageActionItem_Or_Null); + + procedure Read_Progress_Create is new LSP.Input_Tools.Read_Response + (LSP.Structures.Null_Record, LSP.Inputs.Read_Null_Record); + + procedure Read_ApplyEdit is new LSP.Input_Tools.Read_Response + (LSP.Structures.ApplyWorkspaceEditResult, + LSP.Inputs.Read_ApplyWorkspaceEditResult); + + procedure Read_Code_Lens_Refresh is new LSP.Input_Tools.Read_Response + (LSP.Structures.Null_Record, LSP.Inputs.Read_Null_Record); + + procedure Read_Configuration is new LSP.Input_Tools.Read_Response + (LSP.Structures.LSPAny_Vector, LSP.Inputs.Read_LSPAny_Vector); + + procedure Read_Diagnostic_Refresh is new LSP.Input_Tools.Read_Response + (LSP.Structures.Null_Record, LSP.Inputs.Read_Null_Record); + + procedure Read_Inlay_Refresh is new LSP.Input_Tools.Read_Response + (LSP.Structures.Null_Record, LSP.Inputs.Read_Null_Record); + + procedure Read_Inline_Refresh is new LSP.Input_Tools.Read_Response + (LSP.Structures.Null_Record, LSP.Inputs.Read_Null_Record); + + procedure Read_Tokens_Refresh is new LSP.Input_Tools.Read_Response + (LSP.Structures.Null_Record, LSP.Inputs.Read_Null_Record); + + procedure Read_WorkspaceFolders is new LSP.Input_Tools.Read_Response + (LSP.Structures.WorkspaceFolder_Vector_Or_Null, + LSP.Inputs.Read_WorkspaceFolder_Vector_Or_Null); + + function Read_Response + (Input : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Method : VSS.Strings.Virtual_String) + return LSP.Server_Responses.Server_Response'Class is + Index : constant Natural := Method_Map.Get_Index (Method); + begin + case Index is + when 1 => -- client/registerCapability + return Result : LSP.Server_Responses.RegisterCapability.Response do + Read_RegisterCapability (Input, Result.Id, Result.Result); + end return; + + when 2 => -- client/unregisterCapability + return + Result : LSP.Server_Responses.UnregisterCapability.Response do + Read_UnregisterCapability (Input, Result.Id, Result.Result); + end return; + + when 3 => -- window/showDocument + return Result : LSP.Server_Responses.ShowDocument.Response do + Read_ShowDocument (Input, Result.Id, Result.Result); + end return; + + when 4 => -- window/showMessageRequest + return Result : LSP.Server_Responses.ShowMessageRequest.Response do + Read_ShowMessageRequest (Input, Result.Id, Result.Result); + end return; + + when 5 => -- window/workDoneProgress/create + return Result : LSP.Server_Responses.Progress_Create.Response do + Read_Progress_Create (Input, Result.Id, Result.Result); + end return; + + when 6 => -- workspace/applyEdit + return Result : LSP.Server_Responses.ApplyEdit.Response do + Read_ApplyEdit (Input, Result.Id, Result.Result); + end return; + + when 7 => -- workspace/codeLens/refresh + return Result : LSP.Server_Responses.Code_Lens_Refresh.Response do + Read_Code_Lens_Refresh (Input, Result.Id, Result.Result); + end return; + + when 8 => -- workspace/configuration + return Result : LSP.Server_Responses.Configuration.Response do + Read_Configuration (Input, Result.Id, Result.Result); + end return; + + when 9 => -- workspace/diagnostic/refresh + return Result : LSP.Server_Responses.Diagnostic_Refresh.Response do + Read_Diagnostic_Refresh (Input, Result.Id, Result.Result); + end return; + + when 10 => -- workspace/inlayHint/refresh + return Result : LSP.Server_Responses.Inlay_Refresh.Response do + Read_Inlay_Refresh (Input, Result.Id, Result.Result); + end return; + + when 11 => -- workspace/inlineValue/refresh + return Result : LSP.Server_Responses.Inline_Refresh.Response do + Read_Inline_Refresh (Input, Result.Id, Result.Result); + end return; + + when 12 => -- workspace/semanticTokens/refresh + return Result : LSP.Server_Responses.Tokens_Refresh.Response do + Read_Tokens_Refresh (Input, Result.Id, Result.Result); + end return; + + when 13 => -- workspace/workspaceFolders + return Result : LSP.Server_Responses.WorkspaceFolders.Response do + Read_WorkspaceFolders (Input, Result.Id, Result.Result); + end return; + + when others => + return raise Program_Error with "Unknown method"; + end case; + end Read_Response; +end LSP.Server_Response_Readers; diff --git a/source/lsp_3.17/generated/lsp-server_response_receivers.ads b/source/lsp_3.17/generated/lsp-server_response_receivers.ads new file mode 100644 index 000000000..1f5dcd239 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_response_receivers.ads @@ -0,0 +1,122 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Errors; +with LSP.Structures; + +package LSP.Server_Response_Receivers is + pragma Preelaborate; + + type Server_Response_Receiver is limited interface; + + procedure On_RegisterCapability_Response + (Self : in out Server_Response_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Null_Record) is null; + -- The `client/registerCapability` request is sent from the server to the + -- client to register a new capability handler on the client side. + + procedure On_UnregisterCapability_Response + (Self : in out Server_Response_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Null_Record) is null; + -- The `client/unregisterCapability` request is sent from the server to the + -- client to unregister a previously registered capability handler on the + -- client side. + + procedure On_ShowDocument_Response + (Self : in out Server_Response_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ShowDocumentResult) is null; + -- A request to show a document. This request might open an external + -- program depending on the value of the URI to open. For example a request + -- to open `https://code.visualstudio.com/` will very likely open the URI + -- in a WEB browser. + -- + -- @since 3.16.0 + + procedure On_ShowMessageRequest_Response + (Self : in out Server_Response_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.MessageActionItem_Or_Null) is null; + -- The show message request is sent from the server to the client to show a + -- message and a set of options actions to the user. + + procedure On_Progress_Create_Response + (Self : in out Server_Response_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Null_Record) is null; + -- The `window/workDoneProgress/create` request is sent from the server to + -- the client to initiate progress reporting from the server. + + procedure On_ApplyEdit_Response + (Self : in out Server_Response_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ApplyWorkspaceEditResult) is null; + -- A request sent from the server to the client to modified certain + -- resources. + + procedure On_Code_Lens_Refresh_Response + (Self : in out Server_Response_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Null_Record) is null; + -- A request to refresh all code actions + -- + -- @since 3.16.0 + + procedure On_Configuration_Response + (Self : in out Server_Response_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.LSPAny_Vector) is null; + -- The 'workspace/configuration' request is sent from the server to the + -- client to fetch a certain configuration setting. + -- + -- This pull model replaces the old push model were the client signaled + -- configuration change via an event. If the server still needs to + -- react to configuration changes (since the server caches the result of + -- `workspace/configuration` requests) the server should register for an + -- empty configuration change event and empty the cache if such an event + -- is received. + + procedure On_Diagnostic_Refresh_Response + (Self : in out Server_Response_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Null_Record) is null; + -- The diagnostic refresh request definition. + -- + -- @since 3.17.0 + + procedure On_Inlay_Refresh_Response + (Self : in out Server_Response_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Null_Record) is null; + -- @since 3.17.0 + + procedure On_Inline_Refresh_Response + (Self : in out Server_Response_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Null_Record) is null; + -- @since 3.17.0 + + procedure On_Tokens_Refresh_Response + (Self : in out Server_Response_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Null_Record) is null; + -- @since 3.16.0 + + procedure On_WorkspaceFolders_Response + (Self : in out Server_Response_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceFolder_Vector_Or_Null) is null; + -- The `workspace/workspaceFolders` is sent from the server to the client + -- to fetch the open workspace folders. + + procedure On_Error_Response + (Self : in out Server_Response_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Errors.ResponseError) is null; + +end LSP.Server_Response_Receivers; diff --git a/source/lsp_3.17/generated/lsp-server_response_writers.adb b/source/lsp_3.17/generated/lsp-server_response_writers.adb new file mode 100644 index 000000000..7070fc2ae --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_response_writers.adb @@ -0,0 +1,172 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Output_Tools; +with LSP.Outputs; + +package body LSP.Server_Response_Writers is + + overriding procedure On_RegisterCapability_Response + (Self : in out Server_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Null_Record) is + begin + LSP.Output_Tools.Write_Start_Response (Self.Output.all, Id); + Self.Output.Key_Name ("result"); + LSP.Outputs.Write_Null_Record (Self.Output.all, Value); + Self.Output.End_Object; + end On_RegisterCapability_Response; + + overriding procedure On_UnregisterCapability_Response + (Self : in out Server_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Null_Record) is + begin + LSP.Output_Tools.Write_Start_Response (Self.Output.all, Id); + Self.Output.Key_Name ("result"); + LSP.Outputs.Write_Null_Record (Self.Output.all, Value); + Self.Output.End_Object; + end On_UnregisterCapability_Response; + + overriding procedure On_ShowDocument_Response + (Self : in out Server_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ShowDocumentResult) is + begin + LSP.Output_Tools.Write_Start_Response (Self.Output.all, Id); + Self.Output.Key_Name ("result"); + LSP.Outputs.Write_ShowDocumentResult (Self.Output.all, Value); + Self.Output.End_Object; + end On_ShowDocument_Response; + + overriding procedure On_ShowMessageRequest_Response + (Self : in out Server_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.MessageActionItem_Or_Null) is + begin + LSP.Output_Tools.Write_Start_Response (Self.Output.all, Id); + Self.Output.Key_Name ("result"); + LSP.Outputs.Write_MessageActionItem_Or_Null (Self.Output.all, Value); + Self.Output.End_Object; + end On_ShowMessageRequest_Response; + + overriding procedure On_Progress_Create_Response + (Self : in out Server_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Null_Record) is + begin + LSP.Output_Tools.Write_Start_Response (Self.Output.all, Id); + Self.Output.Key_Name ("result"); + LSP.Outputs.Write_Null_Record (Self.Output.all, Value); + Self.Output.End_Object; + end On_Progress_Create_Response; + + overriding procedure On_ApplyEdit_Response + (Self : in out Server_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ApplyWorkspaceEditResult) is + begin + LSP.Output_Tools.Write_Start_Response (Self.Output.all, Id); + Self.Output.Key_Name ("result"); + LSP.Outputs.Write_ApplyWorkspaceEditResult (Self.Output.all, Value); + Self.Output.End_Object; + end On_ApplyEdit_Response; + + overriding procedure On_Code_Lens_Refresh_Response + (Self : in out Server_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Null_Record) is + begin + LSP.Output_Tools.Write_Start_Response (Self.Output.all, Id); + Self.Output.Key_Name ("result"); + LSP.Outputs.Write_Null_Record (Self.Output.all, Value); + Self.Output.End_Object; + end On_Code_Lens_Refresh_Response; + + overriding procedure On_Configuration_Response + (Self : in out Server_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.LSPAny_Vector) is + begin + LSP.Output_Tools.Write_Start_Response (Self.Output.all, Id); + Self.Output.Key_Name ("result"); + LSP.Outputs.Write_LSPAny_Vector (Self.Output.all, Value); + Self.Output.End_Object; + end On_Configuration_Response; + + overriding procedure On_Diagnostic_Refresh_Response + (Self : in out Server_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Null_Record) is + begin + LSP.Output_Tools.Write_Start_Response (Self.Output.all, Id); + Self.Output.Key_Name ("result"); + LSP.Outputs.Write_Null_Record (Self.Output.all, Value); + Self.Output.End_Object; + end On_Diagnostic_Refresh_Response; + + overriding procedure On_Inlay_Refresh_Response + (Self : in out Server_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Null_Record) is + begin + LSP.Output_Tools.Write_Start_Response (Self.Output.all, Id); + Self.Output.Key_Name ("result"); + LSP.Outputs.Write_Null_Record (Self.Output.all, Value); + Self.Output.End_Object; + end On_Inlay_Refresh_Response; + + overriding procedure On_Inline_Refresh_Response + (Self : in out Server_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Null_Record) is + begin + LSP.Output_Tools.Write_Start_Response (Self.Output.all, Id); + Self.Output.Key_Name ("result"); + LSP.Outputs.Write_Null_Record (Self.Output.all, Value); + Self.Output.End_Object; + end On_Inline_Refresh_Response; + + overriding procedure On_Tokens_Refresh_Response + (Self : in out Server_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Null_Record) is + begin + LSP.Output_Tools.Write_Start_Response (Self.Output.all, Id); + Self.Output.Key_Name ("result"); + LSP.Outputs.Write_Null_Record (Self.Output.all, Value); + Self.Output.End_Object; + end On_Tokens_Refresh_Response; + + overriding procedure On_WorkspaceFolders_Response + (Self : in out Server_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceFolder_Vector_Or_Null) is + begin + LSP.Output_Tools.Write_Start_Response (Self.Output.all, Id); + Self.Output.Key_Name ("result"); + LSP.Outputs.Write_WorkspaceFolder_Vector_Or_Null + (Self.Output.all, Value); + Self.Output.End_Object; + end On_WorkspaceFolders_Response; + + overriding procedure On_Error_Response + (Self : in out Server_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Errors.ResponseError) is + begin + LSP.Output_Tools.Write_Start_Response (Self.Output.all, Id); + Self.Output.Key_Name ("error"); + Self.Output.Start_Object; + Self.Output.Key_Name ("code"); + LSP.Outputs.Write_ErrorCodes (Self.Output.all, Value.code); + Self.Output.Key_Name ("message"); + Self.Output.String_Value (Value.message); + Self.Output.End_Object; + Self.Output.End_Object; + end On_Error_Response; + +end LSP.Server_Response_Writers; diff --git a/source/lsp_3.17/generated/lsp-server_response_writers.ads b/source/lsp_3.17/generated/lsp-server_response_writers.ads new file mode 100644 index 000000000..a7bcaf797 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_response_writers.ads @@ -0,0 +1,90 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with VSS.JSON.Content_Handlers; + +with LSP.Errors; +with LSP.Structures; +with LSP.Server_Response_Receivers; + +package LSP.Server_Response_Writers is + pragma Preelaborate; + + type Server_Response_Writer + (Output : access VSS.JSON.Content_Handlers.JSON_Content_Handler'Class) is + new LSP.Server_Response_Receivers.Server_Response_Receiver with null record; + + overriding procedure On_RegisterCapability_Response + (Self : in out Server_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Null_Record); + + overriding procedure On_UnregisterCapability_Response + (Self : in out Server_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Null_Record); + + overriding procedure On_ShowDocument_Response + (Self : in out Server_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ShowDocumentResult); + + overriding procedure On_ShowMessageRequest_Response + (Self : in out Server_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.MessageActionItem_Or_Null); + + overriding procedure On_Progress_Create_Response + (Self : in out Server_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Null_Record); + + overriding procedure On_ApplyEdit_Response + (Self : in out Server_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ApplyWorkspaceEditResult); + + overriding procedure On_Code_Lens_Refresh_Response + (Self : in out Server_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Null_Record); + + overriding procedure On_Configuration_Response + (Self : in out Server_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.LSPAny_Vector); + + overriding procedure On_Diagnostic_Refresh_Response + (Self : in out Server_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Null_Record); + + overriding procedure On_Inlay_Refresh_Response + (Self : in out Server_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Null_Record); + + overriding procedure On_Inline_Refresh_Response + (Self : in out Server_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Null_Record); + + overriding procedure On_Tokens_Refresh_Response + (Self : in out Server_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Null_Record); + + overriding procedure On_WorkspaceFolders_Response + (Self : in out Server_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceFolder_Vector_Or_Null); + + overriding procedure On_Error_Response + (Self : in out Server_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Errors.ResponseError); + +end LSP.Server_Response_Writers; diff --git a/source/lsp_3.17/generated/lsp-server_responses-applyedit.adb b/source/lsp_3.17/generated/lsp-server_responses-applyedit.adb new file mode 100644 index 000000000..fff8f3de0 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_responses-applyedit.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Responses.ApplyEdit is + + overriding procedure Visit_Server_Receiver + (Self : Response; + Value : in out LSP.Server_Response_Receivers.Server_Response_Receiver' + Class) is + begin + Value.On_ApplyEdit_Response (Self.Id, Self.Result); + end Visit_Server_Receiver; + +end LSP.Server_Responses.ApplyEdit; diff --git a/source/lsp_3.17/generated/lsp-server_responses-applyedit.ads b/source/lsp_3.17/generated/lsp-server_responses-applyedit.ads new file mode 100644 index 000000000..fd1dbfcdd --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_responses-applyedit.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Responses.ApplyEdit is + pragma Preelaborate; + + type Response is new LSP.Server_Responses.Server_Response with record + Result : LSP.Structures.ApplyWorkspaceEditResult; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Response; + Value : in out LSP.Server_Response_Receivers.Server_Response_Receiver' + Class); + +end LSP.Server_Responses.ApplyEdit; diff --git a/source/lsp_3.17/generated/lsp-server_responses-code_lens_refresh.adb b/source/lsp_3.17/generated/lsp-server_responses-code_lens_refresh.adb new file mode 100644 index 000000000..be80422f9 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_responses-code_lens_refresh.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Responses.Code_Lens_Refresh is + + overriding procedure Visit_Server_Receiver + (Self : Response; + Value : in out LSP.Server_Response_Receivers.Server_Response_Receiver' + Class) is + begin + Value.On_Code_Lens_Refresh_Response (Self.Id, Self.Result); + end Visit_Server_Receiver; + +end LSP.Server_Responses.Code_Lens_Refresh; diff --git a/source/lsp_3.17/generated/lsp-server_responses-code_lens_refresh.ads b/source/lsp_3.17/generated/lsp-server_responses-code_lens_refresh.ads new file mode 100644 index 000000000..93d73809d --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_responses-code_lens_refresh.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Responses.Code_Lens_Refresh is + pragma Preelaborate; + + type Response is new LSP.Server_Responses.Server_Response with record + Result : LSP.Structures.Null_Record; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Response; + Value : in out LSP.Server_Response_Receivers.Server_Response_Receiver' + Class); + +end LSP.Server_Responses.Code_Lens_Refresh; diff --git a/source/lsp_3.17/generated/lsp-server_responses-configuration.adb b/source/lsp_3.17/generated/lsp-server_responses-configuration.adb new file mode 100644 index 000000000..cd9254243 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_responses-configuration.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Responses.Configuration is + + overriding procedure Visit_Server_Receiver + (Self : Response; + Value : in out LSP.Server_Response_Receivers.Server_Response_Receiver' + Class) is + begin + Value.On_Configuration_Response (Self.Id, Self.Result); + end Visit_Server_Receiver; + +end LSP.Server_Responses.Configuration; diff --git a/source/lsp_3.17/generated/lsp-server_responses-configuration.ads b/source/lsp_3.17/generated/lsp-server_responses-configuration.ads new file mode 100644 index 000000000..f3bcadb73 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_responses-configuration.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Responses.Configuration is + pragma Preelaborate; + + type Response is new LSP.Server_Responses.Server_Response with record + Result : LSP.Structures.LSPAny_Vector; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Response; + Value : in out LSP.Server_Response_Receivers.Server_Response_Receiver' + Class); + +end LSP.Server_Responses.Configuration; diff --git a/source/lsp_3.17/generated/lsp-server_responses-diagnostic_refresh.adb b/source/lsp_3.17/generated/lsp-server_responses-diagnostic_refresh.adb new file mode 100644 index 000000000..05077b2a7 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_responses-diagnostic_refresh.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Responses.Diagnostic_Refresh is + + overriding procedure Visit_Server_Receiver + (Self : Response; + Value : in out LSP.Server_Response_Receivers.Server_Response_Receiver' + Class) is + begin + Value.On_Diagnostic_Refresh_Response (Self.Id, Self.Result); + end Visit_Server_Receiver; + +end LSP.Server_Responses.Diagnostic_Refresh; diff --git a/source/lsp_3.17/generated/lsp-server_responses-diagnostic_refresh.ads b/source/lsp_3.17/generated/lsp-server_responses-diagnostic_refresh.ads new file mode 100644 index 000000000..933681016 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_responses-diagnostic_refresh.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Responses.Diagnostic_Refresh is + pragma Preelaborate; + + type Response is new LSP.Server_Responses.Server_Response with record + Result : LSP.Structures.Null_Record; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Response; + Value : in out LSP.Server_Response_Receivers.Server_Response_Receiver' + Class); + +end LSP.Server_Responses.Diagnostic_Refresh; diff --git a/source/lsp_3.17/generated/lsp-server_responses-inlay_refresh.adb b/source/lsp_3.17/generated/lsp-server_responses-inlay_refresh.adb new file mode 100644 index 000000000..0c3e3e3ee --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_responses-inlay_refresh.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Responses.Inlay_Refresh is + + overriding procedure Visit_Server_Receiver + (Self : Response; + Value : in out LSP.Server_Response_Receivers.Server_Response_Receiver' + Class) is + begin + Value.On_Inlay_Refresh_Response (Self.Id, Self.Result); + end Visit_Server_Receiver; + +end LSP.Server_Responses.Inlay_Refresh; diff --git a/source/lsp_3.17/generated/lsp-server_responses-inlay_refresh.ads b/source/lsp_3.17/generated/lsp-server_responses-inlay_refresh.ads new file mode 100644 index 000000000..83ce351de --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_responses-inlay_refresh.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Responses.Inlay_Refresh is + pragma Preelaborate; + + type Response is new LSP.Server_Responses.Server_Response with record + Result : LSP.Structures.Null_Record; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Response; + Value : in out LSP.Server_Response_Receivers.Server_Response_Receiver' + Class); + +end LSP.Server_Responses.Inlay_Refresh; diff --git a/source/lsp_3.17/generated/lsp-server_responses-inline_refresh.adb b/source/lsp_3.17/generated/lsp-server_responses-inline_refresh.adb new file mode 100644 index 000000000..b9abb3fca --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_responses-inline_refresh.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Responses.Inline_Refresh is + + overriding procedure Visit_Server_Receiver + (Self : Response; + Value : in out LSP.Server_Response_Receivers.Server_Response_Receiver' + Class) is + begin + Value.On_Inline_Refresh_Response (Self.Id, Self.Result); + end Visit_Server_Receiver; + +end LSP.Server_Responses.Inline_Refresh; diff --git a/source/lsp_3.17/generated/lsp-server_responses-inline_refresh.ads b/source/lsp_3.17/generated/lsp-server_responses-inline_refresh.ads new file mode 100644 index 000000000..88f7b5297 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_responses-inline_refresh.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Responses.Inline_Refresh is + pragma Preelaborate; + + type Response is new LSP.Server_Responses.Server_Response with record + Result : LSP.Structures.Null_Record; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Response; + Value : in out LSP.Server_Response_Receivers.Server_Response_Receiver' + Class); + +end LSP.Server_Responses.Inline_Refresh; diff --git a/source/lsp_3.17/generated/lsp-server_responses-progress_create.adb b/source/lsp_3.17/generated/lsp-server_responses-progress_create.adb new file mode 100644 index 000000000..22b3ed326 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_responses-progress_create.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Responses.Progress_Create is + + overriding procedure Visit_Server_Receiver + (Self : Response; + Value : in out LSP.Server_Response_Receivers.Server_Response_Receiver' + Class) is + begin + Value.On_Progress_Create_Response (Self.Id, Self.Result); + end Visit_Server_Receiver; + +end LSP.Server_Responses.Progress_Create; diff --git a/source/lsp_3.17/generated/lsp-server_responses-progress_create.ads b/source/lsp_3.17/generated/lsp-server_responses-progress_create.ads new file mode 100644 index 000000000..40f8064da --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_responses-progress_create.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Responses.Progress_Create is + pragma Preelaborate; + + type Response is new LSP.Server_Responses.Server_Response with record + Result : LSP.Structures.Null_Record; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Response; + Value : in out LSP.Server_Response_Receivers.Server_Response_Receiver' + Class); + +end LSP.Server_Responses.Progress_Create; diff --git a/source/lsp_3.17/generated/lsp-server_responses-registercapability.adb b/source/lsp_3.17/generated/lsp-server_responses-registercapability.adb new file mode 100644 index 000000000..bd658c97d --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_responses-registercapability.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Responses.RegisterCapability is + + overriding procedure Visit_Server_Receiver + (Self : Response; + Value : in out LSP.Server_Response_Receivers.Server_Response_Receiver' + Class) is + begin + Value.On_RegisterCapability_Response (Self.Id, Self.Result); + end Visit_Server_Receiver; + +end LSP.Server_Responses.RegisterCapability; diff --git a/source/lsp_3.17/generated/lsp-server_responses-registercapability.ads b/source/lsp_3.17/generated/lsp-server_responses-registercapability.ads new file mode 100644 index 000000000..b14213f0f --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_responses-registercapability.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Responses.RegisterCapability is + pragma Preelaborate; + + type Response is new LSP.Server_Responses.Server_Response with record + Result : LSP.Structures.Null_Record; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Response; + Value : in out LSP.Server_Response_Receivers.Server_Response_Receiver' + Class); + +end LSP.Server_Responses.RegisterCapability; diff --git a/source/lsp_3.17/generated/lsp-server_responses-showdocument.adb b/source/lsp_3.17/generated/lsp-server_responses-showdocument.adb new file mode 100644 index 000000000..f95b80760 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_responses-showdocument.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Responses.ShowDocument is + + overriding procedure Visit_Server_Receiver + (Self : Response; + Value : in out LSP.Server_Response_Receivers.Server_Response_Receiver' + Class) is + begin + Value.On_ShowDocument_Response (Self.Id, Self.Result); + end Visit_Server_Receiver; + +end LSP.Server_Responses.ShowDocument; diff --git a/source/lsp_3.17/generated/lsp-server_responses-showdocument.ads b/source/lsp_3.17/generated/lsp-server_responses-showdocument.ads new file mode 100644 index 000000000..2a25a546c --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_responses-showdocument.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Responses.ShowDocument is + pragma Preelaborate; + + type Response is new LSP.Server_Responses.Server_Response with record + Result : LSP.Structures.ShowDocumentResult; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Response; + Value : in out LSP.Server_Response_Receivers.Server_Response_Receiver' + Class); + +end LSP.Server_Responses.ShowDocument; diff --git a/source/lsp_3.17/generated/lsp-server_responses-showmessagerequest.adb b/source/lsp_3.17/generated/lsp-server_responses-showmessagerequest.adb new file mode 100644 index 000000000..d2a1acf94 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_responses-showmessagerequest.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Responses.ShowMessageRequest is + + overriding procedure Visit_Server_Receiver + (Self : Response; + Value : in out LSP.Server_Response_Receivers.Server_Response_Receiver' + Class) is + begin + Value.On_ShowMessageRequest_Response (Self.Id, Self.Result); + end Visit_Server_Receiver; + +end LSP.Server_Responses.ShowMessageRequest; diff --git a/source/lsp_3.17/generated/lsp-server_responses-showmessagerequest.ads b/source/lsp_3.17/generated/lsp-server_responses-showmessagerequest.ads new file mode 100644 index 000000000..19fe28468 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_responses-showmessagerequest.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Responses.ShowMessageRequest is + pragma Preelaborate; + + type Response is new LSP.Server_Responses.Server_Response with record + Result : LSP.Structures.MessageActionItem_Or_Null; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Response; + Value : in out LSP.Server_Response_Receivers.Server_Response_Receiver' + Class); + +end LSP.Server_Responses.ShowMessageRequest; diff --git a/source/lsp_3.17/generated/lsp-server_responses-tokens_refresh.adb b/source/lsp_3.17/generated/lsp-server_responses-tokens_refresh.adb new file mode 100644 index 000000000..39ac00c75 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_responses-tokens_refresh.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Responses.Tokens_Refresh is + + overriding procedure Visit_Server_Receiver + (Self : Response; + Value : in out LSP.Server_Response_Receivers.Server_Response_Receiver' + Class) is + begin + Value.On_Tokens_Refresh_Response (Self.Id, Self.Result); + end Visit_Server_Receiver; + +end LSP.Server_Responses.Tokens_Refresh; diff --git a/source/lsp_3.17/generated/lsp-server_responses-tokens_refresh.ads b/source/lsp_3.17/generated/lsp-server_responses-tokens_refresh.ads new file mode 100644 index 000000000..710fd445c --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_responses-tokens_refresh.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Responses.Tokens_Refresh is + pragma Preelaborate; + + type Response is new LSP.Server_Responses.Server_Response with record + Result : LSP.Structures.Null_Record; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Response; + Value : in out LSP.Server_Response_Receivers.Server_Response_Receiver' + Class); + +end LSP.Server_Responses.Tokens_Refresh; diff --git a/source/lsp_3.17/generated/lsp-server_responses-unregistercapability.adb b/source/lsp_3.17/generated/lsp-server_responses-unregistercapability.adb new file mode 100644 index 000000000..7d539f11c --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_responses-unregistercapability.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Responses.UnregisterCapability is + + overriding procedure Visit_Server_Receiver + (Self : Response; + Value : in out LSP.Server_Response_Receivers.Server_Response_Receiver' + Class) is + begin + Value.On_UnregisterCapability_Response (Self.Id, Self.Result); + end Visit_Server_Receiver; + +end LSP.Server_Responses.UnregisterCapability; diff --git a/source/lsp_3.17/generated/lsp-server_responses-unregistercapability.ads b/source/lsp_3.17/generated/lsp-server_responses-unregistercapability.ads new file mode 100644 index 000000000..3214be253 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_responses-unregistercapability.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Responses.UnregisterCapability is + pragma Preelaborate; + + type Response is new LSP.Server_Responses.Server_Response with record + Result : LSP.Structures.Null_Record; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Response; + Value : in out LSP.Server_Response_Receivers.Server_Response_Receiver' + Class); + +end LSP.Server_Responses.UnregisterCapability; diff --git a/source/lsp_3.17/generated/lsp-server_responses-workspacefolders.adb b/source/lsp_3.17/generated/lsp-server_responses-workspacefolders.adb new file mode 100644 index 000000000..432e42f72 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_responses-workspacefolders.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +package body LSP.Server_Responses.WorkspaceFolders is + + overriding procedure Visit_Server_Receiver + (Self : Response; + Value : in out LSP.Server_Response_Receivers.Server_Response_Receiver' + Class) is + begin + Value.On_WorkspaceFolders_Response (Self.Id, Self.Result); + end Visit_Server_Receiver; + +end LSP.Server_Responses.WorkspaceFolders; diff --git a/source/lsp_3.17/generated/lsp-server_responses-workspacefolders.ads b/source/lsp_3.17/generated/lsp-server_responses-workspacefolders.ads new file mode 100644 index 000000000..d9d0ca2ab --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_responses-workspacefolders.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with LSP.Structures; + +package LSP.Server_Responses.WorkspaceFolders is + pragma Preelaborate; + + type Response is new LSP.Server_Responses.Server_Response with record + Result : LSP.Structures.WorkspaceFolder_Vector_Or_Null; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Response; + Value : in out LSP.Server_Response_Receivers.Server_Response_Receiver' + Class); + +end LSP.Server_Responses.WorkspaceFolders; diff --git a/source/lsp_3.17/generated/lsp-structures.ads b/source/lsp_3.17/generated/lsp-structures.ads new file mode 100644 index 000000000..0a64b3828 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-structures.ads @@ -0,0 +1,9057 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- + +with Ada.Containers.Hashed_Maps; +with Ada.Containers.Vectors; +with Ada.Finalization; + +with VSS.JSON.Streams; +with VSS.Strings; + +with VSS.String_Vectors; + +with LSP.Enumerations; use LSP.Enumerations; + +package LSP.Structures is + pragma Preelaborate; + + subtype Virtual_String is VSS.Strings.Virtual_String; + subtype Virtual_String_Optional is VSS.Strings.Virtual_String; + subtype Virtual_String_Vector is VSS.String_Vectors.Virtual_String_Vector; + + type DocumentUri is new VSS.Strings.Virtual_String with null record; + + function Get_Hash (Self : DocumentUri) return Ada.Containers.Hash_Type is + (Ada.Containers.Hash_Type'Mod (Self.Hash)); + + package JSON_Event_Vectors is new Ada.Containers.Vectors + (Positive, VSS.JSON.Streams.JSON_Stream_Element, VSS.JSON.Streams."="); + + subtype Boolean_Or_Any is JSON_Event_Vectors.Vector; + + type SelectionRange_Optional is tagged private; + + type Boolean_Optional (Is_Set : Boolean := False) is record + case Is_Set is + when False => + null; + when True => + Value : Boolean; + end case; + end record; + + type Natural_Optional (Is_Set : Boolean := False) is record + case Is_Set is + when False => + null; + when True => + Value : Natural; + end case; + end record; + + type Integer_Optional (Is_Set : Boolean := False) is record + case Is_Set is + when False => + null; + when True => + Value : Integer; + end case; + end record; + + type ProgressToken (Is_Integer : Boolean := True) is record + case Is_Integer is + when True => + Integer : Standard.Integer; + when False => + Virtual_String : LSP.Structures.Virtual_String; + end case; + end record; + + type ProgressToken_Optional (Is_Set : Boolean := False) is record + case Is_Set is + when False => + null; + when True => + Value : ProgressToken; + end case; + end record; + + type PartialResultParams is interface; + + function partialResultToken + (Self : PartialResultParams) + return LSP.Structures.ProgressToken_Optional is abstract; + -- An optional token that a server can use to report partial results (e.g. + -- streaming) to the client. + + type StaticRegistrationOptions is interface; + -- Static registration options to be returned in the initialize request. + + function id + (Self : StaticRegistrationOptions) + return Virtual_String_Optional is abstract; + -- The id used to register the request. The id can be used to deregister + -- the request again. See also Registration#id. + + type WorkDoneProgressOptions is interface; + + function workDoneProgress + (Self : WorkDoneProgressOptions) return Boolean_Optional is abstract; + + type WorkDoneProgressParams is interface; + + function workDoneToken + (Self : WorkDoneProgressParams) + return LSP.Structures.ProgressToken_Optional is abstract; + -- An optional token that a server can use to report work done progress. + + type Position is record + line : Natural; + -- Line position in a document (zero-based). + -- + -- If a line number is greater than the number of lines in a document, + -- it defaults back to the number of lines in the document. If a line + -- number is negative, it defaults to 0. + + character : Natural; + -- Character offset on a line in a document (zero-based). + -- + -- The meaning of this offset is determined by the negotiated + -- `PositionEncodingKind`. + -- + -- If the character value is greater than the line length it defaults + -- back to the line length. + + end record; + -- Position in a text document expressed as zero-based line and character + -- offset. Prior to 3.17 the offsets were always based on a UTF-16 string + -- representation. So a string of the form `a["010400"]b` the character + -- offset of the character `a` is 0, the character offset of `["010400"]` + -- is 1 and the character offset of b is 3 since `["010400"]` is + -- represented using two code units in UTF-16. Since 3.17 clients and + -- servers can agree on a different string encoding representation (e.g. + -- UTF-8). The client announces it's supported encoding via the client + -- capability [`general.positionEncodings`](#clientCapabilities). The value + -- is an array of position encodings the client supports, with decreasing + -- preference (e.g. the encoding at index `0` is the most preferred one). + -- To stay backwards compatible the only mandatory encoding is UTF-16 + -- represented via the string `utf-16`. The server can pick one of + -- the encodings offered by the client and signals that encoding + -- back to the client via the initialize result's property + -- [`capabilities.positionEncoding`](#serverCapabilities). If the + -- string value `utf-16` is missing from the client's capability + -- `general.positionEncodings` servers can safely assume that the client + -- supports UTF-16. If the server omits the position encoding in its + -- initialize result the encoding defaults to the string value `utf-16`. + -- Implementation considerations: since the conversion from one encoding + -- into another requires the content of the file / line the conversion is + -- best done where the file is read which is usually on the server side. + -- + -- Positions are line end character agnostic. So you can not specify + -- a position that denotes `\r|\n` or `\n|` where `|` represents the + -- character offset. + -- + -- @since 3.17.0 - support for negotiated position encoding. + + type A_Range is record + start : LSP.Structures.Position; + -- The range's start position. + + an_end : LSP.Structures.Position; + -- The range's end position. + + end record; + -- A range in a text document expressed as (zero-based) start and end + -- positions. + -- + -- If you want to specify a range that contains a line including the line + -- ending character(s) then use an end position denoting the start of the + -- next line. For example: ```ts { + -- start: { line: 5, character: 23 } + -- end : { line 6, character : 0 } + -- } + -- ``` + + type TextEdit is tagged record + a_range : LSP.Structures.A_Range; + -- The range of the text document to be manipulated. To insert text into + -- a document create a range where start === end. + + newText : LSP.Structures.Virtual_String; + -- The string to be inserted. For delete operations use an empty string. + + end record; + -- A text edit applicable to a text document. + + type ChangeAnnotationIdentifier is + new VSS.Strings.Virtual_String with null record; + -- An identifier to refer to a change annotation stored with a workspace + -- edit. + + function Get_Hash + (Self : ChangeAnnotationIdentifier) return Ada.Containers.Hash_Type is + (Ada.Containers.Hash_Type'Mod (Self.Hash)); + + type AnnotatedTextEdit is new TextEdit with record + annotationId : LSP.Structures.ChangeAnnotationIdentifier; + -- The actual identifier of the change annotation + + end record; + -- A special text edit with an additional change annotation. + -- + -- @since 3.16.0. + + type RenameFileOptions is record + overwrite : Boolean_Optional; + -- Overwrite target if existing. Overwrite wins over `ignoreIfExists` + + ignoreIfExists : Boolean_Optional; + -- Ignores if target exists. + + end record; + -- Rename file options + + type RenameFileOptions_Optional (Is_Set : Boolean := False) is record + case Is_Set is + when False => + null; + when True => + Value : RenameFileOptions; + end case; + end record; + + type ChangeAnnotationIdentifier_Optional (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : ChangeAnnotationIdentifier; + end case; + end record; + + type ResourceOperation is tagged record + kind : LSP.Structures.Virtual_String; + -- The resource operation kind. + + annotationId : ChangeAnnotationIdentifier_Optional; + -- An optional annotation identifier describing the operation. + -- + -- @since 3.16.0 + + end record; + -- A generic resource operation. + + type RenameFile is new ResourceOperation with record + oldUri : LSP.Structures.DocumentUri; + -- The old (existing) location. + + newUri : LSP.Structures.DocumentUri; + -- The new location. + + options : RenameFileOptions_Optional; + -- Rename options. + + end record; + -- Rename file operation + + type TextDocumentIdentifier is tagged record + uri : LSP.Structures.DocumentUri; + -- The text document's uri. + + end record; + -- A literal to identify a text document in the client. + + type Null_Record is null record; + + type Integer_Or_Null (Is_Null : Boolean := True) is record + case Is_Null is + when True => + null; + when False => + Value : Standard.Integer; + end case; + end record; + + type OptionalVersionedTextDocumentIdentifier is + new TextDocumentIdentifier with record + version : LSP.Structures.Integer_Or_Null; + -- The version number of this document. If a versioned text document + -- identifier is sent from the server to the client and the file is not + -- open in the editor (the server has not received an open notification + -- before) the server can send `null` to indicate that the version + -- is unknown and the content on disk is the truth (as specified + -- with document content ownership). + + end record; + -- A text document identifier to optionally denote a specific version of a + -- text document. + + type TextEdit_Or_AnnotatedTextEdit (Is_TextEdit : Boolean := True) is record + case Is_TextEdit is + when True => + TextEdit : LSP.Structures.TextEdit; + when False => + AnnotatedTextEdit : LSP.Structures.AnnotatedTextEdit; + end case; + end record; + + package TextEdit_Or_AnnotatedTextEdit_Vectors is new Ada.Containers.Vectors + (Positive, TextEdit_Or_AnnotatedTextEdit, "="); + + type TextEdit_Or_AnnotatedTextEdit_Vector is + new TextEdit_Or_AnnotatedTextEdit_Vectors.Vector with null record; + + type TextDocumentEdit is record + textDocument : LSP.Structures.OptionalVersionedTextDocumentIdentifier; + -- The text document to change. + + edits : LSP.Structures.TextEdit_Or_AnnotatedTextEdit_Vector; + -- The edits to be applied. + -- + -- @since 3.16.0 - support for AnnotatedTextEdit. This is guarded using + -- a client capability. + + end record; + -- Describes textual changes on a text document. A TextDocumentEdit + -- describes all changes on a document version Si and after they are + -- applied move the document to version Si+1. So the creator of a + -- TextDocumentEdit doesn't need to sort the array of edits or do any + -- kind of ordering. However the edits must be non overlapping. + + type DeleteFileOptions is record + recursive : Boolean_Optional; + -- Delete the content recursively if a folder is denoted. + + ignoreIfNotExists : Boolean_Optional; + -- Ignore the operation if the file doesn't exist. + + end record; + -- Delete file options + + type DeleteFileOptions_Optional (Is_Set : Boolean := False) is record + case Is_Set is + when False => + null; + when True => + Value : DeleteFileOptions; + end case; + end record; + + type DeleteFile is new ResourceOperation with record + uri : LSP.Structures.DocumentUri; + -- The file to delete. + + options : DeleteFileOptions_Optional; + -- Delete options. + + end record; + -- Delete file operation + + type CreateFileOptions is record + overwrite : Boolean_Optional; + -- Overwrite existing file. Overwrite wins over `ignoreIfExists` + + ignoreIfExists : Boolean_Optional; + -- Ignore if exists. + + end record; + -- Options to create a file. + + type CreateFileOptions_Optional (Is_Set : Boolean := False) is record + case Is_Set is + when False => + null; + when True => + Value : CreateFileOptions; + end case; + end record; + + type CreateFile is new ResourceOperation with record + uri : LSP.Structures.DocumentUri; + -- The resource to create. + + options : CreateFileOptions_Optional; + -- Additional options + + end record; + -- Create file operation. + + type ChangeAnnotation is record + label : LSP.Structures.Virtual_String; + -- A human-readable string describing the actual change. The string is + -- rendered prominent in the user interface. + + needsConfirmation : Boolean_Optional; + -- A flag which indicates that user confirmation is needed before + -- applying the change. + + description : Virtual_String_Optional; + -- A human-readable string which is rendered less prominent in the user + -- interface. + + end record; + -- Additional information that describes document changes. + -- + -- @since 3.16.0 + + package TextEdit_Vectors is new Ada.Containers.Vectors + (Positive, TextEdit, "="); + + type TextEdit_Vector is new TextEdit_Vectors.Vector with null record; + + package TextEdit_Vector_Maps is new Ada.Containers.Hashed_Maps + (DocumentUri, TextEdit_Vector, Get_Hash, "="); + + type changes_OfWorkspaceEdit is + new TextEdit_Vector_Maps.Map with null record; + + type documentChanges_OfWorkspaceEdit_Item_Variant is + (Varian_1, create, rename, delete); + + type documentChanges_OfWorkspaceEdit_Item + (Kind : documentChanges_OfWorkspaceEdit_Item_Variant := + documentChanges_OfWorkspaceEdit_Item_Variant'First) + is + record + case Kind is + when Varian_1 => + Varian_1 : LSP.Structures.TextDocumentEdit; + when create => + create : LSP.Structures.CreateFile; + when rename => + rename : LSP.Structures.RenameFile; + when delete => + delete : LSP.Structures.DeleteFile; + end case; + end record; + + package documentChanges_OfWorkspaceEdit_Item_Vectors is new Ada.Containers + .Vectors + (Positive, documentChanges_OfWorkspaceEdit_Item, "="); + + type documentChanges_OfWorkspaceEdit is + new documentChanges_OfWorkspaceEdit_Item_Vectors.Vector with null record; + + package ChangeAnnotation_Maps is new Ada.Containers.Hashed_Maps + (ChangeAnnotationIdentifier, ChangeAnnotation, Get_Hash, "="); + + type changeAnnotations_OfWorkspaceEdit is + new ChangeAnnotation_Maps.Map with null record; + + type WorkspaceEdit is record + changes : LSP.Structures.changes_OfWorkspaceEdit; + -- Holds changes to existing resources. + + documentChanges : LSP.Structures.documentChanges_OfWorkspaceEdit; + -- Depending on the client capability + -- `workspace.workspaceEdit.resourceOperations` document changes are + -- either an array of `TextDocumentEdit`s to express changes to n + -- different text documents where each text document edit addresses + -- a specific version of a text document. Or it can contain above + -- `TextDocumentEdit`s mixed with create, rename and delete file / + -- folder operations. + -- + -- Whether a client supports versioned document edits is expressed via + -- `workspace.workspaceEdit.documentChanges` client capability. + -- + -- If a client neither supports `documentChanges` nor + -- `workspace.workspaceEdit.resourceOperations` then only + -- plain `TextEdit`s using the `changes` property are supported. + + changeAnnotations : LSP.Structures.changeAnnotations_OfWorkspaceEdit; + -- A map of change annotations that can be referenced in + -- `AnnotatedTextEdit`s or create, rename and delete file / + -- folder operations. + -- + -- Whether clients honor this property depends on the client capability + -- `workspace.changeAnnotationSupport`. + -- + -- @since 3.16.0 + + end record; + -- A workspace edit represents changes to many resources managed + -- in the workspace. The edit should either provide `changes` or + -- `documentChanges`. If documentChanges are present they are preferred + -- over `changes` if the client can handle versioned document edits. + -- + -- Since version 3.13.0 a workspace edit can contain resource operations + -- as well. If resource operations are present clients need to execute the + -- operations in the order in which they are provided. So a workspace edit + -- for example can consist of the following two changes: (1) a create file + -- a.txt and (2) a text document edit which insert text into file a.txt. + -- + -- An invalid sequence (e.g. (1) delete file a.txt and (2) insert text + -- into file a.txt) will cause failure of the operation. How the client + -- recovers from the failure is described by the client capability: + -- `workspace.workspaceEdit.failureHandling` + + type ApplyWorkspaceEditParams is record + label : Virtual_String_Optional; + -- An optional label of the workspace edit. This label is presented in + -- the user interface for example on an undo stack to undo the workspace + -- edit. + + edit : LSP.Structures.WorkspaceEdit; + -- The edits to apply. + + end record; + -- The parameters passed via a apply workspace edit request. + + type ApplyWorkspaceEditResult is record + applied : Standard.Boolean; + -- Indicates whether the edit was applied or not. + + failureReason : Virtual_String_Optional; + -- An optional textual description for why the edit was not applied. + -- This may be used by the server for diagnostic logging or to provide + -- a suitable error for a request that triggered the edit. + + failedChange : Natural_Optional; + -- Depending on the client's failure handling strategy `failedChange` + -- might contain the index of the change that failed. This property is + -- only available if the client signals a `failureHandlingStrategy` in + -- its client capabilities. + + end record; + -- The result returned from the apply workspace edit request. + -- + -- @since 3.17 renamed from ApplyWorkspaceEditResponse + + type SymbolTag_Set is array (SymbolTag) of Boolean with + Pack, Default_Component_Value => False; + + type BaseSymbolInformation is tagged record + name : LSP.Structures.Virtual_String; + -- The name of this symbol. + + kind : LSP.Enumerations.SymbolKind; + -- The kind of this symbol. + + tags : LSP.Structures.SymbolTag_Set; + -- Tags for this symbol. + -- + -- @since 3.16.0 + + containerName : Virtual_String_Optional; + -- The name of the symbol containing this symbol. This information is + -- for user interface purposes (e.g. to render a qualifier in the user + -- interface if necessary). It can't be used to re-infer a hierarchy for + -- the document symbols. + + end record; + -- A base for all symbol information. + + type CallHierarchyClientCapabilities is record + dynamicRegistration : Boolean_Optional; + -- Whether implementation supports dynamic registration. + -- If this is set to `true` the client supports the new + -- `(TextDocumentRegistrationOptions & StaticRegistrationOptions)` + -- return value for the corresponding server capability as well. + + end record; + -- @since 3.16.0 + + type LSPAny is new JSON_Event_Vectors.Vector with null record; + -- The LSP any type. + -- Please note that strictly speaking a property with the value `undefined` + -- can't be converted into JSON preserving the property name. However for + -- convenience it is allowed and assumed that all these properties are + -- optional as well. @since 3.17.0 + + subtype LSPAny_Vector is LSPAny; + + subtype LSPAny_Optional is LSPAny; + + type CallHierarchyItem is record + name : LSP.Structures.Virtual_String; + -- The name of this item. + + kind : LSP.Enumerations.SymbolKind; + -- The kind of this item. + + tags : LSP.Structures.SymbolTag_Set; + -- Tags for this item. + + detail : Virtual_String_Optional; + -- More detail for this item, e.g. the signature of a function. + + uri : LSP.Structures.DocumentUri; + -- The resource identifier of this item. + + a_range : LSP.Structures.A_Range; + -- The range enclosing this symbol not including leading/trailing + -- whitespace but everything else, e.g. comments and code. + + selectionRange : LSP.Structures.A_Range; + -- The range that should be selected and revealed when this symbol is + -- being picked, e.g. the name of a function. Must be contained by the + -- [`range`](#CallHierarchyItem.range). + + data : LSPAny_Optional; + -- A data entry field that is preserved between a call hierarchy prepare + -- and incoming calls or outgoing calls requests. + + end record; + -- Represents programming constructs like functions or constructors in the + -- context of call hierarchy. + -- + -- @since 3.16.0 + + package Range_Vectors is new Ada.Containers.Vectors + (Positive, A_Range, "="); + + type Range_Vector is new Range_Vectors.Vector with null record; + + type CallHierarchyIncomingCall is record + from : LSP.Structures.CallHierarchyItem; + -- The item that makes the call. + + fromRanges : LSP.Structures.Range_Vector; + -- The ranges at which the calls appear. This is relative to the caller + -- denoted by [`this.from`](#CallHierarchyIncomingCall.from). + + end record; + -- Represents an incoming call, e.g. a caller of a method or constructor. + -- + -- @since 3.16.0 + + type CallHierarchyIncomingCallsParams is + new WorkDoneProgressParams and PartialResultParams with record + workDoneToken : ProgressToken_Optional; + -- An optional token that a server can use to report work done progress. + + partialResultToken : ProgressToken_Optional; + -- An optional token that a server can use to report partial results + -- (e.g. streaming) to the client. + + item : LSP.Structures.CallHierarchyItem; + + end record; + -- The parameter of a `callHierarchy/incomingCalls` request. + -- + -- @since 3.16.0 + + overriding function workDoneToken + (Self : CallHierarchyIncomingCallsParams) + return LSP.Structures.ProgressToken_Optional is + (Self.workDoneToken); + + overriding function partialResultToken + (Self : CallHierarchyIncomingCallsParams) + return LSP.Structures.ProgressToken_Optional is + (Self.partialResultToken); + + type CallHierarchyOptions is new WorkDoneProgressOptions with record + workDoneProgress : Boolean_Optional; + + end record; + -- Call hierarchy options used during static registration. + -- + -- @since 3.16.0 + + overriding function workDoneProgress + (Self : CallHierarchyOptions) return Boolean_Optional is + (Self.workDoneProgress); + + type CallHierarchyOutgoingCall is record + to : LSP.Structures.CallHierarchyItem; + -- The item that is called. + + fromRanges : LSP.Structures.Range_Vector; + -- The range at which this item is called. This is the + -- range relative to the caller, e.g the item passed to + -- [`provideCallHierarchyOutgoingCalls`](#CallHierarchyItemProvider.provideCallHierarchyOutgoingCalls) + -- and not [`this.to`](#CallHierarchyOutgoingCall.to). + + end record; + -- Represents an outgoing call, e.g. calling a getter from a method or a + -- method from a constructor etc. + -- + -- @since 3.16.0 + + type CallHierarchyOutgoingCallsParams is + new WorkDoneProgressParams and PartialResultParams with record + workDoneToken : ProgressToken_Optional; + -- An optional token that a server can use to report work done progress. + + partialResultToken : ProgressToken_Optional; + -- An optional token that a server can use to report partial results + -- (e.g. streaming) to the client. + + item : LSP.Structures.CallHierarchyItem; + + end record; + -- The parameter of a `callHierarchy/outgoingCalls` request. + -- + -- @since 3.16.0 + + overriding function workDoneToken + (Self : CallHierarchyOutgoingCallsParams) + return LSP.Structures.ProgressToken_Optional is + (Self.workDoneToken); + + overriding function partialResultToken + (Self : CallHierarchyOutgoingCallsParams) + return LSP.Structures.ProgressToken_Optional is + (Self.partialResultToken); + + type TextDocumentPositionParams is tagged record + textDocument : LSP.Structures.TextDocumentIdentifier; + -- The text document. + + position : LSP.Structures.Position; + -- The position inside the text document. + + end record; + -- A parameter literal used in requests to pass a text document and a + -- position inside that document. + + type CallHierarchyPrepareParams is + new TextDocumentPositionParams and WorkDoneProgressParams with record + workDoneToken : ProgressToken_Optional; + -- An optional token that a server can use to report work done progress. + + end record; + -- The parameter of a `textDocument/prepareCallHierarchy` request. + -- + -- @since 3.16.0 + + overriding function workDoneToken + (Self : CallHierarchyPrepareParams) + return LSP.Structures.ProgressToken_Optional is + (Self.workDoneToken); + + type TextDocumentFilter is record + language : Virtual_String_Optional; + -- A language id, like `typescript`. */ + + scheme : Virtual_String_Optional; + -- A Uri [scheme](#Uri.scheme), like `file` or `untitled`. */ + + pattern : Virtual_String_Optional; + -- A glob pattern, like `*.{ts,js}`. */ + + end record; + -- A document filter denotes a document by different properties like + -- the [language](#TextDocument.languageId), the [scheme](#Uri.scheme) + -- of its resource, or a glob-pattern that is applied to the + -- [path](#TextDocument.fileName). + -- + -- Glob patterns can have the following syntax: - `*` to match one or + -- more characters in a path segment - `?` to match on one character in + -- a path segment - `**` to match any number of path segments, including + -- none - `{}` to group sub patterns into an OR expression. (e.g. + -- `**["200B"]/*.{ts,js}` matches all TypeScript and JavaScript files) - + -- `[]` to declare a range of characters to match in a path segment (e.g., + -- `example.[0-9]` to match on `example.0`, `example.1`, ["2026"]) - + -- `[!...]` to negate a range of characters to match in a path segment + -- (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but not + -- `example.0`) + -- + -- @sample A language filter that applies to typescript files on disk: + -- `{ language: 'typescript', scheme: 'file' }` @sample A language filter + -- that applies to all package.json paths: `{ language: 'json', pattern: + -- '**package.json' }` + -- + -- @since 3.17.0 + + type NotebookDocumentFilter is record + notebookType : Virtual_String_Optional; + -- The type of the enclosing notebook. */ + + scheme : Virtual_String_Optional; + -- A Uri [scheme](#Uri.scheme), like `file` or `untitled`. */ + + pattern : Virtual_String_Optional; + -- A glob pattern. */ + + end record; + -- A notebook document filter denotes a notebook document by different + -- properties. The properties will be match against the notebook's URI + -- (same as with documents) + -- + -- @since 3.17.0 + + type Virtual_String_Or_NotebookDocumentFilter + (Is_Virtual_String : Boolean := True) is + record + case Is_Virtual_String is + when True => + Virtual_String : LSP.Structures.Virtual_String; + when False => + NotebookDocumentFilter : LSP.Structures.NotebookDocumentFilter; + end case; + end record; + + type NotebookCellTextDocumentFilter is record + notebook : LSP.Structures.Virtual_String_Or_NotebookDocumentFilter; + -- A filter that matches against the notebook containing the notebook + -- cell. If a string value is provided it matches against the notebook + -- type. '*' matches every notebook. + + language : Virtual_String_Optional; + -- A language id like `python`. + -- + -- Will be matched against the language id of the notebook cell + -- document. '*' matches every language. + + end record; + -- A notebook cell text document filter denotes a cell text document by + -- different properties. + -- + -- @since 3.17.0 + + type DocumentFilter (Is_TextDocumentFilter : Boolean := True) is record + case Is_TextDocumentFilter is + when True => + TextDocumentFilter : LSP.Structures.TextDocumentFilter; + when False => + NotebookCellTextDocumentFilter : LSP.Structures + .NotebookCellTextDocumentFilter; + end case; + end record; + -- A document filter describes a top level text document or a notebook cell + -- document. + -- + -- @since 3.17.0 - proposed support for NotebookCellTextDocumentFilter. + + type Virtual_String_Or_DocumentFilter (Is_Virtual_String : Boolean := True) + is + record + case Is_Virtual_String is + when True => + Virtual_String : LSP.Structures.Virtual_String; + when False => + DocumentFilter : LSP.Structures.DocumentFilter; + end case; + end record; + + package Virtual_String_Or_DocumentFilter_Vectors is new Ada.Containers + .Vectors + (Positive, Virtual_String_Or_DocumentFilter, "="); + + type DocumentSelector is + new Virtual_String_Or_DocumentFilter_Vectors.Vector with null record; + + -- A document selector is the combination of one or many document filters. + -- + -- @sample `let sel:DocumentSelector = [{ language: 'typescript' }, { + -- language: 'json', pattern: '**["2215"]tsconfig.json' }]`; + -- + -- The use of a string as a document filter is deprecated @since 3.16.0. + + type DocumentSelector_Or_Null (Is_Null : Boolean := True) is record + case Is_Null is + when True => + null; + when False => + Value : DocumentSelector; + end case; + end record; + + type TextDocumentRegistrationOptions is tagged record + documentSelector : LSP.Structures.DocumentSelector_Or_Null; + -- A document selector to identify the scope of the registration. If + -- set to null the document selector provided on the client side will + -- be used. + + end record; + -- General text document registration options. + + type CallHierarchyRegistrationOptions is + new CallHierarchyOptions and StaticRegistrationOptions with record + id : Virtual_String_Optional; + -- The id used to register the request. The id can be used to deregister + -- the request again. See also Registration#id. + + Parent : LSP.Structures.TextDocumentRegistrationOptions; + end record; + -- Call hierarchy options used during static or dynamic registration. + -- + -- @since 3.16.0 + + overriding function id + (Self : CallHierarchyRegistrationOptions) + return Virtual_String_Optional is + (Self.id); + + type Integer_Or_Virtual_String (Is_Integer : Boolean := True) is record + case Is_Integer is + when True => + Integer : Standard.Integer; + when False => + Virtual_String : LSP.Structures.Virtual_String; + end case; + end record; + + type CancelParams is record + id : LSP.Structures.Integer_Or_Virtual_String; + -- The request id to cancel. + + end record; + + type ShowDocumentClientCapabilities is record + support : Standard.Boolean; + -- The client has support for the showDocument request. + + end record; + -- Client capabilities for the showDocument request. + -- + -- @since 3.16.0 + + type ShowDocumentClientCapabilities_Optional (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : ShowDocumentClientCapabilities; + end case; + end record; + + type messageActionItem_OfShowMessageRequestClientCapabilities is record + additionalPropertiesSupport : Boolean_Optional; + -- Whether the client supports additional attributes which are preserved + -- and send back to the server in the request's response. + + end record; + type messageActionItem_OfShowMessageRequestClientCapabilities_Optional + (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : messageActionItem_OfShowMessageRequestClientCapabilities; + end case; + end record; + + type ShowMessageRequestClientCapabilities is record + messageActionItem : messageActionItem_OfShowMessageRequestClientCapabilities_Optional; + -- Capabilities specific to the `MessageActionItem` type. + + end record; + -- Show message request client capabilities + + type ShowMessageRequestClientCapabilities_Optional + (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : ShowMessageRequestClientCapabilities; + end case; + end record; + + type WindowClientCapabilities is record + workDoneProgress : Boolean_Optional; + -- It indicates whether the client supports server initiated progress + -- using the `window/workDoneProgress/create` request. + -- + -- The capability also controls Whether client supports handling + -- of progress notifications. If set servers are allowed to report + -- a `workDoneProgress` property in the request specific server + -- capabilities. + -- + -- @since 3.15.0 + + showMessage : ShowMessageRequestClientCapabilities_Optional; + -- Capabilities specific to the showMessage request. + -- + -- @since 3.16.0 + + showDocument : ShowDocumentClientCapabilities_Optional; + -- Capabilities specific to the showDocument request. + -- + -- @since 3.16.0 + + end record; + + type WindowClientCapabilities_Optional (Is_Set : Boolean := False) is record + case Is_Set is + when False => + null; + when True => + Value : WindowClientCapabilities; + end case; + end record; + + type FailureHandlingKind_Optional (Is_Set : Boolean := False) is record + case Is_Set is + when False => + null; + when True => + Value : FailureHandlingKind; + end case; + end record; + + type ResourceOperationKind_Set is + array (ResourceOperationKind) of Boolean with + Pack, Default_Component_Value => False; + + type changeAnnotationSupport_OfWorkspaceEditClientCapabilities is record + groupsOnLabel : Boolean_Optional; + -- Whether the client groups edits with equal labels into tree nodes, + -- for instance all edits labelled with "Changes in Strings" would be + -- a tree node. + + end record; + type changeAnnotationSupport_OfWorkspaceEditClientCapabilities_Optional + (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : changeAnnotationSupport_OfWorkspaceEditClientCapabilities; + end case; + end record; + + type WorkspaceEditClientCapabilities is record + documentChanges : Boolean_Optional; + -- The client supports versioned document changes in `WorkspaceEdit`s + + resourceOperations : LSP.Structures.ResourceOperationKind_Set; + -- The resource operations the client supports. Clients should at least + -- support 'create', 'rename' and 'delete' files and folders. + -- + -- @since 3.13.0 + + failureHandling : FailureHandlingKind_Optional; + -- The failure handling strategy of a client if applying the workspace + -- edit fails. + -- + -- @since 3.13.0 + + normalizesLineEndings : Boolean_Optional; + -- Whether the client normalizes line endings to the client specific + -- setting. If set to `true` the client will normalize line ending + -- characters in a workspace edit to the client-specified new line + -- character. + -- + -- @since 3.16.0 + + changeAnnotationSupport : changeAnnotationSupport_OfWorkspaceEditClientCapabilities_Optional; + -- Whether the client in general supports change annotations on text + -- edits, create file, rename file and delete file changes. + -- + -- @since 3.16.0 + + end record; + + type WorkspaceEditClientCapabilities_Optional (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : WorkspaceEditClientCapabilities; + end case; + end record; + + type InlayHintWorkspaceClientCapabilities is record + refreshSupport : Boolean_Optional; + -- Whether the client implementation supports a refresh request sent + -- from the server to the client. + -- + -- Note that this event is global and will force the client to refresh + -- all inlay hints currently shown. It should be used with absolute + -- care and is useful for situation where a server for example detects + -- a project wide change that requires such a calculation. + + end record; + -- Client workspace capabilities specific to inlay hints. + -- + -- @since 3.17.0 + + type InlayHintWorkspaceClientCapabilities_Optional + (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : InlayHintWorkspaceClientCapabilities; + end case; + end record; + + type DiagnosticWorkspaceClientCapabilities is record + refreshSupport : Boolean_Optional; + -- Whether the client implementation supports a refresh request sent + -- from the server to the client. + -- + -- Note that this event is global and will force the client to refresh + -- all pulled diagnostics currently shown. It should be used with + -- absolute care and is useful for situation where a server for example + -- detects a project wide change that requires such a calculation. + + end record; + -- Workspace client capabilities specific to diagnostic pull requests. + -- + -- @since 3.17.0 + + type DiagnosticWorkspaceClientCapabilities_Optional + (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : DiagnosticWorkspaceClientCapabilities; + end case; + end record; + + type ExecuteCommandClientCapabilities is record + dynamicRegistration : Boolean_Optional; + -- Execute command supports dynamic registration. + + end record; + -- The client capabilities of a + -- [ExecuteCommandRequest](#ExecuteCommandRequest). + + type ExecuteCommandClientCapabilities_Optional (Is_Set : Boolean := False) + is + record + case Is_Set is + when False => + null; + when True => + Value : ExecuteCommandClientCapabilities; + end case; + end record; + + type DidChangeWatchedFilesClientCapabilities is record + dynamicRegistration : Boolean_Optional; + -- Did change watched files notification supports dynamic registration. + -- Please note that the current protocol doesn't support static + -- configuration for file changes from the server side. + + relativePatternSupport : Boolean_Optional; + -- Whether the client has support for {@link RelativePattern relative + -- pattern} or not. + -- + -- @since 3.17.0 + + end record; + + type DidChangeWatchedFilesClientCapabilities_Optional + (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : DidChangeWatchedFilesClientCapabilities; + end case; + end record; + + type InlineValueWorkspaceClientCapabilities is record + refreshSupport : Boolean_Optional; + -- Whether the client implementation supports a refresh request sent + -- from the server to the client. + -- + -- Note that this event is global and will force the client to refresh + -- all inline values currently shown. It should be used with absolute + -- care and is useful for situation where a server for example detects + -- a project wide change that requires such a calculation. + + end record; + -- Client workspace capabilities specific to inline values. + -- + -- @since 3.17.0 + + type InlineValueWorkspaceClientCapabilities_Optional + (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : InlineValueWorkspaceClientCapabilities; + end case; + end record; + + type FileOperationClientCapabilities is record + dynamicRegistration : Boolean_Optional; + -- Whether the client supports dynamic registration for file + -- requests/notifications. + + didCreate : Boolean_Optional; + -- The client has support for sending didCreateFiles notifications. + + willCreate : Boolean_Optional; + -- The client has support for sending willCreateFiles requests. + + didRename : Boolean_Optional; + -- The client has support for sending didRenameFiles notifications. + + willRename : Boolean_Optional; + -- The client has support for sending willRenameFiles requests. + + didDelete : Boolean_Optional; + -- The client has support for sending didDeleteFiles notifications. + + willDelete : Boolean_Optional; + -- The client has support for sending willDeleteFiles requests. + + end record; + -- Capabilities relating to events from file operations by the user in the + -- client. + -- + -- These events do not come from the file system, they come from user + -- operations like renaming a file in the UI. + -- + -- @since 3.16.0 + + type FileOperationClientCapabilities_Optional (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : FileOperationClientCapabilities; + end case; + end record; + + type DidChangeConfigurationClientCapabilities is record + dynamicRegistration : Boolean_Optional; + -- Did change configuration notification supports dynamic registration. + + end record; + + type DidChangeConfigurationClientCapabilities_Optional + (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : DidChangeConfigurationClientCapabilities; + end case; + end record; + + type SymbolKind_Set is array (SymbolKind) of Boolean with + Pack, Default_Component_Value => False; + + type symbolKind_OfWorkspaceSymbolClientCapabilities is record + valueSet : LSP.Structures.SymbolKind_Set; + -- The symbol kind values the client supports. When this property exists + -- the client also guarantees that it will handle values outside its set + -- gracefully and falls back to a default value when unknown. + -- + -- If this property is not present the client only supports the symbol + -- kinds from `File` to `Array` as defined in the initial version of the + -- protocol. + + end record; + type symbolKind_OfWorkspaceSymbolClientCapabilities_Optional + (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : symbolKind_OfWorkspaceSymbolClientCapabilities; + end case; + end record; + + type tagSupport_OfWorkspaceSymbolClientCapabilities is record + valueSet : LSP.Structures.SymbolTag_Set; + -- The tags supported by the client. + + end record; + type tagSupport_OfWorkspaceSymbolClientCapabilities_Optional + (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : tagSupport_OfWorkspaceSymbolClientCapabilities; + end case; + end record; + + type resolveSupport_OfWorkspaceSymbolClientCapabilities is record + properties : LSP.Structures.Virtual_String_Vector; + -- The properties that a client can resolve lazily. Usually + -- `location.range` + + end record; + type resolveSupport_OfWorkspaceSymbolClientCapabilities_Optional + (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : resolveSupport_OfWorkspaceSymbolClientCapabilities; + end case; + end record; + + type WorkspaceSymbolClientCapabilities is record + dynamicRegistration : Boolean_Optional; + -- Symbol request supports dynamic registration. + + symbolKind : symbolKind_OfWorkspaceSymbolClientCapabilities_Optional; + -- Specific capabilities for the `SymbolKind` in the `workspace/symbol` + -- request. + + tagSupport : tagSupport_OfWorkspaceSymbolClientCapabilities_Optional; + -- The client supports tags on `SymbolInformation`. Clients supporting + -- tags have to handle unknown tags gracefully. + -- + -- @since 3.16.0 + + resolveSupport : resolveSupport_OfWorkspaceSymbolClientCapabilities_Optional; + -- The client support partial workspace symbols. The client will send + -- the request `workspaceSymbol/resolve` to the server to resolve + -- additional properties. + -- + -- @since 3.17.0 + + end record; + -- Client capabilities for a + -- [WorkspaceSymbolRequest](#WorkspaceSymbolRequest). + + type WorkspaceSymbolClientCapabilities_Optional (Is_Set : Boolean := False) + is + record + case Is_Set is + when False => + null; + when True => + Value : WorkspaceSymbolClientCapabilities; + end case; + end record; + + type SemanticTokensWorkspaceClientCapabilities is record + refreshSupport : Boolean_Optional; + -- Whether the client implementation supports a refresh request sent + -- from the server to the client. + -- + -- Note that this event is global and will force the client to refresh + -- all semantic tokens currently shown. It should be used with absolute + -- care and is useful for situation where a server for example detects a + -- project wide change that requires such a calculation. + + end record; + -- @since 3.16.0 + + type SemanticTokensWorkspaceClientCapabilities_Optional + (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : SemanticTokensWorkspaceClientCapabilities; + end case; + end record; + + type CodeLensWorkspaceClientCapabilities is record + refreshSupport : Boolean_Optional; + -- Whether the client implementation supports a refresh request sent + -- from the server to the client. + -- + -- Note that this event is global and will force the client to refresh + -- all code lenses currently shown. It should be used with absolute + -- care and is useful for situation where a server for example detect + -- a project wide change that requires such a calculation. + + end record; + -- @since 3.16.0 + + type CodeLensWorkspaceClientCapabilities_Optional + (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : CodeLensWorkspaceClientCapabilities; + end case; + end record; + + type WorkspaceClientCapabilities is record + applyEdit : Boolean_Optional; + -- The client supports applying batch edits to the workspace by + -- supporting the request 'workspace/applyEdit' + + workspaceEdit : WorkspaceEditClientCapabilities_Optional; + -- Capabilities specific to `WorkspaceEdit`s. + + didChangeConfiguration : DidChangeConfigurationClientCapabilities_Optional; + -- Capabilities specific to the `workspace/didChangeConfiguration` + -- notification. + + didChangeWatchedFiles : DidChangeWatchedFilesClientCapabilities_Optional; + -- Capabilities specific to the `workspace/didChangeWatchedFiles` + -- notification. + + symbol : WorkspaceSymbolClientCapabilities_Optional; + -- Capabilities specific to the `workspace/symbol` request. + + executeCommand : ExecuteCommandClientCapabilities_Optional; + -- Capabilities specific to the `workspace/executeCommand` request. + + workspaceFolders : Boolean_Optional; + -- The client has support for workspace folders. + -- + -- @since 3.6.0 + + configuration : Boolean_Optional; + -- The client supports `workspace/configuration` requests. + -- + -- @since 3.6.0 + + semanticTokens : SemanticTokensWorkspaceClientCapabilities_Optional; + -- Capabilities specific to the semantic token requests scoped to the + -- workspace. + -- + -- @since 3.16.0. + + codeLens : CodeLensWorkspaceClientCapabilities_Optional; + -- Capabilities specific to the code lens requests scoped to the + -- workspace. + -- + -- @since 3.16.0. + + fileOperations : FileOperationClientCapabilities_Optional; + -- The client has support for file notifications/requests for user + -- operations on files. + -- + -- Since 3.16.0 + + inlineValue : InlineValueWorkspaceClientCapabilities_Optional; + -- Capabilities specific to the inline values requests scoped to the + -- workspace. + -- + -- @since 3.17.0. + + inlayHint : InlayHintWorkspaceClientCapabilities_Optional; + -- Capabilities specific to the inlay hint requests scoped to the + -- workspace. + -- + -- @since 3.17.0. + + diagnostics : DiagnosticWorkspaceClientCapabilities_Optional; + -- Capabilities specific to the diagnostic requests scoped to the + -- workspace. + -- + -- @since 3.17.0. + + end record; + -- Workspace specific client capabilities. + + type WorkspaceClientCapabilities_Optional (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : WorkspaceClientCapabilities; + end case; + end record; + + type RegularExpressionsClientCapabilities is record + engine : LSP.Structures.Virtual_String; + -- The engine's name. + + version : Virtual_String_Optional; + -- The engine's version. + + end record; + -- Client capabilities specific to regular expressions. + -- + -- @since 3.16.0 + + type RegularExpressionsClientCapabilities_Optional + (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : RegularExpressionsClientCapabilities; + end case; + end record; + + type MarkdownClientCapabilities is record + parser : LSP.Structures.Virtual_String; + -- The name of the parser. + + version : Virtual_String_Optional; + -- The version of the parser. + + allowedTags : LSP.Structures.Virtual_String_Vector; + -- A list of HTML tags that the client allows / supports in Markdown. + -- + -- @since 3.17.0 + + end record; + -- Client capabilities specific to the used markdown parser. + -- + -- @since 3.16.0 + + type MarkdownClientCapabilities_Optional (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : MarkdownClientCapabilities; + end case; + end record; + + type staleRequestSupport_OfGeneralClientCapabilities is record + cancel : Standard.Boolean; + -- The client will actively cancel the request. + + retryOnContentModified : LSP.Structures.Virtual_String_Vector; + -- The list of requests for which the client will retry the request if + -- it receives a response with error code `ContentModified` + + end record; + type staleRequestSupport_OfGeneralClientCapabilities_Optional + (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : staleRequestSupport_OfGeneralClientCapabilities; + end case; + end record; + + type PositionEncodingKind_Set is + array (PositionEncodingKind) of Boolean with + Pack, Default_Component_Value => False; + + type GeneralClientCapabilities is record + staleRequestSupport : staleRequestSupport_OfGeneralClientCapabilities_Optional; + -- Client capability that signals how the client handles stale requests + -- (e.g. a request for which the client will not process the response + -- anymore since the information is outdated). + -- + -- @since 3.17.0 + + regularExpressions : RegularExpressionsClientCapabilities_Optional; + -- Client capabilities specific to regular expressions. + -- + -- @since 3.16.0 + + markdown : MarkdownClientCapabilities_Optional; + -- Client capabilities specific to the client's markdown parser. + -- + -- @since 3.16.0 + + positionEncodings : LSP.Structures.PositionEncodingKind_Set; + -- The position encodings supported by the client. Client and server + -- have to agree on the same position encoding to ensure that offsets + -- (e.g. character position in a line) are interpreted the same on both + -- sides. + -- + -- To keep the protocol backwards compatible the following applies: if + -- the value 'utf-16' is missing from the array of position encodings + -- servers can assume that the client supports UTF-16. UTF-16 is + -- therefore a mandatory encoding. + -- + -- If omitted it defaults to ['utf-16']. + -- + -- Implementation considerations: since the conversion from one encoding + -- into another requires the content of the file / line the conversion + -- is best done where the file is read which is usually on the server + -- side. + -- + -- @since 3.17.0 + + end record; + -- General client capabilities. + -- + -- @since 3.16.0 + + type GeneralClientCapabilities_Optional (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : GeneralClientCapabilities; + end case; + end record; + + type NotebookDocumentSyncClientCapabilities is record + dynamicRegistration : Boolean_Optional; + -- Whether implementation supports dynamic registration. + -- If this is set to `true` the client supports the new + -- `(TextDocumentRegistrationOptions & StaticRegistrationOptions)` + -- return value for the corresponding server capability as well. + + executionSummarySupport : Boolean_Optional; + -- The client supports sending execution summary data per cell. + + end record; + -- Notebook specific client capabilities. + -- + -- @since 3.17.0 + + type NotebookDocumentClientCapabilities is record + synchronization : LSP.Structures.NotebookDocumentSyncClientCapabilities; + -- Capabilities specific to notebook document synchronization + -- + -- @since 3.17.0 + + end record; + -- Capabilities specific to the notebook document support. + -- + -- @since 3.17.0 + + type NotebookDocumentClientCapabilities_Optional (Is_Set : Boolean := False) + is + record + case Is_Set is + when False => + null; + when True => + Value : NotebookDocumentClientCapabilities; + end case; + end record; + + type DiagnosticClientCapabilities is record + dynamicRegistration : Boolean_Optional; + -- Whether implementation supports dynamic registration. + -- If this is set to `true` the client supports the new + -- `(TextDocumentRegistrationOptions & StaticRegistrationOptions)` + -- return value for the corresponding server capability as well. + + relatedDocumentSupport : Boolean_Optional; + -- Whether the clients supports related documents for document + -- diagnostic pulls. + + end record; + -- Client capabilities specific to diagnostic pull requests. + -- + -- @since 3.17.0 + + type DiagnosticClientCapabilities_Optional (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : DiagnosticClientCapabilities; + end case; + end record; + + type CodeLensClientCapabilities is record + dynamicRegistration : Boolean_Optional; + -- Whether code lens supports dynamic registration. + + end record; + -- The client capabilities of a [CodeLensRequest](#CodeLensRequest). + + type CodeLensClientCapabilities_Optional (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : CodeLensClientCapabilities; + end case; + end record; + + type InlayHintClientCapabilities is record + dynamicRegistration : Boolean_Optional; + -- Whether inlay hints support dynamic registration. + + resolveSupport : resolveSupport_OfWorkspaceSymbolClientCapabilities_Optional; + -- Indicates which properties a client can resolve lazily on an inlay + -- hint. + + end record; + -- Inlay hint client capabilities. + -- + -- @since 3.17.0 + + type InlayHintClientCapabilities_Optional (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : InlayHintClientCapabilities; + end case; + end record; + + type DeclarationClientCapabilities is record + dynamicRegistration : Boolean_Optional; + -- Whether declaration supports dynamic registration. If this is set to + -- `true` the client supports the new `DeclarationRegistrationOptions` + -- return value for the corresponding server capability as well. + + linkSupport : Boolean_Optional; + -- The client supports additional metadata in the form of declaration + -- links. + + end record; + -- @since 3.14.0 + + type DeclarationClientCapabilities_Optional (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : DeclarationClientCapabilities; + end case; + end record; + + type DocumentFormattingClientCapabilities is record + dynamicRegistration : Boolean_Optional; + -- Whether formatting supports dynamic registration. + + end record; + -- Client capabilities of a + -- [DocumentFormattingRequest](#DocumentFormattingRequest). + + type DocumentFormattingClientCapabilities_Optional + (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : DocumentFormattingClientCapabilities; + end case; + end record; + + type DiagnosticTag_Set is array (DiagnosticTag) of Boolean with + Pack, Default_Component_Value => False; + + type tagSupport_OfPublishDiagnosticsClientCapabilities is record + valueSet : LSP.Structures.DiagnosticTag_Set; + -- The tags supported by the client. + + end record; + type tagSupport_OfPublishDiagnosticsClientCapabilities_Optional + (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : tagSupport_OfPublishDiagnosticsClientCapabilities; + end case; + end record; + + type PublishDiagnosticsClientCapabilities is record + relatedInformation : Boolean_Optional; + -- Whether the clients accepts diagnostics with related information. + + tagSupport : tagSupport_OfPublishDiagnosticsClientCapabilities_Optional; + -- Client supports the tag property to provide meta data about a + -- diagnostic. Clients supporting tags have to handle unknown tags + -- gracefully. + -- + -- @since 3.15.0 + + versionSupport : Boolean_Optional; + -- Whether the client interprets the version property of the + -- `textDocument/publishDiagnostics` notification's parameter. + -- + -- @since 3.15.0 + + codeDescriptionSupport : Boolean_Optional; + -- Client supports a codeDescription property + -- + -- @since 3.16.0 + + dataSupport : Boolean_Optional; + -- Whether code action supports the `data` property which is + -- preserved between a `textDocument/publishDiagnostics` and + -- `textDocument/codeAction` request. + -- + -- @since 3.16.0 + + end record; + -- The publish diagnostic client capabilities. + + type PublishDiagnosticsClientCapabilities_Optional + (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : PublishDiagnosticsClientCapabilities; + end case; + end record; + + type LinkedEditingRangeClientCapabilities is record + dynamicRegistration : Boolean_Optional; + -- Whether implementation supports dynamic registration. + -- If this is set to `true` the client supports the new + -- `(TextDocumentRegistrationOptions & StaticRegistrationOptions)` + -- return value for the corresponding server capability as well. + + end record; + -- Client capabilities for the linked editing range request. + -- + -- @since 3.16.0 + + type LinkedEditingRangeClientCapabilities_Optional + (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : LinkedEditingRangeClientCapabilities; + end case; + end record; + + type CodeActionKind_Set is array (CodeActionKind) of Boolean with + Pack, Default_Component_Value => False; + + type codeActionKind_OfcodeActionLiteralSupport_OfCodeActionClientCapabilities is + record + valueSet : LSP.Structures.CodeActionKind_Set; + -- The code action kind values the client supports. When this property + -- exists the client also guarantees that it will handle values outside + -- its set gracefully and falls back to a default value when unknown. + + end record; + type codeActionLiteralSupport_OfCodeActionClientCapabilities is record + codeActionKind : LSP.Structures + .codeActionKind_OfcodeActionLiteralSupport_OfCodeActionClientCapabilities; + -- The code action kind is support with the following value set. + + end record; + type codeActionLiteralSupport_OfCodeActionClientCapabilities_Optional + (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : codeActionLiteralSupport_OfCodeActionClientCapabilities; + end case; + end record; + + type CodeActionClientCapabilities is record + dynamicRegistration : Boolean_Optional; + -- Whether code action supports dynamic registration. + + codeActionLiteralSupport : codeActionLiteralSupport_OfCodeActionClientCapabilities_Optional; + -- The client support code action literals of type `CodeAction` as + -- a valid response of the `textDocument/codeAction` request. If the + -- property is not set the request can only return `Command` literals. + -- + -- @since 3.8.0 + + isPreferredSupport : Boolean_Optional; + -- Whether code action supports the `isPreferred` property. + -- + -- @since 3.15.0 + + disabledSupport : Boolean_Optional; + -- Whether code action supports the `disabled` property. + -- + -- @since 3.16.0 + + dataSupport : Boolean_Optional; + -- Whether code action supports the `data` property which is preserved + -- between a `textDocument/codeAction` and a `codeAction/resolve` + -- request. + -- + -- @since 3.16.0 + + resolveSupport : resolveSupport_OfWorkspaceSymbolClientCapabilities_Optional; + -- Whether the client supports resolving additional code action + -- properties via a separate `codeAction/resolve` request. + -- + -- @since 3.16.0 + + honorsChangeAnnotations : Boolean_Optional; + -- Whether the client honors the change annotations in text edits and + -- resource operations returned via the `CodeAction#edit` property by + -- for example presenting the workspace edit in the user interface and + -- asking for confirmation. + -- + -- @since 3.16.0 + + end record; + -- The Client Capabilities of a [CodeActionRequest](#CodeActionRequest). + + type CodeActionClientCapabilities_Optional (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : CodeActionClientCapabilities; + end case; + end record; + + type DocumentColorClientCapabilities is record + dynamicRegistration : Boolean_Optional; + -- Whether implementation supports dynamic registration. + -- If this is set to `true` the client supports the new + -- `DocumentColorRegistrationOptions` return value for the + -- corresponding server capability as well. + + end record; + + type DocumentColorClientCapabilities_Optional (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : DocumentColorClientCapabilities; + end case; + end record; + + type DocumentLinkClientCapabilities is record + dynamicRegistration : Boolean_Optional; + -- Whether document link supports dynamic registration. + + tooltipSupport : Boolean_Optional; + -- Whether the client supports the `tooltip` property on `DocumentLink`. + -- + -- @since 3.15.0 + + end record; + -- The client capabilities of a + -- [DocumentLinkRequest](#DocumentLinkRequest). + + type DocumentLinkClientCapabilities_Optional (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : DocumentLinkClientCapabilities; + end case; + end record; + + type Boolean_Or_Any_Optional (Is_Set : Boolean := False) is record + case Is_Set is + when False => + null; + when True => + Value : Boolean_Or_Any; + end case; + end record; + + type Boolean_Or_Something (Is_Boolean : Boolean := True) is record + case Is_Boolean is + when True => + Boolean : Standard.Boolean; + when False => + a_delta : Boolean_Optional; + -- The client will send the + -- `textDocument/semanticTokens/full/delta` request if the + -- server provides a corresponding handler. + + end case; + end record; + + type Boolean_Or_Something_Optional (Is_Set : Boolean := False) is record + case Is_Set is + when False => + null; + when True => + Value : Boolean_Or_Something; + end case; + end record; + + type requests_OfSemanticTokensClientCapabilities is record + a_range : Boolean_Or_Any_Optional; + -- The client will send the `textDocument/semanticTokens/range` request + -- if the server provides a corresponding handler. + + full : Boolean_Or_Something_Optional; + -- The client will send the `textDocument/semanticTokens/full` request + -- if the server provides a corresponding handler. + + end record; + type TokenFormat_Set is array (TokenFormat) of Boolean with + Pack, Default_Component_Value => False; + + type SemanticTokensClientCapabilities is record + dynamicRegistration : Boolean_Optional; + -- Whether implementation supports dynamic registration. + -- If this is set to `true` the client supports the new + -- `(TextDocumentRegistrationOptions & StaticRegistrationOptions)` + -- return value for the corresponding server capability as well. + + requests : LSP.Structures.requests_OfSemanticTokensClientCapabilities; + -- Which requests the client supports and might send to the server + -- depending on the server's capability. Please note that clients might + -- not show semantic tokens or degrade some of the user experience if a + -- range or full request is advertised by the client but not provided by + -- the server. If for example the client capability `requests.full` and + -- `request.range` are both set to true but the server only provides + -- a range provider the client might not render a minimap correctly + -- or might even decide to not show any semantic tokens at all. + + tokenTypes : LSP.Structures.Virtual_String_Vector; + -- The token types that the client supports. + + tokenModifiers : LSP.Structures.Virtual_String_Vector; + -- The token modifiers that the client supports. + + formats : LSP.Structures.TokenFormat_Set; + -- The token formats the clients supports. + + overlappingTokenSupport : Boolean_Optional; + -- Whether the client supports tokens that can overlap each other. + + multilineTokenSupport : Boolean_Optional; + -- Whether the client supports tokens that can span multiple lines. + + serverCancelSupport : Boolean_Optional; + -- Whether the client allows the server to actively cancel a semantic + -- token request, e.g. supports returning LSPErrorCodes.ServerCancelled. + -- If a server does the client needs to retrigger the request. + -- + -- @since 3.17.0 + + augmentsSyntaxTokens : Boolean_Optional; + -- Whether the client uses semantic tokens to augment existing syntax + -- tokens. If set to `true` client side created syntax tokens and + -- semantic tokens are both used for colorization. If set to `false` + -- the client only uses the returned semantic tokens for colorization. + -- + -- If the value is `undefined` then the client behavior is not + -- specified. + -- + -- @since 3.17.0 + + end record; + -- @since 3.16.0 + + type SemanticTokensClientCapabilities_Optional (Is_Set : Boolean := False) + is + record + case Is_Set is + when False => + null; + when True => + Value : SemanticTokensClientCapabilities; + end case; + end record; + + package MarkupKind_Vectors is new Ada.Containers.Vectors + (Positive, MarkupKind, "="); + + type MarkupKind_Vector is new MarkupKind_Vectors.Vector with null record; + + type HoverClientCapabilities is record + dynamicRegistration : Boolean_Optional; + -- Whether hover supports dynamic registration. + + contentFormat : LSP.Structures.MarkupKind_Vector; + -- Client supports the following content formats for the content + -- property. The order describes the preferred format of the client. + + end record; + + type HoverClientCapabilities_Optional (Is_Set : Boolean := False) is record + case Is_Set is + when False => + null; + when True => + Value : HoverClientCapabilities; + end case; + end record; + + type TypeDefinitionClientCapabilities is record + dynamicRegistration : Boolean_Optional; + -- Whether implementation supports dynamic registration. + -- If this is set to `true` the client supports the new + -- `TypeDefinitionRegistrationOptions` return value for + -- the corresponding server capability as well. + + linkSupport : Boolean_Optional; + -- The client supports additional metadata in the form of definition + -- links. + -- + -- Since 3.14.0 + + end record; + -- Since 3.6.0 + + type TypeDefinitionClientCapabilities_Optional (Is_Set : Boolean := False) + is + record + case Is_Set is + when False => + null; + when True => + Value : TypeDefinitionClientCapabilities; + end case; + end record; + + type DocumentOnTypeFormattingClientCapabilities is record + dynamicRegistration : Boolean_Optional; + -- Whether on type formatting supports dynamic registration. + + end record; + -- Client capabilities of a + -- [DocumentOnTypeFormattingRequest](#DocumentOnTypeFormattingRequest). + + type DocumentOnTypeFormattingClientCapabilities_Optional + (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : DocumentOnTypeFormattingClientCapabilities; + end case; + end record; + + type FoldingRangeKind_Set is array (FoldingRangeKind) of Boolean with + Pack, Default_Component_Value => False; + + type foldingRangeKind_OfFoldingRangeClientCapabilities is record + valueSet : LSP.Structures.FoldingRangeKind_Set; + -- The folding range kind values the client supports. When this property + -- exists the client also guarantees that it will handle values outside + -- its set gracefully and falls back to a default value when unknown. + + end record; + type foldingRangeKind_OfFoldingRangeClientCapabilities_Optional + (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : foldingRangeKind_OfFoldingRangeClientCapabilities; + end case; + end record; + + type foldingRange_OfFoldingRangeClientCapabilities is record + collapsedText : Boolean_Optional; + -- If set, the client signals that it supports setting collapsedText on + -- folding ranges to display custom labels instead of the default text. + -- + -- @since 3.17.0 + + end record; + type foldingRange_OfFoldingRangeClientCapabilities_Optional + (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : foldingRange_OfFoldingRangeClientCapabilities; + end case; + end record; + + type FoldingRangeClientCapabilities is record + dynamicRegistration : Boolean_Optional; + -- Whether implementation supports dynamic registration for folding + -- range providers. If this is set to `true` the client supports the new + -- `FoldingRangeRegistrationOptions` return value for the corresponding + -- server capability as well. + + rangeLimit : Natural_Optional; + -- The maximum number of folding ranges that the client prefers to + -- receive per document. The value serves as a hint, servers are free + -- to follow the limit. + + lineFoldingOnly : Boolean_Optional; + -- If set, the client signals that it only supports folding complete + -- lines. If set, client will ignore specified `startCharacter` and + -- `endCharacter` properties in a FoldingRange. + + foldingRangeKind : foldingRangeKind_OfFoldingRangeClientCapabilities_Optional; + -- Specific options for the folding range kind. + -- + -- @since 3.17.0 + + foldingRange : foldingRange_OfFoldingRangeClientCapabilities_Optional; + -- Specific options for the folding range. + -- + -- @since 3.17.0 + + end record; + + type FoldingRangeClientCapabilities_Optional (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : FoldingRangeClientCapabilities; + end case; + end record; + + type CallHierarchyClientCapabilities_Optional (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : CallHierarchyClientCapabilities; + end case; + end record; + + type DefinitionClientCapabilities is record + dynamicRegistration : Boolean_Optional; + -- Whether definition supports dynamic registration. + + linkSupport : Boolean_Optional; + -- The client supports additional metadata in the form of definition + -- links. + -- + -- @since 3.14.0 + + end record; + -- Client Capabilities for a [DefinitionRequest](#DefinitionRequest). + + type DefinitionClientCapabilities_Optional (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : DefinitionClientCapabilities; + end case; + end record; + + type TextDocumentSyncClientCapabilities is record + dynamicRegistration : Boolean_Optional; + -- Whether text document synchronization supports dynamic registration. + + willSave : Boolean_Optional; + -- The client supports sending will save notifications. + + willSaveWaitUntil : Boolean_Optional; + -- The client supports sending a will save request and waits for a + -- response providing text edits which will be applied to the document + -- before it is saved. + + didSave : Boolean_Optional; + -- The client supports did save notifications. + + end record; + + type TextDocumentSyncClientCapabilities_Optional (Is_Set : Boolean := False) + is + record + case Is_Set is + when False => + null; + when True => + Value : TextDocumentSyncClientCapabilities; + end case; + end record; + + type PrepareSupportDefaultBehavior_Optional (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : PrepareSupportDefaultBehavior; + end case; + end record; + + type RenameClientCapabilities is record + dynamicRegistration : Boolean_Optional; + -- Whether rename supports dynamic registration. + + prepareSupport : Boolean_Optional; + -- Client supports testing for validity of rename operations before + -- execution. + -- + -- @since 3.12.0 + + prepareSupportDefaultBehavior : PrepareSupportDefaultBehavior_Optional; + -- Client supports the default behavior result. + -- + -- The value indicates the default behavior used by the client. + -- + -- @since 3.16.0 + + honorsChangeAnnotations : Boolean_Optional; + -- Whether the client honors the change annotations in text edits and + -- resource operations returned via the rename request's workspace edit + -- by for example presenting the workspace edit in the user interface + -- and asking for confirmation. + -- + -- @since 3.16.0 + + end record; + + type RenameClientCapabilities_Optional (Is_Set : Boolean := False) is record + case Is_Set is + when False => + null; + when True => + Value : RenameClientCapabilities; + end case; + end record; + + type TypeHierarchyClientCapabilities is record + dynamicRegistration : Boolean_Optional; + -- Whether implementation supports dynamic registration. + -- If this is set to `true` the client supports the new + -- `(TextDocumentRegistrationOptions & StaticRegistrationOptions)` + -- return value for the corresponding server capability as well. + + end record; + -- @since 3.17.0 + + type TypeHierarchyClientCapabilities_Optional (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : TypeHierarchyClientCapabilities; + end case; + end record; + + type ReferenceClientCapabilities is record + dynamicRegistration : Boolean_Optional; + -- Whether references supports dynamic registration. + + end record; + -- Client Capabilities for a [ReferencesRequest](#ReferencesRequest). + + type ReferenceClientCapabilities_Optional (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : ReferenceClientCapabilities; + end case; + end record; + + type DocumentRangeFormattingClientCapabilities is record + dynamicRegistration : Boolean_Optional; + -- Whether range formatting supports dynamic registration. + + end record; + -- Client capabilities of a + -- [DocumentRangeFormattingRequest](#DocumentRangeFormattingRequest). + + type DocumentRangeFormattingClientCapabilities_Optional + (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : DocumentRangeFormattingClientCapabilities; + end case; + end record; + + type parameterInformation_OfsignatureInformation_OfSignatureHelpClientCapabilities is + record + labelOffsetSupport : Boolean_Optional; + -- The client supports processing label offsets instead of a simple + -- label string. + -- + -- @since 3.14.0 + + end record; + type parameterInformation_OfsignatureInformation_OfSignatureHelpClientCapabilities_Optional + (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : parameterInformation_OfsignatureInformation_OfSignatureHelpClientCapabilities; + end case; + end record; + + type signatureInformation_OfSignatureHelpClientCapabilities is record + documentationFormat : LSP.Structures.MarkupKind_Vector; + -- Client supports the following content formats for the documentation + -- property. The order describes the preferred format of the client. + + parameterInformation : parameterInformation_OfsignatureInformation_OfSignatureHelpClientCapabilities_Optional; + -- Client capabilities specific to parameter information. + + activeParameterSupport : Boolean_Optional; + -- The client supports the `activeParameter` property on + -- `SignatureInformation` literal. + -- + -- @since 3.16.0 + + end record; + type signatureInformation_OfSignatureHelpClientCapabilities_Optional + (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : signatureInformation_OfSignatureHelpClientCapabilities; + end case; + end record; + + type SignatureHelpClientCapabilities is record + dynamicRegistration : Boolean_Optional; + -- Whether signature help supports dynamic registration. + + signatureInformation : signatureInformation_OfSignatureHelpClientCapabilities_Optional; + -- The client supports the following `SignatureInformation` specific + -- properties. + + contextSupport : Boolean_Optional; + -- The client supports to send additional context information for + -- a `textDocument/signatureHelp` request. A client that opts into + -- contextSupport will also support the `retriggerCharacters` on + -- `SignatureHelpOptions`. + -- + -- @since 3.15.0 + + end record; + -- Client Capabilities for a [SignatureHelpRequest](#SignatureHelpRequest). + + type SignatureHelpClientCapabilities_Optional (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : SignatureHelpClientCapabilities; + end case; + end record; + + type ImplementationClientCapabilities is record + dynamicRegistration : Boolean_Optional; + -- Whether implementation supports dynamic registration. + -- If this is set to `true` the client supports the new + -- `ImplementationRegistrationOptions` return value for + -- the corresponding server capability as well. + + linkSupport : Boolean_Optional; + -- The client supports additional metadata in the form of definition + -- links. + -- + -- @since 3.14.0 + + end record; + -- @since 3.6.0 + + type ImplementationClientCapabilities_Optional (Is_Set : Boolean := False) + is + record + case Is_Set is + when False => + null; + when True => + Value : ImplementationClientCapabilities; + end case; + end record; + + type MonikerClientCapabilities is record + dynamicRegistration : Boolean_Optional; + -- Whether moniker supports dynamic registration. If this is set to + -- `true` the client supports the new `MonikerRegistrationOptions` + -- return value for the corresponding server capability as well. + + end record; + -- Client capabilities specific to the moniker request. + -- + -- @since 3.16.0 + + type MonikerClientCapabilities_Optional (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : MonikerClientCapabilities; + end case; + end record; + + type DocumentHighlightClientCapabilities is record + dynamicRegistration : Boolean_Optional; + -- Whether document highlight supports dynamic registration. + + end record; + -- Client Capabilities for a + -- [DocumentHighlightRequest](#DocumentHighlightRequest). + + type DocumentHighlightClientCapabilities_Optional + (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : DocumentHighlightClientCapabilities; + end case; + end record; + + type SelectionRangeClientCapabilities is record + dynamicRegistration : Boolean_Optional; + -- Whether implementation supports dynamic registration for selection + -- range providers. If this is set to `true` the client supports + -- the new `SelectionRangeRegistrationOptions` return value for + -- the corresponding server capability as well. + + end record; + + type SelectionRangeClientCapabilities_Optional (Is_Set : Boolean := False) + is + record + case Is_Set is + when False => + null; + when True => + Value : SelectionRangeClientCapabilities; + end case; + end record; + + type InsertTextMode_Optional (Is_Set : Boolean := False) is record + case Is_Set is + when False => + null; + when True => + Value : InsertTextMode; + end case; + end record; + + type CompletionItemTag_Set is array (CompletionItemTag) of Boolean with + Pack, Default_Component_Value => False; + + type tagSupport_OfcompletionItem_OfCompletionClientCapabilities is record + valueSet : LSP.Structures.CompletionItemTag_Set; + -- The tags supported by the client. + + end record; + type tagSupport_OfcompletionItem_OfCompletionClientCapabilities_Optional + (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : tagSupport_OfcompletionItem_OfCompletionClientCapabilities; + end case; + end record; + + type InsertTextMode_Set is array (InsertTextMode) of Boolean with + Pack, Default_Component_Value => False; + + type insertTextModeSupport_OfcompletionItem_OfCompletionClientCapabilities is + record + valueSet : LSP.Structures.InsertTextMode_Set; + + end record; + type insertTextModeSupport_OfcompletionItem_OfCompletionClientCapabilities_Optional + (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : insertTextModeSupport_OfcompletionItem_OfCompletionClientCapabilities; + end case; + end record; + + type completionItem_OfCompletionClientCapabilities is record + snippetSupport : Boolean_Optional; + -- Client supports snippets as insert text. + -- + -- A snippet can define tab stops and placeholders with `$1`, `$2` and + -- `${3:foo}`. `$0` defines the final tab stop, it defaults to the end + -- of the snippet. Placeholders with equal identifiers are linked, that + -- is typing in one will update others too. + + commitCharactersSupport : Boolean_Optional; + -- Client supports commit characters on a completion item. + + documentationFormat : LSP.Structures.MarkupKind_Vector; + -- Client supports the following content formats for the documentation + -- property. The order describes the preferred format of the client. + + deprecatedSupport : Boolean_Optional; + -- Client supports the deprecated property on a completion item. + + preselectSupport : Boolean_Optional; + -- Client supports the preselect property on a completion item. + + tagSupport : tagSupport_OfcompletionItem_OfCompletionClientCapabilities_Optional; + -- Client supports the tag property on a completion item. Clients + -- supporting tags have to handle unknown tags gracefully. Clients + -- especially need to preserve unknown tags when sending a completion + -- item back to the server in a resolve call. + -- + -- @since 3.15.0 + + insertReplaceSupport : Boolean_Optional; + -- Client support insert replace edit to control different behavior if a + -- completion item is inserted in the text or should replace text. + -- + -- @since 3.16.0 + + resolveSupport : resolveSupport_OfWorkspaceSymbolClientCapabilities_Optional; + -- Indicates which properties a client can resolve lazily on a + -- completion item. Before version 3.16.0 only the predefined + -- properties `documentation` and `details` could be resolved lazily. + -- + -- @since 3.16.0 + + insertTextModeSupport : insertTextModeSupport_OfcompletionItem_OfCompletionClientCapabilities_Optional; + -- The client supports the `insertTextMode` property on a completion + -- item to override the whitespace handling mode as defined by the + -- client (see `insertTextMode`). + -- + -- @since 3.16.0 + + labelDetailsSupport : Boolean_Optional; + -- The client has support for completion item label details (see also + -- `CompletionItemLabelDetails`). + -- + -- @since 3.17.0 + + end record; + type completionItem_OfCompletionClientCapabilities_Optional + (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : completionItem_OfCompletionClientCapabilities; + end case; + end record; + + type CompletionItemKind_Set is array (CompletionItemKind) of Boolean with + Pack, Default_Component_Value => False; + + type completionItemKind_OfCompletionClientCapabilities is record + valueSet : LSP.Structures.CompletionItemKind_Set; + -- The completion item kind values the client supports. When this + -- property exists the client also guarantees that it will handle values + -- outside its set gracefully and falls back to a default value when + -- unknown. + -- + -- If this property is not present the client only supports the + -- completion items kinds from `Text` to `Reference` as defined in + -- the initial version of the protocol. + + end record; + type completionItemKind_OfCompletionClientCapabilities_Optional + (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : completionItemKind_OfCompletionClientCapabilities; + end case; + end record; + + type completionList_OfCompletionClientCapabilities is record + itemDefaults : LSP.Structures.Virtual_String_Vector; + -- The client supports the following itemDefaults on a completion list. + -- + -- The value lists the supported property names of the + -- `CompletionList.itemDefaults` object. If omitted no properties + -- are supported. + -- + -- @since 3.17.0 + + end record; + type completionList_OfCompletionClientCapabilities_Optional + (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : completionList_OfCompletionClientCapabilities; + end case; + end record; + + type CompletionClientCapabilities is record + dynamicRegistration : Boolean_Optional; + -- Whether completion supports dynamic registration. + + completionItem : completionItem_OfCompletionClientCapabilities_Optional; + -- The client supports the following `CompletionItem` specific + -- capabilities. + + completionItemKind : completionItemKind_OfCompletionClientCapabilities_Optional; + + insertTextMode : InsertTextMode_Optional; + -- Defines how the client handles whitespace and indentation when + -- accepting a completion item that uses multi line text in either + -- `insertText` or `textEdit`. + -- + -- @since 3.17.0 + + contextSupport : Boolean_Optional; + -- The client supports to send additional context information for a + -- `textDocument/completion` request. + + completionList : completionList_OfCompletionClientCapabilities_Optional; + -- The client supports the following `CompletionList` specific + -- capabilities. + -- + -- @since 3.17.0 + + end record; + -- Completion client capabilities + + type CompletionClientCapabilities_Optional (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : CompletionClientCapabilities; + end case; + end record; + + type DocumentSymbolClientCapabilities is record + dynamicRegistration : Boolean_Optional; + -- Whether document symbol supports dynamic registration. + + symbolKind : symbolKind_OfWorkspaceSymbolClientCapabilities_Optional; + -- Specific capabilities for the `SymbolKind` in the + -- `textDocument/documentSymbol` request. + + hierarchicalDocumentSymbolSupport : Boolean_Optional; + -- The client supports hierarchical document symbols. + + tagSupport : tagSupport_OfWorkspaceSymbolClientCapabilities_Optional; + -- The client supports tags on `SymbolInformation`. Tags are supported + -- on `DocumentSymbol` if `hierarchicalDocumentSymbolSupport` is set to + -- true. Clients supporting tags have to handle unknown tags gracefully. + -- + -- @since 3.16.0 + + labelSupport : Boolean_Optional; + -- The client supports an additional label presented in the UI when + -- registering a document symbol provider. + -- + -- @since 3.16.0 + + end record; + -- Client Capabilities for a + -- [DocumentSymbolRequest](#DocumentSymbolRequest). + + type DocumentSymbolClientCapabilities_Optional (Is_Set : Boolean := False) + is + record + case Is_Set is + when False => + null; + when True => + Value : DocumentSymbolClientCapabilities; + end case; + end record; + + type InlineValueClientCapabilities is record + dynamicRegistration : Boolean_Optional; + -- Whether implementation supports dynamic registration for inline value + -- providers. + + end record; + -- Client capabilities specific to inline values. + -- + -- @since 3.17.0 + + type InlineValueClientCapabilities_Optional (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : InlineValueClientCapabilities; + end case; + end record; + + type TextDocumentClientCapabilities is record + synchronization : TextDocumentSyncClientCapabilities_Optional; + -- Defines which synchronization capabilities the client supports. + + completion : CompletionClientCapabilities_Optional; + -- Capabilities specific to the `textDocument/completion` request. + + hover : HoverClientCapabilities_Optional; + -- Capabilities specific to the `textDocument/hover` request. + + signatureHelp : SignatureHelpClientCapabilities_Optional; + -- Capabilities specific to the `textDocument/signatureHelp` request. + + declaration : DeclarationClientCapabilities_Optional; + -- Capabilities specific to the `textDocument/declaration` request. + -- + -- @since 3.14.0 + + definition : DefinitionClientCapabilities_Optional; + -- Capabilities specific to the `textDocument/definition` request. + + typeDefinition : TypeDefinitionClientCapabilities_Optional; + -- Capabilities specific to the `textDocument/typeDefinition` request. + -- + -- @since 3.6.0 + + implementation : ImplementationClientCapabilities_Optional; + -- Capabilities specific to the `textDocument/implementation` request. + -- + -- @since 3.6.0 + + references : ReferenceClientCapabilities_Optional; + -- Capabilities specific to the `textDocument/references` request. + + documentHighlight : DocumentHighlightClientCapabilities_Optional; + -- Capabilities specific to the `textDocument/documentHighlight` + -- request. + + documentSymbol : DocumentSymbolClientCapabilities_Optional; + -- Capabilities specific to the `textDocument/documentSymbol` request. + + codeAction : CodeActionClientCapabilities_Optional; + -- Capabilities specific to the `textDocument/codeAction` request. + + codeLens : CodeLensClientCapabilities_Optional; + -- Capabilities specific to the `textDocument/codeLens` request. + + documentLink : DocumentLinkClientCapabilities_Optional; + -- Capabilities specific to the `textDocument/documentLink` request. + + colorProvider : DocumentColorClientCapabilities_Optional; + -- Capabilities specific to the `textDocument/documentColor` and the + -- `textDocument/colorPresentation` request. + -- + -- @since 3.6.0 + + formatting : DocumentFormattingClientCapabilities_Optional; + -- Capabilities specific to the `textDocument/formatting` request. + + rangeFormatting : DocumentRangeFormattingClientCapabilities_Optional; + -- Capabilities specific to the `textDocument/rangeFormatting` request. + + onTypeFormatting : DocumentOnTypeFormattingClientCapabilities_Optional; + -- Capabilities specific to the `textDocument/onTypeFormatting` request. + + rename : RenameClientCapabilities_Optional; + -- Capabilities specific to the `textDocument/rename` request. + + foldingRange : FoldingRangeClientCapabilities_Optional; + -- Capabilities specific to the `textDocument/foldingRange` request. + -- + -- @since 3.10.0 + + selectionRange : SelectionRangeClientCapabilities_Optional; + -- Capabilities specific to the `textDocument/selectionRange` request. + -- + -- @since 3.15.0 + + publishDiagnostics : PublishDiagnosticsClientCapabilities_Optional; + -- Capabilities specific to the `textDocument/publishDiagnostics` + -- notification. + + callHierarchy : CallHierarchyClientCapabilities_Optional; + -- Capabilities specific to the various call hierarchy requests. + -- + -- @since 3.16.0 + + semanticTokens : SemanticTokensClientCapabilities_Optional; + -- Capabilities specific to the various semantic token request. + -- + -- @since 3.16.0 + + linkedEditingRange : LinkedEditingRangeClientCapabilities_Optional; + -- Capabilities specific to the `textDocument/linkedEditingRange` + -- request. + -- + -- @since 3.16.0 + + moniker : MonikerClientCapabilities_Optional; + -- Client capabilities specific to the `textDocument/moniker` request. + -- + -- @since 3.16.0 + + typeHierarchy : TypeHierarchyClientCapabilities_Optional; + -- Capabilities specific to the various type hierarchy requests. + -- + -- @since 3.17.0 + + inlineValue : InlineValueClientCapabilities_Optional; + -- Capabilities specific to the `textDocument/inlineValue` request. + -- + -- @since 3.17.0 + + inlayHint : InlayHintClientCapabilities_Optional; + -- Capabilities specific to the `textDocument/inlayHint` request. + -- + -- @since 3.17.0 + + diagnostic : DiagnosticClientCapabilities_Optional; + -- Capabilities specific to the diagnostic pull model. + -- + -- @since 3.17.0 + + end record; + -- Text document specific client capabilities. + + type TextDocumentClientCapabilities_Optional (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : TextDocumentClientCapabilities; + end case; + end record; + + type ClientCapabilities is record + workspace : WorkspaceClientCapabilities_Optional; + -- Workspace specific client capabilities. + + textDocument : TextDocumentClientCapabilities_Optional; + -- Text document specific client capabilities. + + notebookDocument : NotebookDocumentClientCapabilities_Optional; + -- Capabilities specific to the notebook document support. + -- + -- @since 3.17.0 + + window : WindowClientCapabilities_Optional; + -- Window specific client capabilities. + + general : GeneralClientCapabilities_Optional; + -- General client capabilities. + -- + -- @since 3.16.0 + + experimental : LSPAny_Optional; + -- Experimental client capabilities. + + end record; + -- Defines the capabilities provided by the client. + + type WorkspaceEdit_Optional (Is_Set : Boolean := False) is record + case Is_Set is + when False => + null; + when True => + Value : WorkspaceEdit; + end case; + end record; + + type CodeActionKind_Optional (Is_Set : Boolean := False) is record + case Is_Set is + when False => + null; + when True => + Value : CodeActionKind; + end case; + end record; + + type Location is record + uri : LSP.Structures.DocumentUri; + + a_range : LSP.Structures.A_Range; + + end record; + -- Represents a location inside a resource, such as a line inside a text + -- file. + + type DiagnosticRelatedInformation is record + location : LSP.Structures.Location; + -- The location of this related diagnostic information. + + message : LSP.Structures.Virtual_String; + -- The message of this related diagnostic information. + + end record; + -- Represents a related message and source code location for a diagnostic. + -- This should be used to point to code locations that cause or related to + -- a diagnostics, e.g when duplicating a symbol in a scope. + + type URI is new VSS.Strings.Virtual_String with null record; + -- A tagging type for string properties that are actually URIs + -- + -- @since 3.16.0 + + function Get_Hash (Self : URI) return Ada.Containers.Hash_Type is + (Ada.Containers.Hash_Type'Mod (Self.Hash)); + + type CodeDescription is record + href : LSP.Structures.URI; + -- An URI to open with more information about the diagnostic error. + + end record; + -- Structure to capture a description for an error code. + -- + -- @since 3.16.0 + + type CodeDescription_Optional (Is_Set : Boolean := False) is record + case Is_Set is + when False => + null; + when True => + Value : CodeDescription; + end case; + end record; + + type DiagnosticSeverity_Optional (Is_Set : Boolean := False) is record + case Is_Set is + when False => + null; + when True => + Value : DiagnosticSeverity; + end case; + end record; + + type Integer_Or_Virtual_String_Optional (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : Integer_Or_Virtual_String; + end case; + end record; + + package DiagnosticRelatedInformation_Vectors is new Ada.Containers.Vectors + (Positive, DiagnosticRelatedInformation, "="); + + type DiagnosticRelatedInformation_Vector is + new DiagnosticRelatedInformation_Vectors.Vector with null record; + + type Diagnostic is record + a_range : LSP.Structures.A_Range; + -- The range at which the message applies + + severity : DiagnosticSeverity_Optional; + -- The diagnostic's severity. Can be omitted. If omitted it is up to the + -- client to interpret diagnostics as error, warning, info or hint. + + code : Integer_Or_Virtual_String_Optional; + -- The diagnostic's code, which usually appear in the user interface. + + codeDescription : CodeDescription_Optional; + -- An optional property to describe the error code. Requires the code + -- field (above) to be present/not null. + -- + -- @since 3.16.0 + + source : Virtual_String_Optional; + -- A human-readable string describing the source of this diagnostic, + -- e.g. 'typescript' or 'super lint'. It usually appears in the user + -- interface. + + message : LSP.Structures.Virtual_String; + -- The diagnostic's message. It usually appears in the user interface + + tags : LSP.Structures.DiagnosticTag_Set; + -- Additional metadata about the diagnostic. + -- + -- @since 3.15.0 + + relatedInformation : LSP.Structures.DiagnosticRelatedInformation_Vector; + -- An array of related diagnostic information, e.g. when symbol-names + -- within a scope collide all definitions can be marked via this + -- property. + + data : LSPAny_Optional; + -- A data entry field that is preserved between a + -- `textDocument/publishDiagnostics` notification + -- and `textDocument/codeAction` request. + -- + -- @since 3.16.0 + + end record; + -- Represents a diagnostic, such as a compiler error or warning. Diagnostic + -- objects are only valid in the scope of a resource. + + type Command is record + title : LSP.Structures.Virtual_String; + -- Title of the command, like `save`. + + command : LSP.Structures.Virtual_String; + -- The identifier of the actual command handler. + + arguments : LSP.Structures.LSPAny_Vector; + -- Arguments that the command handler should be invoked with. + + end record; + -- Represents a reference to a command. Provides a title which will be used + -- to represent a command in the UI and, optionally, an array of arguments + -- which will be passed to the command handler function when invoked. + + type Command_Optional (Is_Set : Boolean := False) is record + case Is_Set is + when False => + null; + when True => + Value : Command; + end case; + end record; + + package Diagnostic_Vectors is new Ada.Containers.Vectors + (Positive, Diagnostic, "="); + + type Diagnostic_Vector is new Diagnostic_Vectors.Vector with null record; + + type disabled_OfCodeAction is record + reason : LSP.Structures.Virtual_String; + -- Human readable description of why the code action is currently + -- disabled. + -- + -- This is displayed in the code actions UI. + + end record; + type disabled_OfCodeAction_Optional (Is_Set : Boolean := False) is record + case Is_Set is + when False => + null; + when True => + Value : disabled_OfCodeAction; + end case; + end record; + + type CodeAction is record + title : LSP.Structures.Virtual_String; + -- A short, human-readable, title for this code action. + + kind : CodeActionKind_Optional; + -- The kind of the code action. + -- + -- Used to filter code actions. + + diagnostics : LSP.Structures.Diagnostic_Vector; + -- The diagnostics that this code action resolves. + + isPreferred : Boolean_Optional; + -- Marks this as a preferred action. Preferred actions are used by the + -- `auto fix` command and can be targeted by keybindings. + -- + -- A quick fix should be marked preferred if it properly addresses the + -- underlying error. A refactoring should be marked preferred if it is + -- the most reasonable choice of actions to take. + -- + -- @since 3.15.0 + + disabled : disabled_OfCodeAction_Optional; + -- Marks that the code action cannot currently be applied. + -- + -- Clients should follow the following guidelines regarding disabled + -- code actions: + -- + -- - Disabled code actions are not shown in automatic [lightbulbs](https://code.visualstudio.com/docs/editor/editingevolved#_code-action) + -- code action menus. + -- + -- - Disabled actions are shown as faded out in the code action menu when the user requests a more specific type + -- of code action, such as refactorings. + -- + -- - If the user has a [keybinding](https://code.visualstudio.com/docs/editor/refactoring#_keybindings-for-code-actions) + -- that auto applies a code action and only disabled code actions are returned, the client should show the user an + -- error message with `reason` in the editor. + -- + -- @since 3.16.0 + + edit : WorkspaceEdit_Optional; + -- The workspace edit this code action performs. + + command : Command_Optional; + -- A command this code action executes. If a code action provides an + -- edit and a command, first the edit is executed and then the command. + + data : LSPAny_Optional; + -- A data entry field that is preserved on a code action between a + -- `textDocument/codeAction` and a `codeAction/resolve` request. + -- + -- @since 3.16.0 + + end record; + -- A code action represents a change that can be performed in code, e.g. to + -- fix a problem or to refactor code. + -- + -- A CodeAction must set either `edit` and/or a `command`. If both are + -- supplied, the `edit` is applied first, then the `command` is executed. + + type CodeActionTriggerKind_Optional (Is_Set : Boolean := False) is record + case Is_Set is + when False => + null; + when True => + Value : CodeActionTriggerKind; + end case; + end record; + + type CodeActionContext is record + diagnostics : LSP.Structures.Diagnostic_Vector; + -- An array of diagnostics known on the client side overlapping the + -- range provided to the `textDocument/codeAction` request. They + -- are provided so that the server knows which errors are currently + -- presented to the user for the given range. There is no guarantee that + -- these accurately reflect the error state of the resource. The primary + -- parameter to compute code actions is the provided range. + + only : LSP.Structures.CodeActionKind_Set; + -- Requested kind of actions to return. + -- + -- Actions not of this kind are filtered out by the client before being + -- shown. So servers can omit computing them. + + triggerKind : CodeActionTriggerKind_Optional; + -- The reason why code actions were requested. + -- + -- @since 3.17.0 + + end record; + -- Contains additional diagnostic information about the context in which a + -- [code action](#CodeActionProvider.provideCodeActions) is run. + + type CodeActionOptions is new WorkDoneProgressOptions with record + workDoneProgress : Boolean_Optional; + + codeActionKinds : LSP.Structures.CodeActionKind_Set; + -- CodeActionKinds that this server may return. + -- + -- The list of kinds may be generic, such as `CodeActionKind.Refactor`, + -- or the server may list out every specific kind they provide. + + resolveProvider : Boolean_Optional; + -- The server provides support to resolve additional information for a + -- code action. + -- + -- @since 3.16.0 + + end record; + -- Provider options for a [CodeActionRequest](#CodeActionRequest). + + overriding function workDoneProgress + (Self : CodeActionOptions) return Boolean_Optional is + (Self.workDoneProgress); + + type CodeActionParams is + new WorkDoneProgressParams and PartialResultParams with record + workDoneToken : ProgressToken_Optional; + -- An optional token that a server can use to report work done progress. + + partialResultToken : ProgressToken_Optional; + -- An optional token that a server can use to report partial results + -- (e.g. streaming) to the client. + + textDocument : LSP.Structures.TextDocumentIdentifier; + -- The document in which the command was invoked. + + a_range : LSP.Structures.A_Range; + -- The range for which the command was invoked. + + context : LSP.Structures.CodeActionContext; + -- Context carrying additional information. + + end record; + -- The parameters of a [CodeActionRequest](#CodeActionRequest). + + overriding function workDoneToken + (Self : CodeActionParams) return LSP.Structures.ProgressToken_Optional is + (Self.workDoneToken); + + overriding function partialResultToken + (Self : CodeActionParams) return LSP.Structures.ProgressToken_Optional is + (Self.partialResultToken); + + type CodeActionRegistrationOptions is new CodeActionOptions with record + Parent : LSP.Structures.TextDocumentRegistrationOptions; + end record; + -- Registration options for a [CodeActionRequest](#CodeActionRequest). + + type CodeLens is record + a_range : LSP.Structures.A_Range; + -- The range in which this code lens is valid. Should only span a single + -- line. + + command : Command_Optional; + -- The command this code lens represents. + + data : LSPAny_Optional; + -- A data entry field that is preserved on a code lens item between a + -- [CodeLensRequest](#CodeLensRequest) and a [CodeLensResolveRequest] + -- (#CodeLensResolveRequest) + + end record; + -- A code lens represents a [command](#Command) that should be shown along + -- with source text, like the number of references, a way to run tests, + -- etc. + -- + -- A code lens is _unresolved_ when no command is associated to it. For + -- performance reasons the creation of a code lens and resolving should + -- be done in two stages. + + type CodeLensOptions is new WorkDoneProgressOptions with record + workDoneProgress : Boolean_Optional; + + resolveProvider : Boolean_Optional; + -- Code lens has a resolve provider as well. + + end record; + -- Code Lens provider options of a [CodeLensRequest](#CodeLensRequest). + + overriding function workDoneProgress + (Self : CodeLensOptions) return Boolean_Optional is + (Self.workDoneProgress); + + type CodeLensParams is + new WorkDoneProgressParams and PartialResultParams with record + workDoneToken : ProgressToken_Optional; + -- An optional token that a server can use to report work done progress. + + partialResultToken : ProgressToken_Optional; + -- An optional token that a server can use to report partial results + -- (e.g. streaming) to the client. + + textDocument : LSP.Structures.TextDocumentIdentifier; + -- The document to request code lens for. + + end record; + -- The parameters of a [CodeLensRequest](#CodeLensRequest). + + overriding function workDoneToken + (Self : CodeLensParams) return LSP.Structures.ProgressToken_Optional is + (Self.workDoneToken); + + overriding function partialResultToken + (Self : CodeLensParams) return LSP.Structures.ProgressToken_Optional is + (Self.partialResultToken); + + type CodeLensRegistrationOptions is new CodeLensOptions with record + Parent : LSP.Structures.TextDocumentRegistrationOptions; + end record; + -- Registration options for a [CodeLensRequest](#CodeLensRequest). + + type Color is record + red : Float; + -- The red component of this color in the range [0-1]. + + green : Float; + -- The green component of this color in the range [0-1]. + + blue : Float; + -- The blue component of this color in the range [0-1]. + + alpha : Float; + -- The alpha component of this color in the range [0-1]. + + end record; + -- Represents a color in RGBA space. + + type ColorInformation is record + a_range : LSP.Structures.A_Range; + -- The range in the document where this color appears. + + color : LSP.Structures.Color; + -- The actual color value for this color range. + + end record; + -- Represents a color range from a document. + + type TextEdit_Optional (Is_Set : Boolean := False) is record + case Is_Set is + when False => + null; + when True => + Value : TextEdit; + end case; + end record; + + type ColorPresentation is record + label : LSP.Structures.Virtual_String; + -- The label of this color presentation. It will be shown on the color + -- picker header. By default this is also the text that is inserted when + -- selecting this color presentation. + + textEdit : TextEdit_Optional; + -- An [edit](#TextEdit) which is applied to a document when + -- selecting this presentation for the color. When `falsy` + -- the [label](#ColorPresentation.label) is used. + + additionalTextEdits : LSP.Structures.TextEdit_Vector; + -- An optional array of additional [text edits](#TextEdit) that are + -- applied when selecting this color presentation. Edits must not + -- overlap with the main [edit](#ColorPresentation.textEdit) nor + -- with themselves. + + end record; + + type ColorPresentationParams is + new WorkDoneProgressParams and PartialResultParams with record + workDoneToken : ProgressToken_Optional; + -- An optional token that a server can use to report work done progress. + + partialResultToken : ProgressToken_Optional; + -- An optional token that a server can use to report partial results + -- (e.g. streaming) to the client. + + textDocument : LSP.Structures.TextDocumentIdentifier; + -- The text document. + + color : LSP.Structures.Color; + -- The color to request presentations for. + + a_range : LSP.Structures.A_Range; + -- The range where the color would be inserted. Serves as a context. + + end record; + -- Parameters for a [ColorPresentationRequest](#ColorPresentationRequest). + + overriding function workDoneToken + (Self : ColorPresentationParams) + return LSP.Structures.ProgressToken_Optional is + (Self.workDoneToken); + + overriding function partialResultToken + (Self : ColorPresentationParams) + return LSP.Structures.ProgressToken_Optional is + (Self.partialResultToken); + + type CompletionContext is record + triggerKind : LSP.Enumerations.CompletionTriggerKind; + -- How the completion was triggered. + + triggerCharacter : Virtual_String_Optional; + -- The trigger character (a single character) that has + -- trigger code complete. Is undefined if `triggerKind + -- !== CompletionTriggerKind.TriggerCharacter` + + end record; + -- Contains additional information about the context in which a completion + -- request is triggered. + + type CompletionItemLabelDetails is record + detail : Virtual_String_Optional; + -- An optional string which is rendered less prominently directly after + -- {@link CompletionItem.label label}, without any spacing. Should be + -- used for function signatures and type annotations. + + description : Virtual_String_Optional; + -- An optional string which is rendered less prominently after {@link + -- CompletionItem.detail}. Should be used for fully qualified names and + -- file paths. + + end record; + -- Additional details for a completion item label. + -- + -- @since 3.17.0 + + type CompletionItemLabelDetails_Optional (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : CompletionItemLabelDetails; + end case; + end record; + + type InsertTextFormat_Optional (Is_Set : Boolean := False) is record + case Is_Set is + when False => + null; + when True => + Value : InsertTextFormat; + end case; + end record; + + type CompletionItemKind_Optional (Is_Set : Boolean := False) is record + case Is_Set is + when False => + null; + when True => + Value : CompletionItemKind; + end case; + end record; + + type InsertReplaceEdit is record + newText : LSP.Structures.Virtual_String; + -- The string to be inserted. + + insert : LSP.Structures.A_Range; + -- The range if the insert is requested + + replace : LSP.Structures.A_Range; + -- The range if the replace is requested. + + end record; + -- A special text edit to provide an insert and a replace operation. + -- + -- @since 3.16.0 + + type MarkupContent is record + kind : LSP.Enumerations.MarkupKind; + -- The type of the Markup + + value : LSP.Structures.Virtual_String; + -- The content itself + + end record; + -- A `MarkupContent` literal represents a string value which content is + -- interpreted base on its kind flag. Currently the protocol supports + -- `plaintext` and `markdown` as markup kinds. + -- + -- If the kind is `markdown` then the value can contain + -- fenced code blocks like in GitHub issues. See + -- https://help.github.com/articles/creating-and-highlighting-code-blocks/#syntax-highlighting + -- + -- Here is an example how such a string can be constructed using JavaScript + -- / TypeScript: ```ts let markdown: MarkdownContent = { + -- kind: MarkupKind.Markdown, + -- value: [ + -- '# Header', + -- 'Some text', + -- '```typescript', + -- 'someCode();', + -- '```' + -- ].join('\n') + -- }; + -- ``` + -- + -- *Please Note* that clients might sanitize the return markdown. A client + -- could decide to remove HTML from the markdown to avoid script execution. + + type Virtual_String_Or_MarkupContent (Is_Virtual_String : Boolean := True) + is + record + case Is_Virtual_String is + when True => + Virtual_String : LSP.Structures.Virtual_String; + when False => + MarkupContent : LSP.Structures.MarkupContent; + end case; + end record; + + type Virtual_String_Or_MarkupContent_Optional (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : Virtual_String_Or_MarkupContent; + end case; + end record; + + type TextEdit_Or_InsertReplaceEdit (Is_TextEdit : Boolean := True) is record + case Is_TextEdit is + when True => + TextEdit : LSP.Structures.TextEdit; + when False => + InsertReplaceEdit : LSP.Structures.InsertReplaceEdit; + end case; + end record; + + type TextEdit_Or_InsertReplaceEdit_Optional (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : TextEdit_Or_InsertReplaceEdit; + end case; + end record; + + type CompletionItem is record + label : LSP.Structures.Virtual_String; + -- The label of this completion item. + -- + -- The label property is also by default the text that is inserted when + -- selecting this completion. + -- + -- If label details are provided the label itself should be an + -- unqualified name of the completion item. + + labelDetails : CompletionItemLabelDetails_Optional; + -- Additional details for the label + -- + -- @since 3.17.0 + + kind : CompletionItemKind_Optional; + -- The kind of this completion item. Based of the kind an icon is chosen + -- by the editor. + + tags : LSP.Structures.CompletionItemTag_Set; + -- Tags for this completion item. + -- + -- @since 3.15.0 + + detail : Virtual_String_Optional; + -- A human-readable string with additional information about this item, + -- like type or symbol information. + + documentation : Virtual_String_Or_MarkupContent_Optional; + -- A human-readable string that represents a doc-comment. + + deprecated : Boolean_Optional; + -- Indicates if this item is deprecated. @deprecated Use `tags` instead. + + preselect : Boolean_Optional; + -- Select this item when showing. + -- + -- *Note* that only one completion item can be selected and that the + -- tool / client decides which item that is. The rule is that the + -- *first* item of those that match best is selected. + + sortText : Virtual_String_Optional; + -- A string that should be used when comparing this item with other + -- items. When `falsy` the [label](#CompletionItem.label) is used. + + filterText : Virtual_String_Optional; + -- A string that should be used when filtering a set of completion + -- items. When `falsy` the [label](#CompletionItem.label) is used. + + insertText : Virtual_String_Optional; + -- A string that should be inserted into a document when selecting this + -- completion. When `falsy` the [label](#CompletionItem.label) is used. + -- + -- The `insertText` is subject to interpretation by the client side. + -- Some tools might not take the string literally. For example VS + -- Code when code complete is requested in this example `con` and a completion item with an `insertText` of `console` + -- is provided it will only insert `sole`. Therefore it is recommended + -- to use `textEdit` instead since it avoids additional client side + -- interpretation. + + insertTextFormat : InsertTextFormat_Optional; + -- The format of the insert text. The format applies to both the + -- `insertText` property and the `newText` property of a provided + -- `textEdit`. If omitted defaults to `InsertTextFormat.PlainText`. + -- + -- Please note that the insertTextFormat doesn't apply to + -- `additionalTextEdits`. + + insertTextMode : InsertTextMode_Optional; + -- How whitespace and indentation is handled during completion item + -- insertion. If not provided the clients default value depends on + -- the `textDocument.completion.insertTextMode` client capability. + -- + -- @since 3.16.0 + + textEdit : TextEdit_Or_InsertReplaceEdit_Optional; + -- An [edit](#TextEdit) which is applied to a document when + -- selecting this completion. When an edit is provided the value + -- of [insertText](#CompletionItem.insertText) is ignored. + -- + -- Most editors support two different operations when accepting a + -- completion item. One is to insert a completion text and the other is + -- to replace an existing text with a completion text. Since this can + -- usually not be predetermined by a server it can report both ranges. + -- Clients need to signal support for `InsertReplaceEdits` via the + -- `textDocument.completion.insertReplaceSupport` client capability + -- property. + -- + -- *Note 1:* The text edit's range as well as both ranges from an + -- insert replace edit must be a [single line] and they must contain + -- the position at which completion has been requested. *Note 2:* If + -- an `InsertReplaceEdit` is returned the edit's insert range must be a + -- prefix of the edit's replace range, that means it must be contained + -- and starting at the same position. + -- + -- @since 3.16.0 additional type `InsertReplaceEdit` + + textEditText : Virtual_String_Optional; + -- The edit text used if the completion item is part of a CompletionList + -- and CompletionList defines an item default for the text edit range. + -- + -- Clients will only honor this property if they opt into + -- completion list item defaults using the capability + -- `completionList.itemDefaults`. + -- + -- If not provided and a list's default range is provided the label + -- property is used as a text. + -- + -- @since 3.17.0 + + additionalTextEdits : LSP.Structures.TextEdit_Vector; + -- An optional array of additional [text edits](#TextEdit) that + -- are applied when selecting this completion. Edits must not + -- overlap (including the same insert position) with the main + -- [edit](#CompletionItem.textEdit) nor with themselves. + -- + -- Additional text edits should be used to change text unrelated to the + -- current cursor position (for example adding an import statement at + -- the top of the file if the completion item will insert an unqualified + -- type). + + commitCharacters : LSP.Structures.Virtual_String_Vector; + -- An optional set of characters that when pressed while this completion + -- is active will accept it first and then type that character. + -- *Note* that all commit characters should have `length=1` and + -- that superfluous characters will be ignored. + + command : Command_Optional; + -- An optional [command](#Command) that is executed *after* + -- inserting this completion. *Note* that additional modifications + -- to the current document should be described with the + -- [additionalTextEdits](#CompletionItem.additionalTextEdits)-property. + + data : LSPAny_Optional; + -- A data entry field that is preserved on a completion item + -- between a [CompletionRequest](#CompletionRequest) and a + -- [CompletionResolveRequest](#CompletionResolveRequest). + + end record; + -- A completion item represents a text snippet that is proposed to complete + -- text that is being typed. + + type Range_Or_Something (Is_A_Range : Boolean := True) is record + case Is_A_Range is + when True => + A_Range : LSP.Structures.A_Range; + when False => + insert : LSP.Structures.A_Range; + + replace : LSP.Structures.A_Range; + + end case; + end record; + + type Range_Or_Something_Optional (Is_Set : Boolean := False) is record + case Is_Set is + when False => + null; + when True => + Value : Range_Or_Something; + end case; + end record; + + type itemDefaults_OfCompletionList is record + commitCharacters : LSP.Structures.Virtual_String_Vector; + -- A default commit character set. + -- + -- @since 3.17.0 + + editRange : Range_Or_Something_Optional; + -- A default edit range. + -- + -- @since 3.17.0 + + insertTextFormat : InsertTextFormat_Optional; + -- A default insert text format. + -- + -- @since 3.17.0 + + insertTextMode : InsertTextMode_Optional; + -- A default insert text mode. + -- + -- @since 3.17.0 + + data : LSPAny_Optional; + -- A default data value. + -- + -- @since 3.17.0 + + end record; + type itemDefaults_OfCompletionList_Optional (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : itemDefaults_OfCompletionList; + end case; + end record; + + package CompletionItem_Vectors is new Ada.Containers.Vectors + (Positive, CompletionItem, "="); + + type CompletionItem_Vector is + new CompletionItem_Vectors.Vector with null record; + + type CompletionList is record + isIncomplete : Standard.Boolean; + -- This list it not complete. Further typing results in recomputing this + -- list. + -- + -- Recomputed lists have all their items replaced (not appended) in the + -- incomplete completion sessions. + + itemDefaults : itemDefaults_OfCompletionList_Optional; + -- In many cases the items of an actual completion result share the same + -- value for properties like `commitCharacters` or the range of a text + -- edit. A completion list can therefore define item defaults which will + -- be used if a completion item itself doesn't specify the value. + -- + -- If a completion list specifies a default value and a completion item + -- also specifies a corresponding value the one from the item is used. + -- + -- Servers are only allowed to return default values if the client + -- signals support for this via the `completionList.itemDefaults` + -- capability. + -- + -- @since 3.17.0 + + items : LSP.Structures.CompletionItem_Vector; + -- The completion items. + + end record; + -- Represents a collection of [completion items](#CompletionItem) to be + -- presented in the editor. + + type completionItem_OfCompletionOptions is record + labelDetailsSupport : Boolean_Optional; + -- The server has support for completion item label details (see also + -- `CompletionItemLabelDetails`) when receiving a completion item in a + -- resolve call. + -- + -- @since 3.17.0 + + end record; + type completionItem_OfCompletionOptions_Optional (Is_Set : Boolean := False) + is + record + case Is_Set is + when False => + null; + when True => + Value : completionItem_OfCompletionOptions; + end case; + end record; + + type CompletionOptions is new WorkDoneProgressOptions with record + workDoneProgress : Boolean_Optional; + + triggerCharacters : LSP.Structures.Virtual_String_Vector; + -- Most tools trigger completion request automatically without + -- explicitly requesting it using a keyboard shortcut (e.g. Ctrl+Space). + -- Typically they do so when the user starts to type an identifier. For + -- example if the user types `c` in a JavaScript file code complete will + -- automatically pop up present `console` besides others as a completion + -- item. Characters that make up identifiers don't need to be listed + -- here. + -- + -- If code complete should automatically be trigger on characters not + -- being valid inside an identifier (for example `.` in JavaScript) + -- list them in `triggerCharacters`. + + allCommitCharacters : LSP.Structures.Virtual_String_Vector; + -- The list of all possible characters that commit a + -- completion. This field can be used if clients don't support + -- individual commit characters per completion item. See + -- `ClientCapabilities.textDocument.completion.completionItem.commitCharactersSupport` + -- + -- If a server provides both `allCommitCharacters` and commit characters + -- on an individual completion item the ones on the completion item win. + -- + -- @since 3.2.0 + + resolveProvider : Boolean_Optional; + -- The server provides support to resolve additional information for a + -- completion item. + + completionItem : completionItem_OfCompletionOptions_Optional; + -- The server supports the following `CompletionItem` specific + -- capabilities. + -- + -- @since 3.17.0 + + end record; + -- Completion options. + + overriding function workDoneProgress + (Self : CompletionOptions) return Boolean_Optional is + (Self.workDoneProgress); + + type CompletionContext_Optional (Is_Set : Boolean := False) is record + case Is_Set is + when False => + null; + when True => + Value : CompletionContext; + end case; + end record; + + type CompletionParams is + new TextDocumentPositionParams and WorkDoneProgressParams and + PartialResultParams with record + workDoneToken : ProgressToken_Optional; + -- An optional token that a server can use to report work done progress. + + partialResultToken : ProgressToken_Optional; + -- An optional token that a server can use to report partial results + -- (e.g. streaming) to the client. + + context : CompletionContext_Optional; + -- The completion context. This is only available it the + -- client specifies to send this using the client capability + -- `textDocument.completion.contextSupport === true` + + end record; + -- Completion parameters + + overriding function workDoneToken + (Self : CompletionParams) return LSP.Structures.ProgressToken_Optional is + (Self.workDoneToken); + + overriding function partialResultToken + (Self : CompletionParams) return LSP.Structures.ProgressToken_Optional is + (Self.partialResultToken); + + type CompletionRegistrationOptions is new CompletionOptions with record + Parent : LSP.Structures.TextDocumentRegistrationOptions; + end record; + -- Registration options for a [CompletionRequest](#CompletionRequest). + + type ConfigurationItem is record + scopeUri : Virtual_String_Optional; + -- The scope to get the configuration section for. + + section : Virtual_String_Optional; + -- The configuration section asked for. + + end record; + + package ConfigurationItem_Vectors is new Ada.Containers.Vectors + (Positive, ConfigurationItem, "="); + + type ConfigurationItem_Vector is + new ConfigurationItem_Vectors.Vector with null record; + + type ConfigurationParams is record + items : LSP.Structures.ConfigurationItem_Vector; + + end record; + -- The parameters of a configuration request. + + type FileCreate is record + uri : LSP.Structures.Virtual_String; + -- A file:// URI for the location of the file/folder being created. + + end record; + -- Represents information on a file/folder create. + -- + -- @since 3.16.0 + + package FileCreate_Vectors is new Ada.Containers.Vectors + (Positive, FileCreate, "="); + + type FileCreate_Vector is new FileCreate_Vectors.Vector with null record; + + type CreateFilesParams is record + files : LSP.Structures.FileCreate_Vector; + -- An array of all files/folders created in this operation. + + end record; + -- The parameters sent in notifications/requests for user-initiated + -- creation of files. + -- + -- @since 3.16.0 + + type DeclarationOptions is new WorkDoneProgressOptions with record + workDoneProgress : Boolean_Optional; + + end record; + + overriding function workDoneProgress + (Self : DeclarationOptions) return Boolean_Optional is + (Self.workDoneProgress); + + type DeclarationParams is + new TextDocumentPositionParams and WorkDoneProgressParams and + PartialResultParams with record + workDoneToken : ProgressToken_Optional; + -- An optional token that a server can use to report work done progress. + + partialResultToken : ProgressToken_Optional; + -- An optional token that a server can use to report partial results + -- (e.g. streaming) to the client. + + end record; + + overriding function workDoneToken + (Self : DeclarationParams) return LSP.Structures.ProgressToken_Optional is + (Self.workDoneToken); + + overriding function partialResultToken + (Self : DeclarationParams) return LSP.Structures.ProgressToken_Optional is + (Self.partialResultToken); + + type DeclarationRegistrationOptions is + new DeclarationOptions and StaticRegistrationOptions with record + id : Virtual_String_Optional; + -- The id used to register the request. The id can be used to deregister + -- the request again. See also Registration#id. + + Parent : LSP.Structures.TextDocumentRegistrationOptions; + end record; + + overriding function id + (Self : DeclarationRegistrationOptions) return Virtual_String_Optional is + (Self.id); + + type DefinitionOptions is new WorkDoneProgressOptions with record + workDoneProgress : Boolean_Optional; + + end record; + -- Server Capabilities for a [DefinitionRequest](#DefinitionRequest). + + overriding function workDoneProgress + (Self : DefinitionOptions) return Boolean_Optional is + (Self.workDoneProgress); + + type DefinitionParams is + new TextDocumentPositionParams and WorkDoneProgressParams and + PartialResultParams with record + workDoneToken : ProgressToken_Optional; + -- An optional token that a server can use to report work done progress. + + partialResultToken : ProgressToken_Optional; + -- An optional token that a server can use to report partial results + -- (e.g. streaming) to the client. + + end record; + -- Parameters for a [DefinitionRequest](#DefinitionRequest). + + overriding function workDoneToken + (Self : DefinitionParams) return LSP.Structures.ProgressToken_Optional is + (Self.workDoneToken); + + overriding function partialResultToken + (Self : DefinitionParams) return LSP.Structures.ProgressToken_Optional is + (Self.partialResultToken); + + type DefinitionRegistrationOptions is new DefinitionOptions with record + Parent : LSP.Structures.TextDocumentRegistrationOptions; + end record; + -- Registration options for a [DefinitionRequest](#DefinitionRequest). + + type FileDelete is record + uri : LSP.Structures.Virtual_String; + -- A file:// URI for the location of the file/folder being deleted. + + end record; + -- Represents information on a file/folder delete. + -- + -- @since 3.16.0 + + package FileDelete_Vectors is new Ada.Containers.Vectors + (Positive, FileDelete, "="); + + type FileDelete_Vector is new FileDelete_Vectors.Vector with null record; + + type DeleteFilesParams is record + files : LSP.Structures.FileDelete_Vector; + -- An array of all files/folders deleted in this operation. + + end record; + -- The parameters sent in notifications/requests for user-initiated deletes + -- of files. + -- + -- @since 3.16.0 + + type DiagnosticOptions is new WorkDoneProgressOptions with record + workDoneProgress : Boolean_Optional; + + identifier : Virtual_String_Optional; + -- An optional identifier under which the diagnostics are managed by the + -- client. + + interFileDependencies : Standard.Boolean; + -- Whether the language has inter file dependencies meaning that editing + -- code in one file can result in a different diagnostic set in another + -- file. Inter file dependencies are common for most programming + -- languages and typically uncommon for linters. + + workspaceDiagnostics : Standard.Boolean; + -- The server provides support for workspace diagnostics as well. + + end record; + -- Diagnostic options. + -- + -- @since 3.17.0 + + overriding function workDoneProgress + (Self : DiagnosticOptions) return Boolean_Optional is + (Self.workDoneProgress); + + type DiagnosticRegistrationOptions is + new DiagnosticOptions and StaticRegistrationOptions with record + id : Virtual_String_Optional; + -- The id used to register the request. The id can be used to deregister + -- the request again. See also Registration#id. + + Parent : LSP.Structures.TextDocumentRegistrationOptions; + end record; + -- Diagnostic registration options. + -- + -- @since 3.17.0 + + overriding function id + (Self : DiagnosticRegistrationOptions) return Virtual_String_Optional is + (Self.id); + + type DiagnosticServerCancellationData is record + retriggerRequest : Standard.Boolean; + + end record; + -- Cancellation data returned from a diagnostic request. + -- + -- @since 3.17.0 + + type DidChangeConfigurationParams is record + settings : LSP.Structures.LSPAny; + -- The actual changed settings + + end record; + -- The parameters of a change configuration notification. + + type Virtual_String_Vector_Optional (Is_Set : Boolean := False) is record + case Is_Set is + when False => + null; + when True => + Value : Virtual_String_Vector; + end case; + end record; + + type DidChangeConfigurationRegistrationOptions is record + section : Virtual_String_Vector_Optional; + + end record; + + type LSPObject is new LSPAny with record + null; + end record; + -- LSP object definition. + -- @since 3.17.0 + + type LSPObject_Optional (Is_Set : Boolean := False) is record + case Is_Set is + when False => + null; + when True => + Value : LSPObject; + end case; + end record; + + type ExecutionSummary is record + executionOrder : Natural; + -- A strict monotonically increasing value indicating the execution + -- order of a cell inside a notebook. + + success : Boolean_Optional; + -- Whether the execution was successful or not if known by the client. + + end record; + + type ExecutionSummary_Optional (Is_Set : Boolean := False) is record + case Is_Set is + when False => + null; + when True => + Value : ExecutionSummary; + end case; + end record; + + type NotebookCell is record + kind : LSP.Enumerations.NotebookCellKind; + -- The cell's kind + + document : LSP.Structures.DocumentUri; + -- The URI of the cell's text document content. + + metadata : LSPObject_Optional; + -- Additional metadata stored with the cell. + -- + -- Note: should always be an object literal (e.g. LSPObject) + + executionSummary : ExecutionSummary_Optional; + -- Additional execution summary information if supported by the client. + + end record; + -- A notebook cell. + -- + -- A cell's document URI must be unique across ALL notebook cells and can + -- therefore be used to uniquely identify a notebook cell or the cell's + -- text document. + -- + -- @since 3.17.0 + + package NotebookCell_Vectors is new Ada.Containers.Vectors + (Positive, NotebookCell, "="); + + type NotebookCell_Vector is + new NotebookCell_Vectors.Vector with null record; + + type NotebookCellArrayChange is record + start : Natural; + -- The start oftest of the cell that changed. + + deleteCount : Natural; + -- The deleted cells + + cells : LSP.Structures.NotebookCell_Vector; + -- The new cells, if any + + end record; + -- A change describing how to move a `NotebookCell` array from state S to + -- S'. + -- + -- @since 3.17.0 + + type TextDocumentItem is record + uri : LSP.Structures.DocumentUri; + -- The text document's uri. + + languageId : LSP.Structures.Virtual_String; + -- The text document's language identifier. + + version : Standard.Integer; + -- The version number of this document (it will increase after each + -- change, including undo/redo). + + text : LSP.Structures.Virtual_String; + -- The content of the opened text document. + + end record; + -- An item to transfer a text document from the client to the server. + + type VersionedTextDocumentIdentifier is + new TextDocumentIdentifier with record + version : Standard.Integer; + -- The version number of this document. + + end record; + -- A text document identifier to denote a specific version of a text + -- document. + + type A_Range_Optional (Is_Set : Boolean := False) is record + case Is_Set is + when False => + null; + when True => + Value : A_Range; + end case; + end record; + + type TextDocumentContentChangeEvent is record + a_range : A_Range_Optional; + -- The range of the document that changed. + + rangeLength : Natural_Optional; + -- The optional length of the range that got replaced. + -- + -- @deprecated use range instead. + + text : LSP.Structures.Virtual_String; + -- The new text for the provided range. + + end record; + -- An event describing a change to a text document. If only a text is + -- provided it is considered to be the full content of the document. + + package TextDocumentItem_Vectors is new Ada.Containers.Vectors + (Positive, TextDocumentItem, "="); + + type TextDocumentItem_Vector is + new TextDocumentItem_Vectors.Vector with null record; + + package TextDocumentIdentifier_Vectors is new Ada.Containers.Vectors + (Positive, TextDocumentIdentifier, "="); + + type TextDocumentIdentifier_Vector is + new TextDocumentIdentifier_Vectors.Vector with null record; + + type structure_Ofcells_OfNotebookDocumentChangeEvent is record + an_array : LSP.Structures.NotebookCellArrayChange; + -- The change to the cell array. + + didOpen : LSP.Structures.TextDocumentItem_Vector; + -- Additional opened cell text documents. + + didClose : LSP.Structures.TextDocumentIdentifier_Vector; + -- Additional closed cell text documents. + + end record; + type structure_Ofcells_OfNotebookDocumentChangeEvent_Optional + (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : structure_Ofcells_OfNotebookDocumentChangeEvent; + end case; + end record; + + package TextDocumentContentChangeEvent_Vectors is new Ada.Containers.Vectors + (Positive, TextDocumentContentChangeEvent, "="); + + type TextDocumentContentChangeEvent_Vector is + new TextDocumentContentChangeEvent_Vectors.Vector with null record; + + type textContent_Ofcells_OfNotebookDocumentChangeEvent_Item is record + document : LSP.Structures.VersionedTextDocumentIdentifier; + + changes : LSP.Structures.TextDocumentContentChangeEvent_Vector; + + end record; + package textContent_Ofcells_OfNotebookDocumentChangeEvent_Item_Vectors is new Ada + .Containers + .Vectors + (Positive, textContent_Ofcells_OfNotebookDocumentChangeEvent_Item, "="); + + type textContent_Ofcells_OfNotebookDocumentChangeEvent is + new textContent_Ofcells_OfNotebookDocumentChangeEvent_Item_Vectors + .Vector with + null record; + + type cells_OfNotebookDocumentChangeEvent is record + structure : structure_Ofcells_OfNotebookDocumentChangeEvent_Optional; + -- Changes to the cell structure to add or remove cells. + + data : LSP.Structures.NotebookCell_Vector; + -- Changes to notebook cells properties like its kind, execution summary + -- or metadata. + + textContent : LSP.Structures + .textContent_Ofcells_OfNotebookDocumentChangeEvent; + -- Changes to the text content of notebook cells. + + end record; + type cells_OfNotebookDocumentChangeEvent_Optional + (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : cells_OfNotebookDocumentChangeEvent; + end case; + end record; + + type NotebookDocumentChangeEvent is record + metadata : LSPObject_Optional; + -- The changed meta data if any. + -- + -- Note: should always be an object literal (e.g. LSPObject) + + cells : cells_OfNotebookDocumentChangeEvent_Optional; + -- Changes to cells + + end record; + -- A change event for a notebook document. + -- + -- @since 3.17.0 + + type VersionedNotebookDocumentIdentifier is record + version : Standard.Integer; + -- The version number of this notebook document. + + uri : LSP.Structures.URI; + -- The notebook document's uri. + + end record; + -- A versioned notebook document identifier. + -- + -- @since 3.17.0 + + type DidChangeNotebookDocumentParams is record + notebookDocument : LSP.Structures.VersionedNotebookDocumentIdentifier; + -- The notebook document that did change. The version number points to + -- the version after all provided changes have been applied. If only the + -- text document content of a cell changes the notebook version doesn't + -- necessarily have to change. + + change : LSP.Structures.NotebookDocumentChangeEvent; + -- The actual changes to the notebook document. + -- + -- The changes describe single state changes to the notebook document. + -- So if there are two changes c1 (at array index 0) and c2 (at array + -- index 1) for a notebook in state S then c1 moves the notebook from S + -- to S' and c2 from S' to S''. So c1 is computed on the state S and c2 + -- is computed on the state S'. + -- + -- To mirror the content of a notebook using change events use the + -- following approach: - start with the same initial content - apply the + -- 'notebookDocument/didChange' notifications in the order you receive + -- them. - apply the `NotebookChangeEvent`s in a single notification in + -- the order + -- you receive them. + + end record; + -- The params sent in a change notebook document notification. + -- + -- @since 3.17.0 + + type DidChangeTextDocumentParams is record + textDocument : LSP.Structures.VersionedTextDocumentIdentifier; + -- The document that did change. The version number points to the + -- version after all provided content changes have been applied. + + contentChanges : LSP.Structures.TextDocumentContentChangeEvent_Vector; + -- The actual content changes. The content changes describe single state + -- changes to the document. So if there are two content changes c1 (at + -- array index 0) and c2 (at array index 1) for a document in state S + -- then c1 moves the document from S to S' and c2 from S' to S''. So + -- c1 is computed on the state S and c2 is computed on the state S'. + -- + -- To mirror the content of a document using change events use the + -- following approach: - start with the same initial content - apply + -- the 'textDocument/didChange' notifications in the order you receive + -- them. - apply the `TextDocumentContentChangeEvent`s in a single + -- notification in the order + -- you receive them. + + end record; + -- The change text document notification's parameters. + + type FileEvent is record + uri : LSP.Structures.DocumentUri; + -- The file's uri. + + a_type : LSP.Enumerations.FileChangeType; + -- The change type. + + end record; + -- An event describing a file change. + + package FileEvent_Vectors is new Ada.Containers.Vectors + (Positive, FileEvent, "="); + + type FileEvent_Vector is new FileEvent_Vectors.Vector with null record; + + type DidChangeWatchedFilesParams is record + changes : LSP.Structures.FileEvent_Vector; + -- The actual file events. + + end record; + -- The watched files change notification's parameters. + + type WatchKind_Optional (Is_Set : Boolean := False) is record + case Is_Set is + when False => + null; + when True => + Value : WatchKind; + end case; + end record; + + type Pattern is new VSS.Strings.Virtual_String with null record; + -- The glob pattern to watch relative to the base path. Glob patterns can + -- have the following syntax: - `*` to match one or more characters in a + -- path segment - `?` to match on one character in a path segment - `**` + -- to match any number of path segments, including none - `{}` to group + -- conditions (e.g. `**["200B"]/*.{ts,js}` matches all TypeScript and + -- JavaScript files) - `[]` to declare a range of characters to match + -- in a path segment (e.g., `example.[0-9]` to match on `example.0`, + -- `example.1`, ["2026"]) - `[!...]` to negate a range of characters to + -- match in a path segment (e.g., `example.[!0-9]` to match on `example.a`, + -- `example.b`, but not `example.0`) + -- + -- @since 3.17.0 + + function Get_Hash (Self : Pattern) return Ada.Containers.Hash_Type is + (Ada.Containers.Hash_Type'Mod (Self.Hash)); + + type WorkspaceFolder is record + uri : LSP.Structures.URI; + -- The associated URI for this workspace folder. + + name : LSP.Structures.Virtual_String; + -- The name of the workspace folder. Used to refer to this workspace + -- folder in the user interface. + + end record; + -- A workspace folder inside a client. + + type WorkspaceFolder_Or_URI (Is_WorkspaceFolder : Boolean := True) is record + case Is_WorkspaceFolder is + when True => + WorkspaceFolder : LSP.Structures.WorkspaceFolder; + when False => + URI : LSP.Structures.URI; + end case; + end record; + + type RelativePattern is record + baseUri : LSP.Structures.WorkspaceFolder_Or_URI; + -- A workspace folder or a base URI to which this pattern will be + -- matched against relatively. + + pattern : LSP.Structures.Pattern; + -- The actual glob pattern; + + end record; + -- A relative pattern is a helper to construct glob patterns that are + -- matched relatively to a base URI. The common value for a `baseUri` is + -- a workspace folder root, but it can be another absolute URI as well. + -- + -- @since 3.17.0 + + type GlobPattern (Is_Pattern : Boolean := True) is record + case Is_Pattern is + when True => + Pattern : LSP.Structures.Pattern; + when False => + RelativePattern : LSP.Structures.RelativePattern; + end case; + end record; + -- The glob pattern. Either a string pattern or a relative pattern. + -- + -- @since 3.17.0 + + type FileSystemWatcher is record + globPattern : LSP.Structures.GlobPattern; + -- The glob pattern to watch. See {@link GlobPattern glob pattern} for + -- more detail. + -- + -- @since 3.17.0 support for relative patterns. + + kind : WatchKind_Optional; + -- The kind of events of interest. If omitted it defaults to + -- WatchKind.Create | WatchKind.Change | WatchKind.Delete which is 7. + + end record; + + package FileSystemWatcher_Vectors is new Ada.Containers.Vectors + (Positive, FileSystemWatcher, "="); + + type FileSystemWatcher_Vector is + new FileSystemWatcher_Vectors.Vector with null record; + + type DidChangeWatchedFilesRegistrationOptions is record + watchers : LSP.Structures.FileSystemWatcher_Vector; + -- The watchers to register. + + end record; + -- Describe options to be used when registered for text document change + -- events. + + package WorkspaceFolder_Vectors is new Ada.Containers.Vectors + (Positive, WorkspaceFolder, "="); + + type WorkspaceFolder_Vector is + new WorkspaceFolder_Vectors.Vector with null record; + + type WorkspaceFoldersChangeEvent is record + added : LSP.Structures.WorkspaceFolder_Vector; + -- The array of added workspace folders + + removed : LSP.Structures.WorkspaceFolder_Vector; + -- The array of the removed workspace folders + + end record; + -- The workspace folder change event. + + type DidChangeWorkspaceFoldersParams is record + event : LSP.Structures.WorkspaceFoldersChangeEvent; + -- The actual workspace folder change event. + + end record; + -- The parameters of a `workspace/didChangeWorkspaceFolders` notification. + + type NotebookDocumentIdentifier is record + uri : LSP.Structures.URI; + -- The notebook document's uri. + + end record; + -- A literal to identify a notebook document in the client. + -- + -- @since 3.17.0 + + type DidCloseNotebookDocumentParams is record + notebookDocument : LSP.Structures.NotebookDocumentIdentifier; + -- The notebook document that got closed. + + cellTextDocuments : LSP.Structures.TextDocumentIdentifier_Vector; + -- The text documents that represent the content of a notebook cell that + -- got closed. + + end record; + -- The params sent in a close notebook document notification. + -- + -- @since 3.17.0 + + type DidCloseTextDocumentParams is record + textDocument : LSP.Structures.TextDocumentIdentifier; + -- The document that was closed. + + end record; + -- The parameters sent in a close text document notification + + type NotebookDocument is record + uri : LSP.Structures.URI; + -- The notebook document's uri. + + notebookType : LSP.Structures.Virtual_String; + -- The type of the notebook. + + version : Standard.Integer; + -- The version number of this document (it will increase after each + -- change, including undo/redo). + + metadata : LSPObject_Optional; + -- Additional metadata stored with the notebook document. + -- + -- Note: should always be an object literal (e.g. LSPObject) + + cells : LSP.Structures.NotebookCell_Vector; + -- The cells of a notebook. + + end record; + -- A notebook document. + -- + -- @since 3.17.0 + + type DidOpenNotebookDocumentParams is record + notebookDocument : LSP.Structures.NotebookDocument; + -- The notebook document that got opened. + + cellTextDocuments : LSP.Structures.TextDocumentItem_Vector; + -- The text documents that represent the content of a notebook cell. + + end record; + -- The params sent in an open notebook document notification. + -- + -- @since 3.17.0 + + type DidOpenTextDocumentParams is record + textDocument : LSP.Structures.TextDocumentItem; + -- The document that was opened. + + end record; + -- The parameters sent in an open text document notification + + type DidSaveNotebookDocumentParams is record + notebookDocument : LSP.Structures.NotebookDocumentIdentifier; + -- The notebook document that got saved. + + end record; + -- The params sent in a save notebook document notification. + -- + -- @since 3.17.0 + + type DidSaveTextDocumentParams is record + textDocument : LSP.Structures.TextDocumentIdentifier; + -- The document that was saved. + + text : Virtual_String_Optional; + -- Optional the content when saved. Depends on the includeText value + -- when the save notification was requested. + + end record; + -- The parameters sent in a save text document notification + + type DocumentColorOptions is new WorkDoneProgressOptions with record + workDoneProgress : Boolean_Optional; + + end record; + + overriding function workDoneProgress + (Self : DocumentColorOptions) return Boolean_Optional is + (Self.workDoneProgress); + + type DocumentColorParams is + new WorkDoneProgressParams and PartialResultParams with record + workDoneToken : ProgressToken_Optional; + -- An optional token that a server can use to report work done progress. + + partialResultToken : ProgressToken_Optional; + -- An optional token that a server can use to report partial results + -- (e.g. streaming) to the client. + + textDocument : LSP.Structures.TextDocumentIdentifier; + -- The text document. + + end record; + -- Parameters for a [DocumentColorRequest](#DocumentColorRequest). + + overriding function workDoneToken + (Self : DocumentColorParams) + return LSP.Structures.ProgressToken_Optional is + (Self.workDoneToken); + + overriding function partialResultToken + (Self : DocumentColorParams) + return LSP.Structures.ProgressToken_Optional is + (Self.partialResultToken); + + type DocumentColorRegistrationOptions is + new DocumentColorOptions and StaticRegistrationOptions with record + id : Virtual_String_Optional; + -- The id used to register the request. The id can be used to deregister + -- the request again. See also Registration#id. + + Parent : LSP.Structures.TextDocumentRegistrationOptions; + end record; + + overriding function id + (Self : DocumentColorRegistrationOptions) + return Virtual_String_Optional is + (Self.id); + + type DocumentDiagnosticParams is + new WorkDoneProgressParams and PartialResultParams with record + workDoneToken : ProgressToken_Optional; + -- An optional token that a server can use to report work done progress. + + partialResultToken : ProgressToken_Optional; + -- An optional token that a server can use to report partial results + -- (e.g. streaming) to the client. + + textDocument : LSP.Structures.TextDocumentIdentifier; + -- The text document. + + identifier : Virtual_String_Optional; + -- The additional identifier provided during registration. + + previousResultId : Virtual_String_Optional; + -- The result id of a previous response if provided. + + end record; + -- Parameters of the document diagnostic request. + -- + -- @since 3.17.0 + + overriding function workDoneToken + (Self : DocumentDiagnosticParams) + return LSP.Structures.ProgressToken_Optional is + (Self.workDoneToken); + + overriding function partialResultToken + (Self : DocumentDiagnosticParams) + return LSP.Structures.ProgressToken_Optional is + (Self.partialResultToken); + + type UnchangedDocumentDiagnosticReport is tagged record + resultId : LSP.Structures.Virtual_String; + -- A result id which will be sent on the next diagnostic request for the + -- same document. + + end record; + -- A diagnostic report indicating that the last returned report is still + -- accurate. + -- + -- @since 3.17.0 + + type FullDocumentDiagnosticReport is tagged record + resultId : Virtual_String_Optional; + -- An optional result id. If provided it will be sent on the next + -- diagnostic request for the same document. + + items : LSP.Structures.Diagnostic_Vector; + -- The actual items. + + end record; + -- A diagnostic report with a full set of problems. + -- + -- @since 3.17.0 + + type relatedDocuments_OfDocumentDiagnosticReportPartialResult_Item_Variant is + (full, unchanged); + + type relatedDocuments_OfDocumentDiagnosticReportPartialResult_Item + (Kind : relatedDocuments_OfDocumentDiagnosticReportPartialResult_Item_Variant := + relatedDocuments_OfDocumentDiagnosticReportPartialResult_Item_Variant' + First) + is + record + case Kind is + when full => + full : LSP.Structures.FullDocumentDiagnosticReport; + when unchanged => + unchanged : LSP.Structures.UnchangedDocumentDiagnosticReport; + end case; + end record; + + package relatedDocuments_OfDocumentDiagnosticReportPartialResult_Item_Maps is new Ada + .Containers + .Hashed_Maps + (DocumentUri, + relatedDocuments_OfDocumentDiagnosticReportPartialResult_Item, Get_Hash, + "="); + + type relatedDocuments_OfDocumentDiagnosticReportPartialResult is + new relatedDocuments_OfDocumentDiagnosticReportPartialResult_Item_Maps + .Map with + null record; + + type DocumentDiagnosticReportPartialResult is record + relatedDocuments : LSP.Structures + .relatedDocuments_OfDocumentDiagnosticReportPartialResult; + + end record; + -- A partial result for a document diagnostic report. + -- + -- @since 3.17.0 + + type DocumentFormattingOptions is new WorkDoneProgressOptions with record + workDoneProgress : Boolean_Optional; + + end record; + -- Provider options for a + -- [DocumentFormattingRequest](#DocumentFormattingRequest). + + overriding function workDoneProgress + (Self : DocumentFormattingOptions) return Boolean_Optional is + (Self.workDoneProgress); + + type FormattingOptions is record + tabSize : Natural; + -- Size of a tab in spaces. + + insertSpaces : Standard.Boolean; + -- Prefer spaces over tabs. + + trimTrailingWhitespace : Boolean_Optional; + -- Trim trailing whitespace on a line. + -- + -- @since 3.15.0 + + insertFinalNewline : Boolean_Optional; + -- Insert a newline character at the end of the file if one does not + -- exist. + -- + -- @since 3.15.0 + + trimFinalNewlines : Boolean_Optional; + -- Trim all newlines after the final newline at the end of the file. + -- + -- @since 3.15.0 + + end record; + -- Value-object describing what options formatting should use. + + type DocumentFormattingParams is new WorkDoneProgressParams with record + workDoneToken : ProgressToken_Optional; + -- An optional token that a server can use to report work done progress. + + textDocument : LSP.Structures.TextDocumentIdentifier; + -- The document to format. + + options : LSP.Structures.FormattingOptions; + -- The format options. + + end record; + -- The parameters of a + -- [DocumentFormattingRequest](#DocumentFormattingRequest). + + overriding function workDoneToken + (Self : DocumentFormattingParams) + return LSP.Structures.ProgressToken_Optional is + (Self.workDoneToken); + + type DocumentFormattingRegistrationOptions is + new DocumentFormattingOptions with record + Parent : LSP.Structures.TextDocumentRegistrationOptions; + end record; + -- Registration options for a + -- [DocumentFormattingRequest](#DocumentFormattingRequest). + + type DocumentHighlightKind_Optional (Is_Set : Boolean := False) is record + case Is_Set is + when False => + null; + when True => + Value : DocumentHighlightKind; + end case; + end record; + + type DocumentHighlight is record + a_range : LSP.Structures.A_Range; + -- The range this highlight applies to. + + kind : DocumentHighlightKind_Optional; + -- The highlight kind, default is [text](#DocumentHighlightKind.Text). + + end record; + -- A document highlight is a range inside a text document which deserves + -- special attention. Usually a document highlight is visualized by + -- changing the background color of its range. + + type DocumentHighlightOptions is new WorkDoneProgressOptions with record + workDoneProgress : Boolean_Optional; + + end record; + -- Provider options for a + -- [DocumentHighlightRequest](#DocumentHighlightRequest). + + overriding function workDoneProgress + (Self : DocumentHighlightOptions) return Boolean_Optional is + (Self.workDoneProgress); + + type DocumentHighlightParams is + new TextDocumentPositionParams and WorkDoneProgressParams and + PartialResultParams with record + workDoneToken : ProgressToken_Optional; + -- An optional token that a server can use to report work done progress. + + partialResultToken : ProgressToken_Optional; + -- An optional token that a server can use to report partial results + -- (e.g. streaming) to the client. + + end record; + -- Parameters for a [DocumentHighlightRequest](#DocumentHighlightRequest). + + overriding function workDoneToken + (Self : DocumentHighlightParams) + return LSP.Structures.ProgressToken_Optional is + (Self.workDoneToken); + + overriding function partialResultToken + (Self : DocumentHighlightParams) + return LSP.Structures.ProgressToken_Optional is + (Self.partialResultToken); + + type DocumentHighlightRegistrationOptions is + new DocumentHighlightOptions with record + Parent : LSP.Structures.TextDocumentRegistrationOptions; + end record; + -- Registration options for a + -- [DocumentHighlightRequest](#DocumentHighlightRequest). + + type DocumentLink is record + a_range : LSP.Structures.A_Range; + -- The range this link applies to. + + target : Virtual_String_Optional; + -- The uri this link points to. If missing a resolve request is sent + -- later. + + tooltip : Virtual_String_Optional; + -- The tooltip text when you hover over this link. + -- + -- If a tooltip is provided, is will be displayed in a string that + -- includes instructions on how to trigger the link, such as `{0} (ctrl + -- + click)`. The specific instructions vary depending on OS, user + -- settings, and localization. + -- + -- @since 3.15.0 + + data : LSPAny_Optional; + -- A data entry field that is preserved on a document link between a + -- DocumentLinkRequest and a DocumentLinkResolveRequest. + + end record; + -- A document link is a range in a text document that links to an internal + -- or external resource, like another text document or a web site. + + type DocumentLinkOptions is new WorkDoneProgressOptions with record + workDoneProgress : Boolean_Optional; + + resolveProvider : Boolean_Optional; + -- Document links have a resolve provider as well. + + end record; + -- Provider options for a [DocumentLinkRequest](#DocumentLinkRequest). + + overriding function workDoneProgress + (Self : DocumentLinkOptions) return Boolean_Optional is + (Self.workDoneProgress); + + type DocumentLinkParams is + new WorkDoneProgressParams and PartialResultParams with record + workDoneToken : ProgressToken_Optional; + -- An optional token that a server can use to report work done progress. + + partialResultToken : ProgressToken_Optional; + -- An optional token that a server can use to report partial results + -- (e.g. streaming) to the client. + + textDocument : LSP.Structures.TextDocumentIdentifier; + -- The document to provide document links for. + + end record; + -- The parameters of a [DocumentLinkRequest](#DocumentLinkRequest). + + overriding function workDoneToken + (Self : DocumentLinkParams) + return LSP.Structures.ProgressToken_Optional is + (Self.workDoneToken); + + overriding function partialResultToken + (Self : DocumentLinkParams) + return LSP.Structures.ProgressToken_Optional is + (Self.partialResultToken); + + type DocumentLinkRegistrationOptions is new DocumentLinkOptions with record + Parent : LSP.Structures.TextDocumentRegistrationOptions; + end record; + -- Registration options for a [DocumentLinkRequest](#DocumentLinkRequest). + + type DocumentOnTypeFormattingOptions is tagged record + firstTriggerCharacter : LSP.Structures.Virtual_String; + -- A character on which formatting should be triggered, like `{`. + + moreTriggerCharacter : LSP.Structures.Virtual_String_Vector; + -- More trigger characters. + + end record; + -- Provider options for a + -- [DocumentOnTypeFormattingRequest](#DocumentOnTypeFormattingRequest). + + type DocumentOnTypeFormattingParams is record + textDocument : LSP.Structures.TextDocumentIdentifier; + -- The document to format. + + position : LSP.Structures.Position; + -- The position around which the on type formatting should happen. This + -- is not necessarily the exact position where the character denoted by + -- the property `ch` got typed. + + ch : LSP.Structures.Virtual_String; + -- The character that has been typed that triggered the formatting + -- on type request. That is not necessarily the last character that + -- got inserted into the document since the client could auto insert + -- characters as well (e.g. like automatic brace completion). + + options : LSP.Structures.FormattingOptions; + -- The formatting options. + + end record; + -- The parameters of a + -- [DocumentOnTypeFormattingRequest](#DocumentOnTypeFormattingRequest). + + type DocumentOnTypeFormattingRegistrationOptions is + new DocumentOnTypeFormattingOptions with record + Parent : LSP.Structures.TextDocumentRegistrationOptions; + end record; + -- Registration options for a + -- [DocumentOnTypeFormattingRequest](#DocumentOnTypeFormattingRequest). + + type DocumentRangeFormattingOptions is + new WorkDoneProgressOptions with record + workDoneProgress : Boolean_Optional; + + end record; + -- Provider options for a + -- [DocumentRangeFormattingRequest](#DocumentRangeFormattingRequest). + + overriding function workDoneProgress + (Self : DocumentRangeFormattingOptions) return Boolean_Optional is + (Self.workDoneProgress); + + type DocumentRangeFormattingParams is new WorkDoneProgressParams with record + workDoneToken : ProgressToken_Optional; + -- An optional token that a server can use to report work done progress. + + textDocument : LSP.Structures.TextDocumentIdentifier; + -- The document to format. + + a_range : LSP.Structures.A_Range; + -- The range to format + + options : LSP.Structures.FormattingOptions; + -- The format options + + end record; + -- The parameters of a + -- [DocumentRangeFormattingRequest](#DocumentRangeFormattingRequest). + + overriding function workDoneToken + (Self : DocumentRangeFormattingParams) + return LSP.Structures.ProgressToken_Optional is + (Self.workDoneToken); + + type DocumentRangeFormattingRegistrationOptions is + new DocumentRangeFormattingOptions with record + Parent : LSP.Structures.TextDocumentRegistrationOptions; + end record; + -- Registration options for a + -- [DocumentRangeFormattingRequest](#DocumentRangeFormattingRequest). + + type DocumentSymbol_Vector is tagged private with + Variable_Indexing => Get_DocumentSymbol_Variable_Reference, + Constant_Indexing => Get_DocumentSymbol_Constant_Reference; + + type DocumentSymbol is record + name : LSP.Structures.Virtual_String; + -- The name of this symbol. Will be displayed in the user interface and + -- therefore must not be an empty string or a string only consisting of + -- white spaces. + + detail : Virtual_String_Optional; + -- More detail for this symbol, e.g the signature of a function. + + kind : LSP.Enumerations.SymbolKind; + -- The kind of this symbol. + + tags : LSP.Structures.SymbolTag_Set; + -- Tags for this document symbol. + -- + -- @since 3.16.0 + + deprecated : Boolean_Optional; + -- Indicates if this symbol is deprecated. + -- + -- @deprecated Use tags instead + + a_range : LSP.Structures.A_Range; + -- The range enclosing this symbol not including leading/trailing + -- whitespace but everything else like comments. This information is + -- typically used to determine if the clients cursor is inside the + -- symbol to reveal in the symbol in the UI. + + selectionRange : LSP.Structures.A_Range; + -- The range that should be selected and revealed when this symbol is + -- being picked, e.g the name of a function. Must be contained by the + -- `range`. + + children : LSP.Structures.DocumentSymbol_Vector; + -- Children of this symbol, e.g. properties of a class. + + end record; + -- Represents programming constructs like variables, classes, interfaces + -- etc. that appear in a document. Document symbols can be hierarchical + -- and they have two ranges: one that encloses its definition and one that + -- points to its most interesting range, e.g. the range of an identifier. + + type DocumentSymbolOptions is new WorkDoneProgressOptions with record + workDoneProgress : Boolean_Optional; + + label : Virtual_String_Optional; + -- A human-readable string that is shown when multiple outlines trees + -- are shown for the same document. + -- + -- @since 3.16.0 + + end record; + -- Provider options for a [DocumentSymbolRequest](#DocumentSymbolRequest). + + overriding function workDoneProgress + (Self : DocumentSymbolOptions) return Boolean_Optional is + (Self.workDoneProgress); + + type DocumentSymbolParams is + new WorkDoneProgressParams and PartialResultParams with record + workDoneToken : ProgressToken_Optional; + -- An optional token that a server can use to report work done progress. + + partialResultToken : ProgressToken_Optional; + -- An optional token that a server can use to report partial results + -- (e.g. streaming) to the client. + + textDocument : LSP.Structures.TextDocumentIdentifier; + -- The text document. + + end record; + -- Parameters for a [DocumentSymbolRequest](#DocumentSymbolRequest). + + overriding function workDoneToken + (Self : DocumentSymbolParams) + return LSP.Structures.ProgressToken_Optional is + (Self.workDoneToken); + + overriding function partialResultToken + (Self : DocumentSymbolParams) + return LSP.Structures.ProgressToken_Optional is + (Self.partialResultToken); + + type DocumentSymbolRegistrationOptions is + new DocumentSymbolOptions with record + Parent : LSP.Structures.TextDocumentRegistrationOptions; + end record; + -- Registration options for a + -- [DocumentSymbolRequest](#DocumentSymbolRequest). + + type ExecuteCommandOptions is new WorkDoneProgressOptions with record + workDoneProgress : Boolean_Optional; + + commands : LSP.Structures.Virtual_String_Vector; + -- The commands to be executed on the server + + end record; + -- The server capabilities of a + -- [ExecuteCommandRequest](#ExecuteCommandRequest). + + overriding function workDoneProgress + (Self : ExecuteCommandOptions) return Boolean_Optional is + (Self.workDoneProgress); + + type ExecuteCommandParams is new WorkDoneProgressParams with record + workDoneToken : ProgressToken_Optional; + -- An optional token that a server can use to report work done progress. + + command : LSP.Structures.Virtual_String; + -- The identifier of the actual command handler. + + arguments : LSP.Structures.LSPAny_Vector; + -- Arguments that the command should be invoked with. + + end record; + -- The parameters of a [ExecuteCommandRequest](#ExecuteCommandRequest). + + overriding function workDoneToken + (Self : ExecuteCommandParams) + return LSP.Structures.ProgressToken_Optional is + (Self.workDoneToken); + + type ExecuteCommandRegistrationOptions is + new ExecuteCommandOptions with record + null; + end record; + -- Registration options for a + -- [ExecuteCommandRequest](#ExecuteCommandRequest). + + type FileOperationPatternKind_Optional (Is_Set : Boolean := False) is record + case Is_Set is + when False => + null; + when True => + Value : FileOperationPatternKind; + end case; + end record; + + type FileOperationPatternOptions is record + ignoreCase : Boolean_Optional; + -- The pattern should be matched ignoring casing. + + end record; + -- Matching options for the file operation pattern. + -- + -- @since 3.16.0 + + type FileOperationPatternOptions_Optional (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : FileOperationPatternOptions; + end case; + end record; + + type FileOperationPattern is record + glob : LSP.Structures.Virtual_String; + -- The glob pattern to match. Glob patterns can have the following + -- syntax: - `*` to match one or more characters in a path segment - + -- `?` to match on one character in a path segment - `**` to match any + -- number of path segments, including none - `{}` to group sub patterns + -- into an OR expression. (e.g. `**["200B"]/*.{ts,js}` matches all + -- TypeScript and JavaScript files) - `[]` to declare a range of + -- characters to match in a path segment (e.g., `example.[0-9]` to match + -- on `example.0`, `example.1`, ["2026"]) - `[!...]` to negate a range + -- of characters to match in a path segment (e.g., `example.[!0-9]` to + -- match on `example.a`, `example.b`, but not `example.0`) + + matches : FileOperationPatternKind_Optional; + -- Whether to match files or folders with this pattern. + -- + -- Matches both if undefined. + + options : FileOperationPatternOptions_Optional; + -- Additional options used during matching. + + end record; + -- A pattern to describe in which file operation requests or notifications + -- the server is interested in receiving. + -- + -- @since 3.16.0 + + type FileOperationFilter is record + scheme : Virtual_String_Optional; + -- A Uri scheme like `file` or `untitled`. + + pattern : LSP.Structures.FileOperationPattern; + -- The actual file operation pattern. + + end record; + -- A filter to describe in which file operation requests or notifications + -- the server is interested in receiving. + -- + -- @since 3.16.0 + + package FileOperationFilter_Vectors is new Ada.Containers.Vectors + (Positive, FileOperationFilter, "="); + + type FileOperationFilter_Vector is + new FileOperationFilter_Vectors.Vector with null record; + + type FileOperationRegistrationOptions is record + filters : LSP.Structures.FileOperationFilter_Vector; + -- The actual filters. + + end record; + -- The options to register for file operations. + -- + -- @since 3.16.0 + + type FileOperationRegistrationOptions_Optional (Is_Set : Boolean := False) + is + record + case Is_Set is + when False => + null; + when True => + Value : FileOperationRegistrationOptions; + end case; + end record; + + type FileOperationOptions is record + didCreate : FileOperationRegistrationOptions_Optional; + -- The server is interested in receiving didCreateFiles notifications. + + willCreate : FileOperationRegistrationOptions_Optional; + -- The server is interested in receiving willCreateFiles requests. + + didRename : FileOperationRegistrationOptions_Optional; + -- The server is interested in receiving didRenameFiles notifications. + + willRename : FileOperationRegistrationOptions_Optional; + -- The server is interested in receiving willRenameFiles requests. + + didDelete : FileOperationRegistrationOptions_Optional; + -- The server is interested in receiving didDeleteFiles file + -- notifications. + + willDelete : FileOperationRegistrationOptions_Optional; + -- The server is interested in receiving willDeleteFiles file requests. + + end record; + -- Options for notifications/requests for user operations on files. + -- + -- @since 3.16.0 + + type FileRename is record + oldUri : LSP.Structures.Virtual_String; + -- A file:// URI for the original location of the file/folder being + -- renamed. + + newUri : LSP.Structures.Virtual_String; + -- A file:// URI for the new location of the file/folder being renamed. + + end record; + -- Represents information on a file/folder rename. + -- + -- @since 3.16.0 + + type FoldingRangeKind_Optional (Is_Set : Boolean := False) is record + case Is_Set is + when False => + null; + when True => + Value : FoldingRangeKind; + end case; + end record; + + type FoldingRange is record + startLine : Natural; + -- The zero-based start line of the range to fold. The folded area + -- starts after the line's last character. To be valid, the end must be + -- zero or larger and smaller than the number of lines in the document. + + startCharacter : Natural_Optional; + -- The zero-based character offset from where the folded range starts. + -- If not defined, defaults to the length of the start line. + + endLine : Natural; + -- The zero-based end line of the range to fold. The folded area ends + -- with the line's last character. To be valid, the end must be zero + -- or larger and smaller than the number of lines in the document. + + endCharacter : Natural_Optional; + -- The zero-based character offset before the folded range ends. If not + -- defined, defaults to the length of the end line. + + kind : FoldingRangeKind_Optional; + -- Describes the kind of the folding range such as `comment' + -- or 'region'. The kind is used to categorize folding + -- ranges and used by commands like 'Fold all comments'. See + -- [FoldingRangeKind](#FoldingRangeKind) for an enumeration + -- of standardized kinds. + + collapsedText : Virtual_String_Optional; + -- The text that the client should show when the specified range is + -- collapsed. If not defined or not supported by the client, a default + -- will be chosen by the client. + -- + -- @since 3.17.0 + + end record; + -- Represents a folding range. To be valid, start and end line must be + -- bigger than zero and smaller than the number of lines in the document. + -- Clients are free to ignore invalid ranges. + + type FoldingRangeOptions is new WorkDoneProgressOptions with record + workDoneProgress : Boolean_Optional; + + end record; + + overriding function workDoneProgress + (Self : FoldingRangeOptions) return Boolean_Optional is + (Self.workDoneProgress); + + type FoldingRangeParams is + new WorkDoneProgressParams and PartialResultParams with record + workDoneToken : ProgressToken_Optional; + -- An optional token that a server can use to report work done progress. + + partialResultToken : ProgressToken_Optional; + -- An optional token that a server can use to report partial results + -- (e.g. streaming) to the client. + + textDocument : LSP.Structures.TextDocumentIdentifier; + -- The text document. + + end record; + -- Parameters for a [FoldingRangeRequest](#FoldingRangeRequest). + + overriding function workDoneToken + (Self : FoldingRangeParams) + return LSP.Structures.ProgressToken_Optional is + (Self.workDoneToken); + + overriding function partialResultToken + (Self : FoldingRangeParams) + return LSP.Structures.ProgressToken_Optional is + (Self.partialResultToken); + + type FoldingRangeRegistrationOptions is + new FoldingRangeOptions and StaticRegistrationOptions with record + id : Virtual_String_Optional; + -- The id used to register the request. The id can be used to deregister + -- the request again. See also Registration#id. + + Parent : LSP.Structures.TextDocumentRegistrationOptions; + end record; + + overriding function id + (Self : FoldingRangeRegistrationOptions) return Virtual_String_Optional is + (Self.id); + + type MarkedString (Is_Virtual_String : Boolean := True) is record + case Is_Virtual_String is + when True => + Virtual_String : LSP.Structures.Virtual_String; + when False => + language : LSP.Structures.Virtual_String; + + value : LSP.Structures.Virtual_String; + + end case; + end record; + -- MarkedString can be used to render human readable text. It is either + -- a markdown string or a code-block that provides a language and a code + -- snippet. The language identifier is semantically equal to the optional + -- language identifier in fenced code blocks in GitHub issues. See + -- https://help.github.com/articles/creating-and-highlighting-code-blocks/#syntax-highlighting + -- + -- The pair of a language and a value is an equivalent to markdown: + -- ```${language} ${value} ``` + -- + -- Note that markdown strings will be sanitized - that means html will be + -- escaped. @deprecated use MarkupContent instead. + + package MarkedString_Vectors is new Ada.Containers.Vectors + (Positive, MarkedString, "="); + + type MarkedString_Vector is + new MarkedString_Vectors.Vector with null record; + + type MarkupContent_Or_MarkedString_Vector + (Is_MarkupContent : Boolean := True) is + record + case Is_MarkupContent is + when True => + MarkupContent : LSP.Structures.MarkupContent; + when False => + MarkedString_Vector : LSP.Structures.MarkedString_Vector; + end case; + end record; + + type Hover is record + contents : LSP.Structures.MarkupContent_Or_MarkedString_Vector; + -- The hover's content + + a_range : A_Range_Optional; + -- An optional range inside the text document that is used to visualize + -- the hover, e.g. by changing the background color. + + end record; + -- The result of a hover request. + + type HoverOptions is new WorkDoneProgressOptions with record + workDoneProgress : Boolean_Optional; + + end record; + -- Hover options. + + overriding function workDoneProgress + (Self : HoverOptions) return Boolean_Optional is + (Self.workDoneProgress); + + type HoverParams is + new TextDocumentPositionParams and WorkDoneProgressParams with record + workDoneToken : ProgressToken_Optional; + -- An optional token that a server can use to report work done progress. + + end record; + -- Parameters for a [HoverRequest](#HoverRequest). + + overriding function workDoneToken + (Self : HoverParams) return LSP.Structures.ProgressToken_Optional is + (Self.workDoneToken); + + type HoverRegistrationOptions is new HoverOptions with record + Parent : LSP.Structures.TextDocumentRegistrationOptions; + end record; + -- Registration options for a [HoverRequest](#HoverRequest). + + type ImplementationOptions is new WorkDoneProgressOptions with record + workDoneProgress : Boolean_Optional; + + end record; + + overriding function workDoneProgress + (Self : ImplementationOptions) return Boolean_Optional is + (Self.workDoneProgress); + + type ImplementationParams is + new TextDocumentPositionParams and WorkDoneProgressParams and + PartialResultParams with record + workDoneToken : ProgressToken_Optional; + -- An optional token that a server can use to report work done progress. + + partialResultToken : ProgressToken_Optional; + -- An optional token that a server can use to report partial results + -- (e.g. streaming) to the client. + + end record; + + overriding function workDoneToken + (Self : ImplementationParams) + return LSP.Structures.ProgressToken_Optional is + (Self.workDoneToken); + + overriding function partialResultToken + (Self : ImplementationParams) + return LSP.Structures.ProgressToken_Optional is + (Self.partialResultToken); + + type ImplementationRegistrationOptions is + new ImplementationOptions and StaticRegistrationOptions with record + id : Virtual_String_Optional; + -- The id used to register the request. The id can be used to deregister + -- the request again. See also Registration#id. + + Parent : LSP.Structures.TextDocumentRegistrationOptions; + end record; + + overriding function id + (Self : ImplementationRegistrationOptions) + return Virtual_String_Optional is + (Self.id); + + type InitializeError is record + retry : Standard.Boolean; + -- Indicates whether the client execute the following retry logic: (1) + -- show the message provided by the ResponseError to the user (2) user + -- selects retry or cancel (3) if user selected retry the initialize + -- method is sent again. + + end record; + -- The data type of the ResponseError if the initialize request fails. + + subtype WorkspaceFolder_Vector_Or_Null is WorkspaceFolder_Vector; + + type WorkspaceFolder_Vector_Or_Null_Optional (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : WorkspaceFolder_Vector_Or_Null; + end case; + end record; + + type WorkspaceFoldersInitializeParams is tagged record + workspaceFolders : WorkspaceFolder_Vector_Or_Null_Optional; + -- The workspace folders configured in the client when the server + -- starts. + -- + -- This property is only available if the client supports workspace + -- folders. It can be `null` if the client supports workspace folders + -- but none are configured. + -- + -- @since 3.6.0 + + end record; + + type clientInfo_Of_InitializeParams is record + name : LSP.Structures.Virtual_String; + -- The name of the client as defined by the client. + + version : Virtual_String_Optional; + -- The client's version as defined by the client. + + end record; + type clientInfo_Of_InitializeParams_Optional (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : clientInfo_Of_InitializeParams; + end case; + end record; + + type Virtual_String_Or_Null (Is_Null : Boolean := True) is record + case Is_Null is + when True => + null; + when False => + Value : LSP.Structures.Virtual_String; + end case; + end record; + + type Virtual_String_Or_Null_Optional (Is_Set : Boolean := False) is record + case Is_Set is + when False => + null; + when True => + Value : Virtual_String_Or_Null; + end case; + end record; + + type DocumentUri_Or_Null (Is_Null : Boolean := True) is record + case Is_Null is + when True => + null; + when False => + Value : LSP.Structures.DocumentUri; + end case; + end record; + + type trace_Of_InitializeParams is (off, messages, compact, verbose); + + type trace_Of_InitializeParams_Optional (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : trace_Of_InitializeParams; + end case; + end record; + + type An_InitializeParams is new WorkDoneProgressParams with record + workDoneToken : ProgressToken_Optional; + -- An optional token that a server can use to report work done progress. + + processId : LSP.Structures.Integer_Or_Null; + -- The process Id of the parent process that started the server. + -- + -- Is `null` if the process has not been started by another process. If + -- the parent process is not alive then the server should exit. + + clientInfo : clientInfo_Of_InitializeParams_Optional; + -- Information about the client + -- + -- @since 3.15.0 + + locale : Virtual_String_Optional; + -- The locale the client is currently showing the user interface in. + -- This must not necessarily be the locale of the operating system. + -- + -- Uses IETF language tags as the value's syntax (See + -- https://en.wikipedia.org/wiki/IETF_language_tag) + -- + -- @since 3.16.0 + + rootPath : Virtual_String_Or_Null_Optional; + -- The rootPath of the workspace. Is null if no folder is open. + -- + -- @deprecated in favour of rootUri. + + rootUri : LSP.Structures.DocumentUri_Or_Null; + -- The rootUri of the workspace. Is null if no folder is open. If both + -- `rootPath` and `rootUri` are set `rootUri` wins. + -- + -- @deprecated in favour of workspaceFolders. + + capabilities : LSP.Structures.ClientCapabilities; + -- The capabilities provided by the client (editor or tool) + + initializationOptions : LSPAny_Optional; + -- User provided initialization options. + + trace : trace_Of_InitializeParams_Optional; + -- The initial trace setting. If omitted trace is disabled ('off'). + + end record; + -- The initialize parameters + + overriding function workDoneToken + (Self : An_InitializeParams) + return LSP.Structures.ProgressToken_Optional is + (Self.workDoneToken); + + type InitializeParams is new An_InitializeParams with record + Parent : LSP.Structures.WorkspaceFoldersInitializeParams; + end record; + + type MonikerOptions is new WorkDoneProgressOptions with record + workDoneProgress : Boolean_Optional; + + end record; + + overriding function workDoneProgress + (Self : MonikerOptions) return Boolean_Optional is + (Self.workDoneProgress); + + type SemanticTokensLegend is record + tokenTypes : LSP.Structures.Virtual_String_Vector; + -- The token types a server uses. + + tokenModifiers : LSP.Structures.Virtual_String_Vector; + -- The token modifiers a server uses. + + end record; + -- @since 3.16.0 + + type SemanticTokensOptions is new WorkDoneProgressOptions with record + workDoneProgress : Boolean_Optional; + + legend : LSP.Structures.SemanticTokensLegend; + -- The legend used by the server + + a_range : Boolean_Or_Any_Optional; + -- Server supports providing semantic tokens for a specific range of a + -- document. + + full : Boolean_Or_Something_Optional; + -- Server supports providing semantic tokens for a full document. + + end record; + -- @since 3.16.0 + + overriding function workDoneProgress + (Self : SemanticTokensOptions) return Boolean_Optional is + (Self.workDoneProgress); + + type SemanticTokensRegistrationOptions is + new SemanticTokensOptions and StaticRegistrationOptions with record + id : Virtual_String_Optional; + -- The id used to register the request. The id can be used to deregister + -- the request again. See also Registration#id. + + Parent : LSP.Structures.TextDocumentRegistrationOptions; + end record; + -- @since 3.16.0 + + overriding function id + (Self : SemanticTokensRegistrationOptions) + return Virtual_String_Optional is + (Self.id); + + type Virtual_String_Or_Boolean (Is_Virtual_String : Boolean := True) is + record + case Is_Virtual_String is + when True => + Virtual_String : LSP.Structures.Virtual_String; + when False => + Boolean : Standard.Boolean; + end case; + end record; + + type Virtual_String_Or_Boolean_Optional (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : Virtual_String_Or_Boolean; + end case; + end record; + + type WorkspaceFoldersServerCapabilities is record + supported : Boolean_Optional; + -- The server has support for workspace folders + + changeNotifications : Virtual_String_Or_Boolean_Optional; + -- Whether the server wants to receive workspace folder change + -- notifications. + -- + -- If a string is provided the string is treated as an ID under + -- which the notification is registered on the client side. + -- The ID can be used to unregister for these events using + -- the `client/unregisterCapability` request. + + end record; + + type WorkspaceFoldersServerCapabilities_Optional (Is_Set : Boolean := False) + is + record + case Is_Set is + when False => + null; + when True => + Value : WorkspaceFoldersServerCapabilities; + end case; + end record; + + type SignatureHelpOptions is new WorkDoneProgressOptions with record + workDoneProgress : Boolean_Optional; + + triggerCharacters : LSP.Structures.Virtual_String_Vector; + -- List of characters that trigger signature help automatically. + + retriggerCharacters : LSP.Structures.Virtual_String_Vector; + -- List of characters that re-trigger signature help. + -- + -- These trigger characters are only active when signature help + -- is already showing. All trigger characters are also counted + -- as re-trigger characters. + -- + -- @since 3.15.0 + + end record; + -- Server Capabilities for a [SignatureHelpRequest](#SignatureHelpRequest). + + overriding function workDoneProgress + (Self : SignatureHelpOptions) return Boolean_Optional is + (Self.workDoneProgress); + + type SignatureHelpOptions_Optional (Is_Set : Boolean := False) is record + case Is_Set is + when False => + null; + when True => + Value : SignatureHelpOptions; + end case; + end record; + + type WorkspaceSymbolOptions is new WorkDoneProgressOptions with record + workDoneProgress : Boolean_Optional; + + resolveProvider : Boolean_Optional; + -- The server provides support to resolve additional information for a + -- workspace symbol. + -- + -- @since 3.17.0 + + end record; + -- Server capabilities for a + -- [WorkspaceSymbolRequest](#WorkspaceSymbolRequest). + + overriding function workDoneProgress + (Self : WorkspaceSymbolOptions) return Boolean_Optional is + (Self.workDoneProgress); + + type TypeHierarchyOptions is new WorkDoneProgressOptions with record + workDoneProgress : Boolean_Optional; + + end record; + -- Type hierarchy options used during static registration. + -- + -- @since 3.17.0 + + overriding function workDoneProgress + (Self : TypeHierarchyOptions) return Boolean_Optional is + (Self.workDoneProgress); + + type InlineValueOptions is new WorkDoneProgressOptions with record + workDoneProgress : Boolean_Optional; + + end record; + -- Inline value options used during static registration. + -- + -- @since 3.17.0 + + overriding function workDoneProgress + (Self : InlineValueOptions) return Boolean_Optional is + (Self.workDoneProgress); + + type InlineValueRegistrationOptions is + new InlineValueOptions and StaticRegistrationOptions with record + id : Virtual_String_Optional; + -- The id used to register the request. The id can be used to deregister + -- the request again. See also Registration#id. + + Parent : LSP.Structures.TextDocumentRegistrationOptions; + end record; + -- Inline value options used during static or dynamic registration. + -- + -- @since 3.17.0 + + overriding function id + (Self : InlineValueRegistrationOptions) return Virtual_String_Optional is + (Self.id); + + type Virtual_String_Or_NotebookDocumentFilter_Optional + (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : Virtual_String_Or_NotebookDocumentFilter; + end case; + end record; + + type cells_OfnotebookSelector_OfNotebookDocumentSyncOptions_Item_Item is + record + language : LSP.Structures.Virtual_String; + + end record; + package cells_OfnotebookSelector_OfNotebookDocumentSyncOptions_Item_Item_Vectors is new Ada + .Containers + .Vectors + (Positive, + cells_OfnotebookSelector_OfNotebookDocumentSyncOptions_Item_Item, "="); + + type cells_OfnotebookSelector_OfNotebookDocumentSyncOptions_Item is + new cells_OfnotebookSelector_OfNotebookDocumentSyncOptions_Item_Item_Vectors + .Vector with + null record; + + type notebookSelector_OfNotebookDocumentSyncOptions_Item is record + notebook : Virtual_String_Or_NotebookDocumentFilter_Optional; + -- The notebook to be synced If a string value is provided it matches + -- against the notebook type. '*' matches every notebook. + + cells : LSP.Structures + .cells_OfnotebookSelector_OfNotebookDocumentSyncOptions_Item; + -- The cells of the matching notebook to be synced. + + end record; + + package notebookSelector_OfNotebookDocumentSyncOptions_Item_Vectors is new Ada + .Containers + .Vectors + (Positive, notebookSelector_OfNotebookDocumentSyncOptions_Item, "="); + + type notebookSelector_OfNotebookDocumentSyncOptions is + new notebookSelector_OfNotebookDocumentSyncOptions_Item_Vectors.Vector with + null record; + + type NotebookDocumentSyncOptions is tagged record + notebookSelector : LSP.Structures + .notebookSelector_OfNotebookDocumentSyncOptions; + -- The notebooks to be synced + + save : Boolean_Optional; + -- Whether save notification should be forwarded to the server. Will + -- only be honored if mode === `notebook`. + + end record; + -- Options specific to a notebook plus its cells to be synced to the + -- server. + -- + -- If a selector provides a notebook document filter but no cell selector + -- all cells of a matching notebook document will be synced. + -- + -- If a selector provides no notebook document filter but only a cell + -- selector all notebook document that contain at least one matching + -- cell will be synced. + -- + -- @since 3.17.0 + + type MonikerRegistrationOptions is new MonikerOptions with record + Parent : LSP.Structures.TextDocumentRegistrationOptions; + end record; + + type SelectionRangeOptions is new WorkDoneProgressOptions with record + workDoneProgress : Boolean_Optional; + + end record; + + overriding function workDoneProgress + (Self : SelectionRangeOptions) return Boolean_Optional is + (Self.workDoneProgress); + + type SelectionRangeRegistrationOptions is + new SelectionRangeOptions and StaticRegistrationOptions with record + id : Virtual_String_Optional; + -- The id used to register the request. The id can be used to deregister + -- the request again. See also Registration#id. + + Parent : LSP.Structures.TextDocumentRegistrationOptions; + end record; + + overriding function id + (Self : SelectionRangeRegistrationOptions) + return Virtual_String_Optional is + (Self.id); + + type DocumentLinkOptions_Optional (Is_Set : Boolean := False) is record + case Is_Set is + when False => + null; + when True => + Value : DocumentLinkOptions; + end case; + end record; + + type PositionEncodingKind_Optional (Is_Set : Boolean := False) is record + case Is_Set is + when False => + null; + when True => + Value : PositionEncodingKind; + end case; + end record; + + type LinkedEditingRangeOptions is new WorkDoneProgressOptions with record + workDoneProgress : Boolean_Optional; + + end record; + + overriding function workDoneProgress + (Self : LinkedEditingRangeOptions) return Boolean_Optional is + (Self.workDoneProgress); + + type TypeDefinitionOptions is new WorkDoneProgressOptions with record + workDoneProgress : Boolean_Optional; + + end record; + + overriding function workDoneProgress + (Self : TypeDefinitionOptions) return Boolean_Optional is + (Self.workDoneProgress); + + type TypeDefinitionRegistrationOptions is + new TypeDefinitionOptions and StaticRegistrationOptions with record + id : Virtual_String_Optional; + -- The id used to register the request. The id can be used to deregister + -- the request again. See also Registration#id. + + Parent : LSP.Structures.TextDocumentRegistrationOptions; + end record; + + overriding function id + (Self : TypeDefinitionRegistrationOptions) + return Virtual_String_Optional is + (Self.id); + + type LinkedEditingRangeRegistrationOptions is + new LinkedEditingRangeOptions and StaticRegistrationOptions with record + id : Virtual_String_Optional; + -- The id used to register the request. The id can be used to deregister + -- the request again. See also Registration#id. + + Parent : LSP.Structures.TextDocumentRegistrationOptions; + end record; + + overriding function id + (Self : LinkedEditingRangeRegistrationOptions) + return Virtual_String_Optional is + (Self.id); + + type InlayHintOptions is new WorkDoneProgressOptions with record + workDoneProgress : Boolean_Optional; + + resolveProvider : Boolean_Optional; + -- The server provides support to resolve additional information for an + -- inlay hint item. + + end record; + -- Inlay hint options used during static registration. + -- + -- @since 3.17.0 + + overriding function workDoneProgress + (Self : InlayHintOptions) return Boolean_Optional is + (Self.workDoneProgress); + + type TextDocumentSyncKind_Optional (Is_Set : Boolean := False) is record + case Is_Set is + when False => + null; + when True => + Value : TextDocumentSyncKind; + end case; + end record; + + type SaveOptions is tagged record + includeText : Boolean_Optional; + -- The client is supposed to include the content on save. + + end record; + -- Save options. + + type Boolean_Or_SaveOptions (Is_Boolean : Boolean := True) is record + case Is_Boolean is + when True => + Boolean : Standard.Boolean; + when False => + SaveOptions : LSP.Structures.SaveOptions; + end case; + end record; + + type Boolean_Or_SaveOptions_Optional (Is_Set : Boolean := False) is record + case Is_Set is + when False => + null; + when True => + Value : Boolean_Or_SaveOptions; + end case; + end record; + + type TextDocumentSyncOptions is record + openClose : Boolean_Optional; + -- Open and close notifications are sent to the server. If omitted open + -- close notifications should not be sent. + + change : TextDocumentSyncKind_Optional; + -- Change notifications are sent to the server. See + -- TextDocumentSyncKind.None, TextDocumentSyncKind.Full and + -- TextDocumentSyncKind.Incremental. If omitted it defaults + -- to TextDocumentSyncKind.None. + + willSave : Boolean_Optional; + -- If present will save notifications are sent to the server. If omitted + -- the notification should not be sent. + + willSaveWaitUntil : Boolean_Optional; + -- If present will save wait until requests are sent to the server. If + -- omitted the request should not be sent. + + save : Boolean_Or_SaveOptions_Optional; + -- If present save notifications are sent to the server. If omitted the + -- notification should not be sent. + + end record; + + type NotebookDocumentSyncRegistrationOptions is + new NotebookDocumentSyncOptions and StaticRegistrationOptions with record + id : Virtual_String_Optional; + -- The id used to register the request. The id can be used to deregister + -- the request again. See also Registration#id. + + end record; + -- Registration options specific to a notebook. + -- + -- @since 3.17.0 + + overriding function id + (Self : NotebookDocumentSyncRegistrationOptions) + return Virtual_String_Optional is + (Self.id); + + type TypeHierarchyRegistrationOptions is + new TypeHierarchyOptions and StaticRegistrationOptions with record + id : Virtual_String_Optional; + -- The id used to register the request. The id can be used to deregister + -- the request again. See also Registration#id. + + Parent : LSP.Structures.TextDocumentRegistrationOptions; + end record; + -- Type hierarchy options used during static or dynamic registration. + -- + -- @since 3.17.0 + + overriding function id + (Self : TypeHierarchyRegistrationOptions) + return Virtual_String_Optional is + (Self.id); + + type CompletionOptions_Optional (Is_Set : Boolean := False) is record + case Is_Set is + when False => + null; + when True => + Value : CompletionOptions; + end case; + end record; + + type DocumentOnTypeFormattingOptions_Optional (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : DocumentOnTypeFormattingOptions; + end case; + end record; + + type FileOperationOptions_Optional (Is_Set : Boolean := False) is record + case Is_Set is + when False => + null; + when True => + Value : FileOperationOptions; + end case; + end record; + + type ExecuteCommandOptions_Optional (Is_Set : Boolean := False) is record + case Is_Set is + when False => + null; + when True => + Value : ExecuteCommandOptions; + end case; + end record; + + type ReferenceOptions is new WorkDoneProgressOptions with record + workDoneProgress : Boolean_Optional; + + end record; + -- Reference options. + + overriding function workDoneProgress + (Self : ReferenceOptions) return Boolean_Optional is + (Self.workDoneProgress); + + type InlayHintRegistrationOptions is + new InlayHintOptions and StaticRegistrationOptions with record + id : Virtual_String_Optional; + -- The id used to register the request. The id can be used to deregister + -- the request again. See also Registration#id. + + Parent : LSP.Structures.TextDocumentRegistrationOptions; + end record; + -- Inlay hint options used during static or dynamic registration. + -- + -- @since 3.17.0 + + overriding function id + (Self : InlayHintRegistrationOptions) return Virtual_String_Optional is + (Self.id); + + type CodeLensOptions_Optional (Is_Set : Boolean := False) is record + case Is_Set is + when False => + null; + when True => + Value : CodeLensOptions; + end case; + end record; + + type RenameOptions is new WorkDoneProgressOptions with record + workDoneProgress : Boolean_Optional; + + prepareProvider : Boolean_Optional; + -- Renames should be checked and tested before being executed. + -- + -- @since version 3.12.0 + + end record; + -- Provider options for a [RenameRequest](#RenameRequest). + + overriding function workDoneProgress + (Self : RenameOptions) return Boolean_Optional is + (Self.workDoneProgress); + + type T is record + null; + end record; + + type T_Optional (Is_Set : Boolean := False) is record + case Is_Set is + when False => + null; + when True => + Value : T; + end case; + end record; + + type TextDocumentSyncOptions_Or_TextDocumentSyncKind + (Is_TextDocumentSyncOptions : Boolean := True) is + record + case Is_TextDocumentSyncOptions is + when True => + TextDocumentSyncOptions : LSP.Structures.TextDocumentSyncOptions; + when False => + TextDocumentSyncKind : LSP.Enumerations.TextDocumentSyncKind; + end case; + end record; + + type TextDocumentSyncOptions_Or_TextDocumentSyncKind_Optional + (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : TextDocumentSyncOptions_Or_TextDocumentSyncKind; + end case; + end record; + + type NotebookDocumentSyncOptions_Or_NotebookDocumentSyncRegistrationOptions + (Is_NotebookDocumentSyncOptions : Boolean := True) is + record + case Is_NotebookDocumentSyncOptions is + when True => + NotebookDocumentSyncOptions : LSP.Structures + .NotebookDocumentSyncOptions; + when False => + NotebookDocumentSyncRegistrationOptions : LSP.Structures + .NotebookDocumentSyncRegistrationOptions; + end case; + end record; + + type NotebookDocumentSyncOptions_Or_NotebookDocumentSyncRegistrationOptions_Optional + (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : NotebookDocumentSyncOptions_Or_NotebookDocumentSyncRegistrationOptions; + end case; + end record; + + type Boolean_Or_HoverOptions (Is_Boolean : Boolean := True) is record + case Is_Boolean is + when True => + Boolean : Standard.Boolean; + when False => + HoverOptions : LSP.Structures.HoverOptions; + end case; + end record; + + type Boolean_Or_HoverOptions_Optional (Is_Set : Boolean := False) is record + case Is_Set is + when False => + null; + when True => + Value : Boolean_Or_HoverOptions; + end case; + end record; + + type declarationProvider_OfServerCapabilities_Variant is + (Varian_1, Varian_2, Varian_3); + + type declarationProvider_OfServerCapabilities + (Kind : declarationProvider_OfServerCapabilities_Variant := + declarationProvider_OfServerCapabilities_Variant'First) + is + record + case Kind is + when Varian_1 => + Varian_1 : Standard.Boolean; + when Varian_2 => + Varian_2 : LSP.Structures.DeclarationOptions; + when Varian_3 => + Varian_3 : LSP.Structures.DeclarationRegistrationOptions; + end case; + end record; + + type declarationProvider_OfServerCapabilities_Optional + (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : declarationProvider_OfServerCapabilities; + end case; + end record; + + type Boolean_Or_DefinitionOptions (Is_Boolean : Boolean := True) is record + case Is_Boolean is + when True => + Boolean : Standard.Boolean; + when False => + DefinitionOptions : LSP.Structures.DefinitionOptions; + end case; + end record; + + type Boolean_Or_DefinitionOptions_Optional (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : Boolean_Or_DefinitionOptions; + end case; + end record; + + type typeDefinitionProvider_OfServerCapabilities_Variant is + (Varian_1, Varian_2, Varian_3); + + type typeDefinitionProvider_OfServerCapabilities + (Kind : typeDefinitionProvider_OfServerCapabilities_Variant := + typeDefinitionProvider_OfServerCapabilities_Variant'First) + is + record + case Kind is + when Varian_1 => + Varian_1 : Standard.Boolean; + when Varian_2 => + Varian_2 : LSP.Structures.TypeDefinitionOptions; + when Varian_3 => + Varian_3 : LSP.Structures.TypeDefinitionRegistrationOptions; + end case; + end record; + + type typeDefinitionProvider_OfServerCapabilities_Optional + (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : typeDefinitionProvider_OfServerCapabilities; + end case; + end record; + + type implementationProvider_OfServerCapabilities_Variant is + (Varian_1, Varian_2, Varian_3); + + type implementationProvider_OfServerCapabilities + (Kind : implementationProvider_OfServerCapabilities_Variant := + implementationProvider_OfServerCapabilities_Variant'First) + is + record + case Kind is + when Varian_1 => + Varian_1 : Standard.Boolean; + when Varian_2 => + Varian_2 : LSP.Structures.ImplementationOptions; + when Varian_3 => + Varian_3 : LSP.Structures.ImplementationRegistrationOptions; + end case; + end record; + + type implementationProvider_OfServerCapabilities_Optional + (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : implementationProvider_OfServerCapabilities; + end case; + end record; + + type Boolean_Or_ReferenceOptions (Is_Boolean : Boolean := True) is record + case Is_Boolean is + when True => + Boolean : Standard.Boolean; + when False => + ReferenceOptions : LSP.Structures.ReferenceOptions; + end case; + end record; + + type Boolean_Or_ReferenceOptions_Optional (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : Boolean_Or_ReferenceOptions; + end case; + end record; + + type Boolean_Or_DocumentHighlightOptions (Is_Boolean : Boolean := True) is + record + case Is_Boolean is + when True => + Boolean : Standard.Boolean; + when False => + DocumentHighlightOptions : LSP.Structures.DocumentHighlightOptions; + end case; + end record; + + type Boolean_Or_DocumentHighlightOptions_Optional + (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : Boolean_Or_DocumentHighlightOptions; + end case; + end record; + + type Boolean_Or_DocumentSymbolOptions (Is_Boolean : Boolean := True) is + record + case Is_Boolean is + when True => + Boolean : Standard.Boolean; + when False => + DocumentSymbolOptions : LSP.Structures.DocumentSymbolOptions; + end case; + end record; + + type Boolean_Or_DocumentSymbolOptions_Optional (Is_Set : Boolean := False) + is + record + case Is_Set is + when False => + null; + when True => + Value : Boolean_Or_DocumentSymbolOptions; + end case; + end record; + + type Boolean_Or_CodeActionOptions (Is_Boolean : Boolean := True) is record + case Is_Boolean is + when True => + Boolean : Standard.Boolean; + when False => + CodeActionOptions : LSP.Structures.CodeActionOptions; + end case; + end record; + + type Boolean_Or_CodeActionOptions_Optional (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : Boolean_Or_CodeActionOptions; + end case; + end record; + + type colorProvider_OfServerCapabilities_Variant is + (Varian_1, Varian_2, Varian_3); + + type colorProvider_OfServerCapabilities + (Kind : colorProvider_OfServerCapabilities_Variant := + colorProvider_OfServerCapabilities_Variant'First) + is + record + case Kind is + when Varian_1 => + Varian_1 : Standard.Boolean; + when Varian_2 => + Varian_2 : LSP.Structures.DocumentColorOptions; + when Varian_3 => + Varian_3 : LSP.Structures.DocumentColorRegistrationOptions; + end case; + end record; + + type colorProvider_OfServerCapabilities_Optional (Is_Set : Boolean := False) + is + record + case Is_Set is + when False => + null; + when True => + Value : colorProvider_OfServerCapabilities; + end case; + end record; + + type Boolean_Or_WorkspaceSymbolOptions (Is_Boolean : Boolean := True) is + record + case Is_Boolean is + when True => + Boolean : Standard.Boolean; + when False => + WorkspaceSymbolOptions : LSP.Structures.WorkspaceSymbolOptions; + end case; + end record; + + type Boolean_Or_WorkspaceSymbolOptions_Optional (Is_Set : Boolean := False) + is + record + case Is_Set is + when False => + null; + when True => + Value : Boolean_Or_WorkspaceSymbolOptions; + end case; + end record; + + type Boolean_Or_DocumentFormattingOptions (Is_Boolean : Boolean := True) is + record + case Is_Boolean is + when True => + Boolean : Standard.Boolean; + when False => + DocumentFormattingOptions : LSP.Structures + .DocumentFormattingOptions; + end case; + end record; + + type Boolean_Or_DocumentFormattingOptions_Optional + (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : Boolean_Or_DocumentFormattingOptions; + end case; + end record; + + type Boolean_Or_DocumentRangeFormattingOptions + (Is_Boolean : Boolean := True) is + record + case Is_Boolean is + when True => + Boolean : Standard.Boolean; + when False => + DocumentRangeFormattingOptions : LSP.Structures + .DocumentRangeFormattingOptions; + end case; + end record; + + type Boolean_Or_DocumentRangeFormattingOptions_Optional + (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : Boolean_Or_DocumentRangeFormattingOptions; + end case; + end record; + + type Boolean_Or_RenameOptions (Is_Boolean : Boolean := True) is record + case Is_Boolean is + when True => + Boolean : Standard.Boolean; + when False => + RenameOptions : LSP.Structures.RenameOptions; + end case; + end record; + + type Boolean_Or_RenameOptions_Optional (Is_Set : Boolean := False) is record + case Is_Set is + when False => + null; + when True => + Value : Boolean_Or_RenameOptions; + end case; + end record; + + type foldingRangeProvider_OfServerCapabilities_Variant is + (Varian_1, Varian_2, Varian_3); + + type foldingRangeProvider_OfServerCapabilities + (Kind : foldingRangeProvider_OfServerCapabilities_Variant := + foldingRangeProvider_OfServerCapabilities_Variant'First) + is + record + case Kind is + when Varian_1 => + Varian_1 : Standard.Boolean; + when Varian_2 => + Varian_2 : LSP.Structures.FoldingRangeOptions; + when Varian_3 => + Varian_3 : LSP.Structures.FoldingRangeRegistrationOptions; + end case; + end record; + + type foldingRangeProvider_OfServerCapabilities_Optional + (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : foldingRangeProvider_OfServerCapabilities; + end case; + end record; + + type selectionRangeProvider_OfServerCapabilities_Variant is + (Varian_1, Varian_2, Varian_3); + + type selectionRangeProvider_OfServerCapabilities + (Kind : selectionRangeProvider_OfServerCapabilities_Variant := + selectionRangeProvider_OfServerCapabilities_Variant'First) + is + record + case Kind is + when Varian_1 => + Varian_1 : Standard.Boolean; + when Varian_2 => + Varian_2 : LSP.Structures.SelectionRangeOptions; + when Varian_3 => + Varian_3 : LSP.Structures.SelectionRangeRegistrationOptions; + end case; + end record; + + type selectionRangeProvider_OfServerCapabilities_Optional + (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : selectionRangeProvider_OfServerCapabilities; + end case; + end record; + + type callHierarchyProvider_OfServerCapabilities_Variant is + (Varian_1, Varian_2, Varian_3); + + type callHierarchyProvider_OfServerCapabilities + (Kind : callHierarchyProvider_OfServerCapabilities_Variant := + callHierarchyProvider_OfServerCapabilities_Variant'First) + is + record + case Kind is + when Varian_1 => + Varian_1 : Standard.Boolean; + when Varian_2 => + Varian_2 : LSP.Structures.CallHierarchyOptions; + when Varian_3 => + Varian_3 : LSP.Structures.CallHierarchyRegistrationOptions; + end case; + end record; + + type callHierarchyProvider_OfServerCapabilities_Optional + (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : callHierarchyProvider_OfServerCapabilities; + end case; + end record; + + type linkedEditingRangeProvider_OfServerCapabilities_Variant is + (Varian_1, Varian_2, Varian_3); + + type linkedEditingRangeProvider_OfServerCapabilities + (Kind : linkedEditingRangeProvider_OfServerCapabilities_Variant := + linkedEditingRangeProvider_OfServerCapabilities_Variant'First) + is + record + case Kind is + when Varian_1 => + Varian_1 : Standard.Boolean; + when Varian_2 => + Varian_2 : LSP.Structures.LinkedEditingRangeOptions; + when Varian_3 => + Varian_3 : LSP.Structures.LinkedEditingRangeRegistrationOptions; + end case; + end record; + + type linkedEditingRangeProvider_OfServerCapabilities_Optional + (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : linkedEditingRangeProvider_OfServerCapabilities; + end case; + end record; + + type SemanticTokensOptions_Or_SemanticTokensRegistrationOptions + (Is_SemanticTokensOptions : Boolean := True) is + record + case Is_SemanticTokensOptions is + when True => + SemanticTokensOptions : LSP.Structures.SemanticTokensOptions; + when False => + SemanticTokensRegistrationOptions : LSP.Structures + .SemanticTokensRegistrationOptions; + end case; + end record; + + type SemanticTokensOptions_Or_SemanticTokensRegistrationOptions_Optional + (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : SemanticTokensOptions_Or_SemanticTokensRegistrationOptions; + end case; + end record; + + type monikerProvider_OfServerCapabilities_Variant is + (Varian_1, Varian_2, Varian_3); + + type monikerProvider_OfServerCapabilities + (Kind : monikerProvider_OfServerCapabilities_Variant := + monikerProvider_OfServerCapabilities_Variant'First) + is + record + case Kind is + when Varian_1 => + Varian_1 : Standard.Boolean; + when Varian_2 => + Varian_2 : LSP.Structures.MonikerOptions; + when Varian_3 => + Varian_3 : LSP.Structures.MonikerRegistrationOptions; + end case; + end record; + + type monikerProvider_OfServerCapabilities_Optional + (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : monikerProvider_OfServerCapabilities; + end case; + end record; + + type typeHierarchyProvider_OfServerCapabilities_Variant is + (Varian_1, Varian_2, Varian_3); + + type typeHierarchyProvider_OfServerCapabilities + (Kind : typeHierarchyProvider_OfServerCapabilities_Variant := + typeHierarchyProvider_OfServerCapabilities_Variant'First) + is + record + case Kind is + when Varian_1 => + Varian_1 : Standard.Boolean; + when Varian_2 => + Varian_2 : LSP.Structures.TypeHierarchyOptions; + when Varian_3 => + Varian_3 : LSP.Structures.TypeHierarchyRegistrationOptions; + end case; + end record; + + type typeHierarchyProvider_OfServerCapabilities_Optional + (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : typeHierarchyProvider_OfServerCapabilities; + end case; + end record; + + type inlineValueProvider_OfServerCapabilities_Variant is + (Varian_1, Varian_2, Varian_3); + + type inlineValueProvider_OfServerCapabilities + (Kind : inlineValueProvider_OfServerCapabilities_Variant := + inlineValueProvider_OfServerCapabilities_Variant'First) + is + record + case Kind is + when Varian_1 => + Varian_1 : Standard.Boolean; + when Varian_2 => + Varian_2 : LSP.Structures.InlineValueOptions; + when Varian_3 => + Varian_3 : LSP.Structures.InlineValueRegistrationOptions; + end case; + end record; + + type inlineValueProvider_OfServerCapabilities_Optional + (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : inlineValueProvider_OfServerCapabilities; + end case; + end record; + + type inlayHintProvider_OfServerCapabilities_Variant is + (Varian_1, Varian_2, Varian_3); + + type inlayHintProvider_OfServerCapabilities + (Kind : inlayHintProvider_OfServerCapabilities_Variant := + inlayHintProvider_OfServerCapabilities_Variant'First) + is + record + case Kind is + when Varian_1 => + Varian_1 : Standard.Boolean; + when Varian_2 => + Varian_2 : LSP.Structures.InlayHintOptions; + when Varian_3 => + Varian_3 : LSP.Structures.InlayHintRegistrationOptions; + end case; + end record; + + type inlayHintProvider_OfServerCapabilities_Optional + (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : inlayHintProvider_OfServerCapabilities; + end case; + end record; + + type DiagnosticOptions_Or_DiagnosticRegistrationOptions + (Is_DiagnosticOptions : Boolean := True) is + record + case Is_DiagnosticOptions is + when True => + DiagnosticOptions : LSP.Structures.DiagnosticOptions; + when False => + DiagnosticRegistrationOptions : LSP.Structures + .DiagnosticRegistrationOptions; + end case; + end record; + + type DiagnosticOptions_Or_DiagnosticRegistrationOptions_Optional + (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : DiagnosticOptions_Or_DiagnosticRegistrationOptions; + end case; + end record; + + type workspace_OfServerCapabilities is record + workspaceFolders : WorkspaceFoldersServerCapabilities_Optional; + -- The server supports workspace folder. + -- + -- @since 3.6.0 + + fileOperations : FileOperationOptions_Optional; + -- The server is interested in notifications/requests for operations on + -- files. + -- + -- @since 3.16.0 + + end record; + type workspace_OfServerCapabilities_Optional (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : workspace_OfServerCapabilities; + end case; + end record; + + type ServerCapabilities is record + positionEncoding : PositionEncodingKind_Optional; + -- The position encoding the server picked from the encodings offered by + -- the client via the client capability `general.positionEncodings`. + -- + -- If the client didn't provide any position encodings the only valid + -- value that a server can return is 'utf-16'. + -- + -- If omitted it defaults to 'utf-16'. + -- + -- @since 3.17.0 + + textDocumentSync : TextDocumentSyncOptions_Or_TextDocumentSyncKind_Optional; + -- Defines how text documents are synced. Is either a detailed structure + -- defining each notification or for backwards compatibility the + -- TextDocumentSyncKind number. + + notebookDocumentSync : NotebookDocumentSyncOptions_Or_NotebookDocumentSyncRegistrationOptions_Optional; + -- Defines how notebook documents are synced. + -- + -- @since 3.17.0 + + completionProvider : CompletionOptions_Optional; + -- The server provides completion support. + + hoverProvider : Boolean_Or_HoverOptions_Optional; + -- The server provides hover support. + + signatureHelpProvider : SignatureHelpOptions_Optional; + -- The server provides signature help support. + + declarationProvider : declarationProvider_OfServerCapabilities_Optional; + -- The server provides Goto Declaration support. + + definitionProvider : Boolean_Or_DefinitionOptions_Optional; + -- The server provides goto definition support. + + typeDefinitionProvider : typeDefinitionProvider_OfServerCapabilities_Optional; + -- The server provides Goto Type Definition support. + + implementationProvider : implementationProvider_OfServerCapabilities_Optional; + -- The server provides Goto Implementation support. + + referencesProvider : Boolean_Or_ReferenceOptions_Optional; + -- The server provides find references support. + + documentHighlightProvider : Boolean_Or_DocumentHighlightOptions_Optional; + -- The server provides document highlight support. + + documentSymbolProvider : Boolean_Or_DocumentSymbolOptions_Optional; + -- The server provides document symbol support. + + codeActionProvider : Boolean_Or_CodeActionOptions_Optional; + -- The server provides code actions. CodeActionOptions may + -- only be specified if the client states that it supports + -- `codeActionLiteralSupport` in its initial `initialize` request. + + codeLensProvider : CodeLensOptions_Optional; + -- The server provides code lens. + + documentLinkProvider : DocumentLinkOptions_Optional; + -- The server provides document link support. + + colorProvider : colorProvider_OfServerCapabilities_Optional; + -- The server provides color provider support. + + workspaceSymbolProvider : Boolean_Or_WorkspaceSymbolOptions_Optional; + -- The server provides workspace symbol support. + + documentFormattingProvider : Boolean_Or_DocumentFormattingOptions_Optional; + -- The server provides document formatting. + + documentRangeFormattingProvider : Boolean_Or_DocumentRangeFormattingOptions_Optional; + -- The server provides document range formatting. + + documentOnTypeFormattingProvider : DocumentOnTypeFormattingOptions_Optional; + -- The server provides document formatting on typing. + + renameProvider : Boolean_Or_RenameOptions_Optional; + -- The server provides rename support. RenameOptions may only be + -- specified if the client states that it supports `prepareSupport` + -- in its initial `initialize` request. + + foldingRangeProvider : foldingRangeProvider_OfServerCapabilities_Optional; + -- The server provides folding provider support. + + selectionRangeProvider : selectionRangeProvider_OfServerCapabilities_Optional; + -- The server provides selection range support. + + executeCommandProvider : ExecuteCommandOptions_Optional; + -- The server provides execute command support. + + callHierarchyProvider : callHierarchyProvider_OfServerCapabilities_Optional; + -- The server provides call hierarchy support. + -- + -- @since 3.16.0 + + linkedEditingRangeProvider : linkedEditingRangeProvider_OfServerCapabilities_Optional; + -- The server provides linked editing range support. + -- + -- @since 3.16.0 + + semanticTokensProvider : SemanticTokensOptions_Or_SemanticTokensRegistrationOptions_Optional; + -- The server provides semantic tokens support. + -- + -- @since 3.16.0 + + monikerProvider : monikerProvider_OfServerCapabilities_Optional; + -- The server provides moniker support. + -- + -- @since 3.16.0 + + typeHierarchyProvider : typeHierarchyProvider_OfServerCapabilities_Optional; + -- The server provides type hierarchy support. + -- + -- @since 3.17.0 + + inlineValueProvider : inlineValueProvider_OfServerCapabilities_Optional; + -- The server provides inline values. + -- + -- @since 3.17.0 + + inlayHintProvider : inlayHintProvider_OfServerCapabilities_Optional; + -- The server provides inlay hints. + -- + -- @since 3.17.0 + + diagnosticProvider : DiagnosticOptions_Or_DiagnosticRegistrationOptions_Optional; + -- The server has support for pull model diagnostics. + -- + -- @since 3.17.0 + + workspace : workspace_OfServerCapabilities_Optional; + -- Workspace specific server capabilities. + + experimental : T_Optional; + -- Experimental server capabilities. + + end record; + -- Defines the capabilities provided by a language server. + + type InitializeResult is record + capabilities : LSP.Structures.ServerCapabilities; + -- The capabilities the language server provides. + + serverInfo : clientInfo_Of_InitializeParams_Optional; + -- Information about the server. + -- + -- @since 3.15.0 + + end record; + -- The result returned from an initialize request. + + type InitializedParams is record + null; + end record; + + type Location_Optional (Is_Set : Boolean := False) is record + case Is_Set is + when False => + null; + when True => + Value : Location; + end case; + end record; + + type InlayHintLabelPart is record + value : LSP.Structures.Virtual_String; + -- The value of this label part. + + tooltip : Virtual_String_Or_MarkupContent_Optional; + -- The tooltip text when you hover over this label part. Depending + -- on the client capability `inlayHint.resolveSupport` clients might + -- resolve this property late using the resolve request. + + location : Location_Optional; + -- An optional source code location that represents this label part. + -- + -- The editor will use this location for the hover and for code + -- navigation features: This part will become a clickable link that + -- resolves to the definition of the symbol at the given location (not + -- necessarily the location itself), it shows the hover that shows at + -- the given location, and it shows a context menu with further code + -- navigation commands. + -- + -- Depending on the client capability `inlayHint.resolveSupport` clients + -- might resolve this property late using the resolve request. + + command : Command_Optional; + -- An optional command for this label part. + -- + -- Depending on the client capability `inlayHint.resolveSupport` clients + -- might resolve this property late using the resolve request. + + end record; + -- An inlay hint label part allows for interactive and composite labels of + -- inlay hints. + -- + -- @since 3.17.0 + + type InlayHintKind_Optional (Is_Set : Boolean := False) is record + case Is_Set is + when False => + null; + when True => + Value : InlayHintKind; + end case; + end record; + + package InlayHintLabelPart_Vectors is new Ada.Containers.Vectors + (Positive, InlayHintLabelPart, "="); + + type InlayHintLabelPart_Vector is + new InlayHintLabelPart_Vectors.Vector with null record; + + type Virtual_String_Or_InlayHintLabelPart_Vector + (Is_Virtual_String : Boolean := True) is + record + case Is_Virtual_String is + when True => + Virtual_String : LSP.Structures.Virtual_String; + when False => + InlayHintLabelPart_Vector : LSP.Structures + .InlayHintLabelPart_Vector; + end case; + end record; + + type InlayHint is record + position : LSP.Structures.Position; + -- The position of this hint. + + label : LSP.Structures.Virtual_String_Or_InlayHintLabelPart_Vector; + -- The label of this hint. A human readable string or an array of + -- InlayHintLabelPart label parts. + -- + -- *Note* that neither the string nor the label part can be empty. + + kind : InlayHintKind_Optional; + -- The kind of this hint. Can be omitted in which case the client should + -- fall back to a reasonable default. + + textEdits : LSP.Structures.TextEdit_Vector; + -- Optional text edits that are performed when accepting this inlay + -- hint. + -- + -- *Note* that edits are expected to change the document so that the + -- inlay hint (or its nearest variant) is now part of the document and + -- the inlay hint itself is now obsolete. + + tooltip : Virtual_String_Or_MarkupContent_Optional; + -- The tooltip text when you hover over this item. + + paddingLeft : Boolean_Optional; + -- Render padding before the hint. + -- + -- Note: Padding should use the editor's background color, not the + -- background color of the hint itself. That means padding can be + -- used to visually align/separate an inlay hint. + + paddingRight : Boolean_Optional; + -- Render padding after the hint. + -- + -- Note: Padding should use the editor's background color, not the + -- background color of the hint itself. That means padding can be + -- used to visually align/separate an inlay hint. + + data : LSPAny_Optional; + -- A data entry field that is preserved on an inlay hint between a + -- `textDocument/inlayHint` and a `inlayHint/resolve` request. + + end record; + -- Inlay hint information. + -- + -- @since 3.17.0 + + type InlayHintParams is new WorkDoneProgressParams with record + workDoneToken : ProgressToken_Optional; + -- An optional token that a server can use to report work done progress. + + textDocument : LSP.Structures.TextDocumentIdentifier; + -- The text document. + + a_range : LSP.Structures.A_Range; + -- The document range for which inlay hints should be computed. + + end record; + -- A parameter literal used in inlay hint requests. + -- + -- @since 3.17.0 + + overriding function workDoneToken + (Self : InlayHintParams) return LSP.Structures.ProgressToken_Optional is + (Self.workDoneToken); + + type InlineValueContext is record + frameId : Standard.Integer; + -- The stack frame (as a DAP Id) where the execution has stopped. + + stoppedLocation : LSP.Structures.A_Range; + -- The document range where execution has stopped. Typically the end + -- position of the range denotes the line where the inline values are + -- shown. + + end record; + -- @since 3.17.0 + + type InlineValueEvaluatableExpression is record + a_range : LSP.Structures.A_Range; + -- The document range for which the inline value applies. The range + -- is used to extract the evaluatable expression from the underlying + -- document. + + expression : Virtual_String_Optional; + -- If specified the expression overrides the extracted expression. + + end record; + -- Provide an inline value through an expression evaluation. If only a + -- range is specified, the expression will be extracted from the underlying + -- document. An optional expression can be used to override the extracted + -- expression. + -- + -- @since 3.17.0 + + type InlineValueParams is new WorkDoneProgressParams with record + workDoneToken : ProgressToken_Optional; + -- An optional token that a server can use to report work done progress. + + textDocument : LSP.Structures.TextDocumentIdentifier; + -- The text document. + + a_range : LSP.Structures.A_Range; + -- The document range for which inline values should be computed. + + context : LSP.Structures.InlineValueContext; + -- Additional information about the context in which inline values were + -- requested. + + end record; + -- A parameter literal used in inline value requests. + -- + -- @since 3.17.0 + + overriding function workDoneToken + (Self : InlineValueParams) return LSP.Structures.ProgressToken_Optional is + (Self.workDoneToken); + + type InlineValueText is record + a_range : LSP.Structures.A_Range; + -- The document range for which the inline value applies. + + text : LSP.Structures.Virtual_String; + -- The text of the inline value. + + end record; + -- Provide inline value as text. + -- + -- @since 3.17.0 + + type InlineValueVariableLookup is record + a_range : LSP.Structures.A_Range; + -- The document range for which the inline value applies. The range is + -- used to extract the variable name from the underlying document. + + variableName : Virtual_String_Optional; + -- If specified the name of the variable to look up. + + caseSensitiveLookup : Standard.Boolean; + -- How to perform the lookup. + + end record; + -- Provide inline value through a variable lookup. If only a range is + -- specified, the variable name will be extracted from the underlying + -- document. An optional variable name can be used to override the + -- extracted name. + -- + -- @since 3.17.0 + + type LinkedEditingRangeParams is + new TextDocumentPositionParams and WorkDoneProgressParams with record + workDoneToken : ProgressToken_Optional; + -- An optional token that a server can use to report work done progress. + + end record; + + overriding function workDoneToken + (Self : LinkedEditingRangeParams) + return LSP.Structures.ProgressToken_Optional is + (Self.workDoneToken); + + type LinkedEditingRanges is record + ranges : LSP.Structures.Range_Vector; + -- A list of ranges that can be edited together. The ranges must have + -- identical length and contain identical text content. The ranges + -- cannot overlap. + + wordPattern : Virtual_String_Optional; + -- An optional word pattern (regular expression) that describes valid + -- contents for the given ranges. If no pattern is provided, the client + -- configuration's word pattern will be used. + + end record; + -- The result of a linked editing range request. + -- + -- @since 3.16.0 + + type LocationLink is record + originSelectionRange : A_Range_Optional; + -- Span of the origin of this link. + -- + -- Used as the underlined span for mouse interaction. Defaults to the + -- word range at the definition position. + + targetUri : LSP.Structures.DocumentUri; + -- The target resource identifier of this link. + + targetRange : LSP.Structures.A_Range; + -- The full target range of this link. If the target for example is + -- a symbol then target range is the range enclosing this symbol not + -- including leading/trailing whitespace but everything else like + -- comments. This information is typically used to highlight the + -- range in the editor. + + targetSelectionRange : LSP.Structures.A_Range; + -- The range that should be selected and revealed when this link is + -- being followed, e.g the name of a function. Must be contained by + -- the `targetRange`. See also `DocumentSymbol#range` + + end record; + -- Represents the connection of two locations. Provides additional metadata + -- over normal [locations](#Location), including an origin range. + + type LogMessageParams is record + a_type : LSP.Enumerations.MessageType; + -- The message type. See {@link MessageType} + + message : LSP.Structures.Virtual_String; + -- The actual message. + + end record; + -- The log message parameters. + + type LogTraceParams is record + message : LSP.Structures.Virtual_String; + + verbose : Virtual_String_Optional; + + end record; + + type MessageActionItem is record + title : LSP.Structures.Virtual_String; + -- A short title like 'Retry', 'Open Log' etc. + + end record; + + type MonikerKind_Optional (Is_Set : Boolean := False) is record + case Is_Set is + when False => + null; + when True => + Value : MonikerKind; + end case; + end record; + + type Moniker is record + scheme : LSP.Structures.Virtual_String; + -- The scheme of the moniker. For example tsc or .Net + + identifier : LSP.Structures.Virtual_String; + -- The identifier of the moniker. The value is opaque in LSIF however + -- schema owners are allowed to define the structure if they want. + + unique : LSP.Enumerations.UniquenessLevel; + -- The scope in which the moniker is unique + + kind : MonikerKind_Optional; + -- The moniker kind if known. + + end record; + -- Moniker definition to match LSIF 0.5 moniker definition. + -- + -- @since 3.16.0 + + type MonikerParams is + new TextDocumentPositionParams and WorkDoneProgressParams and + PartialResultParams with record + workDoneToken : ProgressToken_Optional; + -- An optional token that a server can use to report work done progress. + + partialResultToken : ProgressToken_Optional; + -- An optional token that a server can use to report partial results + -- (e.g. streaming) to the client. + + end record; + + overriding function workDoneToken + (Self : MonikerParams) return LSP.Structures.ProgressToken_Optional is + (Self.workDoneToken); + + overriding function partialResultToken + (Self : MonikerParams) return LSP.Structures.ProgressToken_Optional is + (Self.partialResultToken); + + type Natural_Tuple is array (1 .. 2) of Natural; + + type String_Or_Natural_Tuple (Is_Virtual_String : Boolean := True) is record + case Is_Virtual_String is + when True => + Virtual_String : LSP.Structures.Virtual_String; + when False => + Natural_Tuple : LSP.Structures.Natural_Tuple; + end case; + end record; + + type ParameterInformation is record + label : LSP.Structures.String_Or_Natural_Tuple; + -- The label of this parameter information. + -- + -- Either a string or an inclusive start and exclusive + -- end offsets within its containing signature label. (see + -- SignatureInformation.label). The offsets are based on a UTF-16 + -- string representation as `Position` and `Range` does. + -- + -- *Note*: a label of type string should be a substring of its + -- containing signature label. Its intended use case is to highlight + -- the parameter label part in the `SignatureInformation.label`. + + documentation : Virtual_String_Or_MarkupContent_Optional; + -- The human-readable doc-comment of this parameter. Will be shown in + -- the UI but can be omitted. + + end record; + -- Represents a parameter of a callable-signature. A parameter can have a + -- label and a doc-comment. + + type PrepareRenameParams is + new TextDocumentPositionParams and WorkDoneProgressParams with record + workDoneToken : ProgressToken_Optional; + -- An optional token that a server can use to report work done progress. + + end record; + + overriding function workDoneToken + (Self : PrepareRenameParams) + return LSP.Structures.ProgressToken_Optional is + (Self.workDoneToken); + + type PreviousResultId is record + uri : LSP.Structures.DocumentUri; + -- The URI for which the client knows a result id. + + value : LSP.Structures.Virtual_String; + -- The value of the previous result id. + + end record; + -- A previous result id in a workspace pull request. + -- + -- @since 3.17.0 + + type ProgressParams is record + token : LSP.Structures.ProgressToken; + -- The progress token provided by the client or server. + + value : LSP.Structures.LSPAny; + -- The progress data. + + end record; + + type PublishDiagnosticsParams is record + uri : LSP.Structures.DocumentUri; + -- The URI for which diagnostic information is reported. + + version : Integer_Optional; + -- Optional the version number of the document the diagnostics are + -- published for. + -- + -- @since 3.15.0 + + diagnostics : LSP.Structures.Diagnostic_Vector; + -- An array of diagnostic information items. + + end record; + -- The publish diagnostic notification's parameters. + + type ReferenceContext is record + includeDeclaration : Standard.Boolean; + -- Include the declaration of the current symbol. + + end record; + -- Value-object that contains additional information when requesting + -- references. + + type ReferenceParams is + new TextDocumentPositionParams and WorkDoneProgressParams and + PartialResultParams with record + workDoneToken : ProgressToken_Optional; + -- An optional token that a server can use to report work done progress. + + partialResultToken : ProgressToken_Optional; + -- An optional token that a server can use to report partial results + -- (e.g. streaming) to the client. + + context : LSP.Structures.ReferenceContext; + + end record; + -- Parameters for a [ReferencesRequest](#ReferencesRequest). + + overriding function workDoneToken + (Self : ReferenceParams) return LSP.Structures.ProgressToken_Optional is + (Self.workDoneToken); + + overriding function partialResultToken + (Self : ReferenceParams) return LSP.Structures.ProgressToken_Optional is + (Self.partialResultToken); + + type ReferenceRegistrationOptions is new ReferenceOptions with record + Parent : LSP.Structures.TextDocumentRegistrationOptions; + end record; + -- Registration options for a [ReferencesRequest](#ReferencesRequest). + + type Registration is record + id : LSP.Structures.Virtual_String; + -- The id used to register the request. The id can be used to deregister + -- the request again. + + method : LSP.Structures.Virtual_String; + -- The method / capability to register for. + + registerOptions : LSPAny_Optional; + -- Options necessary for the registration. + + end record; + -- General parameters to to register for an notification or to register a + -- provider. + + package Registration_Vectors is new Ada.Containers.Vectors + (Positive, Registration, "="); + + type Registration_Vector is + new Registration_Vectors.Vector with null record; + + type RegistrationParams is record + registrations : LSP.Structures.Registration_Vector; + + end record; + + type RelatedFullDocumentDiagnosticReport is + new FullDocumentDiagnosticReport with record + relatedDocuments : LSP.Structures + .relatedDocuments_OfDocumentDiagnosticReportPartialResult; + -- Diagnostics of related documents. This information is useful in + -- programming languages where code in a file A can generate diagnostics + -- in a file B which A depends on. An example of such a language is + -- C/C++ where marco definitions in a file a.cpp and result in errors + -- in a header file b.hpp. + -- + -- @since 3.17.0 + + end record; + -- A full diagnostic report with a set of related documents. + -- + -- @since 3.17.0 + + type RelatedUnchangedDocumentDiagnosticReport is + new UnchangedDocumentDiagnosticReport with record + relatedDocuments : LSP.Structures + .relatedDocuments_OfDocumentDiagnosticReportPartialResult; + -- Diagnostics of related documents. This information is useful in + -- programming languages where code in a file A can generate diagnostics + -- in a file B which A depends on. An example of such a language is + -- C/C++ where marco definitions in a file a.cpp and result in errors + -- in a header file b.hpp. + -- + -- @since 3.17.0 + + end record; + -- An unchanged diagnostic report with a set of related documents. + -- + -- @since 3.17.0 + + package FileRename_Vectors is new Ada.Containers.Vectors + (Positive, FileRename, "="); + + type FileRename_Vector is new FileRename_Vectors.Vector with null record; + + type RenameFilesParams is record + files : LSP.Structures.FileRename_Vector; + -- An array of all files/folders renamed in this operation. When a + -- folder is renamed, only the folder will be included, and not its + -- children. + + end record; + -- The parameters sent in notifications/requests for user-initiated renames + -- of files. + -- + -- @since 3.16.0 + + type RenameParams is new WorkDoneProgressParams with record + workDoneToken : ProgressToken_Optional; + -- An optional token that a server can use to report work done progress. + + textDocument : LSP.Structures.TextDocumentIdentifier; + -- The document to rename. + + position : LSP.Structures.Position; + -- The position at which this request was sent. + + newName : LSP.Structures.Virtual_String; + -- The new name of the symbol. If the given name is not valid the + -- request must return a [ResponseError](#ResponseError) with an + -- appropriate message set. + + end record; + -- The parameters of a [RenameRequest](#RenameRequest). + + overriding function workDoneToken + (Self : RenameParams) return LSP.Structures.ProgressToken_Optional is + (Self.workDoneToken); + + type RenameRegistrationOptions is new RenameOptions with record + Parent : LSP.Structures.TextDocumentRegistrationOptions; + end record; + -- Registration options for a [RenameRequest](#RenameRequest). + + type SelectionRange is record + a_range : LSP.Structures.A_Range; + -- The [range](#Range) of this selection range. + + parent : SelectionRange_Optional; + -- The parent selection range containing this range. Therefore + -- `parent.range` must contain `this.range`. + + end record; + -- A selection range represents a part of a selection hierarchy. A + -- selection range may have a parent selection range that contains it. + + package Position_Vectors is new Ada.Containers.Vectors + (Positive, Position, "="); + + type Position_Vector is new Position_Vectors.Vector with null record; + + type SelectionRangeParams is + new WorkDoneProgressParams and PartialResultParams with record + workDoneToken : ProgressToken_Optional; + -- An optional token that a server can use to report work done progress. + + partialResultToken : ProgressToken_Optional; + -- An optional token that a server can use to report partial results + -- (e.g. streaming) to the client. + + textDocument : LSP.Structures.TextDocumentIdentifier; + -- The text document. + + positions : LSP.Structures.Position_Vector; + -- The positions inside the text document. + + end record; + -- A parameter literal used in selection range requests. + + overriding function workDoneToken + (Self : SelectionRangeParams) + return LSP.Structures.ProgressToken_Optional is + (Self.workDoneToken); + + overriding function partialResultToken + (Self : SelectionRangeParams) + return LSP.Structures.ProgressToken_Optional is + (Self.partialResultToken); + + package Natural_Vectors is new Ada.Containers.Vectors + (Positive, Natural, "="); + + type Natural_Vector is new Natural_Vectors.Vector with null record; + + type SemanticTokens is record + resultId : Virtual_String_Optional; + -- An optional result id. If provided and clients support delta updating + -- the client will include the result id in the next semantic token + -- request. A server can then instead of computing all semantic tokens + -- again simply send a delta. + + data : LSP.Structures.Natural_Vector; + -- The actual tokens. + + end record; + -- @since 3.16.0 + + type SemanticTokensEdit is record + start : Natural; + -- The start offset of the edit. + + deleteCount : Natural; + -- The count of elements to remove. + + data : LSP.Structures.Natural_Vector; + -- The elements to insert. + + end record; + -- @since 3.16.0 + + package SemanticTokensEdit_Vectors is new Ada.Containers.Vectors + (Positive, SemanticTokensEdit, "="); + + type SemanticTokensEdit_Vector is + new SemanticTokensEdit_Vectors.Vector with null record; + + type SemanticTokensDelta is record + resultId : Virtual_String_Optional; + + edits : LSP.Structures.SemanticTokensEdit_Vector; + -- The semantic token edits to transform a previous result into a new + -- result. + + end record; + -- @since 3.16.0 + + type SemanticTokensDeltaParams is + new WorkDoneProgressParams and PartialResultParams with record + workDoneToken : ProgressToken_Optional; + -- An optional token that a server can use to report work done progress. + + partialResultToken : ProgressToken_Optional; + -- An optional token that a server can use to report partial results + -- (e.g. streaming) to the client. + + textDocument : LSP.Structures.TextDocumentIdentifier; + -- The text document. + + previousResultId : LSP.Structures.Virtual_String; + -- The result id of a previous response. The result Id can either point + -- to a full response or a delta response depending on what was received + -- last. + + end record; + -- @since 3.16.0 + + overriding function workDoneToken + (Self : SemanticTokensDeltaParams) + return LSP.Structures.ProgressToken_Optional is + (Self.workDoneToken); + + overriding function partialResultToken + (Self : SemanticTokensDeltaParams) + return LSP.Structures.ProgressToken_Optional is + (Self.partialResultToken); + + type SemanticTokensDeltaPartialResult is record + edits : LSP.Structures.SemanticTokensEdit_Vector; + + end record; + -- @since 3.16.0 + + type SemanticTokensParams is + new WorkDoneProgressParams and PartialResultParams with record + workDoneToken : ProgressToken_Optional; + -- An optional token that a server can use to report work done progress. + + partialResultToken : ProgressToken_Optional; + -- An optional token that a server can use to report partial results + -- (e.g. streaming) to the client. + + textDocument : LSP.Structures.TextDocumentIdentifier; + -- The text document. + + end record; + -- @since 3.16.0 + + overriding function workDoneToken + (Self : SemanticTokensParams) + return LSP.Structures.ProgressToken_Optional is + (Self.workDoneToken); + + overriding function partialResultToken + (Self : SemanticTokensParams) + return LSP.Structures.ProgressToken_Optional is + (Self.partialResultToken); + + type SemanticTokensPartialResult is record + data : LSP.Structures.Natural_Vector; + + end record; + -- @since 3.16.0 + + type SemanticTokensRangeParams is + new WorkDoneProgressParams and PartialResultParams with record + workDoneToken : ProgressToken_Optional; + -- An optional token that a server can use to report work done progress. + + partialResultToken : ProgressToken_Optional; + -- An optional token that a server can use to report partial results + -- (e.g. streaming) to the client. + + textDocument : LSP.Structures.TextDocumentIdentifier; + -- The text document. + + a_range : LSP.Structures.A_Range; + -- The range the semantic tokens are requested for. + + end record; + -- @since 3.16.0 + + overriding function workDoneToken + (Self : SemanticTokensRangeParams) + return LSP.Structures.ProgressToken_Optional is + (Self.workDoneToken); + + overriding function partialResultToken + (Self : SemanticTokensRangeParams) + return LSP.Structures.ProgressToken_Optional is + (Self.partialResultToken); + + type SetTraceParams is record + value : LSP.Enumerations.TraceValues; + + end record; + + type ShowDocumentParams is record + uri : LSP.Structures.URI; + -- The document uri to show. + + external : Boolean_Optional; + -- Indicates to show the resource in an external program. To show for + -- example `https://code.visualstudio.com/` in the default WEB browser + -- set `external` to `true`. + + takeFocus : Boolean_Optional; + -- An optional property to indicate whether the editor showing the + -- document should take focus or not. Clients might ignore this + -- property if an external program is started. + + selection : A_Range_Optional; + -- An optional selection range if the document is a text document. + -- Clients might ignore the property if an external program is started + -- or the file is not a text file. + + end record; + -- Params to show a document. + -- + -- @since 3.16.0 + + type ShowDocumentResult is record + success : Standard.Boolean; + -- A boolean indicating if the show was successful. + + end record; + -- The result of a showDocument request. + -- + -- @since 3.16.0 + + type ShowMessageParams is record + a_type : LSP.Enumerations.MessageType; + -- The message type. See {@link MessageType} + + message : LSP.Structures.Virtual_String; + -- The actual message. + + end record; + -- The parameters of a notification message. + + package MessageActionItem_Vectors is new Ada.Containers.Vectors + (Positive, MessageActionItem, "="); + + type MessageActionItem_Vector is + new MessageActionItem_Vectors.Vector with null record; + + type ShowMessageRequestParams is record + a_type : LSP.Enumerations.MessageType; + -- The message type. See {@link MessageType} + + message : LSP.Structures.Virtual_String; + -- The actual message. + + actions : LSP.Structures.MessageActionItem_Vector; + -- The message action items to present. + + end record; + + package ParameterInformation_Vectors is new Ada.Containers.Vectors + (Positive, ParameterInformation, "="); + + type ParameterInformation_Vector is + new ParameterInformation_Vectors.Vector with null record; + + type SignatureInformation is record + label : LSP.Structures.Virtual_String; + -- The label of this signature. Will be shown in the UI. + + documentation : Virtual_String_Or_MarkupContent_Optional; + -- The human-readable doc-comment of this signature. Will be shown in + -- the UI but can be omitted. + + parameters : LSP.Structures.ParameterInformation_Vector; + -- The parameters of this signature. + + activeParameter : Natural_Optional; + -- The index of the active parameter. + -- + -- If provided, this is used in place of + -- `SignatureHelp.activeParameter`. + -- + -- @since 3.16.0 + + end record; + -- Represents the signature of something callable. A signature can have a + -- label, like a function-name, a doc-comment, and a set of parameters. + + package SignatureInformation_Vectors is new Ada.Containers.Vectors + (Positive, SignatureInformation, "="); + + type SignatureInformation_Vector is + new SignatureInformation_Vectors.Vector with null record; + + type SignatureHelp is record + signatures : LSP.Structures.SignatureInformation_Vector; + -- One or more signatures. + + activeSignature : Natural_Optional; + -- The active signature. If omitted or the value lies outside the range + -- of `signatures` the value defaults to zero or is ignored if the + -- `SignatureHelp` has no signatures. + -- + -- Whenever possible implementors should make an active decision about + -- the active signature and shouldn't rely on a default value. + -- + -- In future version of the protocol this property might become + -- mandatory to better express this. + + activeParameter : Natural_Optional; + -- The active parameter of the active signature. If omitted or the value + -- lies outside the range of `signatures[activeSignature].parameters` + -- defaults to 0 if the active signature has parameters. If the active + -- signature has no parameters it is ignored. In future version of the + -- protocol this property might become mandatory to better express the + -- active parameter if the active signature does have any. + + end record; + -- Signature help represents the signature of something callable. There can + -- be multiple signature but only one active and only one active parameter. + + type SignatureHelp_Optional (Is_Set : Boolean := False) is record + case Is_Set is + when False => + null; + when True => + Value : SignatureHelp; + end case; + end record; + + type SignatureHelpContext is record + triggerKind : LSP.Enumerations.SignatureHelpTriggerKind; + -- Action that caused signature help to be triggered. + + triggerCharacter : Virtual_String_Optional; + -- Character that caused signature help to be triggered. + -- + -- This is undefined when `triggerKind !== + -- SignatureHelpTriggerKind.TriggerCharacter` + + isRetrigger : Standard.Boolean; + -- `true` if signature help was already showing when it was triggered. + -- + -- Retriggers occurs when the signature help is already active and can + -- be caused by actions such as typing a trigger character, a cursor + -- move, or document content changes. + + activeSignatureHelp : SignatureHelp_Optional; + -- The currently active `SignatureHelp`. + -- + -- The `activeSignatureHelp` has its `SignatureHelp.activeSignature` + -- field updated based on the user navigating through available + -- signatures. + + end record; + -- Additional information about the context in which a signature help + -- request was triggered. + -- + -- @since 3.15.0 + + type SignatureHelpContext_Optional (Is_Set : Boolean := False) is record + case Is_Set is + when False => + null; + when True => + Value : SignatureHelpContext; + end case; + end record; + + type SignatureHelpParams is + new TextDocumentPositionParams and WorkDoneProgressParams with record + workDoneToken : ProgressToken_Optional; + -- An optional token that a server can use to report work done progress. + + context : SignatureHelpContext_Optional; + -- The signature help context. This is only available if the + -- client specifies to send this using the client capability + -- `textDocument.signatureHelp.contextSupport === true` + -- + -- @since 3.15.0 + + end record; + -- Parameters for a [SignatureHelpRequest](#SignatureHelpRequest). + + overriding function workDoneToken + (Self : SignatureHelpParams) + return LSP.Structures.ProgressToken_Optional is + (Self.workDoneToken); + + type SignatureHelpRegistrationOptions is + new SignatureHelpOptions with record + Parent : LSP.Structures.TextDocumentRegistrationOptions; + end record; + -- Registration options for a + -- [SignatureHelpRequest](#SignatureHelpRequest). + + type SymbolInformation is new BaseSymbolInformation with record + deprecated : Boolean_Optional; + -- Indicates if this symbol is deprecated. + -- + -- @deprecated Use tags instead + + location : LSP.Structures.Location; + -- The location of this symbol. The location's range is used by a tool + -- to reveal the location in the editor. If the symbol is selected + -- in the tool the range's start information is used to position the + -- cursor. So the range usually spans more than the actual symbol's + -- name and does normally include things like visibility modifiers. + -- + -- The range doesn't have to denote a node range in the sense of an + -- abstract syntax tree. It can therefore not be used to re-construct + -- a hierarchy of the symbols. + + end record; + -- Represents information about programming constructs like variables, + -- classes, interfaces etc. + + type TextDocumentChangeRegistrationOptions is + new TextDocumentRegistrationOptions with record + syncKind : LSP.Enumerations.TextDocumentSyncKind; + -- How documents are synced to the server. + + end record; + -- Describe options to be used when registered for text document change + -- events. + + type TextDocumentSaveRegistrationOptions is new SaveOptions with record + Parent : LSP.Structures.TextDocumentRegistrationOptions; + end record; + -- Save registration options. + + type TypeDefinitionParams is + new TextDocumentPositionParams and WorkDoneProgressParams and + PartialResultParams with record + workDoneToken : ProgressToken_Optional; + -- An optional token that a server can use to report work done progress. + + partialResultToken : ProgressToken_Optional; + -- An optional token that a server can use to report partial results + -- (e.g. streaming) to the client. + + end record; + + overriding function workDoneToken + (Self : TypeDefinitionParams) + return LSP.Structures.ProgressToken_Optional is + (Self.workDoneToken); + + overriding function partialResultToken + (Self : TypeDefinitionParams) + return LSP.Structures.ProgressToken_Optional is + (Self.partialResultToken); + + type TypeHierarchyItem is record + name : LSP.Structures.Virtual_String; + -- The name of this item. + + kind : LSP.Enumerations.SymbolKind; + -- The kind of this item. + + tags : LSP.Structures.SymbolTag_Set; + -- Tags for this item. + + detail : Virtual_String_Optional; + -- More detail for this item, e.g. the signature of a function. + + uri : LSP.Structures.DocumentUri; + -- The resource identifier of this item. + + a_range : LSP.Structures.A_Range; + -- The range enclosing this symbol not including leading/trailing + -- whitespace but everything else, e.g. comments and code. + + selectionRange : LSP.Structures.A_Range; + -- The range that should be selected and revealed when this symbol is + -- being picked, e.g. the name of a function. Must be contained by the + -- [`range`](#TypeHierarchyItem.range). + + data : LSPAny_Optional; + -- A data entry field that is preserved between a type hierarchy + -- prepare and supertypes or subtypes requests. It could also be used + -- to identify the type hierarchy in the server, helping improve the + -- performance on resolving supertypes and subtypes. + + end record; + -- @since 3.17.0 + + type TypeHierarchyPrepareParams is + new TextDocumentPositionParams and WorkDoneProgressParams with record + workDoneToken : ProgressToken_Optional; + -- An optional token that a server can use to report work done progress. + + end record; + -- The parameter of a `textDocument/prepareTypeHierarchy` request. + -- + -- @since 3.17.0 + + overriding function workDoneToken + (Self : TypeHierarchyPrepareParams) + return LSP.Structures.ProgressToken_Optional is + (Self.workDoneToken); + + type TypeHierarchySubtypesParams is + new WorkDoneProgressParams and PartialResultParams with record + workDoneToken : ProgressToken_Optional; + -- An optional token that a server can use to report work done progress. + + partialResultToken : ProgressToken_Optional; + -- An optional token that a server can use to report partial results + -- (e.g. streaming) to the client. + + item : LSP.Structures.TypeHierarchyItem; + + end record; + -- The parameter of a `typeHierarchy/subtypes` request. + -- + -- @since 3.17.0 + + overriding function workDoneToken + (Self : TypeHierarchySubtypesParams) + return LSP.Structures.ProgressToken_Optional is + (Self.workDoneToken); + + overriding function partialResultToken + (Self : TypeHierarchySubtypesParams) + return LSP.Structures.ProgressToken_Optional is + (Self.partialResultToken); + + type TypeHierarchySupertypesParams is + new WorkDoneProgressParams and PartialResultParams with record + workDoneToken : ProgressToken_Optional; + -- An optional token that a server can use to report work done progress. + + partialResultToken : ProgressToken_Optional; + -- An optional token that a server can use to report partial results + -- (e.g. streaming) to the client. + + item : LSP.Structures.TypeHierarchyItem; + + end record; + -- The parameter of a `typeHierarchy/supertypes` request. + -- + -- @since 3.17.0 + + overriding function workDoneToken + (Self : TypeHierarchySupertypesParams) + return LSP.Structures.ProgressToken_Optional is + (Self.workDoneToken); + + overriding function partialResultToken + (Self : TypeHierarchySupertypesParams) + return LSP.Structures.ProgressToken_Optional is + (Self.partialResultToken); + + type Unregistration is record + id : LSP.Structures.Virtual_String; + -- The id used to unregister the request or notification. Usually an id + -- provided during the register request. + + method : LSP.Structures.Virtual_String; + -- The method to unregister for. + + end record; + -- General parameters to unregister a request or notification. + + package Unregistration_Vectors is new Ada.Containers.Vectors + (Positive, Unregistration, "="); + + type Unregistration_Vector is + new Unregistration_Vectors.Vector with null record; + + type UnregistrationParams is record + unregisterations : LSP.Structures.Unregistration_Vector; + + end record; + + type WillSaveTextDocumentParams is record + textDocument : LSP.Structures.TextDocumentIdentifier; + -- The document that will be saved. + + reason : LSP.Enumerations.TextDocumentSaveReason; + -- The 'TextDocumentSaveReason'. + + end record; + -- The parameters sent in a will save text document notification. + + type WorkDoneProgressBegin is record + title : LSP.Structures.Virtual_String; + -- Mandatory title of the progress operation. Used to briefly inform + -- about the kind of operation being performed. + -- + -- Examples: "Indexing" or "Linking dependencies". + + cancellable : Boolean_Optional; + -- Controls if a cancel button should show to allow the user to cancel + -- the long running operation. Clients that don't support cancellation + -- are allowed to ignore the setting. + + message : Virtual_String_Optional; + -- Optional, more detailed associated progress message. Contains + -- complementary information to the `title`. + -- + -- Examples: "3/25 files", "project/src/module2", + -- "node_modules/some_dep". If unset, the previous progress message + -- (if any) is still valid. + + percentage : Natural_Optional; + -- Optional progress percentage to display (value 100 is considered + -- 100%). If not provided infinite progress is assumed and clients are + -- allowed to ignore the `percentage` value in subsequent in report + -- notifications. + -- + -- The value should be steadily rising. Clients are free to ignore + -- values that are not following this rule. The value range is [0, 100]. + + end record; + + type WorkDoneProgressCancelParams is record + token : LSP.Structures.ProgressToken; + -- The token to be used to report progress. + + end record; + + type WorkDoneProgressCreateParams is record + token : LSP.Structures.ProgressToken; + -- The token to be used to report progress. + + end record; + + type WorkDoneProgressEnd is record + message : Virtual_String_Optional; + -- Optional, a final message indicating to for example indicate the + -- outcome of the operation. + + end record; + + type WorkDoneProgressReport is record + cancellable : Boolean_Optional; + -- Controls enablement state of a cancel button. + -- + -- Clients that don't support cancellation or don't support controlling + -- the button's enablement state are allowed to ignore the property. + + message : Virtual_String_Optional; + -- Optional, more detailed associated progress message. Contains + -- complementary information to the `title`. + -- + -- Examples: "3/25 files", "project/src/module2", + -- "node_modules/some_dep". If unset, the previous progress message + -- (if any) is still valid. + + percentage : Natural_Optional; + -- Optional progress percentage to display (value 100 is considered + -- 100%). If not provided infinite progress is assumed and clients are + -- allowed to ignore the `percentage` value in subsequent in report + -- notifications. + -- + -- The value should be steadily rising. Clients are free to ignore + -- values that are not following this rule. The value range is [0, 100] + + end record; + + package PreviousResultId_Vectors is new Ada.Containers.Vectors + (Positive, PreviousResultId, "="); + + type PreviousResultId_Vector is + new PreviousResultId_Vectors.Vector with null record; + + type WorkspaceDiagnosticParams is + new WorkDoneProgressParams and PartialResultParams with record + workDoneToken : ProgressToken_Optional; + -- An optional token that a server can use to report work done progress. + + partialResultToken : ProgressToken_Optional; + -- An optional token that a server can use to report partial results + -- (e.g. streaming) to the client. + + identifier : Virtual_String_Optional; + -- The additional identifier provided during registration. + + previousResultIds : LSP.Structures.PreviousResultId_Vector; + -- The currently known diagnostic reports with their previous result + -- ids. + + end record; + -- Parameters of the workspace diagnostic request. + -- + -- @since 3.17.0 + + overriding function workDoneToken + (Self : WorkspaceDiagnosticParams) + return LSP.Structures.ProgressToken_Optional is + (Self.workDoneToken); + + overriding function partialResultToken + (Self : WorkspaceDiagnosticParams) + return LSP.Structures.ProgressToken_Optional is + (Self.partialResultToken); + + type WorkspaceUnchangedDocumentDiagnosticReport is + new UnchangedDocumentDiagnosticReport with record + uri : LSP.Structures.DocumentUri; + -- The URI for which diagnostic information is reported. + + version : LSP.Structures.Integer_Or_Null; + -- The version number for which the diagnostics are reported. If the + -- document is not marked as open `null` can be provided. + + end record; + -- An unchanged document diagnostic report for a workspace diagnostic + -- result. + -- + -- @since 3.17.0 + + type WorkspaceFullDocumentDiagnosticReport is + new FullDocumentDiagnosticReport with record + uri : LSP.Structures.DocumentUri; + -- The URI for which diagnostic information is reported. + + version : LSP.Structures.Integer_Or_Null; + -- The version number for which the diagnostics are reported. If the + -- document is not marked as open `null` can be provided. + + end record; + -- A full document diagnostic report for a workspace diagnostic result. + -- + -- @since 3.17.0 + + type WorkspaceDocumentDiagnosticReport_Variant is (full, unchanged); + + type WorkspaceDocumentDiagnosticReport + (Kind : WorkspaceDocumentDiagnosticReport_Variant := + WorkspaceDocumentDiagnosticReport_Variant'First) + is + record + case Kind is + when full => + full : LSP.Structures.WorkspaceFullDocumentDiagnosticReport; + when unchanged => + unchanged : LSP.Structures + .WorkspaceUnchangedDocumentDiagnosticReport; + end case; + end record; + -- A workspace diagnostic document report. + -- + -- @since 3.17.0 + + package WorkspaceDocumentDiagnosticReport_Vectors is new Ada.Containers + .Vectors + (Positive, WorkspaceDocumentDiagnosticReport, "="); + + type WorkspaceDocumentDiagnosticReport_Vector is + new WorkspaceDocumentDiagnosticReport_Vectors.Vector with null record; + + type WorkspaceDiagnosticReport is record + items : LSP.Structures.WorkspaceDocumentDiagnosticReport_Vector; + + end record; + -- A workspace diagnostic report. + -- + -- @since 3.17.0 + + type WorkspaceDiagnosticReportPartialResult is record + items : LSP.Structures.WorkspaceDocumentDiagnosticReport_Vector; + + end record; + -- A partial result for a workspace diagnostic report. + -- + -- @since 3.17.0 + + type Location_Or_Something (Is_Location : Boolean := True) is record + case Is_Location is + when True => + Location : LSP.Structures.Location; + when False => + uri : LSP.Structures.DocumentUri; + + end case; + end record; + + type WorkspaceSymbol is new BaseSymbolInformation with record + location : LSP.Structures.Location_Or_Something; + -- The location of the symbol. Whether a server is allowed to return + -- a location without a range depends on the client capability + -- `workspace.symbol.resolveSupport`. + -- + -- See SymbolInformation#location for more details. + + data : LSPAny_Optional; + -- A data entry field that is preserved on a workspace symbol between a + -- workspace symbol request and a workspace symbol resolve request. + + end record; + -- A special workspace symbol that supports locations without a range. + -- + -- See also SymbolInformation. + -- + -- @since 3.17.0 + + type WorkspaceSymbolParams is + new WorkDoneProgressParams and PartialResultParams with record + workDoneToken : ProgressToken_Optional; + -- An optional token that a server can use to report work done progress. + + partialResultToken : ProgressToken_Optional; + -- An optional token that a server can use to report partial results + -- (e.g. streaming) to the client. + + query : LSP.Structures.Virtual_String; + -- A query string to filter symbols by. Clients may send an empty string + -- here to request all symbols. + + end record; + -- The parameters of a [WorkspaceSymbolRequest](#WorkspaceSymbolRequest). + + overriding function workDoneToken + (Self : WorkspaceSymbolParams) + return LSP.Structures.ProgressToken_Optional is + (Self.workDoneToken); + + overriding function partialResultToken + (Self : WorkspaceSymbolParams) + return LSP.Structures.ProgressToken_Optional is + (Self.partialResultToken); + + type WorkspaceSymbolRegistrationOptions is + new WorkspaceSymbolOptions with record + null; + end record; + -- Registration options for a + -- [WorkspaceSymbolRequest](#WorkspaceSymbolRequest). + + package Location_Vectors is new Ada.Containers.Vectors + (Positive, Location, "="); + + type Location_Vector is new Location_Vectors.Vector with null record; + + subtype Declaration is Location_Vector; + -- The declaration of a symbol representation as one or many + -- [locations](#Location). + + subtype DeclarationLink is LocationLink; + -- Information about where a symbol is declared. + -- + -- Provides additional metadata over normal [location](#Location) + -- declarations, including the range of the declaring symbol. + -- + -- Servers should prefer returning `DeclarationLink` over `Declaration` if + -- supported by the client. + + subtype Definition is Location_Vector; + -- The definition of a symbol represented as one or many + -- [locations](#Location). For most programming languages there is only + -- one location at which a symbol is defined. + -- + -- Servers should prefer returning `DefinitionLink` over `Definition` if + -- supported by the client. + + subtype DefinitionLink is LocationLink; + -- Information about where a symbol is defined. + -- + -- Provides additional metadata over normal [location](#Location) + -- definitions, including the range of the defining symbol + + type DocumentDiagnosticReport_Variant is (full, unchanged); + + type DocumentDiagnosticReport + (Kind : DocumentDiagnosticReport_Variant := + DocumentDiagnosticReport_Variant'First) + is + record + case Kind is + when full => + full : LSP.Structures.RelatedFullDocumentDiagnosticReport; + when unchanged => + unchanged : LSP.Structures + .RelatedUnchangedDocumentDiagnosticReport; + end case; + end record; + -- The result of a document diagnostic pull request. A report can either + -- be a full report containing all diagnostics for the requested document + -- or an unchanged report indicating that nothing has changed in terms of + -- diagnostics in comparison to the last pull request. + -- + -- @since 3.17.0 + + type InlineValue_Variant is (Varian_1, Varian_2, Varian_3); + + type InlineValue (Kind : InlineValue_Variant := InlineValue_Variant'First) + is + record + case Kind is + when Varian_1 => + Varian_1 : LSP.Structures.InlineValueText; + when Varian_2 => + Varian_2 : LSP.Structures.InlineValueVariableLookup; + when Varian_3 => + Varian_3 : LSP.Structures.InlineValueEvaluatableExpression; + end case; + end record; + -- Inline value information can be provided by different means: - directly + -- as a text value (class InlineValueText). - as a name to use for a + -- variable lookup (class InlineValueVariableLookup) - as an evaluatable + -- expression (class InlineValueEvaluatableExpression) The InlineValue + -- types combines all inline value types into one type. + -- + -- @since 3.17.0 + + type PrepareRenameResult_2 is record + a_range : LSP.Structures.A_Range; + + placeholder : LSP.Structures.Virtual_String; + + end record; + + type PrepareRenameResult_3 is record + defaultBehavior : Standard.Boolean; + + end record; + + type PrepareRenameResult_Variant is (Varian_1, Varian_2, Varian_3); + + type PrepareRenameResult + (Kind : PrepareRenameResult_Variant := PrepareRenameResult_Variant'First) + is + record + case Kind is + when Varian_1 => + Varian_1 : LSP.Structures.A_Range; + when Varian_2 => + Varian_2 : LSP.Structures.PrepareRenameResult_2; + when Varian_3 => + Varian_3 : LSP.Structures.PrepareRenameResult_3; + end case; + end record; + + package CallHierarchyIncomingCall_Vectors is new Ada.Containers.Vectors + (Positive, CallHierarchyIncomingCall, "="); + + type CallHierarchyIncomingCall_Vector is + new CallHierarchyIncomingCall_Vectors.Vector with null record; + + subtype CallHierarchyIncomingCall_Vector_Or_Null is + CallHierarchyIncomingCall_Vector; + + package CallHierarchyOutgoingCall_Vectors is new Ada.Containers.Vectors + (Positive, CallHierarchyOutgoingCall, "="); + + type CallHierarchyOutgoingCall_Vector is + new CallHierarchyOutgoingCall_Vectors.Vector with null record; + + subtype CallHierarchyOutgoingCall_Vector_Or_Null is + CallHierarchyOutgoingCall_Vector; + + type Command_Or_CodeAction (Is_Command : Boolean := True) is record + case Is_Command is + when True => + Command : LSP.Structures.Command; + when False => + CodeAction : LSP.Structures.CodeAction; + end case; + end record; + + package Command_Or_CodeAction_Vectors is new Ada.Containers.Vectors + (Positive, Command_Or_CodeAction, "="); + + type Command_Or_CodeAction_Vector is + new Command_Or_CodeAction_Vectors.Vector with null record; + + subtype Command_Or_CodeAction_Vector_Or_Null is + Command_Or_CodeAction_Vector; + + package CodeLens_Vectors is new Ada.Containers.Vectors + (Positive, CodeLens, "="); + + type CodeLens_Vector is new CodeLens_Vectors.Vector with null record; + + subtype CodeLens_Vector_Or_Null is CodeLens_Vector; + + package ColorPresentation_Vectors is new Ada.Containers.Vectors + (Positive, ColorPresentation, "="); + + type ColorPresentation_Vector is + new ColorPresentation_Vectors.Vector with null record; + + type Completion_Result_Variant is (Varian_1, Varian_2, Varian_3); + + type Completion_Result + (Kind : Completion_Result_Variant := Completion_Result_Variant'First) is + record + case Kind is + when Varian_1 => + Varian_1 : LSP.Structures.CompletionItem_Vector; + when Varian_2 => + Varian_2 : LSP.Structures.CompletionList; + when Varian_3 => + Varian_3 : LSP.Structures.Null_Record; + end case; + end record; + + package DeclarationLink_Vectors is new Ada.Containers.Vectors + (Positive, DeclarationLink, "="); + + type DeclarationLink_Vector is + new DeclarationLink_Vectors.Vector with null record; + + type Declaration_Result_Variant is (Varian_1, Varian_2, Varian_3); + + type Declaration_Result + (Kind : Declaration_Result_Variant := Declaration_Result_Variant'First) is + record + case Kind is + when Varian_1 => + Varian_1 : LSP.Structures.Declaration; + when Varian_2 => + Varian_2 : LSP.Structures.DeclarationLink_Vector; + when Varian_3 => + Varian_3 : LSP.Structures.Null_Record; + end case; + end record; + + type Declaration_Progress_Report_Variant is (Varian_1, Varian_2); + + type Declaration_Progress_Report + (Kind : Declaration_Progress_Report_Variant := + Declaration_Progress_Report_Variant'First) + is + record + case Kind is + when Varian_1 => + Varian_1 : LSP.Structures.Location_Vector; + when Varian_2 => + Varian_2 : LSP.Structures.DeclarationLink_Vector; + end case; + end record; + + package DefinitionLink_Vectors is new Ada.Containers.Vectors + (Positive, DefinitionLink, "="); + + type DefinitionLink_Vector is + new DefinitionLink_Vectors.Vector with null record; + + type Definition_Result_Variant is (Varian_1, Varian_2, Varian_3); + + type Definition_Result + (Kind : Definition_Result_Variant := Definition_Result_Variant'First) is + record + case Kind is + when Varian_1 => + Varian_1 : LSP.Structures.Definition; + when Varian_2 => + Varian_2 : LSP.Structures.DefinitionLink_Vector; + when Varian_3 => + Varian_3 : LSP.Structures.Null_Record; + end case; + end record; + + type Definition_Progress_Report_Variant is (Varian_1, Varian_2); + + type Definition_Progress_Report + (Kind : Definition_Progress_Report_Variant := + Definition_Progress_Report_Variant'First) + is + record + case Kind is + when Varian_1 => + Varian_1 : LSP.Structures.Location_Vector; + when Varian_2 => + Varian_2 : LSP.Structures.DefinitionLink_Vector; + end case; + end record; + + package ColorInformation_Vectors is new Ada.Containers.Vectors + (Positive, ColorInformation, "="); + + type ColorInformation_Vector is + new ColorInformation_Vectors.Vector with null record; + + package DocumentHighlight_Vectors is new Ada.Containers.Vectors + (Positive, DocumentHighlight, "="); + + type DocumentHighlight_Vector is + new DocumentHighlight_Vectors.Vector with null record; + + subtype DocumentHighlight_Vector_Or_Null is DocumentHighlight_Vector; + + package DocumentLink_Vectors is new Ada.Containers.Vectors + (Positive, DocumentLink, "="); + + type DocumentLink_Vector is + new DocumentLink_Vectors.Vector with null record; + + subtype DocumentLink_Vector_Or_Null is DocumentLink_Vector; + + package SymbolInformation_Vectors is new Ada.Containers.Vectors + (Positive, SymbolInformation, "="); + + type SymbolInformation_Vector is + new SymbolInformation_Vectors.Vector with null record; + + type DocumentSymbol_Result_Variant is (Varian_1, Varian_2, Varian_3); + + type DocumentSymbol_Result + (Kind : DocumentSymbol_Result_Variant := + DocumentSymbol_Result_Variant'First) + is + record + case Kind is + when Varian_1 => + Varian_1 : LSP.Structures.SymbolInformation_Vector; + when Varian_2 => + Varian_2 : LSP.Structures.DocumentSymbol_Vector; + when Varian_3 => + Varian_3 : LSP.Structures.Null_Record; + end case; + end record; + + type DocumentSymbol_Progress_Report_Variant is (Varian_1, Varian_2); + + type DocumentSymbol_Progress_Report + (Kind : DocumentSymbol_Progress_Report_Variant := + DocumentSymbol_Progress_Report_Variant'First) + is + record + case Kind is + when Varian_1 => + Varian_1 : LSP.Structures.SymbolInformation_Vector; + when Varian_2 => + Varian_2 : LSP.Structures.DocumentSymbol_Vector; + end case; + end record; + + package FoldingRange_Vectors is new Ada.Containers.Vectors + (Positive, FoldingRange, "="); + + type FoldingRange_Vector is + new FoldingRange_Vectors.Vector with null record; + + subtype FoldingRange_Vector_Or_Null is FoldingRange_Vector; + + subtype TextEdit_Vector_Or_Null is TextEdit_Vector; + + type Hover_Or_Null (Is_Null : Boolean := True) is record + case Is_Null is + when True => + null; + when False => + Value : Hover; + end case; + end record; + + package InlayHint_Vectors is new Ada.Containers.Vectors + (Positive, InlayHint, "="); + + type InlayHint_Vector is new InlayHint_Vectors.Vector with null record; + + subtype InlayHint_Vector_Or_Null is InlayHint_Vector; + + package InlineValue_Vectors is new Ada.Containers.Vectors + (Positive, InlineValue, "="); + + type InlineValue_Vector is new InlineValue_Vectors.Vector with null record; + + subtype InlineValue_Vector_Or_Null is InlineValue_Vector; + + type LinkedEditingRanges_Or_Null (Is_Null : Boolean := True) is record + case Is_Null is + when True => + null; + when False => + Value : LinkedEditingRanges; + end case; + end record; + + package Moniker_Vectors is new Ada.Containers.Vectors + (Positive, Moniker, "="); + + type Moniker_Vector is new Moniker_Vectors.Vector with null record; + + subtype Moniker_Vector_Or_Null is Moniker_Vector; + + package CallHierarchyItem_Vectors is new Ada.Containers.Vectors + (Positive, CallHierarchyItem, "="); + + type CallHierarchyItem_Vector is + new CallHierarchyItem_Vectors.Vector with null record; + + subtype CallHierarchyItem_Vector_Or_Null is CallHierarchyItem_Vector; + + type PrepareRenameResult_Or_Null (Is_Null : Boolean := True) is record + case Is_Null is + when True => + null; + when False => + Value : PrepareRenameResult; + end case; + end record; + + package TypeHierarchyItem_Vectors is new Ada.Containers.Vectors + (Positive, TypeHierarchyItem, "="); + + type TypeHierarchyItem_Vector is + new TypeHierarchyItem_Vectors.Vector with null record; + + subtype TypeHierarchyItem_Vector_Or_Null is TypeHierarchyItem_Vector; + + subtype Location_Vector_Or_Null is Location_Vector; + + type WorkspaceEdit_Or_Null (Is_Null : Boolean := True) is record + case Is_Null is + when True => + null; + when False => + Value : WorkspaceEdit; + end case; + end record; + + type SelectionRange_Vector is tagged private with + Variable_Indexing => Get_SelectionRange_Variable_Reference, + Constant_Indexing => Get_SelectionRange_Constant_Reference; + + subtype SelectionRange_Vector_Or_Null is SelectionRange_Vector; + + type SemanticTokens_Or_Null (Is_Null : Boolean := True) is record + case Is_Null is + when True => + null; + when False => + Value : SemanticTokens; + end case; + end record; + + type Tokens_Delta_Result_Variant is (Varian_1, Varian_2, Varian_3); + + type Tokens_Delta_Result + (Kind : Tokens_Delta_Result_Variant := Tokens_Delta_Result_Variant'First) + is + record + case Kind is + when Varian_1 => + Varian_1 : LSP.Structures.SemanticTokens; + when Varian_2 => + Varian_2 : LSP.Structures.SemanticTokensDelta; + when Varian_3 => + Varian_3 : LSP.Structures.Null_Record; + end case; + end record; + + type SemanticTokensPartialResult_Or_SemanticTokensDeltaPartialResult + (Is_SemanticTokensPartialResult : Boolean := True) is + record + case Is_SemanticTokensPartialResult is + when True => + SemanticTokensPartialResult : LSP.Structures + .SemanticTokensPartialResult; + when False => + SemanticTokensDeltaPartialResult : LSP.Structures + .SemanticTokensDeltaPartialResult; + end case; + end record; + + type SignatureHelp_Or_Null (Is_Null : Boolean := True) is record + case Is_Null is + when True => + null; + when False => + Value : SignatureHelp; + end case; + end record; + + type MessageActionItem_Or_Null (Is_Null : Boolean := True) is record + case Is_Null is + when True => + null; + when False => + Value : MessageActionItem; + end case; + end record; + + type LSPAny_Or_Null (Is_Null : Boolean := True) is record + case Is_Null is + when True => + null; + when False => + Value : LSPAny; + end case; + end record; + + package WorkspaceSymbol_Vectors is new Ada.Containers.Vectors + (Positive, WorkspaceSymbol, "="); + + type WorkspaceSymbol_Vector is + new WorkspaceSymbol_Vectors.Vector with null record; + + type Symbol_Result_Variant is (Varian_1, Varian_2, Varian_3); + + type Symbol_Result + (Kind : Symbol_Result_Variant := Symbol_Result_Variant'First) is + record + case Kind is + when Varian_1 => + Varian_1 : LSP.Structures.SymbolInformation_Vector; + when Varian_2 => + Varian_2 : LSP.Structures.WorkspaceSymbol_Vector; + when Varian_3 => + Varian_3 : LSP.Structures.Null_Record; + end case; + end record; + + type Symbol_Progress_Report_Variant is (Varian_1, Varian_2); + + type Symbol_Progress_Report + (Kind : Symbol_Progress_Report_Variant := + Symbol_Progress_Report_Variant'First) + is + record + case Kind is + when Varian_1 => + Varian_1 : LSP.Structures.SymbolInformation_Vector; + when Varian_2 => + Varian_2 : LSP.Structures.WorkspaceSymbol_Vector; + end case; + end record; + + function Length (Self : DocumentSymbol_Vector) return Natural; + + procedure Clear (Self : in out DocumentSymbol_Vector); + + procedure Append + (Self : in out DocumentSymbol_Vector; Value : DocumentSymbol); + + type DocumentSymbol_Variable_Reference + (Element : not null access DocumentSymbol) is + null record with + Implicit_Dereference => Element; + + function Get_DocumentSymbol_Variable_Reference + (Self : aliased in out DocumentSymbol_Vector; + Index : Positive) + return DocumentSymbol_Variable_Reference with + Inline; + + type DocumentSymbol_Constant_Reference + (Element : not null access constant DocumentSymbol) is + null record with + Implicit_Dereference => Element; + + function Get_DocumentSymbol_Constant_Reference + (Self : aliased DocumentSymbol_Vector; + Index : Positive) + return DocumentSymbol_Constant_Reference with + Inline; + + function Length (Self : SelectionRange_Vector) return Natural; + + procedure Clear (Self : in out SelectionRange_Vector); + + procedure Append + (Self : in out SelectionRange_Vector; Value : SelectionRange); + + type SelectionRange_Variable_Reference + (Element : not null access SelectionRange) is + null record with + Implicit_Dereference => Element; + + function Get_SelectionRange_Variable_Reference + (Self : aliased in out SelectionRange_Vector; + Index : Positive) + return SelectionRange_Variable_Reference with + Inline; + + type SelectionRange_Constant_Reference + (Element : not null access constant SelectionRange) is + null record with + Implicit_Dereference => Element; + + function Get_SelectionRange_Constant_Reference + (Self : aliased SelectionRange_Vector; + Index : Positive) + return SelectionRange_Constant_Reference with + Inline; + + function Is_Set (Self : SelectionRange_Optional) return Boolean; + function Value (Self : SelectionRange_Optional) return SelectionRange; + procedure Set + (Self : in out SelectionRange_Optional; Value : SelectionRange); + procedure Clear (Self : in out SelectionRange_Optional); + +private + + type DocumentSymbol_Array is + array (Positive range <>) of aliased DocumentSymbol; + type DocumentSymbol_Array_Access is access all DocumentSymbol_Array; + + type DocumentSymbol_Vector is new Ada.Finalization.Controlled with record + Data : DocumentSymbol_Array_Access; + end record; + + overriding procedure Finalize (Self : in out DocumentSymbol_Vector); + overriding procedure Adjust (Self : in out DocumentSymbol_Vector); + + type SelectionRange_Array is + array (Positive range <>) of aliased SelectionRange; + type SelectionRange_Array_Access is access all SelectionRange_Array; + + type SelectionRange_Vector is new Ada.Finalization.Controlled with record + Data : SelectionRange_Array_Access; + end record; + + overriding procedure Finalize (Self : in out SelectionRange_Vector); + overriding procedure Adjust (Self : in out SelectionRange_Vector); + + type SelectionRange_Access is access all SelectionRange; + type SelectionRange_Optional is new Ada.Finalization.Controlled with record + Value : SelectionRange_Access; + end record; + overriding procedure Finalize (Self : in out SelectionRange_Optional); + overriding procedure Adjust (Self : in out SelectionRange_Optional); +end LSP.Structures; From a1a3afb83e3f10dbad7c0c53bad03b87fdba52ec Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Mon, 7 Aug 2023 13:12:43 +0300 Subject: [PATCH 002/152] Move common (between 3.16 and 3.17) code into a dedicated directory for reuse. Refs #1170 --- gnat/lsp.gpr | 3 ++- source/{protocol => common}/lsp-stdio_streams-init_others.adb | 0 source/{protocol => common}/lsp-stdio_streams-init_windows.adb | 0 source/{protocol => common}/lsp-stdio_streams.adb | 0 source/{protocol => common}/lsp-stdio_streams.ads | 0 5 files changed, 2 insertions(+), 1 deletion(-) rename source/{protocol => common}/lsp-stdio_streams-init_others.adb (100%) rename source/{protocol => common}/lsp-stdio_streams-init_windows.adb (100%) rename source/{protocol => common}/lsp-stdio_streams.adb (100%) rename source/{protocol => common}/lsp-stdio_streams.ads (100%) diff --git a/gnat/lsp.gpr b/gnat/lsp.gpr index 2398ce138..4c12560c2 100644 --- a/gnat/lsp.gpr +++ b/gnat/lsp.gpr @@ -1,7 +1,7 @@ ------------------------------------------------------------------------------ -- Language Server Protocol -- -- -- --- Copyright (C) 2018-2021, AdaCore -- +-- Copyright (C) 2018-2023, AdaCore -- -- -- -- This is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -50,6 +50,7 @@ project LSP is for Source_Dirs use ("../source/protocol", "../source/protocol/generated", + "../source/common", "../source/uri"); for Object_Dir use "../.obj/" & Superproject & "/lsp"; for Main use (); diff --git a/source/protocol/lsp-stdio_streams-init_others.adb b/source/common/lsp-stdio_streams-init_others.adb similarity index 100% rename from source/protocol/lsp-stdio_streams-init_others.adb rename to source/common/lsp-stdio_streams-init_others.adb diff --git a/source/protocol/lsp-stdio_streams-init_windows.adb b/source/common/lsp-stdio_streams-init_windows.adb similarity index 100% rename from source/protocol/lsp-stdio_streams-init_windows.adb rename to source/common/lsp-stdio_streams-init_windows.adb diff --git a/source/protocol/lsp-stdio_streams.adb b/source/common/lsp-stdio_streams.adb similarity index 100% rename from source/protocol/lsp-stdio_streams.adb rename to source/common/lsp-stdio_streams.adb diff --git a/source/protocol/lsp-stdio_streams.ads b/source/common/lsp-stdio_streams.ads similarity index 100% rename from source/protocol/lsp-stdio_streams.ads rename to source/common/lsp-stdio_streams.ads From 345f0b213dc2361bd90a609d927db16b4087e8e7 Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Mon, 7 Aug 2023 16:25:22 +0300 Subject: [PATCH 003/152] Add dependecies needed by generated LSP code including * Base message types client/server messages and derived notifications, requests, responses, progress reports, * visitor interfaces to distinguish them * readers specifications (as they are not generated) * LSP.Structures body * I/O tools to handle complicated implementations * errors related responses (not included in JSON metamodel) * Client_Message_Receiver to group all messages from server to client Refs #1170 --- Makefile | 5 +- gnat/README.md | 5 +- gnat/lsp_3_17.gpr | 121 +++++++ .../lsp_3.17/lsp-client_message_receivers.ads | 21 ++ .../lsp_3.17/lsp-client_message_visitors.ads | 34 ++ source/lsp_3.17/lsp-client_messages.ads | 22 ++ .../lsp-client_notification_readers.ads | 20 ++ source/lsp_3.17/lsp-client_notifications.adb | 21 ++ source/lsp_3.17/lsp-client_notifications.ads | 28 ++ .../lsp_3.17/lsp-client_request_readers.ads | 20 ++ source/lsp_3.17/lsp-client_requests.adb | 21 ++ source/lsp_3.17/lsp-client_requests.ads | 32 ++ .../lsp_3.17/lsp-client_response_readers.ads | 20 ++ .../lsp_3.17/lsp-client_responses-errors.adb | 21 ++ .../lsp_3.17/lsp-client_responses-errors.ads | 19 ++ source/lsp_3.17/lsp-client_responses.adb | 33 ++ source/lsp_3.17/lsp-client_responses.ads | 43 +++ source/lsp_3.17/lsp-errors.ads | 34 ++ source/lsp_3.17/lsp-input_tools.adb | 303 ++++++++++++++++++ source/lsp_3.17/lsp-input_tools.ads | 82 +++++ source/lsp_3.17/lsp-output_tools.adb | 119 +++++++ source/lsp_3.17/lsp-output_tools.ads | 36 +++ .../lsp_3.17/lsp-progress_report_readers.ads | 21 ++ source/lsp_3.17/lsp-progress_reports.adb | 21 ++ source/lsp_3.17/lsp-progress_reports.ads | 30 ++ .../lsp_3.17/lsp-server_message_visitors.ads | 29 ++ source/lsp_3.17/lsp-server_messages.ads | 26 ++ .../lsp-server_notification_readers.ads | 20 ++ source/lsp_3.17/lsp-server_notifications.adb | 17 + source/lsp_3.17/lsp-server_notifications.ads | 28 ++ .../lsp_3.17/lsp-server_request_readers.ads | 20 ++ source/lsp_3.17/lsp-server_requests.adb | 17 + source/lsp_3.17/lsp-server_requests.ads | 37 +++ .../lsp_3.17/lsp-server_response_readers.ads | 20 ++ source/lsp_3.17/lsp-server_responses.adb | 25 ++ source/lsp_3.17/lsp-server_responses.ads | 43 +++ source/lsp_3.17/lsp-structures.adb | 238 ++++++++++++++ source/lsp_3.17/lsp.ads | 10 + source/lsp_3.17/minimal_perfect_hash.adb | 53 +++ source/lsp_3.17/minimal_perfect_hash.ads | 23 ++ 40 files changed, 1734 insertions(+), 4 deletions(-) create mode 100644 gnat/lsp_3_17.gpr create mode 100644 source/lsp_3.17/lsp-client_message_receivers.ads create mode 100644 source/lsp_3.17/lsp-client_message_visitors.ads create mode 100644 source/lsp_3.17/lsp-client_messages.ads create mode 100644 source/lsp_3.17/lsp-client_notification_readers.ads create mode 100644 source/lsp_3.17/lsp-client_notifications.adb create mode 100644 source/lsp_3.17/lsp-client_notifications.ads create mode 100644 source/lsp_3.17/lsp-client_request_readers.ads create mode 100644 source/lsp_3.17/lsp-client_requests.adb create mode 100644 source/lsp_3.17/lsp-client_requests.ads create mode 100644 source/lsp_3.17/lsp-client_response_readers.ads create mode 100644 source/lsp_3.17/lsp-client_responses-errors.adb create mode 100644 source/lsp_3.17/lsp-client_responses-errors.ads create mode 100644 source/lsp_3.17/lsp-client_responses.adb create mode 100644 source/lsp_3.17/lsp-client_responses.ads create mode 100644 source/lsp_3.17/lsp-errors.ads create mode 100644 source/lsp_3.17/lsp-input_tools.adb create mode 100644 source/lsp_3.17/lsp-input_tools.ads create mode 100644 source/lsp_3.17/lsp-output_tools.adb create mode 100644 source/lsp_3.17/lsp-output_tools.ads create mode 100644 source/lsp_3.17/lsp-progress_report_readers.ads create mode 100644 source/lsp_3.17/lsp-progress_reports.adb create mode 100644 source/lsp_3.17/lsp-progress_reports.ads create mode 100644 source/lsp_3.17/lsp-server_message_visitors.ads create mode 100644 source/lsp_3.17/lsp-server_messages.ads create mode 100644 source/lsp_3.17/lsp-server_notification_readers.ads create mode 100644 source/lsp_3.17/lsp-server_notifications.adb create mode 100644 source/lsp_3.17/lsp-server_notifications.ads create mode 100644 source/lsp_3.17/lsp-server_request_readers.ads create mode 100644 source/lsp_3.17/lsp-server_requests.adb create mode 100644 source/lsp_3.17/lsp-server_requests.ads create mode 100644 source/lsp_3.17/lsp-server_response_readers.ads create mode 100644 source/lsp_3.17/lsp-server_responses.adb create mode 100644 source/lsp_3.17/lsp-server_responses.ads create mode 100644 source/lsp_3.17/lsp-structures.adb create mode 100644 source/lsp_3.17/lsp.ads create mode 100644 source/lsp_3.17/minimal_perfect_hash.adb create mode 100644 source/lsp_3.17/minimal_perfect_hash.ads diff --git a/Makefile b/Makefile index 56e4f0d83..d0a27c085 100644 --- a/Makefile +++ b/Makefile @@ -92,13 +92,13 @@ else endif all: coverage-instrument + $(GPRBUILD) -P gnat/lsp_3_17.gpr -p $(COVERAGE_BUILD_FLAGS) $(GPRBUILD) -P gnat/tester.gpr -p $(BUILD_FLAGS) $(GPRBUILD) -d -ws -c -u -P gnat/lsp_server.gpr -p $(BUILD_FLAGS) s-memory.adb $(GPRBUILD) -P gnat/lsp_server.gpr -p $(COVERAGE_BUILD_FLAGS) \ -XVERSION=$(VERSION) -XBUILD_DATE=$(BUILD_DATE) $(GPRBUILD) -P gnat/codec_test.gpr -p $(COVERAGE_BUILD_FLAGS) - $(GPRBUILD) -P gnat/lsp_client.gpr -p $(COVERAGE_BUILD_FLAGS) \ - -XVERSION=$(VERSION) + $(GPRBUILD) -P gnat/lsp_client.gpr -p $(COVERAGE_BUILD_FLAGS) ifdef NODE mkdir -p integration/vscode/ada/$(NODE_ARCH)/$(NODE_PLATFORM) cp -f $(ALS) integration/vscode/ada/$(NODE_ARCH)/$(NODE_PLATFORM) @@ -137,6 +137,7 @@ endif clean: -$(GPRCLEAN) -P gnat/lsp.gpr $(LIBRARY_FLAGS) + -$(GPRCLEAN) -P gnat/lsp_3_17.gpr $(LIBRARY_FLAGS) -$(GPRCLEAN) -P gnat/lsp_server.gpr $(LIBRARY_FLAGS) -$(GPRCLEAN) -P gnat/tester.gpr $(LIBRARY_FLAGS) -$(GPRCLEAN) -P gnat/codec_test.gpr $(LIBRARY_FLAGS) diff --git a/gnat/README.md b/gnat/README.md index a2190d25d..0ddd2f10e 100644 --- a/gnat/README.md +++ b/gnat/README.md @@ -1,7 +1,8 @@ -Provided packages +Provided projects ----------------- - * LSP - Ada implementation of LSP messages and codecs to/from JSON + * LSP - Ada implementation of LSP 3.16 messages and codecs to/from JSON + * LSP_3_17 - Ada implementation of LSP 3.17 messages and codecs to/from JSON * LSP_Server - server part of the LSP protocol and Ada LSP server * LSP_Client - client part of the LSP protocol * Tester - Test driver for LSP server testsuite diff --git a/gnat/lsp_3_17.gpr b/gnat/lsp_3_17.gpr new file mode 100644 index 000000000..c8ef0417a --- /dev/null +++ b/gnat/lsp_3_17.gpr @@ -0,0 +1,121 @@ +------------------------------------------------------------------------------ +-- Language Server Protocol -- +-- -- +-- Copyright (C) 2018-2023, AdaCore -- +-- -- +-- This is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 3, or (at your option) any later ver- -- +-- sion. This software is distributed in the hope that it will be useful, -- +-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- -- +-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -- +-- License for more details. You should have received a copy of the GNU -- +-- General Public License distributed with this software; see file -- +-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy -- +-- of the license. -- +------------------------------------------------------------------------------ + +with "vss_common"; +with "vss_text"; +with "vss_json"; + +project LSP_3_17 is + + type Any_Build_Mode is ( + "prod", + -- Produce efficient code to be used in production and don't treat + -- warnings as errors. + + "dev" + -- Produce easy-to-debug code with extra checks. Treat warnings as + -- errors. + ); + Build_Mode : Any_Build_Mode := external ("BUILD_MODE", "dev"); + + Superproject := external ("SUPERPROJECT", ""); + + type Any_Boolean is ("false", "true"); + + -- By default, treat warnings as errors in dev mode, but not in prod + -- mode. Let users override this default using the ALS_WARN_ERRORS + -- environment variable. + + Warnings_As_Errors : Any_Boolean := "true"; + case Build_Mode is + when "dev" => Warnings_As_Errors := "true"; + when "prod" => Warnings_As_Errors := "false"; + end case; + Warnings_As_Errors : Any_Boolean := + external ("ALS_WARN_ERRORS", Warnings_As_Errors); + + for Source_Dirs use ("../source/lsp_3.17", + "../source/lsp_3.17/generated", + "../source/common", + "../source/uri"); + for Object_Dir use "../.obj/" & Superproject & "/lsp_317"; + for Main use (); + + -- Compute the list of default switches to build Ada unit + + Common_Ada_Switches := ( + -- Generate debug information even in production: this is useful to + -- get meaningful tracebacks. + "-g", + + -- Compile with "-gnatX" to support the "[]" syntax for array + -- aggregates: this is the common ground between all compilers + -- commonly used to build the language server. + "-gnatX"); + + Ada_Switches := (); + case Build_Mode is + when "prod" => + Ada_Switches := ( + -- Compile with optimizations + "-O2" + ); + + when "dev" => + Ada_Switches := ( + -- Compile with no optimization and with debug information to ease + -- investigation in debuggers. + "-O0", + + -- Enable all warnings and GNAT stylechecks (plus O: check for + -- overriding indicators). + "-gnatwaJ", "-gnatygO", + + -- Generated files may contain long lines + "-gnatyM150", + + -- Enable assertions and all validity checking options + "-gnata", "-gnatVa", + + -- Enable stack overflow checks + "-fstack-check" + ); + end case; + + case Warnings_As_Errors is + when "true" => Ada_Switches := Ada_Switches & ("-gnatwe"); + when "false" => null; + end case; + + package Compiler is + for Default_Switches ("Ada") use Common_Ada_Switches & Ada_Switches; + for Local_Configuration_Pragmas use "gnat.adc"; + end Compiler; + + package Naming is + case VSS_Common.OS_API is + when "Windows_NT" => + for Implementation ("LSP.Stdio_Streams.Initialize") + use "lsp-stdio_streams-init_windows.adb"; + + when others => + for Implementation ("LSP.Stdio_Streams.Initialize") + use "lsp-stdio_streams-init_others.adb"; + + end case; + end Naming; +end LSP_3_17; diff --git a/source/lsp_3.17/lsp-client_message_receivers.ads b/source/lsp_3.17/lsp-client_message_receivers.ads new file mode 100644 index 000000000..910977967 --- /dev/null +++ b/source/lsp_3.17/lsp-client_message_receivers.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) 2022-2023, AdaCore +-- +-- SPDX-License-Identifier: Apache-2.0 +-- + +with LSP.Client_Notification_Receivers; +with LSP.Client_Request_Receivers; +with LSP.Client_Response_Receivers; +with LSP.Progress_Report_Receivers; + +package LSP.Client_Message_Receivers is + pragma Preelaborate; + + type Client_Message_Receiver is limited interface and + LSP.Client_Notification_Receivers.Client_Notification_Receiver and + LSP.Client_Request_Receivers.Client_Request_Receiver and + LSP.Client_Response_Receivers.Client_Response_Receiver and + LSP.Progress_Report_Receivers.Progress_Report_Receiver; + +end LSP.Client_Message_Receivers; diff --git a/source/lsp_3.17/lsp-client_message_visitors.ads b/source/lsp_3.17/lsp-client_message_visitors.ads new file mode 100644 index 000000000..5a5cca0ea --- /dev/null +++ b/source/lsp_3.17/lsp-client_message_visitors.ads @@ -0,0 +1,34 @@ +-- +-- Copyright (C) 2022-2023, AdaCore +-- +-- SPDX-License-Identifier: Apache-2.0 +-- + +limited with LSP.Client_Notifications; +limited with LSP.Client_Requests; +limited with LSP.Client_Responses; +limited with LSP.Progress_Reports; + +package LSP.Client_Message_Visitors is + pragma Preelaborate; + + type Client_Message_Visitor is limited interface; + -- Interface to visit messages send by a server to a client + + procedure On_Client_Notification + (Self : in out Client_Message_Visitor; + Value : LSP.Client_Notifications.Client_Notification'Class) is null; + + procedure On_Client_Request + (Self : in out Client_Message_Visitor; + Value : LSP.Client_Requests.Client_Request'Class) is null; + + procedure On_Client_Response + (Self : in out Client_Message_Visitor; + Value : LSP.Client_Responses.Client_Response'Class) is null; + + procedure On_Progress_Report + (Self : in out Client_Message_Visitor; + Value : LSP.Progress_Reports.Progress_Report'Class) is null; + +end LSP.Client_Message_Visitors; diff --git a/source/lsp_3.17/lsp-client_messages.ads b/source/lsp_3.17/lsp-client_messages.ads new file mode 100644 index 000000000..634c54b8e --- /dev/null +++ b/source/lsp_3.17/lsp-client_messages.ads @@ -0,0 +1,22 @@ +-- +-- Copyright (C) 2022-2023, AdaCore +-- +-- SPDX-License-Identifier: Apache-2.0 +-- + +with LSP.Client_Message_Visitors; + +package LSP.Client_Messages is + pragma Preelaborate; + + type Client_Message is abstract tagged limited null record; + -- Base class of messages send by a server to a client + + type Client_Message_Access is access all Client_Message'Class; + + procedure Visit_Client_Message_Visitor + (Self : Client_Message; + Visitor : in out LSP.Client_Message_Visitors + .Client_Message_Visitor'Class) is null; + +end LSP.Client_Messages; diff --git a/source/lsp_3.17/lsp-client_notification_readers.ads b/source/lsp_3.17/lsp-client_notification_readers.ads new file mode 100644 index 000000000..6f98fa87b --- /dev/null +++ b/source/lsp_3.17/lsp-client_notification_readers.ads @@ -0,0 +1,20 @@ +-- +-- Copyright (C) 2022-2023, AdaCore +-- +-- SPDX-License-Identifier: Apache-2.0 +-- + +with VSS.JSON.Pull_Readers; +with VSS.Strings; +with LSP.Client_Notifications; + +package LSP.Client_Notification_Readers is + + function Read_Notification + (Input : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Method : VSS.Strings.Virtual_String) + return LSP.Client_Notifications.Client_Notification'Class; + + procedure Initialize; + +end LSP.Client_Notification_Readers; diff --git a/source/lsp_3.17/lsp-client_notifications.adb b/source/lsp_3.17/lsp-client_notifications.adb new file mode 100644 index 000000000..2b5ba0a46 --- /dev/null +++ b/source/lsp_3.17/lsp-client_notifications.adb @@ -0,0 +1,21 @@ +-- +-- Copyright (C) 2022-2023, AdaCore +-- +-- SPDX-License-Identifier: Apache-2.0 +-- + +package body LSP.Client_Notifications is + + ---------------------------------- + -- Visit_Client_Message_Visitor -- + ---------------------------------- + + overriding procedure Visit_Client_Message_Visitor + (Self : Client_Notification; + Visitor : in out LSP.Client_Message_Visitors + .Client_Message_Visitor'Class) is + begin + Visitor.On_Client_Notification (Self); + end Visit_Client_Message_Visitor; + +end LSP.Client_Notifications; diff --git a/source/lsp_3.17/lsp-client_notifications.ads b/source/lsp_3.17/lsp-client_notifications.ads new file mode 100644 index 000000000..d6d6ecf44 --- /dev/null +++ b/source/lsp_3.17/lsp-client_notifications.ads @@ -0,0 +1,28 @@ +-- +-- Copyright (C) 2022-2023, AdaCore +-- +-- SPDX-License-Identifier: Apache-2.0 +-- + +with LSP.Client_Message_Visitors; +with LSP.Client_Messages; +with LSP.Client_Notification_Receivers; + +package LSP.Client_Notifications is + pragma Preelaborate; + + type Client_Notification is abstract limited + new LSP.Client_Messages.Client_Message with null record; + + procedure Visit_Client_Receiver + (Self : Client_Notification; + Value : in out LSP.Client_Notification_Receivers + .Client_Notification_Receiver'Class) + is abstract; + + overriding procedure Visit_Client_Message_Visitor + (Self : Client_Notification; + Visitor : in out LSP.Client_Message_Visitors + .Client_Message_Visitor'Class); + +end LSP.Client_Notifications; diff --git a/source/lsp_3.17/lsp-client_request_readers.ads b/source/lsp_3.17/lsp-client_request_readers.ads new file mode 100644 index 000000000..7271dce20 --- /dev/null +++ b/source/lsp_3.17/lsp-client_request_readers.ads @@ -0,0 +1,20 @@ +-- +-- Copyright (C) 2022-2023, AdaCore +-- +-- SPDX-License-Identifier: Apache-2.0 +-- + +with LSP.Client_Requests; +with VSS.JSON.Pull_Readers; +with VSS.Strings; + +package LSP.Client_Request_Readers is + + procedure Initialize; + + function Read_Request + (Input : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Method : VSS.Strings.Virtual_String) + return LSP.Client_Requests.Client_Request'Class; + +end LSP.Client_Request_Readers; diff --git a/source/lsp_3.17/lsp-client_requests.adb b/source/lsp_3.17/lsp-client_requests.adb new file mode 100644 index 000000000..24ec0c04b --- /dev/null +++ b/source/lsp_3.17/lsp-client_requests.adb @@ -0,0 +1,21 @@ +-- +-- Copyright (C) 2022-2023, AdaCore +-- +-- SPDX-License-Identifier: Apache-2.0 +-- + +package body LSP.Client_Requests is + + ---------------------------------- + -- Visit_Client_Message_Visitor -- + ---------------------------------- + + overriding procedure Visit_Client_Message_Visitor + (Self : Client_Request; + Visitor : in out LSP.Client_Message_Visitors + .Client_Message_Visitor'Class) is + begin + Visitor.On_Client_Request (Self); + end Visit_Client_Message_Visitor; + +end LSP.Client_Requests; diff --git a/source/lsp_3.17/lsp-client_requests.ads b/source/lsp_3.17/lsp-client_requests.ads new file mode 100644 index 000000000..7c0b9b622 --- /dev/null +++ b/source/lsp_3.17/lsp-client_requests.ads @@ -0,0 +1,32 @@ +-- +-- Copyright (C) 2022-2023, AdaCore +-- +-- SPDX-License-Identifier: Apache-2.0 +-- + +with LSP.Client_Message_Visitors; +with LSP.Client_Messages; +with LSP.Client_Request_Receivers; +with LSP.Structures; + +package LSP.Client_Requests is + pragma Preelaborate; + + type Client_Request is + abstract limited new LSP.Client_Messages.Client_Message with + record + Id : LSP.Structures.Integer_Or_Virtual_String; + end record; + + procedure Visit_Client_Receiver + (Self : Client_Request; + Value : in out LSP.Client_Request_Receivers + .Client_Request_Receiver'Class) + is abstract; + + overriding procedure Visit_Client_Message_Visitor + (Self : Client_Request; + Visitor : in out LSP.Client_Message_Visitors + .Client_Message_Visitor'Class); + +end LSP.Client_Requests; diff --git a/source/lsp_3.17/lsp-client_response_readers.ads b/source/lsp_3.17/lsp-client_response_readers.ads new file mode 100644 index 000000000..3e32a8b71 --- /dev/null +++ b/source/lsp_3.17/lsp-client_response_readers.ads @@ -0,0 +1,20 @@ +-- +-- Copyright (C) 2022-2023, AdaCore +-- +-- SPDX-License-Identifier: Apache-2.0 +-- + +with VSS.JSON.Pull_Readers; +with VSS.Strings; +with LSP.Client_Responses; + +package LSP.Client_Response_Readers is + + procedure Initialize; + + function Read_Response + (Input : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Method : VSS.Strings.Virtual_String) + return LSP.Client_Responses.Client_Response'Class; + +end LSP.Client_Response_Readers; diff --git a/source/lsp_3.17/lsp-client_responses-errors.adb b/source/lsp_3.17/lsp-client_responses-errors.adb new file mode 100644 index 000000000..8d20e6a62 --- /dev/null +++ b/source/lsp_3.17/lsp-client_responses-errors.adb @@ -0,0 +1,21 @@ +-- +-- Copyright (C) 2022-2023, AdaCore +-- +-- SPDX-License-Identifier: Apache-2.0 +-- + +package body LSP.Client_Responses.Errors is + + --------------------------- + -- Visit_Client_Receiver -- + --------------------------- + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class) is + begin + Value.On_Error_Response (Self.Id, Self.Error); + end Visit_Client_Receiver; + +end LSP.Client_Responses.Errors; diff --git a/source/lsp_3.17/lsp-client_responses-errors.ads b/source/lsp_3.17/lsp-client_responses-errors.ads new file mode 100644 index 000000000..276376565 --- /dev/null +++ b/source/lsp_3.17/lsp-client_responses-errors.ads @@ -0,0 +1,19 @@ +-- +-- Copyright (C) 2022-2023, AdaCore +-- +-- SPDX-License-Identifier: Apache-2.0 +-- + +package LSP.Client_Responses.Errors is + pragma Preelaborate; + + type Response is new LSP.Client_Responses.Client_Response with record + Error : LSP.Errors.ResponseError; + end record; + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class); + +end LSP.Client_Responses.Errors; diff --git a/source/lsp_3.17/lsp-client_responses.adb b/source/lsp_3.17/lsp-client_responses.adb new file mode 100644 index 000000000..28b5e6f03 --- /dev/null +++ b/source/lsp_3.17/lsp-client_responses.adb @@ -0,0 +1,33 @@ +-- +-- Copyright (C) 2022-2023, AdaCore +-- +-- SPDX-License-Identifier: Apache-2.0 +-- + +package body LSP.Client_Responses is + + ---------------------------------- + -- Visit_Client_Message_Visitor -- + ---------------------------------- + + overriding procedure Visit_Client_Message_Visitor + (Self : Client_Response; + Visitor : in out LSP.Client_Message_Visitors + .Client_Message_Visitor'Class) is + begin + Visitor.On_Client_Response (Self); + end Visit_Client_Message_Visitor; + + --------------------------- + -- Visit_Client_Receiver -- + --------------------------- + + overriding procedure Visit_Client_Receiver + (Self : Client_Error_Response; + Visitor : in out LSP.Client_Response_Receivers + .Client_Response_Receiver'Class) is + begin + Visitor.On_Error_Response (Self.Id, Self.Error); + end Visit_Client_Receiver; + +end LSP.Client_Responses; diff --git a/source/lsp_3.17/lsp-client_responses.ads b/source/lsp_3.17/lsp-client_responses.ads new file mode 100644 index 000000000..49a963178 --- /dev/null +++ b/source/lsp_3.17/lsp-client_responses.ads @@ -0,0 +1,43 @@ +-- +-- Copyright (C) 2022-2023, AdaCore +-- +-- SPDX-License-Identifier: Apache-2.0 +-- + +with LSP.Client_Message_Visitors; +with LSP.Client_Messages; +with LSP.Client_Response_Receivers; +with LSP.Errors; +with LSP.Structures; + +package LSP.Client_Responses is + pragma Preelaborate; + + type Client_Response is + abstract limited new LSP.Client_Messages.Client_Message with + record + Id : LSP.Structures.Integer_Or_Virtual_String; + end record; + + procedure Visit_Client_Receiver + (Self : Client_Response; + Value : in out LSP.Client_Response_Receivers + .Client_Response_Receiver'Class) + is abstract; + + overriding procedure Visit_Client_Message_Visitor + (Self : Client_Response; + Visitor : in out LSP.Client_Message_Visitors + .Client_Message_Visitor'Class); + + type Client_Error_Response is new Client_Response with record + Error : LSP.Errors.ResponseError; + -- The error object in case a request fails. + end record; + + overriding procedure Visit_Client_Receiver + (Self : Client_Error_Response; + Visitor : in out LSP.Client_Response_Receivers + .Client_Response_Receiver'Class); + +end LSP.Client_Responses; diff --git a/source/lsp_3.17/lsp-errors.ads b/source/lsp_3.17/lsp-errors.ads new file mode 100644 index 000000000..95a475811 --- /dev/null +++ b/source/lsp_3.17/lsp-errors.ads @@ -0,0 +1,34 @@ +-- +-- Copyright (C) 2022-2023, AdaCore +-- +-- SPDX-License-Identifier: Apache-2.0 +-- + +with VSS.Strings; + +with LSP.Enumerations; + +package LSP.Errors is + pragma Preelaborate; + + type ResponseError is record + code : LSP.Enumerations.ErrorCodes; + -- A number indicating the error type that occurred. + message : VSS.Strings.Virtual_String; + -- A string providing a short description of the error. + + -- data: string | number | boolean | array | object | null; + -- A primitive or structured value that contains additional information + -- about the error. Can be omitted. + end record; + + type ResponseError_Optional (Is_Set : Boolean := False) is record + case Is_Set is + when False => + null; + when True => + Value : ResponseError; + end case; + end record; + +end LSP.Errors; diff --git a/source/lsp_3.17/lsp-input_tools.adb b/source/lsp_3.17/lsp-input_tools.adb new file mode 100644 index 000000000..4f6dcf4af --- /dev/null +++ b/source/lsp_3.17/lsp-input_tools.adb @@ -0,0 +1,303 @@ +-- +-- Copyright (C) 2022-2023, AdaCore +-- +-- SPDX-License-Identifier: Apache-2.0 +-- + +with VSS.JSON.Streams; + +with LSP.Inputs; +with Minimal_Perfect_Hash; + +package body LSP.Input_Tools is + + package Notification_Propery_Names is new Minimal_Perfect_Hash + (["jsonrpc", "method", "params", "id", "result"]); + + --------------------------------------------------- + -- Look_For_MarkupContent_Or_MarkedString_Vector -- + --------------------------------------------------- + + procedure Look_For_MarkupContent_Or_MarkedString_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.MarkupContent_Or_MarkedString_Vector) is + begin + raise Program_Error with "Unimplemented"; + end Look_For_MarkupContent_Or_MarkedString_Vector; + + ----------------- + -- Read_LSPAny -- + ----------------- + + procedure Read_LSPAny + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.LSPAny) is + begin + Read_LSPAny_Class (Handler, Value); + end Read_LSPAny; + + ----------------------- + -- Read_LSPAny_Class -- + ----------------------- + + procedure Read_LSPAny_Class + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.JSON_Event_Vectors.Vector'Class) + is + use all type VSS.JSON.Streams.JSON_Stream_Element_Kind; + Level : Natural := 0; + begin + while Handler.Element_Kind + in VSS.JSON.Streams.Valid_JSON_Stream_Element_Kind + loop + Value.Append (Handler.Element); + + Level := Level + + (case Handler.Element_Kind is + when Start_Array | Start_Object => 1, + when End_Array | End_Object => -1, + when others => 0); + + exit when Level = 0; + end loop; + end Read_LSPAny_Class; + + ----------------------- + -- Read_Notification -- + ----------------------- + + procedure Read_Notification + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out Parameter_Type) + is + use type VSS.Strings.Virtual_String; + + package PN renames Notification_Propery_Names; + begin + + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while Handler.Is_Key_Name loop + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + + case PN.Get_Index (Key) is + when 1 => -- jsonrpc + pragma Assert (Handler.Is_String_Value and then + Handler.String_Value = "2.0"); + Handler.Read_Next; + when 2 => -- method + pragma Assert (Handler.Is_String_Value and then + Handler.String_Value = Method); + Handler.Read_Next; + when 3 => -- params + Read_Parameter (Handler, Value); + when others => + -- ignore anything else? + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_Notification; + + ----------------------- + -- Read_Null_Request -- + ----------------------- + + procedure Read_Null_Request + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Method : VSS.Strings.Virtual_String; + Id : out LSP.Structures.Integer_Or_Virtual_String) + is + use type VSS.Strings.Virtual_String; + + package PN renames Notification_Propery_Names; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while Handler.Is_Key_Name loop + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + + case PN.Get_Index (Key) is + when 1 => -- jsonrpc + pragma Assert (Handler.Is_String_Value and then + Handler.String_Value = "2.0"); + Handler.Read_Next; + when 2 => -- method + pragma Assert (Handler.Is_String_Value and then + Handler.String_Value = Method); + Handler.Read_Next; + when 4 => -- id + LSP.Inputs.Read_Integer_Or_Virtual_String (Handler, Id); + when others => + -- ignore anything else? + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_Null_Request; + + -------------------------- + -- Read_Progress_Report -- + -------------------------- + + procedure Read_Progress_Report + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Token : out LSP.Structures.Integer_Or_Virtual_String; + Value : out Result_Type) + is + use type VSS.Strings.Virtual_String; + + package PN renames Notification_Propery_Names; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while Handler.Is_Key_Name loop + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + + case PN.Get_Index (Key) is + when 1 => -- jsonrpc + pragma Assert (Handler.Is_String_Value and then + Handler.String_Value = "2.0"); + Handler.Read_Next; + when 2 => -- method + pragma Assert (Handler.Is_String_Value and then + Handler.String_Value = "$/progress"); + Handler.Read_Next; + when 3 => -- params + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while Handler.Is_Key_Name loop + declare + Field : constant VSS.Strings.Virtual_String := + Handler.Key_Name; + begin + Handler.Read_Next; + + if Field = "token" then + LSP.Inputs.Read_Integer_Or_Virtual_String + (Handler, Token); + elsif Field = "value" then + Read_Progress_Report (Handler, Value); + else + -- ignore anything else? + Handler.Skip_Current_Value; + end if; + end; + end loop; + + pragma Assert (Handler.Is_End_Object); + Handler.Read_Next; + when others => + -- ignore anything else? + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_Progress_Report; + + ------------------ + -- Read_Request -- + ------------------ + + procedure Read_Request + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Id : out LSP.Structures.Integer_Or_Virtual_String; + Value : out Parameter_Type) + is + use type VSS.Strings.Virtual_String; + + package PN renames Notification_Propery_Names; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while Handler.Is_Key_Name loop + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + + case PN.Get_Index (Key) is + when 1 => -- jsonrpc + pragma Assert (Handler.Is_String_Value and then + Handler.String_Value = "2.0"); + Handler.Read_Next; + when 2 => -- method + pragma Assert (Handler.Is_String_Value and then + Handler.String_Value = Method); + Handler.Read_Next; + when 3 => -- params + Read_Parameter (Handler, Value); + when 4 => -- id + LSP.Inputs.Read_Integer_Or_Virtual_String (Handler, Id); + when others => + -- ignore anything else? + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_Request; + + ------------------- + -- Read_Response -- + ------------------- + + procedure Read_Response + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Id : out LSP.Structures.Integer_Or_Virtual_String; + Value : out Result_Type) + is + use type VSS.Strings.Virtual_String; + + package PN renames Notification_Propery_Names; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while Handler.Is_Key_Name loop + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + + case PN.Get_Index (Key) is + when 1 => -- jsonrpc + pragma Assert (Handler.Is_String_Value and then + Handler.String_Value = "2.0"); + Handler.Read_Next; + when 4 => -- id + LSP.Inputs.Read_Integer_Or_Virtual_String (Handler, Id); + when 5 => -- result + Read_Result (Handler, Value); + when others => + -- ignore anything else? + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_Response; + +end LSP.Input_Tools; diff --git a/source/lsp_3.17/lsp-input_tools.ads b/source/lsp_3.17/lsp-input_tools.ads new file mode 100644 index 000000000..31172f388 --- /dev/null +++ b/source/lsp_3.17/lsp-input_tools.ads @@ -0,0 +1,82 @@ +-- +-- Copyright (C) 2022-2023, AdaCore +-- +-- SPDX-License-Identifier: Apache-2.0 +-- + +with VSS.JSON.Pull_Readers; +with VSS.Strings; + +with LSP.Structures; + +package LSP.Input_Tools is + + procedure Read_LSPAny + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.LSPAny); + + procedure Read_LSPAny_Class + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.JSON_Event_Vectors.Vector'Class); + + procedure Look_For_MarkupContent_Or_MarkedString_Vector + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.MarkupContent_Or_MarkedString_Vector); + + generic + type Parameter_Type is private; + + Method : VSS.Strings.Virtual_String; + + with procedure Read_Parameter + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out Parameter_Type); + + procedure Read_Notification + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out Parameter_Type); + + generic + type Parameter_Type is private; + + Method : VSS.Strings.Virtual_String; + + with procedure Read_Parameter + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out Parameter_Type); + + procedure Read_Request + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Id : out LSP.Structures.Integer_Or_Virtual_String; + Value : out Parameter_Type); + + procedure Read_Null_Request + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Method : VSS.Strings.Virtual_String; + Id : out LSP.Structures.Integer_Or_Virtual_String); + + generic + type Result_Type is private; + + with procedure Read_Result + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out Result_Type); + + procedure Read_Response + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Id : out LSP.Structures.Integer_Or_Virtual_String; + Value : out Result_Type); + + generic + type Result_Type is private; + + with procedure Read_Progress_Report + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out Result_Type); + + procedure Read_Progress_Report + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Token : out LSP.Structures.Integer_Or_Virtual_String; + Value : out Result_Type); + +end LSP.Input_Tools; diff --git a/source/lsp_3.17/lsp-output_tools.adb b/source/lsp_3.17/lsp-output_tools.adb new file mode 100644 index 000000000..f66c57feb --- /dev/null +++ b/source/lsp_3.17/lsp-output_tools.adb @@ -0,0 +1,119 @@ +-- +-- Copyright (C) 2022-2023, AdaCore +-- +-- SPDX-License-Identifier: Apache-2.0 +-- + +with VSS.JSON.Streams; + +with LSP.Outputs; + +package body LSP.Output_Tools is + + ------------------ + -- Write_LSPAny -- + ------------------ + + procedure Write_LSPAny + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.LSPAny) is + begin + for Item of Value loop + case Item.Kind is + when VSS.JSON.Streams.None + | VSS.JSON.Streams.Invalid + | VSS.JSON.Streams.Start_Document + | VSS.JSON.Streams.End_Document + | VSS.JSON.Streams.Comment => + raise Program_Error; + when VSS.JSON.Streams.Start_Array => + Handler.Start_Array; + when VSS.JSON.Streams.End_Array => + Handler.End_Array; + when VSS.JSON.Streams.Start_Object => + Handler.Start_Object; + when VSS.JSON.Streams.End_Object => + Handler.End_Object; + when VSS.JSON.Streams.Key_Name => + Handler.Key_Name (Item.Key_Name); + when VSS.JSON.Streams.String_Value => + Handler.String_Value (Item.String_Value); + when VSS.JSON.Streams.Number_Value => + Handler.Number_Value (Item.Number_Value); + when VSS.JSON.Streams.Boolean_Value => + Handler.Boolean_Value (Item.Boolean_Value); + when VSS.JSON.Streams.Null_Value => + Handler.Null_Value; + end case; + end loop; + end Write_LSPAny; + + ------------------------------ + -- Write_Start_Notification -- + ------------------------------ + + procedure Write_Start_Notification + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Method : VSS.Strings.Virtual_String) is + begin + Handler.Start_Object; + Handler.Key_Name ("jsonrpc"); + Handler.String_Value ("2.0"); + Handler.Key_Name ("method"); + Handler.String_Value (Method); + end Write_Start_Notification; + + -------------------------------- + -- Write_Start_Progress_Report -- + -------------------------------- + + procedure Write_Start_Progress_Report + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Token : LSP.Structures.Integer_Or_Virtual_String) is + begin + Handler.Start_Object; + Handler.Key_Name ("jsonrpc"); + Handler.String_Value ("2.0"); + Handler.Key_Name ("method"); + Handler.String_Value ("$/progress"); + Handler.Key_Name ("params"); + Handler.Start_Object; + Handler.Key_Name ("token"); + LSP.Outputs.Write_Integer_Or_Virtual_String (Handler, Token); + Handler.Key_Name ("value"); + end Write_Start_Progress_Report; + + ------------------------- + -- Write_Start_Request -- + ------------------------- + + procedure Write_Start_Request + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Method : VSS.Strings.Virtual_String; + Id : LSP.Structures.Integer_Or_Virtual_String) is + begin + Handler.Start_Object; + Handler.Key_Name ("jsonrpc"); + Handler.String_Value ("2.0"); + Handler.Key_Name ("id"); + LSP.Outputs.Write_Integer_Or_Virtual_String (Handler, Id); + Handler.Key_Name ("method"); + Handler.String_Value (Method); + end Write_Start_Request; + + -------------------------- + -- Write_Start_Response -- + -------------------------- + + procedure Write_Start_Response + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Id : LSP.Structures.Integer_Or_Virtual_String) is + begin + Handler.Start_Object; + Handler.Key_Name ("jsonrpc"); + Handler.String_Value ("2.0"); + Handler.Key_Name ("id"); + LSP.Outputs.Write_Integer_Or_Virtual_String (Handler, Id); + end Write_Start_Response; + +end LSP.Output_Tools; diff --git a/source/lsp_3.17/lsp-output_tools.ads b/source/lsp_3.17/lsp-output_tools.ads new file mode 100644 index 000000000..124eb84a9 --- /dev/null +++ b/source/lsp_3.17/lsp-output_tools.ads @@ -0,0 +1,36 @@ +-- +-- Copyright (C) 2022-2023, AdaCore +-- +-- SPDX-License-Identifier: Apache-2.0 +-- + +with VSS.JSON.Content_Handlers; +with VSS.Strings; + +with LSP.Structures; + +package LSP.Output_Tools is + pragma Preelaborate; + + procedure Write_LSPAny + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.LSPAny); + + procedure Write_Start_Notification + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Method : VSS.Strings.Virtual_String); + + procedure Write_Start_Request + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Method : VSS.Strings.Virtual_String; + Id : LSP.Structures.Integer_Or_Virtual_String); + + procedure Write_Start_Response + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Id : LSP.Structures.Integer_Or_Virtual_String); + + procedure Write_Start_Progress_Report + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Token : LSP.Structures.Integer_Or_Virtual_String); + +end LSP.Output_Tools; diff --git a/source/lsp_3.17/lsp-progress_report_readers.ads b/source/lsp_3.17/lsp-progress_report_readers.ads new file mode 100644 index 000000000..532c611fc --- /dev/null +++ b/source/lsp_3.17/lsp-progress_report_readers.ads @@ -0,0 +1,21 @@ +-- +-- Copyright (C) 2022-2023, AdaCore +-- +-- SPDX-License-Identifier: Apache-2.0 +-- + +with VSS.JSON.Pull_Readers; +with VSS.Strings; + +with LSP.Progress_Reports; + +package LSP.Progress_Report_Readers is + + procedure Initialize; + + function Read_Progress_Report + (Input : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Method : VSS.Strings.Virtual_String) + return LSP.Progress_Reports.Progress_Report'Class; + +end LSP.Progress_Report_Readers; diff --git a/source/lsp_3.17/lsp-progress_reports.adb b/source/lsp_3.17/lsp-progress_reports.adb new file mode 100644 index 000000000..c1f8cd636 --- /dev/null +++ b/source/lsp_3.17/lsp-progress_reports.adb @@ -0,0 +1,21 @@ +-- +-- Copyright (C) 2022-2023, AdaCore +-- +-- SPDX-License-Identifier: Apache-2.0 +-- + +package body LSP.Progress_Reports is + + ---------------------------------- + -- Visit_Client_Message_Visitor -- + ---------------------------------- + + overriding procedure Visit_Client_Message_Visitor + (Self : Progress_Report; + Visitor : in out LSP.Client_Message_Visitors.Client_Message_Visitor' + Class) is + begin + Visitor.On_Progress_Report (Self); + end Visit_Client_Message_Visitor; + +end LSP.Progress_Reports; diff --git a/source/lsp_3.17/lsp-progress_reports.ads b/source/lsp_3.17/lsp-progress_reports.ads new file mode 100644 index 000000000..3a25ac3f6 --- /dev/null +++ b/source/lsp_3.17/lsp-progress_reports.ads @@ -0,0 +1,30 @@ +-- +-- Copyright (C) 2022-2023, AdaCore +-- +-- SPDX-License-Identifier: Apache-2.0 +-- + +with LSP.Client_Message_Visitors; +with LSP.Client_Messages; +with LSP.Progress_Report_Receivers; +with LSP.Structures; + +package LSP.Progress_Reports is + pragma Preelaborate; + + type Progress_Report is abstract limited + new LSP.Client_Messages.Client_Message with record + Token : LSP.Structures.Integer_Or_Virtual_String; + end record; + + procedure Visit_Receiver + (Self : Progress_Report; + Value : in out LSP.Progress_Report_Receivers + .Progress_Report_Receiver'Class) is abstract; + + overriding procedure Visit_Client_Message_Visitor + (Self : Progress_Report; + Visitor : in out LSP.Client_Message_Visitors + .Client_Message_Visitor'Class); + +end LSP.Progress_Reports; diff --git a/source/lsp_3.17/lsp-server_message_visitors.ads b/source/lsp_3.17/lsp-server_message_visitors.ads new file mode 100644 index 000000000..432a997f8 --- /dev/null +++ b/source/lsp_3.17/lsp-server_message_visitors.ads @@ -0,0 +1,29 @@ +-- +-- Copyright (C) 2022-2023, AdaCore +-- +-- SPDX-License-Identifier: Apache-2.0 +-- + +limited with LSP.Server_Notifications; +limited with LSP.Server_Requests; +limited with LSP.Server_Responses; + +package LSP.Server_Message_Visitors is + pragma Preelaborate; + + type Server_Message_Visitor is limited interface; + -- Interface to visit messages send by a client to a server + + procedure On_Server_Notification + (Self : in out Server_Message_Visitor; + Value : LSP.Server_Notifications.Server_Notification'Class) is null; + + procedure On_Server_Request + (Self : in out Server_Message_Visitor; + Value : LSP.Server_Requests.Server_Request'Class) is null; + + procedure On_Server_Response + (Self : in out Server_Message_Visitor; + Value : LSP.Server_Responses.Server_Response'Class) is null; + +end LSP.Server_Message_Visitors; diff --git a/source/lsp_3.17/lsp-server_messages.ads b/source/lsp_3.17/lsp-server_messages.ads new file mode 100644 index 000000000..bc3b61593 --- /dev/null +++ b/source/lsp_3.17/lsp-server_messages.ads @@ -0,0 +1,26 @@ +-- +-- Copyright (C) 2022-2023, AdaCore +-- +-- SPDX-License-Identifier: Apache-2.0 +-- + +with LSP.Server_Message_Visitors; + +package LSP.Server_Messages is + pragma Preelaborate; + + type Server_Message is abstract tagged limited null record; + -- Base class of messages send by a client to a server + + function Assigned (Self : access Server_Message'Class) return Boolean + is (Self /= null); + -- Check if the argument is not null + + type Server_Message_Access is access all Server_Message'Class; + + procedure Visit_Server_Message_Visitor + (Self : Server_Message; + Value : in out LSP.Server_Message_Visitors + .Server_Message_Visitor'Class) is null; + +end LSP.Server_Messages; diff --git a/source/lsp_3.17/lsp-server_notification_readers.ads b/source/lsp_3.17/lsp-server_notification_readers.ads new file mode 100644 index 000000000..810cc8c49 --- /dev/null +++ b/source/lsp_3.17/lsp-server_notification_readers.ads @@ -0,0 +1,20 @@ +-- +-- Copyright (C) 2022-2023, AdaCore +-- +-- SPDX-License-Identifier: Apache-2.0 +-- + +with VSS.JSON.Pull_Readers; +with VSS.Strings; +with LSP.Server_Notifications; + +package LSP.Server_Notification_Readers is + + function Read_Notification + (Input : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Method : VSS.Strings.Virtual_String) + return LSP.Server_Notifications.Server_Notification'Class; + + procedure Initialize; + +end LSP.Server_Notification_Readers; diff --git a/source/lsp_3.17/lsp-server_notifications.adb b/source/lsp_3.17/lsp-server_notifications.adb new file mode 100644 index 000000000..9bfd5f247 --- /dev/null +++ b/source/lsp_3.17/lsp-server_notifications.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) 2022-2023, AdaCore +-- +-- SPDX-License-Identifier: Apache-2.0 +-- + +package body LSP.Server_Notifications is + + overriding procedure Visit_Server_Message_Visitor + (Self : Server_Notification; + Visitor : in out LSP.Server_Message_Visitors + .Server_Message_Visitor'Class) is + begin + Visitor.On_Server_Notification (Self); + end Visit_Server_Message_Visitor; + +end LSP.Server_Notifications; diff --git a/source/lsp_3.17/lsp-server_notifications.ads b/source/lsp_3.17/lsp-server_notifications.ads new file mode 100644 index 000000000..93bd6699b --- /dev/null +++ b/source/lsp_3.17/lsp-server_notifications.ads @@ -0,0 +1,28 @@ +-- +-- Copyright (C) 2022-2023, AdaCore +-- +-- SPDX-License-Identifier: Apache-2.0 +-- + +with LSP.Server_Message_Visitors; +with LSP.Server_Messages; +with LSP.Server_Notification_Receivers; + +package LSP.Server_Notifications is + pragma Preelaborate; + + type Server_Notification is abstract limited + new LSP.Server_Messages.Server_Message with null record; + + procedure Visit_Server_Receiver + (Self : Server_Notification; + Value : in out LSP.Server_Notification_Receivers + .Server_Notification_Receiver'Class) + is abstract; + + overriding procedure Visit_Server_Message_Visitor + (Self : Server_Notification; + Visitor : in out LSP.Server_Message_Visitors + .Server_Message_Visitor'Class); + +end LSP.Server_Notifications; diff --git a/source/lsp_3.17/lsp-server_request_readers.ads b/source/lsp_3.17/lsp-server_request_readers.ads new file mode 100644 index 000000000..9fcc33e02 --- /dev/null +++ b/source/lsp_3.17/lsp-server_request_readers.ads @@ -0,0 +1,20 @@ +-- +-- Copyright (C) 2022-2023, AdaCore +-- +-- SPDX-License-Identifier: Apache-2.0 +-- + +with LSP.Server_Requests; +with VSS.JSON.Pull_Readers; +with VSS.Strings; + +package LSP.Server_Request_Readers is + + procedure Initialize; + + function Read_Request + (Input : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Method : VSS.Strings.Virtual_String) + return LSP.Server_Requests.Server_Request'Class; + +end LSP.Server_Request_Readers; diff --git a/source/lsp_3.17/lsp-server_requests.adb b/source/lsp_3.17/lsp-server_requests.adb new file mode 100644 index 000000000..ccd0c7105 --- /dev/null +++ b/source/lsp_3.17/lsp-server_requests.adb @@ -0,0 +1,17 @@ +-- +-- Copyright (C) 2022-2023, AdaCore +-- +-- SPDX-License-Identifier: Apache-2.0 +-- + +package body LSP.Server_Requests is + + overriding procedure Visit_Server_Message_Visitor + (Self : Server_Request; + Visitor : in out LSP.Server_Message_Visitors + .Server_Message_Visitor'Class) is + begin + Visitor.On_Server_Request (Self); + end Visit_Server_Message_Visitor; + +end LSP.Server_Requests; diff --git a/source/lsp_3.17/lsp-server_requests.ads b/source/lsp_3.17/lsp-server_requests.ads new file mode 100644 index 000000000..124a08d34 --- /dev/null +++ b/source/lsp_3.17/lsp-server_requests.ads @@ -0,0 +1,37 @@ +-- +-- Copyright (C) 2022-2023, AdaCore +-- +-- SPDX-License-Identifier: Apache-2.0 +-- + +with LSP.Server_Message_Visitors; +with LSP.Server_Messages; +with LSP.Server_Request_Receivers; +with LSP.Structures; + +package LSP.Server_Requests is + pragma Preelaborate; + + type Server_Request is + abstract limited new LSP.Server_Messages.Server_Message with + record + Id : LSP.Structures.Integer_Or_Virtual_String; + + Canceled : Boolean := False + with Atomic; + -- The cancelation flag set by the input task and read by processing + -- task + end record; + + procedure Visit_Server_Receiver + (Self : Server_Request; + Value : in out LSP.Server_Request_Receivers + .Server_Request_Receiver'Class) + is abstract; + + overriding procedure Visit_Server_Message_Visitor + (Self : Server_Request; + Visitor : in out LSP.Server_Message_Visitors + .Server_Message_Visitor'Class); + +end LSP.Server_Requests; diff --git a/source/lsp_3.17/lsp-server_response_readers.ads b/source/lsp_3.17/lsp-server_response_readers.ads new file mode 100644 index 000000000..317edc2c0 --- /dev/null +++ b/source/lsp_3.17/lsp-server_response_readers.ads @@ -0,0 +1,20 @@ +-- +-- Copyright (C) 2022-2023, AdaCore +-- +-- SPDX-License-Identifier: Apache-2.0 +-- + +with VSS.JSON.Pull_Readers; +with VSS.Strings; +with LSP.Server_Responses; + +package LSP.Server_Response_Readers is + + procedure Initialize; + + function Read_Response + (Input : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Method : VSS.Strings.Virtual_String) + return LSP.Server_Responses.Server_Response'Class; + +end LSP.Server_Response_Readers; diff --git a/source/lsp_3.17/lsp-server_responses.adb b/source/lsp_3.17/lsp-server_responses.adb new file mode 100644 index 000000000..0e38d9a3c --- /dev/null +++ b/source/lsp_3.17/lsp-server_responses.adb @@ -0,0 +1,25 @@ +-- +-- Copyright (C) 2022-2023, AdaCore +-- +-- SPDX-License-Identifier: Apache-2.0 +-- + +package body LSP.Server_Responses is + + overriding procedure Visit_Server_Message_Visitor + (Self : Server_Response; + Visitor : in out LSP.Server_Message_Visitors + .Server_Message_Visitor'Class) is + begin + Visitor.On_Server_Response (Self); + end Visit_Server_Message_Visitor; + + overriding procedure Visit_Server_Receiver + (Self : Server_Error_Response; + Visitor : in out LSP.Server_Response_Receivers + .Server_Response_Receiver'Class) is + begin + Visitor.On_Error_Response (Self.Id, Self.Error); + end Visit_Server_Receiver; + +end LSP.Server_Responses; diff --git a/source/lsp_3.17/lsp-server_responses.ads b/source/lsp_3.17/lsp-server_responses.ads new file mode 100644 index 000000000..20cf722a8 --- /dev/null +++ b/source/lsp_3.17/lsp-server_responses.ads @@ -0,0 +1,43 @@ +-- +-- Copyright (C) 2022-2023, AdaCore +-- +-- SPDX-License-Identifier: Apache-2.0 +-- + +with LSP.Errors; +with LSP.Server_Message_Visitors; +with LSP.Server_Messages; +with LSP.Server_Response_Receivers; +with LSP.Structures; + +package LSP.Server_Responses is + pragma Preelaborate; + + type Server_Response is + abstract limited new LSP.Server_Messages.Server_Message with + record + Id : LSP.Structures.Integer_Or_Virtual_String; + end record; + + procedure Visit_Server_Receiver + (Self : Server_Response; + Value : in out LSP.Server_Response_Receivers + .Server_Response_Receiver'Class) + is abstract; + + overriding procedure Visit_Server_Message_Visitor + (Self : Server_Response; + Visitor : in out LSP.Server_Message_Visitors + .Server_Message_Visitor'Class); + + type Server_Error_Response is new Server_Response with record + Error : LSP.Errors.ResponseError; + -- The error object in case a request fails. + end record; + + overriding procedure Visit_Server_Receiver + (Self : Server_Error_Response; + Visitor : in out LSP.Server_Response_Receivers + .Server_Response_Receiver'Class); + +end LSP.Server_Responses; diff --git a/source/lsp_3.17/lsp-structures.adb b/source/lsp_3.17/lsp-structures.adb new file mode 100644 index 000000000..37936770f --- /dev/null +++ b/source/lsp_3.17/lsp-structures.adb @@ -0,0 +1,238 @@ +-- +-- Copyright (C) 2022-2023, AdaCore +-- +-- SPDX-License-Identifier: Apache-2.0 +-- + +with Ada.Unchecked_Deallocation; + +package body LSP.Structures is + + procedure Free is new Ada.Unchecked_Deallocation + (DocumentSymbol_Array, DocumentSymbol_Array_Access); + + procedure Free is new Ada.Unchecked_Deallocation + (SelectionRange_Array, SelectionRange_Array_Access); + + procedure Free is new Ada.Unchecked_Deallocation + (SelectionRange, SelectionRange_Access); + + ------------ + -- Adjust -- + ------------ + + overriding procedure Adjust (Self : in out DocumentSymbol_Vector) is + begin + if Self.Data /= null then + Self.Data := new DocumentSymbol_Array'(Self.Data.all); + end if; + end Adjust; + + ------------ + -- Adjust -- + ------------ + + overriding procedure Adjust (Self : in out SelectionRange_Optional) is + begin + if Self.Value /= null then + Self.Value := new SelectionRange'(Self.Value.all); + end if; + end Adjust; + + ------------ + -- Adjust -- + ------------ + + overriding procedure Adjust (Self : in out SelectionRange_Vector) is + begin + if Self.Data /= null then + Self.Data := new SelectionRange_Array'(Self.Data.all); + end if; + end Adjust; + + ------------ + -- Append -- + ------------ + + procedure Append + (Self : in out DocumentSymbol_Vector; + Value : DocumentSymbol) + is + Old : DocumentSymbol_Array_Access := Self.Data; + begin + if Old = null then + Self.Data := new DocumentSymbol_Array'(1 => Value); + else + Self.Data := new DocumentSymbol_Array'(Old.all & Value); + Free (Old); + end if; + end Append; + + ------------ + -- Append -- + ------------ + + procedure Append + (Self : in out SelectionRange_Vector; + Value : SelectionRange) + is + Old : SelectionRange_Array_Access := Self.Data; + begin + if Old = null then + Self.Data := new SelectionRange_Array'(1 => Value); + else + Self.Data := new SelectionRange_Array'(Old.all & Value); + Free (Old); + end if; + end Append; + + ----------- + -- Clear -- + ----------- + + procedure Clear (Self : in out DocumentSymbol_Vector) is + begin + Free (Self.Data); + end Clear; + + ----------- + -- Clear -- + ----------- + + procedure Clear (Self : in out SelectionRange_Optional) is + begin + Free (Self.Value); + end Clear; + + ----------- + -- Clear -- + ----------- + + procedure Clear (Self : in out SelectionRange_Vector) is + begin + Free (Self.Data); + end Clear; + + -------------- + -- Finalize -- + -------------- + + overriding procedure Finalize (Self : in out DocumentSymbol_Vector) is + begin + Free (Self.Data); + end Finalize; + + -------------- + -- Finalize -- + -------------- + + overriding procedure Finalize (Self : in out SelectionRange_Vector) is + begin + Free (Self.Data); + end Finalize; + + -------------- + -- Finalize -- + -------------- + + overriding procedure Finalize (Self : in out SelectionRange_Optional) is + begin + Free (Self.Value); + end Finalize; + + ------------------------------------------- + -- Get_DocumentSymbol_Constant_Reference -- + ------------------------------------------- + + function Get_DocumentSymbol_Constant_Reference + (Self : aliased DocumentSymbol_Vector; Index : Positive) + return DocumentSymbol_Constant_Reference is + begin + return (Element => Self.Data (Index)'Access); + end Get_DocumentSymbol_Constant_Reference; + + ------------------------------------------- + -- Get_DocumentSymbol_Variable_Reference -- + ------------------------------------------- + + function Get_DocumentSymbol_Variable_Reference + (Self : aliased in out DocumentSymbol_Vector; Index : Positive) + return DocumentSymbol_Variable_Reference is + begin + return (Element => Self.Data (Index)'Access); + end Get_DocumentSymbol_Variable_Reference; + + ------------------------------------------- + -- Get_SelectionRange_Constant_Reference -- + ------------------------------------------- + + function Get_SelectionRange_Constant_Reference + (Self : aliased SelectionRange_Vector; Index : Positive) + return SelectionRange_Constant_Reference is + begin + return (Element => Self.Data (Index)'Access); + end Get_SelectionRange_Constant_Reference; + + ------------------------------------------- + -- Get_SelectionRange_Variable_Reference -- + ------------------------------------------- + + function Get_SelectionRange_Variable_Reference + (Self : aliased in out SelectionRange_Vector; Index : Positive) + return SelectionRange_Variable_Reference is + begin + return (Element => Self.Data (Index)'Access); + end Get_SelectionRange_Variable_Reference; + + ------------ + -- Is_Set -- + ------------ + + function Is_Set (Self : SelectionRange_Optional) return Boolean is + begin + return Self.Value /= null; + end Is_Set; + + ------------ + -- Length -- + ------------ + + function Length (Self : DocumentSymbol_Vector) return Natural is + begin + return (if Self.Data = null then 0 else Self.Data'Length); + end Length; + + ------------ + -- Length -- + ------------ + + function Length (Self : SelectionRange_Vector) return Natural is + begin + return (if Self.Data = null then 0 else Self.Data'Length); + end Length; + + --------- + -- Set -- + --------- + + procedure Set + (Self : in out SelectionRange_Optional; + Value : SelectionRange) is + begin + if Self.Value = null then + Self.Value := new SelectionRange'(Value); + else + Self.Value.all := Value; + end if; + end Set; + + ----------- + -- Value -- + ----------- + + function Value (Self : SelectionRange_Optional) return SelectionRange is + begin + return Self.Value.all; + end Value; + +end LSP.Structures; diff --git a/source/lsp_3.17/lsp.ads b/source/lsp_3.17/lsp.ads new file mode 100644 index 000000000..b90e408d8 --- /dev/null +++ b/source/lsp_3.17/lsp.ads @@ -0,0 +1,10 @@ +-- +-- Copyright (C) 2022-2023, AdaCore +-- +-- SPDX-License-Identifier: Apache-2.0 +-- + +package LSP is + pragma Pure; + +end LSP; diff --git a/source/lsp_3.17/minimal_perfect_hash.adb b/source/lsp_3.17/minimal_perfect_hash.adb new file mode 100644 index 000000000..400af5e3e --- /dev/null +++ b/source/lsp_3.17/minimal_perfect_hash.adb @@ -0,0 +1,53 @@ +-- +-- Copyright (C) 2022-2023, AdaCore +-- +-- SPDX-License-Identifier: Apache-2.0 +-- + +with Ada.Containers.Hashed_Maps; + +with VSS.Strings.Hash; + +package body Minimal_Perfect_Hash is + + package String_Maps is new Ada.Containers.Hashed_Maps + (VSS.Strings.Virtual_String, + Positive, + VSS.Strings.Hash, + VSS.Strings."="); + + Map : String_Maps.Map; + + --------------- + -- Get_Index -- + --------------- + + function Get_Index (Text : VSS.Strings.Virtual_String) return Natural is + Cursor : String_Maps.Cursor; + begin + if Map.Is_Empty then + Initialize; + end if; + + Cursor := Map.Find (Text); + + if String_Maps.Has_Element (Cursor) then + return String_Maps.Element (Cursor); + else + return 0; + end if; + end Get_Index; + + ---------------- + -- Initialize -- + ---------------- + + procedure Initialize (Seed : Natural := 0) is + pragma Unreferenced (Seed); + begin + for J in 1 .. Variants.Length loop + Map.Insert (Variants (J), J); + end loop; + end Initialize; + +end Minimal_Perfect_Hash; diff --git a/source/lsp_3.17/minimal_perfect_hash.ads b/source/lsp_3.17/minimal_perfect_hash.ads new file mode 100644 index 000000000..d7fd92620 --- /dev/null +++ b/source/lsp_3.17/minimal_perfect_hash.ads @@ -0,0 +1,23 @@ +-- +-- Copyright (C) 2022-2023, AdaCore +-- +-- SPDX-License-Identifier: Apache-2.0 +-- + +with VSS.String_Vectors; +with VSS.Strings; + +generic + Variants : VSS.String_Vectors.Virtual_String_Vector; + +package Minimal_Perfect_Hash is + -- pragma Preelaborate; + + function Get_Index (Text : VSS.Strings.Virtual_String) return Natural; + -- Return index of Text in Variants or zero if Variants doesn't containt + -- Text. + + procedure Initialize (Seed : Natural := 0); + -- Performe internal initialization. + +end Minimal_Perfect_Hash; From 0cbbc9af1f0eec27aa3a1459ed438cdf16b58c33 Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Tue, 8 Aug 2023 11:28:10 +0300 Subject: [PATCH 004/152] Rewrite LSP.Servers to LSP 3.17 with minimal code Rewrite LSP.Ada_Handlers to return unimplemented on each request. Refs #1170 Depends-On: eng/ide/VSS!278 --- gnat/ignore_in_317.txt | 119 + gnat/lsp_server.gpr | 17 +- source/ada/lsp-ada_driver.adb | 204 +- source/ada/lsp-ada_handlers.adb | 7158 +---------------- source/ada/lsp-ada_handlers.ads | 745 +- .../lsp_3.17/lsp-client_message_writers.adb | 42 + .../lsp_3.17/lsp-client_message_writers.ads | 46 + source/server/lsp-servers.adb | 937 +-- source/server/lsp-servers.ads | 181 +- 9 files changed, 514 insertions(+), 8935 deletions(-) create mode 100644 gnat/ignore_in_317.txt create mode 100644 source/lsp_3.17/lsp-client_message_writers.adb create mode 100644 source/lsp_3.17/lsp-client_message_writers.ads diff --git a/gnat/ignore_in_317.txt b/gnat/ignore_in_317.txt new file mode 100644 index 000000000..2d86100b7 --- /dev/null +++ b/gnat/ignore_in_317.txt @@ -0,0 +1,119 @@ +lsp-ada_completions.adb +lsp-ada_completions.ads +lsp-ada_completions-aspects.adb +lsp-ada_completions-aspects.ads +lsp-ada_completions-attributes.adb +lsp-ada_completions-attributes.ads +lsp-ada_completions-end_names.adb +lsp-ada_completions-end_names.ads +lsp-ada_completions-filters.adb +lsp-ada_completions-filters.ads +lsp-ada_completions-generic_assoc.adb +lsp-ada_completions-generic_assoc.ads +lsp-ada_completions-generic_assoc_utils.ads +lsp-ada_completions-keywords.adb +lsp-ada_completions-keywords.ads +lsp-ada_completions-names.adb +lsp-ada_completions-names.ads +lsp-ada_completions-parameters.adb +lsp-ada_completions-parameters.ads +lsp-ada_completions-pragmas.adb +lsp-ada_completions-pragmas.ads +lsp-ada_completions-use_clauses.adb +lsp-ada_completions-use_clauses.ads +lsp-ada_contexts.adb +lsp-ada_contexts.ads +lsp-ada_context_sets.adb +lsp-ada_context_sets.ads +lsp-ada_documentation.adb +lsp-ada_documentation.ads +lsp-ada_documents.adb +lsp-ada_documents.ads +lsp-ada_documents-lal_diagnostics.adb +lsp-ada_documents-lal_diagnostics.ads +lsp-ada_file_sets.adb +lsp-ada_file_sets.ads +lsp-ada_handlers-alire.adb +lsp-ada_handlers-alire.ads +lsp-ada_handlers-file_readers.adb +lsp-ada_handlers-file_readers.ads +lsp-ada_handlers-invisibles.adb +lsp-ada_handlers-invisibles.ads +lsp-ada_handlers-named_parameters_commands.adb +lsp-ada_handlers-named_parameters_commands.ads +lsp-ada_handlers-other_file_commands.adb +lsp-ada_handlers-other_file_commands.ads +lsp-ada_handlers-project_diagnostics.adb +lsp-ada_handlers-project_diagnostics.ads +lsp-ada_handlers-project_reload_commands.adb +lsp-ada_handlers-project_reload_commands.ads +lsp-ada_handlers-refactor-add_parameter.adb +lsp-ada_handlers-refactor-add_parameter.ads +lsp-ada_handlers-refactor-change_parameter_mode.adb +lsp-ada_handlers-refactor-change_parameter_mode.ads +lsp-ada_handlers-refactor-change_parameters_default_value.adb +lsp-ada_handlers-refactor-change_parameters_default_value.ads +lsp-ada_handlers-refactor-change_parameters_type.adb +lsp-ada_handlers-refactor-change_parameters_type.ads +lsp-ada_handlers-refactor-extract_subprogram.adb +lsp-ada_handlers-refactor-extract_subprogram.ads +lsp-ada_handlers-refactor-imports_commands.adb +lsp-ada_handlers-refactor-imports_commands.ads +lsp-ada_handlers-refactor-introduce_parameter.adb +lsp-ada_handlers-refactor-introduce_parameter.ads +lsp-ada_handlers-refactor-move_parameter.adb +lsp-ada_handlers-refactor-move_parameter.ads +lsp-ada_handlers-refactor-pull_up_declaration.adb +lsp-ada_handlers-refactor-pull_up_declaration.ads +lsp-ada_handlers-refactor-remove_parameter.adb +lsp-ada_handlers-refactor-remove_parameter.ads +lsp-ada_handlers-refactor-replace_type.adb +lsp-ada_handlers-refactor-replace_type.ads +lsp-ada_handlers-refactor-sort_dependencies.adb +lsp-ada_handlers-refactor-sort_dependencies.ads +lsp-ada_handlers-refactor-suppress_seperate.adb +lsp-ada_handlers-refactor-suppress_seperate.ads +lsp-ada_highlighters.adb +lsp-ada_highlighters.ads +lsp-ada_id_iterators.adb +lsp-ada_id_iterators.ads +lsp-client_side_file_monitors.adb +lsp-client_side_file_monitors.ads +lsp-common.adb +lsp-common.ads +lsp-diagnostic_sources.ads +lsp-error_decorators.adb +lsp-error_decorators.ads +lsp-fuzz_decorators.adb +lsp-fuzz_decorators.ads +lsp-lal_utils.adb +lsp-lal_utils.ads +lsp-predefined_completion.adb +lsp-predefined_completion.ads +lsp-search.adb +lsp-search.ads +lsp-search-approximate.adb +lsp-search-approximate.ads +lsp-search-empty.adb +lsp-search-empty.ads +lsp-search-full_text.adb +lsp-search-full_text.ads +lsp-search-fuzzy.adb +lsp-search-fuzzy.ads +lsp-search-regexp.adb +lsp-search-regexp.ads +lsp-search-start_word_text.adb +lsp-search-start_word_text.ads +lsp-file_monitors.ads +lsp-generic_cancel_check.adb +lsp-generic_cancel_check.ads +lsp-message_loggers.adb +lsp-message_loggers.ads +lsp-server_backends.ads +lsp-servers-decode_notification.adb +lsp-servers-decode_notification.ads +lsp-servers-decode_request.adb +lsp-servers-decode_request.ads +lsp-servers-fs_watch.adb +lsp-servers-fs_watch.ads +lsp-servers-handle_request.ads diff --git a/gnat/lsp_server.gpr b/gnat/lsp_server.gpr index 80ee9c35c..bcd26de86 100644 --- a/gnat/lsp_server.gpr +++ b/gnat/lsp_server.gpr @@ -23,7 +23,7 @@ with "ada_libfswatch.gpr"; with "libgnatdoc.gpr"; with "spawn.gpr"; -with "lsp"; +with "lsp_3_17"; project LSP_Server is @@ -46,14 +46,23 @@ project LSP_Server is "../source/ada/generated", "../source/memory"); + for Excluded_Source_Dirs use + ("../source/server/generated", + "../source/gpr", + "../source/ada/generated"); + + for Excluded_Source_List_File use "ignore_in_317.txt"; + for Object_Dir use "../.obj/server"; for Main use ("lsp-ada_driver.adb"); package Compiler is - for Default_Switches ("Ada") use LSP.Compiler'Default_Switches ("Ada"); + for Default_Switches ("Ada") use + LSP_3_17.Compiler'Default_Switches ("Ada"); for Switches ("lsp-ada_driver.adb") use - LSP.Compiler'Default_Switches ("Ada") & - ("-gnateDVERSION=""" & VERSION & """", "-gnateDBUILD_DATE=""" & BUILD_DATE & """"); + LSP_3_17.Compiler'Default_Switches ("Ada") + & ("-gnateDVERSION=""" & VERSION & """", + "-gnateDBUILD_DATE=""" & BUILD_DATE & """"); for Switches ("s-memory.adb") use ("-g", "-O2", "-gnatpg"); for Local_Configuration_Pragmas use "gnat.adc"; end Compiler; diff --git a/source/ada/lsp-ada_driver.adb b/source/ada/lsp-ada_driver.adb index 213c35c95..3324fc83c 100644 --- a/source/ada/lsp-ada_driver.adb +++ b/source/ada/lsp-ada_driver.adb @@ -17,11 +17,8 @@ -- -- This is driver to run LSP server for Ada language. -with Ada.Characters.Latin_1; with Ada.Text_IO; -with Ada.Exceptions; use Ada.Exceptions; with Ada.Strings.Unbounded; -with GNAT.Traceback.Symbolic; use GNAT.Traceback.Symbolic; with GNAT.OS_Lib; with GNAT.Strings; @@ -41,28 +38,7 @@ with GNATCOLL.VFS; use GNATCOLL.VFS; with GNATCOLL.Utils; with LSP.Ada_Handlers; -with LSP.Ada_Handlers.Named_Parameters_Commands; -with LSP.Ada_Handlers.Other_File_Commands; -with LSP.Ada_Handlers.Project_Reload_Commands; -with LSP.Ada_Handlers.Refactor.Imports_Commands; -with LSP.Ada_Handlers.Refactor.Add_Parameter; -with LSP.Ada_Handlers.Refactor.Remove_Parameter; -with LSP.Ada_Handlers.Refactor.Move_Parameter; -with LSP.Ada_Handlers.Refactor.Change_Parameter_Mode; -with LSP.Ada_Handlers.Refactor.Change_Parameters_Type; -with LSP.Ada_Handlers.Refactor.Change_Parameters_Default_Value; -with LSP.Ada_Handlers.Refactor.Suppress_Seperate; -with LSP.Ada_Handlers.Refactor.Extract_Subprogram; -with LSP.Ada_Handlers.Refactor.Introduce_Parameter; -with LSP.Ada_Handlers.Refactor.Pull_Up_Declaration; -with LSP.Ada_Handlers.Refactor.Replace_Type; -with LSP.Ada_Handlers.Refactor.Sort_Dependencies; -with LSP.Commands; -with LSP.Error_Decorators; -with LSP.Fuzz_Decorators; -with LSP.GPR_Handlers; with LSP.Memory_Statistics; -with LSP.Predefined_Completion; with LSP.Servers; with LSP.Stdio_Streams; @@ -72,123 +48,27 @@ with LSP.Stdio_Streams; procedure LSP.Ada_Driver is - procedure On_Uncaught_Exception (E : Exception_Occurrence); - -- Reset LAL contexts in Message_Handler after catching some exception. - - procedure Register_Commands; - -- Register all known commands - - procedure Die_On_Uncaught (E : Exception_Occurrence); - -- Quit the process when an uncaught exception reaches this. Used for - -- fuzzing. - - Server_Trace : constant Trace_Handle := Create ("ALS.MAIN", From_Config); - -- Main trace for the LSP. - - In_Trace : constant Trace_Handle := Create ("ALS.IN", Off); - Out_Trace : constant Trace_Handle := Create ("ALS.OUT", Off); - -- Traces that logs all input & output. For debugging purposes. - Server : aliased LSP.Servers.Server; Stream : aliased LSP.Stdio_Streams.Stdio_Stream; Ada_Handler : aliased LSP.Ada_Handlers.Message_Handler - (Server'Access, Server_Trace); - GPR_Handler : aliased LSP.GPR_Handlers.Message_Handler - (Server'Access, Server_Trace); - - Error_Decorator : aliased LSP.Error_Decorators.Error_Decorator - (Server_Trace, - Ada_Handler'Unchecked_Access, - On_Uncaught_Exception'Unrestricted_Access); - -- This decorator catches all Property_Error exceptions and provides - -- default responses for each request. It also reset Libadalang Context - -- on any other exception. - - --------------------------- - -- On_Uncaught_Exception -- - --------------------------- - - procedure On_Uncaught_Exception (E : Exception_Occurrence) is - begin - Trace (Server_Trace, - "EXCEPTION: " & Exception_Name (E) & - Ada.Characters.Latin_1.LF & - "INFORMATION: " & Exception_Information (E) & - Ada.Characters.Latin_1.LF & - Symbolic_Traceback (E)); - Ada_Handler.Handle_Error; - end On_Uncaught_Exception; - - --------------------- - -- Die_On_Uncaught -- - --------------------- - - procedure Die_On_Uncaught (E : Exception_Occurrence) is - begin - Trace (Server_Trace, - "EXCEPTION: " & Exception_Name (E) & - Ada.Characters.Latin_1.LF & - "INFORMATION: " & Exception_Information (E) & - Ada.Characters.Latin_1.LF & - Symbolic_Traceback (E)); - -- An exception occurred while fuzzing: make it fatal. - GNAT.OS_Lib.OS_Exit (42); - end Die_On_Uncaught; - - ----------------------- - -- Register_Commands -- - ----------------------- - - procedure Register_Commands is - begin - LSP.Commands.Register - (LSP.Ada_Handlers.Other_File_Commands.Command'Tag); - LSP.Commands.Register - (LSP.Ada_Handlers.Project_Reload_Commands.Command'Tag); - LSP.Commands.Register - (LSP.Ada_Handlers.Named_Parameters_Commands.Command'Tag); - LSP.Commands.Register - (LSP.Ada_Handlers.Refactor.Imports_Commands.Command'Tag); - LSP.Commands.Register - (LSP.Ada_Handlers.Refactor.Suppress_Seperate.Command'Tag); - LSP.Commands.Register - (LSP.Ada_Handlers.Refactor.Extract_Subprogram.Command'Tag); - LSP.Commands.Register - (LSP.Ada_Handlers.Refactor.Introduce_Parameter.Command'Tag); - LSP.Commands.Register - (LSP.Ada_Handlers.Refactor.Pull_Up_Declaration.Command'Tag); - LSP.Commands.Register - (LSP.Ada_Handlers.Refactor.Replace_Type.Command'Tag); - LSP.Commands.Register - (LSP.Ada_Handlers.Refactor.Sort_Dependencies.Command'Tag); - - -- Refactoring - Change Subprogram Signature Commands - LSP.Commands.Register - (LSP.Ada_Handlers.Refactor.Add_Parameter.Command'Tag); - LSP.Commands.Register - (LSP.Ada_Handlers.Refactor.Remove_Parameter.Command'Tag); - LSP.Commands.Register - (LSP.Ada_Handlers.Refactor.Move_Parameter.Command'Tag); - LSP.Commands.Register - (LSP.Ada_Handlers.Refactor.Change_Parameter_Mode.Command'Tag); - LSP.Commands.Register - (LSP.Ada_Handlers.Refactor.Change_Parameters_Type.Command'Tag); - LSP.Commands.Register - (LSP.Ada_Handlers.Refactor.Change_Parameters_Default_Value. - Command'Tag); - end Register_Commands; + (Server'Access); + GPR_Handler : aliased LSP.Ada_Handlers.Message_Handler + (Server'Access); use type VSS.Strings.Virtual_String; Fuzzing_Activated : constant Boolean := not VSS.Application.System_Environment.Value ("ALS_FUZZING").Is_Empty; + pragma Unreferenced (Fuzzing_Activated); ALS_Home : constant VSS.Strings.Virtual_String := VSS.Application.System_Environment.Value ("ALS_HOME"); GPR_Path : constant VSS.Strings.Virtual_String := VSS.Application.System_Environment.Value ("GPR_PROJECT_PATH"); + pragma Unreferenced (GPR_Path); Path : constant VSS.Strings.Virtual_String := VSS.Application.System_Environment.Value ("PATH"); + pragma Unreferenced (Path); Home_Dir : constant Virtual_File := Create_From_UTF8 (VSS.Strings.Conversions.To_UTF_8_String @@ -230,7 +110,7 @@ procedure LSP.Ada_Driver is Config_File : Virtual_File; - Memory_Monitor_Enabled : Boolean; + Memory_Monitor_Enabled : Boolean := False; begin -- Handle the command line @@ -310,10 +190,6 @@ begin (Ada.Strings.Unbounded.To_String (Parse_Result.Error.Message)); GNAT.OS_Lib.OS_Exit (1); end if; - - Ada_Handler.Change_Configuration_Before_Init - (Options => Parse_Result.Value, - Root => Config_File.Dir); end; end if; @@ -335,8 +211,7 @@ begin if not VSS.Command_Line.Is_Specified (Language_GPR_Option) then -- Load predefined completion items - LSP.Predefined_Completion.Load_Predefined_Completion_Db (Server_Trace); - Register_Commands; + pragma Assert (not VSS.Command_Line.Is_Specified (Language_GPR_Option)); end if; Ada.Text_IO.Set_Output (Ada.Text_IO.Standard_Error); @@ -344,58 +219,11 @@ begin Server.Initialize (Stream'Unchecked_Access); - begin - if VSS.Command_Line.Is_Specified (Language_GPR_Option) then - Server.Run - (GPR_Handler'Unchecked_Access, - GPR_Handler'Unchecked_Access, - Server => null, - On_Error => On_Uncaught_Exception'Unrestricted_Access, - Server_Trace => Server_Trace, - In_Trace => In_Trace, - Out_Trace => Out_Trace); - elsif Fuzzing_Activated then - -- Fuzzing mode means registering the fuzzing decorators and - -- registering Die_On_Uncaught as error handler. - declare - Fuzz_Requests : aliased LSP.Fuzz_Decorators.Fuzz_Request_Decorator - (Server_Trace, - Error_Decorator'Unchecked_Access, - Die_On_Uncaught'Unrestricted_Access); - Fuzz_Notifications : aliased - LSP.Fuzz_Decorators.Fuzz_Notification_Decorator - (Server_Trace, - Ada_Handler'Unchecked_Access, - Ada_Handler'Unchecked_Access); - begin - Server.Run - (Fuzz_Requests'Unchecked_Access, - Fuzz_Notifications'Unchecked_Access, - Server => Ada_Handler'Unchecked_Access, - On_Error => Die_On_Uncaught'Unrestricted_Access, - Server_Trace => Server_Trace, - In_Trace => In_Trace, - Out_Trace => Out_Trace); - end; - else - Server.Run - (Error_Decorator'Unchecked_Access, - Ada_Handler'Unchecked_Access, - Server => Ada_Handler'Unchecked_Access, - On_Error => On_Uncaught_Exception'Unrestricted_Access, - Server_Trace => Server_Trace, - In_Trace => In_Trace, - Out_Trace => Out_Trace); - end if; - exception - when E : others => - Server_Trace.Trace - ("FATAL - Unexpected exception in the main thread: " - & Exception_Name (E) & " - " & Exception_Message (E)); - Server_Trace.Trace (Symbolic_Traceback (E)); - end; - - Server_Trace.Trace ("Shutting server down ..."); + if VSS.Command_Line.Is_Specified (Language_GPR_Option) then + Server.Run (GPR_Handler'Unchecked_Access); + else + Server.Run (Ada_Handler'Unchecked_Access); + end if; -- Dump the memory statistics if the memory monitor trace is active if Memory_Monitor_Enabled then @@ -404,16 +232,14 @@ begin LSP.Memory_Statistics.Dump_Memory_Statistics (3); begin - Server_Trace.Trace (Memory_Stats); + Ada.Text_IO.Put_Line (Memory_Stats); end; end if; - Ada_Handler.Stop_File_Monitoring; Server.Finalize; if Clean_ALS_Dir then - Ada_Handler.Clean_Logs (ALS_Dir); + pragma Assert (Clean_ALS_Dir); end if; - Ada_Handler.Cleanup; -- Clean secondary stack up declare diff --git a/source/ada/lsp-ada_handlers.adb b/source/ada/lsp-ada_handlers.adb index 8269c6ca7..0119b74c8 100644 --- a/source/ada/lsp-ada_handlers.adb +++ b/source/ada/lsp-ada_handlers.adb @@ -15,7160 +15,28 @@ -- of the license. -- ------------------------------------------------------------------------------ -with Ada.Calendar; use Ada.Calendar; -with Ada.Characters.Handling; use Ada.Characters.Handling; -with Ada.Containers.Indefinite_Hashed_Maps; -with Ada.Exceptions; -with Ada.Strings.Wide_Wide_Unbounded; -with Ada.Strings.UTF_Encoding; -with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; -with Ada.Unchecked_Deallocation; - -with GNAT.OS_Lib; -with GNATCOLL.Utils; use GNATCOLL.Utils; - -with GPR2.Containers; -with GPR2.Environment; -with GPR2.Message; -with GPR2.Project.Registry.Attribute; -with GPR2.Project.Source.Set; -with GPR2.Project.Tree.View_Builder; -with GPR2.Project.View; - -with Spawn.Environments; - -with VSS.Characters.Latin; -with VSS.Strings.Conversions; -with VSS.Unicode; - -with LSP.Ada_Documents; use LSP.Ada_Documents; -with LSP.Search; use LSP.Search; -with LSP.Ada_Contexts; use LSP.Ada_Contexts; -with LSP.Ada_Completions; -with LSP.Ada_Completions.Aspects; -with LSP.Ada_Completions.Attributes; -with LSP.Ada_Completions.End_Names; -with LSP.Ada_Completions.Keywords; -with LSP.Ada_Completions.Names; -with LSP.Ada_Completions.Parameters; -with LSP.Ada_Completions.Pragmas; -with LSP.Ada_Completions.Use_Clauses; -with LSP.Ada_Documentation; -with LSP.Ada_Handlers.Alire; -with LSP.Ada_Handlers.Invisibles; -with LSP.Ada_Handlers.Named_Parameters_Commands; -with LSP.Ada_Handlers.Refactor.Change_Parameter_Mode; -with LSP.Ada_Handlers.Refactor.Change_Parameters_Type; -with LSP.Ada_Handlers.Refactor.Change_Parameters_Default_Value; -with LSP.Ada_Handlers.Refactor.Add_Parameter; -with LSP.Ada_Handlers.Refactor.Introduce_Parameter; -with LSP.Ada_Handlers.Refactor.Extract_Subprogram; -with LSP.Ada_Handlers.Refactor.Imports_Commands; -with LSP.Ada_Handlers.Refactor.Move_Parameter; -with LSP.Ada_Handlers.Refactor.Remove_Parameter; -with LSP.Ada_Handlers.Refactor.Suppress_Seperate; -with LSP.Ada_Handlers.Refactor.Pull_Up_Declaration; -with LSP.Ada_Handlers.Refactor.Replace_Type; -with LSP.Ada_Handlers.Refactor.Sort_Dependencies; -with LSP.Ada_Handlers.Project_Diagnostics; -with LSP.Client_Side_File_Monitors; -with LSP.Commands; -with LSP.Common; use LSP.Common; -with LSP.Ada_Handlers.File_Readers; -with LSP.Diagnostic_Sources; -with LSP.Errors; -with LSP.Lal_Utils; use LSP.Lal_Utils; -with LSP.Messages.Client_Requests; -with LSP.Messages.Server_Notifications; -with LSP.Servers.FS_Watch; -with LSP.Types; use LSP.Types; -with LSP.Generic_Cancel_Check; - -with Langkit_Support.Slocs; -with Langkit_Support.Text; - -with Laltools.Common; -with Laltools.Partial_GNATPP; - -with LAL_Refactor.Refactor_Imports; -with LAL_Refactor.Subprogram_Signature; -with LAL_Refactor.Safe_Rename; -with LAL_Refactor.Suppress_Separate; -with LAL_Refactor.Extract_Subprogram; -with LAL_Refactor.Introduce_Parameter; -with LAL_Refactor.Pull_Up_Declaration; -with LAL_Refactor.Sort_Dependencies; -with LAL_Refactor.Subprogram_Signature.Change_Parameters_Type; -with LAL_Refactor.Subprogram_Signature.Change_Parameters_Default_Value; -with LAL_Refactor.Subprogram_Signature.Remove_Parameter; -with LAL_Refactor.Replace_Type; - -with Libadalang.Analysis; -with Libadalang.Common; use Libadalang.Common; -with Libadalang.Helpers; -with Libadalang.Preprocessing; - -with URIs; +with LSP.Enumerations; package body LSP.Ada_Handlers is - use GNATCOLL.VFS; - - type Cancel_Countdown is mod 128; - -- Counter to restrict frequency of Request.Canceled checks - - Allow_Incremental_Text_Changes : constant GNATCOLL.Traces.Trace_Handle := - GNATCOLL.Traces.Create ("ALS.ALLOW_INCREMENTAL_TEXT_CHANGES", - GNATCOLL.Traces.On); - -- Trace to activate the support for incremental text changes. - - Notifications_For_Imprecise : constant GNATCOLL.Traces.Trace_Handle := - GNATCOLL.Traces.Create ("ALS.NOTIFICATIONS_FOR_IMPRECISE_NAVIGATION", - GNATCOLL.Traces.Off); - - Runtime_Indexing : constant GNATCOLL.Traces.Trace_Handle := - GNATCOLL.Traces.Create ("ALS.RUNTIME_INDEXING", - GNATCOLL.Traces.On); - -- Trace to enable/disable runtime indexing. Useful for the testsuite. - - Partial_Gnatpp_Trace : constant GNATCOLL.Traces.Trace_Handle := - GNATCOLL.Traces.Create - (Unit_Name => "ALS.PARTIAL_GNATPP", - Default => GNATCOLL.Traces.On); - -- Trace to enable/disable using partial Gnatpp in the rangeFormatting - -- request. - - On_Type_Formatting_Trace : constant GNATCOLL.Traces.Trace_Handle := - GNATCOLL.Traces.Create - (Unit_Name => "ALS.ON_TYPE_FORMATTING", - Default => GNATCOLL.Traces.On); - -- Trace to enable/disable ALS from providing the - -- documentOnTypeFormattingProvider capability. - - Is_Parent : constant LSP.Messages.AlsReferenceKind_Set := - (Is_Server_Side => True, - As_Flags => [LSP.Messages.Parent => True, others => False]); - Is_Child : constant LSP.Messages.AlsReferenceKind_Set := - (Is_Server_Side => True, - As_Flags => [LSP.Messages.Child => True, others => False]); - -- Convenient constants - - Line_Feed : constant Wide_Wide_Character := - Ada.Characters.Wide_Wide_Latin_1.LF; - -- Backspace : constant Character := Ada.Characters.Latin_1.BS; - - procedure Log_Imprecise_Xref_Message - (Self : access Message_Handler; - URI : LSP.Messages.DocumentUri; - Position : LSP.Messages.Position); - -- Log a message to record that we have made an imprecise navigation - - procedure Log_Unexpected_Null_Document - (Self : access Message_Handler; - Where : String); - -- Log a message saying we unexpectedly couldn't find an open document - - procedure Imprecise_Resolve_Name - (Self : access Message_Handler; - In_Context : Context_Access; - Position : LSP.Messages.TextDocumentPositionParams'Class; - Definition : out Libadalang.Analysis.Defining_Name); - -- If node at given Position is a name, then resolve it. - -- Send a message in case of a possible imprecise result. - -- See description of Msg_Type in Send_Imprecise_Xref_Message comments. - - procedure Show_Message - (Self : access Message_Handler; - Text : VSS.Strings.Virtual_String; - Mode : LSP.Messages.MessageType := LSP.Messages.Error); - -- Convenience function to send a message to the user. - - procedure Show_Imprecise_Reference_Warning - (Self : access Message_Handler; - Operation : String); - -- Convenience function to send the warning that the navigation is - -- imprecise. - - function Get_Unique_Progress_Token - (Self : access Message_Handler; - Operation : String := "") return LSP_Number_Or_String; - -- Return an unique token for indicating progress - - procedure Index_Files (Self : access Message_Handler); - -- Index all loaded files in each context. Emit progresormation. - - procedure Release_Contexts_And_Project_Info (Self : access Message_Handler); - -- Release the memory associated to project information in Self - - function Contexts_For_File - (Self : access Message_Handler; - File : Virtual_File) - return LSP.Ada_Context_Sets.Context_Lists.List; - function Contexts_For_URI - (Self : access Message_Handler; - URI : LSP.Messages.DocumentUri) - return LSP.Ada_Context_Sets.Context_Lists.List; - -- Return a list of contexts that are suitable for the given File/URI: - -- a list of all contexts where the file is known to be part of the - -- project tree, or is a runtime file for this project. If the file - -- is not known to any project, return an empty list. - -- The result should not be freed. - - procedure Reload_Implicit_Project_Dirs (Self : access Message_Handler); - -- Reload as project source dirs the directories in - -- Self.Project_Dirs_Loaded. - - function Compute_File_Operations_Server_Capabilities - (Self : access Message_Handler) - return LSP.Messages.Optional_FileOperationsServerCapabilities; - -- Computes FileOperationsServerCapabilities based on the client's - -- capabilities. If the client does have any, then this function returns - -- an unset object. - - function Compute_File_Operation_Registration_Options - (Self : access Message_Handler) - return LSP.Messages.FileOperationRegistrationOptions; - -- Computes FileOperationRegistrationOptions based on the project held by - -- Self. These registration options will include Ada file that is in a - -- source folder of Self's project. - - function Format - (Self : in out LSP.Ada_Contexts.Context; - Document : LSP.Ada_Documents.Document_Access; - Span : LSP.Messages.Span; - Options : LSP.Messages.FormattingOptions; - Handler : access Message_Handler) - return LSP.Messages.Server_Responses.Formatting_Response; - -- Format the text of the given document in the given range (span). - - function Range_Format - (Self : in out LSP.Ada_Contexts.Context; - Document : LSP.Ada_Documents.Document_Access; - Span : LSP.Messages.Span; - Options : LSP.Messages.FormattingOptions) - return LSP.Messages.Server_Responses.Formatting_Response; - -- Format the text of the given document in the given range (span). - - type File_Span is record - File : GNATCOLL.VFS.Virtual_File; - Span : LSP.Messages.Span; - end record; - -- A text range in a file - - function Hash (Value : File_Span) return Ada.Containers.Hash_Type; - - package File_Span_Sets is new Ada.Containers.Hashed_Sets - (Element_Type => File_Span, - Hash => Hash, - Equivalent_Elements => "="); - - --------------------- - -- Project loading -- - --------------------- - - -- The heuristics that is used for loading a project is the following: - -- - -- * if a project (and optionally a scenario) was specified by - -- the user via the workspace/didChangeConfiguration notification or - -- Initialize request, attempt to use this. - -- If there is an `alire.toml` file in the root directory, then run - -- `alr` to find search path and extra scenario variables. - -- If this fails to load, then report an error, but do not attempt to - -- load another project. - -- => This case is handled by a call to Reload_Project in - -- Change_Configuration. - -- - -- * if no project was specified by the user, then run `alr` in the - -- root directory to get project file name from alire.toml (take the - -- very first project if many or crate name if none). - -- Otherwise look in the root directory, mimicking the behavior of - -- gprbuild : - -- * if there are zero .gpr files in this directory, load the - -- implicit project - -- * if there is exactly one .gpr file in this directory, load - -- it, returning an error if this failed - -- * if there are more than one .gpr files in this directory, - -- display an error - -- => These cases are handled by Ensure_Project_Loaded - -- - -- At any point where requests are made, Self.Contexts should - -- contain one or more contexts, each one containing a non-aggregate - -- project hierarchy. - -- - -- The attempt to load a project should be done in reaction to - -- On_DidChangeConfiguration_Notification. However, the IDEs that - -- are not configured specifically for this language server might - -- not pass a .gpr file to didChangeConfiguration: for these IDEs, - -- we fallback to loading the project the first time an editor is - -- open or a request on non-openned file. - - procedure Ensure_Project_Loaded (Self : access Message_Handler); - -- This function makes sure that the contexts in Self are properly - -- initialized and a project is loaded. If they are not initialized, - -- initialize them. - - procedure Ensure_Project_Loaded - (Self : access Message_Handler; - URI : LSP.Types.LSP_URI); - -- This function makes sure that the contexts in Self are properly - -- initialized and a project is loaded. If they are not initialized, - -- initialize them. Use URI to find a custom root directory if provided. - - procedure Load_Implicit_Project - (Self : access Message_Handler; - Status : Implicit_Project_Loaded); - -- Load the implicit project - - procedure Load_Project - (Self : access Message_Handler; - Project_File : VSS.Strings.Virtual_String; - Scenario : Scenario_Variable_List; - Environment : GPR2.Environment.Object; - Charset : VSS.Strings.Virtual_String; - Status : Load_Project_Status); - -- Attempt to load the given project file, with the scenario provided. - -- This unloads all currently loaded project contexts. This factorizes code - -- between Load_Project_With_Alire and Ensure_Project_Loaded. - - procedure Load_Project_With_Alire - (Self : access Message_Handler; - Project_File : VSS.Strings.Virtual_String := ""; - Scenario_Variables : Scenario_Variable_List; - Charset : VSS.Strings.Virtual_String); - -- Core procedure to find project, search path, scenario and load the - -- project. - -- - -- @param Self The message handler itself - -- @param Project_File GPR, if set by the user in settings - -- @param Scenario_Variables Scenario as set by the user in settings - -- @param Charset Charset, if set by the user in settings - -- - -- Load a project with a help of alire. If there is `alire.toml` in the - -- root directory and `alr` in the `PATH`, then use Alire to setup project - -- search path, extra scenario variables (and a project file name if - -- Project_File is empty). If Alire reports error then show it to the - -- user and fallback to an implicit project. - -- - -- If Alire succeed or no alire/crate then load project if provided. - - procedure Mark_Source_Files_For_Indexing (Self : access Message_Handler); - -- Mark all sources in all projects for indexing. This factorizes code - -- between Load_Project and Load_Implicit_Project. - - function URI_To_File - (Self : Message_Handler'Class; - URI : VSS.Strings.Virtual_String) return VSS.Strings.Virtual_String; - -- Turn URI into path - - function To_Virtual_File - (Value : VSS.Strings.Virtual_String) return Virtual_File is - (Create_From_UTF8 (VSS.Strings.Conversions.To_UTF_8_String (Value))); - -- Cast Virtual_String to Virtual_File - - function To_Virtual_String - (Value : Virtual_File) return VSS.Strings.Virtual_String is - (VSS.Strings.Conversions.To_Virtual_String (Value.Display_Full_Name)); - -- Cast Virtual_File to Virtual_String - - procedure Update_Project_Predefined_Sources (Self : access Message_Handler); - -- Fill Self.Project_Predefined_Sources with loaded project tree runtime - - ----------------------- - -- Contexts_For_File -- - ----------------------- - - function Contexts_For_File - (Self : access Message_Handler; - File : Virtual_File) - return LSP.Ada_Context_Sets.Context_Lists.List - is - function Is_A_Source (Self : LSP.Ada_Contexts.Context) return Boolean is - (Self.Is_Part_Of_Project (File)); - -- Return True if File is a source of the project held by Context - - begin - -- If the file does not exist on disk, assume this is a file - -- being created and, as a special convenience in this case, - -- assume it could belong to any project. - if not File.Is_Regular_File - -- If the file is a runtime file for the loaded project environment, - -- all projects can see it. - or else Self.Project_Predefined_Sources.Contains (File) - then - return Self.Contexts.Each_Context; - end if; - - -- List contexts where File is a source of the project hierarchy - return Self.Contexts.Each_Context (Is_A_Source'Unrestricted_Access); - end Contexts_For_File; - - ---------------------- - -- Contexts_For_URI -- - ---------------------- - - function Contexts_For_URI - (Self : access Message_Handler; - URI : LSP.Messages.DocumentUri) - return LSP.Ada_Context_Sets.Context_Lists.List - is - File : constant Virtual_File := Self.To_File (URI); - begin - return Self.Contexts_For_File (File); - end Contexts_For_URI; - - ----------------------- - -- Get_Open_Document -- - ----------------------- - - overriding function Get_Open_Document - (Self : access Message_Handler; - URI : LSP.Messages.DocumentUri; - Force : Boolean := False) - return LSP.Ada_Documents.Document_Access - is - File : constant GNATCOLL.VFS.Virtual_File := Self.To_File (URI); - begin - Self.Ensure_Project_Loaded (URI); - - if Self.Open_Documents.Contains (File) then - return LSP.Ada_Documents.Document_Access - (Self.Open_Documents.Element (File)); - elsif Force then - declare - Document : constant Internal_Document_Access := - new LSP.Ada_Documents.Document (Self.Trace); - begin - Document.Initialize (URI, VSS.Strings.Empty_Virtual_String, null); - return LSP.Ada_Documents.Document_Access (Document); - end; - else - return null; - end if; - end Get_Open_Document; - - ------------------------------- - -- Get_Open_Document_Version -- - ------------------------------- - - overriding - function Get_Open_Document_Version - (Self : access Message_Handler; - URI : LSP.Messages.DocumentUri) - return LSP.Messages.OptionalVersionedTextDocumentIdentifier - is - Target_Text_Document : constant LSP.Ada_Documents.Document_Access := - Self.Get_Open_Document (URI); - - begin - -- If the target textDocument hasn't been opened in the editor - -- then ALS hasn't received an open notification before. Therefore - -- Target_Text_Document will be null. - -- In that case, its VersionedTextDocumentIdentifier.version will - -- be null. - - if Target_Text_Document = null then - return (URI, LSP.Messages.Nullable_Number'(Is_Set => False)); - - else - return - (uri => Target_Text_Document.Versioned_Identifier.uri, - version => - (True, Target_Text_Document.Versioned_Identifier.version)); - end if; - end Get_Open_Document_Version; - - ---------------------------------- - -- Log_Unexpected_Null_Document -- - ---------------------------------- - - procedure Log_Unexpected_Null_Document - (Self : access Message_Handler; - Where : String) is - begin - Self.Trace.Trace ("Unexpected null document in " & Where); - end Log_Unexpected_Null_Document; - - -------------------------------- - -- Log_Imprecise_Xref_Message -- - -------------------------------- - - procedure Log_Imprecise_Xref_Message - (Self : access Message_Handler; - URI : LSP.Messages.DocumentUri; - Position : LSP.Messages.Position) - is - File : constant GNATCOLL.VFS.Virtual_File := Self.To_File (URI); - begin - Self.Trace.Trace - ("Imprecise fallback used to compute cross-references on entity at " - & File.Display_Base_Name - & ":" & Integer'Image (Integer (Position.line) + 1) - & ":" & Integer'Image (Integer (Position.character) + 1)); - end Log_Imprecise_Xref_Message; - - ---------------------------- - -- Imprecise_Resolve_Name -- - ---------------------------- - - procedure Imprecise_Resolve_Name - (Self : access Message_Handler; - In_Context : Context_Access; - Position : LSP.Messages.TextDocumentPositionParams'Class; - Definition : out Libadalang.Analysis.Defining_Name) - is - use type Libadalang.Analysis.Name; - - Name_Node : constant Libadalang.Analysis.Name := - Laltools.Common.Get_Node_As_Name - (In_Context.Get_Node_At - (Get_Open_Document (Self, Position.textDocument.uri), - Position, - Project_Only => False)); - - Imprecise : Boolean; - begin - if Name_Node = Libadalang.Analysis.No_Name then - return; - end if; - - Definition := Laltools.Common.Resolve_Name - (Name_Node, - Self.Trace, - Imprecise => Imprecise); - - -- If we used the imprecise fallback to get to the definition, log it - if Imprecise then - Self.Log_Imprecise_Xref_Message - (URI => Position.textDocument.uri, - Position => Position.position); - end if; - end Imprecise_Resolve_Name; - - --------------------------------------- - -- Release_Contexts_And_Project_Info -- - --------------------------------------- - - procedure Release_Contexts_And_Project_Info - (Self : access Message_Handler) - is - begin - Self.Contexts.Cleanup; - - Self.Project_Tree.Unload; - Self.Project_Environment := Empty_Environment; - Self.Project_Predefined_Sources.Clear; - Self.Project_Dirs_Loaded.Clear; - - -- Clear indexing data - Self.Files_To_Index.Clear; - Self.Total_Files_To_Index := 1; - Self.Total_Files_Indexed := 0; - end Release_Contexts_And_Project_Info; - - -------------------------- - -- Stop_File_Monitoring -- - -------------------------- - - procedure Stop_File_Monitoring (Self : access Message_Handler) is - begin - if Self.File_Monitor.Assigned then - Self.File_Monitor.Stop_Monitoring_Directories; - end if; - end Stop_File_Monitoring; - - ------------- - -- Cleanup -- - ------------- - - procedure Cleanup (Self : access Message_Handler) - is - begin - -- Cleanup documents - for Document of Self.Open_Documents loop - Free (Document); - end loop; - Self.Open_Documents.Clear; - - -- Cleanup contexts, project and environment - Self.Release_Contexts_And_Project_Info; - - -- Free the file monitor - LSP.File_Monitors.Unchecked_Free (Self.File_Monitor); - end Cleanup; - - ---------------- - -- Clean_Logs -- - ---------------- - - procedure Clean_Logs (Self : access Message_Handler; Dir : Virtual_File) is - Files : File_Array_Access := Read_Dir (Dir, Files_Only); - Dummy : Boolean; - Cpt : Integer := 0; - begin - Sort (Files.all); - -- Browse the log files in reverse timestamp order - for F of reverse Files.all loop - -- Filter out files like traces.cfg - if GNATCOLL.Utils.Ends_With (+F.Base_Name, ".log") then - Cpt := Cpt + 1; - -- Delete the old logs - if Cpt > Self.Log_Threshold then - Delete (F, Dummy); - end if; - end if; - end loop; - Unchecked_Free (Files); - end Clean_Logs; ----------------------- - -- Exit_Notification -- + -- On_Server_Request -- ----------------------- - overriding procedure On_Exit_Notification (Self : access Message_Handler) is - begin - Self.Server.Stop; - end On_Exit_Notification; - - ---------------------------------- - -- Reload_Implicit_Project_Dirs -- - ---------------------------------- - - procedure Reload_Implicit_Project_Dirs (Self : access Message_Handler) is - Project : GPR2.Project.Tree.View_Builder.Object := - GPR2.Project.Tree.View_Builder.Create - (Project_Dir => GPR2.Path_Name.Create_Directory ("."), - Name => "default"); - Values : GPR2.Containers.Value_List; - begin - for Dir of Self.Project_Dirs_Loaded loop - Values.Append (Dir.Display_Full_Name); - end loop; - - Project.Set_Attribute - (GPR2.Project.Registry.Attribute.Source_Dirs, Values); - - -- Load_Autoconf is assuming loading unloaded tree. - - Self.Project_Tree.Unload; - - GPR2.Project.Tree.View_Builder.Load_Autoconf - (Self => Self.Project_Tree, - Project => Project, - Context => Self.Project_Environment.Context, - Build_Path => Self.Project_Environment.Build_Path); - - Self.Project_Tree.Update_Sources (With_Runtime => True); - - exception - when E : others => - Self.Trace.Trace ("Exception loading implicit"); - Self.Trace.Trace (E); - end Reload_Implicit_Project_Dirs; - - -------------------- - -- Reload_Project -- - -------------------- - - procedure Reload_Project (Self : access Message_Handler) is - begin - if Self.Project_File.Is_Empty then - Self.Release_Contexts_And_Project_Info; - Self.Ensure_Project_Loaded; - else - Self.Load_Project_With_Alire - (Self.Project_File, - Self.Scenario_Variables, - Self.Charset); - end if; - end Reload_Project; - - --------------------------- - -- Load_Implicit_Project -- - --------------------------- - - procedure Load_Implicit_Project - (Self : access Message_Handler; - Status : Implicit_Project_Loaded) - is - C : constant Context_Access := new Context (Self.Trace); - Reader : LSP.Ada_Handlers.File_Readers.LSP_Reader_Interface (Self); - begin - Self.Trace.Trace ("Loading the implicit project"); - - Self.Project_Status := Status; - Self.Release_Contexts_And_Project_Info; - - C.Initialize - (File_Reader => Reader, - Follow_Symlinks => Self.Follow_Symlinks, - Style => Self.Options.Documentation.Style, - As_Fallback_Context => True); - - -- Note: we would call Load_Implicit_Project here, but this has - -- two problems: - -- - there is a bug under Windows where the files returned by - -- Source_Files have an extraneous directory separator - -- - the implicit project relies on the current working - -- of the ALS, which imposes a restriction on clients, and - -- is an extra pitfall for developers of this server - -- - -- Instead, use Load_Empty_Project and set the source dir and - -- language manually: this does not have these inconvenients. - - -- When there is no .gpr, create a project which loads the - -- root directory in the workspace. - - Self.Project_Dirs_Loaded.Include (Self.Root); - Self.Reload_Implicit_Project_Dirs; - C.Load_Project (Self.Project_Tree, - Self.Project_Tree.Root_Project, - "iso-8859-1"); - - Update_Project_Predefined_Sources (Self); - - Self.Contexts.Prepend (C); - - -- Reindex the files from disk in the background after a project reload - Self.Mark_Source_Files_For_Indexing; - end Load_Implicit_Project; - - --------------------------- - -- Ensure_Project_Loaded -- - --------------------------- - - procedure Ensure_Project_Loaded - (Self : access Message_Handler; - URI : LSP.Types.LSP_URI) - is - begin - if not Self.Contexts.Is_Empty then - -- Rely on the fact that there is at least one context initialized - -- as a guarantee that the initialization has been done. - return; - end if; - - if Self.Root = No_File then - Self.Root := Self.To_File (URI).Dir; - end if; - - Self.Ensure_Project_Loaded; - end Ensure_Project_Loaded; - - --------------------------- - -- Ensure_Project_Loaded -- - --------------------------- - - procedure Ensure_Project_Loaded (Self : access Message_Handler) is - GPRs_Found : Natural := 0; - Files : File_Array_Access; - Project_File : VSS.Strings.Virtual_String; - begin - if not Self.Contexts.Is_Empty then - -- Rely on the fact that there is at least one context initialized - -- as a guarantee that the initialization has been done. - return; - end if; - - Self.Trace.Trace ("Looking for a project..."); - Self.Trace.Trace ("Root : " & Self.Root.Display_Full_Name); - - Self.Load_Project_With_Alire - (Project_File => VSS.Strings.Empty_Virtual_String, - Scenario_Variables => Self.Scenario_Variables, - Charset => Self.Charset); - - if not Self.Contexts.Is_Empty then - -- Some project was found by alire and loaded. We are done! - return; - end if; - - -- We don't have alire/crate. - -- We're going to look for a project in Root: list all the files - -- in this directory, looking for .gpr files. - - Files := Self.Root.Read_Dir (Files_Only); - - for X of Files.all loop - if X.Has_Suffix (".gpr") then - GPRs_Found := GPRs_Found + 1; - exit when GPRs_Found > 1; - Project_File := To_Virtual_String (X); - end if; - end loop; - - Unchecked_Free (Files); - - -- What we do depends on the number of .gpr files found: - - if GPRs_Found = 0 then - -- We have found zero .gpr files: load the implicit project - - Self.Load_Implicit_Project (No_Project_Found); - elsif GPRs_Found = 1 then - -- We have found exactly one .gpr file: let's load it. - Self.Trace.Trace - ("Loading " & - VSS.Strings.Conversions.To_UTF_8_String (Project_File)); - - Self.Load_Project - (Project_File, - Self.Scenario_Variables, - GPR2.Environment.Process_Environment, - "iso-8859-1", - Single_Project_Found); - else - -- We have found more than one project: warn the user! - - Self.Show_Message - (VSS.Strings.To_Virtual_String - ("More than one .gpr found." & Line_Feed & - "Note: you can configure a project " & - " through the ada.projectFile setting.")); - Self.Load_Implicit_Project (Multiple_Projects_Found); - end if; - end Ensure_Project_Loaded; - - ------------------------------------------------- - -- Compute_File_Operations_Server_Capabilities -- - ------------------------------------------------- - - function Compute_File_Operations_Server_Capabilities - (Self : access Message_Handler) - return LSP.Messages.Optional_FileOperationsServerCapabilities - is - use LSP.Messages; - Client_Capabilities : - LSP.Messages.Optional_FileOperationsClientCapabilities - renames Self.Client.capabilities.workspace.fileOperations; - begin - - if Client_Capabilities.Is_Set - and then not Self.Contexts.Each_Context.Is_Empty - then - declare - Registration_Options : - constant Optional_FileOperationRegistrationOptions := - (Is_Set => True, - Value => Self.Compute_File_Operation_Registration_Options); - begin - return Server_Capabilities : - Optional_FileOperationsServerCapabilities (Is_Set => True) - do - if Client_Capabilities.Value.didCreate = True then - Server_Capabilities.Value.didCreate := Registration_Options; - end if; - if Client_Capabilities.Value.willCreate = True then - Server_Capabilities.Value.willCreate := Registration_Options; - end if; - if Client_Capabilities.Value.didRename = True then - Server_Capabilities.Value.didRename := Registration_Options; - end if; - if Client_Capabilities.Value.willRename = True then - Server_Capabilities.Value.willRename := Registration_Options; - end if; - if Client_Capabilities.Value.didDelete = True then - Server_Capabilities.Value.didDelete := Registration_Options; - end if; - if Client_Capabilities.Value.willDelete = True then - Server_Capabilities.Value.willDelete := Registration_Options; - end if; - end return; - end; - else - return Optional_FileOperationsServerCapabilities'(Is_Set => False); - end if; - end Compute_File_Operations_Server_Capabilities; - - ------------------------------------------------- - -- Compute_File_Operation_Registration_Options -- - ------------------------------------------------- - - function Compute_File_Operation_Registration_Options - (Self : access Message_Handler) - return LSP.Messages.FileOperationRegistrationOptions - is - use LSP.Messages; - use LSP.Ada_File_Sets.Extension_Sets; - use VSS.Strings; - - File_Operation_Filters : LSP.Messages.FileOperationFilter_Vector; - - begin - - for Context of Self.Contexts.Each_Context loop - declare - Extensions_Set : constant LSP.Ada_File_Sets.Extension_Sets.Set - := Context.List_Source_Extensions; - -- Need to lock the Set in a local variable for the cursor to stay - -- valid. - Extension_Pattern : VSS.Strings.Virtual_String := "{"; - Extension_Cursor : LSP.Ada_File_Sets.Extension_Sets.Cursor := - First (Extensions_Set); - begin - while Has_Element (Extension_Cursor) loop - Extension_Pattern.Append (Element (Extension_Cursor)); - Next (Extension_Cursor); - if Has_Element (Extension_Cursor) then - Extension_Pattern.Append (","); - else - Extension_Pattern.Append ("}"); - end if; - end loop; - - for Source_Dir of Context.List_Source_Directories loop - declare - Dir_Full_Name : constant GNATCOLL.VFS.Filesystem_String := - GNATCOLL.VFS."/" (Source_Dir, "*").Full_Name; - Scheme : constant VSS.Strings.Virtual_String := - "file"; - Sources_Glob : constant VSS.Strings.Virtual_String := - VSS.Strings.Conversions.To_Virtual_String (+Dir_Full_Name); - - File_Operation_Filter : - constant LSP.Messages.FileOperationFilter := - (scheme => (Is_Set => True, - Value => Scheme), - pattern => (glob => Sources_Glob & Extension_Pattern, - others => <>)); - begin - File_Operation_Filters.Append (File_Operation_Filter); - end; - end loop; - end; - end loop; - - return - FileOperationRegistrationOptions'(filters => File_Operation_Filters); - end Compute_File_Operation_Registration_Options; - - ------------ - -- Format -- - ------------ - - function Format - (Self : in out LSP.Ada_Contexts.Context; - Document : LSP.Ada_Documents.Document_Access; - Span : LSP.Messages.Span; - Options : LSP.Messages.FormattingOptions; - Handler : access Message_Handler) - return LSP.Messages.Server_Responses.Formatting_Response - is - Response : LSP.Messages.Server_Responses.Formatting_Response - (Is_Error => False); - Success : Boolean; - Messages : VSS.String_Vectors.Virtual_String_Vector; - begin - Self.Format - (Document => Document, - Span => Span, - Options => Options, - Edit => Response.result, - Success => Success, - Messages => Messages); - - if not Success then - declare - use VSS.Strings; - - Response : LSP.Messages.Server_Responses.Formatting_Response - (Is_Error => True); - Error_Msg : VSS.Strings.Virtual_String; - begin - -- Display error messages from gnatpp, if any - for Msg of Messages loop - Error_Msg := Error_Msg & Msg; - end loop; - - Response.error := - (True, - (code => LSP.Errors.InternalError, - message => Error_Msg, - data => <>)); - return Response; - end; - else - -- If the formntting succeeded, still display messages in the client - -- if any. - for Msg of Messages loop - Show_Message - (Self => Handler, - Text => Msg, - Mode => LSP.Messages.Info); - end loop; - end if; - - return Response; - end Format; - - ------------------ - -- Range_Format -- - ------------------ - - function Range_Format - (Self : in out LSP.Ada_Contexts.Context; - Document : LSP.Ada_Documents.Document_Access; - Span : LSP.Messages.Span; - Options : LSP.Messages.FormattingOptions) - return LSP.Messages.Server_Responses.Formatting_Response - is - Response : LSP.Messages.Server_Responses.Formatting_Response - (Is_Error => False); - Success : Boolean; - Messages : VSS.String_Vectors.Virtual_String_Vector; - - begin - Self.Range_Format - (Document => Document, - Span => Span, - Options => Options, - Edit => Response.result, - Success => Success, - Messages => Messages); - - if not Success then - declare - use VSS.Strings; - - Response : LSP.Messages.Server_Responses.Formatting_Response - (Is_Error => True); - Error_Msg : VSS.Strings.Virtual_String; - begin - -- Display error messages from gnatpp, if any - for Msg of Messages loop - Error_Msg := Error_Msg & Msg; - end loop; - - Response.error := - (True, - (code => LSP.Errors.InternalError, - message => Error_Msg, - data => <>)); - return Response; - end; - end if; - - return Response; - end Range_Format; - - ------------------------ - -- Initialize_Request -- - ------------------------ - - overriding function On_Initialize_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Initialize_Request) - return LSP.Messages.Server_Responses.Initialize_Response - is - use LSP.Messages; - - Value : LSP.Messages.InitializeParams renames Request.params; - Code_Action : LSP.Messages.Optional_CodeActionClientCapabilities - renames Value.capabilities.textDocument.codeAction; - Has_Rename : LSP.Messages.Optional_RenameClientCapabilities - renames Value.capabilities.textDocument.rename; - Semantic_Tokens : LSP.Messages.Optional_SemanticTokensClientCapabilities - renames Value.capabilities.textDocument.semanticTokens; - Experimental_Client_Capabilities : LSP.Types.Optional_LSP_Any renames - Value.capabilities.experimental; - Response : LSP.Messages.Server_Responses.Initialize_Response - (Is_Error => False); - Root : VSS.Strings.Virtual_String; - codeActionKinds : LSP.Messages.CodeActionKindSet; - Backspace_String : VSS.Strings.Virtual_String; - Retrigger_Vector : VSS.String_Vectors.Virtual_String_Vector; - - begin - Backspace_String.Append (VSS.Characters.Latin.Backspace); - Retrigger_Vector.Append (Backspace_String); - - Response.result.capabilities.declarationProvider := - (Is_Set => True, - Value => (Is_Boolean => True, Bool => True)); - Response.result.capabilities.definitionProvider := - (Is_Set => True, - Value => (workDoneProgress => LSP.Types.None)); - Response.result.capabilities.typeDefinitionProvider := - (Is_Set => True, - Value => (Is_Boolean => True, Bool => True)); - Response.result.capabilities.implementationProvider := - (Is_Set => True, - Value => (Is_Boolean => True, Bool => True)); - Response.result.capabilities.referencesProvider := - (Is_Set => True, - Value => (workDoneProgress => LSP.Types.None)); - Response.result.capabilities.documentFormattingProvider := - (Is_Set => True, - Value => (workDoneProgress => LSP.Types.None)); - Response.result.capabilities.documentRangeFormattingProvider := - (Is_Set => True, - Value => (workDoneProgress => LSP.Types.None)); - Response.result.capabilities.documentOnTypeFormattingProvider := - (if On_Type_Formatting_Trace.Is_Active then - (Is_Set => True, - Value => - (firstTriggerCharacter => - Self.On_Type_Formatting_Settings.First_Trigger_Character, - moreTriggerCharacter => - Self.On_Type_Formatting_Settings.More_Trigger_Characters)) - else - (Is_Set => False)); - Response.result.capabilities.callHierarchyProvider := - (Is_Set => True, - Value => (Is_Boolean => False, Options => <>)); - Response.result.capabilities.documentHighlightProvider := - (Is_Set => True, - Value => (workDoneProgress => LSP.Types.None)); - - Response.result.capabilities.workspaceSymbolProvider := - (Is_Set => True, - Value => (workDoneProgress => LSP.Types.None)); - Response.result.capabilities.documentSymbolProvider := - (Is_Set => True, - Value => (workDoneProgress => LSP.Types.None, label => <>)); - Response.result.capabilities.renameProvider := - (Is_Set => True, - Value => (prepareProvider => - (if Has_Rename.Is_Set - and then Has_Rename.Value.prepareSupport = True - then LSP.Types.True else LSP.Types.None), - workDoneProgress => LSP.Types.None)); - Response.result.capabilities.textDocumentSync := - (Is_Set => True, Is_Number => True, - Value => - (if Allow_Incremental_Text_Changes.Active then - LSP.Messages.Incremental - else - LSP.Messages.Full)); - Response.result.capabilities.signatureHelpProvider := - (True, - (triggerCharacters => (True, [",", "("]), - retriggerCharacters => (True, Retrigger_Vector), - workDoneProgress => LSP.Types.None)); - Response.result.capabilities.completionProvider := - (True, - (resolveProvider => LSP.Types.True, - triggerCharacters => (True, [".", ",", "'", "("]), - allCommitCharacters => (Is_Set => False), - workDoneProgress => LSP.Types.None)); - Response.result.capabilities.hoverProvider := - (Is_Set => True, - Value => (workDoneProgress => LSP.Types.None)); - Response.result.capabilities.executeCommandProvider := - (Is_Set => True, - Value => (commands => LSP.Commands.All_Commands, - workDoneProgress => LSP.Types.None)); - - if Code_Action.Is_Set and then - Code_Action.Value.codeActionLiteralSupport.Is_Set - then - LSP.Messages.Include (codeActionKinds, LSP.Messages.QuickFix); - LSP.Messages.Include (codeActionKinds, LSP.Messages.RefactorRewrite); - - Response.result.capabilities.codeActionProvider := - (Is_Set => True, - Value => - (codeActionKinds => (True, codeActionKinds), - workDoneProgress => LSP.Types.None, - resolveProvider => LSP.Types.None)); - else - Response.result.capabilities.codeActionProvider := - (Is_Set => True, Value => <>); - end if; - - Response.result.capabilities.alsShowDepsProvider := True; - - Response.result.capabilities.alsReferenceKinds := - (Is_Set => True, - Value => (Is_Server_Side => True, As_Flags => [others => True])); - - Response.result.capabilities.foldingRangeProvider := - (Is_Set => True, - Value => (Is_Boolean => True, Bool => True)); - - Self.Resource_Operations := - Value.capabilities.workspace.workspaceEdit.resourceOperations; - - Response.result.capabilities.alsCheckSyntaxProvider := True; - - -- Client capability to support versioned document changes in - -- `WorkspaceEdit`s. - Self.Versioned_Documents := - Value.capabilities.workspace.workspaceEdit.documentChanges = True; - - if Value.capabilities.textDocument.documentSymbol.Is_Set - and then Value.capabilities.textDocument.documentSymbol.Value - .hierarchicalDocumentSymbolSupport = True - then - Self.Get_Symbols := LSP.Ada_Documents.Get_Symbol_Hierarchy'Access; - else - Self.Get_Symbols := LSP.Ada_Documents.Get_Symbols'Access; - end if; - - if Value.capabilities.textDocument.foldingRange.Is_Set - and then Value.capabilities.textDocument.foldingRange.Value. - lineFoldingOnly = True - then - -- Client capability to fold only entire lines - Self.Line_Folding_Only := True; - end if; - - if Value.capabilities.textDocument.publishDiagnostics.Is_Set - and then Value.capabilities.textDocument.publishDiagnostics.Value. - relatedInformation.Is_Set - then - -- Client capability to support relatedInformation field in - -- diagnostics. - Self.Supports_Related_Diagnostics := - Value.capabilities.textDocument.publishDiagnostics.Value. - relatedInformation.Value; - end if; - - if Value.capabilities.textDocument.completion.completionItem.Is_Set - and then Value.capabilities.textDocument.completion. - completionItem.Value.snippetSupport = True - then - -- Client capability to support snippets for completion - Self.Completion_Snippets_Enabled := True; - end if; - - if Value.capabilities.textDocument.completion.completionItem.Is_Set - and then Value.capabilities.textDocument.completion. - completionItem.Value.resolveSupport.Is_Set - then - Self.Completion_Resolve_Properties := - Value.capabilities.textDocument.completion. - completionItem.Value.resolveSupport.Value.properties; - end if; - - if Value.capabilities.workspace.didChangeWatchedFiles.Is_Set - and then Value.capabilities.workspace.didChangeWatchedFiles.Value - .dynamicRegistration = True - then - Self.File_Monitor := new LSP.Client_Side_File_Monitors.File_Monitor - (Self.Server); - end if; - - if Semantic_Tokens.Is_Set then - declare - Legend : LSP.Messages.SemanticTokensLegend; - begin - Self.Highlighter.Initialize (Semantic_Tokens.Value, Legend); - - Response.result.capabilities.semanticTokensProvider := - (True, - (legend => Legend, - full => (True, (diff => <>)), - span => LSP.Types.True, - others => <>)); - end; - end if; - - if Value.rootUri.Is_Set - and then not Value.rootUri.Value.Is_Empty - then - Root := Self.URI_To_File (Value.rootUri.Value); - elsif Value.rootPath.Is_Set and then Value.rootPath.Value.Is_Set then - -- URI isn't provided, rollback to deprecated rootPath - Root := Value.rootPath.Value.Value; - end if; - - -- Some clients - notably VS Code as of version 33, when opening a file - -- rather than a workspace - don't provide a root at all. In that case - -- use the current directory as root. - - if Root.Is_Empty then - Root := "."; - end if; - - Self.Root := To_Virtual_File (Root); - Self.Client := Value; - - -- Log the context root - Self.Trace.Trace - ("Context root: " & VSS.Strings.Conversions.To_UTF_8_String (Root)); - - -- Client/ServerCapabilities.workspace.fileOperations capabilities - - declare - File_Operation_Capabilities : - constant Optional_FileOperationsServerCapabilities := - Self.Compute_File_Operations_Server_Capabilities; - - begin - if File_Operation_Capabilities.Is_Set then - Response.result.capabilities.workspace := - (Is_Set => True, - Value => - (workspaceFolders => (Is_Set => False), - fileOperations => File_Operation_Capabilities)); - end if; - end; - - Response.result.serverInfo := LSP.Messages.Optional_ProgramInfo' - (True, - (log_filename => - (True, VSS.Strings.Conversions.To_Virtual_String - (Runtime_Indexing.Get_Stream_File.Display_Full_Name)), - others => <>)); - - -- Experimental Client Capabilities - Self.Experimental_Client_Capabilities := - Parse (Experimental_Client_Capabilities); - - if Value.initializationOptions.Is_Set then - Self.Change_Configuration (Value.initializationOptions.Value); - end if; - - return Response; - end On_Initialize_Request; - - ------------------------- - -- On_Shutdown_Request -- - ------------------------- - - overriding function On_Shutdown_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Shutdown_Request) - return LSP.Messages.Server_Responses.Shutdown_Response - is - pragma Unreferenced (Request); + overriding procedure On_Server_Request + (Self : in out Message_Handler; + Value : LSP.Server_Requests.Server_Request'Class) is begin - -- Suspend files/runtime indexing after shutdown requst - Self.Indexing_Enabled := False; - - return Response : LSP.Messages.Server_Responses.Shutdown_Response - (Is_Error => False); - end On_Shutdown_Request; - - --------------------------- - -- On_CodeAction_Request -- - --------------------------- - - overriding function On_CodeAction_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.CodeAction_Request) - return LSP.Messages.Server_Responses.CodeAction_Response - is - Params : LSP.Messages.CodeActionParams renames Request.params; - - procedure Analyse_In_Context - (Context : Context_Access; - Document : LSP.Ada_Documents.Document_Access; - Result : out LSP.Messages.CodeAction_Vector; - Found : in out Boolean); - -- Perform refactoring ananlysis given Document in the Context. - -- Return Found = True if some refactoring is possible. Populate - -- Result with Code_Actions in this case. - - function Has_Assoc_Without_Designator - (Node : Libadalang.Analysis.Basic_Assoc_List) return Boolean; - -- Check if Node is Basic_Assoc_List that contains at least one - -- ParamAssoc without a designator. - - procedure Analyse_Node - (Context : Context_Access; - Node : Libadalang.Analysis.Ada_Node; - Result : out LSP.Messages.CodeAction_Vector; - Found : in out Boolean); - -- Look for a possible refactoring in given Node. - -- Return Found = True if some refactoring is possible. Populate - -- Result with Code_Actions in this case. Return Done = True if futher - -- analysis has no sense. - - procedure Append_Project_Status_Code_Actions - (Result : in out LSP.Messages.CodeAction_Vector); - -- Append project status code action if needed - - ---------------------------------- - -- Has_Assoc_Without_Designator -- - ---------------------------------- - - function Has_Assoc_Without_Designator - (Node : Libadalang.Analysis.Basic_Assoc_List) return Boolean - is - Found : Boolean := False; - - function Process_Type_Expr - (TE : Libadalang.Analysis.Type_Expr) - return Boolean; - -- Returns True if TE is associated to an access of a subprogram - - ----------------------- - -- Process_Type_Expr -- - ----------------------- - - function Process_Type_Expr - (TE : Libadalang.Analysis.Type_Expr) - return Boolean - is - TD : Libadalang.Analysis.Base_Type_Decl; - -- If TE is not an anonymous type then we'll need to know its - -- declaration. - - begin - case TE.Kind is - when Ada_Subtype_Indication_Range => - TD := TE.As_Subtype_Indication.P_Designated_Type_Decl; - - if TD.Is_Null - or else not (TD.Kind in Ada_Type_Decl) - then - return False; - end if; - - case TD.As_Type_Decl.F_Type_Def.Kind is - when Ada_Access_To_Subp_Def_Range => - -- Confirmation that TD is an access to a subprogram - - return True; - - when Ada_Array_Type_Def_Range => - -- If TD is an array type, then it might be an array - -- of accesses to subprograms. Therefore, recursively - -- call Process_Type_Expr to check the type of the - -- components of the array. - - return Process_Type_Expr - (TD.As_Type_Decl.F_Type_Def.As_Array_Type_Def. - F_Component_Type.F_Type_Expr); - - when others => - return False; - end case; - - when Ada_Anonymous_Type_Range => - return TE.As_Anonymous_Type.F_Type_Decl.F_Type_Def.Kind in - Ada_Access_To_Subp_Def_Range; - - when others => - return False; - - end case; - end Process_Type_Expr; - - begin - for J of Node loop - if J.Kind in Libadalang.Common.Ada_Param_Assoc and then - J.As_Param_Assoc.F_Designator.Is_Null - then - Found := True; - exit; - end if; - end loop; + Self.Implemented := False; - if not Found then - return False; - end if; - - declare - Expr : constant Libadalang.Analysis.Ada_Node := Node.Parent; - Name : Libadalang.Analysis.Name; - Decl : Libadalang.Analysis.Basic_Decl; - begin - case Expr.Kind is - when Libadalang.Common.Ada_Call_Expr => - Name := Expr.As_Call_Expr.F_Name; - when others => - return False; - end case; - - Decl := Name.P_Referenced_Decl; - - if Decl.Is_Null then - return False; - end if; - - -- For Ada_Param_Spec, Ada_Component_Decl or Object_Decl nodes, - -- check the type definition of Decl. Named parameters can be - -- added if Decl's type is a (possibly anonymous) access to a - -- subprogram. - - case Decl.Kind is - when Libadalang.Common.Ada_Base_Subp_Body - | Libadalang.Common.Ada_Basic_Subp_Decl => - return True; - - when Libadalang.Common.Ada_Param_Spec_Range => - return Process_Type_Expr (Decl.As_Param_Spec.F_Type_Expr); - - when Libadalang.Common.Ada_Component_Decl_Range => - return Process_Type_Expr - (Decl.As_Component_Decl.F_Component_Def.F_Type_Expr); - - when Libadalang.Common.Ada_Object_Decl_Range => - -- This can either be an object which type is an access - -- to a subprogram or an array of accesses to - -- subprograms. - return Process_Type_Expr (Decl.As_Object_Decl.F_Type_Expr); - - when others => - return False; - end case; - end; - end Has_Assoc_Without_Designator; - - ------------------ - -- Analyse_Node -- - ------------------ - - procedure Analyse_Node - (Context : Context_Access; - Node : Libadalang.Analysis.Ada_Node; - Result : out LSP.Messages.CodeAction_Vector; - Found : in out Boolean) - is - procedure Change_Parameters_Type_Code_Action; - -- Checks if the Change Parameters Type refactoring tool is avaiable, - -- and if so, appends a Code Action with its Command. - - procedure Change_Parameters_Default_Value_Code_Action; - -- Checks if the Change Parameters Default Value refactoring tool is - -- avaiable, and if so, appends a Code Action with its Command. - - procedure Extract_Subprogram_Code_Action; - -- Checks if the Extract Subprogram refactoring tool is available, - -- and if so, appends a Code Action with its Command. - - procedure Introduce_Parameter_Code_Action; - -- Checks if the Introduce Parameter refactoring tool is available, - -- and if so, appends a Code Action with its Command. - - procedure Import_Package_Code_Action; - -- Checks if the Import Package code assist is available, - -- and if so, appends a Code Aciton with its Command. - - procedure Named_Parameters_Code_Action; - -- Checks if the Named Parameters refactoring is available, and if - -- so, appends a Code Action with its Command. - - procedure Pull_Up_Declaration_Code_Action; - -- Checks if the Pull Up Declaration refactoring tool is available, - -- and if so, appends a Code Action with its Command. - - procedure Replace_Type_Code_Action; - -- Checks if the Replace Type refactoring tool is available, - -- and if so, appends a Code Action with its Command. - - procedure Sort_Dependencies_Code_Action; - -- Checks if the Sort Dependencies refactoring tool is available, - -- and if so, appends a Code Action with its Command. - - ---------------------------------------- - -- Change_Parameters_Type_Code_Action -- - ---------------------------------------- - - procedure Change_Parameters_Type_Code_Action is - use Langkit_Support.Slocs; - use LAL_Refactor.Subprogram_Signature.Change_Parameters_Type; - use LSP.Ada_Handlers.Refactor.Change_Parameters_Type; - - Span : constant Source_Location_Range := - (Langkit_Support.Slocs.Line_Number (Params.span.first.line) + 1, - Langkit_Support.Slocs.Line_Number (Params.span.last.line) + 1, - Column_Number (Params.span.first.character) + 1, - Column_Number (Params.span.last.character) + 1); - - Syntax_Rules : Laltools.Common.Grammar_Rule_Vector; - - Change_Parameters_Type_Command : Command; - - begin - if Is_Change_Parameters_Type_Available - (Unit => Node.Unit, - Parameters_Source_Location_Range => Span, - New_Parameter_Syntax_Rules => Syntax_Rules) - then - Change_Parameters_Type_Command.Append_Code_Action - (Context => Context, - Commands_Vector => Result, - Where => - (uri => Params.textDocument.uri, - span => Params.span, - alsKind => LSP.Messages.Empty_Set), - Syntax_Rules => Syntax_Rules); - - Found := True; - end if; - end Change_Parameters_Type_Code_Action; - - ------------------------------------------------- - -- Change_Parameters_Default_Value_Code_Action -- - ------------------------------------------------- - - procedure Change_Parameters_Default_Value_Code_Action is - use Langkit_Support.Slocs; - use LAL_Refactor.Subprogram_Signature. - Change_Parameters_Default_Value; - use LSP.Ada_Handlers.Refactor.Change_Parameters_Default_Value; - - Span : constant Source_Location_Range := - (Langkit_Support.Slocs.Line_Number (Params.span.first.line) + 1, - Langkit_Support.Slocs.Line_Number (Params.span.last.line) + 1, - Column_Number (Params.span.first.character) + 1, - Column_Number (Params.span.last.character) + 1); - - Change_Parameters_Default_Value_Command : Command; - - begin - if Is_Change_Parameters_Default_Value_Available - (Unit => Node.Unit, - Parameters_Source_Location_Range => Span) - then - Change_Parameters_Default_Value_Command.Append_Code_Action - (Context => Context, - Commands_Vector => Result, - Where => - (uri => Params.textDocument.uri, - span => Params.span, - alsKind => LSP.Messages.Empty_Set)); - - Found := True; - end if; - end Change_Parameters_Default_Value_Code_Action; - - ------------------------------------ - -- Extract_Subprogram_Code_Action -- - ------------------------------------ - - procedure Extract_Subprogram_Code_Action is - use LSP.Ada_Handlers.Refactor.Extract_Subprogram; - use Langkit_Support.Slocs; - use LAL_Refactor.Extract_Subprogram; - use type LSP.Messages.Position; - - Single_Location : constant Boolean := - Params.span.first = Params.span.last; - - Section_To_Extract_SLOC : constant Source_Location_Range := - (Langkit_Support.Slocs.Line_Number (Params.span.first.line) + 1, - Langkit_Support.Slocs.Line_Number (Params.span.last.line) + 1, - Column_Number (Params.span.first.character) + 1, - Column_Number (Params.span.last.character) + 1); - - Available_Subprogram_Kinds : Available_Subprogram_Kinds_Type; - - Extract_Subprogram_Command : Command; - - begin - if not Single_Location then - if Is_Extract_Subprogram_Available - (Node.Unit, - Section_To_Extract_SLOC, - Available_Subprogram_Kinds) - then - if Available_Subprogram_Kinds (Ada_Subp_Kind_Procedure) then - Extract_Subprogram_Command.Append_Code_Action - (Context => Context, - Commands_Vector => Result, - Where => - (Params.textDocument.uri, - Params.span, - LSP.Messages.Empty_Set), - Subprogram_Kind => - Ada_Subp_Kind_Procedure); - end if; - - if Available_Subprogram_Kinds (Ada_Subp_Kind_Function) then - Extract_Subprogram_Command.Append_Code_Action - (Context => Context, - Commands_Vector => Result, - Where => - (Params.textDocument.uri, - Params.span, - LSP.Messages.Empty_Set), - Subprogram_Kind => - Ada_Subp_Kind_Function); - end if; - - Found := True; - end if; - end if; - end Extract_Subprogram_Code_Action; - - ------------------------------------- - -- Introduce_Parameter_Code_Action -- - ------------------------------------- - - procedure Introduce_Parameter_Code_Action is - use Langkit_Support.Slocs; - use LAL_Refactor.Introduce_Parameter; - use LSP.Ada_Handlers.Refactor.Introduce_Parameter; - - Span : constant Source_Location_Range := - (Langkit_Support.Slocs.Line_Number (Params.span.first.line) + 1, - Langkit_Support.Slocs.Line_Number (Params.span.last.line) + 1, - Column_Number (Params.span.first.character) + 1, - Column_Number (Params.span.last.character) + 1); - - Introduce_Parameter_Command : Command; - - begin - if Is_Introduce_Parameter_Available - (Unit => Node.Unit, - SLOC_Range => Span) - then - Introduce_Parameter_Command.Append_Code_Action - (Context => Context, - Commands_Vector => Result, - Where => - (uri => Params.textDocument.uri, - span => Params.span, - alsKind => LSP.Messages.Empty_Set)); - - Found := True; - end if; - end Introduce_Parameter_Code_Action; - - -------------------------------- - -- Import_Package_Code_Action -- - -------------------------------- - - procedure Import_Package_Code_Action is - use Libadalang.Analysis; - use LAL_Refactor.Refactor_Imports; - use LSP.Messages; - - Single_Location : constant Boolean := - Params.span.first = Params.span.last; - - Units_Vector : Libadalang.Helpers.Unit_Vectors.Vector; - Units_Array : constant Analysis_Unit_Array := - Context.Analysis_Units; - - Import_Suggestions : Import_Suggestions_Vector.Vector; - - function Is_Import_Suggestions_Available - (This_Node : Ada_Node'Class) - return Boolean; - -- Checks if This_Node is a suitable node to get import - -- suggestions. A suitable node must be an identifier, non - -- defining and if it resolves, it must be to a declaration not - -- declared in the standard package. - -- This function also prepares Units_Vector with the right units - -- where suggestions should be searched for. - - ------------------------------------- - -- Is_Import_Suggestions_Available -- - ------------------------------------- - - function Is_Import_Suggestions_Available - (This_Node : Ada_Node'Class) - return Boolean - is - Aux_Node : Ada_Node := - (if This_Node.Is_Null then No_Ada_Node - else This_Node.As_Ada_Node); - Referenced_Definition : Defining_Name := No_Defining_Name; - - begin - -- Only get suggestions for Identifiers or Dotted_Names - if Aux_Node.Is_Null - or else Aux_Node.Kind not in - Ada_Identifier_Range | Ada_Dotted_Name_Range - then - return False; - end if; - - -- Get the full Dotted_Name if applicable - while not Aux_Node.Is_Null - and then not Aux_Node.Parent.Is_Null - and then Aux_Node.Parent.Kind in Ada_Dotted_Name_Range - loop - Aux_Node := Aux_Node.Parent; - end loop; - - -- Defining names do not need prefixes - if Aux_Node.Is_Null or else Aux_Node.As_Name.P_Is_Defining then - return False; - end if; - - Referenced_Definition := - Aux_Node.As_Name.P_Referenced_Defining_Name; - - -- Declarations in the standard package do not need prefixes - if not Referenced_Definition.Is_Null then - if Referenced_Definition.Unit = Node.P_Standard_Unit then - return False; - end if; - end if; - - if Referenced_Definition.Is_Null then - -- The name could not be resolved so a full search needs to - -- be done. - - for U of Units_Array loop - Units_Vector.Append (U); - end loop; - - -- Add runtime analysis units for this context - -- ??? If possible, this should be cached. - - for F in Self.Project_Predefined_Sources.Iterate loop - declare - VF : GNATCOLL.VFS.Virtual_File renames - LSP.Ada_File_Sets.File_Sets.Element (F); - begin - Units_Vector.Append - (Context.LAL_Context.Get_From_File - (VF.Display_Full_Name, - -- ??? What is the charset for predefined - -- files? - "")); - end; - end loop; - - else - -- Libadalang sometimes can resolve names that are not - -- withed. - -- For instance, with Ada.Text_IO, resolve - -- Ada.Text_IO.Put_Line, remove the Ada.Text_IO and then - -- resolve again Ada.Text_IO.Put_Line. Even though - -- Ada.Text_IO is no longer withed, Libadalang is still - -- able to resolve Put_Line. - -- For such cases, include only Referenced_Definition's - -- Analysis_Units and the tool will suggest the prefixes - -- (there can be more than one, for instance, when there - -- are nested packages. - Units_Vector.Append (Referenced_Definition.Unit); - end if; - - return True; - exception - when others => return False; - end Is_Import_Suggestions_Available; - - begin - if not Single_Location - or else not Is_Import_Suggestions_Available (Node) - then - return; - end if; - - -- Get suggestions for all reachable declarations. - -- Each suggestion contains a with clause and a - -- prefix. - - Import_Suggestions := - Get_Import_Suggestions (Node, Units_Vector); - - -- Create a new codeAction command for each suggestion - - for Suggestion of Import_Suggestions loop - declare - Command : LSP.Ada_Handlers. - Refactor.Imports_Commands.Command; - begin - Command.Append_Suggestion - (Context => Context, - Where => - LSP.Lal_Utils.Get_Node_Location (Node), - Commands_Vector => Result, - Suggestion => Suggestion); - end; - end loop; - - if not Import_Suggestions.Is_Empty then - Found := True; - end if; - end Import_Package_Code_Action; - - ---------------------------------- - -- Named_Parameters_Code_Action -- - ---------------------------------- - - procedure Named_Parameters_Code_Action is - Aux_Node : Libadalang.Analysis.Ada_Node := Node; - Done : Boolean := False; - -- We propose only one choice of Named_Parameters refactoring per - -- request. So, if a user clicks on `1` in `A (B (1))` we propose - -- the refactoring for B (1), but not for A (...) call. We - -- consider this as better user experience. - -- - -- This boolean filter to detect such refactoring duplication. - - procedure Append_Command (Node : Libadalang.Analysis.Ada_Node); - -- Contruct a command and append it to Result - - -------------------- - -- Append_Command -- - -------------------- - - procedure Append_Command (Node : Libadalang.Analysis.Ada_Node) is - Command : LSP.Ada_Handlers.Named_Parameters_Commands.Command; - Pointer : LSP.Commands.Command_Pointer; - Item : LSP.Messages.CodeAction; - Where : constant LSP.Messages.Location := - LSP.Lal_Utils.Get_Node_Location (Node); - - begin - Command.Initialize - (Context => Context.all, - Where => ((uri => Where.uri), Where.span.first)); - - Pointer.Set (Command); - - Item := - (title => "Name parameters in the call", - kind => (Is_Set => True, - Value => LSP.Messages.RefactorRewrite), - diagnostics => (Is_Set => False), - disabled => (Is_Set => False), - edit => (Is_Set => False), - isPreferred => (Is_Set => False), - command => (Is_Set => True, - Value => - (Is_Unknown => False, - title => <>, - Custom => Pointer))); - - Result.Append (Item); - - Done := True; - Found := True; - end Append_Command; - - begin - while not Done and then not Aux_Node.Is_Null loop - case Aux_Node.Kind is - when Libadalang.Common.Ada_Stmt - | Libadalang.Common.Ada_Basic_Decl => - - Done := True; - - when Libadalang.Common.Ada_Basic_Assoc_List => - if Has_Assoc_Without_Designator - (Aux_Node.As_Basic_Assoc_List) - then - Append_Command (Aux_Node); - end if; - - when Libadalang.Common.Ada_Call_Expr => - declare - List : constant Libadalang.Analysis.Ada_Node := - Aux_Node.As_Call_Expr.F_Suffix; - - begin - if not List.Is_Null - and then List.Kind in - Libadalang.Common.Ada_Basic_Assoc_List - and then Has_Assoc_Without_Designator - (List.As_Basic_Assoc_List) - then - Append_Command (List); - end if; - end; - when others => - null; - end case; - - Aux_Node := Aux_Node.Parent; - end loop; - end Named_Parameters_Code_Action; - - ------------------------------------- - -- Pull_Up_Declaration_Code_Action -- - ------------------------------------- - - procedure Pull_Up_Declaration_Code_Action is - use Langkit_Support.Slocs; - use Libadalang.Analysis; - use LAL_Refactor.Pull_Up_Declaration; - use LSP.Ada_Handlers.Refactor.Pull_Up_Declaration; - use LSP.Messages; - - -- This code action is not available when a range of text is - -- selected. - - Single_Location : constant Boolean := - Params.span.first = Params.span.last; - Location : constant Source_Location := - (Langkit_Support.Slocs.Line_Number (Params.span.first.line) + 1, - Column_Number (Params.span.first.character) + 1); - - Pull_Up_Declaration_Command : - LSP.Ada_Handlers.Refactor.Pull_Up_Declaration.Command; - - begin - if Single_Location - and then Is_Pull_Up_Declaration_Available (Node.Unit, Location) - then - Pull_Up_Declaration_Command.Append_Code_Action - (Context => Context, - Commands_Vector => Result, - Where => - (uri => Params.textDocument.uri, - span => Params.span, - alsKind => Empty_Set)); - - Found := True; - end if; - end Pull_Up_Declaration_Code_Action; - - ------------------------------ - -- Replace_Type_Code_Action -- - ------------------------------ - - procedure Replace_Type_Code_Action is - use LSP.Ada_Handlers.Refactor.Replace_Type; - use LAL_Refactor.Replace_Type; - - use Langkit_Support.Slocs; - - Location : constant Source_Location := - (Langkit_Support.Slocs.Line_Number (Params.span.first.line) + 1, - Column_Number (Params.span.first.character) + 1); - - Replace_Type_Command : - LSP.Ada_Handlers.Refactor.Replace_Type.Command; - - begin - if Is_Replace_Type_Available (Node.Unit, Location) then - Replace_Type_Command.Append_Code_Action - (Context => Context, - Commands_Vector => Result, - Where => - (Params.textDocument.uri, - Params.span, - LSP.Messages.Empty_Set)); - - Found := True; - end if; - end Replace_Type_Code_Action; - - ----------------------------------- - -- Sort_Dependencies_Code_Action -- - ----------------------------------- - - procedure Sort_Dependencies_Code_Action is - use Langkit_Support.Slocs; - use Libadalang.Analysis; - use LAL_Refactor.Sort_Dependencies; - use LSP.Ada_Handlers.Refactor.Sort_Dependencies; - use LSP.Messages; - - Location : constant Source_Location := - (Langkit_Support.Slocs.Line_Number (Params.span.first.line) + 1, - Column_Number (Params.span.first.character) + 1); - - Sort_Dependencies_Command : - LSP.Ada_Handlers.Refactor.Sort_Dependencies.Command; - - begin - if Is_Sort_Dependencies_Available (Node.Unit, Location) then - Sort_Dependencies_Command.Append_Code_Action - (Context => Context, - Commands_Vector => Result, - Where => - (uri => Params.textDocument.uri, - span => Params.span, - alsKind => Empty_Set)); - - Found := True; - end if; - end Sort_Dependencies_Code_Action; - - begin - Named_Parameters_Code_Action; - - Sort_Dependencies_Code_Action; - - Import_Package_Code_Action; - - -- Refactoring Code Actions - - -- Extract Subprogram - Extract_Subprogram_Code_Action; - - -- Pull Up Declaration - Pull_Up_Declaration_Code_Action; - - -- These refactorings are only available for clients that can - -- provide user inputs: - -- - Add Parameter - -- - Change Parameters Type - -- - Change Parameters Default Value - - -- Add Parameter - if Self.Experimental_Client_Capabilities. - Advanced_Refactorings (Add_Parameter) - then - declare - use LSP.Ada_Handlers.Refactor.Add_Parameter; - use Libadalang.Analysis; - use LAL_Refactor.Subprogram_Signature; - use Langkit_Support.Slocs; - use type LSP.Messages.Position; - - -- This code action is not available when a range of text is - -- selected. - - Single_Location : constant Boolean := - Params.span.first = Params.span.last; - Location : constant Source_Location := - (if Single_Location then - (Langkit_Support.Slocs.Line_Number - (Params.span.first.line) + 1, - Column_Number (Params.span.first.character) + 1) - else - No_Source_Location); - - Requires_Full_Specification : Boolean; - - Add_Parameter_Commad : Command; - - begin - if Single_Location - and then Is_Add_Parameter_Available - (Node.Unit, - Location, - Requires_Full_Specification) - then - Add_Parameter_Commad.Append_Code_Action - (Context => Context, - Commands_Vector => Result, - Where => - (Params.textDocument.uri, - Params.span, - LSP.Messages.Empty_Set), - Requires_Full_Specification => - Requires_Full_Specification); - - Found := True; - end if; - end; - end if; - - -- Change Parameters Type - if Self.Experimental_Client_Capabilities. - Advanced_Refactorings (Change_Parameters_Type) - then - Change_Parameters_Type_Code_Action; - end if; - - -- Change Parameters Default Value - if Self.Experimental_Client_Capabilities. - Advanced_Refactorings (Change_Parameters_Default_Value) - then - Change_Parameters_Default_Value_Code_Action; - end if; - - -- Remove Parameter - declare - use LSP.Ada_Handlers.Refactor.Remove_Parameter; - use Libadalang.Analysis; - use LAL_Refactor.Subprogram_Signature; - use LAL_Refactor.Subprogram_Signature.Remove_Parameter; - - Target_Subp : Basic_Decl := No_Basic_Decl; - Parameter_Indices_Range : Parameter_Indices_Range_Type; - Remove_Parameter_Command : Command; - - begin - if Is_Remove_Parameter_Available - (Node, Target_Subp, Parameter_Indices_Range) - then - Remove_Parameter_Command.Append_Code_Action - (Context => Context, - Commands_Vector => Result, - Target_Subp => Target_Subp, - Parameters_Indices => Parameter_Indices_Range); - - Found := True; - end if; - end; - - -- Move Parameter - declare - use LSP.Ada_Handlers.Refactor.Move_Parameter; - use Libadalang.Analysis; - use LAL_Refactor.Subprogram_Signature; - - Target_Subp : Basic_Decl := No_Basic_Decl; - Parameter_Index : Positive; - Move_Directions : Move_Direction_Availability_Type; - Move_Parameter_Command : Command; - - begin - if Is_Move_Parameter_Available - (Node, Target_Subp, Parameter_Index, Move_Directions) - then - for Direction in Move_Direction_Type loop - if Move_Directions (Direction) then - Move_Parameter_Command.Append_Code_Action - (Context => Context, - Commands_Vector => Result, - Target_Subp => Target_Subp, - Parameter_Index => Parameter_Index, - Move_Direction => Direction); - end if; - end loop; - - Found := True; - end if; - end; - - -- Change Parameter Mode - declare - use LSP.Ada_Handlers.Refactor.Change_Parameter_Mode; - use Libadalang.Analysis; - use LAL_Refactor.Subprogram_Signature; - - Target_Subp : Basic_Decl := No_Basic_Decl; - Target_Parameters_Indices : Parameter_Indices_Range_Type; - Mode_Alternatives : Mode_Alternatives_Type; - Change_Parameter_Mode_Command : Command; - - begin - if Is_Change_Mode_Available - (Node, Target_Subp, Target_Parameters_Indices, Mode_Alternatives) - then - for Alternative of Mode_Alternatives loop - Change_Parameter_Mode_Command.Append_Code_Action - (Context => Context, - Commands_Vector => Result, - Target_Subp => Target_Subp, - Parameters_Indices => Target_Parameters_Indices, - New_Mode => Alternative); - end loop; - - Found := True; - end if; - end; - - -- Introduce Parameter - Introduce_Parameter_Code_Action; - - -- Suppress Subprogram - declare - use LSP.Ada_Handlers.Refactor.Suppress_Seperate; - use Libadalang.Analysis; - use LAL_Refactor.Suppress_Separate; - - Target_Separate : Basic_Decl := No_Basic_Decl; - Suppress_Separate_Command : Command; - begin - if Is_Suppress_Separate_Available (Node, Target_Separate) then - Suppress_Separate_Command.Append_Code_Action - (Context => Context, - Commands_Vector => Result, - Target_Separate => Target_Separate); - - Found := True; - end if; - end; - - -- Replace Type - if Self.Experimental_Client_Capabilities. - Advanced_Refactorings (Replace_Type) - then - Replace_Type_Code_Action; - end if; - end Analyse_Node; - - ------------------------ - -- Analyse_In_Context -- - ------------------------ - - procedure Analyse_In_Context - (Context : Context_Access; - Document : LSP.Ada_Documents.Document_Access; - Result : out LSP.Messages.CodeAction_Vector; - Found : in out Boolean) - is - Node : constant Libadalang.Analysis.Ada_Node := - Document.Get_Node_At (Context.all, Params.span.first); - begin - if Node.Is_Null then - Found := False; - return; - end if; - - Analyse_Node (Context, Node, Result, Found); - end Analyse_In_Context; - - ---------------------------------------- - -- Append_Project_Status_Code_Actions -- - ---------------------------------------- - - procedure Append_Project_Status_Code_Actions - (Result : in out LSP.Messages.CodeAction_Vector) - is - use type VSS.Strings.Virtual_String; - - Diagnostics : LSP.Messages.Diagnostic_Vector; - - begin - for Item of Params.context.diagnostics loop - if Item.source.Is_Set and then Item.source.Value = "project" then - Diagnostics.Append (Item); - end if; - end loop; - - case Self.Project_Status is - when Valid_Project_Configured | Alire_Project => - null; - when No_Runtime_Found => - -- TODO: Provide help with the compiler installation - null; - when Single_Project_Found | Multiple_Projects_Found => - declare - Item : LSP.Messages.CodeAction; - Command : LSP.Messages.Command (Is_Unknown => True); - Arg : constant LSP.Types.LSP_Any := - LSP.Types.Create ("ada.projectFile"); - begin - Command.title := "Open settings for ada.projectFile"; - Command.command := "workbench.action.openSettings"; - Command.arguments := (Is_Set => True, Value => <>); - Command.arguments.Value.Append (Arg); - - Item := - (title => Command.title, - kind => (True, LSP.Messages.QuickFix), - diagnostics => (True, Diagnostics), - disabled => (Is_Set => False), - edit => (Is_Set => False), - isPreferred => LSP.Types.True, - command => (True, Command)); - - Result.Append (Item); - end; - when No_Project_Found => - declare - Title : constant VSS.Strings.Virtual_String := - "Create a default project file (default.gpr)"; - URI : constant LSP.Messages.DocumentUri := - LSP.Types.File_To_URI - (Self.Root.Join ("default.gpr").Display_Full_Name); - Create : constant LSP.Messages.Document_Change := - (LSP.Messages.Create_File, - (kind => LSP.Messages.create, - uri => URI, - others => <>)); - Text : constant LSP.Messages.AnnotatedTextEdit := - ((span => ((0, 0), (0, 0)), - newText => "project Default is end Default;", - others => <>)); - Insert : constant LSP.Messages.Document_Change := - (LSP.Messages.Text_Document_Edit, - (textDocument => (uri => URI, others => <>), - edits => LSP.Messages.To_Vector (Text, 1))); - Item : LSP.Messages.CodeAction; - Edit : LSP.Messages.WorkspaceEdit; - begin - Edit.documentChanges.Append (Create); - Edit.documentChanges.Append (Insert); - Item := - (title => Title, - kind => (True, LSP.Messages.QuickFix), - diagnostics => (True, Diagnostics), - disabled => (Is_Set => False), - edit => (True, Edit), - isPreferred => LSP.Types.True, - command => (Is_Set => False)); - - Result.Append (Item); - end; - when Invalid_Project_Configured => - null; - end case; - end Append_Project_Status_Code_Actions; - - use type LSP.Messages.Position; - - Document : constant LSP.Ada_Documents.Document_Access := - Get_Open_Document (Self, Params.textDocument.uri); - - Response : LSP.Messages.Server_Responses.CodeAction_Response - (Is_Error => False); - - Found : Boolean := False; - begin - if Document = null then - Self.Log_Unexpected_Null_Document ("On_CodeAction_Request"); - return Response; - end if; - - -- Find any context where we can do some refactoring - for C of Self.Contexts_For_URI (Params.textDocument.uri) loop - Analyse_In_Context (C, Document, Response.result, Found); - - exit when Request.Canceled or else Found; - end loop; - - if Params.span.first = (0, 0) then - Append_Project_Status_Code_Actions (Response.result); - end if; - - return Response; - end On_CodeAction_Request; - - -------------------------------- - -- On_Execute_Command_Request -- - -------------------------------- - - overriding function On_Execute_Command_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Execute_Command_Request) - return LSP.Messages.Server_Responses.ExecuteCommand_Response - is - Error : LSP.Errors.Optional_ResponseError; - Params : LSP.Messages.ExecuteCommandParams renames - Request.params; - Response : LSP.Messages.Server_Responses.ExecuteCommand_Response - (Is_Error => True); - - begin - if Params.Is_Unknown or else Params.Custom.Is_Null then - Response.error := - (True, - (code => LSP.Errors.InternalError, - message => "Not implemented", - data => <>)); - return Response; - end if; - - declare - Command : constant LSP.Commands.Command'Class := - Params.Custom.Unchecked_Get.all; - begin - Command.Execute - (Handler => Self, - Client => Self.Server, - Error => Error); - - if Error.Is_Set then - Response.error := Error; - - return Response; - end if; - - -- No particular response in case of success. - return (Is_Error => False, - error => (Is_Set => False), - others => <>); - end; - end On_Execute_Command_Request; - - ---------------------------- - -- On_Declaration_Request -- - ---------------------------- - - overriding function On_Declaration_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Declaration_Request) - return LSP.Messages.Server_Responses.Location_Link_Response - is - - Value : LSP.Messages.DeclarationParams renames - Request.params; - Response : LSP.Messages.Server_Responses.Location_Link_Response - (Is_Error => False); - Imprecise : Boolean := False; - - Display_Method_Ancestry_Policy : - LSP.Messages.AlsDisplayMethodAncestryOnNavigationPolicy := - Self.Display_Method_Ancestry_Policy; - - Document : constant LSP.Ada_Documents.Document_Access := - Get_Open_Document (Self, Value.textDocument.uri); - - begin - -- Override the displayMethodAncestryOnNavigation global configuration - -- flag if there is on embedded in the request. - if Value.alsDisplayMethodAncestryOnNavigation.Is_Set then - Display_Method_Ancestry_Policy := - Value.alsDisplayMethodAncestryOnNavigation.Value; - end if; - - for C of Self.Contexts_For_URI (Value.textDocument.uri) loop - C.Append_Declarations - (Document, - LSP.Messages.TextDocumentPositionParams (Value), - Display_Method_Ancestry_Policy, - Response.result, - Imprecise); - - exit when Request.Canceled; - end loop; - - if Imprecise then - Self.Show_Imprecise_Reference_Warning ("declaration"); - end if; - - Sort_And_Remove_Duplicates (Response.result.Locations); - return Response; - end On_Declaration_Request; - - ------------------------------- - -- On_Implementation_Request -- - ------------------------------- - - overriding function On_Implementation_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Implementation_Request) - return LSP.Messages.Server_Responses.Location_Link_Response - is - use Libadalang.Analysis; - use LSP.Messages; - - Value : LSP.Messages.ImplementationParams renames - Request.params; - Response : LSP.Messages.Server_Responses.Location_Link_Response - (Is_Error => False); - Imprecise : Boolean := False; - - Display_Method_Ancestry_Policy : - LSP.Messages.AlsDisplayMethodAncestryOnNavigationPolicy := - Self.Display_Method_Ancestry_Policy; - - Document : constant LSP.Ada_Documents.Document_Access := - Get_Open_Document (Self, Value.textDocument.uri); - - procedure Resolve_In_Context (C : Context_Access); - -- Utility function to gather results on one context - - ------------------------ - -- Resolve_In_Context -- - ------------------------ - - procedure Resolve_In_Context (C : Context_Access) is - Name_Node : constant Name := Laltools.Common.Get_Node_As_Name - (C.Get_Node_At (Document, Value)); - - procedure Update_Response - (Bodies : Laltools.Common.Bodies_List.List; - Kind : LSP.Messages.AlsReferenceKind_Set); - -- Utility function to update response with the bodies - - --------------------- - -- Update_Response -- - --------------------- - - procedure Update_Response - (Bodies : Laltools.Common.Bodies_List.List; - Kind : LSP.Messages.AlsReferenceKind_Set) - is - begin - for E of Bodies loop - Append_Location - (Response.result, - E, - Kind); - end loop; - end Update_Response; - - Definition : Defining_Name; - This_Imprecise : Boolean; - Find_All_Imprecise : Boolean; - Decl : Basic_Decl; - - begin - if Name_Node = No_Name then - return; - end if; - - -- Find the definition - Definition := Laltools.Common.Resolve_Name - (Name_Node, Self.Trace, This_Imprecise); - Imprecise := Imprecise or This_Imprecise; - - -- If we didn't find a definition, give up for this context - if Definition = No_Defining_Name then - return; - end if; - - -- First list the bodies of this definition - Update_Response - (Laltools.Common.List_Bodies_Of - (Definition, Self.Trace, Imprecise), - LSP.Messages.Empty_Set); - - -- Then list the bodies of the parent implementations - Decl := Definition.P_Basic_Decl; - - -- Display overriding/overridden subprograms depending on the - -- displayMethodAncestryOnNavigation flag. - if Display_Method_Ancestry_Policy in Definition_Only | Always - or else - (Display_Method_Ancestry_Policy = Usage_And_Abstract_Only - and then Decl.Kind in Ada_Abstract_Subp_Decl_Range) - then - for Subp of C.Find_All_Base_Declarations (Decl, Find_All_Imprecise) - loop - Update_Response - (Laltools.Common.List_Bodies_Of - (Subp.P_Defining_Name, Self.Trace, This_Imprecise), - Is_Parent); - Imprecise := Imprecise or This_Imprecise; - end loop; - Imprecise := Imprecise or Find_All_Imprecise; - - -- And finally the bodies of child implementations - for Subp of C.Find_All_Overrides (Decl, Find_All_Imprecise) loop - Update_Response - (Laltools.Common.List_Bodies_Of - (Subp.P_Defining_Name, Self.Trace, This_Imprecise), - Is_Child); - Imprecise := Imprecise or This_Imprecise; - end loop; - Imprecise := Imprecise or Find_All_Imprecise; - end if; - end Resolve_In_Context; - - begin - -- Override the displayMethodAncestryOnNavigation global configuration - -- flag if there is on embedded in the request. - if Value.alsDisplayMethodAncestryOnNavigation.Is_Set then - Display_Method_Ancestry_Policy := - Value.alsDisplayMethodAncestryOnNavigation.Value; - end if; - - for C of Self.Contexts_For_URI (Value.textDocument.uri) loop - Resolve_In_Context (C); - - exit when Request.Canceled; - end loop; - - if Imprecise then - Self.Show_Imprecise_Reference_Warning ("implementation"); - end if; - - Sort_And_Remove_Duplicates (Response.result.Locations); - return Response; - end On_Implementation_Request; - - --------------------------- - -- On_Definition_Request -- - --------------------------- - - overriding function On_Definition_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Definition_Request) - return LSP.Messages.Server_Responses.Location_Link_Response - is - use Libadalang.Analysis; - use LSP.Messages; - - Value : LSP.Messages.DefinitionParams renames - Request.params; - Response : LSP.Messages.Server_Responses.Location_Link_Response - (Is_Error => False); - Imprecise : Boolean := False; - - Display_Method_Ancestry_Policy : - LSP.Messages.AlsDisplayMethodAncestryOnNavigationPolicy := - Self.Display_Method_Ancestry_Policy; - - Document : constant LSP.Ada_Documents.Document_Access := - Get_Open_Document (Self, Value.textDocument.uri); - - procedure Resolve_In_Context (C : Context_Access); - -- Utility function, appends to Resonse.result all results of the - -- definition requests found in context C. - - ------------------------ - -- Resolve_In_Context -- - ------------------------ - - procedure Resolve_In_Context (C : Context_Access) is - Name_Node : constant Name := - Laltools.Common.Get_Node_As_Name - (C.Get_Node_At (Document, Value)); - Definition : Defining_Name; - Other_Part : Defining_Name; - Manual_Fallback : Defining_Name; - Definition_Node : Basic_Decl := No_Basic_Decl; - Decl_For_Find_Overrides : Basic_Decl := No_Basic_Decl; - Entry_Decl_Node : Entry_Decl := No_Entry_Decl; - begin - if Name_Node = No_Name then - return; - end if; - - -- Check if we are on some defining name - Definition := Laltools.Common.Get_Name_As_Defining (Name_Node); - - if Definition = No_Defining_Name then - Self.Imprecise_Resolve_Name (C, Value, Definition); - - if Definition /= No_Defining_Name then - Append_Location (Response.result, Definition); - - if Display_Method_Ancestry_Policy - in Usage_And_Abstract_Only | Always - then - Decl_For_Find_Overrides := Definition.P_Basic_Decl; - end if; - end if; - else -- If we are on a defining_name already - Other_Part := Laltools.Common.Find_Next_Part - (Definition, Self.Trace); - - Definition_Node := Definition.P_Basic_Decl; - - -- Search for overriding subprograms only if we are on an - -- abstract subprogram. - if Display_Method_Ancestry_Policy = Never - or else - (Display_Method_Ancestry_Policy = Usage_And_Abstract_Only - and then Definition_Node.Kind - not in Ada_Abstract_Subp_Decl_Range) - then - Decl_For_Find_Overrides := No_Basic_Decl; - else - Decl_For_Find_Overrides := Definition_Node; - end if; - - -- Search for accept statements only if we are on an entry - if Definition_Node.Kind in Ada_Entry_Decl_Range then - Entry_Decl_Node := Definition_Node.As_Entry_Decl; - elsif Definition_Node.Kind in - Ada_Single_Task_Type_Decl_Range | Ada_Protected_Type_Decl_Range - then - -- These node types are not handled by Find_Next_Part - -- (LAL design limitations) - declare - Other_Part_For_Decl : constant Basic_Decl := - Laltools.Common.Find_Next_Part_For_Decl - (Definition_Node, Self.Trace); - begin - if Other_Part_For_Decl /= No_Basic_Decl then - Other_Part := Other_Part_For_Decl.P_Defining_Name; - end if; - end; - end if; - - if Other_Part = No_Defining_Name then - -- No next part is found. Check first defining name - Other_Part := Laltools.Common.Find_Canonical_Part - (Definition, Self.Trace); - end if; - - if Other_Part /= No_Defining_Name then - Append_Location (Response.result, Other_Part); - else - -- We were on a defining name, but did not manage to find - -- an answer using Find_Next_Part / Find_Canonical_Part. - -- Use the manual fallback to attempt to find a good enough - -- result. - Manual_Fallback := Laltools.Common.Find_Other_Part_Fallback - (Definition, Self.Trace); - - if Manual_Fallback /= No_Defining_Name then - -- We have found a result using the imprecise heuristics. - -- We'll warn the user and send the result. - Imprecise := True; - Append_Location (Response.result, Manual_Fallback); - end if; - end if; - end if; - - if Decl_For_Find_Overrides /= Libadalang.Analysis.No_Basic_Decl then - declare - Imprecise_Over : Boolean; - Imprecise_Base : Boolean; - Overriding_Subps : constant Basic_Decl_Array := - C.Find_All_Overrides - (Decl_For_Find_Overrides, - Imprecise_Results => Imprecise_Over); - Base_Subps : constant Basic_Decl_Array := - C.Find_All_Base_Declarations - (Decl_For_Find_Overrides, - Imprecise_Results => Imprecise_Base); - begin - for Subp of Base_Subps loop - Append_Location - (Response.result, Subp.P_Defining_Name, Is_Parent); - end loop; - for Subp of Overriding_Subps loop - Append_Location - (Response.result, Subp.P_Defining_Name, Is_Child); - end loop; - Imprecise := Imprecise or Imprecise_Over or Imprecise_Base; - end; - end if; - - if Entry_Decl_Node /= Libadalang.Analysis.No_Entry_Decl then - for Accept_Node of Entry_Decl_Node.P_Accept_Stmts loop - Append_Location - (Response.result, Accept_Node.F_Body_Decl.F_Name); - end loop; - end if; - end Resolve_In_Context; - - begin - -- Override the displayMethodAncestryOnNavigation global configuration - -- flag if there is on embedded in the request. - if Value.alsDisplayMethodAncestryOnNavigation.Is_Set then - Display_Method_Ancestry_Policy := - Value.alsDisplayMethodAncestryOnNavigation.Value; - end if; - - for C of Self.Contexts_For_URI (Value.textDocument.uri) loop - Resolve_In_Context (C); - - exit when Request.Canceled; - end loop; - - if Imprecise then - Self.Show_Imprecise_Reference_Warning ("definition"); - end if; - - Sort_And_Remove_Duplicates (Response.result.Locations); - return Response; - end On_Definition_Request; - - -------------------------------- - -- On_Type_Definition_Request -- - -------------------------------- - - overriding function On_Type_Definition_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Type_Definition_Request) - return LSP.Messages.Server_Responses.Location_Link_Response - is - use Libadalang.Analysis; - - Position : LSP.Messages.TextDocumentPositionParams renames - Request.params; - Response : LSP.Messages.Server_Responses.Location_Link_Response - (Is_Error => False); - Imprecise : Boolean := False; - - Document : constant LSP.Ada_Documents.Document_Access := - Get_Open_Document (Self, Position.textDocument.uri); - - procedure Resolve_In_Context (C : Context_Access); - -- Utility function to gather results on one context - - ------------------------ - -- Resolve_In_Context -- - ------------------------ - - procedure Resolve_In_Context (C : Context_Access) is - Name_Node : constant Name := Laltools.Common.Get_Node_As_Name - (C.Get_Node_At (Document, Position)); - Definition : Defining_Name; - Type_Decl : Base_Type_Decl; - begin - if Name_Node = No_Name then - return; - end if; - - if Name_Node.P_Is_Defining then - -- Special case if Name_Node is defining, for instance on the X in - -- X : My_Type; - declare - Def_Name : constant Defining_Name := - Name_Node.P_Enclosing_Defining_Name; - Type_Expr : constant Libadalang.Analysis.Type_Expr := - Def_Name.P_Basic_Decl.P_Type_Expression; - begin - if not Type_Expr.Is_Null then - Definition := Laltools.Common.Resolve_Name - (Type_Expr.P_Type_Name, Self.Trace, Imprecise); - end if; - end; - else - -- Name_Node is not defining. In this case we can rely on - -- P_Expression_Type. - Type_Decl := Name_Node.P_Expression_Type; - - -- P_Expression_Type returns the entire expression: narrow the - -- result down to the type declaration. Here we assume that the - -- first defining name in this expression is the name of the type. - if Type_Decl /= No_Type_Decl then - Definition := Type_Decl.P_Defining_Name; - end if; - end if; - - if Definition /= No_Defining_Name then - Append_Location (Response.result, Definition); - end if; - end Resolve_In_Context; - - begin - for C of Self.Contexts_For_URI (Position.textDocument.uri) loop - Resolve_In_Context (C); - - exit when Request.Canceled; - end loop; - - return Response; - end On_Type_Definition_Request; - - ------------------------------------------- - -- On_DidChangeTextDocument_Notification -- - ------------------------------------------- - - overriding procedure On_DidChangeTextDocument_Notification - (Self : access Message_Handler; - Value : LSP.Messages.DidChangeTextDocumentParams) - is - function Skip_Did_Change return Boolean; - -- Check if the following message in the queue is didChange for - -- the same document - - --------------------- - -- Skip_Did_Change -- - --------------------- - - function Skip_Did_Change return Boolean is - use type LSP.Servers.Message_Access; - - subtype DidChangeTextDocument_Notification is LSP.Messages - .Server_Notifications.DidChangeTextDocument_Notification; - - Next : constant LSP.Servers.Message_Access := - Self.Server.Look_Ahead_Message; - begin - if Next = null - or else Next.all not in - DidChangeTextDocument_Notification'Class - then - return False; - end if; - - declare - Object : DidChangeTextDocument_Notification'Class renames - DidChangeTextDocument_Notification'Class (Next.all); - Object_File : constant GNATCOLL.VFS.Virtual_File := - Self.To_File (Object.params.textDocument.uri); - Value_File : constant GNATCOLL.VFS.Virtual_File := - Self.To_File (Value.textDocument.uri); - begin - if Object_File /= Value_File then - return False; - end if; - end; - - return True; - end Skip_Did_Change; - - Document : constant LSP.Ada_Documents.Document_Access := - Get_Open_Document (Self, Value.textDocument.uri); - begin - if Document = null then - Self.Log_Unexpected_Null_Document - ("On_DidChangeTextDocument_Notification"); - end if; - - if Allow_Incremental_Text_Changes.Active then - -- If we are applying incremental changes, we can't skip the - -- call to Apply_Changes, since this would break synchronization. - Document.Apply_Changes - (Value.textDocument.version, - Value.contentChanges); - - -- However, we should skip the Indexing part if the next change in - -- the queue will re-change the text document. - if Skip_Did_Change then - return; - end if; - else - -- If we are not applying incremental changes, we can skip - -- Apply_Changes: the next change will contain the full text. - if Skip_Did_Change then - return; - end if; - Document.Apply_Changes - (Value.textDocument.version, - Value.contentChanges); - end if; - - -- Reindex the document in each of the contexts where it is relevant - - for Context of Self.Contexts_For_URI (Value.textDocument.uri) loop - Context.Index_Document (Document.all); - end loop; - - -- Emit diagnostics - Self.Publish_Diagnostics (Document); - end On_DidChangeTextDocument_Notification; - - ------------------------------------------ - -- On_DidCloseTextDocument_Notification -- - ------------------------------------------ - - overriding procedure On_DidCloseTextDocument_Notification - (Self : access Message_Handler; - Value : LSP.Messages.DidCloseTextDocumentParams) - is - URI : LSP.Messages.DocumentUri renames Value.textDocument.uri; - File : constant GNATCOLL.VFS.Virtual_File := Self.To_File (URI); - Diag : LSP.Messages.PublishDiagnosticsParams; - Document : Internal_Document_Access; - begin - if Self.Open_Documents.Contains (File) then - Document := Self.Open_Documents.Element (File); - - -- Remove the URI from the set of open documents now: this way, - -- the call to Flush_Document below will not attempt to reindex - -- from an open document, but from the file on disk. - Self.Open_Documents.Delete (File); - - for Context of Self.Contexts_For_URI (URI) loop - Context.Flush_Document (File); - end loop; - - Free (Document); - - else - -- We have received a didCloseTextDocument but the document was - -- not open: this is not supposed to happen, log it. - - Self.Trace.Trace - ("received a didCloseTextDocument for non-open document with uri: " - & To_UTF_8_String (URI)); - end if; - - -- Clean diagnostics up on closing document - if Self.Diagnostics_Enabled then - Diag.uri := URI; - Self.Server.On_Publish_Diagnostics (Diag); - end if; - end On_DidCloseTextDocument_Notification; - - ----------------------------------------- - -- On_DidOpenTextDocument_Notification -- - ----------------------------------------- - - overriding procedure On_DidOpenTextDocument_Notification - (Self : access Message_Handler; - Value : LSP.Messages.DidOpenTextDocumentParams) - is - URI : LSP.Messages.DocumentUri renames Value.textDocument.uri; - File : constant GNATCOLL.VFS.Virtual_File := Self.To_File (URI); - Object : constant Internal_Document_Access := - new LSP.Ada_Documents.Document (Self.Trace); - Diag : constant LSP.Diagnostic_Sources.Diagnostic_Source_Access := - new LSP.Ada_Handlers.Project_Diagnostics.Diagnostic_Source (Self); - begin - Self.Trace.Trace ("In Text_Document_Did_Open"); - Self.Trace.Trace ("Uri : " & To_UTF_8_String (URI)); - - -- Some clients don't properly call initialize, or don't pass the - -- project to didChangeConfiguration: fallback here on loading a - -- project in this directory, if needed. - Self.Ensure_Project_Loaded (URI); - - -- We have received a document: add it to the documents container - Object.Initialize (URI, Value.textDocument.text, Diag); - Self.Open_Documents.Include (File, Object); - - -- Handle the case where we're loading the implicit project: do - -- we need to add the directory in which the document is open? - - if Self.Project_Status in Implicit_Project_Loaded then - declare - Dir : constant Virtual_File := Self.To_File (URI).Dir; - begin - if not Self.Project_Dirs_Loaded.Contains (Dir) then - -- We do need to add this directory - Self.Project_Dirs_Loaded.Insert (Dir); - Self.Reload_Implicit_Project_Dirs; - end if; - end; - end if; - - -- Index the document in all the contexts where it is relevant - for Context of Self.Contexts_For_URI (URI) loop - Context.Index_Document (Object.all); - end loop; - - -- Emit diagnostics - Self.Publish_Diagnostics (LSP.Ada_Documents.Document_Access (Object)); - - Self.Trace.Trace ("Finished Text_Document_Did_Open"); - end On_DidOpenTextDocument_Notification; - - ------------------------------ - -- On_Folding_Range_Request -- - ------------------------------ - - overriding function On_Folding_Range_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Folding_Range_Request) - return LSP.Messages.Server_Responses.FoldingRange_Response - is - Value : LSP.Messages.FoldingRangeParams renames - Request.params; - - Context : constant Context_Access := - Self.Contexts.Get_Best_Context (Value.textDocument.uri); - Document : constant LSP.Ada_Documents.Document_Access := - Get_Open_Document (Self, Value.textDocument.uri); - Result : LSP.Messages.FoldingRange_Vector; - - package Canceled is new LSP.Generic_Cancel_Check (Request'Access, 127); - - begin - if Document /= null then - Document.Get_Folding_Blocks - (Context.all, - Self.Line_Folding_Only, - Self.Options.Folding.Comments, - Canceled.Has_Been_Canceled'Access, - Result); - - return Response : LSP.Messages.Server_Responses.FoldingRange_Response - (Is_Error => False) - do - if not Canceled.Has_Been_Canceled then - Response.result := Result; - end if; - end return; - - else - return Response : LSP.Messages.Server_Responses.FoldingRange_Response - (Is_Error => True) - do - Response.error := - (True, - (code => LSP.Errors.InternalError, - message => "Document is not opened", - data => <>)); - end return; - end if; - end On_Folding_Range_Request; - - -------------------------------- - -- On_Selection_Range_Request -- - -------------------------------- - - overriding function On_Selection_Range_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Selection_Range_Request) - return LSP.Messages.Server_Responses.SelectionRange_Response - is - pragma Unreferenced (Self, Request); - Response : LSP.Messages.Server_Responses.SelectionRange_Response - (Is_Error => True); - begin - Response.error := - (True, - (code => LSP.Errors.InternalError, - message => "Not implemented", - data => <>)); - return Response; - end On_Selection_Range_Request; - - -------------------------- - -- On_Highlight_Request -- - -------------------------- - - overriding function On_Highlight_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Highlight_Request) - return LSP.Messages.Server_Responses.Highlight_Response - is - use Libadalang.Analysis; - use LSP.Messages; - - Value : LSP.Messages.TextDocumentPositionParams renames - Request.params; - Context : constant Context_Access := - Self.Contexts.Get_Best_Context (Value.textDocument.uri); - Document : constant LSP.Ada_Documents.Document_Access := - Get_Open_Document (Self, Value.textDocument.uri); - File : constant GNATCOLL.VFS.Virtual_File := - Self.To_File (Value.textDocument.uri); - Response : LSP.Messages.Server_Responses.Highlight_Response - (Is_Error => False); - Definition : Defining_Name; - - procedure Callback - (Node : Libadalang.Analysis.Base_Id; - Kind : Libadalang.Common.Ref_Result_Kind; - Cancel : in out Boolean); - -- Called on each found reference. Used to append the reference to the - -- final result. - - function Get_Highlight_Kind - (Node : Ada_Node) return LSP.Messages.Optional_DocumentHighlightKind; - -- Fetch highlight kind for given node - - ------------------------ - -- Get_Highlight_Kind -- - ------------------------ - - function Get_Highlight_Kind - (Node : Ada_Node) return LSP.Messages.Optional_DocumentHighlightKind - is - Id : constant Name := Laltools.Common.Get_Node_As_Name (Node); - begin - if Id.P_Is_Write_Reference then - return LSP.Messages.Optional_DocumentHighlightKind' - (Is_Set => True, Value => Write); - else - return LSP.Messages.Optional_DocumentHighlightKind' - (Is_Set => True, Value => Read); - end if; - end Get_Highlight_Kind; - - -------------- - -- Callback -- - -------------- - - procedure Callback - (Node : Libadalang.Analysis.Base_Id; - Kind : Libadalang.Common.Ref_Result_Kind; - Cancel : in out Boolean) - is - pragma Unreferenced (Kind); - pragma Unreferenced (Cancel); - - begin - if not Laltools.Common.Is_End_Label (Node.As_Ada_Node) then - Append_Location - (Result => Response.result, - Document => Document, - File => File, - Node => Node, - Kind => Get_Highlight_Kind (Node.As_Ada_Node)); - end if; - - end Callback; - - begin - if Document /= null then - Self.Imprecise_Resolve_Name (Context, Value, Definition); - - if Definition = No_Defining_Name or else Request.Canceled then - return Response; - end if; - - -- Find all references will return all the references except the - -- declaration ... - Document.Find_All_References - (Context => Context.all, - Definition => Definition, - Callback => Callback'Access); - - -- ... add it manually - Append_Location - (Result => Response.result, - Document => Document, - File => File, - Node => Definition, - Kind => Get_Highlight_Kind (Definition.As_Ada_Node)); - end if; - return Response; - end On_Highlight_Request; - - ---------------------- - -- On_Hover_Request -- - ---------------------- - - overriding function On_Hover_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Hover_Request) - return LSP.Messages.Server_Responses.Hover_Response - is - use Libadalang.Analysis; - - Value : LSP.Messages.TextDocumentPositionParams renames - Request.params; - Response : LSP.Messages.Server_Responses.Hover_Response - (Is_Error => False); - - Defining_Name_Node : Defining_Name; - Decl : Basic_Decl; - Qualifier_Text : VSS.Strings.Virtual_String; - Decl_Text : VSS.Strings.Virtual_String; - Comments_Text : VSS.Strings.Virtual_String; - Location_Text : VSS.Strings.Virtual_String; - Aspects_Text : VSS.Strings.Virtual_String; - - C : constant Context_Access := - Self.Contexts.Get_Best_Context (Value.textDocument.uri); - -- For the Hover request, we're only interested in the "best" - -- response value, not in the list of values for all contexts - - begin - Self.Imprecise_Resolve_Name (C, Value, Defining_Name_Node); - - if Defining_Name_Node = No_Defining_Name then - return Response; - end if; - - -- Get the associated basic declaration - Decl := Defining_Name_Node.P_Basic_Decl; - - if Decl = No_Basic_Decl or else Request.Canceled then - return Response; - end if; - - LSP.Ada_Documentation.Get_Tooltip_Text - (BD => Decl, - Style => C.Get_Documentation_Style, - Declaration_Text => Decl_Text, - Qualifier_Text => Qualifier_Text, - Location_Text => Location_Text, - Documentation_Text => Comments_Text, - Aspects_Text => Aspects_Text); - - if Decl_Text.Is_Empty then - return Response; - end if; - - Response.result := (Is_Set => True, others => <>); - - -- Append the whole declaration text to the response - - Response.result.Value.contents.Vector.Append - (LSP.Messages.MarkedString' - (Is_String => False, - value => Decl_Text, - language => "ada")); - - -- Append qualifier text if any - - if not Qualifier_Text.Is_Empty then - Response.result.Value.contents.Vector.Append - (LSP.Messages.MarkedString' - (Is_String => True, - value => Qualifier_Text)); - end if; - - -- Append the declaration's location. - -- In addition, append the project's name if we are dealing with an - -- aggregate project. - - Location_Text := LSP.Lal_Utils.Node_Location_Image (Decl); - - if Self.Project_Tree.Root_Project.Kind in GPR2.Aggregate_Kind then - Location_Text.Append (VSS.Characters.Latin.Line_Feed); - Location_Text.Append ("As defined in project "); - Location_Text.Append (C.Id); - Location_Text.Append (" (other projects skipped)."); - end if; - - Response.result.Value.contents.Vector.Append - (LSP.Messages.MarkedString' - (Is_String => True, - value => Location_Text)); - - -- Append the comments associated with the basic declaration - -- if any. - - if not Comments_Text.Is_Empty then - Response.result.Value.contents.Vector.Append - (LSP.Messages.MarkedString' - (Is_String => False, - language => "plaintext", - value => Comments_Text)); - end if; - - -- Append text of aspects - - if not Aspects_Text.Is_Empty then - Response.result.Value.contents.Vector.Append - (LSP.Messages.MarkedString' - (Is_String => False, - value => Aspects_Text, - language => "ada")); - end if; - - return Response; - end On_Hover_Request; - - --------------------------- - -- On_References_Request -- - --------------------------- - - overriding function On_References_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.References_Request) - return LSP.Messages.Server_Responses.Location_Response - is - use Libadalang.Analysis; - - Value : LSP.Messages.ReferenceParams renames Request.params; - Response : LSP.Messages.Server_Responses.Location_Response - (Is_Error => False); - Imprecise : Boolean := False; - - Additional_Kinds : LSP.Messages.AlsReferenceKind_Array := - [others => False]; - - procedure Process_Context (C : Context_Access); - -- Process the references found in one context and append - -- them to Response.results. - - function Get_Reference_Kind - (Node : Ada_Node; - Is_Overriding_Decl : Boolean := False) - return LSP.Messages.AlsReferenceKind_Set; - -- Fetch reference kind for given node. - - ------------------------ - -- Get_Reference_Kind -- - ------------------------ - - function Get_Reference_Kind - (Node : Ada_Node; - Is_Overriding_Decl : Boolean := False) - return LSP.Messages.AlsReferenceKind_Set - is - use LSP.Messages; - - Id : constant Name := Laltools.Common.Get_Node_As_Name (Node); - Result : LSP.Messages.AlsReferenceKind_Set := LSP.Messages.Empty_Set; - begin - begin - Result.As_Flags (LSP.Messages.Write) := Id.P_Is_Write_Reference; - exception - when E : Libadalang.Common.Property_Error => - Log (Self.Trace, E); - end; - - begin - Result.As_Flags (LSP.Messages.Access_Ref) := - Laltools.Common.Is_Access_Ref (Id.As_Ada_Node); - exception - when E : Libadalang.Common.Property_Error => - Log (Self.Trace, E); - end; - - begin - Result.As_Flags (LSP.Messages.Static_Call) := Id.P_Is_Static_Call; - exception - when E : Libadalang.Common.Property_Error => - Log (Self.Trace, E); - end; - - begin - Result.As_Flags (LSP.Messages.Dispatching_Call) := - Id.P_Is_Dispatching_Call; - exception - when E : Libadalang.Common.Property_Error => - Log (Self.Trace, E); - end; - - begin - Result.As_Flags (LSP.Messages.Child) := - Laltools.Common.Is_Type_Derivation (Id.As_Ada_Node); - exception - when E : Libadalang.Common.Property_Error => - Log (Self.Trace, E); - end; - - Result.As_Flags (LSP.Messages.Overriding_Decl) := Is_Overriding_Decl; - - -- If the result has not any set flags at this point, flag it as a - -- simple reference. - if Result.As_Flags = AlsReferenceKind_Array'(others => False) then - Result.As_Flags (LSP.Messages.Simple) := True; - end if; - - -- Apply additional kinds - Result.As_Flags := Result.As_Flags or Additional_Kinds; - - return Result; - end Get_Reference_Kind; - - --------------------- - -- Process_Context -- - --------------------- - - procedure Process_Context (C : Context_Access) is - procedure Callback - (Node : Libadalang.Analysis.Base_Id; - Kind : Libadalang.Common.Ref_Result_Kind; - Cancel : in out Boolean); - - Count : Cancel_Countdown := 0; - - procedure Callback - (Node : Libadalang.Analysis.Base_Id; - Kind : Libadalang.Common.Ref_Result_Kind; - Cancel : in out Boolean) is - begin - Imprecise := Imprecise or Kind = Libadalang.Common.Imprecise; - - if not Laltools.Common.Is_End_Label (Node.As_Ada_Node) then - Count := Count - 1; - - Append_Location - (Response.result, - Node, - Get_Reference_Kind (Node.As_Ada_Node)); - end if; - - Cancel := Count = 0 and then Request.Canceled; - end Callback; - - Definition : Defining_Name; - - begin - - Self.Imprecise_Resolve_Name (C, Value, Definition); - - if Definition = No_Defining_Name or else Request.Canceled then - return; - end if; - - -- Set additional "reference" kind for enumeration literal - declare - Decl : constant Basic_Decl := P_Basic_Decl (Definition); - begin - if Decl /= No_Basic_Decl - and then Kind (Decl) = Ada_Enum_Literal_Decl - then - Additional_Kinds (LSP.Messages.Simple) := True; - end if; - - -- Find all the references - C.Find_All_References (Definition, Callback'Access); - - -- Find all the overriding declarations, if any - for Subp of C.Find_All_Overrides (Decl, Imprecise) loop - Append_Location - (Response.result, - Subp.P_Defining_Name, - Get_Reference_Kind - (Definition.As_Ada_Node, - Is_Overriding_Decl => True)); - end loop; - - if Value.context.includeDeclaration then - Append_Location - (Response.result, - Definition, - Get_Reference_Kind (Definition.As_Ada_Node)); - end if; - end; - end Process_Context; - - begin - for C of Self.Contexts_For_URI (Value.textDocument.uri) loop - Process_Context (C); - - exit when Request.Canceled; - end loop; - - if Imprecise then - Self.Show_Imprecise_Reference_Warning ("references"); - end if; - - Sort_And_Remove_Duplicates (Response.result); - return Response; - end On_References_Request; - - -------------------------------- - -- On_ALS_Source_Dirs_Request -- - -------------------------------- - - overriding function On_ALS_Source_Dirs_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.ALS_Source_Dirs_Request) - return LSP.Messages.Server_Responses.ALS_SourceDirs_Response - is - Response : LSP.Messages.Server_Responses.ALS_SourceDirs_Response - (Is_Error => False); - Unit_Desc : LSP.Messages.ALS_Source_Dir_Description; - Source_Dirs : constant GNATCOLL.VFS.File_Array := - Self.Contexts.All_Source_Directories - (Include_Externally_Built => True); - begin - for Dir of Source_Dirs loop - Unit_Desc := - (name => VSS.Strings.Conversions.To_Virtual_String - (+Dir.Base_Dir_Name), - uri => - File_To_URI (Dir.Display_Full_Name)); - Response.result.Append (Unit_Desc); - end loop; - - Self.Trace.Trace - ("Response.result.length: " & Response.result.Length'Img); - - return Response; - end On_ALS_Source_Dirs_Request; - - -------------------------------------- - -- On_ALS_Show_Dependencies_Request -- - -------------------------------------- - - overriding function On_ALS_Show_Dependencies_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.ALS_Show_Dependencies_Request) - return LSP.Messages.Server_Responses.ALS_ShowDependencies_Response - is - use LSP.Messages; - - Params : LSP.Messages.ALS_ShowDependenciesParams renames - Request.params; - Response : LSP.Messages.Server_Responses.ALS_ShowDependencies_Response - (Is_Error => False); - Document : constant LSP.Ada_Documents.Document_Access := - Get_Open_Document (Self, Params.textDocument.uri, Force => False); - Context : constant Context_Access := - Self.Contexts.Get_Best_Context (Params.textDocument.uri); - - begin - if Document = null then - Self.Log_Unexpected_Null_Document - ("On_ALS_Show_Dependencies_Request"); - return Response; - end if; - - case Params.kind is - when LSP.Messages.Show_Imported => - Document.Get_Imported_Units - (Context => Context.all, - Project_URI => Self.From_File (Self.Root), - Show_Implicit => Params.showImplicit, - Result => Response.result); - - when LSP.Messages.Show_Importing => null; - declare - Contexts : constant LSP.Ada_Context_Sets.Context_Lists.List := - Self.Contexts_For_URI (Params.textDocument.uri); - begin - for Context of Contexts loop - Document.Get_Importing_Units - (Context => Context.all, - Project_URI => Self.From_File (Self.Root), - Show_Implicit => Params.showImplicit, - Result => Response.result); - end loop; - end; - end case; - - return Response; - end On_ALS_Show_Dependencies_Request; - - -------------------------- - -- On_ALS_Debug_Request -- - -------------------------- - - overriding function On_ALS_Debug_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.ALS_Debug_Request) - return LSP.Messages.Server_Responses.ALS_Debug_Response is - begin - case Request.params.Kind is - when LSP.Messages.Suspend_Execution => - declare - Limit : constant LSP_Number := Request.params.inputQueueLength; - begin - while Self.Server.Input_Queue_Length < Integer (Limit) loop - delay 0.1; - end loop; - end; - end case; - - return Response : LSP.Messages.Server_Responses.ALS_Debug_Response - (Is_Error => False); - end On_ALS_Debug_Request; - - ------------------------------- - -- On_Signature_Help_Request -- - ------------------------------- - - overriding function On_Signature_Help_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Signature_Help_Request) - return LSP.Messages.Server_Responses.SignatureHelp_Response - is - use Langkit_Support.Slocs; - use Libadalang.Analysis; - use type VSS.Unicode.UTF16_Code_Unit_Offset; - - Value : LSP.Messages.SignatureHelpParams renames - Request.params; - Prev_Value : LSP.Messages.SignatureHelpParams := Value; - Response : LSP.Messages.Server_Responses.SignatureHelp_Response - (Is_Error => False); - - C : constant Context_Access := - Self.Contexts.Get_Best_Context (Value.textDocument.uri); - - Document : constant LSP.Ada_Documents.Document_Access := - Get_Open_Document (Self, Value.textDocument.uri); - - Node : Libadalang.Analysis.Ada_Node; - Sloc : Langkit_Support.Slocs.Source_Location; - begin - Response.result := (others => <>); - Sloc := Document.Get_Source_Location (Value.position); - - -- Move the cursor to the previous character: this is more resilient - -- to invalid code. - if Prev_Value.position.character > 0 then - Prev_Value.position.character := Prev_Value.position.character - 1; - end if; - Node := C.Get_Node_At (Document, Prev_Value); - - declare - Name_Node : constant Libadalang.Analysis.Name := - Laltools.Common.Get_Node_As_Name (Node); - begin - -- Is this a type cast? - if Name_Node /= No_Ada_Node - and then Name_Node.P_Name_Designated_Type /= No_Ada_Node - -- Does the cast make sense? - -- and then Active_Position = 0 - -- Do we have the previous signatures? - and then Value.context.Is_Set - and then Value.context.Value.activeSignatureHelp.Is_Set - then - -- At this point, the user is writing a typecast in a previous - -- signature => keep showing the previous signatures. - Response.result := Value.context.Value.activeSignatureHelp.Value; - return Response; - end if; - end; - - -- Try to get signatures before the cursor location - -- i.e "Foo (1,|" => "Foo (1|," - LSP.Ada_Completions.Parameters.Propose_Signatures - (Context => C, - Node => Node, - Cursor => Sloc, - Prev_Signatures => Value.context, - Res => Response.result); - - -- Retry to get signature in the previous non whitespace token - -- i.e. "Foo (1, 2 + |" => "Foo (1, 2 +|" - if Response.result.signatures.Is_Empty then - declare - Token : Libadalang.Common.Token_Reference := - C.Get_Token_At (Document, Prev_Value); - begin - if Token /= No_Token - and then Kind (Data (Token)) = Ada_Whitespace - then - Token := - Libadalang.Common.Previous (Token, Exclude_Trivia => True); - end if; - - Prev_Value.position := - To_Span - (Langkit_Support.Slocs.Start_Sloc - (Sloc_Range (Data (Token)))).first; - end; - - Node := C.Get_Node_At (Document, Prev_Value); - LSP.Ada_Completions.Parameters.Propose_Signatures - (Context => C, - Node => Node, - Cursor => Sloc, - Prev_Signatures => Value.context, - Res => Response.result); - end if; - - -- Retry to get signatures in the cursor position. - -- It handles the edge case of nested function closing - -- i.e. "Foo (Bar (1)|" - if Response.result.signatures.Is_Empty then - Node := C.Get_Node_At (Document, Value); - LSP.Ada_Completions.Parameters.Propose_Signatures - (Context => C, - Node => Node, - Cursor => Sloc, - Prev_Signatures => Value.context, - Res => Response.result); - end if; - - return Response; - end On_Signature_Help_Request; - - ----------------------------------- - -- On_Color_Presentation_Request -- - ----------------------------------- - - overriding function On_Color_Presentation_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Color_Presentation_Request) - return LSP.Messages.Server_Responses.ColorPresentation_Response - is - pragma Unreferenced (Self, Request); - Response : LSP.Messages.Server_Responses.ColorPresentation_Response - (Is_Error => True); - begin - Response.error := - (True, - (code => LSP.Errors.InternalError, - message => "Not implemented", - data => <>)); - return Response; - end On_Color_Presentation_Request; - - ------------------------------- - -- On_Document_Color_Request -- - ------------------------------- - - overriding function On_Document_Color_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Document_Color_Request) - return LSP.Messages.Server_Responses.DocumentColor_Response - is - pragma Unreferenced (Self, Request); - Response : LSP.Messages.Server_Responses.DocumentColor_Response - (Is_Error => True); - begin - Response.error := - (True, - (code => LSP.Errors.InternalError, - message => "Not implemented", - data => <>)); - return Response; - end On_Document_Color_Request; - - ------------------------------- - -- On_Document_Links_Request -- - ------------------------------- - - overriding function On_Document_Links_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Document_Links_Request) - return LSP.Messages.Server_Responses.Links_Response - is - pragma Unreferenced (Self, Request); - Response : LSP.Messages.Server_Responses.Links_Response - (Is_Error => True); - begin - Response.error := - (True, - (code => LSP.Errors.InternalError, - message => "Not implemented", - data => <>)); - return Response; - end On_Document_Links_Request; - - ------------------------------------- - -- On_Document_Tokens_Full_Request -- - ------------------------------------- - - overriding function On_Document_Tokens_Full_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Document_Tokens_Full_Request) - return LSP.Messages.Server_Responses.SemanticTokens_Response - is - Value : LSP.Messages.SemanticTokensParams renames Request.params; - Document : constant LSP.Ada_Documents.Document_Access := - Get_Open_Document (Self, Value.textDocument.uri, Force => False); - - Context : constant Context_Access := - Self.Contexts.Get_Best_Context (Value.textDocument.uri); - - Response : LSP.Messages.Server_Responses.SemanticTokens_Response - (Is_Error => False); - - Result : LSP.Messages.uinteger_Vector; - begin - if Document = null then - Self.Log_Unexpected_Null_Document - ("On_Document_Tokens_Full_Request"); - return Response; - end if; - - Result := Document.Get_Tokens (Context.all, Self.Highlighter); - Response.result.data.Move (Result); - - return Response; - end On_Document_Tokens_Full_Request; - - -------------------------------------- - -- On_Document_Tokens_Range_Request -- - -------------------------------------- - - overriding function On_Document_Tokens_Range_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Document_Tokens_Range_Request) - return LSP.Messages.Server_Responses.SemanticTokens_Response - is - Value : LSP.Messages.SemanticTokensRangeParams renames Request.params; - Document : constant LSP.Ada_Documents.Document_Access := - Get_Open_Document (Self, Value.textDocument.uri, Force => False); - - Context : constant Context_Access := - Self.Contexts.Get_Best_Context (Value.textDocument.uri); - - Response : LSP.Messages.Server_Responses.SemanticTokens_Response - (Is_Error => False); - - Result : LSP.Messages.uinteger_Vector; - begin - if Document = null then - Self.Log_Unexpected_Null_Document - ("On_Document_Tokens_Range_Request"); - return Response; - end if; - - Result := Document.Get_Tokens - (Context.all, Self.Highlighter, Value.span); - Response.result.data.Move (Result); - - return Response; - end On_Document_Tokens_Range_Request; - - --------------------------------- - -- On_Document_Symbols_Request -- - --------------------------------- - - overriding function On_Document_Symbols_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Document_Symbols_Request) - return LSP.Messages.Server_Responses.Symbol_Response - is - -- The list of symbols for one document shouldn't depend - -- on the project: we can just choose the best context for this. - Value : LSP.Messages.DocumentSymbolParams renames Request.params; - Document : constant LSP.Ada_Documents.Document_Access := - Get_Open_Document (Self, Value.textDocument.uri, Force => False); - Context : constant Context_Access := - Self.Contexts.Get_Best_Context (Value.textDocument.uri); - Result : LSP.Messages.Server_Responses.Symbol_Response := - (Is_Error => False, - result => <>, - error => (Is_Set => False), - others => <>); - - Pattern : constant Search_Pattern'Class := Build - (Pattern => Value.query, - Case_Sensitive => Value.case_sensitive = LSP.Types.True, - Whole_Word => Value.whole_word = LSP.Types.True, - Negate => Value.negate = LSP.Types.True, - Kind => - (if Value.kind.Is_Set - then Value.kind.Value - else LSP.Messages.Start_Word_Text)); - - package Canceled is new LSP.Generic_Cancel_Check (Request'Access, 127); - - begin - if Document = null then - declare - Document : LSP.Ada_Documents.Document_Access := - Get_Open_Document (Self, Value.textDocument.uri, Force => True); - begin - Self.Get_Symbols - (Document.all, Context.all, Pattern, - Canceled.Has_Been_Canceled'Access, Result.result); - - Free (Internal_Document_Access (Document)); - end; - else - Self.Get_Symbols - (Document.all, Context.all, Pattern, - Canceled.Has_Been_Canceled'Access, Result.result); - end if; - return Result; - end On_Document_Symbols_Request; - - ----------------------- - -- On_Rename_Request -- - ----------------------- - - overriding function On_Rename_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Rename_Request) - return LSP.Messages.Server_Responses.Rename_Response - is - use Libadalang.Analysis; - - Value : LSP.Messages.RenameParams renames Request.params; - Position : constant LSP.Messages.TextDocumentPositionParams := - (Value.textDocument, Value.position); - Response : LSP.Messages.Server_Responses.Rename_Response - (Is_Error => False); - -- If a rename problem is found when Process_Context is called, - -- then Edits.Diagnotics will not be empty. This Response will be - -- discarded and a new response with an error meessage is returned - -- instead. - -- If no problems are found, then this Response will contain all the - -- references to be renamed and is returned by this function. - Document : constant LSP.Ada_Documents.Document_Access := - Get_Open_Document (Self, Value.textDocument.uri); - - Safe_Renamer : LAL_Refactor.Safe_Rename.Safe_Renamer; - Algorithm : constant LAL_Refactor.Safe_Rename. - Problem_Finder_Algorithm_Kind := - LAL_Refactor.Safe_Rename.Analyse_AST; - - Context_Edits : LAL_Refactor.Refactoring_Edits; - -- Edits found for a particular context - All_Edits : LAL_Refactor.Refactoring_Edits; - -- When iterating over all contexts (and therefore all projects), it's - -- possible to encounter the same Text_Edit more than once, so this - -- stores all the unique edits - - Definition_Node : Defining_Name; - -- Used to retrieve the definition node found for a given context - - procedure Process_Context - (C : Context_Access; - Definition_Node : out Defining_Name); - -- Process the rename request for the given context, and add the - -- edits to `All_Edits`. - - function To_LSP_Diagnostic - (Problem : LAL_Refactor.Refactoring_Diagnostic'Class; - Definition_Node : Defining_Name) - return LSP.Messages.Diagnostic; - -- Convert a laltool refactoring diagnostic into a LSP one. - - --------------------- - -- Process_Context -- - --------------------- - - procedure Process_Context - (C : Context_Access; - Definition_Node : out Defining_Name) - is - use LAL_Refactor.Safe_Rename; - - Node : constant Ada_Node := C.Get_Node_At (Document, Position); - Name_Node : constant Libadalang.Analysis.Name := - Laltools.Common.Get_Node_As_Name (Node); - Definition : constant Defining_Name := - Laltools.Common.Resolve_Name_Precisely (Name_Node); - - function Attribute_Value_Provider_Callback - (Attribute : GPR2.Q_Attribute_Id; - Index : String := ""; - Default : String := ""; - Use_Extended : Boolean := False) - return String - is (C.Project_Attribute_Value - (Attribute, Index, Default, Use_Extended)); - - Attribute_Value_Provider : constant - GPR2_Attribute_Value_Provider_Access := - Attribute_Value_Provider_Callback'Unrestricted_Access; - - function Analysis_Units return Analysis_Unit_Array is - (C.Analysis_Units); - -- Callback needed to provide the analysis units to the safe rename - -- tool. - - procedure Process_Comments (Node : Ada_Node); - -- Iterate over all comments and include them in the response when - -- they contain a renamed word. - - procedure Process_File_Renames; - -- Merges Context_Edits.File_Renames into All_Edits.File_Renames - - procedure Process_References; - -- Merges Context_Edits.Text_Edits into All_Edits.Text_Edits and for - -- each Text_Edit (which represents a reference) processes its - -- references in comments. - - ----------------------- - -- Process_Comments -- - ----------------------- - - procedure Process_Comments (Node : Ada_Node) - is - use LAL_Refactor; - - File_Name : constant File_Name_Type := - Node.Unit.Get_Filename; - Token : Token_Reference := First_Token (Node.Unit); - Name : constant Wide_Wide_String := - Ada.Strings.Wide_Wide_Unbounded.To_Wide_Wide_String - (Laltools.Common.Get_Last_Name (Name_Node)); - Text_Edit : LAL_Refactor.Text_Edit; - Span : Langkit_Support.Slocs.Source_Location_Range; - Current : Token_Reference; - Diff : Integer; - - function Process_Box return Boolean; - -- Check whether Current is box header/footer and modify it. - -- Return False when the searching cycle should be stopped. - - ----------------- - -- Process_Box -- - ----------------- - - function Process_Box return Boolean is - use Langkit_Support.Text; - use Langkit_Support.Slocs; - - begin - if Current = No_Token then - return False; - end if; - - case Kind (Data (Current)) is - when Ada_Whitespace => - return True; - - when Ada_Comment => - declare - Value : constant Text_Type := Text (Current); - begin - for Idx in Value'Range loop - if Value (Idx) /= '-' then - return False; - end if; - end loop; - - if Diff > 0 then - -- Increase '-', Diff is positive - declare - Sloc : Source_Location_Range := - Sloc_Range (Data (Current)); - - begin - Sloc.Start_Column := Sloc.End_Column; - - LAL_Refactor.Safe_Insert - (All_Edits.Text_Edits, - File_Name, - LAL_Refactor.Text_Edit' - (Sloc, - Ada.Strings.Unbounded."*" (Diff, '-'))); - end; - - else - -- Decrease '-', Diff is negative - declare - Sloc : Source_Location_Range := - Sloc_Range (Data (Current)); - - begin - Sloc.Start_Column := - Sloc.End_Column - Column_Number (abs Diff); - - LAL_Refactor.Safe_Insert - (All_Edits.Text_Edits, - File_Name, - LAL_Refactor.Text_Edit' - (Sloc, Null_Unbounded_String)); - end; - end if; - - return False; - end; - - when others => - return False; - end case; - end Process_Box; - - begin - Diff := Natural (Value.newName.Character_Length) - Name'Length; - - while Token /= No_Token loop - declare - This_Span : Langkit_Support.Slocs.Source_Location_Range; - begin - if Kind (Data (Token)) = Ada_Comment - and then Laltools.Common.Contains - (Token, Name, True, This_Span) - then - Text_Edit.Location := This_Span; - Text_Edit.Text := - VSS.Strings.Conversions.To_Unbounded_UTF_8_String - (Value.newName); - - if Diff /= 0 - and then Laltools.Common.Contains - (Token, "-- " & Name & " --", False, Span) - then - -- Can be a comment box - Current := Previous (Token); - loop - -- Looking for the box header - exit when not Process_Box; - Current := Previous (Current); - end loop; - - -- Include corrected comment itself - LAL_Refactor.Safe_Insert - (All_Edits.Text_Edits, - Node.Unit.Get_Filename, - Text_Edit); - - Current := Next (Token); - loop - -- Looking for the box footer - exit when not Process_Box; - Current := Next (Current); - end loop; - else - LAL_Refactor.Safe_Insert - (All_Edits.Text_Edits, - Node.Unit.Get_Filename, - Text_Edit); - end if; - end if; - end; - - Token := Next (Token); - end loop; - end Process_Comments; - - -------------------------- - -- Process_File_Renames -- - -------------------------- - - procedure Process_File_Renames is - begin - All_Edits.File_Renames.Union (Context_Edits.File_Renames); - end Process_File_Renames; - - ------------------------ - -- Process_References -- - ------------------------ - - procedure Process_References - is - use LAL_Refactor; - - Text_Edits_Cursor : Text_Edit_Ordered_Maps.Cursor := - Context_Edits.Text_Edits.First; - - Unit : Analysis_Unit; -- Reference Unit - Node : Ada_Node; -- Reference Node - - begin - Text_Edits_Cursor := Context_Edits.Text_Edits.First; - - while Text_Edit_Ordered_Maps.Has_Element (Text_Edits_Cursor) loop - for Text_Edit of - Text_Edit_Ordered_Maps.Element (Text_Edits_Cursor) - loop - -- Check if we've already seen this reference from another - -- context. - - if not Contains - (All_Edits.Text_Edits, - Text_Edit_Ordered_Maps.Key (Text_Edits_Cursor), - Text_Edit) - then - -- First time we see this reference, so add it All_Edits - -- and process comments. - - Safe_Insert - (All_Edits.Text_Edits, - Text_Edit_Ordered_Maps.Key (Text_Edits_Cursor), - Text_Edit); - - Unit := C.Get_AU - (GNATCOLL.VFS.Create_From_UTF8 - (Text_Edit_Ordered_Maps.Key (Text_Edits_Cursor))); - Node := Unit.Root.Lookup - ((Text_Edit.Location.Start_Line, - Text_Edit.Location.Start_Column)); - - if Self.Options.Refactoring.Renaming.In_Comments then - Process_Comments (Node); - end if; - end if; - end loop; - - Text_Edits_Cursor := - Text_Edit_Ordered_Maps.Next (Text_Edits_Cursor); - end loop; - end Process_References; - - begin - Definition_Node := Definition; - - if Definition.Is_Null then - return; - end if; - - Safe_Renamer := LAL_Refactor.Safe_Rename.Create_Safe_Renamer - (Definition => Definition, - New_Name => - Libadalang.Text.To_Unbounded_Text - (VSS.Strings.Conversions.To_Wide_Wide_String (Value.newName)), - Algorithm => Algorithm, - Attribute_Value_Provider => Attribute_Value_Provider); - - Context_Edits := Safe_Renamer.Refactor (Analysis_Units'Access); - - -- If problems were found, do not continue processing references - - if not Context_Edits.Diagnostics.Is_Empty then - return; - end if; - - Process_References; - Process_File_Renames; - end Process_Context; - - ----------------------- - -- To_LSP_Diagnostic -- - ----------------------- - - function To_LSP_Diagnostic - (Problem : LAL_Refactor.Refactoring_Diagnostic'Class; - Definition_Node : Defining_Name) - return LSP.Messages.Diagnostic - is - Diagnostic : LSP.Messages.Diagnostic; - begin - Diagnostic := LSP.Messages.Diagnostic' - (span => - To_Span (Definition_Node.Sloc_Range), - severity => (True, LSP.Messages.Error), - code => <>, - codeDescription => <>, - source => - (True, To_Virtual_String ("Ada")), - message => - (if Self.Supports_Related_Diagnostics then - VSS.Strings.Conversions.To_Virtual_String - ("Can't rename identifier '" - & Langkit_Support.Text.To_UTF8 - (Definition_Node.Text) - & "'") - else VSS.Strings.Conversions.To_Virtual_String - (Problem.Info)), - tags => <>, - relatedInformation => <>); - - if Self.Supports_Related_Diagnostics then - Diagnostic.relatedInformation.Append - (LSP.Messages.DiagnosticRelatedInformation'( - location => LSP.Messages.Location' - (uri => File_To_URI (Problem.Filename), - span => To_Span (Problem.Location), - alsKind => <>), - message => VSS.Strings.Conversions.To_Virtual_String - (Problem.Info))); - end if; - - return Diagnostic; - end To_LSP_Diagnostic; - - begin - for C of Self.Contexts_For_URI (Value.textDocument.uri) loop - Process_Context (C, Definition_Node); - - -- If problems were found, send an error reponse and a diagnostic for - -- each issue. Do not proceed with the renames. - - if not Context_Edits.Diagnostics.Is_Empty then - return Response : LSP.Messages.Server_Responses.Rename_Response - (Is_Error => True) - do - declare - Diag_Params : LSP.Messages.PublishDiagnosticsParams; - Diagnostic : LSP.Messages.Diagnostic; - begin - -- For each problem detected in a given file by laltools, - -- convert it to a LSP diagnostic and publish them when - -- switching to another file. - - for Problem of Context_Edits.Diagnostics loop - Diagnostic := To_LSP_Diagnostic - (Problem, Definition_Node); - - if To_UTF_8_String (Diag_Params.uri) = "" or else - To_UTF_8_String (Diag_Params.uri) = Problem.Filename - then - Diag_Params.diagnostics.Append (Diagnostic); - Diag_Params.uri := Value.textDocument.uri; - else - Self.Server.On_Publish_Diagnostics (Diag_Params); - Diag_Params.uri := File_To_URI (""); - Diag_Params.diagnostics.Clear; - end if; - end loop; - - if not Diag_Params.diagnostics.Is_Empty then - Self.Server.On_Publish_Diagnostics (Diag_Params); - end if; - - Response.error := - (True, - (code => LSP.Errors.RequestFailed, - message => <>, - data => Empty)); - end; - end return; - end if; - - exit when Request.Canceled; - end loop; - - -- All contexts were processed, and no rename problems were found - - Response.result := To_Workspace_Edit - (All_Edits, Self.Resource_Operations, Self.Versioned_Documents, Self); - - return Response; - - exception - when E : others => - return Response : LSP.Messages.Server_Responses.Rename_Response - (Is_Error => True) - do - Response.error := - (True, - (code => LSP.Errors.InternalError, - message => VSS.Strings.Conversions.To_Virtual_String - (Ada.Exceptions.Exception_Information (E)), - data => <>)); - end return; - end On_Rename_Request; - - -------------------------- - -- Change_Configuration -- - -------------------------- - - procedure Change_Configuration - (Self : access Message_Handler; - Options : GNATCOLL.JSON.JSON_Value'Class) - is - use type GNATCOLL.JSON.JSON_Value_Type; - use type VSS.Strings.Virtual_String; - - procedure Add_Variable (Name : String; Value : GNATCOLL.JSON.JSON_Value); - - relocateBuildTree : constant String := - "relocateBuildTree"; - rootDir : constant String := - "rootDir"; - projectFile : constant String := - "projectFile"; - scenarioVariables : constant String := - "scenarioVariables"; - defaultCharset : constant String := - "defaultCharset"; - enableDiagnostics : constant String := - "enableDiagnostics"; - enableIndexing : constant String := - "enableIndexing"; - renameInComments : constant String := - "renameInComments"; - namedNotationThreshold : constant String := - "namedNotationThreshold"; - foldComments : constant String := - "foldComments"; - displayMethodAncestryOnNavigation : constant String := - "displayMethodAncestryOnNavigation"; - followSymlinks : constant String := - "followSymlinks"; - documentationStyle : constant String := - "documentationStyle"; - useCompletionSnippets : constant String := - "useCompletionSnippets"; - logThreshold : constant String := - "logThreshold"; - onTypeFormatting : constant String := - "onTypeFormatting"; - indentOnly : constant String := - "indentOnly"; - - Variables : Scenario_Variable_List; - - function Property - (Name : String; - Default : VSS.Strings.Virtual_String) - return VSS.Strings.Virtual_String is - (if Options.Kind = GNATCOLL.JSON.JSON_Object_Type - and then Options.Has_Field (Name) - then VSS.Strings.Conversions.To_Virtual_String - (String'(Options.Get (Name))) - else Default); - - function Has_Field (Name : String) return Boolean is - (Options.Kind = GNATCOLL.JSON.JSON_Object_Type - and then Options.Has_Field (Name)); - - ------------------ - -- Add_Variable -- - ------------------ - - procedure Add_Variable - (Name : String; Value : GNATCOLL.JSON.JSON_Value) is - begin - if Value.Kind = GNATCOLL.JSON.JSON_String_Type then - Variables.Names.Append - (VSS.Strings.Conversions.To_Virtual_String (Name)); - - Variables.Values.Append - (VSS.Strings.Conversions.To_Virtual_String - (String'(Value.Get))); - end if; - end Add_Variable; - - File : VSS.Strings.Virtual_String; - Charset : VSS.Strings.Virtual_String; - Relocate_Build_Tree : VSS.Strings.Virtual_String; - Relocate_Root : VSS.Strings.Virtual_String; - - Has_Variables : Boolean := False; -- settings has scenarioVariables - - begin - Relocate_Build_Tree := - Property (relocateBuildTree, Self.Relocate_Build_Tree); - - Relocate_Root := Property (rootDir, Self.Relocate_Root_Dir); - Charset := Property (defaultCharset, Self.Charset); - File := Property (projectFile, Self.Project_File); - - -- Drop uri scheme if present - if File.Starts_With ("file:") then - File := Self.URI_To_File (File); - end if; - - if Has_Field (scenarioVariables) and then - Options.Get - (scenarioVariables).Kind = GNATCOLL.JSON.JSON_Object_Type - then - Options.Get - (scenarioVariables).Map_JSON_Object (Add_Variable'Access); - Has_Variables := True; - end if; - - -- It looks like the protocol does not allow clients to say whether - -- or not they want diagnostics as part of - -- InitializeParams.capabilities.textDocument. So we support - -- deactivating of diagnostics via a setting here. - if Has_Field (enableDiagnostics) then - Self.Diagnostics_Enabled := Options.Get (enableDiagnostics); - end if; - - -- Similarly to diagnostics, we support selectively activating - -- indexing in the parameters to this request. - if Has_Field (enableIndexing) then - Self.Indexing_Enabled := Options.Get (enableIndexing); - end if; - - -- Retrieve the different textDocument/rename options if specified - - if Has_Field (renameInComments) then - Self.Options.Refactoring.Renaming.In_Comments := - Options.Get (renameInComments); - end if; - - if Has_Field (foldComments) then - Self.Options.Folding.Comments := Options.Get (foldComments); - end if; - - -- Retrieve the number of parameters / components at which point - -- named notation is used for subprogram/aggregate completion - -- snippets. - - if Has_Field (namedNotationThreshold) then - Self.Named_Notation_Threshold := - Options.Get (namedNotationThreshold); - end if; - - if Has_Field (logThreshold) then - Self.Log_Threshold := Options.Get (logThreshold); - end if; - - -- Check the 'useCompletionSnippets' flag to see if we should use - -- snippets in completion (if the client supports it). - if not Self.Completion_Snippets_Enabled then - Self.Use_Completion_Snippets := False; - elsif Has_Field (useCompletionSnippets) then - Self.Use_Completion_Snippets := - Options.Get (useCompletionSnippets); - end if; - - -- Retrieve the policy for displaying type hierarchy on navigation - -- requests. - if Has_Field (displayMethodAncestryOnNavigation) then - Self.Display_Method_Ancestry_Policy := - LSP.Messages.AlsDisplayMethodAncestryOnNavigationPolicy'Value - (Options.Get (displayMethodAncestryOnNavigation)); - end if; - - -- Retrieve the follow symlinks policy. - - if Has_Field (followSymlinks) then - Self.Follow_Symlinks := Options.Get (followSymlinks); - end if; - - if Has_Field (documentationStyle) then - begin - Self.Options.Documentation.Style := - GNATdoc.Comments.Options.Documentation_Style'Value - (Options.Get (documentationStyle)); - - exception - when Constraint_Error => - Self.Options.Documentation.Style := - GNATdoc.Comments.Options.GNAT; - end; - end if; - - if Has_Field (onTypeFormatting) then - declare - On_Type_Formatting : constant GNATCOLL.JSON.JSON_Value'Class := - Options.Get (onTypeFormatting); - begin - if On_Type_Formatting.Has_Field (indentOnly) then - Self.Options.On_Type_Formatting.Indent_Only := - On_Type_Formatting.Get (indentOnly); - end if; - - exception - when Constraint_Error => - Self.Trace.Trace - ("Failed to get " & onTypeFormatting & "." & indentOnly - & " option. Using True as default."); - Self.Options.On_Type_Formatting.Indent_Only := True; - end; - end if; - - if Self.Project_File = File - and then Self.Charset = Charset - and then Self.Relocate_Build_Tree = Relocate_Build_Tree - and then Self.Relocate_Root_Dir = Relocate_Root - and then not Self.Contexts.Is_Empty - and then (Self.Scenario_Variables = Variables - or else not Has_Variables) - then - - -- Project and Scenario, etc are unchanged, project has been loaded. - -- No needs to reload the project. - null; - else - - Self.Project_File := File; - Self.Scenario_Variables := Variables; - Self.Charset := Charset; - Self.Relocate_Build_Tree := Relocate_Build_Tree; - Self.Relocate_Root_Dir := Relocate_Root; - Self.Project_Status := Valid_Project_Configured; - Self.Reload_Project; - end if; - end Change_Configuration; - - -------------------------------------- - -- Change_Configuration_Before_Init -- - -------------------------------------- - - procedure Change_Configuration_Before_Init - (Self : access Message_Handler; - Options : GNATCOLL.JSON.JSON_Value'Class; - Root : GNATCOLL.VFS.Virtual_File) - is - Saved_Root : constant GNATCOLL.VFS.Virtual_File := Self.Root; - begin - Self.Root := Root; - Self.Change_Configuration (Options); - Self.Root := Saved_Root; - end Change_Configuration_Before_Init; - - -------------------------------------------- - -- On_DidChangeConfiguration_Notification -- - -------------------------------------------- - - overriding procedure On_DidChangeConfiguration_Notification - (Self : access Message_Handler; - Value : LSP.Messages.DidChangeConfigurationParams) - is - - Ada : constant LSP.Types.LSP_Any := Value.settings.Get ("ada"); - - -- Is client capable of dynamically registering file operations? - Dynamically_Register_File_Operations : constant Boolean := - Self.Client.capabilities.workspace.fileOperations.Is_Set - and then Self.Client.capabilities.workspace.fileOperations. - Value.dynamicRegistration.Is_Set = True; - - begin - Self.Change_Configuration (Ada); - - -- Dynamically register file operations if supported by the client - if Dynamically_Register_File_Operations - and then not Self.Contexts.Each_Context.Is_Empty - then - declare - Request : LSP.Messages.Client_Requests.RegisterCapability_Request; - Registration : LSP.Messages.Registration; - Registration_Options : - constant LSP.Messages.FileOperationRegistrationOptions := - Self.Compute_File_Operation_Registration_Options; - File_Operations_Client_Capabilities : - constant LSP.Messages.FileOperationsClientCapabilities := - Self.Client.capabilities.workspace.fileOperations.Value; - - begin - Registration.registerOptions := - (LSP.Types.File_Operation_Registration_Option, - FileOperation => Registration_Options); - - if File_Operations_Client_Capabilities.willCreate = True then - Registration.id := "Will_Create"; - Registration.method := "workspace/willCreateFiles"; - Request.params.registrations.Append (Registration); - end if; - - if File_Operations_Client_Capabilities.didCreate = True then - Registration.id := "Did_Create"; - Registration.method := "workspace/didCreateFiles"; - Request.params.registrations.Append (Registration); - end if; - - if File_Operations_Client_Capabilities.willRename = True then - Registration.id := "Will_Rename"; - Registration.method := "workspace/willRenameFiles"; - Request.params.registrations.Append (Registration); - end if; - - if File_Operations_Client_Capabilities.didRename = True then - Registration.id := "Did_Rename"; - Registration.method := "workspace/didRenameFiles"; - Request.params.registrations.Append (Registration); - end if; - - if File_Operations_Client_Capabilities.willDelete = True then - Registration.id := "Will_Delete"; - Registration.method := "workspace/willDeleteFiles"; - Request.params.registrations.Append (Registration); - end if; - - if File_Operations_Client_Capabilities.didDelete = True then - Registration.id := "Did_Delete"; - Registration.method := "workspace/didDeleteFiles"; - Request.params.registrations.Append (Registration); - end if; - - Self.Server.On_RegisterCapability_Request (Request); - end; - end if; - end On_DidChangeConfiguration_Notification; - - ------------------------------------------- - -- On_DidChangeWatchedFiles_Notification -- - ------------------------------------------- - - overriding procedure On_DidChangeWatchedFiles_Notification - (Self : access Message_Handler; - Value : LSP.Messages.DidChangeWatchedFilesParams) - is - URI : LSP.Messages.DocumentUri; - File : GNATCOLL.VFS.Virtual_File; - - procedure Process_Created_File; - -- Processes a created file - - procedure Process_Deleted_File; - -- Processes a deleted file - - procedure Process_Changed_File; - -- Processes a changed file - - -------------------------- - -- Process_Created_File -- - -------------------------- - - procedure Process_Created_File - is - use VSS.Strings.Conversions; - - Contexts : constant LSP.Ada_Context_Sets.Context_Lists.List := - Self.Contexts_For_File (File); - - function Has_Dir - (Context : LSP.Ada_Contexts.Context) - return Boolean - is (Context.List_Source_Directories.Contains (File.Dir)); - -- Return True if File is in a source directory of the project held - -- by Context. - - begin - -- If the file was created by the client, then the DidCreateFiles - -- notification might have been received from it. In that case, - -- Contexts wont be empty, and all we need to do is check if - -- there's an open document. If there is, it takes precedence over - -- the filesystem. - -- If Contexts is empty, then we need to check if is a new source - -- that needs to be added. For instance, a source that was moved - -- to the the project source directories. - - if Contexts.Is_Empty then - for Context of Self.Contexts.Each_Context - (Has_Dir'Unrestricted_Access) - loop - Context.Include_File (File); - Context.Index_File (File); - - Self.Trace.Trace - ("Included " & File.Display_Base_Name - & " in context " & To_UTF_8_String (Context.Id)); - end loop; - - else - if Self.Get_Open_Document (URI) = null then - for Context of Contexts loop - Context.Index_File (File); - end loop; - end if; - end if; - end Process_Created_File; - - --------------------------- - -- Process_Deleted_Files -- - --------------------------- - - procedure Process_Deleted_File is - begin - if Self.Get_Open_Document (URI) = null then - -- If there is no document, remove from the sources list - -- and reindex the file for each context where it is - -- relevant. - File := Self.To_File (URI); - - for C of Self.Contexts_For_File (File) loop - C.Exclude_File (File); - C.Index_File (File); - end loop; - end if; - end Process_Deleted_File; - - -------------------------- - -- Process_Changed_File -- - -------------------------- - - procedure Process_Changed_File is - begin - if Self.Get_Open_Document (URI) = null then - -- If there is no document, reindex the file for each - -- context where it is relevant. - File := Self.To_File (URI); - - for C of Self.Contexts_For_File (File) loop - C.Index_File (File); - end loop; - end if; - end Process_Changed_File; - - begin - -- Look through each change, filtering non Ada source files - for Change of Value.changes loop - URI := Change.uri; - File := Self.To_File (URI); - case Change.a_type is - when LSP.Messages.Created => - Process_Created_File; - when LSP.Messages.Deleted => - Process_Deleted_File; - when LSP.Messages.Changed => - Process_Changed_File; - end case; - end loop; - end On_DidChangeWatchedFiles_Notification; - - ------------------------------------ - -- Mark_Source_Files_For_Indexing -- - ------------------------------------ - - procedure Mark_Source_Files_For_Indexing (Self : access Message_Handler) is - begin - Self.Files_To_Index.Clear; - - -- Mark all the project's source files - for C of Self.Contexts.Each_Context loop - for F in C.List_Files loop - Self.Files_To_Index.Include - (LSP.Ada_File_Sets.File_Sets.Element (F)); - end loop; - end loop; - - if Runtime_Indexing.Is_Active then - -- Mark all the predefined sources too (runtime) - for F in Self.Project_Predefined_Sources.Iterate loop - declare - File : GNATCOLL.VFS.Virtual_File renames - LSP.Ada_File_Sets.File_Sets.Element (F); - begin - for Context of Self.Contexts_For_File (File) loop - Self.Files_To_Index.Include (File); - end loop; - end; - end loop; - end if; - - Self.Total_Files_Indexed := 0; - Self.Total_Files_To_Index := Positive'Max - (1, Natural (Self.Files_To_Index.Length)); - end Mark_Source_Files_For_Indexing; - - ------------------ - -- Load_Project -- - ------------------ - - procedure Load_Project - (Self : access Message_Handler; - Project_File : VSS.Strings.Virtual_String; - Scenario : Scenario_Variable_List; - Environment : GPR2.Environment.Object; - Charset : VSS.Strings.Virtual_String; - Status : Load_Project_Status) - is - Message : LSP.Messages.ShowMessageParams; - Errors : VSS.String_Vectors.Virtual_String_Vector; - Warnings : VSS.String_Vectors.Virtual_String_Vector; - - procedure Create_Context_For_Non_Aggregate - (View : GPR2.Project.View.Object); - - procedure Append_Errors; - - function To_Virtual_File - (Value : VSS.Strings.Virtual_String) return Virtual_File is - (Create_From_UTF8 (VSS.Strings.Conversions.To_UTF_8_String (Value))); - -- Cast Virtual_String to Virtual_File - - ------------------- - -- Append_Errors -- - ------------------- - - procedure Append_Errors is - begin - for Message of Self.Project_Tree.Log_Messages.all loop - case Message.Level is - when GPR2.Message.Error => - Errors.Append - (VSS.Strings.Conversions.To_Virtual_String - (Message.Format)); - when GPR2.Message.Warning => - Warnings.Append - (VSS.Strings.Conversions.To_Virtual_String - (Message.Format)); - when others => - null; - end case; - end loop; - end Append_Errors; - - -------------------------------------- - -- Create_Context_For_Non_Aggregate -- - -------------------------------------- - - procedure Create_Context_For_Non_Aggregate - (View : GPR2.Project.View.Object) is - C : constant Context_Access := new Context (Self.Trace); - Reader : LSP.Ada_Handlers.File_Readers.LSP_Reader_Interface (Self); - - Default_Config : Libadalang.Preprocessing.File_Config; - File_Configs : Libadalang.Preprocessing.File_Config_Maps.Map; - - procedure Set_Line_Mode - (Config : in out Libadalang.Preprocessing.File_Config); - -- Used to force the preprocessing line mode to Blank_Lines, which - -- is needed to preserve the number of lines after preprocessing a - -- source file, otherwise LSP requests based on SLOCs will fail. - - ------------------- - -- Set_Line_Mode -- - ------------------- - - procedure Set_Line_Mode - (Config : in out Libadalang.Preprocessing.File_Config) is - begin - if Config.Enabled then - Config.Line_Mode := Libadalang.Preprocessing.Blank_Lines; - end if; - end Set_Line_Mode; - - begin - -- Extract the preprocessing options from the context's project - -- and create the file reader which will preprocess the files - -- accordingly. - - Libadalang.Preprocessing.Extract_Preprocessor_Data_From_Project - (Tree => Self.Project_Tree, - Project => View, - Default_Config => Default_Config, - File_Configs => File_Configs); - - Libadalang.Preprocessing.Iterate - (Default_Config => Default_Config, - File_Configs => File_Configs, - Process => Set_Line_Mode'Access); - - Reader.Preprocessing_Data := - Libadalang.Preprocessing.Create_Preprocessor_Data - (Default_Config, File_Configs); - - C.Initialize - (Reader, - Style => Self.Options.Documentation.Style, - Follow_Symlinks => Self.Follow_Symlinks); - - C.Load_Project - (Tree => Self.Project_Tree, - Root => View, - Charset => VSS.Strings.Conversions.To_UTF_8_String (Charset)); - Self.Contexts.Prepend (C); - end Create_Context_For_Non_Aggregate; - - GPR : Virtual_File := To_Virtual_File (Project_File); - Default_Environment : LSP.Ada_Handlers.Environment; - - Relocate_Build_Tree : constant Virtual_File := - To_Virtual_File (Self.Relocate_Build_Tree); - - Root_Dir : constant Virtual_File := - To_Virtual_File (Self.Relocate_Root_Dir); - - begin - -- The projectFile may be either an absolute path or a - -- relative path; if so, we're assuming it's relative - -- to Self.Root. - if not GPR.Is_Absolute_Path then - GPR := Join (Self.Root, GPR); - end if; - - -- Unload the project tree and the project environment - Self.Release_Contexts_And_Project_Info; - - -- Now load the new project - Self.Project_Status := Status; - Self.Project_Environment := Default_Environment; - - if Relocate_Build_Tree /= No_File then - Self.Project_Environment.Build_Path := - GPR2.Path_Name.Create (Relocate_Build_Tree); - if Root_Dir /= No_File and then GPR /= No_File then - if not Root_Dir.Is_Absolute_Path then - Self.Project_Environment.Build_Path := - GPR2.Path_Name.Create_Directory - (GPR2.Path_Name.Create (GPR).Relative_Path - (GPR2.Path_Name.Create (Root_Dir)).Name, - GPR2.Filename_Type - (Self.Project_Environment.Build_Path.Value)); - end if; - end if; - end if; - - -- Update scenario variables with user provided values - for J in 1 .. Scenario.Names.Length loop - Self.Project_Environment.Context.Insert - (GPR2.Optional_Name_Type - (VSS.Strings.Conversions.To_UTF_8_String (Scenario.Names (J))), - VSS.Strings.Conversions.To_UTF_8_String (Scenario.Values (J))); - end loop; - - begin - Self.Project_Tree.Load_Autoconf - (Filename => GPR2.Path_Name.Create (GPR), - Context => Self.Project_Environment.Context, - Build_Path => Self.Project_Environment.Build_Path, - Environment => Environment); - - Self.Project_Tree.Update_Sources (With_Runtime => True); - - exception - when E : GPR2.Project_Error - | GPR2.Processing_Error - | GPR2.Attribute_Error => - - Self.Trace.Trace (E); - - Self.Project_Status := Invalid_Project_Configured; - end; - - -- Keep errors and warnings - Append_Errors; - - if Self.Project_Status /= Status - or else not Self.Project_Tree.Is_Defined - then - -- The project was invalid: fallback on loading the implicit project. - Errors.Prepend - (VSS.Strings.Conversions.To_Virtual_String - ("Unable to load project file: " & GPR.Display_Full_Name)); - - Self.Load_Implicit_Project (Invalid_Project_Configured); - - else - -- No exception during Load_Autoconf, check if we have runtime - if not Self.Project_Tree.Has_Runtime_Project then - Self.Project_Status := No_Runtime_Found; - end if; - - Update_Project_Predefined_Sources (Self); - - if Self.Project_Tree.Root_Project.Kind in GPR2.Aggregate_Kind then - for View of Self.Project_Tree.Root_Project.Aggregated loop - Create_Context_For_Non_Aggregate (View); - end loop; - else - Create_Context_For_Non_Aggregate - (Self.Project_Tree.Root_Project); - end if; - end if; - - -- Report the warnings, if any - if not Warnings.Is_Empty then - Message.message := Warnings.Join_Lines (VSS.Strings.LF); - Message.a_type := LSP.Messages.Warning; - Self.Server.On_Show_Message (Message); - end if; - - -- Report the errors, if any - if not Errors.Is_Empty then - Message.message := Errors.Join_Lines (VSS.Strings.LF); - Message.a_type := LSP.Messages.Error; - Self.Server.On_Show_Message (Message); - end if; - - -- Reindex all open documents immediately after project reload, so - -- that navigation from editors is accurate. - for Document of Self.Open_Documents loop - for Context of Self.Contexts_For_URI (Document.URI) loop - Context.Index_Document (Document.all); - end loop; - - Self.Publish_Diagnostics (Document_Access (Document)); - end loop; - - if not Self.File_Monitor.Assigned then - Self.File_Monitor := - new LSP.Servers.FS_Watch.FS_Watch_Monitor (Self.Server); - end if; - - -- We have successfully loaded a real project: monitor the filesystem - -- for any changes on the sources of the project - Self.File_Monitor.Monitor_Directories - (Self.Contexts.All_Source_Directories); - - -- Reindex the files from disk in the background after a project reload - Self.Mark_Source_Files_For_Indexing; - end Load_Project; - - ----------------------------- - -- Load_Project_With_Alire -- - ----------------------------- - - procedure Load_Project_With_Alire - (Self : access Message_Handler; - Project_File : VSS.Strings.Virtual_String := ""; - Scenario_Variables : Scenario_Variable_List; - Charset : VSS.Strings.Virtual_String) - is - - Has_Alire : Boolean; - Status : Load_Project_Status; - Errors : VSS.Strings.Virtual_String; - Project : VSS.Strings.Virtual_String := Project_File; - UTF_8 : constant VSS.Strings.Virtual_String := "utf-8"; - - Environment : GPR2.Environment.Object := - GPR2.Environment.Process_Environment; - - Alire_TOML : constant GNATCOLL.VFS.Virtual_File := - Self.Root.Create_From_Dir ("alire.toml"); - begin - if Alire_TOML.Is_Regular_File - and Spawn.Environments.System_Environment.Value ("ALIRE") /= "True" - then - - Self.Trace.Trace ("Check alire:"); - - if Project.Is_Empty then - - LSP.Ada_Handlers.Alire.Run_Alire - (Root => Self.Root.Display_Full_Name, - Has_Alire => Has_Alire, - Error => Errors, - Project => Project, - Environment => Environment); - - Status := Alire_Project; - else - - LSP.Ada_Handlers.Alire.Run_Alire - (Root => Self.Root.Display_Full_Name, - Has_Alire => Has_Alire, - Error => Errors, - Environment => Environment); - - Status := Valid_Project_Configured; - end if; - - if Has_Alire and then not Errors.Is_Empty then - - -- Something wrong with alire. Report error. Don't load the - -- project. Fallback to implicit project. - - declare - Error : LSP.Messages.ShowMessageParams; - begin - Error.a_type := LSP.Messages.Error; - Error.message := Errors; - Self.Server.On_Show_Message (Error); - Self.Trace.Trace - (VSS.Strings.Conversions.To_UTF_8_String (Errors)); - - Self.Load_Implicit_Project (Invalid_Project_Configured); - - return; - end; - elsif Has_Alire then - - -- No errors means the project has been found - pragma Assert (not Project.Is_Empty); - - Self.Trace.Trace - (Message => "Project:" - & VSS.Strings.Conversions.To_UTF_8_String (Project)); - - Self.Load_Project - (Project_File => Project, - Scenario => Scenario_Variables, - Environment => Environment, - Charset => (if Charset.Is_Empty then UTF_8 else Charset), - Status => Status); - -- Alire projects tend to use utf-8 - - return; - else - Self.Trace.Trace (Message => "No alr in the PATH."); - end if; - end if; - - -- There is no alire.toml or no alr, but we know the project, load it - if not Project.Is_Empty then - - Self.Load_Project - (Project_File => Project, - Scenario => Scenario_Variables, - Environment => Environment, - Charset => Charset, - Status => Valid_Project_Configured); - end if; - end Load_Project_With_Alire; - - ------------------------------- - -- Get_Unique_Progress_Token -- - ------------------------------- - - function Get_Unique_Progress_Token - (Self : access Message_Handler; - Operation : String := "") return LSP_Number_Or_String - is - use GNAT.OS_Lib; - - Pid : constant String := - GNATCOLL.Utils.Image (Pid_To_Integer (Current_Process_Id), 1); - begin - Self.Token_Id := Self.Token_Id + 1; - -- Generate an identifier that has little risk of collision with - -- other language servers, or other occurrences of this server. - -- (There is still a very small risk of collision with PID recyclings, - -- but the consequences are acceptable.) - return - (Is_Number => False, - String => VSS.Strings.Conversions.To_Virtual_String - ("ada_ls-" - & Pid & "-" & Operation & "-" - & GNATCOLL.Utils.Image (Self.Token_Id, 1))); - end Get_Unique_Progress_Token; - - ----------------- - -- Index_Files -- - ----------------- - - procedure Index_Files (Self : access Message_Handler) is - - procedure Emit_Progress_Begin; - procedure Emit_Progress_Report (Files_Indexed, Total_Files : Natural); - procedure Emit_Progress_End; - -- Emit a message to inform that the indexing has begun / is in - -- progress / has finished. - - Progress_Report_Sent : Time := Clock; - - ------------------------- - -- Emit_Progress_Begin -- - ------------------------- - - procedure Emit_Progress_Begin is - P : LSP.Messages.Progress_Params (LSP.Messages.Progress_Begin); - - Create_Progress : constant LSP.Messages.Client_Requests - .WorkDoneProgressCreate_Request := - (params => (token => Self.Indexing_Token), others => <>); - begin - Self.Server.On_WorkDoneProgress_Create_Request - (Create_Progress); - -- FIXME: wait response before sending progress notifications. - -- Currenctly, we just send a `window/workDoneProgress/create` - -- request and immediately after this start sending notifications. - -- We could do better, send request, wait for client response and - -- start progress-report sending only after response. - P.Begin_Param.token := Self.Indexing_Token; - P.Begin_Param.value.title := "Indexing"; - P.Begin_Param.value.percentage := (Is_Set => True, Value => 0); - Self.Server.On_Progress (P); - end Emit_Progress_Begin; - - -------------------------- - -- Emit_Progress_Report -- - -------------------------- - - procedure Emit_Progress_Report (Files_Indexed, Total_Files : Natural) is - P : LSP.Messages.Progress_Params (LSP.Messages.Progress_Report); - - function Image (N : Natural) return Wide_Wide_String; - function Image (N : Natural) return Wide_Wide_String is - S : constant Wide_Wide_String := Natural'Wide_Wide_Image (N); - begin - return S (S'First + 1 .. S'Last); - end Image; - - Current : constant Time := Clock; - begin - if Current - Progress_Report_Sent < 0.5 then - -- Send only 2 notifications per second - return; - end if; - Progress_Report_Sent := Current; - - P.Report_Param.token := Self.Indexing_Token; - P.Report_Param.value.percentage := - (Is_Set => True, Value => LSP_Number - ((Files_Indexed * 100) / Total_Files)); - P.Report_Param.value.message := - (Is_Set => True, - Value => VSS.Strings.To_Virtual_String - (Image (Files_Indexed) & "/" & Image (Total_Files) & " files")); - Self.Server.On_Progress (P); - end Emit_Progress_Report; - - ----------------------- - -- Emit_Progress_End -- - ----------------------- - - procedure Emit_Progress_End is - P : LSP.Messages.Progress_Params (LSP.Messages.Progress_End); - begin - P.End_Param.token := Self.Indexing_Token; - Self.Server.On_Progress (P); - end Emit_Progress_End; - - begin - -- Prevent work if the indexing has been explicitly disabled or - -- if we have other messages to process. - if not Self.Indexing_Enabled or Self.Server.Has_Pending_Work then - return; - end if; - - if Self.Indexing_Token = Empty_Token then - Self.Indexing_Token := Self.Get_Unique_Progress_Token ("indexing"); - Emit_Progress_Begin; - end if; - - while not Self.Files_To_Index.Is_Empty loop - declare - Cursor : File_Sets.Cursor := Self.Files_To_Index.First; - File : constant GNATCOLL.VFS.Virtual_File := - File_Sets.Element (Cursor); - begin - Self.Files_To_Index.Delete (Cursor); - Self.Total_Files_Indexed := Self.Total_Files_Indexed + 1; - - if not Self.Open_Documents.Contains (File) then - Emit_Progress_Report - (Self.Total_Files_Indexed, Self.Total_Files_To_Index); - - for Context of Self.Contexts_For_File (File) loop - -- Set Reparse to False to avoid issues with LAL envs - -- for now (see T226-048 for more info). - Context.Index_File (File, Reparse => False); - end loop; - - -- Check whether another request is pending. If so, pause - -- the indexing; it will be resumed later as part of - -- After_Request. - if not Self.Files_To_Index.Is_Empty - and then Self.Server.Has_Pending_Work - then - return; - end if; - end if; - end; - end loop; - - Emit_Progress_End; - Self.Indexing_Token := Empty_Token; - end Index_Files; - - ------------------------------------------ - -- On_Workspace_Execute_Command_Request -- - ------------------------------------------ - - overriding function On_Workspace_Execute_Command_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Workspace_Execute_Command_Request) - return LSP.Messages.Server_Responses.ExecuteCommand_Response - is - Error : LSP.Errors.Optional_ResponseError; - Params : LSP.Messages.ExecuteCommandParams renames - Request.params; - Response : LSP.Messages.Server_Responses.ExecuteCommand_Response - (Is_Error => True); - begin - if Params.Is_Unknown or else Params.Custom.Is_Null then - Response.error := - (True, - (code => LSP.Errors.InternalError, - message => "Not implemented", - data => <>)); - return Response; - end if; - - Params.Custom.Unchecked_Get.Execute - (Handler => Self, - Client => Self.Server, - Error => Error); - - if Error.Is_Set then - Response.error := Error; - return Response; - end if; - - -- No particular response in case of success. - return (Is_Error => False, - error => (Is_Set => False), - others => <>); - end On_Workspace_Execute_Command_Request; - - -------------------------------------------- - -- On_Workspace_Will_Create_Files_Request -- - -------------------------------------------- - - overriding function On_Workspace_Will_Create_Files_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests. - Workspace_Will_Create_Files_Request) - return LSP.Messages.Server_Responses.WillCreateFiles_Response - is - Response : LSP.Messages.Server_Responses.WillCreateFiles_Response - (Is_Error => False); - begin - Self.Trace.Trace - ("Message_Handler On_Workspace_Will_Create_Files_Request"); - return Response; - end On_Workspace_Will_Create_Files_Request; - - ------------------------------------ - -- On_DidCreateFiles_Notification -- - ------------------------------------ - - overriding procedure On_DidCreateFiles_Notification - (Self : access Message_Handler; - Value : LSP.Messages.CreateFilesParams) is - begin - Self.Trace.Trace - ("Message_Handler On_DidCreateFiles_Notification"); - - -- New sources were created on this project, so recompute its view - - Self.Project_Tree.Update_Sources (With_Runtime => True); - - -- For each created file of Value.files: - -- - find the contexts that contains its directory - -- - add it to those contexts - -- - index it on those contexts - - for File of Value.files loop - declare - use VSS.Strings.Conversions; - - Created_File : constant Virtual_File := - Self.To_File (To_LSP_URI (File.uri)); - - function Has_Dir - (Context : LSP.Ada_Contexts.Context) - return Boolean - is (Context.List_Source_Directories.Contains - (Created_File.Dir)); - -- Return True if Old_File is a source of the project held by - -- Context. - - begin - for Context of Self.Contexts.Each_Context - (Has_Dir'Unrestricted_Access) - loop - Context.Include_File (Created_File); - Context.Index_File (Created_File); - - Self.Trace.Trace - ("Included " & Created_File.Display_Base_Name - & " in context " & To_UTF_8_String (Context.Id)); - end loop; - end; - end loop; - - Self.Trace.Trace - ("Finished Message_Handler On_DidCreateFiles_Notification"); - end On_DidCreateFiles_Notification; - - -------------------------------------------- - -- On_Workspace_Will_Rename_Files_Request -- - -------------------------------------------- - - overriding function On_Workspace_Will_Rename_Files_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests. - Workspace_Will_Rename_Files_Request) - return LSP.Messages.Server_Responses.WillRenameFiles_Response - is - Response : LSP.Messages.Server_Responses.WillRenameFiles_Response - (Is_Error => False); - begin - Self.Trace.Trace - ("Message_Handler On_Workspace_Will_Rename_Files_Request"); - return Response; - end On_Workspace_Will_Rename_Files_Request; - - ------------------------------------ - -- On_DidRenameFiles_Notification -- - ------------------------------------ - - overriding procedure On_DidRenameFiles_Notification - (Self : access Message_Handler; - Value : LSP.Messages.RenameFilesParams) - is - use LSP.Ada_Context_Sets; - - package URI_Contexts_Maps is new - Ada.Containers.Indefinite_Hashed_Maps - (Key_Type => LSP_URI, - Element_Type => Context_Lists.List, - Hash => Hash, - Equivalent_Keys => Equal, - "=" => Context_Lists."="); - - subtype URI_Contexts_Map is URI_Contexts_Maps.Map; - - URIs_Contexts : URI_Contexts_Map; - - begin - Self.Trace.Trace - ("Message_Handler On_DidRenameFiles_Notification"); - - -- Some project sources were renamed, so recompute its view - - Self.Project_Tree.Update_Sources (With_Runtime => True); - - -- For each oldUri of Value.files: - -- - map it to a list of context that contains it - -- - remove it from those contexts - -- - re-index it on those contexts so that an empty unit is reparsed - - for File_Rename of Value.files loop - declare - use VSS.Strings.Conversions; - - Old_File : constant Virtual_File := - Self.To_File (To_LSP_URI (File_Rename.oldUri)); - - function Has_File - (Context : LSP.Ada_Contexts.Context) - return Boolean - is (Context.Is_Part_Of_Project (Old_File)); - -- Return True if Old_File is a source of the project held by - -- Context. - - URI_Contexts : Context_Lists.List; - - begin - for Context of Self.Contexts.Each_Context - (Has_File'Unrestricted_Access) - loop - URI_Contexts.Append (Context); - Context.Exclude_File (Old_File); - Context.Index_File (Old_File); - - Self.Trace.Trace - ("Excluded " & Old_File.Display_Full_Name - & " from context " & To_UTF_8_String (Context.Id)); - end loop; - - URIs_Contexts.Insert - (To_LSP_URI (File_Rename.oldUri), URI_Contexts); - end; - end loop; - - -- For each (oldUri, newUri) tuple: - -- - add newUri to all contexts that contained oldUri - -- - index the newUri (using the appriate method depending if - -- (there's an open document of not) - - for File_Rename of Value.files loop - declare - use VSS.Strings.Conversions; - - New_File : constant GNATCOLL.VFS.Virtual_File := - Self.To_File (LSP.Types.To_LSP_URI (File_Rename.newUri)); - Document : constant LSP.Ada_Documents.Document_Access := - Get_Open_Document - (Self, - LSP.Messages.DocumentUri - (LSP.Types.To_LSP_URI (File_Rename.newUri))); - Is_Document_Open : constant Boolean := Document /= null; - - begin - for Context of - URIs_Contexts.Constant_Reference - (To_LSP_URI (File_Rename.oldUri)) - loop - Context.Include_File (New_File); - if Is_Document_Open then - Context.Index_Document (Document.all); - else - Context.Index_File (New_File); - end if; - Self.Trace.Trace - ("Included " & New_File.Display_Base_Name & " in context " - & To_UTF_8_String (Context.Id)); - end loop; - end; - end loop; - - Self.Trace.Trace - ("Finished Message_Handler On_DidRenameFiles_Notification"); - end On_DidRenameFiles_Notification; - - -------------------------------------------- - -- On_Workspace_Will_Delete_Files_Request -- - -------------------------------------------- - - overriding function On_Workspace_Will_Delete_Files_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests. - Workspace_Will_Delete_Files_Request) - return LSP.Messages.Server_Responses.WillDeleteFiles_Response - is - Response : LSP.Messages.Server_Responses.WillDeleteFiles_Response - (Is_Error => False); - begin - Self.Trace.Trace - ("Message_Handler On_Workspace_Will_Delete_Files_Request"); - return Response; - end On_Workspace_Will_Delete_Files_Request; - - ------------------------------------ - -- On_DidDeleteFiles_Notification -- - ------------------------------------ - - overriding procedure On_DidDeleteFiles_Notification - (Self : access Message_Handler; - Value : LSP.Messages.DeleteFilesParams) is - begin - Self.Trace.Trace - ("Message_Handler On_DidDeleteFiles_Notification"); - - -- Some project sources were deleted, so recompute its view - - Self.Project_Tree.Update_Sources (With_Runtime => True); - - -- For each delete file of Value.files: - -- - find the contexts that contains it - -- - remove it from those contexts - -- - re-index it on those contexts so that an empty unit is reparsed - - for File of Value.files loop - declare - Deleted_File : constant Virtual_File := - Self.To_File (To_LSP_URI (File.uri)); - - function Has_File - (Context : LSP.Ada_Contexts.Context) - return Boolean - is (Context.Is_Part_Of_Project (Deleted_File)); - -- Return True if Old_File is a source of the project held by - -- Context. - - begin - for Context of Self.Contexts.Each_Context - (Has_File'Unrestricted_Access) - loop - Context.Exclude_File (Deleted_File); - Context.Index_File (Deleted_File); - - Self.Trace.Trace - ("Excluded " & Deleted_File.Display_Base_Name - & " from context " - & VSS.Strings.Conversions.To_UTF_8_String (Context.Id)); - end loop; - end; - end loop; - - Self.Trace.Trace - ("Finished Message_Handler On_DidDeleteFiles_Notification"); - end On_DidDeleteFiles_Notification; - - ---------------------------------- - -- On_Workspace_Symbols_Request -- - ---------------------------------- - - overriding function On_Workspace_Symbols_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Workspace_Symbols_Request) - return LSP.Messages.Server_Responses.Symbol_Response - is - use type LSP.Messages.Search_Kind; - use type VSS.Strings.Character_Count; - use type Ada.Containers.Count_Type; - - procedure On_Inaccessible_Name - (File : GNATCOLL.VFS.Virtual_File; - Name : Libadalang.Analysis.Defining_Name; - Stop : in out Boolean); - - Names : LSP.Ada_Completions.Completion_Maps.Map; - - package Canceled is new LSP.Generic_Cancel_Check (Request'Access, 127); - - procedure Write_Symbols is - new LSP.Ada_Completions.Generic_Write_Symbols - (Canceled.Has_Been_Canceled); - - -------------------------- - -- On_Inaccessible_Name -- - -------------------------- - - procedure On_Inaccessible_Name - (File : GNATCOLL.VFS.Virtual_File; - Name : Libadalang.Analysis.Defining_Name; - Stop : in out Boolean) is - begin - -- Skip all names in open documents, because they could have - -- stale references. Then skip already provided results. - if not Self.Open_Documents.Contains (File) - and then not Names.Contains (Name) - then - Names.Insert - (Name, - (Is_Dot_Call => False, - Is_Visible => False, - Use_Snippets => False, - Pos => <>, - Weight => <>)); - end if; - - Stop := Canceled.Has_Been_Canceled; - end On_Inaccessible_Name; - - Pattern : constant Search_Pattern'Class := Build - (Pattern => Request.params.query, - Case_Sensitive => Request.params.case_sensitive = LSP.Types.True, - Whole_Word => Request.params.whole_word = LSP.Types.True, - Negate => Request.params.negate = LSP.Types.True, - Kind => - (if Request.params.kind.Is_Set - then Request.params.kind.Value - else LSP.Messages.Start_Word_Text)); - - Response : LSP.Messages.Server_Responses.Symbol_Response - (Is_Error => False); - - Partial_Response_Sended : Boolean := False; - - -- Send_Partial_Response -- - - procedure Send_Partial_Response; - procedure Send_Partial_Response - is - P : LSP.Messages.Progress_SymbolInformation_Vector; - V : LSP.Messages.Symbol_Vector; - begin - if Canceled.Has_Been_Canceled then - return; - end if; - - Write_Symbols (Names, V); - Names.Clear; - - P.token := Request.params.partialResultToken.Value; - P.value := V.Vector; - - Self.Server.On_Progress_SymbolInformation_Vector (P); - - Partial_Response_Sended := True; - end Send_Partial_Response; - - begin - if Pattern.Get_Kind /= LSP.Messages.Start_Word_Text - and then Pattern.Get_Canonical_Pattern.Character_Length < 2 - then - -- Do not process too small pattern because - -- this produces a huge response that is useless - -- and costs a while. - - return Response; - end if; - - for Context of Self.Contexts.Each_Context loop - Context.Get_Any_Symbol - (Pattern => Pattern, - Only_Public => False, - Callback => On_Inaccessible_Name'Access); - - if Canceled.Has_Been_Canceled then - return Response; - - elsif Request.params.partialResultToken.Is_Set - and then Names.Length > 100 - then - Send_Partial_Response; - end if; - end loop; - - for Doc of Self.Open_Documents loop - declare - Context : constant Context_Access := - Self.Contexts.Get_Best_Context (Doc.URI); - begin - Doc.Get_Any_Symbol - (Context.all, - Pattern, - Ada.Containers.Count_Type'Last, - False, - Canceled.Has_Been_Canceled'Access, - Names); - end; - - if Canceled.Has_Been_Canceled then - return Response; - - elsif Request.params.partialResultToken.Is_Set - and then Names.Length > 100 - then - Send_Partial_Response; - end if; - end loop; - - if Partial_Response_Sended then - Send_Partial_Response; - else - Write_Symbols (Names, Response.result); - end if; - - return Response; - end On_Workspace_Symbols_Request; - - --------------------------- - -- On_Completion_Request -- - --------------------------- - - overriding function On_Completion_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Completion_Request) - return LSP.Messages.Server_Responses.Completion_Response - is - -- We're completing only based on one context, ie one project - -- tree: this seems reasonable. One further refinement could - -- be to return only results that are available for all - -- project contexts. - - Value : LSP.Messages.TextDocumentPositionParams renames - Request.params; - - Context : constant Context_Access := - Self.Contexts.Get_Best_Context (Value.textDocument.uri); - - Document : constant LSP.Ada_Documents.Document_Access := - Get_Open_Document (Self, Value.textDocument.uri); - - Names : LSP.Ada_Completions.Completion_Maps.Map; - - -- If lazy computation for the 'detail' and 'documentation' fields is - -- supported by the client, set the Compute_Doc_And_Details flag to - -- False. - Compute_Doc_And_Details : constant Boolean := - not - (Self.Completion_Resolve_Properties.Contains - (VSS.Strings.Conversions.To_Virtual_String ("detail")) - and then - Self.Completion_Resolve_Properties.Contains - (VSS.Strings.Conversions.To_Virtual_String ("documentation"))); - - P1 : aliased LSP.Ada_Completions.Aspects.Aspect_Completion_Provider; - P2 : aliased LSP.Ada_Completions.Pragmas.Pragma_Completion_Provider; - P3 : aliased LSP.Ada_Completions.Keywords.Keyword_Completion_Provider; - P4 : aliased - LSP.Ada_Completions.Attributes.Attributes_Completion_Provider; - - P5 : aliased LSP.Ada_Completions.Names.Name_Completion_Provider - (Self.Use_Completion_Snippets); - P6 : aliased LSP.Ada_Handlers.Invisibles.Invisible_Completion_Provider - (Self, Context); - P7 : aliased - LSP.Ada_Completions.Parameters.Parameter_Completion_Provider - (Context => Context, - Document => Document, - Compute_Doc_And_Details => Compute_Doc_And_Details, - Named_Notation_Threshold => Self.Named_Notation_Threshold); - P8 : aliased LSP.Ada_Completions.End_Names.End_Name_Completion_Provider; - P9 : aliased - LSP.Ada_Completions.Use_Clauses.Use_Clause_Completion_Provider; - Providers : constant LSP.Ada_Completions.Completion_Provider_List := - [P1'Unchecked_Access, - P2'Unchecked_Access, - P3'Unchecked_Access, - P4'Unchecked_Access, - P5'Unchecked_Access, - P6'Unchecked_Access, - P7'Unchecked_Access, - P8'Unchecked_Access, - P9'Unchecked_Access]; - - Response : LSP.Messages.Server_Responses.Completion_Response - (Is_Error => False); - - Sloc : Langkit_Support.Slocs.Source_Location; - Token : Libadalang.Common.Token_Reference; - Node : Libadalang.Analysis.Ada_Node; - begin - Document.Get_Completion_Node - (Context => Context.all, - Position => Value.position, - Sloc => Sloc, - Token => Token, - Node => Node); - - Document.Get_Completions_At - (Context => Context.all, - Providers => Providers, - Sloc => Sloc, - Token => Token, - Node => Node, - Names => Names, - Result => Response.result); - - LSP.Ada_Completions.Write_Completions - (Context => Context.all, - Document => Document.all, - Sloc => Sloc, - Node => Node, - Names => Names, - Named_Notation_Threshold => Self.Named_Notation_Threshold, - Compute_Doc_And_Details => Compute_Doc_And_Details, - Result => Response.result.items); - - return Response; - end On_Completion_Request; - - -------------------------------------- - -- On_CompletionItemResolve_Request -- - -------------------------------------- - - overriding function On_CompletionItemResolve_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.CompletionItemResolve_Request) - return LSP.Messages.Server_Responses.CompletionItemResolve_Response - is - Item : LSP.Messages.CompletionItem := - Request.params; - Response : LSP.Messages.Server_Responses.CompletionItemResolve_Response - (Is_Error => False); - C : Context_Access; - Node : Libadalang.Analysis.Ada_Node; - begin - -- Return immediately if we don't have data that allows us to compute - -- additional information for the given item. - -- This is the case when all the completion item's fields have already - -- been computed. - if not Item.data.Is_Set then - Response.result := Item; - return Response; - end if; - - C := Self.Contexts.Get_Best_Context (Item.data.Value.uri); - Node := Get_Node_At - (Self => C.all, - Document => null, - Project_Only => False, - Position => LSP.Messages.TextDocumentPositionParams' - (textDocument => (uri => Item.data.Value.uri), - position => Item.data.Value.span.first)); - - -- Retrieve the Basic_Decl from the completion item's SLOC - while not Node.Is_Null - and then Node.Kind not in Libadalang.Common.Ada_Basic_Decl - loop - Node := Node.Parent; - end loop; - - -- Compute the completion item's details - if not Node.Is_Null then - declare - BD : constant Libadalang.Analysis.Basic_Decl := - Node.As_Basic_Decl; - Qual_Text : VSS.Strings.Virtual_String; - Loc_Text : VSS.Strings.Virtual_String; - Doc_Text : VSS.Strings.Virtual_String; - Decl_Text : VSS.Strings.Virtual_String; - Aspects_Text : VSS.Strings.Virtual_String; - - begin - LSP.Ada_Documentation.Get_Tooltip_Text - (BD => BD, - Style => Self.Options.Documentation.Style, - Qualifier_Text => Qual_Text, - Location_Text => Loc_Text, - Documentation_Text => Doc_Text, - Declaration_Text => Decl_Text, - Aspects_Text => Aspects_Text); - - Item.detail := (True, Decl_Text); - - if not Doc_Text.Is_Empty then - Loc_Text.Append - (VSS.Strings.To_Virtual_String - ((1 .. 2 => Ada.Characters.Wide_Wide_Latin_1.LF))); - - Loc_Text.Append (Doc_Text); - end if; - - Item.documentation := - (Is_Set => True, - Value => LSP.Messages.String_Or_MarkupContent' - (Is_String => True, - String => Loc_Text)); - end; - - Response.result := Item; - end if; - - return Response; - end On_CompletionItemResolve_Request; - - --------------------------- - -- On_Formatting_Request -- - --------------------------- - - overriding function On_Formatting_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Formatting_Request) - return LSP.Messages.Server_Responses.Formatting_Response - is - Context : constant Context_Access := - Self.Contexts.Get_Best_Context (Request.params.textDocument.uri); - - Document : constant LSP.Ada_Documents.Document_Access := - Get_Open_Document (Self, Request.params.textDocument.uri); - begin - if Document.Has_Diagnostics (Context.all) then - return Response : LSP.Messages.Server_Responses.Formatting_Response - (Is_Error => True) - do - Response.error := - (True, - (code => LSP.Errors.InternalError, - message => "Incorrect code can't be formatted", - data => <>)); - end return; - end if; - - declare - use LSP.Messages; - - Response : constant Server_Responses.Formatting_Response := - Format - (Self => Context.all, - Document => Document, - Span => LSP.Messages.Empty_Span, - Options => Request.params.options, - Handler => Self); - begin - return Response; - end; - end On_Formatting_Request; - - --------------------------------------- - -- On_Prepare_Call_Hierarchy_Request -- - --------------------------------------- - - overriding function On_Prepare_Call_Hierarchy_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Prepare_Call_Hierarchy_Request) - return LSP.Messages.Server_Responses.PrepareCallHierarchy_Response - is - Value : LSP.Messages.CallHierarchyPrepareParams renames - Request.params; - - Response : LSP.Messages.Server_Responses.PrepareCallHierarchy_Response - (Is_Error => False); - - Imprecise : Boolean := False; - - C : constant Context_Access := - Self.Contexts.Get_Best_Context (Value.textDocument.uri); - -- For the PrepareCallHierarchy request, we're only interested in the - -- "best" response value, not in the list of values for all contexts - - Node : constant Libadalang.Analysis.Name := - Laltools.Common.Get_Node_As_Name - (C.Get_Node_At - (Get_Open_Document (Self, Value.textDocument.uri), Value)); - - Name : constant Libadalang.Analysis.Defining_Name := - Laltools.Common.Resolve_Name - (Node, - Self.Trace, - Imprecise); - - Decl : Libadalang.Analysis.Basic_Decl; - Next_Part : Libadalang.Analysis.Basic_Decl; - begin - if Name.Is_Null then - return Response; - end if; - - Decl := Name.P_Basic_Decl; - - if Decl.Is_Null or else not Decl.P_Is_Subprogram then - return Response; - end if; - - Next_Part := - Laltools.Common.Find_Next_Part_For_Decl (Decl, Self.Trace); - - if Next_Part.Is_Null then - Next_Part := Decl; - end if; - - Response.result.Append - (To_Call_Hierarchy_Item (Next_Part.P_Defining_Name)); - - if Imprecise then - Self.Show_Imprecise_Reference_Warning ("prepareCallHierarchy"); - end if; - - return Response; - end On_Prepare_Call_Hierarchy_Request; - - ------------------------------- - -- On_Prepare_Rename_Request -- - ------------------------------- - - overriding function On_Prepare_Rename_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Prepare_Rename_Request) - return LSP.Messages.Server_Responses.Prepare_Rename_Response - is - Value : LSP.Messages.TextDocumentPositionParams renames - Request.params; - - Response : LSP.Messages.Server_Responses.Prepare_Rename_Response - (Is_Error => False); - - Document : constant LSP.Ada_Documents.Document_Access := - Get_Open_Document (Self, Value.textDocument.uri); - - Context : constant Context_Access := - Self.Contexts.Get_Best_Context (Value.textDocument.uri); - -- For the prepareRename request, we're only interested in the "best" - -- context to check that we are able to rename the name. - - Name_Node : constant Libadalang.Analysis.Name := - Laltools.Common.Get_Node_As_Name - (Context.Get_Node_At (Document, Value)); - - Imprecise : Boolean := False; - - Defining_Name : constant Libadalang.Analysis.Defining_Name := - Laltools.Common.Resolve_Name (Name_Node, Self.Trace, Imprecise); - - begin - if not Name_Node.Is_Null - and then not Defining_Name.Is_Null - and then not Imprecise - then - -- Success only if the node is a name and can be resolved precisely - Response.result := - (Is_Set => True, - Value => LSP.Lal_Utils.To_Span (Name_Node.Sloc_Range)); - - end if; - - return Response; - end On_Prepare_Rename_Request; - - ------------------------------- - -- On_Incoming_Calls_Request -- - ------------------------------- - - overriding function On_Incoming_Calls_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Incoming_Calls_Request) - return LSP.Messages.Server_Responses.IncomingCalls_Response - is - use Libadalang.Analysis; - - procedure Process_Context (C : Context_Access); - -- Process the subprogram found in one context and append corresponding - -- calls to Response.results. - - Item : LSP.Messages.CallHierarchyItem renames - Request.params.item; - Response : LSP.Messages.Server_Responses.IncomingCalls_Response - (Is_Error => False); - Imprecise : Boolean := False; - - Position : constant LSP.Messages.TextDocumentPositionParams := - (textDocument => (uri => Item.uri), - position => Item.selectionRange.first); - - Filter : File_Span_Sets.Set; - - procedure Add_Incoming_Call - (Filter : in out File_Span_Sets.Set; - Call : LSP.Messages.CallHierarchyIncomingCall); - -- Add an incoming call in results. Use Filter to prevent having - -- duplicates - - ----------------------- - -- Add_Incoming_Call -- - ----------------------- - - procedure Add_Incoming_Call - (Filter : in out File_Span_Sets.Set; - Call : LSP.Messages.CallHierarchyIncomingCall) - is - Span : constant File_Span := - (Self.To_File (Call.from.uri), Call.from.span); - begin - if not Filter.Contains (Span) then - Response.result.Append (Call); - Filter.Insert (Span); - end if; - end Add_Incoming_Call; - - --------------------- - -- Process_Context -- - --------------------- - - procedure Process_Context (C : Context_Access) is - Definition : Defining_Name; - begin - Self.Imprecise_Resolve_Name (C, Position, Definition); - - -- Attempt to resolve the name, return no results if we can't or if - -- the name does not resolve to a callable object, like a subprogram - -- or an entry. - - if Definition = No_Defining_Name - or else not Definition.P_Basic_Decl.P_Is_Subprogram - or else Request.Canceled - then - return; - end if; - - declare - use Laltools.Common; - - This_Imprecise : Boolean; - Incoming_Calls : constant References_By_Subprogram.Map := - LSP.Lal_Utils.Find_Incoming_Calls - (C.all, Definition, This_Imprecise); - C : References_By_Subprogram.Cursor := - Incoming_Calls.First; - begin - Imprecise := Imprecise or This_Imprecise; - - -- Iterate through all the results, converting them to protocol - -- objects. - while References_By_Subprogram.Has_Element (C) loop - declare - Node : constant Defining_Name := - References_By_Subprogram.Key (C); - Refs : constant References_Sets.Set := - References_By_Subprogram.Element (C); - New_Call : LSP.Messages.CallHierarchyIncomingCall; - begin - To_Call_Hierarchy_Result - (Node => Node, - Refs => Refs, - Item => New_Call.from, - Spans => New_Call.fromRanges, - Kinds => New_Call.kinds); - - Add_Incoming_Call (Filter, New_Call); - References_By_Subprogram.Next (C); - end; - end loop; - end; - end Process_Context; - - begin - -- Find the references in all contexts - for C of Self.Contexts_For_URI (Item.uri) loop - Process_Context (C); - - exit when Request.Canceled; - end loop; - - if Imprecise then - Self.Show_Imprecise_Reference_Warning ("incomingCalls"); - end if; - - return Response; - end On_Incoming_Calls_Request; - - ------------------------------- - -- On_Outgoing_Calls_Request -- - ------------------------------- - - overriding function On_Outgoing_Calls_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Outgoing_Calls_Request) - return LSP.Messages.Server_Responses.OutgoingCalls_Response - is - use Libadalang.Analysis; - - Item : LSP.Messages.CallHierarchyItem renames - Request.params.item; - Response : LSP.Messages.Server_Responses.OutgoingCalls_Response - (Is_Error => False); - Imprecise : Boolean := False; - - Position : constant LSP.Messages.TextDocumentPositionParams := - (textDocument => (uri => Item.uri), - position => Item.selectionRange.first); - - Filter : File_Span_Sets.Set; - - procedure Add_Outgoing_Call - (Filter : in out File_Span_Sets.Set; - Call : LSP.Messages.CallHierarchyOutgoingCall); - -- Add a subprogram in results. Use Filter to prevent having duplicates - - procedure Process_Context (C : Context_Access); - -- Process the calls found in one context and append - -- them to Response.results. - - ----------------------- - -- Add_Outgoing_Call -- - ----------------------- - - procedure Add_Outgoing_Call - (Filter : in out File_Span_Sets.Set; - Call : LSP.Messages.CallHierarchyOutgoingCall) - is - Span : constant File_Span := - (Self.To_File (Call.to.uri), Call.to.span); - begin - if not Filter.Contains (Span) then - Response.result.Append (Call); - Filter.Insert (Span); - end if; - end Add_Outgoing_Call; - - --------------------- - -- Process_Context -- - --------------------- - - procedure Process_Context (C : Context_Access) is - Definition : Defining_Name; - begin - Self.Imprecise_Resolve_Name (C, Position, Definition); - - -- Attempt to resolve the name, return no results if we can't or if - -- the name does not resolve to a callable object, like a subprogram - -- or an entry. - - if Definition = No_Defining_Name - or else not Definition.P_Basic_Decl.P_Is_Subprogram - or else Request.Canceled - then - return; - end if; - - declare - use Laltools.Common; - - This_Imprecise : Boolean; - Outgoing_Calls : constant References_By_Subprogram.Map := - LSP.Lal_Utils.Find_Outgoing_Calls - (C.all, Definition, This_Imprecise); - C : References_By_Subprogram.Cursor := - Outgoing_Calls.First; - begin - Imprecise := Imprecise or This_Imprecise; - - -- Iterate through all the results, converting them to protocol - -- objects. - while References_By_Subprogram.Has_Element (C) loop - declare - Node : constant Defining_Name := - References_By_Subprogram.Key (C); - Refs : constant References_Sets.Set := - References_By_Subprogram.Element (C); - New_Call : LSP.Messages.CallHierarchyOutgoingCall; - begin - To_Call_Hierarchy_Result - (Node => Node, - Refs => Refs, - Item => New_Call.to, - Spans => New_Call.fromRanges, - Kinds => New_Call.kinds); - - Add_Outgoing_Call (Filter, New_Call); - References_By_Subprogram.Next (C); - end; - end loop; - end; - end Process_Context; - begin - -- Find the references in all contexts - for C of Self.Contexts_For_URI (Item.uri) loop - Process_Context (C); - - exit when Request.Canceled; - end loop; - - if Imprecise then - Self.Show_Imprecise_Reference_Warning ("outgoingCalls"); - end if; - - return Response; - end On_Outgoing_Calls_Request; - - --------------------------------- - -- On_Range_Formatting_Request -- - --------------------------------- - - overriding function On_Range_Formatting_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Range_Formatting_Request) - return LSP.Messages.Server_Responses.Range_Formatting_Response - is - Context : constant Context_Access := - Self.Contexts.Get_Best_Context (Request.params.textDocument.uri); - - Document : constant LSP.Ada_Documents.Document_Access := - Get_Open_Document (Self, Request.params.textDocument.uri); - - begin - if Document.Has_Diagnostics (Context.all) then - return Response : LSP.Messages.Server_Responses. - Range_Formatting_Response (Is_Error => True) - do - Response.error := - (True, - (code => LSP.Errors.InternalError, - message => "Syntactically incorrect code can't be formatted", - data => <>)); - end return; - end if; - - declare - use LSP.Messages; - - Result : constant Server_Responses.Formatting_Response := - (if Partial_Gnatpp_Trace.Is_Active then - Range_Format - (Self => Context.all, - Document => Document, - Span => Request.params.span, - Options => Request.params.options) - else - Format - (Self => Context.all, - Document => Document, - Span => Request.params.span, - Options => Request.params.options, - Handler => Self)); - Response : Server_Responses.Range_Formatting_Response - (Is_Error => Result.Is_Error); - - begin - if not Result.Is_Error then - Response.result := Result.result; - else - Response.error := Result.error; - end if; - - return Response; - end; - end On_Range_Formatting_Request; - - ----------------------------------- - -- On_On_Type_Formatting_Request -- - ----------------------------------- - - overriding function On_On_Type_Formatting_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.On_Type_Formatting_Request) - return LSP.Messages.Server_Responses.On_Type_Formatting_Response - is - use type VSS.Strings.Virtual_String; - - Context : constant Context_Access := - Self.Contexts.Get_Best_Context (Request.params.textDocument.uri); - Document : constant LSP.Ada_Documents.Document_Access := - Get_Open_Document (Self, Request.params.textDocument.uri); - Has_Dianostics : constant Boolean := - Document.all.Has_Diagnostics (Context.all); - - Indentation : constant Natural := - (declare - Indentation_First_Guess : constant Natural := - Document.all.Get_Indentation - (Context.all, Request.params.position.line); - begin - (if Indentation_First_Guess >= - Natural (Request.params.position.character) - then Indentation_First_Guess - - Natural (Request.params.position.character) - else 0)); - -- Do not add any indentation if the current cursor position is greater - -- than the calculated one. - - Response : - LSP.Messages.Server_Responses.On_Type_Formatting_Response - (Is_Error => False); - - procedure Handle_Document_With_Diagnostics; - -- Simply adds indentation to the new line - - procedure Handle_Document_Without_Diagnostics; - -- Adds indentation to the new line and formats the previous node - -- if configured to do so and taking into account where the cursor - -- is. - - -------------------------------------- - -- Handle_Document_With_Diagnostics -- - -------------------------------------- - - procedure Handle_Document_With_Diagnostics is - use VSS.Strings.Conversions; - - Result : - LSP.Messages.Server_Responses.Formatting_Response - (Is_Error => False); - - begin - Result.result.Append - (LSP.Messages.TextEdit' - (span => - LSP.Messages.Span' - (first => Request.params.position, - last => Request.params.position), - newText => To_Virtual_String (Indentation * " "))); - - Response.result := Result.result; - end Handle_Document_With_Diagnostics; - - ----------------------------------------- - -- Handle_Document_Without_Diagnostics -- - ----------------------------------------- - - procedure Handle_Document_Without_Diagnostics is - use Laltools.Partial_GNATPP; - use VSS.Strings.Conversions; - - use type VSS.Unicode.UTF16_Code_Unit_Offset; - - function Is_Between - (Position : LSP.Messages.Position; - Span : LSP.Messages.Span) - return Boolean; - -- Checks if Position is between Span - - ---------------- - -- Is_Between -- - ---------------- - - function Is_Between - (Position : LSP.Messages.Position; - Span : LSP.Messages.Span) - return Boolean - is ((Position.line = Span.first.line - and then Position.character >= Span.first.character) - or else (Position.line = Span.last.line - and then Position.character <= Span.last.character) - or else (Position.line > Span.first.line - and then Position.line < Span.last.line)); - - Token : constant Token_Reference := - Document.all.Get_Token_At (Context.all, Request.params.position); - Previous_NWNC_Token : - constant Libadalang.Common.Token_Reference := - Previous_Non_Whitespace_Non_Comment_Token (Token); - Previous_NWNC_Token_Span : constant LSP.Messages.Span := - Document.all.To_LSP_Range (Sloc_Range (Data (Previous_NWNC_Token))); - - Formatting_Region : constant Formatting_Region_Type := - Document.all.Get_Formatting_Region - (Context.all, Previous_NWNC_Token_Span.first); - Formatting_Span : constant LSP.Messages.Span := - Document.all.To_LSP_Range - (Langkit_Support.Slocs.Make_Range - (Langkit_Support.Slocs.Start_Sloc - (Sloc_Range (Data (Formatting_Region.Start_Token))), - Langkit_Support.Slocs.Start_Sloc - (Sloc_Range (Data (Formatting_Region.End_Token))))); - -- This is the span that would be formatted based on the cursor - -- position. - - begin - if Self.Options.On_Type_Formatting.Indent_Only then - Self.Trace.Trace - ("'onTypeFormatting' request configured to indent only"); - declare - Result : - LSP.Messages.Server_Responses.Formatting_Response - (Is_Error => False); - - begin - Result.result.Append - (LSP.Messages.TextEdit' - (span => - LSP.Messages.Span' - (first => Request.params.position, - last => Request.params.position), - newText => To_Virtual_String (Indentation * " "))); - - Response.result := Result.result; - end; - - else - -- onTypeFormatting is configured to also format the previous - -- node, however, we can only do this if the cursor is not - -- between the Formatting_Span. - - if Is_Between (Request.params.position, Formatting_Span) then - Self.Trace.Trace - ("Current position is within the Formatting_Span"); - Self.Trace.Trace ("Adding indentation only"); - - declare - Result : - LSP.Messages.Server_Responses.Formatting_Response - (Is_Error => False); - begin - Result.result.Append - (LSP.Messages.TextEdit' - (span => - LSP.Messages.Span' - (first => Request.params.position, - last => Request.params.position), - newText => To_Virtual_String (Indentation * " "))); - - Response.result := Result.result; - end; - - else - Self.Trace.Trace - ("Formatting previous node and adding indentation"); - - declare - Result : - LSP.Messages.Server_Responses.Formatting_Response := - Range_Format - (Self => Context.all, - Document => Document, - Span => Previous_NWNC_Token_Span, - Options => Request.params.options); - begin - if Result.Is_Error then - declare - Result : - LSP.Messages.Server_Responses.Formatting_Response - (Is_Error => False); - begin - Result.result.Append - (LSP.Messages.TextEdit' - (span => - LSP.Messages.Span' - (first => Request.params.position, - last => Request.params.position), - newText => - To_Virtual_String (Indentation * " "))); - - Response.result := Result.result; - end; - - Self.Trace.Trace - ("The 'onTypeFormatting' has failed because of a " - & "Range_Format error"); - - else - -- Result contains the Range_Format result. - -- Add indentation to the next line. - Result.result.Append - (LSP.Messages.TextEdit' - (span => - LSP.Messages.Span' - (first => Request.params.position, - last => Request.params.position), - newText => To_Virtual_String (Indentation * " "))); - - Response.result := Result.result; - end if; - end; - end if; - end if; - end Handle_Document_Without_Diagnostics; - - begin - Self.Trace.Trace ("On 'onTypeFormatting' Request"); - - Self.Trace.Trace - ("uri : " - & LSP.Types.To_UTF_8_String (Request.params.textDocument.uri)); - Self.Trace.Trace - ("ch : " - & VSS.Strings.Conversions.To_UTF_8_String (Request.params.ch)); - Self.Trace.Trace - ("line : " & Request.params.position.line'Image); - Self.Trace.Trace - ("character : " & Request.params.position.character'Image); - - if not On_Type_Formatting_Trace.Is_Active then - Self.Trace.Trace - ("'onTypeFormatting' is not active, yet, ALS received a request - " - & "exiting earlier"); - - return Response; - end if; - - if Request.params.ch /= - Self.On_Type_Formatting_Settings.First_Trigger_Character - then - Self.Trace.Trace - ("Trigger character ch is not a new line - exiting earlier"); - - return Response; - end if; - - if Has_Dianostics then - -- This is the unhappy path: when this Document has diagnostics. - -- Get the previous node (based on the previous non whitespace - -- token), compute the indentation and format it (if configured to - -- to so). - - Self.Trace.Trace ("Document has diagnostics"); - Handle_Document_With_Diagnostics; - - else - -- This is the happy path: when this Document does not have any - -- diagnostics. - -- Get the previous node (based on the previous non whitespace - -- token) and compute the indentation. - - Self.Trace.Trace ("Document does not have any diagnostics"); - Handle_Document_Without_Diagnostics; - end if; - - Self.Trace.Trace ("Exiting 'onTypeFormatting' Request"); - return Response; - end On_On_Type_Formatting_Request; - - ------------------ - -- Handle_Error -- - ------------------ - - overriding procedure Handle_Error - (Self : access Message_Handler) is - begin - -- Reload the contexts in case of unexpected errors. - Self.Contexts.Reload_All_Contexts; - end Handle_Error; - - function Hash (Value : File_Span) return Ada.Containers.Hash_Type is - use type Ada.Containers.Hash_Type; - Prime : constant := 271; - Name : constant Ada.Containers.Hash_Type := Value.File.Full_Name_Hash; - From : constant Ada.Containers.Hash_Type := - Prime * Ada.Containers.Hash_Type'Mod (Value.Span.first.line) - + Ada.Containers.Hash_Type'Mod (Value.Span.first.character); - To : constant Ada.Containers.Hash_Type := - Prime * Ada.Containers.Hash_Type'Mod (Value.Span.last.line) - + Ada.Containers.Hash_Type'Mod (Value.Span.last.character); - begin - return Name + From + To; - end Hash; - - ------------------------- - -- Publish_Diagnostics -- - ------------------------- - - procedure Publish_Diagnostics - (Self : access Message_Handler'Class; - Document : not null LSP.Ada_Documents.Document_Access; - Other_Diagnostics : LSP.Messages.Diagnostic_Vector := - LSP.Messages.Diagnostic_Vectors.Empty; - Force : Boolean := False) - is - Changed : Boolean; - Diag : LSP.Messages.PublishDiagnosticsParams; - begin - if Self.Diagnostics_Enabled then - Document.Get_Errors - (Context => Self.Contexts.Get_Best_Context (Document.URI).all, - Changed => Changed, - Errors => Diag.diagnostics, - Force => Force); - - Diag.diagnostics.Append_Vector (Other_Diagnostics); - - if Changed or else not Other_Diagnostics.Is_Empty then - Diag.uri := Document.URI; - Self.Server.On_Publish_Diagnostics (Diag); - end if; - end if; - end Publish_Diagnostics; - - ---------- - -- Free -- - ---------- - - procedure Free (Self : in out Internal_Document_Access) is - procedure Unchecked_Free is new Ada.Unchecked_Deallocation - (LSP.Ada_Documents.Document, Internal_Document_Access); - begin - Self.Cleanup; - Unchecked_Free (Self); - end Free; - - ------------------ - -- Show_Message -- - ------------------ - - procedure Show_Message - (Self : access Message_Handler; - Text : VSS.Strings.Virtual_String; - Mode : LSP.Messages.MessageType := LSP.Messages.Error) is - begin - Self.Server.On_Show_Message ((Mode, Text)); - end Show_Message; - - -------------------------------------- - -- Show_Imprecise_Reference_Warning -- - -------------------------------------- - - procedure Show_Imprecise_Reference_Warning - (Self : access Message_Handler; - Operation : String) is - begin - if Notifications_For_Imprecise.Is_Active then - Self.Server.On_Show_Message - ((LSP.Messages.Warning, - VSS.Strings.Conversions.To_Virtual_String - ("The result of '" & Operation & "' is approximate."))); - end if; - end Show_Imprecise_Reference_Warning; - - ----------------- - -- Before_Work -- - ----------------- - - overriding procedure Before_Work - (Self : access Message_Handler; - Message : LSP.Messages.Message'Class) is null; - - ---------------- - -- After_Work -- - ---------------- - - overriding procedure After_Work - (Self : access Message_Handler; - Message : LSP.Messages.Message'Class) - is - pragma Unreferenced (Message); - begin - -- We have finished processing a request or notification: - -- if it happens that indexing is required, do it now. - if not Self.Files_To_Index.Is_Empty then - Self.Index_Files; - end if; - end After_Work; - - --------------- - -- From_File -- - --------------- - - function From_File - (Self : Message_Handler'Class; - File : Virtual_File) return LSP.Messages.DocumentUri is - (LSP.Types.To_LSP_URI - (VSS.Strings.Conversions.To_Virtual_String - (URIs.Conversions.From_File (File.Display_Full_Name)))); - - ------------- - -- To_File -- - ------------- - - function To_File - (Self : Message_Handler'Class; - URI : LSP.Types.LSP_URI) return GNATCOLL.VFS.Virtual_File - is - To : constant URIs.URI_String := LSP.Types.To_UTF_8_String (URI); - Result : constant String := URIs.Conversions.To_File - (To, Normalize => Self.Follow_Symlinks); - begin - return GNATCOLL.VFS.Create_From_UTF8 (Result); - end To_File; - - ----------------- - -- URI_To_File -- - ----------------- - - function URI_To_File - (Self : Message_Handler'Class; - URI : VSS.Strings.Virtual_String) return VSS.Strings.Virtual_String - is - To : constant URIs.URI_String := - VSS.Strings.Conversions.To_UTF_8_String (URI); - Result : constant String := URIs.Conversions.To_File - (To, Normalize => Self.Follow_Symlinks); - - begin - return VSS.Strings.Conversions.To_Virtual_String (Result); - end URI_To_File; - - --------------------------------- - -- On_ALS_Check_Syntax_Request -- - --------------------------------- - - overriding function On_ALS_Check_Syntax_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.ALS_Check_Syntax_Request) - return LSP.Messages.Server_Responses.ALS_Check_Syntax_Response - is - use Laltools.Common; - use LSP.Messages.Server_Responses; - use VSS.Strings; - - function "+" - (Item : Virtual_String'Class) - return Ada.Strings.UTF_Encoding.UTF_8_String - renames VSS.Strings.Conversions.To_UTF_8_String; - - function "+" - (Item : Virtual_String'Class) - return Unbounded_String - renames VSS.Strings.Conversions.To_Unbounded_UTF_8_String; - - Invalid_Rule_Error_Message : constant Virtual_String := - "Error parsing the grammar rules for the syntax check"; - - Input : constant Unbounded_String := +Request.params.Input; - Rules : Grammar_Rule_Vector; - - Valid : Boolean := False; - - begin - if Request.params.Rules.Length = 0 then - -- We need at least one rule in order to validate the input - - raise Constraint_Error; - end if; - - for Rule_Image of Request.params.Rules loop - -- A Constraint_Error can be raised here is an invalid rule is - -- received in the request parameters. - Rules.Append (Grammar_Rule'Value (+Rule_Image)); - end loop; - - -- The input cannot be empty and only needs to be valid against one of - -- the rules. - - if Input /= "" then - Valid := Validate_Syntax (Input, Rules); - end if; - - if Valid then - return Response : ALS_Check_Syntax_Response (Is_Error => False) do - Response.result := (Is_Set => False); - end return; - - else - return Response : ALS_Check_Syntax_Response (Is_Error => False) do - Response.result := (Is_Set => True, Value => "Invalid Syntax"); - end return; - end if; - - exception - when Constraint_Error => - return Response : ALS_Check_Syntax_Response (Is_Error => True) do - Response.error := - (Is_Set => True, - Value => (code => LSP.Errors.InvalidRequest, - message => Invalid_Rule_Error_Message, - data => <>)); - end return; - end On_ALS_Check_Syntax_Request; - - ---------------------- - -- GLS_Mains_Request -- - ---------------------- - - overriding function On_GLS_Mains_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.GLS_Mains_Request) - return LSP.Messages.Server_Responses.GLS_Mains_Response - is - use LSP.Messages.Server_Responses; - use VSS.String_Vectors; - Result : Virtual_String_Vector; - Element : GPR2.Project.View.Object; - begin - if Self.Project_Tree.Is_Defined - then - Element := Self.Project_Tree.Root_Project; - if Element.Has_Mains then - for main of Element.Mains loop - Result.Append - (VSS.Strings.Conversions.To_Virtual_String - (main.Source.Value)); - end loop; - end if; - end if; - return Response : GLS_Mains_Response (Is_Error => False) do - Response.result := (Is_Set => True, Value => Result); - end return; - end On_GLS_Mains_Request; - - ---------------------- - -- GLS_Executables_Request -- - ---------------------- - - overriding function On_GLS_Executables_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.GLS_Executables_Request) - return LSP.Messages.Server_Responses.GLS_Executables_Response - is - use LSP.Messages.Server_Responses; - use VSS.String_Vectors; - Result : Virtual_String_Vector; - Element : GPR2.Project.View.Object; - begin - if Self.Project_Tree.Is_Defined - then - Element := Self.Project_Tree.Root_Project; - for exec of Element.Executables loop - Result.Append - (VSS.Strings.Conversions.To_Virtual_String - (exec.Value)); - end loop; - end if; - return Response : GLS_Executables_Response (Is_Error => False) do - Response.result := (Is_Set => True, Value => Result); - end return; - end On_GLS_Executables_Request; - - -------------------------------- - -- On_GLS_ObjectDir_Request -- - -------------------------------- - - overriding function On_GLS_Object_Dir_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.GLS_Object_Dir_Request) - return LSP.Messages.Server_Responses.GLS_Object_Dir_Response - is - use LSP.Messages.Server_Responses; - use VSS.Strings; - Result : Virtual_String; - Element : GPR2.Project.View.Object; - begin - if Self.Project_Tree.Is_Defined - then - Element := Self.Project_Tree.Root_Project; - Result := VSS.Strings.Conversions.To_Virtual_String - (Element.Object_Directory.Value); - end if; - return Response : GLS_Object_Dir_Response (Is_Error => False) do - Response.result := (Is_Set => True, Value => Result); - end return; - end On_GLS_Object_Dir_Request; - - -------------------------------- - -- On_GLS_Project_File_Request -- - -------------------------------- - - overriding function On_GLS_Project_File_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.GLS_Project_File_Request) - return LSP.Messages.Server_Responses.GLS_Project_File_Response - is - use LSP.Messages.Server_Responses; - use VSS.Strings; - Result : Virtual_String; - Element : GPR2.Project.View.Object; - begin - if Self.Project_Tree.Is_Defined - then - Element := Self.Project_Tree.Root_Project; - Result := VSS.Strings.Conversions.To_Virtual_String - (Element.Path_Name.Value); - end if; - return Response : GLS_Project_File_Response (Is_Error => False) do - Response.result := (Is_Set => True, Value => Result); - end return; - end On_GLS_Project_File_Request; - - ----------- - -- Parse -- - ----------- - - function Parse - (Value : LSP.Types.Optional_LSP_Any) - return Experimental_Client_Capabilities is - begin - return Result : Experimental_Client_Capabilities := - (Advanced_Refactorings => [others => False]) - do - if Value.Is_Set then - if Value.Value.Has_Field ("advanced_refactorings") - and then Value.Value.Get ("advanced_refactorings").Kind in - GNATCOLL.JSON.JSON_Array_Type - then - declare - Advanced_Refactorings : constant GNATCOLL.JSON.JSON_Array := - Value.Value.Get ("advanced_refactorings"); - Advanced_Refactoring : - LSP.Ada_Handlers.Advanced_Refactorings; - begin - for Refactoring of Advanced_Refactorings loop - if Refactoring.Kind in GNATCOLL.JSON.JSON_String_Type then - begin - Advanced_Refactoring := - LSP.Ada_Handlers.Advanced_Refactorings'Value - (GNATCOLL.JSON.Get (Refactoring)); - Result.Advanced_Refactorings - (Advanced_Refactoring) := True; - exception - when others => - null; - end; - end if; - end loop; - end; - end if; - end if; - end return; - end Parse; - - --------------------------------------- - -- Update_Project_Predefined_Sources -- - --------------------------------------- - - procedure Update_Project_Predefined_Sources (Self : access Message_Handler) - is - use GPR2; - use GPR2.Project.Source.Set; - begin - Self.Project_Predefined_Sources.Clear; + Value.Visit_Server_Receiver (Self); - if Self.Project_Tree.Is_Defined - and then Self.Project_Tree.Has_Runtime_Project - then - for Source of Self.Project_Tree.Runtime_Project.Sources loop - if Source.Language = GPR2.Ada_Language then - Self.Project_Predefined_Sources.Include - (Source.Path_Name.Virtual_File); - end if; - end loop; + if not Self.Implemented then + Self.Client.On_Error_Response + (Value.Id, + (code => LSP.Enumerations.MethodNotFound, + message => "Not implemented")); end if; - end Update_Project_Predefined_Sources; + end On_Server_Request; end LSP.Ada_Handlers; diff --git a/source/ada/lsp-ada_handlers.ads b/source/ada/lsp-ada_handlers.ads index 8bdab9c80..35935b302 100644 --- a/source/ada/lsp-ada_handlers.ads +++ b/source/ada/lsp-ada_handlers.ads @@ -18,745 +18,26 @@ -- This package provides requests and notifications handler for Ada -- language. -with Ada.Containers.Hashed_Maps; -with Ada.Containers.Hashed_Sets; -with Ada.Strings.Unbounded; -with VSS.String_Vectors; - -with GNATCOLL.JSON; -with GNATCOLL.VFS; -with GNATCOLL.Traces; - -with VSS.Strings; - -with GPR2; -with GPR2.Context; -with GPR2.File_Readers; -with GPR2.Path_Name; -with GPR2.Path_Name.Set; -with GPR2.Project.Configuration; -with GPR2.Project.Tree; - -with LSP.Ada_Contexts; -with LSP.Ada_Context_Sets; -with LSP.Ada_Documents; -with LSP.Ada_File_Sets; -with LSP.Ada_Highlighters; - -with LSP.File_Monitors; -with LSP.Messages.Server_Requests; -with LSP.Messages.Server_Responses; -with LSP.Search; -with LSP.Server_Backends; -with LSP.Server_Request_Handlers; -with LSP.Server_Notification_Receivers; -with LSP.Servers; -with LSP.Types; -with LSP.Messages; - -private with Ada.Characters.Wide_Wide_Latin_1; - -private with GNATdoc.Comments.Options; +with LSP.Client_Message_Receivers; +with LSP.Server_Request_Receivers; +with LSP.Server_Message_Visitors; +with LSP.Server_Requests; package LSP.Ada_Handlers is type Message_Handler - (Server : access LSP.Servers.Server; - Trace : GNATCOLL.Traces.Trace_Handle) is - limited new LSP.Server_Request_Handlers.Server_Request_Handler - and LSP.Server_Notification_Receivers.Server_Notification_Receiver - and LSP.Server_Backends.Server_Backend - and LSP.Ada_Documents.Document_Provider - with private; - -- A handler of LSP notifications and requests from Ada language - - overriding procedure Handle_Error (Self : access Message_Handler); - -- This procedure will be called when an unexpected error is raised in the - -- request processing loop. - - procedure Change_Configuration - (Self : access Message_Handler; - Options : GNATCOLL.JSON.JSON_Value'Class); - -- Change server configuration with settings from Ada JSON object. - - procedure Change_Configuration_Before_Init - (Self : access Message_Handler; - Options : GNATCOLL.JSON.JSON_Value'Class; - Root : GNATCOLL.VFS.Virtual_File); - -- Change server configuration with settings from Ada JSON object, taking - -- Root to resolve all relative references. This is expected to work - -- before the server get initialize request and find root folder. - - procedure Stop_File_Monitoring (Self : access Message_Handler); - - procedure Cleanup (Self : access Message_Handler); - -- Free memory referenced by Self - - procedure Clean_Logs - (Self : access Message_Handler; - Dir : GNATCOLL.VFS.Virtual_File); - -- Remove the oldest logs in Dir - - subtype Context_Access is LSP.Ada_Context_Sets.Context_Access; - - function From_File - (Self : Message_Handler'Class; - File : GNATCOLL.VFS.Virtual_File) return LSP.Messages.DocumentUri; - -- Turn Virtual_File to URI - - function To_File - (Self : Message_Handler'Class; - URI : LSP.Types.LSP_URI) return GNATCOLL.VFS.Virtual_File; - -- Turn URI into Virtual_File - -private - - -- Options for refactoring/renaming - type Renaming_Options is record - In_Comments : Boolean := False; - end record; - - -- Options for refactoring - type Refactoring_Options is record - Renaming : Renaming_Options; - end record; - - -- Options for folding -- - type Folding_Options is record - Comments : Boolean := True; - end record; - - -- Options for documentation - type Documentation_Options is record - Style : GNATdoc.Comments.Options.Documentation_Style := - GNATdoc.Comments.Options.GNAT; - end record; - - type On_Type_Formatting_Options is record - Indent_Only : Boolean; - end record; - - -- Options holder -- - type Options_Holder is record - Refactoring : Refactoring_Options; - -- Configuration options for refactoring - - Folding : Folding_Options; - -- folding options - - Documentation : Documentation_Options; - -- Configuration options for documentation - - On_Type_Formatting : On_Type_Formatting_Options; - -- Configuration options for the onTypeFormatting request - end record; - - type Internal_Document_Access is access all LSP.Ada_Documents.Document; - - procedure Free (Self : in out Internal_Document_Access); - -- Free all the data for the given document. - - -- Container for documents indexed by URI - package Document_Maps is new Ada.Containers.Hashed_Maps - (Key_Type => GNATCOLL.VFS.Virtual_File, - Element_Type => Internal_Document_Access, - Hash => GNATCOLL.VFS.Full_Name_Hash, - Equivalent_Keys => GNATCOLL.VFS."="); - - -- Container for the predefined source files - package File_Sets is new Ada.Containers.Hashed_Sets - (Element_Type => GNATCOLL.VFS.Virtual_File, - Hash => GNATCOLL.VFS.Full_Name_Hash, - Equivalent_Elements => GNATCOLL.VFS."=", - "=" => GNATCOLL.VFS."="); - - type Get_Symbol_Access is access procedure - (Self : LSP.Ada_Documents.Document; - Context : LSP.Ada_Contexts.Context; - Pattern : LSP.Search.Search_Pattern'Class; - Canceled : access function return Boolean; - Result : out LSP.Messages.Symbol_Vector); - -- textDocument/documentSymbol handler - - Empty_Token : LSP.Types.LSP_Number_Or_String := - (Is_Number => False, String => <>); - - type Load_Project_Status is - (Valid_Project_Configured, - Single_Project_Found, - Alire_Project, - No_Runtime_Found, - No_Project_Found, - Multiple_Projects_Found, - Invalid_Project_Configured); - -- Variants for state of the project loaded into the handler: - -- - -- @value Valid_Project_Configured didChangeConfiguration provided a valid - -- project - -- - -- @value Single_Project_Found no project in didChangeConfiguration, but - -- just one project in Root dir - -- - -- @value Alire_Project no project in didChangeConfiguration, but Alire - -- knows what project to use - -- - -- @value No_Runtime_Found project loaded, but no Ada runtime library was - -- found - -- - -- @value No_Project_Found no project in didChangeConfiguration and no - -- project in Root dir - -- - -- @value Multiple_Projects_Found no project in didChangeConfiguration and - -- several projects in Root dir - -- - -- @value Invalid_Project_Configured didChangeConfiguration provided a - -- valid project - - subtype Implicit_Project_Loaded is Load_Project_Status range - No_Project_Found .. Invalid_Project_Configured; - -- Project status when an implicit project loaded - - type Advanced_Refactorings is - (Add_Parameter, Change_Parameters_Type, Change_Parameters_Default_Value, - Replace_Type); - -- Enum with the advanced refactorings that clients might support - - type Advanced_Refactorings_Capabilities is - array (Advanced_Refactorings) of Boolean; - -- Array that determines what advanced refactorings clients support - - type Experimental_Client_Capabilities is record - Advanced_Refactorings : Advanced_Refactorings_Capabilities; - end record; - -- Experimental client capabilities that are extensions of the ones defined - -- in the LSP - - function Parse - (Value : LSP.Types.Optional_LSP_Any) - return Experimental_Client_Capabilities; - -- Parses an LSP.Types.Optional_LSP_Any and creates an - -- Experimental_Client_Capabilities object. - - type Scenario_Variable_List is record - Names : VSS.String_Vectors.Virtual_String_Vector; - Values : VSS.String_Vectors.Virtual_String_Vector; - end record; - - No_Scenario_Variable : constant Scenario_Variable_List := - (Names => VSS.String_Vectors.Empty_Virtual_String_Vector, - Values => VSS.String_Vectors.Empty_Virtual_String_Vector); - - type Environment is record - Filename : GPR2.Path_Name.Object := GPR2.Path_Name.Undefined; - Context : GPR2.Context.Object := GPR2.Context.Empty; - Config : GPR2.Project.Configuration.Object := - GPR2.Project.Configuration.Undefined; - Project_Dir : GPR2.Path_Name.Object := GPR2.Path_Name.Undefined; - Build_Path : GPR2.Path_Name.Object := GPR2.Path_Name.Undefined; - Subdirs : Ada.Strings.Unbounded.Unbounded_String; - Src_Subdirs : Ada.Strings.Unbounded.Unbounded_String; - Check_Shared_Lib : Boolean := True; - Absent_Dir_Error : Boolean := False; - Implicit_With : GPR2.Path_Name.Set.Object := - GPR2.Path_Name.Set.Empty_Set; - Pre_Conf_Mode : Boolean := False; - File_Reader : GPR2.File_Readers.File_Reader_Reference := - GPR2.File_Readers.No_File_Reader_Reference; - end record; - - Empty_Environment : constant Environment := (others => <>); - - type On_Type_Formatting_Settings_Type is record - First_Trigger_Character : VSS.Strings.Virtual_String; - More_Trigger_Characters : LSP.Types.Optional_Virtual_String_Vector; - end record; - - type Message_Handler - (Server : access LSP.Servers.Server; - Trace : GNATCOLL.Traces.Trace_Handle) - is limited new LSP.Server_Request_Handlers.Server_Request_Handler - and LSP.Server_Notification_Receivers.Server_Notification_Receiver - and LSP.Server_Backends.Server_Backend - and LSP.Ada_Documents.Document_Provider + (Client : not null access LSP.Client_Message_Receivers + .Client_Message_Receiver'Class) is limited + new LSP.Server_Message_Visitors.Server_Message_Visitor + and LSP.Server_Request_Receivers.Server_Request_Receiver with record - Contexts : LSP.Ada_Context_Sets.Context_Set; - -- There is one context in this list per loaded project. - -- There should always be at least one "project" context - if no .gpr - -- is known to the server, this context should map to the implicit - -- project. - - Client : LSP.Messages.InitializeParams; - -- Client settings got during initialization request - - Root : GNATCOLL.VFS.Virtual_File; - -- The directory passed under rootURI/rootPath during the initialize - -- request. - - Charset : VSS.Strings.Virtual_String; - -- A character set for Libadalang - - Project_File : VSS.Strings.Virtual_String; - -- The project file, if provided by the user on Configuration/Init - - Scenario_Variables : Scenario_Variable_List; - -- Scenario variables, if provided by the user on Configuration/Init - - Diagnostics_Enabled : Boolean := True; - -- Whether to publish diagnostics - - Token_Id : Integer := 0; - -- An ever-increasing number used to generate unique progress tokens - - Indexing_Enabled : Boolean := True; - -- Whether to index sources in the background. This should be True - -- for normal use, and can be disabled for debug or testing purposes. - - Indexing_Token : LSP.Types.LSP_Number_Or_String := Empty_Token; - -- The token of the current indexing progress sequence - - Files_To_Index : File_Sets.Set; - -- Contains any files that need indexing. - -- - -- Indexing of sources is performed in the background as soon as needed - -- (typically after a project load), and pre-indexes the Ada source - -- files, so that subsequent request are fast. - -- The way the "backgrounding" works is the following: - -- - -- * each request which should trigger indexing (for instance - -- project load) adds files to Files_To_Index - -- - -- * the procedure Index_Files takes care of the indexing; it's also - -- looking at the queue after each indexing to see if there - -- are requests pending. If a request is pending, it stops - -- indexing. - -- - -- * whenever the server has finished processing a notification - -- or a requests, it looks at whether Files_To_Index contains - -- files; if it does, it runs Index_Files - - Total_Files_Indexed : Natural := 0; - Total_Files_To_Index : Positive := 1; - -- These two fields are used to produce a progress bar for the indexing - -- operations. Total_Files_To_Index starts at 1 so that the progress - -- bar starts at 0%. - - Options : Options_Holder; - - Open_Documents : Document_Maps.Map; - -- The documents that are currently open - - Get_Symbols : Get_Symbol_Access; - -- textDocument/documentSymbol handler. Actual value depends on - -- client's capabilities. - - Resource_Operations : LSP.Messages.Optional_ResourceOperationKindSet; - -- Client capabilities to support resource operations in - -- `WorkspaceEdit`s. - - Versioned_Documents : Boolean := False; - -- Client capabilities to support versioned document changes in - -- `WorkspaceEdit`s. - - Line_Folding_Only : Boolean := False; - -- Client capabilities, folding only per lines - - Supports_Related_Diagnostics : Boolean := False; - -- Client capabilities to support diagnostics' relatedInformation. - - Completion_Snippets_Enabled : Boolean := False; - -- True if the client supports completion snippets - - Use_Completion_Snippets : Boolean := True; - -- True if we should use snippets for completion (e.g: - -- subprogram calls). - - Completion_Resolve_Properties : VSS.String_Vectors.Virtual_String_Vector; - -- The list of CompletionItem properties that can be resolved - -- lazily (i.e: when the item is selected on client-side) via - -- the completionItem/resolve request. - - Named_Notation_Threshold : Natural := 3; - -- Defines the number of parameters/components at which point named - -- notation is used for subprogram/aggregate completion snippets. - - Display_Method_Ancestry_Policy : - LSP.Messages.AlsDisplayMethodAncestryOnNavigationPolicy := - LSP.Messages.Usage_And_Abstract_Only; - -- Defines the policy regarding the listing of - -- overriding/overridden subprograms for navigation requests - -- such as textDocument/definition, textDocument/declaration - -- and textDocument/implementation. - - Follow_Symlinks : Boolean := True; - -- False if the client disables symlink following. In this case - -- URIs from client should match file names reported by LAL and - -- GNATCOLL.Project. - - Highlighter : LSP.Ada_Highlighters.Ada_Highlighter; - -- Semantic token highlighter for Ada - - On_Type_Formatting_Settings : On_Type_Formatting_Settings_Type := - (First_Trigger_Character => - VSS.Strings.To_Virtual_String - ((1 .. 1 => Ada.Characters.Wide_Wide_Latin_1.LF)), - More_Trigger_Characters => - (Is_Set => False)); - - ---------------------- - -- Project handling -- - ---------------------- - - Project_Tree : GPR2.Project.Tree.Object; - -- The currently loaded project tree - - Project_Environment : Environment; - -- The project environment for the currently loaded project - - Project_Predefined_Sources : LSP.Ada_File_Sets.Indexed_File_Set; - -- A cache for the predefined sources in the loaded project (typically, - -- runtime files). - - Relocate_Build_Tree : VSS.Strings.Virtual_String; - -- Value of `relocateBuildTree`. See `--relocate-build-tree[=dir]` - -- of `gprbuild`. - - Relocate_Root_Dir : VSS.Strings.Virtual_String; - -- Value of `rootDir`. See `--root-dir=dir` of `gprbuild`. - - Project_Status : Load_Project_Status := No_Project_Found; - -- Status of loading the project - - -- Scenario : LSP.Types.LSP_Any; - -- Last used scenario variables - - -- Charset : Ada.Strings.Unbounded.Unbounded_String; - -- Character set from didChangeConfiguration - - Project_Dirs_Loaded : File_Sets.Set; - -- The directories to load in the "implicit project" - - File_Monitor : LSP.File_Monitors.File_Monitor_Access; - -- Filesystem monitoring - - Log_Threshold : Natural := 10; - -- Maximum number of logs (should be > to the number of servers run - -- simultaneously) - - --------------------------------------- - -- Experimental Client Capabilities -- - --------------------------------------- - - Experimental_Client_Capabilities : - LSP.Ada_Handlers.Experimental_Client_Capabilities := - (Advanced_Refactorings => (others => False)); + Implemented : Boolean; + -- A flag to check if a request was handled end record; - overriding procedure Before_Work - (Self : access Message_Handler; - Message : LSP.Messages.Message'Class); - - overriding procedure After_Work - (Self : access Message_Handler; - Message : LSP.Messages.Message'Class); - - overriding function On_Initialize_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Initialize_Request) - return LSP.Messages.Server_Responses.Initialize_Response; - - overriding function On_Shutdown_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Shutdown_Request) - return LSP.Messages.Server_Responses.Shutdown_Response; - - overriding function On_CodeAction_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.CodeAction_Request) - return LSP.Messages.Server_Responses.CodeAction_Response; - - overriding function On_Completion_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Completion_Request) - return LSP.Messages.Server_Responses.Completion_Response; - - overriding function On_CompletionItemResolve_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.CompletionItemResolve_Request) - return LSP.Messages.Server_Responses.CompletionItemResolve_Response; - - overriding function On_Definition_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Definition_Request) - return LSP.Messages.Server_Responses.Location_Link_Response; - - overriding function On_Declaration_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Declaration_Request) - return LSP.Messages.Server_Responses.Location_Link_Response; - - overriding function On_Implementation_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Implementation_Request) - return LSP.Messages.Server_Responses.Location_Link_Response; - - overriding function On_Type_Definition_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Type_Definition_Request) - return LSP.Messages.Server_Responses.Location_Link_Response; - - overriding function On_Highlight_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Highlight_Request) - return LSP.Messages.Server_Responses.Highlight_Response; - - overriding function On_Hover_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Hover_Request) - return LSP.Messages.Server_Responses.Hover_Response; - - overriding function On_References_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.References_Request) - return LSP.Messages.Server_Responses.Location_Response; - - overriding function On_Signature_Help_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Signature_Help_Request) - return LSP.Messages.Server_Responses.SignatureHelp_Response; - - overriding function On_Document_Links_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Document_Links_Request) - return LSP.Messages.Server_Responses.Links_Response; - - overriding function On_Document_Tokens_Full_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Document_Tokens_Full_Request) - return LSP.Messages.Server_Responses.SemanticTokens_Response; - - overriding function On_Document_Tokens_Range_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Document_Tokens_Range_Request) - return LSP.Messages.Server_Responses.SemanticTokens_Response; - - overriding function On_Document_Symbols_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Document_Symbols_Request) - return LSP.Messages.Server_Responses.Symbol_Response; - - overriding function On_Folding_Range_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Folding_Range_Request) - return LSP.Messages.Server_Responses.FoldingRange_Response; - - overriding function On_Prepare_Call_Hierarchy_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Prepare_Call_Hierarchy_Request) - return LSP.Messages.Server_Responses.PrepareCallHierarchy_Response; - - overriding function On_Incoming_Calls_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Incoming_Calls_Request) - return LSP.Messages.Server_Responses.IncomingCalls_Response; - - overriding function On_Outgoing_Calls_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Outgoing_Calls_Request) - return LSP.Messages.Server_Responses.OutgoingCalls_Response; - - overriding function On_Selection_Range_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Selection_Range_Request) - return LSP.Messages.Server_Responses.SelectionRange_Response; - - overriding function On_Rename_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Rename_Request) - return LSP.Messages.Server_Responses.Rename_Response; - - overriding function On_Prepare_Rename_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Prepare_Rename_Request) - return LSP.Messages.Server_Responses.Prepare_Rename_Response; - - overriding function On_Execute_Command_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Execute_Command_Request) - return LSP.Messages.Server_Responses.ExecuteCommand_Response; - - overriding function On_Workspace_Symbols_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Workspace_Symbols_Request) - return LSP.Messages.Server_Responses.Symbol_Response; - - overriding function On_Workspace_Execute_Command_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Workspace_Execute_Command_Request) - return LSP.Messages.Server_Responses.ExecuteCommand_Response; - - overriding function On_Workspace_Will_Create_Files_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests. - Workspace_Will_Create_Files_Request) - return LSP.Messages.Server_Responses.WillCreateFiles_Response; - - overriding procedure On_DidCreateFiles_Notification - (Self : access Message_Handler; - Value : LSP.Messages.CreateFilesParams); - - overriding function On_Workspace_Will_Rename_Files_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests. - Workspace_Will_Rename_Files_Request) - return LSP.Messages.Server_Responses.WillRenameFiles_Response; - - overriding procedure On_DidRenameFiles_Notification - (Self : access Message_Handler; - Value : LSP.Messages.RenameFilesParams); - - overriding function On_Workspace_Will_Delete_Files_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests. - Workspace_Will_Delete_Files_Request) - return LSP.Messages.Server_Responses.WillDeleteFiles_Response; - - overriding procedure On_DidDeleteFiles_Notification - (Self : access Message_Handler; - Value : LSP.Messages.DeleteFilesParams); - - overriding function On_Color_Presentation_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Color_Presentation_Request) - return LSP.Messages.Server_Responses.ColorPresentation_Response; - - overriding function On_Document_Color_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Document_Color_Request) - return LSP.Messages.Server_Responses.DocumentColor_Response; - - overriding function On_ALS_Show_Dependencies_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.ALS_Show_Dependencies_Request) - return LSP.Messages.Server_Responses.ALS_ShowDependencies_Response; - - overriding function On_ALS_Source_Dirs_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.ALS_Source_Dirs_Request) - return LSP.Messages.Server_Responses.ALS_SourceDirs_Response; - - overriding function On_ALS_Debug_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.ALS_Debug_Request) - return LSP.Messages.Server_Responses.ALS_Debug_Response; - - overriding function On_Formatting_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Formatting_Request) - return LSP.Messages.Server_Responses.Formatting_Response; - - overriding function On_Range_Formatting_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Range_Formatting_Request) - return LSP.Messages.Server_Responses.Range_Formatting_Response; - - overriding function On_On_Type_Formatting_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.On_Type_Formatting_Request) - return LSP.Messages.Server_Responses.On_Type_Formatting_Response; - - overriding procedure On_Initialized_Notification - (Self : access Message_Handler) is null; - - overriding procedure On_Exit_Notification - (Self : access Message_Handler); - - overriding procedure On_DidChangeTextDocument_Notification - (Self : access Message_Handler; - Value : LSP.Messages.DidChangeTextDocumentParams); - - overriding procedure On_DidCloseTextDocument_Notification - (Self : access Message_Handler; - Value : LSP.Messages.DidCloseTextDocumentParams); - - overriding procedure On_DidOpenTextDocument_Notification - (Self : access Message_Handler; - Value : LSP.Messages.DidOpenTextDocumentParams); - - overriding procedure On_DidSaveTextDocument_Notification - (Self : access Message_Handler; - Value : LSP.Messages.DidSaveTextDocumentParams) is null; - - overriding procedure On_DidChangeConfiguration_Notification - (Self : access Message_Handler; - Value : LSP.Messages.DidChangeConfigurationParams); - - overriding procedure On_DidChangeWorkspaceFolders_Notification - (Self : access Message_Handler; - Value : LSP.Messages.DidChangeWorkspaceFoldersParams) is null; - - overriding procedure On_DidChangeWatchedFiles_Notification - (Self : access Message_Handler; - Value : LSP.Messages.DidChangeWatchedFilesParams); - - overriding procedure On_Cancel_Notification - (Self : access Message_Handler; - Value : LSP.Messages.CancelParams) is null; - -- This is intentionally null procedure, because cancel is implemented by - -- LSP server itself. - - overriding procedure On_SetTrace_Notification - (Self : access Message_Handler; - Value : LSP.Messages.SetTraceParams) is null; - -- This is intentionally set to null since VS Code already handle traces - -- by itself correctly, outputting the LSP requests being sent - -- and the returned results with more or less verbosity depending on the - -- settings. - - overriding function Get_Open_Document - (Self : access Message_Handler; - URI : LSP.Messages.DocumentUri; - Force : Boolean := False) - return LSP.Ada_Documents.Document_Access; - -- Return the open document for the given URI. - -- If the document is not opened, then if Force a new document - -- will be created and must be freed by the user else null will be - -- returned. - - overriding function Get_Open_Document_Version - (Self : access Message_Handler; - URI : LSP.Messages.DocumentUri) - return LSP.Messages.OptionalVersionedTextDocumentIdentifier; - -- Return the version of an open document for the given URI. - -- If the document is not opened, then it returns a - -- VersionedTextDocumentIdentifier with a null version. - - overriding function On_ALS_Check_Syntax_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.ALS_Check_Syntax_Request) - return LSP.Messages.Server_Responses.ALS_Check_Syntax_Response; - - overriding function On_GLS_Mains_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.GLS_Mains_Request) - return LSP.Messages.Server_Responses.GLS_Mains_Response; - - overriding function On_GLS_Executables_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.GLS_Executables_Request) - return LSP.Messages.Server_Responses.GLS_Executables_Response; - - overriding function On_GLS_Object_Dir_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.GLS_Object_Dir_Request) - return LSP.Messages.Server_Responses.GLS_Object_Dir_Response; - - overriding function On_GLS_Project_File_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.GLS_Project_File_Request) - return LSP.Messages.Server_Responses.GLS_Project_File_Response; - - procedure Reload_Project (Self : access Message_Handler); - -- Reload current project + overriding procedure On_Server_Request + (Self : in out Message_Handler; + Value : LSP.Server_Requests.Server_Request'Class); procedure Publish_Diagnostics (Self : access Message_Handler'Class; diff --git a/source/lsp_3.17/lsp-client_message_writers.adb b/source/lsp_3.17/lsp-client_message_writers.adb new file mode 100644 index 000000000..797808367 --- /dev/null +++ b/source/lsp_3.17/lsp-client_message_writers.adb @@ -0,0 +1,42 @@ +-- +-- Copyright (C) 2022-2023, AdaCore +-- +-- SPDX-License-Identifier: Apache-2.0 +-- + +package body LSP.Client_Message_Writers is + + ---------------------------- + -- On_Client_Notification -- + ---------------------------- + + overriding procedure On_Client_Notification + (Self : in out Client_Message_Writer; + Message : LSP.Client_Notifications.Client_Notification'Class) is + begin + Message.Visit_Client_Receiver (Self.Notification_Writer); + end On_Client_Notification; + + ----------------------- + -- On_Client_Request -- + ----------------------- + + overriding procedure On_Client_Request + (Self : in out Client_Message_Writer; + Message : LSP.Client_Requests.Client_Request'Class) is + begin + Message.Visit_Client_Receiver (Self.Request_Writer); + end On_Client_Request; + + ------------------------ + -- On_Client_Response -- + ------------------------ + + overriding procedure On_Client_Response + (Self : in out Client_Message_Writer; + Message : LSP.Client_Responses.Client_Response'Class) is + begin + Message.Visit_Client_Receiver (Self.Response_Writer); + end On_Client_Response; + +end LSP.Client_Message_Writers; diff --git a/source/lsp_3.17/lsp-client_message_writers.ads b/source/lsp_3.17/lsp-client_message_writers.ads new file mode 100644 index 000000000..b6de63069 --- /dev/null +++ b/source/lsp_3.17/lsp-client_message_writers.ads @@ -0,0 +1,46 @@ +-- +-- Copyright (C) 2022-2023, AdaCore +-- +-- SPDX-License-Identifier: Apache-2.0 +-- + +with VSS.JSON.Content_Handlers; + +with LSP.Client_Message_Visitors; +with LSP.Client_Notification_Writers; +with LSP.Client_Notifications; +with LSP.Client_Request_Writers; +with LSP.Client_Requests; +with LSP.Client_Response_Writers; +with LSP.Client_Responses; + +package LSP.Client_Message_Writers is + pragma Preelaborate; + + type Client_Message_Writer + (Output : access VSS.JSON.Content_Handlers.JSON_Content_Handler'Class) is + limited new LSP.Client_Message_Visitors.Client_Message_Visitor + with record + Notification_Writer : LSP.Client_Notification_Writers + .Client_Notification_Writer (Output); + + Request_Writer : LSP.Client_Request_Writers + .Client_Request_Writer (Output); + + Response_Writer : LSP.Client_Response_Writers + .Client_Response_Writer (Output); + end record; + + overriding procedure On_Client_Notification + (Self : in out Client_Message_Writer; + Message : LSP.Client_Notifications.Client_Notification'Class); + + overriding procedure On_Client_Request + (Self : in out Client_Message_Writer; + Message : LSP.Client_Requests.Client_Request'Class); + + overriding procedure On_Client_Response + (Self : in out Client_Message_Writer; + Message : LSP.Client_Responses.Client_Response'Class); + +end LSP.Client_Message_Writers; diff --git a/source/server/lsp-servers.adb b/source/server/lsp-servers.adb index 23dcee3e2..ba1bcbfa5 100644 --- a/source/server/lsp-servers.adb +++ b/source/server/lsp-servers.adb @@ -16,85 +16,51 @@ ------------------------------------------------------------------------------ with Ada.Characters.Latin_1; -with Ada.Exceptions; use Ada.Exceptions; +with Ada.Exceptions; with Ada.IO_Exceptions; -with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; -with Ada.Tags; with Ada.Task_Identification; with Ada.Unchecked_Deallocation; -with GNAT.Traceback.Symbolic; use GNAT.Traceback.Symbolic; - -with LSP.Errors; -with LSP.JSON_Streams; -with LSP.Messages.Client_Notifications; -with LSP.Servers.Decode_Notification; -with LSP.Servers.Decode_Request; -with LSP.Servers.Handle_Request; - -with GNATCOLL.Traces; use GNATCOLL.Traces; with VSS.JSON.Pull_Readers.Simple; +with VSS.JSON.Push_Writers; with VSS.JSON.Streams; with VSS.Stream_Element_Vectors.Conversions; -with VSS.Strings.Conversions; +with VSS.Strings; with VSS.Text_Streams.Memory_UTF8_Input; with VSS.Text_Streams.Memory_UTF8_Output; +with LSP.Client_Message_Writers; +with LSP.Enumerations; +with LSP.Errors; +with LSP.Server_Notification_Readers; +with LSP.Server_Request_Readers; +with LSP.Structures; + package body LSP.Servers is New_Line : constant String := (Ada.Characters.Latin_1.CR, Ada.Characters.Latin_1.LF); - Line_Feed : constant Character := Ada.Characters.Latin_1.LF; - procedure Process_One_Message (Self : in out Server'Class; - Initialized : in out Boolean; EOF : in out Boolean); -- Read data from stdin and create a message if there is enough data. -- Then put the message into Self.Input_Queue. - -- Handle initialization logic by tracking 'initialize' request, set - -- Initialized parameter when the request arrives. + -- Handle initialization logic by tracking 'initialize' request using + -- Checker. -- Set EOF at end of stream or an "exit" notification. procedure Append - (Vector : in out Ada.Strings.Unbounded.Unbounded_String; + (Vector : in out VSS.Stream_Element_Vectors.Stream_Element_Vector; Buffer : Ada.Streams.Stream_Element_Array); - function To_Stream_Element_Array - (Vector : Ada.Strings.Unbounded.Unbounded_String) - return Ada.Streams.Stream_Element_Array; - - type Response_Access is access all LSP.Messages.ResponseMessage'Class; - - procedure Send_Response - (Self : in out Server'Class; - Response : in out Response_Access; - Request_Id : LSP.Types.LSP_Number_Or_String); - -- Complete Response and send it to the output queue. Response will be - -- deleted by Output_Task - - procedure Send_Notification - (Self : in out Server'Class; - Value : in out Message_Access); - -- Send given notification to client. The Notification will be deleted by - -- Output_Task - - type Client_Request_Access is - access all LSP.Messages.Client_Requests.Client_Request'Class; - - procedure Send_Request - (Self : in out Server'Class; - Method : VSS.Strings.Virtual_String; - Value : LSP.Messages.Client_Requests.Client_Request'Class); - -- Assign Method to the request and send it to the client. - procedure Send_Exception_Response (Self : in out Server'Class; - E : Exception_Occurrence; + E : Ada.Exceptions.Exception_Occurrence; Trace_Text : String; - Request_Id : LSP.Types.LSP_Number_Or_String; - Code : LSP.Messages.ErrorCodes := LSP.Errors.InternalError); + Request_Id : LSP.Structures.Integer_Or_Virtual_String; + Code : LSP.Enumerations.ErrorCodes := + LSP.Enumerations.InternalError) is null; -- Send a response to the stream representing the exception. This -- should be called whenever an exception occurred while processing -- a request. @@ -102,58 +68,37 @@ package body LSP.Servers is -- Request_Id is the id of the request we were trying to process. -- Use given Code in the response. - procedure Send_Not_Initialized - (Self : in out Server'Class; - Request_Id : LSP.Types.LSP_Number_Or_String); - -- Send "not initialized" response - - procedure Send_Canceled_Request - (Self : in out Server'Class; - Request_Id : LSP.Types.LSP_Number_Or_String); - -- Send RequestCancelled response - procedure Free is new Ada.Unchecked_Deallocation - (Object => LSP.Messages.Message'Class, - Name => Message_Access); - - type Null_Server_Backend is limited new LSP.Server_Backends.Server_Backend - with null record; - -- Server_Backend stub - - overriding procedure Before_Work - (Self : access Null_Server_Backend; - Message : LSP.Messages.Message'Class) is null; + (Object => LSP.Server_Messages.Server_Message'Class, + Name => Server_Message_Access); - overriding procedure After_Work - (Self : access Null_Server_Backend; - Message : LSP.Messages.Message'Class) is null; + procedure Free is new Ada.Unchecked_Deallocation + (Object => LSP.Client_Messages.Client_Message'Class, + Name => Client_Message_Access); - Null_Server : aliased Null_Server_Backend; + function To_String + (Vector : VSS.Stream_Element_Vectors.Stream_Element_Vector'Class) + return String + renames VSS.Stream_Element_Vectors.Conversions.Unchecked_To_String; + -- Cast Stream_Element_Vector to a string ------------ -- Append -- ------------ procedure Append - (Vector : in out Ada.Strings.Unbounded.Unbounded_String; - Buffer : Ada.Streams.Stream_Element_Array) is + (Vector : in out VSS.Stream_Element_Vectors.Stream_Element_Vector; + Buffer : Ada.Streams.Stream_Element_Array) + is + use type Ada.Streams.Stream_Element_Count; begin - for X of Buffer loop - Ada.Strings.Unbounded.Append (Vector, Character'Val (X)); + Vector.Set_Capacity (Vector.Length + Buffer'Length); + + for Byte of Buffer loop + Vector.Append (Byte); end loop; end Append; - ---------------- - -- Initialize -- - ---------------- - - procedure Initialize - (Self : in out Server; - Stream : access Ada.Streams.Root_Stream_Type'Class) is - begin - Self.Stream := Stream; - end Initialize; - -------------- -- Finalize -- -------------- @@ -184,22 +129,16 @@ package body LSP.Servers is end select; end Finalize; - ----------------- - -- Log_Message -- - ----------------- + ---------------- + -- Initialize -- + ---------------- - overriding procedure On_Log_Message - (Self : access Server; - Params : LSP.Messages.LogMessageParams) - is - Message : Message_Access := - new LSP.Messages.Client_Notifications.LogMessage_Notification' - (method => "window/logMessage", - params => Params, - jsonrpc => <>); + procedure Initialize + (Self : in out Server; + Stream : access Ada.Streams.Root_Stream_Type'Class) is begin - Self.Send_Notification (Message); - end On_Log_Message; + Self.Stream := Stream; + end Initialize; ------------------------- -- Process_One_Message -- @@ -207,14 +146,13 @@ package body LSP.Servers is procedure Process_One_Message (Self : in out Server'Class; - Initialized : in out Boolean; EOF : in out Boolean) is use type Ada.Streams.Stream_Element_Count; procedure Parse_Header (Length : out Ada.Streams.Stream_Element_Count; - Vector : in out Ada.Strings.Unbounded.Unbounded_String); + Vector : in out VSS.Stream_Element_Vectors.Stream_Element_Vector); -- Read lines from Vector and after it from Self.Stream until empty -- lines is found. For each non-empty line call Parse_Line. -- Return any unprocessed bytes in Vector. @@ -224,14 +162,16 @@ package body LSP.Servers is Length : in out Ada.Streams.Stream_Element_Count); -- If given Line is "Content-Length:" header then read Length from it. - procedure Parse_JSON (Vector : Ada.Strings.Unbounded.Unbounded_String); + procedure Parse_JSON + (Vector : VSS.Stream_Element_Vectors.Stream_Element_Vector); -- Process Vector as complete JSON document. procedure Process_JSON_Document - (Vector : Ada.Strings.Unbounded.Unbounded_String); + (Vector : VSS.Stream_Element_Vectors.Stream_Element_Vector); -- Process one JSON message. Vector is corresponding text for traces. Buffer_Size : constant := 512; + Empty_Vector : VSS.Stream_Element_Vectors.Stream_Element_Vector; ------------------ -- Parse_Header -- @@ -239,21 +179,22 @@ package body LSP.Servers is procedure Parse_Header (Length : out Ada.Streams.Stream_Element_Count; - Vector : in out Ada.Strings.Unbounded.Unbounded_String) + Vector : in out VSS.Stream_Element_Vectors.Stream_Element_Vector) is Buffer : Ada.Streams.Stream_Element_Array (1 .. Buffer_Size); - Last : Ada.Streams.Stream_Element_Count := - Ada.Streams.Stream_Element_Count - (Ada.Strings.Unbounded.Length (Vector)); + Last : Ada.Streams.Stream_Element_Count := Vector.Length; Line : String (1 .. 80) := (others => ' '); Char : Character; Index : Natural := 0; Empty : Boolean := False; -- We've just seen CR, LF begin - if Last > 0 then - -- Copy unprocessed bytes to Buffer - Buffer (1 .. Last) := To_Stream_Element_Array (Vector); - Vector := Ada.Strings.Unbounded.Null_Unbounded_String; + -- Copy unprocessed bytes to Buffer + for J in 1 .. Vector.Length loop + Buffer (J) := Vector (J); + end loop; + + if not Vector.Is_Empty then + Vector := Empty_Vector; end if; Length := 0; @@ -283,7 +224,12 @@ package body LSP.Servers is if Index > 1 and then Line (Index - 1 .. Index) = New_Line then if Empty then -- Put any unprocessed bytes back into Vector and exit - Append (Vector, Buffer (J + 1 .. Last)); + Vector.Set_Capacity (Last - J); + + for Byte of Buffer (J + 1 .. Last) loop + Vector.Append (Byte); + end loop; + return; end if; @@ -302,7 +248,7 @@ package body LSP.Servers is --------------------------- procedure Process_JSON_Document - (Vector : Ada.Strings.Unbounded.Unbounded_String) + (Vector : VSS.Stream_Element_Vectors.Stream_Element_Vector) is use type VSS.Strings.Virtual_String; @@ -310,70 +256,67 @@ package body LSP.Servers is VSS.Text_Streams.Memory_UTF8_Input.Memory_UTF8_Input_Stream; procedure Decode_JSON_RPC_Headers - (Request_Id : out LSP.Types.LSP_Number_Or_String; + (Request_Id : out LSP.Structures.Integer_Or_Virtual_String; Version : out VSS.Strings.Virtual_String; - Method : out LSP.Types.Optional_Virtual_String; - Error : out LSP.Messages.Optional_ResponseError); + Method : out VSS.Strings.Virtual_String; + Error : out LSP.Errors.ResponseError_Optional); procedure Decode_JSON_RPC_Headers - (Request_Id : out LSP.Types.LSP_Number_Or_String; + (Request_Id : out LSP.Structures.Integer_Or_Virtual_String; Version : out VSS.Strings.Virtual_String; - Method : out LSP.Types.Optional_Virtual_String; - Error : out LSP.Messages.Optional_ResponseError) + Method : out VSS.Strings.Virtual_String; + Error : out LSP.Errors.ResponseError_Optional) is use all type VSS.JSON.Streams.JSON_Stream_Element_Kind; R : aliased VSS.JSON.Pull_Readers.Simple.JSON_Simple_Pull_Reader; - JS : aliased LSP.JSON_Streams.JSON_Stream - (True, R'Unchecked_Access); begin R.Set_Stream (Memory'Unchecked_Access); - JS.R.Read_Next; - pragma Assert (JS.R.Is_Start_Document); - JS.R.Read_Next; - pragma Assert (JS.R.Is_Start_Object); - JS.R.Read_Next; - while not JS.R.Is_End_Object loop - pragma Assert (JS.R.Is_Key_Name); + R.Read_Next; + pragma Assert (R.Is_Start_Document); + R.Read_Next; + pragma Assert (R.Is_Start_Object); + R.Read_Next; + while not R.Is_End_Object loop + pragma Assert (R.Is_Key_Name); declare - Key : constant String := - VSS.Strings.Conversions.To_UTF_8_String (JS.R.Key_Name); + Key : constant VSS.Strings.Virtual_String := R.Key_Name; begin - JS.R.Read_Next; + R.Read_Next; if Key = "id" then - case JS.R.Element_Kind is + case R.Element_Kind is when String_Value => Request_Id := - (Is_Number => False, - String => JS.R.String_Value); + (Is_Integer => False, + Virtual_String => R.String_Value); when Number_Value => Request_Id := - (Is_Number => True, - Number => LSP.Types.LSP_Number - (JS.R.Number_Value.Integer_Value)); + (Is_Integer => True, + Integer => Integer + (R.Number_Value.Integer_Value)); when others => raise Constraint_Error; end case; - JS.R.Read_Next; + R.Read_Next; elsif Key = "jsonrpc" then - pragma Assert (JS.R.Is_String_Value); - Version := JS.R.String_Value; - JS.R.Read_Next; + pragma Assert (R.Is_String_Value); + Version := R.String_Value; + R.Read_Next; elsif Key = "method" then - pragma Assert (JS.R.Is_String_Value); - Method := (Is_Set => True, - Value => JS.R.String_Value); - JS.R.Read_Next; + pragma Assert (R.Is_String_Value); + Method := R.String_Value; + R.Read_Next; elsif Key = "error" then - LSP.Messages.Optional_ResponseError'Read - (JS'Access, Error); + -- TODO: Optional_ResponseError'Read (Error); + Error := (Is_Set => True, Value => <>); + else - JS.Skip_Value; + R.Skip_Current_Value; end if; end; end loop; @@ -381,58 +324,55 @@ package body LSP.Servers is Memory.Rewind; end Decode_JSON_RPC_Headers; - Message : Message_Access; + function Assigned + (Id : LSP.Structures.Integer_Or_Virtual_String) return Boolean is + (Id.Is_Integer or else not Id.Virtual_String.Is_Null); + + Message : Server_Message_Access; Request : Request_Access; Notification : Notification_Access; - Is_Exit_Notification : Boolean; + Ok : constant Boolean := True; + Is_Exit_Notification : constant Boolean := False; Version : VSS.Strings.Virtual_String; - Method : LSP.Types.Optional_Virtual_String; - Request_Id : LSP.Types.LSP_Number_Or_String; - Error : LSP.Messages.Optional_ResponseError; + Method : VSS.Strings.Virtual_String; + Request_Id : LSP.Structures.Integer_Or_Virtual_String := + (False, VSS.Strings.Empty_Virtual_String); + Error : LSP.Errors.ResponseError_Optional; begin - Memory.Set_Data - (VSS.Stream_Element_Vectors.Conversions - .Unchecked_From_Unbounded_String - (Vector)); + Memory.Set_Data (Vector); -- Read request id and method if any Decode_JSON_RPC_Headers (Request_Id, Version, Method, Error); -- Decide if this is a request, response or notification - if not Method.Is_Set then + if Method.Is_Null then -- TODO: Process client responses here. if Error.Is_Set then - -- We have got error from LSP client. Save it in the trace: - Self.Server_Trace.Trace ("Got Error response:"); - - Self.Server_Trace.Trace - (VSS.Strings.Conversions.To_UTF_8_String - (Error.Value.message)); + null; end if; return; - elsif LSP.Types.Assigned (Request_Id) then -- This is a request + elsif Assigned (Request_Id) then -- This is a request - if not Initialized then - if Method.Value = "initialize" then - Initialized := True; - else - Send_Not_Initialized (Self, Request_Id); - return; - end if; - end if; + declare + R : VSS.JSON.Pull_Readers.Simple.JSON_Simple_Pull_Reader; begin + R.Set_Stream (Memory'Unchecked_Access); + R.Read_Next; + pragma Assert (R.Is_Start_Document); + R.Read_Next; + Request := - new LSP.Messages.Server_Requests.Server_Request'Class' - (LSP.Servers.Decode_Request - (Memory'Unchecked_Access, Method.Value)); + new LSP.Server_Requests.Server_Request'Class' + (LSP.Server_Request_Readers.Read_Request + (R, Method)); exception when UR : Unknown_Method => @@ -440,7 +380,7 @@ package body LSP.Servers is (Self, UR, To_String (Vector), Request_Id, - LSP.Errors.MethodNotFound); + LSP.Enumerations.MethodNotFound); return; when E : others => @@ -450,64 +390,45 @@ package body LSP.Servers is (Self, E, To_String (Vector), Request_Id, - LSP.Errors.InvalidParams); + LSP.Enumerations.InvalidParams); return; end; - Self.Request_Map.Include (Request_Id, Request); - - Message := Message_Access (Request); + Message := Server_Message_Access (Request); - elsif Initialized - or else Method.Value = "exit" - then + else -- This is a notification + declare + R : VSS.JSON.Pull_Readers.Simple.JSON_Simple_Pull_Reader; + begin - Notification := - new Messages.Server_Notifications.Server_Notification'Class' - (LSP.Servers.Decode_Notification - (Memory'Unchecked_Access, Method.Value)); + R.Set_Stream (Memory'Unchecked_Access); + R.Read_Next; + pragma Assert (R.Is_Start_Document); + R.Read_Next; - exception - when E : Unknown_Method => - Self.Server_Trace.Trace - ("Unable to decode notification: " - & Symbolic_Traceback (E)); - return; + Notification := + new LSP.Server_Notifications.Server_Notification'Class' + (LSP.Server_Notification_Readers.Read_Notification + (R, Method)); end; - -- Process '$/cancelRequest' notification - if Notification.all in - LSP.Messages.Server_Notifications.Cancel_Notification - then - Request_Id := - LSP.Messages.Server_Notifications.Cancel_Notification - (Notification.all).params.id; - - if Self.Request_Map.Contains (Request_Id) then - Self.Request_Map (Request_Id).Canceled := True; - end if; - end if; - - Message := Message_Access (Notification); - else - -- Ignore any notification (except 'exit') until initialization - return; - + Message := Server_Message_Access (Notification); end if; - Self.Logger.Visit (Message.all); - + -- TODO: Set Is_Exit_Notification; + -- Check initialization status and send a response if this is a + -- request before initialization. + -- -- Check whether this was an exit notification. Note: this must be -- done *before* the call to Enqueue, since we're not guaranteed -- that the memory for Message is still allocated after this call. - Is_Exit_Notification := Message.all in - LSP.Messages.Server_Notifications.Exit_Notification; - - -- Now we have a message to process. Push it to the processing - -- task - Self.Input_Queue.Enqueue (Message); + if Ok then + -- Now we have a message to process. Push it to the processing + -- task + Self.Input_Queue.Enqueue (Message); + end if; if Is_Exit_Notification then -- After "exit" notification don't read any further input. @@ -519,24 +440,10 @@ package body LSP.Servers is -- Parse_JSON -- ---------------- - procedure Parse_JSON (Vector : Ada.Strings.Unbounded.Unbounded_String) is + procedure Parse_JSON + (Vector : VSS.Stream_Element_Vectors.Stream_Element_Vector) is begin - if Self.In_Trace.Is_Active then - -- Avoid expensive convertion to string when trace is off - Self.In_Trace.Trace (To_String (Vector)); - end if; - Process_JSON_Document (Vector); - - exception - when E : others => - -- If we reach this exception handler, this means we are unable - -- to parse text as JSON. - - Self.Server_Trace.Trace - ("Unable to parse JSON message:" & To_String (Vector)); - Self.Server_Trace.Trace (Symbolic_Traceback (E)); - end Parse_JSON; ---------------- @@ -557,7 +464,7 @@ package body LSP.Servers is end if; end Parse_Line; - Vector : Ada.Strings.Unbounded.Unbounded_String := Self.Vector; + Vector : VSS.Stream_Element_Vectors.Stream_Element_Vector := Self.Vector; Length : Ada.Streams.Stream_Element_Count := 0; -- Message length Buffer : Ada.Streams.Stream_Element_Array (1 .. Buffer_Size); Last : Ada.Streams.Stream_Element_Count; -- Index the Buffer @@ -565,10 +472,12 @@ package body LSP.Servers is Parse_Header (Length, Vector); -- Find Length out of headers -- Populate Buffer with Vector content - Last := Ada.Streams.Stream_Element_Count - (Ada.Strings.Unbounded.Length (Vector)); - Buffer (1 .. Last) := To_Stream_Element_Array (Vector); - Vector := Ada.Strings.Unbounded.Null_Unbounded_String; + Last := Vector.Length; + for J in 1 .. Vector.Length loop + Buffer (J) := Vector (J); + end loop; + + Vector := Empty_Vector; loop if Last <= Length then @@ -587,7 +496,7 @@ package body LSP.Servers is if Length = 0 then -- Complete message is ready in the Vector -- Copy extra data if any into Vector and exit - Self.Vector := Ada.Strings.Unbounded.Null_Unbounded_String; + Self.Vector := Empty_Vector; Append (Self.Vector, Buffer (1 .. Last)); Parse_JSON (Vector); Vector := Self.Vector; @@ -596,203 +505,20 @@ package body LSP.Servers is Self.Stream.Read (Buffer, Last); end if; end loop; - exception when Ada.IO_Exceptions.End_Error => EOF := True; - - when E : others => - -- Catch-all case: make sure no exception in output writing - -- can cause an exit of the task loop. - Self.Server_Trace.Trace - ("Exception when reading input:" & Line_Feed - & Exception_Name (E) & " - " & Exception_Message (E)); - Self.Server_Trace.Trace (Symbolic_Traceback (E)); end Process_One_Message; - ------------------------- - -- Publish_Diagnostics -- - ------------------------- - - overriding procedure On_Publish_Diagnostics - (Self : access Server; - Params : LSP.Messages.PublishDiagnosticsParams) - is - Message : Message_Access := - new LSP.Messages.Client_Notifications.PublishDiagnostics_Notification' - (jsonrpc => <>, - method => "textDocument/publishDiagnostics", - params => Params); - begin - Self.Send_Notification (Message); - end On_Publish_Diagnostics; - - ----------------------- - -- Get_Progress_Type -- - ----------------------- - - overriding function Get_Progress_Type - (Self : access Server; - Token : LSP.Types.LSP_Number_Or_String) - return LSP.Client_Notification_Receivers.Progress_Value_Kind - is - pragma Unreferenced (Self, Token); - begin - return LSP.Client_Notification_Receivers.ProgressParams; - end Get_Progress_Type; - - ----------------- - -- On_Progress -- - ----------------- - - overriding procedure On_Progress - (Self : access Server; - Params : LSP.Messages.Progress_Params) - is - Message : Message_Access := - new LSP.Messages.Client_Notifications.Progress_Notification' - (jsonrpc => <>, - method => "$/progress", - params => Params); - begin - Self.Send_Notification (Message); - end On_Progress; - - ------------------------------------------ - -- On_Progress_SymbolInformation_Vector -- - ------------------------------------------ - - overriding procedure On_Progress_SymbolInformation_Vector - (Self : access Server; - Params : LSP.Messages.Progress_SymbolInformation_Vector) - is - Message : Message_Access := - new LSP.Messages.Client_Notifications. - SymbolInformation_Vectors_Notification' - (jsonrpc => <>, - method => "$/progress", - params => Params); - begin - Self.Send_Notification (Message); - end On_Progress_SymbolInformation_Vector; - - ---------------------------- - -- On_ShowMessage_Request -- - ---------------------------- - - overriding procedure On_ShowMessage_Request - (Self : access Server; - Message : LSP.Messages.Client_Requests.ShowMessage_Request) is - begin - Self.Send_Request ("window/showMessageRequest", Message); - end On_ShowMessage_Request; - - ----------------------------- - -- On_ShowDocument_Request -- - ----------------------------- - - overriding procedure On_ShowDocument_Request - (Self : access Server; - Message : LSP.Messages.Client_Requests.ShowDocument_Request) is - begin - Self.Send_Request ("window/showDocument", Message); - end On_ShowDocument_Request; - - ------------------------------------- - -- On_Workspace_Apply_Edit_Request -- - ------------------------------------- - - overriding procedure On_Workspace_Apply_Edit_Request - (Self : access Server; - Message : LSP.Messages.Client_Requests.Workspace_Apply_Edit_Request) is - begin - Self.Send_Request ("workspace/applyEdit", Message); - end On_Workspace_Apply_Edit_Request; - - ---------------------------------------- - -- On_Workspace_Configuration_Request -- - ---------------------------------------- - - overriding procedure On_Workspace_Configuration_Request - (Self : access Server; - Message : LSP.Messages.Client_Requests.Workspace_Configuration_Request) - is - begin - Self.Send_Request ("workspace/configuration", Message); - end On_Workspace_Configuration_Request; - - ---------------------------------- - -- On_Workspace_Folders_Request -- - ---------------------------------- - - overriding procedure On_Workspace_Folders_Request - (Self : access Server; - Message : LSP.Messages.Client_Requests.Workspace_Folders_Request) - is - begin - Self.Send_Request ("workspace/workspaceFolders", Message); - end On_Workspace_Folders_Request; - - ----------------------------------- - -- On_RegisterCapability_Request -- - ----------------------------------- - - overriding procedure On_RegisterCapability_Request - (Self : access Server; - Message : LSP.Messages.Client_Requests.RegisterCapability_Request) - is - begin - Self.Send_Request ("client/registerCapability", Message); - end On_RegisterCapability_Request; - - ------------------------------------- - -- On_UnregisterCapability_Request -- - ------------------------------------- - - overriding procedure On_UnregisterCapability_Request - (Self : access Server; - Message : LSP.Messages.Client_Requests.UnregisterCapability_Request) - is - begin - Self.Send_Request ("client/unregisterCapability", Message); - end On_UnregisterCapability_Request; - - ---------------------------------------- - -- On_WorkDoneProgress_Create_Request -- - ---------------------------------------- - - overriding procedure On_WorkDoneProgress_Create_Request - (Self : access Server; - Message : LSP.Messages.Client_Requests.WorkDoneProgressCreate_Request) is - begin - Self.Send_Request ("window/workDoneProgress/create", Message); - end On_WorkDoneProgress_Create_Request; - --------- -- Run -- --------- procedure Run (Self : in out Server; - Request : not null - LSP.Server_Request_Handlers.Server_Request_Handler_Access; - Notification : not null - LSP.Server_Notification_Receivers.Server_Notification_Receiver_Access; - Server : LSP.Server_Backends.Server_Backend_Access; - On_Error : not null Uncaught_Exception_Handler; - Server_Trace : GNATCOLL.Traces.Trace_Handle; - In_Trace : GNATCOLL.Traces.Trace_Handle; - Out_Trace : GNATCOLL.Traces.Trace_Handle) - is + Handler : not null Server_Message_Visitor_Access) is begin - Self.Server_Trace := Server_Trace; - Self.In_Trace := In_Trace; - Self.Out_Trace := Out_Trace; - Self.On_Error := On_Error; - - Self.Logger.Initialize (Server_Trace); - - Self.Processing_Task.Start (Request, Notification, Server); + Self.Processing_Task.Start (Handler); Self.Output_Task.Start; Self.Input_Task.Start; @@ -800,148 +526,17 @@ package body LSP.Servers is Self.Stop.Seize; end Run; - ----------------------------- - -- Send_Exception_Response -- - ----------------------------- - - procedure Send_Exception_Response - (Self : in out Server'Class; - E : Exception_Occurrence; - Trace_Text : String; - Request_Id : LSP.Types.LSP_Number_Or_String; - Code : LSP.Messages.ErrorCodes := LSP.Errors.InternalError) - is - Exception_Text : constant String := - Exception_Name (E) & Line_Feed & Symbolic_Traceback (E); - Response : Response_Access := - new LSP.Messages.ResponseMessage' - (Is_Error => True, - jsonrpc => <>, -- we will set this latter - id => <>, -- we will set this latter - error => - (Is_Set => True, - Value => - (code => Code, - data => LSP.Types.Empty, - message => - VSS.Strings.Conversions.To_Virtual_String - (Exception_Text)))); - - begin - -- Send the response to the output stream - Send_Response (Self, Response, Request_Id); - - -- Log details in the traces - Self.Server_Trace.Trace - ("Exception when processing request:" & Line_Feed - & Trace_Text & Line_Feed - & Exception_Text); - end Send_Exception_Response; - - -------------------------- - -- Send_Not_Initialized -- - -------------------------- - - procedure Send_Not_Initialized - (Self : in out Server'Class; - Request_Id : LSP.Types.LSP_Number_Or_String) - is - Response : Response_Access := new LSP.Messages.ResponseMessage' - (Is_Error => True, - jsonrpc => <>, -- we will set this latter - id => <>, -- we will set this latter - error => - (Is_Set => True, - Value => (code => LSP.Errors.ServerNotInitialized, - message => "No initialize request was received", - others => <>))); - begin - Send_Response (Self, Response, Request_Id); - end Send_Not_Initialized; - - procedure Send_Canceled_Request - (Self : in out Server'Class; - Request_Id : LSP.Types.LSP_Number_Or_String) - is - Response : Response_Access := new LSP.Messages.ResponseMessage' - (Is_Error => True, - jsonrpc => <>, -- we will set this latter - id => <>, -- we will set this latter - error => - (Is_Set => True, - Value => (code => LSP.Errors.RequestCancelled, - message => "Request was canceled", - others => <>))); - begin - Send_Response (Self, Response, Request_Id); - end Send_Canceled_Request; - - ----------------------- - -- Send_Notification -- - ----------------------- + ---------------- + -- On_Message -- + ---------------- - procedure Send_Notification - (Self : in out Server'Class; - Value : in out Message_Access) - is - begin - Value.jsonrpc := "2.0"; - Self.Output_Queue.Enqueue (Value); - Value := null; - end Send_Notification; - - ------------------ - -- Send_Request -- - ------------------ - - procedure Send_Request - (Self : in out Server'Class; - Method : VSS.Strings.Virtual_String; - Value : LSP.Messages.Client_Requests.Client_Request'Class) - is - use type LSP.Types.LSP_Number; - Message : constant Client_Request_Access := - new LSP.Messages.Client_Requests.Client_Request'Class'(Value); - -- The Message will be deleted by Output_Task - begin - Message.jsonrpc := "2.0"; - Self.Last_Request := Self.Last_Request + 1; - Message.id := (Is_Number => True, Number => Self.Last_Request); - Message.method := Method; - Self.Output_Queue.Enqueue (Message_Access (Message)); - end Send_Request; - - ------------------- - -- Send_Response -- - ------------------- - - procedure Send_Response - (Self : in out Server'Class; - Response : in out Response_Access; - Request_Id : LSP.Types.LSP_Number_Or_String) is - begin - Response.jsonrpc := "2.0"; - Response.id := Request_Id; - Self.Output_Queue.Enqueue (Message_Access (Response)); - Response := null; - end Send_Response; - - ------------------ - -- Show_Message -- - ------------------ - - overriding procedure On_Show_Message - (Self : access Server; - Params : LSP.Messages.ShowMessageParams) + overriding procedure On_Message + (Self : in out Server; + Message : LSP.Client_Messages.Client_Message_Access) is - Message : Message_Access := - new LSP.Messages.Client_Notifications.ShowMessage_Notification' - (jsonrpc => <>, - method => "window/showMessage", - params => Params); begin - Self.Send_Notification (Message); - end On_Show_Message; + Self.Output_Queue.Enqueue (Message); + end On_Message; ---------- -- Stop -- @@ -952,32 +547,12 @@ package body LSP.Servers is Self.Stop.Release; end Stop; - ----------------------------- - -- To_Stream_Element_Array -- - ----------------------------- - - function To_Stream_Element_Array - (Vector : Ada.Strings.Unbounded.Unbounded_String) - return Ada.Streams.Stream_Element_Array - is - Last : constant Ada.Streams.Stream_Element_Count := - Ada.Streams.Stream_Element_Count - (Ada.Strings.Unbounded.Length (Vector)); - Buffer : Ada.Streams.Stream_Element_Array (1 .. Last); - begin - for J in 1 .. Last loop - Buffer (J) := Character'Pos - (Ada.Strings.Unbounded.Element (Vector, Positive (J))); - end loop; - - return Buffer; - end To_Stream_Element_Array; - ------------------------ -- Input_Queue_Length -- ------------------------ function Input_Queue_Length (Self : Server) return Natural is + use type Server_Message_Access; Result : Natural := Natural (Self.Input_Queue.Current_Use); begin if Self.Look_Ahead /= null then @@ -992,9 +567,8 @@ package body LSP.Servers is --------------------- task body Input_Task_Type is - Initialized : Boolean := False; EOF : Boolean := False; - Message : Message_Access; + Message : Server_Message_Access; begin accept Start; @@ -1004,7 +578,6 @@ package body LSP.Servers is select -- Process all available outputs before acceptiong Stop Server.Destroy_Queue.Dequeue (Message); - Server.Request_Map.Delete (Request_Access (Message).id); Free (Message); else @@ -1016,7 +589,7 @@ package body LSP.Servers is accept Stop; exit; else - Server.Process_One_Message (Initialized, EOF); + Server.Process_One_Message (EOF); -- This call can block reading from stream if EOF then @@ -1033,7 +606,6 @@ package body LSP.Servers is -- leaving this task. while Natural (Server.Destroy_Queue.Current_Use) > 0 loop Server.Destroy_Queue.Dequeue (Message); - Server.Request_Map.Delete (Request_Access (Message).id); Free (Message); end loop; end Input_Task_Type; @@ -1043,10 +615,9 @@ package body LSP.Servers is ---------------------- task body Output_Task_Type is - Message : Message_Access; - Stream : access Ada.Streams.Root_Stream_Type'Class renames Server.Stream; + Message : Client_Message_Access; - Output_Queue : Message_Queues.Queue renames Server.Output_Queue; + Output_Queue : Output_Message_Queues.Queue renames Server.Output_Queue; procedure Write_JSON_RPC (Stream : access Ada.Streams.Root_Stream_Type'Class; @@ -1071,17 +642,6 @@ package body LSP.Servers is String'Write (Stream, Header); VSS.Stream_Element_Vectors.Stream_Element_Vector'Write (Stream, Vector); - - if Server.Out_Trace.Is_Active then - declare - Aux : Ada.Strings.Unbounded.String_Access := - new String'(VSS.Stream_Element_Vectors.Conversions - .Unchecked_To_String (Vector)); - begin - Server.Out_Trace.Trace (Aux.all); - Free (Aux); - end; - end if; end Write_JSON_RPC; begin @@ -1091,34 +651,25 @@ package body LSP.Servers is select -- Process all available outputs before acceptiong Stop Output_Queue.Dequeue (Message); - Server.Logger.Visit (Message.all); declare - Out_Stream : aliased LSP.JSON_Streams.JSON_Stream (True, null); - Output : aliased - VSS.Text_Streams.Memory_UTF8_Output.Memory_UTF8_Output_Stream; + Stream : aliased VSS.Text_Streams.Memory_UTF8_Output + .Memory_UTF8_Output_Stream; + Writer : aliased VSS.JSON.Push_Writers.JSON_Simple_Push_Writer; + + Visitor : LSP.Client_Message_Writers.Client_Message_Writer + (Writer'Unchecked_Access); begin - Out_Stream.Set_Stream (Output'Unchecked_Access); + Writer.Set_Stream (Stream'Unchecked_Access); + Writer.Start_Document; - LSP.Messages.Message'Class'Write - (Out_Stream'Access, Message.all); + Message.Visit_Client_Message_Visitor (Visitor); Free (Message); - Out_Stream.End_Document; + Writer.End_Document; -- Send the output to the stream - Write_JSON_RPC (Stream, Output.Buffer); - - exception - when E : others => - -- Catch-all case: make sure no exception in output writing - -- can cause an exit of the task loop. - Server.Server_Trace.Trace - ("Exception when writing output:" & Line_Feed --- & To_String (Output) & Line_Feed - & Exception_Name (E) & " - " & Exception_Message (E)); - Server.Server_Trace.Trace (Symbolic_Traceback (E)); - + Write_JSON_RPC (Server.Stream, Stream.Buffer); end; or delay 0.1; @@ -1141,133 +692,44 @@ package body LSP.Servers is task body Processing_Task_Type is - Req_Handler : LSP.Server_Request_Handlers.Server_Request_Handler_Access; - - Notif_Handler : - LSP.Server_Notification_Receivers.Server_Notification_Receiver_Access; - Server_Backend : LSP.Server_Backends.Server_Backend_Access; + Handler : Server_Message_Visitor_Access; - Input_Queue : Message_Queues.Queue renames Server.Input_Queue; - Output_Queue : Message_Queues.Queue renames Server.Output_Queue; + Input_Queue : Input_Message_Queues.Queue renames Server.Input_Queue; procedure Initialize - (Request : not null LSP.Server_Request_Handlers - .Server_Request_Handler_Access; - Notification : not null LSP.Server_Notification_Receivers - .Server_Notification_Receiver_Access; - Server : LSP.Server_Backends.Server_Backend_Access); + (Handler : not null Server_Message_Visitor_Access); -- Initializes internal data structures - procedure Process_Message (Message : in out Message_Access); + procedure Process_Message (Message : in out Server_Message_Access); ---------------- -- Initialize -- ---------------- procedure Initialize - (Request : not null LSP.Server_Request_Handlers - .Server_Request_Handler_Access; - Notification : not null LSP.Server_Notification_Receivers - .Server_Notification_Receiver_Access; - Server : LSP.Server_Backends.Server_Backend_Access) - is - use type LSP.Server_Backends.Server_Backend_Access; + (Handler : not null Server_Message_Visitor_Access) is begin - Req_Handler := Request; - Notif_Handler := Notification; - - if Server = null then - Server_Backend := Null_Server'Access; - else - Server_Backend := Server; - end if; + Processing_Task_Type.Handler := Handler; end Initialize; --------------------- -- Process_Message -- --------------------- - procedure Process_Message (Message : in out Message_Access) is + procedure Process_Message (Message : in out Server_Message_Access) is begin - if Message.all in - LSP.Messages.Server_Notifications.Server_Notification'Class - then - -- This is a notification - begin - Server_Backend.Before_Work (Message.all); - LSP.Messages.Server_Notifications.Server_Notification'Class - (Message.all).Visit (Notif_Handler); - Server_Backend.After_Work (Message.all); - exception - when E : others => - -- Always log an exception in the traces - Server.Server_Trace.Trace - ("Exception (processing notification):" & Line_Feed - & Exception_Name (E) & Line_Feed & - Symbolic_Traceback (E)); - end; - - Free (Message); - return; - end if; - - declare - -- This is a request - Request : LSP.Messages.Server_Requests.Server_Request'Class renames - LSP.Messages.Server_Requests.Server_Request'Class (Message.all); - begin - - if Request.Canceled then - -- The request has been canceled - Server.Send_Canceled_Request (Request.id); - Server.Destroy_Queue.Enqueue (Message); - -- Request will be deleted by Input_Task - return; - end if; - - Server_Backend.Before_Work (Message.all); - declare - Response : constant Message_Access := - new LSP.Messages.ResponseMessage'Class' - (LSP.Servers.Handle_Request (Req_Handler, Request)); - begin - Output_Queue.Enqueue (Response); - -- Response will be deleted by Output_Task - end; - Server_Backend.After_Work (Message.all); - Server.Destroy_Queue.Enqueue (Message); - -- Request will be deleted by Input_Task - - exception - -- If we reach this exception handler, this means an exception - -- was raised when processing the request. - -- If this is an "exception that's expected for invalid Ada", it - -- should have been caught by the Error_Decorator. - when E : others => - Send_Exception_Response - (Server.all, E, - Ada.Tags.External_Tag (Message'Tag), Request.id); - Server.Destroy_Queue.Enqueue (Message); - end; - - exception - -- Catch-all case: make sure no exception in any message - -- processing can cause an exit of the task main loop. - when E : others => - Server.On_Error (E); + Message.Visit_Server_Message_Visitor (Handler.all); + Server.Destroy_Queue.Enqueue (Message); + Message := null; end Process_Message; - Request : Message_Access; + Request : Server_Message_Access; begin -- Perform initialization accept Start - (Request : not null LSP.Server_Request_Handlers - .Server_Request_Handler_Access; - Notification : not null LSP.Server_Notification_Receivers - .Server_Notification_Receiver_Access; - Server : LSP.Server_Backends.Server_Backend_Access) + (Handler : not null Server_Message_Visitor_Access) do - Initialize (Request, Notification, Server); + Initialize (Handler); end Start; loop @@ -1288,7 +750,7 @@ package body LSP.Servers is Continue := False; end select; - if Request /= null then + if Request.Assigned then Process_Message (Request); end if; end loop; @@ -1315,13 +777,14 @@ package body LSP.Servers is while Natural (Input_Queue.Current_Use) > 0 loop declare - X : Message_Access; + X : Server_Message_Access; begin Input_Queue.Dequeue (X); Free (X); end; end loop; - if Server.Look_Ahead /= null then + + if Server.Look_Ahead.Assigned then Free (Server.Look_Ahead); end if; end Processing_Task_Type; @@ -1330,7 +793,7 @@ package body LSP.Servers is -- Look_Ahead_Message -- ------------------------ - function Look_Ahead_Message (Self : Server) return Message_Access is + function Look_Ahead_Message (Self : Server) return Server_Message_Access is use type Ada.Task_Identification.Task_Id; begin pragma Assert diff --git a/source/server/lsp-servers.ads b/source/server/lsp-servers.ads index 6c1f58d2b..2eb01b3a4 100644 --- a/source/server/lsp-servers.ads +++ b/source/server/lsp-servers.ads @@ -1,7 +1,7 @@ ------------------------------------------------------------------------------ -- Language Server Protocol -- -- -- --- Copyright (C) 2018-2022, AdaCore -- +-- Copyright (C) 2018-2023, AdaCore -- -- -- -- This is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -21,36 +21,30 @@ -- that actually implements message processing. with Ada.Streams; -with Ada.Exceptions; with LSP.Client_Message_Receivers; -with LSP.Client_Notification_Receivers; -with LSP.Message_Loggers; -with LSP.Messages.Client_Requests; -with LSP.Messages; -with LSP.Server_Backends; -with LSP.Server_Notification_Receivers; -with LSP.Server_Request_Handlers; -with LSP.Types; - -with GNATCOLL.Traces; - -private with Ada.Strings.Unbounded; -private with Ada.Containers.Hashed_Maps; +with LSP.Server_Message_Visitors; + +with LSP.Server_Messages; +private with LSP.Client_Message_Factories; +private with LSP.Client_Messages; + private with Ada.Containers.Synchronized_Queue_Interfaces; private with Ada.Containers.Unbounded_Synchronized_Queues; private with GNAT.Semaphores; private with System; -private with LSP.Messages.Server_Notifications; -private with LSP.Messages.Server_Requests; +private with LSP.Server_Notifications; +private with LSP.Server_Requests; +private with VSS.Stream_Element_Vectors; package LSP.Servers is type Server is limited - new LSP.Client_Message_Receivers.Client_Message_Receiver with private; + new LSP.Client_Message_Receivers.Client_Message_Receiver + with private; -- The representation of LSP server. - -- Use methods of Client_Message_Receiver to send notifications and - -- requests to the LSP client. + -- Use methods of Client_Message_Receiver to send notifications, requests + -- and responses to the LSP client. procedure Initialize (Self : in out Server; @@ -60,20 +54,13 @@ package LSP.Servers is procedure Finalize (Self : in out Server); -- Clean up memory, file handles, tasks, etc. - type Uncaught_Exception_Handler is access - procedure (E : Ada.Exceptions.Exception_Occurrence); + type Server_Message_Visitor_Access is access all + LSP.Server_Message_Visitors.Server_Message_Visitor'Class + with Storage_Size => 0; procedure Run (Self : in out Server; - Request : not null - LSP.Server_Request_Handlers.Server_Request_Handler_Access; - Notification : not null - LSP.Server_Notification_Receivers.Server_Notification_Receiver_Access; - Server : LSP.Server_Backends.Server_Backend_Access; - On_Error : not null Uncaught_Exception_Handler; - Server_Trace : GNATCOLL.Traces.Trace_Handle; - In_Trace : GNATCOLL.Traces.Trace_Handle; - Out_Trace : GNATCOLL.Traces.Trace_Handle); + Handler : not null Server_Message_Visitor_Access); -- Run the server using given Request and Notification handler. -- Server_Trace - main trace for the LSP. -- In_Trace and Out_Trace - traces that logs all input & output for @@ -82,73 +69,17 @@ package LSP.Servers is procedure Stop (Self : in out Server); -- Ask server to stop - type Message_Access is access all LSP.Messages.Message'Class; + subtype Server_Message_Access is LSP.Server_Messages.Server_Message_Access; + -- Message send by a client to a server - function Look_Ahead_Message (Self : Server) return Message_Access; - -- Get next nessage in the queue if any. Only request/notification + function Look_Ahead_Message (Self : Server) return Server_Message_Access; + -- Get next message in the queue if any. Only request/notification -- handlers are allowed to call this function. function Input_Queue_Length (Self : Server) return Natural; -- Return number of messages pending in Input_Queue. -- For debug purposes only! - overriding procedure On_Show_Message - (Self : access Server; - Params : LSP.Messages.ShowMessageParams); - - overriding procedure On_Log_Message - (Self : access Server; - Params : LSP.Messages.LogMessageParams); - - overriding procedure On_Publish_Diagnostics - (Self : access Server; - Params : LSP.Messages.PublishDiagnosticsParams); - - overriding function Get_Progress_Type - (Self : access Server; - Token : LSP.Types.LSP_Number_Or_String) - return LSP.Client_Notification_Receivers.Progress_Value_Kind; - - overriding procedure On_Progress - (Self : access Server; - Params : LSP.Messages.Progress_Params); - - overriding procedure On_Progress_SymbolInformation_Vector - (Self : access Server; - Params : LSP.Messages.Progress_SymbolInformation_Vector); - - overriding procedure On_ShowMessage_Request - (Self : access Server; - Message : LSP.Messages.Client_Requests.ShowMessage_Request); - - overriding procedure On_ShowDocument_Request - (Self : access Server; - Message : LSP.Messages.Client_Requests.ShowDocument_Request); - - overriding procedure On_Workspace_Apply_Edit_Request - (Self : access Server; - Message : LSP.Messages.Client_Requests.Workspace_Apply_Edit_Request); - - overriding procedure On_Workspace_Configuration_Request - (Self : access Server; - Message : LSP.Messages.Client_Requests.Workspace_Configuration_Request); - - overriding procedure On_WorkDoneProgress_Create_Request - (Self : access Server; - Message : LSP.Messages.Client_Requests.WorkDoneProgressCreate_Request); - - overriding procedure On_Workspace_Folders_Request - (Self : access Server; - Message : LSP.Messages.Client_Requests.Workspace_Folders_Request); - - overriding procedure On_RegisterCapability_Request - (Self : access Server; - Message : LSP.Messages.Client_Requests.RegisterCapability_Request); - - overriding procedure On_UnregisterCapability_Request - (Self : access Server; - Message : LSP.Messages.Client_Requests.UnregisterCapability_Request); - function Has_Pending_Work (Self : Server) return Boolean; -- Return True if the server has work in the queue, other than the -- notification/request it's currently processing. This should only be @@ -188,28 +119,30 @@ private type Stream_Access is access all Ada.Streams.Root_Stream_Type'Class; type Request_Access is - access all LSP.Messages.Server_Requests.Server_Request'Class; + access all LSP.Server_Requests.Server_Request'Class; type Notification_Access is - access all LSP.Messages.Server_Notifications.Server_Notification'Class; - - package Request_Maps is new Ada.Containers.Hashed_Maps - (Key_Type => LSP.Types.LSP_Number_Or_String, -- Request id - Element_Type => Request_Access, - Hash => LSP.Types.Hash, - Equivalent_Keys => LSP.Types."=", - "=" => "="); + access all LSP.Server_Notifications.Server_Notification'Class; - package Message_Queue_Interface is new - Ada.Containers.Synchronized_Queue_Interfaces - (Message_Access); + package Input_Message_Queue_Interface is new + Ada.Containers.Synchronized_Queue_Interfaces (Server_Message_Access); - package Message_Queues is new + package Input_Message_Queues is new Ada.Containers.Unbounded_Synchronized_Queues - (Message_Queue_Interface); + (Input_Message_Queue_Interface); + + type Input_Queue_Access is access Input_Message_Queues.Queue; - type Input_Queue_Access is access Message_Queues.Queue; - type Output_Queue_Access is access Message_Queues.Queue; + subtype Client_Message_Access is LSP.Client_Messages.Client_Message_Access; + -- Message send by a server to a client + + package Output_Message_Queue_Interface is new + Ada.Containers.Synchronized_Queue_Interfaces (Client_Message_Access); + + package Output_Message_Queues is new + Ada.Containers.Unbounded_Synchronized_Queues + (Output_Message_Queue_Interface); + type Output_Queue_Access is access Output_Message_Queues.Queue; Processing_Task_Stack_Size : constant := 32 * 1_024 * 1_024; -- Size of the stack for request processing task. Set it to high enough @@ -220,12 +153,7 @@ private (Server : access LSP.Servers.Server) with Storage_Size => Processing_Task_Stack_Size is - entry Start - (Request : not null LSP.Server_Request_Handlers - .Server_Request_Handler_Access; - Notification : not null LSP.Server_Notification_Receivers - .Server_Notification_Receiver_Access; - Server : LSP.Server_Backends.Server_Backend_Access); + entry Start (Handler : not null Server_Message_Visitor_Access); entry Stop; -- Clean shutdown of the task end Processing_Task_Type; @@ -257,7 +185,7 @@ private ------------ type Server is limited - new LSP.Client_Message_Receivers.Client_Message_Receiver with + new LSP.Client_Message_Factories.Client_Message_Factory with record Stop : GNAT.Semaphores.Binary_Semaphore (Initially_Available => False, @@ -265,29 +193,26 @@ private -- Signal to main task to stop server. Released on "exit" message or -- on end of input stream. Stream : access Ada.Streams.Root_Stream_Type'Class; - Last_Request : LSP.Types.LSP_Number := 1; - Vector : Ada.Strings.Unbounded.Unbounded_String; + Last_Request : Positive := 1; + Vector : VSS.Stream_Element_Vectors.Stream_Element_Vector; -- Queues and tasks used for asynchronous processing, see doc above - Input_Queue : Message_Queues.Queue; - Look_Ahead : Message_Access; + Input_Queue : Input_Message_Queues.Queue; + Look_Ahead : Server_Message_Access; -- One message look-ahead buffer for Input_Queue - Output_Queue : Message_Queues.Queue; + Output_Queue : Output_Message_Queues.Queue; Processing_Task : Processing_Task_Type (Server'Unchecked_Access); Output_Task : Output_Task_Type (Server'Unchecked_Access); Input_Task : Input_Task_Type (Server'Unchecked_Access); - Request_Map : Request_Maps.Map; - Destroy_Queue : Message_Queues.Queue; - - Server_Trace : GNATCOLL.Traces.Trace_Handle; - In_Trace : GNATCOLL.Traces.Trace_Handle; - Out_Trace : GNATCOLL.Traces.Trace_Handle; - Logger : aliased LSP.Message_Loggers.Message_Logger; - On_Error : Uncaught_Exception_Handler; + Destroy_Queue : Input_Message_Queues.Queue; end record; - Unknown_Method : exception; + overriding procedure On_Message + (Self : in out Server; + Message : LSP.Client_Messages.Client_Message_Access); + + Unknown_Method : exception renames Program_Error; -- This exception is raised by message decoder when it's unable to decode -- an unknown request end LSP.Servers; From aa3c74333133399b21eaef8336681e681af8aed9 Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Tue, 8 Aug 2023 18:53:44 +0300 Subject: [PATCH 005/152] Restore server traces. Introduce abstract tracer interface to hide implementation details there. Refs #1170 --- source/ada/lsp-ada_driver.adb | 45 ++++++---- source/ada/lsp-gnatcoll_tracers.adb | 135 ++++++++++++++++++++++++++++ source/ada/lsp-gnatcoll_tracers.ads | 74 +++++++++++++++ source/server/lsp-servers.adb | 100 +++++++++++++++++---- source/server/lsp-servers.ads | 14 +-- source/server/lsp-tracers.ads | 64 +++++++++++++ 6 files changed, 393 insertions(+), 39 deletions(-) create mode 100644 source/ada/lsp-gnatcoll_tracers.adb create mode 100644 source/ada/lsp-gnatcoll_tracers.ads create mode 100644 source/server/lsp-tracers.ads diff --git a/source/ada/lsp-ada_driver.adb b/source/ada/lsp-ada_driver.adb index 3324fc83c..d400609eb 100644 --- a/source/ada/lsp-ada_driver.adb +++ b/source/ada/lsp-ada_driver.adb @@ -38,6 +38,7 @@ with GNATCOLL.VFS; use GNATCOLL.VFS; with GNATCOLL.Utils; with LSP.Ada_Handlers; +with LSP.GNATCOLL_Tracers; with LSP.Memory_Statistics; with LSP.Servers; with LSP.Stdio_Streams; @@ -48,6 +49,16 @@ with LSP.Stdio_Streams; procedure LSP.Ada_Driver is + use type VSS.Strings.Virtual_String; + + Server_Trace : constant Trace_Handle := Create ("ALS.MAIN", From_Config); + -- Main trace for the LSP. + + In_Trace : constant Trace_Handle := Create ("ALS.IN", Off); + Out_Trace : constant Trace_Handle := Create ("ALS.OUT", Off); + -- Traces that logs all input & output. For debugging purposes. + Tracer : aliased LSP.GNATCOLL_Tracers.Tracer; + Server : aliased LSP.Servers.Server; Stream : aliased LSP.Stdio_Streams.Stdio_Stream; Ada_Handler : aliased LSP.Ada_Handlers.Message_Handler @@ -55,8 +66,6 @@ procedure LSP.Ada_Driver is GPR_Handler : aliased LSP.Ada_Handlers.Message_Handler (Server'Access); - use type VSS.Strings.Virtual_String; - Fuzzing_Activated : constant Boolean := not VSS.Application.System_Environment.Value ("ALS_FUZZING").Is_Empty; pragma Unreferenced (Fuzzing_Activated); @@ -65,10 +74,8 @@ procedure LSP.Ada_Driver is VSS.Application.System_Environment.Value ("ALS_HOME"); GPR_Path : constant VSS.Strings.Virtual_String := VSS.Application.System_Environment.Value ("GPR_PROJECT_PATH"); - pragma Unreferenced (GPR_Path); Path : constant VSS.Strings.Virtual_String := VSS.Application.System_Environment.Value ("PATH"); - pragma Unreferenced (Path); Home_Dir : constant Virtual_File := Create_From_UTF8 (VSS.Strings.Conversions.To_UTF_8_String @@ -110,7 +117,7 @@ procedure LSP.Ada_Driver is Config_File : Virtual_File; - Memory_Monitor_Enabled : Boolean := False; + Memory_Monitor_Enabled : Boolean; begin -- Handle the command line @@ -193,14 +200,16 @@ begin end; end if; - Server_Trace.Trace ("ALS version: " & $VERSION & " (" & $BUILD_DATE & ")"); + Tracer.Initialize (Server_Trace, In_Trace, Out_Trace); + Tracer.Trace ("ALS version: " & $VERSION & " (" & $BUILD_DATE & ")"); - Server_Trace.Trace ("Initializing server ..."); + Tracer.Trace ("Initializing server ..."); - Server_Trace.Trace + Tracer.Trace ("GPR PATH: " & VSS.Strings.Conversions.To_UTF_8_String (GPR_Path)); - Server_Trace.Trace + Tracer.Trace ("PATH: " & VSS.Strings.Conversions.To_UTF_8_String (Path)); + -- Start monitoring the memory if the memory monitor trace is active Memory_Monitor_Enabled := Create ("DEBUG.ADA_MEMORY").Is_Active; @@ -219,11 +228,17 @@ begin Server.Initialize (Stream'Unchecked_Access); - if VSS.Command_Line.Is_Specified (Language_GPR_Option) then - Server.Run (GPR_Handler'Unchecked_Access); - else - Server.Run (Ada_Handler'Unchecked_Access); - end if; + begin + if VSS.Command_Line.Is_Specified (Language_GPR_Option) then + Server.Run (GPR_Handler'Unchecked_Access, Tracer'Unchecked_Access); + else + Server.Run (Ada_Handler'Unchecked_Access, Tracer'Unchecked_Access); + end if; + exception + when E : others => + Tracer.Trace_Exception + (E, "FATAL - Unexpected exception in the main thread:"); + end; -- Dump the memory statistics if the memory monitor trace is active if Memory_Monitor_Enabled then @@ -232,7 +247,7 @@ begin LSP.Memory_Statistics.Dump_Memory_Statistics (3); begin - Ada.Text_IO.Put_Line (Memory_Stats); + Tracer.Trace (Memory_Stats); end; end if; diff --git a/source/ada/lsp-gnatcoll_tracers.adb b/source/ada/lsp-gnatcoll_tracers.adb new file mode 100644 index 000000000..b42687f29 --- /dev/null +++ b/source/ada/lsp-gnatcoll_tracers.adb @@ -0,0 +1,135 @@ +------------------------------------------------------------------------------ +-- Language Server Protocol -- +-- -- +-- Copyright (C) 2022-2023, AdaCore -- +-- -- +-- This is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 3, or (at your option) any later ver- -- +-- sion. This software is distributed in the hope that it will be useful, -- +-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- -- +-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -- +-- License for more details. You should have received a copy of the GNU -- +-- General Public License distributed with this software; see file -- +-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy -- +-- of the license. -- +------------------------------------------------------------------------------ + +with Ada.Strings.Unbounded; + +with GNAT.Traceback.Symbolic; + +with VSS.Stream_Element_Vectors.Conversions; +with VSS.Strings.Conversions; + +package body LSP.GNATCOLL_Tracers is + + ---------------- + -- Initialize -- + ---------------- + + procedure Initialize + (Self : in out Tracer'Class; + Server_Trace : GNATCOLL.Traces.Trace_Handle; + In_Trace : GNATCOLL.Traces.Trace_Handle; + Out_Trace : GNATCOLL.Traces.Trace_Handle) is + begin + Self.Server_Trace := Server_Trace; + Self.In_Trace := In_Trace; + Self.Out_Trace := Out_Trace; + end Initialize; + + ----------- + -- Trace -- + ----------- + + overriding procedure Trace (Self : in out Tracer; Text : String) is + begin + Self.Server_Trace.Trace (Text); + end Trace; + + ----------- + -- Trace -- + ----------- + + overriding procedure Trace + (Self : in out Tracer; + Text : VSS.Stream_Element_Vectors.Stream_Element_Vector) + is + Aux : Ada.Strings.Unbounded.String_Access := + new String'(VSS.Stream_Element_Vectors.Conversions + .Unchecked_To_String (Text)); + begin + Self.Server_Trace.Trace (Aux.all); + Ada.Strings.Unbounded.Free (Aux); + end Trace; + + --------------------- + -- Trace_Exception -- + --------------------- + + overriding procedure Trace_Exception + (Self : in out Tracer; + Error : Ada.Exceptions.Exception_Occurrence; + Message : VSS.Strings.Virtual_String := + VSS.Strings.Empty_Virtual_String) + is + begin + Self.Trace_Text + (if Message.Is_Empty then "Exception:" else Message); + + Self.Trace + (Ada.Exceptions.Exception_Name (Error) & " - " & + Ada.Exceptions.Exception_Message (Error)); + + Self.Trace (GNAT.Traceback.Symbolic.Symbolic_Traceback (Error)); + end Trace_Exception; + + ----------------- + -- Trace_Input -- + ----------------- + + overriding procedure Trace_Input + (Self : in out Tracer; + Text : VSS.Stream_Element_Vectors.Stream_Element_Vector) + is + Aux : Ada.Strings.Unbounded.String_Access; + begin + if Self.In_Trace.Is_Active then + Aux := new String'(VSS.Stream_Element_Vectors.Conversions + .Unchecked_To_String (Text)); + Self.In_Trace.Trace (Aux.all); + Ada.Strings.Unbounded.Free (Aux); + end if; + end Trace_Input; + + ------------------ + -- Trace_Output -- + ------------------ + + overriding procedure Trace_Output + (Self : in out Tracer; + Text : VSS.Stream_Element_Vectors.Stream_Element_Vector) + is + Aux : Ada.Strings.Unbounded.String_Access; + begin + if Self.Out_Trace.Is_Active then + Aux := new String'(VSS.Stream_Element_Vectors.Conversions + .Unchecked_To_String (Text)); + Self.Out_Trace.Trace (Aux.all); + Ada.Strings.Unbounded.Free (Aux); + end if; + end Trace_Output; + + ---------------- + -- Trace_Text -- + ---------------- + + overriding procedure Trace_Text + (Self : in out Tracer; + Text : VSS.Strings.Virtual_String) is + begin + Self.Server_Trace.Trace (VSS.Strings.Conversions.To_UTF_8_String (Text)); + end Trace_Text; + +end LSP.GNATCOLL_Tracers; diff --git a/source/ada/lsp-gnatcoll_tracers.ads b/source/ada/lsp-gnatcoll_tracers.ads new file mode 100644 index 000000000..9862fa604 --- /dev/null +++ b/source/ada/lsp-gnatcoll_tracers.ads @@ -0,0 +1,74 @@ +------------------------------------------------------------------------------ +-- Language Server Protocol -- +-- -- +-- Copyright (C) 2022-2023, AdaCore -- +-- -- +-- This is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 3, or (at your option) any later ver- -- +-- sion. This software is distributed in the hope that it will be useful, -- +-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- -- +-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -- +-- License for more details. You should have received a copy of the GNU -- +-- General Public License distributed with this software; see file -- +-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy -- +-- of the license. -- +------------------------------------------------------------------------------ + +with Ada.Exceptions; + +with GNATCOLL.Traces; + +with VSS.Strings; +with VSS.Stream_Element_Vectors; +with LSP.Tracers; + +package LSP.GNATCOLL_Tracers is + + type Tracer is limited new LSP.Tracers.Tracer with private; + -- Implementation of abstract tracer interface over GNATCOLL.Traces + + procedure Initialize + (Self : in out Tracer'Class; + Server_Trace : GNATCOLL.Traces.Trace_Handle; + In_Trace : GNATCOLL.Traces.Trace_Handle; + Out_Trace : GNATCOLL.Traces.Trace_Handle); + -- Server_Trace - main trace for the LSP. + -- In_Trace and Out_Trace - traces that logs all input & output for + -- debugging purposes. + + overriding procedure Trace + (Self : in out Tracer; + Text : String); + + overriding procedure Trace_Text + (Self : in out Tracer; + Text : VSS.Strings.Virtual_String); + + overriding procedure Trace_Exception + (Self : in out Tracer; + Error : Ada.Exceptions.Exception_Occurrence; + Message : VSS.Strings.Virtual_String := + VSS.Strings.Empty_Virtual_String); + + overriding procedure Trace + (Self : in out Tracer; + Text : VSS.Stream_Element_Vectors.Stream_Element_Vector); + + overriding procedure Trace_Input + (Self : in out Tracer; + Text : VSS.Stream_Element_Vectors.Stream_Element_Vector); + + overriding procedure Trace_Output + (Self : in out Tracer; + Text : VSS.Stream_Element_Vectors.Stream_Element_Vector); + +private + + type Tracer is limited new LSP.Tracers.Tracer with record + Server_Trace : GNATCOLL.Traces.Trace_Handle; + In_Trace : GNATCOLL.Traces.Trace_Handle; + Out_Trace : GNATCOLL.Traces.Trace_Handle; + end record; + +end LSP.GNATCOLL_Tracers; diff --git a/source/server/lsp-servers.adb b/source/server/lsp-servers.adb index ba1bcbfa5..ed3d2b817 100644 --- a/source/server/lsp-servers.adb +++ b/source/server/lsp-servers.adb @@ -24,7 +24,6 @@ with Ada.Unchecked_Deallocation; with VSS.JSON.Pull_Readers.Simple; with VSS.JSON.Push_Writers; with VSS.JSON.Streams; -with VSS.Stream_Element_Vectors.Conversions; with VSS.Strings; with VSS.Text_Streams.Memory_UTF8_Input; with VSS.Text_Streams.Memory_UTF8_Output; @@ -57,14 +56,15 @@ package body LSP.Servers is procedure Send_Exception_Response (Self : in out Server'Class; E : Ada.Exceptions.Exception_Occurrence; - Trace_Text : String; + Message : VSS.Strings.Virtual_String; + Request : VSS.Stream_Element_Vectors.Stream_Element_Vector; Request_Id : LSP.Structures.Integer_Or_Virtual_String; Code : LSP.Enumerations.ErrorCodes := - LSP.Enumerations.InternalError) is null; - -- Send a response to the stream representing the exception. This + LSP.Enumerations.InternalError); + -- Send a response representing the exception to the client. This -- should be called whenever an exception occurred while processing -- a request. - -- Trace_Text is the additional info to write in the traces, and + -- Message is the additional info to write in the traces, and -- Request_Id is the id of the request we were trying to process. -- Use given Code in the response. @@ -76,12 +76,6 @@ package body LSP.Servers is (Object => LSP.Client_Messages.Client_Message'Class, Name => Client_Message_Access); - function To_String - (Vector : VSS.Stream_Element_Vectors.Stream_Element_Vector'Class) - return String - renames VSS.Stream_Element_Vectors.Conversions.Unchecked_To_String; - -- Cast Stream_Element_Vector to a string - ------------ -- Append -- ------------ @@ -322,6 +316,9 @@ package body LSP.Servers is end loop; Memory.Rewind; + exception + when E : others => + Self.Tracer.Trace_Exception (E, "JSON decoding error"); end Decode_JSON_RPC_Headers; function Assigned @@ -353,7 +350,8 @@ package body LSP.Servers is -- TODO: Process client responses here. if Error.Is_Set then - null; + Self.Tracer.Trace ("Got Error response:"); + Self.Tracer.Trace_Text (Error.Value.message); end if; return; @@ -374,11 +372,21 @@ package body LSP.Servers is (LSP.Server_Request_Readers.Read_Request (R, Method)); + if not R.Is_End_Document then + Self.Tracer.Trace ("Request decoding failed:"); + Self.Tracer.Trace (Vector); + Self.On_Error_Response + (Request_Id, + (code => LSP.Enumerations.InvalidParams, + message => "Unable to decode request.")); + + return; + end if; exception when UR : Unknown_Method => Send_Exception_Response - (Self, UR, - To_String (Vector), + (Self, UR, "Unknown method.", + Vector, Request_Id, LSP.Enumerations.MethodNotFound); return; @@ -387,8 +395,8 @@ package body LSP.Servers is -- If we reach this exception handler, this means the -- request could not be decoded. Send_Exception_Response - (Self, E, - To_String (Vector), + (Self, E, "Request decoding fails:", + Vector, Request_Id, LSP.Enumerations.InvalidParams); return; @@ -411,6 +419,11 @@ package body LSP.Servers is new LSP.Server_Notifications.Server_Notification'Class' (LSP.Server_Notification_Readers.Read_Notification (R, Method)); + + if not R.Is_End_Document then + Self.Tracer.Trace ("Notification decoding failed:"); + Self.Tracer.Trace (Vector); + end if; end; Message := Server_Message_Access (Notification); @@ -443,6 +456,7 @@ package body LSP.Servers is procedure Parse_JSON (Vector : VSS.Stream_Element_Vectors.Stream_Element_Vector) is begin + Self.Tracer.Trace_Input (Vector); Process_JSON_Document (Vector); end Parse_JSON; @@ -516,14 +530,16 @@ package body LSP.Servers is procedure Run (Self : in out Server; - Handler : not null Server_Message_Visitor_Access) is + Handler : not null Server_Message_Visitor_Access; + Tracer : not null LSP.Tracers.Tracer_Access) is begin + Self.Tracer := Tracer; Self.Processing_Task.Start (Handler); Self.Output_Task.Start; Self.Input_Task.Start; -- Wait for stop signal - Self.Stop.Seize; + Self.Stop_Signal.Seize; end Run; ---------------- @@ -538,13 +554,34 @@ package body LSP.Servers is Self.Output_Queue.Enqueue (Message); end On_Message; + ----------------------------- + -- Send_Exception_Response -- + ----------------------------- + + procedure Send_Exception_Response + (Self : in out Server'Class; + E : Ada.Exceptions.Exception_Occurrence; + Message : VSS.Strings.Virtual_String; + Request : VSS.Stream_Element_Vectors.Stream_Element_Vector; + Request_Id : LSP.Structures.Integer_Or_Virtual_String; + Code : LSP.Enumerations.ErrorCodes := + LSP.Enumerations.InternalError) is + begin + Self.Tracer.Trace_Exception (E, Message); + Self.Tracer.Trace (Request); + Self.On_Error_Response + (Request_Id, + (code => Code, + message => Message)); + end Send_Exception_Response; + ---------- -- Stop -- ---------- procedure Stop (Self : in out Server) is begin - Self.Stop.Release; + Self.Stop_Signal.Release; end Stop; ------------------------ @@ -608,6 +645,11 @@ package body LSP.Servers is Server.Destroy_Queue.Dequeue (Message); Free (Message); end loop; + + exception + when E : others => + Server.Tracer.Trace_Exception (E, "Input_Task died"); + Server.Stop; -- Ask server to stop end Input_Task_Type; ---------------------- @@ -639,9 +681,15 @@ package body LSP.Servers is & New_Line & New_Line; begin + Server.Tracer.Trace_Output (Vector); String'Write (Stream, Header); VSS.Stream_Element_Vectors.Stream_Element_Vector'Write (Stream, Vector); + + exception + when E : others => + Server.Tracer.Trace_Exception (E, "Can't write JSON to stdout"); + raise; end Write_JSON_RPC; begin @@ -684,6 +732,11 @@ package body LSP.Servers is end select; end select; end loop; + + exception + when E : others => + Server.Tracer.Trace_Exception (E, "Output_Task died"); + Server.Stop; -- Ask server to stop end Output_Task_Type; -------------------------- @@ -721,6 +774,10 @@ package body LSP.Servers is Message.Visit_Server_Message_Visitor (Handler.all); Server.Destroy_Queue.Enqueue (Message); Message := null; + exception + when E : others => + -- Message handler should never raise any exception + Server.Tracer.Trace_Exception (E, "Message handler raised error!"); end Process_Message; Request : Server_Message_Access; @@ -787,6 +844,11 @@ package body LSP.Servers is if Server.Look_Ahead.Assigned then Free (Server.Look_Ahead); end if; + + exception + when E : others => + Server.Tracer.Trace_Exception (E, "Processing_Task died"); + Server.Stop; -- Ask server to stop end Processing_Task_Type; ------------------------ diff --git a/source/server/lsp-servers.ads b/source/server/lsp-servers.ads index 2eb01b3a4..80cc2c84f 100644 --- a/source/server/lsp-servers.ads +++ b/source/server/lsp-servers.ads @@ -26,6 +26,8 @@ with LSP.Client_Message_Receivers; with LSP.Server_Message_Visitors; with LSP.Server_Messages; +with LSP.Tracers; + private with LSP.Client_Message_Factories; private with LSP.Client_Messages; @@ -60,11 +62,12 @@ package LSP.Servers is procedure Run (Self : in out Server; - Handler : not null Server_Message_Visitor_Access); + Handler : not null Server_Message_Visitor_Access; + Tracer : not null LSP.Tracers.Tracer_Access); -- Run the server using given Request and Notification handler. - -- Server_Trace - main trace for the LSP. - -- In_Trace and Out_Trace - traces that logs all input & output for - -- debugging purposes. Call On_Error in case of uncaught exceptions. + -- Tracer object provides tracing/logging capabilities for the main trace, + -- all input & output traces for debugging purposes. + -- Call On_Error in case of uncaught exceptions. procedure Stop (Self : in out Server); -- Ask server to stop @@ -187,7 +190,7 @@ private type Server is limited new LSP.Client_Message_Factories.Client_Message_Factory with record - Stop : GNAT.Semaphores.Binary_Semaphore + Stop_Signal : GNAT.Semaphores.Binary_Semaphore (Initially_Available => False, Ceiling => System.Default_Priority); -- Signal to main task to stop server. Released on "exit" message or @@ -206,6 +209,7 @@ private Input_Task : Input_Task_Type (Server'Unchecked_Access); Destroy_Queue : Input_Message_Queues.Queue; + Tracer : LSP.Tracers.Tracer_Access; end record; overriding procedure On_Message diff --git a/source/server/lsp-tracers.ads b/source/server/lsp-tracers.ads new file mode 100644 index 000000000..9e0b31f81 --- /dev/null +++ b/source/server/lsp-tracers.ads @@ -0,0 +1,64 @@ +------------------------------------------------------------------------------ +-- Language Server Protocol -- +-- -- +-- Copyright (C) 2022-2023, AdaCore -- +-- -- +-- This is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 3, or (at your option) any later ver- -- +-- sion. This software is distributed in the hope that it will be useful, -- +-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- -- +-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -- +-- License for more details. You should have received a copy of the GNU -- +-- General Public License distributed with this software; see file -- +-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy -- +-- of the license. -- +------------------------------------------------------------------------------ + +with Ada.Exceptions; + +with VSS.Stream_Element_Vectors; +with VSS.Strings; + +package LSP.Tracers is + pragma Preelaborate; + + type Tracer is limited interface; + -- The tracer can write exceptions, errors and other information into log + -- files/traces. + + type Tracer_Access is access all Tracer'Class with Storage_Size => 0; + + procedure Trace + (Self : in out Tracer; + Text : String) is abstract; + -- Append Text to default trace file + + procedure Trace_Text + (Self : in out Tracer; + Text : VSS.Strings.Virtual_String) is abstract; + -- Append Text to default trace file + + procedure Trace_Exception + (Self : in out Tracer; + Error : Ada.Exceptions.Exception_Occurrence; + Message : VSS.Strings.Virtual_String := + VSS.Strings.Empty_Virtual_String) is abstract; + -- Append an exception information to default trace file + + procedure Trace + (Self : in out Tracer; + Text : VSS.Stream_Element_Vectors.Stream_Element_Vector) is abstract; + -- Append raw data as text to default trace file + + procedure Trace_Input + (Self : in out Tracer; + Text : VSS.Stream_Element_Vectors.Stream_Element_Vector) is abstract; + -- Append raw data as text to input trace file + + procedure Trace_Output + (Self : in out Tracer; + Text : VSS.Stream_Element_Vectors.Stream_Element_Vector) is abstract; + -- Append raw data as text to output trace file + +end LSP.Tracers; From f881a0e5234307fd732567287f300d8e63838e85 Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Tue, 8 Aug 2023 19:48:11 +0300 Subject: [PATCH 006/152] Move message lifecycle check into a dedicated checker Refs #1170 --- source/server/lsp-lifecycle_checkers.adb | 97 ++++++++++++++++++++++++ source/server/lsp-lifecycle_checkers.ads | 79 +++++++++++++++++++ source/server/lsp-servers.adb | 12 ++- 3 files changed, 184 insertions(+), 4 deletions(-) create mode 100644 source/server/lsp-lifecycle_checkers.adb create mode 100644 source/server/lsp-lifecycle_checkers.ads diff --git a/source/server/lsp-lifecycle_checkers.adb b/source/server/lsp-lifecycle_checkers.adb new file mode 100644 index 000000000..b7020d10f --- /dev/null +++ b/source/server/lsp-lifecycle_checkers.adb @@ -0,0 +1,97 @@ +------------------------------------------------------------------------------ +-- Language Server Protocol -- +-- -- +-- Copyright (C) 2022-2023, AdaCore -- +-- -- +-- This is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 3, or (at your option) any later ver- -- +-- sion. This software is distributed in the hope that it will be useful, -- +-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- -- +-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -- +-- License for more details. You should have received a copy of the GNU -- +-- General Public License distributed with this software; see file -- +-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy -- +-- of the license. -- +------------------------------------------------------------------------------ + +with LSP.Enumerations; + +package body LSP.Lifecycle_Checkers is + + ------------------- + -- Check_Message -- + ------------------- + + procedure Check_Message + (Self : in out Lifecycle_Checker; + Client : in out LSP.Client_Message_Receivers + .Client_Message_Receiver'Class; + Message : LSP.Server_Messages.Server_Message'Class; + Is_Ok : out Boolean; + Is_Exit : out Boolean) + is + begin + Self.Is_Exit := False; + Self.Request_Id := (Is_Set => False); + Self.Client := Client'Unchecked_Access; + + Message.Visit_Server_Message_Visitor (Self.Visitor); + + Is_Exit := Self.Is_Exit; + Is_Ok := Self.Initialized or else Is_Exit; + + if not Is_Ok and then Self.Request_Id.Is_Set then + Client.On_Error_Response + (Id => Self.Request_Id.Value, + Value => + (code => LSP.Enumerations.ServerNotInitialized, + message => "No initialize request has been received")); + end if; + end Check_Message; + + --------------------------- + -- On_Exits_Notification -- + --------------------------- + + overriding procedure On_Exits_Notification (Self : in out Visitor) is + begin + Self.Parent.Is_Exit := True; + end On_Exits_Notification; + + --------------------------- + -- On_Initialize_Request -- + --------------------------- + + overriding procedure On_Initialize_Request + (Self : in out Visitor; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InitializeParams) is + begin + Self.Parent.Initialized := True; + end On_Initialize_Request; + + ---------------------------- + -- On_Server_Notification -- + ---------------------------- + + overriding procedure On_Server_Notification + (Self : in out Visitor; + Value : LSP.Server_Notifications.Server_Notification'Class) is + begin + Value.Visit_Server_Receiver (Self); + end On_Server_Notification; + + ----------------------- + -- On_Server_Request -- + ----------------------- + + overriding procedure On_Server_Request + (Self : in out Visitor; + Value : LSP.Server_Requests.Server_Request'Class) is + begin + Self.Parent.Request_Id := (True, Value.Id); + Value.Visit_Server_Receiver (Self); + end On_Server_Request; + +end LSP.Lifecycle_Checkers; diff --git a/source/server/lsp-lifecycle_checkers.ads b/source/server/lsp-lifecycle_checkers.ads new file mode 100644 index 000000000..ec415b455 --- /dev/null +++ b/source/server/lsp-lifecycle_checkers.ads @@ -0,0 +1,79 @@ +------------------------------------------------------------------------------ +-- Language Server Protocol -- +-- -- +-- Copyright (C) 2022-2023, AdaCore -- +-- -- +-- This is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 3, or (at your option) any later ver- -- +-- sion. This software is distributed in the hope that it will be useful, -- +-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- -- +-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -- +-- License for more details. You should have received a copy of the GNU -- +-- General Public License distributed with this software; see file -- +-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy -- +-- of the license. -- +------------------------------------------------------------------------------ + +with LSP.Client_Message_Receivers; +with LSP.Server_Message_Visitors; +with LSP.Server_Messages; +with LSP.Server_Notification_Receivers; +with LSP.Server_Notifications; +with LSP.Server_Request_Receivers; +with LSP.Server_Requests; +with LSP.Structures; + +package LSP.Lifecycle_Checkers is + + type Lifecycle_Checker is tagged limited private; + -- Type to keep state of initialization and to verify message flow + + procedure Check_Message + (Self : in out Lifecycle_Checker; + Client : in out LSP.Client_Message_Receivers + .Client_Message_Receiver'Class; + Message : LSP.Server_Messages.Server_Message'Class; + Is_Ok : out Boolean; + Is_Exit : out Boolean); + -- Verify if given message is allowed in the current lifycycle state. + -- If it's allowed return Is_Ok = True, else send response using Client + -- object if needed and return Is_Ok = False. + -- Set Is_Exit = True if Message is then exits notification. + +private + + type Visitor (Parent : not null access Lifecycle_Checker) is + limited new LSP.Server_Message_Visitors.Server_Message_Visitor + and LSP.Server_Notification_Receivers.Server_Notification_Receiver + and LSP.Server_Request_Receivers.Server_Request_Receiver + with null record; + + overriding procedure On_Initialize_Request + (Self : in out Visitor; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InitializeParams); + + overriding procedure On_Exits_Notification (Self : in out Visitor); + + overriding procedure On_Server_Notification + (Self : in out Visitor; + Value : LSP.Server_Notifications.Server_Notification'Class); + + overriding procedure On_Server_Request + (Self : in out Visitor; + Value : LSP.Server_Requests.Server_Request'Class); + + type Lifecycle_Checker is tagged limited record + Visitor : LSP.Lifecycle_Checkers.Visitor + (Lifecycle_Checker'Unchecked_Access); + + Initialized : Boolean := False; + Is_Exit : Boolean; + + Request_Id : LSP.Structures.Integer_Or_Virtual_String_Optional; + Client : access constant + LSP.Client_Message_Receivers.Client_Message_Receiver'Class; + end record; + +end LSP.Lifecycle_Checkers; diff --git a/source/server/lsp-servers.adb b/source/server/lsp-servers.adb index ed3d2b817..eef3c6488 100644 --- a/source/server/lsp-servers.adb +++ b/source/server/lsp-servers.adb @@ -31,6 +31,7 @@ with VSS.Text_Streams.Memory_UTF8_Output; with LSP.Client_Message_Writers; with LSP.Enumerations; with LSP.Errors; +with LSP.Lifecycle_Checkers; with LSP.Server_Notification_Readers; with LSP.Server_Request_Readers; with LSP.Structures; @@ -42,6 +43,7 @@ package body LSP.Servers is procedure Process_One_Message (Self : in out Server'Class; + Checker : in out LSP.Lifecycle_Checkers.Lifecycle_Checker; EOF : in out Boolean); -- Read data from stdin and create a message if there is enough data. -- Then put the message into Self.Input_Queue. @@ -140,6 +142,7 @@ package body LSP.Servers is procedure Process_One_Message (Self : in out Server'Class; + Checker : in out LSP.Lifecycle_Checkers.Lifecycle_Checker; EOF : in out Boolean) is use type Ada.Streams.Stream_Element_Count; @@ -329,8 +332,8 @@ package body LSP.Servers is Request : Request_Access; Notification : Notification_Access; - Ok : constant Boolean := True; - Is_Exit_Notification : constant Boolean := False; + Ok : Boolean; + Is_Exit_Notification : Boolean; Version : VSS.Strings.Virtual_String; Method : VSS.Strings.Virtual_String; @@ -429,7 +432,7 @@ package body LSP.Servers is Message := Server_Message_Access (Notification); end if; - -- TODO: Set Is_Exit_Notification; + Checker.Check_Message (Self, Message.all, Ok, Is_Exit_Notification); -- Check initialization status and send a response if this is a -- request before initialization. -- @@ -606,6 +609,7 @@ package body LSP.Servers is task body Input_Task_Type is EOF : Boolean := False; Message : Server_Message_Access; + Checker : LSP.Lifecycle_Checkers.Lifecycle_Checker; begin accept Start; @@ -626,7 +630,7 @@ package body LSP.Servers is accept Stop; exit; else - Server.Process_One_Message (EOF); + Server.Process_One_Message (Checker, EOF); -- This call can block reading from stream if EOF then From 8aae5fc54328be1efb74808793b28cf945d73511 Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Tue, 8 Aug 2023 19:56:32 +0300 Subject: [PATCH 007/152] Keep known request in a map to be able cancel them. Refs #1170 --- source/server/lsp-known_requests.adb | 87 +++++++++++++++++++++++++++ source/server/lsp-known_requests.ads | 90 ++++++++++++++++++++++++++++ 2 files changed, 177 insertions(+) create mode 100644 source/server/lsp-known_requests.adb create mode 100644 source/server/lsp-known_requests.ads diff --git a/source/server/lsp-known_requests.adb b/source/server/lsp-known_requests.adb new file mode 100644 index 000000000..78e586642 --- /dev/null +++ b/source/server/lsp-known_requests.adb @@ -0,0 +1,87 @@ +------------------------------------------------------------------------------ +-- Language Server Protocol -- +-- -- +-- Copyright (C) 2022-2023, AdaCore -- +-- -- +-- This is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 3, or (at your option) any later ver- -- +-- sion. This software is distributed in the hope that it will be useful, -- +-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- -- +-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -- +-- License for more details. You should have received a copy of the GNU -- +-- General Public License distributed with this software; see file -- +-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy -- +-- of the license. -- +------------------------------------------------------------------------------ + +with Ada.Unchecked_Conversion; + +package body LSP.Known_Requests is + + type Request_Constant_Access is + access constant LSP.Server_Requests.Server_Request'Class; + + function Cast is new Ada.Unchecked_Conversion + (Request_Constant_Access, Request_Access); + + ----------------------------------- + -- On_CancelRequest_Notification -- + ----------------------------------- + + overriding procedure On_CancelRequest_Notification + (Self : in out Visitor; + Value : LSP.Structures.CancelParams) + is + Cursor : constant Request_Maps.Cursor := Self.Parent.Map.Find (Value.id); + begin + if Request_Maps.Has_Element (Cursor) then + Request_Maps.Element (Cursor).Canceled := True; + end if; + end On_CancelRequest_Notification; + + ---------------------------- + -- On_Server_Notification -- + ---------------------------- + + overriding procedure On_Server_Notification + (Self : in out Visitor; + Value : LSP.Server_Notifications.Server_Notification'Class) is + begin + Value.Visit_Server_Receiver (Self); + end On_Server_Notification; + + ----------------------- + -- On_Server_Request -- + ----------------------- + + overriding procedure On_Server_Request + (Self : in out Visitor; + Value : LSP.Server_Requests.Server_Request'Class) is + begin + Self.Parent.Map.Insert (Value.Id, Cast (Value'Unchecked_Access)); + end On_Server_Request; + + --------------------- + -- Process_Message -- + --------------------- + + procedure Process_Message + (Self : in out Known_Request_Map; + Message : in out LSP.Server_Messages.Server_Message'Class) is + begin + Message.Visit_Server_Message_Visitor (Self.Visitor); + end Process_Message; + + -------------------- + -- Remove_Request -- + -------------------- + + procedure Remove_Request + (Self : in out Known_Request_Map; + Id : LSP.Structures.Integer_Or_Virtual_String) is + begin + Self.Map.Exclude (Id); + end Remove_Request; + +end LSP.Known_Requests; diff --git a/source/server/lsp-known_requests.ads b/source/server/lsp-known_requests.ads new file mode 100644 index 000000000..06f0cd7b9 --- /dev/null +++ b/source/server/lsp-known_requests.ads @@ -0,0 +1,90 @@ +------------------------------------------------------------------------------ +-- Language Server Protocol -- +-- -- +-- Copyright (C) 2022-2023, AdaCore -- +-- -- +-- This is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 3, or (at your option) any later ver- -- +-- sion. This software is distributed in the hope that it will be useful, -- +-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- -- +-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -- +-- License for more details. You should have received a copy of the GNU -- +-- General Public License distributed with this software; see file -- +-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy -- +-- of the license. -- +------------------------------------------------------------------------------ + +with Ada.Containers.Hashed_Maps; + +with VSS.Strings.Hash; + +with LSP.Server_Message_Visitors; +with LSP.Server_Messages; +with LSP.Server_Notification_Receivers; +with LSP.Server_Notifications; +with LSP.Server_Requests; +with LSP.Structures; + +package LSP.Known_Requests is + + type Known_Request_Map is tagged limited private; + + procedure Process_Message + (Self : in out Known_Request_Map; + Message : in out LSP.Server_Messages.Server_Message'Class); + -- If Message is a request, then keep the request for futher cancelation. + -- If Message is a cancel request notification, then find the corresponding + -- request and mark it as canceled. + + procedure Remove_Request + (Self : in out Known_Request_Map; + Id : LSP.Structures.Integer_Or_Virtual_String); + -- Remove request with given Id from the map + +private + + type Visitor (Parent : not null access Known_Request_Map) is + limited new LSP.Server_Message_Visitors.Server_Message_Visitor + and LSP.Server_Notification_Receivers.Server_Notification_Receiver + with null record; + + overriding procedure On_Server_Notification + (Self : in out Visitor; + Value : LSP.Server_Notifications.Server_Notification'Class); + + overriding procedure On_Server_Request + (Self : in out Visitor; + Value : LSP.Server_Requests.Server_Request'Class); + + overriding procedure On_CancelRequest_Notification + (Self : in out Visitor; + Value : LSP.Structures.CancelParams); + + function Hash + (Value : LSP.Structures.Integer_Or_Virtual_String) + return Ada.Containers.Hash_Type is + (case Value.Is_Integer is + when True => + Ada.Containers.Hash_Type'Mod (Value.Integer), + when False => + VSS.Strings.Hash (Value.Virtual_String)); + + type Request_Access is + access all LSP.Server_Requests.Server_Request'Class; + + package Request_Maps is new Ada.Containers.Hashed_Maps + (Key_Type => LSP.Structures.Integer_Or_Virtual_String, -- id + Element_Type => Request_Access, + Hash => Hash, + Equivalent_Keys => LSP.Structures."=", + "=" => "="); + + type Known_Request_Map is tagged limited record + Visitor : LSP.Known_Requests.Visitor + (Known_Request_Map'Unchecked_Access); + + Map : Request_Maps.Map; + end record; + +end LSP.Known_Requests; From f3f5c2ee1e162ecb331e98d21fd5bc82bf49718d Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Wed, 9 Aug 2023 10:31:55 +0300 Subject: [PATCH 008/152] Move unimplemented request logic into a dedicated type Refs #1170 --- source/ada/lsp-ada_driver.adb | 4 +- source/ada/lsp-ada_handlers.adb | 25 +- source/ada/lsp-ada_handlers.ads | 18 +- source/server/lsp-unimplemented_handlers.adb | 733 +++++++++++++++++++ source/server/lsp-unimplemented_handlers.ads | 286 ++++++++ 5 files changed, 1060 insertions(+), 6 deletions(-) create mode 100644 source/server/lsp-unimplemented_handlers.adb create mode 100644 source/server/lsp-unimplemented_handlers.ads diff --git a/source/ada/lsp-ada_driver.adb b/source/ada/lsp-ada_driver.adb index d400609eb..01725b1c3 100644 --- a/source/ada/lsp-ada_driver.adb +++ b/source/ada/lsp-ada_driver.adb @@ -62,9 +62,9 @@ procedure LSP.Ada_Driver is Server : aliased LSP.Servers.Server; Stream : aliased LSP.Stdio_Streams.Stdio_Stream; Ada_Handler : aliased LSP.Ada_Handlers.Message_Handler - (Server'Access); + (Server'Access, Tracer'Unchecked_Access); GPR_Handler : aliased LSP.Ada_Handlers.Message_Handler - (Server'Access); + (Server'Access, Tracer'Unchecked_Access); Fuzzing_Activated : constant Boolean := not VSS.Application.System_Environment.Value ("ALS_FUZZING").Is_Empty; diff --git a/source/ada/lsp-ada_handlers.adb b/source/ada/lsp-ada_handlers.adb index 0119b74c8..d0738f046 100644 --- a/source/ada/lsp-ada_handlers.adb +++ b/source/ada/lsp-ada_handlers.adb @@ -15,6 +15,10 @@ -- of the license. -- ------------------------------------------------------------------------------ +with Ada.Exceptions; + +with VSS.Strings.Conversions; + with LSP.Enumerations; package body LSP.Ada_Handlers is @@ -27,7 +31,7 @@ package body LSP.Ada_Handlers is (Self : in out Message_Handler; Value : LSP.Server_Requests.Server_Request'Class) is begin - Self.Implemented := False; + Self.Implemented := True; Value.Visit_Server_Receiver (Self); @@ -37,6 +41,25 @@ package body LSP.Ada_Handlers is (code => LSP.Enumerations.MethodNotFound, message => "Not implemented")); end if; + + exception + when E : others => + declare + Message : constant VSS.Strings.Virtual_String := + VSS.Strings.Conversions.To_Virtual_String + ("Exception: " & + Ada.Exceptions.Exception_Name (E) & " (" & + Ada.Exceptions.Exception_Message (E) & ")"); + + begin + Self.Tracer.Trace_Exception (E, "On_Server_Request"); + + Self.Client.On_Error_Response + (Value.Id, + (code => LSP.Enumerations.InternalError, + message => Message)); + + end; end On_Server_Request; end LSP.Ada_Handlers; diff --git a/source/ada/lsp-ada_handlers.ads b/source/ada/lsp-ada_handlers.ads index 35935b302..0cd5c902e 100644 --- a/source/ada/lsp-ada_handlers.ads +++ b/source/ada/lsp-ada_handlers.ads @@ -22,17 +22,29 @@ with LSP.Client_Message_Receivers; with LSP.Server_Request_Receivers; with LSP.Server_Message_Visitors; with LSP.Server_Requests; +with LSP.Unimplemented_Handlers; +with LSP.Tracers; package LSP.Ada_Handlers is type Message_Handler (Client : not null access LSP.Client_Message_Receivers - .Client_Message_Receiver'Class) is limited + .Client_Message_Receiver'Class; + Tracer : not null LSP.Tracers.Tracer_Access) is limited new LSP.Server_Message_Visitors.Server_Message_Visitor and LSP.Server_Request_Receivers.Server_Request_Receiver + with private; + +private + + type Message_Handler + (Client : not null access LSP.Client_Message_Receivers + .Client_Message_Receiver'Class; + Tracer : not null LSP.Tracers.Tracer_Access) is limited + new LSP.Unimplemented_Handlers.Unimplemented_Handler + and LSP.Server_Message_Visitors.Server_Message_Visitor with record - Implemented : Boolean; - -- A flag to check if a request was handled + null; end record; overriding procedure On_Server_Request diff --git a/source/server/lsp-unimplemented_handlers.adb b/source/server/lsp-unimplemented_handlers.adb new file mode 100644 index 000000000..78e5844cc --- /dev/null +++ b/source/server/lsp-unimplemented_handlers.adb @@ -0,0 +1,733 @@ +------------------------------------------------------------------------------ +-- Language Server Protocol -- +-- -- +-- Copyright (C) 2018-2023, AdaCore -- +-- -- +-- This is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 3, or (at your option) any later ver- -- +-- sion. This software is distributed in the hope that it will be useful, -- +-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- -- +-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -- +-- License for more details. You should have received a copy of the GNU -- +-- General Public License distributed with this software; see file -- +-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy -- +-- of the license. -- +------------------------------------------------------------------------------ + +package body LSP.Unimplemented_Handlers is + + ------------------------------------ + -- On_Code_Action_Resolve_Request -- + ------------------------------------ + + overriding procedure On_Code_Action_Resolve_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CodeAction) + is + begin + Self.Implemented := False; + + end On_Code_Action_Resolve_Request; + + ---------------------------------- + -- On_Code_Lens_Resolve_Request -- + ---------------------------------- + + overriding procedure On_Code_Lens_Resolve_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CodeLens) + is + begin + Self.Implemented := False; + + end On_Code_Lens_Resolve_Request; + + --------------------------- + -- On_CodeAction_Request -- + --------------------------- + + overriding procedure On_CodeAction_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CodeActionParams) + is + begin + Self.Implemented := False; + + end On_CodeAction_Request; + + ------------------------- + -- On_CodeLens_Request -- + ------------------------- + + overriding procedure On_CodeLens_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CodeLensParams) + is + begin + Self.Implemented := False; + + end On_CodeLens_Request; + + ---------------------------------- + -- On_ColorPresentation_Request -- + ---------------------------------- + + overriding procedure On_ColorPresentation_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ColorPresentationParams) + is + begin + Self.Implemented := False; + + end On_ColorPresentation_Request; + + --------------------------- + -- On_Completion_Request -- + --------------------------- + + overriding procedure On_Completion_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CompletionParams) + is + begin + Self.Implemented := False; + + end On_Completion_Request; + + ----------------------------------- + -- On_Completion_Resolve_Request -- + ----------------------------------- + + overriding procedure On_Completion_Resolve_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CompletionItem) + is + begin + Self.Implemented := False; + + end On_Completion_Resolve_Request; + + ---------------------------- + -- On_Declaration_Request -- + ---------------------------- + + overriding procedure On_Declaration_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DeclarationParams) + is + begin + Self.Implemented := False; + + end On_Declaration_Request; + + --------------------------- + -- On_Definition_Request -- + --------------------------- + + overriding procedure On_Definition_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DefinitionParams) + is + begin + Self.Implemented := False; + + end On_Definition_Request; + + --------------------------- + -- On_Diagnostic_Request -- + --------------------------- + + overriding procedure On_Diagnostic_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentDiagnosticParams) + is + begin + Self.Implemented := False; + + end On_Diagnostic_Request; + + ------------------------------ + -- On_DocumentColor_Request -- + ------------------------------ + + overriding procedure On_DocumentColor_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentColorParams) + is + begin + Self.Implemented := False; + + end On_DocumentColor_Request; + + ---------------------------------- + -- On_DocumentHighlight_Request -- + ---------------------------------- + + overriding procedure On_DocumentHighlight_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentHighlightParams) + is + begin + Self.Implemented := False; + + end On_DocumentHighlight_Request; + + ----------------------------- + -- On_DocumentLink_Request -- + ----------------------------- + + overriding procedure On_DocumentLink_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentLinkParams) + is + begin + Self.Implemented := False; + + end On_DocumentLink_Request; + + ------------------------------- + -- On_DocumentSymbol_Request -- + ------------------------------- + + overriding procedure On_DocumentSymbol_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentSymbolParams) + is + begin + Self.Implemented := False; + + end On_DocumentSymbol_Request; + + ------------------------------- + -- On_ExecuteCommand_Request -- + ------------------------------- + + overriding procedure On_ExecuteCommand_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ExecuteCommandParams) + is + begin + Self.Implemented := False; + + end On_ExecuteCommand_Request; + + ----------------------------- + -- On_FoldingRange_Request -- + ----------------------------- + + overriding procedure On_FoldingRange_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.FoldingRangeParams) + is + begin + Self.Implemented := False; + + end On_FoldingRange_Request; + + --------------------------- + -- On_Formatting_Request -- + --------------------------- + + overriding procedure On_Formatting_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentFormattingParams) + is + begin + Self.Implemented := False; + + end On_Formatting_Request; + + --------------------- + -- On_Full_Request -- + --------------------- + + overriding procedure On_Full_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SemanticTokensParams) + is + begin + Self.Implemented := False; + + end On_Full_Request; + + ---------------------- + -- On_Hover_Request -- + ---------------------- + + overriding procedure On_Hover_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.HoverParams) + is + begin + Self.Implemented := False; + + end On_Hover_Request; + + ------------------------------- + -- On_Implementation_Request -- + ------------------------------- + + overriding procedure On_Implementation_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ImplementationParams) + is + begin + Self.Implemented := False; + + end On_Implementation_Request; + + ------------------------------ + -- On_IncomingCalls_Request -- + ------------------------------ + + overriding procedure On_IncomingCalls_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CallHierarchyIncomingCallsParams) + is + begin + Self.Implemented := False; + + end On_IncomingCalls_Request; + + --------------------------- + -- On_Initialize_Request -- + --------------------------- + + overriding procedure On_Initialize_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InitializeParams) + is + begin + Self.Implemented := False; + + end On_Initialize_Request; + + ------------------------------ + -- On_Inlay_Resolve_Request -- + ------------------------------ + + overriding procedure On_Inlay_Resolve_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InlayHint) + is + begin + Self.Implemented := False; + + end On_Inlay_Resolve_Request; + + -------------------------- + -- On_InlayHint_Request -- + -------------------------- + + overriding procedure On_InlayHint_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InlayHintParams) + is + begin + Self.Implemented := False; + + end On_InlayHint_Request; + + ---------------------------- + -- On_InlineValue_Request -- + ---------------------------- + + overriding procedure On_InlineValue_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InlineValueParams) + is + begin + Self.Implemented := False; + + end On_InlineValue_Request; + + ----------------------------- + -- On_Link_Resolve_Request -- + ----------------------------- + + overriding procedure On_Link_Resolve_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentLink) + is + begin + Self.Implemented := False; + + end On_Link_Resolve_Request; + + ----------------------------------- + -- On_LinkedEditingRange_Request -- + ----------------------------------- + + overriding procedure On_LinkedEditingRange_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.LinkedEditingRangeParams) + is + begin + Self.Implemented := False; + + end On_LinkedEditingRange_Request; + + ------------------------ + -- On_Moniker_Request -- + ------------------------ + + overriding procedure On_Moniker_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.MonikerParams) + is + begin + Self.Implemented := False; + + end On_Moniker_Request; + + --------------------------------- + -- On_OnTypeFormatting_Request -- + --------------------------------- + + overriding procedure On_OnTypeFormatting_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentOnTypeFormattingParams) + is + begin + Self.Implemented := False; + + end On_OnTypeFormatting_Request; + + ------------------------------ + -- On_OutgoingCalls_Request -- + ------------------------------ + + overriding procedure On_OutgoingCalls_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CallHierarchyOutgoingCallsParams) + is + begin + Self.Implemented := False; + + end On_OutgoingCalls_Request; + + ------------------------------------- + -- On_PrepareCallHierarchy_Request -- + ------------------------------------- + + overriding procedure On_PrepareCallHierarchy_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CallHierarchyPrepareParams) + is + begin + Self.Implemented := False; + + end On_PrepareCallHierarchy_Request; + + ------------------------------ + -- On_PrepareRename_Request -- + ------------------------------ + + overriding procedure On_PrepareRename_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.PrepareRenameParams) + is + begin + Self.Implemented := False; + + end On_PrepareRename_Request; + + ------------------------------------- + -- On_PrepareTypeHierarchy_Request -- + ------------------------------------- + + overriding procedure On_PrepareTypeHierarchy_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TypeHierarchyPrepareParams) + is + begin + Self.Implemented := False; + + end On_PrepareTypeHierarchy_Request; + + -------------------------------- + -- On_RangeFormatting_Request -- + -------------------------------- + + overriding procedure On_RangeFormatting_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentRangeFormattingParams) + is + begin + Self.Implemented := False; + + end On_RangeFormatting_Request; + + --------------------------- + -- On_References_Request -- + --------------------------- + + overriding procedure On_References_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ReferenceParams) + is + begin + Self.Implemented := False; + + end On_References_Request; + + ----------------------- + -- On_Rename_Request -- + ----------------------- + + overriding procedure On_Rename_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.RenameParams) + is + begin + Self.Implemented := False; + + end On_Rename_Request; + + ------------------------------- + -- On_SelectionRange_Request -- + ------------------------------- + + overriding procedure On_SelectionRange_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SelectionRangeParams) + is + begin + Self.Implemented := False; + + end On_SelectionRange_Request; + + ------------------------- + -- On_Shutdown_Request -- + ------------------------- + + overriding procedure On_Shutdown_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String) + is + begin + Self.Implemented := False; + + end On_Shutdown_Request; + + ------------------------------ + -- On_SignatureHelp_Request -- + ------------------------------ + + overriding procedure On_SignatureHelp_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SignatureHelpParams) + is + begin + Self.Implemented := False; + + end On_SignatureHelp_Request; + + ------------------------- + -- On_Subtypes_Request -- + ------------------------- + + overriding procedure On_Subtypes_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TypeHierarchySubtypesParams) + is + begin + Self.Implemented := False; + + end On_Subtypes_Request; + + --------------------------- + -- On_Supertypes_Request -- + --------------------------- + + overriding procedure On_Supertypes_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TypeHierarchySupertypesParams) + is + begin + Self.Implemented := False; + + end On_Supertypes_Request; + + ----------------------- + -- On_Symbol_Request -- + ----------------------- + + overriding procedure On_Symbol_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceSymbolParams) + is + begin + Self.Implemented := False; + + end On_Symbol_Request; + + ------------------------------- + -- On_Symbol_Resolve_Request -- + ------------------------------- + + overriding procedure On_Symbol_Resolve_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceSymbol) + is + begin + Self.Implemented := False; + + end On_Symbol_Resolve_Request; + + ----------------------------- + -- On_Tokens_Delta_Request -- + ----------------------------- + + overriding procedure On_Tokens_Delta_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SemanticTokensDeltaParams) + is + begin + Self.Implemented := False; + + end On_Tokens_Delta_Request; + + ----------------------------- + -- On_Tokens_Range_Request -- + ----------------------------- + + overriding procedure On_Tokens_Range_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SemanticTokensRangeParams) + is + begin + Self.Implemented := False; + + end On_Tokens_Range_Request; + + ------------------------------- + -- On_TypeDefinition_Request -- + ------------------------------- + + overriding procedure On_TypeDefinition_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TypeDefinitionParams) + is + begin + Self.Implemented := False; + + end On_TypeDefinition_Request; + + -------------------------------- + -- On_WillCreateFiles_Request -- + -------------------------------- + + overriding procedure On_WillCreateFiles_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CreateFilesParams) + is + begin + Self.Implemented := False; + + end On_WillCreateFiles_Request; + + -------------------------------- + -- On_WillDeleteFiles_Request -- + -------------------------------- + + overriding procedure On_WillDeleteFiles_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DeleteFilesParams) + is + begin + Self.Implemented := False; + + end On_WillDeleteFiles_Request; + + -------------------------------- + -- On_WillRenameFiles_Request -- + -------------------------------- + + overriding procedure On_WillRenameFiles_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.RenameFilesParams) + is + begin + Self.Implemented := False; + + end On_WillRenameFiles_Request; + + ---------------------------------- + -- On_WillSaveWaitUntil_Request -- + ---------------------------------- + + overriding procedure On_WillSaveWaitUntil_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WillSaveTextDocumentParams) + is + begin + Self.Implemented := False; + + end On_WillSaveWaitUntil_Request; + + ------------------------------------- + -- On_Workspace_Diagnostic_Request -- + ------------------------------------- + + overriding procedure On_Workspace_Diagnostic_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceDiagnosticParams) + is + begin + Self.Implemented := False; + + end On_Workspace_Diagnostic_Request; + +end LSP.Unimplemented_Handlers; diff --git a/source/server/lsp-unimplemented_handlers.ads b/source/server/lsp-unimplemented_handlers.ads new file mode 100644 index 000000000..e534e013e --- /dev/null +++ b/source/server/lsp-unimplemented_handlers.ads @@ -0,0 +1,286 @@ +------------------------------------------------------------------------------ +-- Language Server Protocol -- +-- -- +-- Copyright (C) 2018-2023, AdaCore -- +-- -- +-- This is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 3, or (at your option) any later ver- -- +-- sion. This software is distributed in the hope that it will be useful, -- +-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- -- +-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -- +-- License for more details. You should have received a copy of the GNU -- +-- General Public License distributed with this software; see file -- +-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy -- +-- of the license. -- +------------------------------------------------------------------------------ +-- +-- This package provides requests handler that tracks unimplemented requests. + +with LSP.Server_Request_Receivers; +with LSP.Structures; + +package LSP.Unimplemented_Handlers is + + type Unimplemented_Handler is limited + new LSP.Server_Request_Receivers.Server_Request_Receiver + with record + Implemented : Boolean; + -- A flag to check if a request was handled + end record; + + overriding procedure On_IncomingCalls_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CallHierarchyIncomingCallsParams); + + overriding procedure On_OutgoingCalls_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CallHierarchyOutgoingCallsParams); + + overriding procedure On_Code_Action_Resolve_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CodeAction); + + overriding procedure On_Code_Lens_Resolve_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CodeLens); + + overriding procedure On_Completion_Resolve_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CompletionItem); + + overriding procedure On_Link_Resolve_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentLink); + + overriding procedure On_Initialize_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InitializeParams); + + overriding procedure On_Inlay_Resolve_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InlayHint); + + overriding procedure On_Shutdown_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String); + + overriding procedure On_CodeAction_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CodeActionParams); + + overriding procedure On_CodeLens_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CodeLensParams); + + overriding procedure On_ColorPresentation_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ColorPresentationParams); + + overriding procedure On_Completion_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CompletionParams); + + overriding procedure On_Declaration_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DeclarationParams); + + overriding procedure On_Definition_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DefinitionParams); + + overriding procedure On_Diagnostic_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentDiagnosticParams); + + overriding procedure On_DocumentColor_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentColorParams); + + overriding procedure On_DocumentHighlight_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentHighlightParams); + + overriding procedure On_DocumentLink_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentLinkParams); + + overriding procedure On_DocumentSymbol_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentSymbolParams); + + overriding procedure On_FoldingRange_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.FoldingRangeParams); + + overriding procedure On_Formatting_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentFormattingParams); + + overriding procedure On_Hover_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.HoverParams); + + overriding procedure On_Implementation_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ImplementationParams); + + overriding procedure On_InlayHint_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InlayHintParams); + + overriding procedure On_InlineValue_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InlineValueParams); + + overriding procedure On_LinkedEditingRange_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.LinkedEditingRangeParams); + + overriding procedure On_Moniker_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.MonikerParams); + + overriding procedure On_OnTypeFormatting_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentOnTypeFormattingParams); + + overriding procedure On_PrepareCallHierarchy_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CallHierarchyPrepareParams); + + overriding procedure On_PrepareRename_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.PrepareRenameParams); + + overriding procedure On_PrepareTypeHierarchy_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TypeHierarchyPrepareParams); + + overriding procedure On_RangeFormatting_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentRangeFormattingParams); + + overriding procedure On_References_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ReferenceParams); + + overriding procedure On_Rename_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.RenameParams); + + overriding procedure On_SelectionRange_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SelectionRangeParams); + + overriding procedure On_Full_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SemanticTokensParams); + + overriding procedure On_Tokens_Delta_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SemanticTokensDeltaParams); + + overriding procedure On_Tokens_Range_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SemanticTokensRangeParams); + + overriding procedure On_SignatureHelp_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SignatureHelpParams); + + overriding procedure On_TypeDefinition_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TypeDefinitionParams); + + overriding procedure On_WillSaveWaitUntil_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WillSaveTextDocumentParams); + + overriding procedure On_Subtypes_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TypeHierarchySubtypesParams); + + overriding procedure On_Supertypes_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TypeHierarchySupertypesParams); + + overriding procedure On_Workspace_Diagnostic_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceDiagnosticParams); + + overriding procedure On_ExecuteCommand_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ExecuteCommandParams); + + overriding procedure On_Symbol_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceSymbolParams); + + overriding procedure On_WillCreateFiles_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CreateFilesParams); + + overriding procedure On_WillDeleteFiles_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DeleteFilesParams); + + overriding procedure On_WillRenameFiles_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.RenameFilesParams); + + overriding procedure On_Symbol_Resolve_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceSymbol); + +end LSP.Unimplemented_Handlers; From 826e0e872c2f182d9a23e294cfd421e43f8baa20 Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Wed, 9 Aug 2023 14:12:29 +0300 Subject: [PATCH 009/152] Add initialization request handler. Keep client capabilities in a dedicated object. Create a function to map client capabilities and configuration options to server capabilities. Refs #1170 --- source/ada/lsp-ada_client_capabilities.adb | 68 ++++++++++++++++++++++ source/ada/lsp-ada_client_capabilities.ads | 57 ++++++++++++++++++ source/ada/lsp-ada_driver.adb | 10 ++++ source/ada/lsp-ada_handlers.adb | 34 ++++++++++- source/ada/lsp-ada_handlers.ads | 36 +++++++----- 5 files changed, 187 insertions(+), 18 deletions(-) create mode 100644 source/ada/lsp-ada_client_capabilities.adb create mode 100644 source/ada/lsp-ada_client_capabilities.ads diff --git a/source/ada/lsp-ada_client_capabilities.adb b/source/ada/lsp-ada_client_capabilities.adb new file mode 100644 index 000000000..59b6d5f49 --- /dev/null +++ b/source/ada/lsp-ada_client_capabilities.adb @@ -0,0 +1,68 @@ +------------------------------------------------------------------------------ +-- Language Server Protocol -- +-- -- +-- Copyright (C) 2018-2023, AdaCore -- +-- -- +-- This is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 3, or (at your option) any later ver- -- +-- sion. This software is distributed in the hope that it will be useful, -- +-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- -- +-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -- +-- License for more details. You should have received a copy of the GNU -- +-- General Public License distributed with this software; see file -- +-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy -- +-- of the license. -- +------------------------------------------------------------------------------ + +with LSP.Enumerations; + +package body LSP.Ada_Client_Capabilities is + + ---------------- + -- Initialize -- + ---------------- + + procedure Initialize + (Self : in out Client_Capability'Class; + Value : LSP.Structures.InitializeParams) is + begin + Self.Value := Value; + + if Value.rootUri.Is_Null + and then Value.rootPath.Is_Set + and then not Value.rootPath.Value.Is_Null + then + -- URI isn't provided, rollback to deprecated rootPath + Self.Root := Value.rootPath.Value.Value; + elsif not Value.rootUri.Is_Null then + Self.Root := VSS.Strings.Virtual_String (Value.rootUri.Value); + end if; + end Initialize; + + ---------------------------- + -- To_Server_Capabilities -- + ---------------------------- + + function To_Server_Capabilities + (Self : Client_Capability'Class; + Incremental_Text_Changes : Boolean) + return LSP.Structures.ServerCapabilities + is + pragma Unreferenced (Self); + begin + return Result : LSP.Structures.ServerCapabilities do + + Result.textDocumentSync := + (Is_Set => True, + Value => + (Is_TextDocumentSyncOptions => False, + TextDocumentSyncKind => + (if Incremental_Text_Changes then + LSP.Enumerations.Incremental + else + LSP.Enumerations.Full))); + end return; + end To_Server_Capabilities; + +end LSP.Ada_Client_Capabilities; diff --git a/source/ada/lsp-ada_client_capabilities.ads b/source/ada/lsp-ada_client_capabilities.ads new file mode 100644 index 000000000..80b76c42c --- /dev/null +++ b/source/ada/lsp-ada_client_capabilities.ads @@ -0,0 +1,57 @@ +------------------------------------------------------------------------------ +-- Language Server Protocol -- +-- -- +-- Copyright (C) 2018-2023, AdaCore -- +-- -- +-- This is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 3, or (at your option) any later ver- -- +-- sion. This software is distributed in the hope that it will be useful, -- +-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- -- +-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -- +-- License for more details. You should have received a copy of the GNU -- +-- General Public License distributed with this software; see file -- +-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy -- +-- of the license. -- +------------------------------------------------------------------------------ + +with VSS.Strings; + +with LSP.Structures; + +package LSP.Ada_Client_Capabilities is + pragma Preelaborate; + + type Client_Capability is tagged limited private; + -- This type holds client initialization response and provides handy + -- queries on the client capabilities + + procedure Initialize + (Self : in out Client_Capability'Class; + Value : LSP.Structures.InitializeParams); + -- Save initialze parameters + + function To_Server_Capabilities + (Self : Client_Capability'Class; + Incremental_Text_Changes : Boolean) + return LSP.Structures.ServerCapabilities; + -- Calculate server capabilities by client Capability and configuation + -- options. + + function Root (Self : Client_Capability'Class) + return VSS.Strings.Virtual_String; + -- rootUri (or rootPath) + -- if not rootUri/rootPath is provided, then it means no folder is open. + -- Return an empty string in this case. + +private + + type Client_Capability is tagged limited record + Value : LSP.Structures.InitializeParams; + Root : VSS.Strings.Virtual_String; + end record; + + function Root (Self : Client_Capability'Class) + return VSS.Strings.Virtual_String is (Self.Root); + +end LSP.Ada_Client_Capabilities; diff --git a/source/ada/lsp-ada_driver.adb b/source/ada/lsp-ada_driver.adb index 01725b1c3..a775656ea 100644 --- a/source/ada/lsp-ada_driver.adb +++ b/source/ada/lsp-ada_driver.adb @@ -226,6 +226,16 @@ begin Ada.Text_IO.Set_Output (Ada.Text_IO.Standard_Error); -- Protect stdout from pollution by accidental Put_Line calls + declare + Allow_Incremental_Text_Changes : constant GNATCOLL.Traces.Trace_Handle + := GNATCOLL.Traces.Create ("ALS.ALLOW_INCREMENTAL_TEXT_CHANGES", + GNATCOLL.Traces.On); + -- Trace to activate the support for incremental text changes. + begin + Ada_Handler.Initialize + (Incremental_Text_Changes => Allow_Incremental_Text_Changes.Is_Active); + end; + Server.Initialize (Stream'Unchecked_Access); begin diff --git a/source/ada/lsp-ada_handlers.adb b/source/ada/lsp-ada_handlers.adb index d0738f046..65b6d4e34 100644 --- a/source/ada/lsp-ada_handlers.adb +++ b/source/ada/lsp-ada_handlers.adb @@ -23,6 +23,36 @@ with LSP.Enumerations; package body LSP.Ada_Handlers is + ---------------- + -- Initialize -- + ---------------- + + procedure Initialize + (Self : in out Message_Handler'Class; + Incremental_Text_Changes : Boolean) is + begin + Self.Incremental_Text_Changes := Incremental_Text_Changes; + end Initialize; + + --------------------------- + -- On_Initialize_Request -- + --------------------------- + + overriding procedure On_Initialize_Request + (Self : in out Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InitializeParams) + is + Response : LSP.Structures.InitializeResult; + begin + Self.Client.Initialize (Value); + + Response.capabilities := Self.Client.To_Server_Capabilities + (Incremental_Text_Changes => Self.Incremental_Text_Changes); + + Self.Sender.On_Initialize_Response (Id, Response); + end On_Initialize_Request; + ----------------------- -- On_Server_Request -- ----------------------- @@ -36,7 +66,7 @@ package body LSP.Ada_Handlers is Value.Visit_Server_Receiver (Self); if not Self.Implemented then - Self.Client.On_Error_Response + Self.Sender.On_Error_Response (Value.Id, (code => LSP.Enumerations.MethodNotFound, message => "Not implemented")); @@ -54,7 +84,7 @@ package body LSP.Ada_Handlers is begin Self.Tracer.Trace_Exception (E, "On_Server_Request"); - Self.Client.On_Error_Response + Self.Sender.On_Error_Response (Value.Id, (code => LSP.Enumerations.InternalError, message => Message)); diff --git a/source/ada/lsp-ada_handlers.ads b/source/ada/lsp-ada_handlers.ads index 0cd5c902e..03e3767b1 100644 --- a/source/ada/lsp-ada_handlers.ads +++ b/source/ada/lsp-ada_handlers.ads @@ -18,49 +18,53 @@ -- This package provides requests and notifications handler for Ada -- language. +with LSP.Ada_Client_Capabilities; with LSP.Client_Message_Receivers; -with LSP.Server_Request_Receivers; with LSP.Server_Message_Visitors; +with LSP.Server_Request_Receivers; with LSP.Server_Requests; -with LSP.Unimplemented_Handlers; +with LSP.Structures; with LSP.Tracers; +with LSP.Unimplemented_Handlers; package LSP.Ada_Handlers is type Message_Handler - (Client : not null access LSP.Client_Message_Receivers + (Sender : not null access LSP.Client_Message_Receivers .Client_Message_Receiver'Class; Tracer : not null LSP.Tracers.Tracer_Access) is limited new LSP.Server_Message_Visitors.Server_Message_Visitor and LSP.Server_Request_Receivers.Server_Request_Receiver with private; + procedure Initialize + (Self : in out Message_Handler'Class; + Incremental_Text_Changes : Boolean); + -- Initialize the message handler and configure it. + -- + -- Incremental_Text_Changes - activate the support for incremental text + -- changes. + private type Message_Handler - (Client : not null access LSP.Client_Message_Receivers + (Sender : not null access LSP.Client_Message_Receivers .Client_Message_Receiver'Class; Tracer : not null LSP.Tracers.Tracer_Access) is limited new LSP.Unimplemented_Handlers.Unimplemented_Handler and LSP.Server_Message_Visitors.Server_Message_Visitor with record - null; + Client : LSP.Ada_Client_Capabilities.Client_Capability; + Incremental_Text_Changes : Boolean; end record; overriding procedure On_Server_Request (Self : in out Message_Handler; Value : LSP.Server_Requests.Server_Request'Class); - procedure Publish_Diagnostics - (Self : access Message_Handler'Class; - Document : not null LSP.Ada_Documents.Document_Access; - Other_Diagnostics : LSP.Messages.Diagnostic_Vector := - LSP.Messages.Diagnostic_Vectors.Empty; - Force : Boolean := False); - -- Publish diagnostic messages for given document if needed. - -- Other_Diagnostics can be used to specify punctual diagnostics not coming - -- from sources that analyze files when being opened or modified. - -- When Force is True, the diagnostics will always be sent, not matter if - -- they have changed or not. + overriding procedure On_Initialize_Request + (Self : in out Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InitializeParams); end LSP.Ada_Handlers; From f09bfa7f46e44b01e6c9801eeac1c8dc36a8fe83 Mon Sep 17 00:00:00 2001 From: Vadim Godunko Date: Mon, 14 Aug 2023 16:48:02 +0400 Subject: [PATCH 010/152] Add 'shutdown' request. --- source/ada/lsp-ada_handlers.adb | 17 +++++++++++++++++ source/ada/lsp-ada_handlers.ads | 8 ++++++++ 2 files changed, 25 insertions(+) diff --git a/source/ada/lsp-ada_handlers.adb b/source/ada/lsp-ada_handlers.adb index 65b6d4e34..89130da1e 100644 --- a/source/ada/lsp-ada_handlers.adb +++ b/source/ada/lsp-ada_handlers.adb @@ -92,4 +92,21 @@ package body LSP.Ada_Handlers is end; end On_Server_Request; + ------------------------- + -- On_Shutdown_Request -- + ------------------------- + + overriding procedure On_Shutdown_Request + (Self : in out Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String) + is + Result : LSP.Structures.Null_Record; + + begin + -- Suspend files/runtime indexing after shutdown requst + Self.Indexing_Enabled := False; + + Self.Sender.On_Shutdown_Response (Id, Result); + end On_Shutdown_Request; + end LSP.Ada_Handlers; diff --git a/source/ada/lsp-ada_handlers.ads b/source/ada/lsp-ada_handlers.ads index 03e3767b1..cd5848d47 100644 --- a/source/ada/lsp-ada_handlers.ads +++ b/source/ada/lsp-ada_handlers.ads @@ -56,12 +56,20 @@ private with record Client : LSP.Ada_Client_Capabilities.Client_Capability; Incremental_Text_Changes : Boolean; + + Indexing_Enabled : Boolean := True; + -- Whether to index sources in the background. This should be True + -- for normal use, and can be disabled for debug or testing purposes. end record; overriding procedure On_Server_Request (Self : in out Message_Handler; Value : LSP.Server_Requests.Server_Request'Class); + overriding procedure On_Shutdown_Request + (Self : in out Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String); + overriding procedure On_Initialize_Request (Self : in out Message_Handler; Id : LSP.Structures.Integer_Or_Virtual_String; From 6193789160895e55353014dceaa4cb332e6aad7f Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Thu, 10 Aug 2023 12:49:19 +0300 Subject: [PATCH 011/152] Add configuration object for Ada message handler. Add didChangeConfiguration stub. Refs #1170 --- source/ada/lsp-ada_configurations.adb | 284 ++++++++++++++++++++++++++ source/ada/lsp-ada_configurations.ads | 171 ++++++++++++++++ source/ada/lsp-ada_handlers.adb | 34 +++ source/ada/lsp-ada_handlers.ads | 13 ++ 4 files changed, 502 insertions(+) create mode 100644 source/ada/lsp-ada_configurations.adb create mode 100644 source/ada/lsp-ada_configurations.ads diff --git a/source/ada/lsp-ada_configurations.adb b/source/ada/lsp-ada_configurations.adb new file mode 100644 index 000000000..093daefd1 --- /dev/null +++ b/source/ada/lsp-ada_configurations.adb @@ -0,0 +1,284 @@ +------------------------------------------------------------------------------ +-- Language Server Protocol -- +-- -- +-- Copyright (C) 2018-2023, AdaCore -- +-- -- +-- This is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 3, or (at your option) any later ver- -- +-- sion. This software is distributed in the hope that it will be useful, -- +-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- -- +-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -- +-- License for more details. You should have received a copy of the GNU -- +-- General Public License distributed with this software; see file -- +-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy -- +-- of the license. -- +------------------------------------------------------------------------------ + +pragma Ada_2022; + +with Ada.Containers.Generic_Anonymous_Array_Sort; + +with VSS.Strings.Conversions; +with VSS.JSON.Streams; + +package body LSP.Ada_Configurations is + + Doc_Style_Values : constant VSS.String_Vectors.Virtual_String_Vector := + [for Item in GNATdoc.Comments.Options.Documentation_Style => + VSS.Strings.To_Virtual_String (Item'Wide_Wide_Image).To_Lowercase]; + + --------------- + -- Read_JSON -- + --------------- + + procedure Read_JSON + (Self : in out Configuration'Class; + JSON : LSP.Structures.LSPAny; + Reload : out Boolean) + is + use all type VSS.JSON.JSON_Number_Kind; + use all type VSS.JSON.Streams.JSON_Stream_Element_Kind; + use type VSS.Strings.Virtual_String; + use type VSS.String_Vectors.Virtual_String_Vector; + + Index : Positive := JSON.First_Index; + Variables_Names : VSS.String_Vectors.Virtual_String_Vector; + Variables_Values : VSS.String_Vectors.Virtual_String_Vector; + + procedure Swap_Variables (Left, Right : Positive); + + procedure Parse_Ada; + procedure Skip_Value; + procedure Set + (Target : in out VSS.Strings.Virtual_String; + Value : VSS.Strings.Virtual_String); + + --------------- + -- Parse_Ada -- + --------------- + + procedure Parse_Ada is + procedure Parse_Variables (From : Positive); + + procedure Parse_Variables (From : Positive) is + Name : VSS.Strings.Virtual_String; + Value : VSS.Strings.Virtual_String; + Index : Positive := From + 1; + begin + while Index <= JSON.Last_Index + and then JSON (Index).Kind = Key_Name + loop + Name := JSON (Index).Key_Name; + Index := Index + 1; + + Value := (if JSON (Index).Kind = String_Value + then JSON (Index).String_Value else ""); + + Index := Index + 1; + + Variables_Names.Append (Name); + Variables_Values.Append (Value); + end loop; + end Parse_Variables; + + Name : VSS.Strings.Virtual_String; + begin + Index := Index + 1; -- skip start object + + while Index <= JSON.Last_Index + and then JSON (Index).Kind = Key_Name + loop + Name := JSON (Index).Key_Name; + Index := Index + 1; + + if Name = "relocateBuildTree" + and then JSON (Index).Kind = String_Value + then + Set (Self.Relocate_Build_Tree, JSON (Index).String_Value); + + elsif Name = "rootDir" + and then JSON (Index).Kind = String_Value + then + Set (Self.Relocate_Root, JSON (Index).String_Value); + + elsif Name = "projectFile" + and then JSON (Index).Kind = String_Value + then + Set (Self.Project_File, JSON (Index).String_Value); + + elsif Name = "scenarioVariables" + and then JSON (Index).Kind = Start_Object + then + Parse_Variables (Index); + + elsif Name = "defaultCharset" + and then JSON (Index).Kind = String_Value + then + Set (Self.Charset, JSON (Index).String_Value); + + elsif Name = "enableDiagnostics" + and then JSON (Index).Kind = Boolean_Value + then + Self.Diagnostics_Enabled := JSON (Index).Boolean_Value; + + elsif Name = "enableIndexing" + and then JSON (Index).Kind = Boolean_Value + then + Self.Indexing_Enabled := JSON (Index).Boolean_Value; + + elsif Name = "renameInComments" + and then JSON (Index).Kind = Boolean_Value + then + Self.Rename_In_Comments := JSON (Index).Boolean_Value; + + elsif Name = "namedNotationThreshold" + and then JSON (Index).Kind = Number_Value + and then JSON (Index).Number_Value.Kind = JSON_Integer + then + Self.Named_Notation_Threshold := + Natural (JSON (Index).Number_Value.Integer_Value); + + elsif Name = "foldComments" + and then JSON (Index).Kind = Boolean_Value + then + Self.Folding_Comments := JSON (Index).Boolean_Value; + + elsif Name = "displayMethodAncestryOnNavigation" then + null; -- TBD + + elsif Name = "followSymlinks" + and then JSON (Index).Kind = Boolean_Value + then + Self.Follow_Symlinks := JSON (Index).Boolean_Value; + + elsif Name = "documentationStyle" + and then JSON (Index).Kind = String_Value + and then Doc_Style_Values.Contains (JSON (Index).String_Value) + then + Self.Documentation_Style := + GNATdoc.Comments.Options.Documentation_Style'Value + (VSS.Strings.Conversions.To_UTF_8_String + (JSON (Index).String_Value)); + + elsif Name = "useCompletionSnippets" + and then JSON (Index).Kind = Boolean_Value + then + Self.Use_Completion_Snippets := JSON (Index).Boolean_Value; + + elsif Name = "logThreshold" + and then JSON (Index).Kind = Number_Value + and then JSON (Index).Number_Value.Kind = JSON_Integer + then + Self.Log_Threshold := + Natural (JSON (Index).Number_Value.Integer_Value); + + elsif Name = "onTypeFormatting" + and then JSON (Index).Kind = Start_Object + then + Name := JSON (Index + 1).Key_Name; + + if Name = "indentOnly" + and then JSON (Index + 2).Kind = Boolean_Value + then + Self.Indent_Only := JSON (Index + 2).Boolean_Value; + + end if; + end if; + + Skip_Value; + end loop; + end Parse_Ada; + + --------- + -- Set -- + --------- + + procedure Set + (Target : in out VSS.Strings.Virtual_String; + Value : VSS.Strings.Virtual_String) is + begin + if Target /= Value then + Target := Value; + Reload := True; + end if; + end Set; + + ---------------- + -- Skip_Value -- + ---------------- + + procedure Skip_Value is + Level : Natural := 0; + begin + while Index <= JSON.Last_Index loop + Level := (case JSON (Index).Kind is + when Start_Object | Start_Array => Level + 1, + when End_Object | End_Array => Level - 1, + when others => Level); + + Index := Index + 1; + + exit when Level = 0; + end loop; + end Skip_Value; + + -------------------- + -- Swap_Variables -- + -------------------- + + procedure Swap_Variables (Left, Right : Positive) is + Name : constant VSS.Strings.Virtual_String := Variables_Names (Left); + + Value : constant VSS.Strings.Virtual_String := + Variables_Values (Left); + begin + Variables_Names.Replace (Left, Variables_Names (Right)); + Variables_Values.Replace (Left, Variables_Values (Right)); + Variables_Names.Replace (Right, Name); + Variables_Values.Replace (Right, Value); + end Swap_Variables; + + function Less (Left, Right : Positive) return Boolean is + (Variables_Names (Left) < Variables_Names (Right)); + + procedure Sort_Variables is + new Ada.Containers.Generic_Anonymous_Array_Sort + (Positive, Less, Swap_Variables); + begin + Reload := False; + + if JSON.Is_Empty or else JSON (Index).Kind /= Start_Object then + return; + else + Index := Index + 1; + end if; + + while Index <= JSON.Last_Index + and then JSON (Index).Kind = Key_Name + loop + declare + Is_Ada : constant Boolean := JSON (Index).Key_Name = "ada"; + begin + Index := Index + 1; + + if Is_Ada and then + Index <= JSON.Last_Index and then + JSON (Index).Kind = Start_Object + then + Parse_Ada; + else + Skip_Value; + end if; + end; + + end loop; + + Sort_Variables (1, Variables_Names.Length); + + Reload := Reload or else + Variables_Names /= Self.Variables_Names or else + Variables_Values /= Self.Variables_Values; + end Read_JSON; + +end LSP.Ada_Configurations; diff --git a/source/ada/lsp-ada_configurations.ads b/source/ada/lsp-ada_configurations.ads new file mode 100644 index 000000000..b48fba3f3 --- /dev/null +++ b/source/ada/lsp-ada_configurations.ads @@ -0,0 +1,171 @@ +------------------------------------------------------------------------------ +-- Language Server Protocol -- +-- -- +-- Copyright (C) 2018-2023, AdaCore -- +-- -- +-- This is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 3, or (at your option) any later ver- -- +-- sion. This software is distributed in the hope that it will be useful, -- +-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- -- +-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -- +-- License for more details. You should have received a copy of the GNU -- +-- General Public License distributed with this software; see file -- +-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy -- +-- of the license. -- +------------------------------------------------------------------------------ + +with GNATdoc.Comments.Options; + +with VSS.Strings; +with VSS.String_Vectors; + +with LSP.Structures; + +package LSP.Ada_Configurations is + + type Configuration is tagged limited private; + + procedure Read_JSON + (Self : in out Configuration'Class; + JSON : LSP.Structures.LSPAny; + Reload : out Boolean); + + function Project_File + (Self : Configuration'Class) return VSS.Strings.Virtual_String; + -- The project file, if provided by the user on Configuration/Init + + function Charset + (Self : Configuration'Class) return VSS.Strings.Virtual_String; + -- A character set for Libadalang + + function Relocate_Build_Tree + (Self : Configuration'Class) return VSS.Strings.Virtual_String; + -- Value of `relocateBuildTree`. See `--relocate-build-tree[=dir]` + -- of `gprbuild`. + + function Relocate_Root + (Self : Configuration'Class) return VSS.Strings.Virtual_String; + -- Value of `rootDir`. See `--root-dir=dir` of `gprbuild`. + + function Named_Notation_Threshold + (Self : Configuration'Class) return Natural; + -- Defines the number of parameters/components at which point named + -- notation is used for subprogram/aggregate completion snippets. + + function Log_Threshold (Self : Configuration'Class) return Natural; + -- Maximum number of logs (should be > to the number of servers run + -- simultaneously) + + function Diagnostics_Enabled (Self : Configuration'Class) return Boolean; + -- Whether to publish diagnostics + + function Indexing_Enabled (Self : Configuration'Class) return Boolean; + -- Whether to index sources in the background. This should be True + -- for normal use, and can be disabled for debug or testing purposes. + + function Rename_In_Comments (Self : Configuration'Class) return Boolean; + function Folding_Comments (Self : Configuration'Class) return Boolean; + + function Use_Completion_Snippets + (Self : Configuration'Class) return Boolean; + -- True if we should use snippets for completion (e.g: + -- subprogram calls). + + function Indent_Only (Self : Configuration'Class) return Boolean; + + function Follow_Symlinks (Self : Configuration'Class) return Boolean; + -- False if the client disables symlink following. In this case + -- URIs from client should match file names reported by LAL and + -- GNATCOLL.Project. + + function Documentation_Style (Self : Configuration'Class) + return GNATdoc.Comments.Options.Documentation_Style; + + type Variable_List is record + Names : VSS.String_Vectors.Virtual_String_Vector; + Values : VSS.String_Vectors.Virtual_String_Vector; + end record; + + function Scenario_Variables + (Self : Configuration'Class) return Variable_List; + -- Scenario variables, if provided by the user on Configuration/Init + +private + + type Configuration is tagged limited record + Project_File : VSS.Strings.Virtual_String; + Charset : VSS.Strings.Virtual_String; + Relocate_Build_Tree : VSS.Strings.Virtual_String; + Relocate_Root : VSS.Strings.Virtual_String; + Named_Notation_Threshold : Natural := 3; + Log_Threshold : Natural := 10; + Diagnostics_Enabled : Boolean := True; + Indexing_Enabled : Boolean := True; + Rename_In_Comments : Boolean := False; + Folding_Comments : Boolean := True; + Use_Completion_Snippets : Boolean := True; + Indent_Only : Boolean := True; + Follow_Symlinks : Boolean := True; + + Documentation_Style : GNATdoc.Comments.Options.Documentation_Style + := GNATdoc.Comments.Options.GNAT; + + Variables_Names : VSS.String_Vectors.Virtual_String_Vector; + Variables_Values : VSS.String_Vectors.Virtual_String_Vector; + end record; + + function Project_File + (Self : Configuration'Class) return VSS.Strings.Virtual_String is + (Self.Project_File); + + function Charset + (Self : Configuration'Class) return VSS.Strings.Virtual_String is + (Self.Charset); + + function Relocate_Build_Tree + (Self : Configuration'Class) return VSS.Strings.Virtual_String is + (Self.Relocate_Build_Tree); + + function Relocate_Root + (Self : Configuration'Class) return VSS.Strings.Virtual_String is + (Self.Relocate_Root); + + function Scenario_Variables + (Self : Configuration'Class) return Variable_List is + ((Self.Variables_Names, Self.Variables_Values)); + + function Diagnostics_Enabled (Self : Configuration'Class) return Boolean is + (Self.Diagnostics_Enabled); + + function Indexing_Enabled (Self : Configuration'Class) return Boolean is + (Self.Indexing_Enabled); + + function Use_Completion_Snippets + (Self : Configuration'Class) return Boolean is + (Self.Use_Completion_Snippets); + + function Follow_Symlinks (Self : Configuration'Class) return Boolean is + (Self.Follow_Symlinks); + + function Named_Notation_Threshold + (Self : Configuration'Class) return Natural is + (Self.Named_Notation_Threshold); + + function Log_Threshold (Self : Configuration'Class) return Natural is + (Self.Log_Threshold); + + function Rename_In_Comments (Self : Configuration'Class) return Boolean is + (Self.Rename_In_Comments); + + function Folding_Comments (Self : Configuration'Class) return Boolean is + (Self.Folding_Comments); + + function Indent_Only (Self : Configuration'Class) return Boolean is + (Self.Indent_Only); + + function Documentation_Style (Self : Configuration'Class) + return GNATdoc.Comments.Options.Documentation_Style is + (Self.Documentation_Style); + +end LSP.Ada_Configurations; diff --git a/source/ada/lsp-ada_handlers.adb b/source/ada/lsp-ada_handlers.adb index 89130da1e..b88f34ceb 100644 --- a/source/ada/lsp-ada_handlers.adb +++ b/source/ada/lsp-ada_handlers.adb @@ -23,6 +23,9 @@ with LSP.Enumerations; package body LSP.Ada_Handlers is + procedure Reload_Project (Self : in out Message_Handler'CLass) is null; + -- TBD + ---------------- -- Initialize -- ---------------- @@ -34,6 +37,23 @@ package body LSP.Ada_Handlers is Self.Incremental_Text_Changes := Incremental_Text_Changes; end Initialize; + -------------------------------------------- + -- On_DidChangeConfiguration_Notification -- + -------------------------------------------- + + overriding procedure On_DidChangeConfiguration_Notification + (Self : in out Message_Handler; + Value : LSP.Structures.DidChangeConfigurationParams) + is + Reload : Boolean := False; + begin + Self.Configuration.Read_JSON (Value.settings, Reload); + + if Reload then + Self.Reload_Project; + end if; + end On_DidChangeConfiguration_Notification; + --------------------------- -- On_Initialize_Request -- --------------------------- @@ -53,6 +73,20 @@ package body LSP.Ada_Handlers is Self.Sender.On_Initialize_Response (Id, Response); end On_Initialize_Request; + ---------------------------- + -- On_Server_Notification -- + ---------------------------- + + overriding procedure On_Server_Notification + (Self : in out Message_Handler; + Value : LSP.Server_Notifications.Server_Notification'Class) is + begin + Value.Visit_Server_Receiver (Self); + exception + when E : others => + Self.Tracer.Trace_Exception (E, "On_Server_Notification"); + end On_Server_Notification; + ----------------------- -- On_Server_Request -- ----------------------- diff --git a/source/ada/lsp-ada_handlers.ads b/source/ada/lsp-ada_handlers.ads index cd5848d47..6afa80662 100644 --- a/source/ada/lsp-ada_handlers.ads +++ b/source/ada/lsp-ada_handlers.ads @@ -19,8 +19,11 @@ -- language. with LSP.Ada_Client_Capabilities; +with LSP.Ada_Configurations; with LSP.Client_Message_Receivers; with LSP.Server_Message_Visitors; +with LSP.Server_Notification_Receivers; +with LSP.Server_Notifications; with LSP.Server_Request_Receivers; with LSP.Server_Requests; with LSP.Structures; @@ -35,6 +38,7 @@ package LSP.Ada_Handlers is Tracer : not null LSP.Tracers.Tracer_Access) is limited new LSP.Server_Message_Visitors.Server_Message_Visitor and LSP.Server_Request_Receivers.Server_Request_Receiver + and LSP.Server_Notification_Receivers.Server_Notification_Receiver with private; procedure Initialize @@ -53,8 +57,10 @@ private Tracer : not null LSP.Tracers.Tracer_Access) is limited new LSP.Unimplemented_Handlers.Unimplemented_Handler and LSP.Server_Message_Visitors.Server_Message_Visitor + and LSP.Server_Notification_Receivers.Server_Notification_Receiver with record Client : LSP.Ada_Client_Capabilities.Client_Capability; + Configuration : LSP.Ada_Configurations.Configuration; Incremental_Text_Changes : Boolean; Indexing_Enabled : Boolean := True; @@ -69,10 +75,17 @@ private overriding procedure On_Shutdown_Request (Self : in out Message_Handler; Id : LSP.Structures.Integer_Or_Virtual_String); + overriding procedure On_Server_Notification + (Self : in out Message_Handler; + Value : LSP.Server_Notifications.Server_Notification'Class); overriding procedure On_Initialize_Request (Self : in out Message_Handler; Id : LSP.Structures.Integer_Or_Virtual_String; Value : LSP.Structures.InitializeParams); + overriding procedure On_DidChangeConfiguration_Notification + (Self : in out Message_Handler; + Value : LSP.Structures.DidChangeConfigurationParams); + end LSP.Ada_Handlers; From 9b107639a00371548bf093b7c8e726c4706fe094 Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Mon, 14 Aug 2023 11:44:04 +0300 Subject: [PATCH 012/152] Add LSP.Search stub Refs #1170 --- gnat/ignore_in_317.txt | 2 -- source/ada/lsp-search.adb | 61 ++------------------------------------- source/ada/lsp-search.ads | 32 +++++++++++++++++--- 3 files changed, 31 insertions(+), 64 deletions(-) diff --git a/gnat/ignore_in_317.txt b/gnat/ignore_in_317.txt index 2d86100b7..c3bfa39c2 100644 --- a/gnat/ignore_in_317.txt +++ b/gnat/ignore_in_317.txt @@ -90,8 +90,6 @@ lsp-lal_utils.adb lsp-lal_utils.ads lsp-predefined_completion.adb lsp-predefined_completion.ads -lsp-search.adb -lsp-search.ads lsp-search-approximate.adb lsp-search-approximate.ads lsp-search-empty.adb diff --git a/source/ada/lsp-search.adb b/source/ada/lsp-search.adb index f547046e1..54cb14357 100644 --- a/source/ada/lsp-search.adb +++ b/source/ada/lsp-search.adb @@ -15,17 +15,6 @@ -- of the license. -- ------------------------------------------------------------------------------ -with GNAT.Regpat; - -with LSP.Lal_Utils; use LSP.Lal_Utils; - -with LSP.Search.Full_Text; use LSP.Search.Full_Text; -with LSP.Search.Fuzzy; use LSP.Search.Fuzzy; -with LSP.Search.Approximate; use LSP.Search.Approximate; -with LSP.Search.Regexp; use LSP.Search.Regexp; -with LSP.Search.Empty; use LSP.Search.Empty; -with LSP.Search.Start_Word_Text; use LSP.Search.Start_Word_Text; - package body LSP.Search is ----------- @@ -37,53 +26,9 @@ package body LSP.Search is Case_Sensitive : Boolean := False; Whole_Word : Boolean := False; Negate : Boolean := False; - Kind : Search_Kind := LSP.Messages.Full_Text) + Kind : Search_Kind := Full_Text) return Search_Pattern'Class - is - P : constant VSS.Strings.Virtual_String := - (if Case_Sensitive - then Pattern - else Canonicalize (Pattern)); - - begin - if P.Is_Empty then - return Empty.Build; - end if; - - case Kind is - when LSP.Messages.Full_Text => - return Full_Text.Build (P, Case_Sensitive, Whole_Word, Negate); - - when LSP.Messages.Start_Word_Text => - return Start_Word_Text.Build - (P, Case_Sensitive, Whole_Word, Negate); - - when LSP.Messages.Fuzzy => - return Fuzzy.Build (P, Case_Sensitive, Whole_Word, Negate); - - when LSP.Messages.Approximate => - if P.Character_Length <= 4 - or else P.Character_Length > 64 - then - -- Fallback to Full_Text, pattern is too long or too short - return Full_Text.Build (P, Case_Sensitive, Whole_Word, Negate); - - else - return Approximate.Build - (P, Case_Sensitive, Whole_Word, Negate); - end if; - - when LSP.Messages.Regexp => - begin - return Regexp.Build (P, Case_Sensitive, Whole_Word, Negate); - - exception - when GNAT.Regpat.Expression_Error => - return Full_Text.Build - (P, Case_Sensitive, Whole_Word, Negate); - end; - end case; - end Build; + is (raise Program_Error with "Unimplemented"); -- FIXME -------------- -- Get_Kind -- @@ -111,7 +56,7 @@ package body LSP.Search is (Self : Search_Pattern) return VSS.Strings.Virtual_String is begin if Self.Case_Sensitive then - return Canonicalize (Self.Text); + raise Program_Error with "Unimplemented"; -- FIXME else return Self.Text; end if; diff --git a/source/ada/lsp-search.ads b/source/ada/lsp-search.ads index 18c55f706..053a91652 100644 --- a/source/ada/lsp-search.ads +++ b/source/ada/lsp-search.ads @@ -1,7 +1,7 @@ ------------------------------------------------------------------------------ -- Language Server Protocol -- -- -- --- Copyright (C) 2021, AdaCore -- +-- Copyright (C) 2021-2023, AdaCore -- -- -- -- This is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -17,11 +17,35 @@ with Ada.Finalization; -with VSS.Strings; use VSS.Strings; -with LSP.Messages; use LSP.Messages; +with VSS.Strings; package LSP.Search is + type Search_Kind is + (Full_Text, Regexp, Fuzzy, Approximate, Start_Word_Text); + -- A Full_Text match searches the pattern exactly in the contents. + -- + -- A Start_Word_Text works like a Full_Text but tested word should mutch + -- patters from the first letter + -- + -- A regexp parses the pattern as a regular expression. + -- + -- A fuzzy match will search for some contents that contains all the + -- characters of the pattern, in the same order, but possibly with + -- other characters in-between. The number of characters in-between is not + -- limited, so this mode really only makes sense when matching short text + -- (and not, for instance, in text editors). + -- + -- Approximate allows one or two errors to appear in the match (character + -- insertion, deletion or substitution). This is mostly suitable when + -- matching in long texts. The implementation of this algorithm is + -- optimized so that characters are matched only once, but the total length + -- of the pattern is limited to 64 characters. The exact number of errors + -- depends on the length of the pattern: + -- patterns of length <= 4 => no error allowed + -- patterns of length <= 10 => one error allowed + -- long patterns => up to two errors + -------------------- -- Search_Pattern -- -------------------- @@ -75,7 +99,7 @@ private type Search_Pattern is abstract new Ada.Finalization.Limited_Controlled with record - Text : VSS.Strings.Virtual_String := Empty_Virtual_String; + Text : VSS.Strings.Virtual_String; Case_Sensitive : Boolean := False; Whole_Word : Boolean := False; Kind : Search_Kind := Full_Text; From f87545b24df9895b8882d9839be73a1a8ad2efa7 Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Mon, 14 Aug 2023 12:00:46 +0300 Subject: [PATCH 013/152] Add LSP.Ada_File_Sets Refs #1170 --- gnat/ignore_in_317.txt | 2 - source/ada/lsp-ada_file_sets.adb | 17 ++-- source/ada/lsp-lal_utils.adb | 122 ------------------------- source/ada/lsp-lal_utils.ads | 20 ----- source/ada/lsp-predicates.adb | 147 +++++++++++++++++++++++++++++++ source/ada/lsp-predicates.ads | 42 +++++++++ 6 files changed, 197 insertions(+), 153 deletions(-) create mode 100644 source/ada/lsp-predicates.adb create mode 100644 source/ada/lsp-predicates.ads diff --git a/gnat/ignore_in_317.txt b/gnat/ignore_in_317.txt index c3bfa39c2..841d739a2 100644 --- a/gnat/ignore_in_317.txt +++ b/gnat/ignore_in_317.txt @@ -31,8 +31,6 @@ lsp-ada_documents.adb lsp-ada_documents.ads lsp-ada_documents-lal_diagnostics.adb lsp-ada_documents-lal_diagnostics.ads -lsp-ada_file_sets.adb -lsp-ada_file_sets.ads lsp-ada_handlers-alire.adb lsp-ada_handlers-alire.ads lsp-ada_handlers-file_readers.adb diff --git a/source/ada/lsp-ada_file_sets.adb b/source/ada/lsp-ada_file_sets.adb index 1702484fe..99e679266 100644 --- a/source/ada/lsp-ada_file_sets.adb +++ b/source/ada/lsp-ada_file_sets.adb @@ -20,8 +20,7 @@ with Libadalang.Common; use Libadalang.Common; with Libadalang.Iterators; with Libadalang.Sources; -with LSP.Lal_Utils; -with LSP.Messages; +with LSP.Predicates; package body LSP.Ada_File_Sets is @@ -94,7 +93,7 @@ package body LSP.Ada_File_Sets is Defining_Name : Libadalang.Analysis.Defining_Name; Stop : in out Boolean)) is - use type LSP.Messages.Search_Kind; + use all type LSP.Search.Search_Kind; Stop : Boolean := False; Cursor : Symbol_Maps.Cursor; @@ -102,9 +101,9 @@ package body LSP.Ada_File_Sets is Use_Celling : constant Boolean := not Pattern.Get_Case_Sensitive and then not Pattern.Get_Negate - and then ((Pattern.Get_Kind = LSP.Messages.Full_Text + and then ((Pattern.Get_Kind = Full_Text and then Pattern.Get_Whole_Word) - or else Pattern.Get_Kind = LSP.Messages.Start_Word_Text); + or else Pattern.Get_Kind = Start_Word_Text); begin if Use_Celling then @@ -123,7 +122,7 @@ package body LSP.Ada_File_Sets is if not Defining_Name.Is_Null and then Pattern.Match - (LSP.Lal_Utils.To_Virtual_String + (VSS.Strings.To_Virtual_String (Defining_Name.As_Ada_Node.Text)) then if not Only_Public or else Item.Is_Public then @@ -196,10 +195,10 @@ package body LSP.Ada_File_Sets is Node : Libadalang.Analysis.Ada_Node; Global_Visible : constant Libadalang.Iterators.Ada_Node_Predicate := - LSP.Lal_Utils.Is_Global_Visible; + LSP.Predicates.Is_Global_Visible; Restricted_Kind : constant Libadalang.Iterators.Ada_Node_Predicate := - LSP.Lal_Utils.Is_Restricted_Kind; + LSP.Predicates.Is_Restricted_Kind; -- Find all definings names excluding private parts and bodies content It : Libadalang.Iterators.Traverse_Iterator'Class := @@ -237,7 +236,7 @@ package body LSP.Ada_File_Sets is begin if Canonical.Success then Self.All_Symbols.Insert - (LSP.Lal_Utils.To_Virtual_String (Canonical.Symbol), + (VSS.Strings.To_Virtual_String (Canonical.Symbol), Name_Vectors.Empty_Vector, Cursor, Inserted); diff --git a/source/ada/lsp-lal_utils.adb b/source/ada/lsp-lal_utils.adb index 3760f7981..5ce58bf40 100644 --- a/source/ada/lsp-lal_utils.adb +++ b/source/ada/lsp-lal_utils.adb @@ -52,28 +52,6 @@ package body LSP.Lal_Utils is return Ada.Strings.Unbounded.Unbounded_String; -- Convert Input to unbounded string. - type Restricted_Kind_Predicate is - new Libadalang.Iterators.Ada_Node_Predicate_Interface with null record; - -- A custom node predicate to filter some declaration kinds. - -- See Is_Restricted_Kind for details. - - overriding function Evaluate - (Ignore : in out Restricted_Kind_Predicate; - Node : Libadalang.Analysis.Ada_Node) return Boolean; - -- Evaluate the Restricted_Kind_Predicate filter - -- See Is_Restricted_Kind for details. - - type Is_Global_Visible_Predicate is - new Libadalang.Iterators.Ada_Node_Predicate_Interface with null record; - -- A custom node predicate to filter some declaration kinds. - -- See Is_Restricted_Kind for details. - - overriding function Evaluate - (Ignore : in out Is_Global_Visible_Predicate; - Node : Libadalang.Analysis.Ada_Node) return Boolean; - -- Evaluate the Restricted_Kind_Predicate filter - -- See Is_Restricted_Kind for details. - --------------------- -- Append_Location -- --------------------- @@ -1290,106 +1268,6 @@ package body LSP.Lal_Utils is Langkit_Support.Symbols.Destroy (Symbols); end Format_Vector; - -------------- - -- Evaluate -- - -------------- - - overriding function Evaluate - (Ignore : in out Restricted_Kind_Predicate; - Node : Libadalang.Analysis.Ada_Node) return Boolean - is - Decl : constant Libadalang.Analysis.Basic_Decl := - Node.As_Defining_Name.P_Basic_Decl; - Next : Libadalang.Analysis.Ada_Node := Decl.Parent; - - begin - if not Decl.Is_Null and then - Decl.Kind in Libadalang.Common.Ada_For_Loop_Var_Decl - | Libadalang.Common.Ada_Base_Formal_Param_Decl - | Libadalang.Common.Ada_Extended_Return_Stmt_Object_Decl - | Libadalang.Common.Ada_Anonymous_Expr_Decl - | Libadalang.Common.Ada_Exception_Handler - | Libadalang.Common.Ada_Label_Decl - | Libadalang.Common.Ada_Named_Stmt_Decl - | Libadalang.Common.Ada_Entry_Index_Spec - | Libadalang.Common.Ada_Entry_Decl - then - return True; - - elsif not Decl.Is_Null and then - Decl.Kind in Libadalang.Common.Ada_Object_Decl and then - Decl.Parent.Kind = Libadalang.Common.Ada_Generic_Formal_Obj_Decl - then - -- This is a special case for the formal_object_declaration - return True; - end if; - - while not Next.Is_Null loop - -- Any program unit body excluding library level package bodies - if Next.Kind in Libadalang.Common.Ada_Body_Node and then - (Next.Kind not in Libadalang.Common.Ada_Package_Body or else - Next.Parent.Kind not in Libadalang.Common.Ada_Library_Item) - then - return True; - end if; - - Next := Next.Parent; - end loop; - - return False; - end Evaluate; - - -------------- - -- Evaluate -- - -------------- - - overriding function Evaluate - (Ignore : in out Is_Global_Visible_Predicate; - Node : Libadalang.Analysis.Ada_Node) return Boolean - is - Decl : constant Libadalang.Analysis.Basic_Decl := - Node.As_Defining_Name.P_Basic_Decl; - Next : Libadalang.Analysis.Ada_Node := Decl.Parent; - begin - while not Next.Is_Null loop - if Next.Kind in - Libadalang.Common.Ada_Body_Node - | Libadalang.Common.Ada_Private_Part - | Libadalang.Common.Ada_Protected_Type_Decl - | Libadalang.Common.Ada_Single_Protected_Decl - then - return False; - end if; - - Next := Next.Parent; - end loop; - - return True; - end Evaluate; - - ------------------------ - -- Is_Restricted_Kind -- - ------------------------ - - function Is_Restricted_Kind - return Libadalang.Iterators.Ada_Node_Predicate is - begin - return Result : Libadalang.Iterators.Ada_Node_Predicate do - Result.Set (Restricted_Kind_Predicate'(null record)); - end return; - end Is_Restricted_Kind; - - ----------------------- - -- Is_Global_Visible -- - ----------------------- - - function Is_Global_Visible return Libadalang.Iterators.Ada_Node_Predicate is - begin - return Result : Libadalang.Iterators.Ada_Node_Predicate do - Result.Set (Is_Global_Visible_Predicate'(null record)); - end return; - end Is_Global_Visible; - ------------------ -- Is_End_Token -- ------------------ diff --git a/source/ada/lsp-lal_utils.ads b/source/ada/lsp-lal_utils.ads index 2b9507481..70c0e487a 100644 --- a/source/ada/lsp-lal_utils.ads +++ b/source/ada/lsp-lal_utils.ads @@ -258,26 +258,6 @@ package LSP.Lal_Utils is return VSS.Strings.Virtual_String; -- Do string type conversion. - -- Global symbol index predicates. - - function Is_Restricted_Kind return Libadalang.Iterators.Ada_Node_Predicate; - -- A node under query doesn't participate in global symbol index. It's a - -- defining name of a declaration such as - -- * a loop parameter specification - -- * parameter declaration - -- * discriminant/component declaration - -- * return object declaration - -- * entry/entry-index declaration - -- * formal parameter declaration - -- * etc - -- It also includes any symbols local to some non-package body. - -- These symbols isn't very useful in "invisible symbol completion" and - -- in "Go to workspace symbol" requests. - - function Is_Global_Visible return Libadalang.Iterators.Ada_Node_Predicate; - -- A node under query is a defined name visible at a library level, such - -- as declaration in a public part of a library level project. - function Is_End_Token (Token : Libadalang.Common.Token_Reference) return Boolean; -- Check if Token is . diff --git a/source/ada/lsp-predicates.adb b/source/ada/lsp-predicates.adb new file mode 100644 index 000000000..693d297ec --- /dev/null +++ b/source/ada/lsp-predicates.adb @@ -0,0 +1,147 @@ +------------------------------------------------------------------------------ +-- Language Server Protocol -- +-- -- +-- Copyright (C) 2018-2023, AdaCore -- +-- -- +-- This is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 3, or (at your option) any later ver- -- +-- sion. This software is distributed in the hope that it will be useful, -- +-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- -- +-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -- +-- License for more details. You should have received a copy of the GNU -- +-- General Public License distributed with this software; see file -- +-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy -- +-- of the license. -- +------------------------------------------------------------------------------ + +with Libadalang.Analysis; +with Libadalang.Common; + +package body LSP.Predicates is + + type Restricted_Kind_Predicate is + new Libadalang.Iterators.Ada_Node_Predicate_Interface with null record; + -- A custom node predicate to filter some declaration kinds. + -- See Is_Restricted_Kind for details. + + overriding function Evaluate + (Ignore : in out Restricted_Kind_Predicate; + Node : Libadalang.Analysis.Ada_Node) return Boolean; + -- Evaluate the Restricted_Kind_Predicate filter + -- See Is_Restricted_Kind for details. + + type Is_Global_Visible_Predicate is + new Libadalang.Iterators.Ada_Node_Predicate_Interface with null record; + -- A custom node predicate to filter some declaration kinds. + -- See Is_Restricted_Kind for details. + + overriding function Evaluate + (Ignore : in out Is_Global_Visible_Predicate; + Node : Libadalang.Analysis.Ada_Node) return Boolean; + -- Evaluate the Restricted_Kind_Predicate filter + -- See Is_Restricted_Kind for details. + + -------------- + -- Evaluate -- + -------------- + + overriding function Evaluate + (Ignore : in out Restricted_Kind_Predicate; + Node : Libadalang.Analysis.Ada_Node) return Boolean + is + use type Libadalang.Common.Ada_Node_Kind_Type; + + Decl : constant Libadalang.Analysis.Basic_Decl := + Node.As_Defining_Name.P_Basic_Decl; + Next : Libadalang.Analysis.Ada_Node := Decl.Parent; + + begin + if not Decl.Is_Null and then + Decl.Kind in Libadalang.Common.Ada_For_Loop_Var_Decl + | Libadalang.Common.Ada_Base_Formal_Param_Decl + | Libadalang.Common.Ada_Extended_Return_Stmt_Object_Decl + | Libadalang.Common.Ada_Anonymous_Expr_Decl + | Libadalang.Common.Ada_Exception_Handler + | Libadalang.Common.Ada_Label_Decl + | Libadalang.Common.Ada_Named_Stmt_Decl + | Libadalang.Common.Ada_Entry_Index_Spec + | Libadalang.Common.Ada_Entry_Decl + then + return True; + + elsif not Decl.Is_Null and then + Decl.Kind in Libadalang.Common.Ada_Object_Decl and then + Decl.Parent.Kind = Libadalang.Common.Ada_Generic_Formal_Obj_Decl + then + -- This is a special case for the formal_object_declaration + return True; + end if; + + while not Next.Is_Null loop + -- Any program unit body excluding library level package bodies + if Next.Kind in Libadalang.Common.Ada_Body_Node and then + (Next.Kind not in Libadalang.Common.Ada_Package_Body or else + Next.Parent.Kind not in Libadalang.Common.Ada_Library_Item) + then + return True; + end if; + + Next := Next.Parent; + end loop; + + return False; + end Evaluate; + + -------------- + -- Evaluate -- + -------------- + + overriding function Evaluate + (Ignore : in out Is_Global_Visible_Predicate; + Node : Libadalang.Analysis.Ada_Node) return Boolean + is + Decl : constant Libadalang.Analysis.Basic_Decl := + Node.As_Defining_Name.P_Basic_Decl; + Next : Libadalang.Analysis.Ada_Node := Decl.Parent; + begin + while not Next.Is_Null loop + if Next.Kind in + Libadalang.Common.Ada_Body_Node + | Libadalang.Common.Ada_Private_Part + | Libadalang.Common.Ada_Protected_Type_Decl + | Libadalang.Common.Ada_Single_Protected_Decl + then + return False; + end if; + + Next := Next.Parent; + end loop; + + return True; + end Evaluate; + + ------------------------ + -- Is_Restricted_Kind -- + ------------------------ + + function Is_Restricted_Kind + return Libadalang.Iterators.Ada_Node_Predicate is + begin + return Result : Libadalang.Iterators.Ada_Node_Predicate do + Result.Set (Restricted_Kind_Predicate'(null record)); + end return; + end Is_Restricted_Kind; + + ----------------------- + -- Is_Global_Visible -- + ----------------------- + + function Is_Global_Visible return Libadalang.Iterators.Ada_Node_Predicate is + begin + return Result : Libadalang.Iterators.Ada_Node_Predicate do + Result.Set (Is_Global_Visible_Predicate'(null record)); + end return; + end Is_Global_Visible; + +end LSP.Predicates; diff --git a/source/ada/lsp-predicates.ads b/source/ada/lsp-predicates.ads new file mode 100644 index 000000000..11ccd1022 --- /dev/null +++ b/source/ada/lsp-predicates.ads @@ -0,0 +1,42 @@ +------------------------------------------------------------------------------ +-- Language Server Protocol -- +-- -- +-- Copyright (C) 2018-2023, AdaCore -- +-- -- +-- This is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 3, or (at your option) any later ver- -- +-- sion. This software is distributed in the hope that it will be useful, -- +-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- -- +-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -- +-- License for more details. You should have received a copy of the GNU -- +-- General Public License distributed with this software; see file -- +-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy -- +-- of the license. -- +------------------------------------------------------------------------------ +-- +-- This package provides some Libadalang predicates. + +with Libadalang.Iterators; + +package LSP.Predicates is + + function Is_Restricted_Kind return Libadalang.Iterators.Ada_Node_Predicate; + -- A node under query doesn't participate in global symbol index. It's a + -- defining name of a declaration such as + -- * a loop parameter specification + -- * parameter declaration + -- * discriminant/component declaration + -- * return object declaration + -- * entry/entry-index declaration + -- * formal parameter declaration + -- * etc + -- It also includes any symbols local to some non-package body. + -- These symbols isn't very useful in "invisible symbol completion" and + -- in "Go to workspace symbol" requests. + + function Is_Global_Visible return Libadalang.Iterators.Ada_Node_Predicate; + -- A node under query is a defined name visible at a library level, such + -- as declaration in a public part of a library level project. + +end LSP.Predicates; From edfac4c33fb96f5c05f2c81ddfe72c9ada77a3a0 Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Mon, 14 Aug 2023 12:18:10 +0300 Subject: [PATCH 014/152] Add LSP.Ada_Id_Iterators Refs #1170 --- gnat/ignore_in_317.txt | 2 -- source/ada/lsp-ada_id_iterators.adb | 45 +++++++++++++++++++++++++---- source/ada/lsp-ada_id_iterators.ads | 8 ++--- 3 files changed, 43 insertions(+), 12 deletions(-) diff --git a/gnat/ignore_in_317.txt b/gnat/ignore_in_317.txt index 841d739a2..d90962e2b 100644 --- a/gnat/ignore_in_317.txt +++ b/gnat/ignore_in_317.txt @@ -73,8 +73,6 @@ lsp-ada_handlers-refactor-suppress_seperate.adb lsp-ada_handlers-refactor-suppress_seperate.ads lsp-ada_highlighters.adb lsp-ada_highlighters.ads -lsp-ada_id_iterators.adb -lsp-ada_id_iterators.ads lsp-client_side_file_monitors.adb lsp-client_side_file_monitors.ads lsp-common.adb diff --git a/source/ada/lsp-ada_id_iterators.adb b/source/ada/lsp-ada_id_iterators.adb index e7d0b6bc6..594dca17b 100644 --- a/source/ada/lsp-ada_id_iterators.adb +++ b/source/ada/lsp-ada_id_iterators.adb @@ -1,7 +1,7 @@ ------------------------------------------------------------------------------ -- Language Server Protocol -- -- -- --- Copyright (C) 2018-2020, AdaCore -- +-- Copyright (C) 2018-2023, AdaCore -- -- -- -- This is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -15,10 +15,44 @@ -- of the license. -- ------------------------------------------------------------------------------ -with Laltools.Common; - package body LSP.Ada_Id_Iterators is + function Find_Next_Part + (Definition : Libadalang.Analysis.Defining_Name; + Tracer : in out LSP.Tracers.Tracer'Class; + Imprecise_Fallback : Boolean := False) + return Libadalang.Analysis.Defining_Name; + -- Wrapper around P_Next_Part that returns No_Defining_Name if next part + -- is name itself. It also catches Property_Error and reports it in traces. + + -------------------- + -- Find_Next_Part -- + -------------------- + + function Find_Next_Part + (Definition : Libadalang.Analysis.Defining_Name; + Tracer : in out LSP.Tracers.Tracer'Class; + Imprecise_Fallback : Boolean := False) + return Libadalang.Analysis.Defining_Name + is + use type Libadalang.Analysis.Defining_Name; + + Next : Libadalang.Analysis.Defining_Name; + begin + Next := + Definition.P_Next_Part (Imprecise_Fallback => Imprecise_Fallback); + + if Next = Definition then + return Libadalang.Analysis.No_Defining_Name; + else + return Next; + end if; + exception + when E : Libadalang.Common.Property_Error => + Tracer.Trace_Exception (E, "in Find_Next_Part"); + return Libadalang.Analysis.No_Defining_Name; + end Find_Next_Part; + -------------------------------------------- -- Find_All_Param_References_In_Hierarchy -- -------------------------------------------- @@ -68,7 +102,7 @@ package body LSP.Ada_Id_Iterators is procedure Find_All_Subp_References_In_Hierarchy (Hierarchy : Libadalang.Analysis.Basic_Decl_Array; - Trace : GNATCOLL.Traces.Trace_Handle; + Tracer : in out LSP.Tracers.Tracer'Class; Callback : not null access procedure (Base_Id : Libadalang.Analysis.Base_Id; Kind : Libadalang.Common.Ref_Result_Kind; @@ -87,8 +121,7 @@ package body LSP.Ada_Id_Iterators is exit when Cancel; -- Try to get the corresponding body - Subp_Body_Name := Laltools.Common.Find_Next_Part - (Subp_Decl.P_Defining_Name, Trace); + Subp_Body_Name := Find_Next_Part (Subp_Decl.P_Defining_Name, Tracer); -- If there is a body, append the body's begin and end labels -- to the result. diff --git a/source/ada/lsp-ada_id_iterators.ads b/source/ada/lsp-ada_id_iterators.ads index 557be2605..966affbcd 100644 --- a/source/ada/lsp-ada_id_iterators.ads +++ b/source/ada/lsp-ada_id_iterators.ads @@ -1,7 +1,7 @@ ------------------------------------------------------------------------------ -- Language Server Protocol -- -- -- --- Copyright (C) 2018-2020, AdaCore -- +-- Copyright (C) 2018-2023, AdaCore -- -- -- -- This is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -17,11 +17,11 @@ -- -- This package provides iterators over Libadalang Base_Id nodes. -with GNATCOLL.Traces; - with Libadalang.Analysis; with Libadalang.Common; +with LSP.Tracers; + package LSP.Ada_Id_Iterators is procedure Find_All_References @@ -46,7 +46,7 @@ package LSP.Ada_Id_Iterators is procedure Find_All_Subp_References_In_Hierarchy (Hierarchy : Libadalang.Analysis.Basic_Decl_Array; - Trace : GNATCOLL.Traces.Trace_Handle; + Tracer : in out LSP.Tracers.Tracer'Class; Callback : not null access procedure (Base_Id : Libadalang.Analysis.Base_Id; Kind : Libadalang.Common.Ref_Result_Kind; From f820dc00a9bb5093d7cb1f73a447673d2766d076 Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Mon, 14 Aug 2023 16:05:11 +0300 Subject: [PATCH 015/152] Add LSP.Ada_Highlighters stub Refs #1170 --- gnat/ignore_in_317.txt | 2 - source/ada/lsp-ada_highlighters.adb | 939 +--------------------------- source/ada/lsp-ada_highlighters.ads | 47 +- 3 files changed, 31 insertions(+), 957 deletions(-) diff --git a/gnat/ignore_in_317.txt b/gnat/ignore_in_317.txt index d90962e2b..5cadaaab3 100644 --- a/gnat/ignore_in_317.txt +++ b/gnat/ignore_in_317.txt @@ -71,8 +71,6 @@ lsp-ada_handlers-refactor-sort_dependencies.adb lsp-ada_handlers-refactor-sort_dependencies.ads lsp-ada_handlers-refactor-suppress_seperate.adb lsp-ada_handlers-refactor-suppress_seperate.ads -lsp-ada_highlighters.adb -lsp-ada_highlighters.ads lsp-client_side_file_monitors.adb lsp-client_side_file_monitors.ads lsp-common.adb diff --git a/source/ada/lsp-ada_highlighters.adb b/source/ada/lsp-ada_highlighters.adb index 39928bf25..7b8367c00 100644 --- a/source/ada/lsp-ada_highlighters.adb +++ b/source/ada/lsp-ada_highlighters.adb @@ -1,7 +1,7 @@ ------------------------------------------------------------------------------ -- Language Server Protocol -- -- -- --- Copyright (C) 2022, AdaCore -- +-- Copyright (C) 2022-2023, AdaCore -- -- -- -- This is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -15,836 +15,19 @@ -- of the license. -- ------------------------------------------------------------------------------ -with Ada.Containers.Vectors; - -with Langkit_Support.Slocs; -with Langkit_Support.Text; -with Langkit_Support.Token_Data_Handlers; -with Libadalang.Common; use Libadalang.Common; - -with LSP.Common; -with LSP.Lal_Utils; - -with VSS.Strings; - package body LSP.Ada_Highlighters is - Highlighter_Debug : constant GNATCOLL.Traces.Trace_Handle := - GNATCOLL.Traces.Create ("ALS.HIGHLIGHTERS.DEBUG", GNATCOLL.Traces.Off); - - Skip : LSP.Messages.SemanticTokenTypes renames LSP.Messages.macro; - -- A dedicated token type for unsupported tokens - - package Highlights_Holders is - type Highlights_Holder is tagged limited private; - -- Highlights_Holder stores style for each token in the range given - -- on initialization. - - procedure Initialize - (Self : in out Highlights_Holder'Class; - From : Libadalang.Common.Token_Reference; - To : Libadalang.Common.Token_Reference; - Empty : out Boolean); - -- Initialize holder by providing token range. If From or To is a trivia - -- holder uses corresponding non-trivia token instead. - - procedure Set_Token_Kind - (Self : in out Highlights_Holder'Class; - Token : Libadalang.Common.Token_Reference; - Value : LSP.Messages.SemanticTokenTypes) - with Pre => not Libadalang.Common.Is_Trivia (Token); - - procedure Set_Token_Modifier - (Self : in out Highlights_Holder'Class; - Token : Libadalang.Common.Token_Reference; - Value : LSP.Messages.SemanticTokenModifiers) - with Pre => not Libadalang.Common.Is_Trivia (Token); - - procedure Set_Token_Modifier - (Self : in out Highlights_Holder'Class; - From : Libadalang.Common.Token_Reference; - To : Libadalang.Common.Token_Reference; - Value : LSP.Messages.SemanticTokenModifiers) - with Pre => not Libadalang.Common.Is_Trivia (From) and then - not Libadalang.Common.Is_Trivia (To); - -- Set a modifier on each token in the range From .. To - - type Modifier_Set is - array (LSP.Messages.SemanticTokenModifiers) of Boolean - with Pack; - - Empty : constant Modifier_Set := (others => False); - - type Semantic_Token (Is_Set : Boolean := False) is record - Modifiers : Modifier_Set; - - case Is_Set is - when True => - Kind : LSP.Messages.SemanticTokenTypes; - when False => - null; - end case; - end record; - - function Get - (Self : Highlights_Holder'Class; - Token : Libadalang.Common.Token_Reference) - return Semantic_Token - with Pre => not Libadalang.Common.Is_Trivia (Token); - - private - - package Semantic_Token_Vectors is new Ada.Containers.Vectors - (Index_Type => Langkit_Support.Token_Data_Handlers.Token_Index, - Element_Type => Semantic_Token); - - type Highlights_Holder is tagged limited record - First : Langkit_Support.Token_Data_Handlers.Token_Index; - Vector : Semantic_Token_Vectors.Vector; - end record; - end Highlights_Holders; - - function To_Int - (Self : Ada_Highlighter'Class; - Set : Highlights_Holders.Modifier_Set) - return LSP.Messages.uinteger - with Inline; - -- Cast set of modifiers to uinteger - - ------------------------ - -- Highlights_Holders -- - ------------------------ - - package body Highlights_Holders is - - ---------------- - -- Initialize -- - ---------------- - - procedure Initialize - (Self : in out Highlights_Holder'Class; - From : Libadalang.Common.Token_Reference; - To : Libadalang.Common.Token_Reference; - Empty : out Boolean) - is - use type Langkit_Support.Token_Data_Handlers.Token_Index; - - First : Libadalang.Common.Token_Reference := From; - Last : Libadalang.Common.Token_Reference := To; - - Count : Langkit_Support.Token_Data_Handlers.Token_Index; - None : constant Semantic_Token := - (Is_Set => False, Modifiers => (others => False)); - begin - if Libadalang.Common.Is_Trivia (First) then - First := Libadalang.Common.Next (First, Exclude_Trivia => True); - end if; - - if Libadalang.Common.Is_Trivia (Last) then - Last := Libadalang.Common.Previous (Last, Exclude_Trivia => True); - end if; - - if Libadalang.Common.No_Token in First | Last - or else Last < First - then - Self.First := 0; - Self.Vector.Clear; - Empty := True; - return; - end if; - - Self.First := Libadalang.Common.Index (First); - Count := Libadalang.Common.Index (Last) - Self.First + 1; - - Self.Vector.Clear; - Self.Vector.Append (None, Ada.Containers.Count_Type (Count)); - Empty := False; - end Initialize; - - --------- - -- Get -- - --------- - - function Get - (Self : Highlights_Holder'Class; - Token : Libadalang.Common.Token_Reference) return Semantic_Token - is - use type Langkit_Support.Token_Data_Handlers.Token_Index; - - Index : constant Langkit_Support.Token_Data_Handlers.Token_Index := - Libadalang.Common.Index (Token) - Self.First; - begin - return Self.Vector (Index); - end Get; - - ------------------------ - -- Set_Token_Modifier -- - ------------------------ - - procedure Set_Token_Modifier - (Self : in out Highlights_Holder'Class; - Token : Libadalang.Common.Token_Reference; - Value : LSP.Messages.SemanticTokenModifiers) - is - use type Langkit_Support.Token_Data_Handlers.Token_Index; - Index : constant Langkit_Support.Token_Data_Handlers.Token_Index := - Libadalang.Common.Index (Token) - Self.First; - begin - Self.Vector (Index).Modifiers (Value) := True; - end Set_Token_Modifier; - - ------------------------ - -- Set_Token_Modifier -- - ------------------------ - - procedure Set_Token_Modifier - (Self : in out Highlights_Holder'Class; - From : Libadalang.Common.Token_Reference; - To : Libadalang.Common.Token_Reference; - Value : LSP.Messages.SemanticTokenModifiers) - is - use type Langkit_Support.Token_Data_Handlers.Token_Index; - - Token : Libadalang.Common.Token_Reference := From; - Index : Langkit_Support.Token_Data_Handlers.Token_Index; - begin - loop - if Libadalang.Common.Index (Token) >= Self.First then - Index := Libadalang.Common.Index (Token) - Self.First; - - if Index <= Self.Vector.Last_Index then - Self.Vector (Index).Modifiers (Value) := True; - end if; - end if; - - exit when Token = To; - - Token := Libadalang.Common.Next (Token, Exclude_Trivia => True); - end loop; - end Set_Token_Modifier; - - -------------------- - -- Set_Token_Kind -- - -------------------- - - procedure Set_Token_Kind - (Self : in out Highlights_Holder'Class; - Token : Libadalang.Common.Token_Reference; - Value : LSP.Messages.SemanticTokenTypes) - is - use type Langkit_Support.Token_Data_Handlers.Token_Index; - Index : constant Langkit_Support.Token_Data_Handlers.Token_Index := - Libadalang.Common.Index (Token) - Self.First; - begin - if Self.Vector (Index).Is_Set then - Self.Vector (Index).Kind := Value; - else - Self.Vector.Replace_Element - (Index, (True, Self.Vector (Index).Modifiers, Value)); - end if; - end Set_Token_Kind; - - end Highlights_Holders; - ---------------- -- Get_Tokens -- ---------------- function Get_Tokens - (Self : Ada_Highlighter'Class; - Unit : Libadalang.Analysis.Analysis_Unit; - Trace : GNATCOLL.Traces.Trace_Handle; - Span : LSP.Messages.Span) - return LSP.Messages.uinteger_Vector + (Self : Ada_Highlighter'Class; Unit : Libadalang.Analysis.Analysis_Unit; + Tracer : in out LSP.Tracers.Tracer'Class; Span : LSP.Structures.A_Range) + return LSP.Structures.Natural_Vector is - use type LSP.Types.Line_Number; - - First_Token : constant Libadalang.Common.Token_Reference := - (if Span.last.line = 0 then Unit.First_Token - else Unit.Lookup_Token - ((Langkit_Support.Slocs.Line_Number (Span.first.line + 1), 1))); - - Last_Token : constant Libadalang.Common.Token_Reference := - (if Span.last.line = 0 then Unit.Last_Token - else Unit.Lookup_Token - ((Langkit_Support.Slocs.Line_Number (Span.last.line + 2), 1))); - - From_Token : constant Libadalang.Common.Token_Reference := - (if Libadalang.Common.Is_Trivia (First_Token) - then Libadalang.Common.Next (First_Token, Exclude_Trivia => True) - else First_Token); - - To_Token : constant Libadalang.Common.Token_Reference := - (if Libadalang.Common.Is_Trivia (Last_Token) - then Libadalang.Common.Previous (Last_Token, Exclude_Trivia => True) - else Last_Token); - - function Is_Ghost_Root_Node - (Node : Libadalang.Analysis.Ada_Node'Class) return Boolean; - -- Check if given node is a declaration and has ghost aspect - - procedure Highlight_Token - (Token : Libadalang.Common.Token_Reference; - Kind : LSP.Messages.SemanticTokenTypes); - -- Highlight given Token with token Kind - - procedure Highlight_Token - (Token : Libadalang.Common.Token_Reference; - Kind : LSP.Messages.SemanticTokenModifiers); - -- Highlight given Token with token Kind - - function Highlight_Node - (Node : Libadalang.Analysis.Ada_Node'Class) - return Libadalang.Common.Visit_Status; - -- Highlight given node - - procedure Highlight_Name - (Node : Libadalang.Analysis.Name'Class); - -- Highlight given name with token Kind - - procedure Get_Result - (Holder : Highlights_Holders.Highlights_Holder; - Result : out LSP.Messages.uinteger_Vector); - - ---------------- - -- Get_Result -- - ---------------- - - procedure Get_Result - (Holder : Highlights_Holders.Highlights_Holder; - Result : out LSP.Messages.uinteger_Vector) - is - use all type LSP.Messages.SemanticTokenTypes; - use type Langkit_Support.Slocs.Line_Number; - use type Langkit_Support.Slocs.Column_Number; - - subtype uint is LSP.Messages.uinteger; - - Last : Langkit_Support.Slocs.Source_Location := (1, 1); - - Token : Libadalang.Common.Token_Reference := From_Token; - begin - -- Scan over all tokens and find a corresponding value in Holder - while Token < To_Token loop - - declare - Value : constant Highlights_Holders.Semantic_Token := - Holder.Get (Token); - - Token_Data : constant Libadalang.Common.Token_Data_Type := - Libadalang.Common.Data (Token); - begin - declare - use type Highlights_Holders.Modifier_Set; - - Sloc_Range : constant - Langkit_Support.Slocs.Source_Location_Range := - Libadalang.Common.Sloc_Range (Token_Data); - - Start : constant Langkit_Support.Slocs.Source_Location := - Langkit_Support.Slocs.Start_Sloc (Sloc_Range); - - Map : constant array (Libadalang.Common.Token_Kind) of - LSP.Messages.SemanticTokenTypes := - (Ada_All .. Ada_Xor | Ada_With => keyword, - Ada_Par_Close .. Ada_Target => operator, - Ada_String | Ada_Char => a_string, - Ada_Decimal | Ada_Integer => number, - Ada_Comment => comment, - Ada_Identifier => Skip, - others => Skip); - - Mapped_Token : constant LSP.Messages.SemanticTokenTypes := - Map (Libadalang.Common.Kind (Token_Data)); - begin - -- If we have no token type calculated and no modifiers then - -- skip this token. For instance skip string literals those - -- are not in GHost code. This lets VS Code use rule-based - -- (lexical level) highlighter. Such highlighter is capable - -- to highlight character escape sequences inside a string - -- literal, or +/- before exponent in numeric literal, etc. - if Value.Is_Set or - (Mapped_Token /= Skip and then - Self.Token_Types.Contains (Mapped_Token) and then - Value.Modifiers /= Highlights_Holders.Empty) - then - pragma Assert - (Sloc_Range.End_Line = Sloc_Range.Start_Line); - - -- deltaLine - Result.Append (uint (Start.Line - Last.Line)); - -- deltaStartChar - Result.Append - (uint - (Start.Column - - (if Start.Line = Last.Line - then Last.Column else 1))); - -- length - Result.Append - (uint - (Sloc_Range.End_Column - Sloc_Range.Start_Column)); - -- tokenType - Result.Append - (Self.Token_Types - (if Value.Is_Set then Value.Kind else Mapped_Token)); - -- tokenModifiers - Result.Append (Self.To_Int (Value.Modifiers)); - - Last := Start; - end if; - end; - - Token := Libadalang.Common.Next (Token, Exclude_Trivia => True); - - exit when not (Token < To_Token); - end; - end loop; - end Get_Result; - - -------------------- - -- Highlight_Name -- - -------------------- - - procedure Highlight_Name (Node : Libadalang.Analysis.Name'Class) is - use all type LSP.Messages.SemanticTokenTypes; - use all type LSP.Messages.SemanticTokenModifiers; - use type Libadalang.Analysis.Defining_Name; - - function To_Kind (Decl : Libadalang.Analysis.Basic_Decl) - return LSP.Messages.SemanticTokenTypes; - - function Has_Abstract (Decl : Libadalang.Analysis.Basic_Decl) - return Boolean; - - function Is_Predefined (Decl : Libadalang.Analysis.Basic_Decl) - return Boolean; - - ------------------ - -- Has_Abstract -- - ------------------ - - function Has_Abstract (Decl : Libadalang.Analysis.Basic_Decl) - return Boolean - is - begin - case Decl.Kind is - when Ada_Abstract_Formal_Subp_Decl | - Ada_Abstract_Subp_Decl - => - return True; - when others => - return False; - end case; - end Has_Abstract; - - ------------------- - -- Is_Predefined -- - ------------------- - - function Is_Predefined (Decl : Libadalang.Analysis.Basic_Decl) - return Boolean - is - Name : Libadalang.Analysis.Name := - Decl.P_Enclosing_Compilation_Unit.P_Decl.P_Defining_Name.F_Name; - begin - if LSP.Lal_Utils.Is_Synthetic (Decl) then - return True; -- In Standard package - end if; - - while not Name.Is_Null and then Name.Kind = Ada_Dotted_Name loop - Name := Name.As_Dotted_Name.F_Prefix; - end loop; - - if not Name.Is_Null - and then Name.Kind = Ada_Identifier - and then (Name.P_Name_Is (Self.Ada) - or Name.P_Name_Is (Self.System) - or Name.P_Name_Is (Self.Interfaces)) - then - return True; - else - return False; - end if; - end Is_Predefined; - - ------------- - -- To_Kind -- - ------------- - - function To_Kind (Decl : Libadalang.Analysis.Basic_Decl) - return LSP.Messages.SemanticTokenTypes is - begin - case Decl.Kind is - when Libadalang.Common.Ada_Basic_Subp_Decl => - if Decl.Kind = Ada_Enum_Literal_Decl then - return enumMember; - else - return a_function; - end if; - when Libadalang.Common.Ada_Base_Type_Decl => - begin - if Decl.Kind = Ada_Single_Task_Type_Decl then - return variable; - elsif Decl.As_Base_Type_Decl.P_Is_Enum_Type then - return enum; - elsif Decl.As_Base_Type_Decl.P_Is_Interface_Type then - return an_interface; - elsif Decl.As_Base_Type_Decl.P_Is_Tagged_Type then - return class; - elsif Decl.As_Base_Type_Decl.P_Is_Record_Type then - return struct; - else - return a_type; - end if; - exception - when Property_Error => - -- If an error occurs while analysing the type (e.g. - -- incomplete code), default to "type". - return a_type; - end; - - when Ada_Base_Formal_Param_Decl => - case Ada_Base_Formal_Param_Decl'(Decl.Kind) is - when Ada_Component_Decl => - return property; - when Ada_Discriminant_Spec => - return typeParameter; - when Ada_Param_Spec => - return parameter; - when Ada_Generic_Formal_Obj_Decl => - return variable; - when Ada_Generic_Formal_Package => - return namespace; - when Ada_Generic_Formal_Subp_Decl => - return a_function; - when Ada_Generic_Formal_Type_Decl => - return a_type; -- class/enum/interface/struct...? - when Ada_Synthetic_Formal_Param_Decl => - -- Synthetic nodes do not correspond to source text - return Skip; - end case; - - when Libadalang.Common.Ada_Base_Package_Decl => - return namespace; - - when Ada_Body_Node => - begin - declare - Spec : constant Libadalang.Analysis.Basic_Decl := - Decl.As_Body_Node.P_Decl_Part (True); - begin - if not Spec.Is_Null then - -- If there's a spec, use it to determine the kind - return To_Kind (Spec); - end if; - end; - exception - when Property_Error => - -- In case of errors while trying to obtain the spec - -- (e.g. incomplete code), continue the logic below - -- based on the body node. - null; - end; - - -- If the above fails, handle the kinds of bodies directly - case Ada_Body_Node'(Decl.Kind) is - when Ada_Accept_Stmt_Body => - return Skip; - when Ada_Base_Subp_Body => - return a_function; - when Ada_Package_Body_Stub => - return namespace; - when Ada_Protected_Body_Stub => - return variable; - when Ada_Subp_Body_Stub => - return a_function; - when Ada_Task_Body_Stub => - return variable; - when Ada_Entry_Body => - return variable; - when Ada_Package_Body => - return namespace; - when Ada_Protected_Body => - return variable; - when Ada_Task_Body => - return variable; - end case; - - when Ada_Entry_Index_Spec => - return variable; - when Ada_Exception_Decl => - return a_type; - when Ada_Exception_Handler => - return variable; - when Ada_Object_Decl => - return variable; - when Ada_For_Loop_Var_Decl => - return variable; - when Ada_Generic_Package_Decl => - return namespace; - when Ada_Generic_Subp_Decl => - return a_function; - when Ada_Generic_Package_Instantiation => - return namespace; - when Ada_Generic_Subp_Instantiation => - return a_function; - when Ada_Generic_Package_Renaming_Decl => - return namespace; - when Ada_Generic_Subp_Renaming_Decl => - return a_function; - when Ada_Named_Stmt_Decl => - return namespace; - when Ada_Number_Decl => - return number; - when Ada_Package_Renaming_Decl => - return namespace; - when Ada_Single_Protected_Decl => - return variable; - when Ada_Single_Task_Decl => - return variable; - when others => - return Skip; - end case; - end To_Kind; - - Failsafe_Def : Libadalang.Analysis.Refd_Def; - Def : Libadalang.Analysis.Defining_Name; - Decl : Libadalang.Analysis.Basic_Decl; - Kind : LSP.Messages.SemanticTokenTypes; - begin - if Node.Kind not in Ada_Identifier | Ada_String_Literal then - -- Highlight only identifiers and operator symbols - return; - end if; - - if Node.P_Is_Defining then - Def := Node.P_Enclosing_Defining_Name; - - begin - declare - Is_Canonical : constant Boolean := - not Def.Is_Null and then Def.P_Canonical_Part = Def; - begin - if Is_Canonical then - Highlight_Token (Node.Token_Start, declaration); - else - Highlight_Token (Node.Token_Start, definition); - end if; - end; - exception - when Property_Error => - -- In case of errors (e.g. incomplete code) consider it - -- a canonical declaration. - Highlight_Token (Node.Token_Start, declaration); - end; - else - Failsafe_Def := Node.P_Failsafe_Referenced_Def_Name (True); - Def := Libadalang.Analysis.Defining_Name (Failsafe_Def.Def_Name); - end if; - - if Node.Kind in Libadalang.Common.Ada_Name then - begin - if Node.As_Name.P_Is_Write_Reference (True) then - Highlight_Token (Node.Token_Start, modification); - end if; - exception - when Libadalang.Common.Property_Error => null; - end; - end if; - - if not Def.Is_Null then - Decl := Def.P_Basic_Decl; - - if not Decl.Is_Null then - Kind := To_Kind (Decl); - if Kind /= Skip then - Highlight_Token (Node.Token_Start, Kind); - end if; - - begin - if Kind in variable | parameter | typeParameter | property - and then Decl.P_Is_Constant_Object - then - Highlight_Token (Node.Token_Start, readonly); - end if; - exception - when Libadalang.Common.Property_Error => null; - end; - - begin - if Decl.P_Is_Static_Decl then - Highlight_Token (Node.Token_Start, static); - end if; - exception - when Libadalang.Common.Property_Error => null; - end; - - begin - -- P_Has_Aspect checks the existence of either an aspect or - -- a pragma. - if Def.P_Has_Aspect (Self.Obsolescent) then - Highlight_Token (Node.Token_Start, deprecated); - end if; - exception - when Libadalang.Common.Property_Error => null; - end; - - if Has_Abstract (Decl) then - Highlight_Token (Node.Token_Start, an_abstract); - end if; - - if Is_Predefined (Decl) then - Highlight_Token (Node.Token_Start, defaultLibrary); - end if; - - return; - end if; - elsif Node.Kind = Ada_String_Literal then - return; -- This is not an operator symbol, so do nothing - end if; - - if Node.P_Is_Operator_Name then - Highlight_Token (Node.Token_Start, operator); - else - -- In case of unresolved identifiers, do not set any semantic - -- highlighting - null; - end if; - end Highlight_Name; - - Holder : Highlights_Holders.Highlights_Holder; - - -------------------- - -- Highlight_Node -- - -------------------- - - function Highlight_Node - (Node : Libadalang.Analysis.Ada_Node'Class) - return Libadalang.Common.Visit_Status - is - use all type LSP.Messages.SemanticTokenModifiers; - begin - if Node.Token_End < From_Token or To_Token < Node.Token_Start then - -- Skip uninteresting nodes to speedup traversal - return Libadalang.Common.Over; - elsif Is_Ghost_Root_Node (Node) then - -- Mark all tokens in a ghost element as `documentation` - Holder.Set_Token_Modifier - (Node.Token_Start, Node.Token_End, documentation); - end if; - - case Node.Kind is - when Libadalang.Common.Ada_Name => - Highlight_Name (Node.As_Name); - - when others => - null; - end case; - - return Libadalang.Common.Into; - exception - when E : Libadalang.Common.Property_Error => - if Highlighter_Debug.Is_Active then - LSP.Common.Log - (Trace, - E, - "In Highlight_Node at " - & Langkit_Support.Text.Image (Node.Full_Sloc_Image)); - end if; - return Libadalang.Common.Into; - end Highlight_Node; - - --------------------- - -- Highlight_Token -- - --------------------- - - procedure Highlight_Token - (Token : Libadalang.Common.Token_Reference; - Kind : LSP.Messages.SemanticTokenTypes) is - begin - if Token < From_Token or To_Token < Token then - -- Skip uninteresting tokens - return; - elsif not Self.Token_Types.Contains (Kind) then - -- Skip unsupported tokens - return; - end if; - - Holder.Set_Token_Kind (Token, Kind); - end Highlight_Token; - - --------------------- - -- Highlight_Token -- - --------------------- - - procedure Highlight_Token - (Token : Libadalang.Common.Token_Reference; - Kind : LSP.Messages.SemanticTokenModifiers) is - begin - if Token < From_Token or To_Token < Token then - -- Skip uninteresting tokens - return; - elsif not Self.Token_Modifiers.Contains (Kind) then - -- Skip unsupported tokens - return; - end if; - - Holder.Set_Token_Modifier (Token, Kind); - end Highlight_Token; - - ------------------------ - -- Is_Ghost_Root_Node -- - ------------------------ - - function Is_Ghost_Root_Node - (Node : Libadalang.Analysis.Ada_Node'Class) return Boolean is - begin - case Node.Kind is - when Libadalang.Common.Ada_Basic_Decl => - declare - Name : constant Libadalang.Analysis.Defining_Name := - Node.As_Basic_Decl.P_Defining_Name; - begin - return not Name.Is_Null and then Name.P_Is_Ghost_Code; - end; - when Libadalang.Common.Ada_Aspect_Spec => - -- Mark all aspects as a ghost code, because most of aspects - -- are contract specifications. - return True; - when others => - return False; - end case; - exception - when Libadalang.Common.Property_Error => - return False; - end Is_Ghost_Root_Node; - - Root : constant Libadalang.Analysis.Ada_Node := - Libadalang.Analysis.Root (Unit); - - Empty : Boolean; - begin - if Root.Is_Null or else - Libadalang.Common.No_Token in From_Token | To_Token - then - -- No tokens to highlight - return LSP.Messages.Empty; - end if; - - Holder.Initialize (From_Token, To_Token, Empty); - - if Empty then - return LSP.Messages.Empty; - end if; - - -- Traverse whole tree, look for intresting nodes and mark their - -- tokens in Holder for further processing - Root.Traverse (Highlight_Node'Access); - - return Result : LSP.Messages.uinteger_Vector do - Get_Result (Holder, Result); - end return; + return LSP.Structures.Empty; end Get_Tokens; ---------------- @@ -853,116 +36,10 @@ package body LSP.Ada_Highlighters is procedure Initialize (Self : in out Ada_Highlighter'Class; - Client : LSP.Messages.SemanticTokensClientCapabilities; - Legend : out LSP.Messages.SemanticTokensLegend) - is - use all type LSP.Messages.SemanticTokenTypes; - use all type LSP.Messages.SemanticTokenModifiers; - - procedure Append_Type - (Kind : LSP.Messages.SemanticTokenTypes; - Image : VSS.Strings.Virtual_String); - -- Update Legend.tokenTypes if client understands given Kind - - procedure Append_Modifier - (Kind : LSP.Messages.SemanticTokenModifiers; - Image : VSS.Strings.Virtual_String); - -- Update Legend.tokenModifiers if client understands given Kind - - function "+" (Source : Wide_Wide_String) return Unbounded_Text_Type - renames Ada.Strings.Wide_Wide_Unbounded.To_Unbounded_Wide_Wide_String; - - procedure Append_Modifier - (Kind : LSP.Messages.SemanticTokenModifiers; - Image : VSS.Strings.Virtual_String) is - begin - if Client.tokenModifiers.Contains (Kind) then - Self.Token_Modifiers.Insert - (Kind, - LSP.Messages.uinteger (2 ** Legend.tokenModifiers.Length)); - - Legend.tokenModifiers.Append (Image); - end if; - end Append_Modifier; - - ----------------- - -- Append_Type -- - ----------------- - - procedure Append_Type - (Kind : LSP.Messages.SemanticTokenTypes; - Image : VSS.Strings.Virtual_String) is - begin - if Client.tokenTypes.Contains (Kind) then - Self.Token_Types.Insert - (Kind, - LSP.Messages.uinteger (Legend.tokenTypes.Length)); - - Legend.tokenTypes.Append (Image); - end if; - end Append_Type; - + Client : LSP.Structures.SemanticTokensClientCapabilities; + Legend : out LSP.Structures.SemanticTokensLegend) is begin - Append_Type (namespace, "namespace"); - Append_Type (a_type, "type"); - Append_Type (class, "class"); - Append_Type (enum, "enum"); - Append_Type (an_interface, "interface"); - Append_Type (struct, "struct"); - Append_Type (typeParameter, "typeParameter"); - Append_Type (parameter, "parameter"); - Append_Type (variable, "variable"); - Append_Type (property, "property"); - Append_Type (enumMember, "enumMember"); - -- Append_Type (event, "event"); - Append_Type (a_function, "function"); - -- Append_Type (method, "method"); - -- Append_Type (macro, "macro"); - Append_Type (keyword, "keyword"); - Append_Type (modifier, "modifier"); - Append_Type (comment, "comment"); - Append_Type (a_string, "string"); - Append_Type (number, "number"); - -- Append_Type (regexp, "regexp"); - Append_Type (operator, "operator"); - - Append_Modifier (declaration, "declaration"); - Append_Modifier (definition, "definition"); - Append_Modifier (readonly, "readonly"); - Append_Modifier (static, "static"); - Append_Modifier (deprecated, "deprecated"); - Append_Modifier (an_abstract, "abstract"); - -- Append_Modifier (async, "async"); - Append_Modifier (modification, "modification"); - Append_Modifier (documentation, "documentation"); - Append_Modifier (defaultLibrary, "defaultLibrary"); - - Self.Obsolescent := +"Obsolescent"; - Self.Ada := +"Ada"; - Self.System := +"System"; - Self.Interfaces := +"Interfaces"; + null; end Initialize; - ------------ - -- To_Int -- - ------------ - - function To_Int - (Self : Ada_Highlighter'Class; - Set : Highlights_Holders.Modifier_Set) - return LSP.Messages.uinteger - is - use type LSP.Messages.uinteger; - - Result : LSP.Messages.uinteger := 0; - begin - for J in Set'Range loop - if Set (J) then - Result := Result + Self.Token_Modifiers (J); - end if; - end loop; - - return Result; - end To_Int; - end LSP.Ada_Highlighters; diff --git a/source/ada/lsp-ada_highlighters.ads b/source/ada/lsp-ada_highlighters.ads index b5650d635..cb566906d 100644 --- a/source/ada/lsp-ada_highlighters.ads +++ b/source/ada/lsp-ada_highlighters.ads @@ -1,7 +1,7 @@ ------------------------------------------------------------------------------ -- Language Server Protocol -- -- -- --- Copyright (C) 2022, AdaCore -- +-- Copyright (C) 2022-2023, AdaCore -- -- -- -- This is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -18,12 +18,11 @@ with Ada.Containers.Hashed_Maps; with Ada.Strings.Wide_Wide_Unbounded; -with GNATCOLL.Traces; - with Libadalang.Analysis; -with LSP.Messages; -with LSP.Types; +with LSP.Enumerations; +with LSP.Structures; +with LSP.Tracers; package LSP.Ada_Highlighters is @@ -31,43 +30,43 @@ package LSP.Ada_Highlighters is procedure Initialize (Self : in out Ada_Highlighter'Class; - Client : LSP.Messages.SemanticTokensClientCapabilities; - Legend : out LSP.Messages.SemanticTokensLegend); + Client : LSP.Structures.SemanticTokensClientCapabilities; + Legend : out LSP.Structures.SemanticTokensLegend); function Get_Tokens - (Self : Ada_Highlighter'Class; - Unit : Libadalang.Analysis.Analysis_Unit; - Trace : GNATCOLL.Traces.Trace_Handle; - Span : LSP.Messages.Span) - return LSP.Messages.uinteger_Vector; + (Self : Ada_Highlighter'Class; + Unit : Libadalang.Analysis.Analysis_Unit; + Tracer : in out LSP.Tracers.Tracer'Class; + Span : LSP.Structures.A_Range) + return LSP.Structures.Natural_Vector; -- If Span isn't empty then return unit tokens in given Span, otherwise -- return all tokens in the Unit. private - function Hash (Value : LSP.Messages.SemanticTokenTypes) + function Hash (Value : LSP.Enumerations.SemanticTokenTypes) return Ada.Containers.Hash_Type is (Ada.Containers.Hash_Type - (LSP.Messages.SemanticTokenTypes'Pos (Value))); + (LSP.Enumerations.SemanticTokenTypes'Pos (Value))); package Token_Type_Maps is new Ada.Containers.Hashed_Maps - (LSP.Messages.SemanticTokenTypes, - LSP.Messages.uinteger, + (LSP.Enumerations.SemanticTokenTypes, + Natural, Hash, - LSP.Messages."=", - LSP.Types."="); + LSP.Enumerations."=", + "="); - function Hash (Value : LSP.Messages.SemanticTokenModifiers) + function Hash (Value : LSP.Enumerations.SemanticTokenModifiers) return Ada.Containers.Hash_Type is (Ada.Containers.Hash_Type - (LSP.Messages.SemanticTokenModifiers'Pos (Value))); + (LSP.Enumerations.SemanticTokenModifiers'Pos (Value))); package Token_Modifier_Maps is new Ada.Containers.Hashed_Maps - (LSP.Messages.SemanticTokenModifiers, - LSP.Messages.uinteger, + (LSP.Enumerations.SemanticTokenModifiers, + Natural, Hash, - LSP.Messages."=", - LSP.Types."="); + LSP.Enumerations."=", + "="); subtype Unbounded_Text_Type is Ada.Strings.Wide_Wide_Unbounded.Unbounded_Wide_Wide_String; From 398e8c9c21bf5b92bdf7475b20fd02e1e37ca54f Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Mon, 14 Aug 2023 17:50:03 +0300 Subject: [PATCH 016/152] Add lsp-ada_contexts.ad[sb] and some dependencies Delete: * lsp-ada_completions-filters.adb * lsp-ada_completions.adb * lsp-ada_documents.adb * In lsp-ada_contexts.adb delete: * Append_Declarations * Update_Pp_Formatting_Options * Format * Range_Format * Get_Node_At * Get_Token_At Refs #1170 --- gnat/ignore_in_317.txt | 11 - source/ada/lsp-ada_completions-filters.adb | 265 +- source/ada/lsp-ada_completions-filters.ads | 16 +- source/ada/lsp-ada_completions.adb | 463 +-- source/ada/lsp-ada_completions.ads | 14 +- source/ada/lsp-ada_contexts.adb | 426 +-- source/ada/lsp-ada_contexts.ads | 99 +- source/ada/lsp-ada_documents.adb | 3109 ++---------------- source/ada/lsp-ada_documents.ads | 118 +- source/ada/lsp-ada_handlers-file_readers.adb | 11 +- source/ada/lsp-ada_handlers-file_readers.ads | 8 +- source/ada/lsp-ada_handlers.adb | 11 + source/ada/lsp-ada_handlers.ads | 11 + source/ada/lsp-diagnostic_sources.ads | 4 +- 14 files changed, 509 insertions(+), 4057 deletions(-) diff --git a/gnat/ignore_in_317.txt b/gnat/ignore_in_317.txt index 5cadaaab3..c024e3b67 100644 --- a/gnat/ignore_in_317.txt +++ b/gnat/ignore_in_317.txt @@ -1,13 +1,9 @@ -lsp-ada_completions.adb -lsp-ada_completions.ads lsp-ada_completions-aspects.adb lsp-ada_completions-aspects.ads lsp-ada_completions-attributes.adb lsp-ada_completions-attributes.ads lsp-ada_completions-end_names.adb lsp-ada_completions-end_names.ads -lsp-ada_completions-filters.adb -lsp-ada_completions-filters.ads lsp-ada_completions-generic_assoc.adb lsp-ada_completions-generic_assoc.ads lsp-ada_completions-generic_assoc_utils.ads @@ -21,20 +17,14 @@ lsp-ada_completions-pragmas.adb lsp-ada_completions-pragmas.ads lsp-ada_completions-use_clauses.adb lsp-ada_completions-use_clauses.ads -lsp-ada_contexts.adb -lsp-ada_contexts.ads lsp-ada_context_sets.adb lsp-ada_context_sets.ads lsp-ada_documentation.adb lsp-ada_documentation.ads -lsp-ada_documents.adb -lsp-ada_documents.ads lsp-ada_documents-lal_diagnostics.adb lsp-ada_documents-lal_diagnostics.ads lsp-ada_handlers-alire.adb lsp-ada_handlers-alire.ads -lsp-ada_handlers-file_readers.adb -lsp-ada_handlers-file_readers.ads lsp-ada_handlers-invisibles.adb lsp-ada_handlers-invisibles.ads lsp-ada_handlers-named_parameters_commands.adb @@ -75,7 +65,6 @@ lsp-client_side_file_monitors.adb lsp-client_side_file_monitors.ads lsp-common.adb lsp-common.ads -lsp-diagnostic_sources.ads lsp-error_decorators.adb lsp-error_decorators.ads lsp-fuzz_decorators.adb diff --git a/source/ada/lsp-ada_completions-filters.adb b/source/ada/lsp-ada_completions-filters.adb index 2f2cded2e..9494f6341 100644 --- a/source/ada/lsp-ada_completions-filters.adb +++ b/source/ada/lsp-ada_completions-filters.adb @@ -1,7 +1,7 @@ ------------------------------------------------------------------------------ -- Language Server Protocol -- -- -- --- Copyright (C) 2021, AdaCore -- +-- Copyright (C) 2021-2023, AdaCore -- -- -- -- This is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -15,27 +15,20 @@ -- of the license. -- ------------------------------------------------------------------------------ -with LSP.Lal_Utils; - package body LSP.Ada_Completions.Filters is - - function Kind - (Token : Libadalang.Common.Token_Reference) - return Libadalang.Common.Token_Kind - is (Libadalang.Common.Kind (Libadalang.Common.Data (Token))); + pragma Warnings (Off); ---------------- -- Initialize -- ---------------- procedure Initialize - (Self : in out Filter; - Token : Libadalang.Common.Token_Reference; - Node : Libadalang.Analysis.Ada_Node) + (Self : in out Filter; Token : Libadalang.Common.Token_Reference; + Node : Libadalang.Analysis.Ada_Node) is begin - Self.Token := Token; - Self.Node := Node; + pragma Compile_Time_Warning (Standard.True, "Initialize unimplemented"); + raise Program_Error with "Unimplemented procedure Initialize"; end Initialize; ------------------ @@ -44,47 +37,22 @@ package body LSP.Ada_Completions.Filters is function Is_End_Label (Self : in out Filter'Class) return Boolean is begin - if not Self.Is_End_Label.Is_Set then - declare - use all type Libadalang.Common.Ada_Node_Kind_Type; - - Parent : constant Libadalang.Analysis.Ada_Node := - (if Self.Node.Is_Null then Self.Node - else LSP.Lal_Utils.Skip_Dotted_Names (Self.Node.Parent)); - -- Skip the outermost dotted name enclosing Node.Parent, so - -- that when completing in a situation such as the following: - -- - -- end Ada.Tex| - -- ^ Cursor here - -- - -- we get the DottedName node's parent rather than just the "Tex" - -- Id. We want the DottedName parent rather than the Id so as - -- to get the proper completions (all elements in the "Ada" - -- namespace). - begin - if not Parent.Is_Null - and then Parent.Kind = Libadalang.Common.Ada_End_Name - then - Self.Is_End_Label := (True, True); - - elsif LSP.Lal_Utils.Is_End_Token (Self.Token) then - Self.Is_End_Label := (True, True); - - elsif LSP.Lal_Utils.Is_End_Token - (Libadalang.Common.Previous - (Self.Token, Exclude_Trivia => True)) - then - Self.Is_End_Label := (True, True); - - else - Self.Is_End_Label := (True, False); + pragma Compile_Time_Warning + (Standard.True, "Is_End_Label unimplemented"); + return raise Program_Error with "Unimplemented function Is_End_Label"; + end Is_End_Label; - end if; - end; - end if; + ------------------------ + -- Is_Numeric_Literal -- + ------------------------ - return Self.Is_End_Label.Value; - end Is_End_Label; + function Is_Numeric_Literal (Self : in out Filter'Class) return Boolean is + begin + pragma Compile_Time_Warning + (Standard.True, "Is_Numeric_Literal unimplemented"); + return + raise Program_Error with "Unimplemented function Is_Numeric_Literal"; + end Is_Numeric_Literal; ---------------------- -- Is_Attribute_Ref -- @@ -92,41 +60,10 @@ package body LSP.Ada_Completions.Filters is function Is_Attribute_Ref (Self : in out Filter'Class) return Boolean is begin - if not Self.Is_Attribute.Is_Set then - declare - use all type Libadalang.Common.Ada_Node_Kind_Type; - use all type Libadalang.Common.Token_Kind; - - Token_Kind : constant Libadalang.Common.Token_Kind := - Kind (Self.Token); - Parent : Libadalang.Analysis.Ada_Node := - (if Self.Node.Is_Null then Self.Node else Self.Node.Parent); - begin - -- Get the outermost dotted name of which node is a prefix, so - -- that when completing in a situation such as the following: - -- - -- end Ada.Tex| - -- ^ Cursor here - -- - -- we get the DottedName node rather than just the "Tex" BaseId. - -- We want the DottedName rather than the Id so as to get the - -- proper completions (all elements in the "Ada" namespace). - - while not Parent.Is_Null - and then Parent.Kind = Ada_Dotted_Name - loop - Parent := Parent.Parent; - end loop; - - Self.Is_Attribute := - (True, - Token_Kind = Ada_Tick or else - (not Parent.Is_Null - and then Parent.Kind = Ada_Attribute_Ref)); - end; - end if; - - return Self.Is_Attribute.Value; + pragma Compile_Time_Warning + (Standard.True, "Is_Attribute_Ref unimplemented"); + return + raise Program_Error with "Unimplemented function Is_Attribute_Ref"; end Is_Attribute_Ref; --------------- @@ -135,43 +72,8 @@ package body LSP.Ada_Completions.Filters is function Is_Aspect (Self : in out Filter'Class) return Boolean is begin - if not Self.Is_Aspect.Is_Set then - declare - use Libadalang.Common; - - Token_Kind : constant Libadalang.Common.Token_Kind := - Kind (Libadalang.Common.Previous - (Self.Token, Exclude_Trivia => True)); - Parent : Libadalang.Analysis.Ada_Node := - (if Self.Node.Is_Null then Self.Node else Self.Node.Parent); - begin - -- Get the outermost dotted name of which node is a prefix, so - -- that when completing in a situation such as the following: - -- - -- end Ada.Tex| - -- ^ Cursor here - -- - -- we get the DottedName node rather than just the "Tex" BaseId. - -- We want the DottedName rather than the Id so as to get the - -- proper completions (all elements in the "Ada" namespace). - - while not Parent.Is_Null - and then Parent.Kind = Ada_Dotted_Name - loop - Parent := Parent.Parent; - end loop; - - Self.Is_Aspect := - (True, - Token_Kind = Ada_With and then - (Self.Node.Kind in Ada_Aspect_Spec_Range - or else - (not Parent.Is_Null - and then Parent.Kind in Ada_Aspect_Assoc_Range))); - end; - end if; - - return Self.Is_Aspect.Value; + pragma Compile_Time_Warning (Standard.True, "Is_Aspect unimplemented"); + return raise Program_Error with "Unimplemented function Is_Aspect"; end Is_Aspect; ------------------ @@ -180,20 +82,9 @@ package body LSP.Ada_Completions.Filters is function Is_Semicolon (Self : in out Filter'Class) return Boolean is begin - if not Self.Is_Semicolon.Is_Set then - declare - use all type Libadalang.Common.Token_Kind; - - Token_Kind : constant Libadalang.Common.Token_Kind := - Kind (Self.Token); - begin - Self.Is_Semicolon := - (True, - Token_Kind = Ada_Semicolon); - end; - end if; - - return Self.Is_Semicolon.Value; + pragma Compile_Time_Warning + (Standard.True, "Is_Semicolon unimplemented"); + return raise Program_Error with "Unimplemented function Is_Semicolon"; end Is_Semicolon; -------------- @@ -202,102 +93,8 @@ package body LSP.Ada_Completions.Filters is function Is_Comma (Self : in out Filter'Class) return Boolean is begin - if not Self.Is_Comma.Is_Set then - declare - use all type Libadalang.Common.Token_Kind; - - Token_Kind : constant Libadalang.Common.Token_Kind := - Kind (Self.Token); - begin - Self.Is_Comma := - (True, - Token_Kind = Ada_Comma); - end; - end if; - - return Self.Is_Comma.Value; + pragma Compile_Time_Warning (Standard.True, "Is_Comma unimplemented"); + return raise Program_Error with "Unimplemented function Is_Comma"; end Is_Comma; - ------------------------ - -- Is_Numeric_Literal -- - ------------------------ - - function Is_Numeric_Literal (Self : in out Filter'Class) return Boolean is - use all type Libadalang.Common.Token_Kind; - - First : Libadalang.Common.Token_Reference := Self.Token; - begin - if Self.Is_Numeric_Literal.Is_Set then - return Self.Is_Numeric_Literal.Value; - end if; - - -- Let me be pessimistic - Self.Is_Numeric_Literal := LSP.Types.False; - - -- An incomplete numeric literal may be represented in LAL as tokens. - -- Scan tokens backward till the start token of numeric literal. - case Kind (First) is - when Ada_Lexing_Failure => - -- (Integer|Decimal) (Lexing_Failure) - -- 1_ - -- 1.0_ - -- 1e0_ - if Libadalang.Common.Text (First) /= "_" then - return Self.Is_Numeric_Literal.Value; - end if; - - First := Libadalang.Common.Previous (First); - - when Ada_Dot | Ada_Prep_Line => - -- (Integer) (Prep_Line) - -- 2# - -- 2#1 - -- (Integer) (Dot) - -- 1. - First := Libadalang.Common.Previous (First); - - if Kind (First) /= Ada_Integer then - return Self.Is_Numeric_Literal.Value; - end if; - - when Ada_Identifier => - -- (Integer|Decimal) (Identifier) - -- 1.0e - if Libadalang.Common.Text (First) in "e" | "E" then - First := Libadalang.Common.Previous (First); - else - return Self.Is_Numeric_Literal.Value; - end if; - - when Ada_Plus | Ada_Minus => - -- (Integer|Decimal) (Identifier) (Plus|Minus) - -- 1.0e+ - First := Libadalang.Common.Previous (First); - - if Kind (First) = Ada_Identifier - and then Libadalang.Common.Text (First) in "e" | "E" - then - First := Libadalang.Common.Previous (First); - else - return Self.Is_Numeric_Literal.Value; - end if; - - when Ada_Integer | Ada_Decimal => - -- A complete (valid) numeric literal - null; - - when others => - return Self.Is_Numeric_Literal.Value; - end case; - - if Kind (First) not in Ada_Integer | Ada_Decimal then - return Self.Is_Numeric_Literal.Value; - end if; - - -- Ok, we have found a numeric literal - Self.Is_Numeric_Literal := LSP.Types.True; - - return Self.Is_Numeric_Literal.Value; - end Is_Numeric_Literal; - end LSP.Ada_Completions.Filters; diff --git a/source/ada/lsp-ada_completions-filters.ads b/source/ada/lsp-ada_completions-filters.ads index d547e306b..8aecee609 100644 --- a/source/ada/lsp-ada_completions-filters.ads +++ b/source/ada/lsp-ada_completions-filters.ads @@ -1,7 +1,7 @@ ------------------------------------------------------------------------------ -- Language Server Protocol -- -- -- --- Copyright (C) 2021, AdaCore -- +-- Copyright (C) 2021-2023, AdaCore -- -- -- -- This is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -15,7 +15,7 @@ -- of the license. -- ------------------------------------------------------------------------------ -with LSP.Types; +with LSP.Structures; package LSP.Ada_Completions.Filters is @@ -53,12 +53,12 @@ private type Filter is tagged limited record Token : Libadalang.Common.Token_Reference; Node : Libadalang.Analysis.Ada_Node; - Is_End_Label : LSP.Types.Optional_Boolean; - Is_Numeric_Literal : LSP.Types.Optional_Boolean; - Is_Attribute : LSP.Types.Optional_Boolean; - Is_Aspect : LSP.Types.Optional_Boolean; - Is_Semicolon : LSP.Types.Optional_Boolean; - Is_Comma : LSP.Types.Optional_Boolean; + Is_End_Label : LSP.Structures.Boolean_Optional; + Is_Numeric_Literal : LSP.Structures.Boolean_Optional; + Is_Attribute : LSP.Structures.Boolean_Optional; + Is_Aspect : LSP.Structures.Boolean_Optional; + Is_Semicolon : LSP.Structures.Boolean_Optional; + Is_Comma : LSP.Structures.Boolean_Optional; end record; end LSP.Ada_Completions.Filters; diff --git a/source/ada/lsp-ada_completions.adb b/source/ada/lsp-ada_completions.adb index 01ca7ae1d..6ce085674 100644 --- a/source/ada/lsp-ada_completions.adb +++ b/source/ada/lsp-ada_completions.adb @@ -1,7 +1,7 @@ ------------------------------------------------------------------------------ -- Language Server Protocol -- -- -- --- Copyright (C) 2018-2021, AdaCore -- +-- Copyright (C) 2018-2023, AdaCore -- -- -- -- This is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -15,51 +15,21 @@ -- of the license. -- ------------------------------------------------------------------------------ -with Ada.Characters.Latin_1; -with Ada.Containers.Indefinite_Hashed_Maps; -with Ada.Containers.Hashed_Sets; -with Ada.Strings; -with Ada.Strings.Hash; -with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; - -with GNATCOLL.Traces; - -with GNAT.Regpat; use GNAT.Regpat; -with GNAT.Strings; - -with Langkit_Support; -with Libadalang.Analysis; use Libadalang.Analysis; - -with LSP.Ada_Contexts; -with LSP.Ada_Documents; -with LSP.Common; -with LSP.Lal_Utils; -with LSP.Messages; use LSP.Messages; - -with Pp.Actions; -with Pp.Command_Lines; -with Pp.Scanner; -with Utils.Char_Vectors; -with Utils.Command_Lines; -with Utils.Command_Lines.Common; -with VSS.Strings; -with VSS.Strings.Conversions; - package body LSP.Ada_Completions is - - Me_Formatting : constant GNATCOLL.Traces.Trace_Handle := - GNATCOLL.Traces.Create - ("ALS.COMPLETION.FORMATTING", Default => GNATCOLL.Traces.On); + pragma Warnings (Off); ------------------------ -- Is_Full_Sloc_Equal -- ------------------------ function Is_Full_Sloc_Equal - (Left, Right : Libadalang.Analysis.Defining_Name) return Boolean is + (Left, Right : Libadalang.Analysis.Defining_Name) return Boolean + is begin - return Libadalang.Analysis.Full_Sloc_Image - (Left) = Libadalang.Analysis.Full_Sloc_Image (Right); + pragma Compile_Time_Warning + (Standard.True, "Is_Full_Sloc_Equal unimplemented"); + return + raise Program_Error with "Unimplemented function Is_Full_Sloc_Equal"; end Is_Full_Sloc_Equal; ----------------------- @@ -67,75 +37,17 @@ package body LSP.Ada_Completions is ----------------------- procedure Write_Completions - (Context : LSP.Ada_Contexts.Context; - Document : LSP.Ada_Documents.Document; - Sloc : Langkit_Support.Slocs.Source_Location; - Node : Libadalang.Analysis.Ada_Node; - Names : Completion_Maps.Map; - Named_Notation_Threshold : Natural; - Compute_Doc_And_Details : Boolean; - Result : in out LSP.Messages.CompletionItem_Vector) + (Context : LSP.Ada_Contexts.Context; + Document : LSP.Ada_Documents.Document; + Sloc : Langkit_Support.Slocs.Source_Location; + Node : Libadalang.Analysis.Ada_Node; Names : Completion_Maps.Map; + Named_Notation_Threshold : Natural; Compute_Doc_And_Details : Boolean; + Result : in out LSP.Structures.CompletionItem_Vector) is - function Hash (Value : VSS.Strings.Virtual_String) - return Ada.Containers.Hash_Type - is (Ada.Containers.Hash_Type'Mod (Value.Hash)); - - package String_Sets is new Ada.Containers.Hashed_Sets - (VSS.Strings.Virtual_String, Hash, VSS.Strings."=", VSS.Strings."="); - - Seen : String_Sets.Set; - -- Set of found visible names in canonical form - Length : constant Natural := Natural (Names.Length); begin - - -- Write Result in two pases. Firstly append all visible names and - -- populate Seen set. Then append invisible names not in Seen. - - for Visible in reverse Boolean loop -- Phase: True then False - for Cursor in Names.Iterate loop - declare - Append : Boolean := False; - Info : constant Name_Information := Names (Cursor); - Name : constant Libadalang.Analysis.Defining_Name := - Completion_Maps.Key (Cursor); - Selector : constant Libadalang.Analysis.Name := - Name.P_Relative_Name; - Label : VSS.Strings.Virtual_String; - Canonical : VSS.Strings.Virtual_String; - begin - if Visible and Info.Is_Visible then - Label := LSP.Lal_Utils.To_Virtual_String (Selector.Text); - Canonical := LSP.Lal_Utils.Canonicalize (Label); - Seen.Include (Canonical); - Append := True; - elsif not Visible and not Info.Is_Visible then - -- Append invisible name on if no such visible name found - Label := LSP.Lal_Utils.To_Virtual_String (Selector.Text); - Canonical := LSP.Lal_Utils.Canonicalize (Label); - Append := not Seen.Contains (Canonical); - end if; - - if Append then - Result.Append - (LSP.Ada_Documents.Compute_Completion_Item - (Document => Document, - Context => Context, - Sloc => Sloc, - Node => Node, - BD => Name.P_Basic_Decl, - Label => Label, - Use_Snippets => Info.Use_Snippets, - Compute_Doc_And_Details => Compute_Doc_And_Details, - Named_Notation_Threshold => Named_Notation_Threshold, - Is_Dot_Call => Info.Is_Dot_Call, - Is_Visible => Info.Is_Visible, - Pos => Info.Pos, - Weight => Info.Weight, - Completions_Count => Length)); - end if; - end; - end loop; - end loop; + pragma Compile_Time_Warning + (Standard.True, "Write_Completions unimplemented"); + raise Program_Error with "Unimplemented procedure Write_Completions"; end Write_Completions; -------------------------- @@ -143,305 +55,14 @@ package body LSP.Ada_Completions is -------------------------- procedure Pretty_Print_Snippet - (Context : LSP.Ada_Contexts.Context; - Prefix : String; - Offset : Natural; - Span : LSP.Messages.Span; - Rule : Libadalang.Common.Grammar_Rule; - Result : in out LSP.Messages.CompletionItem) + (Context : LSP.Ada_Contexts.Context; Prefix : String; Offset : Natural; + Span : LSP.Structures.A_Range; Rule : Libadalang.Common.Grammar_Rule; + Result : in out LSP.Structures.CompletionItem) is - - package Encoding_Maps is new Ada.Containers.Indefinite_Hashed_Maps - (Key_Type => String, - Element_Type => String, - Hash => Ada.Strings.Hash, - Equivalent_Keys => "="); - - Encoding : Encoding_Maps.Map; - -- Map of Snippet fake name to snippet: - -- {"Foo_1" : "$1", "Foo_2" : "${2: Integer}"} - -- $0 will not be replaced - - procedure Set_PP_Switches - (Cmd : in out Utils.Command_Lines.Command_Line); - -- Force switches not enabled by default by GNATpp - - function Encode_String (S : String) return String; - -- Create pseudo code for the snippet - - function Decode_String (S : String) return String; - -- Recreate the snippet via the pseudo code - - function Snippet_Placeholder (S : String) return String - is ("FooBar_" & S); - -- Generate a fake entity for a snippet (S is the index of the snippet) - -- The length of the placeholder will affect where the strings is cut - -- to avoid exceeding line length => 8/9 characters seems to be - -- reasonable (most of the time a placeholder is replacing the - -- parameter type's name) - - function Find_Next_Placeholder - (S : String; - Start : Integer) - return Match_Location; - -- Find the next placeholder starting from Start in S - - function Post_Pretty_Print (S : String) return String; - -- Indent the block using the initial location and add back $0 (it has - -- been removed to not generate invalid pseudo code) - - --------------------- - -- Set_PP_Switches -- - --------------------- - - procedure Set_PP_Switches - (Cmd : in out Utils.Command_Lines.Command_Line) is - - begin - -- If not set by the user: align parameters and aggregates - - if not Pp.Command_Lines.Pp_Nat_Switches.Explicit - (Cmd, Pp.Command_Lines.Call_Threshold) - then - Pp.Command_Lines.Pp_Nat_Switches.Set_Arg - (Cmd, Pp.Command_Lines.Call_Threshold, 1); - end if; - - if not Pp.Command_Lines.Pp_Nat_Switches.Explicit - (Cmd, Pp.Command_Lines.Par_Threshold) - then - Pp.Command_Lines.Pp_Nat_Switches.Set_Arg - (Cmd, Pp.Command_Lines.Par_Threshold, 1); - end if; - - if not Pp.Command_Lines.Pp_Boolean_Switches.Explicit - (Cmd, Pp.Command_Lines.Vertical_Named_Aggregates) - then - Pp.Command_Lines.Pp_Boolean_Switches.Set_Arg - (Cmd, Pp.Command_Lines.Vertical_Named_Aggregates); - end if; - end Set_PP_Switches; - - ------------------- - -- Encode_String -- - ------------------- - - function Encode_String (S : String) return String - is - Res : Unbounded_String; - Start_Encoded : Natural := 0; - Search_Index : Boolean := False; - Encoded_Index : Unbounded_String; - In_Snippet : Boolean := False; - - procedure Add_Placeholder (Cursor : Natural); - - --------------------- - -- Add_Placeholder -- - --------------------- - - procedure Add_Placeholder (Cursor : Natural) is - Placeholder : constant String := - Snippet_Placeholder (To_String (Encoded_Index)); - begin - if Encoded_Index /= Null_Unbounded_String then - Encoding.Insert - (Placeholder, S (Start_Encoded .. Cursor)); - Append (Res, Placeholder); - Encoded_Index := Null_Unbounded_String; - end if; - end Add_Placeholder; - - begin - for I in S'Range loop - case S (I) is - when '$' => - Search_Index := True; - Start_Encoded := I; - Encoded_Index := Null_Unbounded_String; - when '{' => - In_Snippet := True; - when '}' => - Add_Placeholder (I); - In_Snippet := False; - Search_Index := False; - when '0' .. '9' => - if Search_Index then - Append (Encoded_Index, S (I)); - elsif not In_Snippet then - Append (Res, S (I)); - end if; - when others => - Search_Index := False; - if not In_Snippet then - Add_Placeholder (I); - Append (Res, S (I)); - end if; - end case; - end loop; - - -- Do nothing for $0 which will be removed at the end - - return To_String (Res); - end Encode_String; - - ------------------- - -- Decode_String -- - ------------------- - - function Decode_String (S : String) return String - is - Res : Unbounded_String; - U : Unbounded_String := To_Unbounded_String (S); - begin - -- Remove the extra whitespace at the start - Trim (U, Ada.Strings.Left); - - declare - Trimed_S : constant String := To_String (U); - Cur_Index : Natural := Trimed_S'First; - begin - loop - declare - Match : constant Match_Location := - Find_Next_Placeholder (Trimed_S, Cur_Index); - begin - exit when Match = No_Match; - Append - (Res, Trimed_S (Cur_Index .. Match.First - 1)); - Append - (Res, Encoding (Trimed_S (Match.First .. Match.Last))); - Cur_Index := Match.Last + 1; - end; - end loop; - - Append (Res, Trimed_S (Cur_Index .. Trimed_S'Last)); - end; - - return To_String (Res); - end Decode_String; - - --------------------------- - -- Find_Next_Placeholder -- - --------------------------- - - function Find_Next_Placeholder - (S : String; - Start : Integer) - return Match_Location - is - Placeholder_Regexp : constant Pattern_Matcher := - Compile ("FooBar_[0-9]+"); - Matched : Match_Array (0 .. 0); - begin - Match - (Self => Placeholder_Regexp, - Data => S, - Matches => Matched, - Data_First => Start); - return Matched (0); - end Find_Next_Placeholder; - - ----------------------- - -- Post_Pretty_Print -- - ----------------------- - - function Post_Pretty_Print (S : String) return String - is - Res : Unbounded_String; - begin - -- Remove this condition when V725-006 is fixed - if S (S'Last) = Ada.Characters.Latin_1.LF then - Append (Res, S (S'First .. S'Last - 1)); - else - Append (Res, S); - end if; - - -- Add back snippet terminator - Append (Res, "$0"); - return To_String (Res); - end Post_Pretty_Print; - begin - if Me_Formatting.Active - and then Result.insertText.Is_Set - and then Result.insertTextFormat.Is_Set - and then Result.insertTextFormat.Value = Snippet - then - declare - Input : Utils.Char_Vectors.Char_Vector; - Output : Utils.Char_Vectors.Char_Vector; - PP_Messages : Pp.Scanner.Source_Message_Vector; - S : GNAT.Strings.String_Access; - Tmp_Unit : Analysis_Unit; - Cmd : Utils.Command_Lines.Command_Line := Context.Get_PP_Options; - Tmp_Context : constant Analysis_Context := - Create_Context - (Charset => - Utils.Command_Lines.Common.Wide_Character_Encoding (Cmd)); - begin - Set_PP_Switches (Cmd); - - S := - new String' - (VSS.Strings.Conversions.To_UTF_8_String - (Result.insertText.Value)); - - declare - Full : constant String := Prefix & Encode_String (S.all); - begin - Input.Append (Full); - Tmp_Unit := - Get_From_Buffer - (Context => Tmp_Context, - Filename => "", - Buffer => Full, - Rule => Rule); - Pp.Actions.Format_Vector - (Cmd => Cmd, - Input => Input, - Node => Root (Tmp_Unit), - Output => Output, - Messages => PP_Messages, - Initial_Indentation => Offset, - Partial_GNATPP => True); - exception - when E : others => - -- Failed to pretty print the snippet, keep the previous - -- value. - LSP.Common.Log (Context.Trace, E); - return; - end; - - GNAT.Strings.Free (S); - S := new String'(Output.To_Array); - - if S.all /= "" then - -- The text is already formatted, don't try to indent it - Result.insertTextMode := - (Is_Set => True, - Value => asIs); - - -- Label is too verbose and can conflict with client filtering - -- set filterText to the content of the span we are replacing. - Result.filterText := - (Is_Set => True, - Value => - VSS.Strings.Conversions.To_Virtual_String (Prefix)); - - Result.textEdit := - (Is_Set => True, - Value => - (Is_TextEdit => True, - TextEdit => - (span => Span, - newText => - VSS.Strings.Conversions.To_Virtual_String - (Post_Pretty_Print (Decode_String (S.all)))))); - end if; - GNAT.Strings.Free (S); - end; - end if; + pragma Compile_Time_Warning + (Standard.True, "Pretty_Print_Snippet unimplemented"); + raise Program_Error with "Unimplemented procedure Pretty_Print_Snippet"; end Pretty_Print_Snippet; --------------------------- @@ -449,38 +70,14 @@ package body LSP.Ada_Completions is --------------------------- procedure Generic_Write_Symbols - (Names : Completion_Maps.Map; - Result : in out LSP.Messages.Symbol_Vector) is + (Names : Completion_Maps.Map; + Result : in out LSP.Structures.DocumentSymbol_Vector) + is begin - for Cursor in Names.Iterate loop - declare - Name : constant Libadalang.Analysis.Defining_Name := - Completion_Maps.Key (Cursor); - Node : Libadalang.Analysis.Ada_Node := Name.As_Ada_Node; - begin - while not Node.Is_Null and then - Node.Kind not in Libadalang.Common.Ada_Basic_Decl - loop - Node := Node.Parent; - end loop; - - if not Node.Is_Null then - Result.Vector.Append - (LSP.Messages.SymbolInformation' - (name => LSP.Lal_Utils.To_Virtual_String (Name.Text), - kind => LSP.Lal_Utils.Get_Decl_Kind - (Node.As_Basic_Decl), - location => LSP.Lal_Utils.Get_Node_Location - (Name.As_Ada_Node), - alsIsAdaProcedure => <>, - tags => LSP.Messages.Empty, - deprecated => <>, - containerName => <>)); - end if; - - exit when Has_Been_Canceled; - end; - end loop; + pragma Assert (not Has_Been_Canceled); + pragma Compile_Time_Warning + (Standard.True, "Generic_Write_Symbols unimplemented"); + raise Program_Error with "Unimplemented procedure Generic_Write_Symbols"; end Generic_Write_Symbols; end LSP.Ada_Completions; diff --git a/source/ada/lsp-ada_completions.ads b/source/ada/lsp-ada_completions.ads index 77d51a31e..3e6ca7148 100644 --- a/source/ada/lsp-ada_completions.ads +++ b/source/ada/lsp-ada_completions.ads @@ -1,7 +1,7 @@ ------------------------------------------------------------------------------ -- Language Server Protocol -- -- -- --- Copyright (C) 2018-2021, AdaCore -- +-- Copyright (C) 2018-2023, AdaCore -- -- -- -- This is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -29,7 +29,7 @@ limited with LSP.Ada_Contexts; limited with LSP.Ada_Documents; limited with LSP.Ada_Completions.Filters; -with LSP.Messages; +with LSP.Structures; package LSP.Ada_Completions is @@ -83,7 +83,7 @@ package LSP.Ada_Completions is Node : Libadalang.Analysis.Ada_Node; Filter : in out LSP.Ada_Completions.Filters.Filter; Names : in out Ada_Completions.Completion_Maps.Map; - Result : in out LSP.Messages.CompletionList) is abstract; + Result : in out LSP.Structures.CompletionList) is abstract; -- Populate Names and Result with completions for given Source_Location. -- Names works for defining name completions to create snippets and to -- avoid duplicates. The Token's span encloses Sloc-1, but not Sloc itself. @@ -103,7 +103,7 @@ package LSP.Ada_Completions is Names : Completion_Maps.Map; Named_Notation_Threshold : Natural; Compute_Doc_And_Details : Boolean; - Result : in out LSP.Messages.CompletionItem_Vector); + Result : in out LSP.Structures.CompletionItem_Vector); -- Convert all the completion Names into LSP completion items' results. -- Named_Notation_Threshold defines the number of parameters/components at -- which point named notation is used for subprogram/aggregate completion @@ -116,9 +116,9 @@ package LSP.Ada_Completions is (Context : LSP.Ada_Contexts.Context; Prefix : String; Offset : Natural; - Span : LSP.Messages.Span; + Span : LSP.Structures.A_Range; Rule : Libadalang.Common.Grammar_Rule; - Result : in out LSP.Messages.CompletionItem); + Result : in out LSP.Structures.CompletionItem); -- If Result is a snippet then generate a textEdit over span using GNATpp. -- Rule must match the content of "Prefix & Result.insertText.Value" @@ -126,7 +126,7 @@ package LSP.Ada_Completions is with function Has_Been_Canceled return Boolean; procedure Generic_Write_Symbols (Names : Completion_Maps.Map; - Result : in out LSP.Messages.Symbol_Vector); + Result : in out LSP.Structures.DocumentSymbol_Vector); type Completion_Provider_Access is access all LSP.Ada_Completions.Completion_Provider'Class; diff --git a/source/ada/lsp-ada_contexts.adb b/source/ada/lsp-ada_contexts.adb index 1fa96b940..d162cad2e 100644 --- a/source/ada/lsp-ada_contexts.adb +++ b/source/ada/lsp-ada_contexts.adb @@ -30,14 +30,8 @@ with GPR2.Project.Source; with VSS.Strings.Conversions; -with URIs; -with LSP.Ada_Id_Iterators; -with LSP.Common; use LSP.Common; -with LSP.Lal_Utils; use LSP.Lal_Utils; - with Libadalang.Common; use Libadalang.Common; with Libadalang.Project_Provider; - with Langkit_Support.Slocs; with Utils.Command_Lines.Common; @@ -45,17 +39,19 @@ with Utils.Command_Lines.Common; with Pp.Actions; with Langkit_Support.Text; +with URIs; +with LSP.Ada_Id_Iterators; +with LSP.Structures; + package body LSP.Ada_Contexts is Indexing_Trace : constant Trace_Handle := Create ("ALS.INDEXING", Off); - Formatting_Trace : constant Trace_Handle := Create ("ALS.FORMATTING", On); - use type Libadalang.Analysis.Analysis_Unit; type LSP_Context_Event_Handler_Type is new Libadalang.Analysis.Event_Handler_Interface with record - Trace : Trace_Handle; + Tracer : LSP.Tracers.Tracer_Access; end record; -- LAL event handler used to log units that have notbeen found when -- requested. @@ -95,24 +91,13 @@ package body LSP.Ada_Contexts is function URI_To_File (Self : Context; - URI : LSP.Types.LSP_URI) - return Ada.Strings.UTF_Encoding.UTF_8_String - is (URIs.Conversions.To_File (LSP.Types.To_UTF_8_String (URI), - Self.Follow_Symlinks)); - - function URI_To_File - (Self : Context; - URI : LSP.Types.LSP_URI) + URI : LSP.Structures.DocumentUri) return GNATCOLL.VFS.Virtual_File is - (GNATCOLL.VFS.Create_From_UTF8 (Self.URI_To_File (URI))); - - procedure Update_Pp_Formatting_Options - (Pp_Options : in out Utils.Command_Lines.Command_Line; - LSP_Options : LSP.Messages.FormattingOptions); - -- Update the gnatpp formatting options using the LSP ones. - -- Options that are explicitly specified in the .gpr file take precedence - -- over LSP options. + (GNATCOLL.VFS.Create_From_UTF8 + (URIs.Conversions.To_File + (VSS.Strings.Conversions.To_UTF_8_String (URI), + Self.Follow_Symlinks))); ----------------------------- -- Unit_Requested_Callback -- @@ -127,137 +112,12 @@ package body LSP.Ada_Contexts is Is_Not_Found_Error : Boolean) is begin if not Found then - Self.Trace.Trace + Self.Tracer.Trace ("Failed to request the following unit: " & Langkit_Support.Text.To_UTF8 (Name)); end if; end Unit_Requested_Callback; - ------------------------- - -- Append_Declarations -- - ------------------------- - - procedure Append_Declarations - (Self : Context; - Document : LSP.Ada_Documents.Document_Access; - Position : LSP.Messages.TextDocumentPositionParams; - Display_Method_Ancestry_Policy : - LSP.Messages.AlsDisplayMethodAncestryOnNavigationPolicy; - Result : in out LSP.Messages.Location_Or_Link_Vector; - Imprecise : in out Boolean) - is - use LSP.Messages; - use Libadalang.Analysis; - - Name_Node : constant Libadalang.Analysis.Name := - Laltools.Common.Get_Node_As_Name - (Self.Get_Node_At (Document, Position)); - - Definition : Libadalang.Analysis.Defining_Name; - -- A defining name that corresponds to Name_Node - First_Part : Libadalang.Analysis.Defining_Name; - -- "Canonical part" of Definition - Prev_Part : Libadalang.Analysis.Defining_Name; - -- A previous name for Definition - Decl_For_Find_Overrides : Libadalang.Analysis.Basic_Decl := - Libadalang.Analysis.No_Basic_Decl; - - On_Defining_Name : Boolean := False; - -- Set to True if we are on a denfining name node - begin - if Name_Node = Libadalang.Analysis.No_Name then - return; - end if; - - -- Check if we are on some defining name - Definition := Laltools.Common.Get_Name_As_Defining (Name_Node); - - if Definition = Libadalang.Analysis.No_Defining_Name then - -- If we aren't on a defining_name already then try to resolve - declare - Is_Imprecise : Boolean; - begin - Definition := Laltools.Common.Resolve_Name - (Name_Node, Self.Trace, Is_Imprecise); - - Imprecise := Imprecise or Is_Imprecise; - end; - else - On_Defining_Name := True; - end if; - - if Definition = Libadalang.Analysis.No_Defining_Name then - return; -- Name resolution fails, nothing to do. - end if; - - -- Display the method ancestry in three cases: - -- - -- . When the preference is set to Always - -- - -- . When we are on a usage node (e.g: subprogram call) and if the - -- preference is set to Usage_And_Abstract_Only - -- - -- . When we are on a defining name node and if the preference is - -- set to Definition_Only - - if Display_Method_Ancestry_Policy = Always - or else (Display_Method_Ancestry_Policy = Usage_And_Abstract_Only - and then not On_Defining_Name) - or else (Display_Method_Ancestry_Policy = Definition_Only - and then On_Defining_Name) - then - First_Part := Laltools.Common.Find_Canonical_Part - (Definition, Self.Trace); - - if First_Part = Libadalang.Analysis.No_Defining_Name then - Decl_For_Find_Overrides := Definition.P_Basic_Decl; - else - Decl_For_Find_Overrides := First_Part.P_Basic_Decl; - end if; - end if; - - begin - Prev_Part := Definition.P_Previous_Part; - exception - when E : Libadalang.Common.Property_Error => - Log (Self.Trace, E); - Prev_Part := Libadalang.Analysis.No_Defining_Name; - end; - - if Prev_Part /= Libadalang.Analysis.No_Defining_Name then - -- We have found previous part, return it. - LSP.Lal_Utils.Append_Location (Result, Prev_Part); - elsif Definition /= Libadalang.Analysis.No_Defining_Name then - -- No previous part, return definition itself. - LSP.Lal_Utils.Append_Location (Result, Definition); - end if; - - if not Decl_For_Find_Overrides.Is_Null then - declare - Imprecise_Over : Boolean; - Imprecise_Base : Boolean; - Overriding_Subps : constant Basic_Decl_Array := - Self.Find_All_Overrides - (Decl_For_Find_Overrides, - Imprecise_Results => Imprecise_Over); - Base_Subps : constant Basic_Decl_Array := - Self.Find_All_Base_Declarations - (Decl_For_Find_Overrides, - Imprecise_Results => Imprecise_Base); - begin - for Subp of Base_Subps loop - Append_Location - (Result, Subp.P_Defining_Name, LSP.Common.Is_Parent); - end loop; - for Subp of Overriding_Subps loop - Append_Location - (Result, Subp.P_Defining_Name, LSP.Common.Is_Child); - end loop; - Imprecise := Imprecise or Imprecise_Over or Imprecise_Base; - end; - end if; - end Append_Declarations; - ------------ -- Get_AU -- ------------ @@ -336,7 +196,7 @@ package body LSP.Ada_Contexts is LSP.Ada_Id_Iterators.Find_All_References (Definition, Units, Callback); exception when E : Libadalang.Common.Property_Error => - Log (Self.Trace, E, "in Find_All_References"); + Self.Tracer.Trace_Exception (E, "in Find_All_References"); end Find_All_References; ------------------------ @@ -365,13 +225,13 @@ package body LSP.Ada_Contexts is exception when E : Libadalang.Common.Property_Error => Imprecise_Results := True; - Log (Self.Trace, E, "in Find_All_Overrides (precise)"); + Self.Tracer.Trace_Exception (E, "in Find_All_Overrides (precise)"); return Decl.P_Find_All_Overrides (Units, Imprecise_Fallback => True); end; exception when E : Libadalang.Common.Property_Error => - Log (Self.Trace, E, "in Find_All_Overrides (imprecise)"); + Self.Tracer.Trace_Exception (E, "in Find_All_Overrides (imprecise)"); return (1 .. 0 => <>); end Find_All_Overrides; @@ -386,7 +246,14 @@ package body LSP.Ada_Contexts is return Libadalang.Analysis.Basic_Decl_Array is use Libadalang.Analysis; + use type Langkit_Support.Slocs.Source_Location; + function Equal (Left, Right : Libadalang.Analysis.Ada_Node'Class) + return Boolean is + (Left.Unit.Get_Filename = + Right.Unit.Get_Filename and then + Langkit_Support.Slocs.Start_Sloc (Left.Sloc_Range) = + Langkit_Support.Slocs.Start_Sloc (Right.Sloc_Range)); begin Imprecise_Results := False; @@ -395,7 +262,6 @@ package body LSP.Ada_Contexts is end if; declare - use VSS.Strings; Lal_Result : constant Basic_Decl_Array := Decl.P_Base_Subp_Declarations; Our_Result : Basic_Decl_Array @@ -411,7 +277,7 @@ package body LSP.Ada_Contexts is -- The result returned by Libadalang includes self; we want to remove -- this from the list. for J of Lal_Result loop - if Node_Location_Image (J) /= Node_Location_Image (Decl) then + if not Equal (J, Decl) then Our_Result (Index) := J; Index := Index + 1; end if; @@ -422,7 +288,7 @@ package body LSP.Ada_Contexts is exception when E : Libadalang.Common.Property_Error => - Log (Self.Trace, E, "in Find_All_Base_Declarations"); + Self.Tracer.Trace_Exception (E, "in Find_All_Base_Declarations"); Imprecise_Results := True; return (1 .. 0 => <>); end Find_All_Base_Declarations; @@ -475,7 +341,7 @@ package body LSP.Ada_Contexts is else LSP.Ada_Id_Iterators.Find_All_Subp_References_In_Hierarchy (Hierarchy => Hierarchy, - Trace => Self.Trace, + Tracer => Self.Tracer.all, Callback => Callback); end if; end Find_All_References_In_Hierarchy; @@ -564,7 +430,7 @@ package body LSP.Ada_Contexts is end loop; exception when E : Libadalang.Common.Property_Error => - Log (Self.Trace, E, "in Is_Called_By"); + Self.Tracer.Trace_Exception (E, "in Is_Called_By"); end Find_All_Calls; --------------------------- @@ -597,7 +463,7 @@ package body LSP.Ada_Contexts is return Res; exception when E : Libadalang.Common.Property_Error => - Log (Self.Trace, E, "in Find_All_Env_Elements"); + Self.Tracer.Trace_Exception (E, "in Find_All_Env_Elements"); return Laltools.Common.Node_Vectors.Empty_Vector; end Find_All_Env_Elements; @@ -784,8 +650,22 @@ package body LSP.Ada_Contexts is -- Pretty_Printer_Setup -- -------------------------- - procedure Pretty_Printer_Setup - is + procedure Pretty_Printer_Setup is + + use type GPR2.Package_Id; + use type GPR2.Optional_Attribute_Id; + + Pretty_Printer_Id : constant GPR2.Package_Id := +"pretty_printer"; + + package Pretty_Printer is + Switches : constant GPR2.Q_Attribute_Id := + (Pretty_Printer_Id, +"switches"); + end Pretty_Printer; + + Ada_Index : constant GPR2.Project.Attribute_Index.Object := + GPR2.Project.Attribute_Index.Create + (GPR2.Ada_Language); + Validated : GNAT.Strings.String_List_Access; Index : Integer := 0; Attribute : GPR2.Project.Attribute.Object; @@ -795,8 +675,8 @@ package body LSP.Ada_Contexts is -- Initialize an gnatpp command line object if Root.Check_Attribute - (Name => LSP.Common.Pretty_Printer.Switches, - Index => LSP.Common.Ada_Index, + (Name => Pretty_Printer.Switches, + Index => Ada_Index, Result => Attribute) then @@ -851,7 +731,7 @@ package body LSP.Ada_Contexts is (Tree => Tree, Project => Root); Self.Event_Handler := Libadalang.Analysis.Create_Event_Handler_Reference - (LSP_Context_Event_Handler_Type'(Trace => Self.Trace)); + (LSP_Context_Event_Handler_Type'(Tracer => Self.Tracer)); Self.Reload; Update_Source_Files; @@ -873,111 +753,6 @@ package body LSP.Ada_Contexts is -- Tab stop is set 1 to disable "visible character guessing" by LAL. end Reload; - ---------------------------------- - -- Update_Pp_Formatting_Options -- - ---------------------------------- - - procedure Update_Pp_Formatting_Options - (Pp_Options : in out Utils.Command_Lines.Command_Line; - LSP_Options : LSP.Messages.FormattingOptions) - is - Pp_Indentation : constant Natural := - Pp.Command_Lines.Pp_Nat_Switches.Arg - (Pp_Options, Pp.Command_Lines.Indentation); - Pp_No_Tab : constant Boolean := - Pp.Command_Lines.Pp_Flag_Switches.Arg - (Pp_Options, Pp.Command_Lines.No_Tab); - begin - -- Check if intentation and 'no tab' policy options have been explictly - -- set in the project. - -- If it's not the case, use the LSP options. - - if not Pp.Command_Lines.Pp_Nat_Switches.Explicit - (Pp_Options, Pp.Command_Lines.Indentation) - then - Pp.Command_Lines.Pp_Nat_Switches.Set_Arg - (Pp_Options, - Pp.Command_Lines.Indentation, - Natural (LSP_Options.tabSize)); - - elsif Pp_Indentation /= Natural (LSP_Options.tabSize) then - Formatting_Trace.Trace - ("Project file defines an indentation " - & "of" & Pp_Indentation'Img & ", while LSP defines an " - & "indentation of" & LSP_Options.tabSize'Img & "."); - end if; - - if not Pp.Command_Lines.Pp_Flag_Switches.Explicit - (Pp_Options, Pp.Command_Lines.No_Tab) - then - Pp.Command_Lines.Pp_Flag_Switches.Set_Arg - (Pp_Options, - Pp.Command_Lines.No_Tab, - LSP_Options.insertSpaces); - - elsif Pp_No_Tab /= LSP_Options.insertSpaces then - Formatting_Trace.Trace - ("Project file no tab policy is set to " & Pp_No_Tab'Img - & ", while LSP is set to " & LSP_Options.insertSpaces'Img); - end if; - end Update_Pp_Formatting_Options; - - ------------ - -- Format -- - ------------ - - procedure Format - (Self : in out Context; - Document : LSP.Ada_Documents.Document_Access; - Span : LSP.Messages.Span; - Options : LSP.Messages.FormattingOptions; - Edit : out LSP.Messages.TextEdit_Vector; - Success : out Boolean; - Messages : out VSS.String_Vectors.Virtual_String_Vector) is - begin - -- Take into account the options set by the request only if the - -- corresponding GPR switches are not explicitly set. - - Update_Pp_Formatting_Options - (Pp_Options => Self.PP_Options, - LSP_Options => Options); - - Success := Document.Formatting - (Context => Self, - Span => Span, - Cmd => Self.PP_Options, - Edit => Edit, - Messages => Messages); - end Format; - - ------------------ - -- Range_Format -- - ------------------ - - procedure Range_Format - (Self : in out Context; - Document : LSP.Ada_Documents.Document_Access; - Span : LSP.Messages.Span; - Options : LSP.Messages.FormattingOptions; - Edit : out LSP.Messages.TextEdit_Vector; - Success : out Boolean; - Messages : out VSS.String_Vectors.Virtual_String_Vector) is - begin - -- Take into account the options set by the request only if the - -- corresponding GPR switches are not explicitly set. - - Update_Pp_Formatting_Options - (Pp_Options => Self.PP_Options, - LSP_Options => Options); - - Success := Document.Range_Formatting - (Context => Self, - Span => Span, - PP_Options => Self.PP_Options, - Edit => Edit, - Messages => Messages); - end Range_Format; - ---------- -- Free -- ---------- @@ -992,113 +767,6 @@ package body LSP.Ada_Contexts is Pp.Actions.Clear_Template_Tables; end Free; - ----------------- - -- Get_Node_At -- - ----------------- - - function Get_Node_At - (Self : Context; - Document : LSP.Ada_Documents.Document_Access; - Position : LSP.Messages.TextDocumentPositionParams'Class; - Project_Only : Boolean := True) - return Libadalang.Analysis.Ada_Node - is - use type Libadalang.Analysis.Ada_Node; - use type LSP.Ada_Documents.Document_Access; - use type Langkit_Support.Slocs.Line_Number; - use type Langkit_Support.Slocs.Column_Number; - - Unit : Libadalang.Analysis.Analysis_Unit; - - URI : constant LSP.Messages.DocumentUri := - Position.textDocument.uri; - Name : constant Ada.Strings.UTF_Encoding.UTF_8_String := - Self.URI_To_File (URI); - File : constant Virtual_File := Create_From_UTF8 (Name); - begin - -- We're about to get a node from an analysis unit. Either the document - -- is open for it, in which case we read the document, or the - -- document is not open for it. In this case, resolve this only - -- if the file belongs to the project (unless if Project_Only is False): - -- we don't want to pollute the LAL context with units that are not in - -- the project. - - if Document /= null then - return Document.Get_Node_At - (Context => Self, - Position => Position.position); - elsif not Project_Only or else Self.Is_Part_Of_Project (File) then - Unit := Self.Get_AU (File); - - if Unit.Root = Libadalang.Analysis.No_Ada_Node then - return Libadalang.Analysis.No_Ada_Node; - end if; - - return Unit.Root.Lookup - ((Line => Langkit_Support.Slocs.Line_Number - (Position.position.line) + 1, - Column => Langkit_Support.Slocs.Column_Number - (Position.position.character) + 1)); - -- ??? Incorrect conversion of UTF16 offset to Column_Number - - else - return Libadalang.Analysis.No_Ada_Node; - end if; - end Get_Node_At; - - ------------------ - -- Get_Token_At -- - ------------------ - - function Get_Token_At - (Self : Context; - Document : LSP.Ada_Documents.Document_Access; - Position : LSP.Messages.TextDocumentPositionParams'Class; - Project_Only : Boolean := True) - return Libadalang.Common.Token_Reference - is - use type Libadalang.Analysis.Ada_Node; - use type LSP.Ada_Documents.Document_Access; - use type Langkit_Support.Slocs.Line_Number; - use type Langkit_Support.Slocs.Column_Number; - - Unit : Libadalang.Analysis.Analysis_Unit; - - URI : constant LSP.Messages.DocumentUri := - Position.textDocument.uri; - Name : constant Ada.Strings.UTF_Encoding.UTF_8_String := - Self.URI_To_File (URI); - File : constant Virtual_File := Create_From_UTF8 (Name); - begin - -- We're about to get a node from an analysis unit. Either the document - -- is open for it, in which case we read the document, or the - -- document is not open for it. In this case, resolve this only - -- if the file belongs to the project (unless if Project_Only is False): - -- we don't want to pollute the LAL context with units that are not in - -- the project. - - if Document /= null then - return Document.Get_Token_At - (Context => Self, - Position => Position.position); - elsif not Project_Only or else Self.Is_Part_Of_Project (File) then - Unit := Self.Get_AU (File); - - if Unit.Root = Libadalang.Analysis.No_Ada_Node then - return Libadalang.Common.No_Token; - end if; - - return Unit.Lookup_Token - ((Line => Langkit_Support.Slocs.Line_Number - (Position.position.line) + 1, - Column => Langkit_Support.Slocs.Column_Number - (Position.position.character) + 1)); - - else - return Libadalang.Common.No_Token; - end if; - end Get_Token_At; - -------- -- Id -- -------- @@ -1179,7 +847,7 @@ package body LSP.Ada_Contexts is (Self : in out Context; Document : in out LSP.Ada_Documents.Document) is - Filename : constant Ada.Strings.UTF_Encoding.UTF_8_String := + Filename : constant GNATCOLL.VFS.Virtual_File := Self.URI_To_File (Document.URI); begin -- Reset cache of symbols to avoid access to stale references @@ -1188,7 +856,7 @@ package body LSP.Ada_Contexts is -- Index the file, calling Populate_Lexical_Env on it to speed up the -- response to user queries. Self.Index_File - (File => Create_From_UTF8 (Filename), + (File => Filename, Reparse => True, PLE => True); end Index_Document; diff --git a/source/ada/lsp-ada_contexts.ads b/source/ada/lsp-ada_contexts.ads index a1661c43c..ada6e74ee 100644 --- a/source/ada/lsp-ada_contexts.ads +++ b/source/ada/lsp-ada_contexts.ads @@ -18,9 +18,7 @@ -- This package provides a context of Ada Language server. with Ada.Strings.Unbounded; -with Ada.Strings.UTF_Encoding; -with GNATCOLL.Traces; with GNATCOLL.VFS; with GNATdoc.Comments.Options; @@ -36,19 +34,17 @@ with Libadalang.Common; with Utils.Command_Lines; with Pp.Command_Lines; -with VSS.String_Vectors; with VSS.Strings; -with LSP.Messages; +with LSP.Tracers; with LSP.Ada_Documents; -with LSP.Ada_File_Sets; use LSP.Ada_File_Sets; +with LSP.Ada_File_Sets; with LSP.Search; -with LSP.Types; package LSP.Ada_Contexts is - type Context (Trace : GNATCOLL.Traces.Trace_Handle) is + type Context (Tracer : not null LSP.Tracers.Tracer_Access) is tagged limited private; -- A context contains a non-aggregate project tree and its associated -- libadalang context. @@ -85,55 +81,15 @@ package LSP.Ada_Contexts is -- Release the memory associated to Self. You should not use the -- context after calling this. - function URI_To_File - (Self : Context; - URI : LSP.Types.LSP_URI) - return Ada.Strings.UTF_Encoding.UTF_8_String; - - function URI_To_File - (Self : Context; - URI : LSP.Types.LSP_URI) - return GNATCOLL.VFS.Virtual_File; - - function Get_Node_At - (Self : Context; - Document : LSP.Ada_Documents.Document_Access; - Position : LSP.Messages.TextDocumentPositionParams'Class; - Project_Only : Boolean := True) - return Libadalang.Analysis.Ada_Node; - -- Return the node at the given location. - -- If Document is not null, get the location from the document, otherwise - -- get it from the file if it belongs to the context's project when - -- Project_Only is True. - - function Get_Token_At - (Self : Context; - Document : LSP.Ada_Documents.Document_Access; - Position : LSP.Messages.TextDocumentPositionParams'Class; - Project_Only : Boolean := True) - return Libadalang.Common.Token_Reference; - -- Return the token at the given location. - -- If Document is not null, get the location from the document, otherwise - -- get it from the file if it belongs to the context's project when - -- Project_Only is True. - - procedure Format - (Self : in out Context; - Document : LSP.Ada_Documents.Document_Access; - Span : LSP.Messages.Span; - Options : LSP.Messages.FormattingOptions; - Edit : out LSP.Messages.TextEdit_Vector; - Success : out Boolean; - Messages : out VSS.String_Vectors.Virtual_String_Vector); - - procedure Range_Format - (Self : in out Context; - Document : LSP.Ada_Documents.Document_Access; - Span : LSP.Messages.Span; - Options : LSP.Messages.FormattingOptions; - Edit : out LSP.Messages.TextEdit_Vector; - Success : out Boolean; - Messages : out VSS.String_Vectors.Virtual_String_Vector); + -- function URI_To_File + -- (Self : Context; + -- URI : LSP.Types.LSP_URI) + -- return Ada.Strings.UTF_Encoding.UTF_8_String; + -- + -- function URI_To_File + -- (Self : Context; + -- URI : LSP.Types.LSP_URI) + -- return GNATCOLL.VFS.Virtual_File; procedure Find_All_References (Self : Context; @@ -208,8 +164,9 @@ package LSP.Ada_Contexts is File : GNATCOLL.VFS.Virtual_File) return Boolean; -- Check if given file belongs to the project loaded in the Context - function List_Files (Self : Context) - return File_Sets.Set_Iterator_Interfaces.Reversible_Iterator'Class; + function List_Files (Self : Context'CLass) + return LSP.Ada_File_Sets.File_Sets.Set_Iterator_Interfaces + .Reversible_Iterator'Class; -- Return the list of files known to this context. function File_Count (Self : Context) return Natural; @@ -276,23 +233,6 @@ package LSP.Ada_Contexts is File : GNATCOLL.VFS.Virtual_File); -- Revert a document to the state of the file discarding any changes - procedure Append_Declarations - (Self : Context; - Document : LSP.Ada_Documents.Document_Access; - Position : LSP.Messages.TextDocumentPositionParams; - Display_Method_Ancestry_Policy : - LSP.Messages.AlsDisplayMethodAncestryOnNavigationPolicy; - Result : in out LSP.Messages.Location_Or_Link_Vector; - Imprecise : in out Boolean); - -- Find corresponding declarations for a name at given Position and append - -- their locations to Result. - -- Document is the document from which the request originates; it can - -- be null if no document is open for this location. - -- - -- Here we follow C terminology, where 'Declaration' equals to - -- Ada subprogram specification while 'Definition' equals to - -- Ada subprogram body (completion). - function LAL_Context (Self : Context) return Libadalang.Analysis.Analysis_Context; -- Return the LAL context corresponding to Self @@ -333,7 +273,8 @@ package LSP.Ada_Contexts is private - type Context (Trace : GNATCOLL.Traces.Trace_Handle) is tagged limited record + type Context (Tracer : not null LSP.Tracers.Tracer_Access) is tagged limited + record Id : VSS.Strings.Virtual_String; Unit_Provider : Libadalang.Analysis.Unit_Provider_Reference; Event_Handler : Libadalang.Analysis.Event_Handler_Reference; @@ -381,9 +322,9 @@ private (Self : Context) return Libadalang.Analysis.Analysis_Context is (Self.LAL_Context); - function List_Files (Self : Context) - return File_Sets.Set_Iterator_Interfaces.Reversible_Iterator'Class - is (Self.Source_Files.Iterate); + function List_Files (Self : Context'Class) + return LSP.Ada_File_Sets.File_Sets.Set_Iterator_Interfaces + .Reversible_Iterator'Class is (Self.Source_Files.Iterate); function File_Count (Self : Context) return Natural is (Self.Source_Files.Length); diff --git a/source/ada/lsp-ada_documents.adb b/source/ada/lsp-ada_documents.adb index 9f0710023..dd8da1b84 100644 --- a/source/ada/lsp-ada_documents.adb +++ b/source/ada/lsp-ada_documents.adb @@ -15,590 +15,69 @@ -- of the license. -- ------------------------------------------------------------------------------ -with Ada.Characters.Wide_Wide_Latin_1; -with Ada.Tags; -with Ada.Unchecked_Deallocation; - -with GNAT.Strings; - -with GNATCOLL.Utils; -with GNATCOLL.VFS; - -with VSS.Characters; -with VSS.Strings.Conversions; -with VSS.Strings.Cursors.Iterators.Characters; - -with Langkit_Support.Symbols; -with Langkit_Support.Text; -with Libadalang.Analysis; use Libadalang.Analysis; -with Libadalang.Sources; -with Libadalang.Iterators; - -with Laltools.Common; - -with VSS.Strings.Character_Iterators; -with VSS.Strings.Line_Iterators; -with VSS.Unicode; - -with LSP.Ada_Contexts; use LSP.Ada_Contexts; -with LSP.Ada_Completions.Filters; -with LSP.Ada_Documentation; -with LSP.Ada_Id_Iterators; -with LSP.Ada_Documents.LAL_Diagnostics; -with LSP.Common; use LSP.Common; -with LSP.Lal_Utils; - -with Pp.Scanner; - -with Utils.Char_Vectors; - package body LSP.Ada_Documents is - - Lal_PP_Output : constant GNATCOLL.Traces.Trace_Handle := - GNATCOLL.Traces.Create ("ALS.LAL_PP_OUTPUT_ON_FORMATTING", - GNATCOLL.Traces.Off); - -- Logging lalpp output if On - - Document_Changes_Trace : constant GNATCOLL.Traces.Trace_Handle := - GNATCOLL.Traces.Create ("ALS.DOCUMENT_CHANGES", - GNATCOLL.Traces.Off); - -- Loging each document change - - function Get_Profile - (Node : Libadalang.Analysis.Basic_Decl; - Is_Function : out Boolean) - return VSS.Strings.Virtual_String; - -- Return the profile of Node. - - function Is_Declaration - (Node : Libadalang.Analysis.Basic_Decl) return Boolean; - - function Get_Visibility - (Node : Libadalang.Analysis.Basic_Decl) - return LSP.Messages.Als_Visibility; - - function To_Completion_Kind - (K : LSP.Messages.SymbolKind) return LSP.Messages.CompletionItemKind - is - (case K is - when LSP.Messages.A_Function => LSP.Messages.A_Function, - when LSP.Messages.Field => LSP.Messages.Field, - when LSP.Messages.Variable => LSP.Messages.Variable, - when LSP.Messages.A_Package => LSP.Messages.Module, - when LSP.Messages.Module => LSP.Messages.Module, - when LSP.Messages.Class => LSP.Messages.Class, - when LSP.Messages.Struct => LSP.Messages.Class, - when LSP.Messages.Number => LSP.Messages.Value, - when LSP.Messages.Enum => LSP.Messages.Enum, - when LSP.Messages.String => LSP.Messages.Value, - when LSP.Messages.A_Constant => LSP.Messages.Value, - when others => LSP.Messages.Reference); - -- Convert a SymbolKind to a CompletionItemKind. - -- TODO: It might be better to have a unified kind, and then convert to - -- specific kind types, but for the moment this is good enough. - - procedure Recompute_Indexes (Self : in out Document); - -- Recompute the line-to-offset indexes in Self - - procedure Recompute_Markers - (Self : in out Document'Class; - Low_Line : LSP.Types.Line_Number; - Start_Marker : VSS.Strings.Markers.Character_Marker; - End_Marker : VSS.Strings.Markers.Character_Marker); - -- Recompute line-to-marker index starting from Start_Marker till - -- End_Marker and filling index table starting at Low_Line. End_Marker - -- may be invalid marker, in this case indexing down to the end of the - -- text. - - procedure Span_To_Markers - (Self : Document'Class; - Span : LSP.Messages.Span; - From : out VSS.Strings.Markers.Character_Marker; - To : out VSS.Strings.Markers.Character_Marker); - - ----------------------- - -- Recompute_Indexes -- - ----------------------- - - procedure Recompute_Indexes (Self : in out Document) is - use type VSS.Strings.Character_Count; - - begin - Self.Line_To_Marker.Clear; - - -- To avoid too many reallocations during the initial filling - -- of the index vector, pre-allocate it. Give a generous - -- pre-allocation assuming that there is a line break every - -- 20 characters on average (this file has one line break - -- every 33 characters). - Self.Line_To_Marker.Reserve_Capacity - (Ada.Containers.Count_Type (Self.Text.Character_Length / 20)); - - declare - J : VSS.Strings.Line_Iterators.Line_Iterator := - Self.Text.At_First_Line - (Terminators => LSP_New_Line_Function_Set, - Keep_Terminator => True); - Last_Line_Terminated : Boolean := False; - - begin - if J.Has_Element then - -- Update Line_Terminator of the document - Self.Line_Terminator := Self.Text.Slice - (J.Terminator_First_Marker, J.Terminator_Last_Marker); - - loop - Self.Line_To_Marker.Append (J.First_Marker); - Last_Line_Terminated := J.Has_Line_Terminator; - - exit when not J.Forward; - end loop; - - else - Last_Line_Terminated := True; - -- Force to add one line for an empty document. - end if; - - -- Append marker at the end of the text when the last line has line - -- terminator sequence or text is empty. It allows to avoid checks - -- for corner cases. - - if Last_Line_Terminated then - Self.Line_To_Marker.Append (J.First_Marker); - end if; - end; - end Recompute_Indexes; - - ----------------------- - -- Recompute_Markers -- - ----------------------- - - procedure Recompute_Markers - (Self : in out Document'Class; - Low_Line : LSP.Types.Line_Number; - Start_Marker : VSS.Strings.Markers.Character_Marker; - End_Marker : VSS.Strings.Markers.Character_Marker) - is - use type LSP.Types.Line_Number; - use type VSS.Strings.Character_Count; - - M : VSS.Strings.Markers.Character_Marker; - J : VSS.Strings.Line_Iterators.Line_Iterator := - Self.Text.At_Line - (Position => Start_Marker, - Terminators => LSP_New_Line_Function_Set, - Keep_Terminator => True); - Line : LSP.Types.Line_Number := Low_Line; - - begin - if J.Has_Element then - loop - M := J.First_Marker; - - exit - when End_Marker.Is_Valid - and then M.Character_Index = End_Marker.Character_Index; - - Self.Line_To_Marker.Insert (Line, M); - Line := Line + 1; - - exit when not J.Forward; - end loop; - - if not End_Marker.Is_Valid then - Self.Line_To_Marker.Append (J.First_Marker); - end if; - end if; - end Recompute_Markers; + pragma Warnings (Off); ------------------- -- Apply_Changes -- ------------------- procedure Apply_Changes - (Self : aliased in out Document; - Version : LSP.Types.LSP_Number; - Vector : LSP.Messages.TextDocumentContentChangeEvent_Vector) + (Self : aliased in out Document; Version : Integer; + Vector : LSP.Structures.TextDocumentContentChangeEvent_Vector) is - URI : constant String := Types.To_UTF_8_String (Self.URI); - Dummy : Libadalang.Analysis.Analysis_Unit; - use LSP.Types; begin - Document_Changes_Trace.Trace ("Applying changes for document " & URI); - - Self.Version := Version; - - for Change of Vector loop - if Change.span.Is_Set then - -- We're replacing a range - - declare - Low_Line : LSP.Types.Line_Number := - Change.span.Value.first.line; - High_Line : LSP.Types.Line_Number := - Change.span.Value.last.line; - Delete_High : LSP.Types.Line_Number := High_Line; - Start_Index : LSP.Types.Line_Number; - - First_Marker : VSS.Strings.Markers.Character_Marker; - Last_Marker : VSS.Strings.Markers.Character_Marker; - Start_Marker : VSS.Strings.Markers.Character_Marker; - End_Marker : VSS.Strings.Markers.Character_Marker; - - begin - -- Do text replacement - - Self.Span_To_Markers - (Change.span.Value, First_Marker, Last_Marker); - Self.Text.Replace (First_Marker, Last_Marker, Change.text); - - -- Markers inside modified range of lines need to be - -- recomputed, markers outside of this range has been - -- recomputed by call to Replace. - - -- Use marker of the line before the first modified line as - -- start marker for recompute because marker of the first - -- modified line may be ether invalidated or moved by Replace, - -- or start from first character of the new text when first - -- line was modified. - - if Low_Line /= Self.Line_To_Marker.First_Index then - Low_Line := Low_Line - 1; - Start_Index := Low_Line; - Start_Marker := Self.Line_To_Marker (Low_Line); - - else - Start_Index := Self.Line_To_Marker.First_Index; - Start_Marker := Self.Text.At_First_Character.Marker; - end if; - - -- Use marker of the line after the last modified line as end - -- marker for recompute because marker of the last modified - -- line may be ether invalidated or moved and not point to the - -- beginning of the line, or use invalid marker when last line - -- was modified. - - if High_Line /= Self.Line_To_Marker.Last_Index then - Delete_High := High_Line; - High_Line := High_Line + 1; - End_Marker := Self.Line_To_Marker (High_Line); - end if; - - if Low_Line = Self.Line_To_Marker.First_Index - and then High_Line = Self.Line_To_Marker.Last_Index - then - Self.Recompute_Indexes; - - else - if Delete_High >= Low_Line then - Self.Line_To_Marker.Delete - (Low_Line, - Ada.Containers.Count_Type - (Delete_High - Low_Line + 1)); - end if; - - Self.Recompute_Markers - (Start_Index, Start_Marker, End_Marker); - end if; - end; - - else - Self.Text := Change.text; - - -- We're setting the whole text: compute the indexes now. - Self.Recompute_Indexes; - end if; - end loop; - Document_Changes_Trace.Trace - ("Done applying changes for document " & URI); + pragma Compile_Time_Warning + (Standard.True, "Apply_Changes unimplemented"); + raise Program_Error with "Unimplemented procedure Apply_Changes"; end Apply_Changes; - ----------------- - -- Get_Text_At -- - ----------------- - - function Get_Text_At - (Self : Document; - Start_Pos : LSP.Messages.Position; - End_Pos : LSP.Messages.Position) return VSS.Strings.Virtual_String - is - First_Marker : VSS.Strings.Markers.Character_Marker; - Last_Marker : VSS.Strings.Markers.Character_Marker; + ------------- + -- Cleanup -- + ------------- + procedure Cleanup (Self : in out Document) is begin - Self.Span_To_Markers - ((Start_Pos, End_Pos), First_Marker, Last_Marker); + pragma Compile_Time_Warning (Standard.True, "Cleanup unimplemented"); + raise Program_Error with "Unimplemented procedure Cleanup"; + end Cleanup; - return Self.Text.Slice (First_Marker, Last_Marker); - end Get_Text_At; + ----------------------------- + -- Compute_Completion_Item -- + ----------------------------- + + function Compute_Completion_Item + (Document : LSP.Ada_Documents.Document; + Context : LSP.Ada_Contexts.Context; + Sloc : Langkit_Support.Slocs.Source_Location; + Node : Libadalang.Analysis.Ada_Node; BD : Libadalang.Analysis.Basic_Decl; + Label : VSS.Strings.Virtual_String; Use_Snippets : Boolean; + Compute_Doc_And_Details : Boolean; Named_Notation_Threshold : Natural; + Is_Dot_Call : Boolean; Is_Visible : Boolean; Pos : Integer; + Weight : Ada_Completions.Completion_Item_Weight_Type; + Completions_Count : Natural) return LSP.Structures.CompletionItem + is + begin + pragma Compile_Time_Warning + (Standard.True, "Compute_Completion_Item unimplemented"); + return + raise Program_Error + with "Unimplemented function Compute_Completion_Item"; + end Compute_Completion_Item; ---------- -- Diff -- ---------- procedure Diff - (Self : Document; - New_Text : VSS.Strings.Virtual_String; - Old_Span : LSP.Messages.Span := LSP.Messages.Empty_Span; - New_Span : LSP.Messages.Span := LSP.Messages.Empty_Span; - Edit : out LSP.Messages.TextEdit_Vector) + (Self : Document; New_Text : VSS.Strings.Virtual_String; + Old_Span : LSP.Structures.A_Range := Empty_Range; + New_Span : LSP.Structures.A_Range := Empty_Range; + Edit : out LSP.Structures.TextEdit_Vector) is - use LSP.Types; - use LSP.Messages; - - Old_First_Line : Natural; - New_First_Line : Natural; - - Old_Lines, New_Lines : VSS.String_Vectors.Virtual_String_Vector; - Old_Length, New_Length : Natural; - begin - Old_Lines := - Self.Text.Split_Lines - (Terminators => LSP_New_Line_Function_Set, - Keep_Terminator => True); - New_Lines := - New_Text.Split_Lines - (Terminators => LSP_New_Line_Function_Set, - Keep_Terminator => True); - - if Old_Span = Empty_Span then - Old_First_Line := 1; - Old_Length := Old_Lines.Length; - - else - Old_First_Line := Natural (Old_Span.first.line + 1); - Old_Length := Natural (Old_Span.last.line - Old_Span.first.line + 1); - end if; - - if New_Span = Empty_Span then - New_First_Line := 1; - New_Length := New_Lines.Length; - else - New_First_Line := Natural (New_Span.first.line + 1); - New_Length := Natural (New_Span.last.line - New_Span.first.line + 1); - end if; - - declare - use type VSS.Strings.Virtual_String; - - type LCS_Array is array - (Natural range 0 .. Old_Length, - Natural range 0 .. New_Length) of Integer; - type LCS_Array_Access is access all LCS_Array; - - procedure Free is - new Ada.Unchecked_Deallocation (LCS_Array, LCS_Array_Access); - - LCS : LCS_Array_Access := new LCS_Array; - Match : Integer; - Delete : Integer; - Insert : Integer; - - Old_Index : Natural := Old_Length; - New_Index : Natural := New_Length; - - Old_Line_Number : Line_Number; - -- needed to determine which line number in the old buffer is - -- changed, deleted or before which new lines are inserted - - Changed_Block_Text : VSS.Strings.Virtual_String; - Changed_Block_Span : LSP.Messages.Span := ((0, 0), (0, 0)); - - procedure Prepare - (Line : Line_Number; - Text : VSS.Strings.Virtual_String); - -- Store imformation for Text_Etid in New_String and Span - - procedure Add (From_Line : Line_Number); - -- Add prepared New_String and Span into Text_Edit - - ------------- - -- Prepare -- - ------------- - - procedure Prepare - (Line : Line_Number; - Text : VSS.Strings.Virtual_String) is - begin - if Changed_Block_Span.last = (0, 0) then - -- it is the first portion of a changed block so store - -- last position of the changes - Changed_Block_Span.last := (Line, 0); - end if; - - -- accumulating new text for the changed block - Changed_Block_Text.Prepend (Text); - end Prepare; - - --------- - -- Add -- - --------- - - procedure Add (From_Line : Line_Number) is - begin - if Changed_Block_Span.last = (0, 0) then - -- No information for Text_Edit - return; - end if; - - Changed_Block_Span.first := - (line => From_Line, - character => 0); - - LSP.Messages.Prepend - (Edit, LSP.Messages.TextEdit' - (span => Changed_Block_Span, - newText => Changed_Block_Text)); - - -- clearing - Changed_Block_Text.Clear; - Changed_Block_Span := ((0, 0), (0, 0)); - end Add; - - begin - -- prepare LCS - - -- default values for line 0 - for Index in 0 .. Old_Length loop - LCS (Index, 0) := -5 * Index; - end loop; - - -- default values for the first column - for Index in 0 .. New_Length loop - LCS (0, Index) := -5 * Index; - end loop; - - -- calculate LCS - for Row in 1 .. Old_Length loop - for Column in 1 .. New_Length loop - Match := LCS (Row - 1, Column - 1) + - (if Old_Lines (Old_First_Line + Row - 1) = - New_Lines (New_First_Line + Column - 1) - then 10 -- +10 is the 'weight' for equal lines - else -1); -- and -1 for the different - - Delete := LCS (Row - 1, Column) - 5; - Insert := LCS (Row, Column - 1) - 5; - - LCS (Row, Column) := Integer'Max (Match, Insert); - LCS (Row, Column) := Integer'Max (LCS (Row, Column), Delete); - end loop; - end loop; - - -- iterate over LCS and create Text_Edit - - Old_Line_Number := Line_Number (Old_First_Line + Old_Length - 1); - - while Old_Index > 0 - and then New_Index > 0 - loop - if LCS (Old_Index, New_Index) = - LCS (Old_Index - 1, New_Index - 1) + - (if Old_Lines (Old_First_Line + Old_Index - 1) = - New_Lines (New_First_Line + New_Index - 1) - then 10 - else -1) - then - -- both has lines - if New_Lines.Element (New_First_Line + New_Index - 1) = - Old_Lines.Element (Old_First_Line + Old_Index - 1) - then - -- lines are equal, add Text_Edit after current line - -- if any is already prepared - Add (Old_Line_Number); - else - -- lines are different, change old line by new one, - -- we deleted whole line so 'To' position will be - -- the beginning of the next line - Prepare - (Old_Line_Number, - New_Lines.Element (New_First_Line + New_Index - 1)); - end if; - - -- move lines cursor backward - Old_Line_Number := Old_Line_Number - 1; - - New_Index := New_Index - 1; - Old_Index := Old_Index - 1; - - elsif LCS (Old_Index, New_Index) = - LCS (Old_Index - 1, New_Index) - 5 - then - -- line has been deleted, move lines cursor backward - Prepare (Old_Line_Number, VSS.Strings.Empty_Virtual_String); - - Old_Line_Number := Old_Line_Number - 1; - Old_Index := Old_Index - 1; - - elsif LCS (Old_Index, New_Index) = - LCS (Old_Index, New_Index - 1) - 5 - then - -- line has been inserted - -- insert Text_Edit information with insertion after - -- current line, do not move lines cursor because it is - -- additional line not present in the old document - Prepare - (Old_Line_Number, - New_Lines.Element (New_First_Line + New_Index - 1)); - - New_Index := New_Index - 1; - end if; - end loop; - - while Old_Index > 0 loop - -- deleted - Prepare (Old_Line_Number, VSS.Strings.Empty_Virtual_String); - - Old_Line_Number := Old_Line_Number - 1; - Old_Index := Old_Index - 1; - end loop; - - while New_Index > 0 loop - -- inserted - Prepare - (Old_Line_Number, - New_Lines.Element (New_First_Line + New_Index - 1)); - - New_Index := New_Index - 1; - end loop; - - Add (Old_Line_Number); - Free (LCS); - - -- Handle the edge case where the last location of - -- the edit is trying to affect a non existent line. - -- The edits are ordered so we only need to check the last one. - - if not Edit.Is_Empty - and then not Self.Line_To_Marker.Is_Empty - and then Edit.Last_Element.span.last.line not in - Self.Line_To_Marker.First_Index .. Self.Line_To_Marker.Last_Index - then - declare - use type VSS.Unicode.UTF16_Code_Unit_Offset; - - Element : LSP.Messages.TextEdit := Edit.Last_Element; - Last_Line : constant VSS.Strings.Virtual_String := - Old_Lines (Old_Lines.Length); - Iterator : - constant VSS.Strings.Character_Iterators.Character_Iterator := - Last_Line.At_Last_Character; - - begin - -- Replace the wrong location by the end of the buffer - Element.span.last := - (line => Line_Number (Old_Lines.Length - 1), - character => Iterator.Last_UTF16_Offset + 1); - Edit.Replace_Element (Edit.Last, Element); - end; - end if; - - exception - when others => - Free (LCS); - raise; - end; + pragma Compile_Time_Warning (Standard.True, "Diff unimplemented"); + raise Program_Error with "Unimplemented procedure Diff"; end Diff; ------------------ @@ -606,1060 +85,161 @@ package body LSP.Ada_Documents is ------------------ procedure Diff_Symbols - (Self : Document; - Span : LSP.Messages.Span; - New_Text : VSS.Strings.Virtual_String; - Edit : in out LSP.Messages.TextEdit_Vector) + (Self : Document; Span : LSP.Structures.A_Range; + New_Text : VSS.Strings.Virtual_String; + Edit : in out LSP.Structures.TextEdit_Vector) is - use LSP.Types; - use LSP.Messages; - use VSS.Strings; - use VSS.Characters; - - Old_Text : VSS.Strings.Virtual_String; - Old_Lines : VSS.String_Vectors.Virtual_String_Vector; - Old_Line : VSS.Strings.Virtual_String; - Old_Length, New_Length : Natural; - - First_Marker : VSS.Strings.Markers.Character_Marker; - Last_Marker : VSS.Strings.Markers.Character_Marker; - begin - Self.Span_To_Markers (Span, First_Marker, Last_Marker); - - Old_Text := Self.Text.Slice (First_Marker, Last_Marker); - Old_Lines := Old_Text.Split_Lines - (Terminators => LSP_New_Line_Function_Set, - Keep_Terminator => True); - Old_Line := Old_Lines.Element (Old_Lines.Length); - - Old_Length := Integer (Character_Length (Old_Text)); - New_Length := Integer (Character_Length (New_Text)); - - declare - type LCS_Array is array - (Natural range 0 .. Old_Length, - Natural range 0 .. New_Length) of Integer; - type LCS_Array_Access is access all LCS_Array; - - procedure Free is - new Ada.Unchecked_Deallocation (LCS_Array, LCS_Array_Access); - - LCS : LCS_Array_Access := new LCS_Array; - Match : Integer; - Delete : Integer; - Insert : Integer; - - Old_Char : VSS.Strings.Cursors.Iterators.Characters. - Character_Iterator := Old_Text.At_First_Character; - New_Char : VSS.Strings.Cursors.Iterators.Characters. - Character_Iterator := New_Text.At_First_Character; - - Dummy : Boolean; - - Old_Index, New_Index : Integer; - - Changed_Block_Text : VSS.Strings.Virtual_String; - Changed_Block_Span : LSP.Messages.Span := ((0, 0), (0, 0)); - Span_Set : Boolean := False; - - -- to calculate span - Current_Line_Number : Line_Number := - (if Natural (Span.last.character) = 0 - then Span.last.line - 1 - else Span.last.line); - -- we do not have a line at all when the range end is on the - -- begin of a line, so set Current_Line_Number to the previous one - Old_Lines_Number : Natural := Old_Lines.Length; - Cursor : VSS.Strings.Cursors.Iterators.Characters. - Character_Iterator := Old_Line.After_Last_Character; - - procedure Backward; - -- Move old line Cursor backward, update Old_Line and - -- Old_Lines_Number if needed - - function Get_Position (Insert : Boolean) return Position; - -- get Position for a Span based on Cursor to prepare first/last - -- position for changes - - procedure Prepare_Last_Span (Insert : Boolean); - -- Store position based on Cursor to Changed_Block_Span.last if - -- it is not stored yet - - procedure Prepare_Change - (Insert : Boolean; - Char : VSS.Characters.Virtual_Character); - -- Collect change information for Text_Edit in Changed_Block_Text - -- and Changed_Block_Span - - procedure Add_Prepared_Change; - -- Add prepared New_String and corresponding Span into Text_Edit - - -------------- - -- Backward -- - -------------- - - procedure Backward is - begin - if not Cursor.Backward - and then Old_Lines_Number > 1 - then - Current_Line_Number := Current_Line_Number - 1; - Old_Lines_Number := Old_Lines_Number - 1; - Old_Line := Old_Lines.Element (Old_Lines_Number); - Cursor.Set_At_Last (Old_Line); - end if; - - Old_Index := Old_Index - 1; - Dummy := Old_Char.Backward; - end Backward; - - ------------------ - -- Get_Position -- - ------------------ - - function Get_Position (Insert : Boolean) return Position - is - -------------- - -- Backward -- - -------------- - - function Backward return Position; - function Backward return Position is - C : VSS.Strings.Cursors.Iterators.Characters. - Character_Iterator := Old_Line.At_Character (Cursor); - begin - -- "Cursor" is after the current character but we should - -- insert before it - if C.Backward then - return - (line => Current_Line_Number, - character => C.First_UTF16_Offset); - else - return - (line => Current_Line_Number, - character => 0); - end if; - end Backward; - - begin - if not Cursor.Has_Element then - return - (line => Current_Line_Number, - character => 0); - - elsif Insert then - -- "Cursor" is after the current character but we should - -- insert before it - return Backward; - - else - return - (line => Current_Line_Number, - character => Cursor.First_UTF16_Offset); - end if; - end Get_Position; - - ----------------------- - -- Prepare_Last_Span -- - ----------------------- - - procedure Prepare_Last_Span (Insert : Boolean) is - begin - if not Span_Set then - -- it is the first portion of a changed block so store - -- last position of the changes - Span_Set := True; - Changed_Block_Span.last := Get_Position (Insert); - end if; - end Prepare_Last_Span; - - -------------------- - -- Prepare_Change -- - -------------------- - - procedure Prepare_Change - (Insert : Boolean; - Char : VSS.Characters.Virtual_Character) is - begin - Prepare_Last_Span (Insert); - -- accumulating new text for the changed block - Changed_Block_Text.Prepend (Char); - end Prepare_Change; - - ------------------------- - -- Add_Prepared_Change -- - ------------------------- - - procedure Add_Prepared_Change is - begin - if not Span_Set then - -- No information for Text_Edit - return; - end if; - - Changed_Block_Span.first := Get_Position (False); - - LSP.Messages.Prepend - (Edit, LSP.Messages.TextEdit' - (span => Changed_Block_Span, - newText => Changed_Block_Text)); - - -- clearing - Changed_Block_Text.Clear; - - Changed_Block_Span := ((0, 0), (0, 0)); - Span_Set := False; - end Add_Prepared_Change; - - begin - -- prepare LCS - - -- default values for line 0 - for Index in 0 .. Old_Length loop - LCS (Index, 0) := -5 * Index; - end loop; - - -- default values for the first column - for Index in 0 .. New_Length loop - LCS (0, Index) := -5 * Index; - end loop; - - -- calculate LCS - for Row in 1 .. Old_Length loop - New_Char.Set_At_First (New_Text); - for Column in 1 .. New_Length loop - Match := LCS (Row - 1, Column - 1) + - (if Old_Char.Element = New_Char.Element - then 10 -- +10 is the 'weight' for equal lines - else -1); -- and -1 for the different - - Delete := LCS (Row - 1, Column) - 5; - Insert := LCS (Row, Column - 1) - 5; - - LCS (Row, Column) := Integer'Max (Match, Insert); - LCS (Row, Column) := Integer'Max (LCS (Row, Column), Delete); - - Dummy := New_Char.Forward; - end loop; - Dummy := Old_Char.Forward; - end loop; - - -- iterate over LCS and create Text_Edit - - Old_Char.Set_At_Last (Old_Text); - New_Char.Set_At_Last (New_Text); - Old_Index := Old_Length; - New_Index := New_Length; - - while Old_Index > 0 - and then New_Index > 0 - loop - if LCS (Old_Index, New_Index) = - LCS (Old_Index - 1, New_Index - 1) + - (if Old_Char.Element = New_Char.Element - then 10 - else -1) - then - -- both has elements - if Old_Char.Element = New_Char.Element then - -- elements are equal, add prepared Text_Edit - Add_Prepared_Change; - else - -- elements are different, change old one by new - Prepare_Change (False, New_Char.Element); - end if; - - -- move old element cursors backward - Backward; - - New_Index := New_Index - 1; - Dummy := New_Char.Backward; - - elsif LCS (Old_Index, New_Index) = - LCS (Old_Index - 1, New_Index) - 5 - then - -- element has been deleted, move old cursor backward - Prepare_Last_Span (False); - Backward; - - elsif LCS (Old_Index, New_Index) = - LCS (Old_Index, New_Index - 1) - 5 - then - -- element has been inserted - Prepare_Change (True, New_Char.Element); - - New_Index := New_Index - 1; - Dummy := New_Char.Backward; - end if; - end loop; - - while Old_Index > 0 loop - -- deleted - Prepare_Last_Span (False); - Backward; - end loop; - - while New_Index > 0 loop - -- inserted - Prepare_Change (True, New_Char.Element); - - New_Index := New_Index - 1; - Dummy := New_Char.Backward; - end loop; - - Add_Prepared_Change; - Free (LCS); - - exception - when others => - Free (LCS); - raise; - end; + pragma Compile_Time_Warning + (Standard.True, "Diff_Symbols unimplemented"); + raise Program_Error with "Unimplemented procedure Diff_Symbols"; end Diff_Symbols; - --------------------------- - -- Get_Formatting_Region -- - --------------------------- + ------------------------- + -- Find_All_References -- + ------------------------- - function Get_Formatting_Region - (Self : Document; - Context : LSP.Ada_Contexts.Context; - Position : LSP.Messages.Position) - return Laltools.Partial_GNATPP.Formatting_Region_Type - is (Laltools.Partial_GNATPP.Get_Formatting_Region - (Unit => Self.Unit (Context), - Input_Range => - Langkit_Support.Slocs.Make_Range - (Self.Get_Source_Location (Position), - Self.Get_Source_Location (Position)))); + procedure Find_All_References + (Self : Document; Context : LSP.Ada_Contexts.Context; + Definition : Libadalang.Analysis.Defining_Name; + Callback : not null access procedure + (Base_Id : Libadalang.Analysis.Base_Id; + Kind : Libadalang.Common.Ref_Result_Kind; Cancel : in out Boolean)) + is + begin + pragma Compile_Time_Warning + (Standard.True, "Find_All_References unimplemented"); + raise Program_Error with "Unimplemented procedure Find_All_References"; + end Find_All_References; ---------------- -- Formatting -- ---------------- function Formatting - (Self : Document; - Context : LSP.Ada_Contexts.Context; - Span : LSP.Messages.Span; - Cmd : Pp.Command_Lines.Cmd_Line; - Edit : out LSP.Messages.TextEdit_Vector; - Messages : out VSS.String_Vectors.Virtual_String_Vector) - return Boolean + (Self : Document; Context : LSP.Ada_Contexts.Context; + Span : LSP.Structures.A_Range; Cmd : Pp.Command_Lines.Cmd_Line; + Edit : out LSP.Structures.TextEdit_Vector; + Messages : out VSS.String_Vectors.Virtual_String_Vector) return Boolean is - use Utils.Char_Vectors; - use Utils.Char_Vectors.Char_Vectors; - use LSP.Types; - use LSP.Messages; - use Langkit_Support.Slocs; - use type LSP.Types.UTF_16_Index; - - Input : Char_Vector; - Output : Char_Vector; - Out_Span : LSP.Messages.Span; - - PP_Messages : Pp.Scanner.Source_Message_Vector; - - Sloc : constant Source_Location_Range := - (if Span = LSP.Messages.Empty_Span - then No_Source_Location_Range - else Make_Range (Self.Get_Source_Location (Span.first), - Self.Get_Source_Location (Span.last))); - - Out_Sloc : Source_Location_Range; - S : GNAT.Strings.String_Access; begin - if Span /= LSP.Messages.Empty_Span then - -- Align Span to line bounds - if Span.first.character /= 0 then - return Self.Formatting - (Context => Context, - Span => ((Span.first.line, 0), Span.last), - Cmd => Cmd, - Edit => Edit, - Messages => Messages); - elsif Span.last.character /= 0 then - return Self.Formatting - (Context => Context, - Span => (Span.first, (Span.last.line + 1, 0)), - Cmd => Cmd, - Edit => Edit, - Messages => Messages); - end if; - end if; - - S := new String'(VSS.Strings.Conversions.To_UTF_8_String (Self.Text)); - Input.Append (S.all); - GNAT.Strings.Free (S); - - LSP.Lal_Utils.Format_Vector - (Cmd => Cmd, - Input => Input, - Node => Self.Unit (Context).Root, - In_Sloc => Sloc, - Output => Output, - Out_Sloc => Out_Sloc, - Messages => PP_Messages); - - -- Properly format the messages received from gnatpp, using the - -- the GNAT standard way for messages (i.e: :: ) - - if not PP_Messages.Is_Empty then - declare - Filename : constant String := URI_To_File - (Self => Context, URI => Self.URI); - File : constant GNATCOLL.VFS.Virtual_File := - GNATCOLL.VFS.Create_From_UTF8 (Filename); - begin - for Error of PP_Messages loop - Messages.Append - (VSS.Strings.Conversions.To_Virtual_String - (File.Display_Base_Name - & ":" - & Pp.Scanner.Sloc_Image (Error.Sloc) - & ": " - & String (To_Array (Error.Text)))); - end loop; - - return False; - end; - end if; - - S := new String'(Output.To_Array); - if Lal_PP_Output.Is_Active then - Lal_PP_Output.Trace (S.all); - end if; - - if Span = LSP.Messages.Empty_Span then - -- diff for the whole document - Diff - (Self, - VSS.Strings.Conversions.To_Virtual_String (S.all), - Edit => Edit); - - elsif Out_Sloc = No_Source_Location_Range then - -- Range formating fails. Do nothing, skip formating altogether - null; - else - -- diff for a part of the document - - Out_Span := Self.To_LSP_Range (Out_Sloc); - - -- Use line diff if the range is too wide - if Span.last.line - Span.first.line > 5 then - Diff - (Self, - VSS.Strings.Conversions.To_Virtual_String (S.all), - Span, - Out_Span, - Edit); - else - declare - Formatted : constant VSS.Strings.Virtual_String := - VSS.Strings.Conversions.To_Virtual_String (S.all); - Slice : VSS.Strings.Virtual_String; - - begin - LSP.Lal_Utils.Span_To_Slice (Formatted, Out_Span, Slice); - - Diff_Symbols - (Self, - Span, - Slice, - Edit); - end; - end if; - end if; - - GNAT.Strings.Free (S); - return True; - - exception - when E : others => - Lal_PP_Output.Trace (E); - GNAT.Strings.Free (S); - return False; + pragma Compile_Time_Warning (Standard.True, "Formatting unimplemented"); + return raise Program_Error with "Unimplemented function Formatting"; end Formatting; - ---------------------- - -- Range_Formatting -- - ---------------------- - - function Range_Formatting - (Self : Document; - Context : LSP.Ada_Contexts.Context; - Span : LSP.Messages.Span; - PP_Options : Pp.Command_Lines.Cmd_Line; - Edit : out LSP.Messages.TextEdit_Vector; - Messages : out VSS.String_Vectors.Virtual_String_Vector) - return Boolean - is - use Langkit_Support.Slocs; - use Laltools.Partial_GNATPP; - use LSP.Types; - use LSP.Messages; - use Utils.Char_Vectors; - use Utils.Char_Vectors.Char_Vectors; - - procedure Append_PP_Messages - (PP_Messages : Pp.Scanner.Source_Message_Vector); - -- Append any message of PP_Messages to Messages properly formatting - -- them using the GNAT standard way for messages - -- (i.e: :: ) - - ------------------------ - -- Append_PP_Messages -- - ------------------------ - - procedure Append_PP_Messages - (PP_Messages : Pp.Scanner.Source_Message_Vector) - is - Filename : constant String := - Context.URI_To_File (Self.URI); - File : constant GNATCOLL.VFS.Virtual_File := - GNATCOLL.VFS.Create_From_UTF8 (Filename); - - begin - for Message of PP_Messages loop - Messages.Append - (VSS.Strings.Conversions.To_Virtual_String - (File.Display_Base_Name - & ":" - & Pp.Scanner.Sloc_Image (Message.Sloc) - & ": " - & String (To_Array (Message.Text)))); - end loop; - end Append_PP_Messages; - - begin - Context.Trace.Trace ("On Range_Formatting"); - - Context.Trace.Trace ("Format_Selection"); - declare - Unit : constant Analysis_Unit := - Self.Unit (Context); - Input_Selection_Range : constant Source_Location_Range := - (if Span = LSP.Messages.Empty_Span then No_Source_Location_Range - else Make_Range - (Self.Get_Source_Location (Span.first), - Self.Get_Source_Location (Span.last))); - Partial_Formatting_Edit : - constant Laltools.Partial_GNATPP.Partial_Formatting_Edit := - Format_Selection (Unit, Input_Selection_Range, PP_Options); - - begin - if not Partial_Formatting_Edit.Diagnostics.Is_Empty then - Append_PP_Messages (Partial_Formatting_Edit.Diagnostics); - Context.Trace.Trace - ("Non empty diagnostics from GNATPP - " - & "not continuing with Range_Formatting"); - return False; - end if; - - Context.Trace.Trace ("Computing Range_Formatting Text_Edits"); - Edit.Clear; - declare - Edit_Span : constant LSP.Messages.Span := - Self.To_LSP_Range (Partial_Formatting_Edit.Edit.Location); - Edit_Text : constant VSS.Strings.Virtual_String := - VSS.Strings.Conversions.To_Virtual_String - (Partial_Formatting_Edit.Edit.Text); - - begin - Edit.Append (TextEdit'(Edit_Span, Edit_Text)); - end; - - return True; - end; - - exception - when E : others => - Log (Self.Trace, E, "in Range_Formatting"); - return False; - end Range_Formatting; - - ------------------------ - -- Get_Imported_Units -- - ------------------------ + -------------------- + -- Get_Any_Symbol -- + -------------------- - procedure Get_Imported_Units - (Self : Document; - Context : LSP.Ada_Contexts.Context; - Project_URI : LSP.Types.LSP_URI; - Show_Implicit : Boolean; - Result : out LSP.Messages.ALS_Unit_Description_Vector) + procedure Get_Any_Symbol + (Self : in out Document; Context : LSP.Ada_Contexts.Context; + Pattern : LSP.Search.Search_Pattern'Class; + Limit : Ada.Containers.Count_Type; Only_Public : Boolean; + Canceled : access function return Boolean; + Result : in out LSP.Ada_Completions.Completion_Maps.Map) is - Unit : constant Libadalang.Analysis.Analysis_Unit := - LSP.Ada_Documents.Unit (Self => Self, - Context => Context); - Root : constant Ada_Node := Unit.Root; - - procedure Append_Units - (Units : Libadalang.Analysis.Compilation_Unit_Array); - - ------------------ - -- Append_Units -- - ------------------ - - procedure Append_Units - (Units : Libadalang.Analysis.Compilation_Unit_Array) is - begin - for Unit of Units loop - Result.Append - (LSP.Messages.ALS_Unit_Description' - (uri => LSP.Types.File_To_URI (Unit.Unit.Get_Filename), - projectUri => Project_URI)); - end loop; - end Append_Units; - begin - - case Root.Kind is - when Libadalang.Common.Ada_Compilation_Unit_Range => - declare - Comp_Unit : constant Compilation_Unit := - As_Compilation_Unit (Root); - Units : constant Compilation_Unit_Array := - (if Show_Implicit then - Comp_Unit.P_Unit_Dependencies - else - Comp_Unit.P_Withed_Units); - begin - Append_Units (Units); - end; - - when Libadalang.Common.Ada_Compilation_Unit_List_Range => - declare - Comp_Unit_List : constant Compilation_Unit_List := - As_Compilation_Unit_List (Root); - begin - for Comp_Unit of Comp_Unit_List loop - Append_Units - (if Show_Implicit then - Comp_Unit.P_Withed_Units - else - Comp_Unit.P_Unit_Dependencies); - end loop; - end; - when others => - null; - end case; - end Get_Imported_Units; + pragma Compile_Time_Warning + (Standard.True, "Get_Any_Symbol unimplemented"); + raise Program_Error with "Unimplemented procedure Get_Any_Symbol"; + end Get_Any_Symbol; ------------------------- - -- Get_Importing_Units -- + -- Get_Completion_Node -- ------------------------- - procedure Get_Importing_Units - (Self : Document; - Context : LSP.Ada_Contexts.Context; - Project_URI : LSP.Types.LSP_URI; - Show_Implicit : Boolean; - Result : out LSP.Messages.ALS_Unit_Description_Vector) + procedure Get_Completion_Node + (Self : Document; Context : LSP.Ada_Contexts.Context; + Position : LSP.Structures.Position; + Sloc : out Langkit_Support.Slocs.Source_Location; + Token : out Libadalang.Common.Token_Reference; + Node : out Libadalang.Analysis.Ada_Node) is - - Root : constant Ada_Node := Self.Unit (Context).Root; - - procedure Append_Units - (Units : Libadalang.Analysis.Analysis_Unit_Array); - - ------------------ - -- Append_Units -- - ------------------ - - procedure Append_Units - (Units : Libadalang.Analysis.Analysis_Unit_Array) is - begin - for Unit of Units loop - Result.Append - (LSP.Messages.ALS_Unit_Description' - (uri => LSP.Types.File_To_URI (Unit.Get_Filename), - projectUri => Project_URI)); - end loop; - end Append_Units; - begin + pragma Compile_Time_Warning + (Standard.True, "Get_Completion_Node unimplemented"); + raise Program_Error with "Unimplemented procedure Get_Completion_Node"; + end Get_Completion_Node; - case Root.Kind is - when Libadalang.Common.Ada_Compilation_Unit_Range => - declare - Comp_Unit : constant Compilation_Unit := - As_Compilation_Unit (Root); - Importing_Units : constant - Libadalang.Analysis.Analysis_Unit_Array := - Comp_Unit.P_Filter_Is_Imported_By - (Units => Context.Analysis_Units, - Transitive => Show_Implicit); - begin - Append_Units (Importing_Units); - end; - - when Libadalang.Common.Ada_Compilation_Unit_List_Range => - declare - Comp_Unit_List : constant Compilation_Unit_List := - As_Compilation_Unit_List (Root); - begin - for Comp_Unit of Comp_Unit_List loop - Append_Units - (Comp_Unit.P_Filter_Is_Imported_By - (Units => Context.Analysis_Units, - Transitive => Show_Implicit)); - end loop; - end; - when others => - null; - end case; - end Get_Importing_Units; - - ------------------------- - -- Find_All_References -- - ------------------------- + ------------------------ + -- Get_Completions_At -- + ------------------------ - procedure Find_All_References - (Self : Document; - Context : LSP.Ada_Contexts.Context; - Definition : Libadalang.Analysis.Defining_Name; - Callback : not null access procedure - (Base_Id : Libadalang.Analysis.Base_Id; - Kind : Libadalang.Common.Ref_Result_Kind; - Cancel : in out Boolean)) + procedure Get_Completions_At + (Self : Document; + Providers : LSP.Ada_Completions.Completion_Provider_List; + Context : LSP.Ada_Contexts.Context; + Sloc : Langkit_Support.Slocs.Source_Location; + Token : Libadalang.Common.Token_Reference; + Node : Libadalang.Analysis.Ada_Node; + Names : out Ada_Completions.Completion_Maps.Map; + Result : out LSP.Structures.CompletionList) is - Units : constant Libadalang.Analysis.Analysis_Unit_Array := - (1 => LSP.Ada_Documents.Unit (Self => Self, - Context => Context)); begin - LSP.Ada_Id_Iterators.Find_All_References (Definition, Units, Callback); - exception - when E : Libadalang.Common.Property_Error => - Log (Self.Trace, E, "in Find_All_References"); - end Find_All_References; + pragma Compile_Time_Warning + (Standard.True, "Get_Completions_At unimplemented"); + raise Program_Error with "Unimplemented procedure Get_Completions_At"; + end Get_Completions_At; ---------------- -- Get_Errors -- ---------------- procedure Get_Errors - (Self : in out Document; - Context : LSP.Ada_Contexts.Context; - Changed : out Boolean; - Errors : out LSP.Messages.Diagnostic_Vector; - Force : Boolean := False) is + (Self : in out Document; Context : LSP.Ada_Contexts.Context; + Changed : out Boolean; Errors : out LSP.Structures.Diagnostic_Vector; + Force : Boolean := False) + is begin - Errors.Clear; - Changed := (for some Source of Self.Diagnostic_Sources => - Source.Has_New_Diagnostic (Context)); - - if Changed or else Force then - for Source of Self.Diagnostic_Sources loop - Source.Get_Diagnostic (Context, Errors); - end loop; - end if; + pragma Compile_Time_Warning (Standard.True, "Get_Errors unimplemented"); + raise Program_Error with "Unimplemented procedure Get_Errors"; end Get_Errors; - --------------------- - -- Has_Diagnostics -- - --------------------- - - function Has_Diagnostics - (Self : Document; - Context : LSP.Ada_Contexts.Context) - return Boolean is - begin - return Self.Unit (Context).Has_Diagnostics; - end Has_Diagnostics; - - -------------------------- - -- Get_Symbol_Hierarchy -- - -------------------------- + ------------------------ + -- Get_Folding_Blocks -- + ------------------------ - procedure Get_Symbol_Hierarchy - (Self : Document; - Context : LSP.Ada_Contexts.Context; - Pattern : LSP.Search.Search_Pattern'Class; - Canceled : access function return Boolean; - Result : out LSP.Messages.Symbol_Vector) + procedure Get_Folding_Blocks + (Self : Document; Context : LSP.Ada_Contexts.Context; + Lines_Only : Boolean; Comments : Boolean; + Canceled : access function return Boolean; + Result : out LSP.Structures.FoldingRange_Vector) is - use LSP.Messages; - - procedure Walk - (Node : Libadalang.Analysis.Ada_Node; - Cursor : LSP.Messages.DocumentSymbol_Trees.Cursor; - Nested_Level : Integer; - Tree : in out LSP.Messages.DocumentSymbol_Tree); - -- Traverse Node and all its children recursively. Find any defining - -- name and construct corresponding symbol node, then append it to - -- the Tree under a position pointed by the Cursor. - - ---------- - -- Walk -- - ---------- - - procedure Walk - (Node : Libadalang.Analysis.Ada_Node; - Cursor : LSP.Messages.DocumentSymbol_Trees.Cursor; - Nested_Level : Integer; - Tree : in out LSP.Messages.DocumentSymbol_Tree) - is - Next : LSP.Messages.DocumentSymbol_Trees.Cursor := Cursor; - Dummy : LSP.Messages.DocumentSymbol_Trees.Cursor; - -- Dummy is used for node which can't be parents like pragma and with - -- statements - New_Nested_Level : Integer := Nested_Level; - begin - if Node = No_Ada_Node - or else Node.Kind in Libadalang.Common.Ada_Expr - or else Canceled.all - then - return; - end if; - - if Node.Kind in Libadalang.Common.Ada_Basic_Decl then - declare - Decl : constant Libadalang.Analysis.Basic_Decl := - Node.As_Basic_Decl; - - Kind : constant LSP.Messages.SymbolKind := - LSP.Lal_Utils.Get_Decl_Kind - (Decl, Ignore_Local => Nested_Level > 1); - - begin - if Kind /= LSP.Messages.A_Null then - New_Nested_Level := New_Nested_Level + 1; - declare - Names : constant Libadalang.Analysis.Defining_Name_Array - := Decl.P_Defining_Names; - begin - - for Name of Names loop - exit when Name = Libadalang.Analysis.No_Defining_Name; - - if Pattern.Match - (LSP.Lal_Utils.To_Virtual_String (Name.Text)) - then - declare - Is_Function : Boolean; - Profile : constant VSS.Strings.Virtual_String := - Get_Profile (Decl, Is_Function); - Item : constant LSP.Messages.DocumentSymbol := - (name => - LSP.Lal_Utils.To_Virtual_String (Name.Text), - detail => - (Is_Set => True, Value => Profile), - kind => Kind, - deprecated => (Is_Set => False), - tags => LSP.Messages.Empty, - span => LSP.Lal_Utils.To_Span - (Node.Sloc_Range), - selectionRange => LSP.Lal_Utils.To_Span - (Name.Sloc_Range), - alsIsDeclaration => - (Is_Set => True, - Value => Is_Declaration (Decl)), - alsIsAdaProcedure => - (if Is_Function - then (Is_Set => False) - else (Is_Set => True, Value => True)), - alsVisibility => - (Is_Set => True, - Value => Get_Visibility (Decl)), - children => True); - begin - Tree.Insert_Child - (Parent => Cursor, - Before => - Messages.DocumentSymbol_Trees.No_Element, - New_Item => Item, - Position => Next); - end; - end if; - end loop; - end; - end if; - end; - - elsif Pattern.Get_Kind /= Start_Word_Text - and then Node.Kind in Libadalang.Common.Ada_With_Clause_Range - then - declare - With_Node : constant Libadalang.Analysis.With_Clause := - Node.As_With_Clause; - begin - for N of With_Node.F_Packages loop - declare - Item : constant LSP.Messages.DocumentSymbol := - (name => - LSP.Lal_Utils.To_Virtual_String (N.Text), - detail => (Is_Set => False), - kind => Namespace, - tags => LSP.Messages.Empty, - deprecated => (Is_Set => False), - span => LSP.Lal_Utils.To_Span - (Node.Sloc_Range), - selectionRange => LSP.Lal_Utils.To_Span - (N.Sloc_Range), - alsIsDeclaration => (Is_Set => False), - alsIsAdaProcedure => (Is_Set => False), - alsVisibility => (Is_Set => False), - children => False); - begin - Tree.Insert_Child - (Parent => Next, - Before => - Messages.DocumentSymbol_Trees.No_Element, - New_Item => Item, - Position => Dummy); - end; - end loop; - end; - - elsif Pattern.Get_Kind /= Start_Word_Text - and then Nested_Level <= 1 - and then Node.Kind in Libadalang.Common.Ada_Pragma_Node - then - declare - Pragma_Node : constant Libadalang.Analysis.Pragma_Node := - Node.As_Pragma_Node; - Id : constant Libadalang.Analysis.Identifier := - Pragma_Node.F_Id; - Item : constant LSP.Messages.DocumentSymbol := - (name => - LSP.Lal_Utils.To_Virtual_String (Id.Text), - detail => - (Is_Set => True, - Value => - LSP.Lal_Utils.To_Virtual_String - ("(" & (Pragma_Node.F_Args.Text & ")"))), - kind => Property, - tags => LSP.Messages.Empty, - deprecated => (Is_Set => False), - span => LSP.Lal_Utils.To_Span - (Node.Sloc_Range), - selectionRange => LSP.Lal_Utils.To_Span - (Id.Sloc_Range), - alsIsDeclaration => (Is_Set => False), - alsIsAdaProcedure => (Is_Set => False), - alsVisibility => (Is_Set => False), - children => False); - begin - Tree.Insert_Child - (Parent => Next, - Before => - Messages.DocumentSymbol_Trees.No_Element, - New_Item => Item, - Position => Dummy); - end; - end if; - - for Child of Node.Children loop - if Child not in Libadalang.Analysis.No_Ada_Node then - Walk (Child, Next, New_Nested_Level, Tree); - exit when Canceled.all; - end if; - end loop; - end Walk; - - Root : constant Libadalang.Analysis.Ada_Node := Self.Unit (Context).Root; begin - Result := (Is_Tree => True, others => <>); - Walk (Root, Result.Tree.Root, 0, Result.Tree); - end Get_Symbol_Hierarchy; + pragma Compile_Time_Warning + (Standard.True, "Get_Folding_Blocks unimplemented"); + raise Program_Error with "Unimplemented procedure Get_Folding_Blocks"; + end Get_Folding_Blocks; - ----------------- - -- Get_Symbols -- - ----------------- + --------------------------- + -- Get_Formatting_Region -- + --------------------------- - procedure Get_Symbols - (Self : Document; - Context : LSP.Ada_Contexts.Context; - Pattern : LSP.Search.Search_Pattern'Class; - Canceled : access function return Boolean; - Result : out LSP.Messages.Symbol_Vector) + function Get_Formatting_Region + (Self : Document; Context : LSP.Ada_Contexts.Context; + Position : LSP.Structures.Position) + return Laltools.Partial_GNATPP.Formatting_Region_Type is - use LSP.Messages; - Element : Libadalang.Analysis.Ada_Node; - - Is_Defining_Name : constant Libadalang.Iterators.Ada_Node_Predicate := - Libadalang.Iterators.Kind_Is (Libadalang.Common.Ada_Defining_Name); - -- This object will be deallocated by Cursor's finalization - - Cursor : Libadalang.Iterators.Traverse_Iterator'Class := - Libadalang.Iterators.Find - (Self.Unit (Context).Root, Is_Defining_Name); - - begin - Result := LSP.Messages.Symbol_Vector' - (Is_Tree => False, - Vector => <>); - - while not Canceled.all - and then Cursor.Next (Element) - loop - declare - Item : LSP.Messages.SymbolInformation; - Kind : constant LSP.Messages.SymbolKind := - LSP.Lal_Utils.Get_Decl_Kind - (Element.As_Defining_Name.P_Basic_Decl, Ignore_Local => True); - begin - if Kind /= LSP.Messages.A_Null - and then Pattern.Match - (LSP.Lal_Utils.To_Virtual_String (Element.Text)) - then - Item := - (name => - LSP.Lal_Utils.To_Virtual_String (Element.Text), - kind => Kind, - alsIsAdaProcedure => <>, - tags => LSP.Messages.Empty, - deprecated => <>, - location => - (uri => Self.URI, - span => LSP.Lal_Utils.To_Span (Element.Sloc_Range), - alsKind => LSP.Messages.Empty_Set), - containerName => <>); - - Result.Vector.Append (Item); - end if; - end; - end loop; - end Get_Symbols; - - --------------------- - -- Line_Terminator -- - --------------------- - - function Line_Terminator - (Self : Document'Class) return VSS.Strings.Virtual_String is begin - if Self.Line_Terminator.Is_Empty then - -- Document has no line terminator yet, return LF as most used - -- - -- Should it be platform specific? CRLF for Windows, CR for Mac? - - return - VSS.Strings.To_Virtual_String - ((1 => Ada.Characters.Wide_Wide_Latin_1.LF)); - - else - return Self.Line_Terminator; - end if; - end Line_Terminator; + pragma Compile_Time_Warning + (Standard.True, "Get_Formatting_Region unimplemented"); + return + raise Program_Error + with "Unimplemented function Get_Formatting_Region"; + end Get_Formatting_Region; --------------------- -- Get_Indentation -- --------------------- function Get_Indentation - (Self : Document; - Context : LSP.Ada_Contexts.Context; - Line : LSP.Types.Line_Number) + (Self : Document; Context : LSP.Ada_Contexts.Context; Line : Positive) return Natural is - Unit : constant Libadalang.Analysis.Analysis_Unit := - Self.Unit (Context); - Line_Number : constant Langkit_Support.Slocs.Line_Number := - Self.Get_Source_Location (LSP.Messages.Position'(Line, 1)).Line; begin - return Laltools.Partial_GNATPP.Estimate_Indentation (Unit, Line_Number); + pragma Compile_Time_Warning + (Standard.True, "Get_Indentation unimplemented"); + return raise Program_Error with "Unimplemented function Get_Indentation"; end Get_Indentation; ----------------- @@ -1667,510 +247,86 @@ package body LSP.Ada_Documents is ----------------- function Get_Node_At - (Self : Document; - Context : LSP.Ada_Contexts.Context; - Position : LSP.Messages.Position) - return Libadalang.Analysis.Ada_Node + (Self : Document; Context : LSP.Ada_Contexts.Context; + Position : LSP.Structures.Position) return Libadalang.Analysis.Ada_Node is - use Langkit_Support.Slocs; - Unit : constant Libadalang.Analysis.Analysis_Unit := Self.Unit (Context); begin - if Unit.Root = No_Ada_Node then - return No_Ada_Node; - end if; - - return Unit.Root.Lookup (Self.Get_Source_Location (Position)); + pragma Compile_Time_Warning (Standard.True, "Get_Node_At unimplemented"); + return raise Program_Error with "Unimplemented function Get_Node_At"; end Get_Node_At; - ------------------------ - -- Get_Folding_Blocks -- - ------------------------ - - procedure Get_Folding_Blocks - (Self : Document; - Context : LSP.Ada_Contexts.Context; - Lines_Only : Boolean; - Comments : Boolean; - Canceled : access function return Boolean; - Result : out LSP.Messages.FoldingRange_Vector) - is - use Libadalang.Common; - - Location : LSP.Messages.Location; - foldingRange : LSP.Messages.FoldingRange; - Have_With : Boolean := False; - - function Parse (Node : Ada_Node'Class) return Visit_Status; - -- Includes Node location to the result if the node has "proper" kind - - procedure Store_Span (Span : LSP.Messages.Span); - -- Include Span to the result . - - ----------- - -- Parse -- - ----------- - - function Parse (Node : Ada_Node'Class) return Visit_Status - is - - procedure Store_With_Block; - -- Store folding for with/use clauses as one folding block - - ---------------------- - -- Store_With_Block -- - ---------------------- - - procedure Store_With_Block is - use type LSP.Types.Line_Number; - begin - if not Have_With then - return; - end if; - - if foldingRange.startLine /= foldingRange.endLine then - Result.Append (foldingRange); - end if; - - Have_With := False; - end Store_With_Block; - - Result : Visit_Status := Into; - begin - if Canceled.all then - return Stop; - end if; - --- Cat_Namespace, --- Cat_Constructor, --- Cat_Destructor, --- Cat_Structure, --- Cat_Case_Inside_Record, --- Cat_Union, --- Cat_Custom - - case Node.Kind is - when Ada_Package_Decl | - Ada_Generic_Formal_Package | - Ada_Package_Body | --- Cat_Package - - Ada_Type_Decl | - - Ada_Classwide_Type_Decl | --- Cat_Class - - Ada_Protected_Type_Decl | --- Cat_Protected - - Ada_Task_Type_Decl | - Ada_Single_Task_Type_Decl | --- Cat_Task - - Ada_Subp_Decl | - Ada_Subp_Body | - Ada_Generic_Formal_Subp_Decl | - Ada_Abstract_Subp_Decl | - Ada_Abstract_Formal_Subp_Decl | - Ada_Concrete_Formal_Subp_Decl | - Ada_Generic_Subp_Internal | - Ada_Null_Subp_Decl | - Ada_Subp_Renaming_Decl | - Ada_Subp_Body_Stub | - Ada_Generic_Subp_Decl | - Ada_Generic_Subp_Instantiation | - Ada_Generic_Subp_Renaming_Decl | - Ada_Subp_Kind_Function | - Ada_Subp_Kind_Procedure | - Ada_Access_To_Subp_Def | --- Cat_Procedure --- Cat_Function --- Cat_Method - - Ada_Case_Stmt | --- Cat_Case_Statement - - Ada_If_Stmt | --- Cat_If_Statement - - Ada_For_Loop_Stmt | - Ada_While_Loop_Stmt | --- Cat_Loop_Statement - - Ada_Begin_Block | - Ada_Decl_Block | --- Cat_Declare_Block --- Cat_Simple_Block - --- Ada_Return_Stmt | --- Ada_Extended_Return_Stmt | - Ada_Extended_Return_Stmt_Object_Decl | --- Cat_Return_Block - - Ada_Select_Stmt | --- Cat_Select_Statement - - Ada_Entry_Body | --- Cat_Entry - - Ada_Exception_Handler | --- Cat_Exception_Handler - - Ada_Pragma_Node_List | - Ada_Pragma_Argument_Assoc | - Ada_Pragma_Node | --- Cat_Pragma - - Ada_Aspect_Spec => --- Cat_Aspect - - Store_With_Block; - - foldingRange.kind := - (Is_Set => True, Value => LSP.Messages.Region); - - Location := LSP.Lal_Utils.Get_Node_Location (Ada_Node (Node)); - Store_Span (Location.span); - - when Ada_With_Clause | - Ada_Use_Package_Clause | - Ada_Use_Type_Clause => - - Location := LSP.Lal_Utils.Get_Node_Location (Ada_Node (Node)); - - if not Have_With then - Have_With := True; - - foldingRange.kind := - (Is_Set => True, Value => LSP.Messages.Imports); - - foldingRange.startLine := Location.span.first.line; - end if; - - foldingRange.endLine := Location.span.last.line; - - -- Do not step into with/use clause - Result := Over; - - when others => - Store_With_Block; - end case; - - return Result; - end Parse; - - ---------------- - -- Store_Span -- - ---------------- - - procedure Store_Span (Span : LSP.Messages.Span) is - use type LSP.Types.Line_Number; - begin - if not Lines_Only - or else Span.first.line /= Span.last.line - then - foldingRange.startLine := Span.first.line; - foldingRange.endLine := Span.last.line; - - if not Lines_Only then - foldingRange.startCharacter := - (Is_Set => True, - Value => LSP.Types.LSP_Number (Span.first.character)); - - foldingRange.startCharacter := - (Is_Set => True, - Value => LSP.Types.LSP_Number (Span.last.character)); - end if; - - Result.Append (foldingRange); - end if; - end Store_Span; - - Token : Token_Reference; - Span : LSP.Messages.Span; - - begin - Traverse (Self.Unit (Context).Root, Parse'Access); - - if not Comments then - -- do not process comments - return; - end if; - - -- Looking for comments - foldingRange.kind := (Is_Set => False); - Token := First_Token (Self.Unit (Context)); - - while Token /= No_Token - and then not Canceled.all - loop - case Kind (Data (Token)) is - when Ada_Comment => - if not foldingRange.kind.Is_Set then - foldingRange.kind := - (Is_Set => True, Value => LSP.Messages.Comment); - Span := LSP.Lal_Utils.Get_Token_Span (Token); - else - Span.last := LSP.Lal_Utils.Get_Token_Span (Token).last; - end if; - - when Ada_Whitespace => - null; - - when others => - if foldingRange.kind.Is_Set then - Store_Span (Span); - foldingRange.kind := (Is_Set => False); - end if; - end case; - - Token := Next (Token); - end loop; - end Get_Folding_Blocks; - - ----------------- - -- Get_Profile -- - ----------------- + ------------------------- + -- Get_Source_Location -- + ------------------------- - function Get_Profile - (Node : Libadalang.Analysis.Basic_Decl; - Is_Function : out Boolean) return VSS.Strings.Virtual_String + function Get_Source_Location + (Self : Document'Class; Position : LSP.Structures.Position) + return Langkit_Support.Slocs.Source_Location is - use Libadalang.Common; - - function To_Text - (Node : Ada_Node'Class) return VSS.Strings.Virtual_String; - -- Retrieve the node text and format it - - function To_Profile - (Node : Libadalang.Analysis.Subp_Spec'Class) - return VSS.Strings.Virtual_String; - - ------------- - -- To_Text -- - ------------- - - function To_Text - (Node : Ada_Node'Class) return VSS.Strings.Virtual_String - is - Node_Text : constant Langkit_Support.Text.Text_Type := Node.Text; - Was_Space : Boolean := False; - Result : VSS.Strings.Virtual_String; - - begin - for I in Node_Text'Range loop - if Node_Text (I) = ' ' then - -- Trim multiple whitespace to only keep one - - if not Was_Space then - Result.Append - (VSS.Characters.Virtual_Character (Node_Text (I))); - end if; - - Was_Space := True; - - -- Remove the new line character - - elsif Node_Text (I) /= Ada.Characters.Wide_Wide_Latin_1.LF then - Was_Space := False; - Result.Append - (VSS.Characters.Virtual_Character (Node_Text (I))); - end if; - end loop; - - return Result; - end To_Text; - - ---------------- - -- To_Profile -- - ---------------- - - function To_Profile - (Node : Libadalang.Analysis.Subp_Spec'Class) - return VSS.Strings.Virtual_String - is - Result : VSS.Strings.Virtual_String; - Params : constant Param_Spec_Array := Node.P_Params; - Returns : constant Type_Expr := Node.F_Subp_Returns; - - begin - if Params'Length > 0 then - Result.Append ('('); - end if; - - for Param of Params loop - declare - use type VSS.Strings.Character_Count; - - Names : constant Defining_Name_List := Param.F_Ids; - Init : constant Expr := Param.F_Default_Expr; - Item : VSS.Strings.Virtual_String; - Mode : constant Ada_Mode := Param.F_Mode; - - begin - Item.Append (" :"); - - case Mode is - when Ada_Mode_Default | Ada_Mode_In => - Item.Append (" in "); - when Ada_Mode_In_Out => - Item.Append (" in out "); - when Ada_Mode_Out => - Item.Append (" out "); - end case; - - Item.Append (To_Text (Param.F_Type_Expr)); - - if not Init.Is_Null then - Item.Append (" := "); - Item.Append (To_Text (Init)); - end if; - - for J in Names.First_Child_Index .. Names.Last_Child_Index loop - if Result.Character_Length /= 1 then - Result.Append ("; "); - end if; - - Result.Append (To_Text (Names.Child (J))); - Result.Append (Item); - end loop; - end; - end loop; - - if Params'Length > 0 then - Result.Append (')'); - end if; - - if not Returns.Is_Null then - Is_Function := True; - Result.Append (" return "); - Result.Append (To_Text (Returns)); - end if; - - return Result; - end To_Profile; - begin - Is_Function := False; - - case Node.Kind is - when Ada_Classic_Subp_Decl => - return To_Profile (Node.As_Classic_Subp_Decl.F_Subp_Spec); - when Ada_Base_Subp_Body => - return To_Profile (Node.As_Base_Subp_Body.F_Subp_Spec); - when Ada_Generic_Subp_Decl => - return To_Profile - (Node.As_Generic_Subp_Decl.F_Subp_Decl.F_Subp_Spec); - when others => - return VSS.Strings.Empty_Virtual_String; - end case; - end Get_Profile; + pragma Compile_Time_Warning + (Standard.True, "Get_Source_Location unimplemented"); + return + raise Program_Error with "Unimplemented function Get_Source_Location"; + end Get_Source_Location; - -------------------- - -- Is_Declaration -- - -------------------- + -------------------------- + -- Get_Symbol_Hierarchy -- + -------------------------- - function Is_Declaration - (Node : Libadalang.Analysis.Basic_Decl) return Boolean + procedure Get_Symbol_Hierarchy + (Self : Document; Context : LSP.Ada_Contexts.Context; + Pattern : LSP.Search.Search_Pattern'Class; + Canceled : access function return Boolean; + Result : out LSP.Structures.DocumentSymbol_Vector) is - use Libadalang.Common; begin - case Node.Kind is - when Ada_Base_Package_Decl | - Ada_Generic_Package_Decl | - Ada_Generic_Package_Instantiation | - Ada_Generic_Package_Renaming_Decl | - Ada_Package_Renaming_Decl | - Ada_Abstract_Subp_Decl | - Ada_Formal_Subp_Decl | - Ada_Subp_Decl | - Ada_Subp_Renaming_Decl | - Ada_Generic_Subp_Instantiation | - Ada_Generic_Subp_Renaming_Decl | - Ada_Generic_Subp_Decl | - Ada_Null_Subp_Decl | - Ada_Expr_Function | - Ada_Protected_Type_Decl | - Ada_Single_Protected_Decl | - Ada_Entry_Decl | - Ada_Type_Decl | - Ada_Single_Task_Decl | - Ada_Task_Type_Decl => - return True; - when others => - return False; - end case; - end Is_Declaration; + pragma Compile_Time_Warning + (Standard.True, "Get_Symbol_Hierarchy unimplemented"); + raise Program_Error with "Unimplemented procedure Get_Symbol_Hierarchy"; + end Get_Symbol_Hierarchy; - -------------------- - -- Get_Visibility -- - -------------------- + ----------------- + -- Get_Symbols -- + ----------------- - function Get_Visibility - (Node : Libadalang.Analysis.Basic_Decl) - return LSP.Messages.Als_Visibility + procedure Get_Symbols + (Self : Document; Context : LSP.Ada_Contexts.Context; + Pattern : LSP.Search.Search_Pattern'Class; + Canceled : access function return Boolean; + Result : out LSP.Structures.DocumentSymbol_Vector) is - use Libadalang.Common; begin - for Parent of Node.Parents loop - if Parent.Kind = Ada_Private_Part then - return LSP.Messages.Als_Private; - elsif Parent.Kind in Ada_Protected_Body | Ada_Protected_Def then - return LSP.Messages.Als_Protected; - end if; - end loop; - return LSP.Messages.Als_Public; - end Get_Visibility; + pragma Compile_Time_Warning (Standard.True, "Get_Symbols unimplemented"); + raise Program_Error with "Unimplemented procedure Get_Symbols"; + end Get_Symbols; - ------------------------- - -- Get_Source_Location -- - ------------------------- + ----------------- + -- Get_Text_At -- + ----------------- - function Get_Source_Location - (Self : Document'Class; - Position : LSP.Messages.Position) - return Langkit_Support.Slocs.Source_Location + function Get_Text_At + (Self : Document; Start_Pos : LSP.Structures.Position; + End_Pos : LSP.Structures.Position) return VSS.Strings.Virtual_String is - use type LSP.Types.Line_Number; - use type VSS.Unicode.UTF16_Code_Unit_Offset; - use type VSS.Strings.Character_Index; - - Iterator : VSS.Strings.Character_Iterators.Character_Iterator := - Self.Text.At_Character (Self.Line_To_Marker (Position.line)); - - Line_Offset : constant VSS.Unicode.UTF16_Code_Unit_Offset := - Iterator.First_UTF16_Offset; - - Line_First_Character : constant VSS.Strings.Character_Index := - Iterator.Character_Index; begin - while Iterator.First_UTF16_Offset - Line_Offset <= Position.character - and then Iterator.Forward - loop - null; - end loop; - - return ((Line => Langkit_Support.Slocs.Line_Number (Position.line + 1), - Column => Langkit_Support.Slocs.Column_Number - (Iterator.Character_Index - Line_First_Character))); - end Get_Source_Location; + pragma Compile_Time_Warning (Standard.True, "Get_Text_At unimplemented"); + return raise Program_Error with "Unimplemented function Get_Text_At"; + end Get_Text_At; ------------------ -- Get_Token_At -- ------------------ function Get_Token_At - (Self : Document'Class; - Context : LSP.Ada_Contexts.Context; - Position : LSP.Messages.Position) + (Self : Document'Class; Context : LSP.Ada_Contexts.Context; + Position : LSP.Structures.Position) return Libadalang.Common.Token_Reference is - Unit : constant Libadalang.Analysis.Analysis_Unit := - Self.Unit (Context); - - Token : constant Libadalang.Common.Token_Reference := - Unit.Lookup_Token (Self.Get_Source_Location (Position)); begin - return Token; + pragma Compile_Time_Warning + (Standard.True, "Get_Token_At unimplemented"); + return raise Program_Error with "Unimplemented function Get_Token_At"; end Get_Token_At; ---------------- @@ -2178,16 +334,14 @@ package body LSP.Ada_Documents is ---------------- function Get_Tokens - (Self : Document'Class; - Context : LSP.Ada_Contexts.Context; + (Self : Document'Class; Context : LSP.Ada_Contexts.Context; Highlighter : LSP.Ada_Highlighters.Ada_Highlighter; - Span : LSP.Messages.Span := ((1, 1), (0, 0))) - return LSP.Messages.uinteger_Vector + Span : LSP.Structures.A_Range := ((1, 1), (0, 0))) + return LSP.Structures.Natural_Vector is - Unit : constant Libadalang.Analysis.Analysis_Unit := - Self.Unit (Context); begin - return Highlighter.Get_Tokens (Unit, Context.Trace, Span); + pragma Compile_Time_Warning (Standard.True, "Get_Tokens unimplemented"); + return raise Program_Error with "Unimplemented function Get_Tokens"; end Get_Tokens; ----------------- @@ -2195,86 +349,70 @@ package body LSP.Ada_Documents is ----------------- function Get_Word_At - (Self : Document; - Context : LSP.Ada_Contexts.Context; - Position : LSP.Messages.Position) - return VSS.Strings.Virtual_String + (Self : Document; Context : LSP.Ada_Contexts.Context; + Position : LSP.Structures.Position) return VSS.Strings.Virtual_String is - use Langkit_Support.Slocs; - use all type Libadalang.Common.Token_Kind; - - Result : VSS.Strings.Virtual_String; - - Unit : constant Libadalang.Analysis.Analysis_Unit := - Self.Unit (Context); - - Origin : constant Source_Location := Self.Get_Source_Location (Position); - Where : constant Source_Location := (Origin.Line, Origin.Column - 1); - -- Compute the position we want for completion, which is one character - -- before the cursor. - - Token : constant Libadalang.Common.Token_Reference := - Unit.Lookup_Token (Where); - - Data : constant Libadalang.Common.Token_Data_Type := - Libadalang.Common.Data (Token); - - Kind : constant Libadalang.Common.Token_Kind := - Libadalang.Common.Kind (Data); - - Text : constant Langkit_Support.Text.Text_Type := - Libadalang.Common.Text (Token); - - Sloc : constant Source_Location_Range := - Libadalang.Common.Sloc_Range (Data); + begin + pragma Compile_Time_Warning (Standard.True, "Get_Word_At unimplemented"); + return raise Program_Error with "Unimplemented function Get_Word_At"; + end Get_Word_At; - Span : constant Integer := - Natural (Where.Column) - Natural (Sloc.Start_Column); + --------------------- + -- Has_Diagnostics -- + --------------------- + function Has_Diagnostics + (Self : Document; Context : LSP.Ada_Contexts.Context) return Boolean + is begin - if Kind in Ada_Identifier .. Ada_Xor - and then Compare (Sloc, Where) = Inside - then - Result := - LSP.Lal_Utils.To_Virtual_String - (Text (Text'First .. Text'First + Span)); - end if; - - return Result; - end Get_Word_At; + pragma Compile_Time_Warning + (Standard.True, "Has_Diagnostics unimplemented"); + return raise Program_Error with "Unimplemented function Has_Diagnostics"; + end Has_Diagnostics; ---------------- -- Initialize -- ---------------- procedure Initialize - (Self : in out Document; - URI : LSP.Messages.DocumentUri; - Text : VSS.Strings.Virtual_String; - Diagnostic : LSP.Diagnostic_Sources.Diagnostic_Source_Access) + (Self : in out Document; URI : LSP.Structures.DocumentUri; + Text : VSS.Strings.Virtual_String; + Diagnostic : LSP.Diagnostic_Sources.Diagnostic_Source_Access) is begin - Self.URI := URI; - Self.Version := 1; - Self.Text := Text; - Self.Refresh_Symbol_Cache := True; - Self.Diagnostic_Sources (1) := new - LSP.Ada_Documents.LAL_Diagnostics.Diagnostic_Source - (Self'Unchecked_Access); - Self.Diagnostic_Sources (2) := Diagnostic; - Recompute_Indexes (Self); + pragma Compile_Time_Warning (Standard.True, "Initialize unimplemented"); + raise Program_Error with "Unimplemented procedure Initialize"; end Initialize; - ------------- - -- Cleanup -- - ------------- + --------------------- + -- Line_Terminator -- + --------------------- - procedure Cleanup (Self : in out Document) is + function Line_Terminator + (Self : Document'Class) return VSS.Strings.Virtual_String + is begin - for Source of Self.Diagnostic_Sources loop - LSP.Diagnostic_Sources.Unchecked_Free (Source); - end loop; - end Cleanup; + pragma Compile_Time_Warning + (Standard.True, "Line_Terminator unimplemented"); + return raise Program_Error with "Unimplemented function Line_Terminator"; + end Line_Terminator; + + ---------------------- + -- Range_Formatting -- + ---------------------- + + function Range_Formatting + (Self : Document; Context : LSP.Ada_Contexts.Context; + Span : LSP.Structures.A_Range; PP_Options : Pp.Command_Lines.Cmd_Line; + Edit : out LSP.Structures.TextEdit_Vector; + Messages : out VSS.String_Vectors.Virtual_String_Vector) return Boolean + is + begin + pragma Compile_Time_Warning + (Standard.True, "Range_Formatting unimplemented"); + return + raise Program_Error with "Unimplemented function Range_Formatting"; + end Range_Formatting; ------------------------ -- Reset_Symbol_Cache -- @@ -2282,754 +420,66 @@ package body LSP.Ada_Documents is procedure Reset_Symbol_Cache (Self : in out Document'Class) is begin - for Item of Self.Symbol_Cache loop - -- We clear defining name vectors, but keep symbol map in hope, that - -- we will reuse the same elements after reindexing in - -- Refresh_Symbol_Cache call, so we avoid memory reallocation. - Item.Clear; - end loop; - - Self.Refresh_Symbol_Cache := True; + pragma Compile_Time_Warning + (Standard.True, "Reset_Symbol_Cache unimplemented"); + raise Program_Error with "Unimplemented procedure Reset_Symbol_Cache"; end Reset_Symbol_Cache; - ----------------------------- - -- Compute_Completion_Item -- - ----------------------------- - - function Compute_Completion_Item - (Document : LSP.Ada_Documents.Document; - Context : LSP.Ada_Contexts.Context; - Sloc : Langkit_Support.Slocs.Source_Location; - Node : Libadalang.Analysis.Ada_Node; - BD : Libadalang.Analysis.Basic_Decl; - Label : VSS.Strings.Virtual_String; - Use_Snippets : Boolean; - Compute_Doc_And_Details : Boolean; - Named_Notation_Threshold : Natural; - Is_Dot_Call : Boolean; - Is_Visible : Boolean; - Pos : Integer; - Weight : Completion_Item_Weight_Type; - Completions_Count : Natural) - return LSP.Messages.CompletionItem - is - use LSP.Messages; - - Item : CompletionItem; - Subp_Spec_Node : Base_Subp_Spec; - Min_Width : constant Natural := Completions_Count'Img'Length - 1; - -- The -1 remove the whitespace added by 'Img - - function Get_Sort_Text - (Base_Label : VSS.Strings.Virtual_String) - return VSS.Strings.Virtual_String; - -- Return a suitable sortText according to the completion item's - -- visibility and position in the completion list. - - ------------------- - -- Get_Sort_Text -- - ------------------- - - function Get_Sort_Text - (Base_Label : VSS.Strings.Virtual_String) - return VSS.Strings.Virtual_String - is - use VSS.Strings; - begin - return Sort_Text : VSS.Strings.Virtual_String do - - Sort_Text := - VSS.Strings.Conversions.To_Virtual_String - (GNATCOLL.Utils.Image - (Value => Completion_Item_Weight_Type'Last - Weight, - Min_Width => - Completion_Item_Weight_Type'Last'Img'Length - 1)) & "&"; - - Sort_Text := Sort_Text & - VSS.Strings.Conversions.To_Virtual_String - (GNATCOLL.Utils.Image (Pos, Min_Width => Min_Width)); - - Sort_Text.Append (Base_Label); - - if not Is_Visible then - Sort_Text.Prepend ('~'); - end if; - end return; - end Get_Sort_Text; - - begin - Item.label := Label; - Item.kind := (True, To_Completion_Kind - (LSP.Lal_Utils.Get_Decl_Kind (BD))); - - declare - Base_Label : constant VSS.Strings.Virtual_String := Item.label; - Sort_Text : constant VSS.Strings.Virtual_String := - Get_Sort_Text (Base_Label); - - begin - if not Is_Visible then - Item.insertText := (True, Base_Label); - Item.label.Append (" (invisible)"); - Item.filterText := (True, Base_Label); - end if; - - -- Set the sortText if needed - if not Sort_Text.Is_Empty then - Item.sortText := (True, Sort_Text); - end if; - end; - - Set_Completion_Item_Documentation - (Context => Context, - BD => BD, - Item => Item, - Compute_Doc_And_Details => Compute_Doc_And_Details); - - -- Return immediately if we should not use snippets (e.g: completion for - -- invisible symbols). - if not Use_Snippets then - return Item; - end if; - - -- Check if we are dealing with a subprogram and return a completion - -- snippet that lists all the formal parameters if it's the case. - - Subp_Spec_Node := BD.P_Subp_Spec_Or_Null; - - if Subp_Spec_Node.Is_Null then - return Item; - end if; - - declare - Insert_Text : VSS.Strings.Virtual_String := Label; - All_Params : constant Param_Spec_Array := Subp_Spec_Node.P_Params; - - Params : constant Param_Spec_Array := - (if Is_Dot_Call then - All_Params (All_Params'First + 1 .. All_Params'Last) - else - All_Params); - -- Remove the first formal parameter from the list when the dotted - -- notation is used. - - Idx : Positive := 1; - Nb_Params : Natural := 0; - Use_Named_Notation : Boolean := False; - begin - - -- Create a completion snippet if the subprogram expects some - -- parameters. - - if Params'Length /= 0 then - Item.insertTextFormat := Optional_InsertTextFormat' - (Is_Set => True, - Value => Snippet); - - Insert_Text.Append (" ("); - - -- Compute number of params to know if named notation should be - -- used. - - for Param of Params loop - Nb_Params := Nb_Params + Param.F_Ids.Children_Count; - end loop; - - Use_Named_Notation := Named_Notation_Threshold > 0 - and then Nb_Params >= Named_Notation_Threshold; - - for Param of Params loop - for Id of Param.F_Ids loop - declare - Mode : constant Langkit_Support.Text.Text_Type := - Param.F_Mode.Text; - - begin - if Use_Named_Notation then - Insert_Text.Append - (LSP.Lal_Utils.To_Virtual_String (Id.Text)); - Insert_Text.Append (" => "); - Insert_Text.Append ("${"); - Insert_Text.Append - (VSS.Strings.Conversions.To_Virtual_String - (GNATCOLL.Utils.Image (Idx, Min_Width => 1))); - Insert_Text.Append (':'); - Insert_Text.Append - ((if Mode /= "" - then LSP.Lal_Utils.To_Virtual_String (Mode & " ") - else "")); - Insert_Text.Append - (LSP.Lal_Utils.To_Virtual_String - (Param.F_Type_Expr.Text)); - Insert_Text.Append ("}, "); - - else - Insert_Text.Append ("${"); - Insert_Text.Append - (VSS.Strings.Conversions.To_Virtual_String - (GNATCOLL.Utils.Image (Idx, Min_Width => 1))); - Insert_Text.Append (':'); - Insert_Text.Append - (LSP.Lal_Utils.To_Virtual_String (Id.Text)); - Insert_Text.Append (" : "); - Insert_Text.Append - ((if Mode /= "" - then LSP.Lal_Utils.To_Virtual_String (Mode & " ") - else "")); - Insert_Text.Append - (LSP.Lal_Utils.To_Virtual_String - (Param.F_Type_Expr.Text)); - Insert_Text.Append ("}, "); - end if; - - Idx := Idx + 1; - end; - end loop; - end loop; - - -- Remove the ", " substring that has been appended in the last - -- loop iteration. - - declare - First : constant - VSS.Strings.Character_Iterators.Character_Iterator := - Insert_Text.At_First_Character; - Last : VSS.Strings.Character_Iterators.Character_Iterator := - Insert_Text.At_Last_Character; - Success : Boolean with Unreferenced; - - begin - Success := Last.Backward; - Success := Last.Backward; - - Insert_Text := Insert_Text.Slice (First, Last); - -- ??? May be replaced by "Head" like procedure when it will be - -- implemented. - end; - - -- Insert '$0' (i.e: the final tab stop) at the end. - Insert_Text.Append (")$0"); - - Item.insertText := (True, Insert_Text); - end if; - end; - - return Item; - end Compute_Completion_Item; - --------------------------------------- -- Set_Completion_Item_Documentation -- --------------------------------------- procedure Set_Completion_Item_Documentation - (Context : LSP.Ada_Contexts.Context; - BD : Libadalang.Analysis.Basic_Decl; - Item : in out LSP.Messages.CompletionItem; - Compute_Doc_And_Details : Boolean) is - begin - -- Compute the 'documentation' and 'detail' fields immediately if - -- requested (i.e: when the client does not support lazy computation - -- for these fields or if we are dealing with predefined types). - if Compute_Doc_And_Details or else LSP.Lal_Utils.Is_Synthetic (BD) then - declare - Qual_Text : VSS.Strings.Virtual_String; - Decl_Text : VSS.Strings.Virtual_String; - Loc_Text : VSS.Strings.Virtual_String; - Doc_Text : VSS.Strings.Virtual_String; - Aspects_Text : VSS.Strings.Virtual_String; - - begin - LSP.Ada_Documentation.Get_Tooltip_Text - (BD => BD, - Style => Context.Get_Documentation_Style, - Declaration_Text => Decl_Text, - Qualifier_Text => Qual_Text, - Location_Text => Loc_Text, - Documentation_Text => Doc_Text, - Aspects_Text => Aspects_Text); - - Item.detail := (True, Decl_Text); - - if not Doc_Text.Is_Empty then - Loc_Text.Append - (VSS.Strings.To_Virtual_String - ((1 .. 2 => Ada.Characters.Wide_Wide_Latin_1.LF))); - - Loc_Text.Append (Doc_Text); - end if; - - Item.documentation := - (Is_Set => True, - Value => LSP.Messages.String_Or_MarkupContent' - (Is_String => True, - String => Loc_Text)); - end; - - else - -- Set node's location to the 'data' field of the completion item, so - -- that we can retrieve it in the completionItem/resolve handler. - Item.data := - (True, - (uri => LSP.Types.File_To_URI (BD.Unit.Get_Filename), - span => LSP.Lal_Utils.To_Span (BD.Sloc_Range), - others => <>)); - end if; - end Set_Completion_Item_Documentation; - - -------------------- - -- Get_Any_Symbol -- - -------------------- - - procedure Get_Any_Symbol - (Self : in out Document; - Context : LSP.Ada_Contexts.Context; - Pattern : LSP.Search.Search_Pattern'Class; - Limit : Ada.Containers.Count_Type; - Only_Public : Boolean; - Canceled : access function return Boolean; - Result : in out LSP.Ada_Completions.Completion_Maps.Map) - is - use type LSP.Messages.Search_Kind; - - procedure Refresh_Symbol_Cache; - -- Find intresting definings names in the document and put them - -- into Self.Symbol_Cache - - procedure Insert - (Item : Name_Information; - Name : Libadalang.Analysis.Defining_Name); - -- Populate Result with the name information if Result doesn't have - -- the Name already - - function Get_Defining_Name - (Loc : Langkit_Support.Slocs.Source_Location) - return Libadalang.Analysis.Defining_Name; - - ----------------------- - -- Get_Defining_Name -- - ----------------------- - - function Get_Defining_Name - (Loc : Langkit_Support.Slocs.Source_Location) - return Libadalang.Analysis.Defining_Name - is - Unit : constant Libadalang.Analysis.Analysis_Unit := - Self.Unit (Context); - - Name : constant Libadalang.Analysis.Name := - Laltools.Common.Get_Node_As_Name (Unit.Root.Lookup (Loc)); - begin - return Laltools.Common.Get_Name_As_Defining (Name); - end Get_Defining_Name; - - ------------ - -- Insert -- - ------------ - - procedure Insert - (Item : Name_Information; - Name : Libadalang.Analysis.Defining_Name) is - begin - if not Result.Contains (Name) and then - (not Only_Public or else Item.Is_Public) - then - Result.Insert - (Name, - (Is_Dot_Call => False, - Is_Visible => False, - Use_Snippets => False, - Pos => <>, - Weight => <>)); - end if; - end Insert; - - -------------------------- - -- Refresh_Symbol_Cache -- - -------------------------- - - procedure Refresh_Symbol_Cache is - use Langkit_Support.Symbols; - use Libadalang.Common; - use Libadalang.Iterators; - - Node : Libadalang.Analysis.Ada_Node; - - Global_Visible : constant Libadalang.Iterators.Ada_Node_Predicate := - LSP.Lal_Utils.Is_Global_Visible; - - Restricted_Kind : constant Libadalang.Iterators.Ada_Node_Predicate := - LSP.Lal_Utils.Is_Restricted_Kind; - - -- Find all definings names excluding private parts and bodies - It : Libadalang.Iterators.Traverse_Iterator'Class := - Libadalang.Iterators.Find - (Self.Unit (Context).Root, - Libadalang.Iterators.Kind_Is (Ada_Defining_Name) - and not Restricted_Kind); - - begin - while It.Next (Node) loop - declare - Token : constant Token_Reference := Node.Token_End; - Text : constant Langkit_Support.Text.Text_Type := - Libadalang.Common.Text (Token); - Canonical : constant Symbolization_Result := - Libadalang.Sources.Canonicalize (Text); - Cursor : Symbol_Maps.Cursor; - Inserted : Boolean; - - begin - if Canonical.Success then - Self.Symbol_Cache.Insert - (LSP.Lal_Utils.To_Virtual_String (Canonical.Symbol), - Name_Vectors.Empty_Vector, - Cursor, - Inserted); - - Self.Symbol_Cache (Cursor).Append - (Name_Information' - (Langkit_Support.Slocs.Start_Sloc (Node.Sloc_Range), - Global_Visible.Unchecked_Get.Evaluate (Node))); - end if; - end; - end loop; - end Refresh_Symbol_Cache; - - Cursor : Symbol_Maps.Cursor; - - -- In "Celling" mode we scan only range of cache where a key prefix - -- matches lowercased pattern as is. - Use_Celling : constant Boolean := - not Pattern.Get_Negate - and then ((Pattern.Get_Kind = LSP.Messages.Full_Text - and then Pattern.Get_Whole_Word) - or else Pattern.Get_Kind = LSP.Messages.Start_Word_Text); - - begin - if Self.Refresh_Symbol_Cache then - Refresh_Symbol_Cache; - Self.Refresh_Symbol_Cache := False; - end if; - - if Use_Celling then - Cursor := Self.Symbol_Cache.Ceiling (Pattern.Get_Canonical_Pattern); - else - Cursor := Self.Symbol_Cache.First; - end if; - - while Symbol_Maps.Has_Element (Cursor) loop - - if Use_Celling - and then not Pattern.Match (Symbol_Maps.Key (Cursor)) - then - -- We use "Celling mode" and key stops matching, - -- Symbol_Cache is ordered so we will not find any - -- matches more - - exit when Use_Celling or else Canceled.all; - - else - - for Item of Self.Symbol_Cache (Cursor) loop - declare - Defining_Name : constant Libadalang.Analysis.Defining_Name := - Get_Defining_Name (Item.Loc); - begin - -- Match each element individually in case of sensitive - -- search or non-celling mode - if not Defining_Name.Is_Null - and then - ((Use_Celling - and then not Pattern.Get_Case_Sensitive) - or else Pattern.Match - (LSP.Lal_Utils.To_Virtual_String - (Defining_Name.As_Ada_Node.Text))) - then - Insert (Item, Defining_Name); - end if; - - exit when Canceled.all; - - end; - end loop; - - end if; - - Symbol_Maps.Next (Cursor); - end loop; - end Get_Any_Symbol; - - ------------------------- - -- Get_Completion_Node -- - ------------------------- - - procedure Get_Completion_Node - (Self : Document; - Context : LSP.Ada_Contexts.Context; - Position : LSP.Messages.Position; - Sloc : out Langkit_Support.Slocs.Source_Location; - Token : out Libadalang.Common.Token_Reference; - Node : out Libadalang.Analysis.Ada_Node) + (Context : LSP.Ada_Contexts.Context; BD : Libadalang.Analysis.Basic_Decl; + Item : in out LSP.Structures.CompletionItem; + Compute_Doc_And_Details : Boolean) is - use Libadalang.Common; - - function Completion_Token - (Sloc : Langkit_Support.Slocs.Source_Location) - return Libadalang.Common.Token_Reference; - -- Get token under completion for given cursor position. - -- If cursor at the first symbol of a token return previous token: - -- XXX___ - -- ^ cursor just after a token mean user is completion XXX token. - - ---------------------- - -- Completion_Token -- - ---------------------- - - function Completion_Token - (Sloc : Langkit_Support.Slocs.Source_Location) - return Libadalang.Common.Token_Reference - is - use type Langkit_Support.Slocs.Source_Location; - - Token : constant Libadalang.Common.Token_Reference := - Self.Get_Token_At (Context, Position); - - Prev : constant Libadalang.Common.Token_Reference := - (if Token = Libadalang.Common.No_Token - then Token - else Libadalang.Common.Previous (Token)); - - begin - if Libadalang.Common.No_Token not in Token | Prev then - declare - Data : constant Libadalang.Common.Token_Data_Type := - Libadalang.Common.Data (Token); - - Start : constant Langkit_Support.Slocs.Source_Location := - Langkit_Support.Slocs.Start_Sloc - (Libadalang.Common.Sloc_Range (Data)); - begin - if Start = Sloc then - return Prev; - end if; - end; - end if; - - return Token; - end Completion_Token; begin - Sloc := Self.Get_Source_Location (Position); - Token := Completion_Token (Sloc); - declare - From : constant Langkit_Support.Slocs.Source_Location := - Langkit_Support.Slocs.Start_Sloc - (Libadalang.Common.Sloc_Range - (Libadalang.Common.Data (Token))); - - Root : constant Libadalang.Analysis.Ada_Node := - Self.Unit (Context).Root; - begin - Node := (if Root = No_Ada_Node then Root else Root.Lookup (From)); - end; - end Get_Completion_Node; - - ------------------------ - -- Get_Completions_At -- - ------------------------ - - procedure Get_Completions_At - (Self : Document; - Providers : LSP.Ada_Completions.Completion_Provider_List; - Context : LSP.Ada_Contexts.Context; - Sloc : Langkit_Support.Slocs.Source_Location; - Token : Libadalang.Common.Token_Reference; - Node : Libadalang.Analysis.Ada_Node; - Names : out Ada_Completions.Completion_Maps.Map; - Result : out LSP.Messages.CompletionList) - is - Parent : constant Libadalang.Analysis.Ada_Node := - (if Node = No_Ada_Node then Node else Node.Parent); - - Filter : LSP.Ada_Completions.Filters.Filter; - begin - if not Parent.Is_Null - and then (Parent.Kind not in - Libadalang.Common.Ada_Dotted_Name | Libadalang.Common.Ada_End_Name - and then Node.Kind in Libadalang.Common.Ada_String_Literal_Range) - then - -- Do nothing when inside a string - return; - end if; - - Context.Trace.Trace - ("Getting completions, Pos = (" - & Sloc.Line'Image & ", " & Sloc.Column'Image & ") Node = " - & Image (Node)); - - Filter.Initialize (Token, Node); - - for Provider of Providers loop - begin - Provider.Propose_Completion - (Sloc => Sloc, - Token => Token, - Node => Node, - Filter => Filter, - Names => Names, - Result => Result); - - exception - when E : Libadalang.Common.Property_Error => - LSP.Common.Log - (Context.Trace, - E, - "LAL EXCEPTION occurred with following completion provider: " - & Ada.Tags.Expanded_Name (Provider'Tag)); - end; - end loop; - - Context.Trace.Trace - ("Number of filtered completions : " & Names.Length'Image); - end Get_Completions_At; + pragma Compile_Time_Warning + (Standard.True, "Set_Completion_Item_Documentation unimplemented"); + raise Program_Error + with "Unimplemented procedure Set_Completion_Item_Documentation"; + end Set_Completion_Item_Documentation; --------------------- - -- Span_To_Markers -- + -- To_LSP_Location -- --------------------- - procedure Span_To_Markers - (Self : Document'Class; - Span : LSP.Messages.Span; - From : out VSS.Strings.Markers.Character_Marker; - To : out VSS.Strings.Markers.Character_Marker) + function To_LSP_Location + (Self : Document; Segment : Langkit_Support.Slocs.Source_Location_Range) + return LSP.Structures.Location is - use type VSS.Unicode.UTF16_Code_Unit_Offset; - - J1 : VSS.Strings.Character_Iterators.Character_Iterator := - Self.Text.At_Character (Self.Line_To_Marker (Span.first.line)); - U1 : constant VSS.Unicode.UTF16_Code_Unit_Offset := - J1.First_UTF16_Offset; - - J2 : VSS.Strings.Character_Iterators.Character_Iterator := - Self.Text.At_Character (Self.Line_To_Marker (Span.last.line)); - U2 : constant VSS.Unicode.UTF16_Code_Unit_Offset := - J2.First_UTF16_Offset; - - Dummy : Boolean; - begin - while Span.first.character /= J1.First_UTF16_Offset - U1 - and then J1.Forward - loop - null; - end loop; - - From := J1.Marker; - - while Span.last.character /= J2.First_UTF16_Offset - U2 - and then J2.Forward - loop - null; - end loop; - - Dummy := J2.Backward; - To := J2.Marker; - end Span_To_Markers; + pragma Compile_Time_Warning + (Standard.True, "To_LSP_Location unimplemented"); + return raise Program_Error with "Unimplemented function To_LSP_Location"; + end To_LSP_Location; ------------------ -- To_LSP_Range -- ------------------ function To_LSP_Range - (Self : Document; - Segment : Langkit_Support.Slocs.Source_Location_Range) - return LSP.Messages.Span + (Self : Document; Segment : Langkit_Support.Slocs.Source_Location_Range) + return LSP.Structures.A_Range is - - use type LSP.Types.Line_Number; - - Start_Line : constant LSP.Types.Line_Number := - LSP.Types.Line_Number (Segment.Start_Line) - 1; - Start_Line_Text : constant VSS.Strings.Virtual_String := - (if Self.Line_To_Marker.Last_Index = Start_Line then - Self.Text.Slice - (Self.Line_To_Marker (Start_Line), Self.Text.After_Last_Character) - else - Self.Text.Slice - (Self.Line_To_Marker (Start_Line), - Self.Line_To_Marker (Start_Line + 1))); - Start_Iterator : VSS.Strings.Character_Iterators.Character_Iterator := - Start_Line_Text.At_First_Character; - - End_Line : constant LSP.Types.Line_Number := - LSP.Types.Line_Number (Segment.End_Line) - 1; - End_Line_Text : constant VSS.Strings.Virtual_String := - (if Self.Line_To_Marker.Last_Index = End_Line then - Self.Text.Slice - (Self.Line_To_Marker (End_Line), Self.Text.After_Last_Character) - else - Self.Text.Slice - (Self.Line_To_Marker (End_Line), - Self.Line_To_Marker (End_Line + 1))); - End_Iterator : VSS.Strings.Character_Iterators.Character_Iterator := - End_Line_Text.At_First_Character; - Success : Boolean with Unreferenced; - begin - -- Iterating forward through the line of the start position, initial - -- iterator points to the first characters, thus "starts" from the - -- second one. - - for J in 2 .. Segment.Start_Column loop - Success := Start_Iterator.Forward; - end loop; - - -- Iterating forward through the line of the end position. For the same - -- reason "starts" from second character. - - for J in 2 .. Segment.End_Column loop - Success := End_Iterator.Forward; - end loop; - - return - (first => - (line => Start_Line, - character => Start_Iterator.First_UTF16_Offset), - last => - (line => End_Line, - character => End_Iterator.Last_UTF16_Offset)); + pragma Compile_Time_Warning + (Standard.True, "To_LSP_Range unimplemented"); + return raise Program_Error with "Unimplemented function To_LSP_Range"; end To_LSP_Range; - --------------------- - -- To_LSP_Location -- - --------------------- - - function To_LSP_Location - (Self : Document; - Segment : Langkit_Support.Slocs.Source_Location_Range; - Kind : LSP.Messages.AlsReferenceKind_Set := LSP.Messages.Empty_Set) - return LSP.Messages.Location is - begin - return LSP.Messages.Location' - (uri => Self.URI, - span => To_LSP_Range (Self, Segment), - alsKind => <>); - end To_LSP_Location; - ---------- -- Unit -- ---------- function Unit - (Self : Document'Class; - Context : LSP.Ada_Contexts.Context) + (Self : Document'Class; Context : LSP.Ada_Contexts.Context) return Libadalang.Analysis.Analysis_Unit is - File : constant String := Context.URI_To_File (Self.URI); begin - return Context.LAL_Context.Get_From_File - (Filename => File, - Charset => Context.Charset, - Reparse => False); + pragma Compile_Time_Warning (Standard.True, "Unit unimplemented"); + return raise Program_Error with "Unimplemented function Unit"; end Unit; -------------------------- @@ -3037,10 +487,13 @@ package body LSP.Ada_Documents is -------------------------- function Versioned_Identifier - (Self : Document) return LSP.Messages.VersionedTextDocumentIdentifier is + (Self : Document) return LSP.Structures.VersionedTextDocumentIdentifier + is begin - return (uri => Self.URI, - version => Self.Version); + pragma Compile_Time_Warning + (Standard.True, "Versioned_Identifier unimplemented"); + return + raise Program_Error with "Unimplemented function Versioned_Identifier"; end Versioned_Identifier; end LSP.Ada_Documents; diff --git a/source/ada/lsp-ada_documents.ads b/source/ada/lsp-ada_documents.ads index d7b4ae492..2dfe2db9e 100644 --- a/source/ada/lsp-ada_documents.ads +++ b/source/ada/lsp-ada_documents.ads @@ -1,7 +1,7 @@ ------------------------------------------------------------------------------ -- Language Server Protocol -- -- -- --- Copyright (C) 2018-2021, AdaCore -- +-- Copyright (C) 2018-2023, AdaCore -- -- -- -- This is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -33,12 +33,11 @@ with GNATCOLL.Traces; with Pp.Command_Lines; limited with LSP.Ada_Contexts; -with LSP.Ada_Completions; use LSP.Ada_Completions; -with LSP.Ada_Highlighters; +with LSP.Ada_Completions; with LSP.Diagnostic_Sources; -with LSP.Messages; +with LSP.Ada_Highlighters; with LSP.Search; -with LSP.Types; +with LSP.Structures; package LSP.Ada_Documents is @@ -53,7 +52,7 @@ package LSP.Ada_Documents is procedure Initialize (Self : in out Document; - URI : LSP.Messages.DocumentUri; + URI : LSP.Structures.DocumentUri; Text : VSS.Strings.Virtual_String; Diagnostic : LSP.Diagnostic_Sources.Diagnostic_Source_Access); -- Create a new document from a TextDocumentItem. Use Diagnostic as @@ -66,7 +65,7 @@ package LSP.Ada_Documents is -- Contents handling -- ----------------------- - function URI (Self : Document) return LSP.Messages.DocumentUri; + function URI (Self : Document) return LSP.Structures.DocumentUri; -- Return the URI associated with Self function Text (Self : Document) return VSS.Strings.Virtual_String; @@ -74,31 +73,30 @@ package LSP.Ada_Documents is function Get_Text_At (Self : Document; - Start_Pos : LSP.Messages.Position; - End_Pos : LSP.Messages.Position) return VSS.Strings.Virtual_String; + Start_Pos : LSP.Structures.Position; + End_Pos : LSP.Structures.Position) return VSS.Strings.Virtual_String; -- Return the text in the specified range. function To_LSP_Range (Self : Document; Segment : Langkit_Support.Slocs.Source_Location_Range) - return LSP.Messages.Span; + return LSP.Structures.A_Range; -- Convert LAL's Source_Location_Range to LSP's Range function To_LSP_Location (Self : Document; - Segment : Langkit_Support.Slocs.Source_Location_Range; - Kind : LSP.Messages.AlsReferenceKind_Set := LSP.Messages.Empty_Set) - return LSP.Messages.Location; + Segment : Langkit_Support.Slocs.Source_Location_Range) + return LSP.Structures.Location; -- Convert LAL's Source_Location_Range and document's uri to a LSP location procedure Apply_Changes (Self : aliased in out Document; - Version : LSP.Types.LSP_Number; - Vector : LSP.Messages.TextDocumentContentChangeEvent_Vector); + Version : Integer; + Vector : LSP.Structures.TextDocumentContentChangeEvent_Vector); -- Modify document according to event vector provided by LSP client. function Versioned_Identifier - (Self : Document) return LSP.Messages.VersionedTextDocumentIdentifier; + (Self : Document) return LSP.Structures.VersionedTextDocumentIdentifier; -------------- -- Requests -- @@ -110,7 +108,7 @@ package LSP.Ada_Documents is (Self : in out Document; Context : LSP.Ada_Contexts.Context; Changed : out Boolean; - Errors : out LSP.Messages.Diagnostic_Vector; + Errors : out LSP.Structures.Diagnostic_Vector; Force : Boolean := False); -- Get errors found during document parsing. -- When Force is True, any existing diagnostic will be retrieved, no matter @@ -127,7 +125,7 @@ package LSP.Ada_Documents is Context : LSP.Ada_Contexts.Context; Pattern : LSP.Search.Search_Pattern'Class; Canceled : access function return Boolean; - Result : out LSP.Messages.Symbol_Vector); + Result : out LSP.Structures.DocumentSymbol_Vector); -- Populate Result with symbols from the document. procedure Get_Symbol_Hierarchy @@ -135,34 +133,34 @@ package LSP.Ada_Documents is Context : LSP.Ada_Contexts.Context; Pattern : LSP.Search.Search_Pattern'Class; Canceled : access function return Boolean; - Result : out LSP.Messages.Symbol_Vector); + Result : out LSP.Structures.DocumentSymbol_Vector); -- Populate Result with a symbol hierarchy from the document. function Get_Indentation (Self : Document; Context : LSP.Ada_Contexts.Context; - Line : LSP.Types.Line_Number) + Line : Positive) return Natural; -- Estimates the indention a line should have function Get_Node_At (Self : Document; Context : LSP.Ada_Contexts.Context; - Position : LSP.Messages.Position) + Position : LSP.Structures.Position) return Libadalang.Analysis.Ada_Node; -- Get Libadalang Node for given position in the document. function Get_Word_At (Self : Document; Context : LSP.Ada_Contexts.Context; - Position : LSP.Messages.Position) + Position : LSP.Structures.Position) return VSS.Strings.Virtual_String; -- Get an identifier at given position in the document or an empty string. procedure Get_Completion_Node (Self : Document; Context : LSP.Ada_Contexts.Context; - Position : LSP.Messages.Position; + Position : LSP.Structures.Position; Sloc : out Langkit_Support.Slocs.Source_Location; Token : out Libadalang.Common.Token_Reference; Node : out Libadalang.Analysis.Ada_Node); @@ -176,7 +174,7 @@ package LSP.Ada_Documents is Token : Libadalang.Common.Token_Reference; Node : Libadalang.Analysis.Ada_Node; Names : out Ada_Completions.Completion_Maps.Map; - Result : out LSP.Messages.CompletionList); + Result : out LSP.Structures.CompletionList); -- Populate Result/Names with completions Node in the -- document. Names works for defining name completions to create snippets -- and to avoid duplicates. @@ -197,14 +195,14 @@ package LSP.Ada_Documents is Lines_Only : Boolean; Comments : Boolean; Canceled : access function return Boolean; - Result : out LSP.Messages.FoldingRange_Vector); + Result : out LSP.Structures.FoldingRange_Vector); -- Populate Result with code folding blocks in the document. If Lines_Only -- is True does not return characters positions in lines. function Get_Formatting_Region (Self : Document; Context : LSP.Ada_Contexts.Context; - Position : LSP.Messages.Position) + Position : LSP.Structures.Position) return Laltools.Partial_GNATPP.Formatting_Region_Type; -- Given Position, get the region that would be formatted if -- Range_Formatting was called. @@ -212,9 +210,9 @@ package LSP.Ada_Documents is function Formatting (Self : Document; Context : LSP.Ada_Contexts.Context; - Span : LSP.Messages.Span; + Span : LSP.Structures.A_Range; Cmd : Pp.Command_Lines.Cmd_Line; - Edit : out LSP.Messages.TextEdit_Vector; + Edit : out LSP.Structures.TextEdit_Vector; Messages : out VSS.String_Vectors.Virtual_String_Vector) return Boolean; -- Format document or its part defined in Span @@ -222,33 +220,13 @@ package LSP.Ada_Documents is function Range_Formatting (Self : Document; Context : LSP.Ada_Contexts.Context; - Span : LSP.Messages.Span; + Span : LSP.Structures.A_Range; PP_Options : Pp.Command_Lines.Cmd_Line; - Edit : out LSP.Messages.TextEdit_Vector; + Edit : out LSP.Structures.TextEdit_Vector; Messages : out VSS.String_Vectors.Virtual_String_Vector) return Boolean; -- Format document or its part defined in Span - procedure Get_Imported_Units - (Self : Document; - Context : LSP.Ada_Contexts.Context; - Project_URI : LSP.Types.LSP_URI; - Show_Implicit : Boolean; - Result : out LSP.Messages.ALS_Unit_Description_Vector); - -- Return all the units that import the document's unit. - -- If Show_Implicit is True, units that import implicitly on the document's - -- unit are also returned. - - procedure Get_Importing_Units - (Self : Document; - Context : LSP.Ada_Contexts.Context; - Project_URI : LSP.Types.LSP_URI; - Show_Implicit : Boolean; - Result : out LSP.Messages.ALS_Unit_Description_Vector); - -- Return the units that import the document's unit among the given list. - -- If Show_Implicit is True, units that depend on the document's unit in - -- an implicit way will also be returned. - procedure Find_All_References (Self : Document; Context : LSP.Ada_Contexts.Context; @@ -274,7 +252,7 @@ package LSP.Ada_Documents is function Get_Open_Document (Self : access Document_Provider; - URI : LSP.Messages.DocumentUri; + URI : LSP.Structures.DocumentUri; Force : Boolean := False) return Document_Access is abstract; -- Return the open document for the given URI. @@ -284,8 +262,8 @@ package LSP.Ada_Documents is function Get_Open_Document_Version (Self : access Document_Provider; - URI : LSP.Messages.DocumentUri) - return LSP.Messages.OptionalVersionedTextDocumentIdentifier is abstract; + URI : LSP.Structures.DocumentUri) + return LSP.Structures.OptionalVersionedTextDocumentIdentifier is abstract; -- Return the version of an open document for the given URI. -- If the document is not opened, then it returns a -- VersionedTextDocumentIdentifier with a null version. @@ -303,9 +281,9 @@ package LSP.Ada_Documents is Is_Dot_Call : Boolean; Is_Visible : Boolean; Pos : Integer; - Weight : Completion_Item_Weight_Type; + Weight : Ada_Completions.Completion_Item_Weight_Type; Completions_Count : Natural) - return LSP.Messages.CompletionItem; + return LSP.Structures.CompletionItem; -- Compute a completion item. -- Node is the node from which the completion starts (e.g: 'A' in 'A.'). -- BD is the basic declaration and Label is the defining name text @@ -323,14 +301,14 @@ package LSP.Ada_Documents is procedure Set_Completion_Item_Documentation (Context : LSP.Ada_Contexts.Context; BD : Libadalang.Analysis.Basic_Decl; - Item : in out LSP.Messages.CompletionItem; + Item : in out LSP.Structures.CompletionItem; Compute_Doc_And_Details : Boolean); -- Either set the item documentation and details or setup it to produce -- them for the Completion_Resolve request. function Get_Source_Location (Self : Document'Class; - Position : LSP.Messages.Position) + Position : LSP.Structures.Position) return Langkit_Support.Slocs.Source_Location; -- Convert a Positon to a Source_Location @@ -341,7 +319,7 @@ package LSP.Ada_Documents is function Get_Token_At (Self : Document'Class; Context : LSP.Ada_Contexts.Context; - Position : LSP.Messages.Position) + Position : LSP.Structures.Position) return Libadalang.Common.Token_Reference; -- Return a token at the given Position. @@ -349,14 +327,14 @@ package LSP.Ada_Documents is (Self : Document'Class; Context : LSP.Ada_Contexts.Context; Highlighter : LSP.Ada_Highlighters.Ada_Highlighter; - Span : LSP.Messages.Span := ((1, 1), (0, 0))) - return LSP.Messages.uinteger_Vector; + Span : LSP.Structures.A_Range := ((1, 1), (0, 0))) + return LSP.Structures.Natural_Vector; -- Return semantic tokens in the document. See details in LSP specification private package Line_Marker_Vectors is new Ada.Containers.Vectors - (Index_Type => LSP.Types.Line_Number, + (Index_Type => Natural, Element_Type => VSS.Strings.Markers.Character_Marker, "=" => VSS.Strings.Markers."="); @@ -379,9 +357,9 @@ private type Document (Trace : GNATCOLL.Traces.Trace_Handle) is tagged limited record - URI : LSP.Messages.DocumentUri; + URI : LSP.Structures.DocumentUri; - Version : LSP.Types.LSP_Number := 1; + Version : Integer := 1; -- Document version Text : VSS.Strings.Virtual_String; @@ -404,12 +382,14 @@ private -- Known sources of diagnostics end record; + Empty_Range : LSP.Structures.A_Range := ((1, 1), (0, 0)); + procedure Diff (Self : Document; New_Text : VSS.Strings.Virtual_String; - Old_Span : LSP.Messages.Span := LSP.Messages.Empty_Span; - New_Span : LSP.Messages.Span := LSP.Messages.Empty_Span; - Edit : out LSP.Messages.TextEdit_Vector); + Old_Span : LSP.Structures.A_Range := Empty_Range; + New_Span : LSP.Structures.A_Range := Empty_Range; + Edit : out LSP.Structures.TextEdit_Vector); -- Create a diff between document Text and New_Text and return Text_Edit -- based on Needleman-Wunsch algorithm. -- Old_Span and New_Span are used when we need to compare certain @@ -417,15 +397,15 @@ private procedure Diff_Symbols (Self : Document; - Span : LSP.Messages.Span; + Span : LSP.Structures.A_Range; New_Text : VSS.Strings.Virtual_String; - Edit : in out LSP.Messages.TextEdit_Vector); + Edit : in out LSP.Structures.TextEdit_Vector); -- Create a diff between document Text inside Span and New_Chunk and -- return Text_Edit. Tests individual symbols instead of lines -- as above. Do not use it for large text slices because it -- creates an N^M map for symbols. - function URI (Self : Document) return LSP.Messages.DocumentUri is + function URI (Self : Document) return LSP.Structures.DocumentUri is (Self.URI); function Text (Self : Document) return VSS.Strings.Virtual_String is (Self.Text); diff --git a/source/ada/lsp-ada_handlers-file_readers.adb b/source/ada/lsp-ada_handlers-file_readers.adb index db236d20a..5d21073fd 100644 --- a/source/ada/lsp-ada_handlers-file_readers.adb +++ b/source/ada/lsp-ada_handlers-file_readers.adb @@ -1,7 +1,7 @@ ------------------------------------------------------------------------------ -- Language Server Protocol -- -- -- --- Copyright (C) 2021, AdaCore -- +-- Copyright (C) 2021-2023, AdaCore -- -- -- -- This is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -36,6 +36,8 @@ with Langkit_Support.File_Readers; use Langkit_Support.File_Readers; with Langkit_Support.Slocs; with Langkit_Support.Text; +with URIs; + package body LSP.Ada_Handlers.File_Readers is use all type VSS.Strings.Converters.Converter_Flag; @@ -121,7 +123,7 @@ package body LSP.Ada_Handlers.File_Readers is ---------- overriding procedure Read - (Self : LSP_Reader_Interface; + (Self : LSP_File_Reader; Filename : String; Charset : String; Read_BOM : Boolean; @@ -129,6 +131,8 @@ package body LSP.Ada_Handlers.File_Readers is Diagnostics : in out Langkit_Support.Diagnostics.Diagnostics_Vectors.Vector) is + URI : constant URIs.URI_String := URIs.Conversions.From_File (Filename); + Doc : Document_Access; Text : VSS.Strings.Virtual_String; Error : VSS.Strings.Virtual_String; @@ -137,7 +141,8 @@ package body LSP.Ada_Handlers.File_Readers is -- First check if the file is an open document Doc := Self.Handler.Get_Open_Document - (URI => LSP.Types.File_To_URI (Filename), + (URI => (VSS.Strings.Conversions.To_Virtual_String (URI) + with null record), Force => False); -- Preprocess the document's contents if open, or the file contents if diff --git a/source/ada/lsp-ada_handlers-file_readers.ads b/source/ada/lsp-ada_handlers-file_readers.ads index 4cb71fdc2..65cc27c49 100644 --- a/source/ada/lsp-ada_handlers-file_readers.ads +++ b/source/ada/lsp-ada_handlers-file_readers.ads @@ -1,7 +1,7 @@ ------------------------------------------------------------------------------ -- Language Server Protocol -- -- -- --- Copyright (C) 2021, AdaCore -- +-- Copyright (C) 2021-2023, AdaCore -- -- -- -- This is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -25,7 +25,7 @@ with Libadalang.Preprocessing; package LSP.Ada_Handlers.File_Readers is - type LSP_Reader_Interface (Handler : access Message_Handler) is new + type LSP_File_Reader (Handler : access Message_Handler'Class) is new Langkit_Support.File_Readers.File_Reader_Interface with record Preprocessing_Data : Libadalang.Preprocessing.Preprocessor_Data := @@ -33,7 +33,7 @@ package LSP.Ada_Handlers.File_Readers is end record; overriding procedure Read - (Self : LSP_Reader_Interface; + (Self : LSP_File_Reader; Filename : String; Charset : String; Read_BOM : Boolean; @@ -42,6 +42,6 @@ package LSP.Ada_Handlers.File_Readers is Langkit_Support.Diagnostics.Diagnostics_Vectors.Vector); overriding procedure Release - (Self : in out LSP_Reader_Interface) is null; + (Self : in out LSP_File_Reader) is null; end LSP.Ada_Handlers.File_Readers; diff --git a/source/ada/lsp-ada_handlers.adb b/source/ada/lsp-ada_handlers.adb index b88f34ceb..0b0f3e093 100644 --- a/source/ada/lsp-ada_handlers.adb +++ b/source/ada/lsp-ada_handlers.adb @@ -26,6 +26,17 @@ package body LSP.Ada_Handlers is procedure Reload_Project (Self : in out Message_Handler'CLass) is null; -- TBD + ----------------------- + -- Get_Open_Document -- + ----------------------- + + function Get_Open_Document + (Self : access Message_Handler; + URI : LSP.Structures.DocumentUri; + Force : Boolean := False) + return LSP.Ada_Documents.Document_Access + is (raise Program_Error with "Unimplemented"); + ---------------- -- Initialize -- ---------------- diff --git a/source/ada/lsp-ada_handlers.ads b/source/ada/lsp-ada_handlers.ads index 6afa80662..bc014016c 100644 --- a/source/ada/lsp-ada_handlers.ads +++ b/source/ada/lsp-ada_handlers.ads @@ -20,6 +20,7 @@ with LSP.Ada_Client_Capabilities; with LSP.Ada_Configurations; +with LSP.Ada_Documents; with LSP.Client_Message_Receivers; with LSP.Server_Message_Visitors; with LSP.Server_Notification_Receivers; @@ -49,6 +50,16 @@ package LSP.Ada_Handlers is -- Incremental_Text_Changes - activate the support for incremental text -- changes. + function Get_Open_Document + (Self : access Message_Handler; + URI : LSP.Structures.DocumentUri; + Force : Boolean := False) + return LSP.Ada_Documents.Document_Access; + -- Return the open document for the given URI. + -- If the document is not opened, then if Force a new document + -- will be created and must be freed by the user else null will be + -- returned. + private type Message_Handler diff --git a/source/ada/lsp-diagnostic_sources.ads b/source/ada/lsp-diagnostic_sources.ads index 7b692f1d9..c272ae937 100644 --- a/source/ada/lsp-diagnostic_sources.ads +++ b/source/ada/lsp-diagnostic_sources.ads @@ -16,7 +16,7 @@ ------------------------------------------------------------------------------ with Ada.Unchecked_Deallocation; -with LSP.Messages; +with LSP.Structures; limited with LSP.Ada_Contexts; package LSP.Diagnostic_Sources is @@ -30,7 +30,7 @@ package LSP.Diagnostic_Sources is procedure Get_Diagnostic (Self : in out Diagnostic_Source; Context : LSP.Ada_Contexts.Context; - Errors : out LSP.Messages.Diagnostic_Vector) is abstract; + Errors : out LSP.Structures.Diagnostic_Vector) is abstract; -- Fill diagnostics for given document. function Has_New_Diagnostic From 6608b3d015a82b57dff63613fb2274771d1b203d Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Mon, 14 Aug 2023 18:11:15 +0300 Subject: [PATCH 017/152] Add lsp-ada_context_sets.ad[sb] Refs #1170 --- gnat/ignore_in_317.txt | 2 -- source/ada/lsp-ada_context_sets.adb | 15 +++++---------- source/ada/lsp-ada_context_sets.ads | 10 +++++----- source/ada/lsp-ada_contexts.adb | 5 ++--- source/ada/lsp-ada_contexts.ads | 5 +++-- 5 files changed, 15 insertions(+), 22 deletions(-) diff --git a/gnat/ignore_in_317.txt b/gnat/ignore_in_317.txt index c024e3b67..620d46cb8 100644 --- a/gnat/ignore_in_317.txt +++ b/gnat/ignore_in_317.txt @@ -17,8 +17,6 @@ lsp-ada_completions-pragmas.adb lsp-ada_completions-pragmas.ads lsp-ada_completions-use_clauses.adb lsp-ada_completions-use_clauses.ads -lsp-ada_context_sets.adb -lsp-ada_context_sets.ads lsp-ada_documentation.adb lsp-ada_documentation.ads lsp-ada_documents-lal_diagnostics.adb diff --git a/source/ada/lsp-ada_context_sets.adb b/source/ada/lsp-ada_context_sets.adb index 4abfa4671..47ae40ed7 100644 --- a/source/ada/lsp-ada_context_sets.adb +++ b/source/ada/lsp-ada_context_sets.adb @@ -1,7 +1,7 @@ ------------------------------------------------------------------------------ -- Language Server Protocol -- -- -- --- Copyright (C) 2018-2021, AdaCore -- +-- Copyright (C) 2018-2023, AdaCore -- -- -- -- This is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -71,17 +71,12 @@ package body LSP.Ada_Context_Sets is function Get_Best_Context (Self : Context_Set'Class; - URI : LSP.Messages.DocumentUri) return Context_Access is + URI : LSP.Structures.DocumentUri) return Context_Access is begin for Context of Self.Contexts loop - declare - File : constant Virtual_File := - Create_From_UTF8 (Context.URI_To_File (URI)); - begin - if Context.Is_Part_Of_Project (File) then - return Context; - end if; - end; + if Context.Is_Part_Of_Project (URI) then + return Context; + end if; end loop; return Self.Contexts.First_Element; diff --git a/source/ada/lsp-ada_context_sets.ads b/source/ada/lsp-ada_context_sets.ads index d1c493224..08af7fcc1 100644 --- a/source/ada/lsp-ada_context_sets.ads +++ b/source/ada/lsp-ada_context_sets.ads @@ -1,7 +1,7 @@ ------------------------------------------------------------------------------ -- Language Server Protocol -- -- -- --- Copyright (C) 2018-2021, AdaCore -- +-- Copyright (C) 2018-2023, AdaCore -- -- -- -- This is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -23,10 +23,10 @@ with Ada.Containers.Doubly_Linked_Lists; with Ada.Containers.Hashed_Maps; with VSS.Strings; +with VSS.Strings.Hash; with LSP.Ada_Contexts; -with LSP.Messages; -with LSP.Types; +with LSP.Structures; package LSP.Ada_Context_Sets is @@ -50,7 +50,7 @@ package LSP.Ada_Context_Sets is function Get_Best_Context (Self : Context_Set'Class; - URI : LSP.Messages.DocumentUri) return Context_Access; + URI : LSP.Structures.DocumentUri) return Context_Access; -- Return the first context in Contexts which contains a project -- which knows about file. Return the first context if no such -- context was found. @@ -92,7 +92,7 @@ private package Maps is new Ada.Containers.Hashed_Maps (Key_Type => VSS.Strings.Virtual_String, Element_Type => Context_Access, - Hash => LSP.Types.Hash, + Hash => VSS.Strings.Hash, Equivalent_Keys => VSS.Strings."=", "=" => "="); diff --git a/source/ada/lsp-ada_contexts.adb b/source/ada/lsp-ada_contexts.adb index d162cad2e..e6496abc2 100644 --- a/source/ada/lsp-ada_contexts.adb +++ b/source/ada/lsp-ada_contexts.adb @@ -41,7 +41,6 @@ with Langkit_Support.Text; with URIs; with LSP.Ada_Id_Iterators; -with LSP.Structures; package body LSP.Ada_Contexts is @@ -550,10 +549,10 @@ package body LSP.Ada_Contexts is function Is_Part_Of_Project (Self : Context; - File : Virtual_File) return Boolean is + URI : LSP.Structures.DocumentUri) return Boolean is begin return Self.Is_Fallback_Context - or else Self.Source_Files.Contains (File); + or else Self.Source_Files.Contains (Self.URI_To_File (URI)); end Is_Part_Of_Project; ------------------ diff --git a/source/ada/lsp-ada_contexts.ads b/source/ada/lsp-ada_contexts.ads index ada6e74ee..835f49403 100644 --- a/source/ada/lsp-ada_contexts.ads +++ b/source/ada/lsp-ada_contexts.ads @@ -37,10 +37,11 @@ with Pp.Command_Lines; with VSS.Strings; -with LSP.Tracers; with LSP.Ada_Documents; with LSP.Ada_File_Sets; with LSP.Search; +with LSP.Structures; +with LSP.Tracers; package LSP.Ada_Contexts is @@ -161,7 +162,7 @@ package LSP.Ada_Contexts is function Is_Part_Of_Project (Self : Context; - File : GNATCOLL.VFS.Virtual_File) return Boolean; + URI : LSP.Structures.DocumentUri) return Boolean; -- Check if given file belongs to the project loaded in the Context function List_Files (Self : Context'CLass) From f187d8c7f835b299336e71be547ae5d213cc8340 Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Mon, 14 Aug 2023 21:44:32 +0300 Subject: [PATCH 018/152] Copy project loading code into LSP.Ada_Handlers.Project_Loading Refs #1170 --- .../ada/lsp-ada_handlers-project_loading.adb | 769 ++++++++++++++++++ .../ada/lsp-ada_handlers-project_loading.ads | 46 ++ source/ada/lsp-ada_handlers.adb | 6 +- source/ada/lsp-ada_handlers.ads | 105 +++ source/ada/lsp-ada_highlighters.adb | 1 + 5 files changed, 923 insertions(+), 4 deletions(-) create mode 100644 source/ada/lsp-ada_handlers-project_loading.adb create mode 100644 source/ada/lsp-ada_handlers-project_loading.ads diff --git a/source/ada/lsp-ada_handlers-project_loading.adb b/source/ada/lsp-ada_handlers-project_loading.adb new file mode 100644 index 000000000..969f02e4d --- /dev/null +++ b/source/ada/lsp-ada_handlers-project_loading.adb @@ -0,0 +1,769 @@ +------------------------------------------------------------------------------ +-- Language Server Protocol -- +-- -- +-- Copyright (C) 2018-2023, AdaCore -- +-- -- +-- This is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 3, or (at your option) any later ver- -- +-- sion. This software is distributed in the hope that it will be useful, -- +-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- -- +-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -- +-- License for more details. You should have received a copy of the GNU -- +-- General Public License distributed with this software; see file -- +-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy -- +-- of the license. -- +------------------------------------------------------------------------------ + +with Ada.Characters.Wide_Wide_Latin_1; + +with GNATCOLL.Traces; +with GNATCOLL.VFS; + +with GPR2.Context; +with GPR2.Path_Name; +with GPR2.Project.View; +with GPR2.Containers; +with GPR2.Message; +with GPR2.Project.Registry.Attribute; +with GPR2.Project.Source.Set; +with GPR2.Project.Tree.View_Builder; + +with Libadalang.Preprocessing; + +with VSS.Strings.Conversions; +with VSS.String_Vectors; + +with Spawn.Environments; + +with LSP.Ada_Contexts; +with LSP.Ada_Context_Sets; +with LSP.Ada_Handlers.File_Readers; +with LSP.Enumerations; +with LSP.Structures; + +package body LSP.Ada_Handlers.Project_Loading is + + Line_Feed : constant Wide_Wide_Character := + Ada.Characters.Wide_Wide_Latin_1.LF; + + Runtime_Indexing : constant GNATCOLL.Traces.Trace_Handle := + GNATCOLL.Traces.Create ("ALS.RUNTIME_INDEXING", + GNATCOLL.Traces.On); + -- Trace to enable/disable runtime indexing. Useful for the testsuite. + + package Alire is + + procedure Run_Alire + (Root : String; + Has_Alire : out Boolean; + Error : out VSS.Strings.Virtual_String; + Project : out VSS.Strings.Virtual_String; + Environment : in out GPR2.Environment.Object) is null; + -- if Root directory contains `alire.toml` file, then run + -- `alr printenv` and fetch the first project from `alire.toml`. + + procedure Run_Alire + (Root : String; + Has_Alire : out Boolean; + Error : out VSS.Strings.Virtual_String; + Environment : in out GPR2.Environment.Object) is null; + -- The same as above, but without fetching the project file + + end Alire; + + procedure Load_Project_With_Alire + (Self : in out Message_Handler'Class; + Project_File : VSS.Strings.Virtual_String := ""; + Scenario_Variables : LSP.Ada_Configurations.Variable_List; + Charset : VSS.Strings.Virtual_String); + -- Core procedure to find project, search path, scenario and load the + -- project. + -- + -- @param Self The message handler itself + -- @param Project_File GPR, if set by the user in settings + -- @param Scenario_Variables Scenario as set by the user in settings + -- @param Charset Charset, if set by the user in settings + -- + -- Load a project with a help of alire. If there is `alire.toml` in the + -- root directory and `alr` in the `PATH`, then use Alire to setup project + -- search path, extra scenario variables (and a project file name if + -- Project_File is empty). If Alire reports error then show it to the + -- user and fallback to an implicit project. + -- + -- If Alire succeed or no alire/crate then load project if provided. + + procedure Load_Implicit_Project + (Self : in out Message_Handler'Class; + Status : Implicit_Project_Loaded); + -- Load the implicit project + + procedure Reload_Implicit_Project_Dirs + (Self : in out Message_Handler'Class); + -- Reload as project source dirs the directories in + -- Self.Project_Dirs_Loaded. + + procedure Update_Project_Predefined_Sources + (Self : in out Message_Handler'Class); + -- Fill Self.Project_Predefined_Sources with loaded project tree runtime + + procedure Mark_Source_Files_For_Indexing + (Self : in out Message_Handler'Class); + -- Mark all sources in all projects for indexing. This factorizes code + -- between Load_Project and Load_Implicit_Project. + + function To_Virtual_String + (Value : GNATCOLL.VFS.Virtual_File) return VSS.Strings.Virtual_String is + (VSS.Strings.Conversions.To_Virtual_String (Value.Display_Full_Name)); + -- Cast Virtual_File to Virtual_String + + function Root (Self : Message_Handler'Class) return GNATCOLL.VFS.Virtual_File + is (GNATCOLL.VFS.Create_From_UTF8 + (VSS.Strings.Conversions.To_UTF_8_String + (Self.Client.Root))); + -- Return the root directory of the client workspace + + type Environment is record + Context : GPR2.Context.Object := GPR2.Context.Empty; + Build_Path : GPR2.Path_Name.Object := GPR2.Path_Name.Undefined; + end record; + + --------------------------- + -- Ensure_Project_Loaded -- + --------------------------- + + procedure Ensure_Project_Loaded (Self : in out Message_Handler'Class) is + GPRs_Found : Natural := 0; + Project_File : VSS.Strings.Virtual_String; + begin + if not Self.Contexts.Is_Empty then + -- Rely on the fact that there is at least one context initialized + -- as a guarantee that the initialization has been done. + return; + end if; + + Self.Tracer.Trace ("Looking for a project... Root:"); + Self.Tracer.Trace_Text (Self.Client.Root); + + Load_Project_With_Alire + (Self => Self, + Project_File => VSS.Strings.Empty_Virtual_String, + Scenario_Variables => Self.Configuration.Scenario_Variables, + Charset => Self.Configuration.Charset); + + if not Self.Contexts.Is_Empty then + -- Some project was found by alire and loaded. We are done! + return; + end if; + + -- We don't have alire/crate. + -- We're going to look for a project in Root: list all the files + -- in this directory, looking for .gpr files. + + if not Self.Client.Root.Is_Empty then + declare + Files : GNATCOLL.VFS.File_Array_Access := + Root (Self).Read_Dir (GNATCOLL.VFS.Files_Only); + begin + for X of Files.all loop + if X.Has_Suffix (".gpr") then + GPRs_Found := GPRs_Found + 1; + exit when GPRs_Found > 1; + Project_File := To_Virtual_String (X); + end if; + end loop; + + GNATCOLL.VFS.Unchecked_Free (Files); + end; + end if; + + -- What we do depends on the number of .gpr files found: + + if GPRs_Found = 0 then + -- We have found zero .gpr files: load the implicit project + + Load_Implicit_Project (Self, No_Project_Found); + elsif GPRs_Found = 1 then + -- We have found exactly one .gpr file: let's load it. + Self.Tracer.Trace ("Loading:"); + Self.Tracer.Trace_Text (Project_File); + + Load_Project + (Self, + Project_File, + Self.Configuration.Scenario_Variables, + GPR2.Environment.Process_Environment, + "iso-8859-1", + Single_Project_Found); + else + -- We have found more than one project: warn the user! + + Self.Sender.On_ShowMessage_Notification + ((a_type => LSP.Enumerations.Error, + message => VSS.Strings.To_Virtual_String + ("More than one .gpr found." & Line_Feed & + "Note: you can configure a project " & + " through the ada.projectFile setting."))); + + Load_Implicit_Project (Self, Multiple_Projects_Found); + end if; + end Ensure_Project_Loaded; + + --------------------------- + -- Load_Implicit_Project -- + --------------------------- + + procedure Load_Implicit_Project + (Self : in out Message_Handler'Class; + Status : Implicit_Project_Loaded) + is + use LSP.Ada_Context_Sets; + use LSP.Ada_Contexts; + + C : constant Context_Access := new Context (Self.Tracer); + + Reader : LSP.Ada_Handlers.File_Readers.LSP_File_Reader + (Self'Unchecked_Access); + begin + Self.Tracer.Trace ("Loading the implicit project"); + + Self.Project_Status := Status; + Release_Contexts_And_Project_Info (Self); + + C.Initialize + (File_Reader => Reader, + Follow_Symlinks => Self.Configuration.Follow_Symlinks, + Style => Self.Configuration.Documentation_Style, + As_Fallback_Context => True); + + -- Note: we would call Load_Implicit_Project here, but this has + -- two problems: + -- - there is a bug under Windows where the files returned by + -- Source_Files have an extraneous directory separator + -- - the implicit project relies on the current working + -- of the ALS, which imposes a restriction on clients, and + -- is an extra pitfall for developers of this server + -- + -- Instead, use Load_Empty_Project and set the source dir and + -- language manually: this does not have these inconvenients. + + -- When there is no .gpr, create a project which loads the + -- root directory in the workspace. + + if not Self.Client.Root.Is_Empty then + Self.Project_Dirs_Loaded.Include (Root (Self)); + end if; + + Reload_Implicit_Project_Dirs (Self); + C.Load_Project (Self.Project_Tree, + Self.Project_Tree.Root_Project, + "iso-8859-1"); + + Update_Project_Predefined_Sources (Self); + + Self.Contexts.Prepend (C); + + -- Reindex the files from disk in the background after a project reload + Mark_Source_Files_For_Indexing (Self); + end Load_Implicit_Project; + + ------------------ + -- Load_Project -- + ------------------ + + procedure Load_Project + (Self : in out Message_Handler'Class; + Project_File : VSS.Strings.Virtual_String; + Scenario : LSP.Ada_Configurations.Variable_List; + Environment : GPR2.Environment.Object; + Charset : VSS.Strings.Virtual_String; + Status : Load_Project_Status) + is + use type GNATCOLL.VFS.Virtual_File; + + Message : LSP.Structures.ShowMessageParams; + Errors : VSS.String_Vectors.Virtual_String_Vector; + Warnings : VSS.String_Vectors.Virtual_String_Vector; + + procedure Create_Context_For_Non_Aggregate + (View : GPR2.Project.View.Object); + + procedure Append_Errors; + + function To_Virtual_File (Value : VSS.Strings.Virtual_String) + return GNATCOLL.VFS.Virtual_File is + (GNATCOLL.VFS.Create_From_UTF8 + (VSS.Strings.Conversions.To_UTF_8_String (Value))); + -- Cast Virtual_String to Virtual_File + + ------------------- + -- Append_Errors -- + ------------------- + + procedure Append_Errors is + begin + for Message of Self.Project_Tree.Log_Messages.all loop + case Message.Level is + when GPR2.Message.Error => + Errors.Append + (VSS.Strings.Conversions.To_Virtual_String + (Message.Format)); + when GPR2.Message.Warning => + Warnings.Append + (VSS.Strings.Conversions.To_Virtual_String + (Message.Format)); + when others => + null; + end case; + end loop; + end Append_Errors; + + -------------------------------------- + -- Create_Context_For_Non_Aggregate -- + -------------------------------------- + + procedure Create_Context_For_Non_Aggregate + (View : GPR2.Project.View.Object) + is + use LSP.Ada_Context_Sets; + use LSP.Ada_Contexts; + + C : constant Context_Access := new Context (Self.Tracer); + + Reader : LSP.Ada_Handlers.File_Readers.LSP_File_Reader + (Self'Unchecked_Access); + + Default_Config : Libadalang.Preprocessing.File_Config; + File_Configs : Libadalang.Preprocessing.File_Config_Maps.Map; + + procedure Set_Line_Mode + (Config : in out Libadalang.Preprocessing.File_Config); + -- Used to force the preprocessing line mode to Blank_Lines, which + -- is needed to preserve the number of lines after preprocessing a + -- source file, otherwise LSP requests based on SLOCs will fail. + + ------------------- + -- Set_Line_Mode -- + ------------------- + + procedure Set_Line_Mode + (Config : in out Libadalang.Preprocessing.File_Config) is + begin + if Config.Enabled then + Config.Line_Mode := Libadalang.Preprocessing.Blank_Lines; + end if; + end Set_Line_Mode; + + begin + -- Extract the preprocessing options from the context's project + -- and create the file reader which will preprocess the files + -- accordingly. + + Libadalang.Preprocessing.Extract_Preprocessor_Data_From_Project + (Tree => Self.Project_Tree, + Project => View, + Default_Config => Default_Config, + File_Configs => File_Configs); + + Libadalang.Preprocessing.Iterate + (Default_Config => Default_Config, + File_Configs => File_Configs, + Process => Set_Line_Mode'Access); + + Reader.Preprocessing_Data := + Libadalang.Preprocessing.Create_Preprocessor_Data + (Default_Config, File_Configs); + + C.Initialize + (Reader, + Style => Self.Configuration.Documentation_Style, + Follow_Symlinks => Self.Configuration.Follow_Symlinks); + + C.Load_Project + (Tree => Self.Project_Tree, + Root => View, + Charset => VSS.Strings.Conversions.To_UTF_8_String (Charset)); + + Self.Contexts.Prepend (C); + end Create_Context_For_Non_Aggregate; + + GPR : GNATCOLL.VFS.Virtual_File := + To_Virtual_File (Project_File); + + Project_Environment : Project_Loading.Environment; + + Relocate_Build_Tree : constant GNATCOLL.VFS.Virtual_File := + To_Virtual_File (Self.Configuration.Relocate_Build_Tree); + + Root_Dir : constant GNATCOLL.VFS.Virtual_File := + To_Virtual_File (Self.Configuration.Relocate_Root); + + begin + -- The projectFile may be either an absolute path or a + -- relative path; if so, we're assuming it's relative + -- to Self.Root. + + if not GPR.Is_Absolute_Path and then not Self.Client.Root.Is_Empty then + GPR := GNATCOLL.VFS.Join (Root (Self), GPR); + end if; + + -- Unload the project tree and the project environment + Release_Contexts_And_Project_Info (Self); + + -- Now load the new project + Self.Project_Status := Status; + + if not Self.Configuration.Relocate_Build_Tree.Is_Empty then + Project_Environment.Build_Path := + GPR2.Path_Name.Create (Relocate_Build_Tree); + + if not Self.Configuration.Relocate_Root.Is_Empty + and then GPR /= GNATCOLL.VFS.No_File + then + if not Root_Dir.Is_Absolute_Path then + Project_Environment.Build_Path := + GPR2.Path_Name.Create_Directory + (GPR2.Path_Name.Create (GPR).Relative_Path + (GPR2.Path_Name.Create (Root_Dir)).Name, + GPR2.Filename_Type + (Project_Environment.Build_Path.Value)); + end if; + end if; + end if; + + -- Update scenario variables with user provided values + for J in 1 .. Scenario.Names.Length loop + Project_Environment.Context.Insert + (GPR2.Optional_Name_Type + (VSS.Strings.Conversions.To_UTF_8_String (Scenario.Names (J))), + VSS.Strings.Conversions.To_UTF_8_String (Scenario.Values (J))); + end loop; + + begin + Self.Project_Tree.Load_Autoconf + (Filename => GPR2.Path_Name.Create (GPR), + Context => Project_Environment.Context, + Build_Path => Project_Environment.Build_Path, + Environment => Environment); + + Self.Project_Tree.Update_Sources (With_Runtime => True); + + exception + when E : GPR2.Project_Error + | GPR2.Processing_Error + | GPR2.Attribute_Error => + + Self.Tracer.Trace_Exception (E); + + Self.Project_Status := Invalid_Project_Configured; + end; + + -- Keep errors and warnings + Append_Errors; + + if Self.Project_Status /= Status + or else not Self.Project_Tree.Is_Defined + then + -- The project was invalid: fallback on loading the implicit project. + Errors.Prepend + (VSS.Strings.Conversions.To_Virtual_String + ("Unable to load project file: " & GPR.Display_Full_Name)); + + Load_Implicit_Project (Self, Invalid_Project_Configured); + + else + -- No exception during Load_Autoconf, check if we have runtime + if not Self.Project_Tree.Has_Runtime_Project then + Self.Project_Status := No_Runtime_Found; + end if; + + Update_Project_Predefined_Sources (Self); + + if Self.Project_Tree.Root_Project.Kind in GPR2.Aggregate_Kind then + for View of Self.Project_Tree.Root_Project.Aggregated loop + Create_Context_For_Non_Aggregate (View); + end loop; + else + Create_Context_For_Non_Aggregate + (Self.Project_Tree.Root_Project); + end if; + end if; + + -- Report the warnings, if any + if not Warnings.Is_Empty then + Message.message := Warnings.Join_Lines (VSS.Strings.LF); + Message.a_type := LSP.Enumerations.Warning; + Self.Sender.On_ShowMessage_Notification (Message); + end if; + + -- Report the errors, if any + if not Errors.Is_Empty then + Message.message := Errors.Join_Lines (VSS.Strings.LF); + Message.a_type := LSP.Enumerations.Error; + Self.Sender.On_ShowMessage_Notification (Message); + end if; + + -- Reindex all open documents immediately after project reload, so + -- that navigation from editors is accurate. + -- for Document of Self.Open_Documents loop + -- for Context of Self.Contexts_For_URI (Document.URI) loop + -- Context.Index_Document (Document.all); + -- end loop; + -- + -- Self.Publish_Diagnostics (Document_Access (Document)); + -- end loop; + + -- if not Self.File_Monitor.Assigned then + -- Self.File_Monitor := + -- new LSP.Servers.FS_Watch.FS_Watch_Monitor (Self.Server); + -- end if; + + -- We have successfully loaded a real project: monitor the filesystem + -- for any changes on the sources of the project + -- Self.File_Monitor.Monitor_Directories + -- (Self.Contexts.All_Source_Directories); + + -- Reindex the files from disk in the background after a project reload + Mark_Source_Files_For_Indexing (Self); + end Load_Project; + + ----------------------------- + -- Load_Project_With_Alire -- + ----------------------------- + + procedure Load_Project_With_Alire + (Self : in out Message_Handler'Class; + Project_File : VSS.Strings.Virtual_String := ""; + Scenario_Variables : LSP.Ada_Configurations.Variable_List; + Charset : VSS.Strings.Virtual_String) + is + + Has_Alire : Boolean; + Status : Load_Project_Status; + Errors : VSS.Strings.Virtual_String; + Project : VSS.Strings.Virtual_String := Project_File; + UTF_8 : constant VSS.Strings.Virtual_String := "utf-8"; + + Environment : GPR2.Environment.Object := + GPR2.Environment.Process_Environment; + + Alire_TOML : constant GNATCOLL.VFS.Virtual_File := + (if Self.Client.Root.Is_Empty then GNATCOLL.VFS.No_File + else Root (Self).Create_From_Dir ("alire.toml")); + + begin + if Alire_TOML.Is_Regular_File + and Spawn.Environments.System_Environment.Value ("ALIRE") /= "True" + then + + Self.Tracer.Trace ("Check alire:"); + + if Project.Is_Empty then + + Alire.Run_Alire + (Root => Root (Self).Display_Full_Name, + Has_Alire => Has_Alire, + Error => Errors, + Project => Project, + Environment => Environment); + + Status := Alire_Project; + else + + Alire.Run_Alire + (Root => Root (Self).Display_Full_Name, + Has_Alire => Has_Alire, + Error => Errors, + Environment => Environment); + + Status := Valid_Project_Configured; + end if; + + if Has_Alire and then not Errors.Is_Empty then + + -- Something wrong with alire. Report error. Don't load the + -- project. Fallback to implicit project. + + declare + Error : LSP.Structures.ShowMessageParams; + begin + Error.a_type := LSP.Enumerations.Error; + Error.message := Errors; + Self.Sender.On_ShowMessage_Notification (Error); + Self.Tracer.Trace_Text (Errors); + + Load_Implicit_Project (Self, Invalid_Project_Configured); + + return; + end; + elsif Has_Alire then + + -- No errors means the project has been found + pragma Assert (not Project.Is_Empty); + + Self.Tracer.Trace ("Project:"); + Self.Tracer.Trace_Text (Project); + + Load_Project + (Self => Self, + Project_File => Project, + Scenario => Scenario_Variables, + Environment => Environment, + Charset => (if Charset.Is_Empty then UTF_8 else Charset), + Status => Status); + -- Alire projects tend to use utf-8 + + return; + else + Self.Tracer.Trace ("No alr in the PATH."); + end if; + end if; + + -- There is no alire.toml or no alr, but we know the project, load it + if not Project.Is_Empty then + + Load_Project + (Self => Self, + Project_File => Project, + Scenario => Scenario_Variables, + Environment => Environment, + Charset => Charset, + Status => Valid_Project_Configured); + end if; + end Load_Project_With_Alire; + + ------------------------------------ + -- Mark_Source_Files_For_Indexing -- + ------------------------------------ + + procedure Mark_Source_Files_For_Indexing + (Self : in out Message_Handler'Class) is + begin + Self.Files_To_Index.Clear; + + -- Mark all the project's source files + for C of Self.Contexts.Each_Context loop + for F in C.List_Files loop + Self.Files_To_Index.Include + (LSP.Ada_File_Sets.File_Sets.Element (F)); + end loop; + end loop; + + if Runtime_Indexing.Is_Active then + -- Mark all the predefined sources too (runtime) + for F in Self.Project_Predefined_Sources.Iterate loop + declare + File : GNATCOLL.VFS.Virtual_File renames + LSP.Ada_File_Sets.File_Sets.Element (F); + begin + for Context of Self.Contexts.Each_Context loop + Self.Files_To_Index.Include (File); + end loop; + end; + end loop; + end if; + + Self.Total_Files_Indexed := 0; + Self.Total_Files_To_Index := Positive'Max + (1, Natural (Self.Files_To_Index.Length)); + end Mark_Source_Files_For_Indexing; + + --------------------------------------- + -- Release_Contexts_And_Project_Info -- + --------------------------------------- + + procedure Release_Contexts_And_Project_Info + (Self : in out Message_Handler'Class) is + begin + Self.Contexts.Cleanup; + + Self.Project_Tree.Unload; + -- Self.Project_Environment := Empty_Environment; + Self.Project_Predefined_Sources.Clear; + Self.Project_Dirs_Loaded.Clear; + + -- Clear indexing data + Self.Files_To_Index.Clear; + Self.Total_Files_To_Index := 1; + Self.Total_Files_Indexed := 0; + end Release_Contexts_And_Project_Info; + + ---------------------------------- + -- Reload_Implicit_Project_Dirs -- + ---------------------------------- + + procedure Reload_Implicit_Project_Dirs + (Self : in out Message_Handler'Class) + is + Project : GPR2.Project.Tree.View_Builder.Object := + GPR2.Project.Tree.View_Builder.Create + (Project_Dir => GPR2.Path_Name.Create_Directory ("."), + Name => "default"); + Values : GPR2.Containers.Value_List; + begin + for Dir of Self.Project_Dirs_Loaded loop + Values.Append (Dir.Display_Full_Name); + end loop; + + Project.Set_Attribute + (GPR2.Project.Registry.Attribute.Source_Dirs, Values); + + -- Load_Autoconf is assuming loading unloaded tree. + + Self.Project_Tree.Unload; + + GPR2.Project.Tree.View_Builder.Load_Autoconf + (Self => Self.Project_Tree, + Project => Project, + Context => GPR2.Context.Empty); + + Self.Project_Tree.Update_Sources (With_Runtime => True); + + exception + when E : others => + Self.Tracer.Trace_Exception (E, "Reload_Implicit_Project_Dirs"); + end Reload_Implicit_Project_Dirs; + + -------------------- + -- Reload_Project -- + -------------------- + + procedure Reload_Project (Self : in out Message_Handler'CLass) is + begin + if Self.Configuration.Project_File.Is_Empty then + Release_Contexts_And_Project_Info (Self); + Ensure_Project_Loaded (Self); + else + Load_Project_With_Alire + (Self, + Self.Configuration.Project_File, + Self.Configuration.Scenario_Variables, + Self.Configuration.Charset); + end if; + end Reload_Project; + + --------------------------------------- + -- Update_Project_Predefined_Sources -- + --------------------------------------- + + procedure Update_Project_Predefined_Sources + (Self : in out Message_Handler'Class) + is + use GPR2; + use GPR2.Project.Source.Set; + begin + Self.Project_Predefined_Sources.Clear; + + if Self.Project_Tree.Is_Defined + and then Self.Project_Tree.Has_Runtime_Project + then + for Source of Self.Project_Tree.Runtime_Project.Sources loop + if Source.Language = GPR2.Ada_Language then + Self.Project_Predefined_Sources.Include + (Source.Path_Name.Virtual_File); + end if; + end loop; + end if; + end Update_Project_Predefined_Sources; + +end LSP.Ada_Handlers.Project_Loading; diff --git a/source/ada/lsp-ada_handlers-project_loading.ads b/source/ada/lsp-ada_handlers-project_loading.ads new file mode 100644 index 000000000..b550e08a2 --- /dev/null +++ b/source/ada/lsp-ada_handlers-project_loading.ads @@ -0,0 +1,46 @@ +------------------------------------------------------------------------------ +-- Language Server Protocol -- +-- -- +-- Copyright (C) 2018-2023, AdaCore -- +-- -- +-- This is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 3, or (at your option) any later ver- -- +-- sion. This software is distributed in the hope that it will be useful, -- +-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- -- +-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -- +-- License for more details. You should have received a copy of the GNU -- +-- General Public License distributed with this software; see file -- +-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy -- +-- of the license. -- +------------------------------------------------------------------------------ + +with VSS.Strings; +with GPR2.Environment; + +with LSP.Ada_Configurations; + +private + +package LSP.Ada_Handlers.Project_Loading is + + procedure Load_Project + (Self : in out Message_Handler'Class; + Project_File : VSS.Strings.Virtual_String; + Scenario : LSP.Ada_Configurations.Variable_List; + Environment : GPR2.Environment.Object; + Charset : VSS.Strings.Virtual_String; + Status : Load_Project_Status); + -- Attempt to load the given project file, with the scenario provided. + -- This unloads all currently loaded project contexts. This factorizes code + -- between Load_Project_With_Alire and Ensure_Project_Loaded. + + procedure Ensure_Project_Loaded (Self : in out Message_Handler'Class); + + procedure Reload_Project (Self : in out Message_Handler'CLass); + + procedure Release_Contexts_And_Project_Info + (Self : in out Message_Handler'Class); + -- Release the memory associated to project information in Self + +end LSP.Ada_Handlers.Project_Loading; diff --git a/source/ada/lsp-ada_handlers.adb b/source/ada/lsp-ada_handlers.adb index 0b0f3e093..cef8c4e9e 100644 --- a/source/ada/lsp-ada_handlers.adb +++ b/source/ada/lsp-ada_handlers.adb @@ -19,13 +19,11 @@ with Ada.Exceptions; with VSS.Strings.Conversions; +with LSP.Ada_Handlers.Project_Loading; with LSP.Enumerations; package body LSP.Ada_Handlers is - procedure Reload_Project (Self : in out Message_Handler'CLass) is null; - -- TBD - ----------------------- -- Get_Open_Document -- ----------------------- @@ -61,7 +59,7 @@ package body LSP.Ada_Handlers is Self.Configuration.Read_JSON (Value.settings, Reload); if Reload then - Self.Reload_Project; + LSP.Ada_Handlers.Project_Loading.Reload_Project (Self); end if; end On_DidChangeConfiguration_Notification; diff --git a/source/ada/lsp-ada_handlers.ads b/source/ada/lsp-ada_handlers.ads index bc014016c..41a85e88a 100644 --- a/source/ada/lsp-ada_handlers.ads +++ b/source/ada/lsp-ada_handlers.ads @@ -18,9 +18,17 @@ -- This package provides requests and notifications handler for Ada -- language. +with Ada.Containers.Hashed_Sets; + +with GNATCOLL.VFS; + +with GPR2.Project.Tree; + with LSP.Ada_Client_Capabilities; with LSP.Ada_Configurations; +with LSP.Ada_Context_Sets; with LSP.Ada_Documents; +with LSP.Ada_File_Sets; with LSP.Client_Message_Receivers; with LSP.Server_Message_Visitors; with LSP.Server_Notification_Receivers; @@ -62,6 +70,48 @@ package LSP.Ada_Handlers is private + type Load_Project_Status is + (Valid_Project_Configured, + Single_Project_Found, + Alire_Project, + No_Runtime_Found, + No_Project_Found, + Multiple_Projects_Found, + Invalid_Project_Configured); + -- Variants for state of the project loaded into the handler: + -- + -- @value Valid_Project_Configured didChangeConfiguration provided a valid + -- project + -- + -- @value Single_Project_Found no project in didChangeConfiguration, but + -- just one project in Root dir + -- + -- @value Alire_Project no project in didChangeConfiguration, but Alire + -- knows what project to use + -- + -- @value No_Runtime_Found project loaded, but no Ada runtime library was + -- found + -- + -- @value No_Project_Found no project in didChangeConfiguration and no + -- project in Root dir + -- + -- @value Multiple_Projects_Found no project in didChangeConfiguration and + -- several projects in Root dir + -- + -- @value Invalid_Project_Configured didChangeConfiguration provided a + -- valid project + + subtype Implicit_Project_Loaded is Load_Project_Status range + No_Project_Found .. Invalid_Project_Configured; + -- Project status when an implicit project loaded + + -- Container for the predefined source files + package File_Sets is new Ada.Containers.Hashed_Sets + (Element_Type => GNATCOLL.VFS.Virtual_File, + Hash => GNATCOLL.VFS.Full_Name_Hash, + Equivalent_Elements => GNATCOLL.VFS."=", + "=" => GNATCOLL.VFS."="); + type Message_Handler (Sender : not null access LSP.Client_Message_Receivers .Client_Message_Receiver'Class; @@ -72,11 +122,66 @@ private with record Client : LSP.Ada_Client_Capabilities.Client_Capability; Configuration : LSP.Ada_Configurations.Configuration; + + Contexts : LSP.Ada_Context_Sets.Context_Set; + -- There is one context in this list per loaded project. + -- There should always be at least one "project" context - if no .gpr + -- is known to the server, this context should map to the implicit + -- project. + Incremental_Text_Changes : Boolean; + -- the support for incremental text changes is active Indexing_Enabled : Boolean := True; -- Whether to index sources in the background. This should be True -- for normal use, and can be disabled for debug or testing purposes. + + Files_To_Index : File_Sets.Set; + -- Contains any files that need indexing. + -- + -- Indexing of sources is performed in the background as soon as needed + -- (typically after a project load), and pre-indexes the Ada source + -- files, so that subsequent request are fast. + -- The way the "backgrounding" works is the following: + -- + -- * each request which should trigger indexing (for instance + -- project load) adds files to Files_To_Index + -- + -- * the procedure Index_Files takes care of the indexing; it's also + -- looking at the queue after each indexing to see if there + -- are requests pending. If a request is pending, it stops + -- indexing. + -- + -- * whenever the server has finished processing a notification + -- or a requests, it looks at whether Files_To_Index contains + -- files; if it does, it runs Index_Files + + Total_Files_Indexed : Natural := 0; + Total_Files_To_Index : Positive := 1; + -- These two fields are used to produce a progress bar for the indexing + -- operations. Total_Files_To_Index starts at 1 so that the progress + -- bar starts at 0%. + + ---------------------- + -- Project handling -- + ---------------------- + + Project_Tree : GPR2.Project.Tree.Object; + -- The currently loaded project tree + + -- Project_Environment : Environment; + -- The project environment for the currently loaded project + + Project_Predefined_Sources : LSP.Ada_File_Sets.Indexed_File_Set; + -- A cache for the predefined sources in the loaded project (typically, + -- runtime files). + + Project_Status : Load_Project_Status := No_Project_Found; + -- Status of loading the project + + Project_Dirs_Loaded : File_Sets.Set; + -- The directories to load in the "implicit project" + end record; overriding procedure On_Server_Request diff --git a/source/ada/lsp-ada_highlighters.adb b/source/ada/lsp-ada_highlighters.adb index 7b8367c00..a9ffb6ca9 100644 --- a/source/ada/lsp-ada_highlighters.adb +++ b/source/ada/lsp-ada_highlighters.adb @@ -26,6 +26,7 @@ package body LSP.Ada_Highlighters is Tracer : in out LSP.Tracers.Tracer'Class; Span : LSP.Structures.A_Range) return LSP.Structures.Natural_Vector is + pragma Unreferenced (Self, Unit, Tracer, Span); begin return LSP.Structures.Empty; end Get_Tokens; From 64ead85ff81ca548609c20c291d29f2b3d7525df Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Tue, 15 Aug 2023 10:47:51 +0300 Subject: [PATCH 019/152] Add lsp-ada_handlers-project_diagnostics.ads Refs #1170 --- gnat/ignore_in_317.txt | 2 -- .../ada/lsp-ada_handlers-project_diagnostics.adb | 14 ++++++++------ .../ada/lsp-ada_handlers-project_diagnostics.ads | 5 +++-- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/gnat/ignore_in_317.txt b/gnat/ignore_in_317.txt index 620d46cb8..2890c4e52 100644 --- a/gnat/ignore_in_317.txt +++ b/gnat/ignore_in_317.txt @@ -29,8 +29,6 @@ lsp-ada_handlers-named_parameters_commands.adb lsp-ada_handlers-named_parameters_commands.ads lsp-ada_handlers-other_file_commands.adb lsp-ada_handlers-other_file_commands.ads -lsp-ada_handlers-project_diagnostics.adb -lsp-ada_handlers-project_diagnostics.ads lsp-ada_handlers-project_reload_commands.adb lsp-ada_handlers-project_reload_commands.ads lsp-ada_handlers-refactor-add_parameter.adb diff --git a/source/ada/lsp-ada_handlers-project_diagnostics.adb b/source/ada/lsp-ada_handlers-project_diagnostics.adb index 9aa08efca..63e3d5b61 100644 --- a/source/ada/lsp-ada_handlers-project_diagnostics.adb +++ b/source/ada/lsp-ada_handlers-project_diagnostics.adb @@ -17,6 +17,8 @@ with VSS.Strings; +with LSP.Enumerations; + package body LSP.Ada_Handlers.Project_Diagnostics is Single_Project_Found_Message : constant VSS.Strings.Virtual_String := @@ -51,14 +53,14 @@ package body LSP.Ada_Handlers.Project_Diagnostics is overriding procedure Get_Diagnostic (Self : in out Diagnostic_Source; Context : LSP.Ada_Contexts.Context; - Errors : out LSP.Messages.Diagnostic_Vector) + Errors : out LSP.Structures.Diagnostic_Vector) is - Item : LSP.Messages.Diagnostic; + Item : LSP.Structures.Diagnostic; begin Self.Last_Status := Self.Handler.Project_Status; - Item.span := ((0, 0), (0, 0)); - Item.source := (True, "project"); - Item.severity := (True, LSP.Messages.Error); + Item.a_range := ((0, 0), (0, 0)); + Item.source := "project"; + Item.severity := (True, LSP.Enumerations.Error); case Self.Last_Status is when Valid_Project_Configured | Alire_Project => @@ -68,7 +70,7 @@ package body LSP.Ada_Handlers.Project_Diagnostics is Errors.Append (Item); when Single_Project_Found => Item.message := Single_Project_Found_Message; - Item.severity := (True, LSP.Messages.Hint); + Item.severity := (True, LSP.Enumerations.Hint); Errors.Append (Item); when No_Project_Found => Item.message := No_Project_Found_Message; diff --git a/source/ada/lsp-ada_handlers-project_diagnostics.ads b/source/ada/lsp-ada_handlers-project_diagnostics.ads index 2a9a36237..638f795e4 100644 --- a/source/ada/lsp-ada_handlers-project_diagnostics.ads +++ b/source/ada/lsp-ada_handlers-project_diagnostics.ads @@ -1,7 +1,7 @@ ------------------------------------------------------------------------------ -- Language Server Protocol -- -- -- --- Copyright (C) 2018-2021, AdaCore -- +-- Copyright (C) 2018-2023, AdaCore -- -- -- -- This is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -15,6 +15,7 @@ -- of the license. -- ------------------------------------------------------------------------------ +with LSP.Ada_Contexts; with LSP.Diagnostic_Sources; package LSP.Ada_Handlers.Project_Diagnostics is @@ -26,7 +27,7 @@ package LSP.Ada_Handlers.Project_Diagnostics is overriding procedure Get_Diagnostic (Self : in out Diagnostic_Source; Context : LSP.Ada_Contexts.Context; - Errors : out LSP.Messages.Diagnostic_Vector); + Errors : out LSP.Structures.Diagnostic_Vector); -- Fill diagnostics for given document. overriding function Has_New_Diagnostic From 7831732dd6279b41639abe043fe94066e589e8b9 Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Tue, 15 Aug 2023 11:02:34 +0300 Subject: [PATCH 020/152] Implement didOpen notification Refs #1170 --- source/ada/lsp-ada_client_capabilities.adb | 13 ++ source/ada/lsp-ada_client_capabilities.ads | 5 + source/ada/lsp-ada_documents.ads | 8 +- .../ada/lsp-ada_handlers-project_loading.adb | 5 - .../ada/lsp-ada_handlers-project_loading.ads | 5 + source/ada/lsp-ada_handlers.adb | 187 +++++++++++++++++- source/ada/lsp-ada_handlers.ads | 20 ++ source/ada/lsp-gnatcoll_tracers.adb | 2 +- source/ada/lsp-gnatcoll_tracers.ads | 2 +- source/server/lsp-tracers.ads | 2 +- 10 files changed, 236 insertions(+), 13 deletions(-) diff --git a/source/ada/lsp-ada_client_capabilities.adb b/source/ada/lsp-ada_client_capabilities.adb index 59b6d5f49..3d531c8c6 100644 --- a/source/ada/lsp-ada_client_capabilities.adb +++ b/source/ada/lsp-ada_client_capabilities.adb @@ -40,6 +40,19 @@ package body LSP.Ada_Client_Capabilities is end if; end Initialize; + ----------------------- + -- Set_Root_If_Empty -- + ----------------------- + + procedure Set_Root_If_Empty + (Self : in out Client_Capability'Class; + Value : VSS.Strings.Virtual_String) is + begin + if Self.Root.Is_Empty then + Self.Root := Value; + end if; + end Set_Root_If_Empty; + ---------------------------- -- To_Server_Capabilities -- ---------------------------- diff --git a/source/ada/lsp-ada_client_capabilities.ads b/source/ada/lsp-ada_client_capabilities.ads index 80b76c42c..16f83921d 100644 --- a/source/ada/lsp-ada_client_capabilities.ads +++ b/source/ada/lsp-ada_client_capabilities.ads @@ -44,6 +44,11 @@ package LSP.Ada_Client_Capabilities is -- if not rootUri/rootPath is provided, then it means no folder is open. -- Return an empty string in this case. + procedure Set_Root_If_Empty + (Self : in out Client_Capability'Class; + Value : VSS.Strings.Virtual_String); + -- Is Self.Root is empty then replace it with given Value + private type Client_Capability is tagged limited record diff --git a/source/ada/lsp-ada_documents.ads b/source/ada/lsp-ada_documents.ads index 2dfe2db9e..aecdee5af 100644 --- a/source/ada/lsp-ada_documents.ads +++ b/source/ada/lsp-ada_documents.ads @@ -28,8 +28,6 @@ with Libadalang.Common; with Langkit_Support.Slocs; with Laltools.Partial_GNATPP; -with GNATCOLL.Traces; - with Pp.Command_Lines; limited with LSP.Ada_Contexts; @@ -38,12 +36,13 @@ with LSP.Diagnostic_Sources; with LSP.Ada_Highlighters; with LSP.Search; with LSP.Structures; +with LSP.Tracers; package LSP.Ada_Documents is MAX_NB_DIAGNOSTICS : constant := 2; - type Document (Trace : GNATCOLL.Traces.Trace_Handle) is + type Document (Tracer : not null LSP.Tracers.Tracer_Access) is tagged limited private; -- An Ada document (file). @@ -355,7 +354,8 @@ private type Diagnostic_Source_Array is array (Natural range <>) of LSP.Diagnostic_Sources.Diagnostic_Source_Access; - type Document (Trace : GNATCOLL.Traces.Trace_Handle) is tagged limited + type Document (Tracer : not null LSP.Tracers.Tracer_Access) is + tagged limited record URI : LSP.Structures.DocumentUri; diff --git a/source/ada/lsp-ada_handlers-project_loading.adb b/source/ada/lsp-ada_handlers-project_loading.adb index 969f02e4d..44b054c8c 100644 --- a/source/ada/lsp-ada_handlers-project_loading.adb +++ b/source/ada/lsp-ada_handlers-project_loading.adb @@ -98,11 +98,6 @@ package body LSP.Ada_Handlers.Project_Loading is Status : Implicit_Project_Loaded); -- Load the implicit project - procedure Reload_Implicit_Project_Dirs - (Self : in out Message_Handler'Class); - -- Reload as project source dirs the directories in - -- Self.Project_Dirs_Loaded. - procedure Update_Project_Predefined_Sources (Self : in out Message_Handler'Class); -- Fill Self.Project_Predefined_Sources with loaded project tree runtime diff --git a/source/ada/lsp-ada_handlers-project_loading.ads b/source/ada/lsp-ada_handlers-project_loading.ads index b550e08a2..ca9448eef 100644 --- a/source/ada/lsp-ada_handlers-project_loading.ads +++ b/source/ada/lsp-ada_handlers-project_loading.ads @@ -43,4 +43,9 @@ package LSP.Ada_Handlers.Project_Loading is (Self : in out Message_Handler'Class); -- Release the memory associated to project information in Self + procedure Reload_Implicit_Project_Dirs + (Self : in out Message_Handler'Class); + -- Reload as project source dirs the directories in + -- Self.Project_Dirs_Loaded. + end LSP.Ada_Handlers.Project_Loading; diff --git a/source/ada/lsp-ada_handlers.adb b/source/ada/lsp-ada_handlers.adb index cef8c4e9e..e4a2d4854 100644 --- a/source/ada/lsp-ada_handlers.adb +++ b/source/ada/lsp-ada_handlers.adb @@ -16,14 +16,92 @@ ------------------------------------------------------------------------------ with Ada.Exceptions; +with Ada.Unchecked_Deallocation; with VSS.Strings.Conversions; +with URIs; + +with LSP.Ada_Contexts; +with LSP.Ada_Handlers.Project_Diagnostics; with LSP.Ada_Handlers.Project_Loading; +with LSP.Diagnostic_Sources; with LSP.Enumerations; package body LSP.Ada_Handlers is + function Contexts_For_URI + (Self : access Message_Handler; + URI : LSP.Structures.DocumentUri) + return LSP.Ada_Context_Sets.Context_Lists.List; + -- Return a list of contexts that are suitable for the given File/URI: + -- a list of all contexts where the file is known to be part of the + -- project tree, or is a runtime file for this project. If the file + -- is not known to any project, return an empty list. + + procedure Publish_Diagnostics + (Self : in out Message_Handler'Class; + Document : not null LSP.Ada_Documents.Document_Access; + Other_Diagnostics : LSP.Structures.Diagnostic_Vector := + LSP.Structures.Empty; + Force : Boolean := False); + -- Publish diagnostic messages for given document if needed. + -- Other_Diagnostics can be used to specify punctual diagnostics not coming + -- from sources that analyze files when being opened or modified. + -- When Force is True, the diagnostics will always be sent, not matter if + -- they have changed or not. + + function To_File + (Self : Message_Handler'Class; + URI : LSP.Structures.DocumentUri) return GNATCOLL.VFS.Virtual_File + is + (GNATCOLL.VFS.Create_From_UTF8 + (URIs.Conversions.To_File + (VSS.Strings.Conversions.To_UTF_8_String (URI), + Normalize => Self.Configuration.Follow_Symlinks))); + + ---------------------- + -- Contexts_For_URI -- + ---------------------- + + function Contexts_For_URI + (Self : access Message_Handler; + URI : LSP.Structures.DocumentUri) + return LSP.Ada_Context_Sets.Context_Lists.List + is + function Is_A_Source (Self : LSP.Ada_Contexts.Context) return Boolean is + (Self.Is_Part_Of_Project (URI)); + -- Return True if URI is a source of the project held by Context + + File : constant GNATCOLL.VFS.Virtual_File := Self.To_File (URI); + begin + -- If the file does not exist on disk, assume this is a file + -- being created and, as a special convenience in this case, + -- assume it could belong to any project. + if not File.Is_Regular_File + -- If the file is a runtime file for the loaded project environment, + -- all projects can see it. + or else Self.Project_Predefined_Sources.Contains (File) + then + return Self.Contexts.Each_Context; + end if; + + -- List contexts where File is a source of the project hierarchy + return Self.Contexts.Each_Context (Is_A_Source'Unrestricted_Access); + end Contexts_For_URI; + + ---------- + -- Free -- + ---------- + + procedure Free (Self : in out Internal_Document_Access) is + procedure Unchecked_Free is new Ada.Unchecked_Deallocation + (LSP.Ada_Documents.Document, Internal_Document_Access); + begin + Self.Cleanup; + Unchecked_Free (Self); + end Free; + ----------------------- -- Get_Open_Document -- ----------------------- @@ -33,7 +111,26 @@ package body LSP.Ada_Handlers is URI : LSP.Structures.DocumentUri; Force : Boolean := False) return LSP.Ada_Documents.Document_Access - is (raise Program_Error with "Unimplemented"); + is + File : constant GNATCOLL.VFS.Virtual_File := Self.To_File (URI); + begin + Project_Loading.Ensure_Project_Loaded (Self.all); + + if Self.Open_Documents.Contains (File) then + return LSP.Ada_Documents.Document_Access + (Self.Open_Documents.Element (File)); + elsif Force then + declare + Document : constant Internal_Document_Access := + new LSP.Ada_Documents.Document (Self.Tracer); + begin + Document.Initialize (URI, VSS.Strings.Empty_Virtual_String, null); + return LSP.Ada_Documents.Document_Access (Document); + end; + else + return null; + end if; + end Get_Open_Document; ---------------- -- Initialize -- @@ -63,6 +160,64 @@ package body LSP.Ada_Handlers is end if; end On_DidChangeConfiguration_Notification; + ----------------------------- + -- On_DidOpen_Notification -- + ----------------------------- + + overriding procedure On_DidOpen_Notification + (Self : in out Message_Handler; + Value : LSP.Structures.DidOpenTextDocumentParams) + is + URI : LSP.Structures.DocumentUri renames Value.textDocument.uri; + File : constant GNATCOLL.VFS.Virtual_File := Self.To_File (URI); + Object : constant Internal_Document_Access := + new LSP.Ada_Documents.Document (Self.Tracer); + Diag : constant LSP.Diagnostic_Sources.Diagnostic_Source_Access := + new LSP.Ada_Handlers.Project_Diagnostics.Diagnostic_Source + (Self'Unchecked_Access); + begin + Self.Tracer.Trace ("In Text_Document_Did_Open. Uri :"); + Self.Tracer.Trace_Text (URI); + + -- Some clients don't properly call initialize, or don't pass the + -- project to didChangeConfiguration: fallback here on loading a + -- project in this directory, if needed. + Self.Client.Set_Root_If_Empty + (VSS.Strings.Conversions.To_Virtual_String + (File.Dir.Display_Full_Name)); + + Project_Loading.Ensure_Project_Loaded (Self); + + -- We have received a document: add it to the documents container + Object.Initialize (URI, Value.textDocument.text, Diag); + Self.Open_Documents.Include (File, Object); + + -- Handle the case where we're loading the implicit project: do + -- we need to add the directory in which the document is open? + + if Self.Project_Status in Implicit_Project_Loaded then + declare + Dir : constant GNATCOLL.VFS.Virtual_File := Self.To_File (URI).Dir; + begin + if not Self.Project_Dirs_Loaded.Contains (Dir) then + -- We do need to add this directory + Self.Project_Dirs_Loaded.Insert (Dir); + Project_Loading.Reload_Implicit_Project_Dirs (Self); + end if; + end; + end if; + + -- Index the document in all the contexts where it is relevant + for Context of Self.Contexts_For_URI (URI) loop + Context.Index_Document (Object.all); + end loop; + + -- Emit diagnostics + Self.Publish_Diagnostics (LSP.Ada_Documents.Document_Access (Object)); + + Self.Tracer.Trace ("Finished Text_Document_Did_Open"); + end On_DidOpen_Notification; + --------------------------- -- On_Initialize_Request -- --------------------------- @@ -152,4 +307,34 @@ package body LSP.Ada_Handlers is Self.Sender.On_Shutdown_Response (Id, Result); end On_Shutdown_Request; + ------------------------- + -- Publish_Diagnostics -- + ------------------------- + + procedure Publish_Diagnostics + (Self : in out Message_Handler'Class; + Document : not null LSP.Ada_Documents.Document_Access; + Other_Diagnostics : LSP.Structures.Diagnostic_Vector := + LSP.Structures.Empty; + Force : Boolean := False) + is + Changed : Boolean; + Diag : LSP.Structures.PublishDiagnosticsParams; + begin + if Self.Configuration.Diagnostics_Enabled then + Document.Get_Errors + (Context => Self.Contexts.Get_Best_Context (Document.URI).all, + Changed => Changed, + Errors => Diag.diagnostics, + Force => Force); + + Diag.diagnostics.Append_Vector (Other_Diagnostics); + + if Changed or else not Other_Diagnostics.Is_Empty then + Diag.uri := Document.URI; + Self.Sender.On_PublishDiagnostics_Notification (Diag); + end if; + end if; + end Publish_Diagnostics; + end LSP.Ada_Handlers; diff --git a/source/ada/lsp-ada_handlers.ads b/source/ada/lsp-ada_handlers.ads index 41a85e88a..c1b72a626 100644 --- a/source/ada/lsp-ada_handlers.ads +++ b/source/ada/lsp-ada_handlers.ads @@ -18,6 +18,7 @@ -- This package provides requests and notifications handler for Ada -- language. +with Ada.Containers.Hashed_Maps; with Ada.Containers.Hashed_Sets; with GNATCOLL.VFS; @@ -105,6 +106,18 @@ private No_Project_Found .. Invalid_Project_Configured; -- Project status when an implicit project loaded + type Internal_Document_Access is access all LSP.Ada_Documents.Document; + + procedure Free (Self : in out Internal_Document_Access); + -- Free all the data for the given document. + + -- Container for documents indexed by URI + package Document_Maps is new Ada.Containers.Hashed_Maps + (Key_Type => GNATCOLL.VFS.Virtual_File, + Element_Type => Internal_Document_Access, + Hash => GNATCOLL.VFS.Full_Name_Hash, + Equivalent_Keys => GNATCOLL.VFS."="); + -- Container for the predefined source files package File_Sets is new Ada.Containers.Hashed_Sets (Element_Type => GNATCOLL.VFS.Virtual_File, @@ -136,6 +149,9 @@ private -- Whether to index sources in the background. This should be True -- for normal use, and can be disabled for debug or testing purposes. + Open_Documents : Document_Maps.Map; + -- The documents that are currently open + Files_To_Index : File_Sets.Set; -- Contains any files that need indexing. -- @@ -204,4 +220,8 @@ private (Self : in out Message_Handler; Value : LSP.Structures.DidChangeConfigurationParams); + overriding procedure On_DidOpen_Notification + (Self : in out Message_Handler; + Value : LSP.Structures.DidOpenTextDocumentParams); + end LSP.Ada_Handlers; diff --git a/source/ada/lsp-gnatcoll_tracers.adb b/source/ada/lsp-gnatcoll_tracers.adb index b42687f29..94ec3493f 100644 --- a/source/ada/lsp-gnatcoll_tracers.adb +++ b/source/ada/lsp-gnatcoll_tracers.adb @@ -127,7 +127,7 @@ package body LSP.GNATCOLL_Tracers is overriding procedure Trace_Text (Self : in out Tracer; - Text : VSS.Strings.Virtual_String) is + Text : VSS.Strings.Virtual_String'Class) is begin Self.Server_Trace.Trace (VSS.Strings.Conversions.To_UTF_8_String (Text)); end Trace_Text; diff --git a/source/ada/lsp-gnatcoll_tracers.ads b/source/ada/lsp-gnatcoll_tracers.ads index 9862fa604..67ecf0e4e 100644 --- a/source/ada/lsp-gnatcoll_tracers.ads +++ b/source/ada/lsp-gnatcoll_tracers.ads @@ -43,7 +43,7 @@ package LSP.GNATCOLL_Tracers is overriding procedure Trace_Text (Self : in out Tracer; - Text : VSS.Strings.Virtual_String); + Text : VSS.Strings.Virtual_String'Class); overriding procedure Trace_Exception (Self : in out Tracer; diff --git a/source/server/lsp-tracers.ads b/source/server/lsp-tracers.ads index 9e0b31f81..b8bb1df41 100644 --- a/source/server/lsp-tracers.ads +++ b/source/server/lsp-tracers.ads @@ -36,7 +36,7 @@ package LSP.Tracers is procedure Trace_Text (Self : in out Tracer; - Text : VSS.Strings.Virtual_String) is abstract; + Text : VSS.Strings.Virtual_String'Class) is abstract; -- Append Text to default trace file procedure Trace_Exception From 163fd7941941e707c45f2cf63a23ed72c0935e61 Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Tue, 15 Aug 2023 11:25:59 +0300 Subject: [PATCH 021/152] Add lsp-ada_documents-lal_diagnostics.ads Refs #1170 --- gnat/ignore_in_317.txt | 2 -- source/ada/lsp-ada_documents-lal_diagnostics.adb | 16 +++++++++------- source/ada/lsp-ada_documents-lal_diagnostics.ads | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/gnat/ignore_in_317.txt b/gnat/ignore_in_317.txt index 2890c4e52..58efbb4f0 100644 --- a/gnat/ignore_in_317.txt +++ b/gnat/ignore_in_317.txt @@ -19,8 +19,6 @@ lsp-ada_completions-use_clauses.adb lsp-ada_completions-use_clauses.ads lsp-ada_documentation.adb lsp-ada_documentation.ads -lsp-ada_documents-lal_diagnostics.adb -lsp-ada_documents-lal_diagnostics.ads lsp-ada_handlers-alire.adb lsp-ada_handlers-alire.ads lsp-ada_handlers-invisibles.adb diff --git a/source/ada/lsp-ada_documents-lal_diagnostics.adb b/source/ada/lsp-ada_documents-lal_diagnostics.adb index bda672419..ac44a35ac 100644 --- a/source/ada/lsp-ada_documents-lal_diagnostics.adb +++ b/source/ada/lsp-ada_documents-lal_diagnostics.adb @@ -1,7 +1,7 @@ ------------------------------------------------------------------------------ -- Language Server Protocol -- -- -- --- Copyright (C) 2018-2021, AdaCore -- +-- Copyright (C) 2018-2023, AdaCore -- -- -- -- This is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -17,7 +17,7 @@ with Ada.Strings.Wide_Wide_Unbounded; -with LSP.Lal_Utils; +with VSS.Strings.Conversions; package body LSP.Ada_Documents.LAL_Diagnostics is @@ -32,16 +32,18 @@ package body LSP.Ada_Documents.LAL_Diagnostics is overriding procedure Get_Diagnostic (Self : in out Diagnostic_Source; Context : LSP.Ada_Contexts.Context; - Errors : out LSP.Messages.Diagnostic_Vector) + Errors : out LSP.Structures.Diagnostic_Vector) is - Item : LSP.Messages.Diagnostic; + Item : LSP.Structures.Diagnostic; begin - Item.source := (True, "libadalang"); + Item.source := "libadalang"; Self.Errors := Self.Get_Diagnostics (Context); for J in Self.Errors.List'Range loop - Item.span := LSP.Lal_Utils.To_Span (Self.Errors.List (J).Sloc_Range); - Item.message := LSP.Lal_Utils.To_Virtual_String + Item.a_range := Self.Document.To_LSP_Range + (Self.Errors.List (J).Sloc_Range); + + Item.message := VSS.Strings.Conversions.To_Virtual_String (Self.Errors.List (J).Message); Errors.Append (Item); diff --git a/source/ada/lsp-ada_documents-lal_diagnostics.ads b/source/ada/lsp-ada_documents-lal_diagnostics.ads index e4c89226c..4988f53b9 100644 --- a/source/ada/lsp-ada_documents-lal_diagnostics.ads +++ b/source/ada/lsp-ada_documents-lal_diagnostics.ads @@ -1,7 +1,7 @@ ------------------------------------------------------------------------------ -- Language Server Protocol -- -- -- --- Copyright (C) 2018-2021, AdaCore -- +-- Copyright (C) 2018-2023, AdaCore -- -- -- -- This is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -27,7 +27,7 @@ package LSP.Ada_Documents.LAL_Diagnostics is overriding procedure Get_Diagnostic (Self : in out Diagnostic_Source; Context : LSP.Ada_Contexts.Context; - Errors : out LSP.Messages.Diagnostic_Vector); + Errors : out LSP.Structures.Diagnostic_Vector); -- Fill diagnostics for given document. overriding function Has_New_Diagnostic From 776971d8b7d85cbc15427815ed261eeaec91a629 Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Tue, 15 Aug 2023 13:23:21 +0300 Subject: [PATCH 022/152] Restore part of lsp-ada_documents.adb Refs #1170 --- source/ada/lsp-ada_contexts.adb | 4 + source/ada/lsp-ada_contexts.ads | 8 +- source/ada/lsp-ada_documents.adb | 1791 +++++++++++++++++++++++++++--- 3 files changed, 1663 insertions(+), 140 deletions(-) diff --git a/source/ada/lsp-ada_contexts.adb b/source/ada/lsp-ada_contexts.adb index e6496abc2..804f6b3e1 100644 --- a/source/ada/lsp-ada_contexts.adb +++ b/source/ada/lsp-ada_contexts.adb @@ -88,6 +88,10 @@ package body LSP.Ada_Contexts is -- references to the base primitives it inherits and all the references to -- the overriding ones. + ----------------- + -- URI_To_File -- + ----------------- + function URI_To_File (Self : Context; URI : LSP.Structures.DocumentUri) diff --git a/source/ada/lsp-ada_contexts.ads b/source/ada/lsp-ada_contexts.ads index 835f49403..91e8d89df 100644 --- a/source/ada/lsp-ada_contexts.ads +++ b/source/ada/lsp-ada_contexts.ads @@ -87,10 +87,10 @@ package LSP.Ada_Contexts is -- URI : LSP.Types.LSP_URI) -- return Ada.Strings.UTF_Encoding.UTF_8_String; -- - -- function URI_To_File - -- (Self : Context; - -- URI : LSP.Types.LSP_URI) - -- return GNATCOLL.VFS.Virtual_File; + function URI_To_File + (Self : Context; + URI : LSP.Structures.DocumentUri) + return GNATCOLL.VFS.Virtual_File; procedure Find_All_References (Self : Context; diff --git a/source/ada/lsp-ada_documents.adb b/source/ada/lsp-ada_documents.adb index dd8da1b84..6851564da 100644 --- a/source/ada/lsp-ada_documents.adb +++ b/source/ada/lsp-ada_documents.adb @@ -15,21 +15,153 @@ -- of the license. -- ------------------------------------------------------------------------------ +with Ada.Characters.Wide_Wide_Latin_1; +with Ada.Tags; +with Ada.Unchecked_Deallocation; + +with Langkit_Support.Symbols; +with Langkit_Support.Text; + +with Laltools.Common; +with Pp.Scanner; +with Utils.Char_Vectors; + +with Libadalang.Iterators; +with Libadalang.Sources; + +with VSS.Characters; +with VSS.Strings.Character_Iterators; +with VSS.Strings.Conversions; +with VSS.Strings.Cursors; +with VSS.Strings.Line_Iterators; +with VSS.Unicode; + +with LSP.Ada_Completions.Filters; +with LSP.Ada_Contexts; +with LSP.Ada_Documents.LAL_Diagnostics; +with LSP.Ada_Id_Iterators; +with LSP.Enumerations; +with LSP.Predicates; + package body LSP.Ada_Documents is pragma Warnings (Off); + LSP_New_Line_Function_Set : constant VSS.Strings.Line_Terminator_Set := + (VSS.Strings.CR | VSS.Strings.CRLF | VSS.Strings.LF => True, + others => False); + -- LSP allows to use three kinds of line terminators: CR, CR+LF and LF. + + procedure Recompute_Indexes (Self : in out Document'Class); + -- Recompute the line-to-offset indexes in Self + + procedure Recompute_Markers + (Self : in out Document'Class; + Low_Line : Natural; + Start_Marker : VSS.Strings.Markers.Character_Marker; + End_Marker : VSS.Strings.Markers.Character_Marker); + -- Recompute line-to-marker index starting from Start_Marker till + -- End_Marker and filling index table starting at Low_Line. End_Marker + -- may be invalid marker, in this case indexing down to the end of the + -- text. + + procedure Span_To_Markers + (Self : Document'Class; + Span : LSP.Structures.A_Range; + From : out VSS.Strings.Markers.Character_Marker; + To : out VSS.Strings.Markers.Character_Marker); + ------------------- -- Apply_Changes -- ------------------- procedure Apply_Changes - (Self : aliased in out Document; Version : Integer; - Vector : LSP.Structures.TextDocumentContentChangeEvent_Vector) + (Self : aliased in out Document; + Version : Integer; + Vector : LSP.Structures.TextDocumentContentChangeEvent_Vector) is + Dummy : Libadalang.Analysis.Analysis_Unit; begin - pragma Compile_Time_Warning - (Standard.True, "Apply_Changes unimplemented"); - raise Program_Error with "Unimplemented procedure Apply_Changes"; + Self.Version := Version; + + for Change of Vector loop + if Change.a_range.Is_Set then + -- We're replacing a range + + declare + Low_Line : Natural := Change.a_range.Value.start.line; + High_Line : Natural := Change.a_range.Value.an_end.line; + Delete_High : Natural := High_Line; + Start_Index : Natural; + + First_Marker : VSS.Strings.Markers.Character_Marker; + Last_Marker : VSS.Strings.Markers.Character_Marker; + Start_Marker : VSS.Strings.Markers.Character_Marker; + End_Marker : VSS.Strings.Markers.Character_Marker; + + begin + -- Do text replacement + + Self.Span_To_Markers + (Change.a_range.Value, First_Marker, Last_Marker); + Self.Text.Replace (First_Marker, Last_Marker, Change.text); + + -- Markers inside modified range of lines need to be + -- recomputed, markers outside of this range has been + -- recomputed by call to Replace. + + -- Use marker of the line before the first modified line as + -- start marker for recompute because marker of the first + -- modified line may be ether invalidated or moved by Replace, + -- or start from first character of the new text when first + -- line was modified. + + if Low_Line /= Self.Line_To_Marker.First_Index then + Low_Line := Low_Line - 1; + Start_Index := Low_Line; + Start_Marker := Self.Line_To_Marker (Low_Line); + + else + Start_Index := Self.Line_To_Marker.First_Index; + Start_Marker := Self.Text.At_First_Character.Marker; + end if; + + -- Use marker of the line after the last modified line as end + -- marker for recompute because marker of the last modified + -- line may be ether invalidated or moved and not point to the + -- beginning of the line, or use invalid marker when last line + -- was modified. + + if High_Line /= Self.Line_To_Marker.Last_Index then + Delete_High := High_Line; + High_Line := High_Line + 1; + End_Marker := Self.Line_To_Marker (High_Line); + end if; + + if Low_Line = Self.Line_To_Marker.First_Index + and then High_Line = Self.Line_To_Marker.Last_Index + then + Self.Recompute_Indexes; + + else + if Delete_High >= Low_Line then + Self.Line_To_Marker.Delete + (Low_Line, + Ada.Containers.Count_Type + (Delete_High - Low_Line + 1)); + end if; + + Self.Recompute_Markers + (Start_Index, Start_Marker, End_Marker); + end if; + end; + + else + Self.Text := Change.text; + + -- We're setting the whole text: compute the indexes now. + Self.Recompute_Indexes; + end if; + end loop; end Apply_Changes; ------------- @@ -38,8 +170,9 @@ package body LSP.Ada_Documents is procedure Cleanup (Self : in out Document) is begin - pragma Compile_Time_Warning (Standard.True, "Cleanup unimplemented"); - raise Program_Error with "Unimplemented procedure Cleanup"; + for Source of Self.Diagnostic_Sources loop + LSP.Diagnostic_Sources.Unchecked_Free (Source); + end loop; end Cleanup; ----------------------------- @@ -70,14 +203,270 @@ package body LSP.Ada_Documents is ---------- procedure Diff - (Self : Document; New_Text : VSS.Strings.Virtual_String; - Old_Span : LSP.Structures.A_Range := Empty_Range; - New_Span : LSP.Structures.A_Range := Empty_Range; + (Self : Document; + New_Text : VSS.Strings.Virtual_String; + Old_Span : LSP.Structures.A_Range := Empty_Range; + New_Span : LSP.Structures.A_Range := Empty_Range; Edit : out LSP.Structures.TextEdit_Vector) is + use type LSP.Structures.A_Range; + use type LSP.Structures.Position; + + Old_First_Line : Natural; + New_First_Line : Natural; + + Old_Lines, New_Lines : VSS.String_Vectors.Virtual_String_Vector; + Old_Length, New_Length : Natural; + begin - pragma Compile_Time_Warning (Standard.True, "Diff unimplemented"); - raise Program_Error with "Unimplemented procedure Diff"; + Old_Lines := + Self.Text.Split_Lines + (Terminators => LSP_New_Line_Function_Set, + Keep_Terminator => True); + New_Lines := + New_Text.Split_Lines + (Terminators => LSP_New_Line_Function_Set, + Keep_Terminator => True); + + if Old_Span = Empty_Range then + Old_First_Line := 1; + Old_Length := Old_Lines.Length; + + else + Old_First_Line := Natural (Old_Span.start.line + 1); + Old_Length := + Natural (Old_Span.an_end.line - Old_Span.start.line + 1); + end if; + + if New_Span = Empty_Range then + New_First_Line := 1; + New_Length := New_Lines.Length; + else + New_First_Line := Natural (New_Span.start.line + 1); + New_Length := + Natural (New_Span.an_end.line - New_Span.start.line + 1); + end if; + + declare + use type VSS.Strings.Virtual_String; + + type LCS_Array is array + (Natural range 0 .. Old_Length, + Natural range 0 .. New_Length) of Integer; + type LCS_Array_Access is access all LCS_Array; + + procedure Free is + new Ada.Unchecked_Deallocation (LCS_Array, LCS_Array_Access); + + LCS : LCS_Array_Access := new LCS_Array; + Match : Integer; + Delete : Integer; + Insert : Integer; + + Old_Index : Natural := Old_Length; + New_Index : Natural := New_Length; + + Old_Natural : Natural; + -- needed to determine which line number in the old buffer is + -- changed, deleted or before which new lines are inserted + + Changed_Block_Text : VSS.Strings.Virtual_String; + Changed_Block_Span : LSP.Structures.A_Range := ((0, 0), (0, 0)); + + procedure Prepare + (Line : Natural; + Text : VSS.Strings.Virtual_String); + -- Store imformation for Text_Etid in New_String and Span + + procedure Add (From_Line : Natural); + -- Add prepared New_String and Span into Text_Edit + + ------------- + -- Prepare -- + ------------- + + procedure Prepare + (Line : Natural; + Text : VSS.Strings.Virtual_String) is + begin + if Changed_Block_Span.an_end = (0, 0) then + -- it is the first portion of a changed block so store + -- last position of the changes + Changed_Block_Span.an_end := (Line, 0); + end if; + + -- accumulating new text for the changed block + Changed_Block_Text.Prepend (Text); + end Prepare; + + --------- + -- Add -- + --------- + + procedure Add (From_Line : Natural) is + begin + if Changed_Block_Span.an_end = (0, 0) then + -- No information for Text_Edit + return; + end if; + + Changed_Block_Span.start := + (line => From_Line, + character => 0); + + Edit.Prepend + (LSP.Structures.TextEdit' + (a_range => Changed_Block_Span, + newText => Changed_Block_Text)); + + -- clearing + Changed_Block_Text.Clear; + Changed_Block_Span := ((0, 0), (0, 0)); + end Add; + + begin + -- prepare LCS + + -- default values for line 0 + for Index in 0 .. Old_Length loop + LCS (Index, 0) := -5 * Index; + end loop; + + -- default values for the first column + for Index in 0 .. New_Length loop + LCS (0, Index) := -5 * Index; + end loop; + + -- calculate LCS + for Row in 1 .. Old_Length loop + for Column in 1 .. New_Length loop + Match := LCS (Row - 1, Column - 1) + + (if Old_Lines (Old_First_Line + Row - 1) = + New_Lines (New_First_Line + Column - 1) + then 10 -- +10 is the 'weight' for equal lines + else -1); -- and -1 for the different + + Delete := LCS (Row - 1, Column) - 5; + Insert := LCS (Row, Column - 1) - 5; + + LCS (Row, Column) := Integer'Max (Match, Insert); + LCS (Row, Column) := Integer'Max (LCS (Row, Column), Delete); + end loop; + end loop; + + -- iterate over LCS and create Text_Edit + + Old_Natural := Natural (Old_First_Line + Old_Length - 1); + + while Old_Index > 0 + and then New_Index > 0 + loop + if LCS (Old_Index, New_Index) = + LCS (Old_Index - 1, New_Index - 1) + + (if Old_Lines (Old_First_Line + Old_Index - 1) = + New_Lines (New_First_Line + New_Index - 1) + then 10 + else -1) + then + -- both has lines + if New_Lines.Element (New_First_Line + New_Index - 1) = + Old_Lines.Element (Old_First_Line + Old_Index - 1) + then + -- lines are equal, add Text_Edit after current line + -- if any is already prepared + Add (Old_Natural); + else + -- lines are different, change old line by new one, + -- we deleted whole line so 'To' position will be + -- the beginning of the next line + Prepare + (Old_Natural, + New_Lines.Element (New_First_Line + New_Index - 1)); + end if; + + -- move lines cursor backward + Old_Natural := Old_Natural - 1; + + New_Index := New_Index - 1; + Old_Index := Old_Index - 1; + + elsif LCS (Old_Index, New_Index) = + LCS (Old_Index - 1, New_Index) - 5 + then + -- line has been deleted, move lines cursor backward + Prepare (Old_Natural, VSS.Strings.Empty_Virtual_String); + + Old_Natural := Old_Natural - 1; + Old_Index := Old_Index - 1; + + elsif LCS (Old_Index, New_Index) = + LCS (Old_Index, New_Index - 1) - 5 + then + -- line has been inserted + -- insert Text_Edit information with insertion after + -- current line, do not move lines cursor because it is + -- additional line not present in the old document + Prepare + (Old_Natural, + New_Lines.Element (New_First_Line + New_Index - 1)); + + New_Index := New_Index - 1; + end if; + end loop; + + while Old_Index > 0 loop + -- deleted + Prepare (Old_Natural, VSS.Strings.Empty_Virtual_String); + + Old_Natural := Old_Natural - 1; + Old_Index := Old_Index - 1; + end loop; + + while New_Index > 0 loop + -- inserted + Prepare + (Old_Natural, + New_Lines.Element (New_First_Line + New_Index - 1)); + + New_Index := New_Index - 1; + end loop; + + Add (Old_Natural); + Free (LCS); + + -- Handle the edge case where the last location of + -- the edit is trying to affect a non existent line. + -- The edits are ordered so we only need to check the last one. + + if not Edit.Is_Empty + and then not Self.Line_To_Marker.Is_Empty + and then Edit.Last_Element.a_range.an_end.line not in + Self.Line_To_Marker.First_Index .. Self.Line_To_Marker.Last_Index + then + declare + use type VSS.Unicode.UTF16_Code_Unit_Offset; + + Element : LSP.Structures.TextEdit := Edit.Last_Element; + Last_Line : constant VSS.Strings.Virtual_String := + Old_Lines (Old_Lines.Length); + Iterator : + constant VSS.Strings.Character_Iterators.Character_Iterator := + Last_Line.At_Last_Character; + + begin + -- Replace the wrong location by the end of the buffer + Element.a_range.an_end := + (line => Natural (Old_Lines.Length) - 1, + character => Natural (Iterator.Last_UTF16_Offset) + 1); + Edit.Replace_Element (Edit.Last, Element); + end; + end if; + + exception + when others => + Free (LCS); + raise; + end; end Diff; ------------------ @@ -85,14 +474,319 @@ package body LSP.Ada_Documents is ------------------ procedure Diff_Symbols - (Self : Document; Span : LSP.Structures.A_Range; - New_Text : VSS.Strings.Virtual_String; + (Self : Document; + Span : LSP.Structures.A_Range; + New_Text : VSS.Strings.Virtual_String; Edit : in out LSP.Structures.TextEdit_Vector) is + use VSS.Strings; + use VSS.Characters; + + Old_Text : VSS.Strings.Virtual_String; + Old_Lines : VSS.String_Vectors.Virtual_String_Vector; + Old_Line : VSS.Strings.Virtual_String; + Old_Length, New_Length : Natural; + + First_Marker : VSS.Strings.Markers.Character_Marker; + Last_Marker : VSS.Strings.Markers.Character_Marker; + begin - pragma Compile_Time_Warning - (Standard.True, "Diff_Symbols unimplemented"); - raise Program_Error with "Unimplemented procedure Diff_Symbols"; + Self.Span_To_Markers (Span, First_Marker, Last_Marker); + + Old_Text := Self.Text.Slice (First_Marker, Last_Marker); + Old_Lines := Old_Text.Split_Lines + (Terminators => LSP_New_Line_Function_Set, + Keep_Terminator => True); + Old_Line := Old_Lines.Element (Old_Lines.Length); + + Old_Length := Integer (Character_Length (Old_Text)); + New_Length := Integer (Character_Length (New_Text)); + + declare + type LCS_Array is array + (Natural range 0 .. Old_Length, + Natural range 0 .. New_Length) of Integer; + type LCS_Array_Access is access all LCS_Array; + + procedure Free is + new Ada.Unchecked_Deallocation (LCS_Array, LCS_Array_Access); + + LCS : LCS_Array_Access := new LCS_Array; + Match : Integer; + Delete : Integer; + Insert : Integer; + + Old_Char : VSS.Strings.Character_Iterators.Character_Iterator := + Old_Text.At_First_Character; + + New_Char : VSS.Strings.Character_Iterators.Character_Iterator := + New_Text.At_First_Character; + + Dummy : Boolean; + + Old_Index, New_Index : Integer; + + Changed_Block_Text : VSS.Strings.Virtual_String; + Changed_Block_Span : LSP.Structures.A_Range := ((0, 0), (0, 0)); + Span_Set : Boolean := False; + + -- to calculate span + Current_Natural : Natural := + (if Natural (Span.an_end.character) = 0 + then Span.an_end.line - 1 + else Span.an_end.line); + -- we do not have a line at all when the range end is on the + -- begin of a line, so set Current_Natural to the previous one + Old_Lines_Number : Natural := Old_Lines.Length; + + Cursor : VSS.Strings.Character_Iterators.Character_Iterator := + Old_Line.After_Last_Character; + + procedure Backward; + -- Move old line Cursor backward, update Old_Line and + -- Old_Lines_Number if needed + + function Get_Position + (Insert : Boolean) return LSP.Structures.Position; + -- get Position for a Span based on Cursor to prepare first/last + -- position for changes + + procedure Prepare_Last_Span (Insert : Boolean); + -- Store position based on Cursor to Changed_Block_Span.an_end if + -- it is not stored yet + + procedure Prepare_Change + (Insert : Boolean; + Char : VSS.Characters.Virtual_Character); + -- Collect change information for Text_Edit in Changed_Block_Text + -- and Changed_Block_Span + + procedure Add_Prepared_Change; + -- Add prepared New_String and corresponding Span into Text_Edit + + -------------- + -- Backward -- + -------------- + + procedure Backward is + begin + if not Cursor.Backward + and then Old_Lines_Number > 1 + then + Current_Natural := Current_Natural - 1; + Old_Lines_Number := Old_Lines_Number - 1; + Old_Line := Old_Lines.Element (Old_Lines_Number); + Cursor.Set_At_Last (Old_Line); + end if; + + Old_Index := Old_Index - 1; + Dummy := Old_Char.Backward; + end Backward; + + ------------------ + -- Get_Position -- + ------------------ + + function Get_Position + (Insert : Boolean) return LSP.Structures.Position + is + -------------- + -- Backward -- + -------------- + + function Backward return LSP.Structures.Position; + + function Backward return LSP.Structures.Position is + C : VSS.Strings.Character_Iterators.Character_Iterator := + Old_Line.At_Character (Cursor); + begin + -- "Cursor" is after the current character but we should + -- insert before it + if C.Backward then + return + (line => Current_Natural, + character => Natural (C.First_UTF16_Offset)); + else + return + (line => Current_Natural, + character => 0); + end if; + end Backward; + + begin + if not Cursor.Has_Element then + return + (line => Current_Natural, + character => 0); + + elsif Insert then + -- "Cursor" is after the current character but we should + -- insert before it + return Backward; + + else + return + (line => Current_Natural, + character => Natural (Cursor.First_UTF16_Offset)); + end if; + end Get_Position; + + ----------------------- + -- Prepare_Last_Span -- + ----------------------- + + procedure Prepare_Last_Span (Insert : Boolean) is + begin + if not Span_Set then + -- it is the first portion of a changed block so store + -- last position of the changes + Span_Set := True; + Changed_Block_Span.an_end := Get_Position (Insert); + end if; + end Prepare_Last_Span; + + -------------------- + -- Prepare_Change -- + -------------------- + + procedure Prepare_Change + (Insert : Boolean; + Char : VSS.Characters.Virtual_Character) is + begin + Prepare_Last_Span (Insert); + -- accumulating new text for the changed block + Changed_Block_Text.Prepend (Char); + end Prepare_Change; + + ------------------------- + -- Add_Prepared_Change -- + ------------------------- + + procedure Add_Prepared_Change is + begin + if not Span_Set then + -- No information for Text_Edit + return; + end if; + + Changed_Block_Span.start := Get_Position (False); + + Edit.Prepend + (LSP.Structures.TextEdit' + (a_range => Changed_Block_Span, + newText => Changed_Block_Text)); + + -- clearing + Changed_Block_Text.Clear; + + Changed_Block_Span := ((0, 0), (0, 0)); + Span_Set := False; + end Add_Prepared_Change; + + begin + -- prepare LCS + + -- default values for line 0 + for Index in 0 .. Old_Length loop + LCS (Index, 0) := -5 * Index; + end loop; + + -- default values for the first column + for Index in 0 .. New_Length loop + LCS (0, Index) := -5 * Index; + end loop; + + -- calculate LCS + for Row in 1 .. Old_Length loop + New_Char.Set_At_First (New_Text); + for Column in 1 .. New_Length loop + Match := LCS (Row - 1, Column - 1) + + (if Old_Char.Element = New_Char.Element + then 10 -- +10 is the 'weight' for equal lines + else -1); -- and -1 for the different + + Delete := LCS (Row - 1, Column) - 5; + Insert := LCS (Row, Column - 1) - 5; + + LCS (Row, Column) := Integer'Max (Match, Insert); + LCS (Row, Column) := Integer'Max (LCS (Row, Column), Delete); + + Dummy := New_Char.Forward; + end loop; + Dummy := Old_Char.Forward; + end loop; + + -- iterate over LCS and create Text_Edit + + Old_Char.Set_At_Last (Old_Text); + New_Char.Set_At_Last (New_Text); + Old_Index := Old_Length; + New_Index := New_Length; + + while Old_Index > 0 + and then New_Index > 0 + loop + if LCS (Old_Index, New_Index) = + LCS (Old_Index - 1, New_Index - 1) + + (if Old_Char.Element = New_Char.Element + then 10 + else -1) + then + -- both has elements + if Old_Char.Element = New_Char.Element then + -- elements are equal, add prepared Text_Edit + Add_Prepared_Change; + else + -- elements are different, change old one by new + Prepare_Change (False, New_Char.Element); + end if; + + -- move old element cursors backward + Backward; + + New_Index := New_Index - 1; + Dummy := New_Char.Backward; + + elsif LCS (Old_Index, New_Index) = + LCS (Old_Index - 1, New_Index) - 5 + then + -- element has been deleted, move old cursor backward + Prepare_Last_Span (False); + Backward; + + elsif LCS (Old_Index, New_Index) = + LCS (Old_Index, New_Index - 1) - 5 + then + -- element has been inserted + Prepare_Change (True, New_Char.Element); + + New_Index := New_Index - 1; + Dummy := New_Char.Backward; + end if; + end loop; + + while Old_Index > 0 loop + -- deleted + Prepare_Last_Span (False); + Backward; + end loop; + + while New_Index > 0 loop + -- inserted + Prepare_Change (True, New_Char.Element); + + New_Index := New_Index - 1; + Dummy := New_Char.Backward; + end loop; + + Add_Prepared_Change; + Free (LCS); + + exception + when others => + Free (LCS); + raise; + end; end Diff_Symbols; ------------------------- @@ -106,10 +800,14 @@ package body LSP.Ada_Documents is (Base_Id : Libadalang.Analysis.Base_Id; Kind : Libadalang.Common.Ref_Result_Kind; Cancel : in out Boolean)) is + Units : constant Libadalang.Analysis.Analysis_Unit_Array := + (1 => LSP.Ada_Documents.Unit (Self => Self, + Context => Context)); begin - pragma Compile_Time_Warning - (Standard.True, "Find_All_References unimplemented"); - raise Program_Error with "Unimplemented procedure Find_All_References"; + LSP.Ada_Id_Iterators.Find_All_References (Definition, Units, Callback); + exception + when E : Libadalang.Common.Property_Error => + Self.Tracer.Trace_Exception (E, "in Find_All_References"); end Find_All_References; ---------------- @@ -132,16 +830,183 @@ package body LSP.Ada_Documents is -------------------- procedure Get_Any_Symbol - (Self : in out Document; Context : LSP.Ada_Contexts.Context; - Pattern : LSP.Search.Search_Pattern'Class; - Limit : Ada.Containers.Count_Type; Only_Public : Boolean; - Canceled : access function return Boolean; - Result : in out LSP.Ada_Completions.Completion_Maps.Map) + (Self : in out Document; Context : LSP.Ada_Contexts.Context; + Pattern : LSP.Search.Search_Pattern'Class; + Limit : Ada.Containers.Count_Type; + Only_Public : Boolean; + Canceled : access function return Boolean; + Result : in out LSP.Ada_Completions.Completion_Maps.Map) is + -- use type LSP.Messages.Search_Kind; + + procedure Refresh_Symbol_Cache; + -- Find intresting definings names in the document and put them + -- into Self.Symbol_Cache + + procedure Insert + (Item : Name_Information; + Name : Libadalang.Analysis.Defining_Name); + -- Populate Result with the name information if Result doesn't have + -- the Name already + + function Get_Defining_Name + (Loc : Langkit_Support.Slocs.Source_Location) + return Libadalang.Analysis.Defining_Name; + + ----------------------- + -- Get_Defining_Name -- + ----------------------- + + function Get_Defining_Name + (Loc : Langkit_Support.Slocs.Source_Location) + return Libadalang.Analysis.Defining_Name + is + Unit : constant Libadalang.Analysis.Analysis_Unit := + Self.Unit (Context); + + Name : constant Libadalang.Analysis.Name := + Laltools.Common.Get_Node_As_Name (Unit.Root.Lookup (Loc)); + begin + return Laltools.Common.Get_Name_As_Defining (Name); + end Get_Defining_Name; + + ------------ + -- Insert -- + ------------ + + procedure Insert + (Item : Name_Information; + Name : Libadalang.Analysis.Defining_Name) is + begin + if not Result.Contains (Name) and then + (not Only_Public or else Item.Is_Public) + then + Result.Insert + (Name, + (Is_Dot_Call => False, + Is_Visible => False, + Use_Snippets => False, + Pos => <>, + Weight => <>)); + end if; + end Insert; + + -------------------------- + -- Refresh_Symbol_Cache -- + -------------------------- + + procedure Refresh_Symbol_Cache is + use Langkit_Support.Symbols; + use Libadalang.Common; + use Libadalang.Iterators; + + Node : Libadalang.Analysis.Ada_Node; + + Global_Visible : constant Libadalang.Iterators.Ada_Node_Predicate := + LSP.Predicates.Is_Global_Visible; + + Restricted_Kind : constant Libadalang.Iterators.Ada_Node_Predicate := + LSP.Predicates.Is_Restricted_Kind; + + -- Find all definings names excluding private parts and bodies + It : Libadalang.Iterators.Traverse_Iterator'Class := + Libadalang.Iterators.Find + (Self.Unit (Context).Root, + Libadalang.Iterators.Kind_Is (Ada_Defining_Name) + and not Restricted_Kind); + + begin + while It.Next (Node) loop + declare + Token : constant Token_Reference := Node.Token_End; + Text : constant Langkit_Support.Text.Text_Type := + Libadalang.Common.Text (Token); + Canonical : constant Symbolization_Result := + Libadalang.Sources.Canonicalize (Text); + Cursor : Symbol_Maps.Cursor; + Inserted : Boolean; + + begin + if Canonical.Success then + Self.Symbol_Cache.Insert + (VSS.Strings.To_Virtual_String (Canonical.Symbol), + Name_Vectors.Empty_Vector, + Cursor, + Inserted); + + Self.Symbol_Cache (Cursor).Append + (Name_Information' + (Langkit_Support.Slocs.Start_Sloc (Node.Sloc_Range), + Global_Visible.Unchecked_Get.Evaluate (Node))); + end if; + end; + end loop; + end Refresh_Symbol_Cache; + + Cursor : Symbol_Maps.Cursor; + + use type LSP.Search.Search_Kind; + + -- In "Celling" mode we scan only range of cache where a key prefix + -- matches lowercased pattern as is. + Use_Celling : constant Boolean := + not Pattern.Get_Negate + and then ((Pattern.Get_Kind = LSP.Search.Full_Text + and then Pattern.Get_Whole_Word) + or else Pattern.Get_Kind = LSP.Search.Start_Word_Text); + begin - pragma Compile_Time_Warning - (Standard.True, "Get_Any_Symbol unimplemented"); - raise Program_Error with "Unimplemented procedure Get_Any_Symbol"; + if Self.Refresh_Symbol_Cache then + Refresh_Symbol_Cache; + Self.Refresh_Symbol_Cache := False; + end if; + + if Use_Celling then + Cursor := Self.Symbol_Cache.Ceiling (Pattern.Get_Canonical_Pattern); + else + Cursor := Self.Symbol_Cache.First; + end if; + + while Symbol_Maps.Has_Element (Cursor) loop + + if Use_Celling + and then not Pattern.Match (Symbol_Maps.Key (Cursor)) + then + -- We use "Celling mode" and key stops matching, + -- Symbol_Cache is ordered so we will not find any + -- matches more + + exit when Use_Celling or else Canceled.all; + + else + + for Item of Self.Symbol_Cache (Cursor) loop + declare + Defining_Name : constant Libadalang.Analysis.Defining_Name := + Get_Defining_Name (Item.Loc); + begin + -- Match each element individually in case of sensitive + -- search or non-celling mode + if not Defining_Name.Is_Null + and then + ((Use_Celling + and then not Pattern.Get_Case_Sensitive) + or else Pattern.Match + (VSS.Strings.To_Virtual_String + (Defining_Name.As_Ada_Node.Text))) + then + Insert (Item, Defining_Name); + end if; + + exit when Canceled.all; + + end; + end loop; + + end if; + + Symbol_Maps.Next (Cursor); + end loop; end Get_Any_Symbol; ------------------------- @@ -149,16 +1014,73 @@ package body LSP.Ada_Documents is ------------------------- procedure Get_Completion_Node - (Self : Document; Context : LSP.Ada_Contexts.Context; - Position : LSP.Structures.Position; + (Self : Document; + Context : LSP.Ada_Contexts.Context; + Position : LSP.Structures.Position; Sloc : out Langkit_Support.Slocs.Source_Location; Token : out Libadalang.Common.Token_Reference; Node : out Libadalang.Analysis.Ada_Node) is + use Libadalang.Common; + + function Completion_Token + (Sloc : Langkit_Support.Slocs.Source_Location) + return Libadalang.Common.Token_Reference; + -- Get token under completion for given cursor position. + -- If cursor at the first symbol of a token return previous token: + -- XXX___ + -- ^ cursor just after a token mean user is completion XXX token. + + ---------------------- + -- Completion_Token -- + ---------------------- + + function Completion_Token + (Sloc : Langkit_Support.Slocs.Source_Location) + return Libadalang.Common.Token_Reference + is + use type Langkit_Support.Slocs.Source_Location; + + Token : constant Libadalang.Common.Token_Reference := + Self.Get_Token_At (Context, Position); + + Prev : constant Libadalang.Common.Token_Reference := + (if Token = Libadalang.Common.No_Token + then Token + else Libadalang.Common.Previous (Token)); + + begin + if Libadalang.Common.No_Token not in Token | Prev then + declare + Data : constant Libadalang.Common.Token_Data_Type := + Libadalang.Common.Data (Token); + + Start : constant Langkit_Support.Slocs.Source_Location := + Langkit_Support.Slocs.Start_Sloc + (Libadalang.Common.Sloc_Range (Data)); + begin + if Start = Sloc then + return Prev; + end if; + end; + end if; + + return Token; + end Completion_Token; begin - pragma Compile_Time_Warning - (Standard.True, "Get_Completion_Node unimplemented"); - raise Program_Error with "Unimplemented procedure Get_Completion_Node"; + Sloc := Self.Get_Source_Location (Position); + Token := Completion_Token (Sloc); + declare + From : constant Langkit_Support.Slocs.Source_Location := + Langkit_Support.Slocs.Start_Sloc + (Libadalang.Common.Sloc_Range + (Libadalang.Common.Data (Token))); + + Root : constant Libadalang.Analysis.Ada_Node := + Self.Unit (Context).Root; + begin + Node := (if Root.Is_Null then Root else Root.Lookup (From)); + end; end Get_Completion_Node; ------------------------ @@ -166,19 +1088,57 @@ package body LSP.Ada_Documents is ------------------------ procedure Get_Completions_At - (Self : Document; - Providers : LSP.Ada_Completions.Completion_Provider_List; - Context : LSP.Ada_Contexts.Context; - Sloc : Langkit_Support.Slocs.Source_Location; - Token : Libadalang.Common.Token_Reference; - Node : Libadalang.Analysis.Ada_Node; + (Self : Document; + Providers : LSP.Ada_Completions.Completion_Provider_List; + Context : LSP.Ada_Contexts.Context; + Sloc : Langkit_Support.Slocs.Source_Location; + Token : Libadalang.Common.Token_Reference; + Node : Libadalang.Analysis.Ada_Node; Names : out Ada_Completions.Completion_Maps.Map; Result : out LSP.Structures.CompletionList) is + Parent : constant Libadalang.Analysis.Ada_Node := + (if Node.Is_Null then Node else Node.Parent); + + Filter : LSP.Ada_Completions.Filters.Filter; begin - pragma Compile_Time_Warning - (Standard.True, "Get_Completions_At unimplemented"); - raise Program_Error with "Unimplemented procedure Get_Completions_At"; + if not Parent.Is_Null + and then (Parent.Kind not in + Libadalang.Common.Ada_Dotted_Name | Libadalang.Common.Ada_End_Name + and then Node.Kind in Libadalang.Common.Ada_String_Literal_Range) + then + -- Do nothing when inside a string + return; + end if; + + Self.Tracer.Trace + ("Getting completions, Pos = (" + & Sloc.Line'Image & ", " & Sloc.Column'Image & ") Node = " + & Libadalang.Analysis.Image (Node)); + + Filter.Initialize (Token, Node); + + for Provider of Providers loop + begin + Provider.Propose_Completion + (Sloc => Sloc, + Token => Token, + Node => Node, + Filter => Filter, + Names => Names, + Result => Result); + + exception + when E : Libadalang.Common.Property_Error => + Self.Tracer.Trace_Exception + (E, + "LAL EXCEPTION occurred with following completion provider"); + Self.Tracer.Trace (Ada.Tags.Expanded_Name (Provider'Tag)); + end; + end loop; + + Self.Tracer.Trace + ("Number of filtered completions : " & Names.Length'Image); end Get_Completions_At; ---------------- @@ -186,13 +1146,22 @@ package body LSP.Ada_Documents is ---------------- procedure Get_Errors - (Self : in out Document; Context : LSP.Ada_Contexts.Context; - Changed : out Boolean; Errors : out LSP.Structures.Diagnostic_Vector; - Force : Boolean := False) + (Self : in out Document; + Context : LSP.Ada_Contexts.Context; + Changed : out Boolean; + Errors : out LSP.Structures.Diagnostic_Vector; + Force : Boolean := False) is begin - pragma Compile_Time_Warning (Standard.True, "Get_Errors unimplemented"); - raise Program_Error with "Unimplemented procedure Get_Errors"; + Errors.Clear; + Changed := (for some Source of Self.Diagnostic_Sources => + Source.Has_New_Diagnostic (Context)); + + if Changed or else Force then + for Source of Self.Diagnostic_Sources loop + Source.Get_Diagnostic (Context, Errors); + end loop; + end if; end Get_Errors; ------------------------ @@ -200,15 +1169,244 @@ package body LSP.Ada_Documents is ------------------------ procedure Get_Folding_Blocks - (Self : Document; Context : LSP.Ada_Contexts.Context; - Lines_Only : Boolean; Comments : Boolean; - Canceled : access function return Boolean; + (Self : Document; + Context : LSP.Ada_Contexts.Context; + Lines_Only : Boolean; + Comments : Boolean; + Canceled : access function return Boolean; Result : out LSP.Structures.FoldingRange_Vector) is + use Libadalang.Common; + use Libadalang.Analysis; + + Location : LSP.Structures.Location; + foldingRange : LSP.Structures.FoldingRange; + Have_With : Boolean := False; + + function Parse (Node : Ada_Node'Class) return Visit_Status; + -- Includes Node location to the result if the node has "proper" kind + + procedure Store_Span (Span : LSP.Structures.A_Range); + -- Include Span to the result . + + ----------- + -- Parse -- + ----------- + + function Parse (Node : Ada_Node'Class) return Visit_Status + is + + procedure Store_With_Block; + -- Store folding for with/use clauses as one folding block + + ---------------------- + -- Store_With_Block -- + ---------------------- + + procedure Store_With_Block is + begin + if not Have_With then + return; + end if; + + if foldingRange.startLine /= foldingRange.endLine then + Result.Append (foldingRange); + end if; + + Have_With := False; + end Store_With_Block; + + Result : Visit_Status := Into; + begin + if Canceled.all then + return Stop; + end if; + +-- Cat_Namespace, +-- Cat_Constructor, +-- Cat_Destructor, +-- Cat_Structure, +-- Cat_Case_Inside_Record, +-- Cat_Union, +-- Cat_Custom + + case Node.Kind is + when Ada_Package_Decl | + Ada_Generic_Formal_Package | + Ada_Package_Body | +-- Cat_Package + + Ada_Type_Decl | + + Ada_Classwide_Type_Decl | +-- Cat_Class + + Ada_Protected_Type_Decl | +-- Cat_Protected + + Ada_Task_Type_Decl | + Ada_Single_Task_Type_Decl | +-- Cat_Task + + Ada_Subp_Decl | + Ada_Subp_Body | + Ada_Generic_Formal_Subp_Decl | + Ada_Abstract_Subp_Decl | + Ada_Abstract_Formal_Subp_Decl | + Ada_Concrete_Formal_Subp_Decl | + Ada_Generic_Subp_Internal | + Ada_Null_Subp_Decl | + Ada_Subp_Renaming_Decl | + Ada_Subp_Body_Stub | + Ada_Generic_Subp_Decl | + Ada_Generic_Subp_Instantiation | + Ada_Generic_Subp_Renaming_Decl | + Ada_Subp_Kind_Function | + Ada_Subp_Kind_Procedure | + Ada_Access_To_Subp_Def | +-- Cat_Procedure +-- Cat_Function +-- Cat_Method + + Ada_Case_Stmt | +-- Cat_Case_Statement + + Ada_If_Stmt | +-- Cat_If_Statement + + Ada_For_Loop_Stmt | + Ada_While_Loop_Stmt | +-- Cat_Loop_Statement + + Ada_Begin_Block | + Ada_Decl_Block | +-- Cat_Declare_Block +-- Cat_Simple_Block + +-- Ada_Return_Stmt | +-- Ada_Extended_Return_Stmt | + Ada_Extended_Return_Stmt_Object_Decl | +-- Cat_Return_Block + + Ada_Select_Stmt | +-- Cat_Select_Statement + + Ada_Entry_Body | +-- Cat_Entry + + Ada_Exception_Handler | +-- Cat_Exception_Handler + + Ada_Pragma_Node_List | + Ada_Pragma_Argument_Assoc | + Ada_Pragma_Node | +-- Cat_Pragma + + Ada_Aspect_Spec => +-- Cat_Aspect + + Store_With_Block; + + foldingRange.kind := + (Is_Set => True, Value => LSP.Enumerations.Region); + + Location := Self.To_LSP_Location (Node.Sloc_Range); + Store_Span (Location.a_range); + + when Ada_With_Clause | + Ada_Use_Package_Clause | + Ada_Use_Type_Clause => + + Location := Self.To_LSP_Location (Node.Sloc_Range); + + if not Have_With then + Have_With := True; + + foldingRange.kind := + (Is_Set => True, Value => LSP.Enumerations.Imports); + + foldingRange.startLine := Location.a_range.start.line; + end if; + + foldingRange.endLine := Location.a_range.an_end.line; + + -- Do not step into with/use clause + Result := Over; + + when others => + Store_With_Block; + end case; + + return Result; + end Parse; + + ---------------- + -- Store_Span -- + ---------------- + + procedure Store_Span (Span : LSP.Structures.A_Range) is + begin + if not Lines_Only + or else Span.start.line /= Span.an_end.line + then + foldingRange.startLine := Span.start.line; + foldingRange.endLine := Span.an_end.line; + + if not Lines_Only then + foldingRange.startCharacter := + (Is_Set => True, + Value => Span.start.character); + + foldingRange.startCharacter := + (Is_Set => True, + Value => Span.an_end.character); + end if; + + Result.Append (foldingRange); + end if; + end Store_Span; + + Token : Token_Reference; + Span : LSP.Structures.A_Range; + begin - pragma Compile_Time_Warning - (Standard.True, "Get_Folding_Blocks unimplemented"); - raise Program_Error with "Unimplemented procedure Get_Folding_Blocks"; + Traverse (Self.Unit (Context).Root, Parse'Access); + + if not Comments then + -- do not process comments + return; + end if; + + -- Looking for comments + foldingRange.kind := (Is_Set => False); + Token := First_Token (Self.Unit (Context)); + + while Token /= No_Token + and then not Canceled.all + loop + case Kind (Data (Token)) is + when Ada_Comment => + if not foldingRange.kind.Is_Set then + foldingRange.kind := + (Is_Set => True, Value => LSP.Enumerations.Comment); + Span := Self.To_LSP_Range (Sloc_Range (Data (Token))); + else + Span.an_end := + Self.To_LSP_Range (Sloc_Range (Data (Token))).an_end; + end if; + + when Ada_Whitespace => + null; + + when others => + if foldingRange.kind.Is_Set then + Store_Span (Span); + foldingRange.kind := (Is_Set => False); + end if; + end case; + + Token := Next (Token); + end loop; end Get_Folding_Blocks; --------------------------- @@ -216,43 +1414,44 @@ package body LSP.Ada_Documents is --------------------------- function Get_Formatting_Region - (Self : Document; Context : LSP.Ada_Contexts.Context; + (Self : Document; + Context : LSP.Ada_Contexts.Context; Position : LSP.Structures.Position) return Laltools.Partial_GNATPP.Formatting_Region_Type - is - begin - pragma Compile_Time_Warning - (Standard.True, "Get_Formatting_Region unimplemented"); - return - raise Program_Error - with "Unimplemented function Get_Formatting_Region"; - end Get_Formatting_Region; + is (Laltools.Partial_GNATPP.Get_Formatting_Region + (Unit => Self.Unit (Context), + Input_Range => + Langkit_Support.Slocs.Make_Range + (Self.Get_Source_Location (Position), + Self.Get_Source_Location (Position)))); --------------------- -- Get_Indentation -- --------------------- function Get_Indentation - (Self : Document; Context : LSP.Ada_Contexts.Context; Line : Positive) + (Self : Document; + Context : LSP.Ada_Contexts.Context; + Line : Positive) return Natural is - begin - pragma Compile_Time_Warning - (Standard.True, "Get_Indentation unimplemented"); - return raise Program_Error with "Unimplemented function Get_Indentation"; - end Get_Indentation; + (Laltools.Partial_GNATPP.Estimate_Indentation + (Self.Unit (Context), + Self.Get_Source_Location ((Line, 1)).Line)); ----------------- -- Get_Node_At -- ----------------- function Get_Node_At - (Self : Document; Context : LSP.Ada_Contexts.Context; + (Self : Document; + Context : LSP.Ada_Contexts.Context; Position : LSP.Structures.Position) return Libadalang.Analysis.Ada_Node is + Unit : constant Libadalang.Analysis.Analysis_Unit := Self.Unit (Context); begin - pragma Compile_Time_Warning (Standard.True, "Get_Node_At unimplemented"); - return raise Program_Error with "Unimplemented function Get_Node_At"; + return (if Unit.Root.Is_Null then Libadalang.Analysis.No_Ada_Node + else Unit.Root.Lookup (Self.Get_Source_Location (Position))); end Get_Node_At; ------------------------- @@ -263,11 +1462,28 @@ package body LSP.Ada_Documents is (Self : Document'Class; Position : LSP.Structures.Position) return Langkit_Support.Slocs.Source_Location is + use type VSS.Unicode.UTF16_Code_Unit_Offset; + use type VSS.Strings.Character_Index; + + Iterator : VSS.Strings.Character_Iterators.Character_Iterator := + Self.Text.At_Character (Self.Line_To_Marker (Position.line)); + + Line_Offset : constant VSS.Unicode.UTF16_Code_Unit_Offset := + Iterator.First_UTF16_Offset; + + Line_First_Character : constant VSS.Strings.Character_Index := + Iterator.Character_Index; begin - pragma Compile_Time_Warning - (Standard.True, "Get_Source_Location unimplemented"); - return - raise Program_Error with "Unimplemented function Get_Source_Location"; + while Integer (Iterator.First_UTF16_Offset - Line_Offset) + <= Position.character + and then Iterator.Forward + loop + null; + end loop; + + return ((Line => Langkit_Support.Slocs.Line_Number (Position.line + 1), + Column => Langkit_Support.Slocs.Column_Number + (Iterator.Character_Index - Line_First_Character))); end Get_Source_Location; -------------------------- @@ -309,9 +1525,14 @@ package body LSP.Ada_Documents is (Self : Document; Start_Pos : LSP.Structures.Position; End_Pos : LSP.Structures.Position) return VSS.Strings.Virtual_String is + First_Marker : VSS.Strings.Markers.Character_Marker; + Last_Marker : VSS.Strings.Markers.Character_Marker; + begin - pragma Compile_Time_Warning (Standard.True, "Get_Text_At unimplemented"); - return raise Program_Error with "Unimplemented function Get_Text_At"; + Self.Span_To_Markers + ((Start_Pos, End_Pos), First_Marker, Last_Marker); + + return Self.Text.Slice (First_Marker, Last_Marker); end Get_Text_At; ------------------ @@ -323,11 +1544,7 @@ package body LSP.Ada_Documents is Position : LSP.Structures.Position) return Libadalang.Common.Token_Reference is - begin - pragma Compile_Time_Warning - (Standard.True, "Get_Token_At unimplemented"); - return raise Program_Error with "Unimplemented function Get_Token_At"; - end Get_Token_At; + (Self.Unit (Context).Lookup_Token (Self.Get_Source_Location (Position))); ---------------- -- Get_Tokens -- @@ -339,22 +1556,57 @@ package body LSP.Ada_Documents is Span : LSP.Structures.A_Range := ((1, 1), (0, 0))) return LSP.Structures.Natural_Vector is - begin - pragma Compile_Time_Warning (Standard.True, "Get_Tokens unimplemented"); - return raise Program_Error with "Unimplemented function Get_Tokens"; - end Get_Tokens; + (Highlighter.Get_Tokens (Self.Unit (Context), Context.Tracer.all, Span)); ----------------- -- Get_Word_At -- ----------------- function Get_Word_At - (Self : Document; Context : LSP.Ada_Contexts.Context; + (Self : Document; + Context : LSP.Ada_Contexts.Context; Position : LSP.Structures.Position) return VSS.Strings.Virtual_String is + use Langkit_Support.Slocs; + use all type Libadalang.Common.Token_Kind; + + Result : VSS.Strings.Virtual_String; + + Unit : constant Libadalang.Analysis.Analysis_Unit := + Self.Unit (Context); + + Origin : constant Source_Location := Self.Get_Source_Location (Position); + Where : constant Source_Location := (Origin.Line, Origin.Column - 1); + -- Compute the position we want for completion, which is one character + -- before the cursor. + + Token : constant Libadalang.Common.Token_Reference := + Unit.Lookup_Token (Where); + + Data : constant Libadalang.Common.Token_Data_Type := + Libadalang.Common.Data (Token); + + Kind : constant Libadalang.Common.Token_Kind := + Libadalang.Common.Kind (Data); + + Text : constant Langkit_Support.Text.Text_Type := + Libadalang.Common.Text (Token); + + Sloc : constant Source_Location_Range := + Libadalang.Common.Sloc_Range (Data); + + Span : constant Integer := + Natural (Where.Column) - Natural (Sloc.Start_Column); + begin - pragma Compile_Time_Warning (Standard.True, "Get_Word_At unimplemented"); - return raise Program_Error with "Unimplemented function Get_Word_At"; + if Kind in Ada_Identifier .. Ada_Xor + and then Compare (Sloc, Where) = Inside + then + Result := VSS.Strings.To_Virtual_String + (Text (Text'First .. Text'First + Span)); + end if; + + return Result; end Get_Word_At; --------------------- @@ -364,24 +1616,28 @@ package body LSP.Ada_Documents is function Has_Diagnostics (Self : Document; Context : LSP.Ada_Contexts.Context) return Boolean is - begin - pragma Compile_Time_Warning - (Standard.True, "Has_Diagnostics unimplemented"); - return raise Program_Error with "Unimplemented function Has_Diagnostics"; - end Has_Diagnostics; + (Self.Unit (Context).Has_Diagnostics); ---------------- -- Initialize -- ---------------- procedure Initialize - (Self : in out Document; URI : LSP.Structures.DocumentUri; - Text : VSS.Strings.Virtual_String; - Diagnostic : LSP.Diagnostic_Sources.Diagnostic_Source_Access) + (Self : in out Document; + URI : LSP.Structures.DocumentUri; + Text : VSS.Strings.Virtual_String; + Diagnostic : LSP.Diagnostic_Sources.Diagnostic_Source_Access) is begin - pragma Compile_Time_Warning (Standard.True, "Initialize unimplemented"); - raise Program_Error with "Unimplemented procedure Initialize"; + Self.URI := URI; + Self.Version := 1; + Self.Text := Text; + Self.Refresh_Symbol_Cache := True; + Self.Diagnostic_Sources (1) := new + LSP.Ada_Documents.LAL_Diagnostics.Diagnostic_Source + (Self'Unchecked_Access); + Self.Diagnostic_Sources (2) := Diagnostic; + Recompute_Indexes (Self); end Initialize; --------------------- @@ -391,38 +1647,221 @@ package body LSP.Ada_Documents is function Line_Terminator (Self : Document'Class) return VSS.Strings.Virtual_String is - begin - pragma Compile_Time_Warning - (Standard.True, "Line_Terminator unimplemented"); - return raise Program_Error with "Unimplemented function Line_Terminator"; - end Line_Terminator; + (if Self.Line_Terminator.Is_Empty then + -- Document has no line terminator yet, return LF as most used + -- + -- Should it be platform specific? CRLF for Windows, CR for Mac? + + VSS.Strings.To_Virtual_String + ((1 => Ada.Characters.Wide_Wide_Latin_1.LF)) + + else + Self.Line_Terminator); ---------------------- -- Range_Formatting -- ---------------------- function Range_Formatting - (Self : Document; Context : LSP.Ada_Contexts.Context; - Span : LSP.Structures.A_Range; PP_Options : Pp.Command_Lines.Cmd_Line; - Edit : out LSP.Structures.TextEdit_Vector; - Messages : out VSS.String_Vectors.Virtual_String_Vector) return Boolean + (Self : Document; + Context : LSP.Ada_Contexts.Context; + Span : LSP.Structures.A_Range; + PP_Options : Pp.Command_Lines.Cmd_Line; + Edit : out LSP.Structures.TextEdit_Vector; + Messages : out VSS.String_Vectors.Virtual_String_Vector) return Boolean is + use Libadalang.Analysis; + use Langkit_Support.Slocs; + use Laltools.Partial_GNATPP; + use LSP.Structures; + use Utils.Char_Vectors; + use Utils.Char_Vectors.Char_Vectors; + + procedure Append_PP_Messages + (PP_Messages : Pp.Scanner.Source_Message_Vector); + -- Append any message of PP_Messages to Messages properly formatting + -- them using the GNAT standard way for messages + -- (i.e: :: ) + + ------------------------ + -- Append_PP_Messages -- + ------------------------ + + procedure Append_PP_Messages + (PP_Messages : Pp.Scanner.Source_Message_Vector) is + begin + for Message of PP_Messages loop + declare + Error : LSP.Structures.DocumentUri := Self.URI; + begin + Error.Append (":"); + Error.Append + (VSS.Strings.Conversions.To_Virtual_String + (Pp.Scanner.Sloc_Image (Message.Sloc))); + Error.Append (": "); + Error.Append + (VSS.Strings.Conversions.To_Virtual_String + (String (To_Array (Message.Text)))); + Messages.Append (Error); + end; + end loop; + end Append_PP_Messages; + begin - pragma Compile_Time_Warning - (Standard.True, "Range_Formatting unimplemented"); - return - raise Program_Error with "Unimplemented function Range_Formatting"; + Self.Tracer.Trace ("On Range_Formatting"); + + Self.Tracer.Trace ("Format_Selection"); + declare + Unit : constant Analysis_Unit := + Self.Unit (Context); + Input_Selection_Range : constant Source_Location_Range := + (if Span = Empty_Range then No_Source_Location_Range + else Make_Range + (Self.Get_Source_Location (Span.start), + Self.Get_Source_Location (Span.an_end))); + Partial_Formatting_Edit : + constant Laltools.Partial_GNATPP.Partial_Formatting_Edit := + Format_Selection (Unit, Input_Selection_Range, PP_Options); + + begin + if not Partial_Formatting_Edit.Diagnostics.Is_Empty then + Append_PP_Messages (Partial_Formatting_Edit.Diagnostics); + Self.Tracer.Trace + ("Non empty diagnostics from GNATPP - " + & "not continuing with Range_Formatting"); + return False; + end if; + + Self.Tracer.Trace ("Computing Range_Formatting Text_Edits"); + Edit.Clear; + declare + Edit_Span : constant LSP.Structures.A_Range := + Self.To_LSP_Range (Partial_Formatting_Edit.Edit.Location); + Edit_Text : constant VSS.Strings.Virtual_String := + VSS.Strings.Conversions.To_Virtual_String + (Partial_Formatting_Edit.Edit.Text); + + begin + Edit.Append (TextEdit'(Edit_Span, Edit_Text)); + end; + + return True; + end; + + exception + when E : others => + Self.Tracer.Trace_Exception (E, "in Range_Formatting"); + return False; end Range_Formatting; + ----------------------- + -- Recompute_Indexes -- + ----------------------- + + procedure Recompute_Indexes (Self : in out Document'Class) is + use type VSS.Strings.Character_Count; + + begin + Self.Line_To_Marker.Clear; + + -- To avoid too many reallocations during the initial filling + -- of the index vector, pre-allocate it. Give a generous + -- pre-allocation assuming that there is a line break every + -- 20 characters on average (this file has one line break + -- every 33 characters). + Self.Line_To_Marker.Reserve_Capacity + (Ada.Containers.Count_Type (Self.Text.Character_Length / 20)); + + declare + J : VSS.Strings.Line_Iterators.Line_Iterator := + Self.Text.At_First_Line + (Terminators => LSP_New_Line_Function_Set, + Keep_Terminator => True); + Last_Line_Terminated : Boolean := False; + + begin + if J.Has_Element then + -- Update Line_Terminator of the document + Self.Line_Terminator := Self.Text.Slice + (J.Terminator_First_Marker, J.Terminator_Last_Marker); + + loop + Self.Line_To_Marker.Append (J.First_Marker); + Last_Line_Terminated := J.Has_Line_Terminator; + + exit when not J.Forward; + end loop; + + else + Last_Line_Terminated := True; + -- Force to add one line for an empty document. + end if; + + -- Append marker at the end of the text when the last line has line + -- terminator sequence or text is empty. It allows to avoid checks + -- for corner cases. + + if Last_Line_Terminated then + Self.Line_To_Marker.Append (J.First_Marker); + end if; + end; + end Recompute_Indexes; + + ----------------------- + -- Recompute_Markers -- + ----------------------- + + procedure Recompute_Markers + (Self : in out Document'Class; + Low_Line : Natural; + Start_Marker : VSS.Strings.Markers.Character_Marker; + End_Marker : VSS.Strings.Markers.Character_Marker) + is + use type VSS.Strings.Character_Count; + + M : VSS.Strings.Markers.Character_Marker; + J : VSS.Strings.Line_Iterators.Line_Iterator := + Self.Text.At_Line + (Position => Start_Marker, + Terminators => LSP_New_Line_Function_Set, + Keep_Terminator => True); + Line : Natural := Low_Line; + + begin + if J.Has_Element then + loop + M := J.First_Marker; + + exit + when End_Marker.Is_Valid + and then M.Character_Index = End_Marker.Character_Index; + + Self.Line_To_Marker.Insert (Line, M); + Line := Line + 1; + + exit when not J.Forward; + end loop; + + if not End_Marker.Is_Valid then + Self.Line_To_Marker.Append (J.First_Marker); + end if; + end if; + end Recompute_Markers; + ------------------------ -- Reset_Symbol_Cache -- ------------------------ procedure Reset_Symbol_Cache (Self : in out Document'Class) is begin - pragma Compile_Time_Warning - (Standard.True, "Reset_Symbol_Cache unimplemented"); - raise Program_Error with "Unimplemented procedure Reset_Symbol_Cache"; + for Item of Self.Symbol_Cache loop + -- We clear defining name vectors, but keep symbol map in hope, that + -- we will reuse the same elements after reindexing in + -- Refresh_Symbol_Cache call, so we avoid memory reallocation. + Item.Clear; + end loop; + + Self.Refresh_Symbol_Cache := True; end Reset_Symbol_Cache; --------------------------------------- @@ -441,6 +1880,49 @@ package body LSP.Ada_Documents is with "Unimplemented procedure Set_Completion_Item_Documentation"; end Set_Completion_Item_Documentation; + --------------------- + -- Span_To_Markers -- + --------------------- + + procedure Span_To_Markers + (Self : Document'Class; + Span : LSP.Structures.A_Range; + From : out VSS.Strings.Markers.Character_Marker; + To : out VSS.Strings.Markers.Character_Marker) + is + use type VSS.Unicode.UTF16_Code_Unit_Offset; + + J1 : VSS.Strings.Character_Iterators.Character_Iterator := + Self.Text.At_Character (Self.Line_To_Marker (Span.start.line)); + U1 : constant VSS.Unicode.UTF16_Code_Unit_Offset := + J1.First_UTF16_Offset; + + J2 : VSS.Strings.Character_Iterators.Character_Iterator := + Self.Text.At_Character (Self.Line_To_Marker (Span.an_end.line)); + U2 : constant VSS.Unicode.UTF16_Code_Unit_Offset := + J2.First_UTF16_Offset; + + Dummy : Boolean; + + begin + while Span.start.character /= Integer (J1.First_UTF16_Offset - U1) + and then J1.Forward + loop + null; + end loop; + + From := J1.Marker; + + while Span.an_end.character /= Integer (J2.First_UTF16_Offset - U2) + and then J2.Forward + loop + null; + end loop; + + Dummy := J2.Backward; + To := J2.Marker; + end Span_To_Markers; + --------------------- -- To_LSP_Location -- --------------------- @@ -448,25 +1930,68 @@ package body LSP.Ada_Documents is function To_LSP_Location (Self : Document; Segment : Langkit_Support.Slocs.Source_Location_Range) return LSP.Structures.Location - is - begin - pragma Compile_Time_Warning - (Standard.True, "To_LSP_Location unimplemented"); - return raise Program_Error with "Unimplemented function To_LSP_Location"; - end To_LSP_Location; + is (uri => Self.URI, + a_range => Self.To_LSP_Range (Segment)); ------------------ -- To_LSP_Range -- ------------------ function To_LSP_Range - (Self : Document; Segment : Langkit_Support.Slocs.Source_Location_Range) + (Self : Document; + Segment : Langkit_Support.Slocs.Source_Location_Range) return LSP.Structures.A_Range is + + Start_Line : constant Natural := Natural (Segment.Start_Line) - 1; + + Start_Line_Text : constant VSS.Strings.Virtual_String := + (if Self.Line_To_Marker.Last_Index = Start_Line then + Self.Text.Slice + (Self.Line_To_Marker (Start_Line), Self.Text.After_Last_Character) + else + Self.Text.Slice + (Self.Line_To_Marker (Start_Line), + Self.Line_To_Marker (Start_Line + 1))); + Start_Iterator : VSS.Strings.Character_Iterators.Character_Iterator := + Start_Line_Text.At_First_Character; + + End_Line : constant Natural := Natural (Segment.End_Line) - 1; + End_Line_Text : constant VSS.Strings.Virtual_String := + (if Self.Line_To_Marker.Last_Index = End_Line then + Self.Text.Slice + (Self.Line_To_Marker (End_Line), Self.Text.After_Last_Character) + else + Self.Text.Slice + (Self.Line_To_Marker (End_Line), + Self.Line_To_Marker (End_Line + 1))); + End_Iterator : VSS.Strings.Character_Iterators.Character_Iterator := + End_Line_Text.At_First_Character; + Success : Boolean with Unreferenced; + begin - pragma Compile_Time_Warning - (Standard.True, "To_LSP_Range unimplemented"); - return raise Program_Error with "Unimplemented function To_LSP_Range"; + -- Iterating forward through the line of the start position, initial + -- iterator points to the first characters, thus "starts" from the + -- second one. + + for J in 2 .. Segment.Start_Column loop + Success := Start_Iterator.Forward; + end loop; + + -- Iterating forward through the line of the end position. For the same + -- reason "starts" from second character. + + for J in 2 .. Segment.End_Column loop + Success := End_Iterator.Forward; + end loop; + + return + (start => + (line => Start_Line, + character => Natural (Start_Iterator.First_UTF16_Offset)), + an_end => + (line => End_Line, + character => Natural (End_Iterator.Last_UTF16_Offset))); end To_LSP_Range; ---------- @@ -477,10 +2002,10 @@ package body LSP.Ada_Documents is (Self : Document'Class; Context : LSP.Ada_Contexts.Context) return Libadalang.Analysis.Analysis_Unit is - begin - pragma Compile_Time_Warning (Standard.True, "Unit unimplemented"); - return raise Program_Error with "Unimplemented function Unit"; - end Unit; + (Context.LAL_Context.Get_From_File + (Filename => Context.URI_To_File (Self.URI).Display_Full_Name, + Charset => Context.Charset, + Reparse => False)); -------------------------- -- Versioned_Identifier -- @@ -488,12 +2013,6 @@ package body LSP.Ada_Documents is function Versioned_Identifier (Self : Document) return LSP.Structures.VersionedTextDocumentIdentifier - is - begin - pragma Compile_Time_Warning - (Standard.True, "Versioned_Identifier unimplemented"); - return - raise Program_Error with "Unimplemented function Versioned_Identifier"; - end Versioned_Identifier; + is (Self.URI, Self.Version); end LSP.Ada_Documents; From 88bd14bc59fd25dc4cdb943a30b25339c15a2a3f Mon Sep 17 00:00:00 2001 From: Andry Ogorodnik Date: Tue, 15 Aug 2023 13:29:31 +0000 Subject: [PATCH 023/152] Add LSP 3.17 generated code --- source/ada/lsp-ada_completions-filters.adb | 252 +++++++++++++++++++-- source/ada/lsp-ada_completions-filters.ads | 2 +- source/ada/lsp-ada_completions.adb | 38 ++++ source/ada/lsp-ada_completions.ads | 10 + 4 files changed, 276 insertions(+), 26 deletions(-) diff --git a/source/ada/lsp-ada_completions-filters.adb b/source/ada/lsp-ada_completions-filters.adb index 9494f6341..eda9b728e 100644 --- a/source/ada/lsp-ada_completions-filters.adb +++ b/source/ada/lsp-ada_completions-filters.adb @@ -16,19 +16,23 @@ ------------------------------------------------------------------------------ package body LSP.Ada_Completions.Filters is - pragma Warnings (Off); + + function Kind + (Token : Libadalang.Common.Token_Reference) + return Libadalang.Common.Token_Kind + is (Libadalang.Common.Kind (Libadalang.Common.Data (Token))); ---------------- -- Initialize -- ---------------- procedure Initialize - (Self : in out Filter; Token : Libadalang.Common.Token_Reference; - Node : Libadalang.Analysis.Ada_Node) - is + (Self : in out Filter; + Token : Libadalang.Common.Token_Reference; + Node : Libadalang.Analysis.Ada_Node) is begin - pragma Compile_Time_Warning (Standard.True, "Initialize unimplemented"); - raise Program_Error with "Unimplemented procedure Initialize"; + Self.Token := Token; + Self.Node := Node; end Initialize; ------------------ @@ -37,21 +41,130 @@ package body LSP.Ada_Completions.Filters is function Is_End_Label (Self : in out Filter'Class) return Boolean is begin - pragma Compile_Time_Warning - (Standard.True, "Is_End_Label unimplemented"); - return raise Program_Error with "Unimplemented function Is_End_Label"; + if not Self.Is_End_Label.Is_Set then + declare + use all type Libadalang.Common.Ada_Node_Kind_Type; + + Parent : constant Libadalang.Analysis.Ada_Node := + (if Self.Node.Is_Null then Self.Node + else Skip_Dotted_Names (Self.Node.Parent)); + -- Skip the outermost dotted name enclosing Node.Parent, so + -- that when completing in a situation such as the following: + -- + -- end Ada.Tex| + -- ^ Cursor here + -- + -- we get the DottedName node's parent rather than just the "Tex" + -- Id. We want the DottedName parent rather than the Id so as + -- to get the proper completions (all elements in the "Ada" + -- namespace). + begin + if not Parent.Is_Null + and then Parent.Kind = Libadalang.Common.Ada_End_Name + then + Self.Is_End_Label := (True, True); + + elsif Is_End_Token (Self.Token) then + Self.Is_End_Label := (True, True); + + elsif Is_End_Token + (Libadalang.Common.Previous + (Self.Token, Exclude_Trivia => True)) + then + Self.Is_End_Label := (True, True); + + else + Self.Is_End_Label := (True, False); + + end if; + end; + end if; + + return Self.Is_End_Label.Value; end Is_End_Label; ------------------------ -- Is_Numeric_Literal -- ------------------------ - function Is_Numeric_Literal (Self : in out Filter'Class) return Boolean is + function Is_Numeric_Literal (Self : in out Filter'Class) return Boolean + is + use all type Libadalang.Common.Token_Kind; + + First : Libadalang.Common.Token_Reference := Self.Token; + begin - pragma Compile_Time_Warning - (Standard.True, "Is_Numeric_Literal unimplemented"); - return - raise Program_Error with "Unimplemented function Is_Numeric_Literal"; + if Self.Is_Numeric_Literal.Is_Set then + return Self.Is_Numeric_Literal.Value; + end if; + + -- Let me be pessimistic + Self.Is_Numeric_Literal := (True, False); + + -- An incomplete numeric literal may be represented in LAL as tokens. + -- Scan tokens backward till the start token of numeric literal. + case Kind (First) is + when Ada_Lexing_Failure => + -- (Integer|Decimal) (Lexing_Failure) + -- 1_ + -- 1.0_ + -- 1e0_ + if Libadalang.Common.Text (First) /= "_" then + return Self.Is_Numeric_Literal.Value; + end if; + + First := Libadalang.Common.Previous (First); + + when Ada_Dot | Ada_Prep_Line => + -- (Integer) (Prep_Line) + -- 2# + -- 2#1 + -- (Integer) (Dot) + -- 1. + First := Libadalang.Common.Previous (First); + + if Kind (First) /= Ada_Integer then + return Self.Is_Numeric_Literal.Value; + end if; + + when Ada_Identifier => + -- (Integer|Decimal) (Identifier) + -- 1.0e + if Libadalang.Common.Text (First) in "e" | "E" then + First := Libadalang.Common.Previous (First); + else + return Self.Is_Numeric_Literal.Value; + end if; + + when Ada_Plus | Ada_Minus => + -- (Integer|Decimal) (Identifier) (Plus|Minus) + -- 1.0e+ + First := Libadalang.Common.Previous (First); + + if Kind (First) = Ada_Identifier + and then Libadalang.Common.Text (First) in "e" | "E" + then + First := Libadalang.Common.Previous (First); + else + return Self.Is_Numeric_Literal.Value; + end if; + + when Ada_Integer | Ada_Decimal => + -- A complete (valid) numeric literal + null; + + when others => + return Self.Is_Numeric_Literal.Value; + end case; + + if Kind (First) not in Ada_Integer | Ada_Decimal then + return Self.Is_Numeric_Literal.Value; + end if; + + -- Ok, we have found a numeric literal + Self.Is_Numeric_Literal := (True, True); + + return Self.Is_Numeric_Literal.Value; end Is_Numeric_Literal; ---------------------- @@ -60,10 +173,41 @@ package body LSP.Ada_Completions.Filters is function Is_Attribute_Ref (Self : in out Filter'Class) return Boolean is begin - pragma Compile_Time_Warning - (Standard.True, "Is_Attribute_Ref unimplemented"); - return - raise Program_Error with "Unimplemented function Is_Attribute_Ref"; + if not Self.Is_Attribute.Is_Set then + declare + use all type Libadalang.Common.Ada_Node_Kind_Type; + use all type Libadalang.Common.Token_Kind; + + Token_Kind : constant Libadalang.Common.Token_Kind := + Kind (Self.Token); + Parent : Libadalang.Analysis.Ada_Node := + (if Self.Node.Is_Null then Self.Node else Self.Node.Parent); + begin + -- Get the outermost dotted name of which node is a prefix, so + -- that when completing in a situation such as the following: + -- + -- end Ada.Tex| + -- ^ Cursor here + -- + -- we get the DottedName node rather than just the "Tex" BaseId. + -- We want the DottedName rather than the Id so as to get the + -- proper completions (all elements in the "Ada" namespace). + + while not Parent.Is_Null + and then Parent.Kind = Ada_Dotted_Name + loop + Parent := Parent.Parent; + end loop; + + Self.Is_Attribute := + (True, + Token_Kind = Ada_Tick or else + (not Parent.Is_Null + and then Parent.Kind = Ada_Attribute_Ref)); + end; + end if; + + return Self.Is_Attribute.Value; end Is_Attribute_Ref; --------------- @@ -72,8 +216,43 @@ package body LSP.Ada_Completions.Filters is function Is_Aspect (Self : in out Filter'Class) return Boolean is begin - pragma Compile_Time_Warning (Standard.True, "Is_Aspect unimplemented"); - return raise Program_Error with "Unimplemented function Is_Aspect"; + if not Self.Is_Aspect.Is_Set then + declare + use Libadalang.Common; + + Token_Kind : constant Libadalang.Common.Token_Kind := + Kind (Libadalang.Common.Previous + (Self.Token, Exclude_Trivia => True)); + Parent : Libadalang.Analysis.Ada_Node := + (if Self.Node.Is_Null then Self.Node else Self.Node.Parent); + begin + -- Get the outermost dotted name of which node is a prefix, so + -- that when completing in a situation such as the following: + -- + -- end Ada.Tex| + -- ^ Cursor here + -- + -- we get the DottedName node rather than just the "Tex" BaseId. + -- We want the DottedName rather than the Id so as to get the + -- proper completions (all elements in the "Ada" namespace). + + while not Parent.Is_Null + and then Parent.Kind = Ada_Dotted_Name + loop + Parent := Parent.Parent; + end loop; + + Self.Is_Aspect := + (True, + Token_Kind = Ada_With and then + (Self.Node.Kind in Ada_Aspect_Spec_Range + or else + (not Parent.Is_Null + and then Parent.Kind in Ada_Aspect_Assoc_Range))); + end; + end if; + + return Self.Is_Aspect.Value; end Is_Aspect; ------------------ @@ -82,9 +261,20 @@ package body LSP.Ada_Completions.Filters is function Is_Semicolon (Self : in out Filter'Class) return Boolean is begin - pragma Compile_Time_Warning - (Standard.True, "Is_Semicolon unimplemented"); - return raise Program_Error with "Unimplemented function Is_Semicolon"; + if not Self.Is_Semicolon.Is_Set then + declare + use all type Libadalang.Common.Token_Kind; + + Token_Kind : constant Libadalang.Common.Token_Kind := + Kind (Self.Token); + begin + Self.Is_Semicolon := + (True, + Token_Kind = Ada_Semicolon); + end; + end if; + + return Self.Is_Semicolon.Value; end Is_Semicolon; -------------- @@ -93,8 +283,20 @@ package body LSP.Ada_Completions.Filters is function Is_Comma (Self : in out Filter'Class) return Boolean is begin - pragma Compile_Time_Warning (Standard.True, "Is_Comma unimplemented"); - return raise Program_Error with "Unimplemented function Is_Comma"; + if not Self.Is_Comma.Is_Set then + declare + use all type Libadalang.Common.Token_Kind; + + Token_Kind : constant Libadalang.Common.Token_Kind := + Kind (Self.Token); + begin + Self.Is_Comma := + (True, + Token_Kind = Ada_Comma); + end; + end if; + + return Self.Is_Comma.Value; end Is_Comma; end LSP.Ada_Completions.Filters; diff --git a/source/ada/lsp-ada_completions-filters.ads b/source/ada/lsp-ada_completions-filters.ads index 8aecee609..61913b869 100644 --- a/source/ada/lsp-ada_completions-filters.ads +++ b/source/ada/lsp-ada_completions-filters.ads @@ -15,7 +15,7 @@ -- of the license. -- ------------------------------------------------------------------------------ -with LSP.Structures; +private with LSP.Structures; package LSP.Ada_Completions.Filters is diff --git a/source/ada/lsp-ada_completions.adb b/source/ada/lsp-ada_completions.adb index 6ce085674..e1068bed5 100644 --- a/source/ada/lsp-ada_completions.adb +++ b/source/ada/lsp-ada_completions.adb @@ -18,6 +18,24 @@ package body LSP.Ada_Completions is pragma Warnings (Off); + ------------------ + -- Is_End_Token -- + ------------------ + + function Is_End_Token + (Token : Libadalang.Common.Token_Reference) + return Boolean + is + use Libadalang.Common; + End_Token : constant Libadalang.Common.Token_Data_Type := + Libadalang.Common.Data (Token); + + Token_Kind : constant Libadalang.Common.Token_Kind := + Libadalang.Common.Kind (End_Token); + begin + return Token_Kind = Libadalang.Common.Ada_End; + end Is_End_Token; + ------------------------ -- Is_Full_Sloc_Equal -- ------------------------ @@ -32,6 +50,26 @@ package body LSP.Ada_Completions is raise Program_Error with "Unimplemented function Is_Full_Sloc_Equal"; end Is_Full_Sloc_Equal; + ----------------------- + -- Skip_Dotted_Names -- + ----------------------- + + function Skip_Dotted_Names + (Node : Libadalang.Analysis.Ada_Node) + return Libadalang.Analysis.Ada_Node + is + use Libadalang.Common; + Parent : Libadalang.Analysis.Ada_Node := Node; + begin + while not Parent.Is_Null + and then Parent.Kind = Libadalang.Common.Ada_Dotted_Name + loop + Parent := Parent.Parent; + end loop; + + return Parent; + end Skip_Dotted_Names; + ----------------------- -- Write_Completions -- ----------------------- diff --git a/source/ada/lsp-ada_completions.ads b/source/ada/lsp-ada_completions.ads index 3e6ca7148..ba63ad90e 100644 --- a/source/ada/lsp-ada_completions.ads +++ b/source/ada/lsp-ada_completions.ads @@ -134,4 +134,14 @@ package LSP.Ada_Completions is type Completion_Provider_List is array (Positive range <>) of Completion_Provider_Access; +private + + function Skip_Dotted_Names (Node : Libadalang.Analysis.Ada_Node) + return Libadalang.Analysis.Ada_Node; + -- While Node.Kind is the Dotted_Name go up. + + function Is_End_Token (Token : Libadalang.Common.Token_Reference) + return Boolean; + -- Check if Token is . + end LSP.Ada_Completions; From 3c7fbbacebc4a9d420c13923eecd6a2a8c0e4f87 Mon Sep 17 00:00:00 2001 From: Andry Ogorodnik Date: Tue, 15 Aug 2023 17:01:18 +0000 Subject: [PATCH 024/152] Implemented On_FoldingRange_Request --- gnat/ignore_in_317.txt | 2 - source/ada/lsp-ada_client_capabilities.adb | 26 ++++++++++- source/ada/lsp-ada_client_capabilities.ads | 3 ++ source/ada/lsp-ada_handlers.adb | 50 ++++++++++++++++++++-- source/ada/lsp-ada_handlers.ads | 11 ++++- source/server/lsp-generic_cancel_check.adb | 2 +- source/server/lsp-generic_cancel_check.ads | 6 +-- 7 files changed, 88 insertions(+), 12 deletions(-) diff --git a/gnat/ignore_in_317.txt b/gnat/ignore_in_317.txt index 58efbb4f0..edb411331 100644 --- a/gnat/ignore_in_317.txt +++ b/gnat/ignore_in_317.txt @@ -80,8 +80,6 @@ lsp-search-regexp.ads lsp-search-start_word_text.adb lsp-search-start_word_text.ads lsp-file_monitors.ads -lsp-generic_cancel_check.adb -lsp-generic_cancel_check.ads lsp-message_loggers.adb lsp-message_loggers.ads lsp-server_backends.ads diff --git a/source/ada/lsp-ada_client_capabilities.adb b/source/ada/lsp-ada_client_capabilities.adb index 3d531c8c6..b6cc510c0 100644 --- a/source/ada/lsp-ada_client_capabilities.adb +++ b/source/ada/lsp-ada_client_capabilities.adb @@ -65,7 +65,6 @@ package body LSP.Ada_Client_Capabilities is pragma Unreferenced (Self); begin return Result : LSP.Structures.ServerCapabilities do - Result.textDocumentSync := (Is_Set => True, Value => @@ -75,7 +74,32 @@ package body LSP.Ada_Client_Capabilities is LSP.Enumerations.Incremental else LSP.Enumerations.Full))); + + Result.foldingRangeProvider := + (Is_Set => True, + Value => + (Kind => LSP.Structures.Varian_1, Varian_1 => True)); end return; end To_Server_Capabilities; + ----------------------- + -- Line_Folding_Only -- + ----------------------- + + function Line_Folding_Only + (Self : Client_Capability'Class) return Boolean is + begin + if Self.Value.capabilities.textDocument.Is_Set + and then Self.Value.capabilities.textDocument.Value.foldingRange.Is_Set + and then Self.Value.capabilities.textDocument.Value.foldingRange.Value. + lineFoldingOnly.Is_Set + then + return Self.Value.capabilities.textDocument.Value.foldingRange.Value. + lineFoldingOnly.Value; + + else + return False; + end if; + end Line_Folding_Only; + end LSP.Ada_Client_Capabilities; diff --git a/source/ada/lsp-ada_client_capabilities.ads b/source/ada/lsp-ada_client_capabilities.ads index 16f83921d..cefc331de 100644 --- a/source/ada/lsp-ada_client_capabilities.ads +++ b/source/ada/lsp-ada_client_capabilities.ads @@ -49,6 +49,9 @@ package LSP.Ada_Client_Capabilities is Value : VSS.Strings.Virtual_String); -- Is Self.Root is empty then replace it with given Value + function Line_Folding_Only (Self : Client_Capability'Class) return Boolean; + -- Returns capabilities.textDocument.foldingRange.lineFoldingOnly or False + private type Client_Capability is tagged limited record diff --git a/source/ada/lsp-ada_handlers.adb b/source/ada/lsp-ada_handlers.adb index e4a2d4854..a7a7e1905 100644 --- a/source/ada/lsp-ada_handlers.adb +++ b/source/ada/lsp-ada_handlers.adb @@ -27,6 +27,7 @@ with LSP.Ada_Handlers.Project_Diagnostics; with LSP.Ada_Handlers.Project_Loading; with LSP.Diagnostic_Sources; with LSP.Enumerations; +with LSP.Generic_Cancel_Check; package body LSP.Ada_Handlers is @@ -107,14 +108,14 @@ package body LSP.Ada_Handlers is ----------------------- function Get_Open_Document - (Self : access Message_Handler; + (Self : in out Message_Handler; URI : LSP.Structures.DocumentUri; Force : Boolean := False) return LSP.Ada_Documents.Document_Access is File : constant GNATCOLL.VFS.Virtual_File := Self.To_File (URI); begin - Project_Loading.Ensure_Project_Loaded (Self.all); + Project_Loading.Ensure_Project_Loaded (Self); if Self.Open_Documents.Contains (File) then return LSP.Ada_Documents.Document_Access @@ -143,6 +144,44 @@ package body LSP.Ada_Handlers is Self.Incremental_Text_Changes := Incremental_Text_Changes; end Initialize; + ----------------------------- + -- On_FoldingRange_Request -- + ----------------------------- + + overriding procedure On_FoldingRange_Request + (Self : in out Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.FoldingRangeParams) + is + use type LSP.Ada_Documents.Document_Access; + + Context : constant LSP.Ada_Context_Sets.Context_Access := + Self.Contexts.Get_Best_Context (Value.textDocument.uri); + Document : constant LSP.Ada_Documents.Document_Access := + Get_Open_Document (Self, Value.textDocument.uri); + Response : LSP.Structures.FoldingRange_Vector_Or_Null; + + begin + if Document /= null then + Document.Get_Folding_Blocks + (Context.all, + Self.Client.Line_Folding_Only, + Self.Configuration.Folding_Comments, + Self.Is_Canceled, + Response); + + if Self.Is_Canceled.all then + Response.Clear; + end if; + Self.Sender.On_FoldingRange_Response (Id, Response); + + else + Self.Sender.On_Error_Response + (Id, (code => LSP.Enumerations.InternalError, + message => "Document is not opened")); + end if; + end On_FoldingRange_Request; + -------------------------------------------- -- On_DidChangeConfiguration_Notification -- -------------------------------------------- @@ -232,7 +271,7 @@ package body LSP.Ada_Handlers is Self.Client.Initialize (Value); Response.capabilities := Self.Client.To_Server_Capabilities - (Incremental_Text_Changes => Self.Incremental_Text_Changes); + (Self.Incremental_Text_Changes); Self.Sender.On_Initialize_Response (Id, Response); end On_Initialize_Request; @@ -257,9 +296,12 @@ package body LSP.Ada_Handlers is overriding procedure On_Server_Request (Self : in out Message_Handler; - Value : LSP.Server_Requests.Server_Request'Class) is + Value : LSP.Server_Requests.Server_Request'Class) + is + package Canceled is new LSP.Generic_Cancel_Check (Value'Access, 127); begin Self.Implemented := True; + Self.Is_Canceled := Canceled.Has_Been_Canceled'Unrestricted_Access; Value.Visit_Server_Receiver (Self); diff --git a/source/ada/lsp-ada_handlers.ads b/source/ada/lsp-ada_handlers.ads index c1b72a626..2b19fea69 100644 --- a/source/ada/lsp-ada_handlers.ads +++ b/source/ada/lsp-ada_handlers.ads @@ -60,7 +60,7 @@ package LSP.Ada_Handlers is -- changes. function Get_Open_Document - (Self : access Message_Handler; + (Self : in out Message_Handler; URI : LSP.Structures.DocumentUri; Force : Boolean := False) return LSP.Ada_Documents.Document_Access; @@ -125,6 +125,8 @@ private Equivalent_Elements => GNATCOLL.VFS."=", "=" => GNATCOLL.VFS."="); + type Has_Been_Canceled_Function is access function return Boolean; + type Message_Handler (Sender : not null access LSP.Client_Message_Receivers .Client_Message_Receiver'Class; @@ -198,6 +200,8 @@ private Project_Dirs_Loaded : File_Sets.Set; -- The directories to load in the "implicit project" + Is_Canceled : Has_Been_Canceled_Function; + -- Is request has been canceled end record; overriding procedure On_Server_Request @@ -216,6 +220,11 @@ private Id : LSP.Structures.Integer_Or_Virtual_String; Value : LSP.Structures.InitializeParams); + overriding procedure On_FoldingRange_Request + (Self : in out Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.FoldingRangeParams); + overriding procedure On_DidChangeConfiguration_Notification (Self : in out Message_Handler; Value : LSP.Structures.DidChangeConfigurationParams); diff --git a/source/server/lsp-generic_cancel_check.adb b/source/server/lsp-generic_cancel_check.adb index 732ec36b3..f858f4db8 100644 --- a/source/server/lsp-generic_cancel_check.adb +++ b/source/server/lsp-generic_cancel_check.adb @@ -1,7 +1,7 @@ ------------------------------------------------------------------------------ -- Language Server Protocol -- -- -- --- Copyright (C) 2018-2021, AdaCore -- +-- Copyright (C) 2018-2023, AdaCore -- -- -- -- This is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- diff --git a/source/server/lsp-generic_cancel_check.ads b/source/server/lsp-generic_cancel_check.ads index d6d774d20..a7c31aefc 100644 --- a/source/server/lsp-generic_cancel_check.ads +++ b/source/server/lsp-generic_cancel_check.ads @@ -1,7 +1,7 @@ ------------------------------------------------------------------------------ -- Language Server Protocol -- -- -- --- Copyright (C) 2018-2021, AdaCore -- +-- Copyright (C) 2018-2023, AdaCore -- -- -- -- This is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -20,10 +20,10 @@ -- checking cound generate overhead. This package provides a function to -- avoid an extra overhread by reducing atomic flag check frequency. -with LSP.Messages.Server_Requests; +with LSP.Server_Requests; generic - Request : access constant LSP.Messages.Server_Requests.Server_Request'Class; + Request : access constant LSP.Server_Requests.Server_Request'Class; -- A request to check cancelation Max_Skip_Count : Natural; From 6be9616f814378e07719a6c7a80dd26779db8ac5 Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Wed, 16 Aug 2023 09:31:29 +0300 Subject: [PATCH 025/152] Add Unwrap package for optional unwrapping functions Refs #1170 --- source/ada/lsp-ada_client_capabilities.adb | 20 ++++++++------------ source/lsp_3.17/lsp-structures-unwrap.ads | 18 ++++++++++++++++++ 2 files changed, 26 insertions(+), 12 deletions(-) create mode 100644 source/lsp_3.17/lsp-structures-unwrap.ads diff --git a/source/ada/lsp-ada_client_capabilities.adb b/source/ada/lsp-ada_client_capabilities.adb index b6cc510c0..26d1d7ae6 100644 --- a/source/ada/lsp-ada_client_capabilities.adb +++ b/source/ada/lsp-ada_client_capabilities.adb @@ -16,6 +16,7 @@ ------------------------------------------------------------------------------ with LSP.Enumerations; +with LSP.Structures.Unwrap; package body LSP.Ada_Client_Capabilities is @@ -87,19 +88,14 @@ package body LSP.Ada_Client_Capabilities is ----------------------- function Line_Folding_Only - (Self : Client_Capability'Class) return Boolean is - begin - if Self.Value.capabilities.textDocument.Is_Set - and then Self.Value.capabilities.textDocument.Value.foldingRange.Is_Set - and then Self.Value.capabilities.textDocument.Value.foldingRange.Value. - lineFoldingOnly.Is_Set - then - return Self.Value.capabilities.textDocument.Value.foldingRange.Value. - lineFoldingOnly.Value; + (Self : Client_Capability'Class) return Boolean + is + use LSP.Structures.Unwrap; - else - return False; - end if; + Result : constant LSP.Structures.Boolean_Optional := + lineFoldingOnly (foldingRange (Self.Value.capabilities.textDocument)); + begin + return (if Result.Is_Set then Result.Value else False); end Line_Folding_Only; end LSP.Ada_Client_Capabilities; diff --git a/source/lsp_3.17/lsp-structures-unwrap.ads b/source/lsp_3.17/lsp-structures-unwrap.ads new file mode 100644 index 000000000..5b5dc204a --- /dev/null +++ b/source/lsp_3.17/lsp-structures-unwrap.ads @@ -0,0 +1,18 @@ +-- +-- Copyright (C) 2022-2023, AdaCore +-- +-- SPDX-License-Identifier: Apache-2.0 +-- + +package LSP.Structures.Unwrap is + pragma Preelaborate; + + function foldingRange (X : TextDocumentClientCapabilities_Optional) + return FoldingRangeClientCapabilities_Optional is + (if X.Is_Set then X.Value.foldingRange else (Is_Set => False)); + + function lineFoldingOnly (X : FoldingRangeClientCapabilities_Optional) + return Boolean_Optional is + (if X.Is_Set then X.Value.lineFoldingOnly else (Is_Set => False)); + +end LSP.Structures.Unwrap; From 808407408e5c7736a4598fbf2733f30b0e8e2489 Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Wed, 16 Aug 2023 09:46:19 +0300 Subject: [PATCH 026/152] Create a dedicated package to keep constants like Boolean_Optional True/False literals, etc. Refs #1170 --- gnat/ignore_in_317.txt | 2 ++ source/ada/lsp-ada_client_capabilities.adb | 6 ++--- source/ada/lsp-ada_completions-filters.adb | 14 +++++++----- source/lsp_3.17/lsp-constants.ads | 26 ++++++++++++++++++++++ 4 files changed, 38 insertions(+), 10 deletions(-) create mode 100644 source/lsp_3.17/lsp-constants.ads diff --git a/gnat/ignore_in_317.txt b/gnat/ignore_in_317.txt index edb411331..8ebe65784 100644 --- a/gnat/ignore_in_317.txt +++ b/gnat/ignore_in_317.txt @@ -29,6 +29,8 @@ lsp-ada_handlers-other_file_commands.adb lsp-ada_handlers-other_file_commands.ads lsp-ada_handlers-project_reload_commands.adb lsp-ada_handlers-project_reload_commands.ads +lsp-ada_handlers-refactor.adb +lsp-ada_handlers-refactor.ads lsp-ada_handlers-refactor-add_parameter.adb lsp-ada_handlers-refactor-add_parameter.ads lsp-ada_handlers-refactor-change_parameter_mode.adb diff --git a/source/ada/lsp-ada_client_capabilities.adb b/source/ada/lsp-ada_client_capabilities.adb index 26d1d7ae6..4e6c99d83 100644 --- a/source/ada/lsp-ada_client_capabilities.adb +++ b/source/ada/lsp-ada_client_capabilities.adb @@ -15,6 +15,7 @@ -- of the license. -- ------------------------------------------------------------------------------ +with LSP.Constants; with LSP.Enumerations; with LSP.Structures.Unwrap; @@ -76,10 +77,7 @@ package body LSP.Ada_Client_Capabilities is else LSP.Enumerations.Full))); - Result.foldingRangeProvider := - (Is_Set => True, - Value => - (Kind => LSP.Structures.Varian_1, Varian_1 => True)); + Result.foldingRangeProvider := LSP.Constants.True; end return; end To_Server_Capabilities; diff --git a/source/ada/lsp-ada_completions-filters.adb b/source/ada/lsp-ada_completions-filters.adb index eda9b728e..e511a8f86 100644 --- a/source/ada/lsp-ada_completions-filters.adb +++ b/source/ada/lsp-ada_completions-filters.adb @@ -15,6 +15,8 @@ -- of the license. -- ------------------------------------------------------------------------------ +with LSP.Constants; + package body LSP.Ada_Completions.Filters is function Kind @@ -62,19 +64,19 @@ package body LSP.Ada_Completions.Filters is if not Parent.Is_Null and then Parent.Kind = Libadalang.Common.Ada_End_Name then - Self.Is_End_Label := (True, True); + Self.Is_End_Label := LSP.Constants.True; elsif Is_End_Token (Self.Token) then - Self.Is_End_Label := (True, True); + Self.Is_End_Label := LSP.Constants.True; elsif Is_End_Token (Libadalang.Common.Previous (Self.Token, Exclude_Trivia => True)) then - Self.Is_End_Label := (True, True); + Self.Is_End_Label := LSP.Constants.True; else - Self.Is_End_Label := (True, False); + Self.Is_End_Label := LSP.Constants.False; end if; end; @@ -99,7 +101,7 @@ package body LSP.Ada_Completions.Filters is end if; -- Let me be pessimistic - Self.Is_Numeric_Literal := (True, False); + Self.Is_Numeric_Literal := LSP.Constants.False; -- An incomplete numeric literal may be represented in LAL as tokens. -- Scan tokens backward till the start token of numeric literal. @@ -162,7 +164,7 @@ package body LSP.Ada_Completions.Filters is end if; -- Ok, we have found a numeric literal - Self.Is_Numeric_Literal := (True, True); + Self.Is_Numeric_Literal := LSP.Constants.True; return Self.Is_Numeric_Literal.Value; end Is_Numeric_Literal; diff --git a/source/lsp_3.17/lsp-constants.ads b/source/lsp_3.17/lsp-constants.ads new file mode 100644 index 000000000..341694568 --- /dev/null +++ b/source/lsp_3.17/lsp-constants.ads @@ -0,0 +1,26 @@ +-- +-- Copyright (C) 2022-2023, AdaCore +-- +-- SPDX-License-Identifier: Apache-2.0 +-- + +with LSP.Structures; + +package LSP.Constants is + pragma Preelaborate; + + function False return LSP.Structures.Boolean_Optional + is (Is_Set => True, Value => False); + + function True return LSP.Structures.Boolean_Optional + is (Is_Set => True, Value => True); + + function True + return LSP.Structures.foldingRangeProvider_OfServerCapabilities + is (Kind => LSP.Structures.Varian_1, Varian_1 => True); + + function True + return LSP.Structures.foldingRangeProvider_OfServerCapabilities_Optional + is (Is_Set => True, Value => True); + +end LSP.Constants; From 89f4a151a4c7f76e75cae8d5786992e551fe6671 Mon Sep 17 00:00:00 2001 From: Andry Ogorodnik Date: Wed, 16 Aug 2023 12:21:54 +0000 Subject: [PATCH 027/152] Implemented On_DidChange_Notification --- source/ada/lsp-ada_handlers.adb | 97 +++++++++++++++++++++++++++++++++ source/ada/lsp-ada_handlers.ads | 4 ++ 2 files changed, 101 insertions(+) diff --git a/source/ada/lsp-ada_handlers.adb b/source/ada/lsp-ada_handlers.adb index a7a7e1905..ecca0751b 100644 --- a/source/ada/lsp-ada_handlers.adb +++ b/source/ada/lsp-ada_handlers.adb @@ -28,6 +28,8 @@ with LSP.Ada_Handlers.Project_Loading; with LSP.Diagnostic_Sources; with LSP.Enumerations; with LSP.Generic_Cancel_Check; +with LSP.Servers; +with LSP.Server_Notifications.DidChange; package body LSP.Ada_Handlers is @@ -182,6 +184,101 @@ package body LSP.Ada_Handlers is end if; end On_FoldingRange_Request; + ------------------------------- + -- On_DidChange_Notification -- + ------------------------------- + + overriding procedure On_DidChange_Notification + (Self : in out Message_Handler; + Value : LSP.Structures.DidChangeTextDocumentParams) + is + use type LSP.Ada_Documents.Document_Access; + + function Skip_Did_Change return Boolean; + -- Check if the following message in the queue is didChange for + -- the same document + + URI : LSP.Structures.DocumentUri renames Value.textDocument.uri; + Document : constant LSP.Ada_Documents.Document_Access := + Get_Open_Document (Self, URI); + + --------------------- + -- Skip_Did_Change -- + --------------------- + + function Skip_Did_Change return Boolean is + use type LSP.Servers.Server_Message_Access; + + subtype DidChange_Notification is + LSP.Server_Notifications.DidChange.Notification; + + Next : constant LSP.Servers.Server_Message_Access := + LSP.Servers.Server'Class (Self.Sender.all).Look_Ahead_Message; + begin + + if Next = null + or else Next.all not in DidChange_Notification'Class + then + return False; + end if; + + declare + use GNATCOLL.VFS; + Object : DidChange_Notification'Class renames + DidChange_Notification'Class (Next.all); + Object_File : constant Virtual_File := Self.To_File + (Object.Params.textDocument.uri); + Value_File : constant Virtual_File := Self.To_File (URI); + begin + if Object_File /= Value_File then + return False; + end if; + end; + + return True; + end Skip_Did_Change; + + begin + if Document = null then + Self.Tracer.Trace + ("Unexpected null document in On_DidChange_Notification"); + return; + end if; + + if Self.Incremental_Text_Changes then + -- If we are applying incremental changes, we can't skip the + -- call to Apply_Changes, since this would break synchronization. + Document.Apply_Changes + (Value.textDocument.version, + Value.contentChanges); + + -- However, we should skip the Indexing part if the next change in + -- the queue will re-change the text document. + if Skip_Did_Change then + return; + end if; + else + -- If we are not applying incremental changes, we can skip + -- Apply_Changes: the next change will contain the full text. + if Skip_Did_Change then + return; + end if; + + Document.Apply_Changes + (Value.textDocument.version, + Value.contentChanges); + end if; + + -- Reindex the document in each of the contexts where it is relevant + + for Context of Self.Contexts_For_URI (URI) loop + Context.Index_Document (Document.all); + end loop; + + -- Emit diagnostics + Self.Publish_Diagnostics (Document); + end On_DidChange_Notification; + -------------------------------------------- -- On_DidChangeConfiguration_Notification -- -------------------------------------------- diff --git a/source/ada/lsp-ada_handlers.ads b/source/ada/lsp-ada_handlers.ads index 2b19fea69..1b8911cc0 100644 --- a/source/ada/lsp-ada_handlers.ads +++ b/source/ada/lsp-ada_handlers.ads @@ -225,6 +225,10 @@ private Id : LSP.Structures.Integer_Or_Virtual_String; Value : LSP.Structures.FoldingRangeParams); + overriding procedure On_DidChange_Notification + (Self : in out Message_Handler; + Value : LSP.Structures.DidChangeTextDocumentParams); + overriding procedure On_DidChangeConfiguration_Notification (Self : in out Message_Handler; Value : LSP.Structures.DidChangeConfigurationParams); From 8ee83db8cb9b3f4b85884c0ad30f73447cbc1046 Mon Sep 17 00:00:00 2001 From: Andry Ogorodnik Date: Wed, 16 Aug 2023 14:44:40 +0000 Subject: [PATCH 028/152] Implemented: --- source/ada/lsp-ada_handlers.adb | 211 +++++++++++++++++++++++++++++++- source/ada/lsp-ada_handlers.ads | 20 ++- 2 files changed, 223 insertions(+), 8 deletions(-) diff --git a/source/ada/lsp-ada_handlers.adb b/source/ada/lsp-ada_handlers.adb index ecca0751b..ba890af60 100644 --- a/source/ada/lsp-ada_handlers.adb +++ b/source/ada/lsp-ada_handlers.adb @@ -54,6 +54,27 @@ package body LSP.Ada_Handlers is -- When Force is True, the diagnostics will always be sent, not matter if -- they have changed or not. + procedure Clean_Diagnostics + (Self : in out Message_Handler'Class; + Document : not null LSP.Ada_Documents.Document_Access); + -- Clean diagnostics up for the document + + function To_DocumentUri (X : VSS.Strings.Virtual_String) + return LSP.Structures.DocumentUri is (X with null record); + + EmptyDocumentUri : constant LSP.Structures.DocumentUri := + To_DocumentUri (VSS.Strings.Empty_Virtual_String); + + procedure Log_Method_In + (Self : in out Message_Handler; + Name : String; + URI : LSP.Structures.DocumentUri := EmptyDocumentUri); + + procedure Log_Method_Out + (Self : in out Message_Handler; + Name : String); + -- Save method in/out in a log file + function To_File (Self : Message_Handler'Class; URI : LSP.Structures.DocumentUri) return GNATCOLL.VFS.Virtual_File @@ -63,6 +84,32 @@ package body LSP.Ada_Handlers is (VSS.Strings.Conversions.To_UTF_8_String (URI), Normalize => Self.Configuration.Follow_Symlinks))); + ------------------- + -- Log_Method_In -- + ------------------- + + procedure Log_Method_In + (Self : in out Message_Handler; + Name : String; + URI : LSP.Structures.DocumentUri := EmptyDocumentUri) is + begin + Self.Tracer.Trace ("In Message_Handler " & Name); + if not URI.Is_Empty then + Self.Tracer.Trace_Text (URI); + end if; + end Log_Method_In; + + -------------------- + -- Log_Method_Out -- + -------------------- + + procedure Log_Method_Out + (Self : in out Message_Handler; + Name : String) is + begin + Self.Tracer.Trace ("Out Message_Handler " & Name); + end Log_Method_Out; + ---------------------- -- Contexts_For_URI -- ---------------------- @@ -179,7 +226,7 @@ package body LSP.Ada_Handlers is else Self.Sender.On_Error_Response - (Id, (code => LSP.Enumerations.InternalError, + (Id, (code => LSP.Enumerations.InternalError, message => "Document is not opened")); end if; end On_FoldingRange_Request; @@ -312,8 +359,7 @@ package body LSP.Ada_Handlers is new LSP.Ada_Handlers.Project_Diagnostics.Diagnostic_Source (Self'Unchecked_Access); begin - Self.Tracer.Trace ("In Text_Document_Did_Open. Uri :"); - Self.Tracer.Trace_Text (URI); + Self.Log_Method_In ("Text_Document_Did_Open. Uri :", URI); -- Some clients don't properly call initialize, or don't pass the -- project to didChangeConfiguration: fallback here on loading a @@ -351,9 +397,150 @@ package body LSP.Ada_Handlers is -- Emit diagnostics Self.Publish_Diagnostics (LSP.Ada_Documents.Document_Access (Object)); - Self.Tracer.Trace ("Finished Text_Document_Did_Open"); + Self.Log_Method_Out ("Text_Document_Did_Open"); end On_DidOpen_Notification; + ------------------------------ + -- On_DidClose_Notification -- + ------------------------------ + + overriding procedure On_DidClose_Notification + (Self : in out Message_Handler; + Value : LSP.Structures.DidCloseTextDocumentParams) + is + URI : LSP.Structures.DocumentUri renames Value.textDocument.uri; + File : constant GNATCOLL.VFS.Virtual_File := Self.To_File (URI); + Document : Internal_Document_Access; + begin + if Self.Open_Documents.Contains (File) then + Document := Self.Open_Documents.Element (File); + + -- Remove the URI from the set of open documents now: this way, + -- the call to Flush_Document below will not attempt to reindex + -- from an open document, but from the file on disk. + Self.Open_Documents.Delete (File); + + for Context of Self.Contexts_For_URI (URI) loop + Context.Flush_Document (File); + end loop; + + Free (Document); + + else + -- We have received a didCloseTextDocument but the document was + -- not open: this is not supposed to happen, log it. + + Self.Tracer.Trace + ("received a On_DidClose_Notification for non-open document " + & "with uri: "); + Self.Tracer.Trace_Text (URI); + end if; + + -- Clean diagnostics up on closing document + Self.Clean_Diagnostics + (LSP.Ada_Documents.Document_Access (Document)); + end On_DidClose_Notification; + + ------------------------------------ + -- On_DidCreateFiles_Notification -- + ------------------------------------ + + overriding procedure On_DidCreateFiles_Notification + (Self : in out Message_Handler; + Value : LSP.Structures.CreateFilesParams) is + begin + Self.Log_Method_In ("On_DidCreateFiles_Notification"); + + -- New sources were created on this project, so recompute its view + + Self.Project_Tree.Update_Sources (With_Runtime => True); + + -- For each created file of Value.files: + -- - find the contexts that contains its directory + -- - add it to those contexts + -- - index it on those contexts + + for File of Value.files loop + declare + use VSS.Strings.Conversions; + + Created_File : constant GNATCOLL.VFS.Virtual_File := + Self.To_File (To_DocumentUri (File.uri)); + + function Has_Dir + (Context : LSP.Ada_Contexts.Context) + return Boolean + is (Context.List_Source_Directories.Contains + (Created_File.Dir)); + -- Return True if Old_File is a source of the project held by + -- Context. + + begin + for Context of Self.Contexts.Each_Context + (Has_Dir'Unrestricted_Access) + loop + Context.Include_File (Created_File); + Context.Index_File (Created_File); + + Self.Tracer.Trace + ("Included " & Created_File.Display_Base_Name + & " in context " & To_UTF_8_String (Context.Id)); + end loop; + end; + end loop; + + Self.Log_Method_Out ("On_DidCreateFiles_Notification"); + end On_DidCreateFiles_Notification; + + ------------------------------------ + -- On_DidDeleteFiles_Notification -- + ------------------------------------ + + overriding procedure On_DidDeleteFiles_Notification + (Self : in out Message_Handler; + Value : LSP.Structures.DeleteFilesParams) is + begin + Self.Log_Method_In ("On_DidDeleteFiles_Notification"); + + -- Some project sources were deleted, so recompute its view + + Self.Project_Tree.Update_Sources (With_Runtime => True); + + -- For each delete file of Value.files: + -- - find the contexts that contains it + -- - remove it from those contexts + -- - re-index it on those contexts so that an empty unit is reparsed + + for File of Value.files loop + declare + Deleted_File : constant GNATCOLL.VFS.Virtual_File := + Self.To_File (To_DocumentUri (File.uri)); + + function Has_File + (Context : LSP.Ada_Contexts.Context) + return Boolean + is (Context.Is_Part_Of_Project (To_DocumentUri (File.uri))); + -- Return True if Old_File is a source of the project held by + -- Context. + + begin + for Context of Self.Contexts.Each_Context + (Has_File'Unrestricted_Access) + loop + Context.Exclude_File (Deleted_File); + Context.Index_File (Deleted_File); + + Self.Tracer.Trace + ("Excluded " & Deleted_File.Display_Base_Name + & " from context " + & VSS.Strings.Conversions.To_UTF_8_String (Context.Id)); + end loop; + end; + end loop; + + Self.Log_Method_Out ("On_DidDeleteFiles_Notification"); + end On_DidDeleteFiles_Notification; + --------------------------- -- On_Initialize_Request -- --------------------------- @@ -476,4 +663,20 @@ package body LSP.Ada_Handlers is end if; end Publish_Diagnostics; + ----------------------- + -- Clean_Diagnostics -- + ----------------------- + + procedure Clean_Diagnostics + (Self : in out Message_Handler'Class; + Document : not null LSP.Ada_Documents.Document_Access) + is + Diag : LSP.Structures.PublishDiagnosticsParams; + begin + if Self.Configuration.Diagnostics_Enabled then + Diag.uri := Document.URI; + Self.Sender.On_PublishDiagnostics_Notification (Diag); + end if; + end Clean_Diagnostics; + end LSP.Ada_Handlers; diff --git a/source/ada/lsp-ada_handlers.ads b/source/ada/lsp-ada_handlers.ads index 1b8911cc0..42d6fb897 100644 --- a/source/ada/lsp-ada_handlers.ads +++ b/source/ada/lsp-ada_handlers.ads @@ -225,10 +225,6 @@ private Id : LSP.Structures.Integer_Or_Virtual_String; Value : LSP.Structures.FoldingRangeParams); - overriding procedure On_DidChange_Notification - (Self : in out Message_Handler; - Value : LSP.Structures.DidChangeTextDocumentParams); - overriding procedure On_DidChangeConfiguration_Notification (Self : in out Message_Handler; Value : LSP.Structures.DidChangeConfigurationParams); @@ -237,4 +233,20 @@ private (Self : in out Message_Handler; Value : LSP.Structures.DidOpenTextDocumentParams); + overriding procedure On_DidChange_Notification + (Self : in out Message_Handler; + Value : LSP.Structures.DidChangeTextDocumentParams); + + overriding procedure On_DidClose_Notification + (Self : in out Message_Handler; + Value : LSP.Structures.DidCloseTextDocumentParams); + + overriding procedure On_DidCreateFiles_Notification + (Self : in out Message_Handler; + Value : LSP.Structures.CreateFilesParams); + + overriding procedure On_DidDeleteFiles_Notification + (Self : in out Message_Handler; + Value : LSP.Structures.DeleteFilesParams); + end LSP.Ada_Handlers; From feb59c5d118198cfb6e0cb99c90997e687846e80 Mon Sep 17 00:00:00 2001 From: Andry Ogorodnik Date: Wed, 16 Aug 2023 15:26:55 +0000 Subject: [PATCH 029/152] Implemented rest of Did* methods --- source/ada/lsp-ada_handlers.adb | 217 +++++++++++++++++++++++++++++++- source/ada/lsp-ada_handlers.ads | 8 ++ 2 files changed, 223 insertions(+), 2 deletions(-) diff --git a/source/ada/lsp-ada_handlers.adb b/source/ada/lsp-ada_handlers.adb index ba890af60..8a9587a42 100644 --- a/source/ada/lsp-ada_handlers.adb +++ b/source/ada/lsp-ada_handlers.adb @@ -15,6 +15,7 @@ -- of the license. -- ------------------------------------------------------------------------------ +with Ada.Containers.Indefinite_Hashed_Maps; with Ada.Exceptions; with Ada.Unchecked_Deallocation; @@ -62,6 +63,11 @@ package body LSP.Ada_Handlers is function To_DocumentUri (X : VSS.Strings.Virtual_String) return LSP.Structures.DocumentUri is (X with null record); + function To_DocumentUri + (X : LSP.Structures.URI) + return LSP.Structures.DocumentUri is + (VSS.Strings.Virtual_String (X) with null record); + EmptyDocumentUri : constant LSP.Structures.DocumentUri := To_DocumentUri (VSS.Strings.Empty_Virtual_String); @@ -93,9 +99,11 @@ package body LSP.Ada_Handlers is Name : String; URI : LSP.Structures.DocumentUri := EmptyDocumentUri) is begin - Self.Tracer.Trace ("In Message_Handler " & Name); if not URI.Is_Empty then + Self.Tracer.Trace ("In Message_Handler " & Name & " URI:"); Self.Tracer.Trace_Text (URI); + else + Self.Tracer.Trace ("In Message_Handler " & Name); end if; end Log_Method_In; @@ -359,7 +367,7 @@ package body LSP.Ada_Handlers is new LSP.Ada_Handlers.Project_Diagnostics.Diagnostic_Source (Self'Unchecked_Access); begin - Self.Log_Method_In ("Text_Document_Did_Open. Uri :", URI); + Self.Log_Method_In ("Text_Document_Did_Open", URI); -- Some clients don't properly call initialize, or don't pass the -- project to didChangeConfiguration: fallback here on loading a @@ -541,6 +549,211 @@ package body LSP.Ada_Handlers is Self.Log_Method_Out ("On_DidDeleteFiles_Notification"); end On_DidDeleteFiles_Notification; + ------------------------------------ + -- On_DidRenameFiles_Notification -- + ------------------------------------ + + overriding procedure On_DidRenameFiles_Notification + (Self : in out Message_Handler; + Value : LSP.Structures.RenameFilesParams) + is + use LSP.Ada_Context_Sets; + + package URI_Contexts_Maps is new + Ada.Containers.Indefinite_Hashed_Maps + (Key_Type => LSP.Structures.DocumentUri, + Element_Type => Context_Lists.List, + Hash => LSP.Structures.Get_Hash, + Equivalent_Keys => LSP.Structures."=", + "=" => Context_Lists."="); + + subtype URI_Contexts_Map is URI_Contexts_Maps.Map; + + URIs_Contexts : URI_Contexts_Map; + + begin + Self.Log_Method_In ("On_DidRenameFiles_Notification"); + + -- Some project sources were renamed, so recompute its view + + Self.Project_Tree.Update_Sources (With_Runtime => True); + + -- For each oldUri of Value.files: + -- - map it to a list of context that contains it + -- - remove it from those contexts + -- - re-index it on those contexts so that an empty unit is reparsed + + for File_Rename of Value.files loop + declare + use VSS.Strings.Conversions; + + Old_File : constant GNATCOLL.VFS.Virtual_File := + Self.To_File (To_DocumentUri (File_Rename.oldUri)); + + function Has_File + (Context : LSP.Ada_Contexts.Context) + return Boolean + is (Context.Is_Part_Of_Project + (To_DocumentUri (File_Rename.oldUri))); + -- Return True if Old_File is a source of the project held by + -- Context. + + URI_Contexts : Context_Lists.List; + + begin + for Context of Self.Contexts.Each_Context + (Has_File'Unrestricted_Access) + loop + URI_Contexts.Append (Context); + Context.Exclude_File (Old_File); + Context.Index_File (Old_File); + + Self.Tracer.Trace + ("Excluded " & Old_File.Display_Full_Name + & " from context " & To_UTF_8_String (Context.Id)); + end loop; + + URIs_Contexts.Insert + (To_DocumentUri (File_Rename.oldUri), URI_Contexts); + end; + end loop; + + -- For each (oldUri, newUri) tuple: + -- - add newUri to all contexts that contained oldUri + -- - index the newUri (using the appriate method depending if + -- (there's an open document of not) + + for File_Rename of Value.files loop + declare + use VSS.Strings.Conversions; + use type LSP.Ada_Documents.Document_Access; + + New_File : constant GNATCOLL.VFS.Virtual_File := + Self.To_File (To_DocumentUri (File_Rename.newUri)); + Document : constant LSP.Ada_Documents.Document_Access := + Get_Open_Document (Self, To_DocumentUri (File_Rename.newUri)); + Is_Document_Open : constant Boolean := Document /= null; + + begin + for Context of URIs_Contexts.Constant_Reference + (To_DocumentUri (File_Rename.oldUri)) + loop + Context.Include_File (New_File); + if Is_Document_Open then + Context.Index_Document (Document.all); + else + Context.Index_File (New_File); + end if; + Self.Tracer.Trace + ("Included " & New_File.Display_Base_Name & " in context " + & To_UTF_8_String (Context.Id)); + end loop; + end; + end loop; + + Self.Log_Method_Out ("On_DidRenameFiles_Notification"); + end On_DidRenameFiles_Notification; + + ----------------------------------------------- + -- On_DidChangeWorkspaceFolders_Notification -- + ----------------------------------------------- + + overriding procedure On_DidChangeWorkspaceFolders_Notification + (Self : in out Message_Handler; + Value : LSP.Structures.DidChangeWorkspaceFoldersParams) + is + use type LSP.Ada_Documents.Document_Access; + + URI : LSP.Structures.DocumentUri; + File : GNATCOLL.VFS.Virtual_File; + + procedure Process_Created_File; + -- Processes a created file + + procedure Process_Deleted_File; + -- Processes a deleted file + + -------------------------- + -- Process_Created_File -- + -------------------------- + + procedure Process_Created_File + is + use VSS.Strings.Conversions; + + Contexts : constant LSP.Ada_Context_Sets.Context_Lists.List := + Self.Contexts_For_URI (URI); + + function Has_Dir + (Context : LSP.Ada_Contexts.Context) + return Boolean + is (Context.List_Source_Directories.Contains (File.Dir)); + -- Return True if File is in a source directory of the project held + -- by Context. + + begin + -- If the file was created by the client, then the DidCreateFiles + -- notification might have been received from it. In that case, + -- Contexts wont be empty, and all we need to do is check if + -- there's an open document. If there is, it takes precedence over + -- the filesystem. + -- If Contexts is empty, then we need to check if is a new source + -- that needs to be added. For instance, a source that was moved + -- to the the project source directories. + + if Contexts.Is_Empty then + for Context of Self.Contexts.Each_Context + (Has_Dir'Unrestricted_Access) + loop + Context.Include_File (File); + Context.Index_File (File); + + Self.Tracer.Trace + ("Included " & File.Display_Base_Name + & " in context " & To_UTF_8_String (Context.Id)); + end loop; + + else + if Self.Get_Open_Document (URI) = null then + for Context of Contexts loop + Context.Index_File (File); + end loop; + end if; + end if; + end Process_Created_File; + + --------------------------- + -- Process_Deleted_Files -- + --------------------------- + + procedure Process_Deleted_File is + begin + if Self.Get_Open_Document (URI) = null then + -- If there is no document, remove from the sources list + -- and reindex the file for each context where it is + -- relevant. + for C of Self.Contexts_For_URI (URI) loop + C.Exclude_File (File); + C.Index_File (File); + end loop; + end if; + end Process_Deleted_File; + + begin + -- Look through each change, filtering non Ada source files + for Change of Value.event.added loop + URI := To_DocumentUri (Change.uri); + File := Self.To_File (URI); + Process_Created_File; + end loop; + + for Change of Value.event.removed loop + URI := To_DocumentUri (Change.uri); + File := Self.To_File (URI); + Process_Deleted_File; + end loop; + end On_DidChangeWorkspaceFolders_Notification; + --------------------------- -- On_Initialize_Request -- --------------------------- diff --git a/source/ada/lsp-ada_handlers.ads b/source/ada/lsp-ada_handlers.ads index 42d6fb897..25a81edaf 100644 --- a/source/ada/lsp-ada_handlers.ads +++ b/source/ada/lsp-ada_handlers.ads @@ -249,4 +249,12 @@ private (Self : in out Message_Handler; Value : LSP.Structures.DeleteFilesParams); + overriding procedure On_DidRenameFiles_Notification + (Self : in out Message_Handler; + Value : LSP.Structures.RenameFilesParams); + + overriding procedure On_DidChangeWorkspaceFolders_Notification + (Self : in out Message_Handler; + Value : LSP.Structures.DidChangeWorkspaceFoldersParams); + end LSP.Ada_Handlers; From a8cf159a3b22bd8c201c9ce5ff8601314a7ef43c Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Thu, 17 Aug 2023 09:02:20 +0300 Subject: [PATCH 030/152] Fix LSP Any reading --- source/lsp_3.17/lsp-input_tools.adb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/lsp_3.17/lsp-input_tools.adb b/source/lsp_3.17/lsp-input_tools.adb index 4f6dcf4af..c3e406291 100644 --- a/source/lsp_3.17/lsp-input_tools.adb +++ b/source/lsp_3.17/lsp-input_tools.adb @@ -58,6 +58,8 @@ package body LSP.Input_Tools is when End_Array | End_Object => -1, when others => 0); + Handler.Read_Next; + exit when Level = 0; end loop; end Read_LSPAny_Class; From 23ee85c836d23cc694b4d1a69db1315220a5d7d3 Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Wed, 16 Aug 2023 19:32:58 +0300 Subject: [PATCH 031/152] Turn rootUri into a directory format --- .../ada/lsp-ada_handlers-project_loading.adb | 27 +++++++++++++++---- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/source/ada/lsp-ada_handlers-project_loading.adb b/source/ada/lsp-ada_handlers-project_loading.adb index 44b054c8c..33ab866f5 100644 --- a/source/ada/lsp-ada_handlers-project_loading.adb +++ b/source/ada/lsp-ada_handlers-project_loading.adb @@ -42,6 +42,8 @@ with LSP.Ada_Handlers.File_Readers; with LSP.Enumerations; with LSP.Structures; +with URIs; + package body LSP.Ada_Handlers.Project_Loading is Line_Feed : constant Wide_Wide_Character := @@ -112,10 +114,8 @@ package body LSP.Ada_Handlers.Project_Loading is (VSS.Strings.Conversions.To_Virtual_String (Value.Display_Full_Name)); -- Cast Virtual_File to Virtual_String - function Root (Self : Message_Handler'Class) return GNATCOLL.VFS.Virtual_File - is (GNATCOLL.VFS.Create_From_UTF8 - (VSS.Strings.Conversions.To_UTF_8_String - (Self.Client.Root))); + function Root + (Self : Message_Handler'Class) return GNATCOLL.VFS.Virtual_File; -- Return the root directory of the client workspace type Environment is record @@ -158,7 +158,7 @@ package body LSP.Ada_Handlers.Project_Loading is if not Self.Client.Root.Is_Empty then declare Files : GNATCOLL.VFS.File_Array_Access := - Root (Self).Read_Dir (GNATCOLL.VFS.Files_Only); + Root (Self).Dir.Read_Dir (GNATCOLL.VFS.Files_Only); begin for X of Files.all loop if X.Has_Suffix (".gpr") then @@ -737,6 +737,23 @@ package body LSP.Ada_Handlers.Project_Loading is end if; end Reload_Project; + ---------- + -- Root -- + ---------- + + function Root + (Self : Message_Handler'Class) return GNATCOLL.VFS.Virtual_File + is + Value : constant VSS.Strings.Virtual_String := Self.Client.Root; + Root : constant String := + VSS.Strings.Conversions.To_UTF_8_String (Value); + begin + return GNATCOLL.VFS.Create_From_UTF8 + (if Value.Starts_With ("file://") + then URIs.Conversions.To_File (Root, True) + else Root); + end Root; + --------------------------------------- -- Update_Project_Predefined_Sources -- --------------------------------------- From a841ee1b785a890a929060b0748f72ac5539679a Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Thu, 17 Aug 2023 09:37:24 +0300 Subject: [PATCH 032/152] Mark failing tests as XFAIL You can bulk edit for undo with this command: find testsuite/ -name test.yaml -exec sed -i -e '/Skip till 3.17 ready/,$d' {} \; Refs #1170 --- testsuite/ada_lsp/0003-get_symbols/test.yaml | 3 +++ testsuite/ada_lsp/C825-005.xrefs.extending/test.yaml | 3 +++ testsuite/ada_lsp/D301-004.xrefs.generics/test.yaml | 3 +++ .../ada_lsp/D803-003.xrefs.generics_go_to_body/test.yaml | 3 +++ testsuite/ada_lsp/F131-024.xrefs.separate_body/test.yaml | 3 +++ testsuite/ada_lsp/F222-029.xrefs.prefixed_notation/test.yaml | 3 +++ .../ada_lsp/G323-009.tooltips.function_prototype/test.yaml | 3 +++ .../JB24-033.xrefs.no_refs_for_non_loaded_projects/test.yaml | 3 +++ .../O208-003.xrefs.aggregate_library_projects/test.yaml | 3 +++ testsuite/ada_lsp/P107-003.refactoring.underscores/test.yaml | 3 +++ .../ada_lsp/P429-023.refactoring.rename_clauses/test.yaml | 3 +++ .../ada_lsp/QB01-002.xrefs.non_ascii_documentation/test.yaml | 3 +++ testsuite/ada_lsp/S312-063.documentSymbol.constant/test.yaml | 3 +++ .../S314-015.refactor_change_parameter_mode_0/test.yaml | 3 +++ .../ada_lsp/S314-015.refactor_move_parameter_0/test.yaml | 3 +++ .../ada_lsp/S314-015.refactor_remove_parameter_0/test.yaml | 3 +++ testsuite/ada_lsp/S510-020.exceptions_reporting/test.yaml | 3 +++ testsuite/ada_lsp/S516-013.no_file/test.yaml | 3 +++ testsuite/ada_lsp/S628-009.formatting/test.yaml | 3 +++ testsuite/ada_lsp/S820-016.called_by.entry/test.yaml | 3 +++ testsuite/ada_lsp/SA11-038_Name_Collision/test.yaml | 5 ++++- testsuite/ada_lsp/SA11-040.definition.fallback/test.yaml | 3 +++ testsuite/ada_lsp/SA21-029.documentSymbol.function/test.yaml | 3 +++ testsuite/ada_lsp/SA21-029.documentSymbol.with/test.yaml | 3 +++ testsuite/ada_lsp/SA22-029.rename_in_comments/test.yaml | 3 +++ testsuite/ada_lsp/SA22-032.folding/test.yaml | 3 +++ testsuite/ada_lsp/SA24-055.called_by_on_abstract/test.yaml | 3 +++ .../SB08-025.goto.advanced_decltype/test.yaml | 3 +++ .../ada_lsp/SB14-027.references.tagged_access_kind/test.yaml | 3 +++ testsuite/ada_lsp/SB14-037.references.access_kind/test.yaml | 3 +++ testsuite/ada_lsp/SB21-042.tooltips.aspects/test.yaml | 3 +++ testsuite/ada_lsp/SC16-095.fallback_when_no_body/test.yaml | 3 +++ testsuite/ada_lsp/SC28-001.named.parameters.0/test.yaml | 3 +++ testsuite/ada_lsp/T123-048.incremental_editing/test.yaml | 3 +++ testsuite/ada_lsp/T318-086.suppress.separates.0/test.yaml | 3 +++ testsuite/ada_lsp/T527-019.range_formatting/test.yaml | 3 +++ .../ada_lsp/T616-016.formatting_incorrect_code/test.yaml | 3 +++ testsuite/ada_lsp/T623-017.format_uses_project/test.yaml | 3 +++ .../ada_lsp/T709-018.is_called_by.name_collision/test.yaml | 3 +++ .../ada_lsp/T713-012.completion.generic_package/test.yaml | 3 +++ testsuite/ada_lsp/T723-027.signatureHelp.nested/test.yaml | 3 +++ .../ada_lsp/T723-027.signatureHelp.overloaded/test.yaml | 3 +++ testsuite/ada_lsp/T723-027.signatureHelp.simple/test.yaml | 3 +++ testsuite/ada_lsp/T826-026.search/test.yaml | 3 +++ testsuite/ada_lsp/T827-018.documentSymbol.pragma/test.yaml | 3 +++ testsuite/ada_lsp/T923-019.project_reload.gnatpp/test.yaml | 3 +++ .../ada_lsp/T928-015.formatting.end_of_buffer/test.yaml | 3 +++ testsuite/ada_lsp/TB12-017.named.parameters.0/test.yaml | 3 +++ testsuite/ada_lsp/TB12-017.named.parameters.1/test.yaml | 3 +++ testsuite/ada_lsp/TB12-017.named.parameters.2/test.yaml | 3 +++ testsuite/ada_lsp/U121-013.enum_references/test.yaml | 3 +++ testsuite/ada_lsp/U415-027.refactor_safe_rename_0/test.yaml | 3 +++ testsuite/ada_lsp/U415-027.refactor_safe_rename_1/test.yaml | 3 +++ .../U416-030.refactor_change_parameter_mode_0/test.yaml | 3 +++ .../ada_lsp/U416-030.refactor_remove_parameter_0/test.yaml | 3 +++ testsuite/ada_lsp/U429-030.signatureHelp.dot_call/test.yaml | 3 +++ .../test.yaml | 3 +++ testsuite/ada_lsp/U614-038.edits.no_project/test.yaml | 3 +++ .../ada_lsp/U721-012.signatureHelp.null_expr_funcs/test.yaml | 3 +++ testsuite/ada_lsp/U805-023.signatureHelp.context/test.yaml | 3 +++ .../ada_lsp/U805-023.signatureHelp.designators/test.yaml | 3 +++ .../ada_lsp/U909-007.signatureHelp.closing_par/test.yaml | 3 +++ testsuite/ada_lsp/U909-007.signatureHelp.type_cast/test.yaml | 3 +++ .../ada_lsp/U910-043.client_capabilities.optional/test.yaml | 3 +++ testsuite/ada_lsp/U913-028.completion.params/test.yaml | 3 +++ .../ada_lsp/U915-024.completion.invisible_snippets/test.yaml | 3 +++ .../U921-010.completion.no_generic_duplicates/test.yaml | 3 +++ .../UA20-011.parameter_completion.multiple_order/test.yaml | 3 +++ .../UA21-041.parameter_completion.dotted_call/test.yaml | 3 +++ .../ada_lsp/UA28-007.Did_Change_Watched_Files_0/test.yaml | 2 ++ testsuite/ada_lsp/UA28-007.Did_Create_Files_0/test.yaml | 3 +++ testsuite/ada_lsp/UA28-007.Did_Delete_Files_0/test.yaml | 2 ++ testsuite/ada_lsp/UA28-007.Did_Rename_Files_0/test.yaml | 3 +++ testsuite/ada_lsp/V201-024.goto.entry_and_asserts/test.yaml | 3 +++ .../ada_lsp/V216-030.completion.attribute_in_decl/test.yaml | 3 +++ .../ada_lsp/V628-012.highlighting.defining_names/test.yaml | 3 +++ testsuite/ada_lsp/V628-012.highlighting.no-libs/test.yaml | 3 +++ testsuite/ada_lsp/V628-024.symbol_diff/test.yaml | 3 +++ .../ada_lsp/V701-011.formatting.options_precedence/test.yaml | 3 +++ .../ada_lsp/V705-026.completion.predefined_types/test.yaml | 3 +++ testsuite/ada_lsp/aggregate.is_called_by/test.yaml | 3 +++ .../ada_lsp/aggregate.references_after_update/test.yaml | 3 +++ testsuite/ada_lsp/aggregate.simple/test.yaml | 3 +++ testsuite/ada_lsp/callHierarchy.abstract_subps/test.yaml | 3 +++ testsuite/ada_lsp/called_by.null_subp/test.yaml | 3 +++ testsuite/ada_lsp/called_by.renames/test.yaml | 3 +++ testsuite/ada_lsp/called_by/test.yaml | 3 +++ testsuite/ada_lsp/called_by_dispatching/test.yaml | 3 +++ testsuite/ada_lsp/called_by_not_open/test.yaml | 3 +++ testsuite/ada_lsp/callgraph.named_blocks/test.yaml | 3 +++ testsuite/ada_lsp/calls/test.yaml | 3 +++ testsuite/ada_lsp/cancel/test.yaml | 3 +++ testsuite/ada_lsp/commands.other_file/test.yaml | 3 +++ testsuite/ada_lsp/completion.aggregates.complex/test.yaml | 3 +++ .../ada_lsp/completion.aggregates.derived_private/test.yaml | 3 +++ .../ada_lsp/completion.aggregates.derived_types/test.yaml | 3 +++ .../ada_lsp/completion.aggregates.incomplete_type/test.yaml | 3 +++ .../completion.aggregates.multiple_discriminants/test.yaml | 3 +++ testsuite/ada_lsp/completion.aggregates.simple/test.yaml | 3 +++ .../ada_lsp/completion.aggregates.snippet_indexes/test.yaml | 3 +++ testsuite/ada_lsp/completion.aspects.filtering/test.yaml | 3 +++ testsuite/ada_lsp/completion.aspects/test.yaml | 3 +++ testsuite/ada_lsp/completion.complex_renames/test.yaml | 3 +++ testsuite/ada_lsp/completion.defining_names/test.yaml | 3 +++ testsuite/ada_lsp/completion.dotted_call.keyword/test.yaml | 3 +++ testsuite/ada_lsp/completion.duplicates/test.yaml | 3 +++ testsuite/ada_lsp/completion.end_labels/test.yaml | 3 +++ testsuite/ada_lsp/completion.end_labels2/test.yaml | 3 +++ testsuite/ada_lsp/completion.invisible.runtime/test.yaml | 4 +++- testsuite/ada_lsp/completion.invisible/test.yaml | 3 +++ testsuite/ada_lsp/completion.invisible2/test.yaml | 3 +++ testsuite/ada_lsp/completion.invisible3/test.yaml | 3 +++ testsuite/ada_lsp/completion.invisible4/test.yaml | 3 +++ testsuite/ada_lsp/completion.invisible5/test.yaml | 3 +++ testsuite/ada_lsp/completion.keywords/test.yaml | 3 +++ testsuite/ada_lsp/completion.lazy_computation/test.yaml | 3 +++ testsuite/ada_lsp/completion.no_snippet_for_params/test.yaml | 3 +++ testsuite/ada_lsp/completion.num_literals/test.yaml | 3 +++ .../ada_lsp/completion.param.no_named_notation/test.yaml | 3 +++ testsuite/ada_lsp/completion.param.non_basic_calls/test.yaml | 3 +++ testsuite/ada_lsp/completion.snippet.formatting/test.yaml | 3 +++ testsuite/ada_lsp/completion.snippet.formatting2/test.yaml | 3 +++ testsuite/ada_lsp/completion.snippet.formatting3/test.yaml | 3 +++ testsuite/ada_lsp/completion.subp_parameters/test.yaml | 3 +++ .../ada_lsp/completion.subp_params_dotted_names/test.yaml | 3 +++ .../ada_lsp/completion.use_clauses.multiple_with/test.yaml | 3 +++ testsuite/ada_lsp/completion.use_clauses/test.yaml | 3 +++ testsuite/ada_lsp/declaration.overridings_on_usage/test.yaml | 3 +++ testsuite/ada_lsp/declaration/test.yaml | 3 +++ testsuite/ada_lsp/def_name/test.yaml | 3 +++ testsuite/ada_lsp/definition_and_overridings/test.yaml | 3 +++ testsuite/ada_lsp/definition_parents/test.yaml | 3 +++ testsuite/ada_lsp/document_highlight/test.yaml | 3 +++ .../ada_lsp/documentation.subprogram-from-generic/test.yaml | 3 +++ testsuite/ada_lsp/editor.incremental/test.yaml | 3 +++ testsuite/ada_lsp/find_all_refs/test.yaml | 3 +++ testsuite/ada_lsp/find_all_refs_child_package/test.yaml | 3 +++ testsuite/ada_lsp/find_all_refs_defining_names/test.yaml | 3 +++ testsuite/ada_lsp/find_all_refs_kinds/test.yaml | 3 +++ testsuite/ada_lsp/find_all_refs_subp/test.yaml | 3 +++ testsuite/ada_lsp/get_symbol_hier/test.yaml | 3 +++ testsuite/ada_lsp/hover.for_loops/test.yaml | 3 +++ testsuite/ada_lsp/implementation.aggregates/test.yaml | 3 +++ testsuite/ada_lsp/implementation.overridings/test.yaml | 3 +++ testsuite/ada_lsp/implementation/test.yaml | 3 +++ testsuite/ada_lsp/incorrect_fallback/test.yaml | 3 +++ testsuite/ada_lsp/indexing_progress/test.yaml | 3 +++ testsuite/ada_lsp/invalid_project/test.yaml | 3 +++ testsuite/ada_lsp/invalidation.file_contents/test.yaml | 3 +++ testsuite/ada_lsp/named_params.dot_calls/test.yaml | 3 +++ testsuite/ada_lsp/named_params/test.yaml | 3 +++ testsuite/ada_lsp/no_root/test.yaml | 3 +++ testsuite/ada_lsp/non_project_files/test.yaml | 3 +++ testsuite/ada_lsp/onTypeFormatting/indentOnlyFalse/test.yaml | 3 +++ testsuite/ada_lsp/onTypeFormatting/indentOnlyTrue/test.yaml | 3 +++ testsuite/ada_lsp/preprocessor/test.yaml | 3 +++ testsuite/ada_lsp/project_config.alire/test.yaml | 3 ++- testsuite/ada_lsp/project_config.file/test.yaml | 3 +++ testsuite/ada_lsp/project_config.init/test.yaml | 3 +++ testsuite/ada_lsp/project_config.missing_file/test.yaml | 3 +++ testsuite/ada_lsp/project_config/test.yaml | 3 +++ testsuite/ada_lsp/project_reload.command/test.yaml | 3 +++ testsuite/ada_lsp/project_reload/test.yaml | 3 +++ testsuite/ada_lsp/project_search/test.yaml | 3 +++ testsuite/ada_lsp/project_symlinks/test.yaml | 4 +++- testsuite/ada_lsp/publish_diag/test.yaml | 3 +++ .../UB30-006_range_format_whole_document/test.yaml | 3 +++ .../ada_lsp/range_formatting/W103-015_GitHub-1008/test.yaml | 3 +++ .../range_formatting/W103-015_GitHub-1073-1074/test.yaml | 3 +++ .../ada_lsp/range_formatting/W103-015_GitHub-1086/test.yaml | 3 +++ .../ada_lsp/refactoring_add_parameter/S314-015/test.yaml | 3 +++ .../ada_lsp/refactoring_add_parameter/UA25-015/test.yaml | 3 +++ .../S314-015/test.yaml | 3 +++ .../refactoring_change_parameters_type/S314-015/test.yaml | 3 +++ testsuite/ada_lsp/refactoring_diagnostics/test.yaml | 3 +++ .../refactoring_extract_subprogram/SA11-047_0/test.yaml | 3 +++ .../refactoring_extract_subprogram/SA11-047_1/test.yaml | 3 +++ .../U511-009.refactoring.import_with_use/test.yaml | 3 +++ .../suggestions_with_nested_packages/test.yaml | 3 +++ .../refactoring_introduce_parameter/SA11-051/test.yaml | 3 +++ .../refactoring_pull_up_declaration/V207-019/test.yaml | 3 +++ .../ada_lsp/refactoring_replace_type/Q817-007/test.yaml | 3 +++ .../ada_lsp/refactoring_sort_dependencies/SA22-035/test.yaml | 3 +++ testsuite/ada_lsp/references.child/test.yaml | 3 +++ testsuite/ada_lsp/references.overriding/test.yaml | 3 +++ testsuite/ada_lsp/rename.not_up_to_date/test.yaml | 3 +++ testsuite/ada_lsp/rename.prepare/test.yaml | 3 +++ testsuite/ada_lsp/rename.primitive_parameters/test.yaml | 3 +++ testsuite/ada_lsp/rename.tagged_type_primitives/test.yaml | 3 +++ testsuite/ada_lsp/rename/test.yaml | 3 +++ testsuite/ada_lsp/show_dependencies.aggregate/test.yaml | 3 +++ testsuite/ada_lsp/show_dependencies/test.yaml | 3 +++ testsuite/ada_lsp/signature.aggregate/test.yaml | 3 +++ testsuite/ada_lsp/signature.aggregate2/test.yaml | 3 +++ testsuite/ada_lsp/signature.generic/test.yaml | 3 +++ testsuite/ada_lsp/skip__standard/test.yaml | 3 +++ testsuite/ada_lsp/spec_from_body/test.yaml | 3 +++ testsuite/ada_lsp/type_definition.aggregate/test.yaml | 3 +++ testsuite/ada_lsp/type_definition.def_name/test.yaml | 3 +++ testsuite/ada_lsp/type_definition/test.yaml | 3 +++ testsuite/ada_lsp/workspace_symbol/test.yaml | 3 +++ testsuite/gpr_lsp/get_symbols/test.yaml | 3 +++ testsuite/gpr_lsp/get_symbols_hierarchy/test.yaml | 3 +++ testsuite/gpr_lsp/publish_diag/test.yaml | 3 +++ 204 files changed, 610 insertions(+), 4 deletions(-) diff --git a/testsuite/ada_lsp/0003-get_symbols/test.yaml b/testsuite/ada_lsp/0003-get_symbols/test.yaml index 585065161..ef14a8b70 100644 --- a/testsuite/ada_lsp/0003-get_symbols/test.yaml +++ b/testsuite/ada_lsp/0003-get_symbols/test.yaml @@ -1 +1,4 @@ title: '0003-get_symbols' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/C825-005.xrefs.extending/test.yaml b/testsuite/ada_lsp/C825-005.xrefs.extending/test.yaml index b22197cfb..4599bc1a2 100644 --- a/testsuite/ada_lsp/C825-005.xrefs.extending/test.yaml +++ b/testsuite/ada_lsp/C825-005.xrefs.extending/test.yaml @@ -1 +1,4 @@ title: 'C825-005.xrefs.extending' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/D301-004.xrefs.generics/test.yaml b/testsuite/ada_lsp/D301-004.xrefs.generics/test.yaml index 4061ba58c..a5b2efabd 100644 --- a/testsuite/ada_lsp/D301-004.xrefs.generics/test.yaml +++ b/testsuite/ada_lsp/D301-004.xrefs.generics/test.yaml @@ -1 +1,4 @@ title: 'D301-004.xrefs.generics' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/D803-003.xrefs.generics_go_to_body/test.yaml b/testsuite/ada_lsp/D803-003.xrefs.generics_go_to_body/test.yaml index 423af828f..07a554598 100644 --- a/testsuite/ada_lsp/D803-003.xrefs.generics_go_to_body/test.yaml +++ b/testsuite/ada_lsp/D803-003.xrefs.generics_go_to_body/test.yaml @@ -1 +1,4 @@ title: 'D803-003.xrefs.generics_go_to_body' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/F131-024.xrefs.separate_body/test.yaml b/testsuite/ada_lsp/F131-024.xrefs.separate_body/test.yaml index e51005203..783c63e30 100644 --- a/testsuite/ada_lsp/F131-024.xrefs.separate_body/test.yaml +++ b/testsuite/ada_lsp/F131-024.xrefs.separate_body/test.yaml @@ -1 +1,4 @@ title: 'F131-024.xrefs.separate_body' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/F222-029.xrefs.prefixed_notation/test.yaml b/testsuite/ada_lsp/F222-029.xrefs.prefixed_notation/test.yaml index 55ba61ef5..fe3f1a477 100644 --- a/testsuite/ada_lsp/F222-029.xrefs.prefixed_notation/test.yaml +++ b/testsuite/ada_lsp/F222-029.xrefs.prefixed_notation/test.yaml @@ -1 +1,4 @@ title: 'F222-029.xrefs.prefixed_notation' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/G323-009.tooltips.function_prototype/test.yaml b/testsuite/ada_lsp/G323-009.tooltips.function_prototype/test.yaml index 41c51fbaf..cc8399663 100644 --- a/testsuite/ada_lsp/G323-009.tooltips.function_prototype/test.yaml +++ b/testsuite/ada_lsp/G323-009.tooltips.function_prototype/test.yaml @@ -1 +1,4 @@ title: 'G323-009.tooltips.function_prototype' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/JB24-033.xrefs.no_refs_for_non_loaded_projects/test.yaml b/testsuite/ada_lsp/JB24-033.xrefs.no_refs_for_non_loaded_projects/test.yaml index dda78a768..163f229a4 100644 --- a/testsuite/ada_lsp/JB24-033.xrefs.no_refs_for_non_loaded_projects/test.yaml +++ b/testsuite/ada_lsp/JB24-033.xrefs.no_refs_for_non_loaded_projects/test.yaml @@ -1 +1,4 @@ title: 'JB24-033.xrefs.no_refs_for_non_loaded_projects' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/O208-003.xrefs.aggregate_library_projects/test.yaml b/testsuite/ada_lsp/O208-003.xrefs.aggregate_library_projects/test.yaml index 7031b5e0a..6eab161d9 100644 --- a/testsuite/ada_lsp/O208-003.xrefs.aggregate_library_projects/test.yaml +++ b/testsuite/ada_lsp/O208-003.xrefs.aggregate_library_projects/test.yaml @@ -1 +1,4 @@ title: 'O208-003.xrefs.aggregate_library_projects' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/P107-003.refactoring.underscores/test.yaml b/testsuite/ada_lsp/P107-003.refactoring.underscores/test.yaml index 4a8d6c35b..a46e330ff 100644 --- a/testsuite/ada_lsp/P107-003.refactoring.underscores/test.yaml +++ b/testsuite/ada_lsp/P107-003.refactoring.underscores/test.yaml @@ -1 +1,4 @@ title: 'P107-003.refactoring.underscores' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/P429-023.refactoring.rename_clauses/test.yaml b/testsuite/ada_lsp/P429-023.refactoring.rename_clauses/test.yaml index 09b12a59b..6f0c2eac3 100644 --- a/testsuite/ada_lsp/P429-023.refactoring.rename_clauses/test.yaml +++ b/testsuite/ada_lsp/P429-023.refactoring.rename_clauses/test.yaml @@ -1 +1,4 @@ title: 'P429-023.refactoring.rename_clauses' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/QB01-002.xrefs.non_ascii_documentation/test.yaml b/testsuite/ada_lsp/QB01-002.xrefs.non_ascii_documentation/test.yaml index 52d5030c6..dcac71881 100644 --- a/testsuite/ada_lsp/QB01-002.xrefs.non_ascii_documentation/test.yaml +++ b/testsuite/ada_lsp/QB01-002.xrefs.non_ascii_documentation/test.yaml @@ -1 +1,4 @@ title: 'QB01-002.xrefs.non_ascii_documentation' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/S312-063.documentSymbol.constant/test.yaml b/testsuite/ada_lsp/S312-063.documentSymbol.constant/test.yaml index c45e0c130..37ed7ad4a 100644 --- a/testsuite/ada_lsp/S312-063.documentSymbol.constant/test.yaml +++ b/testsuite/ada_lsp/S312-063.documentSymbol.constant/test.yaml @@ -1 +1,4 @@ title: 'S312-063.documentSymbol.constant' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/S314-015.refactor_change_parameter_mode_0/test.yaml b/testsuite/ada_lsp/S314-015.refactor_change_parameter_mode_0/test.yaml index e9688a1ce..eb490028b 100644 --- a/testsuite/ada_lsp/S314-015.refactor_change_parameter_mode_0/test.yaml +++ b/testsuite/ada_lsp/S314-015.refactor_change_parameter_mode_0/test.yaml @@ -1 +1,4 @@ title: 'S314-015.refactor_change_parameter_mode_0' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/S314-015.refactor_move_parameter_0/test.yaml b/testsuite/ada_lsp/S314-015.refactor_move_parameter_0/test.yaml index 7f3f98bf5..02219d674 100644 --- a/testsuite/ada_lsp/S314-015.refactor_move_parameter_0/test.yaml +++ b/testsuite/ada_lsp/S314-015.refactor_move_parameter_0/test.yaml @@ -1 +1,4 @@ title: 'S314-015.refactor_move_parameter_0' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/S314-015.refactor_remove_parameter_0/test.yaml b/testsuite/ada_lsp/S314-015.refactor_remove_parameter_0/test.yaml index 3fae18358..452762ac8 100644 --- a/testsuite/ada_lsp/S314-015.refactor_remove_parameter_0/test.yaml +++ b/testsuite/ada_lsp/S314-015.refactor_remove_parameter_0/test.yaml @@ -1 +1,4 @@ title: 'S314-015.refactor_remove_parameter_0' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/S510-020.exceptions_reporting/test.yaml b/testsuite/ada_lsp/S510-020.exceptions_reporting/test.yaml index 3c0110260..0448db0dd 100644 --- a/testsuite/ada_lsp/S510-020.exceptions_reporting/test.yaml +++ b/testsuite/ada_lsp/S510-020.exceptions_reporting/test.yaml @@ -1 +1,4 @@ title: 'S510-020.exceptions_reporting' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/S516-013.no_file/test.yaml b/testsuite/ada_lsp/S516-013.no_file/test.yaml index d1704289e..a434bd3ed 100644 --- a/testsuite/ada_lsp/S516-013.no_file/test.yaml +++ b/testsuite/ada_lsp/S516-013.no_file/test.yaml @@ -1 +1,4 @@ title: 'S516-013.no_file' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/S628-009.formatting/test.yaml b/testsuite/ada_lsp/S628-009.formatting/test.yaml index 04b82edae..708977865 100644 --- a/testsuite/ada_lsp/S628-009.formatting/test.yaml +++ b/testsuite/ada_lsp/S628-009.formatting/test.yaml @@ -1 +1,4 @@ title: 'S628-009.formatting' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/S820-016.called_by.entry/test.yaml b/testsuite/ada_lsp/S820-016.called_by.entry/test.yaml index e8a5ea36c..d3cf58719 100644 --- a/testsuite/ada_lsp/S820-016.called_by.entry/test.yaml +++ b/testsuite/ada_lsp/S820-016.called_by.entry/test.yaml @@ -1 +1,4 @@ title: 'S820-016.called_by.entry' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/SA11-038_Name_Collision/test.yaml b/testsuite/ada_lsp/SA11-038_Name_Collision/test.yaml index 4b52ad242..88436ce87 100644 --- a/testsuite/ada_lsp/SA11-038_Name_Collision/test.yaml +++ b/testsuite/ada_lsp/SA11-038_Name_Collision/test.yaml @@ -1 +1,4 @@ -title: 'SA11-038_Name_Collision' \ No newline at end of file +title: 'SA11-038_Name_Collision' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/SA11-040.definition.fallback/test.yaml b/testsuite/ada_lsp/SA11-040.definition.fallback/test.yaml index f2901910c..7c189d630 100644 --- a/testsuite/ada_lsp/SA11-040.definition.fallback/test.yaml +++ b/testsuite/ada_lsp/SA11-040.definition.fallback/test.yaml @@ -1 +1,4 @@ title: 'SA11-040.definition.fallback' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/SA21-029.documentSymbol.function/test.yaml b/testsuite/ada_lsp/SA21-029.documentSymbol.function/test.yaml index 7b48ac5f4..37ee1d85c 100644 --- a/testsuite/ada_lsp/SA21-029.documentSymbol.function/test.yaml +++ b/testsuite/ada_lsp/SA21-029.documentSymbol.function/test.yaml @@ -1 +1,4 @@ title: 'SA21-029.documentSymbol.function' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/SA21-029.documentSymbol.with/test.yaml b/testsuite/ada_lsp/SA21-029.documentSymbol.with/test.yaml index 4cde640d4..b9f5554d4 100644 --- a/testsuite/ada_lsp/SA21-029.documentSymbol.with/test.yaml +++ b/testsuite/ada_lsp/SA21-029.documentSymbol.with/test.yaml @@ -1 +1,4 @@ title: 'SA21-029.documentSymbol.with' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/SA22-029.rename_in_comments/test.yaml b/testsuite/ada_lsp/SA22-029.rename_in_comments/test.yaml index 378761e87..69dea75db 100644 --- a/testsuite/ada_lsp/SA22-029.rename_in_comments/test.yaml +++ b/testsuite/ada_lsp/SA22-029.rename_in_comments/test.yaml @@ -1 +1,4 @@ title: 'SA22-029.rename_in_comments' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/SA22-032.folding/test.yaml b/testsuite/ada_lsp/SA22-032.folding/test.yaml index 54e3772e0..ad1816f99 100644 --- a/testsuite/ada_lsp/SA22-032.folding/test.yaml +++ b/testsuite/ada_lsp/SA22-032.folding/test.yaml @@ -1 +1,4 @@ title: 'SA22-032.folding' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/SA24-055.called_by_on_abstract/test.yaml b/testsuite/ada_lsp/SA24-055.called_by_on_abstract/test.yaml index 31eb6ebfa..32e646d96 100644 --- a/testsuite/ada_lsp/SA24-055.called_by_on_abstract/test.yaml +++ b/testsuite/ada_lsp/SA24-055.called_by_on_abstract/test.yaml @@ -1 +1,4 @@ title: 'SA24-055.called_by_on_abstract' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/SB08-025.goto.advanced_decltype/SB08-025.goto.advanced_decltype/test.yaml b/testsuite/ada_lsp/SB08-025.goto.advanced_decltype/SB08-025.goto.advanced_decltype/test.yaml index f389d4d3f..effbec7fb 100644 --- a/testsuite/ada_lsp/SB08-025.goto.advanced_decltype/SB08-025.goto.advanced_decltype/test.yaml +++ b/testsuite/ada_lsp/SB08-025.goto.advanced_decltype/SB08-025.goto.advanced_decltype/test.yaml @@ -1 +1,4 @@ title: 'SB08-025.goto.advanced_decltype' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/SB14-027.references.tagged_access_kind/test.yaml b/testsuite/ada_lsp/SB14-027.references.tagged_access_kind/test.yaml index 1fb50e67f..394a1c577 100644 --- a/testsuite/ada_lsp/SB14-027.references.tagged_access_kind/test.yaml +++ b/testsuite/ada_lsp/SB14-027.references.tagged_access_kind/test.yaml @@ -1 +1,4 @@ title: 'ada_lsp/SB14-027.references.tagged_access_kind' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/SB14-037.references.access_kind/test.yaml b/testsuite/ada_lsp/SB14-037.references.access_kind/test.yaml index 90f31395c..4d5dc492f 100644 --- a/testsuite/ada_lsp/SB14-037.references.access_kind/test.yaml +++ b/testsuite/ada_lsp/SB14-037.references.access_kind/test.yaml @@ -1 +1,4 @@ title: 'SB14-037.references.access_kind' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/SB21-042.tooltips.aspects/test.yaml b/testsuite/ada_lsp/SB21-042.tooltips.aspects/test.yaml index 949b5c801..e5fa87cf4 100644 --- a/testsuite/ada_lsp/SB21-042.tooltips.aspects/test.yaml +++ b/testsuite/ada_lsp/SB21-042.tooltips.aspects/test.yaml @@ -1 +1,4 @@ title: 'SB21-042.tooltips.aspects' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/SC16-095.fallback_when_no_body/test.yaml b/testsuite/ada_lsp/SC16-095.fallback_when_no_body/test.yaml index afb1465d5..92b0e3daf 100644 --- a/testsuite/ada_lsp/SC16-095.fallback_when_no_body/test.yaml +++ b/testsuite/ada_lsp/SC16-095.fallback_when_no_body/test.yaml @@ -1 +1,4 @@ title: 'SC16-095.fallback_when_no_body' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/SC28-001.named.parameters.0/test.yaml b/testsuite/ada_lsp/SC28-001.named.parameters.0/test.yaml index c007b5663..25ba1c4e9 100644 --- a/testsuite/ada_lsp/SC28-001.named.parameters.0/test.yaml +++ b/testsuite/ada_lsp/SC28-001.named.parameters.0/test.yaml @@ -1 +1,4 @@ title: 'SC28-001.named.parameters.0' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/T123-048.incremental_editing/test.yaml b/testsuite/ada_lsp/T123-048.incremental_editing/test.yaml index 0dbde29c0..ce760b0dc 100644 --- a/testsuite/ada_lsp/T123-048.incremental_editing/test.yaml +++ b/testsuite/ada_lsp/T123-048.incremental_editing/test.yaml @@ -1 +1,4 @@ title: 'T123-048.incremental_editing' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/T318-086.suppress.separates.0/test.yaml b/testsuite/ada_lsp/T318-086.suppress.separates.0/test.yaml index f89e21490..96ce7f29e 100644 --- a/testsuite/ada_lsp/T318-086.suppress.separates.0/test.yaml +++ b/testsuite/ada_lsp/T318-086.suppress.separates.0/test.yaml @@ -1 +1,4 @@ title: 'T318-086.suppress.separates.0' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/T527-019.range_formatting/test.yaml b/testsuite/ada_lsp/T527-019.range_formatting/test.yaml index 774cb511c..21e9b3c30 100644 --- a/testsuite/ada_lsp/T527-019.range_formatting/test.yaml +++ b/testsuite/ada_lsp/T527-019.range_formatting/test.yaml @@ -1 +1,4 @@ title: 'T527-019.range_formatting' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/T616-016.formatting_incorrect_code/test.yaml b/testsuite/ada_lsp/T616-016.formatting_incorrect_code/test.yaml index cf8182bc4..06991276d 100644 --- a/testsuite/ada_lsp/T616-016.formatting_incorrect_code/test.yaml +++ b/testsuite/ada_lsp/T616-016.formatting_incorrect_code/test.yaml @@ -1 +1,4 @@ title: 'T616-016.formatting_incorrect_code' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/T623-017.format_uses_project/test.yaml b/testsuite/ada_lsp/T623-017.format_uses_project/test.yaml index 918b608e7..80b5ee6ca 100644 --- a/testsuite/ada_lsp/T623-017.format_uses_project/test.yaml +++ b/testsuite/ada_lsp/T623-017.format_uses_project/test.yaml @@ -1 +1,4 @@ title: 'T623-017.format_uses_project' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/T709-018.is_called_by.name_collision/test.yaml b/testsuite/ada_lsp/T709-018.is_called_by.name_collision/test.yaml index 0dfed344c..d8e54f2ee 100644 --- a/testsuite/ada_lsp/T709-018.is_called_by.name_collision/test.yaml +++ b/testsuite/ada_lsp/T709-018.is_called_by.name_collision/test.yaml @@ -1 +1,4 @@ title: 'T709-018.is_called_by.name_collision' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/T713-012.completion.generic_package/test.yaml b/testsuite/ada_lsp/T713-012.completion.generic_package/test.yaml index 6446caeb2..3f50b7e27 100644 --- a/testsuite/ada_lsp/T713-012.completion.generic_package/test.yaml +++ b/testsuite/ada_lsp/T713-012.completion.generic_package/test.yaml @@ -1 +1,4 @@ title: 'T713-012.completion.generic_package' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/T723-027.signatureHelp.nested/test.yaml b/testsuite/ada_lsp/T723-027.signatureHelp.nested/test.yaml index ca1ef87fc..b6d05fc57 100644 --- a/testsuite/ada_lsp/T723-027.signatureHelp.nested/test.yaml +++ b/testsuite/ada_lsp/T723-027.signatureHelp.nested/test.yaml @@ -1 +1,4 @@ title: 'T723-027.signatureHelp.nested' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/T723-027.signatureHelp.overloaded/test.yaml b/testsuite/ada_lsp/T723-027.signatureHelp.overloaded/test.yaml index 30ce94e12..0c122418e 100644 --- a/testsuite/ada_lsp/T723-027.signatureHelp.overloaded/test.yaml +++ b/testsuite/ada_lsp/T723-027.signatureHelp.overloaded/test.yaml @@ -1 +1,4 @@ title: 'T723-027.signatureHelp.overloaded' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/T723-027.signatureHelp.simple/test.yaml b/testsuite/ada_lsp/T723-027.signatureHelp.simple/test.yaml index 7aaa04c76..73c979069 100644 --- a/testsuite/ada_lsp/T723-027.signatureHelp.simple/test.yaml +++ b/testsuite/ada_lsp/T723-027.signatureHelp.simple/test.yaml @@ -1 +1,4 @@ title: 'T723-027.signatureHelp.simple' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/T826-026.search/test.yaml b/testsuite/ada_lsp/T826-026.search/test.yaml index 91d90bd5d..628562203 100644 --- a/testsuite/ada_lsp/T826-026.search/test.yaml +++ b/testsuite/ada_lsp/T826-026.search/test.yaml @@ -1 +1,4 @@ title: 'T826-026.search' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/T827-018.documentSymbol.pragma/test.yaml b/testsuite/ada_lsp/T827-018.documentSymbol.pragma/test.yaml index c5fe2ffd2..0af64fb9e 100644 --- a/testsuite/ada_lsp/T827-018.documentSymbol.pragma/test.yaml +++ b/testsuite/ada_lsp/T827-018.documentSymbol.pragma/test.yaml @@ -1 +1,4 @@ title: 'T827-018.documentSymbol.pragma' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/T923-019.project_reload.gnatpp/test.yaml b/testsuite/ada_lsp/T923-019.project_reload.gnatpp/test.yaml index e120f21ea..7dd18811c 100644 --- a/testsuite/ada_lsp/T923-019.project_reload.gnatpp/test.yaml +++ b/testsuite/ada_lsp/T923-019.project_reload.gnatpp/test.yaml @@ -1 +1,4 @@ title: 'T923-019.project_reload.gnatpp' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/T928-015.formatting.end_of_buffer/test.yaml b/testsuite/ada_lsp/T928-015.formatting.end_of_buffer/test.yaml index 95f343758..f57110592 100644 --- a/testsuite/ada_lsp/T928-015.formatting.end_of_buffer/test.yaml +++ b/testsuite/ada_lsp/T928-015.formatting.end_of_buffer/test.yaml @@ -1 +1,4 @@ title: 'T928-015.formatting.end_of_buffer' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/TB12-017.named.parameters.0/test.yaml b/testsuite/ada_lsp/TB12-017.named.parameters.0/test.yaml index 18282236c..175570a4d 100644 --- a/testsuite/ada_lsp/TB12-017.named.parameters.0/test.yaml +++ b/testsuite/ada_lsp/TB12-017.named.parameters.0/test.yaml @@ -1 +1,4 @@ title: 'TB12-017.named.parameters.0' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/TB12-017.named.parameters.1/test.yaml b/testsuite/ada_lsp/TB12-017.named.parameters.1/test.yaml index 5e30832d0..3ce276661 100644 --- a/testsuite/ada_lsp/TB12-017.named.parameters.1/test.yaml +++ b/testsuite/ada_lsp/TB12-017.named.parameters.1/test.yaml @@ -1 +1,4 @@ title: 'TB12-017.named.parameters.1' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/TB12-017.named.parameters.2/test.yaml b/testsuite/ada_lsp/TB12-017.named.parameters.2/test.yaml index b23876f0c..a4ce3e0d7 100644 --- a/testsuite/ada_lsp/TB12-017.named.parameters.2/test.yaml +++ b/testsuite/ada_lsp/TB12-017.named.parameters.2/test.yaml @@ -1 +1,4 @@ title: 'TB12-017.named.parameters.2' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/U121-013.enum_references/test.yaml b/testsuite/ada_lsp/U121-013.enum_references/test.yaml index 0c8696a1a..54f3c33f4 100644 --- a/testsuite/ada_lsp/U121-013.enum_references/test.yaml +++ b/testsuite/ada_lsp/U121-013.enum_references/test.yaml @@ -1 +1,4 @@ title: 'U121-013.enum_references' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/U415-027.refactor_safe_rename_0/test.yaml b/testsuite/ada_lsp/U415-027.refactor_safe_rename_0/test.yaml index 2e803f4c5..c72042ab1 100644 --- a/testsuite/ada_lsp/U415-027.refactor_safe_rename_0/test.yaml +++ b/testsuite/ada_lsp/U415-027.refactor_safe_rename_0/test.yaml @@ -1 +1,4 @@ title: 'U415-027.refactor_safe_rename_0' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/U415-027.refactor_safe_rename_1/test.yaml b/testsuite/ada_lsp/U415-027.refactor_safe_rename_1/test.yaml index 1d7610f2f..5d41b4650 100644 --- a/testsuite/ada_lsp/U415-027.refactor_safe_rename_1/test.yaml +++ b/testsuite/ada_lsp/U415-027.refactor_safe_rename_1/test.yaml @@ -1,3 +1,6 @@ title: 'U415-027.refactor_safe_rename_1' description: 'Checks that file renames are not sent if client does not support them' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/U416-030.refactor_change_parameter_mode_0/test.yaml b/testsuite/ada_lsp/U416-030.refactor_change_parameter_mode_0/test.yaml index e9688a1ce..eb490028b 100644 --- a/testsuite/ada_lsp/U416-030.refactor_change_parameter_mode_0/test.yaml +++ b/testsuite/ada_lsp/U416-030.refactor_change_parameter_mode_0/test.yaml @@ -1 +1,4 @@ title: 'S314-015.refactor_change_parameter_mode_0' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/U416-030.refactor_remove_parameter_0/test.yaml b/testsuite/ada_lsp/U416-030.refactor_remove_parameter_0/test.yaml index e9688a1ce..eb490028b 100644 --- a/testsuite/ada_lsp/U416-030.refactor_remove_parameter_0/test.yaml +++ b/testsuite/ada_lsp/U416-030.refactor_remove_parameter_0/test.yaml @@ -1 +1,4 @@ title: 'S314-015.refactor_change_parameter_mode_0' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/U429-030.signatureHelp.dot_call/test.yaml b/testsuite/ada_lsp/U429-030.signatureHelp.dot_call/test.yaml index c81dc2e7a..a6e5a16c9 100644 --- a/testsuite/ada_lsp/U429-030.signatureHelp.dot_call/test.yaml +++ b/testsuite/ada_lsp/U429-030.signatureHelp.dot_call/test.yaml @@ -1 +1,4 @@ title: 'U429-030.signatureHelp.dot_call' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/U614-031.completion.simple_aggregate_formatting/test.yaml b/testsuite/ada_lsp/U614-031.completion.simple_aggregate_formatting/test.yaml index 3541f432f..5d0df4386 100644 --- a/testsuite/ada_lsp/U614-031.completion.simple_aggregate_formatting/test.yaml +++ b/testsuite/ada_lsp/U614-031.completion.simple_aggregate_formatting/test.yaml @@ -1 +1,4 @@ title: 'U614-031.completion.simple_aggregate_formatting' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/U614-038.edits.no_project/test.yaml b/testsuite/ada_lsp/U614-038.edits.no_project/test.yaml index c87bb1cf7..85e9d0237 100644 --- a/testsuite/ada_lsp/U614-038.edits.no_project/test.yaml +++ b/testsuite/ada_lsp/U614-038.edits.no_project/test.yaml @@ -1 +1,4 @@ title: 'U614-038.edits.no_project' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/U721-012.signatureHelp.null_expr_funcs/test.yaml b/testsuite/ada_lsp/U721-012.signatureHelp.null_expr_funcs/test.yaml index d938fb23d..78ddb59cf 100644 --- a/testsuite/ada_lsp/U721-012.signatureHelp.null_expr_funcs/test.yaml +++ b/testsuite/ada_lsp/U721-012.signatureHelp.null_expr_funcs/test.yaml @@ -1 +1,4 @@ title: 'U721-012.signatureHelp.null_expr_funcs' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/U805-023.signatureHelp.context/test.yaml b/testsuite/ada_lsp/U805-023.signatureHelp.context/test.yaml index 940306588..1eff25d00 100644 --- a/testsuite/ada_lsp/U805-023.signatureHelp.context/test.yaml +++ b/testsuite/ada_lsp/U805-023.signatureHelp.context/test.yaml @@ -1 +1,4 @@ title: 'U805-023.signatureHelp.context' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/U805-023.signatureHelp.designators/test.yaml b/testsuite/ada_lsp/U805-023.signatureHelp.designators/test.yaml index 93f693ee3..2c8705bb4 100644 --- a/testsuite/ada_lsp/U805-023.signatureHelp.designators/test.yaml +++ b/testsuite/ada_lsp/U805-023.signatureHelp.designators/test.yaml @@ -1 +1,4 @@ title: 'U805-023.signatureHelp.designators' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/U909-007.signatureHelp.closing_par/test.yaml b/testsuite/ada_lsp/U909-007.signatureHelp.closing_par/test.yaml index fa207f179..b67cf7c50 100644 --- a/testsuite/ada_lsp/U909-007.signatureHelp.closing_par/test.yaml +++ b/testsuite/ada_lsp/U909-007.signatureHelp.closing_par/test.yaml @@ -1 +1,4 @@ title: 'U909-007.signatureHelp.closing_par' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/U909-007.signatureHelp.type_cast/test.yaml b/testsuite/ada_lsp/U909-007.signatureHelp.type_cast/test.yaml index cd66946c6..897b2799b 100644 --- a/testsuite/ada_lsp/U909-007.signatureHelp.type_cast/test.yaml +++ b/testsuite/ada_lsp/U909-007.signatureHelp.type_cast/test.yaml @@ -1 +1,4 @@ title: 'U909-007.signatureHelp.type_cast' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/U910-043.client_capabilities.optional/test.yaml b/testsuite/ada_lsp/U910-043.client_capabilities.optional/test.yaml index cd8301b3b..1b8185abb 100644 --- a/testsuite/ada_lsp/U910-043.client_capabilities.optional/test.yaml +++ b/testsuite/ada_lsp/U910-043.client_capabilities.optional/test.yaml @@ -1 +1,4 @@ title: 'U910-043.client_capabilities.optional' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/U913-028.completion.params/test.yaml b/testsuite/ada_lsp/U913-028.completion.params/test.yaml index dd1e51997..726e4ed55 100644 --- a/testsuite/ada_lsp/U913-028.completion.params/test.yaml +++ b/testsuite/ada_lsp/U913-028.completion.params/test.yaml @@ -1 +1,4 @@ title: 'U913-028.completion.params' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/U915-024.completion.invisible_snippets/test.yaml b/testsuite/ada_lsp/U915-024.completion.invisible_snippets/test.yaml index 70f915ef1..652d40faa 100644 --- a/testsuite/ada_lsp/U915-024.completion.invisible_snippets/test.yaml +++ b/testsuite/ada_lsp/U915-024.completion.invisible_snippets/test.yaml @@ -1 +1,4 @@ title: 'U915-024.completion.invisible_snippets' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/U921-010.completion.no_generic_duplicates/test.yaml b/testsuite/ada_lsp/U921-010.completion.no_generic_duplicates/test.yaml index b39efddf7..c3f7f089c 100644 --- a/testsuite/ada_lsp/U921-010.completion.no_generic_duplicates/test.yaml +++ b/testsuite/ada_lsp/U921-010.completion.no_generic_duplicates/test.yaml @@ -1 +1,4 @@ title: 'U921-010.completion.no_generic_duplicates' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/UA20-011.parameter_completion.multiple_order/test.yaml b/testsuite/ada_lsp/UA20-011.parameter_completion.multiple_order/test.yaml index 16f38bee1..d4005610e 100644 --- a/testsuite/ada_lsp/UA20-011.parameter_completion.multiple_order/test.yaml +++ b/testsuite/ada_lsp/UA20-011.parameter_completion.multiple_order/test.yaml @@ -1 +1,4 @@ title: 'UA20-011.parameter_completion.multiple_order' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/UA21-041.parameter_completion.dotted_call/test.yaml b/testsuite/ada_lsp/UA21-041.parameter_completion.dotted_call/test.yaml index ff3f0d391..77b5454b4 100644 --- a/testsuite/ada_lsp/UA21-041.parameter_completion.dotted_call/test.yaml +++ b/testsuite/ada_lsp/UA21-041.parameter_completion.dotted_call/test.yaml @@ -1 +1,4 @@ title: 'UA21-041.parameter_completion.dotted_call' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/UA28-007.Did_Change_Watched_Files_0/test.yaml b/testsuite/ada_lsp/UA28-007.Did_Change_Watched_Files_0/test.yaml index 700d4c822..f13ab6736 100644 --- a/testsuite/ada_lsp/UA28-007.Did_Change_Watched_Files_0/test.yaml +++ b/testsuite/ada_lsp/UA28-007.Did_Change_Watched_Files_0/test.yaml @@ -1,3 +1,5 @@ title: 'UA28-007.Did_Change_Watched_Files_0' skip: - ['SKIP', 'env.build.os.name == "windows"'] + # Skip till 3.17 ready + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/UA28-007.Did_Create_Files_0/test.yaml b/testsuite/ada_lsp/UA28-007.Did_Create_Files_0/test.yaml index 288558cdb..d78feb211 100644 --- a/testsuite/ada_lsp/UA28-007.Did_Create_Files_0/test.yaml +++ b/testsuite/ada_lsp/UA28-007.Did_Create_Files_0/test.yaml @@ -1 +1,4 @@ title: 'UA28-007.Did_Create_Files_0' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/UA28-007.Did_Delete_Files_0/test.yaml b/testsuite/ada_lsp/UA28-007.Did_Delete_Files_0/test.yaml index b4b5b0bb8..61b3007e2 100644 --- a/testsuite/ada_lsp/UA28-007.Did_Delete_Files_0/test.yaml +++ b/testsuite/ada_lsp/UA28-007.Did_Delete_Files_0/test.yaml @@ -1,3 +1,5 @@ title: 'UA28-007.Did_Delete_Files_0' skip: - ['SKIP', 'env.build.os.name == "windows"'] + # Skip till 3.17 ready + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/UA28-007.Did_Rename_Files_0/test.yaml b/testsuite/ada_lsp/UA28-007.Did_Rename_Files_0/test.yaml index 907cdb1fd..e789a82de 100644 --- a/testsuite/ada_lsp/UA28-007.Did_Rename_Files_0/test.yaml +++ b/testsuite/ada_lsp/UA28-007.Did_Rename_Files_0/test.yaml @@ -1 +1,4 @@ title: 'UA28-007.Did_Rename_Files_0' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/V201-024.goto.entry_and_asserts/test.yaml b/testsuite/ada_lsp/V201-024.goto.entry_and_asserts/test.yaml index dd0b13873..1ec303c8e 100644 --- a/testsuite/ada_lsp/V201-024.goto.entry_and_asserts/test.yaml +++ b/testsuite/ada_lsp/V201-024.goto.entry_and_asserts/test.yaml @@ -1 +1,4 @@ title: 'V201-024.goto.entry_and_asserts' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/V216-030.completion.attribute_in_decl/test.yaml b/testsuite/ada_lsp/V216-030.completion.attribute_in_decl/test.yaml index ad0e20240..6398fc0c1 100644 --- a/testsuite/ada_lsp/V216-030.completion.attribute_in_decl/test.yaml +++ b/testsuite/ada_lsp/V216-030.completion.attribute_in_decl/test.yaml @@ -1 +1,4 @@ title: 'V216-030.completion.attribute_in_decl' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/V628-012.highlighting.defining_names/test.yaml b/testsuite/ada_lsp/V628-012.highlighting.defining_names/test.yaml index cd65f15da..e5b45b580 100644 --- a/testsuite/ada_lsp/V628-012.highlighting.defining_names/test.yaml +++ b/testsuite/ada_lsp/V628-012.highlighting.defining_names/test.yaml @@ -1 +1,4 @@ title: 'V628-012.highlighting.defining_names' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/V628-012.highlighting.no-libs/test.yaml b/testsuite/ada_lsp/V628-012.highlighting.no-libs/test.yaml index 3799e4ffc..9e5f6ebca 100644 --- a/testsuite/ada_lsp/V628-012.highlighting.no-libs/test.yaml +++ b/testsuite/ada_lsp/V628-012.highlighting.no-libs/test.yaml @@ -1 +1,4 @@ title: 'V628-012.highlighting.no-libs' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/V628-024.symbol_diff/test.yaml b/testsuite/ada_lsp/V628-024.symbol_diff/test.yaml index 63b6bd529..5eac5e910 100644 --- a/testsuite/ada_lsp/V628-024.symbol_diff/test.yaml +++ b/testsuite/ada_lsp/V628-024.symbol_diff/test.yaml @@ -1 +1,4 @@ title: 'V628-024.symbol_diff' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/V701-011.formatting.options_precedence/test.yaml b/testsuite/ada_lsp/V701-011.formatting.options_precedence/test.yaml index 06adf7211..531a10eb0 100644 --- a/testsuite/ada_lsp/V701-011.formatting.options_precedence/test.yaml +++ b/testsuite/ada_lsp/V701-011.formatting.options_precedence/test.yaml @@ -1 +1,4 @@ title: 'V701-011.formatting.options_precedence' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/V705-026.completion.predefined_types/test.yaml b/testsuite/ada_lsp/V705-026.completion.predefined_types/test.yaml index ead4cad6e..af4c6d3d8 100644 --- a/testsuite/ada_lsp/V705-026.completion.predefined_types/test.yaml +++ b/testsuite/ada_lsp/V705-026.completion.predefined_types/test.yaml @@ -1 +1,4 @@ title: 'V705-026.completion.predefined_types' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/aggregate.is_called_by/test.yaml b/testsuite/ada_lsp/aggregate.is_called_by/test.yaml index d635ca355..079d8d474 100644 --- a/testsuite/ada_lsp/aggregate.is_called_by/test.yaml +++ b/testsuite/ada_lsp/aggregate.is_called_by/test.yaml @@ -1 +1,4 @@ title: 'aggregate.is_called_by' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/aggregate.references_after_update/test.yaml b/testsuite/ada_lsp/aggregate.references_after_update/test.yaml index e307ec768..b0d55ee57 100644 --- a/testsuite/ada_lsp/aggregate.references_after_update/test.yaml +++ b/testsuite/ada_lsp/aggregate.references_after_update/test.yaml @@ -1 +1,4 @@ title: 'aggregate.references_after_update' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/aggregate.simple/test.yaml b/testsuite/ada_lsp/aggregate.simple/test.yaml index f1c3e1554..2ecca90b5 100644 --- a/testsuite/ada_lsp/aggregate.simple/test.yaml +++ b/testsuite/ada_lsp/aggregate.simple/test.yaml @@ -1 +1,4 @@ title: 'aggregate.simple' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/callHierarchy.abstract_subps/test.yaml b/testsuite/ada_lsp/callHierarchy.abstract_subps/test.yaml index 3521001dd..7d0818fc3 100644 --- a/testsuite/ada_lsp/callHierarchy.abstract_subps/test.yaml +++ b/testsuite/ada_lsp/callHierarchy.abstract_subps/test.yaml @@ -1 +1,4 @@ title: 'callHierarchy.abstract_subps' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/called_by.null_subp/test.yaml b/testsuite/ada_lsp/called_by.null_subp/test.yaml index 89e140645..a009d4e9e 100644 --- a/testsuite/ada_lsp/called_by.null_subp/test.yaml +++ b/testsuite/ada_lsp/called_by.null_subp/test.yaml @@ -1 +1,4 @@ title: 'called_by.null_subp' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/called_by.renames/test.yaml b/testsuite/ada_lsp/called_by.renames/test.yaml index 5b2f50365..2025cf193 100644 --- a/testsuite/ada_lsp/called_by.renames/test.yaml +++ b/testsuite/ada_lsp/called_by.renames/test.yaml @@ -1 +1,4 @@ title: 'called_by.renames' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/called_by/test.yaml b/testsuite/ada_lsp/called_by/test.yaml index 4094d8b50..1cf0db5b3 100644 --- a/testsuite/ada_lsp/called_by/test.yaml +++ b/testsuite/ada_lsp/called_by/test.yaml @@ -1 +1,4 @@ title: 'called_by' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/called_by_dispatching/test.yaml b/testsuite/ada_lsp/called_by_dispatching/test.yaml index 9db9c991e..2b6560186 100644 --- a/testsuite/ada_lsp/called_by_dispatching/test.yaml +++ b/testsuite/ada_lsp/called_by_dispatching/test.yaml @@ -1 +1,4 @@ title: 'called_by_dispatching' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/called_by_not_open/test.yaml b/testsuite/ada_lsp/called_by_not_open/test.yaml index f7f5f964e..da284269f 100644 --- a/testsuite/ada_lsp/called_by_not_open/test.yaml +++ b/testsuite/ada_lsp/called_by_not_open/test.yaml @@ -1 +1,4 @@ title: 'called_by_not_open' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/callgraph.named_blocks/test.yaml b/testsuite/ada_lsp/callgraph.named_blocks/test.yaml index 5ec3fcae7..e5943b097 100644 --- a/testsuite/ada_lsp/callgraph.named_blocks/test.yaml +++ b/testsuite/ada_lsp/callgraph.named_blocks/test.yaml @@ -1 +1,4 @@ title: 'callgraph.named_blocks' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/calls/test.yaml b/testsuite/ada_lsp/calls/test.yaml index 53ed07121..810f249db 100644 --- a/testsuite/ada_lsp/calls/test.yaml +++ b/testsuite/ada_lsp/calls/test.yaml @@ -1 +1,4 @@ title: 'calls' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/cancel/test.yaml b/testsuite/ada_lsp/cancel/test.yaml index cdc8d1fd1..600266d87 100644 --- a/testsuite/ada_lsp/cancel/test.yaml +++ b/testsuite/ada_lsp/cancel/test.yaml @@ -1 +1,4 @@ title: 'cancel' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/commands.other_file/test.yaml b/testsuite/ada_lsp/commands.other_file/test.yaml index aad95470d..f50a37b5d 100644 --- a/testsuite/ada_lsp/commands.other_file/test.yaml +++ b/testsuite/ada_lsp/commands.other_file/test.yaml @@ -1 +1,4 @@ title: 'commands.other_file' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/completion.aggregates.complex/test.yaml b/testsuite/ada_lsp/completion.aggregates.complex/test.yaml index 9d29b3e9b..b9b5c1c87 100644 --- a/testsuite/ada_lsp/completion.aggregates.complex/test.yaml +++ b/testsuite/ada_lsp/completion.aggregates.complex/test.yaml @@ -1 +1,4 @@ title: 'completion.aggregates.complex' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/completion.aggregates.derived_private/test.yaml b/testsuite/ada_lsp/completion.aggregates.derived_private/test.yaml index d880c5b4b..f1d3ecf81 100644 --- a/testsuite/ada_lsp/completion.aggregates.derived_private/test.yaml +++ b/testsuite/ada_lsp/completion.aggregates.derived_private/test.yaml @@ -1 +1,4 @@ title: 'completion.aggregates.derived_private' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/completion.aggregates.derived_types/test.yaml b/testsuite/ada_lsp/completion.aggregates.derived_types/test.yaml index 1e59062c4..f7da393fc 100644 --- a/testsuite/ada_lsp/completion.aggregates.derived_types/test.yaml +++ b/testsuite/ada_lsp/completion.aggregates.derived_types/test.yaml @@ -1 +1,4 @@ title: 'completion.aggregates.derived_types' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/completion.aggregates.incomplete_type/test.yaml b/testsuite/ada_lsp/completion.aggregates.incomplete_type/test.yaml index dfa04d1cd..fbffefa9c 100644 --- a/testsuite/ada_lsp/completion.aggregates.incomplete_type/test.yaml +++ b/testsuite/ada_lsp/completion.aggregates.incomplete_type/test.yaml @@ -1 +1,4 @@ title: 'completion.aggregates.incomplete_type' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/completion.aggregates.multiple_discriminants/test.yaml b/testsuite/ada_lsp/completion.aggregates.multiple_discriminants/test.yaml index 0d5eb1caa..d8103dcf5 100644 --- a/testsuite/ada_lsp/completion.aggregates.multiple_discriminants/test.yaml +++ b/testsuite/ada_lsp/completion.aggregates.multiple_discriminants/test.yaml @@ -1 +1,4 @@ title: 'completion.aggregates.multiple_discriminants' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/completion.aggregates.simple/test.yaml b/testsuite/ada_lsp/completion.aggregates.simple/test.yaml index e0231e160..bf645495a 100644 --- a/testsuite/ada_lsp/completion.aggregates.simple/test.yaml +++ b/testsuite/ada_lsp/completion.aggregates.simple/test.yaml @@ -1 +1,4 @@ title: 'completion.aggregates.simple' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/completion.aggregates.snippet_indexes/test.yaml b/testsuite/ada_lsp/completion.aggregates.snippet_indexes/test.yaml index 1c0ae5fe1..dec5cb88d 100644 --- a/testsuite/ada_lsp/completion.aggregates.snippet_indexes/test.yaml +++ b/testsuite/ada_lsp/completion.aggregates.snippet_indexes/test.yaml @@ -1 +1,4 @@ title: 'completion.aggregates.snippet_indexes' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/completion.aspects.filtering/test.yaml b/testsuite/ada_lsp/completion.aspects.filtering/test.yaml index 76eb79396..afb2ec0d5 100644 --- a/testsuite/ada_lsp/completion.aspects.filtering/test.yaml +++ b/testsuite/ada_lsp/completion.aspects.filtering/test.yaml @@ -1 +1,4 @@ title: 'completion.aspects' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/completion.aspects/test.yaml b/testsuite/ada_lsp/completion.aspects/test.yaml index 76eb79396..afb2ec0d5 100644 --- a/testsuite/ada_lsp/completion.aspects/test.yaml +++ b/testsuite/ada_lsp/completion.aspects/test.yaml @@ -1 +1,4 @@ title: 'completion.aspects' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/completion.complex_renames/test.yaml b/testsuite/ada_lsp/completion.complex_renames/test.yaml index f9a746df0..37ecadba2 100644 --- a/testsuite/ada_lsp/completion.complex_renames/test.yaml +++ b/testsuite/ada_lsp/completion.complex_renames/test.yaml @@ -1 +1,4 @@ title: 'completion.complex_renames' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/completion.defining_names/test.yaml b/testsuite/ada_lsp/completion.defining_names/test.yaml index af9515f9e..28e82d8b6 100644 --- a/testsuite/ada_lsp/completion.defining_names/test.yaml +++ b/testsuite/ada_lsp/completion.defining_names/test.yaml @@ -1 +1,4 @@ title: 'completion.defining_names' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/completion.dotted_call.keyword/test.yaml b/testsuite/ada_lsp/completion.dotted_call.keyword/test.yaml index 6af60bbf3..68261fd01 100644 --- a/testsuite/ada_lsp/completion.dotted_call.keyword/test.yaml +++ b/testsuite/ada_lsp/completion.dotted_call.keyword/test.yaml @@ -1 +1,4 @@ title: 'completion.dotted_call.keyword' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/completion.duplicates/test.yaml b/testsuite/ada_lsp/completion.duplicates/test.yaml index 6617dc41d..86811d7d4 100644 --- a/testsuite/ada_lsp/completion.duplicates/test.yaml +++ b/testsuite/ada_lsp/completion.duplicates/test.yaml @@ -1 +1,4 @@ title: 'completion.duplicates' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/completion.end_labels/test.yaml b/testsuite/ada_lsp/completion.end_labels/test.yaml index 1b1f9366e..6b5ff43d7 100644 --- a/testsuite/ada_lsp/completion.end_labels/test.yaml +++ b/testsuite/ada_lsp/completion.end_labels/test.yaml @@ -1 +1,4 @@ title: 'completion.end_labels' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/completion.end_labels2/test.yaml b/testsuite/ada_lsp/completion.end_labels2/test.yaml index ea8cb569d..35fea88cc 100644 --- a/testsuite/ada_lsp/completion.end_labels2/test.yaml +++ b/testsuite/ada_lsp/completion.end_labels2/test.yaml @@ -1 +1,4 @@ title: 'completion.end_labels2' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/completion.invisible.runtime/test.yaml b/testsuite/ada_lsp/completion.invisible.runtime/test.yaml index 84612ba1d..84d769199 100644 --- a/testsuite/ada_lsp/completion.invisible.runtime/test.yaml +++ b/testsuite/ada_lsp/completion.invisible.runtime/test.yaml @@ -2,4 +2,6 @@ title: 'completion.invisible.runtime' # Test only on Linux, since runtime source locations can be # different depending on the platform skip: - - ['SKIP', 'env.build.os.name != "linux"'] \ No newline at end of file + - ['SKIP', 'env.build.os.name != "linux"'] + # Skip till 3.17 ready + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/completion.invisible/test.yaml b/testsuite/ada_lsp/completion.invisible/test.yaml index 09458cf2b..238062a64 100644 --- a/testsuite/ada_lsp/completion.invisible/test.yaml +++ b/testsuite/ada_lsp/completion.invisible/test.yaml @@ -1 +1,4 @@ title: 'completion.invisible' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/completion.invisible2/test.yaml b/testsuite/ada_lsp/completion.invisible2/test.yaml index a9f066055..9cbfe19d6 100644 --- a/testsuite/ada_lsp/completion.invisible2/test.yaml +++ b/testsuite/ada_lsp/completion.invisible2/test.yaml @@ -1 +1,4 @@ title: 'completion.invisible2' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/completion.invisible3/test.yaml b/testsuite/ada_lsp/completion.invisible3/test.yaml index 07773fc39..1c9c2425b 100644 --- a/testsuite/ada_lsp/completion.invisible3/test.yaml +++ b/testsuite/ada_lsp/completion.invisible3/test.yaml @@ -1 +1,4 @@ title: 'completion.invisible3' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/completion.invisible4/test.yaml b/testsuite/ada_lsp/completion.invisible4/test.yaml index 6a40dc690..120f0f344 100644 --- a/testsuite/ada_lsp/completion.invisible4/test.yaml +++ b/testsuite/ada_lsp/completion.invisible4/test.yaml @@ -1 +1,4 @@ title: 'completion.invisible4' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/completion.invisible5/test.yaml b/testsuite/ada_lsp/completion.invisible5/test.yaml index 33d3311c2..d3f962235 100644 --- a/testsuite/ada_lsp/completion.invisible5/test.yaml +++ b/testsuite/ada_lsp/completion.invisible5/test.yaml @@ -1 +1,4 @@ title: 'completion.invisible5' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/completion.keywords/test.yaml b/testsuite/ada_lsp/completion.keywords/test.yaml index 8c96d4b44..44dcfc7a5 100644 --- a/testsuite/ada_lsp/completion.keywords/test.yaml +++ b/testsuite/ada_lsp/completion.keywords/test.yaml @@ -1 +1,4 @@ title: 'completion.keywords' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/completion.lazy_computation/test.yaml b/testsuite/ada_lsp/completion.lazy_computation/test.yaml index dc3083cdb..a05237a9f 100644 --- a/testsuite/ada_lsp/completion.lazy_computation/test.yaml +++ b/testsuite/ada_lsp/completion.lazy_computation/test.yaml @@ -1 +1,4 @@ title: 'completion.lazy_computation' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/completion.no_snippet_for_params/test.yaml b/testsuite/ada_lsp/completion.no_snippet_for_params/test.yaml index 276aa41fc..7e89fb494 100644 --- a/testsuite/ada_lsp/completion.no_snippet_for_params/test.yaml +++ b/testsuite/ada_lsp/completion.no_snippet_for_params/test.yaml @@ -1 +1,4 @@ title: 'completion.no_snippet_for_params' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/completion.num_literals/test.yaml b/testsuite/ada_lsp/completion.num_literals/test.yaml index e3468059c..292049918 100644 --- a/testsuite/ada_lsp/completion.num_literals/test.yaml +++ b/testsuite/ada_lsp/completion.num_literals/test.yaml @@ -1 +1,4 @@ title: 'completion.num_literals' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/completion.param.no_named_notation/test.yaml b/testsuite/ada_lsp/completion.param.no_named_notation/test.yaml index 8da75c380..8e2e0dbfb 100644 --- a/testsuite/ada_lsp/completion.param.no_named_notation/test.yaml +++ b/testsuite/ada_lsp/completion.param.no_named_notation/test.yaml @@ -1 +1,4 @@ title: 'completion.param.no_named_notation' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/completion.param.non_basic_calls/test.yaml b/testsuite/ada_lsp/completion.param.non_basic_calls/test.yaml index 4043a0eef..2af802807 100644 --- a/testsuite/ada_lsp/completion.param.non_basic_calls/test.yaml +++ b/testsuite/ada_lsp/completion.param.non_basic_calls/test.yaml @@ -1 +1,4 @@ title: 'testsuite/ada_lsp/completion.param.non_basic_calls' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/completion.snippet.formatting/test.yaml b/testsuite/ada_lsp/completion.snippet.formatting/test.yaml index 981628ef8..ccda29f3d 100644 --- a/testsuite/ada_lsp/completion.snippet.formatting/test.yaml +++ b/testsuite/ada_lsp/completion.snippet.formatting/test.yaml @@ -1 +1,4 @@ title: 'completion.snippet.formatting' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/completion.snippet.formatting2/test.yaml b/testsuite/ada_lsp/completion.snippet.formatting2/test.yaml index d398cd5c7..09ec70335 100644 --- a/testsuite/ada_lsp/completion.snippet.formatting2/test.yaml +++ b/testsuite/ada_lsp/completion.snippet.formatting2/test.yaml @@ -1 +1,4 @@ title: 'completion.snippet.formatting2' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/completion.snippet.formatting3/test.yaml b/testsuite/ada_lsp/completion.snippet.formatting3/test.yaml index fd4f2d176..61af73928 100644 --- a/testsuite/ada_lsp/completion.snippet.formatting3/test.yaml +++ b/testsuite/ada_lsp/completion.snippet.formatting3/test.yaml @@ -1 +1,4 @@ title: 'completion.snippet.formatting3' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/completion.subp_parameters/test.yaml b/testsuite/ada_lsp/completion.subp_parameters/test.yaml index 6712d001b..fe8eaf965 100644 --- a/testsuite/ada_lsp/completion.subp_parameters/test.yaml +++ b/testsuite/ada_lsp/completion.subp_parameters/test.yaml @@ -1 +1,4 @@ title: 'completion.subp_parameters' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/completion.subp_params_dotted_names/test.yaml b/testsuite/ada_lsp/completion.subp_params_dotted_names/test.yaml index c39537535..1988e74f3 100644 --- a/testsuite/ada_lsp/completion.subp_params_dotted_names/test.yaml +++ b/testsuite/ada_lsp/completion.subp_params_dotted_names/test.yaml @@ -1 +1,4 @@ title: 'completion.subp_params_dotted_names' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/completion.use_clauses.multiple_with/test.yaml b/testsuite/ada_lsp/completion.use_clauses.multiple_with/test.yaml index fb702036a..acff3d145 100644 --- a/testsuite/ada_lsp/completion.use_clauses.multiple_with/test.yaml +++ b/testsuite/ada_lsp/completion.use_clauses.multiple_with/test.yaml @@ -1 +1,4 @@ title: 'completion.use_clauses.multiple_with' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/completion.use_clauses/test.yaml b/testsuite/ada_lsp/completion.use_clauses/test.yaml index e1c462914..000088442 100644 --- a/testsuite/ada_lsp/completion.use_clauses/test.yaml +++ b/testsuite/ada_lsp/completion.use_clauses/test.yaml @@ -1 +1,4 @@ title: 'completion.use_clauses' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/declaration.overridings_on_usage/test.yaml b/testsuite/ada_lsp/declaration.overridings_on_usage/test.yaml index 2cf12ec5b..c268d3d59 100644 --- a/testsuite/ada_lsp/declaration.overridings_on_usage/test.yaml +++ b/testsuite/ada_lsp/declaration.overridings_on_usage/test.yaml @@ -1 +1,4 @@ title: 'declaration.overridings_on_usage' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/declaration/test.yaml b/testsuite/ada_lsp/declaration/test.yaml index 905cfa0a7..4ef12f3f2 100644 --- a/testsuite/ada_lsp/declaration/test.yaml +++ b/testsuite/ada_lsp/declaration/test.yaml @@ -1 +1,4 @@ title: 'declaration' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/def_name/test.yaml b/testsuite/ada_lsp/def_name/test.yaml index 4e96d138a..8a74ab2f7 100644 --- a/testsuite/ada_lsp/def_name/test.yaml +++ b/testsuite/ada_lsp/def_name/test.yaml @@ -1 +1,4 @@ title: 'def_name' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/definition_and_overridings/test.yaml b/testsuite/ada_lsp/definition_and_overridings/test.yaml index c817524bf..77ecc029e 100644 --- a/testsuite/ada_lsp/definition_and_overridings/test.yaml +++ b/testsuite/ada_lsp/definition_and_overridings/test.yaml @@ -1 +1,4 @@ title: 'definition_and_overridings' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/definition_parents/test.yaml b/testsuite/ada_lsp/definition_parents/test.yaml index a7b307755..1f6a55214 100644 --- a/testsuite/ada_lsp/definition_parents/test.yaml +++ b/testsuite/ada_lsp/definition_parents/test.yaml @@ -1 +1,4 @@ title: 'definition_parents' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/document_highlight/test.yaml b/testsuite/ada_lsp/document_highlight/test.yaml index b6f44ebc5..c9cea11b8 100644 --- a/testsuite/ada_lsp/document_highlight/test.yaml +++ b/testsuite/ada_lsp/document_highlight/test.yaml @@ -1 +1,4 @@ title: 'document_highlight' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/documentation.subprogram-from-generic/test.yaml b/testsuite/ada_lsp/documentation.subprogram-from-generic/test.yaml index d37b34bc9..3cb491b9b 100644 --- a/testsuite/ada_lsp/documentation.subprogram-from-generic/test.yaml +++ b/testsuite/ada_lsp/documentation.subprogram-from-generic/test.yaml @@ -1 +1,4 @@ title: 'documentation.subprogram-from-generic' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/editor.incremental/test.yaml b/testsuite/ada_lsp/editor.incremental/test.yaml index 076b8d532..da905a803 100644 --- a/testsuite/ada_lsp/editor.incremental/test.yaml +++ b/testsuite/ada_lsp/editor.incremental/test.yaml @@ -1 +1,4 @@ title: 'editor.incremental' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/find_all_refs/test.yaml b/testsuite/ada_lsp/find_all_refs/test.yaml index 4be0e72c6..64dbb17fa 100644 --- a/testsuite/ada_lsp/find_all_refs/test.yaml +++ b/testsuite/ada_lsp/find_all_refs/test.yaml @@ -1 +1,4 @@ title: 'find_all_refs' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/find_all_refs_child_package/test.yaml b/testsuite/ada_lsp/find_all_refs_child_package/test.yaml index 70cd3af66..3b86b4924 100644 --- a/testsuite/ada_lsp/find_all_refs_child_package/test.yaml +++ b/testsuite/ada_lsp/find_all_refs_child_package/test.yaml @@ -1 +1,4 @@ title: 'find_all_refs_child_package' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/find_all_refs_defining_names/test.yaml b/testsuite/ada_lsp/find_all_refs_defining_names/test.yaml index 1895995d4..e398a35e3 100644 --- a/testsuite/ada_lsp/find_all_refs_defining_names/test.yaml +++ b/testsuite/ada_lsp/find_all_refs_defining_names/test.yaml @@ -1 +1,4 @@ title: 'find_all_refs_defining_names' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/find_all_refs_kinds/test.yaml b/testsuite/ada_lsp/find_all_refs_kinds/test.yaml index 6cd2cddd6..b0e63542e 100644 --- a/testsuite/ada_lsp/find_all_refs_kinds/test.yaml +++ b/testsuite/ada_lsp/find_all_refs_kinds/test.yaml @@ -1 +1,4 @@ title: 'find_all_refs_kinds' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/find_all_refs_subp/test.yaml b/testsuite/ada_lsp/find_all_refs_subp/test.yaml index 5038036ed..e2d8d38e1 100644 --- a/testsuite/ada_lsp/find_all_refs_subp/test.yaml +++ b/testsuite/ada_lsp/find_all_refs_subp/test.yaml @@ -1 +1,4 @@ title: 'find_all_refs_subp' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/get_symbol_hier/test.yaml b/testsuite/ada_lsp/get_symbol_hier/test.yaml index b8e2fcdcb..92253d150 100644 --- a/testsuite/ada_lsp/get_symbol_hier/test.yaml +++ b/testsuite/ada_lsp/get_symbol_hier/test.yaml @@ -1 +1,4 @@ title: 'get_symbol_hier' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/hover.for_loops/test.yaml b/testsuite/ada_lsp/hover.for_loops/test.yaml index 79e0bf978..90fc12d26 100644 --- a/testsuite/ada_lsp/hover.for_loops/test.yaml +++ b/testsuite/ada_lsp/hover.for_loops/test.yaml @@ -1 +1,4 @@ title: 'hover.for_loops' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/implementation.aggregates/test.yaml b/testsuite/ada_lsp/implementation.aggregates/test.yaml index e29a63983..40d2cf51c 100644 --- a/testsuite/ada_lsp/implementation.aggregates/test.yaml +++ b/testsuite/ada_lsp/implementation.aggregates/test.yaml @@ -1 +1,4 @@ title: 'implementation.aggregates' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/implementation.overridings/test.yaml b/testsuite/ada_lsp/implementation.overridings/test.yaml index 91a3a9ca9..b38a2bc73 100644 --- a/testsuite/ada_lsp/implementation.overridings/test.yaml +++ b/testsuite/ada_lsp/implementation.overridings/test.yaml @@ -1 +1,4 @@ title: 'implementation.overridings' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/implementation/test.yaml b/testsuite/ada_lsp/implementation/test.yaml index 96719905e..d454f244f 100644 --- a/testsuite/ada_lsp/implementation/test.yaml +++ b/testsuite/ada_lsp/implementation/test.yaml @@ -1 +1,4 @@ title: 'implementation' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/incorrect_fallback/test.yaml b/testsuite/ada_lsp/incorrect_fallback/test.yaml index b94bc808e..cf2128d75 100644 --- a/testsuite/ada_lsp/incorrect_fallback/test.yaml +++ b/testsuite/ada_lsp/incorrect_fallback/test.yaml @@ -1 +1,4 @@ title: 'incorrect_fallback' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/indexing_progress/test.yaml b/testsuite/ada_lsp/indexing_progress/test.yaml index b1a3851ac..6c74dee25 100644 --- a/testsuite/ada_lsp/indexing_progress/test.yaml +++ b/testsuite/ada_lsp/indexing_progress/test.yaml @@ -1 +1,4 @@ title: 'indexing_progress' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/invalid_project/test.yaml b/testsuite/ada_lsp/invalid_project/test.yaml index 2f8fa1edd..a2487c50c 100644 --- a/testsuite/ada_lsp/invalid_project/test.yaml +++ b/testsuite/ada_lsp/invalid_project/test.yaml @@ -1 +1,4 @@ title: 'invalid_project' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/invalidation.file_contents/test.yaml b/testsuite/ada_lsp/invalidation.file_contents/test.yaml index 2c0a137f6..c38a8104f 100644 --- a/testsuite/ada_lsp/invalidation.file_contents/test.yaml +++ b/testsuite/ada_lsp/invalidation.file_contents/test.yaml @@ -1 +1,4 @@ title: 'invalidation.file_contents' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/named_params.dot_calls/test.yaml b/testsuite/ada_lsp/named_params.dot_calls/test.yaml index ada715aa1..1dc519ee0 100644 --- a/testsuite/ada_lsp/named_params.dot_calls/test.yaml +++ b/testsuite/ada_lsp/named_params.dot_calls/test.yaml @@ -1 +1,4 @@ title: 'named_params.dot_calls' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/named_params/test.yaml b/testsuite/ada_lsp/named_params/test.yaml index e30d4f298..540de3465 100644 --- a/testsuite/ada_lsp/named_params/test.yaml +++ b/testsuite/ada_lsp/named_params/test.yaml @@ -1 +1,4 @@ title: 'named_params' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/no_root/test.yaml b/testsuite/ada_lsp/no_root/test.yaml index b54209fb2..3ebd69b7a 100644 --- a/testsuite/ada_lsp/no_root/test.yaml +++ b/testsuite/ada_lsp/no_root/test.yaml @@ -1 +1,4 @@ title: 'no_root' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/non_project_files/test.yaml b/testsuite/ada_lsp/non_project_files/test.yaml index c4b4adc5b..2a986c8d2 100644 --- a/testsuite/ada_lsp/non_project_files/test.yaml +++ b/testsuite/ada_lsp/non_project_files/test.yaml @@ -1 +1,4 @@ title: 'non_project_files' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/onTypeFormatting/indentOnlyFalse/test.yaml b/testsuite/ada_lsp/onTypeFormatting/indentOnlyFalse/test.yaml index 1e828283a..cf5fb0aa8 100644 --- a/testsuite/ada_lsp/onTypeFormatting/indentOnlyFalse/test.yaml +++ b/testsuite/ada_lsp/onTypeFormatting/indentOnlyFalse/test.yaml @@ -1 +1,4 @@ title: 'testi' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/onTypeFormatting/indentOnlyTrue/test.yaml b/testsuite/ada_lsp/onTypeFormatting/indentOnlyTrue/test.yaml index 1e828283a..cf5fb0aa8 100644 --- a/testsuite/ada_lsp/onTypeFormatting/indentOnlyTrue/test.yaml +++ b/testsuite/ada_lsp/onTypeFormatting/indentOnlyTrue/test.yaml @@ -1 +1,4 @@ title: 'testi' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/preprocessor/test.yaml b/testsuite/ada_lsp/preprocessor/test.yaml index 68bcf2116..c13dbc157 100644 --- a/testsuite/ada_lsp/preprocessor/test.yaml +++ b/testsuite/ada_lsp/preprocessor/test.yaml @@ -1 +1,4 @@ title: 'preprocessor' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/project_config.alire/test.yaml b/testsuite/ada_lsp/project_config.alire/test.yaml index 5f6afb2a2..11c6f15e6 100644 --- a/testsuite/ada_lsp/project_config.alire/test.yaml +++ b/testsuite/ada_lsp/project_config.alire/test.yaml @@ -1,4 +1,5 @@ title: 'project_config.alire' skip: - ['SKIP', 'env.build.os.name == "windows"'] - + # Skip till 3.17 ready + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/project_config.file/test.yaml b/testsuite/ada_lsp/project_config.file/test.yaml index 43ac894d0..cbf8d2630 100644 --- a/testsuite/ada_lsp/project_config.file/test.yaml +++ b/testsuite/ada_lsp/project_config.file/test.yaml @@ -1 +1,4 @@ title: 'project_config.file' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/project_config.init/test.yaml b/testsuite/ada_lsp/project_config.init/test.yaml index 3035a601c..2a5dcf53e 100644 --- a/testsuite/ada_lsp/project_config.init/test.yaml +++ b/testsuite/ada_lsp/project_config.init/test.yaml @@ -1 +1,4 @@ title: 'project_config.init' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/project_config.missing_file/test.yaml b/testsuite/ada_lsp/project_config.missing_file/test.yaml index 0e5bf90d4..bc881bfaf 100644 --- a/testsuite/ada_lsp/project_config.missing_file/test.yaml +++ b/testsuite/ada_lsp/project_config.missing_file/test.yaml @@ -1 +1,4 @@ title: 'project_config.missing_file' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/project_config/test.yaml b/testsuite/ada_lsp/project_config/test.yaml index 06e6e95fa..27896db8e 100644 --- a/testsuite/ada_lsp/project_config/test.yaml +++ b/testsuite/ada_lsp/project_config/test.yaml @@ -1 +1,4 @@ title: 'project_config' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/project_reload.command/test.yaml b/testsuite/ada_lsp/project_reload.command/test.yaml index 9b9de08d3..287a268fe 100644 --- a/testsuite/ada_lsp/project_reload.command/test.yaml +++ b/testsuite/ada_lsp/project_reload.command/test.yaml @@ -1 +1,4 @@ title: 'project_reload.command' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/project_reload/test.yaml b/testsuite/ada_lsp/project_reload/test.yaml index f74b5a50a..893aaa5b9 100644 --- a/testsuite/ada_lsp/project_reload/test.yaml +++ b/testsuite/ada_lsp/project_reload/test.yaml @@ -1 +1,4 @@ title: 'project_reload' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/project_search/test.yaml b/testsuite/ada_lsp/project_search/test.yaml index 0a2a7aa5d..9f8253d95 100644 --- a/testsuite/ada_lsp/project_search/test.yaml +++ b/testsuite/ada_lsp/project_search/test.yaml @@ -1 +1,4 @@ title: 'project_search' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/project_symlinks/test.yaml b/testsuite/ada_lsp/project_symlinks/test.yaml index e420b3a1d..6d279b3f8 100644 --- a/testsuite/ada_lsp/project_symlinks/test.yaml +++ b/testsuite/ada_lsp/project_symlinks/test.yaml @@ -1,3 +1,5 @@ title: 'project_symlinks' skip: - - ['SKIP', 'env.build.os.name == "windows"'] \ No newline at end of file + - ['SKIP', 'env.build.os.name == "windows"'] + # Skip till 3.17 ready + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/publish_diag/test.yaml b/testsuite/ada_lsp/publish_diag/test.yaml index 5407b203c..3a6fb7d24 100644 --- a/testsuite/ada_lsp/publish_diag/test.yaml +++ b/testsuite/ada_lsp/publish_diag/test.yaml @@ -1 +1,4 @@ title: 'publish_diag' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/range_formatting/UB30-006_range_format_whole_document/test.yaml b/testsuite/ada_lsp/range_formatting/UB30-006_range_format_whole_document/test.yaml index 788725536..6d7bbe96d 100644 --- a/testsuite/ada_lsp/range_formatting/UB30-006_range_format_whole_document/test.yaml +++ b/testsuite/ada_lsp/range_formatting/UB30-006_range_format_whole_document/test.yaml @@ -1 +1,4 @@ title: 'UB30-006_range_format_whole_document' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/range_formatting/W103-015_GitHub-1008/test.yaml b/testsuite/ada_lsp/range_formatting/W103-015_GitHub-1008/test.yaml index e5531c3d5..9432af60f 100644 --- a/testsuite/ada_lsp/range_formatting/W103-015_GitHub-1008/test.yaml +++ b/testsuite/ada_lsp/range_formatting/W103-015_GitHub-1008/test.yaml @@ -1 +1,4 @@ title: 'W103-015_GitHub-1008' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/range_formatting/W103-015_GitHub-1073-1074/test.yaml b/testsuite/ada_lsp/range_formatting/W103-015_GitHub-1073-1074/test.yaml index ce967cb61..ce26df2c2 100644 --- a/testsuite/ada_lsp/range_formatting/W103-015_GitHub-1073-1074/test.yaml +++ b/testsuite/ada_lsp/range_formatting/W103-015_GitHub-1073-1074/test.yaml @@ -1 +1,4 @@ title: 'W103-015_GitHub-1073-1074' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/range_formatting/W103-015_GitHub-1086/test.yaml b/testsuite/ada_lsp/range_formatting/W103-015_GitHub-1086/test.yaml index 6a5d83caa..bc55cad20 100644 --- a/testsuite/ada_lsp/range_formatting/W103-015_GitHub-1086/test.yaml +++ b/testsuite/ada_lsp/range_formatting/W103-015_GitHub-1086/test.yaml @@ -1 +1,4 @@ title: 'W103-015_GitHub-1086' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/refactoring_add_parameter/S314-015/test.yaml b/testsuite/ada_lsp/refactoring_add_parameter/S314-015/test.yaml index 02a7aa171..f43843768 100644 --- a/testsuite/ada_lsp/refactoring_add_parameter/S314-015/test.yaml +++ b/testsuite/ada_lsp/refactoring_add_parameter/S314-015/test.yaml @@ -3,3 +3,6 @@ title: 'refactoring_add_parameters_S314-015_0' description: > Check that the Add_Parameter codeAction is not available if the client does not provide the userInputProvider capability. +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/refactoring_add_parameter/UA25-015/test.yaml b/testsuite/ada_lsp/refactoring_add_parameter/UA25-015/test.yaml index 15420ab5f..048c442b7 100644 --- a/testsuite/ada_lsp/refactoring_add_parameter/UA25-015/test.yaml +++ b/testsuite/ada_lsp/refactoring_add_parameter/UA25-015/test.yaml @@ -4,3 +4,6 @@ description: > Check that the Add_Parameter codeAction is avaiable when the client provides the userInputProvider capability, and that it executes correctly. +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/refactoring_change_parameters_default_values/S314-015/test.yaml b/testsuite/ada_lsp/refactoring_change_parameters_default_values/S314-015/test.yaml index 3ef6451e6..3fa8ff28a 100644 --- a/testsuite/ada_lsp/refactoring_change_parameters_default_values/S314-015/test.yaml +++ b/testsuite/ada_lsp/refactoring_change_parameters_default_values/S314-015/test.yaml @@ -1 +1,4 @@ title: 'refactoring_change_parameters_default_values/S314-015' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/refactoring_change_parameters_type/S314-015/test.yaml b/testsuite/ada_lsp/refactoring_change_parameters_type/S314-015/test.yaml index 4eb744bf9..70e45128e 100644 --- a/testsuite/ada_lsp/refactoring_change_parameters_type/S314-015/test.yaml +++ b/testsuite/ada_lsp/refactoring_change_parameters_type/S314-015/test.yaml @@ -1 +1,4 @@ title: 'refactoring_change_parameters_type/S314-015' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/refactoring_diagnostics/test.yaml b/testsuite/ada_lsp/refactoring_diagnostics/test.yaml index 3790b7b3d..28cb3d211 100644 --- a/testsuite/ada_lsp/refactoring_diagnostics/test.yaml +++ b/testsuite/ada_lsp/refactoring_diagnostics/test.yaml @@ -1 +1,4 @@ title: 'refactoring_diagnostics' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/refactoring_extract_subprogram/SA11-047_0/test.yaml b/testsuite/ada_lsp/refactoring_extract_subprogram/SA11-047_0/test.yaml index 9f0e99c25..87a9e3e62 100644 --- a/testsuite/ada_lsp/refactoring_extract_subprogram/SA11-047_0/test.yaml +++ b/testsuite/ada_lsp/refactoring_extract_subprogram/SA11-047_0/test.yaml @@ -1 +1,4 @@ title: 'refactoring_extract_subprogram/SA11-047_0' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/refactoring_extract_subprogram/SA11-047_1/test.yaml b/testsuite/ada_lsp/refactoring_extract_subprogram/SA11-047_1/test.yaml index 09d270119..5b557ae5e 100644 --- a/testsuite/ada_lsp/refactoring_extract_subprogram/SA11-047_1/test.yaml +++ b/testsuite/ada_lsp/refactoring_extract_subprogram/SA11-047_1/test.yaml @@ -1 +1,4 @@ title: 'refactoring_extract_subprogram/SA11-047_1' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/refactoring_imports_commands/U511-009.refactoring.import_with_use/test.yaml b/testsuite/ada_lsp/refactoring_imports_commands/U511-009.refactoring.import_with_use/test.yaml index 758ad65b5..ec7c8badb 100644 --- a/testsuite/ada_lsp/refactoring_imports_commands/U511-009.refactoring.import_with_use/test.yaml +++ b/testsuite/ada_lsp/refactoring_imports_commands/U511-009.refactoring.import_with_use/test.yaml @@ -1 +1,4 @@ title: 'U511-009.refactoring.import_with_use' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/refactoring_imports_commands/suggestions_with_nested_packages/test.yaml b/testsuite/ada_lsp/refactoring_imports_commands/suggestions_with_nested_packages/test.yaml index be969cbe2..cb155740b 100644 --- a/testsuite/ada_lsp/refactoring_imports_commands/suggestions_with_nested_packages/test.yaml +++ b/testsuite/ada_lsp/refactoring_imports_commands/suggestions_with_nested_packages/test.yaml @@ -1 +1,4 @@ title: 'refactor_imports_commands' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/refactoring_introduce_parameter/SA11-051/test.yaml b/testsuite/ada_lsp/refactoring_introduce_parameter/SA11-051/test.yaml index bc50abdec..6487d85e9 100644 --- a/testsuite/ada_lsp/refactoring_introduce_parameter/SA11-051/test.yaml +++ b/testsuite/ada_lsp/refactoring_introduce_parameter/SA11-051/test.yaml @@ -1 +1,4 @@ title: 'refactoring_introduce_parameter/SA11-051' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/refactoring_pull_up_declaration/V207-019/test.yaml b/testsuite/ada_lsp/refactoring_pull_up_declaration/V207-019/test.yaml index 04e2109cf..cf84bdcef 100644 --- a/testsuite/ada_lsp/refactoring_pull_up_declaration/V207-019/test.yaml +++ b/testsuite/ada_lsp/refactoring_pull_up_declaration/V207-019/test.yaml @@ -1 +1,4 @@ title: 'refactoring_pull_up_declaration/V207-019' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/refactoring_replace_type/Q817-007/test.yaml b/testsuite/ada_lsp/refactoring_replace_type/Q817-007/test.yaml index 311430b5f..7b8156c29 100644 --- a/testsuite/ada_lsp/refactoring_replace_type/Q817-007/test.yaml +++ b/testsuite/ada_lsp/refactoring_replace_type/Q817-007/test.yaml @@ -1 +1,4 @@ title: 'foo_test' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/refactoring_sort_dependencies/SA22-035/test.yaml b/testsuite/ada_lsp/refactoring_sort_dependencies/SA22-035/test.yaml index ba299842b..56e907375 100644 --- a/testsuite/ada_lsp/refactoring_sort_dependencies/SA22-035/test.yaml +++ b/testsuite/ada_lsp/refactoring_sort_dependencies/SA22-035/test.yaml @@ -1 +1,4 @@ title: 'refactoring_sort_dependencies/SA22-035' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/references.child/test.yaml b/testsuite/ada_lsp/references.child/test.yaml index 5bb27a1b4..c14c644af 100644 --- a/testsuite/ada_lsp/references.child/test.yaml +++ b/testsuite/ada_lsp/references.child/test.yaml @@ -1 +1,4 @@ title: 'references.child' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/references.overriding/test.yaml b/testsuite/ada_lsp/references.overriding/test.yaml index 892e2b5ef..a1be780ea 100644 --- a/testsuite/ada_lsp/references.overriding/test.yaml +++ b/testsuite/ada_lsp/references.overriding/test.yaml @@ -1 +1,4 @@ title: 'references.overriding' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/rename.not_up_to_date/test.yaml b/testsuite/ada_lsp/rename.not_up_to_date/test.yaml index 0b93a159c..0995735d7 100644 --- a/testsuite/ada_lsp/rename.not_up_to_date/test.yaml +++ b/testsuite/ada_lsp/rename.not_up_to_date/test.yaml @@ -1 +1,4 @@ title: 'rename.not_up_to_date' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/rename.prepare/test.yaml b/testsuite/ada_lsp/rename.prepare/test.yaml index c7c534518..a504e5c09 100644 --- a/testsuite/ada_lsp/rename.prepare/test.yaml +++ b/testsuite/ada_lsp/rename.prepare/test.yaml @@ -1 +1,4 @@ title: 'rename.prepare' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/rename.primitive_parameters/test.yaml b/testsuite/ada_lsp/rename.primitive_parameters/test.yaml index 66072476f..67fa64120 100644 --- a/testsuite/ada_lsp/rename.primitive_parameters/test.yaml +++ b/testsuite/ada_lsp/rename.primitive_parameters/test.yaml @@ -1 +1,4 @@ title: 'rename.primitive_parameters' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/rename.tagged_type_primitives/test.yaml b/testsuite/ada_lsp/rename.tagged_type_primitives/test.yaml index 69a40f07a..e6c233318 100644 --- a/testsuite/ada_lsp/rename.tagged_type_primitives/test.yaml +++ b/testsuite/ada_lsp/rename.tagged_type_primitives/test.yaml @@ -1 +1,4 @@ title: 'rename.tagged_type_primitives' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/rename/test.yaml b/testsuite/ada_lsp/rename/test.yaml index de8e16831..7d0b374ee 100644 --- a/testsuite/ada_lsp/rename/test.yaml +++ b/testsuite/ada_lsp/rename/test.yaml @@ -1 +1,4 @@ title: 'rename' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/show_dependencies.aggregate/test.yaml b/testsuite/ada_lsp/show_dependencies.aggregate/test.yaml index 2ad209106..babea9703 100644 --- a/testsuite/ada_lsp/show_dependencies.aggregate/test.yaml +++ b/testsuite/ada_lsp/show_dependencies.aggregate/test.yaml @@ -1 +1,4 @@ title: 'show_dependencies.aggregate' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/show_dependencies/test.yaml b/testsuite/ada_lsp/show_dependencies/test.yaml index 80708b21f..764945a71 100644 --- a/testsuite/ada_lsp/show_dependencies/test.yaml +++ b/testsuite/ada_lsp/show_dependencies/test.yaml @@ -1 +1,4 @@ title: 'show_dependencies' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/signature.aggregate/test.yaml b/testsuite/ada_lsp/signature.aggregate/test.yaml index eec92b91e..9440d9ef4 100644 --- a/testsuite/ada_lsp/signature.aggregate/test.yaml +++ b/testsuite/ada_lsp/signature.aggregate/test.yaml @@ -1 +1,4 @@ title: 'signature.aggregate' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/signature.aggregate2/test.yaml b/testsuite/ada_lsp/signature.aggregate2/test.yaml index c42881385..fb366ea77 100644 --- a/testsuite/ada_lsp/signature.aggregate2/test.yaml +++ b/testsuite/ada_lsp/signature.aggregate2/test.yaml @@ -1 +1,4 @@ title: 'signature.aggregate2' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/signature.generic/test.yaml b/testsuite/ada_lsp/signature.generic/test.yaml index 56f800026..967c075ba 100644 --- a/testsuite/ada_lsp/signature.generic/test.yaml +++ b/testsuite/ada_lsp/signature.generic/test.yaml @@ -1 +1,4 @@ title: 'signature.generic' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/skip__standard/test.yaml b/testsuite/ada_lsp/skip__standard/test.yaml index 9dad6b62c..a98623397 100644 --- a/testsuite/ada_lsp/skip__standard/test.yaml +++ b/testsuite/ada_lsp/skip__standard/test.yaml @@ -1 +1,4 @@ title: 'skip__standard' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/spec_from_body/test.yaml b/testsuite/ada_lsp/spec_from_body/test.yaml index e12ef5329..7c2abf950 100644 --- a/testsuite/ada_lsp/spec_from_body/test.yaml +++ b/testsuite/ada_lsp/spec_from_body/test.yaml @@ -1 +1,4 @@ title: 'spec_from_body' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/type_definition.aggregate/test.yaml b/testsuite/ada_lsp/type_definition.aggregate/test.yaml index be682af55..574180802 100644 --- a/testsuite/ada_lsp/type_definition.aggregate/test.yaml +++ b/testsuite/ada_lsp/type_definition.aggregate/test.yaml @@ -1 +1,4 @@ title: 'type_definition.aggregate' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/type_definition.def_name/test.yaml b/testsuite/ada_lsp/type_definition.def_name/test.yaml index 1720bdee4..5a3c7b93e 100644 --- a/testsuite/ada_lsp/type_definition.def_name/test.yaml +++ b/testsuite/ada_lsp/type_definition.def_name/test.yaml @@ -1 +1,4 @@ title: 'type_definition.def_name' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/type_definition/test.yaml b/testsuite/ada_lsp/type_definition/test.yaml index c24ca1a1f..a4714fc80 100644 --- a/testsuite/ada_lsp/type_definition/test.yaml +++ b/testsuite/ada_lsp/type_definition/test.yaml @@ -1 +1,4 @@ title: 'type_definition' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/workspace_symbol/test.yaml b/testsuite/ada_lsp/workspace_symbol/test.yaml index bb6898958..2600bcf46 100644 --- a/testsuite/ada_lsp/workspace_symbol/test.yaml +++ b/testsuite/ada_lsp/workspace_symbol/test.yaml @@ -1 +1,4 @@ title: 'workspace_symbol' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/gpr_lsp/get_symbols/test.yaml b/testsuite/gpr_lsp/get_symbols/test.yaml index dd06e4d51..d242ff582 100644 --- a/testsuite/gpr_lsp/get_symbols/test.yaml +++ b/testsuite/gpr_lsp/get_symbols/test.yaml @@ -1 +1,4 @@ title: 'textDocument/documentSymbol request (no hierarchicalDocumentSymbolSupport)' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/gpr_lsp/get_symbols_hierarchy/test.yaml b/testsuite/gpr_lsp/get_symbols_hierarchy/test.yaml index f107dd526..6681866a7 100644 --- a/testsuite/gpr_lsp/get_symbols_hierarchy/test.yaml +++ b/testsuite/gpr_lsp/get_symbols_hierarchy/test.yaml @@ -1 +1,4 @@ title: 'textDocument/documentSymbol request using hierarchicalDocumentSymbolSupport' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/gpr_lsp/publish_diag/test.yaml b/testsuite/gpr_lsp/publish_diag/test.yaml index 2f8fa1edd..a2487c50c 100644 --- a/testsuite/gpr_lsp/publish_diag/test.yaml +++ b/testsuite/gpr_lsp/publish_diag/test.yaml @@ -1 +1,4 @@ title: 'invalid_project' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] From b9b91e36a9d45065593167a079bbb7fb32b10ee7 Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Wed, 16 Aug 2023 10:07:18 +0300 Subject: [PATCH 033/152] Add DisplayMethodAncestryOnNavigationPolicy type Refs #1170 --- source/ada/lsp-ada_configurations.adb | 20 ++++++++++++++++---- source/ada/lsp-ada_configurations.ads | 13 +++++++++++++ 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/source/ada/lsp-ada_configurations.adb b/source/ada/lsp-ada_configurations.adb index 093daefd1..6f1ac0288 100644 --- a/source/ada/lsp-ada_configurations.adb +++ b/source/ada/lsp-ada_configurations.adb @@ -28,6 +28,13 @@ package body LSP.Ada_Configurations is [for Item in GNATdoc.Comments.Options.Documentation_Style => VSS.Strings.To_Virtual_String (Item'Wide_Wide_Image).To_Lowercase]; + Display_Method_Values : constant VSS.String_Vectors.Virtual_String_Vector := + [for Item in DisplayMethodAncestryOnNavigationPolicy => + VSS.Strings.To_Virtual_String (Item'Wide_Wide_Image).To_Lowercase]; + + function "+" (X : VSS.Strings.Virtual_String'Class) return String renames + VSS.Strings.Conversions.To_UTF_8_String; + --------------- -- Read_JSON -- --------------- @@ -144,8 +151,14 @@ package body LSP.Ada_Configurations is then Self.Folding_Comments := JSON (Index).Boolean_Value; - elsif Name = "displayMethodAncestryOnNavigation" then - null; -- TBD + elsif Name = "displayMethodAncestryOnNavigation" + and then JSON (Index).Kind = String_Value + and then Display_Method_Values.Contains + (JSON (Index).String_Value) + then + Self.Method_Ancestry_Policy := + DisplayMethodAncestryOnNavigationPolicy'Value + (+JSON (Index).String_Value); elsif Name = "followSymlinks" and then JSON (Index).Kind = Boolean_Value @@ -158,8 +171,7 @@ package body LSP.Ada_Configurations is then Self.Documentation_Style := GNATdoc.Comments.Options.Documentation_Style'Value - (VSS.Strings.Conversions.To_UTF_8_String - (JSON (Index).String_Value)); + (+JSON (Index).String_Value); elsif Name = "useCompletionSnippets" and then JSON (Index).Kind = Boolean_Value diff --git a/source/ada/lsp-ada_configurations.ads b/source/ada/lsp-ada_configurations.ads index b48fba3f3..d9f4c8f3b 100644 --- a/source/ada/lsp-ada_configurations.ads +++ b/source/ada/lsp-ada_configurations.ads @@ -91,6 +91,12 @@ package LSP.Ada_Configurations is (Self : Configuration'Class) return Variable_List; -- Scenario variables, if provided by the user on Configuration/Init + type DisplayMethodAncestryOnNavigationPolicy is + (Never, Usage_And_Abstract_Only, Definition_Only, Always); + + function Display_Method_Ancestry_Policy (Self : Configuration'Class) + return DisplayMethodAncestryOnNavigationPolicy; + private type Configuration is tagged limited record @@ -111,6 +117,9 @@ private Documentation_Style : GNATdoc.Comments.Options.Documentation_Style := GNATdoc.Comments.Options.GNAT; + Method_Ancestry_Policy : DisplayMethodAncestryOnNavigationPolicy := + Usage_And_Abstract_Only; + Variables_Names : VSS.String_Vectors.Virtual_String_Vector; Variables_Values : VSS.String_Vectors.Virtual_String_Vector; end record; @@ -168,4 +177,8 @@ private return GNATdoc.Comments.Options.Documentation_Style is (Self.Documentation_Style); + function Display_Method_Ancestry_Policy (Self : Configuration'Class) + return DisplayMethodAncestryOnNavigationPolicy is + (Self.Method_Ancestry_Policy); + end LSP.Ada_Configurations; From 3aa8398e04efa83f92d19710726b644935a70b10 Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Wed, 16 Aug 2023 19:32:11 +0300 Subject: [PATCH 034/152] Enable definition provider --- source/ada/lsp-ada_client_capabilities.adb | 1 + source/lsp_3.17/lsp-constants.ads | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/source/ada/lsp-ada_client_capabilities.adb b/source/ada/lsp-ada_client_capabilities.adb index 4e6c99d83..898f141be 100644 --- a/source/ada/lsp-ada_client_capabilities.adb +++ b/source/ada/lsp-ada_client_capabilities.adb @@ -77,6 +77,7 @@ package body LSP.Ada_Client_Capabilities is else LSP.Enumerations.Full))); + Result.definitionProvider := LSP.Constants.True; Result.foldingRangeProvider := LSP.Constants.True; end return; end To_Server_Capabilities; diff --git a/source/lsp_3.17/lsp-constants.ads b/source/lsp_3.17/lsp-constants.ads index 341694568..34b7c64ab 100644 --- a/source/lsp_3.17/lsp-constants.ads +++ b/source/lsp_3.17/lsp-constants.ads @@ -23,4 +23,12 @@ package LSP.Constants is return LSP.Structures.foldingRangeProvider_OfServerCapabilities_Optional is (Is_Set => True, Value => True); + function True + return LSP.Structures.Boolean_Or_DefinitionOptions + is (Is_Boolean => True, Boolean => True); + + function True + return LSP.Structures.Boolean_Or_DefinitionOptions_Optional + is (Is_Set => True, Value => True); + end LSP.Constants; From 628cd6fd28194120f0868197c3a99eb8f7cabab6 Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Thu, 17 Aug 2023 12:17:24 +0300 Subject: [PATCH 035/152] Always reload project if Project_Tree isn't ready Refs #1170 --- source/ada/lsp-ada_handlers.adb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/ada/lsp-ada_handlers.adb b/source/ada/lsp-ada_handlers.adb index 8a9587a42..00e30e4d7 100644 --- a/source/ada/lsp-ada_handlers.adb +++ b/source/ada/lsp-ada_handlers.adb @@ -342,10 +342,13 @@ package body LSP.Ada_Handlers is (Self : in out Message_Handler; Value : LSP.Structures.DidChangeConfigurationParams) is - Reload : Boolean := False; + Reload : Boolean; begin Self.Configuration.Read_JSON (Value.settings, Reload); + -- Always reload project if Project_Tree isn't ready + Reload := Reload or not Self.Project_Tree.Is_Defined; + if Reload then LSP.Ada_Handlers.Project_Loading.Reload_Project (Self); end if; From cf4b6fdb36f4c7947ac97db340c03d96a56b08df Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Thu, 17 Aug 2023 12:46:21 +0300 Subject: [PATCH 036/152] Reorder subprogram bodies in lsp-ada_handlers.adb --- source/ada/lsp-ada_handlers.adb | 418 ++++++++++++++++---------------- 1 file changed, 210 insertions(+), 208 deletions(-) diff --git a/source/ada/lsp-ada_handlers.adb b/source/ada/lsp-ada_handlers.adb index 00e30e4d7..d8ad2c92f 100644 --- a/source/ada/lsp-ada_handlers.adb +++ b/source/ada/lsp-ada_handlers.adb @@ -29,11 +29,13 @@ with LSP.Ada_Handlers.Project_Loading; with LSP.Diagnostic_Sources; with LSP.Enumerations; with LSP.Generic_Cancel_Check; -with LSP.Servers; with LSP.Server_Notifications.DidChange; +with LSP.Servers; package body LSP.Ada_Handlers is + pragma Style_Checks ("o"); -- check subprogram bodies in alphabetical ordr + function Contexts_For_URI (Self : access Message_Handler; URI : LSP.Structures.DocumentUri) @@ -90,33 +92,21 @@ package body LSP.Ada_Handlers is (VSS.Strings.Conversions.To_UTF_8_String (URI), Normalize => Self.Configuration.Follow_Symlinks))); - ------------------- - -- Log_Method_In -- - ------------------- + ----------------------- + -- Clean_Diagnostics -- + ----------------------- - procedure Log_Method_In - (Self : in out Message_Handler; - Name : String; - URI : LSP.Structures.DocumentUri := EmptyDocumentUri) is + procedure Clean_Diagnostics + (Self : in out Message_Handler'Class; + Document : not null LSP.Ada_Documents.Document_Access) + is + Diag : LSP.Structures.PublishDiagnosticsParams; begin - if not URI.Is_Empty then - Self.Tracer.Trace ("In Message_Handler " & Name & " URI:"); - Self.Tracer.Trace_Text (URI); - else - Self.Tracer.Trace ("In Message_Handler " & Name); + if Self.Configuration.Diagnostics_Enabled then + Diag.uri := Document.URI; + Self.Sender.On_PublishDiagnostics_Notification (Diag); end if; - end Log_Method_In; - - -------------------- - -- Log_Method_Out -- - -------------------- - - procedure Log_Method_Out - (Self : in out Message_Handler; - Name : String) is - begin - Self.Tracer.Trace ("Out Message_Handler " & Name); - end Log_Method_Out; + end Clean_Diagnostics; ---------------------- -- Contexts_For_URI -- @@ -201,43 +191,33 @@ package body LSP.Ada_Handlers is Self.Incremental_Text_Changes := Incremental_Text_Changes; end Initialize; - ----------------------------- - -- On_FoldingRange_Request -- - ----------------------------- - - overriding procedure On_FoldingRange_Request - (Self : in out Message_Handler; - Id : LSP.Structures.Integer_Or_Virtual_String; - Value : LSP.Structures.FoldingRangeParams) - is - use type LSP.Ada_Documents.Document_Access; - - Context : constant LSP.Ada_Context_Sets.Context_Access := - Self.Contexts.Get_Best_Context (Value.textDocument.uri); - Document : constant LSP.Ada_Documents.Document_Access := - Get_Open_Document (Self, Value.textDocument.uri); - Response : LSP.Structures.FoldingRange_Vector_Or_Null; + ------------------- + -- Log_Method_In -- + ------------------- + procedure Log_Method_In + (Self : in out Message_Handler; + Name : String; + URI : LSP.Structures.DocumentUri := EmptyDocumentUri) is begin - if Document /= null then - Document.Get_Folding_Blocks - (Context.all, - Self.Client.Line_Folding_Only, - Self.Configuration.Folding_Comments, - Self.Is_Canceled, - Response); - - if Self.Is_Canceled.all then - Response.Clear; - end if; - Self.Sender.On_FoldingRange_Response (Id, Response); - + if not URI.Is_Empty then + Self.Tracer.Trace ("In Message_Handler " & Name & " URI:"); + Self.Tracer.Trace_Text (URI); else - Self.Sender.On_Error_Response - (Id, (code => LSP.Enumerations.InternalError, - message => "Document is not opened")); + Self.Tracer.Trace ("In Message_Handler " & Name); end if; - end On_FoldingRange_Request; + end Log_Method_In; + + -------------------- + -- Log_Method_Out -- + -------------------- + + procedure Log_Method_Out + (Self : in out Message_Handler; + Name : String) is + begin + Self.Tracer.Trace ("Out Message_Handler " & Name); + end Log_Method_Out; ------------------------------- -- On_DidChange_Notification -- @@ -354,62 +334,105 @@ package body LSP.Ada_Handlers is end if; end On_DidChangeConfiguration_Notification; - ----------------------------- - -- On_DidOpen_Notification -- - ----------------------------- + ----------------------------------------------- + -- On_DidChangeWorkspaceFolders_Notification -- + ----------------------------------------------- - overriding procedure On_DidOpen_Notification + overriding procedure On_DidChangeWorkspaceFolders_Notification (Self : in out Message_Handler; - Value : LSP.Structures.DidOpenTextDocumentParams) + Value : LSP.Structures.DidChangeWorkspaceFoldersParams) is - URI : LSP.Structures.DocumentUri renames Value.textDocument.uri; - File : constant GNATCOLL.VFS.Virtual_File := Self.To_File (URI); - Object : constant Internal_Document_Access := - new LSP.Ada_Documents.Document (Self.Tracer); - Diag : constant LSP.Diagnostic_Sources.Diagnostic_Source_Access := - new LSP.Ada_Handlers.Project_Diagnostics.Diagnostic_Source - (Self'Unchecked_Access); - begin - Self.Log_Method_In ("Text_Document_Did_Open", URI); + use type LSP.Ada_Documents.Document_Access; - -- Some clients don't properly call initialize, or don't pass the - -- project to didChangeConfiguration: fallback here on loading a - -- project in this directory, if needed. - Self.Client.Set_Root_If_Empty - (VSS.Strings.Conversions.To_Virtual_String - (File.Dir.Display_Full_Name)); + URI : LSP.Structures.DocumentUri; + File : GNATCOLL.VFS.Virtual_File; - Project_Loading.Ensure_Project_Loaded (Self); + procedure Process_Created_File; + -- Processes a created file - -- We have received a document: add it to the documents container - Object.Initialize (URI, Value.textDocument.text, Diag); - Self.Open_Documents.Include (File, Object); + procedure Process_Deleted_File; + -- Processes a deleted file - -- Handle the case where we're loading the implicit project: do - -- we need to add the directory in which the document is open? + -------------------------- + -- Process_Created_File -- + -------------------------- - if Self.Project_Status in Implicit_Project_Loaded then - declare - Dir : constant GNATCOLL.VFS.Virtual_File := Self.To_File (URI).Dir; - begin - if not Self.Project_Dirs_Loaded.Contains (Dir) then - -- We do need to add this directory - Self.Project_Dirs_Loaded.Insert (Dir); - Project_Loading.Reload_Implicit_Project_Dirs (Self); + procedure Process_Created_File + is + use VSS.Strings.Conversions; + + Contexts : constant LSP.Ada_Context_Sets.Context_Lists.List := + Self.Contexts_For_URI (URI); + + function Has_Dir + (Context : LSP.Ada_Contexts.Context) + return Boolean + is (Context.List_Source_Directories.Contains (File.Dir)); + -- Return True if File is in a source directory of the project held + -- by Context. + + begin + -- If the file was created by the client, then the DidCreateFiles + -- notification might have been received from it. In that case, + -- Contexts wont be empty, and all we need to do is check if + -- there's an open document. If there is, it takes precedence over + -- the filesystem. + -- If Contexts is empty, then we need to check if is a new source + -- that needs to be added. For instance, a source that was moved + -- to the the project source directories. + + if Contexts.Is_Empty then + for Context of Self.Contexts.Each_Context + (Has_Dir'Unrestricted_Access) + loop + Context.Include_File (File); + Context.Index_File (File); + + Self.Tracer.Trace + ("Included " & File.Display_Base_Name + & " in context " & To_UTF_8_String (Context.Id)); + end loop; + + else + if Self.Get_Open_Document (URI) = null then + for Context of Contexts loop + Context.Index_File (File); + end loop; end if; - end; - end if; + end if; + end Process_Created_File; - -- Index the document in all the contexts where it is relevant - for Context of Self.Contexts_For_URI (URI) loop - Context.Index_Document (Object.all); - end loop; + --------------------------- + -- Process_Deleted_Files -- + --------------------------- - -- Emit diagnostics - Self.Publish_Diagnostics (LSP.Ada_Documents.Document_Access (Object)); + procedure Process_Deleted_File is + begin + if Self.Get_Open_Document (URI) = null then + -- If there is no document, remove from the sources list + -- and reindex the file for each context where it is + -- relevant. + for C of Self.Contexts_For_URI (URI) loop + C.Exclude_File (File); + C.Index_File (File); + end loop; + end if; + end Process_Deleted_File; - Self.Log_Method_Out ("Text_Document_Did_Open"); - end On_DidOpen_Notification; + begin + -- Look through each change, filtering non Ada source files + for Change of Value.event.added loop + URI := To_DocumentUri (Change.uri); + File := Self.To_File (URI); + Process_Created_File; + end loop; + + for Change of Value.event.removed loop + URI := To_DocumentUri (Change.uri); + File := Self.To_File (URI); + Process_Deleted_File; + end loop; + end On_DidChangeWorkspaceFolders_Notification; ------------------------------ -- On_DidClose_Notification -- @@ -552,6 +575,63 @@ package body LSP.Ada_Handlers is Self.Log_Method_Out ("On_DidDeleteFiles_Notification"); end On_DidDeleteFiles_Notification; + ----------------------------- + -- On_DidOpen_Notification -- + ----------------------------- + + overriding procedure On_DidOpen_Notification + (Self : in out Message_Handler; + Value : LSP.Structures.DidOpenTextDocumentParams) + is + URI : LSP.Structures.DocumentUri renames Value.textDocument.uri; + File : constant GNATCOLL.VFS.Virtual_File := Self.To_File (URI); + Object : constant Internal_Document_Access := + new LSP.Ada_Documents.Document (Self.Tracer); + Diag : constant LSP.Diagnostic_Sources.Diagnostic_Source_Access := + new LSP.Ada_Handlers.Project_Diagnostics.Diagnostic_Source + (Self'Unchecked_Access); + begin + Self.Log_Method_In ("Text_Document_Did_Open", URI); + + -- Some clients don't properly call initialize, or don't pass the + -- project to didChangeConfiguration: fallback here on loading a + -- project in this directory, if needed. + Self.Client.Set_Root_If_Empty + (VSS.Strings.Conversions.To_Virtual_String + (File.Dir.Display_Full_Name)); + + Project_Loading.Ensure_Project_Loaded (Self); + + -- We have received a document: add it to the documents container + Object.Initialize (URI, Value.textDocument.text, Diag); + Self.Open_Documents.Include (File, Object); + + -- Handle the case where we're loading the implicit project: do + -- we need to add the directory in which the document is open? + + if Self.Project_Status in Implicit_Project_Loaded then + declare + Dir : constant GNATCOLL.VFS.Virtual_File := Self.To_File (URI).Dir; + begin + if not Self.Project_Dirs_Loaded.Contains (Dir) then + -- We do need to add this directory + Self.Project_Dirs_Loaded.Insert (Dir); + Project_Loading.Reload_Implicit_Project_Dirs (Self); + end if; + end; + end if; + + -- Index the document in all the contexts where it is relevant + for Context of Self.Contexts_For_URI (URI) loop + Context.Index_Document (Object.all); + end loop; + + -- Emit diagnostics + Self.Publish_Diagnostics (LSP.Ada_Documents.Document_Access (Object)); + + Self.Log_Method_Out ("Text_Document_Did_Open"); + end On_DidOpen_Notification; + ------------------------------------ -- On_DidRenameFiles_Notification -- ------------------------------------ @@ -657,105 +737,43 @@ package body LSP.Ada_Handlers is Self.Log_Method_Out ("On_DidRenameFiles_Notification"); end On_DidRenameFiles_Notification; - ----------------------------------------------- - -- On_DidChangeWorkspaceFolders_Notification -- - ----------------------------------------------- + ----------------------------- + -- On_FoldingRange_Request -- + ----------------------------- - overriding procedure On_DidChangeWorkspaceFolders_Notification + overriding procedure On_FoldingRange_Request (Self : in out Message_Handler; - Value : LSP.Structures.DidChangeWorkspaceFoldersParams) + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.FoldingRangeParams) is use type LSP.Ada_Documents.Document_Access; - URI : LSP.Structures.DocumentUri; - File : GNATCOLL.VFS.Virtual_File; - - procedure Process_Created_File; - -- Processes a created file - - procedure Process_Deleted_File; - -- Processes a deleted file - - -------------------------- - -- Process_Created_File -- - -------------------------- - - procedure Process_Created_File - is - use VSS.Strings.Conversions; - - Contexts : constant LSP.Ada_Context_Sets.Context_Lists.List := - Self.Contexts_For_URI (URI); - - function Has_Dir - (Context : LSP.Ada_Contexts.Context) - return Boolean - is (Context.List_Source_Directories.Contains (File.Dir)); - -- Return True if File is in a source directory of the project held - -- by Context. - - begin - -- If the file was created by the client, then the DidCreateFiles - -- notification might have been received from it. In that case, - -- Contexts wont be empty, and all we need to do is check if - -- there's an open document. If there is, it takes precedence over - -- the filesystem. - -- If Contexts is empty, then we need to check if is a new source - -- that needs to be added. For instance, a source that was moved - -- to the the project source directories. - - if Contexts.Is_Empty then - for Context of Self.Contexts.Each_Context - (Has_Dir'Unrestricted_Access) - loop - Context.Include_File (File); - Context.Index_File (File); - - Self.Tracer.Trace - ("Included " & File.Display_Base_Name - & " in context " & To_UTF_8_String (Context.Id)); - end loop; - - else - if Self.Get_Open_Document (URI) = null then - for Context of Contexts loop - Context.Index_File (File); - end loop; - end if; - end if; - end Process_Created_File; + Context : constant LSP.Ada_Context_Sets.Context_Access := + Self.Contexts.Get_Best_Context (Value.textDocument.uri); + Document : constant LSP.Ada_Documents.Document_Access := + Get_Open_Document (Self, Value.textDocument.uri); + Response : LSP.Structures.FoldingRange_Vector_Or_Null; - --------------------------- - -- Process_Deleted_Files -- - --------------------------- + begin + if Document /= null then + Document.Get_Folding_Blocks + (Context.all, + Self.Client.Line_Folding_Only, + Self.Configuration.Folding_Comments, + Self.Is_Canceled, + Response); - procedure Process_Deleted_File is - begin - if Self.Get_Open_Document (URI) = null then - -- If there is no document, remove from the sources list - -- and reindex the file for each context where it is - -- relevant. - for C of Self.Contexts_For_URI (URI) loop - C.Exclude_File (File); - C.Index_File (File); - end loop; + if Self.Is_Canceled.all then + Response.Clear; end if; - end Process_Deleted_File; - - begin - -- Look through each change, filtering non Ada source files - for Change of Value.event.added loop - URI := To_DocumentUri (Change.uri); - File := Self.To_File (URI); - Process_Created_File; - end loop; + Self.Sender.On_FoldingRange_Response (Id, Response); - for Change of Value.event.removed loop - URI := To_DocumentUri (Change.uri); - File := Self.To_File (URI); - Process_Deleted_File; - end loop; - end On_DidChangeWorkspaceFolders_Notification; + else + Self.Sender.On_Error_Response + (Id, (code => LSP.Enumerations.InternalError, + message => "Document is not opened")); + end if; + end On_FoldingRange_Request; --------------------------- -- On_Initialize_Request -- @@ -879,20 +897,4 @@ package body LSP.Ada_Handlers is end if; end Publish_Diagnostics; - ----------------------- - -- Clean_Diagnostics -- - ----------------------- - - procedure Clean_Diagnostics - (Self : in out Message_Handler'Class; - Document : not null LSP.Ada_Documents.Document_Access) - is - Diag : LSP.Structures.PublishDiagnosticsParams; - begin - if Self.Configuration.Diagnostics_Enabled then - Diag.uri := Document.URI; - Self.Sender.On_PublishDiagnostics_Notification (Diag); - end if; - end Clean_Diagnostics; - end LSP.Ada_Handlers; From a33ae39b981c859ba9afddcee5d5585a37f997b2 Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Thu, 17 Aug 2023 13:00:55 +0300 Subject: [PATCH 037/152] Add `definition` request handler Refs #1170 --- source/ada/lsp-ada_handlers-locations.adb | 112 ++++++++++ source/ada/lsp-ada_handlers-locations.ads | 33 +++ source/ada/lsp-ada_handlers.adb | 248 +++++++++++++++++++++ source/ada/lsp-ada_handlers.ads | 6 + source/ada/lsp-gnatcoll_tracers-handle.adb | 22 ++ source/ada/lsp-gnatcoll_tracers-handle.ads | 19 ++ 6 files changed, 440 insertions(+) create mode 100644 source/ada/lsp-ada_handlers-locations.adb create mode 100644 source/ada/lsp-ada_handlers-locations.ads create mode 100644 source/ada/lsp-gnatcoll_tracers-handle.adb create mode 100644 source/ada/lsp-gnatcoll_tracers-handle.ads diff --git a/source/ada/lsp-ada_handlers-locations.adb b/source/ada/lsp-ada_handlers-locations.adb new file mode 100644 index 000000000..d11bd99ff --- /dev/null +++ b/source/ada/lsp-ada_handlers-locations.adb @@ -0,0 +1,112 @@ +------------------------------------------------------------------------------ +-- Language Server Protocol -- +-- -- +-- Copyright (C) 2018-2023, AdaCore -- +-- -- +-- This is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 3, or (at your option) any later ver- -- +-- sion. This software is distributed in the hope that it will be useful, -- +-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- -- +-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -- +-- License for more details. You should have received a copy of the GNU -- +-- General Public License distributed with this software; see file -- +-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy -- +-- of the license. -- +------------------------------------------------------------------------------ + +with Langkit_Support.Slocs; + +with VSS.Strings.Conversions; +with VSS.Strings.Character_Iterators; + +with URIs; + +package body LSP.Ada_Handlers.Locations is + + --------------------- + -- To_LSP_Location -- + --------------------- + + function To_LSP_Location + (Self : in out Message_Handler'Class; + Node : Libadalang.Analysis.Ada_Node'Class) + return LSP.Structures.Location + is + use type LSP.Ada_Documents.Document_Access; + + URI : constant LSP.Structures.DocumentUri := + (VSS.Strings.Conversions.To_Virtual_String + (URIs.Conversions.From_File (Node.Unit.Get_Filename)) + with null record); + + Sloc : constant Langkit_Support.Slocs.Source_Location_Range := + Node.Sloc_Range; + + Doc : constant LSP.Ada_Documents.Document_Access := + Self.Get_Open_Document (URI); + + Result : LSP.Structures.Location; + begin + if Doc /= null then + return Doc.To_LSP_Location (Sloc); + + else + Result := + (uri => URI, + a_range => + (start => (line => Positive (Sloc.Start_Line) - 1, + character => 0), + an_end => (line => Positive (Sloc.End_Line) - 1, + character => 0))); + end if; + + declare + use type Langkit_Support.Slocs.Column_Number; + + Line : constant VSS.Strings.Virtual_String := + VSS.Strings.To_Virtual_String + (Node.Unit.Get_Line (Positive (Sloc.Start_Line))); + + Cursor : VSS.Strings.Character_Iterators.Character_Iterator := + Line.Before_First_Character; + + begin + for J in 1 .. Sloc.Start_Column loop + exit when not Cursor.Forward; + end loop; + + Result.a_range.start.character := Natural (Cursor.First_UTF16_Offset); + + if Result.a_range.start.line = Result.a_range.an_end.line then + for J in Sloc.Start_Column .. Sloc.End_Column - 1 loop + exit when not Cursor.Forward; + end loop; + + Result.a_range.an_end.character := + Natural (Cursor.First_UTF16_Offset); + + return Result; + end if; + end; + + declare + Line : constant VSS.Strings.Virtual_String := + VSS.Strings.To_Virtual_String + (Node.Unit.Get_Line (Positive (Sloc.End_Line))); + + Cursor : VSS.Strings.Character_Iterators.Character_Iterator := + Line.Before_First_Character; + + begin + for J in 1 .. Sloc.Start_Column loop + exit when not Cursor.Forward; + end loop; + + Result.a_range.an_end.character := Natural (Cursor.First_UTF16_Offset); + + return Result; + end; + end To_LSP_Location; + +end LSP.Ada_Handlers.Locations; diff --git a/source/ada/lsp-ada_handlers-locations.ads b/source/ada/lsp-ada_handlers-locations.ads new file mode 100644 index 000000000..9671ad9cd --- /dev/null +++ b/source/ada/lsp-ada_handlers-locations.ads @@ -0,0 +1,33 @@ +------------------------------------------------------------------------------ +-- Language Server Protocol -- +-- -- +-- Copyright (C) 2018-2023, AdaCore -- +-- -- +-- This is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 3, or (at your option) any later ver- -- +-- sion. This software is distributed in the hope that it will be useful, -- +-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- -- +-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -- +-- License for more details. You should have received a copy of the GNU -- +-- General Public License distributed with this software; see file -- +-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy -- +-- of the license. -- +------------------------------------------------------------------------------ +-- +-- This package provides routines to convert Libadalang locations to LSP +-- locations. If there is the corresponding open document then it is used +-- to do conversion. Otherwise we use Libadalang to get corresponding lines +-- and compute character offsets. + +with Libadalang.Analysis; + +package LSP.Ada_Handlers.Locations is + + function To_LSP_Location + (Self : in out Message_Handler'Class; + Node : Libadalang.Analysis.Ada_Node'Class) + return LSP.Structures.Location; + -- Convert LAL's Node to a LSP location + +end LSP.Ada_Handlers.Locations; diff --git a/source/ada/lsp-ada_handlers.adb b/source/ada/lsp-ada_handlers.adb index d8ad2c92f..22859f81b 100644 --- a/source/ada/lsp-ada_handlers.adb +++ b/source/ada/lsp-ada_handlers.adb @@ -19,16 +19,25 @@ with Ada.Containers.Indefinite_Hashed_Maps; with Ada.Exceptions; with Ada.Unchecked_Deallocation; +with GNATCOLL.Traces; + +with Libadalang.Analysis; +with Libadalang.Common; + +with Laltools.Common; + with VSS.Strings.Conversions; with URIs; with LSP.Ada_Contexts; +with LSP.Ada_Handlers.Locations; with LSP.Ada_Handlers.Project_Diagnostics; with LSP.Ada_Handlers.Project_Loading; with LSP.Diagnostic_Sources; with LSP.Enumerations; with LSP.Generic_Cancel_Check; +with LSP.GNATCOLL_Tracers.Handle; with LSP.Server_Notifications.DidChange; with LSP.Servers; @@ -36,6 +45,37 @@ package body LSP.Ada_Handlers is pragma Style_Checks ("o"); -- check subprogram bodies in alphabetical ordr + type AlsReferenceKind is + (Simple, + Access_Ref, + Write, + Static_Call, + Dispatching_Call, + Parent, + Child, + Overriding_Decl); + -- This should be part of the protocol + + pragma Unreferenced + (Simple, Access_Ref, Write, Static_Call, Dispatching_Call, + Overriding_Decl); + + type AlsReferenceKind_Array is array (AlsReferenceKind) of Boolean; + + function Empty return AlsReferenceKind_Array is ([others => False]); + + function Is_Parent return AlsReferenceKind_Array is + ([Parent => True, others => False]); + + function Is_Child return AlsReferenceKind_Array is + ([Child => True, others => False]); + + procedure Append_Location + (Self : in out Message_Handler; + Result : in out LSP.Structures.Location_Vector; + Node : Libadalang.Analysis.Ada_Node'Class; + Ignore : AlsReferenceKind_Array := Empty); + function Contexts_For_URI (Self : access Message_Handler; URI : LSP.Structures.DocumentUri) @@ -83,6 +123,12 @@ package body LSP.Ada_Handlers is Name : String); -- Save method in/out in a log file + function To_LSP_Location + (Self : in out Message_Handler'Class; + Node : Libadalang.Analysis.Ada_Node'Class) + return LSP.Structures.Location + renames LSP.Ada_Handlers.Locations.To_LSP_Location; + function To_File (Self : Message_Handler'Class; URI : LSP.Structures.DocumentUri) return GNATCOLL.VFS.Virtual_File @@ -92,6 +138,21 @@ package body LSP.Ada_Handlers is (VSS.Strings.Conversions.To_UTF_8_String (URI), Normalize => Self.Configuration.Follow_Symlinks))); + --------------------- + -- Append_Location -- + --------------------- + + procedure Append_Location + (Self : in out Message_Handler; + Result : in out LSP.Structures.Location_Vector; + Node : Libadalang.Analysis.Ada_Node'Class; + Ignore : AlsReferenceKind_Array := Empty) is + begin + if not Node.Is_Synthetic then + Result.Append (Self.To_LSP_Location (Node)); + end if; + end Append_Location; + ----------------------- -- Clean_Diagnostics -- ----------------------- @@ -219,6 +280,193 @@ package body LSP.Ada_Handlers is Self.Tracer.Trace ("Out Message_Handler " & Name); end Log_Method_Out; + --------------------------- + -- On_Definition_Request -- + --------------------------- + + overriding procedure On_Definition_Request + (Self : in out Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DefinitionParams) + is + use Libadalang.Analysis; + use all type LSP.Ada_Configurations. + DisplayMethodAncestryOnNavigationPolicy; + + Trace : constant GNATCOLL.Traces.Trace_Handle := + LSP.GNATCOLL_Tracers.Handle (Self.Tracer.all); + + Response : LSP.Structures.Definition_Result (LSP.Structures.Varian_1); + Vector : LSP.Structures.Location_Vector renames Response.Varian_1; + + Imprecise : Boolean := False; + + Display_Method_Ancestry_Policy : constant + LSP.Ada_Configurations.DisplayMethodAncestryOnNavigationPolicy := + Self.Configuration.Display_Method_Ancestry_Policy; + + Document : constant LSP.Ada_Documents.Document_Access := + Self.Get_Open_Document (Value.textDocument.uri); + + procedure Resolve_In_Context (C : LSP.Ada_Context_Sets.Context_Access); + -- Utility function, appends to Resonse.result all results of the + -- definition requests found in context C. + + ------------------------ + -- Resolve_In_Context -- + ------------------------ + + procedure Resolve_In_Context (C : LSP.Ada_Context_Sets.Context_Access) is + use Libadalang.Common; + + Name_Node : constant Name := + Laltools.Common.Get_Node_As_Name + (Document.Get_Node_At (C.all, Value.position)); + + Definition : Defining_Name; + Other_Part : Defining_Name; + Manual_Fallback : Defining_Name; + Definition_Node : Basic_Decl := No_Basic_Decl; + Decl_For_Find_Overrides : Basic_Decl := No_Basic_Decl; + Entry_Decl_Node : Entry_Decl := No_Entry_Decl; + begin + if Name_Node.Is_Null then + return; + end if; + + -- Check if we are on some defining name + Definition := Laltools.Common.Get_Name_As_Defining (Name_Node); + + if Definition.Is_Null then + Definition := Laltools.Common.Resolve_Name + (Name_Node, + Trace, + Imprecise => Imprecise); + + if not Definition.Is_Null then + Self.Append_Location (Vector, Definition); + + if Display_Method_Ancestry_Policy + in Usage_And_Abstract_Only | Always + then + Decl_For_Find_Overrides := Definition.P_Basic_Decl; + end if; + end if; + else -- If we are on a defining_name already + Other_Part := Laltools.Common.Find_Next_Part (Definition, Trace); + + Definition_Node := Definition.P_Basic_Decl; + + -- Search for overriding subprograms only if we are on an + -- abstract subprogram. + if Display_Method_Ancestry_Policy /= Never + and then + (Display_Method_Ancestry_Policy /= Usage_And_Abstract_Only + or else Definition_Node.Kind in Ada_Abstract_Subp_Decl_Range) + then + Decl_For_Find_Overrides := Definition_Node; + end if; + + -- Search for accept statements only if we are on an entry + if Definition_Node.Kind in Ada_Entry_Decl_Range then + Entry_Decl_Node := Definition_Node.As_Entry_Decl; + + elsif Definition_Node.Kind in + Ada_Single_Task_Type_Decl_Range | Ada_Protected_Type_Decl_Range + then + -- These node types are not handled by Find_Next_Part + -- (LAL design limitations) + declare + Other_Part_For_Decl : constant Basic_Decl := + Laltools.Common.Find_Next_Part_For_Decl + (Definition_Node, Trace); + begin + if not Other_Part_For_Decl.Is_Null then + Other_Part := Other_Part_For_Decl.P_Defining_Name; + end if; + end; + end if; + + if Other_Part.Is_Null then + -- No next part is found. Check first defining name + Other_Part := Laltools.Common.Find_Canonical_Part + (Definition, Trace); + end if; + + if not Other_Part.Is_Null then + Self.Append_Location (Vector, Other_Part); + + else + -- We were on a defining name, but did not manage to find + -- an answer using Find_Next_Part / Find_Canonical_Part. + -- Use the manual fallback to attempt to find a good enough + -- result. + Manual_Fallback := Laltools.Common.Find_Other_Part_Fallback + (Definition, Trace); + + if not Manual_Fallback.Is_Null then + -- We have found a result using the imprecise heuristics. + -- We'll warn the user and send the result. + Imprecise := True; + Self.Append_Location (Vector, Manual_Fallback); + end if; + end if; + end if; + + if not Decl_For_Find_Overrides.Is_Null then + declare + Imprecise_Over : Boolean; + Imprecise_Base : Boolean; + Overriding_Subps : constant Basic_Decl_Array := + C.Find_All_Overrides + (Decl_For_Find_Overrides, + Imprecise_Results => Imprecise_Over); + Base_Subps : constant Basic_Decl_Array := + C.Find_All_Base_Declarations + (Decl_For_Find_Overrides, + Imprecise_Results => Imprecise_Base); + begin + for Subp of Base_Subps loop + Self.Append_Location + (Vector, Subp.P_Defining_Name, Is_Parent); + end loop; + + for Subp of Overriding_Subps loop + Self.Append_Location + (Vector, Subp.P_Defining_Name, Is_Child); + end loop; + + Imprecise := Imprecise or Imprecise_Over or Imprecise_Base; + end; + end if; + + if not Entry_Decl_Node.Is_Null then + for Accept_Node of Entry_Decl_Node.P_Accept_Stmts loop + Self.Append_Location + (Vector, Accept_Node.F_Body_Decl.F_Name); + end loop; + end if; + end Resolve_In_Context; + + begin + -- Override the displayMethodAncestryOnNavigation global configuration + -- flag if there is on embedded in the request. + -- if Value.alsDisplayMethodAncestryOnNavigation.Is_Set then + -- Display_Method_Ancestry_Policy := + -- Value.alsDisplayMethodAncestryOnNavigation.Value; + -- end if; + + for C of Self.Contexts_For_URI (Value.textDocument.uri) loop + Resolve_In_Context (C); + + exit when Self.Is_Canceled.all; + end loop; + + -- Sort_And_Remove_Duplicates (Vector); + + Self.Sender.On_Definition_Response (Id, Response); + end On_Definition_Request; + ------------------------------- -- On_DidChange_Notification -- ------------------------------- diff --git a/source/ada/lsp-ada_handlers.ads b/source/ada/lsp-ada_handlers.ads index 25a81edaf..42bd1f70f 100644 --- a/source/ada/lsp-ada_handlers.ads +++ b/source/ada/lsp-ada_handlers.ads @@ -208,9 +208,15 @@ private (Self : in out Message_Handler; Value : LSP.Server_Requests.Server_Request'Class); + overriding procedure On_Definition_Request + (Self : in out Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DefinitionParams); + overriding procedure On_Shutdown_Request (Self : in out Message_Handler; Id : LSP.Structures.Integer_Or_Virtual_String); + overriding procedure On_Server_Notification (Self : in out Message_Handler; Value : LSP.Server_Notifications.Server_Notification'Class); diff --git a/source/ada/lsp-gnatcoll_tracers-handle.adb b/source/ada/lsp-gnatcoll_tracers-handle.adb new file mode 100644 index 000000000..9f6ca1b72 --- /dev/null +++ b/source/ada/lsp-gnatcoll_tracers-handle.adb @@ -0,0 +1,22 @@ +------------------------------------------------------------------------------ +-- Language Server Protocol -- +-- -- +-- Copyright (C) 2022-2023, AdaCore -- +-- -- +-- This is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 3, or (at your option) any later ver- -- +-- sion. This software is distributed in the hope that it will be useful, -- +-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- -- +-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -- +-- License for more details. You should have received a copy of the GNU -- +-- General Public License distributed with this software; see file -- +-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy -- +-- of the license. -- +------------------------------------------------------------------------------ + +function LSP.GNATCOLL_Tracers.Handle + (Self : LSP.Tracers.Tracer'Class) return GNATCOLL.Traces.Trace_Handle is +begin + return Tracer (Self).Server_Trace; +end LSP.GNATCOLL_Tracers.Handle; diff --git a/source/ada/lsp-gnatcoll_tracers-handle.ads b/source/ada/lsp-gnatcoll_tracers-handle.ads new file mode 100644 index 000000000..3ec11e4a5 --- /dev/null +++ b/source/ada/lsp-gnatcoll_tracers-handle.ads @@ -0,0 +1,19 @@ +------------------------------------------------------------------------------ +-- Language Server Protocol -- +-- -- +-- Copyright (C) 2022-2023, AdaCore -- +-- -- +-- This is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 3, or (at your option) any later ver- -- +-- sion. This software is distributed in the hope that it will be useful, -- +-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- -- +-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -- +-- License for more details. You should have received a copy of the GNU -- +-- General Public License distributed with this software; see file -- +-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy -- +-- of the license. -- +------------------------------------------------------------------------------ + +function LSP.GNATCOLL_Tracers.Handle + (Self : LSP.Tracers.Tracer'Class) return GNATCOLL.Traces.Trace_Handle; From b74a319fcbc6c3ebb7b370d89590cd9213410a4e Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Thu, 17 Aug 2023 13:47:15 +0300 Subject: [PATCH 038/152] Rebase tests for `textDocument/definition` Refs #1170 --- .../ada_lsp/C825-005.xrefs.extending/test.json | 3 +-- .../test.json | 9 +++------ .../F131-024.xrefs.separate_body/test.json | 9 +++------ .../F222-029.xrefs.prefixed_notation/test.json | 3 +-- .../test.json | 3 +-- .../SA11-040.definition.fallback/test.json | 10 +--------- .../SB08-025.goto.advanced_decltype/test.json | 18 ++++++------------ .../SC16-095.fallback_when_no_body/test.json | 3 +-- .../test.json | 12 +++++------- .../UA28-007.Did_Create_Files_0/test.json | 8 +++----- .../UA28-007.Did_Delete_Files_0/test.json | 5 ++--- .../UA28-007.Did_Rename_Files_0/test.json | 12 ++++-------- .../V201-024.goto.entry_and_asserts/test.json | 6 ++---- testsuite/ada_lsp/cancel/cancel.json | 4 ++-- testsuite/ada_lsp/def_name/def_name.json | 8 ++++---- testsuite/ada_lsp/def_name/test.yaml | 3 --- testsuite/ada_lsp/def_name/uri_with_slash.json | 8 ++++---- testsuite/ada_lsp/definition_parents/test.json | 6 ++---- .../implementation.aggregates/test.json | 6 ++---- testsuite/ada_lsp/implementation/test.json | 3 +-- .../incorrect_fallback/incorrect_fallback.json | 3 +-- testsuite/ada_lsp/invalid_project/test.json | 3 +-- testsuite/ada_lsp/invalid_project/test.yaml | 3 --- .../invalidation.file_contents/test.json | 9 +++------ testsuite/ada_lsp/no_root/no_root.json | 8 ++++---- testsuite/ada_lsp/no_root/test.yaml | 3 --- testsuite/ada_lsp/no_root/uri_with_slash.json | 8 ++++---- .../non_project_files/non_project_files.json | 12 ++++++------ testsuite/ada_lsp/preprocessor/test.json | 11 ++++------- .../project_config.file/project_config.json | 4 ++-- .../ada_lsp/project_config.file/test.yaml | 3 --- .../project_config.init/project_config.json | 4 ++-- .../ada_lsp/project_config.init/test.yaml | 3 --- .../project_config.missing_file/test.yaml | 3 --- .../ada_lsp/project_config/project_config.json | 4 ++-- .../ada_lsp/project_search/project_search.json | 4 ++-- testsuite/ada_lsp/project_search/test.yaml | 3 --- testsuite/ada_lsp/project_symlinks/test.json | 8 ++++---- .../ada_lsp/spec_from_body/spec_from_body.json | 16 ++++++++-------- testsuite/ada_lsp/spec_from_body/test.yaml | 3 --- 40 files changed, 91 insertions(+), 163 deletions(-) diff --git a/testsuite/ada_lsp/C825-005.xrefs.extending/test.json b/testsuite/ada_lsp/C825-005.xrefs.extending/test.json index 821fd14ef..f60e23a0c 100644 --- a/testsuite/ada_lsp/C825-005.xrefs.extending/test.json +++ b/testsuite/ada_lsp/C825-005.xrefs.extending/test.json @@ -153,7 +153,7 @@ "wait": [ { "id": 2, - "result": [ + "result": { "range": { "start": { @@ -167,7 +167,6 @@ }, "uri": "$URI{pkg.sp}" } - ] } ] } diff --git a/testsuite/ada_lsp/D803-003.xrefs.generics_go_to_body/test.json b/testsuite/ada_lsp/D803-003.xrefs.generics_go_to_body/test.json index caeb69feb..c25f4c02b 100644 --- a/testsuite/ada_lsp/D803-003.xrefs.generics_go_to_body/test.json +++ b/testsuite/ada_lsp/D803-003.xrefs.generics_go_to_body/test.json @@ -153,7 +153,7 @@ "wait": [ { "id": 2, - "result": [ + "result": { "range": { "start": { @@ -167,7 +167,6 @@ }, "uri": "$URI{gen.ads}" } - ] } ] } @@ -191,7 +190,7 @@ "wait": [ { "id": 3, - "result": [ + "result": { "range": { "start": { @@ -205,7 +204,6 @@ }, "uri": "$URI{gen.adb}" } - ] } ] } @@ -229,7 +227,7 @@ "wait": [ { "id": 4, - "result": [ + "result": { "range": { "start": { @@ -243,7 +241,6 @@ }, "uri": "$URI{main.adb}" } - ] } ] } diff --git a/testsuite/ada_lsp/F131-024.xrefs.separate_body/test.json b/testsuite/ada_lsp/F131-024.xrefs.separate_body/test.json index 15e277e51..7b0616a6a 100644 --- a/testsuite/ada_lsp/F131-024.xrefs.separate_body/test.json +++ b/testsuite/ada_lsp/F131-024.xrefs.separate_body/test.json @@ -158,7 +158,7 @@ "wait": [ { "id": 3, - "result": [ + "result": { "range": { "start": { @@ -172,7 +172,6 @@ }, "uri": "$URI{a.ads}" } - ] } ] } @@ -213,7 +212,7 @@ "wait": [ { "id": 4, - "result": [ + "result": { "range": { "start": { @@ -227,7 +226,6 @@ }, "uri": "$URI{a.adb}" } - ] } ] } @@ -300,7 +298,7 @@ "wait": [ { "id": 6, - "result": [ + "result": { "range": { "start": { @@ -314,7 +312,6 @@ }, "uri": "$URI{a~foo.adb}" } - ] } ] } diff --git a/testsuite/ada_lsp/F222-029.xrefs.prefixed_notation/test.json b/testsuite/ada_lsp/F222-029.xrefs.prefixed_notation/test.json index 40fea5c59..41fa88c36 100644 --- a/testsuite/ada_lsp/F222-029.xrefs.prefixed_notation/test.json +++ b/testsuite/ada_lsp/F222-029.xrefs.prefixed_notation/test.json @@ -119,7 +119,7 @@ "wait": [ { "id": 3, - "result": [ + "result": { "range": { "start": { @@ -133,7 +133,6 @@ }, "uri": "$URI{test_class.ads}" } - ] } ] } diff --git a/testsuite/ada_lsp/O208-003.xrefs.aggregate_library_projects/test.json b/testsuite/ada_lsp/O208-003.xrefs.aggregate_library_projects/test.json index 2ad555c73..34083ad73 100644 --- a/testsuite/ada_lsp/O208-003.xrefs.aggregate_library_projects/test.json +++ b/testsuite/ada_lsp/O208-003.xrefs.aggregate_library_projects/test.json @@ -120,7 +120,7 @@ "wait": [ { "id": 2, - "result": [ + "result": { "range": { "start": { @@ -134,7 +134,6 @@ }, "uri": "$URI{srclib/sublib.ads}" } - ] } ] } diff --git a/testsuite/ada_lsp/SA11-040.definition.fallback/test.json b/testsuite/ada_lsp/SA11-040.definition.fallback/test.json index 367d45fdf..75cfaea19 100644 --- a/testsuite/ada_lsp/SA11-040.definition.fallback/test.json +++ b/testsuite/ada_lsp/SA11-040.definition.fallback/test.json @@ -122,16 +122,9 @@ "method": "textDocument/definition" }, "wait": [ - { - "params": { - "message": "The result of 'definition' is approximate.", - "type": 2 - }, - "method": "window/showMessage" - }, { "id": 2, - "result": [ + "result": { "range": { "start": { @@ -145,7 +138,6 @@ }, "uri": "$URI{p.adb}" } - ] } ] } diff --git a/testsuite/ada_lsp/SB08-025.goto.advanced_decltype/SB08-025.goto.advanced_decltype/test.json b/testsuite/ada_lsp/SB08-025.goto.advanced_decltype/SB08-025.goto.advanced_decltype/test.json index 33eb6667e..32d6dbe86 100644 --- a/testsuite/ada_lsp/SB08-025.goto.advanced_decltype/SB08-025.goto.advanced_decltype/test.json +++ b/testsuite/ada_lsp/SB08-025.goto.advanced_decltype/SB08-025.goto.advanced_decltype/test.json @@ -122,7 +122,7 @@ "wait": [ { "id": 4, - "result": [ + "result": { "uri": "$URI{foo.adb}", "range": { @@ -136,7 +136,6 @@ } } } - ] } ] } @@ -161,7 +160,7 @@ "wait": [ { "id": 6, - "result": [ + "result": { "uri": "$URI{foo.adb}", "range": { @@ -175,7 +174,6 @@ } } } - ] } ] } @@ -200,7 +198,7 @@ "wait": [ { "id": 8, - "result": [ + "result": { "uri": "$URI{foo.adb}", "range": { @@ -214,7 +212,6 @@ } } } - ] } ] } @@ -239,7 +236,7 @@ "wait": [ { "id": 10, - "result": [ + "result": { "uri": "$URI{foo.adb}", "range": { @@ -253,7 +250,6 @@ } } } - ] } ] } @@ -278,7 +274,7 @@ "wait": [ { "id": 12, - "result": [ + "result": { "uri": "$URI{foo.adb}", "range": { @@ -292,7 +288,6 @@ } } } - ] } ] } @@ -317,7 +312,7 @@ "wait": [ { "id": 14, - "result": [ + "result": { "uri": "$URI{foo.adb}", "range": { @@ -331,7 +326,6 @@ } } } - ] } ] } diff --git a/testsuite/ada_lsp/SC16-095.fallback_when_no_body/test.json b/testsuite/ada_lsp/SC16-095.fallback_when_no_body/test.json index 62dd9d39c..5489aa693 100644 --- a/testsuite/ada_lsp/SC16-095.fallback_when_no_body/test.json +++ b/testsuite/ada_lsp/SC16-095.fallback_when_no_body/test.json @@ -232,7 +232,7 @@ "wait": [ { "id": 5, - "result": [ + "result": { "range": { "start": { @@ -246,7 +246,6 @@ }, "uri": "$URI{pack.adb}" } - ] } ] } diff --git a/testsuite/ada_lsp/UA28-007.Did_Change_Watched_Files_0/test.json b/testsuite/ada_lsp/UA28-007.Did_Change_Watched_Files_0/test.json index 4fa9f8acf..8251d5693 100644 --- a/testsuite/ada_lsp/UA28-007.Did_Change_Watched_Files_0/test.json +++ b/testsuite/ada_lsp/UA28-007.Did_Change_Watched_Files_0/test.json @@ -610,7 +610,7 @@ "wait": [ { "id": 2, - "result": [ + "result": { "uri": "$URI{qux.ads}", "range": { @@ -624,7 +624,6 @@ } } } - ] } ] } @@ -907,7 +906,7 @@ "wait": [ { "id": 6, - "result": [ + "result": { "uri": "$URI{qux.ads}", "range": { @@ -921,7 +920,7 @@ } } } - ] + } ] } @@ -996,7 +995,7 @@ { "jsonrpc": "2.0", "id": 8, - "result": [ + "result": { "uri": "$URI{qux.ads}", "range": { @@ -1010,7 +1009,6 @@ } } } - ] } ] } @@ -1082,4 +1080,4 @@ "exit_code": 0 } } -] \ No newline at end of file +] diff --git a/testsuite/ada_lsp/UA28-007.Did_Create_Files_0/test.json b/testsuite/ada_lsp/UA28-007.Did_Create_Files_0/test.json index 917ebadde..0ac0a6ab8 100644 --- a/testsuite/ada_lsp/UA28-007.Did_Create_Files_0/test.json +++ b/testsuite/ada_lsp/UA28-007.Did_Create_Files_0/test.json @@ -1085,7 +1085,7 @@ "wait": [ { "id": 20, - "result": [ + "result": { "uri": "$URI{qux.ads}", "range": { @@ -1099,7 +1099,6 @@ } } } - ] } ] } @@ -1227,7 +1226,7 @@ "wait": [ { "id": 31, - "result": [ + "result": { "uri": "$URI{foo.ads}", "range": { @@ -1241,7 +1240,6 @@ } } } - ] } ] } @@ -1266,4 +1264,4 @@ "exit_code": 0 } } -] \ No newline at end of file +] diff --git a/testsuite/ada_lsp/UA28-007.Did_Delete_Files_0/test.json b/testsuite/ada_lsp/UA28-007.Did_Delete_Files_0/test.json index 8b4b4caf9..825d3cb83 100644 --- a/testsuite/ada_lsp/UA28-007.Did_Delete_Files_0/test.json +++ b/testsuite/ada_lsp/UA28-007.Did_Delete_Files_0/test.json @@ -760,7 +760,7 @@ "wait": [ { "id": 6, - "result": [ + "result": { "uri": "$URI{qux.ads}", "range": { @@ -774,7 +774,6 @@ } } } - ] } ] } @@ -1117,4 +1116,4 @@ "exit_code": 0 } } -] \ No newline at end of file +] diff --git a/testsuite/ada_lsp/UA28-007.Did_Rename_Files_0/test.json b/testsuite/ada_lsp/UA28-007.Did_Rename_Files_0/test.json index ecd977999..6c355eb53 100644 --- a/testsuite/ada_lsp/UA28-007.Did_Rename_Files_0/test.json +++ b/testsuite/ada_lsp/UA28-007.Did_Rename_Files_0/test.json @@ -1325,7 +1325,7 @@ "wait": [ { "id": 18, - "result": [ + "result": { "uri": "$URI{qux.ads}", "range": { @@ -1339,7 +1339,6 @@ } } } - ] } ] } @@ -1475,7 +1474,7 @@ "wait": [ { "id": 28, - "result": [ + "result": { "uri": "$URI{qux.adb}", "range": { @@ -1489,7 +1488,6 @@ } } } - ] } ] } @@ -1625,7 +1623,7 @@ "wait": [ { "id": 38, - "result": [ + "result": { "uri": "$URI{qux.ads}", "range": { @@ -1639,7 +1637,6 @@ } } } - ] } ] } @@ -1663,7 +1660,7 @@ "wait": [ { "id": 56, - "result": [ + "result": { "uri": "$URI{qux.ads}", "range": { @@ -1677,7 +1674,6 @@ } } } - ] } ] } diff --git a/testsuite/ada_lsp/V201-024.goto.entry_and_asserts/test.json b/testsuite/ada_lsp/V201-024.goto.entry_and_asserts/test.json index 650063ace..ee74b3f79 100644 --- a/testsuite/ada_lsp/V201-024.goto.entry_and_asserts/test.json +++ b/testsuite/ada_lsp/V201-024.goto.entry_and_asserts/test.json @@ -206,7 +206,7 @@ "wait": [ { "id": 9, - "result": [ + "result": { "uri": "$URI{foo.adb}", "range": { @@ -220,7 +220,6 @@ } } } - ] } ] } @@ -297,7 +296,7 @@ "wait": [ { "id": 15, - "result": [ + "result": { "uri": "$URI{foo.adb}", "range": { @@ -311,7 +310,6 @@ } } } - ] } ] } diff --git a/testsuite/ada_lsp/cancel/cancel.json b/testsuite/ada_lsp/cancel/cancel.json index b4531cae4..6a60ec8d2 100644 --- a/testsuite/ada_lsp/cancel/cancel.json +++ b/testsuite/ada_lsp/cancel/cancel.json @@ -113,7 +113,7 @@ }, "wait":[{ "id": "defname-2", - "result":[{ + "result":{ "uri": "$URI{aaa.adb}", "range": { "start": { @@ -125,7 +125,7 @@ "character": 13 } } - }] + } }] } }, { diff --git a/testsuite/ada_lsp/def_name/def_name.json b/testsuite/ada_lsp/def_name/def_name.json index 4de8ee350..24f3c63d6 100644 --- a/testsuite/ada_lsp/def_name/def_name.json +++ b/testsuite/ada_lsp/def_name/def_name.json @@ -71,7 +71,7 @@ }, "wait":[{ "id": "defname-1", - "result":[{ + "result":{ "uri": "$URI{aaa.adb}", "range": { "start": { @@ -83,7 +83,7 @@ "character": 13 } } - }] + } }] } }, { @@ -104,12 +104,12 @@ }, "wait":[{ "id": "defname-2", - "result":[{ + "result":{ "range": { "start": {}, "end": {} } - }] + } }] } }, { diff --git a/testsuite/ada_lsp/def_name/test.yaml b/testsuite/ada_lsp/def_name/test.yaml index 8a74ab2f7..4e96d138a 100644 --- a/testsuite/ada_lsp/def_name/test.yaml +++ b/testsuite/ada_lsp/def_name/test.yaml @@ -1,4 +1 @@ title: 'def_name' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/def_name/uri_with_slash.json b/testsuite/ada_lsp/def_name/uri_with_slash.json index 7326a4a1e..1065e38fc 100644 --- a/testsuite/ada_lsp/def_name/uri_with_slash.json +++ b/testsuite/ada_lsp/def_name/uri_with_slash.json @@ -71,7 +71,7 @@ }, "wait":[{ "id": "defname-1", - "result":[{ + "result":{ "uri": "$URI{aaa.adb}", "range": { "start": { @@ -83,7 +83,7 @@ "character": 13 } } - }] + } }] } }, { @@ -104,12 +104,12 @@ }, "wait":[{ "id": "defname-2", - "result":[{ + "result":{ "range": { "start": {}, "end": {} } - }] + } }] } }, { diff --git a/testsuite/ada_lsp/definition_parents/test.json b/testsuite/ada_lsp/definition_parents/test.json index 16aaa5fc5..fae99886a 100644 --- a/testsuite/ada_lsp/definition_parents/test.json +++ b/testsuite/ada_lsp/definition_parents/test.json @@ -237,7 +237,7 @@ "wait": [ { "id": 4, - "result": [ + "result": { "range": { "start": { @@ -251,7 +251,6 @@ }, "uri": "$URI{pack.adb}" } - ] } ] } @@ -301,7 +300,7 @@ "wait": [ { "id": 10, - "result": [ + "result": { "range": { "start": { @@ -315,7 +314,6 @@ }, "uri": "$URI{pack.adb}" } - ] } ] } diff --git a/testsuite/ada_lsp/implementation.aggregates/test.json b/testsuite/ada_lsp/implementation.aggregates/test.json index 7b23d4c1e..6dd8d2cdb 100644 --- a/testsuite/ada_lsp/implementation.aggregates/test.json +++ b/testsuite/ada_lsp/implementation.aggregates/test.json @@ -350,7 +350,7 @@ "wait": [ { "id": 9, - "result": [ + "result": { "range": { "start": { @@ -364,7 +364,6 @@ }, "uri": "$URI{common/common_pack.ads}" } - ] } ] } @@ -388,7 +387,7 @@ "wait": [ { "id": 10, - "result": [ + "result": { "range": { "start": { @@ -402,7 +401,6 @@ }, "uri": "$URI{common/common_pack.ads}" } - ] } ] } diff --git a/testsuite/ada_lsp/implementation/test.json b/testsuite/ada_lsp/implementation/test.json index ca7916802..63916c14c 100644 --- a/testsuite/ada_lsp/implementation/test.json +++ b/testsuite/ada_lsp/implementation/test.json @@ -242,7 +242,7 @@ "wait": [ { "id": 4, - "result": [ + "result": { "range": { "start": { @@ -256,7 +256,6 @@ }, "uri": "$URI{pack.ads}" } - ] } ] } diff --git a/testsuite/ada_lsp/incorrect_fallback/incorrect_fallback.json b/testsuite/ada_lsp/incorrect_fallback/incorrect_fallback.json index b6c4a0352..1a8fd4ed2 100644 --- a/testsuite/ada_lsp/incorrect_fallback/incorrect_fallback.json +++ b/testsuite/ada_lsp/incorrect_fallback/incorrect_fallback.json @@ -209,7 +209,7 @@ "wait": [ { "id": 1, - "result": [ + "result": { "range": { "start": { @@ -223,7 +223,6 @@ }, "uri": "$URI{test.adb}" } - ] } ] } diff --git a/testsuite/ada_lsp/invalid_project/test.json b/testsuite/ada_lsp/invalid_project/test.json index 2676e273f..223c51086 100644 --- a/testsuite/ada_lsp/invalid_project/test.json +++ b/testsuite/ada_lsp/invalid_project/test.json @@ -190,7 +190,7 @@ "wait": [ { "id": 4, - "result": [ + "result": { "range": { "start": { @@ -204,7 +204,6 @@ }, "uri": "$URI{foo.ads}" } - ] } ] } diff --git a/testsuite/ada_lsp/invalid_project/test.yaml b/testsuite/ada_lsp/invalid_project/test.yaml index a2487c50c..2f8fa1edd 100644 --- a/testsuite/ada_lsp/invalid_project/test.yaml +++ b/testsuite/ada_lsp/invalid_project/test.yaml @@ -1,4 +1 @@ title: 'invalid_project' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/invalidation.file_contents/test.json b/testsuite/ada_lsp/invalidation.file_contents/test.json index 0e79c23a7..2fa06b617 100644 --- a/testsuite/ada_lsp/invalidation.file_contents/test.json +++ b/testsuite/ada_lsp/invalidation.file_contents/test.json @@ -162,7 +162,7 @@ "wait": [ { "id": 3, - "result": [ + "result": { "range": { "start": { @@ -176,7 +176,6 @@ }, "uri": "$URI{p.ads}" } - ] } ] } @@ -281,7 +280,7 @@ "wait": [ { "id": 5, - "result": [ + "result": { "range": { "start": { @@ -295,7 +294,6 @@ }, "uri": "$URI{p.ads}" } - ] } ] } @@ -359,7 +357,7 @@ "wait": [ { "id": 6, - "result": [ + "result": { "range": { "start": { @@ -373,7 +371,6 @@ }, "uri": "$URI{q.ads}" } - ] } ] } diff --git a/testsuite/ada_lsp/no_root/no_root.json b/testsuite/ada_lsp/no_root/no_root.json index 5f30b5d2f..64a399ad7 100644 --- a/testsuite/ada_lsp/no_root/no_root.json +++ b/testsuite/ada_lsp/no_root/no_root.json @@ -71,7 +71,7 @@ }, "wait":[{ "id": "defname-1", - "result":[{ + "result":{ "uri": "$URI{aaa.adb}", "range": { "start": { @@ -83,7 +83,7 @@ "character": 13 } } - }] + } }] } }, { @@ -104,12 +104,12 @@ }, "wait":[{ "id": "defname-2", - "result":[{ + "result":{ "range": { "start": {}, "end": {} } - }] + } }] } }, { diff --git a/testsuite/ada_lsp/no_root/test.yaml b/testsuite/ada_lsp/no_root/test.yaml index 3ebd69b7a..b54209fb2 100644 --- a/testsuite/ada_lsp/no_root/test.yaml +++ b/testsuite/ada_lsp/no_root/test.yaml @@ -1,4 +1 @@ title: 'no_root' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/no_root/uri_with_slash.json b/testsuite/ada_lsp/no_root/uri_with_slash.json index 7326a4a1e..1065e38fc 100644 --- a/testsuite/ada_lsp/no_root/uri_with_slash.json +++ b/testsuite/ada_lsp/no_root/uri_with_slash.json @@ -71,7 +71,7 @@ }, "wait":[{ "id": "defname-1", - "result":[{ + "result":{ "uri": "$URI{aaa.adb}", "range": { "start": { @@ -83,7 +83,7 @@ "character": 13 } } - }] + } }] } }, { @@ -104,12 +104,12 @@ }, "wait":[{ "id": "defname-2", - "result":[{ + "result":{ "range": { "start": {}, "end": {} } - }] + } }] } }, { diff --git a/testsuite/ada_lsp/non_project_files/non_project_files.json b/testsuite/ada_lsp/non_project_files/non_project_files.json index b526f5ae2..795598822 100644 --- a/testsuite/ada_lsp/non_project_files/non_project_files.json +++ b/testsuite/ada_lsp/non_project_files/non_project_files.json @@ -70,7 +70,7 @@ }, "wait":[{ "id": "defname-1", - "result":[{ + "result":{ "uri": "$URI{p.ads}", "range": { "start": { @@ -82,7 +82,7 @@ "character": 9 } } - }] + } }] } }, { @@ -137,7 +137,7 @@ }, "wait":[{ "id": "defname-3", - "result":[{ + "result":{ "uri": "$URI{p.adb}", "range": { "start": { @@ -149,7 +149,7 @@ "character": 14 } } - }] + } }] } }, { @@ -170,7 +170,7 @@ }, "wait":[{ "id": "defname-4", - "result":[{ + "result":{ "uri": "$URI{p.ads}", "range": { "start": { @@ -182,7 +182,7 @@ "character": 9 } } - }] + } }] } }, { diff --git a/testsuite/ada_lsp/preprocessor/test.json b/testsuite/ada_lsp/preprocessor/test.json index fc662d69c..0f2a48531 100644 --- a/testsuite/ada_lsp/preprocessor/test.json +++ b/testsuite/ada_lsp/preprocessor/test.json @@ -183,7 +183,7 @@ "wait": [ { "id": "ada-6", - "result": [ + "result": { "uri": "$URI{mytypes.ads}", "range": { @@ -197,7 +197,6 @@ } } } - ] } ] } @@ -254,7 +253,7 @@ "wait": [ { "id": "ada-14", - "result": [ + "result": { "uri": "$URI{mytypes.ads}", "range": { @@ -268,7 +267,6 @@ } } } - ] } ] } @@ -320,7 +318,7 @@ "wait": [ { "id": "ada-25", - "result": [ + "result": { "uri": "$URI{mytypes.ads}", "range": { @@ -334,7 +332,6 @@ } } } - ] } ] } @@ -359,4 +356,4 @@ "exit_code": 0 } } -] \ No newline at end of file +] diff --git a/testsuite/ada_lsp/project_config.file/project_config.json b/testsuite/ada_lsp/project_config.file/project_config.json index e0a3749b6..87842eec2 100644 --- a/testsuite/ada_lsp/project_config.file/project_config.json +++ b/testsuite/ada_lsp/project_config.file/project_config.json @@ -72,7 +72,7 @@ }, "wait":[{ "id": "defname-1", - "result":[{ + "result":{ "uri": "$URI{second.ads}", "range": { "start": { @@ -84,7 +84,7 @@ "character": 22 } } - }] + } }] } }, { diff --git a/testsuite/ada_lsp/project_config.file/test.yaml b/testsuite/ada_lsp/project_config.file/test.yaml index cbf8d2630..43ac894d0 100644 --- a/testsuite/ada_lsp/project_config.file/test.yaml +++ b/testsuite/ada_lsp/project_config.file/test.yaml @@ -1,4 +1 @@ title: 'project_config.file' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/project_config.init/project_config.json b/testsuite/ada_lsp/project_config.init/project_config.json index daaadf0d9..842bfcd7f 100644 --- a/testsuite/ada_lsp/project_config.init/project_config.json +++ b/testsuite/ada_lsp/project_config.init/project_config.json @@ -68,7 +68,7 @@ }, "wait":[{ "id": "defname-1", - "result":[{ + "result":{ "uri": "$URI{second.ads}", "range": { "start": { @@ -80,7 +80,7 @@ "character": 22 } } - }] + } }] } }, { diff --git a/testsuite/ada_lsp/project_config.init/test.yaml b/testsuite/ada_lsp/project_config.init/test.yaml index 2a5dcf53e..3035a601c 100644 --- a/testsuite/ada_lsp/project_config.init/test.yaml +++ b/testsuite/ada_lsp/project_config.init/test.yaml @@ -1,4 +1 @@ title: 'project_config.init' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/project_config.missing_file/test.yaml b/testsuite/ada_lsp/project_config.missing_file/test.yaml index bc881bfaf..0e5bf90d4 100644 --- a/testsuite/ada_lsp/project_config.missing_file/test.yaml +++ b/testsuite/ada_lsp/project_config.missing_file/test.yaml @@ -1,4 +1 @@ title: 'project_config.missing_file' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/project_config/project_config.json b/testsuite/ada_lsp/project_config/project_config.json index 5d4c07b25..c5a1350e0 100644 --- a/testsuite/ada_lsp/project_config/project_config.json +++ b/testsuite/ada_lsp/project_config/project_config.json @@ -75,7 +75,7 @@ }, "wait":[{ "id": "defname-1", - "result":[{ + "result":{ "uri": "$URI{second.ads}", "range": { "start": { @@ -87,7 +87,7 @@ "character": 22 } } - }] + } }] } }, { diff --git a/testsuite/ada_lsp/project_search/project_search.json b/testsuite/ada_lsp/project_search/project_search.json index 59eba9e83..e36b38e33 100644 --- a/testsuite/ada_lsp/project_search/project_search.json +++ b/testsuite/ada_lsp/project_search/project_search.json @@ -72,7 +72,7 @@ }, "wait":[{ "id": "defname-1", - "result":[{ + "result":{ "uri": "$URI{second.ads}", "range": { "start": { @@ -84,7 +84,7 @@ "character": 22 } } - }] + } }] } }, { diff --git a/testsuite/ada_lsp/project_search/test.yaml b/testsuite/ada_lsp/project_search/test.yaml index 9f8253d95..0a2a7aa5d 100644 --- a/testsuite/ada_lsp/project_search/test.yaml +++ b/testsuite/ada_lsp/project_search/test.yaml @@ -1,4 +1 @@ title: 'project_search' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/project_symlinks/test.json b/testsuite/ada_lsp/project_symlinks/test.json index 0ae350394..c09b97dcb 100644 --- a/testsuite/ada_lsp/project_symlinks/test.json +++ b/testsuite/ada_lsp/project_symlinks/test.json @@ -76,9 +76,9 @@ } } }, - "wait":[{ + "wait":{ "id": "defname-1", - "result":[{ + "result":{ "uri": "$URI{link/aaa.ads}", "range": { "start": { @@ -90,8 +90,8 @@ "character": 11 } } - }] - }] + } + } } }, { "send": { diff --git a/testsuite/ada_lsp/spec_from_body/spec_from_body.json b/testsuite/ada_lsp/spec_from_body/spec_from_body.json index f1d2ba099..74caba511 100644 --- a/testsuite/ada_lsp/spec_from_body/spec_from_body.json +++ b/testsuite/ada_lsp/spec_from_body/spec_from_body.json @@ -72,7 +72,7 @@ }, "wait":[{ "id": "defname-1", - "result":[{ + "result":{ "uri": "$URI{bbb.adb}", "range": { "start": { @@ -84,7 +84,7 @@ "character": 17 } } - }] + } }] } }, { @@ -105,7 +105,7 @@ }, "wait":[{ "id": "defname-2", - "result":[{ + "result":{ "uri": "$URI{bbb.adb}", "range": { "start": { @@ -117,7 +117,7 @@ "character": 17 } } - }] + } }] } }, { @@ -138,7 +138,7 @@ }, "wait":[{ "id": "defname-3", - "result":[{ + "result":{ "uri": "$URI{bbb.ads}", "range": { "start": { @@ -150,7 +150,7 @@ "character": 18 } } - }] + } }] } }, { @@ -187,7 +187,7 @@ }, "wait":[{ "id": "defname-4", - "result":[{ + "result":{ "uri": "$URI{bbb.adb}", "range": { "start": { @@ -199,7 +199,7 @@ "character": 18 } } - }] + } }] } }, { diff --git a/testsuite/ada_lsp/spec_from_body/test.yaml b/testsuite/ada_lsp/spec_from_body/test.yaml index 7c2abf950..e12ef5329 100644 --- a/testsuite/ada_lsp/spec_from_body/test.yaml +++ b/testsuite/ada_lsp/spec_from_body/test.yaml @@ -1,4 +1 @@ title: 'spec_from_body' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] From 3924c055d840d51d3b48582716a0d444963cf913 Mon Sep 17 00:00:00 2001 From: Andry Ogorodnik Date: Fri, 18 Aug 2023 11:09:56 +0000 Subject: [PATCH 039/152] Implemented On_Completion_Request --- gnat/ignore_in_317.txt | 25 ---- gnat/lsp_server.gpr | 3 +- source/ada/lsp-ada_client_capabilities.adb | 26 ++++ source/ada/lsp-ada_client_capabilities.ads | 3 + source/ada/lsp-ada_completions-aspects.adb | 2 +- source/ada/lsp-ada_completions-aspects.ads | 2 +- source/ada/lsp-ada_completions-attributes.adb | 2 +- source/ada/lsp-ada_completions-attributes.ads | 2 +- source/ada/lsp-ada_completions-end_names.adb | 32 +++-- source/ada/lsp-ada_completions-end_names.ads | 2 +- .../ada/lsp-ada_completions-generic_assoc.adb | 130 +++++++++--------- .../ada/lsp-ada_completions-generic_assoc.ads | 12 +- source/ada/lsp-ada_completions-keywords.adb | 17 ++- source/ada/lsp-ada_completions-keywords.ads | 2 +- source/ada/lsp-ada_completions-names.adb | 7 +- source/ada/lsp-ada_completions-names.ads | 2 +- source/ada/lsp-ada_completions-parameters.adb | 106 ++++++++++---- source/ada/lsp-ada_completions-parameters.ads | 12 +- source/ada/lsp-ada_completions-pragmas.adb | 2 +- source/ada/lsp-ada_completions-pragmas.ads | 2 +- .../ada/lsp-ada_completions-use_clauses.adb | 30 ++-- .../ada/lsp-ada_completions-use_clauses.ads | 2 +- source/ada/lsp-ada_documentation.adb | 10 +- source/ada/lsp-ada_handlers-invisibles.adb | 10 +- source/ada/lsp-ada_handlers-invisibles.ads | 4 +- source/ada/lsp-ada_handlers.adb | 111 +++++++++++++++ source/ada/lsp-ada_handlers.ads | 5 + source/ada/lsp-common.adb | 37 ----- source/ada/lsp-common.ads | 5 - source/ada/lsp-lal_utils.adb | 98 ------------- source/ada/lsp-lal_utils.ads | 16 --- source/ada/lsp-predefined_completion.adb | 62 +++++++-- source/ada/lsp-predefined_completion.ads | 2 +- source/ada/lsp-utils.adb | 83 +++++++++++ source/ada/lsp-utils.ads | 36 +++++ source/lsp_3.17/lsp-structures-unwrap.ads | 21 +++ 36 files changed, 563 insertions(+), 360 deletions(-) create mode 100644 source/ada/lsp-utils.adb create mode 100644 source/ada/lsp-utils.ads diff --git a/gnat/ignore_in_317.txt b/gnat/ignore_in_317.txt index 8ebe65784..c662e8f54 100644 --- a/gnat/ignore_in_317.txt +++ b/gnat/ignore_in_317.txt @@ -1,28 +1,5 @@ -lsp-ada_completions-aspects.adb -lsp-ada_completions-aspects.ads -lsp-ada_completions-attributes.adb -lsp-ada_completions-attributes.ads -lsp-ada_completions-end_names.adb -lsp-ada_completions-end_names.ads -lsp-ada_completions-generic_assoc.adb -lsp-ada_completions-generic_assoc.ads -lsp-ada_completions-generic_assoc_utils.ads -lsp-ada_completions-keywords.adb -lsp-ada_completions-keywords.ads -lsp-ada_completions-names.adb -lsp-ada_completions-names.ads -lsp-ada_completions-parameters.adb -lsp-ada_completions-parameters.ads -lsp-ada_completions-pragmas.adb -lsp-ada_completions-pragmas.ads -lsp-ada_completions-use_clauses.adb -lsp-ada_completions-use_clauses.ads -lsp-ada_documentation.adb -lsp-ada_documentation.ads lsp-ada_handlers-alire.adb lsp-ada_handlers-alire.ads -lsp-ada_handlers-invisibles.adb -lsp-ada_handlers-invisibles.ads lsp-ada_handlers-named_parameters_commands.adb lsp-ada_handlers-named_parameters_commands.ads lsp-ada_handlers-other_file_commands.adb @@ -67,8 +44,6 @@ lsp-fuzz_decorators.adb lsp-fuzz_decorators.ads lsp-lal_utils.adb lsp-lal_utils.ads -lsp-predefined_completion.adb -lsp-predefined_completion.ads lsp-search-approximate.adb lsp-search-approximate.ads lsp-search-empty.adb diff --git a/gnat/lsp_server.gpr b/gnat/lsp_server.gpr index bcd26de86..fd8451d70 100644 --- a/gnat/lsp_server.gpr +++ b/gnat/lsp_server.gpr @@ -48,8 +48,7 @@ project LSP_Server is for Excluded_Source_Dirs use ("../source/server/generated", - "../source/gpr", - "../source/ada/generated"); + "../source/gpr"); for Excluded_Source_List_File use "ignore_in_317.txt"; diff --git a/source/ada/lsp-ada_client_capabilities.adb b/source/ada/lsp-ada_client_capabilities.adb index 898f141be..9aee60357 100644 --- a/source/ada/lsp-ada_client_capabilities.adb +++ b/source/ada/lsp-ada_client_capabilities.adb @@ -15,6 +15,8 @@ -- of the license. -- ------------------------------------------------------------------------------ +with VSS.String_Vectors; + with LSP.Constants; with LSP.Enumerations; with LSP.Structures.Unwrap; @@ -77,6 +79,12 @@ package body LSP.Ada_Client_Capabilities is else LSP.Enumerations.Full))); + Result.completionProvider := + (Is_Set => True, + Value => (triggerCharacters => [".", ",", "'", "("], + resolveProvider => LSP.Constants.True, + others => <>)); + Result.definitionProvider := LSP.Constants.True; Result.foldingRangeProvider := LSP.Constants.True; end return; @@ -97,4 +105,22 @@ package body LSP.Ada_Client_Capabilities is return (if Result.Is_Set then Result.Value else False); end Line_Folding_Only; + -------------------- + -- Resolve_Lazily -- + -------------------- + + function Resolve_Lazily (Self : Client_Capability'Class) return Boolean is + use LSP.Structures.Unwrap; + + List : constant VSS.String_Vectors.Virtual_String_Vector := + properties + (resolveSupport + (completionItem + (completion + (Self.Value.capabilities.textDocument)))); + + begin + return List.Contains ("detail") and then List.Contains ("documentation"); + end Resolve_Lazily; + end LSP.Ada_Client_Capabilities; diff --git a/source/ada/lsp-ada_client_capabilities.ads b/source/ada/lsp-ada_client_capabilities.ads index cefc331de..b9e29390f 100644 --- a/source/ada/lsp-ada_client_capabilities.ads +++ b/source/ada/lsp-ada_client_capabilities.ads @@ -52,6 +52,9 @@ package LSP.Ada_Client_Capabilities is function Line_Folding_Only (Self : Client_Capability'Class) return Boolean; -- Returns capabilities.textDocument.foldingRange.lineFoldingOnly or False + function Resolve_Lazily (Self : Client_Capability'Class) return Boolean; + -- Returns True when resolve contains `documentation` and `details` + private type Client_Capability is tagged limited record diff --git a/source/ada/lsp-ada_completions-aspects.adb b/source/ada/lsp-ada_completions-aspects.adb index a9b706d29..9f058ff3e 100644 --- a/source/ada/lsp-ada_completions-aspects.adb +++ b/source/ada/lsp-ada_completions-aspects.adb @@ -33,7 +33,7 @@ package body LSP.Ada_Completions.Aspects is Node : Libadalang.Analysis.Ada_Node; Filter : in out LSP.Ada_Completions.Filters.Filter; Names : in out Ada_Completions.Completion_Maps.Map; - Result : in out LSP.Messages.CompletionList) + Result : in out LSP.Structures.CompletionList) is pragma Unreferenced (Names); diff --git a/source/ada/lsp-ada_completions-aspects.ads b/source/ada/lsp-ada_completions-aspects.ads index 4fb93b3b3..1ff4ce669 100644 --- a/source/ada/lsp-ada_completions-aspects.ads +++ b/source/ada/lsp-ada_completions-aspects.ads @@ -27,7 +27,7 @@ package LSP.Ada_Completions.Aspects is Node : Libadalang.Analysis.Ada_Node; Filter : in out LSP.Ada_Completions.Filters.Filter; Names : in out Ada_Completions.Completion_Maps.Map; - Result : in out LSP.Messages.CompletionList); + Result : in out LSP.Structures.CompletionList); -- Get completion for aspects if we are within an aspect association -- node and return immediatly since we only expect aspects here. diff --git a/source/ada/lsp-ada_completions-attributes.adb b/source/ada/lsp-ada_completions-attributes.adb index 3f6186cb7..779ffc992 100644 --- a/source/ada/lsp-ada_completions-attributes.adb +++ b/source/ada/lsp-ada_completions-attributes.adb @@ -33,7 +33,7 @@ package body LSP.Ada_Completions.Attributes is Node : Libadalang.Analysis.Ada_Node; Filter : in out LSP.Ada_Completions.Filters.Filter; Names : in out Ada_Completions.Completion_Maps.Map; - Result : in out LSP.Messages.CompletionList) + Result : in out LSP.Structures.CompletionList) is pragma Unreferenced (Names); diff --git a/source/ada/lsp-ada_completions-attributes.ads b/source/ada/lsp-ada_completions-attributes.ads index 6b072fd6d..b7348f2d9 100644 --- a/source/ada/lsp-ada_completions-attributes.ads +++ b/source/ada/lsp-ada_completions-attributes.ads @@ -28,7 +28,7 @@ package LSP.Ada_Completions.Attributes is Node : Libadalang.Analysis.Ada_Node; Filter : in out LSP.Ada_Completions.Filters.Filter; Names : in out Ada_Completions.Completion_Maps.Map; - Result : in out LSP.Messages.CompletionList); + Result : in out LSP.Structures.CompletionList); -- Get completion for attributes. end LSP.Ada_Completions.Attributes; diff --git a/source/ada/lsp-ada_completions-end_names.adb b/source/ada/lsp-ada_completions-end_names.adb index b1fca333a..abaa311f8 100644 --- a/source/ada/lsp-ada_completions-end_names.adb +++ b/source/ada/lsp-ada_completions-end_names.adb @@ -17,7 +17,7 @@ with VSS.Strings; -with LSP.Lal_Utils; +with LSP.Enumerations; package body LSP.Ada_Completions.End_Names is -- List on Ada 2012 syntax rules with token: @@ -54,7 +54,7 @@ package body LSP.Ada_Completions.End_Names is Node : Libadalang.Analysis.Ada_Node; Filter : in out LSP.Ada_Completions.Filters.Filter; Names : in out Ada_Completions.Completion_Maps.Map; - Result : in out LSP.Messages.CompletionList) + Result : in out LSP.Structures.CompletionList) is pragma Unreferenced (Filter); use type Libadalang.Common.Ada_Node_Kind_Type; @@ -255,10 +255,10 @@ package body LSP.Ada_Completions.End_Names is Label : VSS.Strings.Virtual_String; Has_Space : Boolean := Libadalang.Common.Is_Trivia (Token); End_Token : Libadalang.Common.Token_Data_Type; - Item : LSP.Messages.CompletionItem; + Item : LSP.Structures.CompletionItem; Parent : constant Libadalang.Analysis.Ada_Node := (if Node.Is_Null then Node - else LSP.Lal_Utils.Skip_Dotted_Names (Node.Parent)); + else Skip_Dotted_Names (Node.Parent)); -- Skip the outermost dotted name enclosing Node.Parent, so -- that when completing in a situation such as the following: -- @@ -284,21 +284,21 @@ package body LSP.Ada_Completions.End_Names is Token_Reference := Libadalang.Common.Previous (Token_Reference, Exclude_Trivia => True); - if LSP.Lal_Utils.Is_End_Token (Token_Reference) then + if Is_End_Token (Token_Reference) then End_Token := Libadalang.Common.Data (Token_Reference); Has_Space := True; -- Fix for case else return; end if; - elsif LSP.Lal_Utils.Is_End_Token (Token) then + elsif Is_End_Token (Token) then End_Token := Libadalang.Common.Data (Token); else -- The case: Token_Reference := Libadalang.Common.Previous (Token_Reference, Exclude_Trivia => True); - if LSP.Lal_Utils.Is_End_Token (Token_Reference) then + if Is_End_Token (Token_Reference) then End_Token := Libadalang.Common.Data (Token_Reference); Has_Space := True; -- Fix for case else @@ -324,22 +324,24 @@ package body LSP.Ada_Completions.End_Names is Label.Append (';'); Item := (label => Label, - kind => (True, LSP.Messages.Keyword), - tags => (Is_Set => False), - detail => (Is_Set => False), + labelDetails => (Is_Set => False), + kind => (True, LSP.Enumerations.Keyword), + tags => <>, + detail => <>, documentation => (Is_Set => False), deprecated => (Is_Set => False), preselect => (True, Has_Space), - sortText => (True, Label), - filterText => (Is_Set => False), - insertText => (True, Label), + sortText => Label, + filterText => <>, + insertText => Label, insertTextFormat => (Is_Set => False), insertTextMode => (Is_Set => False), textEdit => (Is_Set => False), + textEditText => <>, additionalTextEdits => <>, - commitCharacters => (Is_Set => False), + commitCharacters => <>, command => (Is_Set => False), - data => (Is_Set => False)); + data => <>); Result.items.Append (Item); end Propose_Completion; diff --git a/source/ada/lsp-ada_completions-end_names.ads b/source/ada/lsp-ada_completions-end_names.ads index b778812a4..545967e9e 100644 --- a/source/ada/lsp-ada_completions-end_names.ads +++ b/source/ada/lsp-ada_completions-end_names.ads @@ -28,7 +28,7 @@ package LSP.Ada_Completions.End_Names is Node : Libadalang.Analysis.Ada_Node; Filter : in out LSP.Ada_Completions.Filters.Filter; Names : in out Ada_Completions.Completion_Maps.Map; - Result : in out LSP.Messages.CompletionList); + Result : in out LSP.Structures.CompletionList); -- Get completion for or . end LSP.Ada_Completions.End_Names; diff --git a/source/ada/lsp-ada_completions-generic_assoc.adb b/source/ada/lsp-ada_completions-generic_assoc.adb index 9826459ef..f99a1a395 100644 --- a/source/ada/lsp-ada_completions-generic_assoc.adb +++ b/source/ada/lsp-ada_completions-generic_assoc.adb @@ -20,8 +20,7 @@ with GNATCOLL.Traces; with Laltools.Common; with LSP.Ada_Documents; with LSP.Ada_Documentation; -with LSP.Lal_Utils; -with LSP.Types; +with LSP.Enumerations; with VSS.Strings.Character_Iterators; with VSS.Strings.Conversions; with VSS.Unicode; @@ -47,11 +46,11 @@ package body LSP.Ada_Completions.Generic_Assoc is Parent : Laltools.Common.Node_Vectors.Vector) return Boolean; function Is_Signature_Active - (Parameters : LSP.Messages.ParameterInformation_Vector; + (Parameters : LSP.Structures.ParameterInformation_Vector; Sig_Label : VSS.Strings.Virtual_String; - Cursor_Position : LSP.Types.LSP_Number; + Cursor_Position : Integer; Designator : Libadalang.Analysis.Ada_Node; - Active_Position : out LSP.Types.LSP_Number) + Active_Position : out Integer) return Boolean; -- Return True if Parameters is valid for the current context. -- Active_Position will point to the active parameter inside Parameters. @@ -62,14 +61,14 @@ package body LSP.Ada_Completions.Generic_Assoc is Prefixed : Boolean; Parameters : LSP.Ada_Completions.Generic_Assoc_Utils.Param_Vectors.Vector; - Cursor_Position : out LSP.Types.LSP_Number; + Cursor_Position : out Integer; Current_Designator : out Libadalang.Analysis.Ada_Node); function Find_Designator_Position (Designator : Libadalang.Analysis.Ada_Node; Spec_Designators : Laltools.Common.Node_Vectors.Vector; - Cursor_Position : LSP.Types.LSP_Number) - return LSP.Types.LSP_Number; + Cursor_Position : Integer) + return Integer; ----------------------- -- Match_Designators -- @@ -144,7 +143,7 @@ package body LSP.Ada_Completions.Generic_Assoc is Limit : Natural; Filter : in out LSP.Ada_Completions.Filters.Filter; Names : in out Ada_Completions.Completion_Maps.Map; - Unsorted_Res : in out LSP.Messages.CompletionItem_Vector) + Unsorted_Res : in out LSP.Structures.CompletionItem_Vector) is pragma Unreferenced (Filter, Names); use Libadalang.Analysis; @@ -172,7 +171,7 @@ package body LSP.Ada_Completions.Generic_Assoc is Column : Langkit_Support.Slocs.Column_Number; -- Use Column as the block indentation - Prefix_Span : LSP.Messages.Span; + Prefix_Span : LSP.Structures.A_Range; -- The span covering Prefix. Prefixed : Boolean; @@ -245,7 +244,7 @@ package body LSP.Ada_Completions.Generic_Assoc is declare Name : constant VSS.Strings.Virtual_String := VSS.Strings.To_Virtual_String (Desg.Text); - Item : LSP.Messages.CompletionItem; + Item : LSP.Structures.CompletionItem; Snippet : VSS.Strings.Virtual_String; Type_Text : constant VSS.Strings.Virtual_String := (if Param_Types.Contains (Desg) @@ -267,26 +266,25 @@ package body LSP.Ada_Completions.Generic_Assoc is -- Snippet Format: "Name => " Item.label := Name; Item.insertTextFormat := - (True, LSP.Messages.PlainText); - Item.insertText := (True, Value => <>); - Item.insertText.Value.Append - (Whitespace_Prefix); - Item.insertText.Value.Append (Name); - Item.insertText.Value.Append (" => "); - Item.kind := (True, LSP.Messages.Field); - Doc := Item.insertText.Value; + (True, LSP.Enumerations.PlainText); + Item.insertText.Append (Whitespace_Prefix); + Item.insertText.Append (Name); + Item.insertText.Append (" => "); + Item.kind := (True, LSP.Enumerations.Field); + Doc := Item.insertText; if Param_Types (Desg).Is_Value then - Item.insertText.Value.Append (Type_Text); + Item.insertText.Append (Type_Text); Item.label.Append (" => "); Item.label.Append (Type_Text); end if; Item.documentation := (Is_Set => True, - Value => LSP.Messages.String_Or_MarkupContent' - (Is_String => True, - String => Doc)); + Value => LSP.Structures. + Virtual_String_Or_MarkupContent' + (Is_Virtual_String => True, + Virtual_String => Doc)); Unsorted_Res.Append (Item); end if; @@ -367,15 +365,13 @@ package body LSP.Ada_Completions.Generic_Assoc is Params_Snippet.Prepend (Snippet_Prefix); declare - Item : LSP.Messages.CompletionItem; + Item : LSP.Structures.CompletionItem; begin Item.label := Title; - Item.insertTextFormat := - (True, LSP.Messages.Snippet); - Item.insertText := (True, Value => <>); - Item.insertText.Value.Append (Whitespace_Prefix); - Item.insertText.Value.Append (Params_Snippet); - Item.kind := (True, LSP.Messages.Snippet); + Item.insertTextFormat := (True, LSP.Enumerations.Snippet); + Item.insertText.Append (Whitespace_Prefix); + Item.insertText.Append (Params_Snippet); + Item.kind := (True, LSP.Enumerations.Snippet); LSP.Ada_Documents.Set_Completion_Item_Documentation (Context => Self.Context.all, BD => Decl, @@ -409,7 +405,7 @@ package body LSP.Ada_Completions.Generic_Assoc is (Get_Prefix_Node (Elem_Node, Column => Column).Sloc_Range), Sloc)); Prefix := Self.Document.Get_Text_At - (Prefix_Span.first, Prefix_Span.last); + (Prefix_Span.start, Prefix_Span.an_end); Parameters := Get_Parameters (Elem_Node, Prefixed); Using_Name := Has_Designator (Unnamed_Params); @@ -451,15 +447,14 @@ package body LSP.Ada_Completions.Generic_Assoc is ------------------------ procedure Propose_Signatures - (Context : not null LSP.Ada_Handlers.Context_Access; + (Context : not null LSP.Ada_Context_Sets.Context_Access; Node : Libadalang.Analysis.Ada_Node; Cursor : Langkit_Support.Slocs.Source_Location; - Prev_Signatures : LSP.Messages.Optional_SignatureHelpContext; - Res : in out LSP.Messages.SignatureHelp; + Prev_Signatures : LSP.Structures.SignatureHelpContext_Optional; + Res : in out LSP.Structures.SignatureHelp; Lazy : Boolean := False) is use LSP.Ada_Completions.Generic_Assoc_Utils; - use type LSP.Types.LSP_Number; Elem_Node : constant Element := Search_Element (Node); @@ -470,7 +465,7 @@ package body LSP.Ada_Completions.Generic_Assoc is Prefixed : Boolean; -- Are we prefixed by a parameter? (for example: dot call) - Prev_Active : LSP.Types.LSP_Number := + Prev_Active : Integer := (if Prev_Signatures.Is_Set and then Prev_Signatures.Value.activeSignatureHelp.Is_Set and then Prev_Signatures.Value.activeSignatureHelp. @@ -479,7 +474,7 @@ package body LSP.Ada_Completions.Generic_Assoc is Value.activeSignature.Value else 0); - Cursor_Position : LSP.Types.LSP_Number := 0; + Cursor_Position : Integer := 0; Current_Designator : Libadalang.Analysis.Ada_Node := Libadalang.Analysis.No_Ada_Node; @@ -488,14 +483,14 @@ package body LSP.Ada_Completions.Generic_Assoc is procedure Add_Signature (Spec : Assoc_Data); procedure Filter_Previous_Signatures - (Signatures : LSP.Messages.SignatureHelp); + (Signatures : LSP.Structures.SignatureHelp); ------------------- -- Add_Signature -- ------------------- procedure Add_Signature (Spec : Assoc_Data) is - Signature : LSP.Messages.SignatureInformation := + Signature : LSP.Structures.SignatureInformation := (label => <>, activeParameter => (Is_Set => True, @@ -525,15 +520,17 @@ package body LSP.Ada_Completions.Generic_Assoc is Signature.label := Declaration_Text; Signature.documentation := (Is_Set => True, - Value => (Is_String => True, String => Documentation_Text)); + Value => + (Is_Virtual_String => True, + Virtual_String => Documentation_Text)); for Param of Spec.Param_Vector loop declare - P : constant LSP.Messages.ParameterInformation := + P : constant LSP.Structures.ParameterInformation := (label => - (Is_String => True, - String => - LSP.Lal_Utils.To_Virtual_String (Param.Text)), + (Is_Virtual_String => True, + Virtual_String => + VSS.Strings.To_Virtual_String (Param.Text)), documentation => (Is_Set => False) ); @@ -549,12 +546,12 @@ package body LSP.Ada_Completions.Generic_Assoc is -------------------------------- procedure Filter_Previous_Signatures - (Signatures : LSP.Messages.SignatureHelp) is + (Signatures : LSP.Structures.SignatureHelp) is begin -- Search for the current designator and the active position declare - Active_Position : LSP.Types.LSP_Number := -1; - Index : LSP.Types.LSP_Number := 0; + Active_Position : Integer := -1; + Index : Integer := 0; begin for S of Signatures.signatures loop if Is_Signature_Active @@ -565,7 +562,7 @@ package body LSP.Ada_Completions.Generic_Assoc is Active_Position => Active_Position) then declare - Signature : LSP.Messages.SignatureInformation := S; + Signature : LSP.Structures.SignatureInformation := S; begin Signature.activeParameter := (Is_Set => True, @@ -628,7 +625,7 @@ package body LSP.Ada_Completions.Generic_Assoc is -- Cursor can't point to Length (Spec), it starts at 0 and then Cursor_Position /= -1 and then Cursor_Position < - LSP.Types.LSP_Number (Spec.Param_Vector.Length) + Integer (Spec.Param_Vector.Length) -- The designators matched and then Match_Designators (Parameters, Spec.Param_Vector) then @@ -637,7 +634,7 @@ package body LSP.Ada_Completions.Generic_Assoc is -- redundant => remove the parameter highlighting -- (too many possibilities) declare - Sign : LSP.Messages.SignatureInformation := + Sign : LSP.Structures.SignatureInformation := Res.signatures.Last_Element; begin Sign.activeParameter := (Is_Set => False); @@ -668,15 +665,14 @@ package body LSP.Ada_Completions.Generic_Assoc is ------------------------- function Is_Signature_Active - (Parameters : LSP.Messages.ParameterInformation_Vector; + (Parameters : LSP.Structures.ParameterInformation_Vector; Sig_Label : VSS.Strings.Virtual_String; - Cursor_Position : LSP.Types.LSP_Number; + Cursor_Position : Integer; Designator : Libadalang.Analysis.Ada_Node; - Active_Position : out LSP.Types.LSP_Number) + Active_Position : out Integer) return Boolean is use Libadalang.Analysis; - use type LSP.Types.LSP_Number; use type VSS.Strings.Virtual_String; begin Active_Position := 0; @@ -688,11 +684,11 @@ package body LSP.Ada_Completions.Generic_Assoc is -- Check if Position is valid in Parameters (Note: Position starts -- at 0) Active_Position := Cursor_Position; - return Cursor_Position < LSP.Types.LSP_Number (Parameters.Length); + return Cursor_Position < Integer (Parameters.Length); else declare Name : constant VSS.Strings.Virtual_String := - LSP.Lal_Utils.To_Virtual_String (Designator.Text); + VSS.Strings.To_Virtual_String (Designator.Text); begin for Param of Parameters loop @@ -708,21 +704,23 @@ package body LSP.Ada_Completions.Generic_Assoc is Success : Boolean with Unreferenced; begin - if Param.label.Is_String then - if Param.label.String = Name then + if Param.label.Is_Virtual_String then + if Param.label.Virtual_String = Name then return True; end if; else -- The code below check that: -- Sig_Label [label.From .. label.Till - 1] = Name - while First.First_UTF16_Offset < Param.label.From + while First.First_UTF16_Offset < VSS.Unicode. + UTF16_Code_Unit_Index (Param.label.Natural_Tuple (1)) and then First.Forward loop null; end loop; - while Last.First_UTF16_Offset < Param.label.Till + while Last.First_UTF16_Offset < VSS.Unicode. + UTF16_Code_Unit_Index (Param.label.Natural_Tuple (2)) and then Last.Forward loop null; @@ -755,11 +753,10 @@ package body LSP.Ada_Completions.Generic_Assoc is Prefixed : Boolean; Parameters : LSP.Ada_Completions.Generic_Assoc_Utils.Param_Vectors.Vector; - Cursor_Position : out LSP.Types.LSP_Number; + Cursor_Position : out Integer; Current_Designator : out Libadalang.Analysis.Ada_Node) is use Langkit_Support.Slocs; - use type LSP.Types.LSP_Number; Is_New_Param : Boolean := False; @@ -866,7 +863,7 @@ package body LSP.Ada_Completions.Generic_Assoc is end loop; -- New param is only considered if we are using all the previous params - if LSP.Types.LSP_Number (Parameters.Length) = Cursor_Position + if Integer (Parameters.Length) = Cursor_Position and then Is_New_Param then Cursor_Position := Cursor_Position + 1; @@ -890,12 +887,11 @@ package body LSP.Ada_Completions.Generic_Assoc is function Find_Designator_Position (Designator : Libadalang.Analysis.Ada_Node; Spec_Designators : Laltools.Common.Node_Vectors.Vector; - Cursor_Position : LSP.Types.LSP_Number) - return LSP.Types.LSP_Number + Cursor_Position : Integer) + return Integer is - use type LSP.Types.LSP_Number; use type Libadalang.Analysis.Ada_Node; - Index : LSP.Types.LSP_Number := 0; + Index : Integer := 0; begin if Designator = Libadalang.Analysis.No_Ada_Node then if Cursor_Position > 0 then diff --git a/source/ada/lsp-ada_completions-generic_assoc.ads b/source/ada/lsp-ada_completions-generic_assoc.ads index a8bcc5227..851506940 100644 --- a/source/ada/lsp-ada_completions-generic_assoc.ads +++ b/source/ada/lsp-ada_completions-generic_assoc.ads @@ -20,7 +20,7 @@ with Libadalang.Analysis; with LSP.Ada_Completions.Filters; with LSP.Ada_Completions.Generic_Assoc_Utils; with LSP.Ada_Completions.Parameters; -with LSP.Ada_Handlers; +with LSP.Ada_Context_Sets; generic type Element is private; @@ -44,7 +44,7 @@ generic with function Get_Spec_Designators (E : Element; - Context : not null LSP.Ada_Handlers.Context_Access; + Context : not null LSP.Ada_Context_Sets.Context_Access; For_Signature : Boolean) return LSP.Ada_Completions.Generic_Assoc_Utils.Assoc_Data_Lists.List; -- Return all the specs matching E @@ -75,14 +75,14 @@ package LSP.Ada_Completions.Generic_Assoc is Limit : Natural; Filter : in out LSP.Ada_Completions.Filters.Filter; Names : in out Ada_Completions.Completion_Maps.Map; - Unsorted_Res : in out LSP.Messages.CompletionItem_Vector); + Unsorted_Res : in out LSP.Structures.CompletionItem_Vector); procedure Propose_Signatures - (Context : not null LSP.Ada_Handlers.Context_Access; + (Context : not null LSP.Ada_Context_Sets.Context_Access; Node : Libadalang.Analysis.Ada_Node; Cursor : Langkit_Support.Slocs.Source_Location; - Prev_Signatures : LSP.Messages.Optional_SignatureHelpContext; - Res : in out LSP.Messages.SignatureHelp; + Prev_Signatures : LSP.Structures.SignatureHelpContext_Optional; + Res : in out LSP.Structures.SignatureHelp; Lazy : Boolean := False); -- If Lazy, give up on trying to highlight the parameters when multiple -- signature are possible. diff --git a/source/ada/lsp-ada_completions-keywords.adb b/source/ada/lsp-ada_completions-keywords.adb index 2b0103949..94ef28c5d 100644 --- a/source/ada/lsp-ada_completions-keywords.adb +++ b/source/ada/lsp-ada_completions-keywords.adb @@ -15,12 +15,13 @@ -- of the license. -- ------------------------------------------------------------------------------ +with Ada.Strings.Wide_Wide_Unbounded; with Libadalang.Common; with VSS.Strings; with LSP.Ada_Completions.Filters; -with LSP.Lal_Utils; +with LSP.Enumerations; package body LSP.Ada_Completions.Keywords is @@ -35,7 +36,7 @@ package body LSP.Ada_Completions.Keywords is Node : Libadalang.Analysis.Ada_Node; Filter : in out LSP.Ada_Completions.Filters.Filter; Names : in out Ada_Completions.Completion_Maps.Map; - Result : in out LSP.Messages.CompletionList) + Result : in out LSP.Structures.CompletionList) is pragma Unreferenced (Names); Prev : constant Libadalang.Common.Token_Reference := @@ -55,7 +56,7 @@ package body LSP.Ada_Completions.Keywords is end if; declare - Item : LSP.Messages.CompletionItem; + Item : LSP.Structures.CompletionItem; Prefix : constant VSS.Strings.Virtual_String := VSS.Strings.To_Virtual_String (Node.Text); Keywords : constant Libadalang.Analysis.Unbounded_Text_Type_Array := @@ -65,16 +66,18 @@ package body LSP.Ada_Completions.Keywords is for Keyword of Keywords loop declare Label : constant VSS.Strings.Virtual_String := - LSP.Lal_Utils.To_Virtual_String (Keyword); + VSS.Strings.To_Virtual_String + (Ada.Strings.Wide_Wide_Unbounded.To_Wide_Wide_String + (Keyword)); begin if Label.Starts_With (Prefix, VSS.Strings.Identifier_Caseless) then Item.label := Label; - Item.insertTextFormat := (True, LSP.Messages.PlainText); - Item.insertText := (True, Label); - Item.kind := (True, LSP.Messages.Keyword); + Item.insertTextFormat := (True, LSP.Enumerations.PlainText); + Item.insertText := Label; + Item.kind := (True, LSP.Enumerations.Keyword); Result.items.Append (Item); end if; end; diff --git a/source/ada/lsp-ada_completions-keywords.ads b/source/ada/lsp-ada_completions-keywords.ads index e34e76286..2666216f8 100644 --- a/source/ada/lsp-ada_completions-keywords.ads +++ b/source/ada/lsp-ada_completions-keywords.ads @@ -28,7 +28,7 @@ package LSP.Ada_Completions.Keywords is Node : Libadalang.Analysis.Ada_Node; Filter : in out LSP.Ada_Completions.Filters.Filter; Names : in out Ada_Completions.Completion_Maps.Map; - Result : in out LSP.Messages.CompletionList); + Result : in out LSP.Structures.CompletionList); -- Get completion for keywords, filtering them with the prefix. end LSP.Ada_Completions.Keywords; diff --git a/source/ada/lsp-ada_completions-names.adb b/source/ada/lsp-ada_completions-names.adb index 6e37baa0b..9869da816 100644 --- a/source/ada/lsp-ada_completions-names.adb +++ b/source/ada/lsp-ada_completions-names.adb @@ -20,7 +20,6 @@ with Langkit_Support.Errors; with VSS.Strings; with LSP.Ada_Completions.Filters; -with LSP.Lal_Utils; package body LSP.Ada_Completions.Names is @@ -35,7 +34,7 @@ package body LSP.Ada_Completions.Names is Node : Libadalang.Analysis.Ada_Node; Filter : in out LSP.Ada_Completions.Filters.Filter; Names : in out Ada_Completions.Completion_Maps.Map; - Result : in out LSP.Messages.CompletionList) + Result : in out LSP.Structures.CompletionList) is use all type Libadalang.Analysis.Base_Id; use all type Libadalang.Common.Ada_Node_Kind_Type; @@ -172,8 +171,8 @@ package body LSP.Ada_Completions.Names is if not BD.Is_Null then for DN of BD.P_Defining_Names loop - Name := - LSP.Lal_Utils.To_Virtual_String (DN.P_Relative_Name.Text); + Name := VSS.Strings.To_Virtual_String + (DN.P_Relative_Name.Text); if Name.Ends_With (Underscore) then -- Skip `root_types_` until UB30-020 is fixed. diff --git a/source/ada/lsp-ada_completions-names.ads b/source/ada/lsp-ada_completions-names.ads index 942d44485..c9e491d91 100644 --- a/source/ada/lsp-ada_completions-names.ads +++ b/source/ada/lsp-ada_completions-names.ads @@ -28,6 +28,6 @@ package LSP.Ada_Completions.Names is Node : Libadalang.Analysis.Ada_Node; Filter : in out LSP.Ada_Completions.Filters.Filter; Names : in out Ada_Completions.Completion_Maps.Map; - Result : in out LSP.Messages.CompletionList); + Result : in out LSP.Structures.CompletionList); end LSP.Ada_Completions.Names; diff --git a/source/ada/lsp-ada_completions-parameters.adb b/source/ada/lsp-ada_completions-parameters.adb index 551fb6240..8d91843ce 100644 --- a/source/ada/lsp-ada_completions-parameters.adb +++ b/source/ada/lsp-ada_completions-parameters.adb @@ -24,8 +24,7 @@ with LSP.Ada_Completions.Filters; with LSP.Ada_Completions.Generic_Assoc; with LSP.Ada_Completions.Generic_Assoc_Utils; use LSP.Ada_Completions.Generic_Assoc_Utils; - -with LSP.Lal_Utils; +with LSP.Enumerations; with VSS.Strings.Conversions; with Langkit_Support.Slocs; @@ -38,7 +37,7 @@ package body LSP.Ada_Completions.Parameters is return LSP.Ada_Completions.Generic_Assoc_Utils.Param_Vectors.Vector; function Get_Spec_Call_Expr_Designators (C : Libadalang.Analysis.Call_Expr; - Context : not null LSP.Ada_Handlers.Context_Access; + Context : not null LSP.Ada_Context_Sets.Context_Access; For_Signature : Boolean) return LSP.Ada_Completions.Generic_Assoc_Utils.Assoc_Data_Lists.List; function Get_Prefix_Node @@ -49,13 +48,19 @@ package body LSP.Ada_Completions.Parameters is (C : Libadalang.Analysis.Call_Expr) return Libadalang.Analysis.Ada_Node'Class is (C); + function Get_Call_Expr + (Node : Libadalang.Analysis.Ada_Node'Class) + return Libadalang.Analysis.Call_Expr; + -- From Node try to find a Call_Expr node, it will handle basic error + -- recovery. + package Call_Expr_Completion is new LSP.Ada_Completions.Generic_Assoc (Element => Libadalang.Analysis.Call_Expr, Null_Element => Libadalang.Analysis.No_Call_Expr, Pretty_Print_Rule => Libadalang.Common.Param_Assoc_Rule, Get_Prefix_Node => Get_Prefix_Node, - Search_Element => LSP.Lal_Utils.Get_Call_Expr, + Search_Element => Get_Call_Expr, Get_Parameters => Get_Parameters, Get_Spec_Designators => Get_Spec_Call_Expr_Designators, To_Node => To_Node); @@ -69,7 +74,7 @@ package body LSP.Ada_Completions.Parameters is return LSP.Ada_Completions.Generic_Assoc_Utils.Param_Vectors.Vector; function Get_Spec_Aggregate_Designators (A : Libadalang.Analysis.Aggregate; - Context : not null LSP.Ada_Handlers.Context_Access; + Context : not null LSP.Ada_Context_Sets.Context_Access; For_Signature : Boolean) return LSP.Ada_Completions.Generic_Assoc_Utils.Assoc_Data_Lists.List; function Get_Prefix_Node @@ -100,7 +105,7 @@ package body LSP.Ada_Completions.Parameters is return LSP.Ada_Completions.Generic_Assoc_Utils.Param_Vectors.Vector; function Get_Decl_Designators (G : Libadalang.Analysis.Generic_Package_Instantiation; - Context : not null LSP.Ada_Handlers.Context_Access; + Context : not null LSP.Ada_Context_Sets.Context_Access; For_Signature : Boolean) return LSP.Ada_Completions.Generic_Assoc_Utils.Assoc_Data_Lists.List; function Get_Prefix_Node @@ -190,7 +195,7 @@ package body LSP.Ada_Completions.Parameters is function Get_Spec_Call_Expr_Designators (C : Libadalang.Analysis.Call_Expr; - Context : not null LSP.Ada_Handlers.Context_Access; + Context : not null LSP.Ada_Context_Sets.Context_Access; For_Signature : Boolean) return LSP.Ada_Completions.Generic_Assoc_Utils.Assoc_Data_Lists.List is @@ -319,7 +324,7 @@ package body LSP.Ada_Completions.Parameters is function Get_Spec_Aggregate_Designators (A : Libadalang.Analysis.Aggregate; - Context : not null LSP.Ada_Handlers.Context_Access; + Context : not null LSP.Ada_Context_Sets.Context_Access; For_Signature : Boolean) return LSP.Ada_Completions.Generic_Assoc_Utils.Assoc_Data_Lists.List is @@ -467,7 +472,7 @@ package body LSP.Ada_Completions.Parameters is begin if Length = 0 then return - LSP.Lal_Utils.To_Virtual_String + VSS.Strings.To_Virtual_String ("Aggregate for " & Aggr_Type.F_Name.Text); end if; @@ -479,12 +484,12 @@ package body LSP.Ada_Completions.Parameters is Discriminants (Idx); begin Result.Append - (LSP.Lal_Utils.To_Virtual_String + (VSS.Strings.To_Virtual_String (Discriminant (Disc_Values).Text)); Result.Append (" => "); Result.Append - (LSP.Lal_Utils.To_Virtual_String (Values (Disc_Values).Text)); + (VSS.Strings.To_Virtual_String (Values (Disc_Values).Text)); if Idx < Discriminants'Length then Result.Append (", "); @@ -646,7 +651,7 @@ package body LSP.Ada_Completions.Parameters is function Get_Decl_Designators (G : Libadalang.Analysis.Generic_Package_Instantiation; - Context : not null LSP.Ada_Handlers.Context_Access; + Context : not null LSP.Ada_Context_Sets.Context_Access; For_Signature : Boolean) return LSP.Ada_Completions.Generic_Assoc_Utils.Assoc_Data_Lists.List is @@ -748,10 +753,10 @@ package body LSP.Ada_Completions.Parameters is Node : Libadalang.Analysis.Ada_Node; Filter : in out LSP.Ada_Completions.Filters.Filter; Names : in out Ada_Completions.Completion_Maps.Map; - Result : in out LSP.Messages.CompletionList) + Result : in out LSP.Structures.CompletionList) is Count : Natural := 0; - Unsorted_Res : LSP.Messages.CompletionItem_Vector; + Unsorted_Res : LSP.Structures.CompletionItem_Vector; begin Call_Expr_Completion.Propose_Completion (Self => Self, @@ -790,9 +795,8 @@ package body LSP.Ada_Completions.Parameters is -- Use a "+" as the first sorted character to be shown before -- the items from the other providers ("+" is lower than -- the alphanumeric symbol and "~" in the ASCII table) - Unsort_Item.sortText := (True, Value => <>); - Unsort_Item.sortText.Value.Append ('+'); - Unsort_Item.sortText.Value.Append + Unsort_Item.sortText.Append ('+'); + Unsort_Item.sortText.Append (VSS.Strings.Conversions.To_Virtual_String (GNATCOLL.Utils.Image (Count, Min_Width => Min_Width))); Result.items.Append (Unsort_Item); @@ -806,21 +810,21 @@ package body LSP.Ada_Completions.Parameters is ------------------------ procedure Propose_Signatures - (Context : not null LSP.Ada_Handlers.Context_Access; + (Context : not null LSP.Ada_Context_Sets.Context_Access; Node : Libadalang.Analysis.Ada_Node; Cursor : Langkit_Support.Slocs.Source_Location; - Prev_Signatures : LSP.Messages.Optional_SignatureHelpContext; - Res : in out LSP.Messages.SignatureHelp) + Prev_Signatures : LSP.Structures.SignatureHelpContext_Optional; + Res : in out LSP.Structures.SignatureHelp) is - use type LSP.Messages.SignatureHelpTriggerKind; + use type LSP.Enumerations.SignatureHelpTriggerKind; use type VSS.Strings.Virtual_String; - Filter_Signatures : LSP.Messages.Optional_SignatureHelpContext := + Filter_Signatures : LSP.Structures.SignatureHelpContext_Optional := (Is_Set => False); begin -- Special handling of typecast declare - Call_Node : constant Libadalang.Analysis.Call_Expr - := LSP.Lal_Utils.Get_Call_Expr (Node); + Call_Node : constant Libadalang.Analysis.Call_Expr := + Get_Call_Expr (Node); begin if not Call_Node.Is_Null then declare @@ -844,11 +848,10 @@ package body LSP.Ada_Completions.Parameters is and then Prev_Signatures.Value.isRetrigger and then Prev_Signatures.Value.activeSignatureHelp.Is_Set and then - (Prev_Signatures.Value.triggerKind /= LSP.Messages.TriggerCharacter - or else + (Prev_Signatures.Value.triggerKind /= + LSP.Enumerations.TriggerCharacter -- Adding a ',' will not add new results only filter the previous - (Prev_Signatures.Value.triggerCharacter.Is_Set - and then Prev_Signatures.Value.triggerCharacter.Value = ",")) + or else Prev_Signatures.Value.triggerCharacter = ",") then -- At this point, we are filtering the previous signatures Filter_Signatures := Prev_Signatures; @@ -877,4 +880,51 @@ package body LSP.Ada_Completions.Parameters is Res => Res); end Propose_Signatures; + ------------------- + -- Get_Call_Expr -- + ------------------- + + function Get_Call_Expr + (Node : Libadalang.Analysis.Ada_Node'Class) + return Libadalang.Analysis.Call_Expr + is + Cur_Node : Ada_Node := Node.As_Ada_Node; + begin + if not Cur_Node.Is_Null + and then Cur_Node.Kind in Ada_Error_Stmt_Range + then + -- In case of Error_Stmt, find the nearest previous sibling + -- which is not also an Error_Stmt + while not Cur_Node.Is_Null + and then Cur_Node.Kind in Ada_Error_Stmt_Range + loop + Cur_Node := Cur_Node.Previous_Sibling; + end loop; + + -- Find the nearest Call_Expr node in the children + if not Cur_Node.Is_Null then + for Child_Node of Cur_Node.Children loop + if Child_Node.Kind in Ada_Call_Expr_Range then + Cur_Node := Child_Node; + exit; + end if; + end loop; + end if; + end if; + + -- Find the nearest Call_Expr node in the parents or itself + while not Cur_Node.Is_Null loop + exit when Cur_Node.Kind in Ada_Call_Expr_Range; + + Cur_Node := Cur_Node.Parent; + end loop; + + -- At this point we have null or a Call_Expr + if Cur_Node.Is_Null then + return No_Call_Expr; + else + return Cur_Node.As_Call_Expr; + end if; + end Get_Call_Expr; + end LSP.Ada_Completions.Parameters; diff --git a/source/ada/lsp-ada_completions-parameters.ads b/source/ada/lsp-ada_completions-parameters.ads index 734c00015..ee131503c 100644 --- a/source/ada/lsp-ada_completions-parameters.ads +++ b/source/ada/lsp-ada_completions-parameters.ads @@ -16,13 +16,13 @@ ------------------------------------------------------------------------------ -- A completion provider for parameters after '(' or ',' -with LSP.Ada_Handlers; +with LSP.Ada_Context_Sets; with LSP.Ada_Documents; package LSP.Ada_Completions.Parameters is type Parameter_Completion_Provider - (Context : not null LSP.Ada_Handlers.Context_Access; + (Context : not null LSP.Ada_Context_Sets.Context_Access; Document : LSP.Ada_Documents.Document_Access; Named_Notation_Threshold : Natural; Compute_Doc_And_Details : Boolean) @@ -35,14 +35,14 @@ package LSP.Ada_Completions.Parameters is Node : Libadalang.Analysis.Ada_Node; Filter : in out LSP.Ada_Completions.Filters.Filter; Names : in out Ada_Completions.Completion_Maps.Map; - Result : in out LSP.Messages.CompletionList); + Result : in out LSP.Structures.CompletionList); -- Using the context, return the list of parameters after '(' or ',' procedure Propose_Signatures - (Context : not null LSP.Ada_Handlers.Context_Access; + (Context : not null LSP.Ada_Context_Sets.Context_Access; Node : Libadalang.Analysis.Ada_Node; Cursor : Langkit_Support.Slocs.Source_Location; - Prev_Signatures : LSP.Messages.Optional_SignatureHelpContext; - Res : in out LSP.Messages.SignatureHelp); + Prev_Signatures : LSP.Structures.SignatureHelpContext_Optional; + Res : in out LSP.Structures.SignatureHelp); -- Using the context, return the possible signatures end LSP.Ada_Completions.Parameters; diff --git a/source/ada/lsp-ada_completions-pragmas.adb b/source/ada/lsp-ada_completions-pragmas.adb index d55090e41..36ace002f 100644 --- a/source/ada/lsp-ada_completions-pragmas.adb +++ b/source/ada/lsp-ada_completions-pragmas.adb @@ -32,7 +32,7 @@ package body LSP.Ada_Completions.Pragmas is Node : Libadalang.Analysis.Ada_Node; Filter : in out LSP.Ada_Completions.Filters.Filter; Names : in out Ada_Completions.Completion_Maps.Map; - Result : in out LSP.Messages.CompletionList) + Result : in out LSP.Structures.CompletionList) is pragma Unreferenced (Filter); pragma Unreferenced (Names); diff --git a/source/ada/lsp-ada_completions-pragmas.ads b/source/ada/lsp-ada_completions-pragmas.ads index c4439327a..150d979b2 100644 --- a/source/ada/lsp-ada_completions-pragmas.ads +++ b/source/ada/lsp-ada_completions-pragmas.ads @@ -27,7 +27,7 @@ package LSP.Ada_Completions.Pragmas is Node : Libadalang.Analysis.Ada_Node; Filter : in out LSP.Ada_Completions.Filters.Filter; Names : in out Ada_Completions.Completion_Maps.Map; - Result : in out LSP.Messages.CompletionList); + Result : in out LSP.Structures.CompletionList); -- Get completion for pragmas if we are within an pragma node and return -- immediately, since we don't want to propose other items than pragmas -- when wthin a pragma node. diff --git a/source/ada/lsp-ada_completions-use_clauses.adb b/source/ada/lsp-ada_completions-use_clauses.adb index 97a952dac..33b323139 100644 --- a/source/ada/lsp-ada_completions-use_clauses.adb +++ b/source/ada/lsp-ada_completions-use_clauses.adb @@ -17,7 +17,9 @@ with VSS.Strings.Conversions; with Libadalang.Iterators; + with LSP.Ada_Completions.Filters; +with LSP.Enumerations; package body LSP.Ada_Completions.Use_Clauses is @@ -32,7 +34,7 @@ package body LSP.Ada_Completions.Use_Clauses is Node : Libadalang.Analysis.Ada_Node; Filter : in out LSP.Ada_Completions.Filters.Filter; Names : in out Ada_Completions.Completion_Maps.Map; - Result : in out LSP.Messages.CompletionList) + Result : in out LSP.Structures.CompletionList) is use Libadalang.Common; use Langkit_Support.Slocs; @@ -79,7 +81,7 @@ package body LSP.Ada_Completions.Use_Clauses is VSS.Strings.Conversions.To_Virtual_String ("Insert the use-clause corresponding to the with-clause on " & "the same line."); - Item : LSP.Messages.CompletionItem; + Item : LSP.Structures.CompletionItem; Count : Positive := 1; begin for Package_Name of Packages loop @@ -97,26 +99,28 @@ package body LSP.Ada_Completions.Use_Clauses is Item := (label => Insert_Text, - kind => (True, LSP.Messages.Unit), - tags => (Is_Set => False), - detail => (Is_Set => False), + labelDetails => (Is_Set => False), + kind => (True, LSP.Enumerations.Unit), + tags => <>, + detail => <>, documentation => (Is_Set => True, - Value => LSP.Messages.String_Or_MarkupContent' - (Is_String => True, - String => Doc_Text)), + Value => LSP.Structures.Virtual_String_Or_MarkupContent' + (Is_Virtual_String => True, + Virtual_String => Doc_Text)), deprecated => (Is_Set => False), preselect => (True, False), - sortText => (True, "+" & Insert_Text), - filterText => (Is_Set => False), - insertText => (True, Insert_Text), + sortText => "+" & Insert_Text, + filterText => <>, + insertText => Insert_Text, insertTextFormat => (Is_Set => False), insertTextMode => (Is_Set => False), textEdit => (Is_Set => False), + textEditText => <>, additionalTextEdits => <>, - commitCharacters => (Is_Set => False), + commitCharacters => <>, command => (Is_Set => False), - data => (Is_Set => False)); + data => <>); Result.items.Append (Item); end; diff --git a/source/ada/lsp-ada_completions-use_clauses.ads b/source/ada/lsp-ada_completions-use_clauses.ads index 78b146091..32668a571 100644 --- a/source/ada/lsp-ada_completions-use_clauses.ads +++ b/source/ada/lsp-ada_completions-use_clauses.ads @@ -28,7 +28,7 @@ package LSP.Ada_Completions.Use_Clauses is Node : Libadalang.Analysis.Ada_Node; Filter : in out LSP.Ada_Completions.Filters.Filter; Names : in out Ada_Completions.Completion_Maps.Map; - Result : in out LSP.Messages.CompletionList); + Result : in out LSP.Structures.CompletionList); -- Get completion for use-clauses if we have a with-clause node on the -- same line. diff --git a/source/ada/lsp-ada_documentation.adb b/source/ada/lsp-ada_documentation.adb index f52c2dc15..4981182b7 100644 --- a/source/ada/lsp-ada_documentation.adb +++ b/source/ada/lsp-ada_documentation.adb @@ -22,9 +22,9 @@ with VSS.String_Vectors; with Langkit_Support.Text; with Libadalang.Common; -with GNATdoc.Comments.Helpers; +with LSP.Utils; -with LSP.Lal_Utils; +with GNATdoc.Comments.Helpers; package body LSP.Ada_Documentation is @@ -130,7 +130,7 @@ package body LSP.Ada_Documentation is Node.Parent.Text; begin - Result.Append (LSP.Lal_Utils.To_Virtual_String (Parent_Text)); + Result.Append (VSS.Strings.To_Virtual_String (Parent_Text)); end Get_Loop_Var_Hover_Text; --------------------------- @@ -139,7 +139,7 @@ package body LSP.Ada_Documentation is procedure Get_Aspect_Hover_Text is Text : constant VSS.Strings.Virtual_String := - LSP.Lal_Utils.To_Virtual_String (Node.Text); + VSS.Strings.To_Virtual_String (Node.Text); Lines : constant VSS.String_Vectors.Virtual_String_Vector := Text.Split_Lines; @@ -264,7 +264,7 @@ package body LSP.Ada_Documentation is (Document_LSP_New_Line_Function, False); end if; - Location_Text := LSP.Lal_Utils.Node_Location_Image (BD); + Location_Text := LSP.Utils.Node_Location_Image (BD); -- For subprograms, do additional analysis and construct qualifier. diff --git a/source/ada/lsp-ada_handlers-invisibles.adb b/source/ada/lsp-ada_handlers-invisibles.adb index c4ed1f69b..94b3fa90a 100644 --- a/source/ada/lsp-ada_handlers-invisibles.adb +++ b/source/ada/lsp-ada_handlers-invisibles.adb @@ -19,8 +19,8 @@ with GNATCOLL.VFS; with VSS.Strings; -with LSP.Lal_Utils; with LSP.Search; +with LSP.Utils; package body LSP.Ada_Handlers.Invisibles is @@ -35,7 +35,7 @@ package body LSP.Ada_Handlers.Invisibles is Node : Libadalang.Analysis.Ada_Node; Filter : in out LSP.Ada_Completions.Filters.Filter; Names : in out Ada_Completions.Completion_Maps.Map; - Result : in out LSP.Messages.CompletionList) + Result : in out LSP.Structures.CompletionList) is pragma Unreferenced (Result); use all type Libadalang.Common.Token_Kind; @@ -120,12 +120,12 @@ package body LSP.Ada_Handlers.Invisibles is declare Word : constant VSS.Strings.Virtual_String := - LSP.Lal_Utils.To_Virtual_String + VSS.Strings.To_Virtual_String (if Libadalang.Common.Is_Trivia (Token) then "" else Libadalang.Common.Text (Token)); Canonical_Prefix : constant VSS.Strings.Virtual_String := - LSP.Lal_Utils.Canonicalize (Word); + LSP.Utils.Canonicalize (Word); begin if not Word.Is_Empty then @@ -136,7 +136,7 @@ package body LSP.Ada_Handlers.Invisibles is Case_Sensitive => False, Whole_Word => False, Negate => False, - Kind => LSP.Messages.Start_Word_Text); + Kind => LSP.Search.Start_Word_Text); begin Self.Context.Get_Any_Symbol (Pattern => Pattern, diff --git a/source/ada/lsp-ada_handlers-invisibles.ads b/source/ada/lsp-ada_handlers-invisibles.ads index b0ed72fdf..3b47d8fe6 100644 --- a/source/ada/lsp-ada_handlers-invisibles.ads +++ b/source/ada/lsp-ada_handlers-invisibles.ads @@ -26,7 +26,7 @@ package LSP.Ada_Handlers.Invisibles is type Invisible_Completion_Provider (Handler : not null access LSP.Ada_Handlers.Message_Handler; - Context : not null LSP.Ada_Handlers.Context_Access) + Context : not null LSP.Ada_Context_Sets.Context_Access) is new LSP.Ada_Completions.Completion_Provider with null record; overriding procedure Propose_Completion @@ -36,6 +36,6 @@ package LSP.Ada_Handlers.Invisibles is Node : Libadalang.Analysis.Ada_Node; Filter : in out LSP.Ada_Completions.Filters.Filter; Names : in out Ada_Completions.Completion_Maps.Map; - Result : in out LSP.Messages.CompletionList); + Result : in out LSP.Structures.CompletionList); end LSP.Ada_Handlers.Invisibles; diff --git a/source/ada/lsp-ada_handlers.adb b/source/ada/lsp-ada_handlers.adb index 22859f81b..908d38983 100644 --- a/source/ada/lsp-ada_handlers.adb +++ b/source/ada/lsp-ada_handlers.adb @@ -28,9 +28,21 @@ with Laltools.Common; with VSS.Strings.Conversions; +with Langkit_Support.Slocs; + with URIs; +with LSP.Ada_Completions; +with LSP.Ada_Completions.Aspects; +with LSP.Ada_Completions.Attributes; +with LSP.Ada_Completions.End_Names; +with LSP.Ada_Completions.Keywords; +with LSP.Ada_Completions.Names; +with LSP.Ada_Completions.Parameters; +with LSP.Ada_Completions.Pragmas; +with LSP.Ada_Completions.Use_Clauses; with LSP.Ada_Contexts; +with LSP.Ada_Handlers.Invisibles; with LSP.Ada_Handlers.Locations; with LSP.Ada_Handlers.Project_Diagnostics; with LSP.Ada_Handlers.Project_Loading; @@ -280,6 +292,105 @@ package body LSP.Ada_Handlers is Self.Tracer.Trace ("Out Message_Handler " & Name); end Log_Method_Out; + --------------------------- + -- On_Completion_Request -- + --------------------------- + + overriding procedure On_Completion_Request + (Self : in out Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CompletionParams) + is + -- We're completing only based on one context, ie one project + -- tree: this seems reasonable. One further refinement could + -- be to return only results that are available for all + -- project contexts. + + -- Value : LSP.Messages.TextDocumentPositionParams renames + -- Request.params; + + Context : constant LSP.Ada_Context_Sets.Context_Access := + Self.Contexts.Get_Best_Context (Value.textDocument.uri); + + Document : constant LSP.Ada_Documents.Document_Access := + Get_Open_Document (Self, Value.textDocument.uri); + + Names : LSP.Ada_Completions.Completion_Maps.Map; + + -- If lazy computation for the 'detail' and 'documentation' fields is + -- supported by the client, set the Compute_Doc_And_Details flag to + -- False. + Compute_Doc_And_Details : constant Boolean := + not Self.Client.Resolve_Lazily; + + P1 : aliased LSP.Ada_Completions.Aspects.Aspect_Completion_Provider; + P2 : aliased LSP.Ada_Completions.Pragmas.Pragma_Completion_Provider; + P3 : aliased LSP.Ada_Completions.Keywords.Keyword_Completion_Provider; + P4 : aliased + LSP.Ada_Completions.Attributes.Attributes_Completion_Provider; + + P5 : aliased LSP.Ada_Completions.Names.Name_Completion_Provider + (Self.Configuration.Use_Completion_Snippets); + P6 : aliased LSP.Ada_Handlers.Invisibles.Invisible_Completion_Provider + (Self'Access, Context); + P7 : aliased + LSP.Ada_Completions.Parameters.Parameter_Completion_Provider + (Context => Context, + Document => Document, + Compute_Doc_And_Details => Compute_Doc_And_Details, + Named_Notation_Threshold => + Self.Configuration.Named_Notation_Threshold); + P8 : aliased LSP.Ada_Completions.End_Names.End_Name_Completion_Provider; + P9 : aliased + LSP.Ada_Completions.Use_Clauses.Use_Clause_Completion_Provider; + Providers : constant LSP.Ada_Completions.Completion_Provider_List := + [P1'Unchecked_Access, + P2'Unchecked_Access, + P3'Unchecked_Access, + P4'Unchecked_Access, + P5'Unchecked_Access, + P6'Unchecked_Access, + P7'Unchecked_Access, + P8'Unchecked_Access, + P9'Unchecked_Access]; + + Sloc : Langkit_Support.Slocs.Source_Location; + Token : Libadalang.Common.Token_Reference; + Node : Libadalang.Analysis.Ada_Node; + + Response : LSP.Structures.Completion_Result + (Kind => LSP.Structures.Varian_2); + begin + Document.Get_Completion_Node + (Context => Context.all, + Position => Value.position, + Sloc => Sloc, + Token => Token, + Node => Node); + + Document.Get_Completions_At + (Context => Context.all, + Providers => Providers, + Sloc => Sloc, + Token => Token, + Node => Node, + Names => Names, + Result => Response.Varian_2); + + LSP.Ada_Completions.Write_Completions + (Context => Context.all, + Document => Document.all, + Sloc => Sloc, + Node => Node, + Names => Names, + Named_Notation_Threshold => + Self.Configuration.Named_Notation_Threshold, + Compute_Doc_And_Details => Compute_Doc_And_Details, + Result => Response.Varian_2.items); + + Self.Sender.On_Completion_Response (Id, Response); + end On_Completion_Request; + --------------------------- -- On_Definition_Request -- --------------------------- diff --git a/source/ada/lsp-ada_handlers.ads b/source/ada/lsp-ada_handlers.ads index 42bd1f70f..7658ddbe7 100644 --- a/source/ada/lsp-ada_handlers.ads +++ b/source/ada/lsp-ada_handlers.ads @@ -263,4 +263,9 @@ private (Self : in out Message_Handler; Value : LSP.Structures.DidChangeWorkspaceFoldersParams); + overriding procedure On_Completion_Request + (Self : in out Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CompletionParams); + end LSP.Ada_Handlers; diff --git a/source/ada/lsp-common.adb b/source/ada/lsp-common.adb index b16b5cebb..121bbec0c 100644 --- a/source/ada/lsp-common.adb +++ b/source/ada/lsp-common.adb @@ -48,43 +48,6 @@ package body LSP.Common is end if; end Log; - ---------------- - -- Get_Output -- - ---------------- - - function Get_Output - (Exe : Virtual_File; - Args : GNAT.OS_Lib.Argument_List) return String - is - begin - if Exe = No_File then - return ""; - end if; - - declare - Fd : aliased GNAT.Expect.TTY.TTY_Process_Descriptor; - begin - GNAT.Expect.Non_Blocking_Spawn - (Descriptor => Fd, - Command => Exe.Display_Full_Name, - Buffer_Size => 0, - Args => Args, - Err_To_Out => True); - declare - S : constant String := - GNATCOLL.Utils.Get_Command_Output (Fd'Access); - begin - GNAT.Expect.TTY.Close (Fd); - - return S; - end; - exception - when GNAT.Expect.Process_Died => - GNAT.Expect.TTY.Close (Fd); - return ""; - end; - end Get_Output; - ---------------------- -- Is_Ada_Separator -- ---------------------- diff --git a/source/ada/lsp-common.ads b/source/ada/lsp-common.ads index ad7c3fa66..b4015d722 100644 --- a/source/ada/lsp-common.ads +++ b/source/ada/lsp-common.ads @@ -65,11 +65,6 @@ package LSP.Common is Message : String := ""); -- Log an exception in the given traces, with an optional message - function Get_Output - (Exe : Virtual_File; - Args : GNAT.OS_Lib.Argument_List) return String; - -- Run the given command line and return the output. - function Is_Ada_Separator (Item : VSS.Characters.Virtual_Character) return Boolean; -- Return True when given character belongs to 'separator' category, diff --git a/source/ada/lsp-lal_utils.adb b/source/ada/lsp-lal_utils.adb index 5ce58bf40..3c23a2f82 100644 --- a/source/ada/lsp-lal_utils.adb +++ b/source/ada/lsp-lal_utils.adb @@ -344,53 +344,6 @@ package body LSP.Lal_Utils is return LSP.Messages.A_Null; end Get_Decl_Kind; - ------------------- - -- Get_Call_Expr -- - ------------------- - - function Get_Call_Expr - (Node : Libadalang.Analysis.Ada_Node'Class) - return Libadalang.Analysis.Call_Expr - is - Cur_Node : Ada_Node := Node.As_Ada_Node; - begin - if not Cur_Node.Is_Null - and then Cur_Node.Kind in Ada_Error_Stmt_Range - then - -- In case of Error_Stmt, find the nearest previous sibling - -- which is not also an Error_Stmt - while not Cur_Node.Is_Null - and then Cur_Node.Kind in Ada_Error_Stmt_Range - loop - Cur_Node := Cur_Node.Previous_Sibling; - end loop; - - -- Find the nearest Call_Expr node in the children - if not Cur_Node.Is_Null then - for Child_Node of Cur_Node.Children loop - if Child_Node.Kind in Ada_Call_Expr_Range then - Cur_Node := Child_Node; - exit; - end if; - end loop; - end if; - end if; - - -- Find the nearest Call_Expr node in the parents or itself - while not Cur_Node.Is_Null loop - exit when Cur_Node.Kind in Ada_Call_Expr_Range; - - Cur_Node := Cur_Node.Parent; - end loop; - - -- At this point we have null or a Call_Expr - if Cur_Node.Is_Null then - return No_Call_Expr; - else - return Cur_Node.As_Call_Expr; - end if; - end Get_Call_Expr; - ------------------ -- Get_Location -- ------------------ @@ -722,26 +675,6 @@ package body LSP.Lal_Utils is end return; end To_Workspace_Edit; - ------------------ - -- Canonicalize -- - ------------------ - - function Canonicalize - (Text : VSS.Strings.Virtual_String) return VSS.Strings.Virtual_String - is - UTF_32 : constant Wide_Wide_String := - VSS.Strings.Conversions.To_Wide_Wide_String (Text); - Result : constant Symbolization_Result := - Libadalang.Sources.Canonicalize (UTF_32); - - begin - if Result.Success then - return LSP.Lal_Utils.To_Virtual_String (Result.Symbol); - else - return VSS.Strings.Empty_Virtual_String; - end if; - end Canonicalize; - ----------------------- -- Containing_Entity -- ----------------------- @@ -995,37 +928,6 @@ package body LSP.Lal_Utils is (Ada.Strings.Wide_Wide_Unbounded.To_Wide_Wide_String (Item)); end To_Virtual_String; - ------------------------- - -- Node_Location_Image -- - ------------------------- - - function Node_Location_Image - (Node : Libadalang.Analysis.Ada_Node'Class) - return VSS.Strings.Virtual_String - is - Decl_Unit_File : constant GNATCOLL.VFS.Virtual_File := - GNATCOLL.VFS.Create_From_UTF8 (Node.Unit.Get_Filename); - - begin - return Result : VSS.Strings.Virtual_String do - Result.Append ("at "); - Result.Append - (VSS.Strings.Conversions.To_Virtual_String - (Decl_Unit_File.Display_Base_Name)); - Result.Append (" ("); - Result.Append - (VSS.Strings.Conversions.To_Virtual_String - (GNATCOLL.Utils.Image - (Integer (Node.Sloc_Range.Start_Line), Min_Width => 1))); - Result.Append (':'); - Result.Append - (VSS.Strings.Conversions.To_Virtual_String - (GNATCOLL.Utils.Image - (Integer (Node.Sloc_Range.Start_Column), Min_Width => 1))); - Result.Append (')'); - end return; - end Node_Location_Image; - ------------- -- Is_Task -- ------------- diff --git a/source/ada/lsp-lal_utils.ads b/source/ada/lsp-lal_utils.ads index 70c0e487a..c7dce3f93 100644 --- a/source/ada/lsp-lal_utils.ads +++ b/source/ada/lsp-lal_utils.ads @@ -190,11 +190,6 @@ package LSP.Lal_Utils is -- TODO: Reactivate these lines when libadalang supports -- P_Next_Part for tasks: T716-049 - function Canonicalize - (Text : VSS.Strings.Virtual_String) return VSS.Strings.Virtual_String; - -- Return a canonicalized value for Text. This performs case folding and - -- brackets decoding. - function Get_Decl_Kind (Node : Libadalang.Analysis.Basic_Decl; Ignore_Local : Boolean := False) @@ -203,12 +198,6 @@ package LSP.Lal_Utils is -- When Ignore_Local it will return Is_Null for all local objects like -- variables. - function Get_Call_Expr - (Node : Libadalang.Analysis.Ada_Node'Class) - return Libadalang.Analysis.Call_Expr; - -- From Node try to find a Call_Expr node, it will handle basic error - -- recovery. - function To_Call_Hierarchy_Item (Name : Libadalang.Analysis.Defining_Name) return LSP.Messages.CallHierarchyItem; @@ -224,11 +213,6 @@ package LSP.Lal_Utils is -- corresponding CallHierarchyItem and its associated spans, which contains -- the references. This should be used for the callHierarchy requests. - function Node_Location_Image - (Node : Libadalang.Analysis.Ada_Node'Class) - return VSS.Strings.Virtual_String; - -- Return "file.adb:line:col" as a string - function Containing_Entity (Ref : Ada_Node; Canonical : Boolean := True) return Defining_Name; diff --git a/source/ada/lsp-predefined_completion.adb b/source/ada/lsp-predefined_completion.adb index 1549f1c9f..c674ac05b 100644 --- a/source/ada/lsp-predefined_completion.adb +++ b/source/ada/lsp-predefined_completion.adb @@ -16,12 +16,17 @@ ------------------------------------------------------------------------------ with Ada.Strings.Fixed; use Ada.Strings.Fixed; + +with GNAT.Expect.TTY; +with GNAT.OS_Lib; + with GNATCOLL.JSON; use GNATCOLL.JSON; with GNATCOLL.VFS; use GNATCOLL.VFS; +with GNATCOLL.Utils; with VSS.Strings.Conversions; -with LSP.Common; +with LSP.Enumerations; with LSP.Predefined_Completion.Ada2012; package body LSP.Predefined_Completion is @@ -44,6 +49,11 @@ package body LSP.Predefined_Completion is -- Filter all the given items using Prefix (i.e: remove the items that -- don't match with Prefix). + function Get_Output + (Exe : Virtual_File; + Args : GNAT.OS_Lib.Argument_List) return String; + -- Run the given command line and return the output. + --------------------------- -- Load_Predefined_Items -- --------------------------- @@ -76,17 +86,16 @@ package body LSP.Predefined_Completion is VSS.Strings.Conversions.To_Virtual_String (String'(Value.Get ("_name"))); Item.detail := - (True, - VSS.Strings.Conversions.To_Virtual_String + (VSS.Strings.Conversions.To_Virtual_String (String'(Value.Get ("_origin")))); Item.documentation := (Is_Set => True, - Value => String_Or_MarkupContent' - (Is_String => True, - String => + Value => Virtual_String_Or_MarkupContent' + (Is_Virtual_String => True, + Virtual_String => VSS.Strings.Conversions.To_Virtual_String (String'(Value.Get ("DOC"))))); - Item.kind := (True, Text); + Item.kind := (Is_Set => True, Value => LSP.Enumerations.Text); Items.Append (Item); end Load_Item; @@ -156,7 +165,7 @@ package body LSP.Predefined_Completion is if GNATmake_Exe /= No_File then declare GNATmake_Help_Arg : aliased String := "--help"; - GNATmake_Help : constant String := LSP.Common.Get_Output + GNATmake_Help : constant String := Get_Output (Exe => GNATmake_Exe, Args => (1 => GNATmake_Help_Arg'Unrestricted_Access)); begin @@ -231,4 +240,41 @@ package body LSP.Predefined_Completion is Filter_Items (Prefix => Prefix, Items => Pragmas, Result => Result); end Get_Pragmas; + ---------------- + -- Get_Output -- + ---------------- + + function Get_Output + (Exe : Virtual_File; + Args : GNAT.OS_Lib.Argument_List) return String + is + begin + if Exe = No_File then + return ""; + end if; + + declare + Fd : aliased GNAT.Expect.TTY.TTY_Process_Descriptor; + begin + GNAT.Expect.Non_Blocking_Spawn + (Descriptor => Fd, + Command => Exe.Display_Full_Name, + Buffer_Size => 0, + Args => Args, + Err_To_Out => True); + declare + S : constant String := + GNATCOLL.Utils.Get_Command_Output (Fd'Access); + begin + GNAT.Expect.TTY.Close (Fd); + + return S; + end; + exception + when GNAT.Expect.Process_Died => + GNAT.Expect.TTY.Close (Fd); + return ""; + end; + end Get_Output; + end LSP.Predefined_Completion; diff --git a/source/ada/lsp-predefined_completion.ads b/source/ada/lsp-predefined_completion.ads index 9d7db6a22..65c5960f4 100644 --- a/source/ada/lsp-predefined_completion.ads +++ b/source/ada/lsp-predefined_completion.ads @@ -19,7 +19,7 @@ with GNATCOLL.Traces; use GNATCOLL.Traces; with VSS.Strings; -with LSP.Messages; use LSP.Messages; +with LSP.Structures; use LSP.Structures; package LSP.Predefined_Completion is diff --git a/source/ada/lsp-utils.adb b/source/ada/lsp-utils.adb new file mode 100644 index 000000000..f8db6c30f --- /dev/null +++ b/source/ada/lsp-utils.adb @@ -0,0 +1,83 @@ +------------------------------------------------------------------------------ +-- Language Server Protocol -- +-- -- +-- Copyright (C) 2023, AdaCore -- +-- -- +-- This is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 3, or (at your option) any later ver- -- +-- sion. This software is distributed in the hope that it will be useful, -- +-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- -- +-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -- +-- License for more details. You should have received a copy of the GNU -- +-- General Public License distributed with this software; see file -- +-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy -- +-- of the license. -- +------------------------------------------------------------------------------ +-- +-- This package provides some utility subprograms. + +with GNATCOLL.VFS; +with GNATCOLL.Utils; + +with VSS.Strings.Conversions; + +with Libadalang.Sources; +with Langkit_Support.Symbols; + +package body LSP.Utils is + + ------------------ + -- Canonicalize -- + ------------------ + + function Canonicalize + (Text : VSS.Strings.Virtual_String) return VSS.Strings.Virtual_String + is + use Langkit_Support.Symbols; + + UTF_32 : constant Wide_Wide_String := + VSS.Strings.Conversions.To_Wide_Wide_String (Text); + Result : constant Symbolization_Result := + Libadalang.Sources.Canonicalize (UTF_32); + + begin + if Result.Success then + return VSS.Strings.To_Virtual_String (Result.Symbol); + else + return VSS.Strings.Empty_Virtual_String; + end if; + end Canonicalize; + + ------------------------- + -- Node_Location_Image -- + ------------------------- + + function Node_Location_Image + (Node : Libadalang.Analysis.Ada_Node'Class) + return VSS.Strings.Virtual_String + is + Decl_Unit_File : constant GNATCOLL.VFS.Virtual_File := + GNATCOLL.VFS.Create_From_UTF8 (Node.Unit.Get_Filename); + + begin + return Result : VSS.Strings.Virtual_String do + Result.Append ("at "); + Result.Append + (VSS.Strings.Conversions.To_Virtual_String + (Decl_Unit_File.Display_Base_Name)); + Result.Append (" ("); + Result.Append + (VSS.Strings.Conversions.To_Virtual_String + (GNATCOLL.Utils.Image + (Integer (Node.Sloc_Range.Start_Line), Min_Width => 1))); + Result.Append (':'); + Result.Append + (VSS.Strings.Conversions.To_Virtual_String + (GNATCOLL.Utils.Image + (Integer (Node.Sloc_Range.Start_Column), Min_Width => 1))); + Result.Append (')'); + end return; + end Node_Location_Image; + +end LSP.Utils; diff --git a/source/ada/lsp-utils.ads b/source/ada/lsp-utils.ads new file mode 100644 index 000000000..d1c8946db --- /dev/null +++ b/source/ada/lsp-utils.ads @@ -0,0 +1,36 @@ +------------------------------------------------------------------------------ +-- Language Server Protocol -- +-- -- +-- Copyright (C) 2023, AdaCore -- +-- -- +-- This is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 3, or (at your option) any later ver- -- +-- sion. This software is distributed in the hope that it will be useful, -- +-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- -- +-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -- +-- License for more details. You should have received a copy of the GNU -- +-- General Public License distributed with this software; see file -- +-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy -- +-- of the license. -- +------------------------------------------------------------------------------ +-- +-- This package provides some utility subprograms. + +with VSS.Strings; + +with Libadalang.Analysis; + +package LSP.Utils is + + function Canonicalize + (Text : VSS.Strings.Virtual_String) return VSS.Strings.Virtual_String; + -- Return a canonicalized value for Text. This performs case folding and + -- brackets decoding. + + function Node_Location_Image + (Node : Libadalang.Analysis.Ada_Node'Class) + return VSS.Strings.Virtual_String; + -- Return "file.adb:line:col" as a string + +end LSP.Utils; diff --git a/source/lsp_3.17/lsp-structures-unwrap.ads b/source/lsp_3.17/lsp-structures-unwrap.ads index 5b5dc204a..747aa69d6 100644 --- a/source/lsp_3.17/lsp-structures-unwrap.ads +++ b/source/lsp_3.17/lsp-structures-unwrap.ads @@ -4,6 +4,8 @@ -- SPDX-License-Identifier: Apache-2.0 -- +with VSS.String_Vectors; + package LSP.Structures.Unwrap is pragma Preelaborate; @@ -15,4 +17,23 @@ package LSP.Structures.Unwrap is return Boolean_Optional is (if X.Is_Set then X.Value.lineFoldingOnly else (Is_Set => False)); + function completion (X : TextDocumentClientCapabilities_Optional) + return CompletionClientCapabilities_Optional is + (if X.Is_Set then X.Value.completion else (Is_Set => False)); + + function completionItem (X : CompletionClientCapabilities_Optional) + return completionItem_OfCompletionClientCapabilities_Optional is + (if X.Is_Set then X.Value.completionItem else (Is_Set => False)); + + function resolveSupport + (X : completionItem_OfCompletionClientCapabilities_Optional) + return resolveSupport_OfWorkspaceSymbolClientCapabilities_Optional is + (if X.Is_Set then X.Value.resolveSupport else (Is_Set => False)); + + function properties + (X : resolveSupport_OfWorkspaceSymbolClientCapabilities_Optional) + return LSP.Structures.Virtual_String_Vector is + (if X.Is_Set then X.Value.properties + else VSS.String_Vectors.Empty_Virtual_String_Vector); + end LSP.Structures.Unwrap; From 4b30b180ed21a8902ca15d0e6f74ef7cbbbb48a8 Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Mon, 21 Aug 2023 11:50:40 +0300 Subject: [PATCH 040/152] Add `declaration` request handler. Refs #1170 --- source/ada/lsp-ada_client_capabilities.adb | 1 + source/ada/lsp-ada_handlers-locations.adb | 67 +++++ source/ada/lsp-ada_handlers-locations.ads | 31 +++ source/ada/lsp-ada_handlers.adb | 244 +++++++++++++----- source/ada/lsp-ada_handlers.ads | 18 ++ source/lsp_3.17/lsp-constants.ads | 8 + .../ada_lsp/declaration/declaration.json | 8 +- testsuite/ada_lsp/declaration/test.yaml | 3 - 8 files changed, 303 insertions(+), 77 deletions(-) diff --git a/source/ada/lsp-ada_client_capabilities.adb b/source/ada/lsp-ada_client_capabilities.adb index 9aee60357..816011ea9 100644 --- a/source/ada/lsp-ada_client_capabilities.adb +++ b/source/ada/lsp-ada_client_capabilities.adb @@ -85,6 +85,7 @@ package body LSP.Ada_Client_Capabilities is resolveProvider => LSP.Constants.True, others => <>)); + Result.declarationProvider := LSP.Constants.True; Result.definitionProvider := LSP.Constants.True; Result.foldingRangeProvider := LSP.Constants.True; end return; diff --git a/source/ada/lsp-ada_handlers-locations.adb b/source/ada/lsp-ada_handlers-locations.adb index d11bd99ff..d448e73bb 100644 --- a/source/ada/lsp-ada_handlers-locations.adb +++ b/source/ada/lsp-ada_handlers-locations.adb @@ -24,6 +24,73 @@ with URIs; package body LSP.Ada_Handlers.Locations is + --------------------- + -- Append_Location -- + --------------------- + + procedure Append_Location + (Self : in out Message_Handler; + Result : in out LSP.Structures.Location_Vector; + Node : Libadalang.Analysis.Ada_Node'Class; + Ignore : AlsReferenceKind_Array := Empty) is + begin + if not Node.Is_Synthetic then + Result.Append (To_LSP_Location (Self, Node)); + end if; + end Append_Location; + + ----------------- + -- Get_Node_At -- + ----------------- + + function Get_Node_At + (Self : in out Message_Handler'Class; + Context : LSP.Ada_Contexts.Context; + Value : LSP.Structures.TextDocumentPositionParams'Class) + return Libadalang.Analysis.Ada_Node + is + use type LSP.Ada_Documents.Document_Access; + + Document : constant LSP.Ada_Documents.Document_Access := + Self.Get_Open_Document (Value.textDocument.uri); + + begin + if Document /= null then + return Document.Get_Node_At (Context, Value.position); + end if; + + declare + File : constant GNATCOLL.VFS.Virtual_File := + Self.To_File (Value.textDocument.uri); + + Unit : constant Libadalang.Analysis.Analysis_Unit := + Context.Get_AU (File); + + Sloc : Langkit_Support.Slocs.Source_Location := + (Line => Langkit_Support.Slocs.Line_Number + (Value.position.line + 1), + Column => <>); + + Line : constant VSS.Strings.Virtual_String := + VSS.Strings.To_Virtual_String + (Unit.Get_Line (Value.position.line + 1)); + + Cursor : VSS.Strings.Character_Iterators.Character_Iterator := + Line.Before_First_Character; + begin + while Cursor.Forward and then + Value.position.character < Natural (Cursor.First_UTF16_Offset) + loop + null; -- Skip characters on the left of the `position.character` + end loop; + + Sloc.Column := Langkit_Support.Slocs.Column_Number + (Cursor.Character_Index); + + return Unit.Root.Lookup (Sloc); + end; + end Get_Node_At; + --------------------- -- To_LSP_Location -- --------------------- diff --git a/source/ada/lsp-ada_handlers-locations.ads b/source/ada/lsp-ada_handlers-locations.ads index 9671ad9cd..de87c052a 100644 --- a/source/ada/lsp-ada_handlers-locations.ads +++ b/source/ada/lsp-ada_handlers-locations.ads @@ -22,6 +22,8 @@ with Libadalang.Analysis; +with LSP.Ada_Contexts; + package LSP.Ada_Handlers.Locations is function To_LSP_Location @@ -30,4 +32,33 @@ package LSP.Ada_Handlers.Locations is return LSP.Structures.Location; -- Convert LAL's Node to a LSP location + function Get_Node_At + (Self : in out Message_Handler'Class; + Context : LSP.Ada_Contexts.Context; + Value : LSP.Structures.TextDocumentPositionParams'Class) + return Libadalang.Analysis.Ada_Node; + + type AlsReferenceKind is + (Simple, + Access_Ref, + Write, + Static_Call, + Dispatching_Call, + Parent, + Child, + Overriding_Decl); + -- This should be part of the protocol + + type AlsReferenceKind_Array is array (AlsReferenceKind) of Boolean; + + function Empty return AlsReferenceKind_Array is ([others => False]); + + procedure Append_Location + (Self : in out Message_Handler; + Result : in out LSP.Structures.Location_Vector; + Node : Libadalang.Analysis.Ada_Node'Class; + Ignore : AlsReferenceKind_Array := Empty); + -- Append given Node location to the Result. + -- Do nothing if the item inside of an synthetic file (like __standard). + end LSP.Ada_Handlers.Locations; diff --git a/source/ada/lsp-ada_handlers.adb b/source/ada/lsp-ada_handlers.adb index 908d38983..8b391bdf8 100644 --- a/source/ada/lsp-ada_handlers.adb +++ b/source/ada/lsp-ada_handlers.adb @@ -26,12 +26,8 @@ with Libadalang.Common; with Laltools.Common; -with VSS.Strings.Conversions; - with Langkit_Support.Slocs; -with URIs; - with LSP.Ada_Completions; with LSP.Ada_Completions.Aspects; with LSP.Ada_Completions.Attributes; @@ -57,36 +53,14 @@ package body LSP.Ada_Handlers is pragma Style_Checks ("o"); -- check subprogram bodies in alphabetical ordr - type AlsReferenceKind is - (Simple, - Access_Ref, - Write, - Static_Call, - Dispatching_Call, - Parent, - Child, - Overriding_Decl); - -- This should be part of the protocol - - pragma Unreferenced - (Simple, Access_Ref, Write, Static_Call, Dispatching_Call, - Overriding_Decl); - - type AlsReferenceKind_Array is array (AlsReferenceKind) of Boolean; - - function Empty return AlsReferenceKind_Array is ([others => False]); + subtype AlsReferenceKind_Array is + LSP.Ada_Handlers.Locations.AlsReferenceKind_Array; function Is_Parent return AlsReferenceKind_Array is - ([Parent => True, others => False]); + ([LSP.Ada_Handlers.Locations.Parent => True, others => False]); function Is_Child return AlsReferenceKind_Array is - ([Child => True, others => False]); - - procedure Append_Location - (Self : in out Message_Handler; - Result : in out LSP.Structures.Location_Vector; - Node : Libadalang.Analysis.Ada_Node'Class; - Ignore : AlsReferenceKind_Array := Empty); + ([LSP.Ada_Handlers.Locations.Child => True, others => False]); function Contexts_For_URI (Self : access Message_Handler; @@ -135,35 +109,19 @@ package body LSP.Ada_Handlers is Name : String); -- Save method in/out in a log file - function To_LSP_Location - (Self : in out Message_Handler'Class; - Node : Libadalang.Analysis.Ada_Node'Class) - return LSP.Structures.Location - renames LSP.Ada_Handlers.Locations.To_LSP_Location; - - function To_File - (Self : Message_Handler'Class; - URI : LSP.Structures.DocumentUri) return GNATCOLL.VFS.Virtual_File - is - (GNATCOLL.VFS.Create_From_UTF8 - (URIs.Conversions.To_File - (VSS.Strings.Conversions.To_UTF_8_String (URI), - Normalize => Self.Configuration.Follow_Symlinks))); - - --------------------- - -- Append_Location -- - --------------------- + function Get_Node_At + (Self : in out Message_Handler'Class; + Context : LSP.Ada_Contexts.Context; + Value : LSP.Structures.TextDocumentPositionParams'Class) + return Libadalang.Analysis.Ada_Node + renames LSP.Ada_Handlers.Locations.Get_Node_At; procedure Append_Location (Self : in out Message_Handler; Result : in out LSP.Structures.Location_Vector; Node : Libadalang.Analysis.Ada_Node'Class; - Ignore : AlsReferenceKind_Array := Empty) is - begin - if not Node.Is_Synthetic then - Result.Append (Self.To_LSP_Location (Node)); - end if; - end Append_Location; + Ignore : AlsReferenceKind_Array := LSP.Ada_Handlers.Locations.Empty) + renames LSP.Ada_Handlers.Locations.Append_Location; ----------------------- -- Clean_Diagnostics -- @@ -391,6 +349,159 @@ package body LSP.Ada_Handlers is Self.Sender.On_Completion_Response (Id, Response); end On_Completion_Request; + ---------------------------- + -- On_Declaration_Request -- + ---------------------------- + + overriding procedure On_Declaration_Request + (Self : in out Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DeclarationParams) + is + use Libadalang.Analysis; + use all type LSP.Ada_Configurations. + DisplayMethodAncestryOnNavigationPolicy; + + procedure Resolve_In_Context (C : LSP.Ada_Context_Sets.Context_Access); + -- Utility function, appends to Vector all results of the + -- declaration requests found in context C. + + Response : LSP.Structures.Declaration_Result (LSP.Structures.Varian_1); + Vector : LSP.Structures.Location_Vector renames Response.Varian_1; + + Display_Method_Policy : constant + LSP.Ada_Configurations.DisplayMethodAncestryOnNavigationPolicy := + Self.Configuration.Display_Method_Ancestry_Policy; + + ------------------------ + -- Resolve_In_Context -- + ------------------------ + + procedure Resolve_In_Context (C : LSP.Ada_Context_Sets.Context_Access) is + Trace : constant GNATCOLL.Traces.Trace_Handle := + LSP.GNATCOLL_Tracers.Handle (Self.Tracer.all); + + Name_Node : constant Name := + Laltools.Common.Get_Node_As_Name (Self.Get_Node_At (C.all, Value)); + + Definition : Libadalang.Analysis.Defining_Name; + -- A defining name that corresponds to Name_Node + First_Part : Libadalang.Analysis.Defining_Name; + -- "Canonical part" of Definition + Prev_Part : Libadalang.Analysis.Defining_Name; + -- A previous name for Definition + Decl_For_Find_Overrides : Libadalang.Analysis.Basic_Decl := + Libadalang.Analysis.No_Basic_Decl; + + On_Defining_Name : Boolean := False; + -- Set to True if we are on a denfining name node + + Is_Imprecise : Boolean; + begin + if Name_Node.Is_Null then + return; + end if; + + -- Check if we are on some defining name + Definition := Laltools.Common.Get_Name_As_Defining (Name_Node); + + if Definition.Is_Null then + -- If we aren't on a defining_name already then try to resolve + Definition := Laltools.Common.Resolve_Name + (Name_Node, Trace, Is_Imprecise); + else + On_Defining_Name := True; + end if; + + if Definition.Is_Null then + return; -- Name resolution fails, nothing to do. + end if; + + -- Display the method ancestry in three cases: + -- + -- . When the preference is set to Always + -- + -- . When we are on a usage node (e.g: subprogram call) and if the + -- preference is set to Usage_And_Abstract_Only + -- + -- . When we are on a defining name node and if the preference is + -- set to Definition_Only + + if Display_Method_Policy = Always + or else (Display_Method_Policy = Usage_And_Abstract_Only + and then not On_Defining_Name) + or else (Display_Method_Policy = Definition_Only + and then On_Defining_Name) + then + First_Part := Laltools.Common.Find_Canonical_Part (Definition, Trace); + + if First_Part.Is_Null then + Decl_For_Find_Overrides := Definition.P_Basic_Decl; + else + Decl_For_Find_Overrides := First_Part.P_Basic_Decl; + end if; + end if; + + begin + Prev_Part := Definition.P_Previous_Part; + exception + when E : Libadalang.Common.Property_Error => + Self.Tracer.Trace_Exception (E); + Prev_Part := Libadalang.Analysis.No_Defining_Name; + end; + + if not Prev_Part.Is_Null then + -- We have found previous part, return it. + Self.Append_Location (Vector, Prev_Part); + elsif not Definition.Is_Null then + -- No previous part, return definition itself. + Self.Append_Location (Vector, Definition); + end if; + + if not Decl_For_Find_Overrides.Is_Null then + declare + Overridings : constant Libadalang.Analysis.Basic_Decl_Array := + C.Find_All_Overrides + (Decl_For_Find_Overrides, + Imprecise_Results => Is_Imprecise); + + Bases : constant Libadalang.Analysis.Basic_Decl_Array := + C.Find_All_Base_Declarations + (Decl_For_Find_Overrides, + Imprecise_Results => Is_Imprecise); + begin + for Subp of Bases loop + Self.Append_Location + (Vector, Subp.P_Defining_Name, Is_Parent); + end loop; + + for Subp of Overridings loop + Self.Append_Location + (Vector, Subp.P_Defining_Name, Is_Child); + end loop; + end; + end if; + end Resolve_In_Context; + + begin + -- Override the displayMethodAncestryOnNavigation global configuration + -- flag if there is on embedded in the request. + -- if Value.alsDisplayMethodAncestryOnNavigation.Is_Set then + -- Display_Method_Ancestry_Policy := + -- Value.alsDisplayMethodAncestryOnNavigation.Value; + -- end if; + + for C of Self.Contexts_For_URI (Value.textDocument.uri) loop + Resolve_In_Context (C); + + exit when Self.Is_Canceled.all; + end loop; + + -- Sort_And_Remove_Duplicates (Response.result.Locations); + + Self.Sender.On_Declaration_Response (Id, Response); + end On_Declaration_Request; + --------------------------- -- On_Definition_Request -- --------------------------- @@ -416,11 +527,8 @@ package body LSP.Ada_Handlers is LSP.Ada_Configurations.DisplayMethodAncestryOnNavigationPolicy := Self.Configuration.Display_Method_Ancestry_Policy; - Document : constant LSP.Ada_Documents.Document_Access := - Self.Get_Open_Document (Value.textDocument.uri); - procedure Resolve_In_Context (C : LSP.Ada_Context_Sets.Context_Access); - -- Utility function, appends to Resonse.result all results of the + -- Utility function, appends to Vector all results of the -- definition requests found in context C. ------------------------ @@ -431,8 +539,7 @@ package body LSP.Ada_Handlers is use Libadalang.Common; Name_Node : constant Name := - Laltools.Common.Get_Node_As_Name - (Document.Get_Node_At (C.all, Value.position)); + Laltools.Common.Get_Node_As_Name (Self.Get_Node_At (C.all, Value)); Definition : Defining_Name; Other_Part : Defining_Name; @@ -526,28 +633,25 @@ package body LSP.Ada_Handlers is if not Decl_For_Find_Overrides.Is_Null then declare - Imprecise_Over : Boolean; - Imprecise_Base : Boolean; - Overriding_Subps : constant Basic_Decl_Array := + Overridings : constant Basic_Decl_Array := C.Find_All_Overrides (Decl_For_Find_Overrides, - Imprecise_Results => Imprecise_Over); - Base_Subps : constant Basic_Decl_Array := + Imprecise_Results => Imprecise); + + Bases : constant Basic_Decl_Array := C.Find_All_Base_Declarations (Decl_For_Find_Overrides, - Imprecise_Results => Imprecise_Base); + Imprecise_Results => Imprecise); begin - for Subp of Base_Subps loop + for Subp of Bases loop Self.Append_Location (Vector, Subp.P_Defining_Name, Is_Parent); end loop; - for Subp of Overriding_Subps loop + for Subp of Overridings loop Self.Append_Location (Vector, Subp.P_Defining_Name, Is_Child); end loop; - - Imprecise := Imprecise or Imprecise_Over or Imprecise_Base; end; end if; diff --git a/source/ada/lsp-ada_handlers.ads b/source/ada/lsp-ada_handlers.ads index 7658ddbe7..24254097e 100644 --- a/source/ada/lsp-ada_handlers.ads +++ b/source/ada/lsp-ada_handlers.ads @@ -25,6 +25,8 @@ with GNATCOLL.VFS; with GPR2.Project.Tree; +with VSS.Strings.Conversions; + with LSP.Ada_Client_Capabilities; with LSP.Ada_Configurations; with LSP.Ada_Context_Sets; @@ -40,6 +42,8 @@ with LSP.Structures; with LSP.Tracers; with LSP.Unimplemented_Handlers; +with URIs; + package LSP.Ada_Handlers is type Message_Handler @@ -208,6 +212,11 @@ private (Self : in out Message_Handler; Value : LSP.Server_Requests.Server_Request'Class); + overriding procedure On_Declaration_Request + (Self : in out Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DeclarationParams); + overriding procedure On_Definition_Request (Self : in out Message_Handler; Id : LSP.Structures.Integer_Or_Virtual_String; @@ -268,4 +277,13 @@ private Id : LSP.Structures.Integer_Or_Virtual_String; Value : LSP.Structures.CompletionParams); + function To_File + (Self : Message_Handler'Class; + URI : LSP.Structures.DocumentUri) return GNATCOLL.VFS.Virtual_File + is + (GNATCOLL.VFS.Create_From_UTF8 + (URIs.Conversions.To_File + (VSS.Strings.Conversions.To_UTF_8_String (URI), + Normalize => Self.Configuration.Follow_Symlinks))); + end LSP.Ada_Handlers; diff --git a/source/lsp_3.17/lsp-constants.ads b/source/lsp_3.17/lsp-constants.ads index 34b7c64ab..bd63bd568 100644 --- a/source/lsp_3.17/lsp-constants.ads +++ b/source/lsp_3.17/lsp-constants.ads @@ -23,6 +23,14 @@ package LSP.Constants is return LSP.Structures.foldingRangeProvider_OfServerCapabilities_Optional is (Is_Set => True, Value => True); + function True + return LSP.Structures.declarationProvider_OfServerCapabilities + is (Kind => LSP.Structures.Varian_1, Varian_1 => True); + + function True + return LSP.Structures.declarationProvider_OfServerCapabilities_Optional + is (Is_Set => True, Value => True); + function True return LSP.Structures.Boolean_Or_DefinitionOptions is (Is_Boolean => True, Boolean => True); diff --git a/testsuite/ada_lsp/declaration/declaration.json b/testsuite/ada_lsp/declaration/declaration.json index 00f5623b9..60b94568d 100644 --- a/testsuite/ada_lsp/declaration/declaration.json +++ b/testsuite/ada_lsp/declaration/declaration.json @@ -71,7 +71,7 @@ }, "wait":[{ "id": "defname-1", - "result":[{ + "result":{ "uri": "$URI{aaa.adb}", "range": { "start": { @@ -83,7 +83,7 @@ "character": 13 } } - }] + } }] } }, { @@ -104,12 +104,12 @@ }, "wait":[{ "id": "defname-2", - "result":[{ + "result":{ "range": { "start": {}, "end": {} } - }] + } }] } }, { diff --git a/testsuite/ada_lsp/declaration/test.yaml b/testsuite/ada_lsp/declaration/test.yaml index 4ef12f3f2..905cfa0a7 100644 --- a/testsuite/ada_lsp/declaration/test.yaml +++ b/testsuite/ada_lsp/declaration/test.yaml @@ -1,4 +1 @@ title: 'declaration' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] From 3444acb72adf99420c327c7aad4c4a12f49cd8dd Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Mon, 21 Aug 2023 14:16:05 +0300 Subject: [PATCH 041/152] Fix a completion test * Restore Write_Completions in lsp-ada_completions.adb * Restore Compute_Completion_Item in lsp-ada_documents.adb * Move Get_Decl_Kind to LSP.Utils * Restore LSP.Search.Start_Word * Rebase completion.keywords test Refs #1170 --- gnat/ignore_in_317.txt | 2 - source/ada/lsp-ada_completions.adb | 80 +++++- source/ada/lsp-ada_documents.adb | 248 ++++++++++++++++-- source/ada/lsp-ada_handlers.adb | 2 + source/ada/lsp-lal_utils.adb | 99 ------- source/ada/lsp-lal_utils.ads | 8 - ...ord_text.adb => lsp-search-start_word.adb} | 41 +-- ...ord_text.ads => lsp-search-start_word.ads} | 16 +- source/ada/lsp-search.adb | 14 +- source/ada/lsp-utils.adb | 108 +++++++- source/ada/lsp-utils.ads | 10 + .../ada_lsp/completion.keywords/test.json | 29 -- .../ada_lsp/completion.keywords/test.yaml | 3 - 13 files changed, 454 insertions(+), 206 deletions(-) rename source/ada/{lsp-search-start_word_text.adb => lsp-search-start_word.adb} (65%) rename source/ada/{lsp-search-start_word_text.ads => lsp-search-start_word.ads} (78%) diff --git a/gnat/ignore_in_317.txt b/gnat/ignore_in_317.txt index c662e8f54..c4e9e9059 100644 --- a/gnat/ignore_in_317.txt +++ b/gnat/ignore_in_317.txt @@ -54,8 +54,6 @@ lsp-search-fuzzy.adb lsp-search-fuzzy.ads lsp-search-regexp.adb lsp-search-regexp.ads -lsp-search-start_word_text.adb -lsp-search-start_word_text.ads lsp-file_monitors.ads lsp-message_loggers.adb lsp-message_loggers.ads diff --git a/source/ada/lsp-ada_completions.adb b/source/ada/lsp-ada_completions.adb index e1068bed5..db11c7e49 100644 --- a/source/ada/lsp-ada_completions.adb +++ b/source/ada/lsp-ada_completions.adb @@ -15,6 +15,13 @@ -- of the license. -- ------------------------------------------------------------------------------ +with Ada.Containers.Hashed_Sets; + +with VSS.Strings.Hash; + +with LSP.Ada_Documents; +with LSP.Utils; + package body LSP.Ada_Completions is pragma Warnings (Off); @@ -75,17 +82,74 @@ package body LSP.Ada_Completions is ----------------------- procedure Write_Completions - (Context : LSP.Ada_Contexts.Context; - Document : LSP.Ada_Documents.Document; - Sloc : Langkit_Support.Slocs.Source_Location; - Node : Libadalang.Analysis.Ada_Node; Names : Completion_Maps.Map; - Named_Notation_Threshold : Natural; Compute_Doc_And_Details : Boolean; + (Context : LSP.Ada_Contexts.Context; + Document : LSP.Ada_Documents.Document; + Sloc : Langkit_Support.Slocs.Source_Location; + Node : Libadalang.Analysis.Ada_Node; + Names : Completion_Maps.Map; + Named_Notation_Threshold : Natural; + Compute_Doc_And_Details : Boolean; Result : in out LSP.Structures.CompletionItem_Vector) is + package String_Sets is new Ada.Containers.Hashed_Sets + (VSS.Strings.Virtual_String, + VSS.Strings.Hash, + VSS.Strings."=", + VSS.Strings."="); + + Seen : String_Sets.Set; + -- Set of found visible names in canonical form + Length : constant Natural := Natural (Names.Length); begin - pragma Compile_Time_Warning - (Standard.True, "Write_Completions unimplemented"); - raise Program_Error with "Unimplemented procedure Write_Completions"; + + -- Write Result in two pases. Firstly append all visible names and + -- populate Seen set. Then append invisible names not in Seen. + + for Visible in reverse Boolean loop -- Phase: True then False + for Cursor in Names.Iterate loop + declare + Append : Boolean := False; + Info : constant Name_Information := Names (Cursor); + Name : constant Libadalang.Analysis.Defining_Name := + Completion_Maps.Key (Cursor); + Selector : constant Libadalang.Analysis.Name := + Name.P_Relative_Name; + Label : VSS.Strings.Virtual_String; + Canonical : VSS.Strings.Virtual_String; + begin + if Visible and Info.Is_Visible then + Label := VSS.Strings.To_Virtual_String (Selector.Text); + Canonical := LSP.Utils.Canonicalize (Label); + Seen.Include (Canonical); + Append := True; + elsif not Visible and not Info.Is_Visible then + -- Append invisible name on if no such visible name found + Label := VSS.Strings.To_Virtual_String (Selector.Text); + Canonical := LSP.Utils.Canonicalize (Label); + Append := not Seen.Contains (Canonical); + end if; + + if Append then + Result.Append + (LSP.Ada_Documents.Compute_Completion_Item + (Document => Document, + Context => Context, + Sloc => Sloc, + Node => Node, + BD => Name.P_Basic_Decl, + Label => Label, + Use_Snippets => Info.Use_Snippets, + Compute_Doc_And_Details => Compute_Doc_And_Details, + Named_Notation_Threshold => Named_Notation_Threshold, + Is_Dot_Call => Info.Is_Dot_Call, + Is_Visible => Info.Is_Visible, + Pos => Info.Pos, + Weight => Info.Weight, + Completions_Count => Length)); + end if; + end; + end loop; + end loop; end Write_Completions; -------------------------- diff --git a/source/ada/lsp-ada_documents.adb b/source/ada/lsp-ada_documents.adb index 6851564da..b712ec76e 100644 --- a/source/ada/lsp-ada_documents.adb +++ b/source/ada/lsp-ada_documents.adb @@ -19,6 +19,8 @@ with Ada.Characters.Wide_Wide_Latin_1; with Ada.Tags; with Ada.Unchecked_Deallocation; +with GNATCOLL.Utils; + with Langkit_Support.Symbols; with Langkit_Support.Text; @@ -33,7 +35,10 @@ with VSS.Characters; with VSS.Strings.Character_Iterators; with VSS.Strings.Conversions; with VSS.Strings.Cursors; +with VSS.Strings.Formatters.Integers; +with VSS.Strings.Formatters.Strings; with VSS.Strings.Line_Iterators; +with VSS.Strings.Templates; with VSS.Unicode; with LSP.Ada_Completions.Filters; @@ -42,10 +47,13 @@ with LSP.Ada_Documents.LAL_Diagnostics; with LSP.Ada_Id_Iterators; with LSP.Enumerations; with LSP.Predicates; +with LSP.Utils; package body LSP.Ada_Documents is pragma Warnings (Off); + package Utils renames Standard.Utils; + LSP_New_Line_Function_Set : constant VSS.Strings.Line_Terminator_Set := (VSS.Strings.CR | VSS.Strings.CRLF | VSS.Strings.LF => True, others => False); @@ -70,6 +78,26 @@ package body LSP.Ada_Documents is From : out VSS.Strings.Markers.Character_Marker; To : out VSS.Strings.Markers.Character_Marker); + function To_Completion_Kind (K : LSP.Enumerations.SymbolKind) + return LSP.Enumerations.CompletionItemKind + is + (case K is + when LSP.Enumerations.A_Function => LSP.Enumerations.A_Function, + when LSP.Enumerations.Field => LSP.Enumerations.Field, + when LSP.Enumerations.Variable => LSP.Enumerations.Variable, + when LSP.Enumerations.A_Package => LSP.Enumerations.Module, + when LSP.Enumerations.Module => LSP.Enumerations.Module, + when LSP.Enumerations.Class => LSP.Enumerations.Class, + when LSP.Enumerations.Struct => LSP.Enumerations.Class, + when LSP.Enumerations.Number => LSP.Enumerations.Value, + when LSP.Enumerations.Enum => LSP.Enumerations.Enum, + when LSP.Enumerations.String => LSP.Enumerations.Value, + when LSP.Enumerations.A_Constant => LSP.Enumerations.Value, + when others => LSP.Enumerations.Reference); + -- Convert a SymbolKind to a CompletionItemKind. + -- TODO: It might be better to have a unified kind, and then convert to + -- specific kind types, but for the moment this is good enough. + ------------------- -- Apply_Changes -- ------------------- @@ -180,22 +208,213 @@ package body LSP.Ada_Documents is ----------------------------- function Compute_Completion_Item - (Document : LSP.Ada_Documents.Document; - Context : LSP.Ada_Contexts.Context; - Sloc : Langkit_Support.Slocs.Source_Location; - Node : Libadalang.Analysis.Ada_Node; BD : Libadalang.Analysis.Basic_Decl; - Label : VSS.Strings.Virtual_String; Use_Snippets : Boolean; - Compute_Doc_And_Details : Boolean; Named_Notation_Threshold : Natural; - Is_Dot_Call : Boolean; Is_Visible : Boolean; Pos : Integer; - Weight : Ada_Completions.Completion_Item_Weight_Type; - Completions_Count : Natural) return LSP.Structures.CompletionItem + (Document : LSP.Ada_Documents.Document; + Context : LSP.Ada_Contexts.Context; + Sloc : Langkit_Support.Slocs.Source_Location; + Node : Libadalang.Analysis.Ada_Node; + BD : Libadalang.Analysis.Basic_Decl; + Label : VSS.Strings.Virtual_String; + Use_Snippets : Boolean; + Compute_Doc_And_Details : Boolean; + Named_Notation_Threshold : Natural; + Is_Dot_Call : Boolean; + Is_Visible : Boolean; + Pos : Integer; + Weight : Ada_Completions.Completion_Item_Weight_Type; + Completions_Count : Natural) return LSP.Structures.CompletionItem is + + package Weight_Formatters renames VSS.Strings.Formatters.Integers; + + Item : LSP.Structures.CompletionItem; + Subp_Spec_Node : Libadalang.Analysis.Base_Subp_Spec; + Min_Width : constant Natural := Completions_Count'Image'Length - 1; + -- The -1 remove the whitespace added by 'Image + + Last_Weight : constant Ada_Completions.Completion_Item_Weight_Type := + Ada_Completions.Completion_Item_Weight_Type'Last; + + function Get_Sort_Text + (Base_Label : VSS.Strings.Virtual_String) + return VSS.Strings.Virtual_String; + -- Return a suitable sortText according to the completion item's + -- visibility and position in the completion list. + + ------------------- + -- Get_Sort_Text -- + ------------------- + + function Get_Sort_Text + (Base_Label : VSS.Strings.Virtual_String) + return VSS.Strings.Virtual_String + is + use VSS.Strings; + begin + return Sort_Text : VSS.Strings.Virtual_String do + + Sort_Text := VSS.Strings.Templates.Format + ("{:02}&{:05}{}", + Weight_Formatters.Image (Last_Weight - Weight), + Weight_Formatters.Image (Pos), + VSS.Strings.Formatters.Strings.Image (Base_Label)); + + if not Is_Visible then + Sort_Text.Prepend ('~'); + end if; + end return; + end Get_Sort_Text; + begin - pragma Compile_Time_Warning - (Standard.True, "Compute_Completion_Item unimplemented"); - return - raise Program_Error - with "Unimplemented function Compute_Completion_Item"; + Item.label := Label; + Item.kind := (True, To_Completion_Kind (LSP.Utils.Get_Decl_Kind (BD))); + + if not Is_Visible then + Item.insertText := Label; + Item.label.Append (" (invisible)"); + Item.filterText := Label; + end if; + + Item.sortText := Get_Sort_Text (Label); + + Set_Completion_Item_Documentation + (Context => Context, + BD => BD, + Item => Item, + Compute_Doc_And_Details => Compute_Doc_And_Details); + + -- Return immediately if we should not use snippets (e.g: completion for + -- invisible symbols). + if not Use_Snippets then + return Item; + end if; + + -- Check if we are dealing with a subprogram and return a completion + -- snippet that lists all the formal parameters if it's the case. + + Subp_Spec_Node := BD.P_Subp_Spec_Or_Null; + + if Subp_Spec_Node.Is_Null then + return Item; + end if; + + declare + Insert_Text : VSS.Strings.Virtual_String := Label; + All_Params : constant Libadalang.Analysis.Param_Spec_Array := + Subp_Spec_Node.P_Params; + + Params : constant Libadalang.Analysis.Param_Spec_Array := + (if Is_Dot_Call then + All_Params (All_Params'First + 1 .. All_Params'Last) + else + All_Params); + -- Remove the first formal parameter from the list when the dotted + -- notation is used. + + Idx : Positive := 1; + Nb_Params : Natural := 0; + Use_Named_Notation : Boolean := False; + begin + + -- Create a completion snippet if the subprogram expects some + -- parameters. + + if Params'Length /= 0 then + Item.insertTextFormat := + (Is_Set => True, + Value => LSP.Enumerations.Snippet); + + Insert_Text.Append (" ("); + + -- Compute number of params to know if named notation should be + -- used. + + for Param of Params loop + Nb_Params := Nb_Params + Param.F_Ids.Children_Count; + end loop; + + Use_Named_Notation := Named_Notation_Threshold > 0 + and then Nb_Params >= Named_Notation_Threshold; + + for Param of Params loop + for Id of Param.F_Ids loop + declare + Mode : constant Langkit_Support.Text.Text_Type := + Param.F_Mode.Text; + + begin + if Use_Named_Notation then + Insert_Text.Append + (VSS.Strings.To_Virtual_String (Id.Text)); + Insert_Text.Append (" => "); + Insert_Text.Append ("${"); + Insert_Text.Append + (VSS.Strings.Conversions.To_Virtual_String + (GNATCOLL.Utils.Image (Idx, Min_Width => 1))); + Insert_Text.Append (':'); + Insert_Text.Append + (VSS.Strings.To_Virtual_String (Id.Text)); + Insert_Text.Append (" : "); + Insert_Text.Append + ((if Mode /= "" + then VSS.Strings.To_Virtual_String (Mode & " ") + else "")); + Insert_Text.Append + (VSS.Strings.To_Virtual_String + (Param.F_Type_Expr.Text)); + Insert_Text.Append ("}, "); + + else + Insert_Text.Append ("${"); + Insert_Text.Append + (VSS.Strings.Conversions.To_Virtual_String + (GNATCOLL.Utils.Image (Idx, Min_Width => 1))); + Insert_Text.Append (':'); + Insert_Text.Append + (VSS.Strings.To_Virtual_String (Id.Text)); + Insert_Text.Append (" : "); + Insert_Text.Append + ((if Mode /= "" + then VSS.Strings.To_Virtual_String (Mode & " ") + else "")); + Insert_Text.Append + (VSS.Strings.To_Virtual_String + (Param.F_Type_Expr.Text)); + Insert_Text.Append ("}, "); + end if; + + Idx := Idx + 1; + end; + end loop; + end loop; + + -- Remove the ", " substring that has been appended in the last + -- loop iteration. + + declare + First : constant + VSS.Strings.Character_Iterators.Character_Iterator := + Insert_Text.At_First_Character; + Last : VSS.Strings.Character_Iterators.Character_Iterator := + Insert_Text.At_Last_Character; + Success : Boolean with Unreferenced; + + begin + Success := Last.Backward; + Success := Last.Backward; + + Insert_Text := Insert_Text.Slice (First, Last); + -- ??? May be replaced by "Head" like procedure when it will be + -- implemented. + end; + + -- Insert '$0' (i.e: the final tab stop) at the end. + Insert_Text.Append (")$0"); + + Item.insertText := Insert_Text; + end if; + end; + + return Item; end Compute_Completion_Item; ---------- @@ -837,7 +1056,6 @@ package body LSP.Ada_Documents is Canceled : access function return Boolean; Result : in out LSP.Ada_Completions.Completion_Maps.Map) is - -- use type LSP.Messages.Search_Kind; procedure Refresh_Symbol_Cache; -- Find intresting definings names in the document and put them diff --git a/source/ada/lsp-ada_handlers.adb b/source/ada/lsp-ada_handlers.adb index 8b391bdf8..65ab97a3a 100644 --- a/source/ada/lsp-ada_handlers.adb +++ b/source/ada/lsp-ada_handlers.adb @@ -319,6 +319,8 @@ package body LSP.Ada_Handlers is Response : LSP.Structures.Completion_Result (Kind => LSP.Structures.Varian_2); begin + Response.Varian_2.isIncomplete := False; + Document.Get_Completion_Node (Context => Context.all, Position => Value.position, diff --git a/source/ada/lsp-lal_utils.adb b/source/ada/lsp-lal_utils.adb index 3c23a2f82..694198c64 100644 --- a/source/ada/lsp-lal_utils.adb +++ b/source/ada/lsp-lal_utils.adb @@ -245,105 +245,6 @@ package body LSP.Lal_Utils is Result := New_Result; end Sort_And_Remove_Duplicates; - ------------------- - -- Get_Decl_Kind -- - ------------------- - - function Get_Decl_Kind - (Node : Libadalang.Analysis.Basic_Decl; - Ignore_Local : Boolean := False) - return LSP.Messages.SymbolKind is - begin - case Node.Kind is - when Ada_Classic_Subp_Decl | - Ada_Base_Subp_Body | - Ada_Entry_Body_Range | - Ada_Entry_Decl_Range | - Ada_Generic_Subp_Decl_Range | - Ada_Generic_Subp_Instantiation_Range | - Ada_Generic_Subp_Renaming_Decl_Range | - Ada_Subp_Body_Stub_Range => - return LSP.Messages.A_Function; - - when Ada_Component_Decl | - Ada_Discriminant_Spec => - return LSP.Messages.Field; - - when Ada_Generic_Formal_Obj_Decl | - Ada_Param_Spec | - Ada_Exception_Handler | - Ada_Object_Decl | - Ada_Extended_Return_Stmt_Object_Decl | - Ada_Single_Protected_Decl | - Ada_Single_Task_Decl => - return (if Ignore_Local - then LSP.Messages.A_Null - else - (if Laltools.Common.Is_Constant (Node) - then LSP.Messages.A_Constant - else LSP.Messages.Variable)); - - when Ada_Base_Package_Decl | - Ada_Generic_Formal_Package | - -- Ignore: Ada_Generic_Package_Decl kind, this node always have - -- an Ada_Generic_Package_Internal as a child and we will use it - -- to create the CompletionItem/DocumentSymbol - Ada_Generic_Package_Instantiation | - Ada_Generic_Package_Renaming_Decl | - Ada_Package_Renaming_Decl => - return LSP.Messages.A_Package; - - when Ada_Package_Body_Stub | - Ada_Protected_Body_Stub | - Ada_Task_Body_Stub | - Ada_Package_Body | - Ada_Protected_Body | - Ada_Task_Body => - return LSP.Messages.Module; - - when Ada_Concrete_Type_Decl | - Ada_Formal_Type_Decl => - return (if Laltools.Common.Is_Structure (Node) - then LSP.Messages.Struct - else LSP.Messages.Class); - - when Ada_Generic_Formal_Type_Decl | - Ada_Classwide_Type_Decl | - Ada_Incomplete_Type_Decl | - Ada_Incomplete_Tagged_Type_Decl | - Ada_Protected_Type_Decl | - Ada_Task_Type_Decl | - Ada_Subtype_Decl | - Ada_Anonymous_Type_Decl | - Ada_Synth_Anonymous_Type_Decl => - return LSP.Messages.Class; - - when Ada_Entry_Index_Spec | - Ada_Number_Decl => - return LSP.Messages.Number; - - when Ada_Enum_Literal_Decl => - return (if Ignore_Local - then LSP.Messages.A_Null - else LSP.Messages.Enum); - - when Ada_Exception_Decl => - return LSP.Messages.String; - - when Ada_For_Loop_Var_Decl | - Ada_Label_Decl | - Ada_Named_Stmt_Decl => - return (if Ignore_Local - then LSP.Messages.A_Null - else LSP.Messages.A_Constant); - - when others => - null; - end case; - - return LSP.Messages.A_Null; - end Get_Decl_Kind; - ------------------ -- Get_Location -- ------------------ diff --git a/source/ada/lsp-lal_utils.ads b/source/ada/lsp-lal_utils.ads index c7dce3f93..120d56edb 100644 --- a/source/ada/lsp-lal_utils.ads +++ b/source/ada/lsp-lal_utils.ads @@ -190,14 +190,6 @@ package LSP.Lal_Utils is -- TODO: Reactivate these lines when libadalang supports -- P_Next_Part for tasks: T716-049 - function Get_Decl_Kind - (Node : Libadalang.Analysis.Basic_Decl; - Ignore_Local : Boolean := False) - return LSP.Messages.SymbolKind; - -- Return a LSP SymbolKind for the given Libadalang Basic_Decl - -- When Ignore_Local it will return Is_Null for all local objects like - -- variables. - function To_Call_Hierarchy_Item (Name : Libadalang.Analysis.Defining_Name) return LSP.Messages.CallHierarchyItem; diff --git a/source/ada/lsp-search-start_word_text.adb b/source/ada/lsp-search-start_word.adb similarity index 65% rename from source/ada/lsp-search-start_word_text.adb rename to source/ada/lsp-search-start_word.adb index 31c4655fc..5751a75af 100644 --- a/source/ada/lsp-search-start_word_text.adb +++ b/source/ada/lsp-search-start_word.adb @@ -1,7 +1,7 @@ ------------------------------------------------------------------------------ -- Language Server Protocol -- -- -- --- Copyright (C) 2021, AdaCore -- +-- Copyright (C) 2021-2023, AdaCore -- -- -- -- This is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -15,12 +15,7 @@ -- of the license. -- ------------------------------------------------------------------------------ -with Ada.Strings.UTF_Encoding; - -with VSS.Strings; use VSS.Strings; -with VSS.Strings.Conversions; - -package body LSP.Search.Start_Word_Text is +package body LSP.Search.Start_Word is ----------- -- Build -- @@ -31,32 +26,24 @@ package body LSP.Search.Start_Word_Text is Case_Sensitive : Boolean := False; Whole_Word : Boolean := False; Negate : Boolean := False) - return Search_Pattern'Class - is - BM : GNATCOLL.Boyer_Moore.Pattern; + return Search_Pattern'Class is begin - Compile - (BM, - VSS.Strings.Conversions.To_UTF_8_String (Pattern), - Case_Sensitive => Case_Sensitive); - return Start_Word_Text_Search' + return Start_Word_Search' (Ada.Finalization.Limited_Controlled with - Boyer => BM, Text => Pattern, Case_Sensitive => Case_Sensitive, Negate => Negate, Whole_Word => Whole_Word, - Kind => LSP.Messages.Start_Word_Text); + Kind => Start_Word_Text); end Build; -------------- -- Finalize -- -------------- - overriding procedure Finalize (Self : in out Start_Word_Text_Search) is + overriding procedure Finalize (Self : in out Start_Word_Search) is begin - GNATCOLL.Boyer_Moore.Free (Self.Boyer); Finalize (Search_Pattern (Self)); end Finalize; @@ -65,19 +52,17 @@ package body LSP.Search.Start_Word_Text is ----------- overriding function Match - (Self : Start_Word_Text_Search; + (Self : Start_Word_Search; Text : VSS.Strings.Virtual_String) return Boolean is - T : constant Ada.Strings.UTF_Encoding.UTF_8_String := - VSS.Strings.Conversions.To_UTF_8_String (Text); + Kind : constant array (Boolean) of VSS.Strings.Case_Sensitivity := + [False => VSS.Strings.Identifier_Caseless, + True => VSS.Strings.Case_Sensitive]; begin - if GNATCOLL.Boyer_Moore.Search (Self.Boyer, T) = T'First then - return not Self.Negate; - else - return Self.Negate; - end if; + return Text.Starts_With (Self.Text, Kind (Self.Case_Sensitive)) + xor Self.Negate; end Match; -end LSP.Search.Start_Word_Text; +end LSP.Search.Start_Word; diff --git a/source/ada/lsp-search-start_word_text.ads b/source/ada/lsp-search-start_word.ads similarity index 78% rename from source/ada/lsp-search-start_word_text.ads rename to source/ada/lsp-search-start_word.ads index fbaaed688..3a04ab113 100644 --- a/source/ada/lsp-search-start_word_text.ads +++ b/source/ada/lsp-search-start_word.ads @@ -1,7 +1,7 @@ ------------------------------------------------------------------------------ -- Language Server Protocol -- -- -- --- Copyright (C) 2021, AdaCore -- +-- Copyright (C) 2021-2023, AdaCore -- -- -- -- This is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -15,9 +15,7 @@ -- of the license. -- ------------------------------------------------------------------------------ -with GNATCOLL.Boyer_Moore; use GNATCOLL.Boyer_Moore; - -package LSP.Search.Start_Word_Text is +package LSP.Search.Start_Word is function Build (Pattern : VSS.Strings.Virtual_String; @@ -28,15 +26,13 @@ package LSP.Search.Start_Word_Text is private - type Start_Word_Text_Search is new Search_Pattern with record - Boyer : GNATCOLL.Boyer_Moore.Pattern; - end record; + type Start_Word_Search is new Search_Pattern with null record; - overriding procedure Finalize (Self : in out Start_Word_Text_Search); + overriding procedure Finalize (Self : in out Start_Word_Search); overriding function Match - (Self : Start_Word_Text_Search; + (Self : Start_Word_Search; Text : VSS.Strings.Virtual_String) return Boolean; -end LSP.Search.Start_Word_Text; +end LSP.Search.Start_Word; diff --git a/source/ada/lsp-search.adb b/source/ada/lsp-search.adb index 54cb14357..11ccb921a 100644 --- a/source/ada/lsp-search.adb +++ b/source/ada/lsp-search.adb @@ -15,6 +15,8 @@ -- of the license. -- ------------------------------------------------------------------------------ +with LSP.Search.Start_Word; + package body LSP.Search is ----------- @@ -27,8 +29,16 @@ package body LSP.Search is Whole_Word : Boolean := False; Negate : Boolean := False; Kind : Search_Kind := Full_Text) - return Search_Pattern'Class - is (raise Program_Error with "Unimplemented"); -- FIXME + return Search_Pattern'Class is + begin + case Kind is + when Start_Word_Text => + return Start_Word.Build + (Pattern, Case_Sensitive, Whole_Word, Negate); + when others => + raise Program_Error with "Unimplemented"; -- FIXME + end case; + end Build; -------------- -- Get_Kind -- diff --git a/source/ada/lsp-utils.adb b/source/ada/lsp-utils.adb index f8db6c30f..52605a580 100644 --- a/source/ada/lsp-utils.adb +++ b/source/ada/lsp-utils.adb @@ -20,11 +20,14 @@ with GNATCOLL.VFS; with GNATCOLL.Utils; -with VSS.Strings.Conversions; - +with Libadalang.Common; with Libadalang.Sources; with Langkit_Support.Symbols; +with Laltools.Common; + +with VSS.Strings.Conversions; + package body LSP.Utils is ------------------ @@ -49,6 +52,107 @@ package body LSP.Utils is end if; end Canonicalize; + ------------------- + -- Get_Decl_Kind -- + ------------------- + + function Get_Decl_Kind + (Node : Libadalang.Analysis.Basic_Decl; + Ignore_Local : Boolean := False) + return LSP.Enumerations.SymbolKind + is + use Libadalang.Common; + begin + case Node.Kind is + when Ada_Classic_Subp_Decl | + Ada_Base_Subp_Body | + Ada_Entry_Body_Range | + Ada_Entry_Decl_Range | + Ada_Generic_Subp_Decl_Range | + Ada_Generic_Subp_Instantiation_Range | + Ada_Generic_Subp_Renaming_Decl_Range | + Ada_Subp_Body_Stub_Range => + return LSP.Enumerations.A_Function; + + when Ada_Component_Decl | + Ada_Discriminant_Spec => + return LSP.Enumerations.Field; + + when Ada_Generic_Formal_Obj_Decl | + Ada_Param_Spec | + Ada_Exception_Handler | + Ada_Object_Decl | + Ada_Extended_Return_Stmt_Object_Decl | + Ada_Single_Protected_Decl | + Ada_Single_Task_Decl => + return (if Ignore_Local + then LSP.Enumerations.A_Null + else + (if Laltools.Common.Is_Constant (Node) + then LSP.Enumerations.A_Constant + else LSP.Enumerations.Variable)); + + when Ada_Base_Package_Decl | + Ada_Generic_Formal_Package | + -- Ignore: Ada_Generic_Package_Decl kind, this node always have + -- an Ada_Generic_Package_Internal as a child and we will use it + -- to create the CompletionItem/DocumentSymbol + Ada_Generic_Package_Instantiation | + Ada_Generic_Package_Renaming_Decl | + Ada_Package_Renaming_Decl => + return LSP.Enumerations.A_Package; + + when Ada_Package_Body_Stub | + Ada_Protected_Body_Stub | + Ada_Task_Body_Stub | + Ada_Package_Body | + Ada_Protected_Body | + Ada_Task_Body => + return LSP.Enumerations.Module; + + when Ada_Concrete_Type_Decl | + Ada_Formal_Type_Decl => + return (if Laltools.Common.Is_Structure (Node) + then LSP.Enumerations.Struct + else LSP.Enumerations.Class); + + when Ada_Generic_Formal_Type_Decl | + Ada_Classwide_Type_Decl | + Ada_Incomplete_Type_Decl | + Ada_Incomplete_Tagged_Type_Decl | + Ada_Protected_Type_Decl | + Ada_Task_Type_Decl | + Ada_Subtype_Decl | + Ada_Anonymous_Type_Decl | + Ada_Synth_Anonymous_Type_Decl => + return LSP.Enumerations.Class; + + when Ada_Entry_Index_Spec | + Ada_Number_Decl => + return LSP.Enumerations.Number; + + when Ada_Enum_Literal_Decl => + return (if Ignore_Local + then LSP.Enumerations.A_Null + else LSP.Enumerations.Enum); + + when Ada_Exception_Decl => + return LSP.Enumerations.String; + + when Ada_For_Loop_Var_Decl | + Ada_Label_Decl | + Ada_Named_Stmt_Decl => + return (if Ignore_Local + then LSP.Enumerations.A_Null + else LSP.Enumerations.A_Constant); + + when others => + null; + end case; + + return LSP.Enumerations.A_Null; + end Get_Decl_Kind; + ------------------------- -- Node_Location_Image -- ------------------------- diff --git a/source/ada/lsp-utils.ads b/source/ada/lsp-utils.ads index d1c8946db..fbefe2cdd 100644 --- a/source/ada/lsp-utils.ads +++ b/source/ada/lsp-utils.ads @@ -21,6 +21,8 @@ with VSS.Strings; with Libadalang.Analysis; +with LSP.Enumerations; + package LSP.Utils is function Canonicalize @@ -33,4 +35,12 @@ package LSP.Utils is return VSS.Strings.Virtual_String; -- Return "file.adb:line:col" as a string + function Get_Decl_Kind + (Node : Libadalang.Analysis.Basic_Decl; + Ignore_Local : Boolean := False) + return LSP.Enumerations.SymbolKind; + -- Return a LSP SymbolKind for the given Libadalang Basic_Decl + -- When Ignore_Local it will return Is_Null for all local objects like + -- variables. + end LSP.Utils; diff --git a/testsuite/ada_lsp/completion.keywords/test.json b/testsuite/ada_lsp/completion.keywords/test.json index bda125d1f..6355e0bf4 100644 --- a/testsuite/ada_lsp/completion.keywords/test.json +++ b/testsuite/ada_lsp/completion.keywords/test.json @@ -70,28 +70,7 @@ "id": 1, "result": { "capabilities": { - "alsReferenceKinds": [ - "reference", - "access", - "write", - "call", - "dispatching call", - "parent", - "child", - "overriding" - ], - "implementationProvider": true, - "foldingRangeProvider": true, - "typeDefinitionProvider": true, - "alsShowDepsProvider": true, - "hoverProvider": true, - "definitionProvider": true, - "renameProvider": {}, - "referencesProvider": true, - "codeActionProvider": {}, "textDocumentSync": 2, - "documentFormattingProvider": true, - "declarationProvider": true, "completionProvider": { "triggerCharacters": [ ".", @@ -264,56 +243,48 @@ "insertText": "raise", "kind": 14, "insertTextFormat": 1, - "additionalTextEdits": [], "label": "raise" }, { "insertText": "range", "kind": 14, "insertTextFormat": 1, - "additionalTextEdits": [], "label": "range" }, { "insertText": "record", "kind": 14, "insertTextFormat": 1, - "additionalTextEdits": [], "label": "record" }, { "insertText": "rem", "kind": 14, "insertTextFormat": 1, - "additionalTextEdits": [], "label": "rem" }, { "insertText": "renames", "kind": 14, "insertTextFormat": 1, - "additionalTextEdits": [], "label": "renames" }, { "insertText": "requeue", "kind": 14, "insertTextFormat": 1, - "additionalTextEdits": [], "label": "requeue" }, { "insertText": "return", "kind": 14, "insertTextFormat": 1, - "additionalTextEdits": [], "label": "return" }, { "insertText": "reverse", "kind": 14, "insertTextFormat": 1, - "additionalTextEdits": [], "label": "reverse" } ] diff --git a/testsuite/ada_lsp/completion.keywords/test.yaml b/testsuite/ada_lsp/completion.keywords/test.yaml index 44dcfc7a5..8c96d4b44 100644 --- a/testsuite/ada_lsp/completion.keywords/test.yaml +++ b/testsuite/ada_lsp/completion.keywords/test.yaml @@ -1,4 +1 @@ title: 'completion.keywords' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] From 800779f7278693a7182bafb1eb1ce193349013eb Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Tue, 22 Aug 2023 12:44:15 +0300 Subject: [PATCH 042/152] Add calgraphs requests Refs #1170 --- source/ada/lsp-ada_client_capabilities.adb | 1 + .../ada/lsp-ada_handlers-call_hierarchy.adb | 363 ++++++++++++++++++ .../ada/lsp-ada_handlers-call_hierarchy.ads | 54 +++ source/ada/lsp-ada_handlers-locations.adb | 4 +- source/ada/lsp-ada_handlers.adb | 223 ++++++++++- source/ada/lsp-ada_handlers.ads | 15 + source/ada/lsp-lal_utils.adb | 200 ---------- source/ada/lsp-lal_utils.ads | 50 --- source/ada/lsp-utils.adb | 3 +- source/lsp_3.17/lsp-constants.ads | 8 + .../S820-016.called_by.entry/test.json | 35 +- .../S820-016.called_by.entry/test.yaml | 3 - .../SA24-055.called_by_on_abstract/test.json | 35 +- .../SA24-055.called_by_on_abstract/test.yaml | 3 - .../test.json | 35 +- .../test.yaml | 3 - .../callHierarchy.abstract_subps/test.json | 35 +- .../callHierarchy.abstract_subps/test.yaml | 3 - .../ada_lsp/called_by.null_subp/test.json | 35 +- .../ada_lsp/called_by.null_subp/test.yaml | 3 - testsuite/ada_lsp/called_by/test.json | 43 +-- testsuite/ada_lsp/called_by/test.yaml | 3 - .../ada_lsp/called_by_dispatching/test.json | 35 +- .../ada_lsp/called_by_dispatching/test.yaml | 3 - .../ada_lsp/called_by_not_open/test.json | 35 +- .../ada_lsp/called_by_not_open/test.yaml | 3 - testsuite/ada_lsp/calls/test.json | 35 +- testsuite/ada_lsp/calls/test.yaml | 3 - 28 files changed, 679 insertions(+), 592 deletions(-) create mode 100644 source/ada/lsp-ada_handlers-call_hierarchy.adb create mode 100644 source/ada/lsp-ada_handlers-call_hierarchy.ads diff --git a/source/ada/lsp-ada_client_capabilities.adb b/source/ada/lsp-ada_client_capabilities.adb index 816011ea9..60b5358d5 100644 --- a/source/ada/lsp-ada_client_capabilities.adb +++ b/source/ada/lsp-ada_client_capabilities.adb @@ -85,6 +85,7 @@ package body LSP.Ada_Client_Capabilities is resolveProvider => LSP.Constants.True, others => <>)); + Result.callHierarchyProvider := LSP.Constants.True; Result.declarationProvider := LSP.Constants.True; Result.definitionProvider := LSP.Constants.True; Result.foldingRangeProvider := LSP.Constants.True; diff --git a/source/ada/lsp-ada_handlers-call_hierarchy.adb b/source/ada/lsp-ada_handlers-call_hierarchy.adb new file mode 100644 index 000000000..636ed727d --- /dev/null +++ b/source/ada/lsp-ada_handlers-call_hierarchy.adb @@ -0,0 +1,363 @@ +------------------------------------------------------------------------------ +-- Language Server Protocol -- +-- -- +-- Copyright (C) 2018-2023, AdaCore -- +-- -- +-- This is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 3, or (at your option) any later ver- -- +-- sion. This software is distributed in the hope that it will be useful, -- +-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- -- +-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -- +-- License for more details. You should have received a copy of the GNU -- +-- General Public License distributed with this software; see file -- +-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy -- +-- of the license. -- +------------------------------------------------------------------------------ + +with GNATCOLL.Traces; + +with Libadalang.Common; + +with Laltools.Common; +with Laltools.Call_Hierarchy; + +with LSP.Ada_Handlers.Locations; +with LSP.GNATCOLL_Tracers.Handle; +with LSP.Utils; + +package body LSP.Ada_Handlers.Call_Hierarchy is + + function Containing_Entity + (Ref : Libadalang.Analysis.Ada_Node; + Canonical : Boolean := True) return Libadalang.Analysis.Defining_Name; + + ----------------------- + -- Containing_Entity -- + ----------------------- + + function Containing_Entity + (Ref : Libadalang.Analysis.Ada_Node; + Canonical : Boolean := True) return Libadalang.Analysis.Defining_Name + is + use all type Libadalang.Common.Ada_Node_Kind_Type; + + Parents : constant Libadalang.Analysis.Ada_Node_Array := Ref.Parents; + begin + for Parent of Parents loop + if Parent.Kind in Ada_Subp_Decl + | Ada_Subp_Body + | Ada_Task_Def + | Ada_Task_Body + | Ada_Package_Body + | Ada_Package_Decl + then + if Canonical then + return Parent.As_Basic_Decl.P_Canonical_Part.P_Defining_Name; + else + return Parent.As_Basic_Decl.P_Defining_Name; + end if; + end if; + end loop; + + return Libadalang.Analysis.No_Defining_Name; + end Containing_Entity; + + ------------------------- + -- Find_Incoming_Calls -- + ------------------------- + + procedure Find_Incoming_Calls + (Self : in out Message_Handler; + Response : in out LSP.Structures.CallHierarchyIncomingCall_Vector; + Filter : in out File_Span_Sets.Set; + Context : LSP.Ada_Contexts.Context; + Definition : Libadalang.Analysis.Defining_Name) + is + + procedure Add_Incoming_Call + (Node : Libadalang.Analysis.Defining_Name; + Refs : Laltools.Common.References_Sets.Set); + -- LSP.Structures.AlsReferenceKind_Vector) + -- Add an incoming call in results. Use Filter to prevent having + -- duplicates + + ----------------------- + -- Add_Incoming_Call -- + ----------------------- + + procedure Add_Incoming_Call + (Node : Libadalang.Analysis.Defining_Name; + Refs : Laltools.Common.References_Sets.Set) + is + Call : LSP.Structures.CallHierarchyIncomingCall; + Span : constant LSP.Structures.Location := + Locations.To_LSP_Location (Self, Node); + begin + if not Filter.Contains (Span) then + declare + Decl : constant Libadalang.Analysis.Basic_Decl := + Node.P_Basic_Decl; + Location : constant LSP.Structures.Location := + Locations.To_LSP_Location (Self, Node); + begin + Call.from := LSP.Structures.CallHierarchyItem' + (name => VSS.Strings.To_Virtual_String (Node.Text), + kind => Utils.Get_Decl_Kind (Decl), + tags => <>, + detail => <>, + uri => Location.uri, + a_range => Location.a_range, + selectionRange => Location.a_range, + data => <>); + + for Ref of Refs loop + declare + Ref_Location : constant LSP.Structures.Location := + Locations.To_LSP_Location (Self, Ref); + begin + Call.fromRanges.Append (Ref_Location.a_range); + + -- if Ref.P_Is_Dispatching_Call then + -- Kinds.Append (LSP.Messages.Dispatching_Call); + -- else + -- Kinds.Append (LSP.Messages.Simple); + -- end if; + end; + end loop; + + Response.Append (Call); + Filter.Insert (Span); + end; + end if; + end Add_Incoming_Call; + + procedure Callback + (Ref : Libadalang.Analysis.Base_Id; + Kind : Libadalang.Common.Ref_Result_Kind; + Cancel : in out Boolean); + + Result : Laltools.Common.References_By_Subprogram.Map; + + -------------- + -- Callback -- + -------------- + + procedure Callback + (Ref : Libadalang.Analysis.Base_Id; + Kind : Libadalang.Common.Ref_Result_Kind; + Cancel : in out Boolean) + is + pragma Unreferenced (Kind); + Containing : Libadalang.Analysis.Defining_Name; + begin + -- We have a reference, and this a call: find the containing + -- subprogram or task + Containing := Containing_Entity + (Ref.As_Ada_Node, Canonical => False); + + if not Containing.Is_Null then + if Result.Contains (Containing) then + Result (Containing).Include (Ref); + else + declare + L : Laltools.Common.References_Sets.Set; + begin + L.Include (Ref); + Result.Insert (Containing, L); + end; + end if; + end if; + + if Self.Is_Canceled.all then + Cancel := True; + end if; + end Callback; + + Cursor : Laltools.Common.References_By_Subprogram.Cursor; + + begin + -- Go through all references to Definition, organising them by + -- containing subprogram. + + -- Obtain all the references + Context.Find_All_Calls (Definition, Callback'Access); + + Cursor := Result.First; + -- Iterate through all the results, converting them to protocol + -- objects. + while Laltools.Common.References_By_Subprogram.Has_Element (Cursor) loop + declare + Node : constant Libadalang.Analysis.Defining_Name := + Laltools.Common.References_By_Subprogram.Key (Cursor); + Refs : constant Laltools.Common.References_Sets.Set := + Laltools.Common.References_By_Subprogram.Element (Cursor); + begin + Add_Incoming_Call (Node, Refs); + + Laltools.Common.References_By_Subprogram.Next (Cursor); + end; + end loop; + end Find_Incoming_Calls; + + ------------------------- + -- Find_Outgoing_Calls -- + ------------------------- + + procedure Find_Outgoing_Calls + (Self : in out Message_Handler; + Response : in out LSP.Structures.CallHierarchyOutgoingCall_Vector; + Filter : in out File_Span_Sets.Set; + Definition : Libadalang.Analysis.Defining_Name) + is + use Laltools.Common.References_By_Subprogram; + use Laltools.Common.References_Sets; + + Trace : constant GNATCOLL.Traces.Trace_Handle := + LSP.GNATCOLL_Tracers.Handle (Self.Tracer.all); + + Result : Laltools.Common.References_By_Subprogram.Map; + + procedure Callback (Subp_Call : Libadalang.Analysis.Ada_Node'Class); + procedure Add_Outgoing_Call + (Node : Libadalang.Analysis.Defining_Name; + Refs : Laltools.Common.References_Sets.Set); + -- LSP.Structures.AlsReferenceKind_Vector) + -- Add an Outgoing call in results. Use Filter to prevent having + -- duplicates + + ----------------------- + -- Add_Outgoing_Call -- + ----------------------- + + procedure Add_Outgoing_Call + (Node : Libadalang.Analysis.Defining_Name; + Refs : Laltools.Common.References_Sets.Set) + is + Call : LSP.Structures.CallHierarchyOutgoingCall; + Span : constant LSP.Structures.Location := + Locations.To_LSP_Location (Self, Node); + begin + if not Filter.Contains (Span) then + declare + Decl : constant Libadalang.Analysis.Basic_Decl := + Node.P_Basic_Decl; + Location : constant LSP.Structures.Location := + Locations.To_LSP_Location (Self, Node); + begin + Call.to := LSP.Structures.CallHierarchyItem' + (name => VSS.Strings.To_Virtual_String (Node.Text), + kind => Utils.Get_Decl_Kind (Decl), + tags => <>, + detail => <>, + uri => Location.uri, + a_range => Location.a_range, + selectionRange => Location.a_range, + data => <>); + + for Ref of Refs loop + declare + Ref_Location : constant LSP.Structures.Location := + Locations.To_LSP_Location (Self, Ref); + begin + Call.fromRanges.Append (Ref_Location.a_range); + + -- if Ref.P_Is_Dispatching_Call then + -- Kinds.Append (LSP.Messages.Dispatching_Call); + -- else + -- Kinds.Append (LSP.Messages.Simple); + -- end if; + end; + end loop; + + Response.Append (Call); + Filter.Insert (Span); + end; + end if; + end Add_Outgoing_Call; + + -------------- + -- Callback -- + -------------- + + procedure Callback (Subp_Call : Libadalang.Analysis.Ada_Node'Class) is + Ignore : Boolean; + Call_Definition : Libadalang.Analysis.Defining_Name; + Subp_Call_Name : constant Libadalang.Analysis.Name := + Laltools.Common.Get_Node_As_Name (Subp_Call.As_Ada_Node); + begin + + -- First try to resolve the called function + + Call_Definition := Laltools.Common.Resolve_Name + (Subp_Call_Name, Trace, Ignore); + + if not Call_Definition.Is_Null then + if Result.Contains (Call_Definition) then + declare + R : constant + Laltools.Common.References_By_Subprogram. + Reference_Type := + Result.Reference (Call_Definition); + begin + R.Include (Subp_Call.As_Base_Id); + end; + else + declare + L : Laltools.Common.References_Sets.Set; + begin + L.Include (Subp_Call.As_Base_Id); + Result.Insert (Call_Definition, L); + end; + end if; + end if; + end Callback; + + Imprecise : Boolean; + Cursor : Laltools.Common.References_By_Subprogram.Cursor; + + begin + Laltools.Call_Hierarchy.Find_Outgoing_Calls + (Definition => Definition, + Callback => Callback'Access, + Trace => Trace, + Imprecise => Imprecise); + + Cursor := Result.First; + -- Iterate through all the results, converting them to protocol + -- objects. + while Laltools.Common.References_By_Subprogram.Has_Element (Cursor) loop + declare + Node : constant Libadalang.Analysis.Defining_Name := + Laltools.Common.References_By_Subprogram.Key (Cursor); + Refs : constant Laltools.Common.References_Sets.Set := + Laltools.Common.References_By_Subprogram.Element (Cursor); + begin + Add_Outgoing_Call (Node, Refs); + + Laltools.Common.References_By_Subprogram.Next (Cursor); + end; + end loop; + end Find_Outgoing_Calls; + + ---------- + -- Hash -- + ---------- + + function Hash + (Value : LSP.Structures.Location) return Ada.Containers.Hash_Type is + use type Ada.Containers.Hash_Type; + Prime : constant := 271; + Name : constant Ada.Containers.Hash_Type := + Ada.Containers.Hash_Type'Mod (Value.uri.Hash); + From : constant Ada.Containers.Hash_Type := + Prime * Ada.Containers.Hash_Type'Mod (Value.a_range.start.line) + + Ada.Containers.Hash_Type'Mod (Value.a_range.start.character); + To : constant Ada.Containers.Hash_Type := + Prime * Ada.Containers.Hash_Type'Mod (Value.a_range.an_end.line) + + Ada.Containers.Hash_Type'Mod (Value.a_range.an_end.character); + begin + return Name + From + To; + end Hash; + +end LSP.Ada_Handlers.Call_Hierarchy; diff --git a/source/ada/lsp-ada_handlers-call_hierarchy.ads b/source/ada/lsp-ada_handlers-call_hierarchy.ads new file mode 100644 index 000000000..97edfaa09 --- /dev/null +++ b/source/ada/lsp-ada_handlers-call_hierarchy.ads @@ -0,0 +1,54 @@ +------------------------------------------------------------------------------ +-- Language Server Protocol -- +-- -- +-- Copyright (C) 2018-2023, AdaCore -- +-- -- +-- This is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 3, or (at your option) any later ver- -- +-- sion. This software is distributed in the hope that it will be useful, -- +-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- -- +-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -- +-- License for more details. You should have received a copy of the GNU -- +-- General Public License distributed with this software; see file -- +-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy -- +-- of the license. -- +------------------------------------------------------------------------------ + +with Libadalang.Analysis; + +with LSP.Ada_Contexts; + +package LSP.Ada_Handlers.Call_Hierarchy is + + function Hash + (Value : LSP.Structures.Location) return Ada.Containers.Hash_Type; + + package File_Span_Sets is new Ada.Containers.Hashed_Sets + (Element_Type => LSP.Structures.Location, + Hash => Hash, + Equivalent_Elements => LSP.Structures."=", + "=" => LSP.Structures."="); + + procedure Find_Incoming_Calls + (Self : in out Message_Handler; + Response : in out LSP.Structures.CallHierarchyIncomingCall_Vector; + Filter : in out File_Span_Sets.Set; + Context : LSP.Ada_Contexts.Context; + Definition : Libadalang.Analysis.Defining_Name) + with Pre => Definition.P_Basic_Decl.P_Is_Subprogram; + -- Return the list of all the calls made to the subprogram pointed at by + -- the node given by Definition, organized by the subprograms in which + -- these calls are listed, ordered by the name of these subprograms. + + procedure Find_Outgoing_Calls + (Self : in out Message_Handler; + Response : in out LSP.Structures.CallHierarchyOutgoingCall_Vector; + Filter : in out File_Span_Sets.Set; + Definition : Libadalang.Analysis.Defining_Name) + with Pre => Definition.P_Basic_Decl.P_Is_Subprogram; + -- Return the list of all the calls made in the subprogram pointed at by + -- the node given by Definition, organized by the subprograms in which + -- these calls are listed, ordered by the name of these subprograms. + +end LSP.Ada_Handlers.Call_Hierarchy; diff --git a/source/ada/lsp-ada_handlers-locations.adb b/source/ada/lsp-ada_handlers-locations.adb index d448e73bb..86d8b4e38 100644 --- a/source/ada/lsp-ada_handlers-locations.adb +++ b/source/ada/lsp-ada_handlers-locations.adb @@ -79,7 +79,7 @@ package body LSP.Ada_Handlers.Locations is Line.Before_First_Character; begin while Cursor.Forward and then - Value.position.character < Natural (Cursor.First_UTF16_Offset) + Natural (Cursor.First_UTF16_Offset) < Value.position.character loop null; -- Skip characters on the left of the `position.character` end loop; @@ -166,7 +166,7 @@ package body LSP.Ada_Handlers.Locations is Line.Before_First_Character; begin - for J in 1 .. Sloc.Start_Column loop + for J in 1 .. Sloc.End_Column loop exit when not Cursor.Forward; end loop; diff --git a/source/ada/lsp-ada_handlers.adb b/source/ada/lsp-ada_handlers.adb index 65ab97a3a..fb95c3237 100644 --- a/source/ada/lsp-ada_handlers.adb +++ b/source/ada/lsp-ada_handlers.adb @@ -38,6 +38,7 @@ with LSP.Ada_Completions.Parameters; with LSP.Ada_Completions.Pragmas; with LSP.Ada_Completions.Use_Clauses; with LSP.Ada_Contexts; +with LSP.Ada_Handlers.Call_Hierarchy; with LSP.Ada_Handlers.Invisibles; with LSP.Ada_Handlers.Locations; with LSP.Ada_Handlers.Project_Diagnostics; @@ -48,6 +49,7 @@ with LSP.Generic_Cancel_Check; with LSP.GNATCOLL_Tracers.Handle; with LSP.Server_Notifications.DidChange; with LSP.Servers; +with LSP.Utils; package body LSP.Ada_Handlers is @@ -109,6 +111,12 @@ package body LSP.Ada_Handlers is Name : String); -- Save method in/out in a log file + function To_LSP_Location + (Self : in out Message_Handler'Class; + Node : Libadalang.Analysis.Ada_Node'Class) + return LSP.Structures.Location + renames LSP.Ada_Handlers.Locations.To_LSP_Location; + function Get_Node_At (Self : in out Message_Handler'Class; Context : LSP.Ada_Contexts.Context; @@ -123,6 +131,12 @@ package body LSP.Ada_Handlers is Ignore : AlsReferenceKind_Array := LSP.Ada_Handlers.Locations.Empty) renames LSP.Ada_Handlers.Locations.Append_Location; + function Imprecise_Resolve_Name + (Self : in out Message_Handler'Class; + Context : LSP.Ada_Contexts.Context; + Position : LSP.Structures.TextDocumentPositionParams'Class) + return Libadalang.Analysis.Defining_Name; + ----------------------- -- Clean_Diagnostics -- ----------------------- @@ -211,6 +225,35 @@ package body LSP.Ada_Handlers is end if; end Get_Open_Document; + ---------------------------- + -- Imprecise_Resolve_Name -- + ---------------------------- + + function Imprecise_Resolve_Name + (Self : in out Message_Handler'Class; + Context : LSP.Ada_Contexts.Context; + Position : LSP.Structures.TextDocumentPositionParams'Class) + return Libadalang.Analysis.Defining_Name + is + Trace : constant GNATCOLL.Traces.Trace_Handle := + LSP.GNATCOLL_Tracers.Handle (Self.Tracer.all); + + Name_Node : constant Libadalang.Analysis.Name := + Laltools.Common.Get_Node_As_Name + (Self.Get_Node_At (Context, Position)); + + Imprecise : Boolean; + begin + if Name_Node.Is_Null then + return Libadalang.Analysis.No_Defining_Name; + end if; + + return Laltools.Common.Resolve_Name + (Name_Node, + Trace, + Imprecise => Imprecise); + end Imprecise_Resolve_Name; + ---------------- -- Initialize -- ---------------- @@ -264,7 +307,7 @@ package body LSP.Ada_Handlers is -- be to return only results that are available for all -- project contexts. - -- Value : LSP.Messages.TextDocumentPositionParams renames + -- Value : LSP.Structures.TextDocumentPositionParams renames -- Request.params; Context : constant LSP.Ada_Context_Sets.Context_Access := @@ -1240,6 +1283,66 @@ package body LSP.Ada_Handlers is end if; end On_FoldingRange_Request; + ------------------------------ + -- On_IncomingCalls_Request -- + ------------------------------ + + overriding procedure On_IncomingCalls_Request + (Self : in out Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CallHierarchyIncomingCallsParams) + is + use Libadalang.Analysis; + + procedure Process_Context (C : LSP.Ada_Contexts.Context); + -- Process the subprogram found in one context and append corresponding + -- calls to Response. + + Response : LSP.Structures.CallHierarchyIncomingCall_Vector; + + Item : LSP.Structures.CallHierarchyItem renames + Value.item; + + Position : constant LSP.Structures.TextDocumentPositionParams := + (textDocument => (uri => Item.uri), + position => Item.selectionRange.start); + + Filter : Call_Hierarchy.File_Span_Sets.Set; + + --------------------- + -- Process_Context -- + --------------------- + + procedure Process_Context (C : LSP.Ada_Contexts.Context) is + Definition : Defining_Name; + begin + Definition := Self.Imprecise_Resolve_Name (C, Position); + + -- Attempt to resolve the name, return no results if we can't or if + -- the name does not resolve to a callable object, like a subprogram + -- or an entry. + + if not Definition.Is_Null + and then Definition.P_Basic_Decl.P_Is_Subprogram + and then not Self.Is_Canceled.all + then + Call_Hierarchy.Find_Incoming_Calls + (Self, Response, Filter, C, Definition); + end if; + + end Process_Context; + + begin + -- Find the references in all contexts + for C of Self.Contexts_For_URI (Item.uri) loop + Process_Context (C.all); + + exit when Self.Is_Canceled.all; + end loop; + + Self.Sender.On_IncomingCalls_Response (Id, Response); + end On_IncomingCalls_Request; + --------------------------- -- On_Initialize_Request -- --------------------------- @@ -1259,6 +1362,124 @@ package body LSP.Ada_Handlers is Self.Sender.On_Initialize_Response (Id, Response); end On_Initialize_Request; + ------------------------------ + -- On_OutgoingCalls_Request -- + ------------------------------ + + overriding procedure On_OutgoingCalls_Request + (Self : in out Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CallHierarchyOutgoingCallsParams) + is + use Libadalang.Analysis; + + procedure Process_Context (C : LSP.Ada_Contexts.Context); + -- Process the subprogram found in one context and append corresponding + -- calls to Response. + + Response : LSP.Structures.CallHierarchyOutgoingCall_Vector; + + Item : LSP.Structures.CallHierarchyItem renames + Value.item; + + Position : constant LSP.Structures.TextDocumentPositionParams := + (textDocument => (uri => Item.uri), + position => Item.selectionRange.start); + + Filter : Call_Hierarchy.File_Span_Sets.Set; + + --------------------- + -- Process_Context -- + --------------------- + + procedure Process_Context (C : LSP.Ada_Contexts.Context) is + Definition : Defining_Name; + begin + Definition := Self.Imprecise_Resolve_Name (C, Position); + + -- Attempt to resolve the name, return no results if we can't or if + -- the name does not resolve to a callable object, like a subprogram + -- or an entry. + + if not Definition.Is_Null + and then Definition.P_Basic_Decl.P_Is_Subprogram + and then not Self.Is_Canceled.all + then + Call_Hierarchy.Find_Outgoing_Calls + (Self, Response, Filter, Definition); + end if; + end Process_Context; + + begin + -- Find the references in all contexts + for C of Self.Contexts_For_URI (Item.uri) loop + Process_Context (C.all); + + exit when Self.Is_Canceled.all; + end loop; + + Self.Sender.On_OutgoingCalls_Response (Id, Response); + end On_OutgoingCalls_Request; + + ------------------------------------- + -- On_PrepareCallHierarchy_Request -- + ------------------------------------- + + overriding procedure On_PrepareCallHierarchy_Request + (Self : in out Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CallHierarchyPrepareParams) + is + Response : LSP.Structures.CallHierarchyItem_Vector; + + C : constant LSP.Ada_Context_Sets.Context_Access := + Self.Contexts.Get_Best_Context (Value.textDocument.uri); + -- For the PrepareCallHierarchy request, we're only interested in the + -- "best" response value, not in the list of values for all contexts + + Name : constant Libadalang.Analysis.Defining_Name := + Self.Imprecise_Resolve_Name (C.all, Value); + + Decl : Libadalang.Analysis.Basic_Decl; + Next : Libadalang.Analysis.Basic_Decl; + begin + if not Name.Is_Null then + Decl := Name.P_Basic_Decl; + + if not Decl.Is_Null and then Decl.P_Is_Subprogram then + + Next := Decl.P_Next_Part_For_Decl; + Decl := (if Next.Is_Null then Decl else Next); + + declare + Span : constant LSP.Structures.A_Range := + Self.To_LSP_Location (Decl).a_range; + + Node : constant Libadalang.Analysis.Defining_Name := + Decl.P_Defining_Name; + + Location : constant LSP.Structures.Location := + Self.To_LSP_Location (Node); + + Item : constant LSP.Structures.CallHierarchyItem := + (name => VSS.Strings.To_Virtual_String (Node.Text), + kind => Utils.Get_Decl_Kind (Decl), + tags => <>, + detail => Utils.Node_Location_Image (Node), + uri => Location.uri, + a_range => Span, + selectionRange => Location.a_range, + data => <>); + begin + + Response.Append (Item); + end; + end if; + end if; + + Self.Sender.On_PrepareCallHierarchy_Response (Id, Response); + end On_PrepareCallHierarchy_Request; + ---------------------------- -- On_Server_Notification -- ---------------------------- diff --git a/source/ada/lsp-ada_handlers.ads b/source/ada/lsp-ada_handlers.ads index 24254097e..9ef44fc72 100644 --- a/source/ada/lsp-ada_handlers.ads +++ b/source/ada/lsp-ada_handlers.ads @@ -230,11 +230,26 @@ private (Self : in out Message_Handler; Value : LSP.Server_Notifications.Server_Notification'Class); + overriding procedure On_IncomingCalls_Request + (Self : in out Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CallHierarchyIncomingCallsParams); + overriding procedure On_Initialize_Request (Self : in out Message_Handler; Id : LSP.Structures.Integer_Or_Virtual_String; Value : LSP.Structures.InitializeParams); + overriding procedure On_OutgoingCalls_Request + (Self : in out Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CallHierarchyOutgoingCallsParams); + + overriding procedure On_PrepareCallHierarchy_Request + (Self : in out Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CallHierarchyPrepareParams); + overriding procedure On_FoldingRange_Request (Self : in out Message_Handler; Id : LSP.Structures.Integer_Or_Virtual_String; diff --git a/source/ada/lsp-lal_utils.adb b/source/ada/lsp-lal_utils.adb index 694198c64..f200d3b61 100644 --- a/source/ada/lsp-lal_utils.adb +++ b/source/ada/lsp-lal_utils.adb @@ -605,206 +605,6 @@ package body LSP.Lal_Utils is return No_Defining_Name; end Containing_Entity; - ------------------------- - -- Find_Incoming_Calls -- - ------------------------- - - function Find_Incoming_Calls - (Context : LSP.Ada_Contexts.Context; - Definition : Defining_Name; - Imprecise_Results : out Boolean) - return Laltools.Common.References_By_Subprogram.Map - is - use Laltools.Common.References_By_Subprogram; - use Laltools.Common.References_Sets; - - procedure Callback - (Ref : Libadalang.Analysis.Base_Id; - Kind : Libadalang.Common.Ref_Result_Kind; - Cancel : in out Boolean); - - Result : Map; - - -------------- - -- Callback -- - -------------- - - procedure Callback - (Ref : Libadalang.Analysis.Base_Id; - Kind : Libadalang.Common.Ref_Result_Kind; - Cancel : in out Boolean) - is - pragma Unreferenced (Cancel); - Containing : Defining_Name; - begin - if Kind = Libadalang.Common.Imprecise then - Imprecise_Results := True; - end if; - - -- We have a reference, and this a call: find the containing - -- subprogram or task - Containing := Containing_Entity - (Ref.As_Ada_Node, Canonical => False); - - if Containing /= No_Defining_Name then - if Result.Contains (Containing) then - Result (Containing).Include (Ref); - else - declare - L : Set; - begin - L.Include (Ref); - Result.Insert (Containing, L); - end; - end if; - end if; - end Callback; - - begin - Imprecise_Results := False; - - -- Go through all references to Definition, organising them by - -- containing subprogram. - - -- Obtain all the references - Context.Find_All_Calls (Definition, Callback'Access); - - return Result; - end Find_Incoming_Calls; - - ------------------------- - -- Find_Outgoing_Calls -- - ------------------------- - - function Find_Outgoing_Calls - (Context : LSP.Ada_Contexts.Context; - Definition : Defining_Name; - Imprecise_Results : out Boolean) - return Laltools.Common.References_By_Subprogram.Map - is - use Laltools.Common.References_By_Subprogram; - use Laltools.Common.References_Sets; - - Result : Laltools.Common.References_By_Subprogram.Map; - - procedure Callback (Subp_Call : Ada_Node'Class); - - -------------- - -- Callback -- - -------------- - - procedure Callback (Subp_Call : Ada_Node'Class) - is - Call_Definition : Defining_Name; - Subp_Call_Name : constant Name := - Laltools.Common.Get_Node_As_Name (Subp_Call.As_Ada_Node); - begin - - -- First try to resolve the called function - - Call_Definition := Laltools.Common.Resolve_Name - (Subp_Call_Name, Context.Trace, Imprecise_Results); - - if Call_Definition /= No_Defining_Name then - if Result.Contains (Call_Definition) then - declare - R : constant - Laltools.Common.References_By_Subprogram. - Reference_Type := - Result.Reference (Call_Definition); - begin - R.Include (Subp_Call.As_Base_Id); - end; - else - declare - L : Laltools.Common.References_Sets.Set; - begin - L.Include (Subp_Call.As_Base_Id); - Result.Insert (Call_Definition, L); - end; - end if; - end if; - - end Callback; - begin - Imprecise_Results := False; - - Laltools.Call_Hierarchy.Find_Outgoing_Calls - (Definition => Definition, - Callback => Callback'Access, - Trace => Context.Trace, - Imprecise => Imprecise_Results); - - return Result; - end Find_Outgoing_Calls; - - ---------------------------- - -- To_Call_Hierarchy_Item -- - ---------------------------- - - function To_Call_Hierarchy_Item - (Name : Libadalang.Analysis.Defining_Name) - return LSP.Messages.CallHierarchyItem - is - Main_Item : constant Libadalang.Analysis.Basic_Decl := - Name.P_Basic_Decl; - - Where : constant LSP.Messages.Location := - LSP.Lal_Utils.Get_Node_Location (Main_Item); - begin - return LSP.Messages.CallHierarchyItem' - (name => VSS.Strings.To_Virtual_String (Name.Text), - kind => LSP.Lal_Utils.Get_Decl_Kind (Main_Item), - tags => (Is_Set => False), - detail => (True, LSP.Lal_Utils.Node_Location_Image (Name)), - uri => Where.uri, - span => Where.span, - selectionRange => LSP.Lal_Utils.To_Span (Name.Sloc_Range)); - end To_Call_Hierarchy_Item; - - ------------------------------ - -- To_Call_Hierarchy_Result -- - ------------------------------ - - procedure To_Call_Hierarchy_Result - (Node : Libadalang.Analysis.Defining_Name; - Refs : Laltools.Common.References_Sets.Set; - Item : out LSP.Messages.CallHierarchyItem; - Spans : out LSP.Messages.Span_Vector; - Kinds : out LSP.Messages.AlsReferenceKind_Vector) - is - Decl : constant Libadalang.Analysis.Basic_Decl := - Node.P_Basic_Decl; - Location : constant LSP.Messages.Location := - Get_Node_Location (Ada_Node (Node)); - begin - Item := LSP.Messages.CallHierarchyItem' - (name => VSS.Strings.To_Virtual_String (Node.Text), - kind => Get_Decl_Kind (Decl), - tags => <>, - detail => <>, - uri => Location.uri, - span => Location.span, - selectionRange => LSP.Lal_Utils.To_Span (Node.Sloc_Range)); - - Spans.Clear; - Kinds.Clear; - - for Ref of Refs loop - declare - Ref_Location : constant LSP.Messages.Location := - Get_Node_Location (Ada_Node (Ref)); - begin - Spans.Append (Ref_Location.span); - if Ref.P_Is_Dispatching_Call then - Kinds.Append (LSP.Messages.Dispatching_Call); - else - Kinds.Append (LSP.Messages.Simple); - end if; - end; - end loop; - end To_Call_Hierarchy_Result; - ----------------------- -- To_Virtual_String -- ----------------------- diff --git a/source/ada/lsp-lal_utils.ads b/source/ada/lsp-lal_utils.ads index 120d56edb..64bfad3c6 100644 --- a/source/ada/lsp-lal_utils.ads +++ b/source/ada/lsp-lal_utils.ads @@ -155,56 +155,6 @@ package LSP.Lal_Utils is -- Converts a Refactoring_Edits into a WorkspaceEdit. The Rename flag -- controls if files that are supposed to be deleted, are renamed instead. - --------------- - -- Called_By -- - --------------- - - function Find_Incoming_Calls - (Context : LSP.Ada_Contexts.Context; - Definition : Defining_Name; - Imprecise_Results : out Boolean) - return Laltools.Common.References_By_Subprogram.Map - with Pre => Definition.P_Basic_Decl.P_Is_Subprogram; - -- Return the list of all the calls made to the subprogram pointed at by - -- the node given by Definition, organized by the subprograms in which - -- these calls are listed, ordered by the name of these subprograms. - -- Imprecise_Results is set to True if we don't know whether the results - -- are precise. - - function Find_Outgoing_Calls - (Context : LSP.Ada_Contexts.Context; - Definition : Defining_Name; - Imprecise_Results : out Boolean) - return Laltools.Common.References_By_Subprogram.Map - with Pre => Definition.P_Basic_Decl.P_Is_Subprogram; - -- Return the list of all the calls made in the subprogram pointed at by - -- the node given by Definition, organized by the subprograms in which - -- these calls are listed, ordered by the name of these subprograms. - -- Imprecise_Results is set to True if we don't know whether the results - -- are precise. - - -- function Is_Task - -- (Node : Ada_Node'Class; - -- Trace : GNATCOLL.Traces.Trace_Handle; - -- Imprecise : out Boolean) return Boolean; - -- TODO: Reactivate these lines when libadalang supports - -- P_Next_Part for tasks: T716-049 - - function To_Call_Hierarchy_Item - (Name : Libadalang.Analysis.Defining_Name) - return LSP.Messages.CallHierarchyItem; - -- Create CallHierarchyItem for the given subprogram - - procedure To_Call_Hierarchy_Result - (Node : Libadalang.Analysis.Defining_Name; - Refs : Laltools.Common.References_Sets.Set; - Item : out LSP.Messages.CallHierarchyItem; - Spans : out LSP.Messages.Span_Vector; - Kinds : out LSP.Messages.AlsReferenceKind_Vector); - -- Convert the given Node and the given references to it to the - -- corresponding CallHierarchyItem and its associated spans, which contains - -- the references. This should be used for the callHierarchy requests. - function Containing_Entity (Ref : Ada_Node; Canonical : Boolean := True) return Defining_Name; diff --git a/source/ada/lsp-utils.adb b/source/ada/lsp-utils.adb index 52605a580..fe9570cd8 100644 --- a/source/ada/lsp-utils.adb +++ b/source/ada/lsp-utils.adb @@ -24,9 +24,8 @@ with Libadalang.Common; with Libadalang.Sources; with Langkit_Support.Symbols; -with Laltools.Common; - with VSS.Strings.Conversions; +with Laltools.Common; package body LSP.Utils is diff --git a/source/lsp_3.17/lsp-constants.ads b/source/lsp_3.17/lsp-constants.ads index bd63bd568..f5fc38b87 100644 --- a/source/lsp_3.17/lsp-constants.ads +++ b/source/lsp_3.17/lsp-constants.ads @@ -39,4 +39,12 @@ package LSP.Constants is return LSP.Structures.Boolean_Or_DefinitionOptions_Optional is (Is_Set => True, Value => True); + function True + return LSP.Structures.callHierarchyProvider_OfServerCapabilities + is (Kind => LSP.Structures.Varian_1, Varian_1 => True); + + function True + return LSP.Structures.callHierarchyProvider_OfServerCapabilities_Optional + is (Is_Set => True, Value => True); + end LSP.Constants; diff --git a/testsuite/ada_lsp/S820-016.called_by.entry/test.json b/testsuite/ada_lsp/S820-016.called_by.entry/test.json index 6c656da64..f49ced3c6 100644 --- a/testsuite/ada_lsp/S820-016.called_by.entry/test.json +++ b/testsuite/ada_lsp/S820-016.called_by.entry/test.json @@ -79,40 +79,7 @@ "result": { "capabilities": { "textDocumentSync": 2, - "completionProvider": { - "triggerCharacters": [ - ".", - ",", - "'", - "(" - ], - "resolveProvider": true - }, - "hoverProvider": true, - "declarationProvider": true, - "definitionProvider": true, - "typeDefinitionProvider": true, - "implementationProvider": true, - "referencesProvider": true, - "documentHighlightProvider": true, - "documentSymbolProvider": true, - "codeActionProvider": {}, - "documentFormattingProvider": true, - "renameProvider": {}, - "foldingRangeProvider": true, - "workspaceSymbolProvider": true, - "callHierarchyProvider": {}, - "alsShowDepsProvider": true, - "alsReferenceKinds": [ - "reference", - "access", - "write", - "call", - "dispatching call", - "parent", - "child", - "overriding" - ] + "callHierarchyProvider": true } } } diff --git a/testsuite/ada_lsp/S820-016.called_by.entry/test.yaml b/testsuite/ada_lsp/S820-016.called_by.entry/test.yaml index d3cf58719..e8a5ea36c 100644 --- a/testsuite/ada_lsp/S820-016.called_by.entry/test.yaml +++ b/testsuite/ada_lsp/S820-016.called_by.entry/test.yaml @@ -1,4 +1 @@ title: 'S820-016.called_by.entry' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/SA24-055.called_by_on_abstract/test.json b/testsuite/ada_lsp/SA24-055.called_by_on_abstract/test.json index 248c442cb..7d6c92e84 100644 --- a/testsuite/ada_lsp/SA24-055.called_by_on_abstract/test.json +++ b/testsuite/ada_lsp/SA24-055.called_by_on_abstract/test.json @@ -79,40 +79,7 @@ "result": { "capabilities": { "textDocumentSync": 2, - "completionProvider": { - "triggerCharacters": [ - ".", - ",", - "'", - "(" - ], - "resolveProvider": true - }, - "hoverProvider": true, - "declarationProvider": true, - "definitionProvider": true, - "typeDefinitionProvider": true, - "implementationProvider": true, - "referencesProvider": true, - "documentHighlightProvider": true, - "documentSymbolProvider": true, - "codeActionProvider": {}, - "documentFormattingProvider": true, - "renameProvider": {}, - "foldingRangeProvider": true, - "workspaceSymbolProvider": true, - "callHierarchyProvider": {}, - "alsShowDepsProvider": true, - "alsReferenceKinds": [ - "reference", - "access", - "write", - "call", - "dispatching call", - "parent", - "child", - "overriding" - ] + "callHierarchyProvider": true } } } diff --git a/testsuite/ada_lsp/SA24-055.called_by_on_abstract/test.yaml b/testsuite/ada_lsp/SA24-055.called_by_on_abstract/test.yaml index 32e646d96..31eb6ebfa 100644 --- a/testsuite/ada_lsp/SA24-055.called_by_on_abstract/test.yaml +++ b/testsuite/ada_lsp/SA24-055.called_by_on_abstract/test.yaml @@ -1,4 +1 @@ title: 'SA24-055.called_by_on_abstract' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/T709-018.is_called_by.name_collision/test.json b/testsuite/ada_lsp/T709-018.is_called_by.name_collision/test.json index c94ec94f0..ad02a3eaf 100644 --- a/testsuite/ada_lsp/T709-018.is_called_by.name_collision/test.json +++ b/testsuite/ada_lsp/T709-018.is_called_by.name_collision/test.json @@ -82,40 +82,7 @@ "result": { "capabilities": { "textDocumentSync": 2, - "completionProvider": { - "triggerCharacters": [ - ".", - ",", - "'", - "(" - ], - "resolveProvider": true - }, - "hoverProvider": true, - "declarationProvider": true, - "definitionProvider": true, - "typeDefinitionProvider": true, - "implementationProvider": true, - "referencesProvider": true, - "documentHighlightProvider": true, - "documentSymbolProvider": true, - "codeActionProvider": {}, - "documentFormattingProvider": true, - "renameProvider": {}, - "foldingRangeProvider": true, - "workspaceSymbolProvider": true, - "callHierarchyProvider": {}, - "alsShowDepsProvider": true, - "alsReferenceKinds": [ - "reference", - "access", - "write", - "call", - "dispatching call", - "parent", - "child", - "overriding" - ] + "callHierarchyProvider": true } } } diff --git a/testsuite/ada_lsp/T709-018.is_called_by.name_collision/test.yaml b/testsuite/ada_lsp/T709-018.is_called_by.name_collision/test.yaml index d8e54f2ee..0dfed344c 100644 --- a/testsuite/ada_lsp/T709-018.is_called_by.name_collision/test.yaml +++ b/testsuite/ada_lsp/T709-018.is_called_by.name_collision/test.yaml @@ -1,4 +1 @@ title: 'T709-018.is_called_by.name_collision' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/callHierarchy.abstract_subps/test.json b/testsuite/ada_lsp/callHierarchy.abstract_subps/test.json index 0b3a31811..bbf3ce7ab 100644 --- a/testsuite/ada_lsp/callHierarchy.abstract_subps/test.json +++ b/testsuite/ada_lsp/callHierarchy.abstract_subps/test.json @@ -79,40 +79,7 @@ "result": { "capabilities": { "textDocumentSync": 2, - "completionProvider": { - "triggerCharacters": [ - ".", - ",", - "'", - "(" - ], - "resolveProvider": true - }, - "hoverProvider": true, - "declarationProvider": true, - "definitionProvider": true, - "typeDefinitionProvider": true, - "implementationProvider": true, - "referencesProvider": true, - "documentHighlightProvider": true, - "documentSymbolProvider": true, - "codeActionProvider": {}, - "documentFormattingProvider": true, - "renameProvider": {}, - "foldingRangeProvider": true, - "workspaceSymbolProvider": true, - "callHierarchyProvider": {}, - "alsShowDepsProvider": true, - "alsReferenceKinds": [ - "reference", - "access", - "write", - "call", - "dispatching call", - "parent", - "child", - "overriding" - ] + "callHierarchyProvider": true } } } diff --git a/testsuite/ada_lsp/callHierarchy.abstract_subps/test.yaml b/testsuite/ada_lsp/callHierarchy.abstract_subps/test.yaml index 7d0818fc3..3521001dd 100644 --- a/testsuite/ada_lsp/callHierarchy.abstract_subps/test.yaml +++ b/testsuite/ada_lsp/callHierarchy.abstract_subps/test.yaml @@ -1,4 +1 @@ title: 'callHierarchy.abstract_subps' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/called_by.null_subp/test.json b/testsuite/ada_lsp/called_by.null_subp/test.json index fe84f725e..b6f867a89 100644 --- a/testsuite/ada_lsp/called_by.null_subp/test.json +++ b/testsuite/ada_lsp/called_by.null_subp/test.json @@ -79,40 +79,7 @@ "result": { "capabilities": { "textDocumentSync": 2, - "completionProvider": { - "triggerCharacters": [ - ".", - ",", - "'", - "(" - ], - "resolveProvider": true - }, - "hoverProvider": true, - "declarationProvider": true, - "definitionProvider": true, - "typeDefinitionProvider": true, - "implementationProvider": true, - "referencesProvider": true, - "documentHighlightProvider": true, - "documentSymbolProvider": true, - "codeActionProvider": {}, - "documentFormattingProvider": true, - "renameProvider": {}, - "foldingRangeProvider": true, - "workspaceSymbolProvider": true, - "callHierarchyProvider": {}, - "alsShowDepsProvider": true, - "alsReferenceKinds": [ - "reference", - "access", - "write", - "call", - "dispatching call", - "parent", - "child", - "overriding" - ] + "callHierarchyProvider": true } } } diff --git a/testsuite/ada_lsp/called_by.null_subp/test.yaml b/testsuite/ada_lsp/called_by.null_subp/test.yaml index a009d4e9e..89e140645 100644 --- a/testsuite/ada_lsp/called_by.null_subp/test.yaml +++ b/testsuite/ada_lsp/called_by.null_subp/test.yaml @@ -1,4 +1 @@ title: 'called_by.null_subp' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/called_by/test.json b/testsuite/ada_lsp/called_by/test.json index 266598111..e8bffc38b 100644 --- a/testsuite/ada_lsp/called_by/test.json +++ b/testsuite/ada_lsp/called_by/test.json @@ -79,40 +79,7 @@ "result": { "capabilities": { "textDocumentSync": 2, - "completionProvider": { - "triggerCharacters": [ - ".", - ",", - "'", - "(" - ], - "resolveProvider": true - }, - "hoverProvider": true, - "declarationProvider": true, - "definitionProvider": true, - "typeDefinitionProvider": true, - "implementationProvider": true, - "referencesProvider": true, - "documentHighlightProvider": true, - "documentSymbolProvider": true, - "codeActionProvider": {}, - "documentFormattingProvider": true, - "renameProvider": {}, - "foldingRangeProvider": true, - "workspaceSymbolProvider": true, - "callHierarchyProvider": {}, - "alsShowDepsProvider": true, - "alsReferenceKinds": [ - "reference", - "access", - "write", - "call", - "dispatching call", - "parent", - "child", - "overriding" - ] + "callHierarchyProvider": true } } } @@ -225,15 +192,15 @@ "item": { "name": "", "kind": 12, - "uri": "$URI{p.ads}", + "uri": "$URI{p.adb}", "range": { "start": { "line": 1, - "character": 12 + "character": 3 }, "end": { - "line": 1, - "character": 12 + "line": 4, + "character": 11 } }, "selectionRange": { diff --git a/testsuite/ada_lsp/called_by/test.yaml b/testsuite/ada_lsp/called_by/test.yaml index 1cf0db5b3..4094d8b50 100644 --- a/testsuite/ada_lsp/called_by/test.yaml +++ b/testsuite/ada_lsp/called_by/test.yaml @@ -1,4 +1 @@ title: 'called_by' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/called_by_dispatching/test.json b/testsuite/ada_lsp/called_by_dispatching/test.json index d1f02dab3..5b0466c4b 100644 --- a/testsuite/ada_lsp/called_by_dispatching/test.json +++ b/testsuite/ada_lsp/called_by_dispatching/test.json @@ -79,40 +79,7 @@ "result": { "capabilities": { "textDocumentSync": 2, - "completionProvider": { - "triggerCharacters": [ - ".", - ",", - "'", - "(" - ], - "resolveProvider": true - }, - "hoverProvider": true, - "declarationProvider": true, - "definitionProvider": true, - "typeDefinitionProvider": true, - "implementationProvider": true, - "referencesProvider": true, - "documentHighlightProvider": true, - "documentSymbolProvider": true, - "codeActionProvider": {}, - "documentFormattingProvider": true, - "renameProvider": {}, - "foldingRangeProvider": true, - "workspaceSymbolProvider": true, - "callHierarchyProvider": {}, - "alsShowDepsProvider": true, - "alsReferenceKinds": [ - "reference", - "access", - "write", - "call", - "dispatching call", - "parent", - "child", - "overriding" - ] + "callHierarchyProvider": true } } } diff --git a/testsuite/ada_lsp/called_by_dispatching/test.yaml b/testsuite/ada_lsp/called_by_dispatching/test.yaml index 2b6560186..9db9c991e 100644 --- a/testsuite/ada_lsp/called_by_dispatching/test.yaml +++ b/testsuite/ada_lsp/called_by_dispatching/test.yaml @@ -1,4 +1 @@ title: 'called_by_dispatching' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/called_by_not_open/test.json b/testsuite/ada_lsp/called_by_not_open/test.json index e582f7d83..10bb77bf3 100644 --- a/testsuite/ada_lsp/called_by_not_open/test.json +++ b/testsuite/ada_lsp/called_by_not_open/test.json @@ -79,40 +79,7 @@ "result": { "capabilities": { "textDocumentSync": 2, - "completionProvider": { - "triggerCharacters": [ - ".", - ",", - "'", - "(" - ], - "resolveProvider": true - }, - "hoverProvider": true, - "declarationProvider": true, - "definitionProvider": true, - "typeDefinitionProvider": true, - "implementationProvider": true, - "referencesProvider": true, - "documentHighlightProvider": true, - "documentSymbolProvider": true, - "codeActionProvider": {}, - "documentFormattingProvider": true, - "renameProvider": {}, - "foldingRangeProvider": true, - "workspaceSymbolProvider": true, - "callHierarchyProvider": {}, - "alsShowDepsProvider": true, - "alsReferenceKinds": [ - "reference", - "access", - "write", - "call", - "dispatching call", - "parent", - "child", - "overriding" - ] + "callHierarchyProvider": true } } } diff --git a/testsuite/ada_lsp/called_by_not_open/test.yaml b/testsuite/ada_lsp/called_by_not_open/test.yaml index da284269f..f7f5f964e 100644 --- a/testsuite/ada_lsp/called_by_not_open/test.yaml +++ b/testsuite/ada_lsp/called_by_not_open/test.yaml @@ -1,4 +1 @@ title: 'called_by_not_open' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/calls/test.json b/testsuite/ada_lsp/calls/test.json index 4883583b4..077ac305e 100644 --- a/testsuite/ada_lsp/calls/test.json +++ b/testsuite/ada_lsp/calls/test.json @@ -79,40 +79,7 @@ "result": { "capabilities": { "textDocumentSync": 2, - "completionProvider": { - "triggerCharacters": [ - ".", - ",", - "'", - "(" - ], - "resolveProvider": true - }, - "hoverProvider": true, - "declarationProvider": true, - "definitionProvider": true, - "typeDefinitionProvider": true, - "implementationProvider": true, - "referencesProvider": true, - "documentHighlightProvider": true, - "documentSymbolProvider": true, - "codeActionProvider": {}, - "documentFormattingProvider": true, - "renameProvider": {}, - "foldingRangeProvider": true, - "workspaceSymbolProvider": true, - "callHierarchyProvider": {}, - "alsShowDepsProvider": true, - "alsReferenceKinds": [ - "reference", - "access", - "write", - "call", - "dispatching call", - "parent", - "child", - "overriding" - ] + "callHierarchyProvider": true } } } diff --git a/testsuite/ada_lsp/calls/test.yaml b/testsuite/ada_lsp/calls/test.yaml index 810f249db..53ed07121 100644 --- a/testsuite/ada_lsp/calls/test.yaml +++ b/testsuite/ada_lsp/calls/test.yaml @@ -1,4 +1 @@ title: 'calls' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] From 44cb8733e09552fedd38fd9e83ec4ba1a4aef941 Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Tue, 22 Aug 2023 16:36:17 +0300 Subject: [PATCH 043/152] Add `textDocument/implementation` request Refs #1170 --- source/ada/lsp-ada_client_capabilities.adb | 1 + source/ada/lsp-ada_handlers.adb | 130 ++++++++++++++++++++- source/ada/lsp-ada_handlers.ads | 5 + source/lsp_3.17/lsp-constants.ads | 8 ++ testsuite/ada_lsp/implementation/test.json | 45 ++----- testsuite/ada_lsp/implementation/test.yaml | 3 - 6 files changed, 148 insertions(+), 44 deletions(-) diff --git a/source/ada/lsp-ada_client_capabilities.adb b/source/ada/lsp-ada_client_capabilities.adb index 60b5358d5..f225324be 100644 --- a/source/ada/lsp-ada_client_capabilities.adb +++ b/source/ada/lsp-ada_client_capabilities.adb @@ -89,6 +89,7 @@ package body LSP.Ada_Client_Capabilities is Result.declarationProvider := LSP.Constants.True; Result.definitionProvider := LSP.Constants.True; Result.foldingRangeProvider := LSP.Constants.True; + Result.implementationProvider := LSP.Constants.True; end return; end To_Server_Capabilities; diff --git a/source/ada/lsp-ada_handlers.adb b/source/ada/lsp-ada_handlers.adb index fb95c3237..569c34976 100644 --- a/source/ada/lsp-ada_handlers.adb +++ b/source/ada/lsp-ada_handlers.adb @@ -307,9 +307,6 @@ package body LSP.Ada_Handlers is -- be to return only results that are available for all -- project contexts. - -- Value : LSP.Structures.TextDocumentPositionParams renames - -- Request.params; - Context : constant LSP.Ada_Context_Sets.Context_Access := Self.Contexts.Get_Best_Context (Value.textDocument.uri); @@ -1283,6 +1280,133 @@ package body LSP.Ada_Handlers is end if; end On_FoldingRange_Request; + ------------------------------- + -- On_Implementation_Request -- + ------------------------------- + + overriding procedure On_Implementation_Request + (Self : in out Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ImplementationParams) + is + + Trace : constant GNATCOLL.Traces.Trace_Handle := + LSP.GNATCOLL_Tracers.Handle (Self.Tracer.all); + + Response : LSP.Structures.Definition_Result (LSP.Structures.Varian_1); + + Vector : LSP.Structures.Location_Vector renames Response.Varian_1; + + Display_Method_Ancestry_Policy : constant + LSP.Ada_Configurations.DisplayMethodAncestryOnNavigationPolicy := + Self.Configuration.Display_Method_Ancestry_Policy; + + procedure Resolve_In_Context (C : LSP.Ada_Context_Sets.Context_Access); + -- Utility function to gather results on one context + + ------------------------ + -- Resolve_In_Context -- + ------------------------ + + procedure Resolve_In_Context (C : LSP.Ada_Context_Sets.Context_Access) is + + use all type LSP.Ada_Configurations. + DisplayMethodAncestryOnNavigationPolicy; + + use Libadalang.Common; + + Name_Node : constant Libadalang.Analysis.Name := + Laltools.Common.Get_Node_As_Name (Self.Get_Node_At (C.all, Value)); + + procedure Update_Response + (Bodies : Laltools.Common.Bodies_List.List; + Ignore : AlsReferenceKind_Array); + -- Utility function to update response with the bodies + + --------------------- + -- Update_Response -- + --------------------- + + procedure Update_Response + (Bodies : Laltools.Common.Bodies_List.List; + Ignore : AlsReferenceKind_Array) + is + begin + for E of Bodies loop + Self.Append_Location (Vector, E); + end loop; + end Update_Response; + + Definition : Libadalang.Analysis.Defining_Name; + Imprecise : Boolean; + Decl : Libadalang.Analysis.Basic_Decl; + + begin + if Name_Node.Is_Null then + return; + end if; + + -- Find the definition + Definition := Laltools.Common.Resolve_Name + (Name_Node, Trace, Imprecise); + + -- If we didn't find a definition, give up for this context + if Definition.Is_Null then + return; + end if; + + -- First list the bodies of this definition + Update_Response + (Laltools.Common.List_Bodies_Of (Definition, Trace, Imprecise), + LSP.Ada_Handlers.Locations.Empty); + + -- Then list the bodies of the parent implementations + Decl := Definition.P_Basic_Decl; + + -- Display overriding/overridden subprograms depending on the + -- displayMethodAncestryOnNavigation flag. + if Display_Method_Ancestry_Policy in Definition_Only | Always + or else + (Display_Method_Ancestry_Policy = Usage_And_Abstract_Only + and then Decl.Kind in Ada_Abstract_Subp_Decl_Range) + then + for Subp of C.Find_All_Base_Declarations (Decl, Imprecise) + loop + Update_Response + (Laltools.Common.List_Bodies_Of + (Subp.P_Defining_Name, Trace, Imprecise), + Is_Parent); + end loop; + + -- And finally the bodies of child implementations + for Subp of C.Find_All_Overrides (Decl, Imprecise) loop + Update_Response + (Laltools.Common.List_Bodies_Of + (Subp.P_Defining_Name, Trace, Imprecise), + Is_Child); + end loop; + end if; + end Resolve_In_Context; + + begin + -- Override the displayMethodAncestryOnNavigation global configuration + -- flag if there is on embedded in the request. + -- if Value.alsDisplayMethodAncestryOnNavigation.Is_Set then + -- Display_Method_Ancestry_Policy := + -- Value.alsDisplayMethodAncestryOnNavigation.Value; + -- end if; + + for C of Self.Contexts_For_URI (Value.textDocument.uri) loop + Resolve_In_Context (C); + + exit when Self.Is_Canceled.all; + end loop; + + -- Sort_And_Remove_Duplicates (Response.result.Locations); + + Self.Sender.On_Implementation_Response (Id, Response); + end On_Implementation_Request; + ------------------------------ -- On_IncomingCalls_Request -- ------------------------------ diff --git a/source/ada/lsp-ada_handlers.ads b/source/ada/lsp-ada_handlers.ads index 9ef44fc72..bbf913bd7 100644 --- a/source/ada/lsp-ada_handlers.ads +++ b/source/ada/lsp-ada_handlers.ads @@ -235,6 +235,11 @@ private Id : LSP.Structures.Integer_Or_Virtual_String; Value : LSP.Structures.CallHierarchyIncomingCallsParams); + overriding procedure On_Implementation_Request + (Self : in out Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ImplementationParams); + overriding procedure On_Initialize_Request (Self : in out Message_Handler; Id : LSP.Structures.Integer_Or_Virtual_String; diff --git a/source/lsp_3.17/lsp-constants.ads b/source/lsp_3.17/lsp-constants.ads index f5fc38b87..75f7db638 100644 --- a/source/lsp_3.17/lsp-constants.ads +++ b/source/lsp_3.17/lsp-constants.ads @@ -23,6 +23,14 @@ package LSP.Constants is return LSP.Structures.foldingRangeProvider_OfServerCapabilities_Optional is (Is_Set => True, Value => True); + function True + return LSP.Structures.implementationProvider_OfServerCapabilities + is (Kind => LSP.Structures.Varian_1, Varian_1 => True); + + function True + return LSP.Structures.implementationProvider_OfServerCapabilities_Optional + is (Is_Set => True, Value => True); + function True return LSP.Structures.declarationProvider_OfServerCapabilities is (Kind => LSP.Structures.Varian_1, Varian_1 => True); diff --git a/testsuite/ada_lsp/implementation/test.json b/testsuite/ada_lsp/implementation/test.json index 63916c14c..e5031ba28 100644 --- a/testsuite/ada_lsp/implementation/test.json +++ b/testsuite/ada_lsp/implementation/test.json @@ -49,34 +49,9 @@ "id": 1, "result": { "capabilities": { - "typeDefinitionProvider": true, - "alsReferenceKinds": [ - "reference", - "access", - "write", - "call", - "dispatching call", - "parent", - "child", - "overriding" - ], - "hoverProvider": true, "definitionProvider": true, "implementationProvider": true, - "renameProvider": {}, - "referencesProvider": true, - "declarationProvider": true, - "textDocumentSync": 2, - "completionProvider": { - "triggerCharacters": [ - ".", - ",", - "'", - "(" - ], - "resolveProvider": true - }, - "documentSymbolProvider": true + "textDocumentSync": 2 } } } @@ -147,7 +122,7 @@ "wait": [ { "id": 2, - "result": [ + "result": { "range": { "start": { @@ -161,7 +136,6 @@ }, "uri": "$URI{pack.adb}" } - ] } ] } @@ -203,7 +177,7 @@ "wait": [ { "id": 3, - "result": [ + "result": { "range": { "start": { @@ -217,7 +191,6 @@ }, "uri": "$URI{pack.adb}" } - ] } ] } @@ -280,7 +253,7 @@ "wait": [ { "id": 5, - "result": [ + "result": { "range": { "start": { @@ -294,7 +267,6 @@ }, "uri": "$URI{pack.ads}" } - ] } ] } @@ -319,7 +291,7 @@ "wait": [ { "id": 6, - "result": [ + "result": { "range": { "start": { @@ -333,7 +305,6 @@ }, "uri": "$URI{pack.ads}" } - ] } ] } @@ -410,7 +381,7 @@ "wait": [ { "id": 9, - "result": [ + "result": { "range": { "start": { @@ -424,7 +395,6 @@ }, "uri": "$URI{pack.adb}" } - ] } ] } @@ -449,7 +419,7 @@ "wait": [ { "id": 10, - "result": [ + "result": { "range": { "start": { @@ -463,7 +433,6 @@ }, "uri": "$URI{pack.adb}" } - ] } ] } diff --git a/testsuite/ada_lsp/implementation/test.yaml b/testsuite/ada_lsp/implementation/test.yaml index d454f244f..96719905e 100644 --- a/testsuite/ada_lsp/implementation/test.yaml +++ b/testsuite/ada_lsp/implementation/test.yaml @@ -1,4 +1 @@ title: 'implementation' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] From a53f1916d30fb476da62cfb0dd5a95145a558a9a Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Tue, 22 Aug 2023 17:09:31 +0300 Subject: [PATCH 044/152] Add `textDocument/typeDefinition` request Refs #1170 --- source/ada/lsp-ada_client_capabilities.adb | 1 + source/ada/lsp-ada_handlers.adb | 78 +++++++++++++++++++ source/ada/lsp-ada_handlers.ads | 5 ++ source/lsp_3.17/lsp-constants.ads | 8 ++ .../type_definition.def_name/test.json | 12 +-- .../type_definition.def_name/test.yaml | 3 - testsuite/ada_lsp/type_definition/test.yaml | 3 - .../type_definition/type_definition.json | 4 +- 8 files changed, 100 insertions(+), 14 deletions(-) diff --git a/source/ada/lsp-ada_client_capabilities.adb b/source/ada/lsp-ada_client_capabilities.adb index f225324be..da7d88d5d 100644 --- a/source/ada/lsp-ada_client_capabilities.adb +++ b/source/ada/lsp-ada_client_capabilities.adb @@ -90,6 +90,7 @@ package body LSP.Ada_Client_Capabilities is Result.definitionProvider := LSP.Constants.True; Result.foldingRangeProvider := LSP.Constants.True; Result.implementationProvider := LSP.Constants.True; + Result.typeDefinitionProvider := LSP.Constants.True; end return; end To_Server_Capabilities; diff --git a/source/ada/lsp-ada_handlers.adb b/source/ada/lsp-ada_handlers.adb index 569c34976..05cc921a1 100644 --- a/source/ada/lsp-ada_handlers.adb +++ b/source/ada/lsp-ada_handlers.adb @@ -1677,6 +1677,84 @@ package body LSP.Ada_Handlers is Self.Sender.On_Shutdown_Response (Id, Result); end On_Shutdown_Request; + ------------------------------- + -- On_TypeDefinition_Request -- + ------------------------------- + + overriding procedure On_TypeDefinition_Request + (Self : in out Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TypeDefinitionParams) + is + + Response : LSP.Structures.Definition_Result (LSP.Structures.Varian_1); + Vector : LSP.Structures.Location_Vector renames Response.Varian_1; + Imprecise : Boolean := False; + + procedure Resolve_In_Context (C : LSP.Ada_Context_Sets.Context_Access); + -- Utility function to gather results on one context + + ------------------------ + -- Resolve_In_Context -- + ------------------------ + + procedure Resolve_In_Context (C : LSP.Ada_Context_Sets.Context_Access) is + Trace : constant GNATCOLL.Traces.Trace_Handle := + LSP.GNATCOLL_Tracers.Handle (Self.Tracer.all); + + Name_Node : constant Libadalang.Analysis.Name := + Laltools.Common.Get_Node_As_Name (Self.Get_Node_At (C.all, Value)); + + Definition : Libadalang.Analysis.Defining_Name; + Type_Decl : Libadalang.Analysis.Base_Type_Decl; + begin + if Name_Node.Is_Null then + return; + end if; + + if Name_Node.P_Is_Defining then + -- Special case if Name_Node is defining, for instance on the X in + -- X : My_Type; + declare + Def_Name : constant Libadalang.Analysis.Defining_Name := + Name_Node.P_Enclosing_Defining_Name; + + Type_Expr : constant Libadalang.Analysis.Type_Expr := + Def_Name.P_Basic_Decl.P_Type_Expression; + begin + if not Type_Expr.Is_Null then + Definition := Laltools.Common.Resolve_Name + (Type_Expr.P_Type_Name, Trace, Imprecise); + end if; + end; + else + -- Name_Node is not defining. In this case we can rely on + -- P_Expression_Type. + Type_Decl := Name_Node.P_Expression_Type; + + -- P_Expression_Type returns the entire expression: narrow the + -- result down to the type declaration. Here we assume that the + -- first defining name in this expression is the name of the type. + if not Type_Decl.Is_Null then + Definition := Type_Decl.P_Defining_Name; + end if; + end if; + + if not Definition.Is_Null then + Self.Append_Location (Vector, Definition); + end if; + end Resolve_In_Context; + + begin + for C of Self.Contexts_For_URI (Value.textDocument.uri) loop + Resolve_In_Context (C); + + exit when Self.Is_Canceled.all; + end loop; + + Self.Sender.On_Definition_Response (Id, Response); + end On_TypeDefinition_Request; + ------------------------- -- Publish_Diagnostics -- ------------------------- diff --git a/source/ada/lsp-ada_handlers.ads b/source/ada/lsp-ada_handlers.ads index bbf913bd7..d5a0a585d 100644 --- a/source/ada/lsp-ada_handlers.ads +++ b/source/ada/lsp-ada_handlers.ads @@ -297,6 +297,11 @@ private Id : LSP.Structures.Integer_Or_Virtual_String; Value : LSP.Structures.CompletionParams); + overriding procedure On_TypeDefinition_Request + (Self : in out Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TypeDefinitionParams); + function To_File (Self : Message_Handler'Class; URI : LSP.Structures.DocumentUri) return GNATCOLL.VFS.Virtual_File diff --git a/source/lsp_3.17/lsp-constants.ads b/source/lsp_3.17/lsp-constants.ads index 75f7db638..51255afbe 100644 --- a/source/lsp_3.17/lsp-constants.ads +++ b/source/lsp_3.17/lsp-constants.ads @@ -55,4 +55,12 @@ package LSP.Constants is return LSP.Structures.callHierarchyProvider_OfServerCapabilities_Optional is (Is_Set => True, Value => True); + function True + return LSP.Structures.typeDefinitionProvider_OfServerCapabilities + is (Kind => LSP.Structures.Varian_1, Varian_1 => True); + + function True + return LSP.Structures.typeDefinitionProvider_OfServerCapabilities_Optional + is (Is_Set => True, Value => True); + end LSP.Constants; diff --git a/testsuite/ada_lsp/type_definition.def_name/test.json b/testsuite/ada_lsp/type_definition.def_name/test.json index 18e04d243..c1a6eb4ad 100644 --- a/testsuite/ada_lsp/type_definition.def_name/test.json +++ b/testsuite/ada_lsp/type_definition.def_name/test.json @@ -71,7 +71,7 @@ }, "wait":[{ "id": "typedefname-1", - "result":[{ + "result":{ "uri": "$URI{test.adb}", "range": { "start": { @@ -83,7 +83,7 @@ "character": 9 } } - }] + } }] } }, { @@ -104,7 +104,7 @@ }, "wait":[{ "id": "typedefname-2", - "result":[{ + "result":{ "uri": "$URI{test.adb}", "range": { "start": { @@ -116,7 +116,7 @@ "character": 9 } } - }] + } }] } }, { @@ -137,7 +137,7 @@ }, "wait":[{ "id": "typedefname-3", - "result":[{ + "result":{ "uri": "$URI{test.adb}", "range": { "start": { @@ -149,7 +149,7 @@ "character": 9 } } - }] + } }] } }, { diff --git a/testsuite/ada_lsp/type_definition.def_name/test.yaml b/testsuite/ada_lsp/type_definition.def_name/test.yaml index 5a3c7b93e..1720bdee4 100644 --- a/testsuite/ada_lsp/type_definition.def_name/test.yaml +++ b/testsuite/ada_lsp/type_definition.def_name/test.yaml @@ -1,4 +1 @@ title: 'type_definition.def_name' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/type_definition/test.yaml b/testsuite/ada_lsp/type_definition/test.yaml index a4714fc80..c24ca1a1f 100644 --- a/testsuite/ada_lsp/type_definition/test.yaml +++ b/testsuite/ada_lsp/type_definition/test.yaml @@ -1,4 +1 @@ title: 'type_definition' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/type_definition/type_definition.json b/testsuite/ada_lsp/type_definition/type_definition.json index 84c1d8270..a1e2d1720 100644 --- a/testsuite/ada_lsp/type_definition/type_definition.json +++ b/testsuite/ada_lsp/type_definition/type_definition.json @@ -71,7 +71,7 @@ }, "wait":[{ "id": "typedefname-1", - "result":[{ + "result":{ "uri": "$URI{bbb.ads}", "range": { "start": { @@ -83,7 +83,7 @@ "character": 15 } } - }] + } }] } }, { From e2d796a5b9ff59aab6390921f5e3b77bd9d8b150 Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Tue, 22 Aug 2023 17:58:31 +0300 Subject: [PATCH 045/152] Add `exit` handler Refs #1170 --- source/ada/lsp-ada_handlers.adb | 10 ++++++++++ source/ada/lsp-ada_handlers.ads | 2 ++ 2 files changed, 12 insertions(+) diff --git a/source/ada/lsp-ada_handlers.adb b/source/ada/lsp-ada_handlers.adb index 05cc921a1..eb75f887f 100644 --- a/source/ada/lsp-ada_handlers.adb +++ b/source/ada/lsp-ada_handlers.adb @@ -1242,6 +1242,16 @@ package body LSP.Ada_Handlers is Self.Log_Method_Out ("On_DidRenameFiles_Notification"); end On_DidRenameFiles_Notification; + --------------------------- + -- On_Exits_Notification -- + --------------------------- + + overriding procedure On_Exits_Notification + (Self : in out Message_Handler) is + begin + LSP.Servers.Server'Class (Self.Sender.all).Stop; + end On_Exits_Notification; + ----------------------------- -- On_FoldingRange_Request -- ----------------------------- diff --git a/source/ada/lsp-ada_handlers.ads b/source/ada/lsp-ada_handlers.ads index d5a0a585d..4d0842119 100644 --- a/source/ada/lsp-ada_handlers.ads +++ b/source/ada/lsp-ada_handlers.ads @@ -222,6 +222,8 @@ private Id : LSP.Structures.Integer_Or_Virtual_String; Value : LSP.Structures.DefinitionParams); + overriding procedure On_Exits_Notification (Self : in out Message_Handler); + overriding procedure On_Shutdown_Request (Self : in out Message_Handler; Id : LSP.Structures.Integer_Or_Virtual_String); From 7d1b889c2718024076c80a489dc870a58fc6d9f8 Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Wed, 23 Aug 2023 13:21:40 +0300 Subject: [PATCH 046/152] Fix project loading if Project_File if `file:///` URI. Refs #1170 --- source/ada/lsp-ada_handlers-project_loading.adb | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/source/ada/lsp-ada_handlers-project_loading.adb b/source/ada/lsp-ada_handlers-project_loading.adb index 33ab866f5..e5feebc5a 100644 --- a/source/ada/lsp-ada_handlers-project_loading.adb +++ b/source/ada/lsp-ada_handlers-project_loading.adb @@ -724,14 +724,22 @@ package body LSP.Ada_Handlers.Project_Loading is -------------------- procedure Reload_Project (Self : in out Message_Handler'CLass) is + Project_File : VSS.Strings.Virtual_String := + Self.Configuration.Project_File; begin - if Self.Configuration.Project_File.Is_Empty then + if Project_File.Starts_With ("file://") then + Project_File := VSS.Strings.Conversions.To_Virtual_String + (URIs.Conversions.To_File + (VSS.Strings.Conversions.To_UTF_8_String (Project_File), True)); + end if; + + if Project_File.Is_Empty then Release_Contexts_And_Project_Info (Self); Ensure_Project_Loaded (Self); else Load_Project_With_Alire (Self, - Self.Configuration.Project_File, + Project_File, Self.Configuration.Scenario_Variables, Self.Configuration.Charset); end if; From 462299670cb2d85b03566374d78e7f7752ea1fae Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Wed, 23 Aug 2023 13:25:10 +0300 Subject: [PATCH 047/152] Add semantic tokens requests Refs #1170 --- source/ada/lsp-ada_client_capabilities.adb | 46 +- source/ada/lsp-ada_client_capabilities.ads | 10 +- source/ada/lsp-ada_handlers.adb | 68 +- source/ada/lsp-ada_handlers.ads | 14 + source/ada/lsp-ada_highlighters.adb | 949 +++++++++++++++++- source/ada/lsp-ada_highlighters.ads | 8 +- source/lsp_3.17/lsp-constants.ads | 14 + source/lsp_3.17/lsp-structures-unwrap.ads | 14 + .../test.json | 35 +- .../test.yaml | 3 - .../V628-012.highlighting.no-libs/test.json | 35 +- .../V628-012.highlighting.no-libs/test.yaml | 3 - 12 files changed, 1111 insertions(+), 88 deletions(-) diff --git a/source/ada/lsp-ada_client_capabilities.adb b/source/ada/lsp-ada_client_capabilities.adb index da7d88d5d..4e0b3ad24 100644 --- a/source/ada/lsp-ada_client_capabilities.adb +++ b/source/ada/lsp-ada_client_capabilities.adb @@ -62,8 +62,10 @@ package body LSP.Ada_Client_Capabilities is ---------------------------- function To_Server_Capabilities - (Self : Client_Capability'Class; - Incremental_Text_Changes : Boolean) + (Self : Client_Capability'Class; + Incremental_Text_Changes : Boolean; + Token_Types : LSP.Structures.Virtual_String_Vector; + Token_Modifiers : LSP.Structures.Virtual_String_Vector) return LSP.Structures.ServerCapabilities is pragma Unreferenced (Self); @@ -91,6 +93,18 @@ package body LSP.Ada_Client_Capabilities is Result.foldingRangeProvider := LSP.Constants.True; Result.implementationProvider := LSP.Constants.True; Result.typeDefinitionProvider := LSP.Constants.True; + + Result.semanticTokensProvider := + (Is_Set => True, + Value => + (Is_SemanticTokensOptions => True, + SemanticTokensOptions => + (full => LSP.Constants.True, + a_range => LSP.Constants.True, + legend => + (tokenTypes => Token_Types, + tokenModifiers => Token_Modifiers), + others => <>))); end return; end To_Server_Capabilities; @@ -109,6 +123,34 @@ package body LSP.Ada_Client_Capabilities is return (if Result.Is_Set then Result.Value else False); end Line_Folding_Only; + --------------------- + -- Token_Modifiers -- + --------------------- + + function Token_Modifiers (Self : Client_Capability'Class) + return LSP.Structures.Virtual_String_Vector + is + use LSP.Structures.Unwrap; + + begin + return tokenModifiers + (semanticTokens (Self.Value.capabilities.textDocument)); + end Token_Modifiers; + + ----------------- + -- Token_Types -- + ----------------- + + function Token_Types (Self : Client_Capability'Class) + return LSP.Structures.Virtual_String_Vector + is + use LSP.Structures.Unwrap; + + begin + return tokenTypes + (semanticTokens (Self.Value.capabilities.textDocument)); + end Token_Types; + -------------------- -- Resolve_Lazily -- -------------------- diff --git a/source/ada/lsp-ada_client_capabilities.ads b/source/ada/lsp-ada_client_capabilities.ads index b9e29390f..57bc63149 100644 --- a/source/ada/lsp-ada_client_capabilities.ads +++ b/source/ada/lsp-ada_client_capabilities.ads @@ -33,7 +33,9 @@ package LSP.Ada_Client_Capabilities is function To_Server_Capabilities (Self : Client_Capability'Class; - Incremental_Text_Changes : Boolean) + Incremental_Text_Changes : Boolean; + Token_Types : LSP.Structures.Virtual_String_Vector; + Token_Modifiers : LSP.Structures.Virtual_String_Vector) return LSP.Structures.ServerCapabilities; -- Calculate server capabilities by client Capability and configuation -- options. @@ -55,6 +57,12 @@ package LSP.Ada_Client_Capabilities is function Resolve_Lazily (Self : Client_Capability'Class) return Boolean; -- Returns True when resolve contains `documentation` and `details` + function Token_Types (Self : Client_Capability'Class) + return LSP.Structures.Virtual_String_Vector; + + function Token_Modifiers (Self : Client_Capability'Class) + return LSP.Structures.Virtual_String_Vector; + private type Client_Capability is tagged limited record diff --git a/source/ada/lsp-ada_handlers.adb b/source/ada/lsp-ada_handlers.adb index eb75f887f..fd5d8ccc2 100644 --- a/source/ada/lsp-ada_handlers.adb +++ b/source/ada/lsp-ada_handlers.adb @@ -1290,6 +1290,35 @@ package body LSP.Ada_Handlers is end if; end On_FoldingRange_Request; + --------------------- + -- On_Full_Request -- + --------------------- + + overriding procedure On_Full_Request + (Self : in out Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SemanticTokensParams) + is + use type LSP.Ada_Documents.Document_Access; + + Document : constant LSP.Ada_Documents.Document_Access := + Self.Get_Open_Document (Value.textDocument.uri); + + Context : constant LSP.Ada_Context_Sets.Context_Access := + Self.Contexts.Get_Best_Context (Value.textDocument.uri); + + Response : LSP.Structures.SemanticTokens_Or_Null (Is_Null => False); + + Result : LSP.Structures.Natural_Vector renames + Response.Value.data; + begin + if Document /= null then + Result := Document.Get_Tokens (Context.all, Self.Highlighter); + end if; + + Self.Sender.On_Full_Response (Id, Response); + end On_Full_Request; + ------------------------------- -- On_Implementation_Request -- ------------------------------- @@ -1487,11 +1516,18 @@ package body LSP.Ada_Handlers is Value : LSP.Structures.InitializeParams) is Response : LSP.Structures.InitializeResult; + Token_Types : LSP.Structures.Virtual_String_Vector; + Token_Motifiers : LSP.Structures.Virtual_String_Vector; begin Self.Client.Initialize (Value); + Self.Highlighter.Initialize + (Self.Client, Token_Types, Token_Motifiers); + Response.capabilities := Self.Client.To_Server_Capabilities - (Self.Incremental_Text_Changes); + (Self.Incremental_Text_Changes, + Token_Types, + Token_Motifiers); Self.Sender.On_Initialize_Response (Id, Response); end On_Initialize_Request; @@ -1687,6 +1723,36 @@ package body LSP.Ada_Handlers is Self.Sender.On_Shutdown_Response (Id, Result); end On_Shutdown_Request; + ----------------------------- + -- On_Tokens_Range_Request -- + ----------------------------- + + overriding procedure On_Tokens_Range_Request + (Self : in out Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SemanticTokensRangeParams) + is + use type LSP.Ada_Documents.Document_Access; + + Document : constant LSP.Ada_Documents.Document_Access := + Self.Get_Open_Document (Value.textDocument.uri); + + Context : constant LSP.Ada_Context_Sets.Context_Access := + Self.Contexts.Get_Best_Context (Value.textDocument.uri); + + Response : LSP.Structures.SemanticTokens_Or_Null (Is_Null => False); + + Result : LSP.Structures.Natural_Vector renames + Response.Value.data; + begin + if Document /= null then + Result := Document.Get_Tokens + (Context.all, Self.Highlighter, Value.a_range); + end if; + + Self.Sender.On_Full_Response (Id, Response); + end On_Tokens_Range_Request; + ------------------------------- -- On_TypeDefinition_Request -- ------------------------------- diff --git a/source/ada/lsp-ada_handlers.ads b/source/ada/lsp-ada_handlers.ads index 4d0842119..8ec68d8bc 100644 --- a/source/ada/lsp-ada_handlers.ads +++ b/source/ada/lsp-ada_handlers.ads @@ -32,6 +32,7 @@ with LSP.Ada_Configurations; with LSP.Ada_Context_Sets; with LSP.Ada_Documents; with LSP.Ada_File_Sets; +with LSP.Ada_Highlighters; with LSP.Client_Message_Receivers; with LSP.Server_Message_Visitors; with LSP.Server_Notification_Receivers; @@ -148,6 +149,9 @@ private -- is known to the server, this context should map to the implicit -- project. + Highlighter : LSP.Ada_Highlighters.Ada_Highlighter; + -- Semantic token highlighter for Ada + Incremental_Text_Changes : Boolean; -- the support for incremental text changes is active @@ -262,6 +266,11 @@ private Id : LSP.Structures.Integer_Or_Virtual_String; Value : LSP.Structures.FoldingRangeParams); + overriding procedure On_Full_Request + (Self : in out Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SemanticTokensParams); + overriding procedure On_DidChangeConfiguration_Notification (Self : in out Message_Handler; Value : LSP.Structures.DidChangeConfigurationParams); @@ -299,6 +308,11 @@ private Id : LSP.Structures.Integer_Or_Virtual_String; Value : LSP.Structures.CompletionParams); + overriding procedure On_Tokens_Range_Request + (Self : in out Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SemanticTokensRangeParams); + overriding procedure On_TypeDefinition_Request (Self : in out Message_Handler; Id : LSP.Structures.Integer_Or_Virtual_String; diff --git a/source/ada/lsp-ada_highlighters.adb b/source/ada/lsp-ada_highlighters.adb index a9ffb6ca9..01e54b23c 100644 --- a/source/ada/lsp-ada_highlighters.adb +++ b/source/ada/lsp-ada_highlighters.adb @@ -1,7 +1,7 @@ ------------------------------------------------------------------------------ -- Language Server Protocol -- -- -- --- Copyright (C) 2022-2023, AdaCore -- +-- Copyright (C) 2022, AdaCore -- -- -- -- This is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -15,20 +15,849 @@ -- of the license. -- ------------------------------------------------------------------------------ +with Ada.Containers.Vectors; + +with GNATCOLL.Traces; + +with Langkit_Support.Slocs; +with Langkit_Support.Text; +with Langkit_Support.Token_Data_Handlers; +with Libadalang.Common; use Libadalang.Common; + +with VSS.Strings; + package body LSP.Ada_Highlighters is + Highlighter_Debug : constant GNATCOLL.Traces.Trace_Handle := + GNATCOLL.Traces.Create ("ALS.HIGHLIGHTERS.DEBUG", GNATCOLL.Traces.Off); + + Skip : LSP.Enumerations.SemanticTokenTypes renames LSP.Enumerations.macro; + -- A dedicated token type for unsupported tokens + + package Highlights_Holders is + type Highlights_Holder is tagged limited private; + -- Highlights_Holder stores style for each token in the range given + -- on initialization. + + procedure Initialize + (Self : in out Highlights_Holder'Class; + From : Libadalang.Common.Token_Reference; + To : Libadalang.Common.Token_Reference; + Empty : out Boolean); + -- Initialize holder by providing token range. If From or To is a trivia + -- holder uses corresponding non-trivia token instead. + + procedure Set_Token_Kind + (Self : in out Highlights_Holder'Class; + Token : Libadalang.Common.Token_Reference; + Value : LSP.Enumerations.SemanticTokenTypes) + with Pre => not Libadalang.Common.Is_Trivia (Token); + + procedure Set_Token_Modifier + (Self : in out Highlights_Holder'Class; + Token : Libadalang.Common.Token_Reference; + Value : LSP.Enumerations.SemanticTokenModifiers) + with Pre => not Libadalang.Common.Is_Trivia (Token); + + procedure Set_Token_Modifier + (Self : in out Highlights_Holder'Class; + From : Libadalang.Common.Token_Reference; + To : Libadalang.Common.Token_Reference; + Value : LSP.Enumerations.SemanticTokenModifiers) + with Pre => not Libadalang.Common.Is_Trivia (From) and then + not Libadalang.Common.Is_Trivia (To); + -- Set a modifier on each token in the range From .. To + + type Modifier_Set is + array (LSP.Enumerations.SemanticTokenModifiers) of Boolean + with Pack; + + Empty : constant Modifier_Set := (others => False); + + type Semantic_Token (Is_Set : Boolean := False) is record + Modifiers : Modifier_Set; + + case Is_Set is + when True => + Kind : LSP.Enumerations.SemanticTokenTypes; + when False => + null; + end case; + end record; + + function Get + (Self : Highlights_Holder'Class; + Token : Libadalang.Common.Token_Reference) + return Semantic_Token + with Pre => not Libadalang.Common.Is_Trivia (Token); + + private + + package Semantic_Token_Vectors is new Ada.Containers.Vectors + (Index_Type => Langkit_Support.Token_Data_Handlers.Token_Index, + Element_Type => Semantic_Token); + + type Highlights_Holder is tagged limited record + First : Langkit_Support.Token_Data_Handlers.Token_Index; + Vector : Semantic_Token_Vectors.Vector; + end record; + end Highlights_Holders; + + function To_Int + (Self : Ada_Highlighter'Class; + Set : Highlights_Holders.Modifier_Set) return Natural + with Inline; + -- Cast set of modifiers to uinteger + + ------------------------ + -- Highlights_Holders -- + ------------------------ + + package body Highlights_Holders is + + ---------------- + -- Initialize -- + ---------------- + + procedure Initialize + (Self : in out Highlights_Holder'Class; + From : Libadalang.Common.Token_Reference; + To : Libadalang.Common.Token_Reference; + Empty : out Boolean) + is + use type Langkit_Support.Token_Data_Handlers.Token_Index; + + First : Libadalang.Common.Token_Reference := From; + Last : Libadalang.Common.Token_Reference := To; + + Count : Langkit_Support.Token_Data_Handlers.Token_Index; + None : constant Semantic_Token := + (Is_Set => False, Modifiers => (others => False)); + begin + if Libadalang.Common.Is_Trivia (First) then + First := Libadalang.Common.Next (First, Exclude_Trivia => True); + end if; + + if Libadalang.Common.Is_Trivia (Last) then + Last := Libadalang.Common.Previous (Last, Exclude_Trivia => True); + end if; + + if Libadalang.Common.No_Token in First | Last + or else Last < First + then + Self.First := 0; + Self.Vector.Clear; + Empty := True; + return; + end if; + + Self.First := Libadalang.Common.Index (First); + Count := Libadalang.Common.Index (Last) - Self.First + 1; + + Self.Vector.Clear; + Self.Vector.Append (None, Ada.Containers.Count_Type (Count)); + Empty := False; + end Initialize; + + --------- + -- Get -- + --------- + + function Get + (Self : Highlights_Holder'Class; + Token : Libadalang.Common.Token_Reference) return Semantic_Token + is + use type Langkit_Support.Token_Data_Handlers.Token_Index; + + Index : constant Langkit_Support.Token_Data_Handlers.Token_Index := + Libadalang.Common.Index (Token) - Self.First; + begin + return Self.Vector (Index); + end Get; + + ------------------------ + -- Set_Token_Modifier -- + ------------------------ + + procedure Set_Token_Modifier + (Self : in out Highlights_Holder'Class; + Token : Libadalang.Common.Token_Reference; + Value : LSP.Enumerations.SemanticTokenModifiers) + is + use type Langkit_Support.Token_Data_Handlers.Token_Index; + Index : constant Langkit_Support.Token_Data_Handlers.Token_Index := + Libadalang.Common.Index (Token) - Self.First; + begin + Self.Vector (Index).Modifiers (Value) := True; + end Set_Token_Modifier; + + ------------------------ + -- Set_Token_Modifier -- + ------------------------ + + procedure Set_Token_Modifier + (Self : in out Highlights_Holder'Class; + From : Libadalang.Common.Token_Reference; + To : Libadalang.Common.Token_Reference; + Value : LSP.Enumerations.SemanticTokenModifiers) + is + use type Langkit_Support.Token_Data_Handlers.Token_Index; + + Token : Libadalang.Common.Token_Reference := From; + Index : Langkit_Support.Token_Data_Handlers.Token_Index; + begin + loop + if Libadalang.Common.Index (Token) >= Self.First then + Index := Libadalang.Common.Index (Token) - Self.First; + + if Index <= Self.Vector.Last_Index then + Self.Vector (Index).Modifiers (Value) := True; + end if; + end if; + + exit when Token = To; + + Token := Libadalang.Common.Next (Token, Exclude_Trivia => True); + end loop; + end Set_Token_Modifier; + + -------------------- + -- Set_Token_Kind -- + -------------------- + + procedure Set_Token_Kind + (Self : in out Highlights_Holder'Class; + Token : Libadalang.Common.Token_Reference; + Value : LSP.Enumerations.SemanticTokenTypes) + is + use type Langkit_Support.Token_Data_Handlers.Token_Index; + Index : constant Langkit_Support.Token_Data_Handlers.Token_Index := + Libadalang.Common.Index (Token) - Self.First; + begin + if Self.Vector (Index).Is_Set then + Self.Vector (Index).Kind := Value; + else + Self.Vector.Replace_Element + (Index, (True, Self.Vector (Index).Modifiers, Value)); + end if; + end Set_Token_Kind; + + end Highlights_Holders; + ---------------- -- Get_Tokens -- ---------------- function Get_Tokens - (Self : Ada_Highlighter'Class; Unit : Libadalang.Analysis.Analysis_Unit; - Tracer : in out LSP.Tracers.Tracer'Class; Span : LSP.Structures.A_Range) + (Self : Ada_Highlighter'Class; + Unit : Libadalang.Analysis.Analysis_Unit; + Tracer : in out LSP.Tracers.Tracer'Class; + Span : LSP.Structures.A_Range) return LSP.Structures.Natural_Vector is - pragma Unreferenced (Self, Unit, Tracer, Span); + + First_Token : constant Libadalang.Common.Token_Reference := + (if Span.an_end.line = 0 then Unit.First_Token + else Unit.Lookup_Token + ((Langkit_Support.Slocs.Line_Number (Span.start.line + 1), 1))); + + Last_Token : constant Libadalang.Common.Token_Reference := + (if Span.an_end.line = 0 then Unit.Last_Token + else Unit.Lookup_Token + ((Langkit_Support.Slocs.Line_Number (Span.an_end.line + 2), 1))); + + From_Token : constant Libadalang.Common.Token_Reference := + (if Libadalang.Common.Is_Trivia (First_Token) + then Libadalang.Common.Next (First_Token, Exclude_Trivia => True) + else First_Token); + + To_Token : constant Libadalang.Common.Token_Reference := + (if Libadalang.Common.Is_Trivia (Last_Token) + then Libadalang.Common.Previous (Last_Token, Exclude_Trivia => True) + else Last_Token); + + function Is_Ghost_Root_Node + (Node : Libadalang.Analysis.Ada_Node'Class) return Boolean; + -- Check if given node is a declaration and has ghost aspect + + procedure Highlight_Token + (Token : Libadalang.Common.Token_Reference; + Kind : LSP.Enumerations.SemanticTokenTypes); + -- Highlight given Token with token Kind + + procedure Highlight_Token + (Token : Libadalang.Common.Token_Reference; + Kind : LSP.Enumerations.SemanticTokenModifiers); + -- Highlight given Token with token Kind + + function Highlight_Node + (Node : Libadalang.Analysis.Ada_Node'Class) + return Libadalang.Common.Visit_Status; + -- Highlight given node + + procedure Highlight_Name + (Node : Libadalang.Analysis.Name'Class); + -- Highlight given name with token Kind + + procedure Get_Result + (Holder : Highlights_Holders.Highlights_Holder; + Result : out LSP.Structures.Natural_Vector); + + ---------------- + -- Get_Result -- + ---------------- + + procedure Get_Result + (Holder : Highlights_Holders.Highlights_Holder; + Result : out LSP.Structures.Natural_Vector) + is + use all type LSP.Enumerations.SemanticTokenTypes; + use type Langkit_Support.Slocs.Line_Number; + use type Langkit_Support.Slocs.Column_Number; + + subtype uint is Natural; + + Last : Langkit_Support.Slocs.Source_Location := (1, 1); + + Token : Libadalang.Common.Token_Reference := From_Token; + begin + -- Scan over all tokens and find a corresponding value in Holder + while Token < To_Token loop + + declare + Value : constant Highlights_Holders.Semantic_Token := + Holder.Get (Token); + + Token_Data : constant Libadalang.Common.Token_Data_Type := + Libadalang.Common.Data (Token); + begin + declare + use type Highlights_Holders.Modifier_Set; + + Sloc_Range : constant + Langkit_Support.Slocs.Source_Location_Range := + Libadalang.Common.Sloc_Range (Token_Data); + + Start : constant Langkit_Support.Slocs.Source_Location := + Langkit_Support.Slocs.Start_Sloc (Sloc_Range); + + Map : constant array (Libadalang.Common.Token_Kind) of + LSP.Enumerations.SemanticTokenTypes := + (Ada_All .. Ada_Xor | Ada_With => keyword, + Ada_Par_Close .. Ada_Target => operator, + Ada_String | Ada_Char => LSP.Enumerations.string, + Ada_Decimal | Ada_Integer => number, + Ada_Comment => comment, + Ada_Identifier => Skip, + others => Skip); + + Mapped_Token : constant LSP.Enumerations.SemanticTokenTypes := + Map (Libadalang.Common.Kind (Token_Data)); + begin + -- If we have no token type calculated and no modifiers then + -- skip this token. For instance skip string literals those + -- are not in GHost code. This lets VS Code use rule-based + -- (lexical level) highlighter. Such highlighter is capable + -- to highlight character escape sequences inside a string + -- literal, or +/- before exponent in numeric literal, etc. + if Value.Is_Set or + (Mapped_Token /= Skip and then + Self.Token_Types.Contains (Mapped_Token) and then + Value.Modifiers /= Highlights_Holders.Empty) + then + pragma Assert + (Sloc_Range.End_Line = Sloc_Range.Start_Line); + + -- deltaLine + Result.Append (uint (Start.Line - Last.Line)); + -- deltaStartChar + Result.Append + (uint + (Start.Column - + (if Start.Line = Last.Line + then Last.Column else 1))); + -- length + Result.Append + (uint + (Sloc_Range.End_Column - Sloc_Range.Start_Column)); + -- tokenType + Result.Append + (Self.Token_Types + (if Value.Is_Set then Value.Kind else Mapped_Token)); + -- tokenModifiers + Result.Append (Self.To_Int (Value.Modifiers)); + + Last := Start; + end if; + end; + + Token := Libadalang.Common.Next (Token, Exclude_Trivia => True); + + exit when not (Token < To_Token); + end; + end loop; + end Get_Result; + + -------------------- + -- Highlight_Name -- + -------------------- + + procedure Highlight_Name (Node : Libadalang.Analysis.Name'Class) is + use all type LSP.Enumerations.SemanticTokenTypes; + use all type LSP.Enumerations.SemanticTokenModifiers; + use type Libadalang.Analysis.Defining_Name; + + function To_Kind (Decl : Libadalang.Analysis.Basic_Decl) + return LSP.Enumerations.SemanticTokenTypes; + + function Has_Abstract (Decl : Libadalang.Analysis.Basic_Decl) + return Boolean; + + function Is_Predefined (Decl : Libadalang.Analysis.Basic_Decl) + return Boolean; + + ------------------ + -- Has_Abstract -- + ------------------ + + function Has_Abstract (Decl : Libadalang.Analysis.Basic_Decl) + return Boolean + is + begin + case Decl.Kind is + when Ada_Abstract_Formal_Subp_Decl | + Ada_Abstract_Subp_Decl + => + return True; + when others => + return False; + end case; + end Has_Abstract; + + ------------------- + -- Is_Predefined -- + ------------------- + + function Is_Predefined (Decl : Libadalang.Analysis.Basic_Decl) + return Boolean + is + + function Is_Synthetic + (Node : Libadalang.Analysis.Ada_Node'Class) return Boolean; + + function Is_Synthetic + (Node : Libadalang.Analysis.Ada_Node'Class) return Boolean + is + Std : constant String := "__standard"; + File : constant String := Node.Unit.Get_Filename; + begin + return File'Length >= Std'Length + and then File (File'Last - Std'Length + 1 .. File'Last) = Std; + end Is_Synthetic; + + Name : Libadalang.Analysis.Name := + Decl.P_Enclosing_Compilation_Unit.P_Decl.P_Defining_Name.F_Name; + begin + if Is_Synthetic (Decl) then + return True; -- In Standard package + end if; + + while not Name.Is_Null and then Name.Kind = Ada_Dotted_Name loop + Name := Name.As_Dotted_Name.F_Prefix; + end loop; + + if not Name.Is_Null + and then Name.Kind = Ada_Identifier + and then (Name.P_Name_Is (Self.Ada) + or Name.P_Name_Is (Self.System) + or Name.P_Name_Is (Self.Interfaces)) + then + return True; + else + return False; + end if; + end Is_Predefined; + + ------------- + -- To_Kind -- + ------------- + + function To_Kind (Decl : Libadalang.Analysis.Basic_Decl) + return LSP.Enumerations.SemanticTokenTypes is + begin + case Decl.Kind is + when Libadalang.Common.Ada_Basic_Subp_Decl => + if Decl.Kind = Ada_Enum_Literal_Decl then + return enumMember; + else + return a_function; + end if; + when Libadalang.Common.Ada_Base_Type_Decl => + begin + if Decl.Kind = Ada_Single_Task_Type_Decl then + return variable; + elsif Decl.As_Base_Type_Decl.P_Is_Enum_Type then + return enum; + elsif Decl.As_Base_Type_Decl.P_Is_Interface_Type then + return an_interface; + elsif Decl.As_Base_Type_Decl.P_Is_Tagged_Type then + return class; + elsif Decl.As_Base_Type_Decl.P_Is_Record_Type then + return struct; + else + return a_type; + end if; + exception + when Property_Error => + -- If an error occurs while analysing the type (e.g. + -- incomplete code), default to "type". + return a_type; + end; + + when Ada_Base_Formal_Param_Decl => + case Ada_Base_Formal_Param_Decl'(Decl.Kind) is + when Ada_Component_Decl => + return property; + when Ada_Discriminant_Spec => + return typeParameter; + when Ada_Param_Spec => + return parameter; + when Ada_Generic_Formal_Obj_Decl => + return variable; + when Ada_Generic_Formal_Package => + return namespace; + when Ada_Generic_Formal_Subp_Decl => + return a_function; + when Ada_Generic_Formal_Type_Decl => + return a_type; -- class/enum/interface/struct...? + when Ada_Synthetic_Formal_Param_Decl => + -- Synthetic nodes do not correspond to source text + return Skip; + end case; + + when Libadalang.Common.Ada_Base_Package_Decl => + return namespace; + + when Ada_Body_Node => + begin + declare + Spec : constant Libadalang.Analysis.Basic_Decl := + Decl.As_Body_Node.P_Decl_Part (True); + begin + if not Spec.Is_Null then + -- If there's a spec, use it to determine the kind + return To_Kind (Spec); + end if; + end; + exception + when Property_Error => + -- In case of errors while trying to obtain the spec + -- (e.g. incomplete code), continue the logic below + -- based on the body node. + null; + end; + + -- If the above fails, handle the kinds of bodies directly + case Ada_Body_Node'(Decl.Kind) is + when Ada_Accept_Stmt_Body => + return Skip; + when Ada_Base_Subp_Body => + return a_function; + when Ada_Package_Body_Stub => + return namespace; + when Ada_Protected_Body_Stub => + return variable; + when Ada_Subp_Body_Stub => + return a_function; + when Ada_Task_Body_Stub => + return variable; + when Ada_Entry_Body => + return variable; + when Ada_Package_Body => + return namespace; + when Ada_Protected_Body => + return variable; + when Ada_Task_Body => + return variable; + end case; + + when Ada_Entry_Index_Spec => + return variable; + when Ada_Exception_Decl => + return a_type; + when Ada_Exception_Handler => + return variable; + when Ada_Object_Decl => + return variable; + when Ada_For_Loop_Var_Decl => + return variable; + when Ada_Generic_Package_Decl => + return namespace; + when Ada_Generic_Subp_Decl => + return a_function; + when Ada_Generic_Package_Instantiation => + return namespace; + when Ada_Generic_Subp_Instantiation => + return a_function; + when Ada_Generic_Package_Renaming_Decl => + return namespace; + when Ada_Generic_Subp_Renaming_Decl => + return a_function; + when Ada_Named_Stmt_Decl => + return namespace; + when Ada_Number_Decl => + return number; + when Ada_Package_Renaming_Decl => + return namespace; + when Ada_Single_Protected_Decl => + return variable; + when Ada_Single_Task_Decl => + return variable; + when others => + return Skip; + end case; + end To_Kind; + + Failsafe_Def : Libadalang.Analysis.Refd_Def; + Def : Libadalang.Analysis.Defining_Name; + Decl : Libadalang.Analysis.Basic_Decl; + Kind : LSP.Enumerations.SemanticTokenTypes; + begin + if Node.Kind not in Ada_Identifier | Ada_String_Literal then + -- Highlight only identifiers and operator symbols + return; + end if; + + if Node.P_Is_Defining then + Def := Node.P_Enclosing_Defining_Name; + + begin + declare + Is_Canonical : constant Boolean := + not Def.Is_Null and then Def.P_Canonical_Part = Def; + begin + if Is_Canonical then + Highlight_Token (Node.Token_Start, declaration); + else + Highlight_Token (Node.Token_Start, definition); + end if; + end; + exception + when Property_Error => + -- In case of errors (e.g. incomplete code) consider it + -- a canonical declaration. + Highlight_Token (Node.Token_Start, declaration); + end; + else + Failsafe_Def := Node.P_Failsafe_Referenced_Def_Name (True); + Def := Libadalang.Analysis.Defining_Name (Failsafe_Def.Def_Name); + end if; + + if Node.Kind in Libadalang.Common.Ada_Name then + begin + if Node.As_Name.P_Is_Write_Reference (True) then + Highlight_Token (Node.Token_Start, modification); + end if; + exception + when Libadalang.Common.Property_Error => null; + end; + end if; + + if not Def.Is_Null then + Decl := Def.P_Basic_Decl; + + if not Decl.Is_Null then + Kind := To_Kind (Decl); + if Kind /= Skip then + Highlight_Token (Node.Token_Start, Kind); + end if; + + begin + if Kind in variable | parameter | typeParameter | property + and then Decl.P_Is_Constant_Object + then + Highlight_Token (Node.Token_Start, readonly); + end if; + exception + when Libadalang.Common.Property_Error => null; + end; + + begin + if Decl.P_Is_Static_Decl then + Highlight_Token (Node.Token_Start, static); + end if; + exception + when Libadalang.Common.Property_Error => null; + end; + + begin + -- P_Has_Aspect checks the existence of either an aspect or + -- a pragma. + if Def.P_Has_Aspect (Self.Obsolescent) then + Highlight_Token (Node.Token_Start, deprecated); + end if; + exception + when Libadalang.Common.Property_Error => null; + end; + + if Has_Abstract (Decl) then + Highlight_Token (Node.Token_Start, an_abstract); + end if; + + if Is_Predefined (Decl) then + Highlight_Token (Node.Token_Start, defaultLibrary); + end if; + + return; + end if; + elsif Node.Kind = Ada_String_Literal then + return; -- This is not an operator symbol, so do nothing + end if; + + if Node.P_Is_Operator_Name then + Highlight_Token (Node.Token_Start, operator); + else + -- In case of unresolved identifiers, do not set any semantic + -- highlighting + null; + end if; + end Highlight_Name; + + Holder : Highlights_Holders.Highlights_Holder; + + -------------------- + -- Highlight_Node -- + -------------------- + + function Highlight_Node + (Node : Libadalang.Analysis.Ada_Node'Class) + return Libadalang.Common.Visit_Status + is + use all type LSP.Enumerations.SemanticTokenModifiers; + begin + if Node.Token_End < From_Token or To_Token < Node.Token_Start then + -- Skip uninteresting nodes to speedup traversal + return Libadalang.Common.Over; + elsif Is_Ghost_Root_Node (Node) then + -- Mark all tokens in a ghost element as `documentation` + Holder.Set_Token_Modifier + (Node.Token_Start, Node.Token_End, documentation); + end if; + + case Node.Kind is + when Libadalang.Common.Ada_Name => + Highlight_Name (Node.As_Name); + + when others => + null; + end case; + + return Libadalang.Common.Into; + exception + when E : Libadalang.Common.Property_Error => + if Highlighter_Debug.Is_Active then + Tracer.Trace_Exception + (E, + "In Highlight_Node at "); + + Tracer.Trace + (Langkit_Support.Text.Image (Node.Full_Sloc_Image)); + end if; + + return Libadalang.Common.Into; + end Highlight_Node; + + --------------------- + -- Highlight_Token -- + --------------------- + + procedure Highlight_Token + (Token : Libadalang.Common.Token_Reference; + Kind : LSP.Enumerations.SemanticTokenTypes) is + begin + if Token < From_Token or To_Token < Token then + -- Skip uninteresting tokens + return; + elsif not Self.Token_Types.Contains (Kind) then + -- Skip unsupported tokens + return; + end if; + + Holder.Set_Token_Kind (Token, Kind); + end Highlight_Token; + + --------------------- + -- Highlight_Token -- + --------------------- + + procedure Highlight_Token + (Token : Libadalang.Common.Token_Reference; + Kind : LSP.Enumerations.SemanticTokenModifiers) is + begin + if Token < From_Token or To_Token < Token then + -- Skip uninteresting tokens + return; + elsif not Self.Token_Modifiers.Contains (Kind) then + -- Skip unsupported tokens + return; + end if; + + Holder.Set_Token_Modifier (Token, Kind); + end Highlight_Token; + + ------------------------ + -- Is_Ghost_Root_Node -- + ------------------------ + + function Is_Ghost_Root_Node + (Node : Libadalang.Analysis.Ada_Node'Class) return Boolean is + begin + case Node.Kind is + when Libadalang.Common.Ada_Basic_Decl => + declare + Name : constant Libadalang.Analysis.Defining_Name := + Node.As_Basic_Decl.P_Defining_Name; + begin + return not Name.Is_Null and then Name.P_Is_Ghost_Code; + end; + when Libadalang.Common.Ada_Aspect_Spec => + -- Mark all aspects as a ghost code, because most of aspects + -- are contract specifications. + return True; + when others => + return False; + end case; + exception + when Libadalang.Common.Property_Error => + return False; + end Is_Ghost_Root_Node; + + Root : constant Libadalang.Analysis.Ada_Node := + Libadalang.Analysis.Root (Unit); + + Empty : Boolean; + begin - return LSP.Structures.Empty; + if Root.Is_Null or else + Libadalang.Common.No_Token in From_Token | To_Token + then + -- No tokens to highlight + return LSP.Structures.Empty; + end if; + + Holder.Initialize (From_Token, To_Token, Empty); + + if Empty then + return LSP.Structures.Empty; + end if; + + -- Traverse whole tree, look for intresting nodes and mark their + -- tokens in Holder for further processing + Root.Traverse (Highlight_Node'Access); + + return Result : LSP.Structures.Natural_Vector do + Get_Result (Holder, Result); + end return; end Get_Tokens; ---------------- @@ -36,11 +865,113 @@ package body LSP.Ada_Highlighters is ---------------- procedure Initialize - (Self : in out Ada_Highlighter'Class; - Client : LSP.Structures.SemanticTokensClientCapabilities; - Legend : out LSP.Structures.SemanticTokensLegend) is + (Self : in out Ada_Highlighter'Class; + Client : LSP.Ada_Client_Capabilities.Client_Capability; + Types : out LSP.Structures.Virtual_String_Vector; + Modifiers : out LSP.Structures.Virtual_String_Vector) + is + use all type LSP.Enumerations.SemanticTokenTypes; + use all type LSP.Enumerations.SemanticTokenModifiers; + + procedure Append_Type + (Kind : LSP.Enumerations.SemanticTokenTypes; + Image : VSS.Strings.Virtual_String); + -- Update Legend.tokenTypes if client understands given Kind + + procedure Append_Modifier + (Kind : LSP.Enumerations.SemanticTokenModifiers; + Image : VSS.Strings.Virtual_String); + -- Update Legend.tokenModifiers if client understands given Kind + + function "+" (Source : Wide_Wide_String) return Unbounded_Text_Type + renames Ada.Strings.Wide_Wide_Unbounded.To_Unbounded_Wide_Wide_String; + + procedure Append_Modifier + (Kind : LSP.Enumerations.SemanticTokenModifiers; + Image : VSS.Strings.Virtual_String) is + begin + if Client.Token_Modifiers.Contains (Image) then + Self.Token_Modifiers.Insert + (Kind, Natural (2 ** Modifiers.Length)); + + Modifiers.Append (Image); + end if; + end Append_Modifier; + + ----------------- + -- Append_Type -- + ----------------- + + procedure Append_Type + (Kind : LSP.Enumerations.SemanticTokenTypes; + Image : VSS.Strings.Virtual_String) is + begin + if Client.Token_Types.Contains (Image) then + Self.Token_Types.Insert (Kind, Types.Length); + + Types.Append (Image); + end if; + end Append_Type; + begin - null; + Append_Type (namespace, "namespace"); + Append_Type (a_type, "type"); + Append_Type (class, "class"); + Append_Type (enum, "enum"); + Append_Type (an_interface, "interface"); + Append_Type (struct, "struct"); + Append_Type (typeParameter, "typeParameter"); + Append_Type (parameter, "parameter"); + Append_Type (variable, "variable"); + Append_Type (property, "property"); + Append_Type (enumMember, "enumMember"); + -- Append_Type (event, "event"); + Append_Type (a_function, "function"); + -- Append_Type (method, "method"); + -- Append_Type (macro, "macro"); + Append_Type (keyword, "keyword"); + Append_Type (modifier, "modifier"); + Append_Type (comment, "comment"); + Append_Type (LSP.Enumerations.string, "string"); + Append_Type (number, "number"); + -- Append_Type (regexp, "regexp"); + Append_Type (operator, "operator"); + + Append_Modifier (declaration, "declaration"); + Append_Modifier (definition, "definition"); + Append_Modifier (readonly, "readonly"); + Append_Modifier (static, "static"); + Append_Modifier (deprecated, "deprecated"); + Append_Modifier (an_abstract, "abstract"); + -- Append_Modifier (async, "async"); + Append_Modifier (modification, "modification"); + Append_Modifier (documentation, "documentation"); + Append_Modifier (defaultLibrary, "defaultLibrary"); + + Self.Obsolescent := +"Obsolescent"; + Self.Ada := +"Ada"; + Self.System := +"System"; + Self.Interfaces := +"Interfaces"; end Initialize; + ------------ + -- To_Int -- + ------------ + + function To_Int + (Self : Ada_Highlighter'Class; + Set : Highlights_Holders.Modifier_Set) return Natural + is + + Result : Natural := 0; + begin + for J in Set'Range loop + if Set (J) then + Result := Result + Self.Token_Modifiers (J); + end if; + end loop; + + return Result; + end To_Int; + end LSP.Ada_Highlighters; diff --git a/source/ada/lsp-ada_highlighters.ads b/source/ada/lsp-ada_highlighters.ads index cb566906d..4e4a56382 100644 --- a/source/ada/lsp-ada_highlighters.ads +++ b/source/ada/lsp-ada_highlighters.ads @@ -20,6 +20,7 @@ with Ada.Strings.Wide_Wide_Unbounded; with Libadalang.Analysis; +with LSP.Ada_Client_Capabilities; with LSP.Enumerations; with LSP.Structures; with LSP.Tracers; @@ -29,9 +30,10 @@ package LSP.Ada_Highlighters is type Ada_Highlighter is tagged limited private; procedure Initialize - (Self : in out Ada_Highlighter'Class; - Client : LSP.Structures.SemanticTokensClientCapabilities; - Legend : out LSP.Structures.SemanticTokensLegend); + (Self : in out Ada_Highlighter'Class; + Client : LSP.Ada_Client_Capabilities.Client_Capability; + Types : out LSP.Structures.Virtual_String_Vector; + Modifiers : out LSP.Structures.Virtual_String_Vector); function Get_Tokens (Self : Ada_Highlighter'Class; diff --git a/source/lsp_3.17/lsp-constants.ads b/source/lsp_3.17/lsp-constants.ads index 51255afbe..9b2e3e7f9 100644 --- a/source/lsp_3.17/lsp-constants.ads +++ b/source/lsp_3.17/lsp-constants.ads @@ -4,6 +4,8 @@ -- SPDX-License-Identifier: Apache-2.0 -- +with VSS.JSON.Streams; + with LSP.Structures; package LSP.Constants is @@ -63,4 +65,16 @@ package LSP.Constants is return LSP.Structures.typeDefinitionProvider_OfServerCapabilities_Optional is (Is_Set => True, Value => True); + function True return LSP.Structures.Boolean_Or_Something + is (Is_Boolean => True, Boolean => True); + + function True return LSP.Structures.Boolean_Or_Something_Optional + is (Is_Set => True, Value => True); + + function True return LSP.Structures.Boolean_Or_Any + is [(VSS.JSON.Streams.Boolean_Value, True)]; + + function True return LSP.Structures.Boolean_Or_Any_Optional + is (Is_Set => True, Value => True); + end LSP.Constants; diff --git a/source/lsp_3.17/lsp-structures-unwrap.ads b/source/lsp_3.17/lsp-structures-unwrap.ads index 747aa69d6..095c14a3b 100644 --- a/source/lsp_3.17/lsp-structures-unwrap.ads +++ b/source/lsp_3.17/lsp-structures-unwrap.ads @@ -13,6 +13,20 @@ package LSP.Structures.Unwrap is return FoldingRangeClientCapabilities_Optional is (if X.Is_Set then X.Value.foldingRange else (Is_Set => False)); + function semanticTokens (X : TextDocumentClientCapabilities_Optional) + return SemanticTokensClientCapabilities_Optional is + (if X.Is_Set then X.Value.semanticTokens else (Is_Set => False)); + + function tokenTypes (X : SemanticTokensClientCapabilities_Optional) + return LSP.Structures.Virtual_String_Vector is + (if X.Is_Set then X.Value.tokenTypes + else VSS.String_Vectors.Empty_Virtual_String_Vector); + + function tokenModifiers (X : SemanticTokensClientCapabilities_Optional) + return LSP.Structures.Virtual_String_Vector is + (if X.Is_Set then X.Value.tokenModifiers + else VSS.String_Vectors.Empty_Virtual_String_Vector); + function lineFoldingOnly (X : FoldingRangeClientCapabilities_Optional) return Boolean_Optional is (if X.Is_Set then X.Value.lineFoldingOnly else (Is_Set => False)); diff --git a/testsuite/ada_lsp/V628-012.highlighting.defining_names/test.json b/testsuite/ada_lsp/V628-012.highlighting.defining_names/test.json index 5c03f8f92..17255ff8f 100644 --- a/testsuite/ada_lsp/V628-012.highlighting.defining_names/test.json +++ b/testsuite/ada_lsp/V628-012.highlighting.defining_names/test.json @@ -88,45 +88,14 @@ "result": { "capabilities": { "textDocumentSync": 2, - "completionProvider": { - "triggerCharacters": [ - ".", - ",", - "'", - "(" - ], - "resolveProvider": 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": {} - }, - "hoverProvider": true, - "declarationProvider": true, - "definitionProvider": true, - "typeDefinitionProvider": true, - "implementationProvider": true, - "referencesProvider": true, - "codeActionProvider": { - }, - "renameProvider": { - }, - "foldingRangeProvider": true, - "executeCommandProvider": {}, - "alsReferenceKinds": [ - "reference", - "access", - "write", - "call", - "dispatching call", - "parent", - "child", - "overriding" - ] + "full": true + } } } } diff --git a/testsuite/ada_lsp/V628-012.highlighting.defining_names/test.yaml b/testsuite/ada_lsp/V628-012.highlighting.defining_names/test.yaml index e5b45b580..cd65f15da 100644 --- a/testsuite/ada_lsp/V628-012.highlighting.defining_names/test.yaml +++ b/testsuite/ada_lsp/V628-012.highlighting.defining_names/test.yaml @@ -1,4 +1 @@ title: 'V628-012.highlighting.defining_names' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/V628-012.highlighting.no-libs/test.json b/testsuite/ada_lsp/V628-012.highlighting.no-libs/test.json index 4aacd2508..7fe92c566 100644 --- a/testsuite/ada_lsp/V628-012.highlighting.no-libs/test.json +++ b/testsuite/ada_lsp/V628-012.highlighting.no-libs/test.json @@ -98,45 +98,14 @@ "result": { "capabilities": { "textDocumentSync": 2, - "completionProvider": { - "triggerCharacters": [ - ".", - ",", - "'", - "(" - ], - "resolveProvider": true - }, "semanticTokensProvider": { "legend": { "tokenTypes": ["type","class","enum","interface","struct","typeParameter","parameter","variable","property","enumMember","function","keyword","modifier","comment","string","number","operator"], "tokenModifiers": ["definition","readonly","static","deprecated","abstract","modification","documentation","defaultLibrary"] }, "range": true, - "full": {} - }, - "hoverProvider": true, - "declarationProvider": true, - "definitionProvider": true, - "typeDefinitionProvider": true, - "implementationProvider": true, - "referencesProvider": true, - "codeActionProvider": { - }, - "renameProvider": { - }, - "foldingRangeProvider": true, - "executeCommandProvider": {}, - "alsReferenceKinds": [ - "reference", - "access", - "write", - "call", - "dispatching call", - "parent", - "child", - "overriding" - ] + "full": true + } } } } diff --git a/testsuite/ada_lsp/V628-012.highlighting.no-libs/test.yaml b/testsuite/ada_lsp/V628-012.highlighting.no-libs/test.yaml index 9e5f6ebca..3799e4ffc 100644 --- a/testsuite/ada_lsp/V628-012.highlighting.no-libs/test.yaml +++ b/testsuite/ada_lsp/V628-012.highlighting.no-libs/test.yaml @@ -1,4 +1 @@ title: 'V628-012.highlighting.no-libs' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] From 6e2c51b15ed73d71dcbcd681405cee05bd9c1da4 Mon Sep 17 00:00:00 2001 From: Vadim Godunko Date: Wed, 23 Aug 2023 09:58:06 +0400 Subject: [PATCH 048/152] Add handling of progress messages. --- source/lsp_3.17/lsp-client_message_writers.adb | 11 +++++++++++ source/lsp_3.17/lsp-client_message_writers.ads | 9 +++++++++ 2 files changed, 20 insertions(+) diff --git a/source/lsp_3.17/lsp-client_message_writers.adb b/source/lsp_3.17/lsp-client_message_writers.adb index 797808367..ae925908a 100644 --- a/source/lsp_3.17/lsp-client_message_writers.adb +++ b/source/lsp_3.17/lsp-client_message_writers.adb @@ -17,6 +17,17 @@ package body LSP.Client_Message_Writers is Message.Visit_Client_Receiver (Self.Notification_Writer); end On_Client_Notification; + ------------------------ + -- On_Progress_Report -- + ------------------------ + + overriding procedure On_Progress_Report + (Self : in out Client_Message_Writer; + Message : LSP.Progress_Reports.Progress_Report'Class) is + begin + Message.Visit_Receiver (Self.Progress_Writer); + end On_Progress_Report; + ----------------------- -- On_Client_Request -- ----------------------- diff --git a/source/lsp_3.17/lsp-client_message_writers.ads b/source/lsp_3.17/lsp-client_message_writers.ads index b6de63069..876c0a3b3 100644 --- a/source/lsp_3.17/lsp-client_message_writers.ads +++ b/source/lsp_3.17/lsp-client_message_writers.ads @@ -13,6 +13,8 @@ with LSP.Client_Request_Writers; with LSP.Client_Requests; with LSP.Client_Response_Writers; with LSP.Client_Responses; +with LSP.Progress_Reports; +with LSP.Progress_Report_Writers; package LSP.Client_Message_Writers is pragma Preelaborate; @@ -29,6 +31,9 @@ package LSP.Client_Message_Writers is Response_Writer : LSP.Client_Response_Writers .Client_Response_Writer (Output); + + Progress_Writer : + LSP.Progress_Report_Writers.Progress_Report_Writer (Output); end record; overriding procedure On_Client_Notification @@ -43,4 +48,8 @@ package LSP.Client_Message_Writers is (Self : in out Client_Message_Writer; Message : LSP.Client_Responses.Client_Response'Class); + overriding procedure On_Progress_Report + (Self : in out Client_Message_Writer; + Message : LSP.Progress_Reports.Progress_Report'Class); + end LSP.Client_Message_Writers; From fb72e4f18594be1b8bed53d08093f0946e6f6b54 Mon Sep 17 00:00:00 2001 From: Vadim Godunko Date: Wed, 23 Aug 2023 11:00:01 +0400 Subject: [PATCH 049/152] Indexing of the Ada files. --- source/ada/lsp-ada_contexts.adb | 12 + source/ada/lsp-ada_contexts.ads | 5 + source/ada/lsp-ada_driver.adb | 4 +- .../ada/lsp-ada_handlers-project_loading.adb | 27 +-- source/ada/lsp-ada_handlers.adb | 93 +++++++- source/ada/lsp-ada_handlers.ads | 80 ++++--- source/ada/lsp-ada_indexing.adb | 213 ++++++++++++++++++ source/ada/lsp-ada_indexing.ads | 91 ++++++++ source/server/lsp-server_jobs.ads | 29 +++ source/server/lsp-servers.adb | 31 ++- source/server/lsp-servers.ads | 14 +- testsuite/ada_lsp/indexing_progress/test.json | 26 +-- testsuite/ada_lsp/indexing_progress/test.yaml | 3 - 13 files changed, 550 insertions(+), 78 deletions(-) create mode 100644 source/ada/lsp-ada_indexing.adb create mode 100644 source/ada/lsp-ada_indexing.ads create mode 100644 source/server/lsp-server_jobs.ads diff --git a/source/ada/lsp-ada_contexts.adb b/source/ada/lsp-ada_contexts.adb index 804f6b3e1..b25ee3294 100644 --- a/source/ada/lsp-ada_contexts.adb +++ b/source/ada/lsp-ada_contexts.adb @@ -559,6 +559,18 @@ package body LSP.Ada_Contexts is or else Self.Source_Files.Contains (Self.URI_To_File (URI)); end Is_Part_Of_Project; + ------------------------ + -- Is_Part_Of_Project -- + ------------------------ + + function Is_Part_Of_Project + (Self : Context; + File : Virtual_File) return Boolean is + begin + return Self.Is_Fallback_Context + or else Self.Source_Files.Contains (File); + end Is_Part_Of_Project; + ------------------ -- Load_Project -- ------------------ diff --git a/source/ada/lsp-ada_contexts.ads b/source/ada/lsp-ada_contexts.ads index 91e8d89df..f6e9ce22a 100644 --- a/source/ada/lsp-ada_contexts.ads +++ b/source/ada/lsp-ada_contexts.ads @@ -165,6 +165,11 @@ package LSP.Ada_Contexts is URI : LSP.Structures.DocumentUri) return Boolean; -- Check if given file belongs to the project loaded in the Context + function Is_Part_Of_Project + (Self : Context; + File : GNATCOLL.VFS.Virtual_File) return Boolean; + -- Check if given file belongs to the project loaded in the Context + function List_Files (Self : Context'CLass) return LSP.Ada_File_Sets.File_Sets.Set_Iterator_Interfaces .Reversible_Iterator'Class; diff --git a/source/ada/lsp-ada_driver.adb b/source/ada/lsp-ada_driver.adb index a775656ea..2bf81c2f7 100644 --- a/source/ada/lsp-ada_driver.adb +++ b/source/ada/lsp-ada_driver.adb @@ -62,9 +62,9 @@ procedure LSP.Ada_Driver is Server : aliased LSP.Servers.Server; Stream : aliased LSP.Stdio_Streams.Stdio_Stream; Ada_Handler : aliased LSP.Ada_Handlers.Message_Handler - (Server'Access, Tracer'Unchecked_Access); + (Server'Access, Server'Access, Tracer'Unchecked_Access); GPR_Handler : aliased LSP.Ada_Handlers.Message_Handler - (Server'Access, Tracer'Unchecked_Access); + (Server'Access, Server'Access, Tracer'Unchecked_Access); Fuzzing_Activated : constant Boolean := not VSS.Application.System_Environment.Value ("ALS_FUZZING").Is_Empty; diff --git a/source/ada/lsp-ada_handlers-project_loading.adb b/source/ada/lsp-ada_handlers-project_loading.adb index e5feebc5a..8a83cc390 100644 --- a/source/ada/lsp-ada_handlers-project_loading.adb +++ b/source/ada/lsp-ada_handlers-project_loading.adb @@ -39,6 +39,7 @@ with Spawn.Environments; with LSP.Ada_Contexts; with LSP.Ada_Context_Sets; with LSP.Ada_Handlers.File_Readers; +with LSP.Ada_Indexing; with LSP.Enumerations; with LSP.Structures; @@ -632,15 +633,15 @@ package body LSP.Ada_Handlers.Project_Loading is ------------------------------------ procedure Mark_Source_Files_For_Indexing - (Self : in out Message_Handler'Class) is - begin - Self.Files_To_Index.Clear; + (Self : in out Message_Handler'Class) + is + Files : LSP.Ada_Indexing.File_Sets.Set; + begin -- Mark all the project's source files for C of Self.Contexts.Each_Context loop for F in C.List_Files loop - Self.Files_To_Index.Include - (LSP.Ada_File_Sets.File_Sets.Element (F)); + Files.Include (LSP.Ada_File_Sets.File_Sets.Element (F)); end loop; end loop; @@ -652,15 +653,18 @@ package body LSP.Ada_Handlers.Project_Loading is LSP.Ada_File_Sets.File_Sets.Element (F); begin for Context of Self.Contexts.Each_Context loop - Self.Files_To_Index.Include (File); + Files.Include (File); end loop; end; end loop; end if; - Self.Total_Files_Indexed := 0; - Self.Total_Files_To_Index := Positive'Max - (1, Natural (Self.Files_To_Index.Length)); + LSP.Ada_Indexing.Schedule_Indexing + (Self.Server, + Self'Unchecked_Access, + Self.Configuration, + Self.Project_Stamp, + Files); end Mark_Source_Files_For_Indexing; --------------------------------------- @@ -677,10 +681,7 @@ package body LSP.Ada_Handlers.Project_Loading is Self.Project_Predefined_Sources.Clear; Self.Project_Dirs_Loaded.Clear; - -- Clear indexing data - Self.Files_To_Index.Clear; - Self.Total_Files_To_Index := 1; - Self.Total_Files_Indexed := 0; + Self.Project_Stamp := @ + 1; end Release_Contexts_And_Project_Info; ---------------------------------- diff --git a/source/ada/lsp-ada_handlers.adb b/source/ada/lsp-ada_handlers.adb index fd5d8ccc2..d82e1a6ee 100644 --- a/source/ada/lsp-ada_handlers.adb +++ b/source/ada/lsp-ada_handlers.adb @@ -19,8 +19,13 @@ with Ada.Containers.Indefinite_Hashed_Maps; with Ada.Exceptions; with Ada.Unchecked_Deallocation; +with GNAT.OS_Lib; with GNATCOLL.Traces; +with VSS.Strings.Formatters.Integers; +with VSS.Strings.Formatters.Strings; +with VSS.Strings.Templates; + with Libadalang.Analysis; with Libadalang.Common; @@ -137,6 +142,35 @@ package body LSP.Ada_Handlers is Position : LSP.Structures.TextDocumentPositionParams'Class) return Libadalang.Analysis.Defining_Name; + ----------------------------- + -- Allocate_Progress_Token -- + ----------------------------- + + function Allocate_Progress_Token + (Self : in out Message_Handler'Class; + Operation : VSS.Strings.Virtual_String) + return LSP.Structures.ProgressToken + is + Token_Template : VSS.Strings.Templates.Virtual_String_Template := + "ada_ls-{}-{}-{}"; + + begin + Self.Token_Id := Self.Token_Id + 1; + -- Generate an identifier that has little risk of collision with + -- other language servers, or other occurrences of this server. + -- (There is still a very small risk of collision with PID recyclings, + -- but the consequences are acceptable.) + + return + (Is_Integer => False, + Virtual_String => + Token_Template.Format + (VSS.Strings.Formatters.Integers.Image + (GNAT.OS_Lib.Pid_To_Integer (GNAT.OS_Lib.Current_Process_Id)), + VSS.Strings.Formatters.Strings.Image (Operation), + VSS.Strings.Formatters.Integers.Image (Self.Token_Id))); + end Allocate_Progress_Token; + ----------------------- -- Clean_Diagnostics -- ----------------------- @@ -153,6 +187,35 @@ package body LSP.Ada_Handlers is end if; end Clean_Diagnostics; + ----------------------- + -- Contexts_For_File -- + ----------------------- + + function Contexts_For_File + (Self : access Message_Handler; + File : GNATCOLL.VFS.Virtual_File) + return LSP.Ada_Context_Sets.Context_Lists.List + is + function Is_A_Source (Self : LSP.Ada_Contexts.Context) return Boolean is + (Self.Is_Part_Of_Project (File)); + -- Return True if File is a source of the project held by Context + + begin + -- If the file does not exist on disk, assume this is a file + -- being created and, as a special convenience in this case, + -- assume it could belong to any project. + if not File.Is_Regular_File + -- If the file is a runtime file for the loaded project environment, + -- all projects can see it. + or else Self.Project_Predefined_Sources.Contains (File) + then + return Self.Contexts.Each_Context; + end if; + + -- List contexts where File is a source of the project hierarchy + return Self.Contexts.Each_Context (Is_A_Source'Unrestricted_Access); + end Contexts_For_File; + ---------------------- -- Contexts_For_URI -- ---------------------- @@ -225,6 +288,14 @@ package body LSP.Ada_Handlers is end if; end Get_Open_Document; + ----------------------- + -- Get_Project_Stamp -- + ----------------------- + + function Get_Project_Stamp + (Self : Message_Handler'Class) + return Project_Stamp is (Self.Project_Stamp); + ---------------------------- -- Imprecise_Resolve_Name -- ---------------------------- @@ -265,6 +336,24 @@ package body LSP.Ada_Handlers is Self.Incremental_Text_Changes := Incremental_Text_Changes; end Initialize; + ---------------------- + -- Is_Open_Document -- + ---------------------- + + function Is_Open_Document + (Self : Message_Handler; + File : GNATCOLL.VFS.Virtual_File) return Boolean is + begin + return Self.Open_Documents.Contains (File); + end Is_Open_Document; + + ----------------- + -- Is_Shutdown -- + ----------------- + + function Is_Shutdown + (Self : Message_Handler'Class) return Boolean is (Self.Shutdown); + ------------------- -- Log_Method_In -- ------------------- @@ -1717,9 +1806,7 @@ package body LSP.Ada_Handlers is Result : LSP.Structures.Null_Record; begin - -- Suspend files/runtime indexing after shutdown requst - Self.Indexing_Enabled := False; - + Self.Shutdown := True; Self.Sender.On_Shutdown_Response (Id, Result); end On_Shutdown_Request; diff --git a/source/ada/lsp-ada_handlers.ads b/source/ada/lsp-ada_handlers.ads index 8ec68d8bc..89dd8678c 100644 --- a/source/ada/lsp-ada_handlers.ads +++ b/source/ada/lsp-ada_handlers.ads @@ -39,6 +39,7 @@ with LSP.Server_Notification_Receivers; with LSP.Server_Notifications; with LSP.Server_Request_Receivers; with LSP.Server_Requests; +limited with LSP.Servers; with LSP.Structures; with LSP.Tracers; with LSP.Unimplemented_Handlers; @@ -48,7 +49,9 @@ with URIs; package LSP.Ada_Handlers is type Message_Handler - (Sender : not null access LSP.Client_Message_Receivers + (Server : not null access LSP.Servers.Server'Class; + -- Please avoid to use this discriminant! + Sender : not null access LSP.Client_Message_Receivers .Client_Message_Receiver'Class; Tracer : not null LSP.Tracers.Tracer_Access) is limited new LSP.Server_Message_Visitors.Server_Message_Visitor @@ -64,6 +67,24 @@ package LSP.Ada_Handlers is -- Incremental_Text_Changes - activate the support for incremental text -- changes. + function Contexts_For_File + (Self : access Message_Handler; + File : GNATCOLL.VFS.Virtual_File) + return LSP.Ada_Context_Sets.Context_Lists.List; + + function Is_Shutdown (Self : Message_Handler'Class) return Boolean; + -- Return True when shutdown has been requested. + + function Allocate_Progress_Token + (Self : in out Message_Handler'Class; + Operation : VSS.Strings.Virtual_String) + return LSP.Structures.ProgressToken; + -- Return an unique token for indicating progress + + ---------------------------- + -- Open Document Manger -- + ---------------------------- + function Get_Open_Document (Self : in out Message_Handler; URI : LSP.Structures.DocumentUri; @@ -74,6 +95,22 @@ package LSP.Ada_Handlers is -- will be created and must be freed by the user else null will be -- returned. + function Is_Open_Document + (Self : Message_Handler; + File : GNATCOLL.VFS.Virtual_File) return Boolean; + -- Return True when given document is open. + + ----------------------- + -- Project Manager -- + ----------------------- + + type Project_Stamp is private; + + function Get_Project_Stamp + (Self : Message_Handler'Class) return Project_Stamp; + -- Return stamp of the state of the project. Stamp is changed each time + -- project is (re)loaded. + private type Load_Project_Status is @@ -107,6 +144,8 @@ private -- @value Invalid_Project_Configured didChangeConfiguration provided a -- valid project + type Project_Stamp is mod 2**32; + subtype Implicit_Project_Loaded is Load_Project_Status range No_Project_Found .. Invalid_Project_Configured; -- Project status when an implicit project loaded @@ -133,7 +172,9 @@ private type Has_Been_Canceled_Function is access function return Boolean; type Message_Handler - (Sender : not null access LSP.Client_Message_Receivers + (Server : not null access LSP.Servers.Server'Class; + -- Please avoid to use this discriminant! + Sender : not null access LSP.Client_Message_Receivers .Client_Message_Receiver'Class; Tracer : not null LSP.Tracers.Tracer_Access) is limited new LSP.Unimplemented_Handlers.Unimplemented_Handler @@ -155,38 +196,14 @@ private Incremental_Text_Changes : Boolean; -- the support for incremental text changes is active - Indexing_Enabled : Boolean := True; - -- Whether to index sources in the background. This should be True - -- for normal use, and can be disabled for debug or testing purposes. + Shutdown : Boolean := False; + -- Server is in the shutdown state. Open_Documents : Document_Maps.Map; -- The documents that are currently open - Files_To_Index : File_Sets.Set; - -- Contains any files that need indexing. - -- - -- Indexing of sources is performed in the background as soon as needed - -- (typically after a project load), and pre-indexes the Ada source - -- files, so that subsequent request are fast. - -- The way the "backgrounding" works is the following: - -- - -- * each request which should trigger indexing (for instance - -- project load) adds files to Files_To_Index - -- - -- * the procedure Index_Files takes care of the indexing; it's also - -- looking at the queue after each indexing to see if there - -- are requests pending. If a request is pending, it stops - -- indexing. - -- - -- * whenever the server has finished processing a notification - -- or a requests, it looks at whether Files_To_Index contains - -- files; if it does, it runs Index_Files - - Total_Files_Indexed : Natural := 0; - Total_Files_To_Index : Positive := 1; - -- These two fields are used to produce a progress bar for the indexing - -- operations. Total_Files_To_Index starts at 1 so that the progress - -- bar starts at 0%. + Token_Id : Integer := 0; + -- An ever-increasing number used to generate unique progress tokens ---------------------- -- Project handling -- @@ -208,6 +225,9 @@ private Project_Dirs_Loaded : File_Sets.Set; -- The directories to load in the "implicit project" + Project_Stamp : LSP.Ada_Handlers.Project_Stamp := 0; + -- Stamp of the current project. + Is_Canceled : Has_Been_Canceled_Function; -- Is request has been canceled end record; diff --git a/source/ada/lsp-ada_indexing.adb b/source/ada/lsp-ada_indexing.adb new file mode 100644 index 000000000..3fe6ca24f --- /dev/null +++ b/source/ada/lsp-ada_indexing.adb @@ -0,0 +1,213 @@ +------------------------------------------------------------------------------ +-- Language Server Protocol -- +-- -- +-- Copyright (C) 2023, AdaCore -- +-- -- +-- This is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 3, or (at your option) any later ver- -- +-- sion. This software is distributed in the hope that it will be useful, -- +-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- -- +-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -- +-- License for more details. You should have received a copy of the GNU -- +-- General Public License distributed with this software; see file -- +-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy -- +-- of the license. -- +------------------------------------------------------------------------------ + +with LSP.Servers; + +with VSS.Strings.Formatters.Integers; +with VSS.Strings.Templates; + +package body LSP.Ada_Indexing is + + function From_ProgressToken + (Item : LSP.Structures.ProgressToken) + return LSP.Structures.Integer_Or_Virtual_String; + + ------------------------ + -- From_ProgressToken -- + ------------------------ + + function From_ProgressToken + (Item : LSP.Structures.ProgressToken) + return LSP.Structures.Integer_Or_Virtual_String is + begin + if Item.Is_Integer then + return (True, Item.Integer); + + else + return (False, Item.Virtual_String); + end if; + end From_ProgressToken; + + ----------------- + -- Index_Files -- + ----------------- + + procedure Index_Files (Self : in out Indexing_Job'Class) is + + use type LSP.Ada_Handlers.Project_Stamp; + + procedure Emit_Progress_Report (Files_Indexed, Total_Files : Natural); + + -------------------------- + -- Emit_Progress_Report -- + -------------------------- + + procedure Emit_Progress_Report (Files_Indexed, Total_Files : Natural) is + use type Ada.Calendar.Time; + + Current : constant Ada.Calendar.Time := Ada.Calendar.Clock; + Message_Template : VSS.Strings.Templates.Virtual_String_Template := + "{}/{} files"; + + begin + if Current - Self.Progress_Report_Sent < 0.5 then + -- Send only 2 notifications per second + return; + end if; + + Self.Progress_Report_Sent := Current; + + Self.Server.On_ProgressReport_Work_Done + (From_ProgressToken (Self.Indexing_Token), + (percentage => (True, (Files_Indexed * 100) / Total_Files), + message => + Message_Template.Format + (VSS.Strings.Formatters.Integers.Image (Files_Indexed), + VSS.Strings.Formatters.Integers.Image (Total_Files)), + others => <>)); + end Emit_Progress_Report; + + begin + if Self.Total_Files_Indexed = 0 then + Self.Server.On_ProgressBegin_Work_Done + (From_ProgressToken (Self.Indexing_Token), + (title => "Indexing", percentage => (True, 0), others => <>)); + end if; + + if Self.Handler.Get_Project_Stamp /= Self.Project_Stamp + or Self.Handler.Is_Shutdown + then + -- Project was updated, nothing to index; or server is under shutdown + + Self.Files_To_Index.Clear; + end if; + + while not Self.Files_To_Index.Is_Empty loop + declare + Cursor : File_Sets.Cursor := Self.Files_To_Index.First; + File : constant GNATCOLL.VFS.Virtual_File := + File_Sets.Element (Cursor); + + begin + Self.Files_To_Index.Delete (Cursor); + Self.Total_Files_Indexed := Self.Total_Files_Indexed + 1; + + if not Self.Handler.Is_Open_Document (File) then + for Context of Self.Handler.Contexts_For_File (File) loop + -- Set Reparse to False to avoid issues with LAL envs + -- for now (see T226-048 for more info). + Context.Index_File (File, Reparse => False); + end loop; + + Emit_Progress_Report + (Self.Total_Files_Indexed, Self.Total_Files_To_Index); + + -- Check whether another request is pending. If so, pause + -- the indexing; it will be resumed later as part of + -- After_Request. + + exit when Self.Server.Has_Pending_Work; + end if; + + end; + end loop; + + if Self.Files_To_Index.Is_Empty then + -- Indexing done. + + Self.Server.On_ProgressEnd_Work_Done + (From_ProgressToken (Self.Indexing_Token), (message => <>)); + + return; + end if; + + declare + Job : LSP.Server_Jobs.Server_Jobs_Access := + new Indexing_Job' + (Server => Self.Server.all'Unchecked_Access, + Handler => Self.Handler.all'Unchecked_Access, + Files_To_Index => Self.Files_To_Index, + Indexing_Token => Self.Indexing_Token, + Total_Files_Indexed => Self.Total_Files_Indexed, + Total_Files_To_Index => Self.Total_Files_To_Index, + Progress_Report_Sent => Self.Progress_Report_Sent, + Project_Stamp => Self.Project_Stamp); + + begin + Self.Server.Enqueue (Job); + end; + end Index_Files; + + ----------------------- + -- Schedule_Indexing -- + ----------------------- + + procedure Schedule_Indexing + (Server : not null access LSP.Servers.Server'Class; + Handler : not null access LSP.Ada_Handlers.Message_Handler'Class; + Configuration : LSP.Ada_Configurations.Configuration'Class; + Project_Stamp : LSP.Ada_Handlers.Project_Stamp; + Files : File_Sets.Set) is + begin + if Files.Is_Empty + or not Configuration.Indexing_Enabled + or Handler.Is_Shutdown + then + return; + end if; + + declare + Id : constant LSP.Structures.Integer_Or_Virtual_String := + Server.Allocate_Request_Id; + Token : constant LSP.Structures.ProgressToken := + Handler.Allocate_Progress_Token ("indexing"); + Job : LSP.Server_Jobs.Server_Jobs_Access := + new Indexing_Job' + (Server => Server, + Handler => Handler, + Files_To_Index => Files, + Indexing_Token => Token, + Total_Files_Indexed => 0, + Total_Files_To_Index => Natural (Files.Length), + Progress_Report_Sent => Ada.Calendar.Clock, + Project_Stamp => Project_Stamp); + + begin + Job.Server.On_Progress_Create_Request (Id, (token => Token)); + -- FIXME: wait response before sending progress notifications. + -- Currenctly, we just send a `window/workDoneProgress/create` + -- request and immediately after this start sending notifications. + -- We could do better, send request, wait for client response and + -- start progress-report sending only after response. + + Server.Enqueue (Job); + end; + end Schedule_Indexing; + + ---------------------------------- + -- Visit_Server_Message_Visitor -- + ---------------------------------- + + overriding procedure Visit_Server_Message_Visitor + (Self : Indexing_Job; + Value : in out + LSP.Server_Message_Visitors.Server_Message_Visitor'Class) is + begin + Self'Unrestricted_Access.Index_Files; + end Visit_Server_Message_Visitor; + +end LSP.Ada_Indexing; diff --git a/source/ada/lsp-ada_indexing.ads b/source/ada/lsp-ada_indexing.ads new file mode 100644 index 000000000..6843ec9b4 --- /dev/null +++ b/source/ada/lsp-ada_indexing.ads @@ -0,0 +1,91 @@ +------------------------------------------------------------------------------ +-- Language Server Protocol -- +-- -- +-- Copyright (C) 2023, AdaCore -- +-- -- +-- This is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 3, or (at your option) any later ver- -- +-- sion. This software is distributed in the hope that it will be useful, -- +-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- -- +-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -- +-- License for more details. You should have received a copy of the GNU -- +-- General Public License distributed with this software; see file -- +-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy -- +-- of the license. -- +------------------------------------------------------------------------------ + +private with Ada.Calendar; +with Ada.Containers.Hashed_Sets; + +with GNATCOLL.VFS; + +with LSP.Ada_Configurations; +with LSP.Ada_Handlers; +private with LSP.Server_Jobs; +private with LSP.Server_Message_Visitors; +limited with LSP.Servers; +private with LSP.Structures; + +package LSP.Ada_Indexing is + + package File_Sets is new Ada.Containers.Hashed_Sets + (Element_Type => GNATCOLL.VFS.Virtual_File, + Hash => GNATCOLL.VFS.Full_Name_Hash, + Equivalent_Elements => GNATCOLL.VFS."=", + "=" => GNATCOLL.VFS."="); + + procedure Schedule_Indexing + (Server : not null access LSP.Servers.Server'Class; + Handler : not null access LSP.Ada_Handlers.Message_Handler'Class; + Configuration : LSP.Ada_Configurations.Configuration'Class; + Project_Stamp : LSP.Ada_Handlers.Project_Stamp; + Files : File_Sets.Set); + +private + + -- Indexing of sources is performed in the background as soon as + -- requested (typically after a project load), and pre-indexes the + -- Ada source files, so that subsequent request are fast. The way + -- the "backgrounding" works is the following: + -- + -- * each request which should trigger indexing (for instance + -- project load) compute list of file to index and call + -- Schedule_Indexing which creates indexing job + -- + -- * the indexing job takes care of the indexing; it's also + -- looking at the queue after each indexing to see if there + -- are requests pending. If a request is pending, it creates and + -- schedule new indexing job + + type Indexing_Job + (Server : not null access LSP.Servers.Server'Class; + Handler : not null access LSP.Ada_Handlers.Message_Handler'Class) is + new LSP.Server_Jobs.Abstract_Server_Job (Server) with + record + Files_To_Index : File_Sets.Set; + -- Contains any files that need indexing. + + Indexing_Token : LSP.Structures.ProgressToken; + -- The token of the current indexing progress sequence + + Total_Files_Indexed : Natural := 0; + Total_Files_To_Index : Positive := 1; + -- These two fields are used to produce a progress bar for the indexing + -- operations. Total_Files_To_Index starts at 1 so that the progress + -- bar starts at 0%. + + Progress_Report_Sent : Ada.Calendar.Time; + -- Time of send of last progress notification. + + Project_Stamp : LSP.Ada_Handlers.Project_Stamp; + end record; + + overriding procedure Visit_Server_Message_Visitor + (Self : Indexing_Job; + Value : in out + LSP.Server_Message_Visitors.Server_Message_Visitor'Class); + + procedure Index_Files (Self : in out Indexing_Job'Class); + +end LSP.Ada_Indexing; diff --git a/source/server/lsp-server_jobs.ads b/source/server/lsp-server_jobs.ads new file mode 100644 index 000000000..97eec042a --- /dev/null +++ b/source/server/lsp-server_jobs.ads @@ -0,0 +1,29 @@ +------------------------------------------------------------------------------ +-- Language Server Protocol -- +-- -- +-- Copyright (C) 2018-2023, AdaCore -- +-- -- +-- This is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 3, or (at your option) any later ver- -- +-- sion. This software is distributed in the hope that it will be useful, -- +-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- -- +-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -- +-- License for more details. You should have received a copy of the GNU -- +-- General Public License distributed with this software; see file -- +-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy -- +-- of the license. -- +------------------------------------------------------------------------------ + +with LSP.Server_Messages; +limited with LSP.Servers; + +package LSP.Server_Jobs is + + type Abstract_Server_Job + (Server : not null access LSP.Servers.Server'Class) is + new LSP.Server_Messages.Server_Message with null record; + + type Server_Jobs_Access is access all Abstract_Server_Job'Class; + +end LSP.Server_Jobs; diff --git a/source/server/lsp-servers.adb b/source/server/lsp-servers.adb index eef3c6488..4b3242cd6 100644 --- a/source/server/lsp-servers.adb +++ b/source/server/lsp-servers.adb @@ -34,7 +34,6 @@ with LSP.Errors; with LSP.Lifecycle_Checkers; with LSP.Server_Notification_Readers; with LSP.Server_Request_Readers; -with LSP.Structures; package body LSP.Servers is @@ -78,6 +77,19 @@ package body LSP.Servers is (Object => LSP.Client_Messages.Client_Message'Class, Name => Client_Message_Access); + ------------------------- + -- Allocate_Request_Id -- + ------------------------- + + function Allocate_Request_Id + (Self : in out Server'Class) + return LSP.Structures.Integer_Or_Virtual_String is + begin + Self.Last_Request := @ + 1; + + return (Is_Integer => True, Integer => Self.Last_Request); + end Allocate_Request_Id; + ------------ -- Append -- ------------ @@ -95,6 +107,23 @@ package body LSP.Servers is end loop; end Append; + ------------- + -- Enqueue -- + ------------- + + procedure Enqueue + (Self : in out Server'Class; + Job : in out LSP.Server_Jobs.Server_Jobs_Access) + is + use type LSP.Server_Jobs.Server_Jobs_Access; + + begin + if Job /= null then + Self.Input_Queue.Enqueue (Server_Message_Access (Job)); + Job := null; + end if; + end Enqueue; + -------------- -- Finalize -- -------------- diff --git a/source/server/lsp-servers.ads b/source/server/lsp-servers.ads index 80cc2c84f..7e738ae2b 100644 --- a/source/server/lsp-servers.ads +++ b/source/server/lsp-servers.ads @@ -24,7 +24,9 @@ with Ada.Streams; with LSP.Client_Message_Receivers; with LSP.Server_Message_Visitors; +with LSP.Structures; +with LSP.Server_Jobs; with LSP.Server_Messages; with LSP.Tracers; @@ -88,6 +90,16 @@ package LSP.Servers is -- notification/request it's currently processing. This should only be -- called from the processing task. + procedure Enqueue + (Self : in out Server'Class; + Job : in out LSP.Server_Jobs.Server_Jobs_Access); + -- Put server job into the queue. + + function Allocate_Request_Id + (Self : in out Server'Class) + return LSP.Structures.Integer_Or_Virtual_String; + -- Allocate request identifier. + private ------------------------- @@ -196,7 +208,7 @@ private -- Signal to main task to stop server. Released on "exit" message or -- on end of input stream. Stream : access Ada.Streams.Root_Stream_Type'Class; - Last_Request : Positive := 1; + Last_Request : Natural := 0; Vector : VSS.Stream_Element_Vectors.Stream_Element_Vector; -- Queues and tasks used for asynchronous processing, see doc above diff --git a/testsuite/ada_lsp/indexing_progress/test.json b/testsuite/ada_lsp/indexing_progress/test.json index 5263ed501..b0832a922 100644 --- a/testsuite/ada_lsp/indexing_progress/test.json +++ b/testsuite/ada_lsp/indexing_progress/test.json @@ -31,30 +31,6 @@ "id": 1, "result": { "capabilities": { - "typeDefinitionProvider": true, - "alsReferenceKinds": [ - "reference", - "access", - "write", - "call", - "dispatching call", "parent", "child", - "overriding" - ], - "hoverProvider": true, - "definitionProvider": true, - "renameProvider": {}, - "referencesProvider": true, - "textDocumentSync": 2, - "completionProvider": { - "triggerCharacters": [ - ".", - ",", - "'", - "(" - ], - "resolveProvider": true - }, - "documentSymbolProvider": true } } } @@ -88,7 +64,7 @@ "wait": [ { "jsonrpc":"2.0", - "id":2, + "id":1, "method":"window/workDoneProgress/create", "params":{ "token":"" diff --git a/testsuite/ada_lsp/indexing_progress/test.yaml b/testsuite/ada_lsp/indexing_progress/test.yaml index 6c74dee25..b1a3851ac 100644 --- a/testsuite/ada_lsp/indexing_progress/test.yaml +++ b/testsuite/ada_lsp/indexing_progress/test.yaml @@ -1,4 +1 @@ title: 'indexing_progress' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] From de2c7a2af6daedc017ea0e6477a76cb2833ffd78 Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Wed, 23 Aug 2023 17:45:31 +0300 Subject: [PATCH 050/152] Add references request Refs #1170 --- source/ada/lsp-ada_client_capabilities.adb | 1 + source/ada/lsp-ada_handlers.adb | 179 +++++++++++++++++++++ source/ada/lsp-ada_handlers.ads | 5 + source/lsp_3.17/lsp-constants.ads | 8 +- 4 files changed, 192 insertions(+), 1 deletion(-) diff --git a/source/ada/lsp-ada_client_capabilities.adb b/source/ada/lsp-ada_client_capabilities.adb index 4e0b3ad24..96712961b 100644 --- a/source/ada/lsp-ada_client_capabilities.adb +++ b/source/ada/lsp-ada_client_capabilities.adb @@ -93,6 +93,7 @@ package body LSP.Ada_Client_Capabilities is Result.foldingRangeProvider := LSP.Constants.True; Result.implementationProvider := LSP.Constants.True; Result.typeDefinitionProvider := LSP.Constants.True; + Result.referencesProvider := LSP.Constants.True; Result.semanticTokensProvider := (Is_Set => True, diff --git a/source/ada/lsp-ada_handlers.adb b/source/ada/lsp-ada_handlers.adb index d82e1a6ee..f24ac38dd 100644 --- a/source/ada/lsp-ada_handlers.adb +++ b/source/ada/lsp-ada_handlers.adb @@ -1739,6 +1739,185 @@ package body LSP.Ada_Handlers is Self.Sender.On_PrepareCallHierarchy_Response (Id, Response); end On_PrepareCallHierarchy_Request; + --------------------------- + -- On_References_Request -- + --------------------------- + + overriding procedure On_References_Request + (Self : in out Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ReferenceParams) + is + use all type LSP.Ada_Handlers.Locations.AlsReferenceKind; + + Response : LSP.Structures.Location_Vector_Or_Null; + Imprecise : Boolean := False; + + Additional_Kinds : AlsReferenceKind_Array := + [others => False]; + + procedure Process_Context (C : LSP.Ada_Context_Sets.Context_Access); + -- Process the references found in one context and append + -- them to Response.results. + + function Get_Reference_Kind + (Node : Libadalang.Analysis.Ada_Node'Class; + Is_Overriding_Decl : Boolean := False) + return AlsReferenceKind_Array; + -- Fetch reference kind for given node. + + ------------------------ + -- Get_Reference_Kind -- + ------------------------ + + function Get_Reference_Kind + (Node : Libadalang.Analysis.Ada_Node'Class; + Is_Overriding_Decl : Boolean := False) + return AlsReferenceKind_Array + is + use type AlsReferenceKind_Array; + + Id : constant Libadalang.Analysis.Name := + Laltools.Common.Get_Node_As_Name (Node.As_Ada_Node); + + Result : AlsReferenceKind_Array := [others => False]; + begin + begin + Result (Write) := Id.P_Is_Write_Reference; + exception + when E : Libadalang.Common.Property_Error => + Self.Tracer.Trace_Exception (E); + end; + + begin + Result (Access_Ref) := + Laltools.Common.Is_Access_Ref (Id.As_Ada_Node); + exception + when E : Libadalang.Common.Property_Error => + Self.Tracer.Trace_Exception (E); + end; + + begin + Result (Static_Call) := Id.P_Is_Static_Call; + exception + when E : Libadalang.Common.Property_Error => + Self.Tracer.Trace_Exception (E); + end; + + begin + Result (Dispatching_Call) := + Id.P_Is_Dispatching_Call; + exception + when E : Libadalang.Common.Property_Error => + Self.Tracer.Trace_Exception (E); + end; + + begin + Result (Child) := + Laltools.Common.Is_Type_Derivation (Id.As_Ada_Node); + exception + when E : Libadalang.Common.Property_Error => + Self.Tracer.Trace_Exception (E); + end; + + Result (Overriding_Decl) := Is_Overriding_Decl; + + -- If the result has not any set flags at this point, flag it as a + -- simple reference. + if Result = [Result'Range => False] then + Result (Simple) := True; + end if; + + -- Apply additional kinds + Result := Result or Additional_Kinds; + + return Result; + end Get_Reference_Kind; + + --------------------- + -- Process_Context -- + --------------------- + + procedure Process_Context (C : LSP.Ada_Context_Sets.Context_Access) is + procedure Callback + (Node : Libadalang.Analysis.Base_Id; + Kind : Libadalang.Common.Ref_Result_Kind; + Cancel : in out Boolean); + + procedure Callback + (Node : Libadalang.Analysis.Base_Id; + Kind : Libadalang.Common.Ref_Result_Kind; + Cancel : in out Boolean) + is + pragma Unreferenced (Kind); + begin + if not Laltools.Common.Is_End_Label (Node.As_Ada_Node) then + + Self.Append_Location + (Response, + Node, + Get_Reference_Kind (Node)); + end if; + + Cancel := Self.Is_Canceled.all; + end Callback; + + Definition : Libadalang.Analysis.Defining_Name; + + use Libadalang.Common; + begin + + Definition := Self.Imprecise_Resolve_Name (C.all, Value); + + if Definition.Is_Null or else Self.Is_Canceled.all then + return; + end if; + + -- Set additional "reference" kind for enumeration literal + declare + Decl : constant Libadalang.Analysis.Basic_Decl := + Libadalang.Analysis.P_Basic_Decl (Definition); + begin + if not Decl.Is_Null + and then Libadalang.Analysis.Kind (Decl) = Ada_Enum_Literal_Decl + then + Additional_Kinds (Simple) := True; + end if; + + -- Find all the references + C.Find_All_References (Definition, Callback'Access); + + -- Find all the overriding declarations, if any + for Subp of C.Find_All_Overrides (Decl, Imprecise) loop + Self.Append_Location + (Response, + Subp.P_Defining_Name, + Get_Reference_Kind + (Definition, + Is_Overriding_Decl => True)); + end loop; + + if Value.context.includeDeclaration then + Self.Append_Location + (Response, + Definition, + Get_Reference_Kind (Definition)); + end if; + end; + end Process_Context; + + begin + for C of Self.Contexts_For_URI (Value.textDocument.uri) loop + Process_Context (C); + + exit when Self.Is_Canceled.all; + end loop; + + -- Sort_And_Remove_Duplicates (Response.result); + + Self.Sender.On_References_Response (Id, Response); + end On_References_Request; + ---------------------------- -- On_Server_Notification -- ---------------------------- diff --git a/source/ada/lsp-ada_handlers.ads b/source/ada/lsp-ada_handlers.ads index 89dd8678c..f5922f359 100644 --- a/source/ada/lsp-ada_handlers.ads +++ b/source/ada/lsp-ada_handlers.ads @@ -248,6 +248,11 @@ private overriding procedure On_Exits_Notification (Self : in out Message_Handler); + overriding procedure On_References_Request + (Self : in out Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ReferenceParams); + overriding procedure On_Shutdown_Request (Self : in out Message_Handler; Id : LSP.Structures.Integer_Or_Virtual_String); diff --git a/source/lsp_3.17/lsp-constants.ads b/source/lsp_3.17/lsp-constants.ads index 9b2e3e7f9..c741a6d83 100644 --- a/source/lsp_3.17/lsp-constants.ads +++ b/source/lsp_3.17/lsp-constants.ads @@ -75,6 +75,12 @@ package LSP.Constants is is [(VSS.JSON.Streams.Boolean_Value, True)]; function True return LSP.Structures.Boolean_Or_Any_Optional - is (Is_Set => True, Value => True); + is (Is_Set => True, Value => True); + + function True return LSP.Structures.Boolean_Or_ReferenceOptions + is (Is_Boolean => True, Boolean => True); + + function True return LSP.Structures.Boolean_Or_ReferenceOptions_Optional + is (Is_Set => True, Value => True); end LSP.Constants; From 011c2c58d61011c2d821987d69f7d811ffb7e124 Mon Sep 17 00:00:00 2001 From: Andry Ogorodnik Date: Thu, 24 Aug 2023 14:31:39 +0000 Subject: [PATCH 051/152] Implemented On_CodeAction_Request --- gnat/ignore_in_317.txt | 30 - source/ada/lsp-ada_client_capabilities.adb | 116 ++ source/ada/lsp-ada_client_capabilities.ads | 47 + ...ada_handlers-named_parameters_commands.adb | 235 +-- ...ada_handlers-named_parameters_commands.ads | 38 +- ...sp-ada_handlers-refactor-add_parameter.adb | 144 +- ...sp-ada_handlers-refactor-add_parameter.ads | 26 +- ...andlers-refactor-change_parameter_mode.adb | 156 +- ...andlers-refactor-change_parameter_mode.ads | 32 +- ...factor-change_parameters_default_value.adb | 143 +- ...factor-change_parameters_default_value.ads | 25 +- ...ndlers-refactor-change_parameters_type.adb | 189 +-- ...ndlers-refactor-change_parameters_type.ads | 29 +- ...a_handlers-refactor-extract_subprogram.adb | 153 +- ...a_handlers-refactor-extract_subprogram.ads | 32 +- ...ada_handlers-refactor-imports_commands.adb | 140 +- ...ada_handlers-refactor-imports_commands.ads | 27 +- ..._handlers-refactor-introduce_parameter.adb | 125 +- ..._handlers-refactor-introduce_parameter.ads | 26 +- ...p-ada_handlers-refactor-move_parameter.adb | 149 +- ...p-ada_handlers-refactor-move_parameter.ads | 28 +- ..._handlers-refactor-pull_up_declaration.adb | 129 +- ..._handlers-refactor-pull_up_declaration.ads | 25 +- ...ada_handlers-refactor-remove_parameter.adb | 151 +- ...ada_handlers-refactor-remove_parameter.ads | 32 +- ...lsp-ada_handlers-refactor-replace_type.adb | 133 +- ...lsp-ada_handlers-refactor-replace_type.ads | 23 +- ...da_handlers-refactor-sort_dependencies.adb | 122 +- ...da_handlers-refactor-sort_dependencies.ads | 23 +- ...da_handlers-refactor-suppress_seperate.adb | 127 +- ...da_handlers-refactor-suppress_seperate.ads | 24 +- source/ada/lsp-ada_handlers-refactor.adb | 105 +- source/ada/lsp-ada_handlers-refactor.ads | 14 +- source/ada/lsp-ada_handlers.adb | 1300 ++++++++++++++++- source/ada/lsp-ada_handlers.ads | 35 + source/ada/lsp-lal_utils.adb | 228 --- source/ada/lsp-lal_utils.ads | 81 +- source/ada/lsp-utils.adb | 57 + source/ada/lsp-utils.ads | 27 + source/lsp_3.17/lsp-commands.adb | 46 + source/lsp_3.17/lsp-commands.ads | 63 + source/lsp_3.17/lsp-constants.ads | 8 + .../lsp-structures-lspany_vectors.adb | 418 ++++++ .../lsp-structures-lspany_vectors.ads | 93 ++ source/lsp_3.17/lsp-structures-unwrap.ads | 12 + 45 files changed, 3626 insertions(+), 1540 deletions(-) create mode 100644 source/lsp_3.17/lsp-commands.adb create mode 100644 source/lsp_3.17/lsp-commands.ads create mode 100644 source/lsp_3.17/lsp-structures-lspany_vectors.adb create mode 100644 source/lsp_3.17/lsp-structures-lspany_vectors.ads diff --git a/gnat/ignore_in_317.txt b/gnat/ignore_in_317.txt index c4e9e9059..674936a19 100644 --- a/gnat/ignore_in_317.txt +++ b/gnat/ignore_in_317.txt @@ -1,39 +1,9 @@ lsp-ada_handlers-alire.adb lsp-ada_handlers-alire.ads -lsp-ada_handlers-named_parameters_commands.adb -lsp-ada_handlers-named_parameters_commands.ads lsp-ada_handlers-other_file_commands.adb lsp-ada_handlers-other_file_commands.ads lsp-ada_handlers-project_reload_commands.adb lsp-ada_handlers-project_reload_commands.ads -lsp-ada_handlers-refactor.adb -lsp-ada_handlers-refactor.ads -lsp-ada_handlers-refactor-add_parameter.adb -lsp-ada_handlers-refactor-add_parameter.ads -lsp-ada_handlers-refactor-change_parameter_mode.adb -lsp-ada_handlers-refactor-change_parameter_mode.ads -lsp-ada_handlers-refactor-change_parameters_default_value.adb -lsp-ada_handlers-refactor-change_parameters_default_value.ads -lsp-ada_handlers-refactor-change_parameters_type.adb -lsp-ada_handlers-refactor-change_parameters_type.ads -lsp-ada_handlers-refactor-extract_subprogram.adb -lsp-ada_handlers-refactor-extract_subprogram.ads -lsp-ada_handlers-refactor-imports_commands.adb -lsp-ada_handlers-refactor-imports_commands.ads -lsp-ada_handlers-refactor-introduce_parameter.adb -lsp-ada_handlers-refactor-introduce_parameter.ads -lsp-ada_handlers-refactor-move_parameter.adb -lsp-ada_handlers-refactor-move_parameter.ads -lsp-ada_handlers-refactor-pull_up_declaration.adb -lsp-ada_handlers-refactor-pull_up_declaration.ads -lsp-ada_handlers-refactor-remove_parameter.adb -lsp-ada_handlers-refactor-remove_parameter.ads -lsp-ada_handlers-refactor-replace_type.adb -lsp-ada_handlers-refactor-replace_type.ads -lsp-ada_handlers-refactor-sort_dependencies.adb -lsp-ada_handlers-refactor-sort_dependencies.ads -lsp-ada_handlers-refactor-suppress_seperate.adb -lsp-ada_handlers-refactor-suppress_seperate.ads lsp-client_side_file_monitors.adb lsp-client_side_file_monitors.ads lsp-common.adb diff --git a/source/ada/lsp-ada_client_capabilities.adb b/source/ada/lsp-ada_client_capabilities.adb index 96712961b..ff6b38c33 100644 --- a/source/ada/lsp-ada_client_capabilities.adb +++ b/source/ada/lsp-ada_client_capabilities.adb @@ -39,11 +39,72 @@ package body LSP.Ada_Client_Capabilities is then -- URI isn't provided, rollback to deprecated rootPath Self.Root := Value.rootPath.Value.Value; + elsif not Value.rootUri.Is_Null then Self.Root := VSS.Strings.Virtual_String (Value.rootUri.Value); end if; + + Self.Parse_Experimental; end Initialize; + ------------------------ + -- Parse_Experimental -- + ------------------------ + + procedure Parse_Experimental (Self : Client_Capability'Class) is + begin + if Self.Value.capabilities.experimental.Is_Empty then + return; + end if; + + -- FIXME: Implement parsing + end Parse_Experimental; + + ------------------------------- + -- Resource_Create_Supported -- + ------------------------------- + + function Resource_Create_Supported + (Self : Client_Capability'Class) return Boolean + is + use LSP.Structures.Unwrap; + + Result : constant LSP.Structures.ResourceOperationKind_Set := + resourceOperations (workspaceEdit (Self.Value.capabilities.workspace)); + begin + return Result (LSP.Enumerations.Create); + end Resource_Create_Supported; + + ------------------------------- + -- Resource_Delete_Supported -- + ------------------------------- + + function Resource_Delete_Supported + (Self : Client_Capability'Class) return Boolean + is + use LSP.Structures.Unwrap; + + Result : constant LSP.Structures.ResourceOperationKind_Set := + resourceOperations (workspaceEdit (Self.Value.capabilities.workspace)); + begin + return Result (LSP.Enumerations.Delete); + end Resource_Delete_Supported; + + ------------------------------- + -- Resource_Rename_Supported -- + ------------------------------- + + function Resource_Rename_Supported + (Self : Client_Capability'Class) return Boolean + is + use LSP.Structures.Unwrap; + + Result : constant LSP.Structures.ResourceOperationKind_Set := + resourceOperations (workspaceEdit (Self.Value.capabilities.workspace)); + begin + return Result (LSP.Enumerations.Rename); + end Resource_Rename_Supported; + ----------------------- -- Set_Root_If_Empty -- ----------------------- @@ -152,6 +213,46 @@ package body LSP.Ada_Client_Capabilities is (semanticTokens (Self.Value.capabilities.textDocument)); end Token_Types; + ------------------------------- + -- Refactoring_Add_Parameter -- + ------------------------------- + + function Refactoring_Add_Parameter + (Self : Client_Capability'Class) return Boolean is + begin + return Self.Advanced_Refactorings (Add_Parameter); + end Refactoring_Add_Parameter; + + ------------------------------------------------- + -- Refactoring_Change_Parameters_Default_Value -- + ------------------------------------------------- + + function Refactoring_Change_Parameters_Default_Value + (Self : Client_Capability'Class) return Boolean is + begin + return Self.Advanced_Refactorings (Change_Parameters_Default_Value); + end Refactoring_Change_Parameters_Default_Value; + + ---------------------------------------- + -- Refactoring_Change_Parameters_Type -- + ---------------------------------------- + + function Refactoring_Change_Parameters_Type + (Self : Client_Capability'Class) return Boolean is + begin + return Self.Advanced_Refactorings (Change_Parameters_Type); + end Refactoring_Change_Parameters_Type; + + ------------------------------ + -- Refactoring_Replace_Type -- + ------------------------------ + + function Refactoring_Replace_Type + (Self : Client_Capability'Class) return Boolean is + begin + return Self.Advanced_Refactorings (Replace_Type); + end Refactoring_Replace_Type; + -------------------- -- Resolve_Lazily -- -------------------- @@ -170,4 +271,19 @@ package body LSP.Ada_Client_Capabilities is return List.Contains ("detail") and then List.Contains ("documentation"); end Resolve_Lazily; + ------------------------- + -- Versioned_Documents -- + ------------------------- + + function Versioned_Documents + (Self : Client_Capability'Class) return Boolean + is + use LSP.Structures.Unwrap; + + Result : constant LSP.Structures.Boolean_Optional := + documentChanges (workspaceEdit (Self.Value.capabilities.workspace)); + begin + return (if Result.Is_Set then Result.Value else False); + end Versioned_Documents; + end LSP.Ada_Client_Capabilities; diff --git a/source/ada/lsp-ada_client_capabilities.ads b/source/ada/lsp-ada_client_capabilities.ads index 57bc63149..c0fc19188 100644 --- a/source/ada/lsp-ada_client_capabilities.ads +++ b/source/ada/lsp-ada_client_capabilities.ads @@ -63,14 +63,61 @@ package LSP.Ada_Client_Capabilities is function Token_Modifiers (Self : Client_Capability'Class) return LSP.Structures.Virtual_String_Vector; + function Versioned_Documents + (Self : Client_Capability'Class) return Boolean; + -- Returns capabilities.workspace.workspaceEdit.documentChanges or False + + -- Resource 0perations -- + + function Resource_Create_Supported + (Self : Client_Capability'Class) return Boolean; + + function Resource_Delete_Supported + (Self : Client_Capability'Class) return Boolean; + + function Resource_Rename_Supported + (Self : Client_Capability'Class) return Boolean; + + -- Advanced refactoring settings -- + + function Refactoring_Change_Parameters_Type + (Self : Client_Capability'Class) return Boolean; + + function Refactoring_Add_Parameter + (Self : Client_Capability'Class) return Boolean; + + function Refactoring_Change_Parameters_Default_Value + (Self : Client_Capability'Class) return Boolean; + + function Refactoring_Replace_Type + (Self : Client_Capability'Class) return Boolean; + private + type Advanced_Refactorings is + (Add_Parameter, + Change_Parameters_Type, + Change_Parameters_Default_Value, + Replace_Type); + -- Enum with the advanced refactorings that clients might support + + type Advanced_Refactorings_Capabilities is + array (Advanced_Refactorings) of Boolean; + -- Array that determines what advanced refactorings clients support + type Client_Capability is tagged limited record Value : LSP.Structures.InitializeParams; Root : VSS.Strings.Virtual_String; + + Advanced_Refactorings : Advanced_Refactorings_Capabilities := + (others => False); + -- Experimental client capabilities that are extensions of the ones + -- defined in the LSP end record; function Root (Self : Client_Capability'Class) return VSS.Strings.Virtual_String is (Self.Root); + procedure Parse_Experimental (Self : Client_Capability'Class); + end LSP.Ada_Client_Capabilities; diff --git a/source/ada/lsp-ada_handlers-named_parameters_commands.adb b/source/ada/lsp-ada_handlers-named_parameters_commands.adb index 0f30a896f..1b78ade3a 100644 --- a/source/ada/lsp-ada_handlers-named_parameters_commands.adb +++ b/source/ada/lsp-ada_handlers-named_parameters_commands.adb @@ -1,7 +1,7 @@ ------------------------------------------------------------------------------ -- Language Server Protocol -- -- -- --- Copyright (C) 2020-2021, AdaCore -- +-- Copyright (C) 2020-2023, AdaCore -- -- -- -- This is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -16,17 +16,18 @@ ------------------------------------------------------------------------------ with Ada.Exceptions; -with Ada.Strings.UTF_Encoding; +with VSS.JSON.Streams; with VSS.String_Vectors; with VSS.Strings.Conversions; -with LSP.Lal_Utils; with Libadalang.Analysis; with Libadalang.Common; -with LSP.Messages.Client_Requests; -with LSP.Types; +with LSP.Ada_Contexts; +with LSP.Enumerations; +with LSP.Structures.LSPAny_Vectors; use LSP.Structures.LSPAny_Vectors; +with LSP.Utils; package body LSP.Ada_Handlers.Named_Parameters_Commands is @@ -35,61 +36,129 @@ package body LSP.Ada_Handlers.Named_Parameters_Commands is return VSS.String_Vectors.Virtual_String_Vector; -- Find list of parameter names from given AST node. + ---------------- + -- Initialize -- + ---------------- + + procedure Initialize + (Self : in out Command'Class; + Context : LSP.Ada_Context_Sets.Context_Access; + Where : LSP.Structures.TextDocumentPositionParams; + Versioned_Documents : Boolean) is + begin + Self.Context := Context.Id; + Self.Where := Where; + Self.Versioned_Documents := Versioned_Documents; + end Initialize; + ------------ -- Create -- ------------ overriding function Create - (JS : not null access LSP.JSON_Streams.JSON_Stream'Class) - return Command + (Any : not null access LSP.Structures.LSPAny_Vector) + return Command is - begin - return V : Command do - pragma Assert (JS.R.Is_Start_Object); - JS.R.Read_Next; + use VSS.JSON.Streams; + use VSS.Strings; + use LSP.Structures.JSON_Event_Vectors; - while not JS.R.Is_End_Object loop - pragma Assert (JS.R.Is_Key_Name); + C : Cursor := Any.First; + begin + return Self : Command do + pragma Assert (Element (C).Kind = Start_Object); + Next (C); + + while Has_Element (C) + and then Element (C).Kind /= End_Object + loop + pragma Assert (Element (C).Kind = Key_Name); declare - Key : constant Ada.Strings.UTF_Encoding.UTF_8_String := - VSS.Strings.Conversions.To_UTF_8_String (JS.R.Key_Name); + Key : constant Virtual_String := Element (C).Key_Name; begin - JS.R.Read_Next; + Next (C); if Key = "context" then - LSP.Types.Read_String (JS, V.Context); + Self.Context := Element (C).String_Value; + elsif Key = "where" then - LSP.Messages.TextDocumentPositionParams'Read (JS, V.Where); + Self.Where := From_Any (C); + + elsif Key = "versioned_documents" then + Self.Versioned_Documents := From_Any (C); + else - JS.Skip_Value; + Skip_Value (C); end if; end; + + Next (C); end loop; - JS.R.Read_Next; end return; end Create; + ----------------------- + -- Append_Suggestion -- + ----------------------- + + procedure Append_Suggestion + (Self : in out Command; + Context : LSP.Ada_Context_Sets.Context_Access; + Commands_Vector : in out LSP.Structures.Command_Or_CodeAction_Vector; + Where : LSP.Structures.Location; + Versioned_Documents : Boolean) + is + Code_Action : LSP.Structures.CodeAction; + begin + Self.Initialize + (Context => Context, + Where => ((uri => Where.uri), Where.a_range.start), + Versioned_Documents => Versioned_Documents); + + Code_Action := + (title => "Name parameters in the call", + kind => (Is_Set => True, + Value => LSP.Enumerations.RefactorRewrite), + diagnostics => <>, + disabled => (Is_Set => False), + edit => (Is_Set => False), + isPreferred => (Is_Set => False), + command => + (Is_Set => True, + Value => + (title => <>, + command => VSS.Strings.Conversions.To_Virtual_String + (Command'External_Tag), + arguments => Self.Write_Command)), + data => <>); + + Commands_Vector.Append + (LSP.Structures.Command_Or_CodeAction' + (Is_Command => False, CodeAction => Code_Action)); + end Append_Suggestion; + ------------- -- Execute -- ------------- overriding procedure Execute (Self : Command; - Handler : not null access LSP.Server_Notification_Receivers - .Server_Notification_Receiver' - Class; - Client : not null access LSP.Client_Message_Receivers - .Client_Message_Receiver' - Class; - Error : in out LSP.Errors.Optional_ResponseError) + Handler : not null access + LSP.Server_Notification_Receivers.Server_Notification_Receiver'Class; + Client : not null access + LSP.Client_Message_Receivers.Client_Message_Receiver'Class; + Id : LSP.Structures.Integer_Or_Virtual_String; + Error : in out LSP.Errors.ResponseError_Optional) is + use LSP.Structures; + procedure Append (Node : Libadalang.Analysis.Ada_Node; Name : VSS.Strings.Virtual_String); -- Create and append a TextEdit to insert Name & " => " before Node. - Apply : LSP.Messages.Client_Requests.Workspace_Apply_Edit_Request; - Edits : LSP.Messages.WorkspaceEdit renames Apply.params.edit; + Apply : LSP.Structures.ApplyWorkspaceEditParams; + Edits : LSP.Structures.WorkspaceEdit renames Apply.edit; Message_Handler : LSP.Ada_Handlers.Message_Handler renames LSP.Ada_Handlers.Message_Handler (Handler.all); @@ -104,25 +173,27 @@ package body LSP.Ada_Handlers.Named_Parameters_Commands is is use type VSS.Strings.Virtual_String; - Loc : constant LSP.Messages.Location := - LSP.Lal_Utils.Get_Node_Location (Node); - Edit : LSP.Messages.AnnotatedTextEdit; + Loc : constant LSP.Structures.Location := + LSP.Utils.Get_Node_Location (Node); + Edit : LSP.Structures.AnnotatedTextEdit; begin - Edit.span := (Loc.span.first, Loc.span.first); + Edit.a_range := (Loc.a_range.start, Loc.a_range.start); Edit.newText := Name & " => "; - if Message_Handler.Versioned_Documents then - Edits.documentChanges (1).Text_Document_Edit.edits.Append (Edit); + if Self.Versioned_Documents then + Edits.documentChanges (1).Varian_1.edits.Append + (LSP.Structures.TextEdit_Or_AnnotatedTextEdit' + (Is_TextEdit => False, AnnotatedTextEdit => Edit)); else if Edits.changes.Contains (Self.Where.textDocument.uri) then Edits.changes (Self.Where.textDocument.uri).Append - (LSP.Messages.TextEdit (Edit)); + (LSP.Structures.TextEdit (Edit)); else declare - Text_Edits : LSP.Messages.TextEdit_Vector; + Text_Edits : LSP.Structures.TextEdit_Vector; begin - Text_Edits.Append (LSP.Messages.TextEdit (Edit)); + Text_Edits.Append (LSP.Structures.TextEdit (Edit)); Edits.changes.Include (Self.Where.textDocument.uri, Text_Edits); end; @@ -142,23 +213,23 @@ package body LSP.Ada_Handlers.Named_Parameters_Commands is Args : Libadalang.Analysis.Basic_Assoc_List; Params : VSS.String_Vectors.Virtual_String_Vector; Index : Natural := 0; - Version : constant LSP.Messages.VersionedTextDocumentIdentifier := + Version : constant LSP.Structures.VersionedTextDocumentIdentifier := Document.Versioned_Identifier; begin - Apply.params.label := - (Is_Set => True, - Value => - VSS.Strings.Conversions.To_Virtual_String (Command'External_Tag)); + Apply.label := VSS.Strings.Conversions.To_Virtual_String + (Command'External_Tag); - if Message_Handler.Versioned_Documents then + if Self.Versioned_Documents then Edits.documentChanges.Append - (LSP.Messages.Document_Change' - (Kind => LSP.Messages.Text_Document_Edit, - Text_Document_Edit => + (documentChanges_OfWorkspaceEdit_Item' + (Kind => + documentChanges_OfWorkspaceEdit_Item_Variant'(Varian_1), + Varian_1 => (textDocument => - (uri => Version.uri, - version => (True, Version.version)), + (uri => Version.uri, + version => (Is_Null => False, + Value => Version.version)), edits => <>))); end if; @@ -172,9 +243,8 @@ package body LSP.Ada_Handlers.Named_Parameters_Commands is Error := (Is_Set => True, Value => - (code => LSP.Errors.InvalidRequest, - message => "This is not a valid position to name parameters.", - data => <>)); + (code => LSP.Enumerations.InvalidRequest, + message => "This is not a valid position to name parameters.")); return; end if; @@ -190,9 +260,9 @@ package body LSP.Ada_Handlers.Named_Parameters_Commands is Error := (Is_Set => True, Value => - (code => LSP.Errors.InvalidRequest, - message => "Could not resolve this call expression precisely.", - data => <>)); + (code => LSP.Enumerations.InvalidRequest, + message => + "Could not resolve this call expression precisely.")); return; end if; @@ -214,16 +284,15 @@ package body LSP.Ada_Handlers.Named_Parameters_Commands is Index := Index - 1; end loop; - Client.On_Workspace_Apply_Edit_Request (Apply); + Client.On_ApplyEdit_Request (Id, Apply); exception when E : others => Error := (Is_Set => True, Value => - (code => LSP.Errors.UnknownErrorCode, + (code => LSP.Enumerations.UnknownErrorCode, message => VSS.Strings.Conversions.To_Virtual_String - (Ada.Exceptions.Exception_Information (E)), - data => <>)); + (Ada.Exceptions.Exception_Information (E)))); end Execute; -------------------- @@ -258,7 +327,7 @@ package body LSP.Ada_Handlers.Named_Parameters_Commands is begin for Param of Params loop for Id of Param.F_Ids loop - Result.Append (LSP.Lal_Utils.To_Virtual_String (Id.Text)); + Result.Append (VSS.Strings.To_Virtual_String (Id.Text)); end loop; end loop; end Append; @@ -440,36 +509,34 @@ package body LSP.Ada_Handlers.Named_Parameters_Commands is return Result; end Get_Parameters; - ---------------- - -- Initialize -- - ---------------- - - procedure Initialize - (Self : in out Command'Class; - Context : LSP.Ada_Contexts.Context; - Where : LSP.Messages.TextDocumentPositionParams) is - begin - Self.Context := Context.Id; - Self.Where := Where; - end Initialize; - ------------------- -- Write_Command -- ------------------- - procedure Write_Command - (S : access Ada.Streams.Root_Stream_Type'Class; - V : Command) + function Write_Command + (Self : Command) return LSP.Structures.LSPAny_Vector is - JS : LSP.JSON_Streams.JSON_Stream'Class renames - LSP.JSON_Streams.JSON_Stream'Class (S.all); + use VSS.JSON.Streams; + + Result : LSP.Structures.LSPAny_Vector; begin - JS.Start_Object; - JS.Key ("context"); - LSP.Types.Write_String (S, V.Context); - JS.Key ("where"); - LSP.Messages.TextDocumentPositionParams'Write (S, V.Where); - JS.End_Object; + Result.Append (JSON_Stream_Element'(Kind => Start_Object)); + + -- "context" + Add_Key ("context", Result); + To_Any (Self.Context, Result); + + -- "where" + Add_Key ("where", Result); + To_Any (Self.Where, Result); + + -- "versioned_documents" + Add_Key ("versioned_documents", Result); + To_Any (Self.Versioned_Documents, Result); + + Result.Append (JSON_Stream_Element'(Kind => End_Object)); + + return Result; end Write_Command; end LSP.Ada_Handlers.Named_Parameters_Commands; diff --git a/source/ada/lsp-ada_handlers-named_parameters_commands.ads b/source/ada/lsp-ada_handlers-named_parameters_commands.ads index 51ccdc3cb..5bf294e69 100644 --- a/source/ada/lsp-ada_handlers-named_parameters_commands.ads +++ b/source/ada/lsp-ada_handlers-named_parameters_commands.ads @@ -1,7 +1,7 @@ ------------------------------------------------------------------------------ -- Language Server Protocol -- -- -- --- Copyright (C) 2020, AdaCore -- +-- Copyright (C) 2020-2023, AdaCore -- -- -- -- This is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -18,33 +18,38 @@ -- Implementation of the command to refactor positional parameters into -- named parameters in given subprogram call. -with Ada.Streams; - -private with VSS.Strings; - with LSP.Client_Message_Receivers; with LSP.Commands; with LSP.Errors; -with LSP.JSON_Streams; package LSP.Ada_Handlers.Named_Parameters_Commands is type Command is new LSP.Commands.Command with private; procedure Initialize - (Self : in out Command'Class; - Context : LSP.Ada_Contexts.Context; - Where : LSP.Messages.TextDocumentPositionParams); + (Self : in out Command'Class; + Context : LSP.Ada_Context_Sets.Context_Access; + Where : LSP.Structures.TextDocumentPositionParams; + Versioned_Documents : Boolean); + + procedure Append_Suggestion + (Self : in out Command; + Context : LSP.Ada_Context_Sets.Context_Access; + Commands_Vector : in out LSP.Structures.Command_Or_CodeAction_Vector; + Where : LSP.Structures.Location; + Versioned_Documents : Boolean); + -- Initializes Command and appends it to Commands_Vector. private type Command is new LSP.Commands.Command with record - Context : VSS.Strings.Virtual_String; - Where : LSP.Messages.TextDocumentPositionParams; + Context : VSS.Strings.Virtual_String; + Where : LSP.Structures.TextDocumentPositionParams; + Versioned_Documents : Boolean; end record; overriding function Create - (JS : not null access LSP.JSON_Streams.JSON_Stream'Class) + (Any : not null access LSP.Structures.LSPAny_Vector) return Command; overriding procedure Execute @@ -53,13 +58,12 @@ private LSP.Server_Notification_Receivers.Server_Notification_Receiver'Class; Client : not null access LSP.Client_Message_Receivers.Client_Message_Receiver'Class; - Error : in out LSP.Errors.Optional_ResponseError); + Id : LSP.Structures.Integer_Or_Virtual_String; + Error : in out LSP.Errors.ResponseError_Optional); - procedure Write_Command - (S : access Ada.Streams.Root_Stream_Type'Class; - V : Command); + function Write_Command + (Self : Command) return LSP.Structures.LSPAny_Vector; - for Command'Write use Write_Command; for Command'External_Tag use "als-named-parameters"; end LSP.Ada_Handlers.Named_Parameters_Commands; diff --git a/source/ada/lsp-ada_handlers-refactor-add_parameter.adb b/source/ada/lsp-ada_handlers-refactor-add_parameter.adb index e755ad6ba..e541b62d9 100644 --- a/source/ada/lsp-ada_handlers-refactor-add_parameter.adb +++ b/source/ada/lsp-ada_handlers-refactor-add_parameter.adb @@ -1,7 +1,7 @@ ------------------------------------------------------------------------------ -- Language Server Protocol -- -- -- --- Copyright (C) 2021-2022, AdaCore -- +-- Copyright (C) 2021-2023, AdaCore -- -- -- -- This is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -15,8 +15,6 @@ -- of the license. -- ------------------------------------------------------------------------------ -with Ada.Strings.UTF_Encoding; - with Langkit_Support.Slocs; with Libadalang.Analysis; use Libadalang.Analysis; @@ -24,8 +22,11 @@ with Libadalang.Analysis; use Libadalang.Analysis; with LAL_Refactor.Subprogram_Signature; use LAL_Refactor.Subprogram_Signature; +with VSS.JSON.Streams; with VSS.Strings.Conversions; -with LSP.Commands; + +with LSP.Enumerations; +with LSP.Structures.LSPAny_Vectors; use LSP.Structures.LSPAny_Vectors; package body LSP.Ada_Handlers.Refactor.Add_Parameter is @@ -35,13 +36,13 @@ package body LSP.Ada_Handlers.Refactor.Add_Parameter is procedure Append_Code_Action (Self : in out Command; - Context : Context_Access; - Commands_Vector : in out LSP.Messages.CodeAction_Vector; - Where : LSP.Messages.Location; + Context : LSP.Ada_Context_Sets.Context_Access; + Commands_Vector : in out LSP.Structures. + Command_Or_CodeAction_Vector; + Where : LSP.Structures.Location; Requires_Full_Specification : Boolean) is - Pointer : LSP.Commands.Command_Pointer; - Code_Action : LSP.Messages.CodeAction; + Code_Action : LSP.Structures.CodeAction; begin Self.Initialize @@ -49,25 +50,27 @@ package body LSP.Ada_Handlers.Refactor.Add_Parameter is Where => Where, Requires_Full_Specification => Requires_Full_Specification); - Pointer.Set (Self); - Code_Action := (title => "Add Parameter", kind => (Is_Set => True, - Value => LSP.Messages.RefactorRewrite), - diagnostics => (Is_Set => False), + Value => LSP.Enumerations.RefactorRewrite), + diagnostics => <>, edit => (Is_Set => False), isPreferred => (Is_Set => False), disabled => (Is_Set => False), command => (Is_Set => True, Value => - (Is_Unknown => False, - title => <>, - Custom => Pointer))); - - Commands_Vector.Append (Code_Action); + (title => <>, + command => VSS.Strings.Conversions.To_Virtual_String + (Command'External_Tag), + arguments => Self.Write_Command)), + data => <>); + + Commands_Vector.Append + (LSP.Structures.Command_Or_CodeAction' + (Is_Command => False, CodeAction => Code_Action)); end Append_Code_Action; ------------ @@ -75,44 +78,47 @@ package body LSP.Ada_Handlers.Refactor.Add_Parameter is ------------ overriding function Create - (JS : not null access LSP.JSON_Streams.JSON_Stream'Class) - return Command is - begin - return V : Command do - pragma Assert (JS.R.Is_Start_Object); - - JS.R.Read_Next; - - while not JS.R.Is_End_Object loop - pragma Assert (JS.R.Is_Key_Name); + (Any : not null access LSP.Structures.LSPAny_Vector) + return Command + is + use VSS.JSON.Streams; + use VSS.Strings; + use LSP.Structures.JSON_Event_Vectors; + C : Cursor := Any.First; + begin + return Self : Command do + pragma Assert (Element (C).Kind = Start_Object); + Next (C); + + while Has_Element (C) + and then Element (C).Kind /= End_Object + loop + pragma Assert (Element (C).Kind = Key_Name); declare - Key : constant Ada.Strings.UTF_Encoding.UTF_8_String := - VSS.Strings.Conversions.To_UTF_8_String (JS.R.Key_Name); - + Key : constant Virtual_String := Element (C).Key_Name; begin - JS.R.Read_Next; + Next (C); if Key = "context_id" then - LSP.Types.Read_String (JS, V.Context_Id); + Self.Context_Id := Element (C).String_Value; elsif Key = "where" then - LSP.Messages.Location'Read (JS, V.Where); + Self.Where := From_Any (C); elsif Key = "newParameter" then - LSP.Types.Read_String (JS, V.New_Parameter); + Self.New_Parameter := Element (C).String_Value; elsif Key = "requiresFullSpecification" then - LSP.Types.Read_Boolean - (JS.all, V.Requires_Full_Specification); + Self.Requires_Full_Specification := From_Any (C); else - JS.Skip_Value; + Skip_Value (C); end if; end; - end loop; - JS.R.Read_Next; + Next (C); + end loop; end return; end Create; @@ -130,7 +136,6 @@ package body LSP.Ada_Handlers.Refactor.Add_Parameter is is use Langkit_Support.Slocs; use LAL_Refactor; - use LSP.Types; Message_Handler : LSP.Ada_Handlers.Message_Handler renames LSP.Ada_Handlers.Message_Handler (Handler.all); @@ -147,9 +152,9 @@ package body LSP.Ada_Handlers.Refactor.Add_Parameter is (Context.URI_To_File (Self.Where.uri)), Location => (Langkit_Support.Slocs.Line_Number - (Self.Where.span.first.line) + 1, + (Self.Where.a_range.start.line) + 1, Langkit_Support.Slocs.Column_Number - (Self.Where.span.first.character) + 1), + (Self.Where.a_range.start.character) + 1), New_Parameter => VSS.Strings.Conversions.To_Unbounded_UTF_8_String (Self.New_Parameter)); @@ -164,12 +169,13 @@ package body LSP.Ada_Handlers.Refactor.Add_Parameter is procedure Initialize (Self : in out Command'Class; Context : LSP.Ada_Contexts.Context; - Where : LSP.Messages.Location; + Where : LSP.Structures.Location; Requires_Full_Specification : Boolean) is begin - Self.Context_Id := Context.Id; - Self.Where := Where; + Self.Context_Id := Context.Id; + Self.Where := Where; Self.New_Parameter := VSS.Strings.Empty_Virtual_String; + Self.Requires_Full_Specification := Requires_Full_Specification; end Initialize; @@ -177,29 +183,35 @@ package body LSP.Ada_Handlers.Refactor.Add_Parameter is -- Write_Command -- ------------------- - procedure Write_Command - (S : access Ada.Streams.Root_Stream_Type'Class; - C : Command) + function Write_Command + (Self : Command) + return LSP.Structures.LSPAny_Vector is - JS : LSP.JSON_Streams.JSON_Stream'Class renames - LSP.JSON_Streams.JSON_Stream'Class (S.all); - - function "+" - (Text : Ada.Strings.UTF_Encoding.UTF_8_String) - return VSS.Strings.Virtual_String - renames VSS.Strings.Conversions.To_Virtual_String; + use VSS.JSON.Streams; + Result : LSP.Structures.LSPAny_Vector; begin - JS.Start_Object; - JS.Key ("context_id"); - LSP.Types.Write_String (S, C.Context_Id); - JS.Key ("where"); - LSP.Messages.Location'Write (S, C.Where); - JS.Key ("newParameter"); - LSP.Types.Write_String (S, C.New_Parameter); - LSP.Types.Write_Boolean - (JS, +"requiresFullSpecification", C.Requires_Full_Specification); - JS.End_Object; + Result.Append (JSON_Stream_Element'(Kind => Start_Object)); + + -- "context_id" + Add_Key ("context_id", Result); + To_Any (Self.Context_Id, Result); + + -- "where" + Add_Key ("where", Result); + To_Any (Self.Where, Result); + + -- "newParameter" + Add_Key ("newParameter", Result); + To_Any (Self.New_Parameter, Result); + + -- "requiresFullSpecification" + Add_Key ("requiresFullSpecification", Result); + To_Any (Self.Requires_Full_Specification, Result); + + Result.Append (JSON_Stream_Element'(Kind => End_Object)); + + return Result; end Write_Command; end LSP.Ada_Handlers.Refactor.Add_Parameter; diff --git a/source/ada/lsp-ada_handlers-refactor-add_parameter.ads b/source/ada/lsp-ada_handlers-refactor-add_parameter.ads index 5bff6fa69..88a635646 100644 --- a/source/ada/lsp-ada_handlers-refactor-add_parameter.ads +++ b/source/ada/lsp-ada_handlers-refactor-add_parameter.ads @@ -1,7 +1,7 @@ ------------------------------------------------------------------------------ -- Language Server Protocol -- -- -- --- Copyright (C) 2021, AdaCore -- +-- Copyright (C) 2021-2023, AdaCore -- -- -- -- This is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -17,11 +17,8 @@ -- -- Implementation of the refactoring command to add parameters -with Ada.Streams; - +with LSP.Ada_Contexts; with LSP.Client_Message_Receivers; -with LSP.Messages; -with LSP.JSON_Streams; with VSS.Strings; @@ -35,9 +32,10 @@ package LSP.Ada_Handlers.Refactor.Add_Parameter is procedure Append_Code_Action (Self : in out Command; - Context : Context_Access; - Commands_Vector : in out LSP.Messages.CodeAction_Vector; - Where : LSP.Messages.Location; + Context : LSP.Ada_Context_Sets.Context_Access; + Commands_Vector : in out LSP.Structures. + Command_Or_CodeAction_Vector; + Where : LSP.Structures.Location; Requires_Full_Specification : Boolean); -- Initializes Self and appends it to Commands_Vector @@ -45,14 +43,14 @@ private type Command is new LSP.Ada_Handlers.Refactor.Command with record Context_Id : VSS.Strings.Virtual_String; - Where : LSP.Messages.Location; + Where : LSP.Structures.Location; New_Parameter : VSS.Strings.Virtual_String; Requires_Full_Specification : Boolean; end record; overriding function Create - (JS : not null access LSP.JSON_Streams.JSON_Stream'Class) + (Any : not null access LSP.Structures.LSPAny_Vector) return Command; -- Reads JS and creates a new Command @@ -69,16 +67,12 @@ private procedure Initialize (Self : in out Command'Class; Context : LSP.Ada_Contexts.Context; - Where : LSP.Messages.Location; + Where : LSP.Structures.Location; Requires_Full_Specification : Boolean); -- Initializes Self - procedure Write_Command - (S : access Ada.Streams.Root_Stream_Type'Class; - C : Command); - -- Writes C to S + function Write_Command (Self : Command) return LSP.Structures.LSPAny_Vector; - for Command'Write use Write_Command; for Command'External_Tag use "als-refactor-add-parameters"; end LSP.Ada_Handlers.Refactor.Add_Parameter; diff --git a/source/ada/lsp-ada_handlers-refactor-change_parameter_mode.adb b/source/ada/lsp-ada_handlers-refactor-change_parameter_mode.adb index 842f2323d..2569d39b5 100644 --- a/source/ada/lsp-ada_handlers-refactor-change_parameter_mode.adb +++ b/source/ada/lsp-ada_handlers-refactor-change_parameter_mode.adb @@ -1,7 +1,7 @@ ------------------------------------------------------------------------------ -- Language Server Protocol -- -- -- --- Copyright (C) 2021-2022, AdaCore -- +-- Copyright (C) 2021-2023, AdaCore -- -- -- -- This is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -15,18 +15,18 @@ -- of the license. -- ------------------------------------------------------------------------------ -with Ada.Strings.UTF_Encoding; - with Libadalang.Analysis; use Libadalang.Analysis; with Libadalang.Common; use Libadalang.Common; with Laltools.Common; use Laltools.Common; -with LSP.Messages; -with LSP.Lal_Utils; - +with VSS.JSON.Streams; with VSS.Strings.Conversions; -with LSP.Commands; + +with LSP.Ada_Contexts; +with LSP.Enumerations; +with LSP.Utils; +with LSP.Structures.LSPAny_Vectors; use LSP.Structures.LSPAny_Vectors; package body LSP.Ada_Handlers.Refactor.Change_Parameter_Mode is @@ -36,16 +36,15 @@ package body LSP.Ada_Handlers.Refactor.Change_Parameter_Mode is procedure Append_Code_Action (Self : in out Command; - Context : Context_Access; - Commands_Vector : in out LSP.Messages.CodeAction_Vector; + Context : LSP.Ada_Context_Sets.Context_Access; + Commands_Vector : in out LSP.Structures.Command_Or_CodeAction_Vector; Target_Subp : Libadalang.Analysis.Basic_Decl; Parameters_Indices : Parameter_Indices_Range_Type; New_Mode : Libadalang.Common.Ada_Mode) is - Pointer : LSP.Commands.Command_Pointer; - Code_Action : LSP.Messages.CodeAction; - Where : constant LSP.Messages.Location := - LSP.Lal_Utils.Get_Node_Location (Target_Subp.P_Defining_Name.F_Name); + Code_Action : LSP.Structures.CodeAction; + Where : constant LSP.Structures.Location := + LSP.Utils.Get_Node_Location (Target_Subp.P_Defining_Name.F_Name); function Create_Code_Action_Title return VSS.Strings.Virtual_String; -- Creates the code action text that will be shown by the client to the @@ -157,31 +156,33 @@ package body LSP.Ada_Handlers.Refactor.Change_Parameter_Mode is begin Self.Initialize - (Context => Context.all, - Where => ((uri => Where.uri), Where.span.first), - First_Param_Index => LSP.Types.LSP_Number (Parameters_Indices.First), - Last_Param_Index => LSP.Types.LSP_Number (Parameters_Indices.Last), + (Context => Context, + Where => ((uri => Where.uri), Where.a_range.start), + First_Param_Index => Parameters_Indices.First, + Last_Param_Index => Parameters_Indices.Last, New_Mode => Image (New_Mode)); - Pointer.Set (Self); - Code_Action := (title => Create_Code_Action_Title, kind => (Is_Set => True, - Value => LSP.Messages.RefactorRewrite), - diagnostics => (Is_Set => False), + Value => LSP.Enumerations.RefactorRewrite), + diagnostics => <>, edit => (Is_Set => False), isPreferred => (Is_Set => False), disabled => (Is_Set => False), command => (Is_Set => True, Value => - (Is_Unknown => False, - title => <>, - Custom => Pointer))); - - Commands_Vector.Append (Code_Action); + (title => <>, + command => VSS.Strings.Conversions.To_Virtual_String + (Command'External_Tag), + arguments => Self.Write_Command)), + data => <>); + + Commands_Vector.Append + (LSP.Structures.Command_Or_CodeAction' + (Is_Command => False, CodeAction => Code_Action)); end Append_Code_Action; ------------ @@ -190,46 +191,50 @@ package body LSP.Ada_Handlers.Refactor.Change_Parameter_Mode is overriding function Create - (JS : not null access LSP.JSON_Streams.JSON_Stream'Class) - return Command is - begin - return C : Command do - pragma Assert (JS.R.Is_Start_Object); - - JS.R.Read_Next; - - while not JS.R.Is_End_Object loop - pragma Assert (JS.R.Is_Key_Name); + (Any : not null access LSP.Structures.LSPAny_Vector) + return Command + is + use VSS.JSON.Streams; + use VSS.Strings; + use LSP.Structures.JSON_Event_Vectors; + C : Cursor := Any.First; + begin + return Self : Command do + pragma Assert (Element (C).Kind = Start_Object); + Next (C); + + while Has_Element (C) + and then Element (C).Kind /= End_Object + loop + pragma Assert (Element (C).Kind = Key_Name); declare - Key : constant Ada.Strings.UTF_Encoding.UTF_8_String := - VSS.Strings.Conversions.To_UTF_8_String (JS.R.Key_Name); - + Key : constant Virtual_String := Element (C).Key_Name; begin - JS.R.Read_Next; + Next (C); if Key = "context" then - LSP.Types.Read_String (JS, C.Context); + Self.Context := Element (C).String_Value; elsif Key = "where" then - LSP.Messages.TextDocumentPositionParams'Read (JS, C.Where); + Self.Where := From_Any (C); elsif Key = "first_parameter" then - LSP.Types.Read (JS, C.First_Param_Index); + Self.First_Param_Index := From_Any (C); elsif Key = "last_parameter" then - LSP.Types.Read (JS, C.Last_Param_Index); + Self.Last_Param_Index := From_Any (C); elsif Key = "new_mode" then - LSP.Types.Read_String (JS, C.New_Mode); + Self.New_Mode := Element (C).String_Value; else - JS.Skip_Value; + Skip_Value (C); end if; end; - end loop; - JS.R.Read_Next; + Next (C); + end loop; end return; end Create; @@ -247,7 +252,6 @@ package body LSP.Ada_Handlers.Refactor.Change_Parameter_Mode is Edits : out LAL_Refactor.Refactoring_Edits) is use LAL_Refactor; - use LSP.Types; Message_Handler : LSP.Ada_Handlers.Message_Handler renames LSP.Ada_Handlers.Message_Handler (Handler.all); @@ -321,10 +325,10 @@ package body LSP.Ada_Handlers.Refactor.Change_Parameter_Mode is procedure Initialize (Self : in out Command'Class; - Context : LSP.Ada_Contexts.Context; - Where : LSP.Messages.TextDocumentPositionParams; - First_Param_Index : LSP.Types.LSP_Number; - Last_Param_Index : LSP.Types.LSP_Number; + Context : LSP.Ada_Context_Sets.Context_Access; + Where : LSP.Structures.TextDocumentPositionParams; + First_Param_Index : Integer; + Last_Param_Index : Integer; New_Mode : VSS.Strings.Virtual_String) is begin Self.Context := Context.Id; @@ -338,24 +342,36 @@ package body LSP.Ada_Handlers.Refactor.Change_Parameter_Mode is -- Write_Command -- ------------------- - procedure Write_Command - (S : access Ada.Streams.Root_Stream_Type'Class; - C : Command) + function Write_Command (Self : Command) return LSP.Structures.LSPAny_Vector is - JS : LSP.JSON_Streams.JSON_Stream'Class renames - LSP.JSON_Streams.JSON_Stream'Class (S.all); + use VSS.JSON.Streams; + + Result : LSP.Structures.LSPAny_Vector; begin - JS.Start_Object; - JS.Key ("context"); - LSP.Types.Write_String (S, C.Context); - JS.Key ("where"); - LSP.Messages.TextDocumentPositionParams'Write (S, C.Where); - JS.Key ("first_parameter"); - LSP.Types.Write (S, C.First_Param_Index); - JS.Key ("last_parameter"); - LSP.Types.Write (S, C.Last_Param_Index); - JS.Key ("new_mode"); - LSP.Types.Write_String (S, C.New_Mode); - JS.End_Object; + Result.Append (JSON_Stream_Element'(Kind => Start_Object)); + + -- "context" + Add_Key ("context", Result); + To_Any (Self.Context, Result); + + -- "where" + Add_Key ("where", Result); + To_Any (Self.Where, Result); + + -- "first_parameter" + Add_Key ("first_parameter", Result); + To_Any (Self.First_Param_Index, Result); + + -- "last_parameter" + Add_Key ("last_parameter", Result); + To_Any (Self.Last_Param_Index, Result); + + -- "new_mode" + Add_Key ("new_mode", Result); + To_Any (Self.New_Mode, Result); + + Result.Append (JSON_Stream_Element'(Kind => End_Object)); + + return Result; end Write_Command; end LSP.Ada_Handlers.Refactor.Change_Parameter_Mode; diff --git a/source/ada/lsp-ada_handlers-refactor-change_parameter_mode.ads b/source/ada/lsp-ada_handlers-refactor-change_parameter_mode.ads index 81a9d94c2..002862196 100644 --- a/source/ada/lsp-ada_handlers-refactor-change_parameter_mode.ads +++ b/source/ada/lsp-ada_handlers-refactor-change_parameter_mode.ads @@ -1,7 +1,7 @@ ------------------------------------------------------------------------------ -- Language Server Protocol -- -- -- --- Copyright (C) 2021, AdaCore -- +-- Copyright (C) 2021-2023, AdaCore -- -- -- -- This is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -17,12 +17,9 @@ -- -- Implementation of the refactoring command to change parameters modes -with Ada.Streams; - private with VSS.Strings; with LSP.Client_Message_Receivers; -with LSP.JSON_Streams; with Libadalang.Analysis; with Libadalang.Common; @@ -39,8 +36,8 @@ package LSP.Ada_Handlers.Refactor.Change_Parameter_Mode is procedure Append_Code_Action (Self : in out Command; - Context : Context_Access; - Commands_Vector : in out LSP.Messages.CodeAction_Vector; + Context : LSP.Ada_Context_Sets.Context_Access; + Commands_Vector : in out LSP.Structures.Command_Or_CodeAction_Vector; Target_Subp : Libadalang.Analysis.Basic_Decl; Parameters_Indices : Parameter_Indices_Range_Type; New_Mode : Libadalang.Common.Ada_Mode); @@ -50,15 +47,15 @@ private type Command is new LSP.Ada_Handlers.Refactor.Command with record Context : VSS.Strings.Virtual_String; - Where : LSP.Messages.TextDocumentPositionParams; - First_Param_Index : LSP.Types.LSP_Number; - Last_Param_Index : LSP.Types.LSP_Number; + Where : LSP.Structures.TextDocumentPositionParams; + First_Param_Index : Integer; + Last_Param_Index : Integer; New_Mode : VSS.Strings.Virtual_String; end record; overriding function Create - (JS : not null access LSP.JSON_Streams.JSON_Stream'Class) + (Any : not null access LSP.Structures.LSPAny_Vector) return Command; -- Reads JS and creates a new Command @@ -74,19 +71,16 @@ private procedure Initialize (Self : in out Command'Class; - Context : LSP.Ada_Contexts.Context; - Where : LSP.Messages.TextDocumentPositionParams; - First_Param_Index : LSP.Types.LSP_Number; - Last_Param_Index : LSP.Types.LSP_Number; + Context : LSP.Ada_Context_Sets.Context_Access; + Where : LSP.Structures.TextDocumentPositionParams; + First_Param_Index : Integer; + Last_Param_Index : Integer; New_Mode : VSS.Strings.Virtual_String); -- Initializes Self - procedure Write_Command - (S : access Ada.Streams.Root_Stream_Type'Class; - C : Command); - -- Writes C to S + function Write_Command (Self : Command) return LSP.Structures.LSPAny_Vector; + -- Writes the command to Any_Vector - for Command'Write use Write_Command; for Command'External_Tag use "als-refactor-change-parameter-mode"; end LSP.Ada_Handlers.Refactor.Change_Parameter_Mode; diff --git a/source/ada/lsp-ada_handlers-refactor-change_parameters_default_value.adb b/source/ada/lsp-ada_handlers-refactor-change_parameters_default_value.adb index 83a6ebd53..bf7721cd3 100644 --- a/source/ada/lsp-ada_handlers-refactor-change_parameters_default_value.adb +++ b/source/ada/lsp-ada_handlers-refactor-change_parameters_default_value.adb @@ -2,7 +2,7 @@ -- -- -- Libadalang Tools -- -- -- --- Copyright (C) 2021-2022, AdaCore -- +-- Copyright (C) 2021-2023, AdaCore -- -- -- -- Libadalang Tools is free software; you can redistribute it and/or modi- -- -- fy it under terms of the GNU General Public License as published by -- @@ -21,18 +21,16 @@ -- . -- ------------------------------------------------------------------------------ -with Ada.Strings.UTF_Encoding; - with Langkit_Support.Slocs; use Langkit_Support.Slocs; - with Libadalang.Analysis; use Libadalang.Analysis; with LAL_Refactor.Subprogram_Signature.Change_Parameters_Default_Value; -with LSP.Messages; - +with VSS.JSON.Streams; with VSS.Strings.Conversions; -with LSP.Commands; + +with LSP.Enumerations; +with LSP.Structures.LSPAny_Vectors; use LSP.Structures.LSPAny_Vectors; package body LSP.Ada_Handlers.Refactor.Change_Parameters_Default_Value is @@ -42,12 +40,11 @@ package body LSP.Ada_Handlers.Refactor.Change_Parameters_Default_Value is procedure Append_Code_Action (Self : in out Command; - Context : Context_Access; - Commands_Vector : in out LSP.Messages.CodeAction_Vector; - Where : LSP.Messages.Location) + Context : LSP.Ada_Context_Sets.Context_Access; + Commands_Vector : in out LSP.Structures.Command_Or_CodeAction_Vector; + Where : LSP.Structures.Location) is - Pointer : LSP.Commands.Command_Pointer; - Code_Action : LSP.Messages.CodeAction; + Code_Action : LSP.Structures.CodeAction; begin Self.Initialize @@ -55,25 +52,27 @@ package body LSP.Ada_Handlers.Refactor.Change_Parameters_Default_Value is Where => Where, New_Parameters_Default_Value => ""); - Pointer.Set (Self); - Code_Action := (title => "Change Parameter Default Value", kind => (Is_Set => True, - Value => LSP.Messages.RefactorRewrite), - diagnostics => (Is_Set => False), + Value => LSP.Enumerations.RefactorRewrite), + diagnostics => <>, edit => (Is_Set => False), isPreferred => (Is_Set => False), disabled => (Is_Set => False), command => (Is_Set => True, Value => - (Is_Unknown => False, - title => <>, - Custom => Pointer))); - - Commands_Vector.Append (Code_Action); + (title => <>, + command => VSS.Strings.Conversions.To_Virtual_String + (Command'External_Tag), + arguments => Self.Write_Command)), + data => <>); + + Commands_Vector.Append + (LSP.Structures.Command_Or_CodeAction' + (Is_Command => False, CodeAction => Code_Action)); end Append_Code_Action; ------------ @@ -82,45 +81,45 @@ package body LSP.Ada_Handlers.Refactor.Change_Parameters_Default_Value is overriding function Create - (JS : not null access LSP.JSON_Streams.JSON_Stream'Class) + (Any : not null access LSP.Structures.LSPAny_Vector) return Command is - use Ada.Strings.UTF_Encoding; - use LSP.Messages; - use LSP.Types; - use VSS.Strings.Conversions; + use VSS.JSON.Streams; + use VSS.Strings; + use LSP.Structures.JSON_Event_Vectors; + C : Cursor := Any.First; begin - return C : Command do - pragma Assert (JS.R.Is_Start_Object); - - JS.R.Read_Next; - - while not JS.R.Is_End_Object loop - pragma Assert (JS.R.Is_Key_Name); - + return Self : Command do + pragma Assert (Element (C).Kind = Start_Object); + Next (C); + + while Has_Element (C) + and then Element (C).Kind /= End_Object + loop + pragma Assert (Element (C).Kind = Key_Name); declare - Key : constant UTF_8_String := To_UTF_8_String (JS.R.Key_Name); - + Key : constant Virtual_String := Element (C).Key_Name; begin - JS.R.Read_Next; + Next (C); if Key = "context" then - Read_String (JS, C.Context); + Self.Context := Element (C).String_Value; elsif Key = "where" then - Location'Read (JS, C.Where); + Self.Where := From_Any (C); - elsif Key = "newParametersDefaultValue" then - Read_String (JS, C.New_Parameters_Default_Value); + elsif Key = "newParametersType" then + Self.New_Parameters_Default_Value := + Element (C).String_Value; else - JS.Skip_Value; + Skip_Value (C); end if; end; - end loop; - JS.R.Read_Next; + Next (C); + end loop; end return; end Create; @@ -140,7 +139,6 @@ package body LSP.Ada_Handlers.Refactor.Change_Parameters_Default_Value is use LAL_Refactor; use LAL_Refactor.Subprogram_Signature. Change_Parameters_Default_Value; - use LSP.Types; use VSS.Strings.Conversions; Message_Handler : LSP.Ada_Handlers.Message_Handler renames @@ -148,15 +146,16 @@ package body LSP.Ada_Handlers.Refactor.Change_Parameters_Default_Value is Context : LSP.Ada_Contexts.Context renames Message_Handler.Contexts.Get (Self.Context).all; - Unit : constant Analysis_Unit := - Context.LAL_Context.Get_From_File - (Context.URI_To_File (Self.Where.uri)); + Unit : constant Analysis_Unit := Context.LAL_Context.Get_From_File + (VSS.Strings.Conversions.To_UTF_8_String (Self.Where.uri)); Parameters_SLOC_Range : constant Source_Location_Range := - (Langkit_Support.Slocs.Line_Number (Self.Where.span.first.line) + 1, - Langkit_Support.Slocs.Line_Number (Self.Where.span.last.line) + 1, - Column_Number (Self.Where.span.first.character) + 1, - Column_Number (Self.Where.span.last.character) + 1); + (Langkit_Support.Slocs.Line_Number + (Self.Where.a_range.start.line) + 1, + Langkit_Support.Slocs.Line_Number + (Self.Where.a_range.an_end.line) + 1, + Column_Number (Self.Where.a_range.start.character) + 1, + Column_Number (Self.Where.a_range.an_end.character) + 1); Changer : constant Parameters_Default_Value_Changer := Create_Parameters_Default_Value_Changer @@ -181,11 +180,11 @@ package body LSP.Ada_Handlers.Refactor.Change_Parameters_Default_Value is procedure Initialize (Self : in out Command'Class; Context : LSP.Ada_Contexts.Context; - Where : LSP.Messages.Location; + Where : LSP.Structures.Location; New_Parameters_Default_Value : VSS.Strings.Virtual_String) is begin Self.Context := Context.Id; - Self.Where := Where; + Self.Where := Where; Self.New_Parameters_Default_Value := New_Parameters_Default_Value; end Initialize; @@ -193,25 +192,29 @@ package body LSP.Ada_Handlers.Refactor.Change_Parameters_Default_Value is -- Write_Command -- ------------------- - procedure Write_Command - (S : access Ada.Streams.Root_Stream_Type'Class; - C : Command) + function Write_Command (Self : Command) return LSP.Structures.LSPAny_Vector is - use LSP.Messages; - use LSP.Types; - - JS : LSP.JSON_Streams.JSON_Stream'Class renames - LSP.JSON_Streams.JSON_Stream'Class (S.all); + use VSS.JSON.Streams; + Result : LSP.Structures.LSPAny_Vector; begin - JS.Start_Object; - JS.Key ("context"); - Write_String (S, C.Context); - JS.Key ("where"); - Location'Write (S, C.Where); - JS.Key ("newParametersDefaultValue"); - Write_String (S, C.New_Parameters_Default_Value); - JS.End_Object; + Result.Append (JSON_Stream_Element'(Kind => Start_Object)); + + -- "context" + Add_Key ("context", Result); + To_Any (Self.Context, Result); + + -- "where" + Add_Key ("where", Result); + To_Any (Self.Where, Result); + + -- "newParametersDefaultValue" + Add_Key ("newParametersDefaultValue", Result); + To_Any (Self.New_Parameters_Default_Value, Result); + + Result.Append (JSON_Stream_Element'(Kind => End_Object)); + + return Result; end Write_Command; end LSP.Ada_Handlers.Refactor.Change_Parameters_Default_Value; diff --git a/source/ada/lsp-ada_handlers-refactor-change_parameters_default_value.ads b/source/ada/lsp-ada_handlers-refactor-change_parameters_default_value.ads index c0ca4e67f..840efbf50 100644 --- a/source/ada/lsp-ada_handlers-refactor-change_parameters_default_value.ads +++ b/source/ada/lsp-ada_handlers-refactor-change_parameters_default_value.ads @@ -1,7 +1,7 @@ ------------------------------------------------------------------------------ -- Language Server Protocol -- -- -- --- Copyright (C) 2022, AdaCore -- +-- Copyright (C) 2022-2023, AdaCore -- -- -- -- This is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -18,10 +18,8 @@ -- Implementation of the refactoring command to change a subprogram -- parameter default value -with Ada.Streams; - +with LSP.Ada_Contexts; with LSP.Client_Message_Receivers; -with LSP.JSON_Streams; private with VSS.Strings; @@ -35,22 +33,22 @@ package LSP.Ada_Handlers.Refactor.Change_Parameters_Default_Value is procedure Append_Code_Action (Self : in out Command; - Context : Context_Access; - Commands_Vector : in out LSP.Messages.CodeAction_Vector; - Where : LSP.Messages.Location); + Context : LSP.Ada_Context_Sets.Context_Access; + Commands_Vector : in out LSP.Structures.Command_Or_CodeAction_Vector; + Where : LSP.Structures.Location); -- Initializes Self and appends it to Commands_Vector private type Command is new LSP.Ada_Handlers.Refactor.Command with record Context : VSS.Strings.Virtual_String; - Where : LSP.Messages.Location; + Where : LSP.Structures.Location; New_Parameters_Default_Value : VSS.Strings.Virtual_String; end record; overriding function Create - (JS : not null access LSP.JSON_Streams.JSON_Stream'Class) + (Any : not null access LSP.Structures.LSPAny_Vector) return Command; -- Reads JS and creates a new Command @@ -67,16 +65,13 @@ private procedure Initialize (Self : in out Command'Class; Context : LSP.Ada_Contexts.Context; - Where : LSP.Messages.Location; + Where : LSP.Structures.Location; New_Parameters_Default_Value : VSS.Strings.Virtual_String); -- Initializes Self - procedure Write_Command - (S : access Ada.Streams.Root_Stream_Type'Class; - C : Command); - -- Writes C to S + function Write_Command (Self : Command) return LSP.Structures.LSPAny_Vector; + -- Writes the command to Any_Vector - for Command'Write use Write_Command; for Command'External_Tag use "als-refactor-change_parameters_default_value"; end LSP.Ada_Handlers.Refactor.Change_Parameters_Default_Value; diff --git a/source/ada/lsp-ada_handlers-refactor-change_parameters_type.adb b/source/ada/lsp-ada_handlers-refactor-change_parameters_type.adb index ea9fc6e62..afe0c9f9c 100644 --- a/source/ada/lsp-ada_handlers-refactor-change_parameters_type.adb +++ b/source/ada/lsp-ada_handlers-refactor-change_parameters_type.adb @@ -2,7 +2,7 @@ -- -- -- Libadalang Tools -- -- -- --- Copyright (C) 2021-2022, AdaCore -- +-- Copyright (C) 2021-2023, AdaCore -- -- -- -- Libadalang Tools is free software; you can redistribute it and/or modi- -- -- fy it under terms of the GNU General Public License as published by -- @@ -21,19 +21,17 @@ -- . -- ------------------------------------------------------------------------------ -with Ada.Strings.UTF_Encoding; +with Langkit_Support.Slocs; use Langkit_Support.Slocs; -with Langkit_Support.Slocs; use Langkit_Support.Slocs; - -with Libadalang.Analysis; use Libadalang.Analysis; +with Libadalang.Analysis; use Libadalang.Analysis; with LAL_Refactor.Subprogram_Signature.Change_Parameters_Type; -with LSP.Messages; - -with VSS.String_Vectors; +with VSS.JSON.Streams; with VSS.Strings.Conversions; -with LSP.Commands; + +with LSP.Enumerations; +with LSP.Structures.LSPAny_Vectors; use LSP.Structures.LSPAny_Vectors; package body LSP.Ada_Handlers.Refactor.Change_Parameters_Type is @@ -63,13 +61,12 @@ package body LSP.Ada_Handlers.Refactor.Change_Parameters_Type is procedure Append_Code_Action (Self : in out Command; - Context : Context_Access; - Commands_Vector : in out LSP.Messages.CodeAction_Vector; - Where : LSP.Messages.Location; + Context : LSP.Ada_Context_Sets.Context_Access; + Commands_Vector : in out LSP.Structures.Command_Or_CodeAction_Vector; + Where : LSP.Structures.Location; Syntax_Rules : Laltools.Common.Grammar_Rule_Vector) is - Pointer : LSP.Commands.Command_Pointer; - Code_Action : LSP.Messages.CodeAction; + Code_Action : LSP.Structures.CodeAction; begin Self.Initialize @@ -78,25 +75,28 @@ package body LSP.Ada_Handlers.Refactor.Change_Parameters_Type is Syntax_Rules => Syntax_Rules, New_Parameters_Type => ""); - Pointer.Set (Self); - Code_Action := - (title => "Change Parameter Type", + (title => VSS.Strings.Conversions.To_Virtual_String + ("Change Parameter Type"), kind => (Is_Set => True, - Value => LSP.Messages.RefactorRewrite), - diagnostics => (Is_Set => False), + Value => LSP.Enumerations.RefactorRewrite), + diagnostics => <>, edit => (Is_Set => False), isPreferred => (Is_Set => False), disabled => (Is_Set => False), command => (Is_Set => True, Value => - (Is_Unknown => False, - title => <>, - Custom => Pointer))); - - Commands_Vector.Append (Code_Action); + (title => <>, + command => VSS.Strings.Conversions.To_Virtual_String + (Command'External_Tag), + arguments => Self.Write_Command)), + data => <>); + + Commands_Vector.Append + (LSP.Structures.Command_Or_CodeAction' + (Is_Command => False, CodeAction => Code_Action)); end Append_Code_Action; ------------ @@ -105,48 +105,69 @@ package body LSP.Ada_Handlers.Refactor.Change_Parameters_Type is overriding function Create - (JS : not null access LSP.JSON_Streams.JSON_Stream'Class) + (Any : not null access LSP.Structures.LSPAny_Vector) return Command is - use Ada.Strings.UTF_Encoding; - use LSP.Messages; - use LSP.Types; - use VSS.Strings.Conversions; + use VSS.JSON.Streams; + use VSS.Strings; + use LSP.Structures.JSON_Event_Vectors; + C : Cursor := Any.First; begin - return C : Command do - pragma Assert (JS.R.Is_Start_Object); - - JS.R.Read_Next; - - while not JS.R.Is_End_Object loop - pragma Assert (JS.R.Is_Key_Name); - + return Self : Command do + pragma Assert (Element (C).Kind = Start_Object); + Next (C); + + while Has_Element (C) + and then Element (C).Kind /= End_Object + loop + pragma Assert (Element (C).Kind = Key_Name); declare - Key : constant UTF_8_String := To_UTF_8_String (JS.R.Key_Name); - + Key : constant Virtual_String := Element (C).Key_Name; begin - JS.R.Read_Next; + Next (C); if Key = "context" then - Read_String (JS, C.Context); + Self.Context := Element (C).String_Value; elsif Key = "where" then - Location'Read (JS, C.Where); + Self.Where := From_Any (C); elsif Key = "newParametersType" then - Read_String (JS, C.New_Parameters_Type); + Self.New_Parameters_Type := Element (C).String_Value; + + elsif Key = "syntaxRules" then + Self.Syntax_Rules := From_Any (C); else - JS.Skip_Value; + Skip_Value (C); end if; end; - end loop; - JS.R.Read_Next; + Next (C); + end loop; end return; end Create; + ---------------- + -- Initialize -- + ---------------- + + procedure Initialize + (Self : in out Command'Class; + Context : LSP.Ada_Contexts.Context; + Where : LSP.Structures.Location; + Syntax_Rules : Laltools.Common.Grammar_Rule_Vector; + New_Parameters_Type : VSS.Strings.Virtual_String) is + begin + Self.Context := Context.Id; + Self.Where := Where; + + Self.Syntax_Rules := + To_Virtual_String_Vector (Syntax_Rules); + Self.New_Parameters_Type := New_Parameters_Type; + end Initialize; + -------------- -- Refactor -- -------------- @@ -162,7 +183,6 @@ package body LSP.Ada_Handlers.Refactor.Change_Parameters_Type is is use LAL_Refactor; use LAL_Refactor.Subprogram_Signature.Change_Parameters_Type; - use LSP.Types; use VSS.Strings.Conversions; Message_Handler : LSP.Ada_Handlers.Message_Handler renames @@ -170,15 +190,16 @@ package body LSP.Ada_Handlers.Refactor.Change_Parameters_Type is Context : LSP.Ada_Contexts.Context renames Message_Handler.Contexts.Get (Self.Context).all; - Unit : constant Analysis_Unit := - Context.LAL_Context.Get_From_File - (Context.URI_To_File (Self.Where.uri)); + Unit : constant Analysis_Unit := Context.LAL_Context.Get_From_File + (VSS.Strings.Conversions.To_UTF_8_String (Self.Where.uri)); Parameters_SLOC_Range : constant Source_Location_Range := - (Langkit_Support.Slocs.Line_Number (Self.Where.span.first.line) + 1, - Langkit_Support.Slocs.Line_Number (Self.Where.span.last.line) + 1, - Column_Number (Self.Where.span.first.character) + 1, - Column_Number (Self.Where.span.last.character) + 1); + (Langkit_Support.Slocs.Line_Number + (Self.Where.a_range.start.line) + 1, + Langkit_Support.Slocs.Line_Number + (Self.Where.a_range.an_end.line) + 1, + Column_Number (Self.Where.a_range.start.character) + 1, + Column_Number (Self.Where.a_range.an_end.character) + 1); function Analysis_Units return Analysis_Unit_Array is (Context.Analysis_Units); @@ -196,49 +217,37 @@ package body LSP.Ada_Handlers.Refactor.Change_Parameters_Type is Edits := Changer.Refactor (Analysis_Units'Access); end Refactor; - ---------------- - -- Initialize -- - ---------------- - - procedure Initialize - (Self : in out Command'Class; - Context : LSP.Ada_Contexts.Context; - Where : LSP.Messages.Location; - Syntax_Rules : Laltools.Common.Grammar_Rule_Vector; - New_Parameters_Type : VSS.Strings.Virtual_String) is - begin - Self.Context := Context.Id; - Self.Where := Where; - Self.Syntax_Rules := - To_Virtual_String_Vector (Syntax_Rules); - Self.New_Parameters_Type := New_Parameters_Type; - end Initialize; - ------------------- -- Write_Command -- ------------------- - procedure Write_Command - (S : access Ada.Streams.Root_Stream_Type'Class; - C : Command) + function Write_Command (Self : Command) return LSP.Structures.LSPAny_Vector is - use LSP.Messages; - use LSP.Types; - - JS : LSP.JSON_Streams.JSON_Stream'Class renames - LSP.JSON_Streams.JSON_Stream'Class (S.all); + use VSS.JSON.Streams; + Result : LSP.Structures.LSPAny_Vector; begin - JS.Start_Object; - JS.Key ("context"); - Write_String (S, C.Context); - JS.Key ("where"); - Location'Write (S, C.Where); - JS.Key ("newParametersType"); - Write_String (S, C.New_Parameters_Type); - JS.Key ("syntaxRules"); - LSP.Types.Write_String_Vector (S, C.Syntax_Rules); - JS.End_Object; + Result.Append (JSON_Stream_Element'(Kind => Start_Object)); + + -- "context" + Add_Key ("context", Result); + To_Any (Self.Context, Result); + + -- "where" + Add_Key ("where", Result); + To_Any (Self.Where, Result); + + -- "newParametersType" + Add_Key ("newParametersType", Result); + To_Any (Self.New_Parameters_Type, Result); + + -- "syntaxRules" + Add_Key ("syntaxRules", Result); + To_Any (Self.Syntax_Rules, Result); + + Result.Append (JSON_Stream_Element'(Kind => End_Object)); + + return Result; end Write_Command; end LSP.Ada_Handlers.Refactor.Change_Parameters_Type; diff --git a/source/ada/lsp-ada_handlers-refactor-change_parameters_type.ads b/source/ada/lsp-ada_handlers-refactor-change_parameters_type.ads index f90ac214d..ad2ba5953 100644 --- a/source/ada/lsp-ada_handlers-refactor-change_parameters_type.ads +++ b/source/ada/lsp-ada_handlers-refactor-change_parameters_type.ads @@ -1,7 +1,7 @@ ------------------------------------------------------------------------------ -- Language Server Protocol -- -- -- --- Copyright (C) 2022, AdaCore -- +-- Copyright (C) 2022-2023, AdaCore -- -- -- -- This is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -18,14 +18,12 @@ -- Implementation of the refactoring command to change a subprogram -- parameter type -with Ada.Streams; - with Laltools.Common; with LSP.Client_Message_Receivers; -with LSP.JSON_Streams; -private with VSS.Strings; +private with VSS.String_Vectors; +private with LSP.Ada_Contexts; package LSP.Ada_Handlers.Refactor.Change_Parameters_Type is @@ -37,9 +35,9 @@ package LSP.Ada_Handlers.Refactor.Change_Parameters_Type is procedure Append_Code_Action (Self : in out Command; - Context : Context_Access; - Commands_Vector : in out LSP.Messages.CodeAction_Vector; - Where : LSP.Messages.Location; + Context : LSP.Ada_Context_Sets.Context_Access; + Commands_Vector : in out LSP.Structures.Command_Or_CodeAction_Vector; + Where : LSP.Structures.Location; Syntax_Rules : Laltools.Common.Grammar_Rule_Vector); -- Initializes Self and appends it to Commands_Vector @@ -47,16 +45,16 @@ private type Command is new LSP.Ada_Handlers.Refactor.Command with record Context : VSS.Strings.Virtual_String; - Where : LSP.Messages.Location; + Where : LSP.Structures.Location; Syntax_Rules : VSS.String_Vectors.Virtual_String_Vector; New_Parameters_Type : VSS.Strings.Virtual_String; end record; overriding function Create - (JS : not null access LSP.JSON_Streams.JSON_Stream'Class) + (Any : not null access LSP.Structures.LSPAny_Vector) return Command; - -- Reads JS and creates a new Command + -- Reads Stream and creates a new Command overriding procedure Refactor @@ -71,17 +69,14 @@ private procedure Initialize (Self : in out Command'Class; Context : LSP.Ada_Contexts.Context; - Where : LSP.Messages.Location; + Where : LSP.Structures.Location; Syntax_Rules : Laltools.Common.Grammar_Rule_Vector; New_Parameters_Type : VSS.Strings.Virtual_String); -- Initializes Self - procedure Write_Command - (S : access Ada.Streams.Root_Stream_Type'Class; - C : Command); - -- Writes C to S + function Write_Command (Self : Command) return LSP.Structures.LSPAny_Vector; + -- Writes the command to Any_Vector - for Command'Write use Write_Command; for Command'External_Tag use "als-refactor-change_parameters_type"; end LSP.Ada_Handlers.Refactor.Change_Parameters_Type; diff --git a/source/ada/lsp-ada_handlers-refactor-extract_subprogram.adb b/source/ada/lsp-ada_handlers-refactor-extract_subprogram.adb index c3eaaac01..dd13d265d 100644 --- a/source/ada/lsp-ada_handlers-refactor-extract_subprogram.adb +++ b/source/ada/lsp-ada_handlers-refactor-extract_subprogram.adb @@ -1,7 +1,7 @@ ------------------------------------------------------------------------------ -- Language Server Protocol -- -- -- --- Copyright (C) 2022, AdaCore -- +-- Copyright (C) 2022-2023, AdaCore -- -- -- -- This is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -15,8 +15,6 @@ -- of the license. -- ------------------------------------------------------------------------------ -with Ada.Strings.UTF_Encoding; - with Langkit_Support.Slocs; use Langkit_Support.Slocs; with Libadalang.Analysis; use Libadalang.Analysis; @@ -26,8 +24,10 @@ with LAL_Refactor; use LAL_Refactor; with LAL_Refactor.Extract_Subprogram; use LAL_Refactor.Extract_Subprogram; -with VSS.Strings.Conversions; -with LSP.Commands; +with VSS.JSON.Streams; + +with LSP.Enumerations; +with LSP.Structures.LSPAny_Vectors; use LSP.Structures.LSPAny_Vectors; package body LSP.Ada_Handlers.Refactor.Extract_Subprogram is @@ -37,13 +37,12 @@ package body LSP.Ada_Handlers.Refactor.Extract_Subprogram is procedure Append_Code_Action (Self : in out Command; - Context : Context_Access; - Commands_Vector : in out LSP.Messages.CodeAction_Vector; - Where : LSP.Messages.Location; + Context : LSP.Ada_Context_Sets.Context_Access; + Commands_Vector : in out LSP.Structures.Command_Or_CodeAction_Vector; + Where : LSP.Structures.Location; Subprogram_Kind : Libadalang.Common.Ada_Subp_Kind) is - Pointer : LSP.Commands.Command_Pointer; - Code_Action : LSP.Messages.CodeAction; + Code_Action : LSP.Structures.CodeAction; Code_Action_Title : constant String := (if Subprogram_Kind in Ada_Subp_Kind_Procedure_Range then @@ -57,26 +56,28 @@ package body LSP.Ada_Handlers.Refactor.Extract_Subprogram is Where => Where, Subprogram_Kind => Subprogram_Kind); - Pointer.Set (Self); - Code_Action := (title => VSS.Strings.Conversions.To_Virtual_String (Code_Action_Title), kind => (Is_Set => True, - Value => LSP.Messages.RefactorExtract), - diagnostics => (Is_Set => False), + Value => LSP.Enumerations.RefactorExtract), + diagnostics => <>, edit => (Is_Set => False), isPreferred => (Is_Set => False), disabled => (Is_Set => False), command => (Is_Set => True, Value => - (Is_Unknown => False, - title => "", - Custom => Pointer))); - - Commands_Vector.Append (Code_Action); + (title => "", + command => VSS.Strings.Conversions.To_Virtual_String + (Command'External_Tag), + arguments => Self.Write_Command)), + data => <>); + + Commands_Vector.Append + (LSP.Structures.Command_Or_CodeAction' + (Is_Command => False, CodeAction => Code_Action)); end Append_Code_Action; ------------ @@ -84,51 +85,47 @@ package body LSP.Ada_Handlers.Refactor.Extract_Subprogram is ------------ overriding function Create - (JS : not null access LSP.JSON_Streams.JSON_Stream'Class) - return Command is - begin - return V : Command do - pragma Assert (JS.R.Is_Start_Object); - - JS.R.Read_Next; - - while not JS.R.Is_End_Object loop - pragma Assert (JS.R.Is_Key_Name); + (Any : not null access LSP.Structures.LSPAny_Vector) + return Command + is + use VSS.JSON.Streams; + use VSS.Strings; + use LSP.Structures.JSON_Event_Vectors; + C : Cursor := Any.First; + begin + return Self : Command do + pragma Assert (Element (C).Kind = Start_Object); + Next (C); + + while Has_Element (C) + and then Element (C).Kind /= End_Object + loop + pragma Assert (Element (C).Kind = Key_Name); declare - Key : constant Ada.Strings.UTF_Encoding.UTF_8_String := - VSS.Strings.Conversions.To_UTF_8_String (JS.R.Key_Name); - + Key : constant Virtual_String := Element (C).Key_Name; begin - JS.R.Read_Next; + Next (C); if Key = "context_id" then - LSP.Types.Read_String (JS, V.Context_Id); + Self.Context_Id := Element (C).String_Value; elsif Key = "section_to_extract_sloc" then - LSP.Messages.Location'Read - (JS, V.Section_To_Extract_SLOC); + Self.Section_To_Extract_SLOC := From_Any (C); elsif Key = "subprogram_kind" then - declare - Subprogram_Kind : VSS.Strings.Virtual_String; - - use VSS.Strings.Conversions; - - begin - LSP.Types.Read_String (JS, Subprogram_Kind); - V.Subprogram_Kind := - Libadalang.Common.Ada_Subp_Kind'Value - (To_UTF_8_String (Subprogram_Kind)); - end; + Self.Subprogram_Kind := + Libadalang.Common.Ada_Subp_Kind'Value + (VSS.Strings.Conversions.To_UTF_8_String + (Element (C).String_Value)); else - JS.Skip_Value; + Skip_Value (C); end if; end; - end loop; - JS.R.Read_Next; + Next (C); + end loop; end return; end Create; @@ -144,8 +141,6 @@ package body LSP.Ada_Handlers.Refactor.Extract_Subprogram is Client_Message_Receiver'Class; Edits : out LAL_Refactor.Refactoring_Edits) is - use LSP.Types; - Message_Handler : LSP.Ada_Handlers.Message_Handler renames LSP.Ada_Handlers.Message_Handler (Handler.all); Context : LSP.Ada_Contexts.Context renames @@ -157,14 +152,17 @@ package body LSP.Ada_Handlers.Refactor.Extract_Subprogram is Unit : constant Analysis_Unit := Context.LAL_Context.Get_From_File - (Context.URI_To_File (Self.Section_To_Extract_SLOC.uri)); + (VSS.Strings.Conversions.To_UTF_8_String + (Self.Section_To_Extract_SLOC.uri)); Section_To_Extract : constant Source_Location_Range := (Langkit_Support.Slocs.Line_Number - (Self.Section_To_Extract_SLOC.span.first.line) + 1, + (Self.Section_To_Extract_SLOC.a_range.start.line) + 1, Langkit_Support.Slocs.Line_Number - (Self.Section_To_Extract_SLOC.span.last.line) + 1, - Column_Number (Self.Section_To_Extract_SLOC.span.first.character) + 1, - Column_Number (Self.Section_To_Extract_SLOC.span.last.character) + 1); + (Self.Section_To_Extract_SLOC.a_range.an_end.line) + 1, + Column_Number + (Self.Section_To_Extract_SLOC.a_range.start.character) + 1, + Column_Number + (Self.Section_To_Extract_SLOC.a_range.an_end.character) + 1); Extractor : constant Subprogram_Extractor := Create_Subprogram_Extractor @@ -188,7 +186,7 @@ package body LSP.Ada_Handlers.Refactor.Extract_Subprogram is procedure Initialize (Self : in out Command'Class; Context : LSP.Ada_Contexts.Context; - Where : LSP.Messages.Location; + Where : LSP.Structures.Location; Subprogram_Kind : Libadalang.Common.Ada_Subp_Kind) is begin Self.Context_Id := Context.Id; @@ -200,24 +198,33 @@ package body LSP.Ada_Handlers.Refactor.Extract_Subprogram is -- Write_Command -- ------------------- - procedure Write_Command - (S : access Ada.Streams.Root_Stream_Type'Class; - C : Command) + function Write_Command + (Self : Command) return LSP.Structures.LSPAny_Vector is - JS : LSP.JSON_Streams.JSON_Stream'Class renames - LSP.JSON_Streams.JSON_Stream'Class (S.all); + use VSS.JSON.Streams; + Result : LSP.Structures.LSPAny_Vector; begin - JS.Start_Object; - JS.Key ("context_id"); - LSP.Types.Write_String (S, C.Context_Id); - JS.Key ("section_to_extract_sloc"); - LSP.Messages.Location'Write (S, C.Section_To_Extract_SLOC); - JS.Key ("subprogram_kind"); - LSP.Types.Write_String - (S, - VSS.Strings.Conversions.To_Virtual_String (C.Subprogram_Kind'Image)); - JS.End_Object; + Result.Append (JSON_Stream_Element'(Kind => Start_Object)); + + -- "context_id" + Add_Key ("context_id", Result); + To_Any (Self.Context_Id, Result); + + -- "section_to_extract_sloc" + Add_Key ("section_to_extract_sloc", Result); + To_Any (Self.Section_To_Extract_SLOC, Result); + + -- "subprogram_kind" + Add_Key ("subprogram_kind", Result); + To_Any + (VSS.Strings.Conversions.To_Virtual_String + (Self.Subprogram_Kind'Image), + Result); + + Result.Append (JSON_Stream_Element'(Kind => End_Object)); + + return Result; end Write_Command; end LSP.Ada_Handlers.Refactor.Extract_Subprogram; diff --git a/source/ada/lsp-ada_handlers-refactor-extract_subprogram.ads b/source/ada/lsp-ada_handlers-refactor-extract_subprogram.ads index 6e24ac15e..6be24f469 100644 --- a/source/ada/lsp-ada_handlers-refactor-extract_subprogram.ads +++ b/source/ada/lsp-ada_handlers-refactor-extract_subprogram.ads @@ -1,7 +1,7 @@ ------------------------------------------------------------------------------ -- Language Server Protocol -- -- -- --- Copyright (C) 2022, AdaCore -- +-- Copyright (C) 2022-2023, AdaCore -- -- -- -- This is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -17,13 +17,10 @@ -- -- Implementation of the refactoring command to add parameters -with Ada.Streams; - with Libadalang.Common; +with LSP.Ada_Contexts; with LSP.Client_Message_Receivers; -with LSP.Messages; -with LSP.JSON_Streams; with VSS.Strings; @@ -36,26 +33,26 @@ package LSP.Ada_Handlers.Refactor.Extract_Subprogram is ("Extract Subprogram"); procedure Append_Code_Action - (Self : in out Command; - Context : Context_Access; - Commands_Vector : in out LSP.Messages.CodeAction_Vector; - Where : LSP.Messages.Location; - Subprogram_Kind : Libadalang.Common.Ada_Subp_Kind); + (Self : in out Command; + Context : LSP.Ada_Context_Sets.Context_Access; + Commands_Vector : in out LSP.Structures.Command_Or_CodeAction_Vector; + Where : LSP.Structures.Location; + Subprogram_Kind : Libadalang.Common.Ada_Subp_Kind); -- Initializes Self and appends it to Commands_Vector private type Command is new LSP.Ada_Handlers.Refactor.Command with record Context_Id : VSS.Strings.Virtual_String; - Section_To_Extract_SLOC : LSP.Messages.Location; + Section_To_Extract_SLOC : LSP.Structures.Location; Subprogram_Kind : Libadalang.Common.Ada_Subp_Kind; end record; overriding function Create - (JS : not null access LSP.JSON_Streams.JSON_Stream'Class) + (Any : not null access LSP.Structures.LSPAny_Vector) return Command; - -- Reads JS and creates a new Command + -- Reads Any and creates a new Command overriding procedure Refactor @@ -70,16 +67,13 @@ private procedure Initialize (Self : in out Command'Class; Context : LSP.Ada_Contexts.Context; - Where : LSP.Messages.Location; + Where : LSP.Structures.Location; Subprogram_Kind : Libadalang.Common.Ada_Subp_Kind); -- Initializes Self - procedure Write_Command - (S : access Ada.Streams.Root_Stream_Type'Class; - C : Command); - -- Writes C to S + function Write_Command + (Self : Command) return LSP.Structures.LSPAny_Vector; - for Command'Write use Write_Command; for Command'External_Tag use "als-refactor-extract-subprogram"; end LSP.Ada_Handlers.Refactor.Extract_Subprogram; diff --git a/source/ada/lsp-ada_handlers-refactor-imports_commands.adb b/source/ada/lsp-ada_handlers-refactor-imports_commands.adb index a81aedd3b..1eadb99bc 100644 --- a/source/ada/lsp-ada_handlers-refactor-imports_commands.adb +++ b/source/ada/lsp-ada_handlers-refactor-imports_commands.adb @@ -1,7 +1,7 @@ ------------------------------------------------------------------------------ -- Language Server Protocol -- -- -- --- Copyright (C) 2020-2022, AdaCore -- +-- Copyright (C) 2020-2023, AdaCore -- -- -- -- This is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -15,7 +15,6 @@ -- of the license. -- ------------------------------------------------------------------------------ -with Ada.Strings.UTF_Encoding; with Ada.Strings.Unbounded; with Ada.Strings.Wide_Wide_Unbounded; @@ -26,10 +25,10 @@ with Libadalang.Common; with Laltools.Common; -with LSP.Messages; +with VSS.JSON.Streams; -with VSS.Strings.Conversions; -with LSP.Commands; +with LSP.Enumerations; +with LSP.Structures.LSPAny_Vectors; use LSP.Structures.LSPAny_Vectors; package body LSP.Ada_Handlers.Refactor.Imports_Commands is @@ -40,14 +39,14 @@ package body LSP.Ada_Handlers.Refactor.Imports_Commands is procedure Initialize (Self : in out Command'Class; Context : LSP.Ada_Contexts.Context; - Where : LSP.Messages.TextDocumentPositionParams; + Where : LSP.Structures.TextDocumentPositionParams; With_Clause : VSS.Strings.Virtual_String; Prefix : VSS.Strings.Virtual_String) is begin - Self.Context := Context.Id; - Self.Where := Where; + Self.Context := Context.Id; + Self.Where := Where; Self.With_Clause := With_Clause; - Self.Prefix := Prefix; + Self.Prefix := Prefix; end Initialize; ------------ @@ -55,35 +54,47 @@ package body LSP.Ada_Handlers.Refactor.Imports_Commands is ------------ overriding function Create - (JS : not null access LSP.JSON_Streams.JSON_Stream'Class) + (Any : not null access LSP.Structures.LSPAny_Vector) return Command is + use VSS.JSON.Streams; + use VSS.Strings; + use LSP.Structures.JSON_Event_Vectors; + + C : Cursor := Any.First; begin - return V : Command do - pragma Assert (JS.R.Is_Start_Object); - JS.R.Read_Next; - while not JS.R.Is_End_Object loop - pragma Assert (JS.R.Is_Key_Name); + return Self : Command do + pragma Assert (Element (C).Kind = Start_Object); + Next (C); + + while Has_Element (C) + and then Element (C).Kind /= End_Object + loop + pragma Assert (Element (C).Kind = Key_Name); declare - Key : constant Ada.Strings.UTF_Encoding.UTF_8_String := - VSS.Strings.Conversions.To_UTF_8_String (JS.R.Key_Name); + Key : constant Virtual_String := Element (C).Key_Name; begin - JS.R.Read_Next; + Next (C); if Key = "context" then - LSP.Types.Read_String (JS, V.Context); + Self.Context := Element (C).String_Value; + elsif Key = "where" then - LSP.Messages.TextDocumentPositionParams'Read (JS, V.Where); + Self.Where := From_Any (C); + elsif Key = "with_clause" then - LSP.Types.Read_String (JS, V.With_Clause); + Self.With_Clause := Element (C).String_Value; + elsif Key = "prefix" then - LSP.Types.Read_String (JS, V.Prefix); + Self.Prefix := Element (C).String_Value; + else - JS.Skip_Value; + Skip_Value (C); end if; end; + + Next (C); end loop; - JS.R.Read_Next; end return; end Create; @@ -93,13 +104,12 @@ package body LSP.Ada_Handlers.Refactor.Imports_Commands is procedure Append_Suggestion (Self : in out Command; - Context : Context_Access; - Where : LSP.Messages.Location; - Commands_Vector : in out LSP.Messages.CodeAction_Vector; + Context : LSP.Ada_Context_Sets.Context_Access; + Where : LSP.Structures.Location; + Commands_Vector : in out LSP.Structures.Command_Or_CodeAction_Vector; Suggestion : LAL_Refactor.Refactor_Imports.Import_Suggestion) is - Pointer : LSP.Commands.Command_Pointer; - Item : LSP.Messages.CodeAction; + Item : LSP.Structures.CodeAction; function Create_Suggestion_Title (Suggestion : LAL_Refactor.Refactor_Imports.Import_Suggestion) @@ -111,16 +121,14 @@ package body LSP.Ada_Handlers.Refactor.Imports_Commands is ------------------------------ -- Create_Suggestions_Title -- ------------------------------ + function Create_Suggestion_Title (Suggestion : LAL_Refactor.Refactor_Imports.Import_Suggestion) return VSS.Strings.Virtual_String is - Title : Ada.Strings.Wide_Wide_Unbounded. - Unbounded_Wide_Wide_String - := Ada.Strings.Wide_Wide_Unbounded. - Null_Unbounded_Wide_Wide_String; - use type Ada.Strings.Wide_Wide_Unbounded. - Unbounded_Wide_Wide_String; + Title : Ada.Strings.Wide_Wide_Unbounded.Unbounded_Wide_Wide_String := + Ada.Strings.Wide_Wide_Unbounded.Null_Unbounded_Wide_Wide_String; + use type Ada.Strings.Wide_Wide_Unbounded.Unbounded_Wide_Wide_String; begin if Suggestion.With_Clause_Text /= "" then @@ -154,28 +162,33 @@ package body LSP.Ada_Handlers.Refactor.Imports_Commands is Self.Initialize (Context => Context.all, Where => ((uri => Where.uri), - Where.span.first), + Where.a_range.start), With_Clause => VSS.Strings.Conversions.To_Virtual_String (Suggestion.With_Clause_Text), Prefix => VSS.Strings.Conversions.To_Virtual_String (Suggestion.Prefix_Text)); - Pointer.Set (Self); + Item := (title => Create_Suggestion_Title (Suggestion), kind => (Is_Set => True, - Value => LSP.Messages.RefactorRewrite), - diagnostics => (Is_Set => False), + Value => LSP.Enumerations.RefactorRewrite), + diagnostics => <>, disabled => (Is_Set => False), edit => (Is_Set => False), isPreferred => (Is_Set => False), command => (Is_Set => True, Value => - (Is_Unknown => False, - title => <>, - Custom => Pointer))); - Commands_Vector.Append (Item); + (title => <>, + command => VSS.Strings.Conversions. + To_Virtual_String (Command'External_Tag), + arguments => Self.Write_Command)), + data => <>); + + Commands_Vector.Append + (LSP.Structures.Command_Or_CodeAction' + (Is_Command => False, CodeAction => Item)); end Append_Suggestion; ---------------------------------- @@ -333,23 +346,34 @@ package body LSP.Ada_Handlers.Refactor.Imports_Commands is -- Write_Command -- ------------------- - procedure Write_Command - (S : access Ada.Streams.Root_Stream_Type'Class; - V : Command) + function Write_Command + (Self : Command) return LSP.Structures.LSPAny_Vector is - JS : LSP.JSON_Streams.JSON_Stream'Class renames - LSP.JSON_Streams.JSON_Stream'Class (S.all); + use VSS.JSON.Streams; + + Result : LSP.Structures.LSPAny_Vector; begin - JS.Start_Object; - JS.Key ("context"); - LSP.Types.Write_String (S, V.Context); - JS.Key ("where"); - LSP.Messages.TextDocumentPositionParams'Write (S, V.Where); - JS.Key ("with_clause"); - LSP.Types.Write_String (S, V.With_Clause); - JS.Key ("prefix"); - LSP.Types.Write_String (S, V.Prefix); - JS.End_Object; + Result.Append (JSON_Stream_Element'(Kind => Start_Object)); + + -- "context" + Add_Key ("context", Result); + To_Any (Self.Context, Result); + + -- "where" + Add_Key ("where", Result); + To_Any (Self.Where, Result); + + -- "with_clause" + Add_Key ("with_clause", Result); + To_Any (Self.With_Clause, Result); + + -- "prefix" + Add_Key ("prefix", Result); + To_Any (Self.Prefix, Result); + + Result.Append (JSON_Stream_Element'(Kind => End_Object)); + + return Result; end Write_Command; end LSP.Ada_Handlers.Refactor.Imports_Commands; diff --git a/source/ada/lsp-ada_handlers-refactor-imports_commands.ads b/source/ada/lsp-ada_handlers-refactor-imports_commands.ads index c9b2c61de..b0abe9a36 100644 --- a/source/ada/lsp-ada_handlers-refactor-imports_commands.ads +++ b/source/ada/lsp-ada_handlers-refactor-imports_commands.ads @@ -1,7 +1,7 @@ ------------------------------------------------------------------------------ -- Language Server Protocol -- -- -- --- Copyright (C) 2020-2020, AdaCore -- +-- Copyright (C) 2020-2023, AdaCore -- -- -- -- This is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -17,15 +17,11 @@ -- -- Implementation of the command to refactor imports. -with Ada.Streams; - -with VSS.Strings; - with LAL_Refactor; with LAL_Refactor.Refactor_Imports; +with LSP.Ada_Contexts; with LSP.Client_Message_Receivers; -with LSP.JSON_Streams; package LSP.Ada_Handlers.Refactor.Imports_Commands is @@ -38,16 +34,16 @@ package LSP.Ada_Handlers.Refactor.Imports_Commands is procedure Initialize (Self : in out Command'Class; Context : LSP.Ada_Contexts.Context; - Where : LSP.Messages.TextDocumentPositionParams; + Where : LSP.Structures.TextDocumentPositionParams; With_Clause : VSS.Strings.Virtual_String; Prefix : VSS.Strings.Virtual_String); -- Initializes Command procedure Append_Suggestion (Self : in out Command; - Context : Context_Access; - Where : LSP.Messages.Location; - Commands_Vector : in out LSP.Messages.CodeAction_Vector; + Context : LSP.Ada_Context_Sets.Context_Access; + Where : LSP.Structures.Location; + Commands_Vector : in out LSP.Structures.Command_Or_CodeAction_Vector; Suggestion : LAL_Refactor.Refactor_Imports.Import_Suggestion); -- Initializes Command based on Suggestion and appends it to -- Commands_Vector. @@ -56,13 +52,13 @@ private type Command is new LSP.Ada_Handlers.Refactor.Command with record Context : VSS.Strings.Virtual_String; - Where : LSP.Messages.TextDocumentPositionParams; + Where : LSP.Structures.TextDocumentPositionParams; With_Clause : VSS.Strings.Virtual_String; Prefix : VSS.Strings.Virtual_String; end record; overriding function Create - (JS : not null access LSP.JSON_Streams.JSON_Stream'Class) + (Any : not null access LSP.Structures.LSPAny_Vector) return Command; overriding procedure Refactor @@ -73,10 +69,8 @@ private LSP.Client_Message_Receivers.Client_Message_Receiver'Class; Edits : out LAL_Refactor.Refactoring_Edits); - procedure Write_Command - (S : access Ada.Streams.Root_Stream_Type'Class; - V : Command); - -- Write the command in a JSON Stream + function Write_Command + (Self : Command) return LSP.Structures.LSPAny_Vector; function Command_To_Refactoring_Edits (Self : Command; @@ -86,7 +80,6 @@ private -- Converts Self into LAL_Refactor.Refactoring_Edits that can be -- converted in a WorkspaceEdit. - for Command'Write use Write_Command; for Command'External_Tag use "als-refactor-imports"; end LSP.Ada_Handlers.Refactor.Imports_Commands; diff --git a/source/ada/lsp-ada_handlers-refactor-introduce_parameter.adb b/source/ada/lsp-ada_handlers-refactor-introduce_parameter.adb index 95fbcf072..c64bcd103 100644 --- a/source/ada/lsp-ada_handlers-refactor-introduce_parameter.adb +++ b/source/ada/lsp-ada_handlers-refactor-introduce_parameter.adb @@ -1,7 +1,7 @@ ------------------------------------------------------------------------------ -- Language Server Protocol -- -- -- --- Copyright (C) 2022, AdaCore -- +-- Copyright (C) 2022-2023, AdaCore -- -- -- -- This is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -15,8 +15,6 @@ -- of the license. -- ------------------------------------------------------------------------------ -with Ada.Strings.UTF_Encoding; - with Langkit_Support.Slocs; with Libadalang.Analysis; use Libadalang.Analysis; @@ -24,10 +22,10 @@ with Libadalang.Analysis; use Libadalang.Analysis; with LAL_Refactor.Introduce_Parameter; use LAL_Refactor.Introduce_Parameter; -with LSP.Types; +with VSS.JSON.Streams; -with VSS.Strings.Conversions; -with LSP.Commands; +with LSP.Enumerations; +with LSP.Structures.LSPAny_Vectors; use LSP.Structures.LSPAny_Vectors; package body LSP.Ada_Handlers.Refactor.Introduce_Parameter is @@ -37,33 +35,35 @@ package body LSP.Ada_Handlers.Refactor.Introduce_Parameter is procedure Append_Code_Action (Self : in out Command; - Context : Context_Access; - Commands_Vector : in out LSP.Messages.CodeAction_Vector; - Where : LSP.Messages.Location) + Context : LSP.Ada_Context_Sets.Context_Access; + Commands_Vector : in out LSP.Structures.Command_Or_CodeAction_Vector; + Where : LSP.Structures.Location) is - use LSP.Commands; - use LSP.Messages; - - Pointer : Command_Pointer; - Code_Action : CodeAction; + Code_Action : LSP.Structures.CodeAction; begin Self.Initialize (Context => Context.all, Where => Where); - Pointer.Set (Data => Self); - Code_Action := (title => "Introduce Parameter", - kind => (Is_Set => True, Value => RefactorRewrite), - diagnostics => (Is_Set => False), + kind => (Is_Set => True, + Value => LSP.Enumerations.RefactorRewrite), + diagnostics => <>, edit => (Is_Set => False), isPreferred => (Is_Set => False), disabled => (Is_Set => False), command => (Is_Set => True, - Value => (Is_Unknown => False, title => <>, Custom => Pointer))); - - Commands_Vector.Append (New_Item => Code_Action); + Value => + (title => <>, + command => VSS.Strings.Conversions.To_Virtual_String + (Command'External_Tag), + arguments => Self.Write_Command)), + data => <>); + + Commands_Vector.Append + (LSP.Structures.Command_Or_CodeAction' + (Is_Command => False, CodeAction => Code_Action)); end Append_Code_Action; ------------ @@ -71,42 +71,41 @@ package body LSP.Ada_Handlers.Refactor.Introduce_Parameter is ------------ overriding function Create - (JS : not null access LSP.JSON_Streams.JSON_Stream'Class) + (Any : not null access LSP.Structures.LSPAny_Vector) return Command is - use Ada.Strings.UTF_Encoding; - use VSS.Strings.Conversions; - use LSP.Messages; - use LSP.Types; + use VSS.JSON.Streams; + use VSS.Strings; + use LSP.Structures.JSON_Event_Vectors; + C : Cursor := Any.First; begin - return V : Command do - pragma Assert (JS.R.Is_Start_Object); - - JS.R.Read_Next; - - while not JS.R.Is_End_Object loop - pragma Assert (JS.R.Is_Key_Name); - + return Self : Command do + pragma Assert (Element (C).Kind = Start_Object); + Next (C); + + while Has_Element (C) + and then Element (C).Kind /= End_Object + loop + pragma Assert (Element (C).Kind = Key_Name); declare - Key : constant UTF_8_String := To_UTF_8_String (JS.R.Key_Name); - + Key : constant Virtual_String := Element (C).Key_Name; begin - JS.R.Read_Next; + Next (C); if Key = "context_id" then - Read_String (JS, V.Context_Id); + Self.Context_Id := Element (C).String_Value; elsif Key = "where" then - Location'Read (JS, V.Where); + Self.Where := From_Any (C); else - JS.Skip_Value; + Skip_Value (C); end if; end; - end loop; - JS.R.Read_Next; + Next (C); + end loop; end return; end Create; @@ -124,7 +123,6 @@ package body LSP.Ada_Handlers.Refactor.Introduce_Parameter is is use Langkit_Support.Slocs; use LAL_Refactor; - use LSP.Types; Message_Handler : LSP.Ada_Handlers.Message_Handler renames LSP.Ada_Handlers.Message_Handler (Handler.all); @@ -137,11 +135,11 @@ package body LSP.Ada_Handlers.Refactor.Introduce_Parameter is Context.Get_AU (Context.URI_To_File (Self.Where.uri)), SLOC_Range => (Langkit_Support.Slocs.Line_Number - (Self.Where.span.first.line) + 1, + (Self.Where.a_range.start.line) + 1, Langkit_Support.Slocs.Line_Number - (Self.Where.span.last.line) + 1, - Column_Number (Self.Where.span.first.character) + 1, - Column_Number (Self.Where.span.last.character) + 1)); + (Self.Where.a_range.an_end.line) + 1, + Column_Number (Self.Where.a_range.start.character) + 1, + Column_Number (Self.Where.a_range.an_end.character) + 1)); function Analysis_Units return Analysis_Unit_Array is (Context.Analysis_Units); @@ -158,31 +156,36 @@ package body LSP.Ada_Handlers.Refactor.Introduce_Parameter is procedure Initialize (Self : in out Command'Class; Context : LSP.Ada_Contexts.Context; - Where : LSP.Messages.Location) is + Where : LSP.Structures.Location) is begin Self.Context_Id := Context.Id; - Self.Where := Where; + Self.Where := Where; end Initialize; ------------------- -- Write_Command -- ------------------- - procedure Write_Command - (S : access Ada.Streams.Root_Stream_Type'Class; - C : Command) + function Write_Command + (Self : Command) return LSP.Structures.LSPAny_Vector is - use LSP.JSON_Streams; - - JS : JSON_Stream'Class renames JSON_Stream'Class (S.all); + use VSS.JSON.Streams; + Result : LSP.Structures.LSPAny_Vector; begin - JS.Start_Object; - JS.Key ("context_id"); - LSP.Types.Write_String (S, C.Context_Id); - JS.Key ("where"); - LSP.Messages.Location'Write (S, C.Where); - JS.End_Object; + Result.Append (JSON_Stream_Element'(Kind => Start_Object)); + + -- "context_id" + Add_Key ("context_id", Result); + To_Any (Self.Context_Id, Result); + + -- "where" + Add_Key ("where", Result); + To_Any (Self.Where, Result); + + Result.Append (JSON_Stream_Element'(Kind => End_Object)); + + return Result; end Write_Command; end LSP.Ada_Handlers.Refactor.Introduce_Parameter; diff --git a/source/ada/lsp-ada_handlers-refactor-introduce_parameter.ads b/source/ada/lsp-ada_handlers-refactor-introduce_parameter.ads index 4dc9c628b..d66c471cd 100644 --- a/source/ada/lsp-ada_handlers-refactor-introduce_parameter.ads +++ b/source/ada/lsp-ada_handlers-refactor-introduce_parameter.ads @@ -1,7 +1,7 @@ ------------------------------------------------------------------------------ -- Language Server Protocol -- -- -- --- Copyright (C) 2022, AdaCore -- +-- Copyright (C) 2022-2023, AdaCore -- -- -- -- This is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -17,11 +17,8 @@ -- -- Implementation of the refactoring tool to introduce a parameter -with Ada.Streams; - +with LSP.Ada_Contexts; with LSP.Client_Message_Receivers; -with LSP.Messages; -with LSP.JSON_Streams; with VSS.Strings; @@ -35,21 +32,21 @@ package LSP.Ada_Handlers.Refactor.Introduce_Parameter is procedure Append_Code_Action (Self : in out Command; - Context : Context_Access; - Commands_Vector : in out LSP.Messages.CodeAction_Vector; - Where : LSP.Messages.Location); + Context : LSP.Ada_Context_Sets.Context_Access; + Commands_Vector : in out LSP.Structures.Command_Or_CodeAction_Vector; + Where : LSP.Structures.Location); -- Initializes Self and appends it to Commands_Vector private type Command is new LSP.Ada_Handlers.Refactor.Command with record Context_Id : VSS.Strings.Virtual_String; - Where : LSP.Messages.Location; + Where : LSP.Structures.Location; end record; overriding function Create - (JS : not null access LSP.JSON_Streams.JSON_Stream'Class) + (Any : not null access LSP.Structures.LSPAny_Vector) return Command; -- Reads JS and creates a new Command @@ -66,15 +63,12 @@ private procedure Initialize (Self : in out Command'Class; Context : LSP.Ada_Contexts.Context; - Where : LSP.Messages.Location); + Where : LSP.Structures.Location); -- Initializes Self - procedure Write_Command - (S : access Ada.Streams.Root_Stream_Type'Class; - C : Command); - -- Writes C to S + function Write_Command + (Self : Command) return LSP.Structures.LSPAny_Vector; - for Command'Write use Write_Command; for Command'External_Tag use "als-refactor-introduce-parameter"; end LSP.Ada_Handlers.Refactor.Introduce_Parameter; diff --git a/source/ada/lsp-ada_handlers-refactor-move_parameter.adb b/source/ada/lsp-ada_handlers-refactor-move_parameter.adb index 16c6b2e5d..1e3454c0b 100644 --- a/source/ada/lsp-ada_handlers-refactor-move_parameter.adb +++ b/source/ada/lsp-ada_handlers-refactor-move_parameter.adb @@ -1,7 +1,7 @@ ------------------------------------------------------------------------------ -- Language Server Protocol -- -- -- --- Copyright (C) 2021-2022, AdaCore -- +-- Copyright (C) 2021-2023, AdaCore -- -- -- -- This is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -15,17 +15,17 @@ -- of the license. -- ------------------------------------------------------------------------------ -with Ada.Strings.UTF_Encoding; - with Libadalang.Analysis; use Libadalang.Analysis; with Laltools.Common; use Laltools.Common; -with LSP.Messages; -with LSP.Lal_Utils; - +with VSS.JSON.Streams; with VSS.Strings.Conversions; -with LSP.Commands; + +with LSP.Ada_Contexts; +with LSP.Enumerations; +with LSP.Utils; +with LSP.Structures.LSPAny_Vectors; use LSP.Structures.LSPAny_Vectors; package body LSP.Ada_Handlers.Refactor.Move_Parameter is @@ -37,16 +37,15 @@ package body LSP.Ada_Handlers.Refactor.Move_Parameter is procedure Append_Code_Action (Self : in out Command; - Context : Context_Access; - Commands_Vector : in out LSP.Messages.CodeAction_Vector; + Context : LSP.Ada_Context_Sets.Context_Access; + Commands_Vector : in out LSP.Structures.Command_Or_CodeAction_Vector; Target_Subp : Libadalang.Analysis.Basic_Decl; Parameter_Index : Positive; Move_Direction : Move_Direction_Type) is - Pointer : LSP.Commands.Command_Pointer; - Code_Action : LSP.Messages.CodeAction; - Where : constant LSP.Messages.Location := - LSP.Lal_Utils.Get_Node_Location (Target_Subp.P_Defining_Name.F_Name); + Code_Action : LSP.Structures.CodeAction; + Where : constant LSP.Structures.Location := + LSP.Utils.Get_Node_Location (Target_Subp.P_Defining_Name.F_Name); function Image (D : Move_Direction_Type) return VSS.Strings.Virtual_String; @@ -90,32 +89,34 @@ package body LSP.Ada_Handlers.Refactor.Move_Parameter is begin Self.Initialize - (Context => Context.all, + (Context => Context, Where => ((uri => Where.uri), - Where.span.first), - Parameter_Index => LSP.Types.LSP_Number (Parameter_Index), + Where.a_range.start), + Parameter_Index => Parameter_Index, Direction => Image (Move_Direction)); - Pointer.Set (Self); - Code_Action := (title => Create_Code_Action_Title, kind => (Is_Set => True, - Value => LSP.Messages.RefactorRewrite), - diagnostics => (Is_Set => False), + Value => LSP.Enumerations.RefactorRewrite), + diagnostics => <>, edit => (Is_Set => False), isPreferred => (Is_Set => False), disabled => (Is_Set => False), command => (Is_Set => True, Value => - (Is_Unknown => False, - title => <>, - Custom => Pointer))); - - Commands_Vector.Append (Code_Action); + (title => <>, + command => VSS.Strings.Conversions.To_Virtual_String + (Command'External_Tag), + arguments => Self.Write_Command)), + data => <>); + + Commands_Vector.Append + (LSP.Structures.Command_Or_CodeAction' + (Is_Command => False, CodeAction => Code_Action)); end Append_Code_Action; ---------------- @@ -123,11 +124,11 @@ package body LSP.Ada_Handlers.Refactor.Move_Parameter is ---------------- procedure Initialize - (Self : in out Command'Class; - Context : LSP.Ada_Contexts.Context; - Where : LSP.Messages.TextDocumentPositionParams; - Parameter_Index : LSP.Types.LSP_Number; - Direction : VSS.Strings.Virtual_String) is + (Self : in out Command'Class; + Context : LSP.Ada_Context_Sets.Context_Access; + Where : LSP.Structures.TextDocumentPositionParams; + Parameter_Index : Integer; + Direction : VSS.Strings.Virtual_String) is begin Self.Context := Context.Id; Self.Where := Where; @@ -140,43 +141,47 @@ package body LSP.Ada_Handlers.Refactor.Move_Parameter is ------------ overriding function Create - (JS : not null access LSP.JSON_Streams.JSON_Stream'Class) - return Command is - begin - return V : Command do - pragma Assert (JS.R.Is_Start_Object); - - JS.R.Read_Next; - - while not JS.R.Is_End_Object loop - pragma Assert (JS.R.Is_Key_Name); + (Any : not null access LSP.Structures.LSPAny_Vector) + return Command + is + use VSS.JSON.Streams; + use VSS.Strings; + use LSP.Structures.JSON_Event_Vectors; + C : Cursor := Any.First; + begin + return Self : Command do + pragma Assert (Element (C).Kind = Start_Object); + Next (C); + + while Has_Element (C) + and then Element (C).Kind /= End_Object + loop + pragma Assert (Element (C).Kind = Key_Name); declare - Key : constant Ada.Strings.UTF_Encoding.UTF_8_String := - VSS.Strings.Conversions.To_UTF_8_String (JS.R.Key_Name); - + Key : constant Virtual_String := Element (C).Key_Name; begin - JS.R.Read_Next; + Next (C); if Key = "context" then - LSP.Types.Read_String (JS, V.Context); + Self.Context := Element (C).String_Value; elsif Key = "where" then - LSP.Messages.TextDocumentPositionParams'Read (JS, V.Where); + Self.Where := From_Any (C); elsif Key = "parameter_index" then - LSP.Types.Read (JS, V.Parameter_Index); + Self.Parameter_Index := From_Any (C); elsif Key = "direction" then - LSP.Types.Read_String (JS, V.Direction); + Self.Direction := Element (C).String_Value; else - JS.Skip_Value; + Skip_Value (C); end if; end; - end loop; - JS.R.Read_Next; + Next (C); + end loop; end return; end Create; @@ -193,7 +198,6 @@ package body LSP.Ada_Handlers.Refactor.Move_Parameter is Edits : out LAL_Refactor.Refactoring_Edits) is use LAL_Refactor; - use LSP.Types; Message_Handler : LSP.Ada_Handlers.Message_Handler renames LSP.Ada_Handlers.Message_Handler (Handler.all); @@ -249,23 +253,34 @@ package body LSP.Ada_Handlers.Refactor.Move_Parameter is -- Write_Command -- ------------------- - procedure Write_Command - (S : access Ada.Streams.Root_Stream_Type'Class; - C : Command) + function Write_Command + (Self : Command) return LSP.Structures.LSPAny_Vector is - JS : LSP.JSON_Streams.JSON_Stream'Class renames - LSP.JSON_Streams.JSON_Stream'Class (S.all); + use VSS.JSON.Streams; + + Result : LSP.Structures.LSPAny_Vector; begin - JS.Start_Object; - JS.Key ("context"); - LSP.Types.Write_String (S, C.Context); - JS.Key ("where"); - LSP.Messages.TextDocumentPositionParams'Write (S, C.Where); - JS.Key ("parameter_index"); - LSP.Types.Write (S, C.Parameter_Index); - JS.Key ("direction"); - LSP.Types.Write_String (S, C.Direction); - JS.End_Object; + Result.Append (JSON_Stream_Element'(Kind => Start_Object)); + + -- "context" + Add_Key ("context", Result); + To_Any (Self.Context, Result); + + -- "where" + Add_Key ("where", Result); + To_Any (Self.Where, Result); + + -- "parameter_index" + Add_Key ("parameter_index", Result); + To_Any (Self.Parameter_Index, Result); + + -- "direction" + Add_Key ("direction", Result); + To_Any (Self.Direction, Result); + + Result.Append (JSON_Stream_Element'(Kind => End_Object)); + + return Result; end Write_Command; end LSP.Ada_Handlers.Refactor.Move_Parameter; diff --git a/source/ada/lsp-ada_handlers-refactor-move_parameter.ads b/source/ada/lsp-ada_handlers-refactor-move_parameter.ads index f0a4f62c6..e6eb709e6 100644 --- a/source/ada/lsp-ada_handlers-refactor-move_parameter.ads +++ b/source/ada/lsp-ada_handlers-refactor-move_parameter.ads @@ -1,7 +1,7 @@ ------------------------------------------------------------------------------ -- Language Server Protocol -- -- -- --- Copyright (C) 2021, AdaCore -- +-- Copyright (C) 2021-2023, AdaCore -- -- -- -- This is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -18,12 +18,9 @@ -- Implementation of the refactoring command to move parameters to the left -- and right -with Ada.Streams; - private with VSS.Strings; with LSP.Client_Message_Receivers; -with LSP.JSON_Streams; with LAL_Refactor.Subprogram_Signature; use LAL_Refactor.Subprogram_Signature; @@ -40,8 +37,8 @@ package LSP.Ada_Handlers.Refactor.Move_Parameter is procedure Append_Code_Action (Self : in out Command; - Context : Context_Access; - Commands_Vector : in out LSP.Messages.CodeAction_Vector; + Context : LSP.Ada_Context_Sets.Context_Access; + Commands_Vector : in out LSP.Structures.Command_Or_CodeAction_Vector; Target_Subp : Libadalang.Analysis.Basic_Decl; Parameter_Index : Positive; Move_Direction : Move_Direction_Type); @@ -51,13 +48,13 @@ private type Command is new LSP.Ada_Handlers.Refactor.Command with record Context : VSS.Strings.Virtual_String; - Where : LSP.Messages.TextDocumentPositionParams; - Parameter_Index : LSP.Types.LSP_Number; + Where : LSP.Structures.TextDocumentPositionParams; + Parameter_Index : Integer; Direction : VSS.Strings.Virtual_String; end record; overriding function Create - (JS : not null access LSP.JSON_Streams.JSON_Stream'Class) + (Any : not null access LSP.Structures.LSPAny_Vector) return Command; -- Reads JS and creates a new Command @@ -72,18 +69,15 @@ private procedure Initialize (Self : in out Command'Class; - Context : LSP.Ada_Contexts.Context; - Where : LSP.Messages.TextDocumentPositionParams; - Parameter_Index : LSP.Types.LSP_Number; + Context : LSP.Ada_Context_Sets.Context_Access; + Where : LSP.Structures.TextDocumentPositionParams; + Parameter_Index : Integer; Direction : VSS.Strings.Virtual_String); -- Initializes Self - procedure Write_Command - (S : access Ada.Streams.Root_Stream_Type'Class; - C : Command); - -- Writes C to S + function Write_Command + (Self : Command) return LSP.Structures.LSPAny_Vector; - for Command'Write use Write_Command; for Command'External_Tag use "als-refactor-move-parameter"; end LSP.Ada_Handlers.Refactor.Move_Parameter; diff --git a/source/ada/lsp-ada_handlers-refactor-pull_up_declaration.adb b/source/ada/lsp-ada_handlers-refactor-pull_up_declaration.adb index 2b6078cf4..fa473627c 100644 --- a/source/ada/lsp-ada_handlers-refactor-pull_up_declaration.adb +++ b/source/ada/lsp-ada_handlers-refactor-pull_up_declaration.adb @@ -1,7 +1,7 @@ ------------------------------------------------------------------------------ -- Language Server Protocol -- -- -- --- Copyright (C) 2022, AdaCore -- +-- Copyright (C) 2022-2023, AdaCore -- -- -- -- This is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -15,18 +15,16 @@ -- of the license. -- ------------------------------------------------------------------------------ -with Ada.Strings.UTF_Encoding; - with Langkit_Support.Slocs; with Libadalang.Analysis; with LAL_Refactor.Pull_Up_Declaration; -with LSP.Messages; +with VSS.JSON.Streams; -with VSS.Strings.Conversions; -with LSP.Commands; +with LSP.Enumerations; +with LSP.Structures.LSPAny_Vectors; use LSP.Structures.LSPAny_Vectors; package body LSP.Ada_Handlers.Refactor.Pull_Up_Declaration is @@ -36,81 +34,80 @@ package body LSP.Ada_Handlers.Refactor.Pull_Up_Declaration is procedure Append_Code_Action (Self : in out Command; - Context : Context_Access; - Commands_Vector : in out LSP.Messages.CodeAction_Vector; - Where : LSP.Messages.Location) + Context : LSP.Ada_Context_Sets.Context_Access; + Commands_Vector : in out LSP.Structures.Command_Or_CodeAction_Vector; + Where : LSP.Structures.Location) is - Pointer : LSP.Commands.Command_Pointer; - Code_Action : LSP.Messages.CodeAction; + Code_Action : LSP.Structures.CodeAction; begin Self.Initialize - (Context => Context.all, - Where => Where); - - Pointer.Set (Self); + (Context => Context.all, + Where => Where); Code_Action := (title => "Pull Up Declaration", kind => (Is_Set => True, - Value => LSP.Messages.RefactorExtract), - diagnostics => (Is_Set => False), + Value => LSP.Enumerations.RefactorExtract), + diagnostics => <>, edit => (Is_Set => False), isPreferred => (Is_Set => False), disabled => (Is_Set => False), command => (Is_Set => True, Value => - (Is_Unknown => False, - title => <>, - Custom => Pointer))); - - Commands_Vector.Append (Code_Action); + (title => <>, + command => VSS.Strings.Conversions.To_Virtual_String + (Command'External_Tag), + arguments => Self.Write_Command)), + data => <>); + + Commands_Vector.Append + (LSP.Structures.Command_Or_CodeAction' + (Is_Command => False, CodeAction => Code_Action)); end Append_Code_Action; ------------ -- Create -- ------------ - overriding - function Create - (JS : not null access LSP.JSON_Streams.JSON_Stream'Class) + overriding function Create + (Any : not null access LSP.Structures.LSPAny_Vector) return Command is - use Ada.Strings.UTF_Encoding; - use LSP.Messages; - use LSP.Types; - use VSS.Strings.Conversions; + use VSS.JSON.Streams; + use VSS.Strings; + use LSP.Structures.JSON_Event_Vectors; + C : Cursor := Any.First; begin - return C : Command do - pragma Assert (JS.R.Is_Start_Object); - - JS.R.Read_Next; - - while not JS.R.Is_End_Object loop - pragma Assert (JS.R.Is_Key_Name); - + return Self : Command do + pragma Assert (Element (C).Kind = Start_Object); + Next (C); + + while Has_Element (C) + and then Element (C).Kind /= End_Object + loop + pragma Assert (Element (C).Kind = Key_Name); declare - Key : constant UTF_8_String := To_UTF_8_String (JS.R.Key_Name); - + Key : constant Virtual_String := Element (C).Key_Name; begin - JS.R.Read_Next; + Next (C); if Key = "context" then - Read_String (JS, C.Context); + Self.Context := Element (C).String_Value; elsif Key = "where" then - Location'Read (JS, C.Where); + Self.Where := From_Any (C); else - JS.Skip_Value; + Skip_Value (C); end if; end; - end loop; - JS.R.Read_Next; + Next (C); + end loop; end return; end Create; @@ -131,7 +128,6 @@ package body LSP.Ada_Handlers.Refactor.Pull_Up_Declaration is use Libadalang.Analysis; use LAL_Refactor; use LAL_Refactor.Pull_Up_Declaration; - use LSP.Types; Message_Handler : LSP.Ada_Handlers.Message_Handler renames LSP.Ada_Handlers.Message_Handler (Handler.all); @@ -140,11 +136,13 @@ package body LSP.Ada_Handlers.Refactor.Pull_Up_Declaration is Unit : constant Analysis_Unit := Context.LAL_Context.Get_From_File - (Context.URI_To_File (Self.Where.uri)); + (VSS.Strings.Conversions.To_UTF_8_String (Self.Where.uri)); Declaration_SLOC : constant Source_Location := - (Langkit_Support.Slocs.Line_Number (Self.Where.span.first.line) + 1, - Langkit_Support.Slocs.Column_Number (Self.Where.span.first.character) + (Langkit_Support.Slocs.Line_Number + (Self.Where.a_range.start.line) + 1, + Langkit_Support.Slocs.Column_Number + (Self.Where.a_range.start.character) + 1); function Analysis_Units return Analysis_Unit_Array is @@ -165,7 +163,7 @@ package body LSP.Ada_Handlers.Refactor.Pull_Up_Declaration is procedure Initialize (Self : in out Command'Class; Context : LSP.Ada_Contexts.Context; - Where : LSP.Messages.Location) is + Where : LSP.Structures.Location) is begin Self.Context := Context.Id; Self.Where := Where; @@ -175,23 +173,26 @@ package body LSP.Ada_Handlers.Refactor.Pull_Up_Declaration is -- Write_Command -- ------------------- - procedure Write_Command - (S : access Ada.Streams.Root_Stream_Type'Class; - C : Command) + function Write_Command + (Self : Command) return LSP.Structures.LSPAny_Vector is - use LSP.Messages; - use LSP.Types; - - JS : LSP.JSON_Streams.JSON_Stream'Class renames - LSP.JSON_Streams.JSON_Stream'Class (S.all); + use VSS.JSON.Streams; + Result : LSP.Structures.LSPAny_Vector; begin - JS.Start_Object; - JS.Key ("context"); - Write_String (S, C.Context); - JS.Key ("where"); - Location'Write (S, C.Where); - JS.End_Object; + Result.Append (JSON_Stream_Element'(Kind => Start_Object)); + + -- "context" + Add_Key ("context", Result); + To_Any (Self.Context, Result); + + -- "where" + Add_Key ("where", Result); + To_Any (Self.Where, Result); + + Result.Append (JSON_Stream_Element'(Kind => End_Object)); + + return Result; end Write_Command; end LSP.Ada_Handlers.Refactor.Pull_Up_Declaration; diff --git a/source/ada/lsp-ada_handlers-refactor-pull_up_declaration.ads b/source/ada/lsp-ada_handlers-refactor-pull_up_declaration.ads index 722897494..1676b1a63 100644 --- a/source/ada/lsp-ada_handlers-refactor-pull_up_declaration.ads +++ b/source/ada/lsp-ada_handlers-refactor-pull_up_declaration.ads @@ -1,7 +1,7 @@ ------------------------------------------------------------------------------ -- Language Server Protocol -- -- -- --- Copyright (C) 2022, AdaCore -- +-- Copyright (C) 2022-2023, AdaCore -- -- -- -- This is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -17,10 +17,8 @@ -- -- Implementation of the refactoring command to extract a declaration -with Ada.Streams; - +with LSP.Ada_Contexts; with LSP.Client_Message_Receivers; -with LSP.JSON_Streams; private with VSS.Strings; @@ -34,21 +32,21 @@ package LSP.Ada_Handlers.Refactor.Pull_Up_Declaration is procedure Append_Code_Action (Self : in out Command; - Context : Context_Access; - Commands_Vector : in out LSP.Messages.CodeAction_Vector; - Where : LSP.Messages.Location); + Context : LSP.Ada_Context_Sets.Context_Access; + Commands_Vector : in out LSP.Structures.Command_Or_CodeAction_Vector; + Where : LSP.Structures.Location); -- Initializes Self and appends it to Commands_Vector private type Command is new LSP.Ada_Handlers.Refactor.Command with record Context : VSS.Strings.Virtual_String; - Where : LSP.Messages.Location; + Where : LSP.Structures.Location; end record; overriding function Create - (JS : not null access LSP.JSON_Streams.JSON_Stream'Class) + (Any : not null access LSP.Structures.LSPAny_Vector) return Command; -- Reads JS and creates a new Command @@ -65,15 +63,12 @@ private procedure Initialize (Self : in out Command'Class; Context : LSP.Ada_Contexts.Context; - Where : LSP.Messages.Location); + Where : LSP.Structures.Location); -- Initializes Self - procedure Write_Command - (S : access Ada.Streams.Root_Stream_Type'Class; - C : Command); - -- Writes C to S + function Write_Command + (Self : Command) return LSP.Structures.LSPAny_Vector; - for Command'Write use Write_Command; for Command'External_Tag use "als-refactor-pull_up_declaration"; end LSP.Ada_Handlers.Refactor.Pull_Up_Declaration; diff --git a/source/ada/lsp-ada_handlers-refactor-remove_parameter.adb b/source/ada/lsp-ada_handlers-refactor-remove_parameter.adb index f5a8f0806..b028ff8ea 100644 --- a/source/ada/lsp-ada_handlers-refactor-remove_parameter.adb +++ b/source/ada/lsp-ada_handlers-refactor-remove_parameter.adb @@ -1,7 +1,7 @@ ------------------------------------------------------------------------------ -- Language Server Protocol -- -- -- --- Copyright (C) 2021-2022, AdaCore -- +-- Copyright (C) 2021-2023, AdaCore -- -- -- -- This is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -15,19 +15,19 @@ -- of the license. -- ------------------------------------------------------------------------------ -with Ada.Strings.UTF_Encoding; - with Libadalang.Analysis; use Libadalang.Analysis; with Laltools.Common; use Laltools.Common; with LAL_Refactor.Subprogram_Signature.Remove_Parameter; use LAL_Refactor.Subprogram_Signature.Remove_Parameter; -with LSP.Messages; -with LSP.Lal_Utils; - +with VSS.JSON.Streams; with VSS.Strings.Conversions; -with LSP.Commands; + +with LSP.Ada_Contexts; +with LSP.Enumerations; +with LSP.Utils; +with LSP.Structures.LSPAny_Vectors; use LSP.Structures.LSPAny_Vectors; package body LSP.Ada_Handlers.Refactor.Remove_Parameter is @@ -37,15 +37,14 @@ package body LSP.Ada_Handlers.Refactor.Remove_Parameter is procedure Append_Code_Action (Self : in out Command; - Context : Context_Access; - Commands_Vector : in out LSP.Messages.CodeAction_Vector; - Target_Subp : Basic_Decl; + Context : LSP.Ada_Context_Sets.Context_Access; + Commands_Vector : in out LSP.Structures.Command_Or_CodeAction_Vector; + Target_Subp : Libadalang.Analysis.Basic_Decl; Parameters_Indices : Parameter_Indices_Range_Type) is - Pointer : LSP.Commands.Command_Pointer; - Code_Action : LSP.Messages.CodeAction; - Where : constant LSP.Messages.Location := - LSP.Lal_Utils.Get_Node_Location (Target_Subp.P_Defining_Name.F_Name); + Code_Action : LSP.Structures.CodeAction; + Where : constant LSP.Structures.Location := + LSP.Utils.Get_Node_Location (Target_Subp.P_Defining_Name.F_Name); function Create_Code_Action_Title return VSS.Strings.Virtual_String; -- Creates the code action text that will be shown by the client to @@ -97,30 +96,32 @@ package body LSP.Ada_Handlers.Refactor.Remove_Parameter is begin Self.Initialize - (Context => Context.all, - Where => ((uri => Where.uri), Where.span.first), - First_Parameter => LSP.Types.LSP_Number (Parameters_Indices.First), - Last_Parameter => LSP.Types.LSP_Number (Parameters_Indices.Last)); - - Pointer.Set (Self); + (Context => Context, + Where => ((uri => Where.uri), Where.a_range.start), + First_Parameter => Parameters_Indices.First, + Last_Parameter => Parameters_Indices.Last); Code_Action := (title => Create_Code_Action_Title, kind => (Is_Set => True, - Value => LSP.Messages.RefactorRewrite), - diagnostics => (Is_Set => False), + Value => LSP.Enumerations.RefactorRewrite), + diagnostics => <>, edit => (Is_Set => False), isPreferred => (Is_Set => False), disabled => (Is_Set => False), command => (Is_Set => True, Value => - (Is_Unknown => False, - title => <>, - Custom => Pointer))); - - Commands_Vector.Append (Code_Action); + (title => <>, + command => VSS.Strings.Conversions.To_Virtual_String + (Command'External_Tag), + arguments => Self.Write_Command)), + data => <>); + + Commands_Vector.Append + (LSP.Structures.Command_Or_CodeAction' + (Is_Command => False, CodeAction => Code_Action)); end Append_Code_Action; ------------ @@ -128,44 +129,47 @@ package body LSP.Ada_Handlers.Refactor.Remove_Parameter is ------------ overriding function Create - (JS : not null access LSP.JSON_Streams.JSON_Stream'Class) + (Any : not null access LSP.Structures.LSPAny_Vector) return Command is - begin - return V : Command do - pragma Assert (JS.R.Is_Start_Object); - - JS.R.Read_Next; - - while not JS.R.Is_End_Object loop - pragma Assert (JS.R.Is_Key_Name); + use VSS.JSON.Streams; + use VSS.Strings; + use LSP.Structures.JSON_Event_Vectors; + C : Cursor := Any.First; + begin + return Self : Command do + pragma Assert (Element (C).Kind = Start_Object); + Next (C); + + while Has_Element (C) + and then Element (C).Kind /= End_Object + loop + pragma Assert (Element (C).Kind = Key_Name); declare - Key : constant Ada.Strings.UTF_Encoding.UTF_8_String := - VSS.Strings.Conversions.To_UTF_8_String (JS.R.Key_Name); - + Key : constant Virtual_String := Element (C).Key_Name; begin - JS.R.Read_Next; + Next (C); if Key = "context" then - LSP.Types.Read_String (JS, V.Context); + Self.Context := Element (C).String_Value; elsif Key = "where" then - LSP.Messages.TextDocumentPositionParams'Read (JS, V.Where); + Self.Where := From_Any (C); elsif Key = "first_parameter" then - LSP.Types.Read (JS, V.First_Parameter); + Self.First_Parameter := From_Any (C); elsif Key = "last_parameter" then - LSP.Types.Read (JS, V.Last_Parameter); + Self.Last_Parameter := From_Any (C); else - JS.Skip_Value; + Skip_Value (C); end if; end; - end loop; - JS.R.Read_Next; + Next (C); + end loop; end return; end Create; @@ -182,8 +186,6 @@ package body LSP.Ada_Handlers.Refactor.Remove_Parameter is Edits : out LAL_Refactor.Refactoring_Edits) is use LAL_Refactor; - use LSP.Types; - Message_Handler : LSP.Ada_Handlers.Message_Handler renames LSP.Ada_Handlers.Message_Handler (Handler.all); Context : LSP.Ada_Contexts.Context renames @@ -228,11 +230,11 @@ package body LSP.Ada_Handlers.Refactor.Remove_Parameter is ---------------- procedure Initialize - (Self : in out Command'Class; - Context : LSP.Ada_Contexts.Context; - Where : LSP.Messages.TextDocumentPositionParams; - First_Parameter : LSP.Types.LSP_Number; - Last_Parameter : LSP.Types.LSP_Number) is + (Self : in out Command'Class; + Context : LSP.Ada_Context_Sets.Context_Access; + Where : LSP.Structures.TextDocumentPositionParams; + First_Parameter : Integer; + Last_Parameter : Integer) is begin Self.Context := Context.Id; Self.Where := Where; @@ -244,23 +246,34 @@ package body LSP.Ada_Handlers.Refactor.Remove_Parameter is -- Write_Command -- ------------------- - procedure Write_Command - (S : access Ada.Streams.Root_Stream_Type'Class; - C : Command) + function Write_Command + (Self : Command) return LSP.Structures.LSPAny_Vector is - JS : LSP.JSON_Streams.JSON_Stream'Class renames - LSP.JSON_Streams.JSON_Stream'Class (S.all); + use VSS.JSON.Streams; + + Result : LSP.Structures.LSPAny_Vector; begin - JS.Start_Object; - JS.Key ("context"); - LSP.Types.Write_String (S, C.Context); - JS.Key ("where"); - LSP.Messages.TextDocumentPositionParams'Write (S, C.Where); - JS.Key ("first_parameter"); - LSP.Types.Write (S, C.First_Parameter); - JS.Key ("last_parameter"); - LSP.Types.Write (S, C.Last_Parameter); - JS.End_Object; + Result.Append (JSON_Stream_Element'(Kind => Start_Object)); + + -- "context" + Add_Key ("context", Result); + To_Any (Self.Context, Result); + + -- "where" + Add_Key ("where", Result); + To_Any (Self.Where, Result); + + -- "first_parameter" + Add_Key ("first_parameter", Result); + To_Any (Self.First_Parameter, Result); + + -- "last_parameter" + Add_Key ("last_parameter", Result); + To_Any (Self.Last_Parameter, Result); + + Result.Append (JSON_Stream_Element'(Kind => End_Object)); + + return Result; end Write_Command; end LSP.Ada_Handlers.Refactor.Remove_Parameter; diff --git a/source/ada/lsp-ada_handlers-refactor-remove_parameter.ads b/source/ada/lsp-ada_handlers-refactor-remove_parameter.ads index c17a20d88..698417024 100644 --- a/source/ada/lsp-ada_handlers-refactor-remove_parameter.ads +++ b/source/ada/lsp-ada_handlers-refactor-remove_parameter.ads @@ -1,7 +1,7 @@ ------------------------------------------------------------------------------ -- Language Server Protocol -- -- -- --- Copyright (C) 2021, AdaCore -- +-- Copyright (C) 2021-2023, AdaCore -- -- -- -- This is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -17,12 +17,9 @@ -- -- Implementation of the refactoring command to remove parameters -with Ada.Streams; - private with VSS.Strings; with LSP.Client_Message_Receivers; -with LSP.JSON_Streams; with Libadalang.Analysis; @@ -39,8 +36,8 @@ package LSP.Ada_Handlers.Refactor.Remove_Parameter is procedure Append_Code_Action (Self : in out Command; - Context : Context_Access; - Commands_Vector : in out LSP.Messages.CodeAction_Vector; + Context : LSP.Ada_Context_Sets.Context_Access; + Commands_Vector : in out LSP.Structures.Command_Or_CodeAction_Vector; Target_Subp : Libadalang.Analysis.Basic_Decl; Parameters_Indices : Parameter_Indices_Range_Type); -- Initializes 'Self' and appends it to 'Commands_Vector' @@ -49,13 +46,13 @@ private type Command is new LSP.Ada_Handlers.Refactor.Command with record Context : VSS.Strings.Virtual_String; - Where : LSP.Messages.TextDocumentPositionParams; - First_Parameter : LSP.Types.LSP_Number; - Last_Parameter : LSP.Types.LSP_Number; + Where : LSP.Structures.TextDocumentPositionParams; + First_Parameter : Integer; + Last_Parameter : Integer; end record; overriding function Create - (JS : not null access LSP.JSON_Streams.JSON_Stream'Class) + (Any : not null access LSP.Structures.LSPAny_Vector) return Command; -- Reads JS and creates a new Command @@ -70,18 +67,15 @@ private procedure Initialize (Self : in out Command'Class; - Context : LSP.Ada_Contexts.Context; - Where : LSP.Messages.TextDocumentPositionParams; - First_Parameter : LSP.Types.LSP_Number; - Last_Parameter : LSP.Types.LSP_Number); + Context : LSP.Ada_Context_Sets.Context_Access; + Where : LSP.Structures.TextDocumentPositionParams; + First_Parameter : Integer; + Last_Parameter : Integer); -- Initializes Self - procedure Write_Command - (S : access Ada.Streams.Root_Stream_Type'Class; - C : Command); - -- Writes C to S + function Write_Command + (Self : Command) return LSP.Structures.LSPAny_Vector; - for Command'Write use Write_Command; for Command'External_Tag use "als-refactor-remove-parameters"; end LSP.Ada_Handlers.Refactor.Remove_Parameter; diff --git a/source/ada/lsp-ada_handlers-refactor-replace_type.adb b/source/ada/lsp-ada_handlers-refactor-replace_type.adb index c34080b17..155e5beb6 100644 --- a/source/ada/lsp-ada_handlers-refactor-replace_type.adb +++ b/source/ada/lsp-ada_handlers-refactor-replace_type.adb @@ -15,8 +15,6 @@ -- of the license. -- ------------------------------------------------------------------------------ -with Ada.Strings.UTF_Encoding; - with Langkit_Support.Slocs; with Libadalang.Analysis; use Libadalang.Analysis; @@ -24,10 +22,11 @@ with Libadalang.Analysis; use Libadalang.Analysis; with LAL_Refactor.Replace_Type; use LAL_Refactor.Replace_Type; -with LSP.Messages; - +with VSS.JSON.Streams; with VSS.Strings.Conversions; -with LSP.Commands; + +with LSP.Enumerations; +with LSP.Structures.LSPAny_Vectors; use LSP.Structures.LSPAny_Vectors; package body LSP.Ada_Handlers.Refactor.Replace_Type is @@ -36,38 +35,39 @@ package body LSP.Ada_Handlers.Refactor.Replace_Type is ------------------------ procedure Append_Code_Action - (Self : in out Command; - Context : Context_Access; - Commands_Vector : in out LSP.Messages.CodeAction_Vector; - Where : LSP.Messages.Location) + (Self : in out Command; + Context : LSP.Ada_Context_Sets.Context_Access; + Commands_Vector : in out LSP.Structures.Command_Or_CodeAction_Vector; + Where : LSP.Structures.Location) is - Pointer : LSP.Commands.Command_Pointer; - Code_Action : LSP.Messages.CodeAction; + Code_Action : LSP.Structures.CodeAction; begin Self.Initialize (Context => Context.all, Where => Where); - Pointer.Set (Self); - Code_Action := (title => "Replace Type", kind => (Is_Set => True, - Value => LSP.Messages.RefactorRewrite), - diagnostics => (Is_Set => False), + Value => LSP.Enumerations.RefactorRewrite), + diagnostics => <>, edit => (Is_Set => False), isPreferred => (Is_Set => False), disabled => (Is_Set => False), command => (Is_Set => True, Value => - (Is_Unknown => False, - title => <>, - Custom => Pointer))); - - Commands_Vector.Append (Code_Action); + (title => <>, + command => VSS.Strings.Conversions.To_Virtual_String + (Command'External_Tag), + arguments => Self.Write_Command)), + data => <>); + + Commands_Vector.Append + (LSP.Structures.Command_Or_CodeAction' + (Is_Command => False, CodeAction => Code_Action)); end Append_Code_Action; ------------ @@ -75,40 +75,44 @@ package body LSP.Ada_Handlers.Refactor.Replace_Type is ------------ overriding function Create - (JS : not null access LSP.JSON_Streams.JSON_Stream'Class) - return Command is - begin - return V : Command do - pragma Assert (JS.R.Is_Start_Object); - - JS.R.Read_Next; - - while not JS.R.Is_End_Object loop - pragma Assert (JS.R.Is_Key_Name); + (Any : not null access LSP.Structures.LSPAny_Vector) + return Command + is + use VSS.JSON.Streams; + use VSS.Strings; + use LSP.Structures.JSON_Event_Vectors; + C : Cursor := Any.First; + begin + return Self : Command do + pragma Assert (Element (C).Kind = Start_Object); + Next (C); + + while Has_Element (C) + and then Element (C).Kind /= End_Object + loop + pragma Assert (Element (C).Kind = Key_Name); declare - Key : constant Ada.Strings.UTF_Encoding.UTF_8_String := - VSS.Strings.Conversions.To_UTF_8_String (JS.R.Key_Name); - + Key : constant Virtual_String := Element (C).Key_Name; begin - JS.R.Read_Next; + Next (C); if Key = "context_id" then - LSP.Types.Read_String (JS, V.Context_Id); + Self.Context_Id := Element (C).String_Value; elsif Key = "where" then - LSP.Messages.Location'Read (JS, V.Where); + Self.Where := From_Any (C); elsif Key = "newType" then - LSP.Types.Read_String (JS, V.New_Type); + Self.New_Type := Element (C).String_Value; else - JS.Skip_Value; + Skip_Value (C); end if; end; - end loop; - JS.R.Read_Next; + Next (C); + end loop; end return; end Create; @@ -126,7 +130,6 @@ package body LSP.Ada_Handlers.Refactor.Replace_Type is is use Langkit_Support.Slocs; use LAL_Refactor; - use LSP.Types; Message_Handler : LSP.Ada_Handlers.Message_Handler renames LSP.Ada_Handlers.Message_Handler (Handler.all); @@ -144,9 +147,9 @@ package body LSP.Ada_Handlers.Refactor.Replace_Type is (Context.URI_To_File (Self.Where.uri)), Source_Type_SLOC => (Langkit_Support.Slocs.Line_Number - (Self.Where.span.first.line) + 1, + (Self.Where.a_range.start.line) + 1, Langkit_Support.Slocs.Column_Number - (Self.Where.span.first.character) + 1), + (Self.Where.a_range.start.character) + 1), New_Type => VSS.Strings.Conversions.To_Unbounded_UTF_8_String (Self.New_Type)); @@ -160,35 +163,43 @@ package body LSP.Ada_Handlers.Refactor.Replace_Type is ---------------- procedure Initialize - (Self : in out Command'Class; - Context : LSP.Ada_Contexts.Context; - Where : LSP.Messages.Location) is + (Self : in out Command'Class; + Context : LSP.Ada_Contexts.Context; + Where : LSP.Structures.Location) is begin Self.Context_Id := Context.Id; - Self.Where := Where; - Self.New_Type := VSS.Strings.Empty_Virtual_String; + Self.Where := Where; + Self.New_Type := VSS.Strings.Empty_Virtual_String; end Initialize; ------------------- -- Write_Command -- ------------------- - procedure Write_Command - (S : access Ada.Streams.Root_Stream_Type'Class; - C : Command) + function Write_Command + (Self : Command) return LSP.Structures.LSPAny_Vector is - JS : LSP.JSON_Streams.JSON_Stream'Class renames - LSP.JSON_Streams.JSON_Stream'Class (S.all); + use VSS.JSON.Streams; + Result : LSP.Structures.LSPAny_Vector; begin - JS.Start_Object; - JS.Key ("context_id"); - LSP.Types.Write_String (S, C.Context_Id); - JS.Key ("where"); - LSP.Messages.Location'Write (S, C.Where); - JS.Key ("newType"); - LSP.Types.Write_String (S, C.New_Type); - JS.End_Object; + Result.Append (JSON_Stream_Element'(Kind => Start_Object)); + + -- "context_id" + Add_Key ("context_id", Result); + To_Any (Self.Context_Id, Result); + + -- "where" + Add_Key ("where", Result); + To_Any (Self.Where, Result); + + -- "newType" + Add_Key ("newType", Result); + To_Any (Self.New_Type, Result); + + Result.Append (JSON_Stream_Element'(Kind => End_Object)); + + return Result; end Write_Command; end LSP.Ada_Handlers.Refactor.Replace_Type; diff --git a/source/ada/lsp-ada_handlers-refactor-replace_type.ads b/source/ada/lsp-ada_handlers-refactor-replace_type.ads index 91b9c8152..ff12525ac 100644 --- a/source/ada/lsp-ada_handlers-refactor-replace_type.ads +++ b/source/ada/lsp-ada_handlers-refactor-replace_type.ads @@ -17,10 +17,8 @@ -- -- Implementation of the refactoring command to replace a type -with Ada.Streams; - +with LSP.Ada_Contexts; with LSP.Client_Message_Receivers; -with LSP.JSON_Streams; private with VSS.Strings; @@ -34,22 +32,22 @@ package LSP.Ada_Handlers.Refactor.Replace_Type is procedure Append_Code_Action (Self : in out Command; - Context : Context_Access; - Commands_Vector : in out LSP.Messages.CodeAction_Vector; - Where : LSP.Messages.Location); + Context : LSP.Ada_Context_Sets.Context_Access; + Commands_Vector : in out LSP.Structures.Command_Or_CodeAction_Vector; + Where : LSP.Structures.Location); -- Initializes Self and appends it to Commands_Vector private type Command is new LSP.Ada_Handlers.Refactor.Command with record Context_Id : VSS.Strings.Virtual_String; + Where : LSP.Structures.Location; New_Type : VSS.Strings.Virtual_String; - Where : LSP.Messages.Location; end record; overriding function Create - (JS : not null access LSP.JSON_Streams.JSON_Stream'Class) + (Any : not null access LSP.Structures.LSPAny_Vector) return Command; -- Reads JS and creates a new Command @@ -66,15 +64,12 @@ private procedure Initialize (Self : in out Command'Class; Context : LSP.Ada_Contexts.Context; - Where : LSP.Messages.Location); + Where : LSP.Structures.Location); -- Initializes Self - procedure Write_Command - (S : access Ada.Streams.Root_Stream_Type'Class; - C : Command); - -- Writes C to S + function Write_Command + (Self : Command) return LSP.Structures.LSPAny_Vector; - for Command'Write use Write_Command; for Command'External_Tag use "als-refactor-replace-type"; end LSP.Ada_Handlers.Refactor.Replace_Type; diff --git a/source/ada/lsp-ada_handlers-refactor-sort_dependencies.adb b/source/ada/lsp-ada_handlers-refactor-sort_dependencies.adb index cfd8f9914..bf60d45bd 100644 --- a/source/ada/lsp-ada_handlers-refactor-sort_dependencies.adb +++ b/source/ada/lsp-ada_handlers-refactor-sort_dependencies.adb @@ -15,18 +15,17 @@ -- of the license. -- ------------------------------------------------------------------------------ -with Ada.Strings.UTF_Encoding; - with Langkit_Support.Slocs; with Libadalang.Analysis; with LAL_Refactor.Sort_Dependencies; -with LSP.Messages; - +with VSS.JSON.Streams; with VSS.Strings.Conversions; -with LSP.Commands; + +with LSP.Enumerations; +with LSP.Structures.LSPAny_Vectors; use LSP.Structures.LSPAny_Vectors; package body LSP.Ada_Handlers.Refactor.Sort_Dependencies is @@ -36,37 +35,38 @@ package body LSP.Ada_Handlers.Refactor.Sort_Dependencies is procedure Append_Code_Action (Self : in out Command; - Context : Context_Access; - Commands_Vector : in out LSP.Messages.CodeAction_Vector; - Where : LSP.Messages.Location) + Context : LSP.Ada_Context_Sets.Context_Access; + Commands_Vector : in out LSP.Structures.Command_Or_CodeAction_Vector; + Where : LSP.Structures.Location) is - Pointer : LSP.Commands.Command_Pointer; - Code_Action : LSP.Messages.CodeAction; + Code_Action : LSP.Structures.CodeAction; begin Self.Initialize (Context => Context.all, Where => Where); - Pointer.Set (Self); - Code_Action := (title => "Sort Dependencies", kind => (Is_Set => True, - Value => LSP.Messages.Refactor), - diagnostics => (Is_Set => False), + Value => LSP.Enumerations.Refactor), + diagnostics => <>, edit => (Is_Set => False), isPreferred => (Is_Set => False), disabled => (Is_Set => False), command => (Is_Set => True, Value => - (Is_Unknown => False, - title => <>, - Custom => Pointer))); - - Commands_Vector.Append (Code_Action); + (title => <>, + command => VSS.Strings.Conversions.To_Virtual_String + (Command'External_Tag), + arguments => Self.Write_Command)), + data => <>); + + Commands_Vector.Append + (LSP.Structures.Command_Or_CodeAction' + (Is_Command => False, CodeAction => Code_Action)); end Append_Code_Action; ------------ @@ -75,42 +75,41 @@ package body LSP.Ada_Handlers.Refactor.Sort_Dependencies is overriding function Create - (JS : not null access LSP.JSON_Streams.JSON_Stream'Class) + (Any : not null access LSP.Structures.LSPAny_Vector) return Command is - use Ada.Strings.UTF_Encoding; - use LSP.Messages; - use LSP.Types; - use VSS.Strings.Conversions; + use VSS.JSON.Streams; + use VSS.Strings; + use LSP.Structures.JSON_Event_Vectors; + C : Cursor := Any.First; begin - return C : Command do - pragma Assert (JS.R.Is_Start_Object); - - JS.R.Read_Next; - - while not JS.R.Is_End_Object loop - pragma Assert (JS.R.Is_Key_Name); - + return Self : Command do + pragma Assert (Element (C).Kind = Start_Object); + Next (C); + + while Has_Element (C) + and then Element (C).Kind /= End_Object + loop + pragma Assert (Element (C).Kind = Key_Name); declare - Key : constant UTF_8_String := To_UTF_8_String (JS.R.Key_Name); - + Key : constant Virtual_String := Element (C).Key_Name; begin - JS.R.Read_Next; + Next (C); if Key = "context" then - Read_String (JS, C.Context); + Self.Context := Element (C).String_Value; elsif Key = "where" then - Location'Read (JS, C.Where); + Self.Where := From_Any (C); else - JS.Skip_Value; + Skip_Value (C); end if; end; - end loop; - JS.R.Read_Next; + Next (C); + end loop; end return; end Create; @@ -131,7 +130,6 @@ package body LSP.Ada_Handlers.Refactor.Sort_Dependencies is use Libadalang.Analysis; use LAL_Refactor; use LAL_Refactor.Sort_Dependencies; - use LSP.Types; Message_Handler : LSP.Ada_Handlers.Message_Handler renames LSP.Ada_Handlers.Message_Handler (Handler.all); @@ -140,11 +138,12 @@ package body LSP.Ada_Handlers.Refactor.Sort_Dependencies is Analysis_Unit : constant Libadalang.Analysis.Analysis_Unit := Context.LAL_Context.Get_From_File - (Context.URI_To_File (Self.Where.uri)); + (VSS.Strings.Conversions.To_UTF_8_String (Self.Where.uri)); Sloc : constant Source_Location := - (Langkit_Support.Slocs.Line_Number (Self.Where.span.first.line) + 1, - Langkit_Support.Slocs.Column_Number (Self.Where.span.first.character) - + 1); + (Langkit_Support.Slocs.Line_Number + (Self.Where.a_range.start.line) + 1, + Langkit_Support.Slocs.Column_Number + (Self.Where.a_range.start.character) + 1); Compilation_Unit : constant Libadalang.Analysis.Compilation_Unit := Analysis_Unit.Root.Lookup (Sloc).P_Enclosing_Compilation_Unit; @@ -162,7 +161,7 @@ package body LSP.Ada_Handlers.Refactor.Sort_Dependencies is procedure Initialize (Self : in out Command'Class; Context : LSP.Ada_Contexts.Context; - Where : LSP.Messages.Location) is + Where : LSP.Structures.Location) is begin Self.Context := Context.Id; Self.Where := Where; @@ -172,23 +171,26 @@ package body LSP.Ada_Handlers.Refactor.Sort_Dependencies is -- Write_Command -- ------------------- - procedure Write_Command - (S : access Ada.Streams.Root_Stream_Type'Class; - C : Command) + function Write_Command + (Self : Command) return LSP.Structures.LSPAny_Vector is - use LSP.Messages; - use LSP.Types; - - JS : LSP.JSON_Streams.JSON_Stream'Class renames - LSP.JSON_Streams.JSON_Stream'Class (S.all); + use VSS.JSON.Streams; + Result : LSP.Structures.LSPAny_Vector; begin - JS.Start_Object; - JS.Key ("context"); - Write_String (S, C.Context); - JS.Key ("where"); - Location'Write (S, C.Where); - JS.End_Object; + Result.Append (JSON_Stream_Element'(Kind => Start_Object)); + + -- "context" + Add_Key ("context", Result); + To_Any (Self.Context, Result); + + -- "where" + Add_Key ("where", Result); + To_Any (Self.Where, Result); + + Result.Append (JSON_Stream_Element'(Kind => End_Object)); + + return Result; end Write_Command; end LSP.Ada_Handlers.Refactor.Sort_Dependencies; diff --git a/source/ada/lsp-ada_handlers-refactor-sort_dependencies.ads b/source/ada/lsp-ada_handlers-refactor-sort_dependencies.ads index 7adaeed08..01d2aa94e 100644 --- a/source/ada/lsp-ada_handlers-refactor-sort_dependencies.ads +++ b/source/ada/lsp-ada_handlers-refactor-sort_dependencies.ads @@ -17,10 +17,8 @@ -- -- Implementation of the refactoring command to sort dependencies -with Ada.Streams; - +with LSP.Ada_Contexts; with LSP.Client_Message_Receivers; -with LSP.JSON_Streams; private with VSS.Strings; @@ -34,21 +32,21 @@ package LSP.Ada_Handlers.Refactor.Sort_Dependencies is procedure Append_Code_Action (Self : in out Command; - Context : Context_Access; - Commands_Vector : in out LSP.Messages.CodeAction_Vector; - Where : LSP.Messages.Location); + Context : LSP.Ada_Context_Sets.Context_Access; + Commands_Vector : in out LSP.Structures.Command_Or_CodeAction_Vector; + Where : LSP.Structures.Location); -- Initializes Self and appends it to Commands_Vector private type Command is new LSP.Ada_Handlers.Refactor.Command with record Context : VSS.Strings.Virtual_String; - Where : LSP.Messages.Location; + Where : LSP.Structures.Location; end record; overriding function Create - (JS : not null access LSP.JSON_Streams.JSON_Stream'Class) + (Any : not null access LSP.Structures.LSPAny_Vector) return Command; -- Reads JS and creates a new Command @@ -65,15 +63,12 @@ private procedure Initialize (Self : in out Command'Class; Context : LSP.Ada_Contexts.Context; - Where : LSP.Messages.Location); + Where : LSP.Structures.Location); -- Initializes Self - procedure Write_Command - (S : access Ada.Streams.Root_Stream_Type'Class; - C : Command); - -- Writes C to S + function Write_Command + (Self : Command) return LSP.Structures.LSPAny_Vector; - for Command'Write use Write_Command; for Command'External_Tag use "als-refactor-sort_dependencies"; end LSP.Ada_Handlers.Refactor.Sort_Dependencies; diff --git a/source/ada/lsp-ada_handlers-refactor-suppress_seperate.adb b/source/ada/lsp-ada_handlers-refactor-suppress_seperate.adb index 6f0682282..19e950aae 100644 --- a/source/ada/lsp-ada_handlers-refactor-suppress_seperate.adb +++ b/source/ada/lsp-ada_handlers-refactor-suppress_seperate.adb @@ -1,7 +1,7 @@ ------------------------------------------------------------------------------ -- Language Server Protocol -- -- -- --- Copyright (C) 2021-2022, AdaCore -- +-- Copyright (C) 2021-2023, AdaCore -- -- -- -- This is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -15,20 +15,20 @@ -- of the license. -- ------------------------------------------------------------------------------ -with Ada.Strings.UTF_Encoding; - with Libadalang.Analysis; use Libadalang.Analysis; with Laltools.Common; use Laltools.Common; with LAL_Refactor.Suppress_Separate; use LAL_Refactor.Suppress_Separate; +with LAL_Refactor.Subprogram_Signature; use LAL_Refactor.Subprogram_Signature; -with LSP.Messages; -with LSP.Lal_Utils; - +with VSS.JSON.Streams; with VSS.Strings.Conversions; -with LSP.Commands; -with LAL_Refactor.Subprogram_Signature; use LAL_Refactor.Subprogram_Signature; + +with LSP.Ada_Contexts; +with LSP.Enumerations; +with LSP.Utils; +with LSP.Structures.LSPAny_Vectors; use LSP.Structures.LSPAny_Vectors; package body LSP.Ada_Handlers.Refactor.Suppress_Seperate is @@ -38,44 +38,45 @@ package body LSP.Ada_Handlers.Refactor.Suppress_Seperate is procedure Append_Code_Action (Self : in out Command; - Context : Context_Access; - Commands_Vector : in out LSP.Messages.CodeAction_Vector; - Target_Separate : Basic_Decl) + Context : LSP.Ada_Context_Sets.Context_Access; + Commands_Vector : in out LSP.Structures.Command_Or_CodeAction_Vector; + Target_Separate : Libadalang.Analysis.Basic_Decl) is - Pointer : LSP.Commands.Command_Pointer; - Code_Action : LSP.Messages.CodeAction; + Code_Action : LSP.Structures.CodeAction; Subp_Name : constant Libadalang.Analysis.Name := Target_Separate.P_Defining_Name.F_Name; - Where : constant LSP.Messages.Location := - LSP.Lal_Utils.Get_Node_Location (Subp_Name); + Where : constant LSP.Structures.Location := + LSP.Utils.Get_Node_Location (Subp_Name); Action_Title : constant VSS.Strings.Virtual_String := VSS.Strings.To_Virtual_String ("Suppress separate subprogram " & Subp_Name.Text); begin Self.Initialize - (Context => Context.all, - Where => ((uri => Where.uri), Where.span.first)); - - Pointer.Set (Self); + (Context => Context, + Where => ((uri => Where.uri), Where.a_range.start)); Code_Action := (title => Action_Title, kind => (Is_Set => True, - Value => LSP.Messages.RefactorRewrite), - diagnostics => (Is_Set => False), + Value => LSP.Enumerations.RefactorRewrite), + diagnostics => <>, edit => (Is_Set => False), isPreferred => (Is_Set => False), disabled => (Is_Set => False), command => (Is_Set => True, Value => - (Is_Unknown => False, - title => <>, - Custom => Pointer))); - - Commands_Vector.Append (Code_Action); + (title => <>, + command => VSS.Strings.Conversions.To_Virtual_String + (Command'External_Tag), + arguments => Self.Write_Command)), + data => <>); + + Commands_Vector.Append + (LSP.Structures.Command_Or_CodeAction' + (Is_Command => False, CodeAction => Code_Action)); end Append_Code_Action; ------------ @@ -83,38 +84,41 @@ package body LSP.Ada_Handlers.Refactor.Suppress_Seperate is ------------ overriding function Create - (JS : not null access LSP.JSON_Streams.JSON_Stream'Class) + (Any : not null access LSP.Structures.LSPAny_Vector) return Command is - begin - return V : Command do - pragma Assert (JS.R.Is_Start_Object); - - JS.R.Read_Next; - - while not JS.R.Is_End_Object loop - pragma Assert (JS.R.Is_Key_Name); + use VSS.JSON.Streams; + use VSS.Strings; + use LSP.Structures.JSON_Event_Vectors; + C : Cursor := Any.First; + begin + return Self : Command do + pragma Assert (Element (C).Kind = Start_Object); + Next (C); + + while Has_Element (C) + and then Element (C).Kind /= End_Object + loop + pragma Assert (Element (C).Kind = Key_Name); declare - Key : constant Ada.Strings.UTF_Encoding.UTF_8_String := - VSS.Strings.Conversions.To_UTF_8_String (JS.R.Key_Name); - + Key : constant Virtual_String := Element (C).Key_Name; begin - JS.R.Read_Next; + Next (C); if Key = "context" then - LSP.Types.Read_String (JS, V.Context); + Self.Context := Element (C).String_Value; elsif Key = "where" then - LSP.Messages.TextDocumentPositionParams'Read (JS, V.Where); + Self.Where := From_Any (C); else - JS.Skip_Value; + Skip_Value (C); end if; end; - end loop; - JS.R.Read_Next; + Next (C); + end loop; end return; end Create; @@ -175,9 +179,9 @@ package body LSP.Ada_Handlers.Refactor.Suppress_Seperate is ---------------- procedure Initialize - (Self : in out Command'Class; - Context : LSP.Ada_Contexts.Context; - Where : LSP.Messages.TextDocumentPositionParams) is + (Self : in out Command'Class; + Context : LSP.Ada_Context_Sets.Context_Access; + Where : LSP.Structures.TextDocumentPositionParams) is begin Self.Context := Context.Id; Self.Where := Where; @@ -187,19 +191,26 @@ package body LSP.Ada_Handlers.Refactor.Suppress_Seperate is -- Write_Command -- ------------------- - procedure Write_Command - (S : access Ada.Streams.Root_Stream_Type'Class; - C : Command) + function Write_Command + (Self : Command) return LSP.Structures.LSPAny_Vector is - JS : LSP.JSON_Streams.JSON_Stream'Class renames - LSP.JSON_Streams.JSON_Stream'Class (S.all); + use VSS.JSON.Streams; + + Result : LSP.Structures.LSPAny_Vector; begin - JS.Start_Object; - JS.Key ("context"); - LSP.Types.Write_String (S, C.Context); - JS.Key ("where"); - LSP.Messages.TextDocumentPositionParams'Write (S, C.Where); - JS.End_Object; + Result.Append (JSON_Stream_Element'(Kind => Start_Object)); + + -- "context" + Add_Key ("context", Result); + To_Any (Self.Context, Result); + + -- "where" + Add_Key ("where", Result); + To_Any (Self.Where, Result); + + Result.Append (JSON_Stream_Element'(Kind => End_Object)); + + return Result; end Write_Command; end LSP.Ada_Handlers.Refactor.Suppress_Seperate; diff --git a/source/ada/lsp-ada_handlers-refactor-suppress_seperate.ads b/source/ada/lsp-ada_handlers-refactor-suppress_seperate.ads index e4ff8658b..6e9a11fdc 100644 --- a/source/ada/lsp-ada_handlers-refactor-suppress_seperate.ads +++ b/source/ada/lsp-ada_handlers-refactor-suppress_seperate.ads @@ -1,7 +1,7 @@ ------------------------------------------------------------------------------ -- Language Server Protocol -- -- -- --- Copyright (C) 2021, AdaCore -- +-- Copyright (C) 2021-2023, AdaCore -- -- -- -- This is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -17,12 +17,9 @@ -- -- Implementation of the refactoring command to suppress separate subprograms -with Ada.Streams; - private with VSS.Strings; with LSP.Client_Message_Receivers; -with LSP.JSON_Streams; with Libadalang.Analysis; @@ -36,8 +33,8 @@ package LSP.Ada_Handlers.Refactor.Suppress_Seperate is procedure Append_Code_Action (Self : in out Command; - Context : Context_Access; - Commands_Vector : in out LSP.Messages.CodeAction_Vector; + Context : LSP.Ada_Context_Sets.Context_Access; + Commands_Vector : in out LSP.Structures.Command_Or_CodeAction_Vector; Target_Separate : Libadalang.Analysis.Basic_Decl); -- Initializes 'Self' and appends it to 'Commands_Vector' @@ -45,11 +42,11 @@ private type Command is new LSP.Ada_Handlers.Refactor.Command with record Context : VSS.Strings.Virtual_String; - Where : LSP.Messages.TextDocumentPositionParams; + Where : LSP.Structures.TextDocumentPositionParams; end record; overriding function Create - (JS : not null access LSP.JSON_Streams.JSON_Stream'Class) + (Any : not null access LSP.Structures.LSPAny_Vector) return Command; -- Reads JS and creates a new Command @@ -64,16 +61,13 @@ private procedure Initialize (Self : in out Command'Class; - Context : LSP.Ada_Contexts.Context; - Where : LSP.Messages.TextDocumentPositionParams); + Context : LSP.Ada_Context_Sets.Context_Access; + Where : LSP.Structures.TextDocumentPositionParams); -- Initializes Self - procedure Write_Command - (S : access Ada.Streams.Root_Stream_Type'Class; - C : Command); - -- Writes C to S + function Write_Command + (Self : Command) return LSP.Structures.LSPAny_Vector; - for Command'Write use Write_Command; for Command'External_Tag use "als-suppress-separate"; end LSP.Ada_Handlers.Refactor.Suppress_Seperate; diff --git a/source/ada/lsp-ada_handlers-refactor.adb b/source/ada/lsp-ada_handlers-refactor.adb index b25097287..03845216c 100644 --- a/source/ada/lsp-ada_handlers-refactor.adb +++ b/source/ada/lsp-ada_handlers-refactor.adb @@ -1,7 +1,7 @@ ------------------------------------------------------------------------------ -- Language Server Protocol -- -- -- --- Copyright (C) 2018-2021, AdaCore -- +-- Copyright (C) 2018-2023, AdaCore -- -- -- -- This is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -16,15 +16,18 @@ ------------------------------------------------------------------------------ with VSS.Strings.Conversions; + with LSP.Ada_Documents; use LSP.Ada_Documents; -with LSP.Common; -with LSP.Messages.Client_Requests; use LSP.Messages.Client_Requests; -with LSP.Types; use LSP.Types; -with LSP.Messages; use LSP.Messages; -with LSP.Lal_Utils; +with LSP.Enumerations; +with LSP.Structures; use LSP.Structures; +with LSP.Utils; package body LSP.Ada_Handlers.Refactor is + function To_DocumentUri (X : String) + return LSP.Structures.DocumentUri is + (VSS.Strings.Conversions.To_Virtual_String (X) with null record); + ------------- -- Execute -- ------------- @@ -33,16 +36,17 @@ package body LSP.Ada_Handlers.Refactor is (Self : Command; Handler : not null access LSP.Server_Notification_Receivers.Server_Notification_Receiver'Class; - Client : not null access - LSP.Client_Message_Receivers.Client_Message_Receiver'Class; - Error : in out LSP.Errors.Optional_ResponseError) + Sender : not null access LSP.Client_Message_Receivers. + Client_Message_Receiver'Class; + Id : LSP.Structures.Integer_Or_Virtual_String; + Error : in out LSP.Errors.ResponseError_Optional) is use LAL_Refactor; function To_LSP_Diagnostic (Problem : LAL_Refactor.Refactoring_Diagnostic'Class; Error_Msg : String) - return LSP.Messages.Diagnostic; + return LSP.Structures.Diagnostic; ----------------------- -- To_LSP_Diagnostic -- @@ -51,28 +55,28 @@ package body LSP.Ada_Handlers.Refactor is function To_LSP_Diagnostic (Problem : LAL_Refactor.Refactoring_Diagnostic'Class; Error_Msg : String) - return LSP.Messages.Diagnostic + return LSP.Structures.Diagnostic is - Diagnostic : LSP.Messages.Diagnostic; + Diagnostic : LSP.Structures.Diagnostic; begin - Diagnostic := LSP.Messages.Diagnostic' - (span => LSP.Lal_Utils.To_Span (Problem.Location), - severity => (True, LSP.Messages.Error), + Diagnostic := LSP.Structures.Diagnostic' + (a_range => LSP.Utils.To_Range (Problem.Location), + severity => (True, LSP.Enumerations.Error), code => <>, codeDescription => <>, - source => - (True, VSS.Strings.Conversions.To_Virtual_String ("Ada")), + source => VSS.Strings.Conversions.To_Virtual_String + ("Ada"), message => VSS.Strings.Conversions.To_Virtual_String (Error_Msg), tags => <>, - relatedInformation => <>); + relatedInformation => <>, + data => <>); Diagnostic.relatedInformation.Append - (LSP.Messages.DiagnosticRelatedInformation'( - location => LSP.Messages.Location' - (uri => File_To_URI (Problem.Filename), - span => Lal_Utils.To_Span (Problem.Location), - alsKind => <>), + (LSP.Structures.DiagnosticRelatedInformation'( + location => LSP.Structures.Location' + (uri => To_DocumentUri (Problem.Filename), + a_range => LSP.Utils.To_Range (Problem.Location)), message => VSS.Strings.Conversions.To_Virtual_String (Problem.Info))); @@ -86,14 +90,14 @@ package body LSP.Ada_Handlers.Refactor is & " refactoring."; Message_Handler : LSP.Ada_Handlers.Message_Handler renames LSP.Ada_Handlers.Message_Handler (Handler.all); - Apply : Client_Requests.Workspace_Apply_Edit_Request; - Workspace_Edits : WorkspaceEdit renames Apply.params.edit; - Label : Optional_Virtual_String renames Apply.params.label; + Apply : LSP.Structures.ApplyWorkspaceEditParams; + Workspace_Edits : LSP.Structures.WorkspaceEdit renames Apply.edit; + Label : Virtual_String_Optional renames Apply.label; Edits : LAL_Refactor.Refactoring_Edits; begin LSP.Ada_Handlers.Refactor.Command'Class (Self).Refactor (Handler => Handler, - Client => Client, + Sender => Sender, Edits => Edits); -- The refactoring failed to compute edits: send an error response @@ -102,39 +106,38 @@ package body LSP.Ada_Handlers.Refactor is Error := (Is_Set => True, Value => - (code => LSP.Errors.UnknownErrorCode, + (code => LSP.Enumerations.UnknownErrorCode, message => VSS.Strings.Conversions.To_Virtual_String - (Error_Msg), - data => <>)); + (Error_Msg))); -- Publish the diagnostics when we have some if not Edits.Diagnostics.Is_Empty then declare - Diagnostic : LSP.Messages.Diagnostic; - Diagnostics : LSP.Messages.Diagnostic_Vector; - URI : LSP.Types.LSP_URI := To_LSP_URI (""); + Diagnostic : LSP.Structures.Diagnostic; + Diagnostics : LSP.Structures.Diagnostic_Vector; + URI : LSP.Structures.DocumentUri := To_DocumentUri (""); Document : Document_Access; Idx : Integer := 1; begin for Problem of Edits.Diagnostics loop Document := Get_Open_Document - (Self => Message_Handler'Access, - URI => File_To_URI (Problem.Filename), + (Self => Message_Handler, + URI => To_DocumentUri (Problem.Filename), Force => False); -- Publish any processed diagnostic when switching to a -- different file. if not Diagnostics.Is_Empty - and then To_UTF_8_String (URI) /= Problem.Filename + and then URI /= To_DocumentUri (Problem.Filename) then Publish_Diagnostics - (Self => Message_Handler'Access, + (Self => Message_Handler, Document => Document, Other_Diagnostics => Diagnostics, Force => True); end if; - URI := File_To_URI (Problem.Filename); + URI := To_DocumentUri (Problem.Filename); Diagnostic := To_LSP_Diagnostic (Problem, Error_Msg); Diagnostics.Append (Diagnostic); @@ -142,7 +145,7 @@ package body LSP.Ada_Handlers.Refactor is -- publish all the LSP diagnostics we have. if Idx = Integer (Edits.Diagnostics.Length) then Publish_Diagnostics - (Self => Message_Handler'Access, + (Self => Message_Handler, Document => Document, Other_Diagnostics => Diagnostics, Force => True); @@ -154,30 +157,24 @@ package body LSP.Ada_Handlers.Refactor is end if; else -- Apply the computed refactoring edits - Workspace_Edits := - LSP.Lal_Utils.To_Workspace_Edit - (Edits => Edits, - Resource_Operations => Message_Handler.Resource_Operations, - Versioned_Documents => Message_Handler.Versioned_Documents, - Document_Provider => Message_Handler'Access, - Rename => True); - Label := - (Is_Set => True, - Value => VSS.Strings.Conversions.To_Virtual_String (Name)); + Workspace_Edits := To_Workspace_Edit + (Self => Message_Handler, + Edits => Edits, + Rename => True); + Label := VSS.Strings.Conversions.To_Virtual_String (Name); - Client.On_Workspace_Apply_Edit_Request (Apply); + Sender.On_ApplyEdit_Request (Id, Apply); end if; exception when E : others => - LSP.Common.Log (Message_Handler.Trace, E); + Message_Handler.Tracer.Trace_Exception (E); Error := (Is_Set => True, Value => - (code => LSP.Errors.UnknownErrorCode, + (code => LSP.Enumerations.UnknownErrorCode, message => VSS.Strings.Conversions.To_Virtual_String - (Error_Msg), - data => <>)); + (Error_Msg))); end Execute; end LSP.Ada_Handlers.Refactor; diff --git a/source/ada/lsp-ada_handlers-refactor.ads b/source/ada/lsp-ada_handlers-refactor.ads index e17fb7ed4..2a5548c34 100644 --- a/source/ada/lsp-ada_handlers-refactor.ads +++ b/source/ada/lsp-ada_handlers-refactor.ads @@ -1,7 +1,7 @@ ------------------------------------------------------------------------------ -- Language Server Protocol -- -- -- --- Copyright (C) 2018-2021, AdaCore -- +-- Copyright (C) 2018-2023, AdaCore -- -- -- -- This is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -18,6 +18,7 @@ -- Base package for all the refactoring commands available via the ALS with LAL_Refactor; + with LSP.Client_Message_Receivers; with LSP.Commands; with LSP.Errors; @@ -32,16 +33,17 @@ package LSP.Ada_Handlers.Refactor is (Self : Command; Handler : not null access LSP.Server_Notification_Receivers.Server_Notification_Receiver'Class; - Client : not null access - LSP.Client_Message_Receivers.Client_Message_Receiver'Class; - Error : in out LSP.Errors.Optional_ResponseError); + Sender : not null access LSP.Client_Message_Receivers. + Client_Message_Receiver'Class; + Id : LSP.Structures.Integer_Or_Virtual_String; + Error : in out LSP.Errors.ResponseError_Optional); procedure Refactor (Self : Command; Handler : not null access LSP.Server_Notification_Receivers.Server_Notification_Receiver'Class; - Client : not null access - LSP.Client_Message_Receivers.Client_Message_Receiver'Class; + Sender : not null access LSP.Client_Message_Receivers + .Client_Message_Receiver'Class; Edits : out LAL_Refactor.Refactoring_Edits) is abstract; -- Abstract procedure used to compute the refactoring edits. diff --git a/source/ada/lsp-ada_handlers.adb b/source/ada/lsp-ada_handlers.adb index f24ac38dd..598be0a9e 100644 --- a/source/ada/lsp-ada_handlers.adb +++ b/source/ada/lsp-ada_handlers.adb @@ -25,14 +25,27 @@ with GNATCOLL.Traces; with VSS.Strings.Formatters.Integers; with VSS.Strings.Formatters.Strings; with VSS.Strings.Templates; +with VSS.JSON.Streams; with Libadalang.Analysis; with Libadalang.Common; +with Libadalang.Helpers; with Laltools.Common; with Langkit_Support.Slocs; +with LAL_Refactor.Extract_Subprogram; +with LAL_Refactor.Introduce_Parameter; +with LAL_Refactor.Pull_Up_Declaration; +with LAL_Refactor.Refactor_Imports; +with LAL_Refactor.Replace_Type; +with LAL_Refactor.Sort_Dependencies; +with LAL_Refactor.Subprogram_Signature.Change_Parameters_Default_Value; +with LAL_Refactor.Subprogram_Signature.Change_Parameters_Type; +with LAL_Refactor.Subprogram_Signature.Remove_Parameter; +with LAL_Refactor.Suppress_Separate; + with LSP.Ada_Completions; with LSP.Ada_Completions.Aspects; with LSP.Ada_Completions.Attributes; @@ -46,14 +59,30 @@ with LSP.Ada_Contexts; with LSP.Ada_Handlers.Call_Hierarchy; with LSP.Ada_Handlers.Invisibles; with LSP.Ada_Handlers.Locations; +with LSP.Ada_Handlers.Named_Parameters_Commands; with LSP.Ada_Handlers.Project_Diagnostics; with LSP.Ada_Handlers.Project_Loading; +with LSP.Ada_Handlers.Refactor.Add_Parameter; +with LSP.Ada_Handlers.Refactor.Change_Parameters_Default_Value; +with LSP.Ada_Handlers.Refactor.Change_Parameter_Mode; +with LSP.Ada_Handlers.Refactor.Change_Parameters_Type; +with LSP.Ada_Handlers.Refactor.Extract_Subprogram; +with LSP.Ada_Handlers.Refactor.Imports_Commands; +with LSP.Ada_Handlers.Refactor.Introduce_Parameter; +with LSP.Ada_Handlers.Refactor.Move_Parameter; +with LSP.Ada_Handlers.Refactor.Pull_Up_Declaration; +with LSP.Ada_Handlers.Refactor.Remove_Parameter; +with LSP.Ada_Handlers.Refactor.Replace_Type; +with LSP.Ada_Handlers.Refactor.Sort_Dependencies; +with LSP.Ada_Handlers.Refactor.Suppress_Seperate; with LSP.Diagnostic_Sources; with LSP.Enumerations; with LSP.Generic_Cancel_Check; with LSP.GNATCOLL_Tracers.Handle; with LSP.Server_Notifications.DidChange; with LSP.Servers; + +with LSP.Constants; with LSP.Utils; package body LSP.Ada_Handlers is @@ -78,18 +107,6 @@ package body LSP.Ada_Handlers is -- project tree, or is a runtime file for this project. If the file -- is not known to any project, return an empty list. - procedure Publish_Diagnostics - (Self : in out Message_Handler'Class; - Document : not null LSP.Ada_Documents.Document_Access; - Other_Diagnostics : LSP.Structures.Diagnostic_Vector := - LSP.Structures.Empty; - Force : Boolean := False); - -- Publish diagnostic messages for given document if needed. - -- Other_Diagnostics can be used to specify punctual diagnostics not coming - -- from sources that analyze files when being opened or modified. - -- When Force is True, the diagnostics will always be sent, not matter if - -- they have changed or not. - procedure Clean_Diagnostics (Self : in out Message_Handler'Class; Document : not null LSP.Ada_Documents.Document_Access); @@ -296,6 +313,37 @@ package body LSP.Ada_Handlers is (Self : Message_Handler'Class) return Project_Stamp is (Self.Project_Stamp); + ------------------------------- + -- Get_Open_Document_Version -- + ------------------------------- + + function Get_Open_Document_Version + (Self : in out Message_Handler; + URI : LSP.Structures.DocumentUri) + return LSP.Structures.OptionalVersionedTextDocumentIdentifier + is + use type LSP.Ada_Documents.Document_Access; + Document : constant LSP.Ada_Documents.Document_Access := + Self.Get_Open_Document (URI); + + begin + -- If the target textDocument hasn't been opened in the editor + -- then ALS hasn't received an open notification before. Therefore + -- Target_Text_Document will be null. + -- In that case, its VersionedTextDocumentIdentifier.version will + -- be null. + + if Document = null then + return (URI, LSP.Structures.Integer_Or_Null'(Is_Null => True)); + + else + return + (uri => Document.Versioned_Identifier.uri, + version => (Is_Null => False, + Value => Document.Versioned_Identifier.version)); + end if; + end Get_Open_Document_Version; + ---------------------------- -- Imprecise_Resolve_Name -- ---------------------------- @@ -382,6 +430,1064 @@ package body LSP.Ada_Handlers is Self.Tracer.Trace ("Out Message_Handler " & Name); end Log_Method_Out; + --------------------------- + -- On_CodeAction_Request -- + --------------------------- + + overriding procedure On_CodeAction_Request + (Self : in out Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CodeActionParams) + is + + use Libadalang.Common; + + procedure Analyse_In_Context + (Context : LSP.Ada_Context_Sets.Context_Access; + Document : LSP.Ada_Documents.Document_Access; + Result : out LSP.Structures.Command_Or_CodeAction_Vector; + Found : in out Boolean); + -- Perform refactoring ananlysis given Document in the Context. + -- Return Found = True if some refactoring is possible. Populate + -- Result with Code_Actions in this case. + + function Has_Assoc_Without_Designator + (Node : Libadalang.Analysis.Basic_Assoc_List) return Boolean; + -- Check if Node is Basic_Assoc_List that contains at least one + -- ParamAssoc without a designator. + + procedure Analyse_Node + (Context : LSP.Ada_Context_Sets.Context_Access; + Node : Libadalang.Analysis.Ada_Node; + Result : out LSP.Structures.Command_Or_CodeAction_Vector; + Found : in out Boolean); + -- Look for a possible refactoring in given Node. + -- Return Found = True if some refactoring is possible. Populate + -- Result with Code_Actions in this case. Return Done = True if futher + -- analysis has no sense. + + procedure Append_Project_Status_Code_Actions + (Result : in out LSP.Structures.Command_Or_CodeAction_Vector); + -- Append project status code action if needed + + ------------------------ + -- Analyse_In_Context -- + ------------------------ + + procedure Analyse_In_Context + (Context : LSP.Ada_Context_Sets.Context_Access; + Document : LSP.Ada_Documents.Document_Access; + Result : out LSP.Structures.Command_Or_CodeAction_Vector; + Found : in out Boolean) + is + Node : constant Libadalang.Analysis.Ada_Node := + Document.Get_Node_At (Context.all, Value.a_range.start); + begin + if Node.Is_Null then + Found := False; + return; + end if; + + Analyse_Node (Context, Node, Result, Found); + end Analyse_In_Context; + + ------------------ + -- Analyse_Node -- + ------------------ + + procedure Analyse_Node + (Context : LSP.Ada_Context_Sets.Context_Access; + Node : Libadalang.Analysis.Ada_Node; + Result : out LSP.Structures.Command_Or_CodeAction_Vector; + Found : in out Boolean) + is + procedure Change_Parameters_Type_Code_Action; + -- Checks if the Change Parameters Type refactoring tool is avaiable, + -- and if so, appends a Code Action with its Command. + + procedure Change_Parameters_Default_Value_Code_Action; + -- Checks if the Change Parameters Default Value refactoring tool is + -- avaiable, and if so, appends a Code Action with its Command. + + procedure Extract_Subprogram_Code_Action; + -- Checks if the Extract Subprogram refactoring tool is available, + -- and if so, appends a Code Action with its Command. + + procedure Introduce_Parameter_Code_Action; + -- Checks if the Introduce Parameter refactoring tool is available, + -- and if so, appends a Code Action with its Command. + + procedure Import_Package_Code_Action; + -- Checks if the Import Package code assist is available, + -- and if so, appends a Code Aciton with its Command. + + procedure Named_Parameters_Code_Action; + -- Checks if the Named Parameters refactoring is available, and if + -- so, appends a Code Action with its Command. + + procedure Pull_Up_Declaration_Code_Action; + -- Checks if the Pull Up Declaration refactoring tool is available, + -- and if so, appends a Code Action with its Command. + + procedure Replace_Type_Code_Action; + -- Checks if the Replace Type refactoring tool is available, + -- and if so, appends a Code Action with its Command. + + procedure Sort_Dependencies_Code_Action; + -- Checks if the Sort Dependencies refactoring tool is available, + -- and if so, appends a Code Action with its Command. + + ------------------------------------------------- + -- Change_Parameters_Default_Value_Code_Action -- + ------------------------------------------------- + + procedure Change_Parameters_Default_Value_Code_Action is + use Langkit_Support.Slocs; + use LAL_Refactor.Subprogram_Signature. + Change_Parameters_Default_Value; + use LSP.Ada_Handlers.Refactor.Change_Parameters_Default_Value; + + Span : constant Source_Location_Range := + (Langkit_Support.Slocs.Line_Number + (Value.a_range.start.line) + 1, + Langkit_Support.Slocs.Line_Number + (Value.a_range.an_end.line) + 1, + Column_Number (Value.a_range.start.character) + 1, + Column_Number (Value.a_range.an_end.character) + 1); + + Change_Parameters_Default_Value_Command : Command; + + begin + if Is_Change_Parameters_Default_Value_Available + (Unit => Node.Unit, + Parameters_Source_Location_Range => Span) + then + Change_Parameters_Default_Value_Command.Append_Code_Action + (Context => Context, + Commands_Vector => Result, + Where => + (uri => Value.textDocument.uri, + a_range => Value.a_range)); + + Found := True; + end if; + end Change_Parameters_Default_Value_Code_Action; + + ---------------------------------------- + -- Change_Parameters_Type_Code_Action -- + ---------------------------------------- + + procedure Change_Parameters_Type_Code_Action is + use Langkit_Support.Slocs; + use LAL_Refactor.Subprogram_Signature.Change_Parameters_Type; + use LSP.Ada_Handlers.Refactor.Change_Parameters_Type; + + Span : constant Source_Location_Range := + (Langkit_Support.Slocs.Line_Number + (Value.a_range.start.line) + 1, + Langkit_Support.Slocs.Line_Number + (Value.a_range.an_end.line) + 1, + Column_Number (Value.a_range.start.character) + 1, + Column_Number (Value.a_range.an_end.character) + 1); + + Syntax_Rules : Laltools.Common.Grammar_Rule_Vector; + + Change_Parameters_Type_Command : Command; + + begin + if Is_Change_Parameters_Type_Available + (Unit => Node.Unit, + Parameters_Source_Location_Range => Span, + New_Parameter_Syntax_Rules => Syntax_Rules) + then + Change_Parameters_Type_Command.Append_Code_Action + (Context => Context, + Commands_Vector => Result, + Where => + (uri => Value.textDocument.uri, + a_range => Value.a_range), + Syntax_Rules => Syntax_Rules); + + Found := True; + end if; + end Change_Parameters_Type_Code_Action; + + ------------------------------------ + -- Extract_Subprogram_Code_Action -- + ------------------------------------ + + procedure Extract_Subprogram_Code_Action is + use LSP.Ada_Handlers.Refactor.Extract_Subprogram; + use Langkit_Support.Slocs; + use LAL_Refactor.Extract_Subprogram; + use type LSP.Structures.Position; + + Single_Location : constant Boolean := + Value.a_range.start = Value.a_range.an_end; + + Section_To_Extract_SLOC : constant Source_Location_Range := + (Langkit_Support.Slocs.Line_Number + (Value.a_range.start.line) + 1, + Langkit_Support.Slocs.Line_Number + (Value.a_range.an_end.line) + 1, + Column_Number (Value.a_range.start.character) + 1, + Column_Number (Value.a_range.an_end.character) + 1); + + Available_Subprogram_Kinds : Available_Subprogram_Kinds_Type; + + Extract_Subprogram_Command : Command; + + begin + if not Single_Location then + if Is_Extract_Subprogram_Available + (Node.Unit, + Section_To_Extract_SLOC, + Available_Subprogram_Kinds) + then + if Available_Subprogram_Kinds (Ada_Subp_Kind_Procedure) then + Extract_Subprogram_Command.Append_Code_Action + (Context => Context, + Commands_Vector => Result, + Where => + (Value.textDocument.uri, + Value.a_range), + Subprogram_Kind => Ada_Subp_Kind_Procedure); + end if; + + if Available_Subprogram_Kinds (Ada_Subp_Kind_Function) then + Extract_Subprogram_Command.Append_Code_Action + (Context => Context, + Commands_Vector => Result, + Where => + (Value.textDocument.uri, + Value.a_range), + Subprogram_Kind => Ada_Subp_Kind_Function); + end if; + + Found := True; + end if; + end if; + end Extract_Subprogram_Code_Action; + + -------------------------------- + -- Import_Package_Code_Action -- + -------------------------------- + + procedure Import_Package_Code_Action is + use Libadalang.Analysis; + use LAL_Refactor.Refactor_Imports; + use LSP.Structures; + + Single_Location : constant Boolean := + Value.a_range.start = Value.a_range.an_end; + + Units_Vector : Libadalang.Helpers.Unit_Vectors.Vector; + Units_Array : constant Analysis_Unit_Array := + Context.Analysis_Units; + + Import_Suggestions : Import_Suggestions_Vector.Vector; + + function Is_Import_Suggestions_Available + (This_Node : Ada_Node'Class) + return Boolean; + -- Checks if This_Node is a suitable node to get import + -- suggestions. A suitable node must be an identifier, non + -- defining and if it resolves, it must be to a declaration not + -- declared in the standard package. + -- This function also prepares Units_Vector with the right units + -- where suggestions should be searched for. + + ------------------------------------- + -- Is_Import_Suggestions_Available -- + ------------------------------------- + + function Is_Import_Suggestions_Available + (This_Node : Ada_Node'Class) + return Boolean + is + Aux_Node : Ada_Node := + (if This_Node.Is_Null then No_Ada_Node + else This_Node.As_Ada_Node); + Referenced_Definition : Defining_Name := No_Defining_Name; + + begin + -- Only get suggestions for Identifiers or Dotted_Names + if Aux_Node.Is_Null + or else Aux_Node.Kind not in + Ada_Identifier_Range | Ada_Dotted_Name_Range + then + return False; + end if; + + -- Get the full Dotted_Name if applicable + while not Aux_Node.Is_Null + and then not Aux_Node.Parent.Is_Null + and then Aux_Node.Parent.Kind in Ada_Dotted_Name_Range + loop + Aux_Node := Aux_Node.Parent; + end loop; + + -- Defining names do not need prefixes + if Aux_Node.Is_Null or else Aux_Node.As_Name.P_Is_Defining then + return False; + end if; + + Referenced_Definition := + Aux_Node.As_Name.P_Referenced_Defining_Name; + + -- Declarations in the standard package do not need prefixes + if not Referenced_Definition.Is_Null then + if Referenced_Definition.Unit = Node.P_Standard_Unit then + return False; + end if; + end if; + + if Referenced_Definition.Is_Null then + -- The name could not be resolved so a full search needs to + -- be done. + + for U of Units_Array loop + Units_Vector.Append (U); + end loop; + + -- Add runtime analysis units for this context + -- ??? If possible, this should be cached. + + for F in Self.Project_Predefined_Sources.Iterate loop + declare + VF : GNATCOLL.VFS.Virtual_File renames + LSP.Ada_File_Sets.File_Sets.Element (F); + begin + Units_Vector.Append + (Context.LAL_Context.Get_From_File + (VF.Display_Full_Name, + -- ??? What is the charset for predefined + -- files? + "")); + end; + end loop; + + else + -- Libadalang sometimes can resolve names that are not + -- withed. + -- For instance, with Ada.Text_IO, resolve + -- Ada.Text_IO.Put_Line, remove the Ada.Text_IO and then + -- resolve again Ada.Text_IO.Put_Line. Even though + -- Ada.Text_IO is no longer withed, Libadalang is still + -- able to resolve Put_Line. + -- For such cases, include only Referenced_Definition's + -- Analysis_Units and the tool will suggest the prefixes + -- (there can be more than one, for instance, when there + -- are nested packages. + Units_Vector.Append (Referenced_Definition.Unit); + end if; + + return True; + exception + when others => return False; + end Is_Import_Suggestions_Available; + + begin + if not Single_Location + or else not Is_Import_Suggestions_Available (Node) + then + return; + end if; + + -- Get suggestions for all reachable declarations. + -- Each suggestion contains a with clause and a + -- prefix. + + Import_Suggestions := + Get_Import_Suggestions (Node, Units_Vector); + + -- Create a new codeAction command for each suggestion + + for Suggestion of Import_Suggestions loop + declare + Command : LSP.Ada_Handlers.Refactor.Imports_Commands.Command; + begin + Command.Append_Suggestion + (Context => Context, + Where => + LSP.Utils.Get_Node_Location (Node), + Commands_Vector => Result, + Suggestion => Suggestion); + end; + end loop; + + if not Import_Suggestions.Is_Empty then + Found := True; + end if; + end Import_Package_Code_Action; + + ------------------------------------- + -- Introduce_Parameter_Code_Action -- + ------------------------------------- + + procedure Introduce_Parameter_Code_Action is + use Langkit_Support.Slocs; + use LAL_Refactor.Introduce_Parameter; + use LSP.Ada_Handlers.Refactor.Introduce_Parameter; + + Span : constant Source_Location_Range := + (Langkit_Support.Slocs.Line_Number + (Value.a_range.start.line) + 1, + Langkit_Support.Slocs.Line_Number + (Value.a_range.an_end.line) + 1, + Column_Number (Value.a_range.start.character) + 1, + Column_Number (Value.a_range.an_end.character) + 1); + + Introduce_Parameter_Command : Command; + + begin + if Is_Introduce_Parameter_Available + (Unit => Node.Unit, + SLOC_Range => Span) + then + Introduce_Parameter_Command.Append_Code_Action + (Context => Context, + Commands_Vector => Result, + Where => + (uri => Value.textDocument.uri, + a_range => Value.a_range)); + + Found := True; + end if; + end Introduce_Parameter_Code_Action; + + ---------------------------------- + -- Named_Parameters_Code_Action -- + ---------------------------------- + + procedure Named_Parameters_Code_Action is + Aux_Node : Libadalang.Analysis.Ada_Node := Node; + Done : Boolean := False; + -- We propose only one choice of Named_Parameters refactoring per + -- request. So, if a user clicks on `1` in `A (B (1))` we propose + -- the refactoring for B (1), but not for A (...) call. We + -- consider this as better user experience. + -- + -- This boolean filter to detect such refactoring duplication. + + procedure Append_Command (Node : Libadalang.Analysis.Ada_Node); + -- Contruct a command and append it to Result + + -------------------- + -- Append_Command -- + -------------------- + + procedure Append_Command (Node : Libadalang.Analysis.Ada_Node) is + use LSP.Ada_Handlers.Named_Parameters_Commands; + + Named_Parameters_Command : LSP.Ada_Handlers. + Named_Parameters_Commands.Command; + + begin + Named_Parameters_Command.Append_Suggestion + (Context => Context, + Commands_Vector => Result, + Where => LSP.Utils.Get_Node_Location (Node), + Versioned_Documents => Self.Client.Versioned_Documents); + + Done := True; + Found := True; + end Append_Command; + + begin + while not Done and then not Aux_Node.Is_Null loop + case Aux_Node.Kind is + when Libadalang.Common.Ada_Stmt + | Libadalang.Common.Ada_Basic_Decl => + + Done := True; + + when Libadalang.Common.Ada_Basic_Assoc_List => + if Has_Assoc_Without_Designator + (Aux_Node.As_Basic_Assoc_List) + then + Append_Command (Aux_Node); + end if; + + when Libadalang.Common.Ada_Call_Expr => + declare + List : constant Libadalang.Analysis.Ada_Node := + Aux_Node.As_Call_Expr.F_Suffix; + + begin + if not List.Is_Null + and then List.Kind in + Libadalang.Common.Ada_Basic_Assoc_List + and then Has_Assoc_Without_Designator + (List.As_Basic_Assoc_List) + then + Append_Command (List); + end if; + end; + when others => + null; + end case; + + Aux_Node := Aux_Node.Parent; + end loop; + end Named_Parameters_Code_Action; + + ------------------------------------- + -- Pull_Up_Declaration_Code_Action -- + ------------------------------------- + + procedure Pull_Up_Declaration_Code_Action is + use Langkit_Support.Slocs; + use Libadalang.Analysis; + use LAL_Refactor.Pull_Up_Declaration; + use LSP.Ada_Handlers.Refactor.Pull_Up_Declaration; + use LSP.Structures; + + -- This code action is not available when a range of text is + -- selected. + + Single_Location : constant Boolean := + Value.a_range.start = Value.a_range.an_end; + Location : constant Source_Location := + (Langkit_Support.Slocs.Line_Number + (Value.a_range.start.line) + 1, + Column_Number (Value.a_range.start.character) + 1); + + Pull_Up_Declaration_Command : + LSP.Ada_Handlers.Refactor.Pull_Up_Declaration.Command; + + begin + if Single_Location + and then Is_Pull_Up_Declaration_Available (Node.Unit, Location) + then + Pull_Up_Declaration_Command.Append_Code_Action + (Context => Context, + Commands_Vector => Result, + Where => + (uri => Value.textDocument.uri, + a_range => Value.a_range)); + + Found := True; + end if; + end Pull_Up_Declaration_Code_Action; + + ------------------------------ + -- Replace_Type_Code_Action -- + ------------------------------ + + procedure Replace_Type_Code_Action is + use LSP.Ada_Handlers.Refactor.Replace_Type; + use LAL_Refactor.Replace_Type; + + use Langkit_Support.Slocs; + + Location : constant Source_Location := + (Langkit_Support.Slocs.Line_Number + (Value.a_range.start.line) + 1, + Column_Number (Value.a_range.start.character) + 1); + + Replace_Type_Command : + LSP.Ada_Handlers.Refactor.Replace_Type.Command; + + begin + if Is_Replace_Type_Available (Node.Unit, Location) then + Replace_Type_Command.Append_Code_Action + (Context => Context, + Commands_Vector => Result, + Where => + (Value.textDocument.uri, + Value.a_range)); + + Found := True; + end if; + end Replace_Type_Code_Action; + + ----------------------------------- + -- Sort_Dependencies_Code_Action -- + ----------------------------------- + + procedure Sort_Dependencies_Code_Action is + use Langkit_Support.Slocs; + use Libadalang.Analysis; + use LAL_Refactor.Sort_Dependencies; + use LSP.Ada_Handlers.Refactor.Sort_Dependencies; + use LSP.Structures; + + Location : constant Source_Location := + (Langkit_Support.Slocs.Line_Number + (Value.a_range.start.line) + 1, + Column_Number (Value.a_range.start.character) + 1); + + Sort_Dependencies_Command : + LSP.Ada_Handlers.Refactor.Sort_Dependencies.Command; + + begin + if Is_Sort_Dependencies_Available (Node.Unit, Location) then + Sort_Dependencies_Command.Append_Code_Action + (Context => Context, + Commands_Vector => Result, + Where => + (uri => Value.textDocument.uri, + a_range => Value.a_range)); + + Found := True; + end if; + end Sort_Dependencies_Code_Action; + + begin + Named_Parameters_Code_Action; + + Sort_Dependencies_Code_Action; + + Import_Package_Code_Action; + + -- Refactoring Code Actions + + -- Extract Subprogram + Extract_Subprogram_Code_Action; + + -- Pull Up Declaration + Pull_Up_Declaration_Code_Action; + + -- These refactorings are only available for clients that can + -- provide user inputs: + -- - Add Parameter + -- - Change Parameters Type + -- - Change Parameters Default Value + + -- Add Parameter + if Self.Client.Refactoring_Add_Parameter then + declare + use LSP.Ada_Handlers.Refactor.Add_Parameter; + use Libadalang.Analysis; + use LAL_Refactor.Subprogram_Signature; + use Langkit_Support.Slocs; + use type LSP.Structures.Position; + + -- This code action is not available when a range of text is + -- selected. + + Single_Location : constant Boolean := + Value.a_range.start = Value.a_range.an_end; + Location : constant Source_Location := + (if Single_Location then + (Langkit_Support.Slocs.Line_Number + (Value.a_range.start.line) + 1, + Column_Number (Value.a_range.start.character) + 1) + else + No_Source_Location); + + Requires_Full_Specification : Boolean; + + Add_Parameter_Commad : Command; + + begin + if Single_Location + and then Is_Add_Parameter_Available + (Node.Unit, + Location, + Requires_Full_Specification) + then + Add_Parameter_Commad.Append_Code_Action + (Context => Context, + Commands_Vector => Result, + Where => + (Value.textDocument.uri, + Value.a_range), + Requires_Full_Specification => + Requires_Full_Specification); + + Found := True; + end if; + end; + end if; + + -- Change Parameters Type + if Self.Client.Refactoring_Change_Parameters_Type then + Change_Parameters_Type_Code_Action; + end if; + + -- Change Parameters Default Value + if Self.Client.Refactoring_Change_Parameters_Default_Value then + Change_Parameters_Default_Value_Code_Action; + end if; + + -- Remove Parameter + declare + use LSP.Ada_Handlers.Refactor.Remove_Parameter; + use Libadalang.Analysis; + use LAL_Refactor.Subprogram_Signature; + use LAL_Refactor.Subprogram_Signature.Remove_Parameter; + + Target_Subp : Basic_Decl := No_Basic_Decl; + Parameter_Indices_Range : Parameter_Indices_Range_Type; + Remove_Parameter_Command : Command; + + begin + if Is_Remove_Parameter_Available + (Node, Target_Subp, Parameter_Indices_Range) + then + Remove_Parameter_Command.Append_Code_Action + (Context => Context, + Commands_Vector => Result, + Target_Subp => Target_Subp, + Parameters_Indices => Parameter_Indices_Range); + + Found := True; + end if; + end; + + -- Move Parameter + declare + use LSP.Ada_Handlers.Refactor.Move_Parameter; + use Libadalang.Analysis; + use LAL_Refactor.Subprogram_Signature; + + Target_Subp : Basic_Decl := No_Basic_Decl; + Parameter_Index : Positive; + Move_Directions : Move_Direction_Availability_Type; + Move_Parameter_Command : Command; + + begin + if Is_Move_Parameter_Available + (Node, Target_Subp, Parameter_Index, Move_Directions) + then + for Direction in Move_Direction_Type loop + if Move_Directions (Direction) then + Move_Parameter_Command.Append_Code_Action + (Context => Context, + Commands_Vector => Result, + Target_Subp => Target_Subp, + Parameter_Index => Parameter_Index, + Move_Direction => Direction); + end if; + end loop; + + Found := True; + end if; + end; + + -- Change Parameter Mode + declare + use LSP.Ada_Handlers.Refactor.Change_Parameter_Mode; + use Libadalang.Analysis; + use LAL_Refactor.Subprogram_Signature; + + Target_Subp : Basic_Decl := No_Basic_Decl; + Target_Parameters_Indices : Parameter_Indices_Range_Type; + Mode_Alternatives : Mode_Alternatives_Type; + Change_Parameter_Mode_Command : Command; + + begin + if Is_Change_Mode_Available + (Node, Target_Subp, Target_Parameters_Indices, Mode_Alternatives) + then + for Alternative of Mode_Alternatives loop + Change_Parameter_Mode_Command.Append_Code_Action + (Context => Context, + Commands_Vector => Result, + Target_Subp => Target_Subp, + Parameters_Indices => Target_Parameters_Indices, + New_Mode => Alternative); + end loop; + + Found := True; + end if; + end; + + -- Introduce Parameter + Introduce_Parameter_Code_Action; + + -- Suppress Subprogram + declare + use LSP.Ada_Handlers.Refactor.Suppress_Seperate; + use Libadalang.Analysis; + use LAL_Refactor.Suppress_Separate; + + Target_Separate : Basic_Decl := No_Basic_Decl; + Suppress_Separate_Command : Command; + begin + if Is_Suppress_Separate_Available (Node, Target_Separate) then + Suppress_Separate_Command.Append_Code_Action + (Context => Context, + Commands_Vector => Result, + Target_Separate => Target_Separate); + + Found := True; + end if; + end; + + -- Replace Type + if Self.Client.Refactoring_Replace_Type then + Replace_Type_Code_Action; + end if; + end Analyse_Node; + + ---------------------------------------- + -- Append_Project_Status_Code_Actions -- + ---------------------------------------- + + procedure Append_Project_Status_Code_Actions + (Result : in out LSP.Structures.Command_Or_CodeAction_Vector) + is + use type VSS.Strings.Virtual_String; + + Diagnostics : LSP.Structures.Diagnostic_Vector; + + begin + for Item of Value.context.diagnostics loop + if Item.source = "project" then + Diagnostics.Append (Item); + end if; + end loop; + + case Self.Project_Status is + when Valid_Project_Configured | Alire_Project => + null; + when No_Runtime_Found => + -- TODO: Provide help with the compiler installation + null; + when Single_Project_Found | Multiple_Projects_Found => + declare + Item : LSP.Structures.CodeAction; + Command : LSP.Structures.Command; + Arg : constant VSS.JSON.Streams.JSON_Stream_Element := + VSS.JSON.Streams.JSON_Stream_Element' + (Kind => VSS.JSON.Streams.String_Value, + String_Value => "ada.projectFile"); + begin + Command.title := "Open settings for ada.projectFile"; + Command.command := "workbench.action.openSettings"; + Command.arguments.Append (Arg); + + Item := + (title => Command.title, + kind => (True, LSP.Enumerations.QuickFix), + diagnostics => Diagnostics, + disabled => (Is_Set => False), + edit => (Is_Set => False), + isPreferred => LSP.Constants.True, + command => (True, Command), + data => <>); + + Result.Append + (LSP.Structures.Command_Or_CodeAction' + (Is_Command => False, CodeAction => Item)); + end; + when No_Project_Found => + declare + Title : constant VSS.Strings.Virtual_String := + "Create a default project file (default.gpr)"; + URI : constant LSP.Structures.DocumentUri := + To_DocumentUri + (VSS.Strings.Conversions.To_Virtual_String + (GNATCOLL.VFS.Create_From_UTF8 + (VSS.Strings.Conversions.To_UTF_8_String + (Self.Client.Root)).Join + ("default.gpr").Display_Full_Name)); + + Create : constant LSP.Structures. + documentChanges_OfWorkspaceEdit_Item := + (Kind => LSP.Structures.create, + create => (uri => URI, + others => <>)); + + Text : constant LSP.Structures. + TextEdit_Or_AnnotatedTextEdit := + (Is_TextEdit => True, + TextEdit => + (a_range => ((0, 0), (0, 0)), + newText => "project Default is end Default;")); + Insert : LSP.Structures. + documentChanges_OfWorkspaceEdit_Item := + (LSP.Structures.Varian_1, + (textDocument => (uri => URI, others => <>), + edits => <>)); + + Item : LSP.Structures.CodeAction; + Edit : LSP.Structures.WorkspaceEdit; + begin + Insert.Varian_1.edits.Append (Text); + Edit.documentChanges.Append (Create); + Edit.documentChanges.Append (Insert); + Item := + (title => Title, + kind => (True, LSP.Enumerations.QuickFix), + diagnostics => Diagnostics, + disabled => (Is_Set => False), + edit => (True, Edit), + isPreferred => LSP.Constants.True, + command => (Is_Set => False), + data => <>); + + Result.Append + (LSP.Structures.Command_Or_CodeAction' + (Is_Command => False, CodeAction => Item)); + end; + when Invalid_Project_Configured => + null; + end case; + end Append_Project_Status_Code_Actions; + + ---------------------------------- + -- Has_Assoc_Without_Designator -- + ---------------------------------- + + function Has_Assoc_Without_Designator + (Node : Libadalang.Analysis.Basic_Assoc_List) return Boolean + is + Found : Boolean := False; + + function Process_Type_Expr + (TE : Libadalang.Analysis.Type_Expr) + return Boolean; + -- Returns True if TE is associated to an access of a subprogram + + ----------------------- + -- Process_Type_Expr -- + ----------------------- + + function Process_Type_Expr + (TE : Libadalang.Analysis.Type_Expr) + return Boolean + is + TD : Libadalang.Analysis.Base_Type_Decl; + -- If TE is not an anonymous type then we'll need to know its + -- declaration. + + begin + case TE.Kind is + when Ada_Subtype_Indication_Range => + TD := TE.As_Subtype_Indication.P_Designated_Type_Decl; + + if TD.Is_Null + or else not (TD.Kind in Ada_Type_Decl) + then + return False; + end if; + + case TD.As_Type_Decl.F_Type_Def.Kind is + when Ada_Access_To_Subp_Def_Range => + -- Confirmation that TD is an access to a subprogram + + return True; + + when Ada_Array_Type_Def_Range => + -- If TD is an array type, then it might be an array + -- of accesses to subprograms. Therefore, recursively + -- call Process_Type_Expr to check the type of the + -- components of the array. + + return Process_Type_Expr + (TD.As_Type_Decl.F_Type_Def.As_Array_Type_Def. + F_Component_Type.F_Type_Expr); + + when others => + return False; + end case; + + when Ada_Anonymous_Type_Range => + return TE.As_Anonymous_Type.F_Type_Decl.F_Type_Def.Kind in + Ada_Access_To_Subp_Def_Range; + + when others => + return False; + + end case; + end Process_Type_Expr; + + begin + for J of Node loop + if J.Kind in Libadalang.Common.Ada_Param_Assoc and then + J.As_Param_Assoc.F_Designator.Is_Null + then + Found := True; + exit; + end if; + end loop; + + if not Found then + return False; + end if; + + declare + Expr : constant Libadalang.Analysis.Ada_Node := Node.Parent; + Name : Libadalang.Analysis.Name; + Decl : Libadalang.Analysis.Basic_Decl; + begin + case Expr.Kind is + when Libadalang.Common.Ada_Call_Expr => + Name := Expr.As_Call_Expr.F_Name; + when others => + return False; + end case; + + Decl := Name.P_Referenced_Decl; + + if Decl.Is_Null then + return False; + end if; + + -- For Ada_Param_Spec, Ada_Component_Decl or Object_Decl nodes, + -- check the type definition of Decl. Named parameters can be + -- added if Decl's type is a (possibly anonymous) access to a + -- subprogram. + + case Decl.Kind is + when Libadalang.Common.Ada_Base_Subp_Body + | Libadalang.Common.Ada_Basic_Subp_Decl => + return True; + + when Libadalang.Common.Ada_Param_Spec_Range => + return Process_Type_Expr (Decl.As_Param_Spec.F_Type_Expr); + + when Libadalang.Common.Ada_Component_Decl_Range => + return Process_Type_Expr + (Decl.As_Component_Decl.F_Component_Def.F_Type_Expr); + + when Libadalang.Common.Ada_Object_Decl_Range => + -- This can either be an object which type is an access + -- to a subprogram or an array of accesses to + -- subprograms. + return Process_Type_Expr (Decl.As_Object_Decl.F_Type_Expr); + + when others => + return False; + end case; + end; + end Has_Assoc_Without_Designator; + + use type LSP.Ada_Documents.Document_Access; + use type LSP.Structures.Position; + + Document : constant LSP.Ada_Documents.Document_Access := + Get_Open_Document (Self, Value.textDocument.uri); + + Response : LSP.Structures.Command_Or_CodeAction_Vector_Or_Null; + + Found : Boolean := False; + begin + if Document = null then + Self.Tracer.Trace + ("Unexpected null document in On_CodeAction_Request"); + Self.Sender.On_CodeAction_Response (Id, Response); + return; + end if; + + -- Find any context where we can do some refactoring + for C of Self.Contexts_For_URI (Value.textDocument.uri) loop + Analyse_In_Context (C, Document, Response, Found); + + exit when Self.Is_Canceled.all or else Found; + end loop; + + if Value.a_range.start = LSP.Constants.Empty then + Append_Project_Status_Code_Actions (Response); + end if; + + Self.Sender.On_CodeAction_Response (Id, Response); + end On_CodeAction_Request; + --------------------------- -- On_Completion_Request -- --------------------------- @@ -2127,4 +3233,174 @@ package body LSP.Ada_Handlers is end if; end Publish_Diagnostics; + ----------------------- + -- To_Workspace_Edit -- + ----------------------- + + function To_Workspace_Edit + (Self : in out Message_Handler'Class; + Edits : LAL_Refactor.Refactoring_Edits; + Rename : Boolean := False) + return LSP.Structures.WorkspaceEdit + is + File_URI : LSP.Structures.DocumentUri; + Text_Edits : LSP.Structures.TextEdit_Vector; + + use LAL_Refactor; + use LSP.Structures; + + Text_Edits_Cursor : Text_Edit_Ordered_Maps.Cursor := + Edits.Text_Edits.First; + File_Deletions_Cursor : Unbounded_String_Ordered_Sets.Cursor := + Edits.File_Deletions.First; + + function To_TextEdit + (E : LAL_Refactor.Text_Edit) + return LSP.Structures.TextEdit is + (LSP.Structures.TextEdit' + (LSP.Utils.To_Range (E.Location), + VSS.Strings.Conversions.To_Virtual_String (E.Text))); + + begin + return WE : LSP.Structures.WorkspaceEdit do + -- Text edits + + while Text_Edit_Ordered_Maps.Has_Element (Text_Edits_Cursor) loop + Text_Edits.Clear; + + for Edit of Text_Edit_Ordered_Maps.Element (Text_Edits_Cursor) loop + Text_Edits.Append (To_TextEdit (Edit)); + end loop; + + File_URI := To_DocumentUri + (VSS.Strings.Conversions.To_Virtual_String + (Text_Edit_Ordered_Maps.Key (Text_Edits_Cursor))); + + -- If `workspace.workspaceEdit.documentChanges` client capability + -- was true, then use `TextDocumentEdit[]` instead of + -- `TextEdit[]`. + + if Self.Client.Versioned_Documents then + declare + Annotaded_Edits : TextEdit_Or_AnnotatedTextEdit_Vector; + + begin + Annotaded_Edits.Reserve_Capacity (Text_Edits.Capacity); + for X of Text_Edits loop + Annotaded_Edits.Append + (TextEdit_Or_AnnotatedTextEdit' + (Is_TextEdit => False, + AnnotatedTextEdit => (X with annotationId => <>))); + end loop; + + WE.documentChanges.Append + (documentChanges_OfWorkspaceEdit_Item'( + (Kind => Varian_1, + Varian_1 => TextDocumentEdit' + (textDocument => Self.Get_Open_Document_Version + (File_URI), + edits => Annotaded_Edits)))); + end; + else + WE.changes.Insert (File_URI, Text_Edits); + end if; + + Text_Edit_Ordered_Maps.Next (Text_Edits_Cursor); + end loop; + + -- Resource operations are only supported if + -- `workspace.workspaceEdit.documentChanges` is True since they + -- must be sent in the `documentChanges` field. + -- `workspace.workspaceEdit.resourceOperations` client capability + -- must be checked in order to know which kind of operations are + -- supported. + + -- File creations + + if Self.Client.Versioned_Documents + and then Self.Client.Resource_Create_Supported + then + for File_Creation of Edits.File_Creations loop + WE.documentChanges.Append + (documentChanges_OfWorkspaceEdit_Item'( + (Kind => create, + create => CreateFile' + (uri => To_DocumentUri + (VSS.Strings.Conversions.To_Virtual_String + (File_Creation.Filepath)), + others => <>)))); + + declare + Annotaded_Edits : TextEdit_Or_AnnotatedTextEdit_Vector; + Content : constant TextEdit := TextEdit' + (a_range => ((0, 0), (0, 0)), + newText => + VSS.Strings.Conversions.To_Virtual_String + (File_Creation.Content)); + + begin + Annotaded_Edits.Append + (TextEdit_Or_AnnotatedTextEdit' + (Is_TextEdit => True, TextEdit => Content)); + + WE.documentChanges.Append + (documentChanges_OfWorkspaceEdit_Item'( + (Kind => Varian_1, + Varian_1 => TextDocumentEdit' + (edits => Annotaded_Edits, + others => <>)))); + end; + end loop; + end if; + + -- File deletions + + if Self.Client.Versioned_Documents + and then Self.Client.Resource_Delete_Supported + then + while Unbounded_String_Ordered_Sets.Has_Element + (File_Deletions_Cursor) + loop + File_URI := To_DocumentUri + (VSS.Strings.Conversions.To_Virtual_String + (Unbounded_String_Ordered_Sets.Element + (File_Deletions_Cursor))); + + WE.documentChanges.Append + (documentChanges_OfWorkspaceEdit_Item'( + (Kind => LSP.Structures.rename, + rename => RenameFile' + (oldUri => File_URI, + newUri => + (if Rename + then File_URI & ".bak" + else File_URI), + others => <>)))); + + Unbounded_String_Ordered_Sets.Next (File_Deletions_Cursor); + end loop; + end if; + + -- File renames + + if Self.Client.Versioned_Documents + and then Self.Client.Resource_Rename_Supported + then + for File_Rename of Edits.File_Renames loop + WE.documentChanges.Append + (documentChanges_OfWorkspaceEdit_Item'( + (Kind => LSP.Structures.rename, + rename => RenameFile' + (oldUri => To_DocumentUri + (VSS.Strings.Conversions.To_Virtual_String + (File_Rename.Filepath)), + newUri => To_DocumentUri + (VSS.Strings.Conversions.To_Virtual_String + (File_Rename.New_Name)), + others => <>)))); + end loop; + end if; + end return; + end To_Workspace_Edit; + end LSP.Ada_Handlers; diff --git a/source/ada/lsp-ada_handlers.ads b/source/ada/lsp-ada_handlers.ads index f5922f359..1c292f8a3 100644 --- a/source/ada/lsp-ada_handlers.ads +++ b/source/ada/lsp-ada_handlers.ads @@ -46,6 +46,8 @@ with LSP.Unimplemented_Handlers; with URIs; +private with LAL_Refactor; + package LSP.Ada_Handlers is type Message_Handler @@ -111,6 +113,14 @@ package LSP.Ada_Handlers is -- Return stamp of the state of the project. Stamp is changed each time -- project is (re)loaded. + function Get_Open_Document_Version + (Self : in out Message_Handler; + URI : LSP.Structures.DocumentUri) + return LSP.Structures.OptionalVersionedTextDocumentIdentifier; + -- Return the version of an open document for the given URI. + -- If the document is not opened, then it returns a + -- OptionalVersionedTextDocumentIdentifier with a null version. + private type Load_Project_Status is @@ -343,6 +353,23 @@ private Id : LSP.Structures.Integer_Or_Virtual_String; Value : LSP.Structures.TypeDefinitionParams); + overriding procedure On_CodeAction_Request + (Self : in out Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CodeActionParams); + + procedure Publish_Diagnostics + (Self : in out Message_Handler'Class; + Document : not null LSP.Ada_Documents.Document_Access; + Other_Diagnostics : LSP.Structures.Diagnostic_Vector := + LSP.Structures.Empty; + Force : Boolean := False); + -- Publish diagnostic messages for given document if needed. + -- Other_Diagnostics can be used to specify punctual diagnostics not coming + -- from sources that analyze files when being opened or modified. + -- When Force is True, the diagnostics will always be sent, not matter if + -- they have changed or not. + function To_File (Self : Message_Handler'Class; URI : LSP.Structures.DocumentUri) return GNATCOLL.VFS.Virtual_File @@ -352,4 +379,12 @@ private (VSS.Strings.Conversions.To_UTF_8_String (URI), Normalize => Self.Configuration.Follow_Symlinks))); + function To_Workspace_Edit + (Self : in out Message_Handler'Class; + Edits : LAL_Refactor.Refactoring_Edits; + Rename : Boolean := False) + return LSP.Structures.WorkspaceEdit; + -- Converts a Refactoring_Edits into a WorkspaceEdit. The Rename flag + -- controls if files that are supposed to be deleted, are renamed instead. + end LSP.Ada_Handlers; diff --git a/source/ada/lsp-lal_utils.adb b/source/ada/lsp-lal_utils.adb index f200d3b61..e43da96cb 100644 --- a/source/ada/lsp-lal_utils.adb +++ b/source/ada/lsp-lal_utils.adb @@ -245,34 +245,6 @@ package body LSP.Lal_Utils is Result := New_Result; end Sort_And_Remove_Duplicates; - ------------------ - -- Get_Location -- - ------------------ - - function Get_Location - (Unit : Libadalang.Analysis.Analysis_Unit; - Span : Langkit_Support.Slocs.Source_Location_Range; - Kind : LSP.Messages.AlsReferenceKind_Set := LSP.Messages.Empty_Set) - return LSP.Messages.Location is - begin - return - (uri => LSP.Types.File_To_URI (Unit.Get_Filename), - span => To_Span (Span), - alsKind => Kind); - end Get_Location; - - ----------------------- - -- Get_Node_Location -- - ----------------------- - - function Get_Node_Location - (Node : Libadalang.Analysis.Ada_Node'Class; - Kind : LSP.Messages.AlsReferenceKind_Set := LSP.Messages.Empty_Set) - return LSP.Messages.Location is - begin - return Get_Location (Node.Unit, Node.Sloc_Range, Kind); - end Get_Node_Location; - ------------------------ -- Get_Token_Location -- ------------------------ @@ -288,35 +260,6 @@ package body LSP.Lal_Utils is -- To_Span -- ------------- - function To_Span - (Value : Langkit_Support.Slocs.Source_Location_Range) - return LSP.Messages.Span - is - use type VSS.Unicode.UTF16_Code_Unit_Count; - use type Langkit_Support.Slocs.Source_Location_Range; - - Result : constant LSP.Messages.Span := - (if Value = Langkit_Support.Slocs.No_Source_Location_Range then - LSP.Messages.Empty_Span - else - (first => - (line => LSP.Types.Line_Number (Value.Start_Line) - 1, - character => LSP.Types.UTF_16_Index -- FIXME (UTF16 index)! - (Value.Start_Column) - 1), - last => - (line => LSP.Types.Line_Number (Value.End_Line) - 1, - character => LSP.Types.UTF_16_Index -- FIXME (UTF16 index)! - (Value.End_Column) - 1))); - -- XXX Code unit offset computation is incorrect here - - begin - return Result; - end To_Span; - - ------------- - -- To_Span -- - ------------- - function To_Span (Value : Langkit_Support.Slocs.Source_Location) return LSP.Messages.Span @@ -405,177 +348,6 @@ package body LSP.Lal_Utils is end return; end To_Workspace_Edit; - ----------------------- - -- To_Workspace_Edit -- - ----------------------- - - function To_Workspace_Edit - (Edits : LAL_Refactor.Refactoring_Edits; - Resource_Operations : LSP.Messages.Optional_ResourceOperationKindSet := - LSP.Messages.Optional_ResourceOperationKindSet'(Is_Set => False); - Versioned_Documents : Boolean := False; - Document_Provider : access LSP.Ada_Documents.Document_Provider'Class := - null; - Rename : Boolean := False) - return LSP.Messages.WorkspaceEdit - is - use type VSS.Strings.Virtual_String; - - File_URI : LSP.Types.LSP_URI; - - Text_Edits : LSP.Messages.TextEdit_Vector; - - use LAL_Refactor; - use LSP.Messages; - - Text_Edits_Cursor : Text_Edit_Ordered_Maps.Cursor - := Edits.Text_Edits.First; - File_Deletions_Cursor : Unbounded_String_Ordered_Sets.Cursor - := Edits.File_Deletions.First; - - Is_Create_Supported : constant Boolean := - Resource_Operations.Is_Set - and then ResourceOperationKindSets.Contains - (ResourceOperationKindSets.Set (Resource_Operations.Value), create); - Is_Rename_Supported : constant Boolean := - Resource_Operations.Is_Set - and then ResourceOperationKindSets.Contains - (ResourceOperationKindSets.Set (Resource_Operations.Value), - LSP.Messages.rename); - Is_Delete_Supported : constant Boolean := - Resource_Operations.Is_Set - and then ResourceOperationKindSets.Contains - (ResourceOperationKindSets.Set (Resource_Operations.Value), delete); - - begin - return WE : LSP.Messages.WorkspaceEdit do - -- Text edits - - while Text_Edit_Ordered_Maps.Has_Element (Text_Edits_Cursor) loop - Text_Edits.Clear; - - for Edit of Text_Edit_Ordered_Maps.Element (Text_Edits_Cursor) loop - Text_Edits.Append (To_TextEdit (Edit)); - end loop; - - File_URI := LSP.Types.File_To_URI - (Text_Edit_Ordered_Maps.Key (Text_Edits_Cursor)); - - -- If `workspace.workspaceEdit.documentChanges` client capability - -- was true, then use `TextDocumentEdit[]` instead of - -- `TextEdit[]`. - - if Versioned_Documents then - declare - Annotaded_Edits : LSP.Messages.AnnotatedTextEdit_Vector; - - begin - Annotaded_Edits.Reserve_Capacity (Text_Edits.Capacity); - for X of Text_Edits loop - Annotaded_Edits.Append - (LSP.Messages.AnnotatedTextEdit' - (X with annotationId => <>)); - end loop; - - WE.documentChanges.Append - (LSP.Messages.Document_Change'( - (Kind => LSP.Messages.Text_Document_Edit, - Text_Document_Edit => LSP.Messages.TextDocumentEdit' - (textDocument => Document_Provider. - Get_Open_Document_Version (File_URI), - edits => Annotaded_Edits)))); - end; - else - WE.changes.Insert (File_URI, Text_Edits); - end if; - - Text_Edit_Ordered_Maps.Next (Text_Edits_Cursor); - end loop; - - -- Resource operations are only supported if - -- `workspace.workspaceEdit.documentChanges` is True since they - -- must be sent in the `documentChanges` field. - -- `workspace.workspaceEdit.resourceOperations` client capability - -- must be checked in order to know which kind of operations are - -- supported. - - -- File creations - - if Versioned_Documents and then Is_Create_Supported then - for File_Creation of Edits.File_Creations loop - WE.documentChanges.Append - (LSP.Messages.Document_Change'( - (Kind => LSP.Messages.Create_File, - Create_File => LSP.Messages.CreateFile' - (uri => LSP.Types.File_To_URI (File_Creation.Filepath), - others => <>)))); - - declare - Annotaded_Edits : LSP.Messages.AnnotatedTextEdit_Vector; - Content : constant LSP.Messages.AnnotatedTextEdit := - LSP.Messages.AnnotatedTextEdit' - (span => ((0, 0), (0, 0)), - newText => - VSS.Strings.Conversions.To_Virtual_String - (File_Creation.Content), - others => <>); - - begin - Annotaded_Edits.Append (Content); - - WE.documentChanges.Append - (LSP.Messages.Document_Change'( - (Kind => LSP.Messages.Text_Document_Edit, - Text_Document_Edit => LSP.Messages.TextDocumentEdit' - (edits => Annotaded_Edits, - others => <>)))); - end; - end loop; - end if; - - -- File deletions - - if Versioned_Documents and then Is_Delete_Supported then - while Unbounded_String_Ordered_Sets.Has_Element - (File_Deletions_Cursor) - loop - - File_URI := LSP.Types.File_To_URI - (Unbounded_String_Ordered_Sets.Element - (File_Deletions_Cursor)); - - WE.documentChanges.Append - (LSP.Messages.Document_Change'( - (Kind => LSP.Messages.Rename_File, - Rename_File => LSP.Messages.RenameFile' - (oldUri => File_URI, - newUri => - (if Rename - then LSP.Types.To_LSP_URI - (LSP.Types.To_Virtual_String (File_URI) & ".bak") - else File_URI), - others => <>)))); - - Unbounded_String_Ordered_Sets.Next (File_Deletions_Cursor); - end loop; - end if; - - -- File renames - - if Versioned_Documents and then Is_Rename_Supported then - for File_Rename of Edits.File_Renames loop - WE.documentChanges.Append - (LSP.Messages.Document_Change'( - (Kind => LSP.Messages.Rename_File, - Rename_File => LSP.Messages.RenameFile' - (oldUri => LSP.Types.File_To_URI (File_Rename.Filepath), - newUri => LSP.Types.File_To_URI (File_Rename.New_Name), - others => <>)))); - end loop; - end if; - end return; - end To_Workspace_Edit; - ----------------------- -- Containing_Entity -- ----------------------- diff --git a/source/ada/lsp-lal_utils.ads b/source/ada/lsp-lal_utils.ads index 64bfad3c6..e5b657968 100644 --- a/source/ada/lsp-lal_utils.ads +++ b/source/ada/lsp-lal_utils.ads @@ -78,27 +78,6 @@ package LSP.Lal_Utils is (Result : in out LSP.Messages.Location_Vector); -- Sort Result and remove duplicates from it. - function Get_Location - (Unit : Libadalang.Analysis.Analysis_Unit; - Span : Langkit_Support.Slocs.Source_Location_Range; - Kind : LSP.Messages.AlsReferenceKind_Set := LSP.Messages.Empty_Set) - return LSP.Messages.Location; - -- Return the location in a unit. Populate alsKind field of the result with - -- given Kind. - -- XXX Please avoid use of this subprogram, it doesn't provide Document - -- to convert LAL's Source_Location_Range to LSP's Range. Consider to - -- use Document.To_LSP_Range instead, or add necessary wrapper. - - function Get_Node_Location - (Node : Libadalang.Analysis.Ada_Node'Class; - Kind : LSP.Messages.AlsReferenceKind_Set := LSP.Messages.Empty_Set) - return LSP.Messages.Location; - -- Return the location of the given node. Populate alsKind field of the - -- result with given Kind. - -- XXX Please avoid use of this subprogram, it doesn't provide Document - -- to convert LAL's Source_Location_Range to LSP's Range. Consider to - -- use Document.To_LSP_Range instead, or add necessary wrapper. - function Get_Token_Span (Token : Libadalang.Common.Token_Reference) return LSP.Messages.Span; @@ -107,14 +86,6 @@ package LSP.Lal_Utils is -- to convert LAL's Source_Location_Range to LSP's Range. Consider to -- use Document.To_LSP_Range instead, or add necessary wrapper. - function To_Span - (Value : Langkit_Support.Slocs.Source_Location_Range) - return LSP.Messages.Span; - -- Convert Source_Location_Range to Span - -- XXX Please avoid use of this subprogram, it doesn't provide Document - -- to convert LAL's Source_Location_Range to LSP's Range. Consider to - -- use Document.To_LSP_Range instead, or add necessary wrapper. - function To_Span (Value : Langkit_Support.Slocs.Source_Location) return LSP.Messages.Span; @@ -143,6 +114,7 @@ package LSP.Lal_Utils is with Pre => (if Versioned_Documents then Document_Provider /= null); -- Converts an Edit_Map into a WorkspaceEdit +<<<<<<< Updated upstream function To_Workspace_Edit (Edits : LAL_Refactor.Refactoring_Edits; Resource_Operations : LSP.Messages.Optional_ResourceOperationKindSet := @@ -154,6 +126,57 @@ package LSP.Lal_Utils is return LSP.Messages.WorkspaceEdit; -- Converts a Refactoring_Edits into a WorkspaceEdit. The Rename flag -- controls if files that are supposed to be deleted, are renamed instead. +======= + --------------- + -- Called_By -- + --------------- + + function Find_Incoming_Calls + (Context : LSP.Ada_Contexts.Context; + Definition : Defining_Name; + Imprecise_Results : out Boolean) + return Laltools.Common.References_By_Subprogram.Map + with Pre => Definition.P_Basic_Decl.P_Is_Subprogram; + -- Return the list of all the calls made to the subprogram pointed at by + -- the node given by Definition, organized by the subprograms in which + -- these calls are listed, ordered by the name of these subprograms. + -- Imprecise_Results is set to True if we don't know whether the results + -- are precise. + + function Find_Outgoing_Calls + (Context : LSP.Ada_Contexts.Context; + Definition : Defining_Name; + Imprecise_Results : out Boolean) + return Laltools.Common.References_By_Subprogram.Map + with Pre => Definition.P_Basic_Decl.P_Is_Subprogram; + -- Return the list of all the calls made in the subprogram pointed at by + -- the node given by Definition, organized by the subprograms in which + -- these calls are listed, ordered by the name of these subprograms. + -- Imprecise_Results is set to True if we don't know whether the results + -- are precise. + + -- function Is_Task + -- (Node : Ada_Node'Class; + -- Trace : GNATCOLL.Traces.Trace_Handle; + -- Imprecise : out Boolean) return Boolean; + -- TODO: Reactivate these lines when libadalang supports + -- P_Next_Part for tasks: T716-049 + + function To_Call_Hierarchy_Item + (Name : Libadalang.Analysis.Defining_Name) + return LSP.Messages.CallHierarchyItem; + -- Create CallHierarchyItem for the given subprogram + + procedure To_Call_Hierarchy_Result + (Node : Libadalang.Analysis.Defining_Name; + Refs : Laltools.Common.References_Sets.Set; + Item : out LSP.Messages.CallHierarchyItem; + Spans : out LSP.Messages.Span_Vector; + Kinds : out LSP.Messages.AlsReferenceKind_Vector); + -- Convert the given Node and the given references to it to the + -- corresponding CallHierarchyItem and its associated spans, which contains + -- the references. This should be used for the callHierarchy requests. +>>>>>>> Stashed changes function Containing_Entity (Ref : Ada_Node; diff --git a/source/ada/lsp-utils.adb b/source/ada/lsp-utils.adb index fe9570cd8..74fdd5198 100644 --- a/source/ada/lsp-utils.adb +++ b/source/ada/lsp-utils.adb @@ -27,6 +27,8 @@ with Langkit_Support.Symbols; with VSS.Strings.Conversions; with Laltools.Common; +with LSP.Constants; + package body LSP.Utils is ------------------ @@ -152,6 +154,33 @@ package body LSP.Utils is return LSP.Enumerations.A_Null; end Get_Decl_Kind; + ------------------ + -- Get_Location -- + ------------------ + + function Get_Location + (Unit : Libadalang.Analysis.Analysis_Unit; + Span : Langkit_Support.Slocs.Source_Location_Range) + return LSP.Structures.Location is + begin + return + (uri => + (VSS.Strings.Conversions.To_Virtual_String + (Unit.Get_Filename) with null record), + a_range => To_Range (Span)); + end Get_Location; + + ----------------------- + -- Get_Node_Location -- + ----------------------- + + function Get_Node_Location + (Node : Libadalang.Analysis.Ada_Node'Class) + return LSP.Structures.Location is + begin + return Get_Location (Node.Unit, Node.Sloc_Range); + end Get_Node_Location; + ------------------------- -- Node_Location_Image -- ------------------------- @@ -183,4 +212,32 @@ package body LSP.Utils is end return; end Node_Location_Image; + -------------- + -- To_Range -- + -------------- + + function To_Range + (Value : Langkit_Support.Slocs.Source_Location_Range) + return LSP.Structures.A_Range + is + use type Langkit_Support.Slocs.Source_Location_Range; + + Result : constant LSP.Structures.A_Range := + (if Value = Langkit_Support.Slocs.No_Source_Location_Range then + LSP.Constants.Empty + else + (start => + (line => Natural (Value.Start_Line) - 1, + character => Natural -- FIXME (UTF16 index)! + (Value.Start_Column) - 1), + an_end => + (line => Natural (Value.End_Line) - 1, + character => Natural -- FIXME (UTF16 index)! + (Value.End_Column) - 1))); + -- XXX Code unit offset computation is incorrect here + + begin + return Result; + end To_Range; + end LSP.Utils; diff --git a/source/ada/lsp-utils.ads b/source/ada/lsp-utils.ads index fbefe2cdd..80137402f 100644 --- a/source/ada/lsp-utils.ads +++ b/source/ada/lsp-utils.ads @@ -20,8 +20,10 @@ with VSS.Strings; with Libadalang.Analysis; +with Langkit_Support.Slocs; with LSP.Enumerations; +with LSP.Structures; package LSP.Utils is @@ -43,4 +45,29 @@ package LSP.Utils is -- When Ignore_Local it will return Is_Null for all local objects like -- variables. + function To_Range + (Value : Langkit_Support.Slocs.Source_Location_Range) + return LSP.Structures.A_Range; + -- Convert Source_Location_Range to A_Range + -- XXX Please avoid use of this subprogram, it doesn't provide Document + -- to convert LAL's Source_Location_Range to LSP's Range. Consider to + -- use Document.To_LSP_Range instead, or add necessary wrapper. + + function Get_Location + (Unit : Libadalang.Analysis.Analysis_Unit; + Span : Langkit_Support.Slocs.Source_Location_Range) + return LSP.Structures.Location; + -- Return the location in a unit. + -- XXX Please avoid use of this subprogram, it doesn't provide Document + -- to convert LAL's Source_Location_Range to LSP's Range. Consider to + -- use Document.To_LSP_Range instead, or add necessary wrapper. + + function Get_Node_Location + (Node : Libadalang.Analysis.Ada_Node'Class) + return LSP.Structures.Location; + -- Return the location of the given node. + -- XXX Please avoid use of this subprogram, it doesn't provide Document + -- to convert LAL's Source_Location_Range to LSP's Range. Consider to + -- use Document.To_LSP_Range instead, or add necessary wrapper. + end LSP.Utils; diff --git a/source/lsp_3.17/lsp-commands.adb b/source/lsp_3.17/lsp-commands.adb new file mode 100644 index 000000000..a4bcfc308 --- /dev/null +++ b/source/lsp_3.17/lsp-commands.adb @@ -0,0 +1,46 @@ +------------------------------------------------------------------------------ +-- Language Server Protocol -- +-- -- +-- Copyright (C) 2020-2023, AdaCore -- +-- -- +-- This is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 3, or (at your option) any later ver- -- +-- sion. This software is distributed in the hope that it will be useful, -- +-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- -- +-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -- +-- License for more details. You should have received a copy of the GNU -- +-- General Public License distributed with this software; see file -- +-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy -- +-- of the license. -- +------------------------------------------------------------------------------ + +with VSS.Strings.Conversions; + +package body LSP.Commands is + + Command_Name_List : VSS.String_Vectors.Virtual_String_Vector; + + -------------- + -- Register -- + -------------- + + procedure Register (Value : Ada.Tags.Tag) is + Name : constant VSS.Strings.Virtual_String := + VSS.Strings.Conversions.To_Virtual_String + (Ada.Tags.External_Tag (Value)); + + begin + Command_Name_List.Append (Name); + end Register; + + ------------------ + -- All_Commands -- + ------------------ + + function All_Commands return VSS.String_Vectors.Virtual_String_Vector is + begin + return Command_Name_List; + end All_Commands; + +end LSP.Commands; diff --git a/source/lsp_3.17/lsp-commands.ads b/source/lsp_3.17/lsp-commands.ads new file mode 100644 index 000000000..198f67c16 --- /dev/null +++ b/source/lsp_3.17/lsp-commands.ads @@ -0,0 +1,63 @@ +------------------------------------------------------------------------------ +-- Language Server Protocol -- +-- -- +-- Copyright (C) 2020-2023, AdaCore -- +-- -- +-- This is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 3, or (at your option) any later ver- -- +-- sion. This software is distributed in the hope that it will be useful, -- +-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- -- +-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -- +-- License for more details. You should have received a copy of the GNU -- +-- General Public License distributed with this software; see file -- +-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy -- +-- of the license. -- +------------------------------------------------------------------------------ +-- +-- This package provides a base class to implement custom commands. +-- The concrete LSP server provides the set of commands by inheriting from +-- this base class. Read_XXX procedures declared in LSP.Structures construct +-- corresponding object using generic dispatching constructor on the server +-- side. On the client side any command is an opaque object and will always be +-- represented as a JSON object. + +with Ada.Tags; + +with VSS.String_Vectors; + +with LSP.Structures; +with LSP.Errors; + +limited with LSP.Client_Message_Receivers; +limited with LSP.Server_Notification_Receivers; + +package LSP.Commands is + + type Command is abstract tagged null record; + type Command_Access is access all Command'Class with Storage_Size => 0; + + function Create + (Any : not null access LSP.Structures.LSPAny_Vector) + return Command is abstract; + + procedure Execute + (Self : Command; + Handler : not null access + LSP.Server_Notification_Receivers.Server_Notification_Receiver'Class; + Sender : not null access LSP.Client_Message_Receivers. + Client_Message_Receiver'Class; + Id : LSP.Structures.Integer_Or_Virtual_String; + Error : in out LSP.Errors.ResponseError_Optional) is abstract; + -- Execute given command and return Error is something went wrong. + -- Use Client object to send requests and notifications to the client. + -- Commands are executed on the server side only. + -- The Handler is the access to the message handler executing the command. + + procedure Register (Value : Ada.Tags.Tag); + -- Register a new command type. The type should be in Command'Class + + function All_Commands return VSS.String_Vectors.Virtual_String_Vector; + -- Return all registered command names. + +end LSP.Commands; diff --git a/source/lsp_3.17/lsp-constants.ads b/source/lsp_3.17/lsp-constants.ads index c741a6d83..d49886857 100644 --- a/source/lsp_3.17/lsp-constants.ads +++ b/source/lsp_3.17/lsp-constants.ads @@ -83,4 +83,12 @@ package LSP.Constants is function True return LSP.Structures.Boolean_Or_ReferenceOptions_Optional is (Is_Set => True, Value => True); + function Empty + return LSP.Structures.Position + is (line => 0, character => 0); + + function Empty + return LSP.Structures.A_Range + is (start => Empty, an_end => Empty); + end LSP.Constants; diff --git a/source/lsp_3.17/lsp-structures-lspany_vectors.adb b/source/lsp_3.17/lsp-structures-lspany_vectors.adb new file mode 100644 index 000000000..3c6fd081e --- /dev/null +++ b/source/lsp_3.17/lsp-structures-lspany_vectors.adb @@ -0,0 +1,418 @@ +-- +-- Copyright (C) 2022-2023, AdaCore +-- +-- SPDX-License-Identifier: Apache-2.0 +-- + +with Interfaces; + +package body LSP.Structures.LSPAny_Vectors is + + use VSS.JSON; + use VSS.JSON.Streams; + use VSS.Strings; + use LSP.Structures.JSON_Event_Vectors; + + ------------- + -- Add_Key -- + ------------- + + procedure Add_Key + (Key : VSS.Strings.Virtual_String; + Vector : in out LSPAny_Vector) is + begin + Vector.Append + (JSON_Stream_Element' + (Kind => Key_Name, + Key_Name => Key)); + end Add_Key; + + -------------- + -- From_Any -- + -------------- + + function From_Any + (Cursor : in out JSON_Event_Vectors.Cursor) + return Integer is + begin + return Integer (Element (Cursor).Number_Value.Integer_Value); + end From_Any; + + function From_Any + (Cursor : in out JSON_Event_Vectors.Cursor) + return Boolean is + begin + return Element (Cursor).Boolean_Value; + end From_Any; + + function From_Any + (Cursor : in out JSON_Event_Vectors.Cursor) + return DocumentUri is + begin + return (Element (Cursor).String_Value with null record); + end From_Any; + + function From_Any + (Cursor : in out JSON_Event_Vectors.Cursor) + return TextDocumentIdentifier + is + Result : TextDocumentIdentifier; + begin + pragma Assert (Element (Cursor).Kind = Start_Object); + Next (Cursor); + + while Has_Element (Cursor) + and then Element (Cursor).Kind /= End_Object + loop + pragma Assert (Element (Cursor).Kind = Key_Name); + + declare + Key : constant Virtual_String := Element (Cursor).Key_Name; + begin + Next (Cursor); + + if Key = "uri" then + Result.uri := From_Any (Cursor); + + else + Skip_Value (Cursor); + end if; + end; + Next (Cursor); + end loop; + Next (Cursor); + + return Result; + end From_Any; + + function From_Any + (Cursor : in out JSON_Event_Vectors.Cursor) + return Position + is + Result : Position; + begin + pragma Assert (Element (Cursor).Kind = Start_Object); + Next (Cursor); + + while Has_Element (Cursor) + and then Element (Cursor).Kind /= End_Object + loop + pragma Assert (Element (Cursor).Kind = Key_Name); + + declare + Key : constant Virtual_String := Element (Cursor).Key_Name; + begin + Next (Cursor); + + if Key = "line" then + Result.line := From_Any (Cursor); + + elsif Key = "character" then + Result.character := From_Any (Cursor); + + else + Skip_Value (Cursor); + end if; + end; + Next (Cursor); + end loop; + Next (Cursor); + + return Result; + end From_Any; + + function From_Any + (Cursor : in out LSP.Structures.JSON_Event_Vectors.Cursor) + return TextDocumentPositionParams + is + Result : TextDocumentPositionParams; + begin + pragma Assert (Element (Cursor).Kind = Start_Object); + Next (Cursor); + + while Has_Element (Cursor) + and then Element (Cursor).Kind /= End_Object + loop + pragma Assert (Element (Cursor).Kind = Key_Name); + + declare + Key : constant Virtual_String := Element (Cursor).Key_Name; + begin + Next (Cursor); + + if Key = "textDocument" then + Result.textDocument := From_Any (Cursor); + + elsif Key = "position" then + Result.position := From_Any (Cursor); + + else + Skip_Value (Cursor); + end if; + end; + Next (Cursor); + end loop; + Next (Cursor); + + return Result; + end From_Any; + + function From_Any + (Cursor : in out JSON_Event_Vectors.Cursor) + return A_Range + is + Result : A_Range; + begin + pragma Assert (Element (Cursor).Kind = Start_Object); + Next (Cursor); + + while Has_Element (Cursor) + and then Element (Cursor).Kind /= End_Object + loop + pragma Assert (Element (Cursor).Kind = Key_Name); + + declare + Key : constant Virtual_String := Element (Cursor).Key_Name; + begin + Next (Cursor); + + if Key = "start" then + Result.start := From_Any (Cursor); + + elsif Key = "end" then + Result.an_end := From_Any (Cursor); + + else + Skip_Value (Cursor); + end if; + end; + Next (Cursor); + end loop; + Next (Cursor); + + return Result; + end From_Any; + + function From_Any + (Cursor : in out JSON_Event_Vectors.Cursor) + return Location + is + Result : Location; + begin + pragma Assert (Element (Cursor).Kind = Start_Object); + Next (Cursor); + + while Has_Element (Cursor) + and then Element (Cursor).Kind /= End_Object + loop + pragma Assert (Element (Cursor).Kind = Key_Name); + + declare + Key : constant Virtual_String := Element (Cursor).Key_Name; + begin + Next (Cursor); + + if Key = "uri" then + Result.uri := From_Any (Cursor); + + elsif Key = "range" then + Result.a_range := From_Any (Cursor); + + else + Skip_Value (Cursor); + end if; + end; + + Next (Cursor); + end loop; + Next (Cursor); + + return Result; + end From_Any; + + function From_Any + (Cursor : in out JSON_Event_Vectors.Cursor) + return VSS.String_Vectors.Virtual_String_Vector + is + Result : VSS.String_Vectors.Virtual_String_Vector; + begin + pragma Assert (Element (Cursor).Kind = Start_Array); + Next (Cursor); + + while Has_Element (Cursor) + and then Element (Cursor).Kind /= End_Array + loop + Result.Append (Element (Cursor).String_Value); + Next (Cursor); + end loop; + Next (Cursor); + + return Result; + end From_Any; + + ---------------- + -- Skip_Value -- + ---------------- + + procedure Skip_Value + (Cursor : in out JSON_Event_Vectors.Cursor) + is + Count : Natural := 0; + begin + while Has_Element (Cursor) + and then Count > 0 + and then Element (Cursor).Kind /= Key_Name + and then Element (Cursor).Kind /= End_Object + loop + if Element (Cursor).Kind = Start_Object + or else Element (Cursor).Kind = Start_Array + then + Count := Count + 1; + + elsif Element (Cursor).Kind = End_Object + or else Element (Cursor).Kind = End_Array + then + Count := Count - 1; + end if; + + Next (Cursor); + end loop; + end Skip_Value; + + ------------ + -- To_Any -- + ------------ + + procedure To_Any + (Value : Integer; + Vector : in out LSPAny_Vector) is + begin + Vector.Append + (JSON_Stream_Element' + (Kind => Number_Value, + Number_Value => JSON_Number' + (Kind => JSON_Integer, + String_Value => <>, + Integer_Value => Interfaces.Integer_64 (Value)))); + end To_Any; + + procedure To_Any + (Value : Boolean; + Vector : in out LSPAny_Vector) is + begin + Vector.Append + (JSON_Stream_Element' + (Kind => Boolean_Value, + Boolean_Value => Value)); + end To_Any; + + procedure To_Any + (String : VSS.Strings.Virtual_String; + Vector : in out LSPAny_Vector) is + begin + Vector.Append + (JSON_Stream_Element' + (Kind => String_Value, + String_Value => String)); + end To_Any; + + procedure To_Any + (Self : DocumentUri; + Vector : in out LSPAny_Vector) is + begin + To_Any (VSS.Strings.Virtual_String (Self), Vector); + end To_Any; + + procedure To_Any + (Self : TextDocumentIdentifier; + Vector : in out LSPAny_Vector) is + begin + Vector.Append (JSON_Stream_Element'(Kind => Start_Object)); + + -- "uri" + Add_Key ("uri", Vector); + To_Any (Self.uri, Vector); + + Vector.Append (JSON_Stream_Element'(Kind => End_Object)); + end To_Any; + + procedure To_Any + (Self : Position; + Vector : in out LSPAny_Vector) is + begin + Vector.Append (JSON_Stream_Element'(Kind => Start_Object)); + + -- "line" + Add_Key ("line", Vector); + To_Any (Self.line, Vector); + + -- "character" + Add_Key ("character", Vector); + To_Any (Self.character, Vector); + + Vector.Append (JSON_Stream_Element'(Kind => End_Object)); + end To_Any; + + procedure To_Any + (Self : A_Range; + Vector : in out LSPAny_Vector) is + begin + Vector.Append (JSON_Stream_Element'(Kind => Start_Object)); + + -- "start" + Add_Key ("start", Vector); + To_Any (Self.start, Vector); + + -- "end" + Add_Key ("end", Vector); + To_Any (Self.an_end, Vector); + + Vector.Append (JSON_Stream_Element'(Kind => End_Object)); + end To_Any; + + procedure To_Any + (Self : Location; + Vector : in out LSPAny_Vector) is + begin + Vector.Append (JSON_Stream_Element'(Kind => Start_Object)); + + -- "uri" + Add_Key ("uri", Vector); + To_Any (Self.uri, Vector); + + -- "range" + Add_Key ("range", Vector); + To_Any (Self.a_range, Vector); + + Vector.Append (JSON_Stream_Element'(Kind => End_Object)); + end To_Any; + + procedure To_Any + (Self : TextDocumentPositionParams; + Vector : in out LSPAny_Vector) is + begin + Vector.Append (JSON_Stream_Element'(Kind => Start_Object)); + Add_Key ("textDocument", Vector); + To_Any (Self.textDocument, Vector); + Add_Key ("position", Vector); + To_Any (Self.position, Vector); + Vector.Append (JSON_Stream_Element'(Kind => End_Object)); + end To_Any; + + procedure To_Any + (Self : VSS.String_Vectors.Virtual_String_Vector; + Vector : in out LSPAny_Vector) is + begin + Vector.Append (JSON_Stream_Element'(Kind => Start_Array)); + + for S of Self loop + Vector.Append + (JSON_Stream_Element' + (Kind => String_Value, + String_Value => S)); + end loop; + + Vector.Append (JSON_Stream_Element'(Kind => End_Array)); + end To_Any; + +end LSP.Structures.LSPAny_Vectors; diff --git a/source/lsp_3.17/lsp-structures-lspany_vectors.ads b/source/lsp_3.17/lsp-structures-lspany_vectors.ads new file mode 100644 index 000000000..896f5c42b --- /dev/null +++ b/source/lsp_3.17/lsp-structures-lspany_vectors.ads @@ -0,0 +1,93 @@ +-- +-- Copyright (C) 2022-2023, AdaCore +-- +-- SPDX-License-Identifier: Apache-2.0 +-- + +with VSS.String_Vectors; + +package LSP.Structures.LSPAny_Vectors is + + procedure To_Any + (Value : Integer; + Vector : in out LSPAny_Vector); + + function From_Any + (Cursor : in out JSON_Event_Vectors.Cursor) + return Integer; + + procedure To_Any + (Value : Boolean; + Vector : in out LSPAny_Vector); + + function From_Any + (Cursor : in out JSON_Event_Vectors.Cursor) + return Boolean; + + procedure To_Any + (String : VSS.Strings.Virtual_String; + Vector : in out LSPAny_Vector); + + procedure To_Any + (Self : DocumentUri; + Vector : in out LSPAny_Vector); + + function From_Any + (Cursor : in out JSON_Event_Vectors.Cursor) + return DocumentUri; + + procedure To_Any + (Self : Position; + Vector : in out LSPAny_Vector); + + function From_Any + (Cursor : in out JSON_Event_Vectors.Cursor) + return Position; + + procedure To_Any + (Self : A_Range; + Vector : in out LSPAny_Vector); + + function From_Any + (Cursor : in out JSON_Event_Vectors.Cursor) return A_Range; + + procedure To_Any + (Self : Location; + Vector : in out LSPAny_Vector); + + function From_Any + (Cursor : in out JSON_Event_Vectors.Cursor) + return Location; + + procedure To_Any + (Self : VSS.String_Vectors.Virtual_String_Vector; + Vector : in out LSPAny_Vector); + + function From_Any + (Cursor : in out JSON_Event_Vectors.Cursor) + return VSS.String_Vectors.Virtual_String_Vector; + + procedure To_Any + (Self : TextDocumentPositionParams; + Vector : in out LSPAny_Vector); + + function From_Any + (Cursor : in out LSP.Structures.JSON_Event_Vectors.Cursor) + return TextDocumentPositionParams; + + procedure To_Any + (Self : TextDocumentIdentifier; + Vector : in out LSPAny_Vector); + + function From_Any + (Cursor : in out JSON_Event_Vectors.Cursor) + return TextDocumentIdentifier; + + procedure Add_Key + (Key : VSS.Strings.Virtual_String; + Vector : in out LSPAny_Vector); + + procedure Skip_Value + (Cursor : in out JSON_Event_Vectors.Cursor); + +end LSP.Structures.LSPAny_Vectors; diff --git a/source/lsp_3.17/lsp-structures-unwrap.ads b/source/lsp_3.17/lsp-structures-unwrap.ads index 095c14a3b..b0c8d9666 100644 --- a/source/lsp_3.17/lsp-structures-unwrap.ads +++ b/source/lsp_3.17/lsp-structures-unwrap.ads @@ -50,4 +50,16 @@ package LSP.Structures.Unwrap is (if X.Is_Set then X.Value.properties else VSS.String_Vectors.Empty_Virtual_String_Vector); + function workspaceEdit (X : WorkspaceClientCapabilities_Optional) + return WorkspaceEditClientCapabilities_Optional is + (if X.Is_Set then X.Value.workspaceEdit else (Is_Set => False)); + + function documentChanges (X : WorkspaceEditClientCapabilities_Optional) + return Boolean_Optional is + (if X.Is_Set then X.Value.documentChanges else (Is_Set => False)); + + function resourceOperations (X : WorkspaceEditClientCapabilities_Optional) + return LSP.Structures.ResourceOperationKind_Set is + (if X.Is_Set then X.Value.resourceOperations else (others => False)); + end LSP.Structures.Unwrap; From 242f2e4488f04442b094d38d433f8eaca03dc884 Mon Sep 17 00:00:00 2001 From: Vadim Godunko Date: Thu, 24 Aug 2023 19:05:58 +0400 Subject: [PATCH 052/152] Rewrite with VSS string templates. --- source/ada/lsp-utils.adb | 36 ++++++++++++++++-------------------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/source/ada/lsp-utils.adb b/source/ada/lsp-utils.adb index 74fdd5198..6b8d0fb7a 100644 --- a/source/ada/lsp-utils.adb +++ b/source/ada/lsp-utils.adb @@ -14,17 +14,19 @@ -- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy -- -- of the license. -- ------------------------------------------------------------------------------ --- + -- This package provides some utility subprograms. with GNATCOLL.VFS; -with GNATCOLL.Utils; with Libadalang.Common; with Libadalang.Sources; with Langkit_Support.Symbols; with VSS.Strings.Conversions; +with VSS.Strings.Formatters.Integers; +with VSS.Strings.Formatters.Strings; +with VSS.Strings.Templates; with Laltools.Common; with LSP.Constants; @@ -189,27 +191,21 @@ package body LSP.Utils is (Node : Libadalang.Analysis.Ada_Node'Class) return VSS.Strings.Virtual_String is - Decl_Unit_File : constant GNATCOLL.VFS.Virtual_File := + File : constant GNATCOLL.VFS.Virtual_File := GNATCOLL.VFS.Create_From_UTF8 (Node.Unit.Get_Filename); + Template : constant VSS.Strings.Templates.Virtual_String_Template := + "at {} ({}:{})"; begin - return Result : VSS.Strings.Virtual_String do - Result.Append ("at "); - Result.Append - (VSS.Strings.Conversions.To_Virtual_String - (Decl_Unit_File.Display_Base_Name)); - Result.Append (" ("); - Result.Append - (VSS.Strings.Conversions.To_Virtual_String - (GNATCOLL.Utils.Image - (Integer (Node.Sloc_Range.Start_Line), Min_Width => 1))); - Result.Append (':'); - Result.Append - (VSS.Strings.Conversions.To_Virtual_String - (GNATCOLL.Utils.Image - (Integer (Node.Sloc_Range.Start_Column), Min_Width => 1))); - Result.Append (')'); - end return; + return + Template.Format + (VSS.Strings.Formatters.Strings.Image + (VSS.Strings.Conversions.To_Virtual_String + (File.Display_Base_Name)), + VSS.Strings.Formatters.Integers.Image + (Integer (Node.Sloc_Range.Start_Line)), + VSS.Strings.Formatters.Integers.Image + (Integer (Node.Sloc_Range.Start_Column))); end Node_Location_Image; -------------- From 3fed4ebe0c39533d14f386cfa7f720a73ead5e41 Mon Sep 17 00:00:00 2001 From: Vadim Godunko Date: Thu, 24 Aug 2023 19:07:48 +0400 Subject: [PATCH 053/152] Add support of 'hover' request. --- source/ada/lsp-ada_client_capabilities.adb | 11 +- source/ada/lsp-ada_handlers.adb | 123 +++++++++++++++++++++ source/ada/lsp-ada_handlers.ads | 5 + 3 files changed, 134 insertions(+), 5 deletions(-) diff --git a/source/ada/lsp-ada_client_capabilities.adb b/source/ada/lsp-ada_client_capabilities.adb index ff6b38c33..6cc708745 100644 --- a/source/ada/lsp-ada_client_capabilities.adb +++ b/source/ada/lsp-ada_client_capabilities.adb @@ -148,13 +148,14 @@ package body LSP.Ada_Client_Capabilities is resolveProvider => LSP.Constants.True, others => <>)); - Result.callHierarchyProvider := LSP.Constants.True; - Result.declarationProvider := LSP.Constants.True; - Result.definitionProvider := LSP.Constants.True; - Result.foldingRangeProvider := LSP.Constants.True; + Result.callHierarchyProvider := LSP.Constants.True; + Result.declarationProvider := LSP.Constants.True; + Result.definitionProvider := LSP.Constants.True; + Result.foldingRangeProvider := LSP.Constants.True; + Result.referencesProvider := LSP.Constants.True; + Result.hoverProvider := (True, (True, True)); Result.implementationProvider := LSP.Constants.True; Result.typeDefinitionProvider := LSP.Constants.True; - Result.referencesProvider := LSP.Constants.True; Result.semanticTokensProvider := (Is_Set => True, diff --git a/source/ada/lsp-ada_handlers.adb b/source/ada/lsp-ada_handlers.adb index 598be0a9e..f4ec493bf 100644 --- a/source/ada/lsp-ada_handlers.adb +++ b/source/ada/lsp-ada_handlers.adb @@ -22,6 +22,7 @@ with Ada.Unchecked_Deallocation; with GNAT.OS_Lib; with GNATCOLL.Traces; +with VSS.Characters.Latin; with VSS.Strings.Formatters.Integers; with VSS.Strings.Formatters.Strings; with VSS.Strings.Templates; @@ -56,6 +57,7 @@ with LSP.Ada_Completions.Parameters; with LSP.Ada_Completions.Pragmas; with LSP.Ada_Completions.Use_Clauses; with LSP.Ada_Contexts; +with LSP.Ada_Documentation; with LSP.Ada_Handlers.Call_Hierarchy; with LSP.Ada_Handlers.Invisibles; with LSP.Ada_Handlers.Locations; @@ -2514,6 +2516,127 @@ package body LSP.Ada_Handlers is Self.Sender.On_Full_Response (Id, Response); end On_Full_Request; + ---------------------- + -- On_Hover_Request -- + ---------------------- + + overriding procedure On_Hover_Request + (Self : in out Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.HoverParams) + is + + Response : LSP.Structures.Hover_Or_Null; + + procedure Compute_Response; + + ---------------------- + -- Compute_Response -- + ---------------------- + + procedure Compute_Response is + Context : constant LSP.Ada_Context_Sets.Context_Access := + Self.Contexts.Get_Best_Context (Value.textDocument.uri); + -- For the Hover request, we're only interested in the "best" + -- response value, not in the list of values for all contexts + + Defining_Name_Node : constant Libadalang.Analysis.Defining_Name := + Self.Imprecise_Resolve_Name (Context.all, Value); + Decl : constant Libadalang.Analysis.Basic_Decl := + (if Defining_Name_Node.Is_Null + then Libadalang.Analysis.No_Basic_Decl + else Defining_Name_Node.P_Basic_Decl); + -- Associated basic declaration, if any + + Decl_Text : VSS.Strings.Virtual_String; + Qualifier_Text : VSS.Strings.Virtual_String; + Comments_Text : VSS.Strings.Virtual_String; + Location_Text : VSS.Strings.Virtual_String; + Aspects_Text : VSS.Strings.Virtual_String; + + begin + if Decl.Is_Null or else Self.Is_Canceled.all then + return; + end if; + + LSP.Ada_Documentation.Get_Tooltip_Text + (BD => Decl, + Style => Context.Get_Documentation_Style, + Declaration_Text => Decl_Text, + Qualifier_Text => Qualifier_Text, + Location_Text => Location_Text, + Documentation_Text => Comments_Text, + Aspects_Text => Aspects_Text); + + if Decl_Text.Is_Empty then + return; + end if; + + Response := (Is_Null => False, others => <>); + Response.Value.contents := (Is_MarkupContent => False, others => <>); + + -- Append the whole declaration text to the response + + Response.Value.contents.MarkedString_Vector.Append + (LSP.Structures.MarkedString' + (Is_Virtual_String => False, + value => Decl_Text, + language => "ada")); + + -- Append qualifier text if any + + if not Qualifier_Text.Is_Empty then + Response.Value.contents.MarkedString_Vector.Append + (LSP.Structures.MarkedString' + (Is_Virtual_String => True, + Virtual_String => Qualifier_Text)); + end if; + + -- Append the declaration's location. + -- + -- In addition, append the project's name if we are dealing with an + -- aggregate project. + + Location_Text := LSP.Utils.Node_Location_Image (Decl); + + if Self.Project_Tree.Root_Project.Kind in GPR2.Aggregate_Kind then + Location_Text.Append (VSS.Characters.Latin.Line_Feed); + Location_Text.Append ("As defined in project "); + Location_Text.Append (Context.Id); + Location_Text.Append (" (other projects skipped)."); + end if; + + Response.Value.contents.MarkedString_Vector.Append + (LSP.Structures.MarkedString' + (Is_Virtual_String => True, + Virtual_String => Location_Text)); + + -- Append the comments associated with the basic declaration if any. + + if not Comments_Text.Is_Empty then + Response.Value.contents.MarkedString_Vector.Append + (LSP.Structures.MarkedString' + (Is_Virtual_String => False, + language => "plaintext", + value => Comments_Text)); + end if; + + -- Append text of aspects + + if not Aspects_Text.Is_Empty then + Response.Value.contents.MarkedString_Vector.Append + (LSP.Structures.MarkedString' + (Is_Virtual_String => False, + value => Aspects_Text, + language => "ada")); + end if; + end Compute_Response; + + begin + Compute_Response; + Self.Sender.On_Hover_Response (Id, Response); + end On_Hover_Request; + ------------------------------- -- On_Implementation_Request -- ------------------------------- diff --git a/source/ada/lsp-ada_handlers.ads b/source/ada/lsp-ada_handlers.ads index 1c292f8a3..ba4ef188f 100644 --- a/source/ada/lsp-ada_handlers.ads +++ b/source/ada/lsp-ada_handlers.ads @@ -258,6 +258,11 @@ private overriding procedure On_Exits_Notification (Self : in out Message_Handler); + overriding procedure On_Hover_Request + (Self : in out Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.HoverParams); + overriding procedure On_References_Request (Self : in out Message_Handler; Id : LSP.Structures.Integer_Or_Virtual_String; From 88da45aae4c7c8fea7d5a2d8a97ddec2a0a1f8a3 Mon Sep 17 00:00:00 2001 From: Vadim Godunko Date: Thu, 24 Aug 2023 19:08:01 +0400 Subject: [PATCH 054/152] Enable 'hover' tests. --- .../test.json | 25 +-------------- .../test.yaml | 3 -- .../SB21-042.tooltips.aspects/test.json | 25 +-------------- .../SB21-042.tooltips.aspects/test.yaml | 3 -- testsuite/ada_lsp/hover.for_loops/test.json | 32 +------------------ testsuite/ada_lsp/hover.for_loops/test.yaml | 3 -- 6 files changed, 3 insertions(+), 88 deletions(-) diff --git a/testsuite/ada_lsp/G323-009.tooltips.function_prototype/test.json b/testsuite/ada_lsp/G323-009.tooltips.function_prototype/test.json index a5f99c40b..5dfeb688e 100644 --- a/testsuite/ada_lsp/G323-009.tooltips.function_prototype/test.json +++ b/testsuite/ada_lsp/G323-009.tooltips.function_prototype/test.json @@ -32,30 +32,7 @@ "id": 1, "result": { "capabilities": { - "typeDefinitionProvider": true, - "alsReferenceKinds": [ - "reference", - "access", - "write", - "call", - "dispatching call", "parent", "child", - "overriding" - ], - "hoverProvider": true, - "definitionProvider": true, - "renameProvider": {}, - "referencesProvider": true, - "textDocumentSync": 2, - "completionProvider": { - "triggerCharacters": [ - ".", - ",", - "'", - "(" - ], - "resolveProvider": true - }, - "documentSymbolProvider": true + "hoverProvider": true } } } diff --git a/testsuite/ada_lsp/G323-009.tooltips.function_prototype/test.yaml b/testsuite/ada_lsp/G323-009.tooltips.function_prototype/test.yaml index cc8399663..41c51fbaf 100644 --- a/testsuite/ada_lsp/G323-009.tooltips.function_prototype/test.yaml +++ b/testsuite/ada_lsp/G323-009.tooltips.function_prototype/test.yaml @@ -1,4 +1 @@ title: 'G323-009.tooltips.function_prototype' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/SB21-042.tooltips.aspects/test.json b/testsuite/ada_lsp/SB21-042.tooltips.aspects/test.json index 62dc29b61..2e5b36cd8 100644 --- a/testsuite/ada_lsp/SB21-042.tooltips.aspects/test.json +++ b/testsuite/ada_lsp/SB21-042.tooltips.aspects/test.json @@ -31,30 +31,7 @@ "id": 1, "result": { "capabilities": { - "typeDefinitionProvider": true, - "alsReferenceKinds": [ - "reference", - "access", - "write", - "call", - "dispatching call", "parent", "child", - "overriding" - ], - "hoverProvider": true, - "definitionProvider": true, - "renameProvider": {}, - "referencesProvider": true, - "textDocumentSync": 2, - "completionProvider": { - "triggerCharacters": [ - ".", - ",", - "'", - "(" - ], - "resolveProvider": true - }, - "documentSymbolProvider": true + "hoverProvider": true } } } diff --git a/testsuite/ada_lsp/SB21-042.tooltips.aspects/test.yaml b/testsuite/ada_lsp/SB21-042.tooltips.aspects/test.yaml index e5fa87cf4..949b5c801 100644 --- a/testsuite/ada_lsp/SB21-042.tooltips.aspects/test.yaml +++ b/testsuite/ada_lsp/SB21-042.tooltips.aspects/test.yaml @@ -1,4 +1 @@ title: 'SB21-042.tooltips.aspects' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/hover.for_loops/test.json b/testsuite/ada_lsp/hover.for_loops/test.json index 5728eacaa..8fa0354fe 100644 --- a/testsuite/ada_lsp/hover.for_loops/test.json +++ b/testsuite/ada_lsp/hover.for_loops/test.json @@ -71,37 +71,7 @@ "id": 1, "result": { "capabilities": { - "alsReferenceKinds": [ - "reference", - "access", - "write", - "call", - "dispatching call", - "parent", - "child", - "overriding" - ], - "implementationProvider": true, - "foldingRangeProvider": true, - "typeDefinitionProvider": true, - "alsShowDepsProvider": true, - "hoverProvider": true, - "definitionProvider": true, - "renameProvider": {}, - "referencesProvider": true, - "codeActionProvider": {}, - "textDocumentSync": 2, - "documentFormattingProvider": true, - "declarationProvider": true, - "completionProvider": { - "triggerCharacters": [ - ".", - ",", - "'", - "(" - ], - "resolveProvider": true - } + "hoverProvider": true } } } diff --git a/testsuite/ada_lsp/hover.for_loops/test.yaml b/testsuite/ada_lsp/hover.for_loops/test.yaml index 90fc12d26..79e0bf978 100644 --- a/testsuite/ada_lsp/hover.for_loops/test.yaml +++ b/testsuite/ada_lsp/hover.for_loops/test.yaml @@ -1,4 +1 @@ title: 'hover.for_loops' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] From 909c89fe2d6980b6a31295797353b192c7ddffda Mon Sep 17 00:00:00 2001 From: Vadim Godunko Date: Fri, 25 Aug 2023 10:37:38 +0400 Subject: [PATCH 055/152] Add documentHighlight request. --- source/ada/lsp-ada_client_capabilities.adb | 17 +-- source/ada/lsp-ada_handlers-locations.adb | 25 +++++ source/ada/lsp-ada_handlers-locations.ads | 15 ++- source/ada/lsp-ada_handlers.adb | 116 +++++++++++++++++++++ source/ada/lsp-ada_handlers.ads | 5 + source/lsp_3.17/lsp-constants.ads | 4 + 6 files changed, 173 insertions(+), 9 deletions(-) diff --git a/source/ada/lsp-ada_client_capabilities.adb b/source/ada/lsp-ada_client_capabilities.adb index 6cc708745..ecd6d9a72 100644 --- a/source/ada/lsp-ada_client_capabilities.adb +++ b/source/ada/lsp-ada_client_capabilities.adb @@ -148,14 +148,15 @@ package body LSP.Ada_Client_Capabilities is resolveProvider => LSP.Constants.True, others => <>)); - Result.callHierarchyProvider := LSP.Constants.True; - Result.declarationProvider := LSP.Constants.True; - Result.definitionProvider := LSP.Constants.True; - Result.foldingRangeProvider := LSP.Constants.True; - Result.referencesProvider := LSP.Constants.True; - Result.hoverProvider := (True, (True, True)); - Result.implementationProvider := LSP.Constants.True; - Result.typeDefinitionProvider := LSP.Constants.True; + Result.callHierarchyProvider := LSP.Constants.True; + Result.declarationProvider := LSP.Constants.True; + Result.definitionProvider := LSP.Constants.True; + Result.documentHighlightProvider := LSP.Constants.True; + Result.foldingRangeProvider := LSP.Constants.True; + Result.referencesProvider := LSP.Constants.True; + Result.hoverProvider := (True, (True, True)); + Result.implementationProvider := LSP.Constants.True; + Result.typeDefinitionProvider := LSP.Constants.True; Result.semanticTokensProvider := (Is_Set => True, diff --git a/source/ada/lsp-ada_handlers-locations.adb b/source/ada/lsp-ada_handlers-locations.adb index 86d8b4e38..1c728a339 100644 --- a/source/ada/lsp-ada_handlers-locations.adb +++ b/source/ada/lsp-ada_handlers-locations.adb @@ -39,6 +39,31 @@ package body LSP.Ada_Handlers.Locations is end if; end Append_Location; + --------------------- + -- Append_Location -- + --------------------- + + procedure Append_Location + (Result : in out LSP.Structures.DocumentHighlight_Vector; + Document : not null access LSP.Ada_Documents.Document'Class; + File : GNATCOLL.VFS.Virtual_File; + Node : Libadalang.Analysis.Ada_Node'Class; + Kind : LSP.Structures.DocumentHighlightKind_Optional) + is + use type GNATCOLL.VFS.Virtual_File; + + Node_File : constant GNATCOLL.VFS.Virtual_File := + GNATCOLL.VFS.Create_From_UTF8 (Node.Unit.Get_Filename); + + begin + if File = Node_File then + Result.Append + (LSP.Structures.DocumentHighlight' + (a_range => Document.To_LSP_Range (Node.Sloc_Range), + kind => Kind)); + end if; + end Append_Location; + ----------------- -- Get_Node_At -- ----------------- diff --git a/source/ada/lsp-ada_handlers-locations.ads b/source/ada/lsp-ada_handlers-locations.ads index de87c052a..213083ca4 100644 --- a/source/ada/lsp-ada_handlers-locations.ads +++ b/source/ada/lsp-ada_handlers-locations.ads @@ -14,7 +14,7 @@ -- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy -- -- of the license. -- ------------------------------------------------------------------------------ --- + -- This package provides routines to convert Libadalang locations to LSP -- locations. If there is the corresponding open document then it is used -- to do conversion. Otherwise we use Libadalang to get corresponding lines @@ -61,4 +61,17 @@ package LSP.Ada_Handlers.Locations is -- Append given Node location to the Result. -- Do nothing if the item inside of an synthetic file (like __standard). + procedure Append_Location + (Result : in out LSP.Structures.DocumentHighlight_Vector; + Document : not null access LSP.Ada_Documents.Document'Class; + File : GNATCOLL.VFS.Virtual_File; + Node : Libadalang.Analysis.Ada_Node'Class; + Kind : LSP.Structures.DocumentHighlightKind_Optional); + -- The same for DocumentHighlight_Vector. + -- File is used to filter out the location not in the Document. + -- Note, File and Document must be same document. + -- XXX File parameter can be removed when whether Document can return + -- associated Virtual_File or Node can able to return URI of the enclosing + -- file. + end LSP.Ada_Handlers.Locations; diff --git a/source/ada/lsp-ada_handlers.adb b/source/ada/lsp-ada_handlers.adb index f4ec493bf..721dfd163 100644 --- a/source/ada/lsp-ada_handlers.adb +++ b/source/ada/lsp-ada_handlers.adb @@ -2439,6 +2439,122 @@ package body LSP.Ada_Handlers is Self.Log_Method_Out ("On_DidRenameFiles_Notification"); end On_DidRenameFiles_Notification; + ---------------------------------- + -- On_DocumentHighlight_Request -- + ---------------------------------- + + overriding procedure On_DocumentHighlight_Request + (Self : in out Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentHighlightParams) + is + Response : LSP.Structures.DocumentHighlight_Vector_Or_Null; + + procedure Compute_Response; + + function Get_Highlight_Kind + (Node : Libadalang.Analysis.Ada_Node) + return LSP.Structures.DocumentHighlightKind_Optional; + -- Fetch highlight kind for given node + + ---------------------- + -- Compute_Response -- + ---------------------- + + procedure Compute_Response is + + use type LSP.Ada_Documents.Document_Access; + + Context : constant LSP.Ada_Context_Sets.Context_Access := + Self.Contexts.Get_Best_Context (Value.textDocument.uri); + Document : constant LSP.Ada_Documents.Document_Access := + Get_Open_Document (Self, Value.textDocument.uri); + File : constant GNATCOLL.VFS.Virtual_File := + Self.To_File (Value.textDocument.uri); + Defining_Name : constant Libadalang.Analysis.Defining_Name := + Imprecise_Resolve_Name (Self, Context.all, Value); + + procedure Append_To_Response + (Node : Libadalang.Analysis.Base_Id; + Kind : Libadalang.Common.Ref_Result_Kind; + Cancel : in out Boolean); + -- Called on each found reference. Used to append the reference to + -- the final result. + + ------------------------ + -- Append_To_Response -- + ------------------------ + + procedure Append_To_Response + (Node : Libadalang.Analysis.Base_Id; + Kind : Libadalang.Common.Ref_Result_Kind; + Cancel : in out Boolean) + is + pragma Unreferenced (Kind); + pragma Unreferenced (Cancel); + + begin + if not Laltools.Common.Is_End_Label (Node.As_Ada_Node) then + LSP.Ada_Handlers.Locations.Append_Location + (Result => Response, + Document => Document, + File => File, + Node => Node, + Kind => Get_Highlight_Kind (Node.As_Ada_Node)); + end if; + end Append_To_Response; + + begin + if Document = null + or Defining_Name.Is_Null + or Self.Is_Canceled.all + then + return; + end if; + + -- Find all references will return all the references except the + -- declaration ... + + Document.Find_All_References + (Context => Context.all, + Definition => Defining_Name, + Callback => Append_To_Response'Access); + + -- ... add it manually + + LSP.Ada_Handlers.Locations.Append_Location + (Result => Response, + Document => Document, + File => File, + Node => Defining_Name, + Kind => Get_Highlight_Kind (Defining_Name.As_Ada_Node)); + end Compute_Response; + + ------------------------ + -- Get_Highlight_Kind -- + ------------------------ + + function Get_Highlight_Kind + (Node : Libadalang.Analysis.Ada_Node) + return LSP.Structures.DocumentHighlightKind_Optional + is + Id : constant Libadalang.Analysis.Name := + Laltools.Common.Get_Node_As_Name (Node); + + begin + if Id.P_Is_Write_Reference then + return (Is_Set => True, Value => LSP.Enumerations.Write); + + else + return (Is_Set => True, Value => LSP.Enumerations.Read); + end if; + end Get_Highlight_Kind; + + begin + Compute_Response; + Self.Sender.On_DocumentHighlight_Response (Id, Response); + end On_DocumentHighlight_Request; + --------------------------- -- On_Exits_Notification -- --------------------------- diff --git a/source/ada/lsp-ada_handlers.ads b/source/ada/lsp-ada_handlers.ads index ba4ef188f..1d76047d3 100644 --- a/source/ada/lsp-ada_handlers.ads +++ b/source/ada/lsp-ada_handlers.ads @@ -256,6 +256,11 @@ private Id : LSP.Structures.Integer_Or_Virtual_String; Value : LSP.Structures.DefinitionParams); + overriding procedure On_DocumentHighlight_Request + (Self : in out Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentHighlightParams); + overriding procedure On_Exits_Notification (Self : in out Message_Handler); overriding procedure On_Hover_Request diff --git a/source/lsp_3.17/lsp-constants.ads b/source/lsp_3.17/lsp-constants.ads index d49886857..35c0dc0f4 100644 --- a/source/lsp_3.17/lsp-constants.ads +++ b/source/lsp_3.17/lsp-constants.ads @@ -83,6 +83,10 @@ package LSP.Constants is function True return LSP.Structures.Boolean_Or_ReferenceOptions_Optional is (Is_Set => True, Value => True); + function True + return LSP.Structures.Boolean_Or_DocumentHighlightOptions_Optional + is (Is_Set => True, Value => (Is_Boolean => True, Boolean => True)); + function Empty return LSP.Structures.Position is (line => 0, character => 0); From baeeef73edb084e253a2b3343d5329477d9307f2 Mon Sep 17 00:00:00 2001 From: Vadim Godunko Date: Fri, 25 Aug 2023 10:38:00 +0400 Subject: [PATCH 056/152] Enable documentHighlight test. --- .../ada_lsp/document_highlight/test.json | 43 +------------------ .../ada_lsp/document_highlight/test.yaml | 3 -- 2 files changed, 1 insertion(+), 45 deletions(-) diff --git a/testsuite/ada_lsp/document_highlight/test.json b/testsuite/ada_lsp/document_highlight/test.json index 666982d38..5eedf0207 100644 --- a/testsuite/ada_lsp/document_highlight/test.json +++ b/testsuite/ada_lsp/document_highlight/test.json @@ -356,48 +356,7 @@ "id": 0, "result": { "capabilities": { - "textDocumentSync": 2, - "completionProvider": { - "triggerCharacters": [ - ".", - ",", - "'", - "(" - ], - "resolveProvider": true - }, - "hoverProvider": true, - "declarationProvider": true, - "definitionProvider": true, - "typeDefinitionProvider": true, - "implementationProvider": true, - "referencesProvider": true, - "documentHighlightProvider": true, - "codeActionProvider": { - "codeActionKinds": [ - "", - "refactor.rewrite" - ] - }, - "documentFormattingProvider": true, - "renameProvider": { - "prepareProvider": true - }, - "foldingRangeProvider": true, - "executeCommandProvider": {}, - "workspaceSymbolProvider": true, - "callHierarchyProvider": {}, - "alsShowDepsProvider": true, - "alsReferenceKinds": [ - "reference", - "access", - "write", - "call", - "dispatching call", - "parent", - "child", - "overriding" - ] + "documentHighlightProvider": true } } } diff --git a/testsuite/ada_lsp/document_highlight/test.yaml b/testsuite/ada_lsp/document_highlight/test.yaml index c9cea11b8..b6f44ebc5 100644 --- a/testsuite/ada_lsp/document_highlight/test.yaml +++ b/testsuite/ada_lsp/document_highlight/test.yaml @@ -1,4 +1 @@ title: 'document_highlight' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] From 6d95778781b5f99dbe8dea9d6fd5a0f8bc9afc5f Mon Sep 17 00:00:00 2001 From: Andry Ogorodnik Date: Fri, 25 Aug 2023 12:57:03 +0000 Subject: [PATCH 057/152] Implemented On_ExecuteCommand_Request --- source/ada/lsp-ada_handlers.adb | 54 +++++++++++++++++++++++++++++++++ source/ada/lsp-ada_handlers.ads | 5 +++ 2 files changed, 59 insertions(+) diff --git a/source/ada/lsp-ada_handlers.adb b/source/ada/lsp-ada_handlers.adb index 721dfd163..bdfc0c682 100644 --- a/source/ada/lsp-ada_handlers.adb +++ b/source/ada/lsp-ada_handlers.adb @@ -17,6 +17,7 @@ with Ada.Containers.Indefinite_Hashed_Maps; with Ada.Exceptions; +with Ada.Tags.Generic_Dispatching_Constructor; with Ada.Unchecked_Deallocation; with GNAT.OS_Lib; @@ -77,8 +78,10 @@ with LSP.Ada_Handlers.Refactor.Remove_Parameter; with LSP.Ada_Handlers.Refactor.Replace_Type; with LSP.Ada_Handlers.Refactor.Sort_Dependencies; with LSP.Ada_Handlers.Refactor.Suppress_Seperate; +with LSP.Commands; with LSP.Diagnostic_Sources; with LSP.Enumerations; +with LSP.Errors; with LSP.Generic_Cancel_Check; with LSP.GNATCOLL_Tracers.Handle; with LSP.Server_Notifications.DidChange; @@ -2555,6 +2558,57 @@ package body LSP.Ada_Handlers is Self.Sender.On_DocumentHighlight_Response (Id, Response); end On_DocumentHighlight_Request; + ------------------------------- + -- On_ExecuteCommand_Request -- + ------------------------------- + + function Create_Command is new Ada.Tags.Generic_Dispatching_Constructor + (T => LSP.Commands.Command, + Parameters => LSP.Structures.LSPAny_Vector, + Constructor => LSP.Commands.Create); + + overriding procedure On_ExecuteCommand_Request + (Self : in out Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ExecuteCommandParams) + is + use type Ada.Tags.Tag; + + Tag : Ada.Tags.Tag := Ada.Tags.No_Tag; + Error : LSP.Errors.ResponseError_Optional; + + begin + if not Value.command.Is_Empty then + Tag := Ada.Tags.Internal_Tag + (VSS.Strings.Conversions.To_UTF_8_String (Value.command)); + end if; + + if Tag = Ada.Tags.No_Tag then + Self.Sender.On_Error_Response + (Id, (code => LSP.Enumerations.InternalError, + message => "Unknown command")); + return; + end if; + + declare + Command : constant LSP.Commands.Command'Class := + Create_Command (Tag, Value.arguments'Unrestricted_Access); + begin + Command.Execute + (Handler => Self'Access, + Sender => Self.Sender, + Id => Id, + Error => Error); + + if Error.Is_Set then + Self.Sender.On_Error_Response (Id, Error.Value); + else + -- No particular response in case of success. + Self.Sender.On_ExecuteCommand_Response (Id, (Is_Null => True)); + end if; + end; + end On_ExecuteCommand_Request; + --------------------------- -- On_Exits_Notification -- --------------------------- diff --git a/source/ada/lsp-ada_handlers.ads b/source/ada/lsp-ada_handlers.ads index 1d76047d3..1cfe23d27 100644 --- a/source/ada/lsp-ada_handlers.ads +++ b/source/ada/lsp-ada_handlers.ads @@ -368,6 +368,11 @@ private Id : LSP.Structures.Integer_Or_Virtual_String; Value : LSP.Structures.CodeActionParams); + overriding procedure On_ExecuteCommand_Request + (Self : in out Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ExecuteCommandParams); + procedure Publish_Diagnostics (Self : in out Message_Handler'Class; Document : not null LSP.Ada_Documents.Document_Access; From 93c985b4f6537fdbc950df0ddd36dd37a87f164a Mon Sep 17 00:00:00 2001 From: Vadim Godunko Date: Fri, 25 Aug 2023 15:21:18 +0400 Subject: [PATCH 058/152] Use modular formatters for line and column numbers. --- source/ada/lsp-utils.adb | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/source/ada/lsp-utils.adb b/source/ada/lsp-utils.adb index 6b8d0fb7a..8b4dc17f5 100644 --- a/source/ada/lsp-utils.adb +++ b/source/ada/lsp-utils.adb @@ -24,7 +24,7 @@ with Libadalang.Sources; with Langkit_Support.Symbols; with VSS.Strings.Conversions; -with VSS.Strings.Formatters.Integers; +with VSS.Strings.Formatters.Generic_Modulars; with VSS.Strings.Formatters.Strings; with VSS.Strings.Templates; with Laltools.Common; @@ -191,6 +191,14 @@ package body LSP.Utils is (Node : Libadalang.Analysis.Ada_Node'Class) return VSS.Strings.Virtual_String is + package Line_Number_Formatters is + new VSS.Strings.Formatters.Generic_Modulars + (Libadalang.Slocs.Line_Number); + + package Column_Number_Formatters is + new VSS.Strings.Formatters.Generic_Modulars + (Libadalang.Slocs.Column_Number); + File : constant GNATCOLL.VFS.Virtual_File := GNATCOLL.VFS.Create_From_UTF8 (Node.Unit.Get_Filename); Template : constant VSS.Strings.Templates.Virtual_String_Template := @@ -202,10 +210,8 @@ package body LSP.Utils is (VSS.Strings.Formatters.Strings.Image (VSS.Strings.Conversions.To_Virtual_String (File.Display_Base_Name)), - VSS.Strings.Formatters.Integers.Image - (Integer (Node.Sloc_Range.Start_Line)), - VSS.Strings.Formatters.Integers.Image - (Integer (Node.Sloc_Range.Start_Column))); + Line_Number_Formatters.Image (Node.Sloc_Range.Start_Line), + Column_Number_Formatters.Image (Node.Sloc_Range.Start_Column)); end Node_Location_Image; -------------- From 51029531c4d8dc09837803a5c9b81c25f036fc31 Mon Sep 17 00:00:00 2001 From: Vadim Godunko Date: Mon, 28 Aug 2023 13:09:31 +0400 Subject: [PATCH 059/152] Implementation of 'signatureHelp'. --- source/ada/lsp-ada_client_capabilities.adb | 10 ++ source/ada/lsp-ada_handlers-locations.adb | 31 +++++ source/ada/lsp-ada_handlers-locations.ads | 5 + source/ada/lsp-ada_handlers.adb | 125 +++++++++++++++++++++ source/ada/lsp-ada_handlers.ads | 5 + 5 files changed, 176 insertions(+) diff --git a/source/ada/lsp-ada_client_capabilities.adb b/source/ada/lsp-ada_client_capabilities.adb index ecd6d9a72..dafa80c06 100644 --- a/source/ada/lsp-ada_client_capabilities.adb +++ b/source/ada/lsp-ada_client_capabilities.adb @@ -15,6 +15,7 @@ -- of the license. -- ------------------------------------------------------------------------------ +with VSS.Characters.Latin; with VSS.String_Vectors; with LSP.Constants; @@ -130,6 +131,9 @@ package body LSP.Ada_Client_Capabilities is return LSP.Structures.ServerCapabilities is pragma Unreferenced (Self); + + use type VSS.Strings.Virtual_String; + begin return Result : LSP.Structures.ServerCapabilities do Result.textDocumentSync := @@ -156,6 +160,12 @@ package body LSP.Ada_Client_Capabilities is Result.referencesProvider := LSP.Constants.True; Result.hoverProvider := (True, (True, True)); Result.implementationProvider := LSP.Constants.True; + Result.signatureHelpProvider := + (Is_Set => True, + Value => + (triggerCharacters => [",", "("], + retriggerCharacters => [1 * VSS.Characters.Latin.Backspace], + workDoneProgress => <>)); Result.typeDefinitionProvider := LSP.Constants.True; Result.semanticTokensProvider := diff --git a/source/ada/lsp-ada_handlers-locations.adb b/source/ada/lsp-ada_handlers-locations.adb index 1c728a339..32017b25b 100644 --- a/source/ada/lsp-ada_handlers-locations.adb +++ b/source/ada/lsp-ada_handlers-locations.adb @@ -116,6 +116,37 @@ package body LSP.Ada_Handlers.Locations is end; end Get_Node_At; + -------------------- + -- Start_Position -- + -------------------- + + function Start_Position + (Token : Libadalang.Common.Token_Reference) + return LSP.Structures.Position + is + Location : constant Libadalang.Slocs.Source_Location := + Libadalang.Slocs.Start_Sloc + (Libadalang.Common.Sloc_Range (Libadalang.Common.Data (Token))); + Line : constant VSS.Strings.Virtual_String := + VSS.Strings.To_Virtual_String + (Libadalang.Analysis.Unit + (Token).Get_Line (Positive (Location.Line))); + + Cursor : VSS.Strings.Character_Iterators.Character_Iterator := + Line.Before_First_Character; + + begin + return Result : LSP.Structures.Position := + (line => Positive (Location.Line) - 1, character => 0) + do + for J in 1 .. Location.Column loop + exit when not Cursor.Forward; + end loop; + + Result.character := Natural (Cursor.First_UTF16_Offset); + end return; + end Start_Position; + --------------------- -- To_LSP_Location -- --------------------- diff --git a/source/ada/lsp-ada_handlers-locations.ads b/source/ada/lsp-ada_handlers-locations.ads index 213083ca4..4f0003db6 100644 --- a/source/ada/lsp-ada_handlers-locations.ads +++ b/source/ada/lsp-ada_handlers-locations.ads @@ -21,6 +21,7 @@ -- and compute character offsets. with Libadalang.Analysis; +with Libadalang.Common; with LSP.Ada_Contexts; @@ -38,6 +39,10 @@ package LSP.Ada_Handlers.Locations is Value : LSP.Structures.TextDocumentPositionParams'Class) return Libadalang.Analysis.Ada_Node; + function Start_Position + (Token : Libadalang.Common.Token_Reference) + return LSP.Structures.Position; + type AlsReferenceKind is (Simple, Access_Ref, diff --git a/source/ada/lsp-ada_handlers.adb b/source/ada/lsp-ada_handlers.adb index bdfc0c682..52f166cf3 100644 --- a/source/ada/lsp-ada_handlers.adb +++ b/source/ada/lsp-ada_handlers.adb @@ -3388,6 +3388,131 @@ package body LSP.Ada_Handlers is Self.Sender.On_Shutdown_Response (Id, Result); end On_Shutdown_Request; + ------------------------------ + -- On_SignatureHelp_Request -- + ------------------------------ + + overriding procedure On_SignatureHelp_Request + (Self : in out Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SignatureHelpParams) + is + procedure Compute_Response; + + Response : LSP.Structures.SignatureHelp_Or_Null (Is_Null => False); + + ---------------------- + -- Compute_Response -- + ---------------------- + + procedure Compute_Response is + Context : constant LSP.Ada_Context_Sets.Context_Access := + Self.Contexts.Get_Best_Context (Value.textDocument.uri); + Document : constant LSP.Ada_Documents.Document_Access := + Self.Get_Open_Document (Value.textDocument.uri); + Location : constant Langkit_Support.Slocs.Source_Location := + Document.Get_Source_Location (Value.position); + + Position : LSP.Structures.Position := Value.position; + Node : Libadalang.Analysis.Ada_Node; + + begin + -- Move the cursor to the previous character: this is more resilient + -- to invalid code. + + if Position.character > 0 then + Position.character := @ - 1; + end if; + + Node := Document.Get_Node_At (Context.all, Position); + + declare + Name_Node : constant Libadalang.Analysis.Name := + Laltools.Common.Get_Node_As_Name (Node); + + begin + -- Is this a type cast? + + if not Name_Node.Is_Null + and then not Name_Node.P_Name_Designated_Type.Is_Null + -- Does the cast make sense? + -- and then Active_Position = 0 + -- Do we have the previous signatures? + and then Value.context.Is_Set + and then Value.context.Value.activeSignatureHelp.Is_Set + then + -- At this point, the user is writing a typecast in a previous + -- signature => keep showing the previous signatures. + + Response.Value := Value.context.Value.activeSignatureHelp.Value; + + return; + end if; + end; + + -- Try to get signatures before the cursor location + -- i.e "Foo (1,|" => "Foo (1|," + + LSP.Ada_Completions.Parameters.Propose_Signatures + (Context => Context, + Node => Node, + Cursor => Location, + Prev_Signatures => Value.context, + Res => Response.Value); + + -- Retry to get signature in the previous non whitespace token + -- i.e. "Foo (1, 2 + |" => "Foo (1, 2 +|" + + if Response.Value.signatures.Is_Empty then + declare + use all type Libadalang.Common.Token_Kind; + use type Libadalang.Common.Token_Reference; + + Token : Libadalang.Common.Token_Reference := + Document.Get_Token_At (Context.all, Position); + + begin + if Token /= Libadalang.Common.No_Token + and then Libadalang.Common.Kind + (Libadalang.Common.Data (Token)) = Ada_Whitespace + then + Token := + Libadalang.Common.Previous + (Token, Exclude_Trivia => True); + end if; + + Position := LSP.Ada_Handlers.Locations.Start_Position (Token); + end; + + Node := Document.Get_Node_At (Context.all, Position); + LSP.Ada_Completions.Parameters.Propose_Signatures + (Context => Context, + Node => Node, + Cursor => Location, + Prev_Signatures => Value.context, + Res => Response.Value); + end if; + + -- Retry to get signatures in the cursor position. + -- It handles the edge case of nested function closing + -- i.e. "Foo (Bar (1)|" + + if Response.Value.signatures.Is_Empty then + Node := Document.Get_Node_At (Context.all, Value.position); + LSP.Ada_Completions.Parameters.Propose_Signatures + (Context => Context, + Node => Node, + Cursor => Location, + Prev_Signatures => Value.context, + Res => Response.Value); + end if; + end Compute_Response; + + begin + Compute_Response; + Self.Sender.On_SignatureHelp_Response (Id, Response); + end On_SignatureHelp_Request; + ----------------------------- -- On_Tokens_Range_Request -- ----------------------------- diff --git a/source/ada/lsp-ada_handlers.ads b/source/ada/lsp-ada_handlers.ads index 1cfe23d27..2582ecccf 100644 --- a/source/ada/lsp-ada_handlers.ads +++ b/source/ada/lsp-ada_handlers.ads @@ -353,6 +353,11 @@ private Id : LSP.Structures.Integer_Or_Virtual_String; Value : LSP.Structures.CompletionParams); + overriding procedure On_SignatureHelp_Request + (Self : in out Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SignatureHelpParams); + overriding procedure On_Tokens_Range_Request (Self : in out Message_Handler; Id : LSP.Structures.Integer_Or_Virtual_String; From 3364f4e0d3c5f0d035941349e39df8dea7a8d4a7 Mon Sep 17 00:00:00 2001 From: Vadim Godunko Date: Mon, 28 Aug 2023 13:07:28 +0400 Subject: [PATCH 060/152] Enable tests of 'signatureHelp' --- .../T723-027.signatureHelp.nested/test.json | 14 +------- .../T723-027.signatureHelp.nested/test.yaml | 3 -- .../test.json | 14 +------- .../test.yaml | 3 -- .../T723-027.signatureHelp.simple/test.yaml | 3 -- .../U429-030.signatureHelp.dot_call/test.json | 14 +------- .../U429-030.signatureHelp.dot_call/test.yaml | 3 -- .../test.json | 36 +------------------ .../test.yaml | 3 -- .../test.json | 36 +------------------ .../test.yaml | 3 -- .../test.json | 14 +------- .../test.yaml | 3 -- .../ada_lsp/signature.aggregate/test.yaml | 3 -- testsuite/ada_lsp/signature.generic/test.yaml | 3 -- 15 files changed, 6 insertions(+), 149 deletions(-) diff --git a/testsuite/ada_lsp/T723-027.signatureHelp.nested/test.json b/testsuite/ada_lsp/T723-027.signatureHelp.nested/test.json index 358517e6a..e3231c680 100644 --- a/testsuite/ada_lsp/T723-027.signatureHelp.nested/test.json +++ b/testsuite/ada_lsp/T723-027.signatureHelp.nested/test.json @@ -33,18 +33,7 @@ "id": 1, "result": { "capabilities": { - "hoverProvider": true, - "referencesProvider": true, "textDocumentSync": 2, - "completionProvider": { - "triggerCharacters": [ - ".", - ",", - "'", - "(" - ], - "resolveProvider": true - }, "signatureHelpProvider": { "triggerCharacters": [ ",", @@ -53,8 +42,7 @@ "retriggerCharacters": [ "\b" ] - }, - "definitionProvider": true + } } } }] diff --git a/testsuite/ada_lsp/T723-027.signatureHelp.nested/test.yaml b/testsuite/ada_lsp/T723-027.signatureHelp.nested/test.yaml index b6d05fc57..ca1ef87fc 100644 --- a/testsuite/ada_lsp/T723-027.signatureHelp.nested/test.yaml +++ b/testsuite/ada_lsp/T723-027.signatureHelp.nested/test.yaml @@ -1,4 +1 @@ title: 'T723-027.signatureHelp.nested' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/T723-027.signatureHelp.overloaded/test.json b/testsuite/ada_lsp/T723-027.signatureHelp.overloaded/test.json index ea1aa8fca..50ba0c535 100644 --- a/testsuite/ada_lsp/T723-027.signatureHelp.overloaded/test.json +++ b/testsuite/ada_lsp/T723-027.signatureHelp.overloaded/test.json @@ -32,18 +32,7 @@ "id": 1, "result": { "capabilities": { - "hoverProvider": true, - "referencesProvider": true, "textDocumentSync": 2, - "completionProvider": { - "triggerCharacters": [ - ".", - ",", - "'", - "(" - ], - "resolveProvider": true - }, "signatureHelpProvider": { "triggerCharacters": [ ",", @@ -52,8 +41,7 @@ "retriggerCharacters": [ "\b" ] - }, - "definitionProvider": true + } } } }] diff --git a/testsuite/ada_lsp/T723-027.signatureHelp.overloaded/test.yaml b/testsuite/ada_lsp/T723-027.signatureHelp.overloaded/test.yaml index 0c122418e..30ce94e12 100644 --- a/testsuite/ada_lsp/T723-027.signatureHelp.overloaded/test.yaml +++ b/testsuite/ada_lsp/T723-027.signatureHelp.overloaded/test.yaml @@ -1,4 +1 @@ title: 'T723-027.signatureHelp.overloaded' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/T723-027.signatureHelp.simple/test.yaml b/testsuite/ada_lsp/T723-027.signatureHelp.simple/test.yaml index 73c979069..7aaa04c76 100644 --- a/testsuite/ada_lsp/T723-027.signatureHelp.simple/test.yaml +++ b/testsuite/ada_lsp/T723-027.signatureHelp.simple/test.yaml @@ -1,4 +1 @@ title: 'T723-027.signatureHelp.simple' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/U429-030.signatureHelp.dot_call/test.json b/testsuite/ada_lsp/U429-030.signatureHelp.dot_call/test.json index 0f361238c..5be7fd000 100644 --- a/testsuite/ada_lsp/U429-030.signatureHelp.dot_call/test.json +++ b/testsuite/ada_lsp/U429-030.signatureHelp.dot_call/test.json @@ -34,18 +34,7 @@ "id": 1, "result": { "capabilities": { - "hoverProvider": true, - "referencesProvider": true, "textDocumentSync": 2, - "completionProvider": { - "triggerCharacters": [ - ".", - ",", - "'", - "(" - ], - "resolveProvider": true - }, "signatureHelpProvider": { "triggerCharacters": [ ",", @@ -54,8 +43,7 @@ "retriggerCharacters": [ "\b" ] - }, - "definitionProvider": true + } } } }] diff --git a/testsuite/ada_lsp/U429-030.signatureHelp.dot_call/test.yaml b/testsuite/ada_lsp/U429-030.signatureHelp.dot_call/test.yaml index a6e5a16c9..c81dc2e7a 100644 --- a/testsuite/ada_lsp/U429-030.signatureHelp.dot_call/test.yaml +++ b/testsuite/ada_lsp/U429-030.signatureHelp.dot_call/test.yaml @@ -1,4 +1 @@ title: 'U429-030.signatureHelp.dot_call' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/U721-012.signatureHelp.null_expr_funcs/test.json b/testsuite/ada_lsp/U721-012.signatureHelp.null_expr_funcs/test.json index 28b689741..ffb6be05a 100644 --- a/testsuite/ada_lsp/U721-012.signatureHelp.null_expr_funcs/test.json +++ b/testsuite/ada_lsp/U721-012.signatureHelp.null_expr_funcs/test.json @@ -80,16 +80,6 @@ "result": { "capabilities": { "textDocumentSync": 2, - "completionProvider": { - "triggerCharacters": [ - ".", - ",", - "'", - "(" - ], - "resolveProvider": true - }, - "hoverProvider": true, "signatureHelpProvider": { "triggerCharacters": [ ",", @@ -98,31 +88,7 @@ "retriggerCharacters": [ "\b" ] - }, - "declarationProvider": true, - "definitionProvider": true, - "typeDefinitionProvider": true, - "implementationProvider": true, - "referencesProvider": true, - "documentHighlightProvider": true, - "documentSymbolProvider": true, - "codeActionProvider": {}, - "documentFormattingProvider": true, - "renameProvider": {}, - "foldingRangeProvider": true, - "workspaceSymbolProvider": true, - "callHierarchyProvider": {}, - "alsShowDepsProvider": true, - "alsReferenceKinds": [ - "reference", - "access", - "write", - "call", - "dispatching call", - "parent", - "child", - "overriding" - ] + } } } } diff --git a/testsuite/ada_lsp/U721-012.signatureHelp.null_expr_funcs/test.yaml b/testsuite/ada_lsp/U721-012.signatureHelp.null_expr_funcs/test.yaml index 78ddb59cf..d938fb23d 100644 --- a/testsuite/ada_lsp/U721-012.signatureHelp.null_expr_funcs/test.yaml +++ b/testsuite/ada_lsp/U721-012.signatureHelp.null_expr_funcs/test.yaml @@ -1,4 +1 @@ title: 'U721-012.signatureHelp.null_expr_funcs' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/U805-023.signatureHelp.designators/test.json b/testsuite/ada_lsp/U805-023.signatureHelp.designators/test.json index a66773a3d..824dc9fe0 100644 --- a/testsuite/ada_lsp/U805-023.signatureHelp.designators/test.json +++ b/testsuite/ada_lsp/U805-023.signatureHelp.designators/test.json @@ -80,16 +80,6 @@ "result": { "capabilities": { "textDocumentSync": 2, - "completionProvider": { - "triggerCharacters": [ - ".", - ",", - "'", - "(" - ], - "resolveProvider": true - }, - "hoverProvider": true, "signatureHelpProvider": { "triggerCharacters": [ ",", @@ -98,31 +88,7 @@ "retriggerCharacters": [ "\b" ] - }, - "declarationProvider": true, - "definitionProvider": true, - "typeDefinitionProvider": true, - "implementationProvider": true, - "referencesProvider": true, - "documentHighlightProvider": true, - "documentSymbolProvider": true, - "codeActionProvider": {}, - "documentFormattingProvider": true, - "renameProvider": {}, - "foldingRangeProvider": true, - "workspaceSymbolProvider": true, - "callHierarchyProvider": {}, - "alsShowDepsProvider": true, - "alsReferenceKinds": [ - "reference", - "access", - "write", - "call", - "dispatching call", - "parent", - "child", - "overriding" - ] + } } } } diff --git a/testsuite/ada_lsp/U805-023.signatureHelp.designators/test.yaml b/testsuite/ada_lsp/U805-023.signatureHelp.designators/test.yaml index 2c8705bb4..93f693ee3 100644 --- a/testsuite/ada_lsp/U805-023.signatureHelp.designators/test.yaml +++ b/testsuite/ada_lsp/U805-023.signatureHelp.designators/test.yaml @@ -1,4 +1 @@ title: 'U805-023.signatureHelp.designators' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/U909-007.signatureHelp.closing_par/test.json b/testsuite/ada_lsp/U909-007.signatureHelp.closing_par/test.json index 6439cfa22..a05b7ef4b 100644 --- a/testsuite/ada_lsp/U909-007.signatureHelp.closing_par/test.json +++ b/testsuite/ada_lsp/U909-007.signatureHelp.closing_par/test.json @@ -31,18 +31,7 @@ "id": 1, "result": { "capabilities": { - "hoverProvider": true, - "referencesProvider": true, "textDocumentSync": 2, - "completionProvider": { - "triggerCharacters": [ - ".", - ",", - "'", - "(" - ], - "resolveProvider": true - }, "signatureHelpProvider": { "triggerCharacters": [ ",", @@ -51,8 +40,7 @@ "retriggerCharacters": [ "\b" ] - }, - "definitionProvider": true + } } } }] diff --git a/testsuite/ada_lsp/U909-007.signatureHelp.closing_par/test.yaml b/testsuite/ada_lsp/U909-007.signatureHelp.closing_par/test.yaml index b67cf7c50..fa207f179 100644 --- a/testsuite/ada_lsp/U909-007.signatureHelp.closing_par/test.yaml +++ b/testsuite/ada_lsp/U909-007.signatureHelp.closing_par/test.yaml @@ -1,4 +1 @@ title: 'U909-007.signatureHelp.closing_par' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/signature.aggregate/test.yaml b/testsuite/ada_lsp/signature.aggregate/test.yaml index 9440d9ef4..eec92b91e 100644 --- a/testsuite/ada_lsp/signature.aggregate/test.yaml +++ b/testsuite/ada_lsp/signature.aggregate/test.yaml @@ -1,4 +1 @@ title: 'signature.aggregate' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/signature.generic/test.yaml b/testsuite/ada_lsp/signature.generic/test.yaml index 967c075ba..56f800026 100644 --- a/testsuite/ada_lsp/signature.generic/test.yaml +++ b/testsuite/ada_lsp/signature.generic/test.yaml @@ -1,4 +1 @@ title: 'signature.generic' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] From 021a730bedf7c2e01e8ad368f7ea15f7eeec6b02 Mon Sep 17 00:00:00 2001 From: Andry Ogorodnik Date: Mon, 28 Aug 2023 11:00:09 +0000 Subject: [PATCH 061/152] Implemented On_Completion_Resolve_Request --- source/ada/lsp-ada_handlers.adb | 82 +++++++++++++++++++ source/ada/lsp-ada_handlers.ads | 5 ++ source/lsp_3.17/lsp-constants.ads | 5 ++ .../lsp-structures-lspany_vectors.adb | 7 +- 4 files changed, 98 insertions(+), 1 deletion(-) diff --git a/source/ada/lsp-ada_handlers.adb b/source/ada/lsp-ada_handlers.adb index 52f166cf3..fa0f90c51 100644 --- a/source/ada/lsp-ada_handlers.adb +++ b/source/ada/lsp-ada_handlers.adb @@ -86,6 +86,7 @@ with LSP.Generic_Cancel_Check; with LSP.GNATCOLL_Tracers.Handle; with LSP.Server_Notifications.DidChange; with LSP.Servers; +with LSP.Structures.LSPAny_Vectors; with LSP.Constants; with LSP.Utils; @@ -1591,6 +1592,87 @@ package body LSP.Ada_Handlers is Self.Sender.On_Completion_Response (Id, Response); end On_Completion_Request; + ----------------------------------- + -- On_Completion_Resolve_Request -- + ----------------------------------- + + overriding procedure On_Completion_Resolve_Request + (Self : in out Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CompletionItem) + is + Context : LSP.Ada_Context_Sets.Context_Access; + Node : Libadalang.Analysis.Ada_Node; + C : LSP.Structures.JSON_Event_Vectors.Cursor; + Location : LSP.Structures.Location; + Response : LSP.Structures.CompletionItem; + + begin + -- Return immediately if we don't have data that allows us to compute + -- additional information for the given item. + -- This is the case when all the completion item's fields have already + -- been computed. + if Value.data.Is_Empty then + Self.Sender.On_Completion_Resolve_Response (Id, Value); + end if; + + C := Value.data.First; + Location := LSP.Structures.LSPAny_Vectors.From_Any (C); + Context := Self.Contexts.Get_Best_Context (Location.uri); + Node := Get_Node_At + (Self, Context.all, + LSP.Structures.TextDocumentPositionParams' + (textDocument => (uri => Location.uri), + position => Location.a_range.start)); + + -- Retrieve the Basic_Decl from the completion item's SLOC + while not Node.Is_Null + and then Node.Kind not in Libadalang.Common.Ada_Basic_Decl + loop + Node := Node.Parent; + end loop; + + -- Compute the completion item's details + if not Node.Is_Null then + declare + use type VSS.Strings.Virtual_String; + + BD : constant Libadalang.Analysis.Basic_Decl := + Node.As_Basic_Decl; + Qual_Text : VSS.Strings.Virtual_String; + Loc_Text : VSS.Strings.Virtual_String; + Doc_Text : VSS.Strings.Virtual_String; + Decl_Text : VSS.Strings.Virtual_String; + Aspects_Text : VSS.Strings.Virtual_String; + + begin + LSP.Ada_Documentation.Get_Tooltip_Text + (BD => BD, + Style => Self.Configuration.Documentation_Style, + Qualifier_Text => Qual_Text, + Location_Text => Loc_Text, + Documentation_Text => Doc_Text, + Declaration_Text => Decl_Text, + Aspects_Text => Aspects_Text); + + Response.detail := Decl_Text; + + if not Doc_Text.Is_Empty then + Loc_Text.Append (2 * VSS.Characters.Latin.Line_Feed); + Loc_Text.Append (Doc_Text); + end if; + + Response.documentation := + (Is_Set => True, + Value => LSP.Structures.Virtual_String_Or_MarkupContent' + (Is_Virtual_String => True, + Virtual_String => Loc_Text)); + end; + end if; + + Self.Sender.On_Completion_Resolve_Response (Id, Response); + end On_Completion_Resolve_Request; + ---------------------------- -- On_Declaration_Request -- ---------------------------- diff --git a/source/ada/lsp-ada_handlers.ads b/source/ada/lsp-ada_handlers.ads index 2582ecccf..dd8dfde2a 100644 --- a/source/ada/lsp-ada_handlers.ads +++ b/source/ada/lsp-ada_handlers.ads @@ -378,6 +378,11 @@ private Id : LSP.Structures.Integer_Or_Virtual_String; Value : LSP.Structures.ExecuteCommandParams); + overriding procedure On_Completion_Resolve_Request + (Self : in out Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CompletionItem); + procedure Publish_Diagnostics (Self : in out Message_Handler'Class; Document : not null LSP.Ada_Documents.Document_Access; diff --git a/source/lsp_3.17/lsp-constants.ads b/source/lsp_3.17/lsp-constants.ads index 35c0dc0f4..9c8c54705 100644 --- a/source/lsp_3.17/lsp-constants.ads +++ b/source/lsp_3.17/lsp-constants.ads @@ -5,6 +5,7 @@ -- with VSS.JSON.Streams; +with VSS.Strings; with LSP.Structures; @@ -95,4 +96,8 @@ package LSP.Constants is return LSP.Structures.A_Range is (start => Empty, an_end => Empty); + function Empty + return LSP.Structures.DocumentUri + is ((VSS.Strings.Empty_Virtual_String with null record)); + end LSP.Constants; diff --git a/source/lsp_3.17/lsp-structures-lspany_vectors.adb b/source/lsp_3.17/lsp-structures-lspany_vectors.adb index 3c6fd081e..ab8f69335 100644 --- a/source/lsp_3.17/lsp-structures-lspany_vectors.adb +++ b/source/lsp_3.17/lsp-structures-lspany_vectors.adb @@ -5,6 +5,7 @@ -- with Interfaces; +with LSP.Constants; package body LSP.Structures.LSPAny_Vectors is @@ -49,7 +50,11 @@ package body LSP.Structures.LSPAny_Vectors is (Cursor : in out JSON_Event_Vectors.Cursor) return DocumentUri is begin - return (Element (Cursor).String_Value with null record); + if Has_Element (Cursor) then + return (Element (Cursor).String_Value with null record); + else + return LSP.Constants.Empty; + end if; end From_Any; function From_Any From 42a7755c7241701b78a3fd519f0998cdc192de0d Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Thu, 24 Aug 2023 15:50:04 +0300 Subject: [PATCH 062/152] Add rename requests Refs #1170 --- source/ada/lsp-ada_client_capabilities.adb | 25 + source/ada/lsp-ada_client_capabilities.ads | 4 + .../ada/lsp-ada_handlers-call_hierarchy.adb | 11 +- source/ada/lsp-ada_handlers-locations.adb | 81 ++- source/ada/lsp-ada_handlers-locations.ads | 8 + source/ada/lsp-ada_handlers-renaming.adb | 515 ++++++++++++++++++ source/ada/lsp-ada_handlers-renaming.ads | 47 ++ source/ada/lsp-ada_handlers.adb | 157 +++++- source/ada/lsp-ada_handlers.ads | 17 + source/ada/lsp-utils.adb | 19 + source/ada/lsp-utils.ads | 5 + source/lsp_3.17/lsp-constants.ads | 14 +- source/lsp_3.17/lsp-structures-unwrap.ads | 15 +- 13 files changed, 876 insertions(+), 42 deletions(-) create mode 100644 source/ada/lsp-ada_handlers-renaming.adb create mode 100644 source/ada/lsp-ada_handlers-renaming.ads diff --git a/source/ada/lsp-ada_client_capabilities.adb b/source/ada/lsp-ada_client_capabilities.adb index dafa80c06..0de942216 100644 --- a/source/ada/lsp-ada_client_capabilities.adb +++ b/source/ada/lsp-ada_client_capabilities.adb @@ -119,6 +119,23 @@ package body LSP.Ada_Client_Capabilities is end if; end Set_Root_If_Empty; + ---------------------------------- + -- Supports_Related_Diagnostics -- + ---------------------------------- + + function Supports_Related_Diagnostics + (Self : Client_Capability'Class) return Boolean + is + use LSP.Structures.Unwrap; + + Result : constant LSP.Structures.Boolean_Optional := + relatedInformation + (publishDiagnostics + (Self.Value.capabilities.textDocument)); + begin + return (if Result.Is_Set then Result.Value else False); + end Supports_Related_Diagnostics; + ---------------------------- -- To_Server_Capabilities -- ---------------------------- @@ -168,6 +185,14 @@ package body LSP.Ada_Client_Capabilities is workDoneProgress => <>)); Result.typeDefinitionProvider := LSP.Constants.True; + Result.renameProvider := + (Is_Set => True, + Value => + (Is_Boolean => False, + RenameOptions => + (prepareProvider => LSP.Constants.True, + others => <>))); + Result.semanticTokensProvider := (Is_Set => True, Value => diff --git a/source/ada/lsp-ada_client_capabilities.ads b/source/ada/lsp-ada_client_capabilities.ads index c0fc19188..56eaf5f6f 100644 --- a/source/ada/lsp-ada_client_capabilities.ads +++ b/source/ada/lsp-ada_client_capabilities.ads @@ -67,6 +67,10 @@ package LSP.Ada_Client_Capabilities is (Self : Client_Capability'Class) return Boolean; -- Returns capabilities.workspace.workspaceEdit.documentChanges or False + function Supports_Related_Diagnostics + (Self : Client_Capability'Class) return Boolean; + -- Returns capabilities.textDocument.publishDiagnostics.relatedInformation + -- Resource 0perations -- function Resource_Create_Supported diff --git a/source/ada/lsp-ada_handlers-call_hierarchy.adb b/source/ada/lsp-ada_handlers-call_hierarchy.adb index 636ed727d..e08054f32 100644 --- a/source/ada/lsp-ada_handlers-call_hierarchy.adb +++ b/source/ada/lsp-ada_handlers-call_hierarchy.adb @@ -347,17 +347,8 @@ package body LSP.Ada_Handlers.Call_Hierarchy is function Hash (Value : LSP.Structures.Location) return Ada.Containers.Hash_Type is use type Ada.Containers.Hash_Type; - Prime : constant := 271; - Name : constant Ada.Containers.Hash_Type := - Ada.Containers.Hash_Type'Mod (Value.uri.Hash); - From : constant Ada.Containers.Hash_Type := - Prime * Ada.Containers.Hash_Type'Mod (Value.a_range.start.line) - + Ada.Containers.Hash_Type'Mod (Value.a_range.start.character); - To : constant Ada.Containers.Hash_Type := - Prime * Ada.Containers.Hash_Type'Mod (Value.a_range.an_end.line) - + Ada.Containers.Hash_Type'Mod (Value.a_range.an_end.character); begin - return Name + From + To; + return Value.uri.Get_Hash + LSP.Utils.Hash (Value.a_range); end Hash; end LSP.Ada_Handlers.Call_Hierarchy; diff --git a/source/ada/lsp-ada_handlers-locations.adb b/source/ada/lsp-ada_handlers-locations.adb index 32017b25b..ba563e1ba 100644 --- a/source/ada/lsp-ada_handlers-locations.adb +++ b/source/ada/lsp-ada_handlers-locations.adb @@ -15,8 +15,6 @@ -- of the license. -- ------------------------------------------------------------------------------ -with Langkit_Support.Slocs; - with VSS.Strings.Conversions; with VSS.Strings.Character_Iterators; @@ -24,6 +22,11 @@ with URIs; package body LSP.Ada_Handlers.Locations is + function To_LSP_Range + (Unit : Libadalang.Analysis.Analysis_Unit; + Sloc : Langkit_Support.Slocs.Source_Location_Range) + return LSP.Structures.A_Range; + --------------------- -- Append_Location -- --------------------- @@ -151,6 +154,38 @@ package body LSP.Ada_Handlers.Locations is -- To_LSP_Location -- --------------------- + function To_LSP_Location + (Self : in out Message_Handler'Class; + Context : LSP.Ada_Contexts.Context; + File : String; + Sloc : Langkit_Support.Slocs.Source_Location_Range) + return LSP.Structures.Location + is + use type LSP.Ada_Documents.Document_Access; + + URI : constant LSP.Structures.DocumentUri := + (VSS.Strings.Conversions.To_Virtual_String + (URIs.Conversions.From_File (File)) + with null record); + + Doc : constant LSP.Ada_Documents.Document_Access := + Self.Get_Open_Document (URI); + + begin + if Doc /= null then + return Doc.To_LSP_Location (Sloc); + else + return + (uri => URI, + a_range => To_LSP_Range + (Context.Get_AU (GNATCOLL.VFS.Create_From_UTF8 (File)), Sloc)); + end if; + end To_LSP_Location; + + --------------------- + -- To_LSP_Location -- + --------------------- + function To_LSP_Location (Self : in out Message_Handler'Class; Node : Libadalang.Analysis.Ada_Node'Class) @@ -169,27 +204,39 @@ package body LSP.Ada_Handlers.Locations is Doc : constant LSP.Ada_Documents.Document_Access := Self.Get_Open_Document (URI); - Result : LSP.Structures.Location; begin if Doc /= null then return Doc.To_LSP_Location (Sloc); else - Result := - (uri => URI, - a_range => - (start => (line => Positive (Sloc.Start_Line) - 1, - character => 0), - an_end => (line => Positive (Sloc.End_Line) - 1, - character => 0))); + return + (uri => URI, + a_range => To_LSP_Range (Node.Unit, Sloc)); + end if; + end To_LSP_Location; + ------------------ + -- To_LSP_Range -- + ------------------ + + function To_LSP_Range + (Unit : Libadalang.Analysis.Analysis_Unit; + Sloc : Langkit_Support.Slocs.Source_Location_Range) + return LSP.Structures.A_Range + is + Result : LSP.Structures.A_Range := + (start => (line => Positive (Sloc.Start_Line) - 1, + character => 0), + an_end => (line => Positive (Sloc.End_Line) - 1, + character => 0)); + begin declare use type Langkit_Support.Slocs.Column_Number; Line : constant VSS.Strings.Virtual_String := VSS.Strings.To_Virtual_String - (Node.Unit.Get_Line (Positive (Sloc.Start_Line))); + (Unit.Get_Line (Positive (Sloc.Start_Line))); Cursor : VSS.Strings.Character_Iterators.Character_Iterator := Line.Before_First_Character; @@ -199,14 +246,14 @@ package body LSP.Ada_Handlers.Locations is exit when not Cursor.Forward; end loop; - Result.a_range.start.character := Natural (Cursor.First_UTF16_Offset); + Result.start.character := Natural (Cursor.First_UTF16_Offset); - if Result.a_range.start.line = Result.a_range.an_end.line then + if Result.start.line = Result.an_end.line then for J in Sloc.Start_Column .. Sloc.End_Column - 1 loop exit when not Cursor.Forward; end loop; - Result.a_range.an_end.character := + Result.an_end.character := Natural (Cursor.First_UTF16_Offset); return Result; @@ -216,7 +263,7 @@ package body LSP.Ada_Handlers.Locations is declare Line : constant VSS.Strings.Virtual_String := VSS.Strings.To_Virtual_String - (Node.Unit.Get_Line (Positive (Sloc.End_Line))); + (Unit.Get_Line (Positive (Sloc.End_Line))); Cursor : VSS.Strings.Character_Iterators.Character_Iterator := Line.Before_First_Character; @@ -226,10 +273,10 @@ package body LSP.Ada_Handlers.Locations is exit when not Cursor.Forward; end loop; - Result.a_range.an_end.character := Natural (Cursor.First_UTF16_Offset); + Result.an_end.character := Natural (Cursor.First_UTF16_Offset); return Result; end; - end To_LSP_Location; + end To_LSP_Range; end LSP.Ada_Handlers.Locations; diff --git a/source/ada/lsp-ada_handlers-locations.ads b/source/ada/lsp-ada_handlers-locations.ads index 4f0003db6..855afba0b 100644 --- a/source/ada/lsp-ada_handlers-locations.ads +++ b/source/ada/lsp-ada_handlers-locations.ads @@ -20,6 +20,7 @@ -- to do conversion. Otherwise we use Libadalang to get corresponding lines -- and compute character offsets. +with Langkit_Support.Slocs; with Libadalang.Analysis; with Libadalang.Common; @@ -33,6 +34,13 @@ package LSP.Ada_Handlers.Locations is return LSP.Structures.Location; -- Convert LAL's Node to a LSP location + function To_LSP_Location + (Self : in out Message_Handler'Class; + Context : LSP.Ada_Contexts.Context; + File : String; + Sloc : Langkit_Support.Slocs.Source_Location_Range) + return LSP.Structures.Location; + function Get_Node_At (Self : in out Message_Handler'Class; Context : LSP.Ada_Contexts.Context; diff --git a/source/ada/lsp-ada_handlers-renaming.adb b/source/ada/lsp-ada_handlers-renaming.adb new file mode 100644 index 000000000..0cde061e1 --- /dev/null +++ b/source/ada/lsp-ada_handlers-renaming.adb @@ -0,0 +1,515 @@ +------------------------------------------------------------------------------ +-- Language Server Protocol -- +-- -- +-- Copyright (C) 2018-2023, AdaCore -- +-- -- +-- This is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 3, or (at your option) any later ver- -- +-- sion. This software is distributed in the hope that it will be useful, -- +-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- -- +-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -- +-- License for more details. You should have received a copy of the GNU -- +-- General Public License distributed with this software; see file -- +-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy -- +-- of the license. -- +------------------------------------------------------------------------------ + +with Ada.Strings.Unbounded; +with Ada.Strings.Wide_Wide_Unbounded; + +with Langkit_Support.Slocs; +with Langkit_Support.Text; +with Libadalang.Common; + +with Laltools.Common; + +with LAL_Refactor.Safe_Rename; + +with LSP.Ada_Contexts; +with LSP.Ada_Handlers.Locations; +with LSP.Utils; + +package body LSP.Ada_Handlers.Renaming is + + ---------- + -- Hash -- + ---------- + + function Hash (X : File_Edit) return Ada.Containers.Hash_Type is + use type Ada.Containers.Hash_Type; + + Result : Ada.Containers.Hash_Type := + LSP.Structures.documentChanges_OfWorkspaceEdit_Item_Variant'Pos + (X.Kind); + begin + case X.Kind is + when LSP.Structures.Varian_1 => + Result := @ + X.Varian_1.textDocument.uri.Get_Hash; + + for Item of X.Varian_1.edits loop + case Item.Is_TextEdit is + when True => + Result := @ + Ada.Containers.Hash_Type'Mod + (Item.TextEdit.newText.Hash); + + Result := @ + LSP.Utils.Hash (Item.TextEdit.a_range); + + when False => + Result := @ + Ada.Containers.Hash_Type'Mod + (Item.AnnotatedTextEdit.newText.Hash); + + Result := @ + + LSP.Utils.Hash (Item.AnnotatedTextEdit.a_range); + end case; + end loop; + + when LSP.Structures.create => + Result := @ + X.create.uri.Get_Hash; + + when LSP.Structures.rename => + Result := @ + X.rename.newUri.Get_Hash + X.rename.oldUri.Get_Hash; + + when LSP.Structures.delete => + Result := @ + X.delete.uri.Get_Hash; + end case; + + return Result; + end Hash; + + --------------------- + -- Process_Context -- + --------------------- + + procedure Process_Context + (Self : in out Message_Handler'Class; + C : LSP.Ada_Context_Sets.Context_Access; + Name_Node : Libadalang.Analysis.Name; + New_Name : VSS.Strings.Virtual_String; + Filter : in out Edit_Sets.Set; + Result : in out LSP.Structures.WorkspaceEdit; + Errors : in out LAL_Refactor.Refactoring_Diagnostic_Vector) + is + use Libadalang.Common; + use Libadalang.Analysis; + use LAL_Refactor.Safe_Rename; + + Fix_Comments : constant Boolean := Self.Configuration.Rename_In_Comments; + Versioned_Documents : constant Boolean := Self.Client.Versioned_Documents; + + Safe_Renamer : LAL_Refactor.Safe_Rename.Safe_Renamer; + Context_Edits : LAL_Refactor.Refactoring_Edits; + -- Edits found for a particular context + + Algorithm : constant LAL_Refactor.Safe_Rename. + Problem_Finder_Algorithm_Kind := + LAL_Refactor.Safe_Rename.Analyse_AST; + + Definition : constant Defining_Name := + Laltools.Common.Resolve_Name_Precisely (Name_Node); + + function Attribute_Value_Provider_Callback + (Attribute : GPR2.Q_Attribute_Id; + Index : String := ""; + Default : String := ""; + Use_Extended : Boolean := False) + return String + is (C.Project_Attribute_Value + (Attribute, Index, Default, Use_Extended)); + + Attribute_Value_Provider : constant + GPR2_Attribute_Value_Provider_Access := + Attribute_Value_Provider_Callback'Unrestricted_Access; + + function Analysis_Units return Analysis_Unit_Array is (C.Analysis_Units); + -- Callback needed to provide the analysis units to the safe rename + -- tool. + + procedure Process_Comments (File_Name : String); + -- Iterate over all comments and include them in the response when + -- they contain a renamed word. + + procedure Process_References; + -- Merges Context_Edits.Text_Edits into All_Edits.Text_Edits and for + -- each Text_Edit (which represents a reference) processes its + -- references in comments. + + function To_Edit + (File : String; + Text_Edits : LAL_Refactor.Text_Edit_Ordered_Set) + return LSP.Structures.TextDocumentEdit; + + procedure Append (Item : File_Edit); + -- Append Item to Result if Filter does't contain it yet + + ------------ + -- Append -- + ------------ + + procedure Append (Item : File_Edit) is + Ignore : Edit_Sets.Cursor; + Inserted : Boolean; + URI : LSP.Structures.DocumentUri; + begin + Filter.Insert (Item, Ignore, Inserted); + -- Check if we've already had this reference from another + -- context by trying to insert it into Filter. + + if not Inserted then + null; -- This edit has been added already, do nothing + + elsif Versioned_Documents then + + Result.documentChanges.Append (Item); + + else + + URI := Item.Varian_1.textDocument.uri; + + if not Result.changes.Contains (URI) then + Result.changes.Insert (URI, LSP.Structures.Empty); + end if; + + for X of Item.Varian_1.edits loop + Result.changes (URI).Append (X.TextEdit); + end loop; + end if; + end Append; + + ----------------------- + -- Process_Comments -- + ----------------------- + + procedure Process_Comments (File_Name : String) is + use LAL_Refactor; + + Unit : constant Analysis_Unit := C.Get_AU + (GNATCOLL.VFS.Create_From_UTF8 (File_Name)); + + Set : LAL_Refactor.Text_Edit_Ordered_Set; + Token : Token_Reference := Unit.First_Token; + -- Name : constant Wide_Wide_String := Name_Node.Text; + Name : constant Wide_Wide_String := + Ada.Strings.Wide_Wide_Unbounded.To_Wide_Wide_String + (Laltools.Common.Get_Last_Name (Name_Node)); + Text_Edit : LAL_Refactor.Text_Edit; + Span : Langkit_Support.Slocs.Source_Location_Range; + Current : Token_Reference; + Diff : Integer; + + function Process_Box return Boolean; + -- Check whether Current is box header/footer and modify it. + -- Return False when the searching cycle should be stopped. + + ----------------- + -- Process_Box -- + ----------------- + + function Process_Box return Boolean is + use Langkit_Support.Text; + use Langkit_Support.Slocs; + + begin + if Current = No_Token then + return False; + end if; + + case Kind (Data (Current)) is + when Ada_Whitespace => + return True; + + when Ada_Comment => + declare + Value : constant Text_Type := Text (Current); + begin + for Idx in Value'Range loop + if Value (Idx) /= '-' then + return False; + end if; + end loop; + + if Diff > 0 then + -- Increase '-', Diff is positive + declare + Sloc : Source_Location_Range := + Sloc_Range (Data (Current)); + + begin + Sloc.Start_Column := Sloc.End_Column; + + Text_Edit := + (Sloc, + Ada.Strings.Unbounded."*" (Diff, '-')); + + Set.Include (Text_Edit); + end; + + else + -- Decrease '-', Diff is negative + declare + Sloc : Source_Location_Range := + Sloc_Range (Data (Current)); + + begin + Sloc.Start_Column := + Sloc.End_Column - Column_Number (abs Diff); + + Text_Edit := + (Sloc, + Ada.Strings.Unbounded.Null_Unbounded_String); + + Set.Include (Text_Edit); + end; + end if; + + return False; + end; + + when others => + return False; + end case; + end Process_Box; + + begin + Diff := Natural (New_Name.Character_Length) - Name'Length; + + while Token /= No_Token loop + declare + This_Span : Langkit_Support.Slocs.Source_Location_Range; + begin + if Kind (Data (Token)) = Ada_Comment + and then Laltools.Common.Contains + (Token, Name, True, This_Span) + then + Text_Edit.Location := This_Span; + Text_Edit.Text := + VSS.Strings.Conversions.To_Unbounded_UTF_8_String + (New_Name); + -- Include corrected comment itself + Set.Include (Text_Edit); + + if Diff /= 0 + and then Laltools.Common.Contains + (Token, "-- " & Name & " --", False, Span) + then + -- Can be a comment box + Current := Previous (Token); + loop + -- Looking for the box header + exit when not Process_Box; + Current := Previous (Current); + end loop; + + Current := Next (Token); + loop + -- Looking for the box footer + exit when not Process_Box; + Current := Next (Current); + end loop; + end if; + end if; + end; + + Token := Next (Token); + end loop; + + if not Set.Is_Empty then + declare + Item : File_Edit (LSP.Structures.Varian_1); + Edit : LSP.Structures.TextDocumentEdit renames Item.Varian_1; + begin + Edit := To_Edit (File_Name, Set); + Append (Item); + end; + end if; + end Process_Comments; + + ------------------------ + -- Process_References -- + ------------------------ + + procedure Process_References is + use LAL_Refactor; + + Text_Edits_Cursor : Text_Edit_Ordered_Maps.Cursor := + Context_Edits.Text_Edits.First; + + Item : File_Edit (LSP.Structures.Varian_1); + Edit : LSP.Structures.TextDocumentEdit renames Item.Varian_1; + begin + Text_Edits_Cursor := Context_Edits.Text_Edits.First; + + while Text_Edit_Ordered_Maps.Has_Element (Text_Edits_Cursor) loop + + for Text_Edit of + Text_Edit_Ordered_Maps.Element (Text_Edits_Cursor) + loop + + Edit := To_Edit + (Text_Edit_Ordered_Maps.Key (Text_Edits_Cursor), + Context_Edits.Text_Edits (Text_Edits_Cursor)); + + Append (Item); + end loop; + + if Fix_Comments then + Process_Comments + (Text_Edit_Ordered_Maps.Key (Text_Edits_Cursor)); + end if; + + Text_Edits_Cursor := + Text_Edit_Ordered_Maps.Next (Text_Edits_Cursor); + end loop; + end Process_References; + + ------------- + -- To_Edit -- + ------------- + + function To_Edit + (File : String; + Text_Edits : LAL_Refactor.Text_Edit_Ordered_Set) + return LSP.Structures.TextDocumentEdit is + begin + return Result : LSP.Structures.TextDocumentEdit do + for Item of Text_Edits loop + declare + Edit : LSP.Structures.TextEdit_Or_AnnotatedTextEdit; + + Text : constant VSS.Strings.Virtual_String := + VSS.Strings.Conversions.To_Virtual_String (Item.Text); + + Loc : constant LSP.Structures.Location := + Locations.To_LSP_Location + (Self, C.all, File, Item.Location); + begin + if Result.textDocument.uri.Is_Empty then + Result.textDocument := + Self.Get_Open_Document_Version (Loc.uri); + end if; + + if Versioned_Documents then + Edit := + (Is_TextEdit => False, + AnnotatedTextEdit => + (a_range => Loc.a_range, + newText => Text, + annotationId => <>)); -- could it be empty??? + else + Edit := + (Is_TextEdit => True, + TextEdit => + (a_range => Loc.a_range, + newText => Text)); + end if; + + Result.edits.Append (Edit); + end; + end loop; + end return; + end To_Edit; + + Is_Create_Supported : constant Boolean := + Self.Client.Resource_Create_Supported; + + Is_Rename_Supported : constant Boolean := + Self.Client.Resource_Rename_Supported; + + Is_Delete_Supported : constant Boolean := + Self.Client.Resource_Delete_Supported; + + begin + if Definition.Is_Null then + return; + end if; + + Safe_Renamer := LAL_Refactor.Safe_Rename.Create_Safe_Renamer + (Definition => Definition, + New_Name => + VSS.Strings.Conversions.To_Unbounded_Wide_Wide_String (New_Name), + Algorithm => Algorithm, + Attribute_Value_Provider => Attribute_Value_Provider); + + Context_Edits := Safe_Renamer.Refactor (Analysis_Units'Access); + + -- If problems were found, do not continue processing references + + if not Context_Edits.Diagnostics.Is_Empty then + Errors.Move (Source => Context_Edits.Diagnostics); + return; + end if; + + Process_References; + + if Is_Create_Supported then + for X of Context_Edits.File_Creations loop + declare + File : constant String := Ada.Strings.Unbounded.To_String (X.Filepath); + URI : constant LSP.Structures.DocumentUri := Self.To_URI (File); + + Create : constant File_Edit := + (Kind => LSP.Structures.create, + create => + (kind => "create", + uri => URI, + options => <>, + annotationId => <>)); + + Change : constant LAL_Refactor.Text_Edit := + (Location => (Start_Line => 1, + End_Line => 1, + Start_Column => 1, + End_Column => 0), + Text => X.Content); + + Set : constant LAL_Refactor.Text_Edit_Ordered_Set := [Change]; + + Item : File_Edit (LSP.Structures.Varian_1); + Edit : LSP.Structures.TextDocumentEdit renames Item.Varian_1; + begin + Append (Create); + Edit := To_Edit (File, Set); + Append (Item); + end; + end loop; + end if; + + if Is_Rename_Supported then + for X of Context_Edits.File_Renames loop + declare + Item : constant File_Edit := + (Kind => LSP.Structures.rename, + rename => + (kind => "rename", + oldUri => Self.To_URI + (Ada.Strings.Unbounded.To_String (X.Filepath)), + newUri => Self.To_URI + (Ada.Strings.Unbounded.To_String (X.New_Name)), + options => <>, + annotationId => <>)); + begin + Append (Item); + end; + end loop; + end if; + + if Is_Delete_Supported then + for X of Context_Edits.File_Creations loop + declare + Item : constant File_Edit := + (Kind => LSP.Structures.delete, + delete => + (kind => "delete", + uri => Self.To_URI + (Ada.Strings.Unbounded.To_String (X.Filepath)), + options => <>, + annotationId => <>)); + begin + Append (Item); + end; + end loop; + end if; + + end Process_Context; + +end LSP.Ada_Handlers.Renaming; diff --git a/source/ada/lsp-ada_handlers-renaming.ads b/source/ada/lsp-ada_handlers-renaming.ads new file mode 100644 index 000000000..7bb802e86 --- /dev/null +++ b/source/ada/lsp-ada_handlers-renaming.ads @@ -0,0 +1,47 @@ +------------------------------------------------------------------------------ +-- Language Server Protocol -- +-- -- +-- Copyright (C) 2018-2023, AdaCore -- +-- -- +-- This is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 3, or (at your option) any later ver- -- +-- sion. This software is distributed in the hope that it will be useful, -- +-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- -- +-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -- +-- License for more details. You should have received a copy of the GNU -- +-- General Public License distributed with this software; see file -- +-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy -- +-- of the license. -- +------------------------------------------------------------------------------ + +with Libadalang.Analysis; + +with LAL_Refactor; + +with LSP.Ada_Context_Sets; + +package LSP.Ada_Handlers.Renaming is + + subtype File_Edit is LSP.Structures.documentChanges_OfWorkspaceEdit_Item; + + function Hash (X : File_Edit) return Ada.Containers.Hash_Type; + + package Edit_Sets is new Ada.Containers.Hashed_Sets + (Element_Type => File_Edit, + Hash => Hash, + Equivalent_Elements => LSP.Structures."=", + "=" => LSP.Structures."="); + + procedure Process_Context + (Self : in out Message_Handler'Class; + C : LSP.Ada_Context_Sets.Context_Access; + Name_Node : Libadalang.Analysis.Name; + New_Name : VSS.Strings.Virtual_String; + Filter : in out Edit_Sets.Set; + Result : in out LSP.Structures.WorkspaceEdit; + Errors : in out LAL_Refactor.Refactoring_Diagnostic_Vector); + -- Process the rename request for the given context, and add the + -- edits to Result using Filter to avoid duplicates. + +end LSP.Ada_Handlers.Renaming; diff --git a/source/ada/lsp-ada_handlers.adb b/source/ada/lsp-ada_handlers.adb index fa0f90c51..a317fc802 100644 --- a/source/ada/lsp-ada_handlers.adb +++ b/source/ada/lsp-ada_handlers.adb @@ -15,7 +15,6 @@ -- of the license. -- ------------------------------------------------------------------------------ -with Ada.Containers.Indefinite_Hashed_Maps; with Ada.Exceptions; with Ada.Tags.Generic_Dispatching_Constructor; with Ada.Unchecked_Deallocation; @@ -48,7 +47,6 @@ with LAL_Refactor.Subprogram_Signature.Change_Parameters_Type; with LAL_Refactor.Subprogram_Signature.Remove_Parameter; with LAL_Refactor.Suppress_Separate; -with LSP.Ada_Completions; with LSP.Ada_Completions.Aspects; with LSP.Ada_Completions.Attributes; with LSP.Ada_Completions.End_Names; @@ -57,6 +55,7 @@ with LSP.Ada_Completions.Names; with LSP.Ada_Completions.Parameters; with LSP.Ada_Completions.Pragmas; with LSP.Ada_Completions.Use_Clauses; +with LSP.Ada_Completions; with LSP.Ada_Contexts; with LSP.Ada_Documentation; with LSP.Ada_Handlers.Call_Hierarchy; @@ -66,8 +65,8 @@ with LSP.Ada_Handlers.Named_Parameters_Commands; with LSP.Ada_Handlers.Project_Diagnostics; with LSP.Ada_Handlers.Project_Loading; with LSP.Ada_Handlers.Refactor.Add_Parameter; -with LSP.Ada_Handlers.Refactor.Change_Parameters_Default_Value; with LSP.Ada_Handlers.Refactor.Change_Parameter_Mode; +with LSP.Ada_Handlers.Refactor.Change_Parameters_Default_Value; with LSP.Ada_Handlers.Refactor.Change_Parameters_Type; with LSP.Ada_Handlers.Refactor.Extract_Subprogram; with LSP.Ada_Handlers.Refactor.Imports_Commands; @@ -78,7 +77,9 @@ with LSP.Ada_Handlers.Refactor.Remove_Parameter; with LSP.Ada_Handlers.Refactor.Replace_Type; with LSP.Ada_Handlers.Refactor.Sort_Dependencies; with LSP.Ada_Handlers.Refactor.Suppress_Seperate; +with LSP.Ada_Handlers.Renaming; with LSP.Commands; +with LSP.Constants; with LSP.Diagnostic_Sources; with LSP.Enumerations; with LSP.Errors; @@ -87,8 +88,6 @@ with LSP.GNATCOLL_Tracers.Handle; with LSP.Server_Notifications.DidChange; with LSP.Servers; with LSP.Structures.LSPAny_Vectors; - -with LSP.Constants; with LSP.Utils; package body LSP.Ada_Handlers is @@ -2430,7 +2429,7 @@ package body LSP.Ada_Handlers is use LSP.Ada_Context_Sets; package URI_Contexts_Maps is new - Ada.Containers.Indefinite_Hashed_Maps + Ada.Containers.Hashed_Maps (Key_Type => LSP.Structures.DocumentUri, Element_Type => Context_Lists.List, Hash => LSP.Structures.Get_Hash, @@ -3220,6 +3219,52 @@ package body LSP.Ada_Handlers is Self.Sender.On_PrepareCallHierarchy_Response (Id, Response); end On_PrepareCallHierarchy_Request; + ------------------------------ + -- On_PrepareRename_Request -- + ------------------------------ + + overriding procedure On_PrepareRename_Request + (Self : in out Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.PrepareRenameParams) + is + Trace : constant GNATCOLL.Traces.Trace_Handle := + LSP.GNATCOLL_Tracers.Handle (Self.Tracer.all); + + Response : LSP.Structures.PrepareRenameResult_Or_Null (Is_Null => False); + + Context : constant LSP.Ada_Context_Sets.Context_Access := + Self.Contexts.Get_Best_Context (Value.textDocument.uri); + -- For the prepareRename request, we're only interested in the "best" + -- context to check that we are able to rename the name. + + Name_Node : constant Libadalang.Analysis.Name := + Laltools.Common.Get_Node_As_Name + (Self.Get_Node_At (Context.all, Value)); + + Defining_Name : Libadalang.Analysis.Defining_Name; + + Imprecise : Boolean; + begin + if not Name_Node.Is_Null then + Defining_Name := Laltools.Common.Resolve_Name + (Name_Node, + Trace, + Imprecise => Imprecise); + end if; + + if not Name_Node.Is_Null + and then not Defining_Name.Is_Null + and then not Imprecise + then + -- Success only if the node is a name and can be resolved precisely + Response.Value.Varian_1 := Self.To_LSP_Location (Name_Node).a_range; + + end if; + + Self.Sender.On_PrepareRename_Response (Id, Response); + end On_PrepareRename_Request; + --------------------------- -- On_References_Request -- --------------------------- @@ -3399,6 +3444,106 @@ package body LSP.Ada_Handlers is Self.Sender.On_References_Response (Id, Response); end On_References_Request; + ----------------------- + -- On_Rename_Request -- + ----------------------- + + overriding procedure On_Rename_Request + (Self : in out Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.RenameParams) + is + Response : LSP.Structures.WorkspaceEdit_Or_Null (Is_Null => False); + + Position : constant LSP.Structures.TextDocumentPositionParams := + (textDocument => Value.textDocument, + position => Value.position); + + Filter : LSP.Ada_Handlers.Renaming.Edit_Sets.Set; + -- When iterating over all contexts (and therefore all projects), it's + -- possible to encounter the same Text_Edit more than once, so this + -- stores all the unique edits + + Errors : LAL_Refactor.Refactoring_Diagnostic_Vector; + + begin + for C of Self.Contexts_For_URI (Value.textDocument.uri) loop + declare + Name_Node : constant Libadalang.Analysis.Name := + Laltools.Common.Get_Node_As_Name + (Self.Get_Node_At (C.all, Position)); + begin + LSP.Ada_Handlers.Renaming.Process_Context + (Self, + C, + Name_Node, + New_Name => Value.newName, + Filter => Filter, + Result => Response.Value, + Errors => Errors); + + if not Errors.Is_Empty then + declare + Template : VSS.Strings.Templates.Virtual_String_Template := + "Can't rename identifier '{}'"; + + Message : constant VSS.Strings.Virtual_String := + Template.Format + (VSS.Strings.Formatters.Strings.Image + (VSS.Strings.To_Virtual_String (Name_Node.Text))); + + Diag_Params : LSP.Structures.PublishDiagnosticsParams; + Diagnostic : LSP.Structures.Diagnostic; + begin + Diagnostic.a_range := + Self.To_LSP_Location (Name_Node).a_range; + Diagnostic.severity := LSP.Constants.Error; + Diagnostic.source := "Ada"; + + if Self.Client.Supports_Related_Diagnostics then + + Diagnostic.message := Message; + + for Problem of Errors loop + Diagnostic.relatedInformation.Append + (LSP.Structures.DiagnosticRelatedInformation' + (location => + LSP.Ada_Handlers.Locations.To_LSP_Location + (Self, + C.all, + Problem.Filename, + Problem.Location), + + message => + VSS.Strings.Conversions.To_Virtual_String + (Problem.Info))); + end loop; + else + Diagnostic.message := + VSS.Strings.Conversions.To_Virtual_String + (Errors.First_Element.Info); + + end if; + + Diag_Params.uri := Value.textDocument.uri; + Diag_Params.diagnostics.Append (Diagnostic); + Self.Sender.On_PublishDiagnostics_Notification (Diag_Params); + exit; + end; + end if; + end; + end loop; + + if Errors.Is_Empty then + Self.Sender.On_Rename_Response (Id, Response); + else + Self.Sender.On_Error_Response + (Id, + (code => LSP.Enumerations.InternalError, -- RequestFailed, + message => <>)); + end if; + end On_Rename_Request; + ---------------------------- -- On_Server_Notification -- ---------------------------- diff --git a/source/ada/lsp-ada_handlers.ads b/source/ada/lsp-ada_handlers.ads index dd8dfde2a..64d738654 100644 --- a/source/ada/lsp-ada_handlers.ads +++ b/source/ada/lsp-ada_handlers.ads @@ -306,6 +306,16 @@ private Id : LSP.Structures.Integer_Or_Virtual_String; Value : LSP.Structures.CallHierarchyPrepareParams); + overriding procedure On_PrepareRename_Request + (Self : in out Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.PrepareRenameParams); + + overriding procedure On_Rename_Request + (Self : in out Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.RenameParams); + overriding procedure On_FoldingRange_Request (Self : in out Message_Handler; Id : LSP.Structures.Integer_Or_Virtual_String; @@ -404,6 +414,13 @@ private (VSS.Strings.Conversions.To_UTF_8_String (URI), Normalize => Self.Configuration.Follow_Symlinks))); + function To_URI + (Ignore : Message_Handler'Class; + File : String) return LSP.Structures.DocumentUri + is + (VSS.Strings.Conversions.To_Virtual_String + (URIs.Conversions.From_File (File)) with null record); + function To_Workspace_Edit (Self : in out Message_Handler'Class; Edits : LAL_Refactor.Refactoring_Edits; diff --git a/source/ada/lsp-utils.adb b/source/ada/lsp-utils.adb index 8b4dc17f5..ffa52283c 100644 --- a/source/ada/lsp-utils.adb +++ b/source/ada/lsp-utils.adb @@ -183,6 +183,25 @@ package body LSP.Utils is return Get_Location (Node.Unit, Node.Sloc_Range); end Get_Node_Location; + ---------- + -- Hash -- + ---------- + + function Hash + (Value : LSP.Structures.A_Range) return Ada.Containers.Hash_Type + is + use type Ada.Containers.Hash_Type; + Prime : constant := 271; + From : constant Ada.Containers.Hash_Type := + Prime * Ada.Containers.Hash_Type'Mod (Value.start.line) + + Ada.Containers.Hash_Type'Mod (Value.start.character); + To : constant Ada.Containers.Hash_Type := + Prime * Ada.Containers.Hash_Type'Mod (Value.an_end.line) + + Ada.Containers.Hash_Type'Mod (Value.an_end.character); + begin + return From + To; + end Hash; + ------------------------- -- Node_Location_Image -- ------------------------- diff --git a/source/ada/lsp-utils.ads b/source/ada/lsp-utils.ads index 80137402f..0e87fe244 100644 --- a/source/ada/lsp-utils.ads +++ b/source/ada/lsp-utils.ads @@ -17,6 +17,8 @@ -- -- This package provides some utility subprograms. +with Ada.Containers; + with VSS.Strings; with Libadalang.Analysis; @@ -70,4 +72,7 @@ package LSP.Utils is -- to convert LAL's Source_Location_Range to LSP's Range. Consider to -- use Document.To_LSP_Range instead, or add necessary wrapper. + function Hash + (Value : LSP.Structures.A_Range) return Ada.Containers.Hash_Type; + end LSP.Utils; diff --git a/source/lsp_3.17/lsp-constants.ads b/source/lsp_3.17/lsp-constants.ads index 9c8c54705..e13bb490a 100644 --- a/source/lsp_3.17/lsp-constants.ads +++ b/source/lsp_3.17/lsp-constants.ads @@ -7,6 +7,7 @@ with VSS.JSON.Streams; with VSS.Strings; +with LSP.Enumerations; with LSP.Structures; package LSP.Constants is @@ -88,13 +89,14 @@ package LSP.Constants is return LSP.Structures.Boolean_Or_DocumentHighlightOptions_Optional is (Is_Set => True, Value => (Is_Boolean => True, Boolean => True)); - function Empty - return LSP.Structures.Position - is (line => 0, character => 0); + function Empty return LSP.Structures.Position + is (line => 0, character => 0); - function Empty - return LSP.Structures.A_Range - is (start => Empty, an_end => Empty); + function Empty return LSP.Structures.A_Range + is (start => Empty, an_end => Empty); + + function Error return LSP.Structures.DiagnosticSeverity_Optional + is (Is_Set => True, Value => LSP.Enumerations.Error); function Empty return LSP.Structures.DocumentUri diff --git a/source/lsp_3.17/lsp-structures-unwrap.ads b/source/lsp_3.17/lsp-structures-unwrap.ads index b0c8d9666..def525a68 100644 --- a/source/lsp_3.17/lsp-structures-unwrap.ads +++ b/source/lsp_3.17/lsp-structures-unwrap.ads @@ -52,14 +52,23 @@ package LSP.Structures.Unwrap is function workspaceEdit (X : WorkspaceClientCapabilities_Optional) return WorkspaceEditClientCapabilities_Optional is - (if X.Is_Set then X.Value.workspaceEdit else (Is_Set => False)); + (if X.Is_Set then X.Value.workspaceEdit else (Is_Set => False)); function documentChanges (X : WorkspaceEditClientCapabilities_Optional) return Boolean_Optional is - (if X.Is_Set then X.Value.documentChanges else (Is_Set => False)); + (if X.Is_Set then X.Value.documentChanges else (Is_Set => False)); function resourceOperations (X : WorkspaceEditClientCapabilities_Optional) return LSP.Structures.ResourceOperationKind_Set is - (if X.Is_Set then X.Value.resourceOperations else (others => False)); + (if X.Is_Set then X.Value.resourceOperations else (others => False)); + + function publishDiagnostics (X : TextDocumentClientCapabilities_Optional) + return PublishDiagnosticsClientCapabilities_Optional is + (if X.Is_Set then X.Value.publishDiagnostics else (Is_Set => False)); + + function relatedInformation + (X : PublishDiagnosticsClientCapabilities_Optional) + return Boolean_Optional is + (if X.Is_Set then X.Value.relatedInformation else (Is_Set => False)); end LSP.Structures.Unwrap; From 5f428e8dbb9e16e177a92cf7fc0339e509a2f14c Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Mon, 28 Aug 2023 12:07:20 +0300 Subject: [PATCH 063/152] Rebase tests Refs #1170 --- .../test.json | 16 +--- .../test.yaml | 3 - .../test.json | 18 +---- .../test.yaml | 3 - .../ada_lsp/SA11-038_Name_Collision/test.json | 1 - .../ada_lsp/SA11-038_Name_Collision/test.yaml | 3 - .../SA22-029.rename_in_comments/test.json | 80 +++++++------------ .../SA22-029.rename_in_comments/test.yaml | 3 - .../U415-027.refactor_safe_rename_0/test.json | 24 +++--- .../U415-027.refactor_safe_rename_0/test.yaml | 3 - .../U415-027.refactor_safe_rename_1/test.yaml | 3 - .../ada_lsp/rename.not_up_to_date/test.json | 16 +--- .../ada_lsp/rename.not_up_to_date/test.yaml | 3 - .../rename.primitive_parameters/test.json | 27 +------ .../rename.primitive_parameters/test.yaml | 3 - .../rename.tagged_type_primitives/test.json | 27 +------ .../rename.tagged_type_primitives/test.yaml | 3 - testsuite/ada_lsp/rename/rename.json | 4 +- testsuite/ada_lsp/rename/test.yaml | 3 - 19 files changed, 50 insertions(+), 193 deletions(-) diff --git a/testsuite/ada_lsp/P107-003.refactoring.underscores/test.json b/testsuite/ada_lsp/P107-003.refactoring.underscores/test.json index 17dbdff14..ff70f7d08 100644 --- a/testsuite/ada_lsp/P107-003.refactoring.underscores/test.json +++ b/testsuite/ada_lsp/P107-003.refactoring.underscores/test.json @@ -32,22 +32,8 @@ "id": 1, "result": { "capabilities": { - "typeDefinitionProvider": true, - "hoverProvider": true, - "definitionProvider": true, "renameProvider": {}, - "referencesProvider": true, - "textDocumentSync": 2, - "completionProvider": { - "triggerCharacters": [ - ".", - ",", - "'", - "(" - ], - "resolveProvider": true - }, - "documentSymbolProvider": true + "textDocumentSync": 2 } } } diff --git a/testsuite/ada_lsp/P107-003.refactoring.underscores/test.yaml b/testsuite/ada_lsp/P107-003.refactoring.underscores/test.yaml index a46e330ff..4a8d6c35b 100644 --- a/testsuite/ada_lsp/P107-003.refactoring.underscores/test.yaml +++ b/testsuite/ada_lsp/P107-003.refactoring.underscores/test.yaml @@ -1,4 +1 @@ title: 'P107-003.refactoring.underscores' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/P429-023.refactoring.rename_clauses/test.json b/testsuite/ada_lsp/P429-023.refactoring.rename_clauses/test.json index bdf3bb295..792d2e964 100644 --- a/testsuite/ada_lsp/P429-023.refactoring.rename_clauses/test.json +++ b/testsuite/ada_lsp/P429-023.refactoring.rename_clauses/test.json @@ -32,23 +32,9 @@ "id": 1, "result": { "capabilities": { - "typeDefinitionProvider": true, - "hoverProvider": true, - "definitionProvider": true, "renameProvider": {}, - "referencesProvider": true, - "textDocumentSync": 2, - "completionProvider": { - "triggerCharacters": [ - ".", - ",", - "'", - "(" - ], - "resolveProvider": true - }, - "documentSymbolProvider": true - } + "textDocumentSync": 2 + } } } ] diff --git a/testsuite/ada_lsp/P429-023.refactoring.rename_clauses/test.yaml b/testsuite/ada_lsp/P429-023.refactoring.rename_clauses/test.yaml index 6f0c2eac3..09b12a59b 100644 --- a/testsuite/ada_lsp/P429-023.refactoring.rename_clauses/test.yaml +++ b/testsuite/ada_lsp/P429-023.refactoring.rename_clauses/test.yaml @@ -1,4 +1 @@ title: 'P429-023.refactoring.rename_clauses' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/SA11-038_Name_Collision/test.json b/testsuite/ada_lsp/SA11-038_Name_Collision/test.json index 7194bfca9..6307aab9e 100644 --- a/testsuite/ada_lsp/SA11-038_Name_Collision/test.json +++ b/testsuite/ada_lsp/SA11-038_Name_Collision/test.json @@ -210,7 +210,6 @@ "jsonrpc": "2.0", "id": "ada-4", "error": { - "code": -32803, "message": "" } } diff --git a/testsuite/ada_lsp/SA11-038_Name_Collision/test.yaml b/testsuite/ada_lsp/SA11-038_Name_Collision/test.yaml index 88436ce87..161a21e93 100644 --- a/testsuite/ada_lsp/SA11-038_Name_Collision/test.yaml +++ b/testsuite/ada_lsp/SA11-038_Name_Collision/test.yaml @@ -1,4 +1 @@ title: 'SA11-038_Name_Collision' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/SA22-029.rename_in_comments/test.json b/testsuite/ada_lsp/SA22-029.rename_in_comments/test.json index 7b0bbce78..e87a1e2bb 100644 --- a/testsuite/ada_lsp/SA22-029.rename_in_comments/test.json +++ b/testsuite/ada_lsp/SA22-029.rename_in_comments/test.json @@ -31,30 +31,8 @@ "id": 1, "result": { "capabilities": { - "typeDefinitionProvider": true, - "alsReferenceKinds": [ - "reference", - "access", - "write", - "call", - "dispatching call", "parent", "child", - "overriding" - ], - "hoverProvider": true, - "definitionProvider": true, "renameProvider": {}, - "referencesProvider": true, - "textDocumentSync": 2, - "completionProvider": { - "triggerCharacters": [ - ".", - ",", - "'", - "(" - ], - "resolveProvider": true - }, - "documentSymbolProvider": true + "textDocumentSync": 2 } } } @@ -143,6 +121,21 @@ "id": 2, "result": { "changes": { + "$URI{p1.adb}": [ + { + "newText": "Print1", + "range": { + "start": { + "line": 7, + "character": 8 + }, + "end": { + "line": 7, + "character": 13 + } + } + } + ], "$URI{p.adb}": [ { "newText": "Print1", @@ -172,6 +165,19 @@ } ], "$URI{p.ads}": [ + { + "range": { + "start": { + "line": 9, + "character": 13 + }, + "end": { + "line": 9, + "character": 18 + } + }, + "newText": "Print1" + }, { "range": { "start": { @@ -211,19 +217,6 @@ }, "newText": "-" }, - { - "range": { - "start": { - "line": 9, - "character": 13 - }, - "end": { - "line": 9, - "character": 18 - } - }, - "newText": "Print1" - }, { "range": { "start": { @@ -263,21 +256,6 @@ }, "newText": "-" } - ], - "$URI{p1.adb}": [ - { - "newText": "Print1", - "range": { - "start": { - "line": 7, - "character": 8 - }, - "end": { - "line": 7, - "character": 13 - } - } - } ] } } diff --git a/testsuite/ada_lsp/SA22-029.rename_in_comments/test.yaml b/testsuite/ada_lsp/SA22-029.rename_in_comments/test.yaml index 69dea75db..378761e87 100644 --- a/testsuite/ada_lsp/SA22-029.rename_in_comments/test.yaml +++ b/testsuite/ada_lsp/SA22-029.rename_in_comments/test.yaml @@ -1,4 +1 @@ title: 'SA22-029.rename_in_comments' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/U415-027.refactor_safe_rename_0/test.json b/testsuite/ada_lsp/U415-027.refactor_safe_rename_0/test.json index 2535f12dd..553a6606d 100644 --- a/testsuite/ada_lsp/U415-027.refactor_safe_rename_0/test.json +++ b/testsuite/ada_lsp/U415-027.refactor_safe_rename_0/test.json @@ -170,7 +170,8 @@ "character": 15 } }, - "newText": "Qux" + "newText": "Qux", + "annotationId": "" }, { "range": { @@ -183,7 +184,8 @@ "character": 11 } }, - "newText": "Qux" + "newText": "Qux", + "annotationId": "" } ] }, @@ -204,7 +206,8 @@ "character": 15 } }, - "newText": "Qux" + "newText": "Qux", + "annotationId": "" }, { "range": { @@ -217,7 +220,8 @@ "character": 11 } }, - "newText": "Qux" + "newText": "Qux", + "annotationId": "" } ] }, @@ -238,7 +242,8 @@ "character": 12 } }, - "newText": "Qux" + "newText": "Qux", + "annotationId": "" }, { "range": { @@ -251,21 +256,20 @@ "character": 12 } }, - "newText": "Qux" + "newText": "Qux", + "annotationId": "" } ] }, { "kind": "rename", "oldUri": "$URI{foo-bar-baz.ads}", - "newUri": "$URI{foo-qux-baz.ads}", - "options": {} + "newUri": "$URI{foo-qux-baz.ads}" }, { "kind": "rename", "oldUri": "$URI{foo-bar.ads}", - "newUri": "$URI{foo-qux.ads}", - "options": {} + "newUri": "$URI{foo-qux.ads}" } ] } diff --git a/testsuite/ada_lsp/U415-027.refactor_safe_rename_0/test.yaml b/testsuite/ada_lsp/U415-027.refactor_safe_rename_0/test.yaml index c72042ab1..2e803f4c5 100644 --- a/testsuite/ada_lsp/U415-027.refactor_safe_rename_0/test.yaml +++ b/testsuite/ada_lsp/U415-027.refactor_safe_rename_0/test.yaml @@ -1,4 +1 @@ title: 'U415-027.refactor_safe_rename_0' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/U415-027.refactor_safe_rename_1/test.yaml b/testsuite/ada_lsp/U415-027.refactor_safe_rename_1/test.yaml index 5d41b4650..1d7610f2f 100644 --- a/testsuite/ada_lsp/U415-027.refactor_safe_rename_1/test.yaml +++ b/testsuite/ada_lsp/U415-027.refactor_safe_rename_1/test.yaml @@ -1,6 +1,3 @@ title: 'U415-027.refactor_safe_rename_1' description: 'Checks that file renames are not sent if client does not support them' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/rename.not_up_to_date/test.json b/testsuite/ada_lsp/rename.not_up_to_date/test.json index ab97082fc..a6839fb4f 100644 --- a/testsuite/ada_lsp/rename.not_up_to_date/test.json +++ b/testsuite/ada_lsp/rename.not_up_to_date/test.json @@ -32,22 +32,8 @@ "id": 1, "result": { "capabilities": { - "typeDefinitionProvider": true, - "hoverProvider": true, - "definitionProvider": true, "renameProvider": {}, - "referencesProvider": true, - "textDocumentSync": 2, - "completionProvider": { - "triggerCharacters": [ - ".", - ",", - "'", - "(" - ], - "resolveProvider": true - }, - "documentSymbolProvider": true + "textDocumentSync": 2 } } } diff --git a/testsuite/ada_lsp/rename.not_up_to_date/test.yaml b/testsuite/ada_lsp/rename.not_up_to_date/test.yaml index 0995735d7..0b93a159c 100644 --- a/testsuite/ada_lsp/rename.not_up_to_date/test.yaml +++ b/testsuite/ada_lsp/rename.not_up_to_date/test.yaml @@ -1,4 +1 @@ title: 'rename.not_up_to_date' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/rename.primitive_parameters/test.json b/testsuite/ada_lsp/rename.primitive_parameters/test.json index a73a3aaf0..59df5f4a7 100644 --- a/testsuite/ada_lsp/rename.primitive_parameters/test.json +++ b/testsuite/ada_lsp/rename.primitive_parameters/test.json @@ -53,33 +53,8 @@ "id": 1, "result": { "capabilities": { - "typeDefinitionProvider": true, - "alsReferenceKinds": [ - "reference", - "access", - "write", - "call", - "dispatching call", - "parent", - "child", - "overriding" - ], - "hoverProvider": true, - "definitionProvider": true, "renameProvider": {}, - "referencesProvider": true, - "declarationProvider": true, - "textDocumentSync": 2, - "completionProvider": { - "triggerCharacters": [ - ".", - ",", - "'", - "(" - ], - "resolveProvider": true - }, - "documentSymbolProvider": true + "textDocumentSync": 2 } } } diff --git a/testsuite/ada_lsp/rename.primitive_parameters/test.yaml b/testsuite/ada_lsp/rename.primitive_parameters/test.yaml index 67fa64120..66072476f 100644 --- a/testsuite/ada_lsp/rename.primitive_parameters/test.yaml +++ b/testsuite/ada_lsp/rename.primitive_parameters/test.yaml @@ -1,4 +1 @@ title: 'rename.primitive_parameters' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/rename.tagged_type_primitives/test.json b/testsuite/ada_lsp/rename.tagged_type_primitives/test.json index 5ce76bea2..8d31a2e9e 100644 --- a/testsuite/ada_lsp/rename.tagged_type_primitives/test.json +++ b/testsuite/ada_lsp/rename.tagged_type_primitives/test.json @@ -52,33 +52,8 @@ "id": 1, "result": { "capabilities": { - "typeDefinitionProvider": true, - "alsReferenceKinds": [ - "reference", - "access", - "write", - "call", - "dispatching call", - "parent", - "child", - "overriding" - ], - "hoverProvider": true, - "definitionProvider": true, "renameProvider": {}, - "referencesProvider": true, - "declarationProvider": true, - "textDocumentSync": 2, - "completionProvider": { - "triggerCharacters": [ - ".", - ",", - "'", - "(" - ], - "resolveProvider": true - }, - "documentSymbolProvider": true + "textDocumentSync": 2 } } } diff --git a/testsuite/ada_lsp/rename.tagged_type_primitives/test.yaml b/testsuite/ada_lsp/rename.tagged_type_primitives/test.yaml index e6c233318..69a40f07a 100644 --- a/testsuite/ada_lsp/rename.tagged_type_primitives/test.yaml +++ b/testsuite/ada_lsp/rename.tagged_type_primitives/test.yaml @@ -1,4 +1 @@ title: 'rename.tagged_type_primitives' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/rename/rename.json b/testsuite/ada_lsp/rename/rename.json index dbe6ac460..4af1c39b4 100644 --- a/testsuite/ada_lsp/rename/rename.json +++ b/testsuite/ada_lsp/rename/rename.json @@ -19,7 +19,7 @@ "result":{ "capabilities":{ "textDocumentSync": 2, - "renameProvider":{} + "renameProvider": {} } } }] @@ -141,8 +141,6 @@ "wait":[{ "id": "rename-2", "result":{ - "changes":{ - } } }] } diff --git a/testsuite/ada_lsp/rename/test.yaml b/testsuite/ada_lsp/rename/test.yaml index 7d0b374ee..de8e16831 100644 --- a/testsuite/ada_lsp/rename/test.yaml +++ b/testsuite/ada_lsp/rename/test.yaml @@ -1,4 +1 @@ title: 'rename' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] From 96c9fc605ee5cf7981e16c6cef7b0edd7a81b467 Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Tue, 29 Aug 2023 12:20:11 +0300 Subject: [PATCH 064/152] Fix LSP generator * Fix typo Varian -> Variant * Add "Do NOT edit" header in generated files * Fix token type for progress report (ProgressToken instead of string-or-int) * change error code type to Integer to be able to hold LSPResponseError code also Refs #1172 --- gnat/lsp_3_17.gpr | 12 ++++++++++++ source/lsp_gen/config/3_17.json5 | 2 ++ .../generated/lsp_gen-entities-inputs.adb | 2 ++ .../generated/lsp_gen-entities-inputs.ads | 2 ++ .../generated/lsp_gen-entities-outputs.adb | 2 ++ .../generated/lsp_gen-entities-outputs.ads | 2 ++ source/lsp_gen/generated/lsp_gen-entities.adb | 2 ++ source/lsp_gen/generated/lsp_gen-entities.ads | 2 ++ source/lsp_gen/header.adt | 2 ++ source/lsp_gen/lsp_gen-factories.adb | 8 ++++---- source/lsp_gen/lsp_gen-inputs.adb | 14 +++++++------- source/lsp_gen/lsp_gen-meta_models.adb | 2 +- source/lsp_gen/lsp_gen-notifications.adb | 4 ++-- source/lsp_gen/lsp_gen-progress_reports.adb | 16 ++++++++-------- source/lsp_gen/lsp_gen-requests.adb | 4 ++-- source/lsp_gen/lsp_gen-responses.adb | 9 ++++++--- source/lsp_gen/lsp_gen-structures.adb | 1 + 17 files changed, 59 insertions(+), 27 deletions(-) diff --git a/gnat/lsp_3_17.gpr b/gnat/lsp_3_17.gpr index c8ef0417a..8e65552bb 100644 --- a/gnat/lsp_3_17.gpr +++ b/gnat/lsp_3_17.gpr @@ -118,4 +118,16 @@ project LSP_3_17 is end case; end Naming; + + package Pretty_Printer is + for Default_Switches ("ada") use + ("--no-align-modes", + "--no-separate-is", + "--comments-fill", + "--call-threshold=1", + "--par-threshold=2", + "--vertical-named-aggregates", + "--wide-character-encoding=8"); + end Pretty_Printer; + end LSP_3_17; diff --git a/source/lsp_gen/config/3_17.json5 b/source/lsp_gen/config/3_17.json5 index 32561fc08..ce9208b97 100644 --- a/source/lsp_gen/config/3_17.json5 +++ b/source/lsp_gen/config/3_17.json5 @@ -5,6 +5,8 @@ "Copyright (C) , ", "", "SPDX-License-Identifier: MIT", + "", + "DON'T EDIT THIS FILE! It was generated from metaModel.json.", "" ], diff --git a/source/lsp_gen/generated/lsp_gen-entities-inputs.adb b/source/lsp_gen/generated/lsp_gen-entities-inputs.adb index cc8c58c21..adbb90433 100644 --- a/source/lsp_gen/generated/lsp_gen-entities-inputs.adb +++ b/source/lsp_gen/generated/lsp_gen-entities-inputs.adb @@ -17,6 +17,8 @@ -- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -- DEALINGS IN THE SOFTWARE. +-- +-- DON'T EDIT THIS FILE! It was generated from metaModel.schema.json. pragma Ada_2022; with Minimal_Perfect_Hash; diff --git a/source/lsp_gen/generated/lsp_gen-entities-inputs.ads b/source/lsp_gen/generated/lsp_gen-entities-inputs.ads index 6399e07d7..bcfccf493 100644 --- a/source/lsp_gen/generated/lsp_gen-entities-inputs.ads +++ b/source/lsp_gen/generated/lsp_gen-entities-inputs.ads @@ -17,6 +17,8 @@ -- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -- DEALINGS IN THE SOFTWARE. +-- +-- DON'T EDIT THIS FILE! It was generated from metaModel.schema.json. with VSS.JSON.Pull_Readers; diff --git a/source/lsp_gen/generated/lsp_gen-entities-outputs.adb b/source/lsp_gen/generated/lsp_gen-entities-outputs.adb index 6d970500a..14f58c269 100644 --- a/source/lsp_gen/generated/lsp_gen-entities-outputs.adb +++ b/source/lsp_gen/generated/lsp_gen-entities-outputs.adb @@ -17,6 +17,8 @@ -- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -- DEALINGS IN THE SOFTWARE. +-- +-- DON'T EDIT THIS FILE! It was generated from metaModel.schema.json. with Interfaces; package body LSP_Gen.Entities.Outputs is diff --git a/source/lsp_gen/generated/lsp_gen-entities-outputs.ads b/source/lsp_gen/generated/lsp_gen-entities-outputs.ads index bc6794e5d..99e19a463 100644 --- a/source/lsp_gen/generated/lsp_gen-entities-outputs.ads +++ b/source/lsp_gen/generated/lsp_gen-entities-outputs.ads @@ -17,6 +17,8 @@ -- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -- DEALINGS IN THE SOFTWARE. +-- +-- DON'T EDIT THIS FILE! It was generated from metaModel.schema.json. with VSS.JSON.Content_Handlers; diff --git a/source/lsp_gen/generated/lsp_gen-entities.adb b/source/lsp_gen/generated/lsp_gen-entities.adb index 03abc3e1e..aaf0b0cc2 100644 --- a/source/lsp_gen/generated/lsp_gen-entities.adb +++ b/source/lsp_gen/generated/lsp_gen-entities.adb @@ -17,6 +17,8 @@ -- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -- DEALINGS IN THE SOFTWARE. +-- +-- DON'T EDIT THIS FILE! It was generated from metaModel.schema.json. with Ada.Unchecked_Deallocation; diff --git a/source/lsp_gen/generated/lsp_gen-entities.ads b/source/lsp_gen/generated/lsp_gen-entities.ads index 26837b281..3b1d312d1 100644 --- a/source/lsp_gen/generated/lsp_gen-entities.ads +++ b/source/lsp_gen/generated/lsp_gen-entities.ads @@ -17,6 +17,8 @@ -- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -- DEALINGS IN THE SOFTWARE. +-- +-- DON'T EDIT THIS FILE! It was generated from metaModel.schema.json. with Ada.Containers.Doubly_Linked_Lists; with Ada.Finalization; diff --git a/source/lsp_gen/header.adt b/source/lsp_gen/header.adt index 6cad05bf7..bbf45de1d 100644 --- a/source/lsp_gen/header.adt +++ b/source/lsp_gen/header.adt @@ -17,3 +17,5 @@ -- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -- DEALINGS IN THE SOFTWARE. +-- +-- DON'T EDIT THIS FILE! It was generated from metaModel.schema.json. \ No newline at end of file diff --git a/source/lsp_gen/lsp_gen-factories.adb b/source/lsp_gen/lsp_gen-factories.adb index 1f0f94669..128be6de8 100644 --- a/source/lsp_gen/lsp_gen-factories.adb +++ b/source/lsp_gen/lsp_gen-factories.adb @@ -136,7 +136,7 @@ package body LSP_Gen.Factories is Put ("(Self : in out "); Put (Name); Put_Line (";"); - Put_Line ("Token : LSP.Structures.Integer_Or_Virtual_String;"); + Put_Line ("Token : LSP.Structures.ProgressToken;"); Put ("Value : LSP.Structures."); Put (LSP_Gen.Progress_Reports.Result_Type (Model, Done, J)); Put_Line (");"); @@ -151,7 +151,7 @@ package body LSP_Gen.Factories is Put ("(Self : in out "); Put (Name); Put_Line (";"); - Put_Line ("Token : LSP.Structures.Integer_Or_Virtual_String;"); + Put_Line ("Token : LSP.Structures.ProgressToken;"); Put ("Value : LSP.Structures.WorkDone"); Put (Work_Done); Put_Line (");"); @@ -313,7 +313,7 @@ package body LSP_Gen.Factories is Put ("(Self : in out "); Put (Name); Put_Line (";"); - Put_Line ("Token : LSP.Structures.Integer_Or_Virtual_String;"); + Put_Line ("Token : LSP.Structures.ProgressToken;"); Put ("Value : LSP.Structures."); Put (LSP_Gen.Progress_Reports.Result_Type (Model, Done, J)); Put_Line (") is"); @@ -335,7 +335,7 @@ package body LSP_Gen.Factories is Put ("(Self : in out "); Put (Name); Put_Line (";"); - Put_Line ("Token : LSP.Structures.Integer_Or_Virtual_String;"); + Put_Line ("Token : LSP.Structures.ProgressToken;"); Put ("Value : LSP.Structures.WorkDone"); Put (Work_Done); Put_Line (") is"); diff --git a/source/lsp_gen/lsp_gen-inputs.adb b/source/lsp_gen/lsp_gen-inputs.adb index 7db422bfe..feb5f09c0 100644 --- a/source/lsp_gen/lsp_gen-inputs.adb +++ b/source/lsp_gen/lsp_gen-inputs.adb @@ -512,7 +512,7 @@ package body LSP_Gen.Inputs is Item : constant VSS.Strings.Virtual_String := Model.Get_Variant (List (J), J); begin - if not Item.Starts_With ("Varian") then + if not Item.Starts_With ("Variant") then Variants.Append (Item); end if; end; @@ -798,7 +798,7 @@ package body LSP_Gen.Inputs is if not Spec and Info.a_type.name = LSP_Gen.Entities.Enum.string then Put ("package "); Put_Id (Name); - Put ("_Map is new Minimal_Perfect_Hash (("); + Put ("_Map is new Minimal_Perfect_Hash (["); for J in 1 .. Info.values.Length loop if J > 1 then @@ -809,7 +809,7 @@ package body LSP_Gen.Inputs is Put (Info.values (J).value.String); Put_Line (""""); end loop; - Put_Line ("));"); + Put_Line ("]);"); New_Line; end if; @@ -1290,7 +1290,7 @@ package body LSP_Gen.Inputs is Put_Line ("_Scope is"); Put ("package "); Put_Id (Name); - Put ("_Map is new Minimal_Perfect_Hash (("); + Put ("_Map is new Minimal_Perfect_Hash (["); for J in 1 .. Name_List.Length loop if J > 1 then @@ -1301,7 +1301,7 @@ package body LSP_Gen.Inputs is Put (Name_List (J)); Put_Line (""""); end loop; - Put_Line ("));"); + Put_Line ("]);"); New_Line; Write_Nested_Types_Maps (Model, Done, Name); @@ -1833,12 +1833,12 @@ package body LSP_Gen.Inputs is Put_Line ("_Scope is"); Put ("package "); Put_Id (Name); - Put ("_Map is new Minimal_Perfect_Hash (("); + Put ("_Map is new Minimal_Perfect_Hash (["); end Put_Prolog; procedure Put_Epilog (Name : VSS.Strings.Virtual_String) is begin - Put_Line ("));"); + Put_Line ("]);"); New_Line; Write_Nested_Types_Maps (Model, Done, Name); diff --git a/source/lsp_gen/lsp_gen-meta_models.adb b/source/lsp_gen/lsp_gen-meta_models.adb index f9e217e0d..9221cc2be 100644 --- a/source/lsp_gen/lsp_gen-meta_models.adb +++ b/source/lsp_gen/lsp_gen-meta_models.adb @@ -330,7 +330,7 @@ package body LSP_Gen.Meta_Models is end if; return - "Varian_" & VSS.Strings.To_Virtual_String (Image (2 .. Image'Last)); + "Variant_" & VSS.Strings.To_Virtual_String (Image (2 .. Image'Last)); end Get_Variant; ------------------ diff --git a/source/lsp_gen/lsp_gen-notifications.adb b/source/lsp_gen/lsp_gen-notifications.adb index 4fbaf72db..273dff762 100644 --- a/source/lsp_gen/lsp_gen-notifications.adb +++ b/source/lsp_gen/lsp_gen-notifications.adb @@ -188,7 +188,7 @@ package body LSP_Gen.Notifications is Put_Line ("_Notification_Readers is"); New_Line; - Put_Line ("package Method_Map is new Minimal_Perfect_Hash (("); + Put_Line ("package Method_Map is new Minimal_Perfect_Hash (["); for J of Model.Notifications loop if Model.Message_Direction (J) in From | From_Both then if First then @@ -203,7 +203,7 @@ package body LSP_Gen.Notifications is end if; end loop; - Put_Line ("));"); + Put_Line ("]);"); New_Line; Put_Line ("procedure Initialize is begin Method_Map.Initialize; end;"); New_Line; diff --git a/source/lsp_gen/lsp_gen-progress_reports.adb b/source/lsp_gen/lsp_gen-progress_reports.adb index 4d93071c4..66ebfdbda 100644 --- a/source/lsp_gen/lsp_gen-progress_reports.adb +++ b/source/lsp_gen/lsp_gen-progress_reports.adb @@ -124,7 +124,7 @@ package body LSP_Gen.Progress_Reports is Put ("package body LSP.Progress_Report_Readers is"); New_Line; - Put_Line ("package Method_Map is new Minimal_Perfect_Hash (("); + Put_Line ("package Method_Map is new Minimal_Perfect_Hash (["); for J of Model.Requests loop if Model.Message_Direction (J) = From and then Model.Request (J).partialResult.Is_Set @@ -148,7 +148,7 @@ package body LSP_Gen.Progress_Reports is Put (""""); end loop; - Put_Line ("));"); + Put_Line ("]);"); New_Line; Put_Line ("procedure Initialize is begin Method_Map.Initialize; end;"); New_Line; @@ -283,7 +283,7 @@ package body LSP_Gen.Progress_Reports is Put ("(Self : in out "); Put (Name); Put_Line (";"); - Put_Line ("Token : LSP.Structures.Integer_Or_Virtual_String;"); + Put_Line ("Token : LSP.Structures.ProgressToken;"); Put ("Value : LSP.Structures."); Put (Result_Type (Model, Done, J)); @@ -301,7 +301,7 @@ package body LSP_Gen.Progress_Reports is Put ("(Self : in out "); Put (Name); Put_Line (";"); - Put_Line ("Token : LSP.Structures.Integer_Or_Virtual_String;"); + Put_Line ("Token : LSP.Structures.ProgressToken;"); Put ("Value : LSP.Structures.WorkDone"); Put (Work_Done); Put_Line (") is null;"); @@ -460,7 +460,7 @@ package body LSP_Gen.Progress_Reports is Put ("(Self : in out "); Put (Name); Put_Line (";"); - Put_Line ("Token : LSP.Structures.Integer_Or_Virtual_String;"); + Put_Line ("Token : LSP.Structures.ProgressToken;"); Put ("Value : LSP.Structures."); Put (Result_Type (Model, Done, J)); Put_Line (");"); @@ -475,7 +475,7 @@ package body LSP_Gen.Progress_Reports is Put ("(Self : in out "); Put (Name); Put_Line (";"); - Put_Line ("Token : LSP.Structures.Integer_Or_Virtual_String;"); + Put_Line ("Token : LSP.Structures.ProgressToken;"); Put ("Value : LSP.Structures.WorkDone"); Put (Work_Done); Put_Line (");"); @@ -505,7 +505,7 @@ package body LSP_Gen.Progress_Reports is Put ("(Self : in out "); Put (Name); Put_Line (";"); - Put_Line ("Token : LSP.Structures.Integer_Or_Virtual_String;"); + Put_Line ("Token : LSP.Structures.ProgressToken;"); Put ("Value : LSP.Structures."); Put (Result_Type (Model, Done, J)); Put_Line (") is"); @@ -532,7 +532,7 @@ package body LSP_Gen.Progress_Reports is Put ("(Self : in out "); Put (Name); Put_Line (";"); - Put_Line ("Token : LSP.Structures.Integer_Or_Virtual_String;"); + Put_Line ("Token : LSP.Structures.ProgressToken;"); Put ("Value : LSP.Structures.WorkDone"); Put (Work_Done); Put_Line (") is"); diff --git a/source/lsp_gen/lsp_gen-requests.adb b/source/lsp_gen/lsp_gen-requests.adb index e1db00908..2ed8779fb 100644 --- a/source/lsp_gen/lsp_gen-requests.adb +++ b/source/lsp_gen/lsp_gen-requests.adb @@ -186,7 +186,7 @@ package body LSP_Gen.Requests is Put_Line ("_Request_Readers is"); New_Line; - Put_Line ("package Method_Map is new Minimal_Perfect_Hash (("); + Put_Line ("package Method_Map is new Minimal_Perfect_Hash (["); for J of Model.Requests loop if Model.Message_Direction (J) in From | From_Both then if First then @@ -201,7 +201,7 @@ package body LSP_Gen.Requests is end if; end loop; - Put_Line ("));"); + Put_Line ("]);"); New_Line; Put_Line ("procedure Initialize is begin Method_Map.Initialize; end;"); New_Line; diff --git a/source/lsp_gen/lsp_gen-responses.adb b/source/lsp_gen/lsp_gen-responses.adb index 3cad7f705..5c477c993 100644 --- a/source/lsp_gen/lsp_gen-responses.adb +++ b/source/lsp_gen/lsp_gen-responses.adb @@ -200,7 +200,7 @@ package body LSP_Gen.Responses is Put_Line ("_Response_Readers is"); New_Line; - Put_Line ("package Method_Map is new Minimal_Perfect_Hash (("); + Put_Line ("package Method_Map is new Minimal_Perfect_Hash (["); for J of Model.Requests loop if Model.Message_Direction (J) in From | From_Both then if First then @@ -215,7 +215,7 @@ package body LSP_Gen.Responses is end if; end loop; - Put_Line ("));"); + Put_Line ("]);"); New_Line; Put_Line ("procedure Initialize is begin Method_Map.Initialize; end;"); New_Line; @@ -437,6 +437,8 @@ package body LSP_Gen.Responses is Put_Lines (Model.License_Header, "-- "); New_Line; + Put_Line ("with Interfaces;"); + New_Line; Put_Line ("with LSP.Output_Tools;"); Put_Line ("with LSP.Outputs;"); New_Line; @@ -493,7 +495,8 @@ package body LSP_Gen.Responses is Put_Line ("Self.Output.Key_Name (""error"");"); Put_Line ("Self.Output.Start_Object;"); Put_Line ("Self.Output.Key_Name (""code"");"); - Put_Line ("LSP.Outputs.Write_ErrorCodes (Self.Output.all, Value.code);"); + Put ("Self.Output.Integer_Value (Interfaces.Integer_64'Val"); + Put_Line (" (Value.code));"); Put_Line ("Self.Output.Key_Name (""message"");"); Put_Line ("Self.Output.String_Value (Value.message);"); Put_Line ("Self.Output.End_Object;"); diff --git a/source/lsp_gen/lsp_gen-structures.adb b/source/lsp_gen/lsp_gen-structures.adb index c6ad248cb..590e1ce92 100644 --- a/source/lsp_gen/lsp_gen-structures.adb +++ b/source/lsp_gen/lsp_gen-structures.adb @@ -1711,6 +1711,7 @@ package body LSP_Gen.Structures is end loop; Done (To_Reference ("ErrorCodes")).Is_Message := True; + Done (To_Reference ("ProgressToken")).Is_Message := True; Write_Private_Part; Put_Line ("end LSP.Structures;"); From 744be6da408a49f58f9dc4fa04b92dd45c7b887e Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Tue, 29 Aug 2023 12:21:55 +0300 Subject: [PATCH 065/152] Regenerate LSP code after changes in the generator Refs #1172 --- .../lsp-base_notification_receivers.ads | 2 + .../lsp-base_notification_writers.adb | 2 + .../lsp-base_notification_writers.ads | 2 + .../lsp-client_message_factories.adb | 64 +- .../lsp-client_message_factories.ads | 64 +- .../lsp-client_notification_readers.adb | 14 +- .../lsp-client_notification_receivers.ads | 2 + .../lsp-client_notification_writers.adb | 2 + .../lsp-client_notification_writers.ads | 2 + ...lsp-client_notifications-cancelrequest.adb | 2 + ...lsp-client_notifications-cancelrequest.ads | 2 + .../lsp-client_notifications-event.adb | 2 + .../lsp-client_notifications-event.ads | 2 + .../lsp-client_notifications-logmessage.adb | 2 + .../lsp-client_notifications-logmessage.ads | 2 + .../lsp-client_notifications-logtrace.adb | 2 + .../lsp-client_notifications-logtrace.ads | 2 + .../lsp-client_notifications-progress.adb | 2 + .../lsp-client_notifications-progress.ads | 2 + ...lient_notifications-publishdiagnostics.adb | 2 + ...lient_notifications-publishdiagnostics.ads | 2 + .../lsp-client_notifications-showmessage.adb | 2 + .../lsp-client_notifications-showmessage.ads | 2 + .../generated/lsp-client_request_readers.adb | 26 +- .../lsp-client_request_receivers.ads | 2 + .../generated/lsp-client_request_writers.adb | 2 + .../generated/lsp-client_request_writers.ads | 2 + .../lsp-client_requests-applyedit.adb | 2 + .../lsp-client_requests-applyedit.ads | 2 + .../lsp-client_requests-code_lens_refresh.adb | 2 + .../lsp-client_requests-code_lens_refresh.ads | 2 + .../lsp-client_requests-configuration.adb | 2 + .../lsp-client_requests-configuration.ads | 2 + ...lsp-client_requests-diagnostic_refresh.adb | 2 + ...lsp-client_requests-diagnostic_refresh.ads | 2 + .../lsp-client_requests-inlay_refresh.adb | 2 + .../lsp-client_requests-inlay_refresh.ads | 2 + .../lsp-client_requests-inline_refresh.adb | 2 + .../lsp-client_requests-inline_refresh.ads | 2 + .../lsp-client_requests-progress_create.adb | 2 + .../lsp-client_requests-progress_create.ads | 2 + ...lsp-client_requests-registercapability.adb | 2 + ...lsp-client_requests-registercapability.ads | 2 + .../lsp-client_requests-showdocument.adb | 2 + .../lsp-client_requests-showdocument.ads | 2 + ...lsp-client_requests-showmessagerequest.adb | 2 + ...lsp-client_requests-showmessagerequest.ads | 2 + .../lsp-client_requests-tokens_refresh.adb | 2 + .../lsp-client_requests-tokens_refresh.ads | 2 + ...p-client_requests-unregistercapability.adb | 2 + ...p-client_requests-unregistercapability.ads | 2 + .../lsp-client_requests-workspacefolders.adb | 2 + .../lsp-client_requests-workspacefolders.ads | 2 + .../generated/lsp-client_response_readers.adb | 102 +- .../lsp-client_response_receivers.ads | 2 + .../generated/lsp-client_response_writers.adb | 6 +- .../generated/lsp-client_response_writers.ads | 2 + ...p-client_responses-code_action_resolve.adb | 2 + ...p-client_responses-code_action_resolve.ads | 2 + ...lsp-client_responses-code_lens_resolve.adb | 2 + ...lsp-client_responses-code_lens_resolve.ads | 2 + .../lsp-client_responses-codeaction.adb | 2 + .../lsp-client_responses-codeaction.ads | 2 + .../lsp-client_responses-codelens.adb | 2 + .../lsp-client_responses-codelens.ads | 2 + ...lsp-client_responses-colorpresentation.adb | 2 + ...lsp-client_responses-colorpresentation.ads | 2 + .../lsp-client_responses-completion.adb | 2 + .../lsp-client_responses-completion.ads | 2 + ...sp-client_responses-completion_resolve.adb | 2 + ...sp-client_responses-completion_resolve.ads | 2 + .../lsp-client_responses-declaration.adb | 2 + .../lsp-client_responses-declaration.ads | 2 + .../lsp-client_responses-definition.adb | 2 + .../lsp-client_responses-definition.ads | 2 + .../lsp-client_responses-diagnostic.adb | 2 + .../lsp-client_responses-diagnostic.ads | 2 + .../lsp-client_responses-documentcolor.adb | 2 + .../lsp-client_responses-documentcolor.ads | 2 + ...lsp-client_responses-documenthighlight.adb | 2 + ...lsp-client_responses-documenthighlight.ads | 2 + .../lsp-client_responses-documentlink.adb | 2 + .../lsp-client_responses-documentlink.ads | 2 + .../lsp-client_responses-documentsymbol.adb | 2 + .../lsp-client_responses-documentsymbol.ads | 2 + .../lsp-client_responses-executecommand.adb | 2 + .../lsp-client_responses-executecommand.ads | 2 + .../lsp-client_responses-foldingrange.adb | 2 + .../lsp-client_responses-foldingrange.ads | 2 + .../lsp-client_responses-formatting.adb | 2 + .../lsp-client_responses-formatting.ads | 2 + .../generated/lsp-client_responses-full.adb | 2 + .../generated/lsp-client_responses-full.ads | 2 + .../generated/lsp-client_responses-hover.adb | 2 + .../generated/lsp-client_responses-hover.ads | 2 + .../lsp-client_responses-implementation.adb | 2 + .../lsp-client_responses-implementation.ads | 2 + .../lsp-client_responses-incomingcalls.adb | 2 + .../lsp-client_responses-incomingcalls.ads | 2 + .../lsp-client_responses-initialize.adb | 2 + .../lsp-client_responses-initialize.ads | 2 + .../lsp-client_responses-inlay_resolve.adb | 2 + .../lsp-client_responses-inlay_resolve.ads | 2 + .../lsp-client_responses-inlayhint.adb | 2 + .../lsp-client_responses-inlayhint.ads | 2 + .../lsp-client_responses-inlinevalue.adb | 2 + .../lsp-client_responses-inlinevalue.ads | 2 + .../lsp-client_responses-link_resolve.adb | 2 + .../lsp-client_responses-link_resolve.ads | 2 + ...sp-client_responses-linkededitingrange.adb | 2 + ...sp-client_responses-linkededitingrange.ads | 2 + .../lsp-client_responses-moniker.adb | 2 + .../lsp-client_responses-moniker.ads | 2 + .../lsp-client_responses-ontypeformatting.adb | 2 + .../lsp-client_responses-ontypeformatting.ads | 2 + .../lsp-client_responses-outgoingcalls.adb | 2 + .../lsp-client_responses-outgoingcalls.ads | 2 + ...-client_responses-preparecallhierarchy.adb | 2 + ...-client_responses-preparecallhierarchy.ads | 2 + .../lsp-client_responses-preparerename.adb | 2 + .../lsp-client_responses-preparerename.ads | 2 + ...-client_responses-preparetypehierarchy.adb | 2 + ...-client_responses-preparetypehierarchy.ads | 2 + .../lsp-client_responses-rangeformatting.adb | 2 + .../lsp-client_responses-rangeformatting.ads | 2 + .../lsp-client_responses-references.adb | 2 + .../lsp-client_responses-references.ads | 2 + .../generated/lsp-client_responses-rename.adb | 2 + .../generated/lsp-client_responses-rename.ads | 2 + .../lsp-client_responses-selectionrange.adb | 2 + .../lsp-client_responses-selectionrange.ads | 2 + .../lsp-client_responses-shutdown.adb | 2 + .../lsp-client_responses-shutdown.ads | 2 + .../lsp-client_responses-signaturehelp.adb | 2 + .../lsp-client_responses-signaturehelp.ads | 2 + .../lsp-client_responses-subtypes.adb | 2 + .../lsp-client_responses-subtypes.ads | 2 + .../lsp-client_responses-supertypes.adb | 2 + .../lsp-client_responses-supertypes.ads | 2 + .../generated/lsp-client_responses-symbol.adb | 2 + .../generated/lsp-client_responses-symbol.ads | 2 + .../lsp-client_responses-symbol_resolve.adb | 2 + .../lsp-client_responses-symbol_resolve.ads | 2 + .../lsp-client_responses-tokens_delta.adb | 2 + .../lsp-client_responses-tokens_delta.ads | 2 + .../lsp-client_responses-tokens_range.adb | 2 + .../lsp-client_responses-tokens_range.ads | 2 + .../lsp-client_responses-typedefinition.adb | 2 + .../lsp-client_responses-typedefinition.ads | 2 + .../lsp-client_responses-willcreatefiles.adb | 2 + .../lsp-client_responses-willcreatefiles.ads | 2 + .../lsp-client_responses-willdeletefiles.adb | 2 + .../lsp-client_responses-willdeletefiles.ads | 2 + .../lsp-client_responses-willrenamefiles.adb | 2 + .../lsp-client_responses-willrenamefiles.ads | 2 + ...lsp-client_responses-willsavewaituntil.adb | 2 + ...lsp-client_responses-willsavewaituntil.ads | 2 + ...-client_responses-workspace_diagnostic.adb | 2 + ...-client_responses-workspace_diagnostic.ads | 2 + .../lsp_3.17/generated/lsp-enumerations.ads | 2 + source/lsp_3.17/generated/lsp-inputs.adb | 2029 ++++++++--------- source/lsp_3.17/generated/lsp-inputs.ads | 6 + source/lsp_3.17/generated/lsp-outputs.adb | 271 ++- source/lsp_3.17/generated/lsp-outputs.ads | 6 + .../generated/lsp-progress_report_readers.adb | 62 +- .../lsp-progress_report_receivers.ads | 64 +- .../generated/lsp-progress_report_writers.adb | 64 +- .../generated/lsp-progress_report_writers.ads | 64 +- .../lsp-progress_reports-codeaction.adb | 2 + .../lsp-progress_reports-codeaction.ads | 2 + .../lsp-progress_reports-codelens.adb | 2 + .../lsp-progress_reports-codelens.ads | 2 + ...lsp-progress_reports-colorpresentation.adb | 2 + ...lsp-progress_reports-colorpresentation.ads | 2 + .../lsp-progress_reports-completion.adb | 2 + .../lsp-progress_reports-completion.ads | 2 + .../lsp-progress_reports-declaration.adb | 2 + .../lsp-progress_reports-declaration.ads | 2 + .../lsp-progress_reports-definition.adb | 2 + .../lsp-progress_reports-definition.ads | 2 + .../lsp-progress_reports-diagnostic.adb | 2 + .../lsp-progress_reports-diagnostic.ads | 2 + .../lsp-progress_reports-documentcolor.adb | 2 + .../lsp-progress_reports-documentcolor.ads | 2 + ...lsp-progress_reports-documenthighlight.adb | 2 + ...lsp-progress_reports-documenthighlight.ads | 2 + .../lsp-progress_reports-documentlink.adb | 2 + .../lsp-progress_reports-documentlink.ads | 2 + .../lsp-progress_reports-documentsymbol.adb | 2 + .../lsp-progress_reports-documentsymbol.ads | 2 + .../lsp-progress_reports-foldingrange.adb | 2 + .../lsp-progress_reports-foldingrange.ads | 2 + .../generated/lsp-progress_reports-full.adb | 2 + .../generated/lsp-progress_reports-full.ads | 2 + .../lsp-progress_reports-implementation.adb | 2 + .../lsp-progress_reports-implementation.ads | 2 + .../lsp-progress_reports-incomingcalls.adb | 2 + .../lsp-progress_reports-incomingcalls.ads | 2 + .../lsp-progress_reports-inlayhint.adb | 2 + .../lsp-progress_reports-inlayhint.ads | 2 + .../lsp-progress_reports-inlinevalue.adb | 2 + .../lsp-progress_reports-inlinevalue.ads | 2 + .../lsp-progress_reports-moniker.adb | 2 + .../lsp-progress_reports-moniker.ads | 2 + .../lsp-progress_reports-outgoingcalls.adb | 2 + .../lsp-progress_reports-outgoingcalls.ads | 2 + .../lsp-progress_reports-progressbegin.adb | 2 + .../lsp-progress_reports-progressbegin.ads | 2 + .../lsp-progress_reports-progressend.adb | 2 + .../lsp-progress_reports-progressend.ads | 2 + .../lsp-progress_reports-progressreport.adb | 2 + .../lsp-progress_reports-progressreport.ads | 2 + .../lsp-progress_reports-references.adb | 2 + .../lsp-progress_reports-references.ads | 2 + .../lsp-progress_reports-selectionrange.adb | 2 + .../lsp-progress_reports-selectionrange.ads | 2 + .../lsp-progress_reports-subtypes.adb | 2 + .../lsp-progress_reports-subtypes.ads | 2 + .../lsp-progress_reports-supertypes.adb | 2 + .../lsp-progress_reports-supertypes.ads | 2 + .../generated/lsp-progress_reports-symbol.adb | 2 + .../generated/lsp-progress_reports-symbol.ads | 2 + .../lsp-progress_reports-tokens_delta.adb | 2 + .../lsp-progress_reports-tokens_delta.ads | 2 + .../lsp-progress_reports-tokens_range.adb | 2 + .../lsp-progress_reports-tokens_range.ads | 2 + .../lsp-progress_reports-typedefinition.adb | 2 + .../lsp-progress_reports-typedefinition.ads | 2 + ...-progress_reports-workspace_diagnostic.adb | 2 + ...-progress_reports-workspace_diagnostic.ads | 2 + .../lsp-server_notification_readers.adb | 42 +- .../lsp-server_notification_receivers.ads | 2 + .../lsp-server_notification_writers.adb | 2 + .../lsp-server_notification_writers.ads | 2 + .../lsp-server_notifications-cancel.adb | 2 + .../lsp-server_notifications-cancel.ads | 2 + ...lsp-server_notifications-cancelrequest.adb | 2 + ...lsp-server_notifications-cancelrequest.ads | 2 + .../lsp-server_notifications-didchange.adb | 2 + .../lsp-server_notifications-didchange.ads | 2 + ...r_notifications-didchangeconfiguration.adb | 2 + ...r_notifications-didchangeconfiguration.ads | 2 + ...server_notifications-didchangenotebook.adb | 2 + ...server_notifications-didchangenotebook.ads | 2 + ...er_notifications-didchangewatchedfiles.adb | 2 + ...er_notifications-didchangewatchedfiles.ads | 2 + ...otifications-didchangeworkspacefolders.adb | 2 + ...otifications-didchangeworkspacefolders.ads | 2 + .../lsp-server_notifications-didclose.adb | 2 + .../lsp-server_notifications-didclose.ads | 2 + ...-server_notifications-didclosenotebook.adb | 2 + ...-server_notifications-didclosenotebook.ads | 2 + ...sp-server_notifications-didcreatefiles.adb | 2 + ...sp-server_notifications-didcreatefiles.ads | 2 + ...sp-server_notifications-diddeletefiles.adb | 2 + ...sp-server_notifications-diddeletefiles.ads | 2 + .../lsp-server_notifications-didopen.adb | 2 + .../lsp-server_notifications-didopen.ads | 2 + ...p-server_notifications-didopennotebook.adb | 2 + ...p-server_notifications-didopennotebook.ads | 2 + ...sp-server_notifications-didrenamefiles.adb | 2 + ...sp-server_notifications-didrenamefiles.ads | 2 + .../lsp-server_notifications-didsave.adb | 2 + .../lsp-server_notifications-didsave.ads | 2 + ...p-server_notifications-didsavenotebook.adb | 2 + ...p-server_notifications-didsavenotebook.ads | 2 + .../lsp-server_notifications-exits.adb | 2 + .../lsp-server_notifications-exits.ads | 2 + .../lsp-server_notifications-initialized.adb | 2 + .../lsp-server_notifications-initialized.ads | 2 + .../lsp-server_notifications-progress.adb | 2 + .../lsp-server_notifications-progress.ads | 2 + .../lsp-server_notifications-settrace.adb | 2 + .../lsp-server_notifications-settrace.ads | 2 + .../lsp-server_notifications-willsave.adb | 2 + .../lsp-server_notifications-willsave.ads | 2 + .../generated/lsp-server_request_readers.adb | 102 +- .../lsp-server_request_receivers.ads | 2 + .../generated/lsp-server_request_writers.adb | 2 + .../generated/lsp-server_request_writers.ads | 2 + ...sp-server_requests-code_action_resolve.adb | 2 + ...sp-server_requests-code_action_resolve.ads | 2 + .../lsp-server_requests-code_lens_resolve.adb | 2 + .../lsp-server_requests-code_lens_resolve.ads | 2 + .../lsp-server_requests-codeaction.adb | 2 + .../lsp-server_requests-codeaction.ads | 2 + .../lsp-server_requests-codelens.adb | 2 + .../lsp-server_requests-codelens.ads | 2 + .../lsp-server_requests-colorpresentation.adb | 2 + .../lsp-server_requests-colorpresentation.ads | 2 + .../lsp-server_requests-completion.adb | 2 + .../lsp-server_requests-completion.ads | 2 + ...lsp-server_requests-completion_resolve.adb | 2 + ...lsp-server_requests-completion_resolve.ads | 2 + .../lsp-server_requests-declaration.adb | 2 + .../lsp-server_requests-declaration.ads | 2 + .../lsp-server_requests-definition.adb | 2 + .../lsp-server_requests-definition.ads | 2 + .../lsp-server_requests-diagnostic.adb | 2 + .../lsp-server_requests-diagnostic.ads | 2 + .../lsp-server_requests-documentcolor.adb | 2 + .../lsp-server_requests-documentcolor.ads | 2 + .../lsp-server_requests-documenthighlight.adb | 2 + .../lsp-server_requests-documenthighlight.ads | 2 + .../lsp-server_requests-documentlink.adb | 2 + .../lsp-server_requests-documentlink.ads | 2 + .../lsp-server_requests-documentsymbol.adb | 2 + .../lsp-server_requests-documentsymbol.ads | 2 + .../lsp-server_requests-executecommand.adb | 2 + .../lsp-server_requests-executecommand.ads | 2 + .../lsp-server_requests-foldingrange.adb | 2 + .../lsp-server_requests-foldingrange.ads | 2 + .../lsp-server_requests-formatting.adb | 2 + .../lsp-server_requests-formatting.ads | 2 + .../generated/lsp-server_requests-full.adb | 2 + .../generated/lsp-server_requests-full.ads | 2 + .../generated/lsp-server_requests-hover.adb | 2 + .../generated/lsp-server_requests-hover.ads | 2 + .../lsp-server_requests-implementation.adb | 2 + .../lsp-server_requests-implementation.ads | 2 + .../lsp-server_requests-incomingcalls.adb | 2 + .../lsp-server_requests-incomingcalls.ads | 2 + .../lsp-server_requests-initialize.adb | 2 + .../lsp-server_requests-initialize.ads | 2 + .../lsp-server_requests-inlay_resolve.adb | 2 + .../lsp-server_requests-inlay_resolve.ads | 2 + .../lsp-server_requests-inlayhint.adb | 2 + .../lsp-server_requests-inlayhint.ads | 2 + .../lsp-server_requests-inlinevalue.adb | 2 + .../lsp-server_requests-inlinevalue.ads | 2 + .../lsp-server_requests-link_resolve.adb | 2 + .../lsp-server_requests-link_resolve.ads | 2 + ...lsp-server_requests-linkededitingrange.adb | 2 + ...lsp-server_requests-linkededitingrange.ads | 2 + .../generated/lsp-server_requests-moniker.adb | 2 + .../generated/lsp-server_requests-moniker.ads | 2 + .../lsp-server_requests-ontypeformatting.adb | 2 + .../lsp-server_requests-ontypeformatting.ads | 2 + .../lsp-server_requests-outgoingcalls.adb | 2 + .../lsp-server_requests-outgoingcalls.ads | 2 + ...p-server_requests-preparecallhierarchy.adb | 2 + ...p-server_requests-preparecallhierarchy.ads | 2 + .../lsp-server_requests-preparerename.adb | 2 + .../lsp-server_requests-preparerename.ads | 2 + ...p-server_requests-preparetypehierarchy.adb | 2 + ...p-server_requests-preparetypehierarchy.ads | 2 + .../lsp-server_requests-rangeformatting.adb | 2 + .../lsp-server_requests-rangeformatting.ads | 2 + .../lsp-server_requests-references.adb | 2 + .../lsp-server_requests-references.ads | 2 + .../generated/lsp-server_requests-rename.adb | 2 + .../generated/lsp-server_requests-rename.ads | 2 + .../lsp-server_requests-selectionrange.adb | 2 + .../lsp-server_requests-selectionrange.ads | 2 + .../lsp-server_requests-shutdown.adb | 2 + .../lsp-server_requests-shutdown.ads | 2 + .../lsp-server_requests-signaturehelp.adb | 2 + .../lsp-server_requests-signaturehelp.ads | 2 + .../lsp-server_requests-subtypes.adb | 2 + .../lsp-server_requests-subtypes.ads | 2 + .../lsp-server_requests-supertypes.adb | 2 + .../lsp-server_requests-supertypes.ads | 2 + .../generated/lsp-server_requests-symbol.adb | 2 + .../generated/lsp-server_requests-symbol.ads | 2 + .../lsp-server_requests-symbol_resolve.adb | 2 + .../lsp-server_requests-symbol_resolve.ads | 2 + .../lsp-server_requests-tokens_delta.adb | 2 + .../lsp-server_requests-tokens_delta.ads | 2 + .../lsp-server_requests-tokens_range.adb | 2 + .../lsp-server_requests-tokens_range.ads | 2 + .../lsp-server_requests-typedefinition.adb | 2 + .../lsp-server_requests-typedefinition.ads | 2 + .../lsp-server_requests-willcreatefiles.adb | 2 + .../lsp-server_requests-willcreatefiles.ads | 2 + .../lsp-server_requests-willdeletefiles.adb | 2 + .../lsp-server_requests-willdeletefiles.ads | 2 + .../lsp-server_requests-willrenamefiles.adb | 2 + .../lsp-server_requests-willrenamefiles.ads | 2 + .../lsp-server_requests-willsavewaituntil.adb | 2 + .../lsp-server_requests-willsavewaituntil.ads | 2 + ...p-server_requests-workspace_diagnostic.adb | 2 + ...p-server_requests-workspace_diagnostic.ads | 2 + .../generated/lsp-server_response_readers.adb | 26 +- .../lsp-server_response_receivers.ads | 2 + .../generated/lsp-server_response_writers.adb | 6 +- .../generated/lsp-server_response_writers.ads | 2 + .../lsp-server_responses-applyedit.adb | 2 + .../lsp-server_responses-applyedit.ads | 2 + ...lsp-server_responses-code_lens_refresh.adb | 2 + ...lsp-server_responses-code_lens_refresh.ads | 2 + .../lsp-server_responses-configuration.adb | 2 + .../lsp-server_responses-configuration.ads | 2 + ...sp-server_responses-diagnostic_refresh.adb | 2 + ...sp-server_responses-diagnostic_refresh.ads | 2 + .../lsp-server_responses-inlay_refresh.adb | 2 + .../lsp-server_responses-inlay_refresh.ads | 2 + .../lsp-server_responses-inline_refresh.adb | 2 + .../lsp-server_responses-inline_refresh.ads | 2 + .../lsp-server_responses-progress_create.adb | 2 + .../lsp-server_responses-progress_create.ads | 2 + ...sp-server_responses-registercapability.adb | 2 + ...sp-server_responses-registercapability.ads | 2 + .../lsp-server_responses-showdocument.adb | 2 + .../lsp-server_responses-showdocument.ads | 2 + ...sp-server_responses-showmessagerequest.adb | 2 + ...sp-server_responses-showmessagerequest.ads | 2 + .../lsp-server_responses-tokens_refresh.adb | 2 + .../lsp-server_responses-tokens_refresh.ads | 2 + ...-server_responses-unregistercapability.adb | 2 + ...-server_responses-unregistercapability.ads | 2 + .../lsp-server_responses-workspacefolders.adb | 2 + .../lsp-server_responses-workspacefolders.ads | 2 + source/lsp_3.17/generated/lsp-structures.ads | 328 +-- 413 files changed, 2483 insertions(+), 1651 deletions(-) diff --git a/source/lsp_3.17/generated/lsp-base_notification_receivers.ads b/source/lsp_3.17/generated/lsp-base_notification_receivers.ads index 39b7b5860..95a5f7a64 100644 --- a/source/lsp_3.17/generated/lsp-base_notification_receivers.ads +++ b/source/lsp_3.17/generated/lsp-base_notification_receivers.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-base_notification_writers.adb b/source/lsp_3.17/generated/lsp-base_notification_writers.adb index de73b59cb..05e9f09eb 100644 --- a/source/lsp_3.17/generated/lsp-base_notification_writers.adb +++ b/source/lsp_3.17/generated/lsp-base_notification_writers.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Output_Tools; with LSP.Outputs; diff --git a/source/lsp_3.17/generated/lsp-base_notification_writers.ads b/source/lsp_3.17/generated/lsp-base_notification_writers.ads index d3d948332..ec9e5b00a 100644 --- a/source/lsp_3.17/generated/lsp-base_notification_writers.ads +++ b/source/lsp_3.17/generated/lsp-base_notification_writers.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with VSS.JSON.Content_Handlers; with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-client_message_factories.adb b/source/lsp_3.17/generated/lsp-client_message_factories.adb index 496f8a169..bead27fe4 100644 --- a/source/lsp_3.17/generated/lsp-client_message_factories.adb +++ b/source/lsp_3.17/generated/lsp-client_message_factories.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Client_Responses.Errors; with LSP.Client_Notifications.LogTrace; @@ -851,7 +853,7 @@ package body LSP.Client_Message_Factories is overriding procedure On_IncomingCalls_Partial_Result (Self : in out Client_Message_Factory; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.CallHierarchyIncomingCall_Vector) is begin Client_Message_Factory'Class (Self).On_Message @@ -862,7 +864,7 @@ package body LSP.Client_Message_Factories is overriding procedure On_OutgoingCalls_Partial_Result (Self : in out Client_Message_Factory; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.CallHierarchyOutgoingCall_Vector) is begin Client_Message_Factory'Class (Self).On_Message @@ -873,7 +875,7 @@ package body LSP.Client_Message_Factories is overriding procedure On_CodeAction_Partial_Result (Self : in out Client_Message_Factory; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.Command_Or_CodeAction_Vector) is begin Client_Message_Factory'Class (Self).On_Message @@ -884,7 +886,7 @@ package body LSP.Client_Message_Factories is overriding procedure On_CodeLens_Partial_Result (Self : in out Client_Message_Factory; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.CodeLens_Vector) is begin Client_Message_Factory'Class (Self).On_Message @@ -895,7 +897,7 @@ package body LSP.Client_Message_Factories is overriding procedure On_ColorPresentation_Partial_Result (Self : in out Client_Message_Factory; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.ColorPresentation_Vector) is begin Client_Message_Factory'Class (Self).On_Message @@ -906,7 +908,7 @@ package body LSP.Client_Message_Factories is overriding procedure On_Completion_Partial_Result (Self : in out Client_Message_Factory; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.CompletionItem_Vector) is begin Client_Message_Factory'Class (Self).On_Message @@ -917,7 +919,7 @@ package body LSP.Client_Message_Factories is overriding procedure On_Declaration_Partial_Result (Self : in out Client_Message_Factory; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.Declaration_Progress_Report) is begin Client_Message_Factory'Class (Self).On_Message @@ -928,7 +930,7 @@ package body LSP.Client_Message_Factories is overriding procedure On_Definition_Partial_Result (Self : in out Client_Message_Factory; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.Definition_Progress_Report) is begin Client_Message_Factory'Class (Self).On_Message @@ -939,7 +941,7 @@ package body LSP.Client_Message_Factories is overriding procedure On_Diagnostic_Partial_Result (Self : in out Client_Message_Factory; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.DocumentDiagnosticReportPartialResult) is begin Client_Message_Factory'Class (Self).On_Message @@ -950,7 +952,7 @@ package body LSP.Client_Message_Factories is overriding procedure On_DocumentColor_Partial_Result (Self : in out Client_Message_Factory; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.ColorInformation_Vector) is begin Client_Message_Factory'Class (Self).On_Message @@ -961,7 +963,7 @@ package body LSP.Client_Message_Factories is overriding procedure On_DocumentHighlight_Partial_Result (Self : in out Client_Message_Factory; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.DocumentHighlight_Vector) is begin Client_Message_Factory'Class (Self).On_Message @@ -972,7 +974,7 @@ package body LSP.Client_Message_Factories is overriding procedure On_DocumentLink_Partial_Result (Self : in out Client_Message_Factory; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.DocumentLink_Vector) is begin Client_Message_Factory'Class (Self).On_Message @@ -983,7 +985,7 @@ package body LSP.Client_Message_Factories is overriding procedure On_DocumentSymbol_Partial_Result (Self : in out Client_Message_Factory; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.DocumentSymbol_Progress_Report) is begin Client_Message_Factory'Class (Self).On_Message @@ -994,7 +996,7 @@ package body LSP.Client_Message_Factories is overriding procedure On_FoldingRange_Partial_Result (Self : in out Client_Message_Factory; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.FoldingRange_Vector) is begin Client_Message_Factory'Class (Self).On_Message @@ -1005,7 +1007,7 @@ package body LSP.Client_Message_Factories is overriding procedure On_Implementation_Partial_Result (Self : in out Client_Message_Factory; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.Definition_Progress_Report) is begin Client_Message_Factory'Class (Self).On_Message @@ -1016,7 +1018,7 @@ package body LSP.Client_Message_Factories is overriding procedure On_InlayHint_Partial_Result (Self : in out Client_Message_Factory; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.InlayHint_Vector) is begin Client_Message_Factory'Class (Self).On_Message @@ -1027,7 +1029,7 @@ package body LSP.Client_Message_Factories is overriding procedure On_InlineValue_Partial_Result (Self : in out Client_Message_Factory; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.InlineValue_Vector) is begin Client_Message_Factory'Class (Self).On_Message @@ -1038,7 +1040,7 @@ package body LSP.Client_Message_Factories is overriding procedure On_Moniker_Partial_Result (Self : in out Client_Message_Factory; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.Moniker_Vector) is begin Client_Message_Factory'Class (Self).On_Message @@ -1049,7 +1051,7 @@ package body LSP.Client_Message_Factories is overriding procedure On_References_Partial_Result (Self : in out Client_Message_Factory; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.Location_Vector) is begin Client_Message_Factory'Class (Self).On_Message @@ -1060,7 +1062,7 @@ package body LSP.Client_Message_Factories is overriding procedure On_SelectionRange_Partial_Result (Self : in out Client_Message_Factory; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.SelectionRange_Vector) is begin Client_Message_Factory'Class (Self).On_Message @@ -1071,7 +1073,7 @@ package body LSP.Client_Message_Factories is overriding procedure On_Full_Partial_Result (Self : in out Client_Message_Factory; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.SemanticTokensPartialResult) is begin Client_Message_Factory'Class (Self).On_Message @@ -1082,7 +1084,7 @@ package body LSP.Client_Message_Factories is overriding procedure On_Tokens_Delta_Partial_Result (Self : in out Client_Message_Factory; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures .SemanticTokensPartialResult_Or_SemanticTokensDeltaPartialResult) is begin @@ -1094,7 +1096,7 @@ package body LSP.Client_Message_Factories is overriding procedure On_Tokens_Range_Partial_Result (Self : in out Client_Message_Factory; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.SemanticTokensPartialResult) is begin Client_Message_Factory'Class (Self).On_Message @@ -1105,7 +1107,7 @@ package body LSP.Client_Message_Factories is overriding procedure On_TypeDefinition_Partial_Result (Self : in out Client_Message_Factory; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.Definition_Progress_Report) is begin Client_Message_Factory'Class (Self).On_Message @@ -1116,7 +1118,7 @@ package body LSP.Client_Message_Factories is overriding procedure On_Subtypes_Partial_Result (Self : in out Client_Message_Factory; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.TypeHierarchyItem_Vector) is begin Client_Message_Factory'Class (Self).On_Message @@ -1127,7 +1129,7 @@ package body LSP.Client_Message_Factories is overriding procedure On_Supertypes_Partial_Result (Self : in out Client_Message_Factory; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.TypeHierarchyItem_Vector) is begin Client_Message_Factory'Class (Self).On_Message @@ -1138,7 +1140,7 @@ package body LSP.Client_Message_Factories is overriding procedure On_Workspace_Diagnostic_Partial_Result (Self : in out Client_Message_Factory; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.WorkspaceDiagnosticReportPartialResult) is begin Client_Message_Factory'Class (Self).On_Message @@ -1149,7 +1151,7 @@ package body LSP.Client_Message_Factories is overriding procedure On_Symbol_Partial_Result (Self : in out Client_Message_Factory; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.Symbol_Progress_Report) is begin Client_Message_Factory'Class (Self).On_Message @@ -1160,7 +1162,7 @@ package body LSP.Client_Message_Factories is overriding procedure On_ProgressBegin_Work_Done (Self : in out Client_Message_Factory; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.WorkDoneProgressBegin) is begin Client_Message_Factory'Class (Self).On_Message @@ -1171,7 +1173,7 @@ package body LSP.Client_Message_Factories is overriding procedure On_ProgressReport_Work_Done (Self : in out Client_Message_Factory; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.WorkDoneProgressReport) is begin Client_Message_Factory'Class (Self).On_Message @@ -1182,7 +1184,7 @@ package body LSP.Client_Message_Factories is overriding procedure On_ProgressEnd_Work_Done (Self : in out Client_Message_Factory; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.WorkDoneProgressEnd) is begin Client_Message_Factory'Class (Self).On_Message diff --git a/source/lsp_3.17/generated/lsp-client_message_factories.ads b/source/lsp_3.17/generated/lsp-client_message_factories.ads index 8d2137d14..09fce7f46 100644 --- a/source/lsp_3.17/generated/lsp-client_message_factories.ads +++ b/source/lsp_3.17/generated/lsp-client_message_factories.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Client_Message_Receivers; with LSP.Client_Messages; @@ -361,158 +363,158 @@ package LSP.Client_Message_Factories is overriding procedure On_IncomingCalls_Partial_Result (Self : in out Client_Message_Factory; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.CallHierarchyIncomingCall_Vector); overriding procedure On_OutgoingCalls_Partial_Result (Self : in out Client_Message_Factory; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.CallHierarchyOutgoingCall_Vector); overriding procedure On_CodeAction_Partial_Result (Self : in out Client_Message_Factory; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.Command_Or_CodeAction_Vector); overriding procedure On_CodeLens_Partial_Result (Self : in out Client_Message_Factory; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.CodeLens_Vector); overriding procedure On_ColorPresentation_Partial_Result (Self : in out Client_Message_Factory; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.ColorPresentation_Vector); overriding procedure On_Completion_Partial_Result (Self : in out Client_Message_Factory; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.CompletionItem_Vector); overriding procedure On_Declaration_Partial_Result (Self : in out Client_Message_Factory; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.Declaration_Progress_Report); overriding procedure On_Definition_Partial_Result (Self : in out Client_Message_Factory; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.Definition_Progress_Report); overriding procedure On_Diagnostic_Partial_Result (Self : in out Client_Message_Factory; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.DocumentDiagnosticReportPartialResult); overriding procedure On_DocumentColor_Partial_Result (Self : in out Client_Message_Factory; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.ColorInformation_Vector); overriding procedure On_DocumentHighlight_Partial_Result (Self : in out Client_Message_Factory; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.DocumentHighlight_Vector); overriding procedure On_DocumentLink_Partial_Result (Self : in out Client_Message_Factory; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.DocumentLink_Vector); overriding procedure On_DocumentSymbol_Partial_Result (Self : in out Client_Message_Factory; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.DocumentSymbol_Progress_Report); overriding procedure On_FoldingRange_Partial_Result (Self : in out Client_Message_Factory; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.FoldingRange_Vector); overriding procedure On_Implementation_Partial_Result (Self : in out Client_Message_Factory; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.Definition_Progress_Report); overriding procedure On_InlayHint_Partial_Result (Self : in out Client_Message_Factory; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.InlayHint_Vector); overriding procedure On_InlineValue_Partial_Result (Self : in out Client_Message_Factory; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.InlineValue_Vector); overriding procedure On_Moniker_Partial_Result (Self : in out Client_Message_Factory; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.Moniker_Vector); overriding procedure On_References_Partial_Result (Self : in out Client_Message_Factory; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.Location_Vector); overriding procedure On_SelectionRange_Partial_Result (Self : in out Client_Message_Factory; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.SelectionRange_Vector); overriding procedure On_Full_Partial_Result (Self : in out Client_Message_Factory; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.SemanticTokensPartialResult); overriding procedure On_Tokens_Delta_Partial_Result (Self : in out Client_Message_Factory; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures .SemanticTokensPartialResult_Or_SemanticTokensDeltaPartialResult); overriding procedure On_Tokens_Range_Partial_Result (Self : in out Client_Message_Factory; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.SemanticTokensPartialResult); overriding procedure On_TypeDefinition_Partial_Result (Self : in out Client_Message_Factory; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.Definition_Progress_Report); overriding procedure On_Subtypes_Partial_Result (Self : in out Client_Message_Factory; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.TypeHierarchyItem_Vector); overriding procedure On_Supertypes_Partial_Result (Self : in out Client_Message_Factory; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.TypeHierarchyItem_Vector); overriding procedure On_Workspace_Diagnostic_Partial_Result (Self : in out Client_Message_Factory; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.WorkspaceDiagnosticReportPartialResult); overriding procedure On_Symbol_Partial_Result (Self : in out Client_Message_Factory; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.Symbol_Progress_Report); overriding procedure On_ProgressBegin_Work_Done (Self : in out Client_Message_Factory; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.WorkDoneProgressBegin); overriding procedure On_ProgressReport_Work_Done (Self : in out Client_Message_Factory; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.WorkDoneProgressReport); overriding procedure On_ProgressEnd_Work_Done (Self : in out Client_Message_Factory; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.WorkDoneProgressEnd); end LSP.Client_Message_Factories; diff --git a/source/lsp_3.17/generated/lsp-client_notification_readers.adb b/source/lsp_3.17/generated/lsp-client_notification_readers.adb index 710ae291a..f422a865c 100644 --- a/source/lsp_3.17/generated/lsp-client_notification_readers.adb +++ b/source/lsp_3.17/generated/lsp-client_notification_readers.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with Minimal_Perfect_Hash; with LSP.Inputs; @@ -21,12 +23,12 @@ package body LSP.Client_Notification_Readers is package Method_Map is new Minimal_Perfect_Hash (["$/cancelRequest", - "$/logTrace", - "$/progress", - "telemetry/event", - "textDocument/publishDiagnostics", - "window/logMessage", - "window/showMessage"]); + "$/logTrace", + "$/progress", + "telemetry/event", + "textDocument/publishDiagnostics", + "window/logMessage", + "window/showMessage"]); procedure Initialize is begin diff --git a/source/lsp_3.17/generated/lsp-client_notification_receivers.ads b/source/lsp_3.17/generated/lsp-client_notification_receivers.ads index 14eddc380..aa8a2c959 100644 --- a/source/lsp_3.17/generated/lsp-client_notification_receivers.ads +++ b/source/lsp_3.17/generated/lsp-client_notification_receivers.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Base_Notification_Receivers; with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-client_notification_writers.adb b/source/lsp_3.17/generated/lsp-client_notification_writers.adb index 647d1999f..bf9cc0ac8 100644 --- a/source/lsp_3.17/generated/lsp-client_notification_writers.adb +++ b/source/lsp_3.17/generated/lsp-client_notification_writers.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with VSS.JSON.Content_Handlers; with LSP.Output_Tools; diff --git a/source/lsp_3.17/generated/lsp-client_notification_writers.ads b/source/lsp_3.17/generated/lsp-client_notification_writers.ads index 1a34d1e30..f5e50f911 100644 --- a/source/lsp_3.17/generated/lsp-client_notification_writers.ads +++ b/source/lsp_3.17/generated/lsp-client_notification_writers.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Base_Notification_Writers; with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-client_notifications-cancelrequest.adb b/source/lsp_3.17/generated/lsp-client_notifications-cancelrequest.adb index a5322bc4a..914e0a467 100644 --- a/source/lsp_3.17/generated/lsp-client_notifications-cancelrequest.adb +++ b/source/lsp_3.17/generated/lsp-client_notifications-cancelrequest.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Client_Notifications.CancelRequest is diff --git a/source/lsp_3.17/generated/lsp-client_notifications-cancelrequest.ads b/source/lsp_3.17/generated/lsp-client_notifications-cancelrequest.ads index d1b2e649f..6707feee6 100644 --- a/source/lsp_3.17/generated/lsp-client_notifications-cancelrequest.ads +++ b/source/lsp_3.17/generated/lsp-client_notifications-cancelrequest.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-client_notifications-event.adb b/source/lsp_3.17/generated/lsp-client_notifications-event.adb index ccdaa3fc6..d5ed0548a 100644 --- a/source/lsp_3.17/generated/lsp-client_notifications-event.adb +++ b/source/lsp_3.17/generated/lsp-client_notifications-event.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Client_Notifications.Event is diff --git a/source/lsp_3.17/generated/lsp-client_notifications-event.ads b/source/lsp_3.17/generated/lsp-client_notifications-event.ads index 209a5c12a..32b6d0115 100644 --- a/source/lsp_3.17/generated/lsp-client_notifications-event.ads +++ b/source/lsp_3.17/generated/lsp-client_notifications-event.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-client_notifications-logmessage.adb b/source/lsp_3.17/generated/lsp-client_notifications-logmessage.adb index 1ea0eaf74..04be7fd82 100644 --- a/source/lsp_3.17/generated/lsp-client_notifications-logmessage.adb +++ b/source/lsp_3.17/generated/lsp-client_notifications-logmessage.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Client_Notifications.LogMessage is diff --git a/source/lsp_3.17/generated/lsp-client_notifications-logmessage.ads b/source/lsp_3.17/generated/lsp-client_notifications-logmessage.ads index 73c80383d..1c78075ab 100644 --- a/source/lsp_3.17/generated/lsp-client_notifications-logmessage.ads +++ b/source/lsp_3.17/generated/lsp-client_notifications-logmessage.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-client_notifications-logtrace.adb b/source/lsp_3.17/generated/lsp-client_notifications-logtrace.adb index ee848af4a..ff6060c27 100644 --- a/source/lsp_3.17/generated/lsp-client_notifications-logtrace.adb +++ b/source/lsp_3.17/generated/lsp-client_notifications-logtrace.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Client_Notifications.LogTrace is diff --git a/source/lsp_3.17/generated/lsp-client_notifications-logtrace.ads b/source/lsp_3.17/generated/lsp-client_notifications-logtrace.ads index 903a7265c..4cc77b432 100644 --- a/source/lsp_3.17/generated/lsp-client_notifications-logtrace.ads +++ b/source/lsp_3.17/generated/lsp-client_notifications-logtrace.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-client_notifications-progress.adb b/source/lsp_3.17/generated/lsp-client_notifications-progress.adb index ab15a7850..376671cf4 100644 --- a/source/lsp_3.17/generated/lsp-client_notifications-progress.adb +++ b/source/lsp_3.17/generated/lsp-client_notifications-progress.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Client_Notifications.Progress is diff --git a/source/lsp_3.17/generated/lsp-client_notifications-progress.ads b/source/lsp_3.17/generated/lsp-client_notifications-progress.ads index d45eb77f5..7b9ae6af3 100644 --- a/source/lsp_3.17/generated/lsp-client_notifications-progress.ads +++ b/source/lsp_3.17/generated/lsp-client_notifications-progress.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-client_notifications-publishdiagnostics.adb b/source/lsp_3.17/generated/lsp-client_notifications-publishdiagnostics.adb index 795537458..fb10c11a3 100644 --- a/source/lsp_3.17/generated/lsp-client_notifications-publishdiagnostics.adb +++ b/source/lsp_3.17/generated/lsp-client_notifications-publishdiagnostics.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Client_Notifications.PublishDiagnostics is diff --git a/source/lsp_3.17/generated/lsp-client_notifications-publishdiagnostics.ads b/source/lsp_3.17/generated/lsp-client_notifications-publishdiagnostics.ads index 7cfffbff1..8bc188327 100644 --- a/source/lsp_3.17/generated/lsp-client_notifications-publishdiagnostics.ads +++ b/source/lsp_3.17/generated/lsp-client_notifications-publishdiagnostics.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-client_notifications-showmessage.adb b/source/lsp_3.17/generated/lsp-client_notifications-showmessage.adb index e199737a0..8ba05d142 100644 --- a/source/lsp_3.17/generated/lsp-client_notifications-showmessage.adb +++ b/source/lsp_3.17/generated/lsp-client_notifications-showmessage.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Client_Notifications.ShowMessage is diff --git a/source/lsp_3.17/generated/lsp-client_notifications-showmessage.ads b/source/lsp_3.17/generated/lsp-client_notifications-showmessage.ads index 9bef1af2f..c04134b4a 100644 --- a/source/lsp_3.17/generated/lsp-client_notifications-showmessage.ads +++ b/source/lsp_3.17/generated/lsp-client_notifications-showmessage.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-client_request_readers.adb b/source/lsp_3.17/generated/lsp-client_request_readers.adb index b4e450606..87c7e7988 100644 --- a/source/lsp_3.17/generated/lsp-client_request_readers.adb +++ b/source/lsp_3.17/generated/lsp-client_request_readers.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with Minimal_Perfect_Hash; with LSP.Inputs; @@ -27,18 +29,18 @@ package body LSP.Client_Request_Readers is package Method_Map is new Minimal_Perfect_Hash (["client/registerCapability", - "client/unregisterCapability", - "window/showDocument", - "window/showMessageRequest", - "window/workDoneProgress/create", - "workspace/applyEdit", - "workspace/codeLens/refresh", - "workspace/configuration", - "workspace/diagnostic/refresh", - "workspace/inlayHint/refresh", - "workspace/inlineValue/refresh", - "workspace/semanticTokens/refresh", - "workspace/workspaceFolders"]); + "client/unregisterCapability", + "window/showDocument", + "window/showMessageRequest", + "window/workDoneProgress/create", + "workspace/applyEdit", + "workspace/codeLens/refresh", + "workspace/configuration", + "workspace/diagnostic/refresh", + "workspace/inlayHint/refresh", + "workspace/inlineValue/refresh", + "workspace/semanticTokens/refresh", + "workspace/workspaceFolders"]); procedure Initialize is begin diff --git a/source/lsp_3.17/generated/lsp-client_request_receivers.ads b/source/lsp_3.17/generated/lsp-client_request_receivers.ads index fd4974240..7558eb82b 100644 --- a/source/lsp_3.17/generated/lsp-client_request_receivers.ads +++ b/source/lsp_3.17/generated/lsp-client_request_receivers.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-client_request_writers.adb b/source/lsp_3.17/generated/lsp-client_request_writers.adb index ca07283c1..a6372c2cb 100644 --- a/source/lsp_3.17/generated/lsp-client_request_writers.adb +++ b/source/lsp_3.17/generated/lsp-client_request_writers.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Output_Tools; with LSP.Outputs; diff --git a/source/lsp_3.17/generated/lsp-client_request_writers.ads b/source/lsp_3.17/generated/lsp-client_request_writers.ads index ba632feee..221804481 100644 --- a/source/lsp_3.17/generated/lsp-client_request_writers.ads +++ b/source/lsp_3.17/generated/lsp-client_request_writers.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; with VSS.JSON.Content_Handlers; diff --git a/source/lsp_3.17/generated/lsp-client_requests-applyedit.adb b/source/lsp_3.17/generated/lsp-client_requests-applyedit.adb index 86ce61f73..5444b7704 100644 --- a/source/lsp_3.17/generated/lsp-client_requests-applyedit.adb +++ b/source/lsp_3.17/generated/lsp-client_requests-applyedit.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Client_Requests.ApplyEdit is diff --git a/source/lsp_3.17/generated/lsp-client_requests-applyedit.ads b/source/lsp_3.17/generated/lsp-client_requests-applyedit.ads index dc8e59c18..b18015409 100644 --- a/source/lsp_3.17/generated/lsp-client_requests-applyedit.ads +++ b/source/lsp_3.17/generated/lsp-client_requests-applyedit.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-client_requests-code_lens_refresh.adb b/source/lsp_3.17/generated/lsp-client_requests-code_lens_refresh.adb index e7f27e53c..b367cf33e 100644 --- a/source/lsp_3.17/generated/lsp-client_requests-code_lens_refresh.adb +++ b/source/lsp_3.17/generated/lsp-client_requests-code_lens_refresh.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Client_Requests.Code_Lens_Refresh is diff --git a/source/lsp_3.17/generated/lsp-client_requests-code_lens_refresh.ads b/source/lsp_3.17/generated/lsp-client_requests-code_lens_refresh.ads index 118a5f17d..6cd3389a0 100644 --- a/source/lsp_3.17/generated/lsp-client_requests-code_lens_refresh.ads +++ b/source/lsp_3.17/generated/lsp-client_requests-code_lens_refresh.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package LSP.Client_Requests.Code_Lens_Refresh is pragma Preelaborate; diff --git a/source/lsp_3.17/generated/lsp-client_requests-configuration.adb b/source/lsp_3.17/generated/lsp-client_requests-configuration.adb index ec570e3f9..f32a82d01 100644 --- a/source/lsp_3.17/generated/lsp-client_requests-configuration.adb +++ b/source/lsp_3.17/generated/lsp-client_requests-configuration.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Client_Requests.Configuration is diff --git a/source/lsp_3.17/generated/lsp-client_requests-configuration.ads b/source/lsp_3.17/generated/lsp-client_requests-configuration.ads index 8ac81b8e6..750fc85f6 100644 --- a/source/lsp_3.17/generated/lsp-client_requests-configuration.ads +++ b/source/lsp_3.17/generated/lsp-client_requests-configuration.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-client_requests-diagnostic_refresh.adb b/source/lsp_3.17/generated/lsp-client_requests-diagnostic_refresh.adb index f14353ae5..e98e03ed0 100644 --- a/source/lsp_3.17/generated/lsp-client_requests-diagnostic_refresh.adb +++ b/source/lsp_3.17/generated/lsp-client_requests-diagnostic_refresh.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Client_Requests.Diagnostic_Refresh is diff --git a/source/lsp_3.17/generated/lsp-client_requests-diagnostic_refresh.ads b/source/lsp_3.17/generated/lsp-client_requests-diagnostic_refresh.ads index ae97a736e..15eccfeea 100644 --- a/source/lsp_3.17/generated/lsp-client_requests-diagnostic_refresh.ads +++ b/source/lsp_3.17/generated/lsp-client_requests-diagnostic_refresh.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package LSP.Client_Requests.Diagnostic_Refresh is pragma Preelaborate; diff --git a/source/lsp_3.17/generated/lsp-client_requests-inlay_refresh.adb b/source/lsp_3.17/generated/lsp-client_requests-inlay_refresh.adb index e9693ac2a..cf947bcfa 100644 --- a/source/lsp_3.17/generated/lsp-client_requests-inlay_refresh.adb +++ b/source/lsp_3.17/generated/lsp-client_requests-inlay_refresh.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Client_Requests.Inlay_Refresh is diff --git a/source/lsp_3.17/generated/lsp-client_requests-inlay_refresh.ads b/source/lsp_3.17/generated/lsp-client_requests-inlay_refresh.ads index 2f3c6a35f..915a8d868 100644 --- a/source/lsp_3.17/generated/lsp-client_requests-inlay_refresh.ads +++ b/source/lsp_3.17/generated/lsp-client_requests-inlay_refresh.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package LSP.Client_Requests.Inlay_Refresh is pragma Preelaborate; diff --git a/source/lsp_3.17/generated/lsp-client_requests-inline_refresh.adb b/source/lsp_3.17/generated/lsp-client_requests-inline_refresh.adb index 7a85724d1..41b207685 100644 --- a/source/lsp_3.17/generated/lsp-client_requests-inline_refresh.adb +++ b/source/lsp_3.17/generated/lsp-client_requests-inline_refresh.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Client_Requests.Inline_Refresh is diff --git a/source/lsp_3.17/generated/lsp-client_requests-inline_refresh.ads b/source/lsp_3.17/generated/lsp-client_requests-inline_refresh.ads index 7383a1ffc..1c45a30fc 100644 --- a/source/lsp_3.17/generated/lsp-client_requests-inline_refresh.ads +++ b/source/lsp_3.17/generated/lsp-client_requests-inline_refresh.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package LSP.Client_Requests.Inline_Refresh is pragma Preelaborate; diff --git a/source/lsp_3.17/generated/lsp-client_requests-progress_create.adb b/source/lsp_3.17/generated/lsp-client_requests-progress_create.adb index 3d978d4b4..494472868 100644 --- a/source/lsp_3.17/generated/lsp-client_requests-progress_create.adb +++ b/source/lsp_3.17/generated/lsp-client_requests-progress_create.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Client_Requests.Progress_Create is diff --git a/source/lsp_3.17/generated/lsp-client_requests-progress_create.ads b/source/lsp_3.17/generated/lsp-client_requests-progress_create.ads index 2cff63624..7a2ce9fa0 100644 --- a/source/lsp_3.17/generated/lsp-client_requests-progress_create.ads +++ b/source/lsp_3.17/generated/lsp-client_requests-progress_create.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-client_requests-registercapability.adb b/source/lsp_3.17/generated/lsp-client_requests-registercapability.adb index 4ccc45f6b..d55746991 100644 --- a/source/lsp_3.17/generated/lsp-client_requests-registercapability.adb +++ b/source/lsp_3.17/generated/lsp-client_requests-registercapability.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Client_Requests.RegisterCapability is diff --git a/source/lsp_3.17/generated/lsp-client_requests-registercapability.ads b/source/lsp_3.17/generated/lsp-client_requests-registercapability.ads index 0cf6ca433..202cfb8db 100644 --- a/source/lsp_3.17/generated/lsp-client_requests-registercapability.ads +++ b/source/lsp_3.17/generated/lsp-client_requests-registercapability.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-client_requests-showdocument.adb b/source/lsp_3.17/generated/lsp-client_requests-showdocument.adb index 08fb0aa67..a0e4a0865 100644 --- a/source/lsp_3.17/generated/lsp-client_requests-showdocument.adb +++ b/source/lsp_3.17/generated/lsp-client_requests-showdocument.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Client_Requests.ShowDocument is diff --git a/source/lsp_3.17/generated/lsp-client_requests-showdocument.ads b/source/lsp_3.17/generated/lsp-client_requests-showdocument.ads index 5ef051908..3e8644947 100644 --- a/source/lsp_3.17/generated/lsp-client_requests-showdocument.ads +++ b/source/lsp_3.17/generated/lsp-client_requests-showdocument.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-client_requests-showmessagerequest.adb b/source/lsp_3.17/generated/lsp-client_requests-showmessagerequest.adb index d1ef2582e..6060e30ac 100644 --- a/source/lsp_3.17/generated/lsp-client_requests-showmessagerequest.adb +++ b/source/lsp_3.17/generated/lsp-client_requests-showmessagerequest.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Client_Requests.ShowMessageRequest is diff --git a/source/lsp_3.17/generated/lsp-client_requests-showmessagerequest.ads b/source/lsp_3.17/generated/lsp-client_requests-showmessagerequest.ads index 42f3e217f..10d85940c 100644 --- a/source/lsp_3.17/generated/lsp-client_requests-showmessagerequest.ads +++ b/source/lsp_3.17/generated/lsp-client_requests-showmessagerequest.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-client_requests-tokens_refresh.adb b/source/lsp_3.17/generated/lsp-client_requests-tokens_refresh.adb index cf800e85b..8a66e7cae 100644 --- a/source/lsp_3.17/generated/lsp-client_requests-tokens_refresh.adb +++ b/source/lsp_3.17/generated/lsp-client_requests-tokens_refresh.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Client_Requests.Tokens_Refresh is diff --git a/source/lsp_3.17/generated/lsp-client_requests-tokens_refresh.ads b/source/lsp_3.17/generated/lsp-client_requests-tokens_refresh.ads index 0c0a28f30..ead0f76b6 100644 --- a/source/lsp_3.17/generated/lsp-client_requests-tokens_refresh.ads +++ b/source/lsp_3.17/generated/lsp-client_requests-tokens_refresh.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package LSP.Client_Requests.Tokens_Refresh is pragma Preelaborate; diff --git a/source/lsp_3.17/generated/lsp-client_requests-unregistercapability.adb b/source/lsp_3.17/generated/lsp-client_requests-unregistercapability.adb index c959bed57..1f90c8122 100644 --- a/source/lsp_3.17/generated/lsp-client_requests-unregistercapability.adb +++ b/source/lsp_3.17/generated/lsp-client_requests-unregistercapability.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Client_Requests.UnregisterCapability is diff --git a/source/lsp_3.17/generated/lsp-client_requests-unregistercapability.ads b/source/lsp_3.17/generated/lsp-client_requests-unregistercapability.ads index 689139cdc..bef46b873 100644 --- a/source/lsp_3.17/generated/lsp-client_requests-unregistercapability.ads +++ b/source/lsp_3.17/generated/lsp-client_requests-unregistercapability.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-client_requests-workspacefolders.adb b/source/lsp_3.17/generated/lsp-client_requests-workspacefolders.adb index 63a814c4d..cfd1effd3 100644 --- a/source/lsp_3.17/generated/lsp-client_requests-workspacefolders.adb +++ b/source/lsp_3.17/generated/lsp-client_requests-workspacefolders.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Client_Requests.WorkspaceFolders is diff --git a/source/lsp_3.17/generated/lsp-client_requests-workspacefolders.ads b/source/lsp_3.17/generated/lsp-client_requests-workspacefolders.ads index 22d1c3a5c..d1079bcb1 100644 --- a/source/lsp_3.17/generated/lsp-client_requests-workspacefolders.ads +++ b/source/lsp_3.17/generated/lsp-client_requests-workspacefolders.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package LSP.Client_Requests.WorkspaceFolders is pragma Preelaborate; diff --git a/source/lsp_3.17/generated/lsp-client_response_readers.adb b/source/lsp_3.17/generated/lsp-client_response_readers.adb index 31eb3fcd7..a585a5484 100644 --- a/source/lsp_3.17/generated/lsp-client_response_readers.adb +++ b/source/lsp_3.17/generated/lsp-client_response_readers.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with Minimal_Perfect_Hash; with LSP.Inputs; @@ -65,56 +67,56 @@ package body LSP.Client_Response_Readers is package Method_Map is new Minimal_Perfect_Hash (["callHierarchy/incomingCalls", - "callHierarchy/outgoingCalls", - "codeAction/resolve", - "codeLens/resolve", - "completionItem/resolve", - "documentLink/resolve", - "initialize", - "inlayHint/resolve", - "shutdown", - "textDocument/codeAction", - "textDocument/codeLens", - "textDocument/colorPresentation", - "textDocument/completion", - "textDocument/declaration", - "textDocument/definition", - "textDocument/diagnostic", - "textDocument/documentColor", - "textDocument/documentHighlight", - "textDocument/documentLink", - "textDocument/documentSymbol", - "textDocument/foldingRange", - "textDocument/formatting", - "textDocument/hover", - "textDocument/implementation", - "textDocument/inlayHint", - "textDocument/inlineValue", - "textDocument/linkedEditingRange", - "textDocument/moniker", - "textDocument/onTypeFormatting", - "textDocument/prepareCallHierarchy", - "textDocument/prepareRename", - "textDocument/prepareTypeHierarchy", - "textDocument/rangeFormatting", - "textDocument/references", - "textDocument/rename", - "textDocument/selectionRange", - "textDocument/semanticTokens/full", - "textDocument/semanticTokens/full/delta", - "textDocument/semanticTokens/range", - "textDocument/signatureHelp", - "textDocument/typeDefinition", - "textDocument/willSaveWaitUntil", - "typeHierarchy/subtypes", - "typeHierarchy/supertypes", - "workspace/diagnostic", - "workspace/executeCommand", - "workspace/symbol", - "workspace/willCreateFiles", - "workspace/willDeleteFiles", - "workspace/willRenameFiles", - "workspaceSymbol/resolve"]); + "callHierarchy/outgoingCalls", + "codeAction/resolve", + "codeLens/resolve", + "completionItem/resolve", + "documentLink/resolve", + "initialize", + "inlayHint/resolve", + "shutdown", + "textDocument/codeAction", + "textDocument/codeLens", + "textDocument/colorPresentation", + "textDocument/completion", + "textDocument/declaration", + "textDocument/definition", + "textDocument/diagnostic", + "textDocument/documentColor", + "textDocument/documentHighlight", + "textDocument/documentLink", + "textDocument/documentSymbol", + "textDocument/foldingRange", + "textDocument/formatting", + "textDocument/hover", + "textDocument/implementation", + "textDocument/inlayHint", + "textDocument/inlineValue", + "textDocument/linkedEditingRange", + "textDocument/moniker", + "textDocument/onTypeFormatting", + "textDocument/prepareCallHierarchy", + "textDocument/prepareRename", + "textDocument/prepareTypeHierarchy", + "textDocument/rangeFormatting", + "textDocument/references", + "textDocument/rename", + "textDocument/selectionRange", + "textDocument/semanticTokens/full", + "textDocument/semanticTokens/full/delta", + "textDocument/semanticTokens/range", + "textDocument/signatureHelp", + "textDocument/typeDefinition", + "textDocument/willSaveWaitUntil", + "typeHierarchy/subtypes", + "typeHierarchy/supertypes", + "workspace/diagnostic", + "workspace/executeCommand", + "workspace/symbol", + "workspace/willCreateFiles", + "workspace/willDeleteFiles", + "workspace/willRenameFiles", + "workspaceSymbol/resolve"]); procedure Initialize is begin diff --git a/source/lsp_3.17/generated/lsp-client_response_receivers.ads b/source/lsp_3.17/generated/lsp-client_response_receivers.ads index c1d689d4f..e06800426 100644 --- a/source/lsp_3.17/generated/lsp-client_response_receivers.ads +++ b/source/lsp_3.17/generated/lsp-client_response_receivers.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Errors; with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-client_response_writers.adb b/source/lsp_3.17/generated/lsp-client_response_writers.adb index 2488e58ed..a12a75b09 100644 --- a/source/lsp_3.17/generated/lsp-client_response_writers.adb +++ b/source/lsp_3.17/generated/lsp-client_response_writers.adb @@ -3,6 +3,10 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- + +with Interfaces; with LSP.Output_Tools; with LSP.Outputs; @@ -587,7 +591,7 @@ package body LSP.Client_Response_Writers is Self.Output.Key_Name ("error"); Self.Output.Start_Object; Self.Output.Key_Name ("code"); - LSP.Outputs.Write_ErrorCodes (Self.Output.all, Value.code); + Self.Output.Integer_Value (Interfaces.Integer_64'Val (Value.code)); Self.Output.Key_Name ("message"); Self.Output.String_Value (Value.message); Self.Output.End_Object; diff --git a/source/lsp_3.17/generated/lsp-client_response_writers.ads b/source/lsp_3.17/generated/lsp-client_response_writers.ads index d79bd7706..84198a431 100644 --- a/source/lsp_3.17/generated/lsp-client_response_writers.ads +++ b/source/lsp_3.17/generated/lsp-client_response_writers.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with VSS.JSON.Content_Handlers; diff --git a/source/lsp_3.17/generated/lsp-client_responses-code_action_resolve.adb b/source/lsp_3.17/generated/lsp-client_responses-code_action_resolve.adb index 3d7093e0e..f9b0abf2c 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-code_action_resolve.adb +++ b/source/lsp_3.17/generated/lsp-client_responses-code_action_resolve.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Client_Responses.Code_Action_Resolve is diff --git a/source/lsp_3.17/generated/lsp-client_responses-code_action_resolve.ads b/source/lsp_3.17/generated/lsp-client_responses-code_action_resolve.ads index 9fecf0362..352f0977b 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-code_action_resolve.ads +++ b/source/lsp_3.17/generated/lsp-client_responses-code_action_resolve.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-client_responses-code_lens_resolve.adb b/source/lsp_3.17/generated/lsp-client_responses-code_lens_resolve.adb index 8088be401..390f7781e 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-code_lens_resolve.adb +++ b/source/lsp_3.17/generated/lsp-client_responses-code_lens_resolve.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Client_Responses.Code_Lens_Resolve is diff --git a/source/lsp_3.17/generated/lsp-client_responses-code_lens_resolve.ads b/source/lsp_3.17/generated/lsp-client_responses-code_lens_resolve.ads index c4b130223..49c6695ca 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-code_lens_resolve.ads +++ b/source/lsp_3.17/generated/lsp-client_responses-code_lens_resolve.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-client_responses-codeaction.adb b/source/lsp_3.17/generated/lsp-client_responses-codeaction.adb index e410b8b52..62e90eaa4 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-codeaction.adb +++ b/source/lsp_3.17/generated/lsp-client_responses-codeaction.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Client_Responses.CodeAction is diff --git a/source/lsp_3.17/generated/lsp-client_responses-codeaction.ads b/source/lsp_3.17/generated/lsp-client_responses-codeaction.ads index 4fe038754..b91c8fced 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-codeaction.ads +++ b/source/lsp_3.17/generated/lsp-client_responses-codeaction.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-client_responses-codelens.adb b/source/lsp_3.17/generated/lsp-client_responses-codelens.adb index 90deecf23..58ce2b607 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-codelens.adb +++ b/source/lsp_3.17/generated/lsp-client_responses-codelens.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Client_Responses.CodeLens is diff --git a/source/lsp_3.17/generated/lsp-client_responses-codelens.ads b/source/lsp_3.17/generated/lsp-client_responses-codelens.ads index 07f84c819..50fd55de8 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-codelens.ads +++ b/source/lsp_3.17/generated/lsp-client_responses-codelens.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-client_responses-colorpresentation.adb b/source/lsp_3.17/generated/lsp-client_responses-colorpresentation.adb index 857b2dc7f..3d8d49009 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-colorpresentation.adb +++ b/source/lsp_3.17/generated/lsp-client_responses-colorpresentation.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Client_Responses.ColorPresentation is diff --git a/source/lsp_3.17/generated/lsp-client_responses-colorpresentation.ads b/source/lsp_3.17/generated/lsp-client_responses-colorpresentation.ads index 4b820cf34..8b1011015 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-colorpresentation.ads +++ b/source/lsp_3.17/generated/lsp-client_responses-colorpresentation.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-client_responses-completion.adb b/source/lsp_3.17/generated/lsp-client_responses-completion.adb index 87a3def86..6adbb1bec 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-completion.adb +++ b/source/lsp_3.17/generated/lsp-client_responses-completion.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Client_Responses.Completion is diff --git a/source/lsp_3.17/generated/lsp-client_responses-completion.ads b/source/lsp_3.17/generated/lsp-client_responses-completion.ads index dfbb344b1..37a988230 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-completion.ads +++ b/source/lsp_3.17/generated/lsp-client_responses-completion.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-client_responses-completion_resolve.adb b/source/lsp_3.17/generated/lsp-client_responses-completion_resolve.adb index 062c52763..6ac48d9f3 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-completion_resolve.adb +++ b/source/lsp_3.17/generated/lsp-client_responses-completion_resolve.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Client_Responses.Completion_Resolve is diff --git a/source/lsp_3.17/generated/lsp-client_responses-completion_resolve.ads b/source/lsp_3.17/generated/lsp-client_responses-completion_resolve.ads index caf8eba45..b56b8409e 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-completion_resolve.ads +++ b/source/lsp_3.17/generated/lsp-client_responses-completion_resolve.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-client_responses-declaration.adb b/source/lsp_3.17/generated/lsp-client_responses-declaration.adb index aa98b1c91..1bafc4681 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-declaration.adb +++ b/source/lsp_3.17/generated/lsp-client_responses-declaration.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Client_Responses.Declaration is diff --git a/source/lsp_3.17/generated/lsp-client_responses-declaration.ads b/source/lsp_3.17/generated/lsp-client_responses-declaration.ads index 0417c1b87..bac82dfbb 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-declaration.ads +++ b/source/lsp_3.17/generated/lsp-client_responses-declaration.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-client_responses-definition.adb b/source/lsp_3.17/generated/lsp-client_responses-definition.adb index d141a90f6..851a5f8fd 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-definition.adb +++ b/source/lsp_3.17/generated/lsp-client_responses-definition.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Client_Responses.Definition is diff --git a/source/lsp_3.17/generated/lsp-client_responses-definition.ads b/source/lsp_3.17/generated/lsp-client_responses-definition.ads index 566644f2d..e710ef9f2 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-definition.ads +++ b/source/lsp_3.17/generated/lsp-client_responses-definition.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-client_responses-diagnostic.adb b/source/lsp_3.17/generated/lsp-client_responses-diagnostic.adb index 0f5e58b39..100fa5dc9 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-diagnostic.adb +++ b/source/lsp_3.17/generated/lsp-client_responses-diagnostic.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Client_Responses.Diagnostic is diff --git a/source/lsp_3.17/generated/lsp-client_responses-diagnostic.ads b/source/lsp_3.17/generated/lsp-client_responses-diagnostic.ads index 26202a1d3..3d44f400c 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-diagnostic.ads +++ b/source/lsp_3.17/generated/lsp-client_responses-diagnostic.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-client_responses-documentcolor.adb b/source/lsp_3.17/generated/lsp-client_responses-documentcolor.adb index 147f64d67..a1fe7e879 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-documentcolor.adb +++ b/source/lsp_3.17/generated/lsp-client_responses-documentcolor.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Client_Responses.DocumentColor is diff --git a/source/lsp_3.17/generated/lsp-client_responses-documentcolor.ads b/source/lsp_3.17/generated/lsp-client_responses-documentcolor.ads index 73395de58..81b76f138 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-documentcolor.ads +++ b/source/lsp_3.17/generated/lsp-client_responses-documentcolor.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-client_responses-documenthighlight.adb b/source/lsp_3.17/generated/lsp-client_responses-documenthighlight.adb index 1cc3e93f6..384134184 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-documenthighlight.adb +++ b/source/lsp_3.17/generated/lsp-client_responses-documenthighlight.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Client_Responses.DocumentHighlight is diff --git a/source/lsp_3.17/generated/lsp-client_responses-documenthighlight.ads b/source/lsp_3.17/generated/lsp-client_responses-documenthighlight.ads index 17c85024b..910ddeddb 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-documenthighlight.ads +++ b/source/lsp_3.17/generated/lsp-client_responses-documenthighlight.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-client_responses-documentlink.adb b/source/lsp_3.17/generated/lsp-client_responses-documentlink.adb index e5b954996..fdfa61421 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-documentlink.adb +++ b/source/lsp_3.17/generated/lsp-client_responses-documentlink.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Client_Responses.DocumentLink is diff --git a/source/lsp_3.17/generated/lsp-client_responses-documentlink.ads b/source/lsp_3.17/generated/lsp-client_responses-documentlink.ads index 8d3cdf079..2dacd755f 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-documentlink.ads +++ b/source/lsp_3.17/generated/lsp-client_responses-documentlink.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-client_responses-documentsymbol.adb b/source/lsp_3.17/generated/lsp-client_responses-documentsymbol.adb index 416aeaf54..52e938f63 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-documentsymbol.adb +++ b/source/lsp_3.17/generated/lsp-client_responses-documentsymbol.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Client_Responses.DocumentSymbol is diff --git a/source/lsp_3.17/generated/lsp-client_responses-documentsymbol.ads b/source/lsp_3.17/generated/lsp-client_responses-documentsymbol.ads index faee86f21..895030c8d 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-documentsymbol.ads +++ b/source/lsp_3.17/generated/lsp-client_responses-documentsymbol.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-client_responses-executecommand.adb b/source/lsp_3.17/generated/lsp-client_responses-executecommand.adb index f28f32ccb..16725c02e 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-executecommand.adb +++ b/source/lsp_3.17/generated/lsp-client_responses-executecommand.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Client_Responses.ExecuteCommand is diff --git a/source/lsp_3.17/generated/lsp-client_responses-executecommand.ads b/source/lsp_3.17/generated/lsp-client_responses-executecommand.ads index 93d6a83d9..7ee9198e2 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-executecommand.ads +++ b/source/lsp_3.17/generated/lsp-client_responses-executecommand.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-client_responses-foldingrange.adb b/source/lsp_3.17/generated/lsp-client_responses-foldingrange.adb index 9b79eb404..b85cb97c5 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-foldingrange.adb +++ b/source/lsp_3.17/generated/lsp-client_responses-foldingrange.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Client_Responses.FoldingRange is diff --git a/source/lsp_3.17/generated/lsp-client_responses-foldingrange.ads b/source/lsp_3.17/generated/lsp-client_responses-foldingrange.ads index e4f3a2198..16043b882 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-foldingrange.ads +++ b/source/lsp_3.17/generated/lsp-client_responses-foldingrange.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-client_responses-formatting.adb b/source/lsp_3.17/generated/lsp-client_responses-formatting.adb index ca855264d..3c508570c 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-formatting.adb +++ b/source/lsp_3.17/generated/lsp-client_responses-formatting.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Client_Responses.Formatting is diff --git a/source/lsp_3.17/generated/lsp-client_responses-formatting.ads b/source/lsp_3.17/generated/lsp-client_responses-formatting.ads index c0894518e..e3edb2965 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-formatting.ads +++ b/source/lsp_3.17/generated/lsp-client_responses-formatting.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-client_responses-full.adb b/source/lsp_3.17/generated/lsp-client_responses-full.adb index 14a762b25..1b9520b0c 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-full.adb +++ b/source/lsp_3.17/generated/lsp-client_responses-full.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Client_Responses.Full is diff --git a/source/lsp_3.17/generated/lsp-client_responses-full.ads b/source/lsp_3.17/generated/lsp-client_responses-full.ads index e20e2640a..03d8cefa1 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-full.ads +++ b/source/lsp_3.17/generated/lsp-client_responses-full.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-client_responses-hover.adb b/source/lsp_3.17/generated/lsp-client_responses-hover.adb index 44a89da66..7a9001712 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-hover.adb +++ b/source/lsp_3.17/generated/lsp-client_responses-hover.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Client_Responses.Hover is diff --git a/source/lsp_3.17/generated/lsp-client_responses-hover.ads b/source/lsp_3.17/generated/lsp-client_responses-hover.ads index 50f617d02..4011a177e 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-hover.ads +++ b/source/lsp_3.17/generated/lsp-client_responses-hover.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-client_responses-implementation.adb b/source/lsp_3.17/generated/lsp-client_responses-implementation.adb index e35af4a2d..c33025706 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-implementation.adb +++ b/source/lsp_3.17/generated/lsp-client_responses-implementation.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Client_Responses.Implementation is diff --git a/source/lsp_3.17/generated/lsp-client_responses-implementation.ads b/source/lsp_3.17/generated/lsp-client_responses-implementation.ads index faf1d6cac..a2cf407a1 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-implementation.ads +++ b/source/lsp_3.17/generated/lsp-client_responses-implementation.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-client_responses-incomingcalls.adb b/source/lsp_3.17/generated/lsp-client_responses-incomingcalls.adb index e1e825554..55fa95c0f 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-incomingcalls.adb +++ b/source/lsp_3.17/generated/lsp-client_responses-incomingcalls.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Client_Responses.IncomingCalls is diff --git a/source/lsp_3.17/generated/lsp-client_responses-incomingcalls.ads b/source/lsp_3.17/generated/lsp-client_responses-incomingcalls.ads index b2255d6f5..ddf734715 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-incomingcalls.ads +++ b/source/lsp_3.17/generated/lsp-client_responses-incomingcalls.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-client_responses-initialize.adb b/source/lsp_3.17/generated/lsp-client_responses-initialize.adb index a2c3771cd..863733db6 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-initialize.adb +++ b/source/lsp_3.17/generated/lsp-client_responses-initialize.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Client_Responses.Initialize is diff --git a/source/lsp_3.17/generated/lsp-client_responses-initialize.ads b/source/lsp_3.17/generated/lsp-client_responses-initialize.ads index c32794c1c..4fc120dd9 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-initialize.ads +++ b/source/lsp_3.17/generated/lsp-client_responses-initialize.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-client_responses-inlay_resolve.adb b/source/lsp_3.17/generated/lsp-client_responses-inlay_resolve.adb index 03079266e..96c23c92c 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-inlay_resolve.adb +++ b/source/lsp_3.17/generated/lsp-client_responses-inlay_resolve.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Client_Responses.Inlay_Resolve is diff --git a/source/lsp_3.17/generated/lsp-client_responses-inlay_resolve.ads b/source/lsp_3.17/generated/lsp-client_responses-inlay_resolve.ads index 77a556aee..97cff45ba 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-inlay_resolve.ads +++ b/source/lsp_3.17/generated/lsp-client_responses-inlay_resolve.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-client_responses-inlayhint.adb b/source/lsp_3.17/generated/lsp-client_responses-inlayhint.adb index 41ad7e0c9..9f82d3a2f 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-inlayhint.adb +++ b/source/lsp_3.17/generated/lsp-client_responses-inlayhint.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Client_Responses.InlayHint is diff --git a/source/lsp_3.17/generated/lsp-client_responses-inlayhint.ads b/source/lsp_3.17/generated/lsp-client_responses-inlayhint.ads index 7eb906493..dc0fbfc2a 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-inlayhint.ads +++ b/source/lsp_3.17/generated/lsp-client_responses-inlayhint.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-client_responses-inlinevalue.adb b/source/lsp_3.17/generated/lsp-client_responses-inlinevalue.adb index 54ca41cc3..77cc0c490 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-inlinevalue.adb +++ b/source/lsp_3.17/generated/lsp-client_responses-inlinevalue.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Client_Responses.InlineValue is diff --git a/source/lsp_3.17/generated/lsp-client_responses-inlinevalue.ads b/source/lsp_3.17/generated/lsp-client_responses-inlinevalue.ads index 800622743..41cc13057 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-inlinevalue.ads +++ b/source/lsp_3.17/generated/lsp-client_responses-inlinevalue.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-client_responses-link_resolve.adb b/source/lsp_3.17/generated/lsp-client_responses-link_resolve.adb index 8f7481e56..7c5ed9d2f 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-link_resolve.adb +++ b/source/lsp_3.17/generated/lsp-client_responses-link_resolve.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Client_Responses.Link_Resolve is diff --git a/source/lsp_3.17/generated/lsp-client_responses-link_resolve.ads b/source/lsp_3.17/generated/lsp-client_responses-link_resolve.ads index 57f0107ba..45a0709ba 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-link_resolve.ads +++ b/source/lsp_3.17/generated/lsp-client_responses-link_resolve.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-client_responses-linkededitingrange.adb b/source/lsp_3.17/generated/lsp-client_responses-linkededitingrange.adb index 8e217c77f..799b78e66 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-linkededitingrange.adb +++ b/source/lsp_3.17/generated/lsp-client_responses-linkededitingrange.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Client_Responses.LinkedEditingRange is diff --git a/source/lsp_3.17/generated/lsp-client_responses-linkededitingrange.ads b/source/lsp_3.17/generated/lsp-client_responses-linkededitingrange.ads index 47fb8e438..46dae1d0f 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-linkededitingrange.ads +++ b/source/lsp_3.17/generated/lsp-client_responses-linkededitingrange.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-client_responses-moniker.adb b/source/lsp_3.17/generated/lsp-client_responses-moniker.adb index 87e2b4805..9b0d0a4ff 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-moniker.adb +++ b/source/lsp_3.17/generated/lsp-client_responses-moniker.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Client_Responses.Moniker is diff --git a/source/lsp_3.17/generated/lsp-client_responses-moniker.ads b/source/lsp_3.17/generated/lsp-client_responses-moniker.ads index 25ee78113..7c86ced02 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-moniker.ads +++ b/source/lsp_3.17/generated/lsp-client_responses-moniker.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-client_responses-ontypeformatting.adb b/source/lsp_3.17/generated/lsp-client_responses-ontypeformatting.adb index 44b943207..6ef20bc04 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-ontypeformatting.adb +++ b/source/lsp_3.17/generated/lsp-client_responses-ontypeformatting.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Client_Responses.OnTypeFormatting is diff --git a/source/lsp_3.17/generated/lsp-client_responses-ontypeformatting.ads b/source/lsp_3.17/generated/lsp-client_responses-ontypeformatting.ads index 0847531d3..df1b2c159 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-ontypeformatting.ads +++ b/source/lsp_3.17/generated/lsp-client_responses-ontypeformatting.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-client_responses-outgoingcalls.adb b/source/lsp_3.17/generated/lsp-client_responses-outgoingcalls.adb index 3bc0fe0d6..b43159e09 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-outgoingcalls.adb +++ b/source/lsp_3.17/generated/lsp-client_responses-outgoingcalls.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Client_Responses.OutgoingCalls is diff --git a/source/lsp_3.17/generated/lsp-client_responses-outgoingcalls.ads b/source/lsp_3.17/generated/lsp-client_responses-outgoingcalls.ads index 6259a1d05..10351931e 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-outgoingcalls.ads +++ b/source/lsp_3.17/generated/lsp-client_responses-outgoingcalls.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-client_responses-preparecallhierarchy.adb b/source/lsp_3.17/generated/lsp-client_responses-preparecallhierarchy.adb index 0591c4b90..7203742da 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-preparecallhierarchy.adb +++ b/source/lsp_3.17/generated/lsp-client_responses-preparecallhierarchy.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Client_Responses.PrepareCallHierarchy is diff --git a/source/lsp_3.17/generated/lsp-client_responses-preparecallhierarchy.ads b/source/lsp_3.17/generated/lsp-client_responses-preparecallhierarchy.ads index 254c56c42..a6387c292 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-preparecallhierarchy.ads +++ b/source/lsp_3.17/generated/lsp-client_responses-preparecallhierarchy.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-client_responses-preparerename.adb b/source/lsp_3.17/generated/lsp-client_responses-preparerename.adb index 316dc5166..c2f8bb049 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-preparerename.adb +++ b/source/lsp_3.17/generated/lsp-client_responses-preparerename.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Client_Responses.PrepareRename is diff --git a/source/lsp_3.17/generated/lsp-client_responses-preparerename.ads b/source/lsp_3.17/generated/lsp-client_responses-preparerename.ads index e633db602..dfd53951e 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-preparerename.ads +++ b/source/lsp_3.17/generated/lsp-client_responses-preparerename.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-client_responses-preparetypehierarchy.adb b/source/lsp_3.17/generated/lsp-client_responses-preparetypehierarchy.adb index 77c8b39b3..d99a1e36b 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-preparetypehierarchy.adb +++ b/source/lsp_3.17/generated/lsp-client_responses-preparetypehierarchy.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Client_Responses.PrepareTypeHierarchy is diff --git a/source/lsp_3.17/generated/lsp-client_responses-preparetypehierarchy.ads b/source/lsp_3.17/generated/lsp-client_responses-preparetypehierarchy.ads index 267f3694c..8873b59ea 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-preparetypehierarchy.ads +++ b/source/lsp_3.17/generated/lsp-client_responses-preparetypehierarchy.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-client_responses-rangeformatting.adb b/source/lsp_3.17/generated/lsp-client_responses-rangeformatting.adb index 514b28928..2d3995b0a 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-rangeformatting.adb +++ b/source/lsp_3.17/generated/lsp-client_responses-rangeformatting.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Client_Responses.RangeFormatting is diff --git a/source/lsp_3.17/generated/lsp-client_responses-rangeformatting.ads b/source/lsp_3.17/generated/lsp-client_responses-rangeformatting.ads index 4d2146209..e4feb5f3c 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-rangeformatting.ads +++ b/source/lsp_3.17/generated/lsp-client_responses-rangeformatting.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-client_responses-references.adb b/source/lsp_3.17/generated/lsp-client_responses-references.adb index 62995d47f..1f90aad9c 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-references.adb +++ b/source/lsp_3.17/generated/lsp-client_responses-references.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Client_Responses.References is diff --git a/source/lsp_3.17/generated/lsp-client_responses-references.ads b/source/lsp_3.17/generated/lsp-client_responses-references.ads index 2c66b2491..c3e743765 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-references.ads +++ b/source/lsp_3.17/generated/lsp-client_responses-references.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-client_responses-rename.adb b/source/lsp_3.17/generated/lsp-client_responses-rename.adb index 7b246010d..8339ac95a 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-rename.adb +++ b/source/lsp_3.17/generated/lsp-client_responses-rename.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Client_Responses.Rename is diff --git a/source/lsp_3.17/generated/lsp-client_responses-rename.ads b/source/lsp_3.17/generated/lsp-client_responses-rename.ads index 25db1fad1..a47a5c02f 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-rename.ads +++ b/source/lsp_3.17/generated/lsp-client_responses-rename.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-client_responses-selectionrange.adb b/source/lsp_3.17/generated/lsp-client_responses-selectionrange.adb index ec190c1ac..088440ca6 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-selectionrange.adb +++ b/source/lsp_3.17/generated/lsp-client_responses-selectionrange.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Client_Responses.SelectionRange is diff --git a/source/lsp_3.17/generated/lsp-client_responses-selectionrange.ads b/source/lsp_3.17/generated/lsp-client_responses-selectionrange.ads index 60adb3b15..f08e4b681 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-selectionrange.ads +++ b/source/lsp_3.17/generated/lsp-client_responses-selectionrange.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-client_responses-shutdown.adb b/source/lsp_3.17/generated/lsp-client_responses-shutdown.adb index 02f4c9a65..35cbfb8f2 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-shutdown.adb +++ b/source/lsp_3.17/generated/lsp-client_responses-shutdown.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Client_Responses.Shutdown is diff --git a/source/lsp_3.17/generated/lsp-client_responses-shutdown.ads b/source/lsp_3.17/generated/lsp-client_responses-shutdown.ads index 19dc81ef6..f86a488ba 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-shutdown.ads +++ b/source/lsp_3.17/generated/lsp-client_responses-shutdown.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-client_responses-signaturehelp.adb b/source/lsp_3.17/generated/lsp-client_responses-signaturehelp.adb index fa489ab3a..a6aec0744 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-signaturehelp.adb +++ b/source/lsp_3.17/generated/lsp-client_responses-signaturehelp.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Client_Responses.SignatureHelp is diff --git a/source/lsp_3.17/generated/lsp-client_responses-signaturehelp.ads b/source/lsp_3.17/generated/lsp-client_responses-signaturehelp.ads index ea1ea95d7..8a89524c2 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-signaturehelp.ads +++ b/source/lsp_3.17/generated/lsp-client_responses-signaturehelp.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-client_responses-subtypes.adb b/source/lsp_3.17/generated/lsp-client_responses-subtypes.adb index 8dab461a9..136e54702 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-subtypes.adb +++ b/source/lsp_3.17/generated/lsp-client_responses-subtypes.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Client_Responses.Subtypes is diff --git a/source/lsp_3.17/generated/lsp-client_responses-subtypes.ads b/source/lsp_3.17/generated/lsp-client_responses-subtypes.ads index 4bcdb3b5f..1e72477c5 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-subtypes.ads +++ b/source/lsp_3.17/generated/lsp-client_responses-subtypes.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-client_responses-supertypes.adb b/source/lsp_3.17/generated/lsp-client_responses-supertypes.adb index dda0d621b..9acaa4a37 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-supertypes.adb +++ b/source/lsp_3.17/generated/lsp-client_responses-supertypes.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Client_Responses.Supertypes is diff --git a/source/lsp_3.17/generated/lsp-client_responses-supertypes.ads b/source/lsp_3.17/generated/lsp-client_responses-supertypes.ads index 780b9bb2b..fca2c10a6 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-supertypes.ads +++ b/source/lsp_3.17/generated/lsp-client_responses-supertypes.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-client_responses-symbol.adb b/source/lsp_3.17/generated/lsp-client_responses-symbol.adb index 4249a9423..342698d80 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-symbol.adb +++ b/source/lsp_3.17/generated/lsp-client_responses-symbol.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Client_Responses.Symbol is diff --git a/source/lsp_3.17/generated/lsp-client_responses-symbol.ads b/source/lsp_3.17/generated/lsp-client_responses-symbol.ads index a56fd3c61..ddff74f74 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-symbol.ads +++ b/source/lsp_3.17/generated/lsp-client_responses-symbol.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-client_responses-symbol_resolve.adb b/source/lsp_3.17/generated/lsp-client_responses-symbol_resolve.adb index 6493aa3cc..0bccbd128 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-symbol_resolve.adb +++ b/source/lsp_3.17/generated/lsp-client_responses-symbol_resolve.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Client_Responses.Symbol_Resolve is diff --git a/source/lsp_3.17/generated/lsp-client_responses-symbol_resolve.ads b/source/lsp_3.17/generated/lsp-client_responses-symbol_resolve.ads index dfedea14a..ed37497ed 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-symbol_resolve.ads +++ b/source/lsp_3.17/generated/lsp-client_responses-symbol_resolve.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-client_responses-tokens_delta.adb b/source/lsp_3.17/generated/lsp-client_responses-tokens_delta.adb index a47f4457a..4c4129396 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-tokens_delta.adb +++ b/source/lsp_3.17/generated/lsp-client_responses-tokens_delta.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Client_Responses.Tokens_Delta is diff --git a/source/lsp_3.17/generated/lsp-client_responses-tokens_delta.ads b/source/lsp_3.17/generated/lsp-client_responses-tokens_delta.ads index 3a9c4b8b3..99a7a82dc 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-tokens_delta.ads +++ b/source/lsp_3.17/generated/lsp-client_responses-tokens_delta.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-client_responses-tokens_range.adb b/source/lsp_3.17/generated/lsp-client_responses-tokens_range.adb index 8a2d7dbf1..e1a11498f 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-tokens_range.adb +++ b/source/lsp_3.17/generated/lsp-client_responses-tokens_range.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Client_Responses.Tokens_Range is diff --git a/source/lsp_3.17/generated/lsp-client_responses-tokens_range.ads b/source/lsp_3.17/generated/lsp-client_responses-tokens_range.ads index 5626482a1..691a73d78 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-tokens_range.ads +++ b/source/lsp_3.17/generated/lsp-client_responses-tokens_range.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-client_responses-typedefinition.adb b/source/lsp_3.17/generated/lsp-client_responses-typedefinition.adb index 43906ba64..9fb6576b4 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-typedefinition.adb +++ b/source/lsp_3.17/generated/lsp-client_responses-typedefinition.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Client_Responses.TypeDefinition is diff --git a/source/lsp_3.17/generated/lsp-client_responses-typedefinition.ads b/source/lsp_3.17/generated/lsp-client_responses-typedefinition.ads index 2284c11f0..1ef0eb527 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-typedefinition.ads +++ b/source/lsp_3.17/generated/lsp-client_responses-typedefinition.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-client_responses-willcreatefiles.adb b/source/lsp_3.17/generated/lsp-client_responses-willcreatefiles.adb index fb2a86882..30e6b051a 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-willcreatefiles.adb +++ b/source/lsp_3.17/generated/lsp-client_responses-willcreatefiles.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Client_Responses.WillCreateFiles is diff --git a/source/lsp_3.17/generated/lsp-client_responses-willcreatefiles.ads b/source/lsp_3.17/generated/lsp-client_responses-willcreatefiles.ads index cfd928955..c72e7a142 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-willcreatefiles.ads +++ b/source/lsp_3.17/generated/lsp-client_responses-willcreatefiles.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-client_responses-willdeletefiles.adb b/source/lsp_3.17/generated/lsp-client_responses-willdeletefiles.adb index f472e6be4..55e80562c 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-willdeletefiles.adb +++ b/source/lsp_3.17/generated/lsp-client_responses-willdeletefiles.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Client_Responses.WillDeleteFiles is diff --git a/source/lsp_3.17/generated/lsp-client_responses-willdeletefiles.ads b/source/lsp_3.17/generated/lsp-client_responses-willdeletefiles.ads index ab8942516..e78c58007 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-willdeletefiles.ads +++ b/source/lsp_3.17/generated/lsp-client_responses-willdeletefiles.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-client_responses-willrenamefiles.adb b/source/lsp_3.17/generated/lsp-client_responses-willrenamefiles.adb index 62ff06054..cdbea25b4 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-willrenamefiles.adb +++ b/source/lsp_3.17/generated/lsp-client_responses-willrenamefiles.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Client_Responses.WillRenameFiles is diff --git a/source/lsp_3.17/generated/lsp-client_responses-willrenamefiles.ads b/source/lsp_3.17/generated/lsp-client_responses-willrenamefiles.ads index 5cc76eaeb..4203c73a7 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-willrenamefiles.ads +++ b/source/lsp_3.17/generated/lsp-client_responses-willrenamefiles.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-client_responses-willsavewaituntil.adb b/source/lsp_3.17/generated/lsp-client_responses-willsavewaituntil.adb index 435f99623..b48e4faa6 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-willsavewaituntil.adb +++ b/source/lsp_3.17/generated/lsp-client_responses-willsavewaituntil.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Client_Responses.WillSaveWaitUntil is diff --git a/source/lsp_3.17/generated/lsp-client_responses-willsavewaituntil.ads b/source/lsp_3.17/generated/lsp-client_responses-willsavewaituntil.ads index 29072c637..693c8e4b2 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-willsavewaituntil.ads +++ b/source/lsp_3.17/generated/lsp-client_responses-willsavewaituntil.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-client_responses-workspace_diagnostic.adb b/source/lsp_3.17/generated/lsp-client_responses-workspace_diagnostic.adb index fc98fce17..325b7259c 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-workspace_diagnostic.adb +++ b/source/lsp_3.17/generated/lsp-client_responses-workspace_diagnostic.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Client_Responses.Workspace_Diagnostic is diff --git a/source/lsp_3.17/generated/lsp-client_responses-workspace_diagnostic.ads b/source/lsp_3.17/generated/lsp-client_responses-workspace_diagnostic.ads index ce1628272..faf44aeee 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-workspace_diagnostic.ads +++ b/source/lsp_3.17/generated/lsp-client_responses-workspace_diagnostic.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-enumerations.ads b/source/lsp_3.17/generated/lsp-enumerations.ads index c2579230c..cfb7233c2 100644 --- a/source/lsp_3.17/generated/lsp-enumerations.ads +++ b/source/lsp_3.17/generated/lsp-enumerations.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package LSP.Enumerations is pragma Preelaborate; diff --git a/source/lsp_3.17/generated/lsp-inputs.adb b/source/lsp_3.17/generated/lsp-inputs.adb index b96aa99f5..967a87298 100644 --- a/source/lsp_3.17/generated/lsp-inputs.adb +++ b/source/lsp_3.17/generated/lsp-inputs.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- pragma Ada_2022; with Interfaces; @@ -261,10 +263,6 @@ package body LSP.Inputs is (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; Value : out LSP.Structures.NotebookDocumentSyncClientCapabilities); - procedure Read_ProgressToken - (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; - Value : out LSP.Structures.ProgressToken); - procedure Read_DiagnosticOptions (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; Value : out LSP.Structures.DiagnosticOptions); @@ -1276,11 +1274,11 @@ package body LSP.Inputs is package ClientCapabilities_Scope is package ClientCapabilities_Map is new Minimal_Perfect_Hash (["workspace", - "textDocument", - "notebookDocument", - "window", - "general", - "experimental"]); + "textDocument", + "notebookDocument", + "window", + "general", + "experimental"]); end ClientCapabilities_Scope; @@ -1352,22 +1350,22 @@ package body LSP.Inputs is package InitializeParams_Scope is package InitializeParams_Map is new Minimal_Perfect_Hash (["workDoneToken", - "processId", - "clientInfo", - "locale", - "rootPath", - "rootUri", - "capabilities", - "initializationOptions", - "trace", - "workspaceFolders"]); + "processId", + "clientInfo", + "locale", + "rootPath", + "rootUri", + "capabilities", + "initializationOptions", + "trace", + "workspaceFolders"]); package trace_Of_InitializeParams_Scope is package trace_Of_InitializeParams_Map is new Minimal_Perfect_Hash (["off", - "messages", - "compact", - "verbose"]); + "messages", + "compact", + "verbose"]); end trace_Of_InitializeParams_Scope; @@ -1690,10 +1688,10 @@ package body LSP.Inputs is package FoldingRangeClientCapabilities_Scope is package FoldingRangeClientCapabilities_Map is new Minimal_Perfect_Hash (["dynamicRegistration", - "rangeLimit", - "lineFoldingOnly", - "foldingRangeKind", - "foldingRange"]); + "rangeLimit", + "lineFoldingOnly", + "foldingRangeKind", + "foldingRange"]); package foldingRange_OfFoldingRangeClientCapabilities_Scope is package foldingRange_OfFoldingRangeClientCapabilities_Map is new Minimal_Perfect_Hash @@ -1861,9 +1859,9 @@ package body LSP.Inputs is package CreateFile_Scope is package CreateFile_Map is new Minimal_Perfect_Hash (["kind", - "annotationId", - "uri", - "options"]); + "annotationId", + "uri", + "options"]); end CreateFile_Scope; @@ -1910,7 +1908,7 @@ package body LSP.Inputs is package CompletionContext_Scope is package CompletionContext_Map is new Minimal_Perfect_Hash (["triggerKind", - "triggerCharacter"]); + "triggerCharacter"]); end CompletionContext_Scope; @@ -1968,10 +1966,10 @@ package body LSP.Inputs is package DocumentDiagnosticParams_Scope is package DocumentDiagnosticParams_Map is new Minimal_Perfect_Hash (["workDoneToken", - "partialResultToken", - "textDocument", - "identifier", - "previousResultId"]); + "partialResultToken", + "textDocument", + "identifier", + "previousResultId"]); end DocumentDiagnosticParams_Scope; @@ -2042,14 +2040,14 @@ package body LSP.Inputs is package CodeActionKind_Map is new Minimal_Perfect_Hash (["", - "quickfix", - "refactor", - "refactor.extract", - "refactor.inline", - "refactor.rewrite", - "source", - "source.organizeImports", - "source.fixAll"]); + "quickfix", + "refactor", + "refactor.extract", + "refactor.inline", + "refactor.rewrite", + "source", + "source.organizeImports", + "source.fixAll"]); procedure Read_CodeActionKind (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; @@ -2064,8 +2062,8 @@ package body LSP.Inputs is package RelatedUnchangedDocumentDiagnosticReport_Scope is package RelatedUnchangedDocumentDiagnosticReport_Map is new Minimal_Perfect_Hash (["kind", - "resultId", - "relatedDocuments"]); + "resultId", + "relatedDocuments"]); end RelatedUnchangedDocumentDiagnosticReport_Scope; @@ -2128,7 +2126,7 @@ package body LSP.Inputs is package DidChangeWatchedFilesClientCapabilities_Scope is package DidChangeWatchedFilesClientCapabilities_Map is new Minimal_Perfect_Hash (["dynamicRegistration", - "relativePatternSupport"]); + "relativePatternSupport"]); end DidChangeWatchedFilesClientCapabilities_Scope; @@ -2170,28 +2168,28 @@ package body LSP.Inputs is package SemanticTokenTypes_Map is new Minimal_Perfect_Hash (["namespace", - "type", - "class", - "enum", - "interface", - "struct", - "typeParameter", - "parameter", - "variable", - "property", - "enumMember", - "event", - "function", - "method", - "macro", - "keyword", - "modifier", - "comment", - "string", - "number", - "regexp", - "operator", - "decorator"]); + "type", + "class", + "enum", + "interface", + "struct", + "typeParameter", + "parameter", + "variable", + "property", + "enumMember", + "event", + "function", + "method", + "macro", + "keyword", + "modifier", + "comment", + "string", + "number", + "regexp", + "operator", + "decorator"]); procedure Read_SemanticTokenTypes (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; @@ -2206,8 +2204,8 @@ package body LSP.Inputs is package AnnotatedTextEdit_Scope is package AnnotatedTextEdit_Map is new Minimal_Perfect_Hash (["range", - "newText", - "annotationId"]); + "newText", + "annotationId"]); end AnnotatedTextEdit_Scope; @@ -2283,9 +2281,9 @@ package body LSP.Inputs is package SignatureInformation_Scope is package SignatureInformation_Map is new Minimal_Perfect_Hash (["label", - "documentation", - "parameters", - "activeParameter"]); + "documentation", + "parameters", + "activeParameter"]); end SignatureInformation_Scope; @@ -2370,7 +2368,7 @@ package body LSP.Inputs is package SemanticTokens_Scope is package SemanticTokens_Map is new Minimal_Perfect_Hash (["resultId", - "data"]); + "data"]); end SemanticTokens_Scope; @@ -2407,9 +2405,9 @@ package body LSP.Inputs is package InlineValueParams_Scope is package InlineValueParams_Map is new Minimal_Perfect_Hash (["workDoneToken", - "textDocument", - "range", - "context"]); + "textDocument", + "range", + "context"]); end InlineValueParams_Scope; @@ -2522,15 +2520,15 @@ package body LSP.Inputs is package SemanticTokenModifiers_Map is new Minimal_Perfect_Hash (["declaration", - "definition", - "readonly", - "static", - "deprecated", - "abstract", - "async", - "modification", - "documentation", - "defaultLibrary"]); + "definition", + "readonly", + "static", + "deprecated", + "abstract", + "async", + "modification", + "documentation", + "defaultLibrary"]); procedure Read_SemanticTokenModifiers (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; @@ -2545,7 +2543,7 @@ package body LSP.Inputs is package ConfigurationItem_Scope is package ConfigurationItem_Map is new Minimal_Perfect_Hash (["scopeUri", - "section"]); + "section"]); end ConfigurationItem_Scope; @@ -2664,7 +2662,7 @@ package body LSP.Inputs is package Declaration_Result_Scope is package Declaration_Result_Map is new Minimal_Perfect_Hash (["uri", - "range"]); + "range"]); end Declaration_Result_Scope; @@ -2684,12 +2682,12 @@ package body LSP.Inputs is Handler.Mark; if Handler.Is_Null_Value then Value := - (Kind => LSP.Structures.Varian_3, + (Kind => LSP.Structures.Variant_3, others => <>); elsif Handler.Is_Start_Object then Handler.Read_Next; Value := - (Kind => LSP.Structures.Varian_2, + (Kind => LSP.Structures.Variant_2, others => <>); while Handler.Is_Key_Name loop declare @@ -2702,12 +2700,12 @@ package body LSP.Inputs is case Index is when 1 => -- uri Value := - (Kind => LSP.Structures.Varian_1, + (Kind => LSP.Structures.Variant_1, others => <>); exit; when 2 => -- range Value := - (Kind => LSP.Structures.Varian_1, + (Kind => LSP.Structures.Variant_1, others => <>); exit; when others => @@ -2723,11 +2721,11 @@ package body LSP.Inputs is Handler.Unmark; case Value.Kind is - when LSP.Structures.Varian_1 => - Read_Declaration (Handler, Value.Varian_1); - when LSP.Structures.Varian_2 => - Read_DeclarationLink_Vector (Handler, Value.Varian_2); - when LSP.Structures.Varian_3 => + when LSP.Structures.Variant_1 => + Read_Declaration (Handler, Value.Variant_1); + when LSP.Structures.Variant_2 => + Read_DeclarationLink_Vector (Handler, Value.Variant_2); + when LSP.Structures.Variant_3 => null; -- #null_value Handler.Read_Next; end case; @@ -2737,11 +2735,11 @@ package body LSP.Inputs is package Definition_Progress_Report_Scope is package Definition_Progress_Report_Map is new Minimal_Perfect_Hash (["uri", - "range", - "originSelectionRange", - "targetUri", - "targetRange", - "targetSelectionRange"]); + "range", + "originSelectionRange", + "targetUri", + "targetRange", + "targetSelectionRange"]); end Definition_Progress_Report_Scope; @@ -2775,32 +2773,32 @@ package body LSP.Inputs is case Index is when 1 => -- uri Value := - (Kind => LSP.Structures.Varian_1, + (Kind => LSP.Structures.Variant_1, others => <>); exit; when 2 => -- range Value := - (Kind => LSP.Structures.Varian_1, + (Kind => LSP.Structures.Variant_1, others => <>); exit; when 3 => -- originSelectionRange Value := - (Kind => LSP.Structures.Varian_2, + (Kind => LSP.Structures.Variant_2, others => <>); exit; when 4 => -- targetUri Value := - (Kind => LSP.Structures.Varian_2, + (Kind => LSP.Structures.Variant_2, others => <>); exit; when 5 => -- targetRange Value := - (Kind => LSP.Structures.Varian_2, + (Kind => LSP.Structures.Variant_2, others => <>); exit; when 6 => -- targetSelectionRange Value := - (Kind => LSP.Structures.Varian_2, + (Kind => LSP.Structures.Variant_2, others => <>); exit; when others => @@ -2816,10 +2814,10 @@ package body LSP.Inputs is Handler.Unmark; case Value.Kind is - when LSP.Structures.Varian_1 => - Read_Location_Vector (Handler, Value.Varian_1); - when LSP.Structures.Varian_2 => - Read_DefinitionLink_Vector (Handler, Value.Varian_2); + when LSP.Structures.Variant_1 => + Read_Location_Vector (Handler, Value.Variant_1); + when LSP.Structures.Variant_2 => + Read_DefinitionLink_Vector (Handler, Value.Variant_2); end case; end; end Read_Definition_Progress_Report; @@ -2827,8 +2825,8 @@ package body LSP.Inputs is package SemanticTokensParams_Scope is package SemanticTokensParams_Map is new Minimal_Perfect_Hash (["workDoneToken", - "partialResultToken", - "textDocument"]); + "partialResultToken", + "textDocument"]); end SemanticTokensParams_Scope; @@ -2928,11 +2926,11 @@ package body LSP.Inputs is package DocumentSymbol_Progress_Report_Scope is package DocumentSymbol_Progress_Report_Map is new Minimal_Perfect_Hash (["location", - "containerName", - "detail", - "range", - "selectionRange", - "children"]); + "containerName", + "detail", + "range", + "selectionRange", + "children"]); end DocumentSymbol_Progress_Report_Scope; @@ -2966,32 +2964,32 @@ package body LSP.Inputs is case Index is when 1 => -- location Value := - (Kind => LSP.Structures.Varian_1, + (Kind => LSP.Structures.Variant_1, others => <>); exit; when 2 => -- containerName Value := - (Kind => LSP.Structures.Varian_1, + (Kind => LSP.Structures.Variant_1, others => <>); exit; when 3 => -- detail Value := - (Kind => LSP.Structures.Varian_2, + (Kind => LSP.Structures.Variant_2, others => <>); exit; when 4 => -- range Value := - (Kind => LSP.Structures.Varian_2, + (Kind => LSP.Structures.Variant_2, others => <>); exit; when 5 => -- selectionRange Value := - (Kind => LSP.Structures.Varian_2, + (Kind => LSP.Structures.Variant_2, others => <>); exit; when 6 => -- children Value := - (Kind => LSP.Structures.Varian_2, + (Kind => LSP.Structures.Variant_2, others => <>); exit; when others => @@ -3007,10 +3005,10 @@ package body LSP.Inputs is Handler.Unmark; case Value.Kind is - when LSP.Structures.Varian_1 => - Read_SymbolInformation_Vector (Handler, Value.Varian_1); - when LSP.Structures.Varian_2 => - Read_DocumentSymbol_Vector (Handler, Value.Varian_2); + when LSP.Structures.Variant_1 => + Read_SymbolInformation_Vector (Handler, Value.Variant_1); + when LSP.Structures.Variant_2 => + Read_DocumentSymbol_Vector (Handler, Value.Variant_2); end case; end; end Read_DocumentSymbol_Progress_Report; @@ -3076,8 +3074,8 @@ package body LSP.Inputs is package NotebookDocumentFilter_Scope is package NotebookDocumentFilter_Map is new Minimal_Perfect_Hash (["notebookType", - "scheme", - "pattern"]); + "scheme", + "pattern"]); end NotebookDocumentFilter_Scope; @@ -3119,9 +3117,9 @@ package body LSP.Inputs is package Color_Scope is package Color_Map is new Minimal_Perfect_Hash (["red", - "green", - "blue", - "alpha"]); + "green", + "blue", + "alpha"]); end Color_Scope; @@ -3164,8 +3162,8 @@ package body LSP.Inputs is package FileOperationPattern_Scope is package FileOperationPattern_Map is new Minimal_Perfect_Hash (["glob", - "matches", - "options"]); + "matches", + "options"]); end FileOperationPattern_Scope; @@ -3211,7 +3209,7 @@ package body LSP.Inputs is package LinkedEditingRanges_Scope is package LinkedEditingRanges_Map is new Minimal_Perfect_Hash (["ranges", - "wordPattern"]); + "wordPattern"]); end LinkedEditingRanges_Scope; @@ -3293,40 +3291,40 @@ package body LSP.Inputs is package ServerCapabilities_Scope is package ServerCapabilities_Map is new Minimal_Perfect_Hash (["positionEncoding", - "textDocumentSync", - "notebookDocumentSync", - "completionProvider", - "hoverProvider", - "signatureHelpProvider", - "declarationProvider", - "definitionProvider", - "typeDefinitionProvider", - "implementationProvider", - "referencesProvider", - "documentHighlightProvider", - "documentSymbolProvider", - "codeActionProvider", - "codeLensProvider", - "documentLinkProvider", - "colorProvider", - "workspaceSymbolProvider", - "documentFormattingProvider", - "documentRangeFormattingProvider", - "documentOnTypeFormattingProvider", - "renameProvider", - "foldingRangeProvider", - "selectionRangeProvider", - "executeCommandProvider", - "callHierarchyProvider", - "linkedEditingRangeProvider", - "semanticTokensProvider", - "monikerProvider", - "typeHierarchyProvider", - "inlineValueProvider", - "inlayHintProvider", - "diagnosticProvider", - "workspace", - "experimental"]); + "textDocumentSync", + "notebookDocumentSync", + "completionProvider", + "hoverProvider", + "signatureHelpProvider", + "declarationProvider", + "definitionProvider", + "typeDefinitionProvider", + "implementationProvider", + "referencesProvider", + "documentHighlightProvider", + "documentSymbolProvider", + "codeActionProvider", + "codeLensProvider", + "documentLinkProvider", + "colorProvider", + "workspaceSymbolProvider", + "documentFormattingProvider", + "documentRangeFormattingProvider", + "documentOnTypeFormattingProvider", + "renameProvider", + "foldingRangeProvider", + "selectionRangeProvider", + "executeCommandProvider", + "callHierarchyProvider", + "linkedEditingRangeProvider", + "semanticTokensProvider", + "monikerProvider", + "typeHierarchyProvider", + "inlineValueProvider", + "inlayHintProvider", + "diagnosticProvider", + "workspace", + "experimental"]); package NotebookDocumentSyncOptions_Or_NotebookDocumentSyncRegistrationOptions_Scope is @@ -3338,28 +3336,28 @@ package body LSP.Inputs is package implementationProvider_OfServerCapabilities_Scope is package implementationProvider_OfServerCapabilities_Map is new Minimal_Perfect_Hash (["documentSelector", - "id"]); + "id"]); end implementationProvider_OfServerCapabilities_Scope; package typeHierarchyProvider_OfServerCapabilities_Scope is package typeHierarchyProvider_OfServerCapabilities_Map is new Minimal_Perfect_Hash (["documentSelector", - "id"]); + "id"]); end typeHierarchyProvider_OfServerCapabilities_Scope; package DiagnosticOptions_Or_DiagnosticRegistrationOptions_Scope is package DiagnosticOptions_Or_DiagnosticRegistrationOptions_Map is new Minimal_Perfect_Hash (["documentSelector", - "id"]); + "id"]); end DiagnosticOptions_Or_DiagnosticRegistrationOptions_Scope; package inlayHintProvider_OfServerCapabilities_Scope is package inlayHintProvider_OfServerCapabilities_Map is new Minimal_Perfect_Hash (["documentSelector", - "id"]); + "id"]); end inlayHintProvider_OfServerCapabilities_Scope; @@ -3367,7 +3365,7 @@ package body LSP.Inputs is is package SemanticTokensOptions_Or_SemanticTokensRegistrationOptions_Map is new Minimal_Perfect_Hash (["documentSelector", - "id"]); + "id"]); end SemanticTokensOptions_Or_SemanticTokensRegistrationOptions_Scope; @@ -3380,63 +3378,63 @@ package body LSP.Inputs is package selectionRangeProvider_OfServerCapabilities_Scope is package selectionRangeProvider_OfServerCapabilities_Map is new Minimal_Perfect_Hash (["documentSelector", - "id"]); + "id"]); end selectionRangeProvider_OfServerCapabilities_Scope; package workspace_OfServerCapabilities_Scope is package workspace_OfServerCapabilities_Map is new Minimal_Perfect_Hash (["workspaceFolders", - "fileOperations"]); + "fileOperations"]); end workspace_OfServerCapabilities_Scope; package declarationProvider_OfServerCapabilities_Scope is package declarationProvider_OfServerCapabilities_Map is new Minimal_Perfect_Hash (["documentSelector", - "id"]); + "id"]); end declarationProvider_OfServerCapabilities_Scope; package callHierarchyProvider_OfServerCapabilities_Scope is package callHierarchyProvider_OfServerCapabilities_Map is new Minimal_Perfect_Hash (["documentSelector", - "id"]); + "id"]); end callHierarchyProvider_OfServerCapabilities_Scope; package linkedEditingRangeProvider_OfServerCapabilities_Scope is package linkedEditingRangeProvider_OfServerCapabilities_Map is new Minimal_Perfect_Hash (["documentSelector", - "id"]); + "id"]); end linkedEditingRangeProvider_OfServerCapabilities_Scope; package foldingRangeProvider_OfServerCapabilities_Scope is package foldingRangeProvider_OfServerCapabilities_Map is new Minimal_Perfect_Hash (["documentSelector", - "id"]); + "id"]); end foldingRangeProvider_OfServerCapabilities_Scope; package typeDefinitionProvider_OfServerCapabilities_Scope is package typeDefinitionProvider_OfServerCapabilities_Map is new Minimal_Perfect_Hash (["documentSelector", - "id"]); + "id"]); end typeDefinitionProvider_OfServerCapabilities_Scope; package inlineValueProvider_OfServerCapabilities_Scope is package inlineValueProvider_OfServerCapabilities_Map is new Minimal_Perfect_Hash (["documentSelector", - "id"]); + "id"]); end inlineValueProvider_OfServerCapabilities_Scope; package colorProvider_OfServerCapabilities_Scope is package colorProvider_OfServerCapabilities_Map is new Minimal_Perfect_Hash (["documentSelector", - "id"]); + "id"]); end colorProvider_OfServerCapabilities_Scope; @@ -3691,12 +3689,12 @@ package body LSP.Inputs is Handler.Mark; if Handler.Is_Boolean_Value then Value := - (Kind => LSP.Structures.Varian_1, + (Kind => LSP.Structures.Variant_1, others => <>); elsif Handler.Is_Start_Object then Handler.Read_Next; Value := - (Kind => LSP.Structures.Varian_2, + (Kind => LSP.Structures.Variant_2, others => <>); while Handler.Is_Key_Name loop declare @@ -3711,12 +3709,12 @@ package body LSP.Inputs is case Index is when 1 => -- documentSelector Value := - (Kind => LSP.Structures.Varian_3, + (Kind => LSP.Structures.Variant_3, others => <>); exit; when 2 => -- id Value := - (Kind => LSP.Structures.Varian_3, + (Kind => LSP.Structures.Variant_3, others => <>); exit; when others => @@ -3732,14 +3730,14 @@ package body LSP.Inputs is Handler.Unmark; case Value.Kind is - when LSP.Structures.Varian_1 => - Value.Varian_1 := Handler.Boolean_Value; + when LSP.Structures.Variant_1 => + Value.Variant_1 := Handler.Boolean_Value; Handler.Read_Next; - when LSP.Structures.Varian_2 => - Read_ImplementationOptions (Handler, Value.Varian_2); - when LSP.Structures.Varian_3 => + when LSP.Structures.Variant_2 => + Read_ImplementationOptions (Handler, Value.Variant_2); + when LSP.Structures.Variant_3 => Read_ImplementationRegistrationOptions - (Handler, Value.Varian_3); + (Handler, Value.Variant_3); end case; end; end Read_implementationProvider_OfServerCapabilities; @@ -3762,12 +3760,12 @@ package body LSP.Inputs is Handler.Mark; if Handler.Is_Boolean_Value then Value := - (Kind => LSP.Structures.Varian_1, + (Kind => LSP.Structures.Variant_1, others => <>); elsif Handler.Is_Start_Object then Handler.Read_Next; Value := - (Kind => LSP.Structures.Varian_2, + (Kind => LSP.Structures.Variant_2, others => <>); while Handler.Is_Key_Name loop declare @@ -3781,12 +3779,12 @@ package body LSP.Inputs is case Index is when 1 => -- documentSelector Value := - (Kind => LSP.Structures.Varian_3, + (Kind => LSP.Structures.Variant_3, others => <>); exit; when 2 => -- id Value := - (Kind => LSP.Structures.Varian_3, + (Kind => LSP.Structures.Variant_3, others => <>); exit; when others => @@ -3802,14 +3800,14 @@ package body LSP.Inputs is Handler.Unmark; case Value.Kind is - when LSP.Structures.Varian_1 => - Value.Varian_1 := Handler.Boolean_Value; + when LSP.Structures.Variant_1 => + Value.Variant_1 := Handler.Boolean_Value; Handler.Read_Next; - when LSP.Structures.Varian_2 => - Read_TypeHierarchyOptions (Handler, Value.Varian_2); - when LSP.Structures.Varian_3 => + when LSP.Structures.Variant_2 => + Read_TypeHierarchyOptions (Handler, Value.Variant_2); + when LSP.Structures.Variant_3 => Read_TypeHierarchyRegistrationOptions - (Handler, Value.Varian_3); + (Handler, Value.Variant_3); end case; end; end Read_typeHierarchyProvider_OfServerCapabilities; @@ -3895,12 +3893,12 @@ package body LSP.Inputs is Handler.Mark; if Handler.Is_Boolean_Value then Value := - (Kind => LSP.Structures.Varian_1, + (Kind => LSP.Structures.Variant_1, others => <>); elsif Handler.Is_Start_Object then Handler.Read_Next; Value := - (Kind => LSP.Structures.Varian_2, + (Kind => LSP.Structures.Variant_2, others => <>); while Handler.Is_Key_Name loop declare @@ -3914,12 +3912,12 @@ package body LSP.Inputs is case Index is when 1 => -- documentSelector Value := - (Kind => LSP.Structures.Varian_3, + (Kind => LSP.Structures.Variant_3, others => <>); exit; when 2 => -- id Value := - (Kind => LSP.Structures.Varian_3, + (Kind => LSP.Structures.Variant_3, others => <>); exit; when others => @@ -3935,13 +3933,13 @@ package body LSP.Inputs is Handler.Unmark; case Value.Kind is - when LSP.Structures.Varian_1 => - Value.Varian_1 := Handler.Boolean_Value; + when LSP.Structures.Variant_1 => + Value.Variant_1 := Handler.Boolean_Value; Handler.Read_Next; - when LSP.Structures.Varian_2 => - Read_InlayHintOptions (Handler, Value.Varian_2); - when LSP.Structures.Varian_3 => - Read_InlayHintRegistrationOptions (Handler, Value.Varian_3); + when LSP.Structures.Variant_2 => + Read_InlayHintOptions (Handler, Value.Variant_2); + when LSP.Structures.Variant_3 => + Read_InlayHintRegistrationOptions (Handler, Value.Variant_3); end case; end; end Read_inlayHintProvider_OfServerCapabilities; @@ -4028,12 +4026,12 @@ package body LSP.Inputs is Handler.Mark; if Handler.Is_Boolean_Value then Value := - (Kind => LSP.Structures.Varian_1, + (Kind => LSP.Structures.Variant_1, others => <>); elsif Handler.Is_Start_Object then Handler.Read_Next; Value := - (Kind => LSP.Structures.Varian_2, + (Kind => LSP.Structures.Variant_2, others => <>); while Handler.Is_Key_Name loop declare @@ -4047,7 +4045,7 @@ package body LSP.Inputs is case Index is when 1 => -- documentSelector Value := - (Kind => LSP.Structures.Varian_3, + (Kind => LSP.Structures.Variant_3, others => <>); exit; when others => @@ -4063,13 +4061,13 @@ package body LSP.Inputs is Handler.Unmark; case Value.Kind is - when LSP.Structures.Varian_1 => - Value.Varian_1 := Handler.Boolean_Value; + when LSP.Structures.Variant_1 => + Value.Variant_1 := Handler.Boolean_Value; Handler.Read_Next; - when LSP.Structures.Varian_2 => - Read_MonikerOptions (Handler, Value.Varian_2); - when LSP.Structures.Varian_3 => - Read_MonikerRegistrationOptions (Handler, Value.Varian_3); + when LSP.Structures.Variant_2 => + Read_MonikerOptions (Handler, Value.Variant_2); + when LSP.Structures.Variant_3 => + Read_MonikerRegistrationOptions (Handler, Value.Variant_3); end case; end; end Read_monikerProvider_OfServerCapabilities; @@ -4115,12 +4113,12 @@ package body LSP.Inputs is Handler.Mark; if Handler.Is_Boolean_Value then Value := - (Kind => LSP.Structures.Varian_1, + (Kind => LSP.Structures.Variant_1, others => <>); elsif Handler.Is_Start_Object then Handler.Read_Next; Value := - (Kind => LSP.Structures.Varian_2, + (Kind => LSP.Structures.Variant_2, others => <>); while Handler.Is_Key_Name loop declare @@ -4135,12 +4133,12 @@ package body LSP.Inputs is case Index is when 1 => -- documentSelector Value := - (Kind => LSP.Structures.Varian_3, + (Kind => LSP.Structures.Variant_3, others => <>); exit; when 2 => -- id Value := - (Kind => LSP.Structures.Varian_3, + (Kind => LSP.Structures.Variant_3, others => <>); exit; when others => @@ -4156,14 +4154,14 @@ package body LSP.Inputs is Handler.Unmark; case Value.Kind is - when LSP.Structures.Varian_1 => - Value.Varian_1 := Handler.Boolean_Value; + when LSP.Structures.Variant_1 => + Value.Variant_1 := Handler.Boolean_Value; Handler.Read_Next; - when LSP.Structures.Varian_2 => - Read_SelectionRangeOptions (Handler, Value.Varian_2); - when LSP.Structures.Varian_3 => + when LSP.Structures.Variant_2 => + Read_SelectionRangeOptions (Handler, Value.Variant_2); + when LSP.Structures.Variant_3 => Read_SelectionRangeRegistrationOptions - (Handler, Value.Varian_3); + (Handler, Value.Variant_3); end case; end; end Read_selectionRangeProvider_OfServerCapabilities; @@ -4269,12 +4267,12 @@ package body LSP.Inputs is Handler.Mark; if Handler.Is_Boolean_Value then Value := - (Kind => LSP.Structures.Varian_1, + (Kind => LSP.Structures.Variant_1, others => <>); elsif Handler.Is_Start_Object then Handler.Read_Next; Value := - (Kind => LSP.Structures.Varian_2, + (Kind => LSP.Structures.Variant_2, others => <>); while Handler.Is_Key_Name loop declare @@ -4288,12 +4286,12 @@ package body LSP.Inputs is case Index is when 1 => -- documentSelector Value := - (Kind => LSP.Structures.Varian_3, + (Kind => LSP.Structures.Variant_3, others => <>); exit; when 2 => -- id Value := - (Kind => LSP.Structures.Varian_3, + (Kind => LSP.Structures.Variant_3, others => <>); exit; when others => @@ -4309,14 +4307,14 @@ package body LSP.Inputs is Handler.Unmark; case Value.Kind is - when LSP.Structures.Varian_1 => - Value.Varian_1 := Handler.Boolean_Value; + when LSP.Structures.Variant_1 => + Value.Variant_1 := Handler.Boolean_Value; Handler.Read_Next; - when LSP.Structures.Varian_2 => - Read_DeclarationOptions (Handler, Value.Varian_2); - when LSP.Structures.Varian_3 => + when LSP.Structures.Variant_2 => + Read_DeclarationOptions (Handler, Value.Variant_2); + when LSP.Structures.Variant_3 => Read_DeclarationRegistrationOptions - (Handler, Value.Varian_3); + (Handler, Value.Variant_3); end case; end; end Read_declarationProvider_OfServerCapabilities; @@ -4339,12 +4337,12 @@ package body LSP.Inputs is Handler.Mark; if Handler.Is_Boolean_Value then Value := - (Kind => LSP.Structures.Varian_1, + (Kind => LSP.Structures.Variant_1, others => <>); elsif Handler.Is_Start_Object then Handler.Read_Next; Value := - (Kind => LSP.Structures.Varian_2, + (Kind => LSP.Structures.Variant_2, others => <>); while Handler.Is_Key_Name loop declare @@ -4358,12 +4356,12 @@ package body LSP.Inputs is case Index is when 1 => -- documentSelector Value := - (Kind => LSP.Structures.Varian_3, + (Kind => LSP.Structures.Variant_3, others => <>); exit; when 2 => -- id Value := - (Kind => LSP.Structures.Varian_3, + (Kind => LSP.Structures.Variant_3, others => <>); exit; when others => @@ -4379,14 +4377,14 @@ package body LSP.Inputs is Handler.Unmark; case Value.Kind is - when LSP.Structures.Varian_1 => - Value.Varian_1 := Handler.Boolean_Value; + when LSP.Structures.Variant_1 => + Value.Variant_1 := Handler.Boolean_Value; Handler.Read_Next; - when LSP.Structures.Varian_2 => - Read_CallHierarchyOptions (Handler, Value.Varian_2); - when LSP.Structures.Varian_3 => + when LSP.Structures.Variant_2 => + Read_CallHierarchyOptions (Handler, Value.Variant_2); + when LSP.Structures.Variant_3 => Read_CallHierarchyRegistrationOptions - (Handler, Value.Varian_3); + (Handler, Value.Variant_3); end case; end; end Read_callHierarchyProvider_OfServerCapabilities; @@ -4457,12 +4455,12 @@ package body LSP.Inputs is Handler.Mark; if Handler.Is_Boolean_Value then Value := - (Kind => LSP.Structures.Varian_1, + (Kind => LSP.Structures.Variant_1, others => <>); elsif Handler.Is_Start_Object then Handler.Read_Next; Value := - (Kind => LSP.Structures.Varian_2, + (Kind => LSP.Structures.Variant_2, others => <>); while Handler.Is_Key_Name loop declare @@ -4477,12 +4475,12 @@ package body LSP.Inputs is case Index is when 1 => -- documentSelector Value := - (Kind => LSP.Structures.Varian_3, + (Kind => LSP.Structures.Variant_3, others => <>); exit; when 2 => -- id Value := - (Kind => LSP.Structures.Varian_3, + (Kind => LSP.Structures.Variant_3, others => <>); exit; when others => @@ -4498,14 +4496,14 @@ package body LSP.Inputs is Handler.Unmark; case Value.Kind is - when LSP.Structures.Varian_1 => - Value.Varian_1 := Handler.Boolean_Value; + when LSP.Structures.Variant_1 => + Value.Variant_1 := Handler.Boolean_Value; Handler.Read_Next; - when LSP.Structures.Varian_2 => - Read_LinkedEditingRangeOptions (Handler, Value.Varian_2); - when LSP.Structures.Varian_3 => + when LSP.Structures.Variant_2 => + Read_LinkedEditingRangeOptions (Handler, Value.Variant_2); + when LSP.Structures.Variant_3 => Read_LinkedEditingRangeRegistrationOptions - (Handler, Value.Varian_3); + (Handler, Value.Variant_3); end case; end; end Read_linkedEditingRangeProvider_OfServerCapabilities; @@ -4575,12 +4573,12 @@ package body LSP.Inputs is Handler.Mark; if Handler.Is_Boolean_Value then Value := - (Kind => LSP.Structures.Varian_1, + (Kind => LSP.Structures.Variant_1, others => <>); elsif Handler.Is_Start_Object then Handler.Read_Next; Value := - (Kind => LSP.Structures.Varian_2, + (Kind => LSP.Structures.Variant_2, others => <>); while Handler.Is_Key_Name loop declare @@ -4594,12 +4592,12 @@ package body LSP.Inputs is case Index is when 1 => -- documentSelector Value := - (Kind => LSP.Structures.Varian_3, + (Kind => LSP.Structures.Variant_3, others => <>); exit; when 2 => -- id Value := - (Kind => LSP.Structures.Varian_3, + (Kind => LSP.Structures.Variant_3, others => <>); exit; when others => @@ -4615,14 +4613,14 @@ package body LSP.Inputs is Handler.Unmark; case Value.Kind is - when LSP.Structures.Varian_1 => - Value.Varian_1 := Handler.Boolean_Value; + when LSP.Structures.Variant_1 => + Value.Variant_1 := Handler.Boolean_Value; Handler.Read_Next; - when LSP.Structures.Varian_2 => - Read_FoldingRangeOptions (Handler, Value.Varian_2); - when LSP.Structures.Varian_3 => + when LSP.Structures.Variant_2 => + Read_FoldingRangeOptions (Handler, Value.Variant_2); + when LSP.Structures.Variant_3 => Read_FoldingRangeRegistrationOptions - (Handler, Value.Varian_3); + (Handler, Value.Variant_3); end case; end; end Read_foldingRangeProvider_OfServerCapabilities; @@ -4645,12 +4643,12 @@ package body LSP.Inputs is Handler.Mark; if Handler.Is_Boolean_Value then Value := - (Kind => LSP.Structures.Varian_1, + (Kind => LSP.Structures.Variant_1, others => <>); elsif Handler.Is_Start_Object then Handler.Read_Next; Value := - (Kind => LSP.Structures.Varian_2, + (Kind => LSP.Structures.Variant_2, others => <>); while Handler.Is_Key_Name loop declare @@ -4665,12 +4663,12 @@ package body LSP.Inputs is case Index is when 1 => -- documentSelector Value := - (Kind => LSP.Structures.Varian_3, + (Kind => LSP.Structures.Variant_3, others => <>); exit; when 2 => -- id Value := - (Kind => LSP.Structures.Varian_3, + (Kind => LSP.Structures.Variant_3, others => <>); exit; when others => @@ -4686,14 +4684,14 @@ package body LSP.Inputs is Handler.Unmark; case Value.Kind is - when LSP.Structures.Varian_1 => - Value.Varian_1 := Handler.Boolean_Value; + when LSP.Structures.Variant_1 => + Value.Variant_1 := Handler.Boolean_Value; Handler.Read_Next; - when LSP.Structures.Varian_2 => - Read_TypeDefinitionOptions (Handler, Value.Varian_2); - when LSP.Structures.Varian_3 => + when LSP.Structures.Variant_2 => + Read_TypeDefinitionOptions (Handler, Value.Variant_2); + when LSP.Structures.Variant_3 => Read_TypeDefinitionRegistrationOptions - (Handler, Value.Varian_3); + (Handler, Value.Variant_3); end case; end; end Read_typeDefinitionProvider_OfServerCapabilities; @@ -4716,12 +4714,12 @@ package body LSP.Inputs is Handler.Mark; if Handler.Is_Boolean_Value then Value := - (Kind => LSP.Structures.Varian_1, + (Kind => LSP.Structures.Variant_1, others => <>); elsif Handler.Is_Start_Object then Handler.Read_Next; Value := - (Kind => LSP.Structures.Varian_2, + (Kind => LSP.Structures.Variant_2, others => <>); while Handler.Is_Key_Name loop declare @@ -4735,12 +4733,12 @@ package body LSP.Inputs is case Index is when 1 => -- documentSelector Value := - (Kind => LSP.Structures.Varian_3, + (Kind => LSP.Structures.Variant_3, others => <>); exit; when 2 => -- id Value := - (Kind => LSP.Structures.Varian_3, + (Kind => LSP.Structures.Variant_3, others => <>); exit; when others => @@ -4756,14 +4754,14 @@ package body LSP.Inputs is Handler.Unmark; case Value.Kind is - when LSP.Structures.Varian_1 => - Value.Varian_1 := Handler.Boolean_Value; + when LSP.Structures.Variant_1 => + Value.Variant_1 := Handler.Boolean_Value; Handler.Read_Next; - when LSP.Structures.Varian_2 => - Read_InlineValueOptions (Handler, Value.Varian_2); - when LSP.Structures.Varian_3 => + when LSP.Structures.Variant_2 => + Read_InlineValueOptions (Handler, Value.Variant_2); + when LSP.Structures.Variant_3 => Read_InlineValueRegistrationOptions - (Handler, Value.Varian_3); + (Handler, Value.Variant_3); end case; end; end Read_inlineValueProvider_OfServerCapabilities; @@ -4785,12 +4783,12 @@ package body LSP.Inputs is Handler.Mark; if Handler.Is_Boolean_Value then Value := - (Kind => LSP.Structures.Varian_1, + (Kind => LSP.Structures.Variant_1, others => <>); elsif Handler.Is_Start_Object then Handler.Read_Next; Value := - (Kind => LSP.Structures.Varian_2, + (Kind => LSP.Structures.Variant_2, others => <>); while Handler.Is_Key_Name loop declare @@ -4803,12 +4801,12 @@ package body LSP.Inputs is case Index is when 1 => -- documentSelector Value := - (Kind => LSP.Structures.Varian_3, + (Kind => LSP.Structures.Variant_3, others => <>); exit; when 2 => -- id Value := - (Kind => LSP.Structures.Varian_3, + (Kind => LSP.Structures.Variant_3, others => <>); exit; when others => @@ -4824,14 +4822,14 @@ package body LSP.Inputs is Handler.Unmark; case Value.Kind is - when LSP.Structures.Varian_1 => - Value.Varian_1 := Handler.Boolean_Value; + when LSP.Structures.Variant_1 => + Value.Variant_1 := Handler.Boolean_Value; Handler.Read_Next; - when LSP.Structures.Varian_2 => - Read_DocumentColorOptions (Handler, Value.Varian_2); - when LSP.Structures.Varian_3 => + when LSP.Structures.Variant_2 => + Read_DocumentColorOptions (Handler, Value.Variant_2); + when LSP.Structures.Variant_3 => Read_DocumentColorRegistrationOptions - (Handler, Value.Varian_3); + (Handler, Value.Variant_3); end case; end; end Read_colorProvider_OfServerCapabilities; @@ -5214,8 +5212,8 @@ package body LSP.Inputs is package ImplementationRegistrationOptions_Scope is package ImplementationRegistrationOptions_Map is new Minimal_Perfect_Hash (["documentSelector", - "workDoneProgress", - "id"]); + "workDoneProgress", + "id"]); end ImplementationRegistrationOptions_Scope; @@ -5277,7 +5275,7 @@ package body LSP.Inputs is package LogTraceParams_Scope is package LogTraceParams_Map is new Minimal_Perfect_Hash (["message", - "verbose"]); + "verbose"]); end LogTraceParams_Scope; @@ -5316,8 +5314,8 @@ package body LSP.Inputs is package FoldingRangeRegistrationOptions_Scope is package FoldingRangeRegistrationOptions_Map is new Minimal_Perfect_Hash (["documentSelector", - "workDoneProgress", - "id"]); + "workDoneProgress", + "id"]); end FoldingRangeRegistrationOptions_Scope; @@ -5379,7 +5377,7 @@ package body LSP.Inputs is package InlineValueContext_Scope is package InlineValueContext_Map is new Minimal_Perfect_Hash (["frameId", - "stoppedLocation"]); + "stoppedLocation"]); end InlineValueContext_Scope; @@ -5499,10 +5497,10 @@ package body LSP.Inputs is package RenameFile_Scope is package RenameFile_Map is new Minimal_Perfect_Hash (["kind", - "annotationId", - "oldUri", - "newUri", - "options"]); + "annotationId", + "oldUri", + "newUri", + "options"]); end RenameFile_Scope; @@ -5635,13 +5633,13 @@ package body LSP.Inputs is package CallHierarchyItem_Scope is package CallHierarchyItem_Map is new Minimal_Perfect_Hash (["name", - "kind", - "tags", - "detail", - "uri", - "range", - "selectionRange", - "data"]); + "kind", + "tags", + "detail", + "uri", + "range", + "selectionRange", + "data"]); end CallHierarchyItem_Scope; @@ -5735,7 +5733,7 @@ package body LSP.Inputs is package RelativePattern_Scope is package RelativePattern_Map is new Minimal_Perfect_Hash (["baseUri", - "pattern"]); + "pattern"]); end RelativePattern_Scope; @@ -5808,9 +5806,9 @@ package body LSP.Inputs is package WorkDoneProgressReport_Scope is package WorkDoneProgressReport_Map is new Minimal_Perfect_Hash (["kind", - "cancellable", - "message", - "percentage"]); + "cancellable", + "message", + "percentage"]); end WorkDoneProgressReport_Scope; @@ -5929,35 +5927,35 @@ package body LSP.Inputs is package TextDocumentClientCapabilities_Scope is package TextDocumentClientCapabilities_Map is new Minimal_Perfect_Hash (["synchronization", - "completion", - "hover", - "signatureHelp", - "declaration", - "definition", - "typeDefinition", - "implementation", - "references", - "documentHighlight", - "documentSymbol", - "codeAction", - "codeLens", - "documentLink", - "colorProvider", - "formatting", - "rangeFormatting", - "onTypeFormatting", - "rename", - "foldingRange", - "selectionRange", - "publishDiagnostics", - "callHierarchy", - "semanticTokens", - "linkedEditingRange", - "moniker", - "typeHierarchy", - "inlineValue", - "inlayHint", - "diagnostic"]); + "completion", + "hover", + "signatureHelp", + "declaration", + "definition", + "typeDefinition", + "implementation", + "references", + "documentHighlight", + "documentSymbol", + "codeAction", + "codeLens", + "documentLink", + "colorProvider", + "formatting", + "rangeFormatting", + "onTypeFormatting", + "rename", + "foldingRange", + "selectionRange", + "publishDiagnostics", + "callHierarchy", + "semanticTokens", + "linkedEditingRange", + "moniker", + "typeHierarchy", + "inlineValue", + "inlayHint", + "diagnostic"]); end TextDocumentClientCapabilities_Scope; @@ -6166,8 +6164,8 @@ package body LSP.Inputs is package WorkspaceSymbolParams_Scope is package WorkspaceSymbolParams_Map is new Minimal_Perfect_Hash (["workDoneToken", - "partialResultToken", - "query"]); + "partialResultToken", + "query"]); end WorkspaceSymbolParams_Scope; @@ -6287,8 +6285,8 @@ package body LSP.Inputs is package InsertReplaceEdit_Scope is package InsertReplaceEdit_Map is new Minimal_Perfect_Hash (["newText", - "insert", - "replace"]); + "insert", + "replace"]); end InsertReplaceEdit_Scope; @@ -6327,7 +6325,7 @@ package body LSP.Inputs is package InitializeResult_Scope is package InitializeResult_Map is new Minimal_Perfect_Hash (["capabilities", - "serverInfo"]); + "serverInfo"]); end InitializeResult_Scope; @@ -6366,8 +6364,8 @@ package body LSP.Inputs is package InlineValueVariableLookup_Scope is package InlineValueVariableLookup_Map is new Minimal_Perfect_Hash (["range", - "variableName", - "caseSensitiveLookup"]); + "variableName", + "caseSensitiveLookup"]); end InlineValueVariableLookup_Scope; @@ -6407,7 +6405,7 @@ package body LSP.Inputs is package FileEvent_Scope is package FileEvent_Map is new Minimal_Perfect_Hash (["uri", - "type"]); + "type"]); end FileEvent_Scope; @@ -6443,14 +6441,14 @@ package body LSP.Inputs is package SignatureHelpClientCapabilities_Scope is package SignatureHelpClientCapabilities_Map is new Minimal_Perfect_Hash (["dynamicRegistration", - "signatureInformation", - "contextSupport"]); + "signatureInformation", + "contextSupport"]); package signatureInformation_OfSignatureHelpClientCapabilities_Scope is package signatureInformation_OfSignatureHelpClientCapabilities_Map is new Minimal_Perfect_Hash (["documentationFormat", - "parameterInformation", - "activeParameterSupport"]); + "parameterInformation", + "activeParameterSupport"]); end signatureInformation_OfSignatureHelpClientCapabilities_Scope; @@ -6626,7 +6624,7 @@ package body LSP.Inputs is package NotebookDocumentSyncClientCapabilities_Scope is package NotebookDocumentSyncClientCapabilities_Map is new Minimal_Perfect_Hash (["dynamicRegistration", - "executionSummarySupport"]); + "executionSummarySupport"]); end NotebookDocumentSyncClientCapabilities_Scope; @@ -6694,9 +6692,9 @@ package body LSP.Inputs is package DiagnosticOptions_Scope is package DiagnosticOptions_Map is new Minimal_Perfect_Hash (["workDoneProgress", - "identifier", - "interFileDependencies", - "workspaceDiagnostics"]); + "identifier", + "interFileDependencies", + "workspaceDiagnostics"]); end DiagnosticOptions_Scope; @@ -6743,8 +6741,8 @@ package body LSP.Inputs is package WindowClientCapabilities_Scope is package WindowClientCapabilities_Map is new Minimal_Perfect_Hash (["workDoneProgress", - "showMessage", - "showDocument"]); + "showMessage", + "showDocument"]); end WindowClientCapabilities_Scope; @@ -6793,14 +6791,14 @@ package body LSP.Inputs is package GeneralClientCapabilities_Scope is package GeneralClientCapabilities_Map is new Minimal_Perfect_Hash (["staleRequestSupport", - "regularExpressions", - "markdown", - "positionEncodings"]); + "regularExpressions", + "markdown", + "positionEncodings"]); package staleRequestSupport_OfGeneralClientCapabilities_Scope is package staleRequestSupport_OfGeneralClientCapabilities_Map is new Minimal_Perfect_Hash (["cancel", - "retryOnContentModified"]); + "retryOnContentModified"]); end staleRequestSupport_OfGeneralClientCapabilities_Scope; @@ -6989,8 +6987,8 @@ package body LSP.Inputs is package SignatureHelp_Scope is package SignatureHelp_Map is new Minimal_Perfect_Hash (["signatures", - "activeSignature", - "activeParameter"]); + "activeSignature", + "activeParameter"]); end SignatureHelp_Scope; @@ -7119,7 +7117,7 @@ package body LSP.Inputs is package DidOpenNotebookDocumentParams_Scope is package DidOpenNotebookDocumentParams_Map is new Minimal_Perfect_Hash (["notebookDocument", - "cellTextDocuments"]); + "cellTextDocuments"]); end DidOpenNotebookDocumentParams_Scope; @@ -7211,8 +7209,8 @@ package body LSP.Inputs is package ResourceOperationKind_Map is new Minimal_Perfect_Hash (["create", - "rename", - "delete"]); + "rename", + "delete"]); procedure Read_ResourceOperationKind (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; @@ -7275,15 +7273,15 @@ package body LSP.Inputs is package PrepareRenameResult_Scope is package PrepareRenameResult_Map is new Minimal_Perfect_Hash (["start", - "end", - "range", - "placeholder", - "defaultBehavior"]); + "end", + "range", + "placeholder", + "defaultBehavior"]); package PrepareRenameResult_2_Scope is package PrepareRenameResult_2_Map is new Minimal_Perfect_Hash (["range", - "placeholder"]); + "placeholder"]); end PrepareRenameResult_2_Scope; @@ -7385,27 +7383,27 @@ package body LSP.Inputs is case Index is when 1 => -- start Value := - (Kind => LSP.Structures.Varian_1, + (Kind => LSP.Structures.Variant_1, others => <>); exit; when 2 => -- end Value := - (Kind => LSP.Structures.Varian_1, + (Kind => LSP.Structures.Variant_1, others => <>); exit; when 3 => -- range Value := - (Kind => LSP.Structures.Varian_2, + (Kind => LSP.Structures.Variant_2, others => <>); exit; when 4 => -- placeholder Value := - (Kind => LSP.Structures.Varian_2, + (Kind => LSP.Structures.Variant_2, others => <>); exit; when 5 => -- defaultBehavior Value := - (Kind => LSP.Structures.Varian_3, + (Kind => LSP.Structures.Variant_3, others => <>); exit; when others => @@ -7421,12 +7419,12 @@ package body LSP.Inputs is Handler.Unmark; case Value.Kind is - when LSP.Structures.Varian_1 => - Read_A_Range (Handler, Value.Varian_1); - when LSP.Structures.Varian_2 => - Read_PrepareRenameResult_2 (Handler, Value.Varian_2); - when LSP.Structures.Varian_3 => - Read_PrepareRenameResult_3 (Handler, Value.Varian_3); + when LSP.Structures.Variant_1 => + Read_A_Range (Handler, Value.Variant_1); + when LSP.Structures.Variant_2 => + Read_PrepareRenameResult_2 (Handler, Value.Variant_2); + when LSP.Structures.Variant_3 => + Read_PrepareRenameResult_3 (Handler, Value.Variant_3); end case; end; end Read_PrepareRenameResult; @@ -7434,8 +7432,8 @@ package body LSP.Inputs is package DocumentLinkParams_Scope is package DocumentLinkParams_Map is new Minimal_Perfect_Hash (["workDoneToken", - "partialResultToken", - "textDocument"]); + "partialResultToken", + "textDocument"]); end DocumentLinkParams_Scope; @@ -7478,7 +7476,7 @@ package body LSP.Inputs is package DocumentLinkClientCapabilities_Scope is package DocumentLinkClientCapabilities_Map is new Minimal_Perfect_Hash (["dynamicRegistration", - "tooltipSupport"]); + "tooltipSupport"]); end DocumentLinkClientCapabilities_Scope; @@ -7542,8 +7540,8 @@ package body LSP.Inputs is package CodeActionContext_Scope is package CodeActionContext_Map is new Minimal_Perfect_Hash (["diagnostics", - "only", - "triggerKind"]); + "only", + "triggerKind"]); end CodeActionContext_Scope; @@ -7640,7 +7638,7 @@ package body LSP.Inputs is package DidChangeTextDocumentParams_Scope is package DidChangeTextDocumentParams_Map is new Minimal_Perfect_Hash (["textDocument", - "contentChanges"]); + "contentChanges"]); end DidChangeTextDocumentParams_Scope; @@ -7677,9 +7675,9 @@ package body LSP.Inputs is package InlayHintRegistrationOptions_Scope is package InlayHintRegistrationOptions_Map is new Minimal_Perfect_Hash (["workDoneProgress", - "resolveProvider", - "documentSelector", - "id"]); + "resolveProvider", + "documentSelector", + "id"]); end InlayHintRegistrationOptions_Scope; @@ -7747,11 +7745,11 @@ package body LSP.Inputs is package Declaration_Progress_Report_Scope is package Declaration_Progress_Report_Map is new Minimal_Perfect_Hash (["uri", - "range", - "originSelectionRange", - "targetUri", - "targetRange", - "targetSelectionRange"]); + "range", + "originSelectionRange", + "targetUri", + "targetRange", + "targetSelectionRange"]); end Declaration_Progress_Report_Scope; @@ -7785,32 +7783,32 @@ package body LSP.Inputs is case Index is when 1 => -- uri Value := - (Kind => LSP.Structures.Varian_1, + (Kind => LSP.Structures.Variant_1, others => <>); exit; when 2 => -- range Value := - (Kind => LSP.Structures.Varian_1, + (Kind => LSP.Structures.Variant_1, others => <>); exit; when 3 => -- originSelectionRange Value := - (Kind => LSP.Structures.Varian_2, + (Kind => LSP.Structures.Variant_2, others => <>); exit; when 4 => -- targetUri Value := - (Kind => LSP.Structures.Varian_2, + (Kind => LSP.Structures.Variant_2, others => <>); exit; when 5 => -- targetRange Value := - (Kind => LSP.Structures.Varian_2, + (Kind => LSP.Structures.Variant_2, others => <>); exit; when 6 => -- targetSelectionRange Value := - (Kind => LSP.Structures.Varian_2, + (Kind => LSP.Structures.Variant_2, others => <>); exit; when others => @@ -7826,10 +7824,10 @@ package body LSP.Inputs is Handler.Unmark; case Value.Kind is - when LSP.Structures.Varian_1 => - Read_Location_Vector (Handler, Value.Varian_1); - when LSP.Structures.Varian_2 => - Read_DeclarationLink_Vector (Handler, Value.Varian_2); + when LSP.Structures.Variant_1 => + Read_Location_Vector (Handler, Value.Variant_1); + when LSP.Structures.Variant_2 => + Read_DeclarationLink_Vector (Handler, Value.Variant_2); end case; end; end Read_Declaration_Progress_Report; @@ -7922,7 +7920,7 @@ package body LSP.Inputs is package TextDocumentPositionParams_Scope is package TextDocumentPositionParams_Map is new Minimal_Perfect_Hash (["textDocument", - "position"]); + "position"]); end TextDocumentPositionParams_Scope; @@ -7957,7 +7955,7 @@ package body LSP.Inputs is package DidSaveTextDocumentParams_Scope is package DidSaveTextDocumentParams_Map is new Minimal_Perfect_Hash (["textDocument", - "text"]); + "text"]); end DidSaveTextDocumentParams_Scope; @@ -7994,8 +7992,8 @@ package body LSP.Inputs is package CodeLensRegistrationOptions_Scope is package CodeLensRegistrationOptions_Map is new Minimal_Perfect_Hash (["documentSelector", - "workDoneProgress", - "resolveProvider"]); + "workDoneProgress", + "resolveProvider"]); end CodeLensRegistrationOptions_Scope; @@ -8059,7 +8057,7 @@ package body LSP.Inputs is package SelectionRange_Scope is package SelectionRange_Map is new Minimal_Perfect_Hash (["range", - "parent"]); + "parent"]); end SelectionRange_Scope; @@ -8099,7 +8097,7 @@ package body LSP.Inputs is package NotebookCellTextDocumentFilter_Scope is package NotebookCellTextDocumentFilter_Map is new Minimal_Perfect_Hash (["notebook", - "language"]); + "language"]); end NotebookCellTextDocumentFilter_Scope; @@ -8173,7 +8171,7 @@ package body LSP.Inputs is package ShowMessageParams_Scope is package ShowMessageParams_Map is new Minimal_Perfect_Hash (["type", - "message"]); + "message"]); end ShowMessageParams_Scope; @@ -8210,7 +8208,7 @@ package body LSP.Inputs is package FileSystemWatcher_Scope is package FileSystemWatcher_Map is new Minimal_Perfect_Hash (["globPattern", - "kind"]); + "kind"]); end FileSystemWatcher_Scope; @@ -8269,7 +8267,7 @@ package body LSP.Inputs is package NotebookDocumentSyncOptions_Scope is package NotebookDocumentSyncOptions_Map is new Minimal_Perfect_Hash (["notebookSelector", - "save"]); + "save"]); package cells_OfnotebookSelector_OfNotebookDocumentSyncOptions_Item_Item_Scope is @@ -8281,7 +8279,7 @@ package body LSP.Inputs is package notebookSelector_OfNotebookDocumentSyncOptions_Item_Scope is package notebookSelector_OfNotebookDocumentSyncOptions_Item_Map is new Minimal_Perfect_Hash (["notebook", - "cells"]); + "cells"]); end notebookSelector_OfNotebookDocumentSyncOptions_Item_Scope; @@ -8465,9 +8463,9 @@ package body LSP.Inputs is package CodeActionRegistrationOptions_Scope is package CodeActionRegistrationOptions_Map is new Minimal_Perfect_Hash (["documentSelector", - "workDoneProgress", - "codeActionKinds", - "resolveProvider"]); + "workDoneProgress", + "codeActionKinds", + "resolveProvider"]); end CodeActionRegistrationOptions_Scope; @@ -8533,8 +8531,8 @@ package body LSP.Inputs is package NotebookDocumentSyncRegistrationOptions_Scope is package NotebookDocumentSyncRegistrationOptions_Map is new Minimal_Perfect_Hash (["notebookSelector", - "save", - "id"]); + "save", + "id"]); package cells_OfnotebookSelector_OfNotebookDocumentSyncOptions_Item_Item_Scope is @@ -8546,7 +8544,7 @@ package body LSP.Inputs is package notebookSelector_OfNotebookDocumentSyncOptions_Item_Scope is package notebookSelector_OfNotebookDocumentSyncOptions_Item_Map is new Minimal_Perfect_Hash (["notebook", - "cells"]); + "cells"]); end notebookSelector_OfNotebookDocumentSyncOptions_Item_Scope; @@ -8734,9 +8732,9 @@ package body LSP.Inputs is package WorkspaceUnchangedDocumentDiagnosticReport_Scope is package WorkspaceUnchangedDocumentDiagnosticReport_Map is new Minimal_Perfect_Hash (["kind", - "resultId", - "uri", - "version"]); + "resultId", + "uri", + "version"]); end WorkspaceUnchangedDocumentDiagnosticReport_Scope; @@ -8779,10 +8777,10 @@ package body LSP.Inputs is package ReferenceParams_Scope is package ReferenceParams_Map is new Minimal_Perfect_Hash (["textDocument", - "position", - "workDoneToken", - "partialResultToken", - "context"]); + "position", + "workDoneToken", + "partialResultToken", + "context"]); end ReferenceParams_Scope; @@ -8829,7 +8827,7 @@ package body LSP.Inputs is package HoverClientCapabilities_Scope is package HoverClientCapabilities_Map is new Minimal_Perfect_Hash (["dynamicRegistration", - "contentFormat"]); + "contentFormat"]); end HoverClientCapabilities_Scope; @@ -8868,9 +8866,9 @@ package body LSP.Inputs is package RenameClientCapabilities_Scope is package RenameClientCapabilities_Map is new Minimal_Perfect_Hash (["dynamicRegistration", - "prepareSupport", - "prepareSupportDefaultBehavior", - "honorsChangeAnnotations"]); + "prepareSupport", + "prepareSupportDefaultBehavior", + "honorsChangeAnnotations"]); end RenameClientCapabilities_Scope; @@ -9061,9 +9059,9 @@ package body LSP.Inputs is package FailureHandlingKind_Map is new Minimal_Perfect_Hash (["abort", - "transactional", - "textOnlyTransactional", - "undo"]); + "transactional", + "textOnlyTransactional", + "undo"]); procedure Read_FailureHandlingKind (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; @@ -9078,11 +9076,11 @@ package body LSP.Inputs is package FileOperationOptions_Scope is package FileOperationOptions_Map is new Minimal_Perfect_Hash (["didCreate", - "willCreate", - "didRename", - "willRename", - "didDelete", - "willDelete"]); + "willCreate", + "didRename", + "willRename", + "didDelete", + "willDelete"]); end FileOperationOptions_Scope; @@ -9181,9 +9179,9 @@ package body LSP.Inputs is package TypeDefinitionParams_Scope is package TypeDefinitionParams_Map is new Minimal_Perfect_Hash (["textDocument", - "position", - "workDoneToken", - "partialResultToken"]); + "position", + "workDoneToken", + "partialResultToken"]); end TypeDefinitionParams_Scope; @@ -9277,24 +9275,24 @@ package body LSP.Inputs is package CompletionClientCapabilities_Scope is package CompletionClientCapabilities_Map is new Minimal_Perfect_Hash (["dynamicRegistration", - "completionItem", - "completionItemKind", - "insertTextMode", - "contextSupport", - "completionList"]); + "completionItem", + "completionItemKind", + "insertTextMode", + "contextSupport", + "completionList"]); package completionItem_OfCompletionClientCapabilities_Scope is package completionItem_OfCompletionClientCapabilities_Map is new Minimal_Perfect_Hash (["snippetSupport", - "commitCharactersSupport", - "documentationFormat", - "deprecatedSupport", - "preselectSupport", - "tagSupport", - "insertReplaceSupport", - "resolveSupport", - "insertTextModeSupport", - "labelDetailsSupport"]); + "commitCharactersSupport", + "documentationFormat", + "deprecatedSupport", + "preselectSupport", + "tagSupport", + "insertReplaceSupport", + "resolveSupport", + "insertTextModeSupport", + "labelDetailsSupport"]); end completionItem_OfCompletionClientCapabilities_Scope; @@ -9695,7 +9693,7 @@ package body LSP.Inputs is package RenameOptions_Scope is package RenameOptions_Map is new Minimal_Perfect_Hash (["workDoneProgress", - "prepareProvider"]); + "prepareProvider"]); end RenameOptions_Scope; @@ -9796,7 +9794,7 @@ package body LSP.Inputs is package DocumentHighlightRegistrationOptions_Scope is package DocumentHighlightRegistrationOptions_Map is new Minimal_Perfect_Hash (["documentSelector", - "workDoneProgress"]); + "workDoneProgress"]); end DocumentHighlightRegistrationOptions_Scope; @@ -9879,8 +9877,8 @@ package body LSP.Inputs is package FullDocumentDiagnosticReport_Scope is package FullDocumentDiagnosticReport_Map is new Minimal_Perfect_Hash (["kind", - "resultId", - "items"]); + "resultId", + "items"]); end FullDocumentDiagnosticReport_Scope; @@ -9919,9 +9917,9 @@ package body LSP.Inputs is package RenameParams_Scope is package RenameParams_Map is new Minimal_Perfect_Hash (["workDoneToken", - "textDocument", - "position", - "newName"]); + "textDocument", + "position", + "newName"]); end RenameParams_Scope; @@ -9965,8 +9963,8 @@ package body LSP.Inputs is package DocumentSymbolRegistrationOptions_Scope is package DocumentSymbolRegistrationOptions_Map is new Minimal_Perfect_Hash (["documentSelector", - "workDoneProgress", - "label"]); + "workDoneProgress", + "label"]); end DocumentSymbolRegistrationOptions_Scope; @@ -10042,8 +10040,8 @@ package body LSP.Inputs is package DeclarationRegistrationOptions_Scope is package DeclarationRegistrationOptions_Map is new Minimal_Perfect_Hash (["workDoneProgress", - "documentSelector", - "id"]); + "documentSelector", + "id"]); end DeclarationRegistrationOptions_Scope; @@ -10105,16 +10103,16 @@ package body LSP.Inputs is package WorkspaceSymbol_Scope is package WorkspaceSymbol_Map is new Minimal_Perfect_Hash (["name", - "kind", - "tags", - "containerName", - "location", - "data"]); + "kind", + "tags", + "containerName", + "location", + "data"]); package Location_Or_Something_Scope is package Location_Or_Something_Map is new Minimal_Perfect_Hash (["range", - "uri"]); + "uri"]); end Location_Or_Something_Scope; @@ -10242,7 +10240,7 @@ package body LSP.Inputs is package DeleteFileOptions_Scope is package DeleteFileOptions_Map is new Minimal_Perfect_Hash (["recursive", - "ignoreIfNotExists"]); + "ignoreIfNotExists"]); end DeleteFileOptions_Scope; @@ -10295,8 +10293,8 @@ package body LSP.Inputs is package TypeHierarchyRegistrationOptions_Scope is package TypeHierarchyRegistrationOptions_Map is new Minimal_Perfect_Hash (["documentSelector", - "workDoneProgress", - "id"]); + "workDoneProgress", + "id"]); end TypeHierarchyRegistrationOptions_Scope; @@ -10375,8 +10373,8 @@ package body LSP.Inputs is package PrepareRenameParams_Scope is package PrepareRenameParams_Map is new Minimal_Perfect_Hash (["textDocument", - "position", - "workDoneToken"]); + "position", + "workDoneToken"]); end PrepareRenameParams_Scope; @@ -10426,12 +10424,12 @@ package body LSP.Inputs is package CodeActionClientCapabilities_Scope is package CodeActionClientCapabilities_Map is new Minimal_Perfect_Hash (["dynamicRegistration", - "codeActionLiteralSupport", - "isPreferredSupport", - "disabledSupport", - "dataSupport", - "resolveSupport", - "honorsChangeAnnotations"]); + "codeActionLiteralSupport", + "isPreferredSupport", + "disabledSupport", + "dataSupport", + "resolveSupport", + "honorsChangeAnnotations"]); package codeActionKind_OfcodeActionLiteralSupport_OfCodeActionClientCapabilities_Scope is @@ -10586,8 +10584,8 @@ package body LSP.Inputs is package MarkdownClientCapabilities_Scope is package MarkdownClientCapabilities_Map is new Minimal_Perfect_Hash (["parser", - "version", - "allowedTags"]); + "version", + "allowedTags"]); end MarkdownClientCapabilities_Scope; @@ -10680,9 +10678,9 @@ package body LSP.Inputs is package DefinitionParams_Scope is package DefinitionParams_Map is new Minimal_Perfect_Hash (["textDocument", - "position", - "workDoneToken", - "partialResultToken"]); + "position", + "workDoneToken", + "partialResultToken"]); end DefinitionParams_Scope; @@ -10727,7 +10725,7 @@ package body LSP.Inputs is package ImplementationClientCapabilities_Scope is package ImplementationClientCapabilities_Map is new Minimal_Perfect_Hash (["dynamicRegistration", - "linkSupport"]); + "linkSupport"]); end ImplementationClientCapabilities_Scope; @@ -10770,9 +10768,9 @@ package body LSP.Inputs is package TextDocumentItem_Scope is package TextDocumentItem_Map is new Minimal_Perfect_Hash (["uri", - "languageId", - "version", - "text"]); + "languageId", + "version", + "text"]); end TextDocumentItem_Scope; @@ -10818,10 +10816,10 @@ package body LSP.Inputs is package ColorPresentationParams_Scope is package ColorPresentationParams_Map is new Minimal_Perfect_Hash (["workDoneToken", - "partialResultToken", - "textDocument", - "color", - "range"]); + "partialResultToken", + "textDocument", + "color", + "range"]); end ColorPresentationParams_Scope; @@ -10889,7 +10887,7 @@ package body LSP.Inputs is is package relatedDocuments_OfDocumentDiagnosticReportPartialResult_Item_Map is new Minimal_Perfect_Hash (["full", - "unchanged"]); + "unchanged"]); end relatedDocuments_OfDocumentDiagnosticReportPartialResult_Item_Scope; @@ -11027,9 +11025,9 @@ package body LSP.Inputs is package DeleteFile_Scope is package DeleteFile_Map is new Minimal_Perfect_Hash (["kind", - "annotationId", - "uri", - "options"]); + "annotationId", + "uri", + "options"]); end DeleteFile_Scope; @@ -11111,10 +11109,10 @@ package body LSP.Inputs is package NotebookDocument_Scope is package NotebookDocument_Map is new Minimal_Perfect_Hash (["uri", - "notebookType", - "version", - "metadata", - "cells"]); + "notebookType", + "version", + "metadata", + "cells"]); end NotebookDocument_Scope; @@ -11162,9 +11160,9 @@ package body LSP.Inputs is package RelatedFullDocumentDiagnosticReport_Scope is package RelatedFullDocumentDiagnosticReport_Map is new Minimal_Perfect_Hash (["kind", - "resultId", - "items", - "relatedDocuments"]); + "resultId", + "items", + "relatedDocuments"]); end RelatedFullDocumentDiagnosticReport_Scope; @@ -11264,7 +11262,7 @@ package body LSP.Inputs is package DocumentSymbolOptions_Scope is package DocumentSymbolOptions_Map is new Minimal_Perfect_Hash (["workDoneProgress", - "label"]); + "label"]); end DocumentSymbolOptions_Scope; @@ -11305,11 +11303,11 @@ package body LSP.Inputs is package CompletionRegistrationOptions_Scope is package CompletionRegistrationOptions_Map is new Minimal_Perfect_Hash (["documentSelector", - "workDoneProgress", - "triggerCharacters", - "allCommitCharacters", - "resolveProvider", - "completionItem"]); + "workDoneProgress", + "triggerCharacters", + "allCommitCharacters", + "resolveProvider", + "completionItem"]); package completionItem_OfCompletionOptions_Scope is package completionItem_OfCompletionOptions_Map is new Minimal_Perfect_Hash @@ -11424,7 +11422,7 @@ package body LSP.Inputs is package InlayHintClientCapabilities_Scope is package InlayHintClientCapabilities_Map is new Minimal_Perfect_Hash (["dynamicRegistration", - "resolveSupport"]); + "resolveSupport"]); end InlayHintClientCapabilities_Scope; @@ -11500,10 +11498,10 @@ package body LSP.Inputs is package WorkspaceEditClientCapabilities_Scope is package WorkspaceEditClientCapabilities_Map is new Minimal_Perfect_Hash (["documentChanges", - "resourceOperations", - "failureHandling", - "normalizesLineEndings", - "changeAnnotationSupport"]); + "resourceOperations", + "failureHandling", + "normalizesLineEndings", + "changeAnnotationSupport"]); package changeAnnotationSupport_OfWorkspaceEditClientCapabilities_Scope is @@ -11631,7 +11629,7 @@ package body LSP.Inputs is package WorkspaceSymbolOptions_Scope is package WorkspaceSymbolOptions_Map is new Minimal_Perfect_Hash (["workDoneProgress", - "resolveProvider"]); + "resolveProvider"]); end WorkspaceSymbolOptions_Scope; @@ -11688,8 +11686,8 @@ package body LSP.Inputs is package ChangeAnnotation_Scope is package ChangeAnnotation_Map is new Minimal_Perfect_Hash (["label", - "needsConfirmation", - "description"]); + "needsConfirmation", + "description"]); end ChangeAnnotation_Scope; @@ -11770,7 +11768,7 @@ package body LSP.Inputs is package VersionedTextDocumentIdentifier_Scope is package VersionedTextDocumentIdentifier_Map is new Minimal_Perfect_Hash (["uri", - "version"]); + "version"]); end VersionedTextDocumentIdentifier_Scope; @@ -11808,7 +11806,7 @@ package body LSP.Inputs is package SemanticTokensDelta_Scope is package SemanticTokensDelta_Map is new Minimal_Perfect_Hash (["resultId", - "edits"]); + "edits"]); end SemanticTokensDelta_Scope; @@ -11878,7 +11876,7 @@ package body LSP.Inputs is package ApplyWorkspaceEditParams_Scope is package ApplyWorkspaceEditParams_Map is new Minimal_Perfect_Hash (["label", - "edit"]); + "edit"]); end ApplyWorkspaceEditParams_Scope; @@ -11915,9 +11913,9 @@ package body LSP.Inputs is package InlayHintLabelPart_Scope is package InlayHintLabelPart_Map is new Minimal_Perfect_Hash (["value", - "tooltip", - "location", - "command"]); + "tooltip", + "location", + "command"]); end InlayHintLabelPart_Scope; @@ -12004,9 +12002,9 @@ package body LSP.Inputs is package LocationLink_Scope is package LocationLink_Map is new Minimal_Perfect_Hash (["originSelectionRange", - "targetUri", - "targetRange", - "targetSelectionRange"]); + "targetUri", + "targetRange", + "targetSelectionRange"]); end LocationLink_Scope; @@ -12049,25 +12047,25 @@ package body LSP.Inputs is package CompletionList_Scope is package CompletionList_Map is new Minimal_Perfect_Hash (["isIncomplete", - "itemDefaults", - "items"]); + "itemDefaults", + "items"]); package itemDefaults_OfCompletionList_Scope is package itemDefaults_OfCompletionList_Map is new Minimal_Perfect_Hash (["commitCharacters", - "editRange", - "insertTextFormat", - "insertTextMode", - "data"]); + "editRange", + "insertTextFormat", + "insertTextMode", + "data"]); end itemDefaults_OfCompletionList_Scope; package Range_Or_Something_Scope is package Range_Or_Something_Map is new Minimal_Perfect_Hash (["start", - "end", - "insert", - "replace"]); + "end", + "insert", + "replace"]); end Range_Or_Something_Scope; @@ -12250,11 +12248,11 @@ package body LSP.Inputs is package DiagnosticRegistrationOptions_Scope is package DiagnosticRegistrationOptions_Map is new Minimal_Perfect_Hash (["documentSelector", - "workDoneProgress", - "identifier", - "interFileDependencies", - "workspaceDiagnostics", - "id"]); + "workDoneProgress", + "identifier", + "interFileDependencies", + "workspaceDiagnostics", + "id"]); end DiagnosticRegistrationOptions_Scope; @@ -12336,13 +12334,13 @@ package body LSP.Inputs is package CodeAction_Scope is package CodeAction_Map is new Minimal_Perfect_Hash (["title", - "kind", - "diagnostics", - "isPreferred", - "disabled", - "edit", - "command", - "data"]); + "kind", + "diagnostics", + "isPreferred", + "disabled", + "edit", + "command", + "data"]); package disabled_OfCodeAction_Scope is package disabled_OfCodeAction_Map is new Minimal_Perfect_Hash @@ -12456,9 +12454,9 @@ package body LSP.Inputs is package DeclarationParams_Scope is package DeclarationParams_Map is new Minimal_Perfect_Hash (["textDocument", - "position", - "workDoneToken", - "partialResultToken"]); + "position", + "workDoneToken", + "partialResultToken"]); end DeclarationParams_Scope; @@ -12503,9 +12501,9 @@ package body LSP.Inputs is package DocumentRangeFormattingParams_Scope is package DocumentRangeFormattingParams_Map is new Minimal_Perfect_Hash (["workDoneToken", - "textDocument", - "range", - "options"]); + "textDocument", + "range", + "options"]); end DocumentRangeFormattingParams_Scope; @@ -12583,7 +12581,7 @@ package body LSP.Inputs is package DocumentOnTypeFormattingOptions_Scope is package DocumentOnTypeFormattingOptions_Map is new Minimal_Perfect_Hash (["firstTriggerCharacter", - "moreTriggerCharacter"]); + "moreTriggerCharacter"]); end DocumentOnTypeFormattingOptions_Scope; @@ -12621,7 +12619,7 @@ package body LSP.Inputs is package WorkspaceSymbolRegistrationOptions_Scope is package WorkspaceSymbolRegistrationOptions_Map is new Minimal_Perfect_Hash (["workDoneProgress", - "resolveProvider"]); + "resolveProvider"]); end WorkspaceSymbolRegistrationOptions_Scope; @@ -12664,9 +12662,9 @@ package body LSP.Inputs is package MonikerParams_Scope is package MonikerParams_Map is new Minimal_Perfect_Hash (["textDocument", - "position", - "workDoneToken", - "partialResultToken"]); + "position", + "workDoneToken", + "partialResultToken"]); end MonikerParams_Scope; @@ -12711,13 +12709,13 @@ package body LSP.Inputs is package InlayHint_Scope is package InlayHint_Map is new Minimal_Perfect_Hash (["position", - "label", - "kind", - "textEdits", - "tooltip", - "paddingLeft", - "paddingRight", - "data"]); + "label", + "kind", + "textEdits", + "tooltip", + "paddingLeft", + "paddingRight", + "data"]); end InlayHint_Scope; @@ -12869,7 +12867,7 @@ package body LSP.Inputs is package DocumentFormattingRegistrationOptions_Scope is package DocumentFormattingRegistrationOptions_Map is new Minimal_Perfect_Hash (["documentSelector", - "workDoneProgress"]); + "workDoneProgress"]); end DocumentFormattingRegistrationOptions_Scope; @@ -12927,8 +12925,8 @@ package body LSP.Inputs is package ColorPresentation_Scope is package ColorPresentation_Map is new Minimal_Perfect_Hash (["label", - "textEdit", - "additionalTextEdits"]); + "textEdit", + "additionalTextEdits"]); end ColorPresentation_Scope; @@ -13027,9 +13025,9 @@ package body LSP.Inputs is package SelectionRangeParams_Scope is package SelectionRangeParams_Map is new Minimal_Perfect_Hash (["workDoneToken", - "partialResultToken", - "textDocument", - "positions"]); + "partialResultToken", + "textDocument", + "positions"]); end SelectionRangeParams_Scope; @@ -13099,7 +13097,7 @@ package body LSP.Inputs is package Tokens_Delta_Result_Scope is package Tokens_Delta_Result_Map is new Minimal_Perfect_Hash (["data", - "edits"]); + "edits"]); end Tokens_Delta_Result_Scope; @@ -13119,7 +13117,7 @@ package body LSP.Inputs is Handler.Mark; if Handler.Is_Null_Value then Value := - (Kind => LSP.Structures.Varian_3, + (Kind => LSP.Structures.Variant_3, others => <>); elsif Handler.Is_Start_Object then Handler.Read_Next; @@ -13134,12 +13132,12 @@ package body LSP.Inputs is case Index is when 1 => -- data Value := - (Kind => LSP.Structures.Varian_1, + (Kind => LSP.Structures.Variant_1, others => <>); exit; when 2 => -- edits Value := - (Kind => LSP.Structures.Varian_2, + (Kind => LSP.Structures.Variant_2, others => <>); exit; when others => @@ -13155,11 +13153,11 @@ package body LSP.Inputs is Handler.Unmark; case Value.Kind is - when LSP.Structures.Varian_1 => - Read_SemanticTokens (Handler, Value.Varian_1); - when LSP.Structures.Varian_2 => - Read_SemanticTokensDelta (Handler, Value.Varian_2); - when LSP.Structures.Varian_3 => + when LSP.Structures.Variant_1 => + Read_SemanticTokens (Handler, Value.Variant_1); + when LSP.Structures.Variant_2 => + Read_SemanticTokensDelta (Handler, Value.Variant_2); + when LSP.Structures.Variant_3 => null; -- #null_value Handler.Read_Next; end case; @@ -13225,13 +13223,13 @@ package body LSP.Inputs is package TypeHierarchyItem_Scope is package TypeHierarchyItem_Map is new Minimal_Perfect_Hash (["name", - "kind", - "tags", - "detail", - "uri", - "range", - "selectionRange", - "data"]); + "kind", + "tags", + "detail", + "uri", + "range", + "selectionRange", + "data"]); end TypeHierarchyItem_Scope; @@ -13290,7 +13288,7 @@ package body LSP.Inputs is package Location_Scope is package Location_Map is new Minimal_Perfect_Hash (["uri", - "range"]); + "range"]); end Location_Scope; @@ -13326,8 +13324,8 @@ package body LSP.Inputs is package RenameRegistrationOptions_Scope is package RenameRegistrationOptions_Map is new Minimal_Perfect_Hash (["documentSelector", - "workDoneProgress", - "prepareProvider"]); + "workDoneProgress", + "prepareProvider"]); end RenameRegistrationOptions_Scope; @@ -13391,7 +13389,7 @@ package body LSP.Inputs is package ParameterInformation_Scope is package ParameterInformation_Map is new Minimal_Perfect_Hash (["label", - "documentation"]); + "documentation"]); end ParameterInformation_Scope; @@ -13475,8 +13473,8 @@ package body LSP.Inputs is package PositionEncodingKind_Map is new Minimal_Perfect_Hash (["utf-8", - "utf-16", - "utf-32"]); + "utf-16", + "utf-32"]); procedure Read_PositionEncodingKind (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; @@ -13491,7 +13489,7 @@ package body LSP.Inputs is package Symbol_Progress_Report_Scope is package Symbol_Progress_Report_Map is new Minimal_Perfect_Hash (["deprecated", - "data"]); + "data"]); end Symbol_Progress_Report_Scope; @@ -13525,12 +13523,12 @@ package body LSP.Inputs is case Index is when 1 => -- deprecated Value := - (Kind => LSP.Structures.Varian_1, + (Kind => LSP.Structures.Variant_1, others => <>); exit; when 2 => -- data Value := - (Kind => LSP.Structures.Varian_2, + (Kind => LSP.Structures.Variant_2, others => <>); exit; when others => @@ -13546,10 +13544,10 @@ package body LSP.Inputs is Handler.Unmark; case Value.Kind is - when LSP.Structures.Varian_1 => - Read_SymbolInformation_Vector (Handler, Value.Varian_1); - when LSP.Structures.Varian_2 => - Read_WorkspaceSymbol_Vector (Handler, Value.Varian_2); + when LSP.Structures.Variant_1 => + Read_SymbolInformation_Vector (Handler, Value.Variant_1); + when LSP.Structures.Variant_2 => + Read_WorkspaceSymbol_Vector (Handler, Value.Variant_2); end case; end; end Read_Symbol_Progress_Report; @@ -13567,21 +13565,21 @@ package body LSP.Inputs is package An_InitializeParams_Scope is package An_InitializeParams_Map is new Minimal_Perfect_Hash (["workDoneToken", - "processId", - "clientInfo", - "locale", - "rootPath", - "rootUri", - "capabilities", - "initializationOptions", - "trace"]); + "processId", + "clientInfo", + "locale", + "rootPath", + "rootUri", + "capabilities", + "initializationOptions", + "trace"]); package trace_Of_InitializeParams_Scope is package trace_Of_InitializeParams_Map is new Minimal_Perfect_Hash (["off", - "messages", - "compact", - "verbose"]); + "messages", + "compact", + "verbose"]); end trace_Of_InitializeParams_Scope; @@ -13702,8 +13700,8 @@ package body LSP.Inputs is package TypeHierarchySubtypesParams_Scope is package TypeHierarchySubtypesParams_Map is new Minimal_Perfect_Hash (["workDoneToken", - "partialResultToken", - "item"]); + "partialResultToken", + "item"]); end TypeHierarchySubtypesParams_Scope; @@ -13746,7 +13744,7 @@ package body LSP.Inputs is package FileOperationFilter_Scope is package FileOperationFilter_Map is new Minimal_Perfect_Hash (["scheme", - "pattern"]); + "pattern"]); end FileOperationFilter_Scope; @@ -13783,8 +13781,8 @@ package body LSP.Inputs is package ApplyWorkspaceEditResult_Scope is package ApplyWorkspaceEditResult_Map is new Minimal_Perfect_Hash (["applied", - "failureReason", - "failedChange"]); + "failureReason", + "failedChange"]); end ApplyWorkspaceEditResult_Scope; @@ -13861,8 +13859,8 @@ package body LSP.Inputs is package Completion_Result_Scope is package Completion_Result_Map is new Minimal_Perfect_Hash (["isIncomplete", - "itemDefaults", - "items"]); + "itemDefaults", + "items"]); end Completion_Result_Scope; @@ -13882,12 +13880,12 @@ package body LSP.Inputs is Handler.Mark; if Handler.Is_Null_Value then Value := - (Kind => LSP.Structures.Varian_3, + (Kind => LSP.Structures.Variant_3, others => <>); elsif Handler.Is_Start_Object then Handler.Read_Next; Value := - (Kind => LSP.Structures.Varian_1, + (Kind => LSP.Structures.Variant_1, others => <>); while Handler.Is_Key_Name loop declare @@ -13900,17 +13898,17 @@ package body LSP.Inputs is case Index is when 1 => -- isIncomplete Value := - (Kind => LSP.Structures.Varian_2, + (Kind => LSP.Structures.Variant_2, others => <>); exit; when 2 => -- itemDefaults Value := - (Kind => LSP.Structures.Varian_2, + (Kind => LSP.Structures.Variant_2, others => <>); exit; when 3 => -- items Value := - (Kind => LSP.Structures.Varian_2, + (Kind => LSP.Structures.Variant_2, others => <>); exit; when others => @@ -13926,11 +13924,11 @@ package body LSP.Inputs is Handler.Unmark; case Value.Kind is - when LSP.Structures.Varian_1 => - Read_CompletionItem_Vector (Handler, Value.Varian_1); - when LSP.Structures.Varian_2 => - Read_CompletionList (Handler, Value.Varian_2); - when LSP.Structures.Varian_3 => + when LSP.Structures.Variant_1 => + Read_CompletionItem_Vector (Handler, Value.Variant_1); + when LSP.Structures.Variant_2 => + Read_CompletionList (Handler, Value.Variant_2); + when LSP.Structures.Variant_3 => null; -- #null_value Handler.Read_Next; end case; @@ -13976,9 +13974,9 @@ package body LSP.Inputs is package InlineValue_Scope is package InlineValue_Map is new Minimal_Perfect_Hash (["text", - "variableName", - "caseSensitiveLookup", - "expression"]); + "variableName", + "caseSensitiveLookup", + "expression"]); end InlineValue_Scope; @@ -14008,22 +14006,22 @@ package body LSP.Inputs is case Index is when 1 => -- text Value := - (Kind => LSP.Structures.Varian_1, + (Kind => LSP.Structures.Variant_1, others => <>); exit; when 2 => -- variableName Value := - (Kind => LSP.Structures.Varian_2, + (Kind => LSP.Structures.Variant_2, others => <>); exit; when 3 => -- caseSensitiveLookup Value := - (Kind => LSP.Structures.Varian_2, + (Kind => LSP.Structures.Variant_2, others => <>); exit; when 4 => -- expression Value := - (Kind => LSP.Structures.Varian_3, + (Kind => LSP.Structures.Variant_3, others => <>); exit; when others => @@ -14039,12 +14037,13 @@ package body LSP.Inputs is Handler.Unmark; case Value.Kind is - when LSP.Structures.Varian_1 => - Read_InlineValueText (Handler, Value.Varian_1); - when LSP.Structures.Varian_2 => - Read_InlineValueVariableLookup (Handler, Value.Varian_2); - when LSP.Structures.Varian_3 => - Read_InlineValueEvaluatableExpression (Handler, Value.Varian_3); + when LSP.Structures.Variant_1 => + Read_InlineValueText (Handler, Value.Variant_1); + when LSP.Structures.Variant_2 => + Read_InlineValueVariableLookup (Handler, Value.Variant_2); + when LSP.Structures.Variant_3 => + Read_InlineValueEvaluatableExpression + (Handler, Value.Variant_3); end case; end; end Read_InlineValue; @@ -14076,8 +14075,8 @@ package body LSP.Inputs is package MonikerKind_Map is new Minimal_Perfect_Hash (["import", - "export", - "local"]); + "export", + "local"]); procedure Read_MonikerKind (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; @@ -14146,8 +14145,8 @@ package body LSP.Inputs is package CallHierarchyOutgoingCallsParams_Scope is package CallHierarchyOutgoingCallsParams_Map is new Minimal_Perfect_Hash (["workDoneToken", - "partialResultToken", - "item"]); + "partialResultToken", + "item"]); end CallHierarchyOutgoingCallsParams_Scope; @@ -14211,7 +14210,7 @@ package body LSP.Inputs is package HoverRegistrationOptions_Scope is package HoverRegistrationOptions_Map is new Minimal_Perfect_Hash (["documentSelector", - "workDoneProgress"]); + "workDoneProgress"]); end HoverRegistrationOptions_Scope; @@ -14279,9 +14278,9 @@ package body LSP.Inputs is package SemanticTokensDeltaParams_Scope is package SemanticTokensDeltaParams_Map is new Minimal_Perfect_Hash (["workDoneToken", - "partialResultToken", - "textDocument", - "previousResultId"]); + "partialResultToken", + "textDocument", + "previousResultId"]); end SemanticTokensDeltaParams_Scope; @@ -14360,7 +14359,7 @@ package body LSP.Inputs is package DefinitionRegistrationOptions_Scope is package DefinitionRegistrationOptions_Map is new Minimal_Perfect_Hash (["documentSelector", - "workDoneProgress"]); + "workDoneProgress"]); end DefinitionRegistrationOptions_Scope; @@ -14418,7 +14417,7 @@ package body LSP.Inputs is package clientInfo_Of_InitializeParams_Scope is package clientInfo_Of_InitializeParams_Map is new Minimal_Perfect_Hash (["name", - "version"]); + "version"]); end clientInfo_Of_InitializeParams_Scope; @@ -14456,8 +14455,8 @@ package body LSP.Inputs is package CodeLensParams_Scope is package CodeLensParams_Map is new Minimal_Perfect_Hash (["workDoneToken", - "partialResultToken", - "textDocument"]); + "partialResultToken", + "textDocument"]); end CodeLensParams_Scope; @@ -14522,7 +14521,7 @@ package body LSP.Inputs is package Symbol_Result_Scope is package Symbol_Result_Map is new Minimal_Perfect_Hash (["deprecated", - "data"]); + "data"]); end Symbol_Result_Scope; @@ -14545,7 +14544,7 @@ package body LSP.Inputs is end if; if Handler.Is_Null_Value then Value := - (Kind => LSP.Structures.Varian_3, + (Kind => LSP.Structures.Variant_3, others => <>); elsif Handler.Is_Start_Object then Handler.Read_Next; @@ -14560,12 +14559,12 @@ package body LSP.Inputs is case Index is when 1 => -- deprecated Value := - (Kind => LSP.Structures.Varian_1, + (Kind => LSP.Structures.Variant_1, others => <>); exit; when 2 => -- data Value := - (Kind => LSP.Structures.Varian_2, + (Kind => LSP.Structures.Variant_2, others => <>); exit; when others => @@ -14581,11 +14580,11 @@ package body LSP.Inputs is Handler.Unmark; case Value.Kind is - when LSP.Structures.Varian_1 => - Read_SymbolInformation_Vector (Handler, Value.Varian_1); - when LSP.Structures.Varian_2 => - Read_WorkspaceSymbol_Vector (Handler, Value.Varian_2); - when LSP.Structures.Varian_3 => + when LSP.Structures.Variant_1 => + Read_SymbolInformation_Vector (Handler, Value.Variant_1); + when LSP.Structures.Variant_2 => + Read_WorkspaceSymbol_Vector (Handler, Value.Variant_2); + when LSP.Structures.Variant_3 => null; -- #null_value Handler.Read_Next; end case; @@ -14595,7 +14594,7 @@ package body LSP.Inputs is package DiagnosticClientCapabilities_Scope is package DiagnosticClientCapabilities_Map is new Minimal_Perfect_Hash (["dynamicRegistration", - "relatedDocumentSupport"]); + "relatedDocumentSupport"]); end DiagnosticClientCapabilities_Scope; @@ -14638,7 +14637,7 @@ package body LSP.Inputs is package MonikerRegistrationOptions_Scope is package MonikerRegistrationOptions_Map is new Minimal_Perfect_Hash (["documentSelector", - "workDoneProgress"]); + "workDoneProgress"]); end MonikerRegistrationOptions_Scope; @@ -14696,7 +14695,7 @@ package body LSP.Inputs is package ExecutionSummary_Scope is package ExecutionSummary_Map is new Minimal_Perfect_Hash (["executionOrder", - "success"]); + "success"]); end ExecutionSummary_Scope; @@ -14737,8 +14736,8 @@ package body LSP.Inputs is package TypeHierarchySupertypesParams_Scope is package TypeHierarchySupertypesParams_Map is new Minimal_Perfect_Hash (["workDoneToken", - "partialResultToken", - "item"]); + "partialResultToken", + "item"]); end TypeHierarchySupertypesParams_Scope; @@ -14781,7 +14780,7 @@ package body LSP.Inputs is package PreviousResultId_Scope is package PreviousResultId_Map is new Minimal_Perfect_Hash (["uri", - "value"]); + "value"]); end PreviousResultId_Scope; @@ -14818,8 +14817,8 @@ package body LSP.Inputs is package FoldingRangeKind_Map is new Minimal_Perfect_Hash (["comment", - "imports", - "region"]); + "imports", + "region"]); procedure Read_FoldingRangeKind (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; @@ -14834,8 +14833,8 @@ package body LSP.Inputs is package PublishDiagnosticsParams_Scope is package PublishDiagnosticsParams_Map is new Minimal_Perfect_Hash (["uri", - "version", - "diagnostics"]); + "version", + "diagnostics"]); end PublishDiagnosticsParams_Scope; @@ -14971,7 +14970,7 @@ package body LSP.Inputs is package CallHierarchyIncomingCall_Scope is package CallHierarchyIncomingCall_Map is new Minimal_Perfect_Hash (["from", - "fromRanges"]); + "fromRanges"]); end CallHierarchyIncomingCall_Scope; @@ -15032,7 +15031,7 @@ package body LSP.Inputs is package TextDocumentChangeRegistrationOptions_Scope is package TextDocumentChangeRegistrationOptions_Map is new Minimal_Perfect_Hash (["documentSelector", - "syncKind"]); + "syncKind"]); end TextDocumentChangeRegistrationOptions_Scope; @@ -15174,28 +15173,28 @@ package body LSP.Inputs is package NotebookDocumentChangeEvent_Scope is package NotebookDocumentChangeEvent_Map is new Minimal_Perfect_Hash (["metadata", - "cells"]); + "cells"]); package textContent_Ofcells_OfNotebookDocumentChangeEvent_Item_Scope is package textContent_Ofcells_OfNotebookDocumentChangeEvent_Item_Map is new Minimal_Perfect_Hash (["document", - "changes"]); + "changes"]); end textContent_Ofcells_OfNotebookDocumentChangeEvent_Item_Scope; package cells_OfNotebookDocumentChangeEvent_Scope is package cells_OfNotebookDocumentChangeEvent_Map is new Minimal_Perfect_Hash (["structure", - "data", - "textContent"]); + "data", + "textContent"]); end cells_OfNotebookDocumentChangeEvent_Scope; package structure_Ofcells_OfNotebookDocumentChangeEvent_Scope is package structure_Ofcells_OfNotebookDocumentChangeEvent_Map is new Minimal_Perfect_Hash (["array", - "didOpen", - "didClose"]); + "didOpen", + "didClose"]); end structure_Ofcells_OfNotebookDocumentChangeEvent_Scope; @@ -15386,10 +15385,10 @@ package body LSP.Inputs is package FormattingOptions_Scope is package FormattingOptions_Map is new Minimal_Perfect_Hash (["tabSize", - "insertSpaces", - "trimTrailingWhitespace", - "insertFinalNewline", - "trimFinalNewlines"]); + "insertSpaces", + "trimTrailingWhitespace", + "insertFinalNewline", + "trimFinalNewlines"]); end FormattingOptions_Scope; @@ -15565,8 +15564,8 @@ package body LSP.Inputs is package TypeDefinitionRegistrationOptions_Scope is package TypeDefinitionRegistrationOptions_Map is new Minimal_Perfect_Hash (["documentSelector", - "workDoneProgress", - "id"]); + "workDoneProgress", + "id"]); end TypeDefinitionRegistrationOptions_Scope; @@ -15628,7 +15627,7 @@ package body LSP.Inputs is package CodeLensOptions_Scope is package CodeLensOptions_Map is new Minimal_Perfect_Hash (["workDoneProgress", - "resolveProvider"]); + "resolveProvider"]); end CodeLensOptions_Scope; @@ -15671,7 +15670,7 @@ package body LSP.Inputs is package FileRename_Scope is package FileRename_Map is new Minimal_Perfect_Hash (["oldUri", - "newUri"]); + "newUri"]); end FileRename_Scope; @@ -15711,7 +15710,7 @@ package body LSP.Inputs is is package SemanticTokensPartialResult_Or_SemanticTokensDeltaPartialResult_Map is new Minimal_Perfect_Hash (["data", - "edits"]); + "edits"]); end SemanticTokensPartialResult_Or_SemanticTokensDeltaPartialResult_Scope; @@ -15780,7 +15779,7 @@ package body LSP.Inputs is package DocumentDiagnosticReport_Scope is package DocumentDiagnosticReport_Map is new Minimal_Perfect_Hash (["full", - "unchanged"]); + "unchanged"]); end DocumentDiagnosticReport_Scope; @@ -15884,9 +15883,9 @@ package body LSP.Inputs is package Moniker_Scope is package Moniker_Map is new Minimal_Perfect_Hash (["scheme", - "identifier", - "unique", - "kind"]); + "identifier", + "unique", + "kind"]); end Moniker_Scope; @@ -15932,8 +15931,8 @@ package body LSP.Inputs is package ExecuteCommandParams_Scope is package ExecuteCommandParams_Map is new Minimal_Perfect_Hash (["workDoneToken", - "command", - "arguments"]); + "command", + "arguments"]); end ExecuteCommandParams_Scope; @@ -15975,10 +15974,10 @@ package body LSP.Inputs is package WorkDoneProgressBegin_Scope is package WorkDoneProgressBegin_Map is new Minimal_Perfect_Hash (["kind", - "title", - "cancellable", - "message", - "percentage"]); + "title", + "cancellable", + "message", + "percentage"]); end WorkDoneProgressBegin_Scope; @@ -16068,7 +16067,7 @@ package body LSP.Inputs is package DefinitionClientCapabilities_Scope is package DefinitionClientCapabilities_Map is new Minimal_Perfect_Hash (["dynamicRegistration", - "linkSupport"]); + "linkSupport"]); end DefinitionClientCapabilities_Scope; @@ -16111,9 +16110,9 @@ package body LSP.Inputs is package SignatureHelpRegistrationOptions_Scope is package SignatureHelpRegistrationOptions_Map is new Minimal_Perfect_Hash (["documentSelector", - "workDoneProgress", - "triggerCharacters", - "retriggerCharacters"]); + "workDoneProgress", + "triggerCharacters", + "retriggerCharacters"]); end SignatureHelpRegistrationOptions_Scope; @@ -16213,7 +16212,7 @@ package body LSP.Inputs is package MarkupContent_Scope is package MarkupContent_Map is new Minimal_Perfect_Hash (["kind", - "value"]); + "value"]); end MarkupContent_Scope; @@ -16250,14 +16249,14 @@ package body LSP.Inputs is package WorkspaceEdit_Scope is package WorkspaceEdit_Map is new Minimal_Perfect_Hash (["changes", - "documentChanges", - "changeAnnotations"]); + "documentChanges", + "changeAnnotations"]); package documentChanges_OfWorkspaceEdit_Item_Scope is package documentChanges_OfWorkspaceEdit_Item_Map is new Minimal_Perfect_Hash (["create", - "rename", - "delete"]); + "rename", + "delete"]); end documentChanges_OfWorkspaceEdit_Item_Scope; @@ -16364,8 +16363,8 @@ package body LSP.Inputs is Handler.Unmark; case Value.Kind is - when LSP.Structures.Varian_1 => - Read_TextDocumentEdit (Handler, Value.Varian_1); + when LSP.Structures.Variant_1 => + Read_TextDocumentEdit (Handler, Value.Variant_1); when LSP.Structures.create => Read_CreateFile (Handler, Value.create); when LSP.Structures.rename => @@ -16492,7 +16491,7 @@ package body LSP.Inputs is package DocumentHighlight_Scope is package DocumentHighlight_Map is new Minimal_Perfect_Hash (["range", - "kind"]); + "kind"]); end DocumentHighlight_Scope; @@ -16584,8 +16583,8 @@ package body LSP.Inputs is package InlineValueRegistrationOptions_Scope is package InlineValueRegistrationOptions_Map is new Minimal_Perfect_Hash (["workDoneProgress", - "documentSelector", - "id"]); + "documentSelector", + "id"]); end InlineValueRegistrationOptions_Scope; @@ -16647,7 +16646,7 @@ package body LSP.Inputs is package VersionedNotebookDocumentIdentifier_Scope is package VersionedNotebookDocumentIdentifier_Map is new Minimal_Perfect_Hash (["version", - "uri"]); + "uri"]); end VersionedNotebookDocumentIdentifier_Scope; @@ -16684,9 +16683,9 @@ package body LSP.Inputs is package BaseSymbolInformation_Scope is package BaseSymbolInformation_Map is new Minimal_Perfect_Hash (["name", - "kind", - "tags", - "containerName"]); + "kind", + "tags", + "containerName"]); end BaseSymbolInformation_Scope; @@ -16729,8 +16728,8 @@ package body LSP.Inputs is package InlayHintParams_Scope is package InlayHintParams_Map is new Minimal_Perfect_Hash (["workDoneToken", - "textDocument", - "range"]); + "textDocument", + "range"]); end InlayHintParams_Scope; @@ -16802,7 +16801,7 @@ package body LSP.Inputs is package TextEdit_Scope is package TextEdit_Map is new Minimal_Perfect_Hash (["range", - "newText"]); + "newText"]); end TextEdit_Scope; @@ -16839,7 +16838,7 @@ package body LSP.Inputs is package DeclarationClientCapabilities_Scope is package DeclarationClientCapabilities_Map is new Minimal_Perfect_Hash (["dynamicRegistration", - "linkSupport"]); + "linkSupport"]); end DeclarationClientCapabilities_Scope; @@ -16882,8 +16881,8 @@ package body LSP.Inputs is package SignatureHelpOptions_Scope is package SignatureHelpOptions_Map is new Minimal_Perfect_Hash (["workDoneProgress", - "triggerCharacters", - "retriggerCharacters"]); + "triggerCharacters", + "retriggerCharacters"]); end SignatureHelpOptions_Scope; @@ -16926,8 +16925,8 @@ package body LSP.Inputs is package SemanticTokensEdit_Scope is package SemanticTokensEdit_Map is new Minimal_Perfect_Hash (["start", - "deleteCount", - "data"]); + "deleteCount", + "data"]); end SemanticTokensEdit_Scope; @@ -16967,9 +16966,9 @@ package body LSP.Inputs is package DocumentHighlightParams_Scope is package DocumentHighlightParams_Map is new Minimal_Perfect_Hash (["textDocument", - "position", - "workDoneToken", - "partialResultToken"]); + "position", + "workDoneToken", + "partialResultToken"]); end DocumentHighlightParams_Scope; @@ -17047,10 +17046,10 @@ package body LSP.Inputs is package WorkspaceFullDocumentDiagnosticReport_Scope is package WorkspaceFullDocumentDiagnosticReport_Map is new Minimal_Perfect_Hash (["kind", - "resultId", - "items", - "uri", - "version"]); + "resultId", + "items", + "uri", + "version"]); end WorkspaceFullDocumentDiagnosticReport_Scope; @@ -17108,9 +17107,9 @@ package body LSP.Inputs is package SemanticTokensRangeParams_Scope is package SemanticTokensRangeParams_Map is new Minimal_Perfect_Hash (["workDoneToken", - "partialResultToken", - "textDocument", - "range"]); + "partialResultToken", + "textDocument", + "range"]); end SemanticTokensRangeParams_Scope; @@ -17155,11 +17154,11 @@ package body LSP.Inputs is package FoldingRange_Scope is package FoldingRange_Map is new Minimal_Perfect_Hash (["startLine", - "startCharacter", - "endLine", - "endCharacter", - "kind", - "collapsedText"]); + "startCharacter", + "endLine", + "endCharacter", + "kind", + "collapsedText"]); end FoldingRange_Scope; @@ -17286,10 +17285,10 @@ package body LSP.Inputs is package CompletionParams_Scope is package CompletionParams_Map is new Minimal_Perfect_Hash (["textDocument", - "position", - "workDoneToken", - "partialResultToken", - "context"]); + "position", + "workDoneToken", + "partialResultToken", + "context"]); end CompletionParams_Scope; @@ -17339,8 +17338,8 @@ package body LSP.Inputs is package CallHierarchyIncomingCallsParams_Scope is package CallHierarchyIncomingCallsParams_Map is new Minimal_Perfect_Hash (["workDoneToken", - "partialResultToken", - "item"]); + "partialResultToken", + "item"]); end CallHierarchyIncomingCallsParams_Scope; @@ -17395,9 +17394,9 @@ package body LSP.Inputs is package WorkspaceSymbolClientCapabilities_Scope is package WorkspaceSymbolClientCapabilities_Map is new Minimal_Perfect_Hash (["dynamicRegistration", - "symbolKind", - "tagSupport", - "resolveSupport"]); + "symbolKind", + "tagSupport", + "resolveSupport"]); end WorkspaceSymbolClientCapabilities_Scope; @@ -17539,8 +17538,8 @@ package body LSP.Inputs is package SelectionRangeRegistrationOptions_Scope is package SelectionRangeRegistrationOptions_Map is new Minimal_Perfect_Hash (["workDoneProgress", - "documentSelector", - "id"]); + "documentSelector", + "id"]); end SelectionRangeRegistrationOptions_Scope; @@ -17602,7 +17601,7 @@ package body LSP.Inputs is package DidChangeNotebookDocumentParams_Scope is package DidChangeNotebookDocumentParams_Map is new Minimal_Perfect_Hash (["notebookDocument", - "change"]); + "change"]); end DidChangeNotebookDocumentParams_Scope; @@ -17638,7 +17637,7 @@ package body LSP.Inputs is package RegularExpressionsClientCapabilities_Scope is package RegularExpressionsClientCapabilities_Map is new Minimal_Perfect_Hash (["engine", - "version"]); + "version"]); end RegularExpressionsClientCapabilities_Scope; @@ -17677,7 +17676,7 @@ package body LSP.Inputs is package WorkspaceDocumentDiagnosticReport_Scope is package WorkspaceDocumentDiagnosticReport_Map is new Minimal_Perfect_Hash (["full", - "unchanged"]); + "unchanged"]); end WorkspaceDocumentDiagnosticReport_Scope; @@ -17745,19 +17744,19 @@ package body LSP.Inputs is package WorkspaceClientCapabilities_Scope is package WorkspaceClientCapabilities_Map is new Minimal_Perfect_Hash (["applyEdit", - "workspaceEdit", - "didChangeConfiguration", - "didChangeWatchedFiles", - "symbol", - "executeCommand", - "workspaceFolders", - "configuration", - "semanticTokens", - "codeLens", - "fileOperations", - "inlineValue", - "inlayHint", - "diagnostics"]); + "workspaceEdit", + "didChangeConfiguration", + "didChangeWatchedFiles", + "symbol", + "executeCommand", + "workspaceFolders", + "configuration", + "semanticTokens", + "codeLens", + "fileOperations", + "inlineValue", + "inlayHint", + "diagnostics"]); end WorkspaceClientCapabilities_Scope; @@ -17872,9 +17871,9 @@ package body LSP.Inputs is package WorkspaceDiagnosticParams_Scope is package WorkspaceDiagnosticParams_Map is new Minimal_Perfect_Hash (["workDoneToken", - "partialResultToken", - "identifier", - "previousResultIds"]); + "partialResultToken", + "identifier", + "previousResultIds"]); end WorkspaceDiagnosticParams_Scope; @@ -17957,7 +17956,7 @@ package body LSP.Inputs is package InlayHintOptions_Scope is package InlayHintOptions_Map is new Minimal_Perfect_Hash (["workDoneProgress", - "resolveProvider"]); + "resolveProvider"]); end InlayHintOptions_Scope; @@ -18036,7 +18035,7 @@ package body LSP.Inputs is package WorkspaceFoldersChangeEvent_Scope is package WorkspaceFoldersChangeEvent_Map is new Minimal_Perfect_Hash (["added", - "removed"]); + "removed"]); end WorkspaceFoldersChangeEvent_Scope; @@ -18071,7 +18070,7 @@ package body LSP.Inputs is package TypeDefinitionClientCapabilities_Scope is package TypeDefinitionClientCapabilities_Map is new Minimal_Perfect_Hash (["dynamicRegistration", - "linkSupport"]); + "linkSupport"]); end TypeDefinitionClientCapabilities_Scope; @@ -18114,7 +18113,7 @@ package body LSP.Inputs is package CreateFileOptions_Scope is package CreateFileOptions_Map is new Minimal_Perfect_Hash (["overwrite", - "ignoreIfExists"]); + "ignoreIfExists"]); end CreateFileOptions_Scope; @@ -18157,7 +18156,7 @@ package body LSP.Inputs is package DiagnosticRelatedInformation_Scope is package DiagnosticRelatedInformation_Map is new Minimal_Perfect_Hash (["location", - "message"]); + "message"]); end DiagnosticRelatedInformation_Scope; @@ -18216,7 +18215,7 @@ package body LSP.Inputs is package DidCloseNotebookDocumentParams_Scope is package DidCloseNotebookDocumentParams_Map is new Minimal_Perfect_Hash (["notebookDocument", - "cellTextDocuments"]); + "cellTextDocuments"]); end DidCloseNotebookDocumentParams_Scope; @@ -18310,8 +18309,8 @@ package body LSP.Inputs is package DocumentColorRegistrationOptions_Scope is package DocumentColorRegistrationOptions_Map is new Minimal_Perfect_Hash (["documentSelector", - "workDoneProgress", - "id"]); + "workDoneProgress", + "id"]); end DocumentColorRegistrationOptions_Scope; @@ -18373,8 +18372,8 @@ package body LSP.Inputs is package CodeActionOptions_Scope is package CodeActionOptions_Map is new Minimal_Perfect_Hash (["workDoneProgress", - "codeActionKinds", - "resolveProvider"]); + "codeActionKinds", + "resolveProvider"]); end CodeActionOptions_Scope; @@ -18429,9 +18428,9 @@ package body LSP.Inputs is package ShowDocumentParams_Scope is package ShowDocumentParams_Map is new Minimal_Perfect_Hash (["uri", - "external", - "takeFocus", - "selection"]); + "external", + "takeFocus", + "selection"]); end ShowDocumentParams_Scope; @@ -18481,12 +18480,12 @@ package body LSP.Inputs is package Command_Or_CodeAction_Scope is package Command_Or_CodeAction_Map is new Minimal_Perfect_Hash (["arguments", - "kind", - "diagnostics", - "isPreferred", - "disabled", - "edit", - "data"]); + "kind", + "diagnostics", + "isPreferred", + "disabled", + "edit", + "data"]); end Command_Or_CodeAction_Scope; @@ -18660,8 +18659,8 @@ package body LSP.Inputs is package DocumentFormattingParams_Scope is package DocumentFormattingParams_Map is new Minimal_Perfect_Hash (["workDoneToken", - "textDocument", - "options"]); + "textDocument", + "options"]); end DocumentFormattingParams_Scope; @@ -18701,9 +18700,9 @@ package body LSP.Inputs is package SignatureHelpContext_Scope is package SignatureHelpContext_Map is new Minimal_Perfect_Hash (["triggerKind", - "triggerCharacter", - "isRetrigger", - "activeSignatureHelp"]); + "triggerCharacter", + "isRetrigger", + "activeSignatureHelp"]); end SignatureHelpContext_Scope; @@ -18826,9 +18825,9 @@ package body LSP.Inputs is package DocumentOnTypeFormattingParams_Scope is package DocumentOnTypeFormattingParams_Map is new Minimal_Perfect_Hash (["textDocument", - "position", - "ch", - "options"]); + "position", + "ch", + "options"]); end DocumentOnTypeFormattingParams_Scope; @@ -18869,7 +18868,7 @@ package body LSP.Inputs is package CallHierarchyOutgoingCall_Scope is package CallHierarchyOutgoingCall_Map is new Minimal_Perfect_Hash (["to", - "fromRanges"]); + "fromRanges"]); end CallHierarchyOutgoingCall_Scope; @@ -18925,8 +18924,8 @@ package body LSP.Inputs is package TextDocumentContentChangeEvent_Scope is package TextDocumentContentChangeEvent_Map is new Minimal_Perfect_Hash (["range", - "rangeLength", - "text"]); + "rangeLength", + "text"]); end TextDocumentContentChangeEvent_Scope; @@ -18972,8 +18971,8 @@ package body LSP.Inputs is package DocumentColorParams_Scope is package DocumentColorParams_Map is new Minimal_Perfect_Hash (["workDoneToken", - "partialResultToken", - "textDocument"]); + "partialResultToken", + "textDocument"]); end DocumentColorParams_Scope; @@ -19016,7 +19015,7 @@ package body LSP.Inputs is package WorkspaceFolder_Scope is package WorkspaceFolder_Map is new Minimal_Perfect_Hash (["uri", - "name"]); + "name"]); end WorkspaceFolder_Scope; @@ -19053,7 +19052,7 @@ package body LSP.Inputs is package MarkedString_Scope is package MarkedString_Map is new Minimal_Perfect_Hash (["language", - "value"]); + "value"]); end MarkedString_Scope; @@ -19109,9 +19108,9 @@ package body LSP.Inputs is package NotebookCell_Scope is package NotebookCell_Map is new Minimal_Perfect_Hash (["kind", - "document", - "metadata", - "executionSummary"]); + "document", + "metadata", + "executionSummary"]); end NotebookCell_Scope; @@ -19158,9 +19157,9 @@ package body LSP.Inputs is package DocumentLink_Scope is package DocumentLink_Map is new Minimal_Perfect_Hash (["range", - "target", - "tooltip", - "data"]); + "target", + "tooltip", + "data"]); end DocumentLink_Scope; @@ -19203,7 +19202,7 @@ package body LSP.Inputs is package WorkspaceFoldersServerCapabilities_Scope is package WorkspaceFoldersServerCapabilities_Map is new Minimal_Perfect_Hash (["supported", - "changeNotifications"]); + "changeNotifications"]); end WorkspaceFoldersServerCapabilities_Scope; @@ -19275,7 +19274,7 @@ package body LSP.Inputs is package WorkDoneProgressEnd_Scope is package WorkDoneProgressEnd_Map is new Minimal_Perfect_Hash (["kind", - "message"]); + "message"]); end WorkDoneProgressEnd_Scope; @@ -19312,11 +19311,11 @@ package body LSP.Inputs is package SemanticTokensRegistrationOptions_Scope is package SemanticTokensRegistrationOptions_Map is new Minimal_Perfect_Hash (["documentSelector", - "workDoneProgress", - "legend", - "range", - "full", - "id"]); + "workDoneProgress", + "legend", + "range", + "full", + "id"]); end SemanticTokensRegistrationOptions_Scope; @@ -19400,8 +19399,8 @@ package body LSP.Inputs is package CallHierarchyRegistrationOptions_Scope is package CallHierarchyRegistrationOptions_Map is new Minimal_Perfect_Hash (["documentSelector", - "workDoneProgress", - "id"]); + "workDoneProgress", + "id"]); end CallHierarchyRegistrationOptions_Scope; @@ -19499,8 +19498,8 @@ package body LSP.Inputs is package DocumentSymbolParams_Scope is package DocumentSymbolParams_Map is new Minimal_Perfect_Hash (["workDoneToken", - "partialResultToken", - "textDocument"]); + "partialResultToken", + "textDocument"]); end DocumentSymbolParams_Scope; @@ -19724,7 +19723,7 @@ package body LSP.Inputs is package FileOperationPatternKind_Map is new Minimal_Perfect_Hash (["file", - "folder"]); + "folder"]); procedure Read_FileOperationPatternKind (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; @@ -19739,7 +19738,7 @@ package body LSP.Inputs is package Unregistration_Scope is package Unregistration_Map is new Minimal_Perfect_Hash (["id", - "method"]); + "method"]); end Unregistration_Scope; @@ -19814,8 +19813,8 @@ package body LSP.Inputs is package DocumentOnTypeFormattingRegistrationOptions_Scope is package DocumentOnTypeFormattingRegistrationOptions_Map is new Minimal_Perfect_Hash (["documentSelector", - "firstTriggerCharacter", - "moreTriggerCharacter"]); + "firstTriggerCharacter", + "moreTriggerCharacter"]); end DocumentOnTypeFormattingRegistrationOptions_Scope; @@ -20000,7 +19999,7 @@ package body LSP.Inputs is package ColorInformation_Scope is package ColorInformation_Map is new Minimal_Perfect_Hash (["range", - "color"]); + "color"]); end ColorInformation_Scope; @@ -20035,7 +20034,7 @@ package body LSP.Inputs is package A_Range_Scope is package A_Range_Map is new Minimal_Perfect_Hash (["start", - "end"]); + "end"]); end A_Range_Scope; @@ -20070,8 +20069,8 @@ package body LSP.Inputs is package ShowMessageRequestParams_Scope is package ShowMessageRequestParams_Map is new Minimal_Perfect_Hash (["type", - "message", - "actions"]); + "message", + "actions"]); end ShowMessageRequestParams_Scope; @@ -20185,7 +20184,7 @@ package body LSP.Inputs is package InlineValueEvaluatableExpression_Scope is package InlineValueEvaluatableExpression_Map is new Minimal_Perfect_Hash (["range", - "expression"]); + "expression"]); end InlineValueEvaluatableExpression_Scope; @@ -20252,8 +20251,8 @@ package body LSP.Inputs is package NotebookCellArrayChange_Scope is package NotebookCellArrayChange_Map is new Minimal_Perfect_Hash (["start", - "deleteCount", - "cells"]); + "deleteCount", + "cells"]); end NotebookCellArrayChange_Scope; @@ -20293,8 +20292,8 @@ package body LSP.Inputs is package DocumentLinkRegistrationOptions_Scope is package DocumentLinkRegistrationOptions_Map is new Minimal_Perfect_Hash (["documentSelector", - "workDoneProgress", - "resolveProvider"]); + "workDoneProgress", + "resolveProvider"]); end DocumentLinkRegistrationOptions_Scope; @@ -20370,7 +20369,7 @@ package body LSP.Inputs is package LogMessageParams_Scope is package LogMessageParams_Map is new Minimal_Perfect_Hash (["type", - "message"]); + "message"]); end LogMessageParams_Scope; @@ -20407,8 +20406,8 @@ package body LSP.Inputs is package CodeLens_Scope is package CodeLens_Map is new Minimal_Perfect_Hash (["range", - "command", - "data"]); + "command", + "data"]); end CodeLens_Scope; @@ -20524,7 +20523,7 @@ package body LSP.Inputs is package ProgressParams_Scope is package ProgressParams_Map is new Minimal_Perfect_Hash (["token", - "value"]); + "value"]); end ProgressParams_Scope; @@ -20559,7 +20558,7 @@ package body LSP.Inputs is package DocumentLinkOptions_Scope is package DocumentLinkOptions_Map is new Minimal_Perfect_Hash (["workDoneProgress", - "resolveProvider"]); + "resolveProvider"]); end DocumentLinkOptions_Scope; @@ -20644,11 +20643,11 @@ package body LSP.Inputs is package DocumentSymbol_Result_Scope is package DocumentSymbol_Result_Map is new Minimal_Perfect_Hash (["location", - "containerName", - "detail", - "range", - "selectionRange", - "children"]); + "containerName", + "detail", + "range", + "selectionRange", + "children"]); end DocumentSymbol_Result_Scope; @@ -20671,7 +20670,7 @@ package body LSP.Inputs is end if; if Handler.Is_Null_Value then Value := - (Kind => LSP.Structures.Varian_3, + (Kind => LSP.Structures.Variant_3, others => <>); elsif Handler.Is_Start_Object then Handler.Read_Next; @@ -20686,32 +20685,32 @@ package body LSP.Inputs is case Index is when 1 => -- location Value := - (Kind => LSP.Structures.Varian_1, + (Kind => LSP.Structures.Variant_1, others => <>); exit; when 2 => -- containerName Value := - (Kind => LSP.Structures.Varian_1, + (Kind => LSP.Structures.Variant_1, others => <>); exit; when 3 => -- detail Value := - (Kind => LSP.Structures.Varian_2, + (Kind => LSP.Structures.Variant_2, others => <>); exit; when 4 => -- range Value := - (Kind => LSP.Structures.Varian_2, + (Kind => LSP.Structures.Variant_2, others => <>); exit; when 5 => -- selectionRange Value := - (Kind => LSP.Structures.Varian_2, + (Kind => LSP.Structures.Variant_2, others => <>); exit; when 6 => -- children Value := - (Kind => LSP.Structures.Varian_2, + (Kind => LSP.Structures.Variant_2, others => <>); exit; when others => @@ -20727,11 +20726,11 @@ package body LSP.Inputs is Handler.Unmark; case Value.Kind is - when LSP.Structures.Varian_1 => - Read_SymbolInformation_Vector (Handler, Value.Varian_1); - when LSP.Structures.Varian_2 => - Read_DocumentSymbol_Vector (Handler, Value.Varian_2); - when LSP.Structures.Varian_3 => + when LSP.Structures.Variant_1 => + Read_SymbolInformation_Vector (Handler, Value.Variant_1); + when LSP.Structures.Variant_2 => + Read_DocumentSymbol_Vector (Handler, Value.Variant_2); + when LSP.Structures.Variant_3 => null; -- #null_value Handler.Read_Next; end case; @@ -20740,8 +20739,8 @@ package body LSP.Inputs is package TraceValues_Map is new Minimal_Perfect_Hash (["off", - "messages", - "verbose"]); + "messages", + "verbose"]); procedure Read_TraceValues (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; @@ -20756,8 +20755,8 @@ package body LSP.Inputs is package TypeHierarchyPrepareParams_Scope is package TypeHierarchyPrepareParams_Map is new Minimal_Perfect_Hash (["textDocument", - "position", - "workDoneToken"]); + "position", + "workDoneToken"]); end TypeHierarchyPrepareParams_Scope; @@ -20797,11 +20796,11 @@ package body LSP.Inputs is package SymbolInformation_Scope is package SymbolInformation_Map is new Minimal_Perfect_Hash (["name", - "kind", - "tags", - "containerName", - "deprecated", - "location"]); + "kind", + "tags", + "containerName", + "deprecated", + "location"]); end SymbolInformation_Scope; @@ -20852,7 +20851,7 @@ package body LSP.Inputs is package WillSaveTextDocumentParams_Scope is package WillSaveTextDocumentParams_Map is new Minimal_Perfect_Hash (["textDocument", - "reason"]); + "reason"]); end WillSaveTextDocumentParams_Scope; @@ -20899,12 +20898,12 @@ package body LSP.Inputs is package FileOperationClientCapabilities_Scope is package FileOperationClientCapabilities_Map is new Minimal_Perfect_Hash (["dynamicRegistration", - "didCreate", - "willCreate", - "didRename", - "willRename", - "didDelete", - "willDelete"]); + "didCreate", + "willCreate", + "didRename", + "willRename", + "didDelete", + "willDelete"]); end FileOperationClientCapabilities_Scope; @@ -20977,7 +20976,7 @@ package body LSP.Inputs is package Definition_Result_Scope is package Definition_Result_Map is new Minimal_Perfect_Hash (["uri", - "range"]); + "range"]); end Definition_Result_Scope; @@ -20997,12 +20996,12 @@ package body LSP.Inputs is Handler.Mark; if Handler.Is_Null_Value then Value := - (Kind => LSP.Structures.Varian_3, + (Kind => LSP.Structures.Variant_3, others => <>); elsif Handler.Is_Start_Object then Handler.Read_Next; Value := - (Kind => LSP.Structures.Varian_2, + (Kind => LSP.Structures.Variant_2, others => <>); while Handler.Is_Key_Name loop declare @@ -21015,12 +21014,12 @@ package body LSP.Inputs is case Index is when 1 => -- uri Value := - (Kind => LSP.Structures.Varian_1, + (Kind => LSP.Structures.Variant_1, others => <>); exit; when 2 => -- range Value := - (Kind => LSP.Structures.Varian_1, + (Kind => LSP.Structures.Variant_1, others => <>); exit; when others => @@ -21036,11 +21035,11 @@ package body LSP.Inputs is Handler.Unmark; case Value.Kind is - when LSP.Structures.Varian_1 => - Read_Definition (Handler, Value.Varian_1); - when LSP.Structures.Varian_2 => - Read_DefinitionLink_Vector (Handler, Value.Varian_2); - when LSP.Structures.Varian_3 => + when LSP.Structures.Variant_1 => + Read_Definition (Handler, Value.Variant_1); + when LSP.Structures.Variant_2 => + Read_DefinitionLink_Vector (Handler, Value.Variant_2); + when LSP.Structures.Variant_3 => null; -- #null_value Handler.Read_Next; end case; @@ -21086,7 +21085,7 @@ package body LSP.Inputs is package InlineValueText_Scope is package InlineValueText_Map is new Minimal_Perfect_Hash (["range", - "text"]); + "text"]); end InlineValueText_Scope; @@ -21123,7 +21122,7 @@ package body LSP.Inputs is package UnchangedDocumentDiagnosticReport_Scope is package UnchangedDocumentDiagnosticReport_Map is new Minimal_Perfect_Hash (["kind", - "resultId"]); + "resultId"]); end UnchangedDocumentDiagnosticReport_Scope; @@ -21170,8 +21169,8 @@ package body LSP.Inputs is package Registration_Scope is package Registration_Map is new Minimal_Perfect_Hash (["id", - "method", - "registerOptions"]); + "method", + "registerOptions"]); end Registration_Scope; @@ -21212,30 +21211,30 @@ package body LSP.Inputs is package CompletionItem_Scope is package CompletionItem_Map is new Minimal_Perfect_Hash (["label", - "labelDetails", - "kind", - "tags", - "detail", - "documentation", - "deprecated", - "preselect", - "sortText", - "filterText", - "insertText", - "insertTextFormat", - "insertTextMode", - "textEdit", - "textEditText", - "additionalTextEdits", - "commitCharacters", - "command", - "data"]); + "labelDetails", + "kind", + "tags", + "detail", + "documentation", + "deprecated", + "preselect", + "sortText", + "filterText", + "insertText", + "insertTextFormat", + "insertTextMode", + "textEdit", + "textEditText", + "additionalTextEdits", + "commitCharacters", + "command", + "data"]); package TextEdit_Or_InsertReplaceEdit_Scope is package TextEdit_Or_InsertReplaceEdit_Map is new Minimal_Perfect_Hash (["range", - "insert", - "replace"]); + "insert", + "replace"]); end TextEdit_Or_InsertReplaceEdit_Scope; @@ -21417,7 +21416,7 @@ package body LSP.Inputs is package DocumentRangeFormattingRegistrationOptions_Scope is package DocumentRangeFormattingRegistrationOptions_Map is new Minimal_Perfect_Hash (["documentSelector", - "workDoneProgress"]); + "workDoneProgress"]); end DocumentRangeFormattingRegistrationOptions_Scope; @@ -21497,7 +21496,7 @@ package body LSP.Inputs is package RenameFileOptions_Scope is package RenameFileOptions_Map is new Minimal_Perfect_Hash (["overwrite", - "ignoreIfExists"]); + "ignoreIfExists"]); end RenameFileOptions_Scope; @@ -21540,8 +21539,8 @@ package body LSP.Inputs is package HoverParams_Scope is package HoverParams_Map is new Minimal_Perfect_Hash (["textDocument", - "position", - "workDoneToken"]); + "position", + "workDoneToken"]); end HoverParams_Scope; @@ -21581,13 +21580,13 @@ package body LSP.Inputs is package DocumentSymbol_Scope is package DocumentSymbol_Map is new Minimal_Perfect_Hash (["name", - "detail", - "kind", - "tags", - "deprecated", - "range", - "selectionRange", - "children"]); + "detail", + "kind", + "tags", + "deprecated", + "range", + "selectionRange", + "children"]); end DocumentSymbol_Scope; @@ -21642,10 +21641,10 @@ package body LSP.Inputs is package DocumentSymbolClientCapabilities_Scope is package DocumentSymbolClientCapabilities_Map is new Minimal_Perfect_Hash (["dynamicRegistration", - "symbolKind", - "hierarchicalDocumentSymbolSupport", - "tagSupport", - "labelSupport"]); + "symbolKind", + "hierarchicalDocumentSymbolSupport", + "tagSupport", + "labelSupport"]); end DocumentSymbolClientCapabilities_Scope; @@ -21739,8 +21738,8 @@ package body LSP.Inputs is package LinkedEditingRangeRegistrationOptions_Scope is package LinkedEditingRangeRegistrationOptions_Map is new Minimal_Perfect_Hash (["documentSelector", - "workDoneProgress", - "id"]); + "workDoneProgress", + "id"]); end LinkedEditingRangeRegistrationOptions_Scope; @@ -21802,19 +21801,19 @@ package body LSP.Inputs is package SemanticTokensClientCapabilities_Scope is package SemanticTokensClientCapabilities_Map is new Minimal_Perfect_Hash (["dynamicRegistration", - "requests", - "tokenTypes", - "tokenModifiers", - "formats", - "overlappingTokenSupport", - "multilineTokenSupport", - "serverCancelSupport", - "augmentsSyntaxTokens"]); + "requests", + "tokenTypes", + "tokenModifiers", + "formats", + "overlappingTokenSupport", + "multilineTokenSupport", + "serverCancelSupport", + "augmentsSyntaxTokens"]); package requests_OfSemanticTokensClientCapabilities_Scope is package requests_OfSemanticTokensClientCapabilities_Map is new Minimal_Perfect_Hash (["range", - "full"]); + "full"]); end requests_OfSemanticTokensClientCapabilities_Scope; @@ -21951,12 +21950,12 @@ package body LSP.Inputs is package Hover_Scope is package Hover_Map is new Minimal_Perfect_Hash (["contents", - "range"]); + "range"]); package MarkupContent_Or_MarkedString_Vector_Scope is package MarkupContent_Or_MarkedString_Vector_Map is new Minimal_Perfect_Hash (["kind", - "language"]); + "language"]); end MarkupContent_Or_MarkedString_Vector_Scope; @@ -22096,7 +22095,7 @@ package body LSP.Inputs is package ResourceOperation_Scope is package ResourceOperation_Map is new Minimal_Perfect_Hash (["kind", - "annotationId"]); + "annotationId"]); end ResourceOperation_Scope; @@ -22137,10 +22136,10 @@ package body LSP.Inputs is package PublishDiagnosticsClientCapabilities_Scope is package PublishDiagnosticsClientCapabilities_Map is new Minimal_Perfect_Hash (["relatedInformation", - "tagSupport", - "versionSupport", - "codeDescriptionSupport", - "dataSupport"]); + "tagSupport", + "versionSupport", + "codeDescriptionSupport", + "dataSupport"]); package tagSupport_OfPublishDiagnosticsClientCapabilities_Scope is package tagSupport_OfPublishDiagnosticsClientCapabilities_Map is new Minimal_Perfect_Hash @@ -22261,9 +22260,9 @@ package body LSP.Inputs is package SemanticTokensOptions_Scope is package SemanticTokensOptions_Map is new Minimal_Perfect_Hash (["workDoneProgress", - "legend", - "range", - "full"]); + "legend", + "range", + "full"]); end SemanticTokensOptions_Scope; @@ -22373,8 +22372,8 @@ package body LSP.Inputs is package FoldingRangeParams_Scope is package FoldingRangeParams_Map is new Minimal_Perfect_Hash (["workDoneToken", - "partialResultToken", - "textDocument"]); + "partialResultToken", + "textDocument"]); end FoldingRangeParams_Scope; @@ -22525,9 +22524,9 @@ package body LSP.Inputs is package SignatureHelpParams_Scope is package SignatureHelpParams_Map is new Minimal_Perfect_Hash (["textDocument", - "position", - "workDoneToken", - "context"]); + "position", + "workDoneToken", + "context"]); end SignatureHelpParams_Scope; @@ -22695,7 +22694,7 @@ package body LSP.Inputs is package Position_Scope is package Position_Map is new Minimal_Perfect_Hash (["line", - "character"]); + "character"]); end Position_Scope; @@ -22733,7 +22732,7 @@ package body LSP.Inputs is package TextDocumentSaveRegistrationOptions_Scope is package TextDocumentSaveRegistrationOptions_Map is new Minimal_Perfect_Hash (["documentSelector", - "includeText"]); + "includeText"]); end TextDocumentSaveRegistrationOptions_Scope; @@ -22791,10 +22790,10 @@ package body LSP.Inputs is package CodeActionParams_Scope is package CodeActionParams_Map is new Minimal_Perfect_Hash (["workDoneToken", - "partialResultToken", - "textDocument", - "range", - "context"]); + "partialResultToken", + "textDocument", + "range", + "context"]); end CodeActionParams_Scope; @@ -22841,8 +22840,8 @@ package body LSP.Inputs is package Command_Scope is package Command_Map is new Minimal_Perfect_Hash (["title", - "command", - "arguments"]); + "command", + "arguments"]); end Command_Scope; @@ -22883,8 +22882,8 @@ package body LSP.Inputs is package TextDocumentFilter_Scope is package TextDocumentFilter_Map is new Minimal_Perfect_Hash (["language", - "scheme", - "pattern"]); + "scheme", + "pattern"]); end TextDocumentFilter_Scope; @@ -22959,7 +22958,7 @@ package body LSP.Inputs is package ExecuteCommandRegistrationOptions_Scope is package ExecuteCommandRegistrationOptions_Map is new Minimal_Perfect_Hash (["workDoneProgress", - "commands"]); + "commands"]); end ExecuteCommandRegistrationOptions_Scope; @@ -22997,10 +22996,10 @@ package body LSP.Inputs is package UniquenessLevel_Map is new Minimal_Perfect_Hash (["document", - "project", - "group", - "scheme", - "global"]); + "project", + "group", + "scheme", + "global"]); procedure Read_UniquenessLevel (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; @@ -23015,7 +23014,7 @@ package body LSP.Inputs is package TextDocumentEdit_Scope is package TextDocumentEdit_Map is new Minimal_Perfect_Hash (["textDocument", - "edits"]); + "edits"]); package TextEdit_Or_AnnotatedTextEdit_Scope is package TextEdit_Or_AnnotatedTextEdit_Map is new Minimal_Perfect_Hash @@ -23144,7 +23143,7 @@ package body LSP.Inputs is package CompletionItemLabelDetails_Scope is package CompletionItemLabelDetails_Map is new Minimal_Perfect_Hash (["detail", - "description"]); + "description"]); end CompletionItemLabelDetails_Scope; @@ -23183,10 +23182,10 @@ package body LSP.Inputs is package CompletionOptions_Scope is package CompletionOptions_Map is new Minimal_Perfect_Hash (["workDoneProgress", - "triggerCharacters", - "allCommitCharacters", - "resolveProvider", - "completionItem"]); + "triggerCharacters", + "allCommitCharacters", + "resolveProvider", + "completionItem"]); package completionItem_OfCompletionOptions_Scope is package completionItem_OfCompletionOptions_Map is new Minimal_Perfect_Hash @@ -23280,14 +23279,14 @@ package body LSP.Inputs is package Diagnostic_Scope is package Diagnostic_Map is new Minimal_Perfect_Hash (["range", - "severity", - "code", - "codeDescription", - "source", - "message", - "tags", - "relatedInformation", - "data"]); + "severity", + "code", + "codeDescription", + "source", + "message", + "tags", + "relatedInformation", + "data"]); end Diagnostic_Scope; @@ -23376,8 +23375,8 @@ package body LSP.Inputs is package LinkedEditingRangeParams_Scope is package LinkedEditingRangeParams_Map is new Minimal_Perfect_Hash (["textDocument", - "position", - "workDoneToken"]); + "position", + "workDoneToken"]); end LinkedEditingRangeParams_Scope; @@ -23417,10 +23416,10 @@ package body LSP.Inputs is package TextDocumentSyncOptions_Scope is package TextDocumentSyncOptions_Map is new Minimal_Perfect_Hash (["openClose", - "change", - "willSave", - "willSaveWaitUntil", - "save"]); + "change", + "willSave", + "willSaveWaitUntil", + "save"]); end TextDocumentSyncOptions_Scope; @@ -23506,9 +23505,9 @@ package body LSP.Inputs is package ImplementationParams_Scope is package ImplementationParams_Map is new Minimal_Perfect_Hash (["textDocument", - "position", - "workDoneToken", - "partialResultToken"]); + "position", + "workDoneToken", + "partialResultToken"]); end ImplementationParams_Scope; @@ -23553,7 +23552,7 @@ package body LSP.Inputs is package OptionalVersionedTextDocumentIdentifier_Scope is package OptionalVersionedTextDocumentIdentifier_Map is new Minimal_Perfect_Hash (["uri", - "version"]); + "version"]); end OptionalVersionedTextDocumentIdentifier_Scope; @@ -23589,7 +23588,7 @@ package body LSP.Inputs is package SemanticTokensLegend_Scope is package SemanticTokensLegend_Map is new Minimal_Perfect_Hash (["tokenTypes", - "tokenModifiers"]); + "tokenModifiers"]); end SemanticTokensLegend_Scope; @@ -23647,7 +23646,7 @@ package body LSP.Inputs is package ExecuteCommandOptions_Scope is package ExecuteCommandOptions_Map is new Minimal_Perfect_Hash (["workDoneProgress", - "commands"]); + "commands"]); end ExecuteCommandOptions_Scope; @@ -23686,9 +23685,9 @@ package body LSP.Inputs is package TextDocumentSyncClientCapabilities_Scope is package TextDocumentSyncClientCapabilities_Map is new Minimal_Perfect_Hash (["dynamicRegistration", - "willSave", - "willSaveWaitUntil", - "didSave"]); + "willSave", + "willSaveWaitUntil", + "didSave"]); end TextDocumentSyncClientCapabilities_Scope; @@ -23742,7 +23741,7 @@ package body LSP.Inputs is package MarkupKind_Map is new Minimal_Perfect_Hash (["plaintext", - "markdown"]); + "markdown"]); procedure Read_MarkupKind (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; @@ -23757,8 +23756,8 @@ package body LSP.Inputs is package CallHierarchyPrepareParams_Scope is package CallHierarchyPrepareParams_Map is new Minimal_Perfect_Hash (["textDocument", - "position", - "workDoneToken"]); + "position", + "workDoneToken"]); end CallHierarchyPrepareParams_Scope; @@ -23808,7 +23807,7 @@ package body LSP.Inputs is package ReferenceRegistrationOptions_Scope is package ReferenceRegistrationOptions_Map is new Minimal_Perfect_Hash (["documentSelector", - "workDoneProgress"]); + "workDoneProgress"]); end ReferenceRegistrationOptions_Scope; diff --git a/source/lsp_3.17/generated/lsp-inputs.ads b/source/lsp_3.17/generated/lsp-inputs.ads index 7d1407a2e..f0ad86f96 100644 --- a/source/lsp_3.17/generated/lsp-inputs.ads +++ b/source/lsp_3.17/generated/lsp-inputs.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with VSS.JSON.Pull_Readers; @@ -110,6 +112,10 @@ package LSP.Inputs is (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; Value : out LSP.Structures.WorkDoneProgressCancelParams); + procedure Read_ProgressToken + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ProgressToken); + procedure Read_DidChangeWatchedFilesParams (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; Value : out LSP.Structures.DidChangeWatchedFilesParams); diff --git a/source/lsp_3.17/generated/lsp-outputs.adb b/source/lsp_3.17/generated/lsp-outputs.adb index 6782a6183..91d84bc7f 100644 --- a/source/lsp_3.17/generated/lsp-outputs.adb +++ b/source/lsp_3.17/generated/lsp-outputs.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with Ada.Containers; with Interfaces; @@ -259,10 +261,6 @@ package body LSP.Outputs is (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; Value : LSP.Structures.NotebookDocumentSyncClientCapabilities); - procedure Write_ProgressToken - (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; - Value : LSP.Structures.ProgressToken); - procedure Write_DiagnosticOptions (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; Value : LSP.Structures.DiagnosticOptions); @@ -2098,11 +2096,11 @@ package body LSP.Outputs is Value : LSP.Structures.Declaration_Result) is begin case Value.Kind is - when LSP.Structures.Varian_1 => - Write_Declaration (Handler, Value.Varian_1); - when LSP.Structures.Varian_2 => - Write_DeclarationLink_Vector (Handler, Value.Varian_2); - when LSP.Structures.Varian_3 => + when LSP.Structures.Variant_1 => + Write_Declaration (Handler, Value.Variant_1); + when LSP.Structures.Variant_2 => + Write_DeclarationLink_Vector (Handler, Value.Variant_2); + when LSP.Structures.Variant_3 => Handler.Null_Value; end case; end Write_Declaration_Result; @@ -2112,10 +2110,10 @@ package body LSP.Outputs is Value : LSP.Structures.Definition_Progress_Report) is begin case Value.Kind is - when LSP.Structures.Varian_1 => - Write_Location_Vector (Handler, Value.Varian_1); - when LSP.Structures.Varian_2 => - Write_DefinitionLink_Vector (Handler, Value.Varian_2); + when LSP.Structures.Variant_1 => + Write_Location_Vector (Handler, Value.Variant_1); + when LSP.Structures.Variant_2 => + Write_DefinitionLink_Vector (Handler, Value.Variant_2); end case; end Write_Definition_Progress_Report; @@ -2165,10 +2163,10 @@ package body LSP.Outputs is Value : LSP.Structures.DocumentSymbol_Progress_Report) is begin case Value.Kind is - when LSP.Structures.Varian_1 => - Write_SymbolInformation_Vector (Handler, Value.Varian_1); - when LSP.Structures.Varian_2 => - Write_DocumentSymbol_Vector (Handler, Value.Varian_2); + when LSP.Structures.Variant_1 => + Write_SymbolInformation_Vector (Handler, Value.Variant_1); + when LSP.Structures.Variant_2 => + Write_DocumentSymbol_Vector (Handler, Value.Variant_2); end case; end Write_DocumentSymbol_Progress_Report; @@ -2464,13 +2462,13 @@ package body LSP.Outputs is Value : LSP.Structures.implementationProvider_OfServerCapabilities) is begin case Value.Kind is - when LSP.Structures.Varian_1 => - Handler.Boolean_Value (Value.Varian_1); - when LSP.Structures.Varian_2 => - Write_ImplementationOptions (Handler, Value.Varian_2); - when LSP.Structures.Varian_3 => + when LSP.Structures.Variant_1 => + Handler.Boolean_Value (Value.Variant_1); + when LSP.Structures.Variant_2 => + Write_ImplementationOptions (Handler, Value.Variant_2); + when LSP.Structures.Variant_3 => Write_ImplementationRegistrationOptions - (Handler, Value.Varian_3); + (Handler, Value.Variant_3); end case; end Write_implementationProvider_OfServerCapabilities; @@ -2479,13 +2477,13 @@ package body LSP.Outputs is Value : LSP.Structures.typeHierarchyProvider_OfServerCapabilities) is begin case Value.Kind is - when LSP.Structures.Varian_1 => - Handler.Boolean_Value (Value.Varian_1); - when LSP.Structures.Varian_2 => - Write_TypeHierarchyOptions (Handler, Value.Varian_2); - when LSP.Structures.Varian_3 => + when LSP.Structures.Variant_1 => + Handler.Boolean_Value (Value.Variant_1); + when LSP.Structures.Variant_2 => + Write_TypeHierarchyOptions (Handler, Value.Variant_2); + when LSP.Structures.Variant_3 => Write_TypeHierarchyRegistrationOptions - (Handler, Value.Varian_3); + (Handler, Value.Variant_3); end case; end Write_typeHierarchyProvider_OfServerCapabilities; @@ -2508,12 +2506,12 @@ package body LSP.Outputs is Value : LSP.Structures.inlayHintProvider_OfServerCapabilities) is begin case Value.Kind is - when LSP.Structures.Varian_1 => - Handler.Boolean_Value (Value.Varian_1); - when LSP.Structures.Varian_2 => - Write_InlayHintOptions (Handler, Value.Varian_2); - when LSP.Structures.Varian_3 => - Write_InlayHintRegistrationOptions (Handler, Value.Varian_3); + when LSP.Structures.Variant_1 => + Handler.Boolean_Value (Value.Variant_1); + when LSP.Structures.Variant_2 => + Write_InlayHintOptions (Handler, Value.Variant_2); + when LSP.Structures.Variant_3 => + Write_InlayHintRegistrationOptions (Handler, Value.Variant_3); end case; end Write_inlayHintProvider_OfServerCapabilities; @@ -2537,12 +2535,12 @@ package body LSP.Outputs is Value : LSP.Structures.monikerProvider_OfServerCapabilities) is begin case Value.Kind is - when LSP.Structures.Varian_1 => - Handler.Boolean_Value (Value.Varian_1); - when LSP.Structures.Varian_2 => - Write_MonikerOptions (Handler, Value.Varian_2); - when LSP.Structures.Varian_3 => - Write_MonikerRegistrationOptions (Handler, Value.Varian_3); + when LSP.Structures.Variant_1 => + Handler.Boolean_Value (Value.Variant_1); + when LSP.Structures.Variant_2 => + Write_MonikerOptions (Handler, Value.Variant_2); + when LSP.Structures.Variant_3 => + Write_MonikerRegistrationOptions (Handler, Value.Variant_3); end case; end Write_monikerProvider_OfServerCapabilities; @@ -2563,13 +2561,13 @@ package body LSP.Outputs is Value : LSP.Structures.selectionRangeProvider_OfServerCapabilities) is begin case Value.Kind is - when LSP.Structures.Varian_1 => - Handler.Boolean_Value (Value.Varian_1); - when LSP.Structures.Varian_2 => - Write_SelectionRangeOptions (Handler, Value.Varian_2); - when LSP.Structures.Varian_3 => + when LSP.Structures.Variant_1 => + Handler.Boolean_Value (Value.Variant_1); + when LSP.Structures.Variant_2 => + Write_SelectionRangeOptions (Handler, Value.Variant_2); + when LSP.Structures.Variant_3 => Write_SelectionRangeRegistrationOptions - (Handler, Value.Varian_3); + (Handler, Value.Variant_3); end case; end Write_selectionRangeProvider_OfServerCapabilities; @@ -2620,12 +2618,12 @@ package body LSP.Outputs is Value : LSP.Structures.declarationProvider_OfServerCapabilities) is begin case Value.Kind is - when LSP.Structures.Varian_1 => - Handler.Boolean_Value (Value.Varian_1); - when LSP.Structures.Varian_2 => - Write_DeclarationOptions (Handler, Value.Varian_2); - when LSP.Structures.Varian_3 => - Write_DeclarationRegistrationOptions (Handler, Value.Varian_3); + when LSP.Structures.Variant_1 => + Handler.Boolean_Value (Value.Variant_1); + when LSP.Structures.Variant_2 => + Write_DeclarationOptions (Handler, Value.Variant_2); + when LSP.Structures.Variant_3 => + Write_DeclarationRegistrationOptions (Handler, Value.Variant_3); end case; end Write_declarationProvider_OfServerCapabilities; @@ -2634,13 +2632,13 @@ package body LSP.Outputs is Value : LSP.Structures.callHierarchyProvider_OfServerCapabilities) is begin case Value.Kind is - when LSP.Structures.Varian_1 => - Handler.Boolean_Value (Value.Varian_1); - when LSP.Structures.Varian_2 => - Write_CallHierarchyOptions (Handler, Value.Varian_2); - when LSP.Structures.Varian_3 => + when LSP.Structures.Variant_1 => + Handler.Boolean_Value (Value.Variant_1); + when LSP.Structures.Variant_2 => + Write_CallHierarchyOptions (Handler, Value.Variant_2); + when LSP.Structures.Variant_3 => Write_CallHierarchyRegistrationOptions - (Handler, Value.Varian_3); + (Handler, Value.Variant_3); end case; end Write_callHierarchyProvider_OfServerCapabilities; @@ -2678,13 +2676,13 @@ package body LSP.Outputs is .linkedEditingRangeProvider_OfServerCapabilities) is begin case Value.Kind is - when LSP.Structures.Varian_1 => - Handler.Boolean_Value (Value.Varian_1); - when LSP.Structures.Varian_2 => - Write_LinkedEditingRangeOptions (Handler, Value.Varian_2); - when LSP.Structures.Varian_3 => + when LSP.Structures.Variant_1 => + Handler.Boolean_Value (Value.Variant_1); + when LSP.Structures.Variant_2 => + Write_LinkedEditingRangeOptions (Handler, Value.Variant_2); + when LSP.Structures.Variant_3 => Write_LinkedEditingRangeRegistrationOptions - (Handler, Value.Varian_3); + (Handler, Value.Variant_3); end case; end Write_linkedEditingRangeProvider_OfServerCapabilities; @@ -2718,12 +2716,13 @@ package body LSP.Outputs is Value : LSP.Structures.foldingRangeProvider_OfServerCapabilities) is begin case Value.Kind is - when LSP.Structures.Varian_1 => - Handler.Boolean_Value (Value.Varian_1); - when LSP.Structures.Varian_2 => - Write_FoldingRangeOptions (Handler, Value.Varian_2); - when LSP.Structures.Varian_3 => - Write_FoldingRangeRegistrationOptions (Handler, Value.Varian_3); + when LSP.Structures.Variant_1 => + Handler.Boolean_Value (Value.Variant_1); + when LSP.Structures.Variant_2 => + Write_FoldingRangeOptions (Handler, Value.Variant_2); + when LSP.Structures.Variant_3 => + Write_FoldingRangeRegistrationOptions + (Handler, Value.Variant_3); end case; end Write_foldingRangeProvider_OfServerCapabilities; @@ -2732,13 +2731,13 @@ package body LSP.Outputs is Value : LSP.Structures.typeDefinitionProvider_OfServerCapabilities) is begin case Value.Kind is - when LSP.Structures.Varian_1 => - Handler.Boolean_Value (Value.Varian_1); - when LSP.Structures.Varian_2 => - Write_TypeDefinitionOptions (Handler, Value.Varian_2); - when LSP.Structures.Varian_3 => + when LSP.Structures.Variant_1 => + Handler.Boolean_Value (Value.Variant_1); + when LSP.Structures.Variant_2 => + Write_TypeDefinitionOptions (Handler, Value.Variant_2); + when LSP.Structures.Variant_3 => Write_TypeDefinitionRegistrationOptions - (Handler, Value.Varian_3); + (Handler, Value.Variant_3); end case; end Write_typeDefinitionProvider_OfServerCapabilities; @@ -2747,12 +2746,12 @@ package body LSP.Outputs is Value : LSP.Structures.inlineValueProvider_OfServerCapabilities) is begin case Value.Kind is - when LSP.Structures.Varian_1 => - Handler.Boolean_Value (Value.Varian_1); - when LSP.Structures.Varian_2 => - Write_InlineValueOptions (Handler, Value.Varian_2); - when LSP.Structures.Varian_3 => - Write_InlineValueRegistrationOptions (Handler, Value.Varian_3); + when LSP.Structures.Variant_1 => + Handler.Boolean_Value (Value.Variant_1); + when LSP.Structures.Variant_2 => + Write_InlineValueOptions (Handler, Value.Variant_2); + when LSP.Structures.Variant_3 => + Write_InlineValueRegistrationOptions (Handler, Value.Variant_3); end case; end Write_inlineValueProvider_OfServerCapabilities; @@ -2761,13 +2760,13 @@ package body LSP.Outputs is Value : LSP.Structures.colorProvider_OfServerCapabilities) is begin case Value.Kind is - when LSP.Structures.Varian_1 => - Handler.Boolean_Value (Value.Varian_1); - when LSP.Structures.Varian_2 => - Write_DocumentColorOptions (Handler, Value.Varian_2); - when LSP.Structures.Varian_3 => + when LSP.Structures.Variant_1 => + Handler.Boolean_Value (Value.Variant_1); + when LSP.Structures.Variant_2 => + Write_DocumentColorOptions (Handler, Value.Variant_2); + when LSP.Structures.Variant_3 => Write_DocumentColorRegistrationOptions - (Handler, Value.Varian_3); + (Handler, Value.Variant_3); end case; end Write_colorProvider_OfServerCapabilities; @@ -4027,12 +4026,12 @@ package body LSP.Outputs is begin case Value.Kind is - when LSP.Structures.Varian_1 => - Write_A_Range (Handler, Value.Varian_1); - when LSP.Structures.Varian_2 => - Write_PrepareRenameResult_2 (Handler, Value.Varian_2); - when LSP.Structures.Varian_3 => - Write_PrepareRenameResult_3 (Handler, Value.Varian_3); + when LSP.Structures.Variant_1 => + Write_A_Range (Handler, Value.Variant_1); + when LSP.Structures.Variant_2 => + Write_PrepareRenameResult_2 (Handler, Value.Variant_2); + when LSP.Structures.Variant_3 => + Write_PrepareRenameResult_3 (Handler, Value.Variant_3); end case; end Write_PrepareRenameResult; @@ -4179,10 +4178,10 @@ package body LSP.Outputs is Value : LSP.Structures.Declaration_Progress_Report) is begin case Value.Kind is - when LSP.Structures.Varian_1 => - Write_Location_Vector (Handler, Value.Varian_1); - when LSP.Structures.Varian_2 => - Write_DeclarationLink_Vector (Handler, Value.Varian_2); + when LSP.Structures.Variant_1 => + Write_Location_Vector (Handler, Value.Variant_1); + when LSP.Structures.Variant_2 => + Write_DeclarationLink_Vector (Handler, Value.Variant_2); end case; end Write_Declaration_Progress_Report; @@ -6598,11 +6597,11 @@ package body LSP.Outputs is Value : LSP.Structures.Tokens_Delta_Result) is begin case Value.Kind is - when LSP.Structures.Varian_1 => - Write_SemanticTokens (Handler, Value.Varian_1); - when LSP.Structures.Varian_2 => - Write_SemanticTokensDelta (Handler, Value.Varian_2); - when LSP.Structures.Varian_3 => + when LSP.Structures.Variant_1 => + Write_SemanticTokens (Handler, Value.Variant_1); + when LSP.Structures.Variant_2 => + Write_SemanticTokensDelta (Handler, Value.Variant_2); + when LSP.Structures.Variant_3 => Handler.Null_Value; end case; end Write_Tokens_Delta_Result; @@ -6779,10 +6778,10 @@ package body LSP.Outputs is Value : LSP.Structures.Symbol_Progress_Report) is begin case Value.Kind is - when LSP.Structures.Varian_1 => - Write_SymbolInformation_Vector (Handler, Value.Varian_1); - when LSP.Structures.Varian_2 => - Write_WorkspaceSymbol_Vector (Handler, Value.Varian_2); + when LSP.Structures.Variant_1 => + Write_SymbolInformation_Vector (Handler, Value.Variant_1); + when LSP.Structures.Variant_2 => + Write_WorkspaceSymbol_Vector (Handler, Value.Variant_2); end case; end Write_Symbol_Progress_Report; @@ -6956,11 +6955,11 @@ package body LSP.Outputs is Value : LSP.Structures.Completion_Result) is begin case Value.Kind is - when LSP.Structures.Varian_1 => - Write_CompletionItem_Vector (Handler, Value.Varian_1); - when LSP.Structures.Varian_2 => - Write_CompletionList (Handler, Value.Varian_2); - when LSP.Structures.Varian_3 => + when LSP.Structures.Variant_1 => + Write_CompletionItem_Vector (Handler, Value.Variant_1); + when LSP.Structures.Variant_2 => + Write_CompletionList (Handler, Value.Variant_2); + when LSP.Structures.Variant_3 => Handler.Null_Value; end case; end Write_Completion_Result; @@ -6982,12 +6981,12 @@ package body LSP.Outputs is Value : LSP.Structures.InlineValue) is begin case Value.Kind is - when LSP.Structures.Varian_1 => - Write_InlineValueText (Handler, Value.Varian_1); - when LSP.Structures.Varian_2 => - Write_InlineValueVariableLookup (Handler, Value.Varian_2); - when LSP.Structures.Varian_3 => - Write_InlineValueEvaluatableExpression (Handler, Value.Varian_3); + when LSP.Structures.Variant_1 => + Write_InlineValueText (Handler, Value.Variant_1); + when LSP.Structures.Variant_2 => + Write_InlineValueVariableLookup (Handler, Value.Variant_2); + when LSP.Structures.Variant_3 => + Write_InlineValueEvaluatableExpression (Handler, Value.Variant_3); end case; end Write_InlineValue; @@ -7238,11 +7237,11 @@ package body LSP.Outputs is Value : LSP.Structures.Symbol_Result) is begin case Value.Kind is - when LSP.Structures.Varian_1 => - Write_SymbolInformation_Vector (Handler, Value.Varian_1); - when LSP.Structures.Varian_2 => - Write_WorkspaceSymbol_Vector (Handler, Value.Varian_2); - when LSP.Structures.Varian_3 => + when LSP.Structures.Variant_1 => + Write_SymbolInformation_Vector (Handler, Value.Variant_1); + when LSP.Structures.Variant_2 => + Write_WorkspaceSymbol_Vector (Handler, Value.Variant_2); + when LSP.Structures.Variant_3 => Handler.Null_Value; end case; end Write_Symbol_Result; @@ -7942,8 +7941,8 @@ package body LSP.Outputs is Value : LSP.Structures.documentChanges_OfWorkspaceEdit_Item) is begin case Value.Kind is - when LSP.Structures.Varian_1 => - Write_TextDocumentEdit (Handler, Value.Varian_1); + when LSP.Structures.Variant_1 => + Write_TextDocumentEdit (Handler, Value.Variant_1); when LSP.Structures.create => Write_CreateFile (Handler, Value.create); when LSP.Structures.rename => @@ -9845,11 +9844,11 @@ package body LSP.Outputs is Value : LSP.Structures.DocumentSymbol_Result) is begin case Value.Kind is - when LSP.Structures.Varian_1 => - Write_SymbolInformation_Vector (Handler, Value.Varian_1); - when LSP.Structures.Varian_2 => - Write_DocumentSymbol_Vector (Handler, Value.Varian_2); - when LSP.Structures.Varian_3 => + when LSP.Structures.Variant_1 => + Write_SymbolInformation_Vector (Handler, Value.Variant_1); + when LSP.Structures.Variant_2 => + Write_DocumentSymbol_Vector (Handler, Value.Variant_2); + when LSP.Structures.Variant_3 => Handler.Null_Value; end case; end Write_DocumentSymbol_Result; @@ -9974,11 +9973,11 @@ package body LSP.Outputs is Value : LSP.Structures.Definition_Result) is begin case Value.Kind is - when LSP.Structures.Varian_1 => - Write_Definition (Handler, Value.Varian_1); - when LSP.Structures.Varian_2 => - Write_DefinitionLink_Vector (Handler, Value.Varian_2); - when LSP.Structures.Varian_3 => + when LSP.Structures.Variant_1 => + Write_Definition (Handler, Value.Variant_1); + when LSP.Structures.Variant_2 => + Write_DefinitionLink_Vector (Handler, Value.Variant_2); + when LSP.Structures.Variant_3 => Handler.Null_Value; end case; end Write_Definition_Result; diff --git a/source/lsp_3.17/generated/lsp-outputs.ads b/source/lsp_3.17/generated/lsp-outputs.ads index 40139db80..830092259 100644 --- a/source/lsp_3.17/generated/lsp-outputs.ads +++ b/source/lsp_3.17/generated/lsp-outputs.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with VSS.JSON.Content_Handlers; @@ -112,6 +114,10 @@ package LSP.Outputs is (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; Value : LSP.Structures.WorkDoneProgressCancelParams); + procedure Write_ProgressToken + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.ProgressToken); + procedure Write_DidChangeWatchedFilesParams (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; Value : LSP.Structures.DidChangeWatchedFilesParams); diff --git a/source/lsp_3.17/generated/lsp-progress_report_readers.adb b/source/lsp_3.17/generated/lsp-progress_report_readers.adb index c716a3896..c336afdab 100644 --- a/source/lsp_3.17/generated/lsp-progress_report_readers.adb +++ b/source/lsp_3.17/generated/lsp-progress_report_readers.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with Minimal_Perfect_Hash; with LSP.Inputs; @@ -44,36 +46,36 @@ with LSP.Progress_Reports.ProgressEnd; package body LSP.Progress_Report_Readers is package Method_Map is new Minimal_Perfect_Hash (["callHierarchy/incomingCalls", - "callHierarchy/outgoingCalls", - "textDocument/codeAction", - "textDocument/codeLens", - "textDocument/colorPresentation", - "textDocument/completion", - "textDocument/declaration", - "textDocument/definition", - "textDocument/diagnostic", - "textDocument/documentColor", - "textDocument/documentHighlight", - "textDocument/documentLink", - "textDocument/documentSymbol", - "textDocument/foldingRange", - "textDocument/implementation", - "textDocument/inlayHint", - "textDocument/inlineValue", - "textDocument/moniker", - "textDocument/references", - "textDocument/selectionRange", - "textDocument/semanticTokens/full", - "textDocument/semanticTokens/full/delta", - "textDocument/semanticTokens/range", - "textDocument/typeDefinition", - "typeHierarchy/subtypes", - "typeHierarchy/supertypes", - "workspace/diagnostic", - "workspace/symbol", - "WorkDoneProgressBegin", - "WorkDoneProgressReport", - "WorkDoneProgressEnd"]); + "callHierarchy/outgoingCalls", + "textDocument/codeAction", + "textDocument/codeLens", + "textDocument/colorPresentation", + "textDocument/completion", + "textDocument/declaration", + "textDocument/definition", + "textDocument/diagnostic", + "textDocument/documentColor", + "textDocument/documentHighlight", + "textDocument/documentLink", + "textDocument/documentSymbol", + "textDocument/foldingRange", + "textDocument/implementation", + "textDocument/inlayHint", + "textDocument/inlineValue", + "textDocument/moniker", + "textDocument/references", + "textDocument/selectionRange", + "textDocument/semanticTokens/full", + "textDocument/semanticTokens/full/delta", + "textDocument/semanticTokens/range", + "textDocument/typeDefinition", + "typeHierarchy/subtypes", + "typeHierarchy/supertypes", + "workspace/diagnostic", + "workspace/symbol", + "WorkDoneProgressBegin", + "WorkDoneProgressReport", + "WorkDoneProgressEnd"]); procedure Initialize is begin diff --git a/source/lsp_3.17/generated/lsp-progress_report_receivers.ads b/source/lsp_3.17/generated/lsp-progress_report_receivers.ads index 70a4b6112..aba65a525 100644 --- a/source/lsp_3.17/generated/lsp-progress_report_receivers.ads +++ b/source/lsp_3.17/generated/lsp-progress_report_receivers.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; @@ -13,7 +15,7 @@ package LSP.Progress_Report_Receivers is procedure On_IncomingCalls_Partial_Result (Self : in out Progress_Report_Receiver; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.CallHierarchyIncomingCall_Vector) is null; -- A request to resolve the incoming calls for a given `CallHierarchyItem`. -- @@ -21,7 +23,7 @@ package LSP.Progress_Report_Receivers is procedure On_OutgoingCalls_Partial_Result (Self : in out Progress_Report_Receiver; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.CallHierarchyOutgoingCall_Vector) is null; -- A request to resolve the outgoing calls for a given `CallHierarchyItem`. -- @@ -29,19 +31,19 @@ package LSP.Progress_Report_Receivers is procedure On_CodeAction_Partial_Result (Self : in out Progress_Report_Receiver; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.Command_Or_CodeAction_Vector) is null; -- A request to provide commands for the given text document and range. procedure On_CodeLens_Partial_Result (Self : in out Progress_Report_Receiver; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.CodeLens_Vector) is null; -- A request to provide code lens for the given text document. procedure On_ColorPresentation_Partial_Result (Self : in out Progress_Report_Receiver; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.ColorPresentation_Vector) is null; -- A request to list all presentation for a color. The request's parameter -- is of type [ColorPresentationParams](#ColorPresentationParams) the @@ -50,7 +52,7 @@ package LSP.Progress_Report_Receivers is procedure On_Completion_Partial_Result (Self : in out Progress_Report_Receiver; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.CompletionItem_Vector) is null; -- Request to request completion at a given text -- document position. The request's parameter is of type @@ -67,7 +69,7 @@ package LSP.Progress_Report_Receivers is procedure On_Declaration_Partial_Result (Self : in out Progress_Report_Receiver; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.Declaration_Progress_Report) is null; -- A request to resolve the type definition locations of a symbol at -- a given text document position. The request's parameter is of type @@ -77,7 +79,7 @@ package LSP.Progress_Report_Receivers is procedure On_Definition_Partial_Result (Self : in out Progress_Report_Receiver; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.Definition_Progress_Report) is null; -- A request to resolve the definition location of a symbol at a -- given text document position. The request's parameter is of type @@ -87,7 +89,7 @@ package LSP.Progress_Report_Receivers is procedure On_Diagnostic_Partial_Result (Self : in out Progress_Report_Receiver; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.DocumentDiagnosticReportPartialResult) is null; -- The document diagnostic request definition. -- @@ -95,7 +97,7 @@ package LSP.Progress_Report_Receivers is procedure On_DocumentColor_Partial_Result (Self : in out Progress_Report_Receiver; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.ColorInformation_Vector) is null; -- A request to list all color symbols found in a given -- text document. The request's parameter is of type @@ -105,7 +107,7 @@ package LSP.Progress_Report_Receivers is procedure On_DocumentHighlight_Partial_Result (Self : in out Progress_Report_Receiver; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.DocumentHighlight_Vector) is null; -- Request to resolve a [DocumentHighlight](#DocumentHighlight) for -- a given text document position. The request's parameter is of type @@ -115,13 +117,13 @@ package LSP.Progress_Report_Receivers is procedure On_DocumentLink_Partial_Result (Self : in out Progress_Report_Receiver; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.DocumentLink_Vector) is null; -- A request to provide document links procedure On_DocumentSymbol_Partial_Result (Self : in out Progress_Report_Receiver; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.DocumentSymbol_Progress_Report) is null; -- A request to list all symbols found in a given -- text document. The request's parameter is of type @@ -131,7 +133,7 @@ package LSP.Progress_Report_Receivers is procedure On_FoldingRange_Partial_Result (Self : in out Progress_Report_Receiver; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.FoldingRange_Vector) is null; -- A request to provide folding ranges in a document. The request's -- parameter is of type [FoldingRangeParams](#FoldingRangeParams), the @@ -140,7 +142,7 @@ package LSP.Progress_Report_Receivers is procedure On_Implementation_Partial_Result (Self : in out Progress_Report_Receiver; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.Definition_Progress_Report) is null; -- A request to resolve the implementation locations of a symbol at -- a given text document position. The request's parameter is of type @@ -150,7 +152,7 @@ package LSP.Progress_Report_Receivers is procedure On_InlayHint_Partial_Result (Self : in out Progress_Report_Receiver; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.InlayHint_Vector) is null; -- A request to provide inlay hints in a document. The request's parameter -- is of type [InlayHintsParams](#InlayHintsParams), the response is of @@ -160,7 +162,7 @@ package LSP.Progress_Report_Receivers is procedure On_InlineValue_Partial_Result (Self : in out Progress_Report_Receiver; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.InlineValue_Vector) is null; -- A request to provide inline values in a document. The request's -- parameter is of type [InlineValueParams](#InlineValueParams), the @@ -171,7 +173,7 @@ package LSP.Progress_Report_Receivers is procedure On_Moniker_Partial_Result (Self : in out Progress_Report_Receiver; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.Moniker_Vector) is null; -- A request to get the moniker of a symbol at a given -- text document position. The request parameter is of type @@ -180,7 +182,7 @@ package LSP.Progress_Report_Receivers is procedure On_References_Partial_Result (Self : in out Progress_Report_Receiver; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.Location_Vector) is null; -- A request to resolve project-wide references for the symbol denoted -- by the given text document position. The request's parameter is of @@ -189,7 +191,7 @@ package LSP.Progress_Report_Receivers is procedure On_SelectionRange_Partial_Result (Self : in out Progress_Report_Receiver; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.SelectionRange_Vector) is null; -- A request to provide selection ranges in a document. The request's -- parameter is of type [SelectionRangeParams](#SelectionRangeParams), the @@ -198,26 +200,26 @@ package LSP.Progress_Report_Receivers is procedure On_Full_Partial_Result (Self : in out Progress_Report_Receiver; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.SemanticTokensPartialResult) is null; -- @since 3.16.0 procedure On_Tokens_Delta_Partial_Result (Self : in out Progress_Report_Receiver; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures .SemanticTokensPartialResult_Or_SemanticTokensDeltaPartialResult) is null; -- @since 3.16.0 procedure On_Tokens_Range_Partial_Result (Self : in out Progress_Report_Receiver; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.SemanticTokensPartialResult) is null; -- @since 3.16.0 procedure On_TypeDefinition_Partial_Result (Self : in out Progress_Report_Receiver; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.Definition_Progress_Report) is null; -- A request to resolve the type definition locations of a symbol at -- a given text document position. The request's parameter is of type @@ -227,7 +229,7 @@ package LSP.Progress_Report_Receivers is procedure On_Subtypes_Partial_Result (Self : in out Progress_Report_Receiver; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.TypeHierarchyItem_Vector) is null; -- A request to resolve the subtypes for a given `TypeHierarchyItem`. -- @@ -235,7 +237,7 @@ package LSP.Progress_Report_Receivers is procedure On_Supertypes_Partial_Result (Self : in out Progress_Report_Receiver; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.TypeHierarchyItem_Vector) is null; -- A request to resolve the supertypes for a given `TypeHierarchyItem`. -- @@ -243,7 +245,7 @@ package LSP.Progress_Report_Receivers is procedure On_Workspace_Diagnostic_Partial_Result (Self : in out Progress_Report_Receiver; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.WorkspaceDiagnosticReportPartialResult) is null; -- The workspace diagnostic request definition. -- @@ -251,7 +253,7 @@ package LSP.Progress_Report_Receivers is procedure On_Symbol_Partial_Result (Self : in out Progress_Report_Receiver; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.Symbol_Progress_Report) is null; -- A request to list project-wide symbols matching the query string given -- by the [WorkspaceSymbolParams](#WorkspaceSymbolParams). The response @@ -265,17 +267,17 @@ package LSP.Progress_Report_Receivers is procedure On_ProgressBegin_Work_Done (Self : in out Progress_Report_Receiver; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.WorkDoneProgressBegin) is null; procedure On_ProgressReport_Work_Done (Self : in out Progress_Report_Receiver; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.WorkDoneProgressReport) is null; procedure On_ProgressEnd_Work_Done (Self : in out Progress_Report_Receiver; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.WorkDoneProgressEnd) is null; end LSP.Progress_Report_Receivers; diff --git a/source/lsp_3.17/generated/lsp-progress_report_writers.adb b/source/lsp_3.17/generated/lsp-progress_report_writers.adb index 691bc407a..6cdf7f9fd 100644 --- a/source/lsp_3.17/generated/lsp-progress_report_writers.adb +++ b/source/lsp_3.17/generated/lsp-progress_report_writers.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Output_Tools; with LSP.Outputs; @@ -11,7 +13,7 @@ package body LSP.Progress_Report_Writers is overriding procedure On_IncomingCalls_Partial_Result (Self : in out Progress_Report_Writer; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.CallHierarchyIncomingCall_Vector) is begin LSP.Output_Tools.Write_Start_Progress_Report (Self.Output.all, Token); @@ -23,7 +25,7 @@ package body LSP.Progress_Report_Writers is overriding procedure On_OutgoingCalls_Partial_Result (Self : in out Progress_Report_Writer; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.CallHierarchyOutgoingCall_Vector) is begin LSP.Output_Tools.Write_Start_Progress_Report (Self.Output.all, Token); @@ -35,7 +37,7 @@ package body LSP.Progress_Report_Writers is overriding procedure On_CodeAction_Partial_Result (Self : in out Progress_Report_Writer; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.Command_Or_CodeAction_Vector) is begin LSP.Output_Tools.Write_Start_Progress_Report (Self.Output.all, Token); @@ -46,7 +48,7 @@ package body LSP.Progress_Report_Writers is overriding procedure On_CodeLens_Partial_Result (Self : in out Progress_Report_Writer; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.CodeLens_Vector) is begin LSP.Output_Tools.Write_Start_Progress_Report (Self.Output.all, Token); @@ -57,7 +59,7 @@ package body LSP.Progress_Report_Writers is overriding procedure On_ColorPresentation_Partial_Result (Self : in out Progress_Report_Writer; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.ColorPresentation_Vector) is begin LSP.Output_Tools.Write_Start_Progress_Report (Self.Output.all, Token); @@ -68,7 +70,7 @@ package body LSP.Progress_Report_Writers is overriding procedure On_Completion_Partial_Result (Self : in out Progress_Report_Writer; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.CompletionItem_Vector) is begin LSP.Output_Tools.Write_Start_Progress_Report (Self.Output.all, Token); @@ -79,7 +81,7 @@ package body LSP.Progress_Report_Writers is overriding procedure On_Declaration_Partial_Result (Self : in out Progress_Report_Writer; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.Declaration_Progress_Report) is begin LSP.Output_Tools.Write_Start_Progress_Report (Self.Output.all, Token); @@ -90,7 +92,7 @@ package body LSP.Progress_Report_Writers is overriding procedure On_Definition_Partial_Result (Self : in out Progress_Report_Writer; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.Definition_Progress_Report) is begin LSP.Output_Tools.Write_Start_Progress_Report (Self.Output.all, Token); @@ -101,7 +103,7 @@ package body LSP.Progress_Report_Writers is overriding procedure On_Diagnostic_Partial_Result (Self : in out Progress_Report_Writer; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.DocumentDiagnosticReportPartialResult) is begin LSP.Output_Tools.Write_Start_Progress_Report (Self.Output.all, Token); @@ -113,7 +115,7 @@ package body LSP.Progress_Report_Writers is overriding procedure On_DocumentColor_Partial_Result (Self : in out Progress_Report_Writer; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.ColorInformation_Vector) is begin LSP.Output_Tools.Write_Start_Progress_Report (Self.Output.all, Token); @@ -124,7 +126,7 @@ package body LSP.Progress_Report_Writers is overriding procedure On_DocumentHighlight_Partial_Result (Self : in out Progress_Report_Writer; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.DocumentHighlight_Vector) is begin LSP.Output_Tools.Write_Start_Progress_Report (Self.Output.all, Token); @@ -135,7 +137,7 @@ package body LSP.Progress_Report_Writers is overriding procedure On_DocumentLink_Partial_Result (Self : in out Progress_Report_Writer; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.DocumentLink_Vector) is begin LSP.Output_Tools.Write_Start_Progress_Report (Self.Output.all, Token); @@ -146,7 +148,7 @@ package body LSP.Progress_Report_Writers is overriding procedure On_DocumentSymbol_Partial_Result (Self : in out Progress_Report_Writer; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.DocumentSymbol_Progress_Report) is begin LSP.Output_Tools.Write_Start_Progress_Report (Self.Output.all, Token); @@ -158,7 +160,7 @@ package body LSP.Progress_Report_Writers is overriding procedure On_FoldingRange_Partial_Result (Self : in out Progress_Report_Writer; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.FoldingRange_Vector) is begin LSP.Output_Tools.Write_Start_Progress_Report (Self.Output.all, Token); @@ -169,7 +171,7 @@ package body LSP.Progress_Report_Writers is overriding procedure On_Implementation_Partial_Result (Self : in out Progress_Report_Writer; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.Definition_Progress_Report) is begin LSP.Output_Tools.Write_Start_Progress_Report (Self.Output.all, Token); @@ -180,7 +182,7 @@ package body LSP.Progress_Report_Writers is overriding procedure On_InlayHint_Partial_Result (Self : in out Progress_Report_Writer; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.InlayHint_Vector) is begin LSP.Output_Tools.Write_Start_Progress_Report (Self.Output.all, Token); @@ -191,7 +193,7 @@ package body LSP.Progress_Report_Writers is overriding procedure On_InlineValue_Partial_Result (Self : in out Progress_Report_Writer; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.InlineValue_Vector) is begin LSP.Output_Tools.Write_Start_Progress_Report (Self.Output.all, Token); @@ -202,7 +204,7 @@ package body LSP.Progress_Report_Writers is overriding procedure On_Moniker_Partial_Result (Self : in out Progress_Report_Writer; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.Moniker_Vector) is begin LSP.Output_Tools.Write_Start_Progress_Report (Self.Output.all, Token); @@ -213,7 +215,7 @@ package body LSP.Progress_Report_Writers is overriding procedure On_References_Partial_Result (Self : in out Progress_Report_Writer; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.Location_Vector) is begin LSP.Output_Tools.Write_Start_Progress_Report (Self.Output.all, Token); @@ -224,7 +226,7 @@ package body LSP.Progress_Report_Writers is overriding procedure On_SelectionRange_Partial_Result (Self : in out Progress_Report_Writer; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.SelectionRange_Vector) is begin LSP.Output_Tools.Write_Start_Progress_Report (Self.Output.all, Token); @@ -235,7 +237,7 @@ package body LSP.Progress_Report_Writers is overriding procedure On_Full_Partial_Result (Self : in out Progress_Report_Writer; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.SemanticTokensPartialResult) is begin LSP.Output_Tools.Write_Start_Progress_Report (Self.Output.all, Token); @@ -246,7 +248,7 @@ package body LSP.Progress_Report_Writers is overriding procedure On_Tokens_Delta_Partial_Result (Self : in out Progress_Report_Writer; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures .SemanticTokensPartialResult_Or_SemanticTokensDeltaPartialResult) is begin @@ -260,7 +262,7 @@ package body LSP.Progress_Report_Writers is overriding procedure On_Tokens_Range_Partial_Result (Self : in out Progress_Report_Writer; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.SemanticTokensPartialResult) is begin LSP.Output_Tools.Write_Start_Progress_Report (Self.Output.all, Token); @@ -271,7 +273,7 @@ package body LSP.Progress_Report_Writers is overriding procedure On_TypeDefinition_Partial_Result (Self : in out Progress_Report_Writer; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.Definition_Progress_Report) is begin LSP.Output_Tools.Write_Start_Progress_Report (Self.Output.all, Token); @@ -282,7 +284,7 @@ package body LSP.Progress_Report_Writers is overriding procedure On_Subtypes_Partial_Result (Self : in out Progress_Report_Writer; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.TypeHierarchyItem_Vector) is begin LSP.Output_Tools.Write_Start_Progress_Report (Self.Output.all, Token); @@ -293,7 +295,7 @@ package body LSP.Progress_Report_Writers is overriding procedure On_Supertypes_Partial_Result (Self : in out Progress_Report_Writer; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.TypeHierarchyItem_Vector) is begin LSP.Output_Tools.Write_Start_Progress_Report (Self.Output.all, Token); @@ -304,7 +306,7 @@ package body LSP.Progress_Report_Writers is overriding procedure On_Workspace_Diagnostic_Partial_Result (Self : in out Progress_Report_Writer; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.WorkspaceDiagnosticReportPartialResult) is begin LSP.Output_Tools.Write_Start_Progress_Report (Self.Output.all, Token); @@ -316,7 +318,7 @@ package body LSP.Progress_Report_Writers is overriding procedure On_Symbol_Partial_Result (Self : in out Progress_Report_Writer; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.Symbol_Progress_Report) is begin LSP.Output_Tools.Write_Start_Progress_Report (Self.Output.all, Token); @@ -327,7 +329,7 @@ package body LSP.Progress_Report_Writers is overriding procedure On_ProgressBegin_Work_Done (Self : in out Progress_Report_Writer; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.WorkDoneProgressBegin) is begin LSP.Output_Tools.Write_Start_Progress_Report (Self.Output.all, Token); @@ -338,7 +340,7 @@ package body LSP.Progress_Report_Writers is overriding procedure On_ProgressReport_Work_Done (Self : in out Progress_Report_Writer; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.WorkDoneProgressReport) is begin LSP.Output_Tools.Write_Start_Progress_Report (Self.Output.all, Token); @@ -349,7 +351,7 @@ package body LSP.Progress_Report_Writers is overriding procedure On_ProgressEnd_Work_Done (Self : in out Progress_Report_Writer; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.WorkDoneProgressEnd) is begin LSP.Output_Tools.Write_Start_Progress_Report (Self.Output.all, Token); diff --git a/source/lsp_3.17/generated/lsp-progress_report_writers.ads b/source/lsp_3.17/generated/lsp-progress_report_writers.ads index 8109874fe..eeda8f9f0 100644 --- a/source/lsp_3.17/generated/lsp-progress_report_writers.ads +++ b/source/lsp_3.17/generated/lsp-progress_report_writers.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; with VSS.JSON.Content_Handlers; @@ -17,158 +19,158 @@ package LSP.Progress_Report_Writers is overriding procedure On_IncomingCalls_Partial_Result (Self : in out Progress_Report_Writer; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.CallHierarchyIncomingCall_Vector); overriding procedure On_OutgoingCalls_Partial_Result (Self : in out Progress_Report_Writer; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.CallHierarchyOutgoingCall_Vector); overriding procedure On_CodeAction_Partial_Result (Self : in out Progress_Report_Writer; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.Command_Or_CodeAction_Vector); overriding procedure On_CodeLens_Partial_Result (Self : in out Progress_Report_Writer; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.CodeLens_Vector); overriding procedure On_ColorPresentation_Partial_Result (Self : in out Progress_Report_Writer; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.ColorPresentation_Vector); overriding procedure On_Completion_Partial_Result (Self : in out Progress_Report_Writer; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.CompletionItem_Vector); overriding procedure On_Declaration_Partial_Result (Self : in out Progress_Report_Writer; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.Declaration_Progress_Report); overriding procedure On_Definition_Partial_Result (Self : in out Progress_Report_Writer; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.Definition_Progress_Report); overriding procedure On_Diagnostic_Partial_Result (Self : in out Progress_Report_Writer; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.DocumentDiagnosticReportPartialResult); overriding procedure On_DocumentColor_Partial_Result (Self : in out Progress_Report_Writer; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.ColorInformation_Vector); overriding procedure On_DocumentHighlight_Partial_Result (Self : in out Progress_Report_Writer; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.DocumentHighlight_Vector); overriding procedure On_DocumentLink_Partial_Result (Self : in out Progress_Report_Writer; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.DocumentLink_Vector); overriding procedure On_DocumentSymbol_Partial_Result (Self : in out Progress_Report_Writer; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.DocumentSymbol_Progress_Report); overriding procedure On_FoldingRange_Partial_Result (Self : in out Progress_Report_Writer; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.FoldingRange_Vector); overriding procedure On_Implementation_Partial_Result (Self : in out Progress_Report_Writer; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.Definition_Progress_Report); overriding procedure On_InlayHint_Partial_Result (Self : in out Progress_Report_Writer; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.InlayHint_Vector); overriding procedure On_InlineValue_Partial_Result (Self : in out Progress_Report_Writer; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.InlineValue_Vector); overriding procedure On_Moniker_Partial_Result (Self : in out Progress_Report_Writer; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.Moniker_Vector); overriding procedure On_References_Partial_Result (Self : in out Progress_Report_Writer; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.Location_Vector); overriding procedure On_SelectionRange_Partial_Result (Self : in out Progress_Report_Writer; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.SelectionRange_Vector); overriding procedure On_Full_Partial_Result (Self : in out Progress_Report_Writer; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.SemanticTokensPartialResult); overriding procedure On_Tokens_Delta_Partial_Result (Self : in out Progress_Report_Writer; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures .SemanticTokensPartialResult_Or_SemanticTokensDeltaPartialResult); overriding procedure On_Tokens_Range_Partial_Result (Self : in out Progress_Report_Writer; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.SemanticTokensPartialResult); overriding procedure On_TypeDefinition_Partial_Result (Self : in out Progress_Report_Writer; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.Definition_Progress_Report); overriding procedure On_Subtypes_Partial_Result (Self : in out Progress_Report_Writer; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.TypeHierarchyItem_Vector); overriding procedure On_Supertypes_Partial_Result (Self : in out Progress_Report_Writer; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.TypeHierarchyItem_Vector); overriding procedure On_Workspace_Diagnostic_Partial_Result (Self : in out Progress_Report_Writer; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.WorkspaceDiagnosticReportPartialResult); overriding procedure On_Symbol_Partial_Result (Self : in out Progress_Report_Writer; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.Symbol_Progress_Report); overriding procedure On_ProgressBegin_Work_Done (Self : in out Progress_Report_Writer; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.WorkDoneProgressBegin); overriding procedure On_ProgressReport_Work_Done (Self : in out Progress_Report_Writer; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.WorkDoneProgressReport); overriding procedure On_ProgressEnd_Work_Done (Self : in out Progress_Report_Writer; - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; Value : LSP.Structures.WorkDoneProgressEnd); end LSP.Progress_Report_Writers; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-codeaction.adb b/source/lsp_3.17/generated/lsp-progress_reports-codeaction.adb index b9ec353d7..35b9fba84 100644 --- a/source/lsp_3.17/generated/lsp-progress_reports-codeaction.adb +++ b/source/lsp_3.17/generated/lsp-progress_reports-codeaction.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Progress_Reports.CodeAction is diff --git a/source/lsp_3.17/generated/lsp-progress_reports-codeaction.ads b/source/lsp_3.17/generated/lsp-progress_reports-codeaction.ads index 16d2e023a..e8c51f4c3 100644 --- a/source/lsp_3.17/generated/lsp-progress_reports-codeaction.ads +++ b/source/lsp_3.17/generated/lsp-progress_reports-codeaction.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-codelens.adb b/source/lsp_3.17/generated/lsp-progress_reports-codelens.adb index fdedc80ec..af5cb1d3a 100644 --- a/source/lsp_3.17/generated/lsp-progress_reports-codelens.adb +++ b/source/lsp_3.17/generated/lsp-progress_reports-codelens.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Progress_Reports.CodeLens is diff --git a/source/lsp_3.17/generated/lsp-progress_reports-codelens.ads b/source/lsp_3.17/generated/lsp-progress_reports-codelens.ads index 6e4a1e6dd..52fb2b543 100644 --- a/source/lsp_3.17/generated/lsp-progress_reports-codelens.ads +++ b/source/lsp_3.17/generated/lsp-progress_reports-codelens.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-colorpresentation.adb b/source/lsp_3.17/generated/lsp-progress_reports-colorpresentation.adb index cf7322938..ff5e98901 100644 --- a/source/lsp_3.17/generated/lsp-progress_reports-colorpresentation.adb +++ b/source/lsp_3.17/generated/lsp-progress_reports-colorpresentation.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Progress_Reports.ColorPresentation is diff --git a/source/lsp_3.17/generated/lsp-progress_reports-colorpresentation.ads b/source/lsp_3.17/generated/lsp-progress_reports-colorpresentation.ads index 18b27f147..6fa289893 100644 --- a/source/lsp_3.17/generated/lsp-progress_reports-colorpresentation.ads +++ b/source/lsp_3.17/generated/lsp-progress_reports-colorpresentation.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-completion.adb b/source/lsp_3.17/generated/lsp-progress_reports-completion.adb index e7c9d83fa..4aa341854 100644 --- a/source/lsp_3.17/generated/lsp-progress_reports-completion.adb +++ b/source/lsp_3.17/generated/lsp-progress_reports-completion.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Progress_Reports.Completion is diff --git a/source/lsp_3.17/generated/lsp-progress_reports-completion.ads b/source/lsp_3.17/generated/lsp-progress_reports-completion.ads index 316b2258e..e19b92e78 100644 --- a/source/lsp_3.17/generated/lsp-progress_reports-completion.ads +++ b/source/lsp_3.17/generated/lsp-progress_reports-completion.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-declaration.adb b/source/lsp_3.17/generated/lsp-progress_reports-declaration.adb index 85fe87d6b..635bb7c78 100644 --- a/source/lsp_3.17/generated/lsp-progress_reports-declaration.adb +++ b/source/lsp_3.17/generated/lsp-progress_reports-declaration.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Progress_Reports.Declaration is diff --git a/source/lsp_3.17/generated/lsp-progress_reports-declaration.ads b/source/lsp_3.17/generated/lsp-progress_reports-declaration.ads index a17fd4922..9db786af5 100644 --- a/source/lsp_3.17/generated/lsp-progress_reports-declaration.ads +++ b/source/lsp_3.17/generated/lsp-progress_reports-declaration.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-definition.adb b/source/lsp_3.17/generated/lsp-progress_reports-definition.adb index ffc9d17a2..987568928 100644 --- a/source/lsp_3.17/generated/lsp-progress_reports-definition.adb +++ b/source/lsp_3.17/generated/lsp-progress_reports-definition.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Progress_Reports.Definition is diff --git a/source/lsp_3.17/generated/lsp-progress_reports-definition.ads b/source/lsp_3.17/generated/lsp-progress_reports-definition.ads index d7b03ba9b..aeecb185e 100644 --- a/source/lsp_3.17/generated/lsp-progress_reports-definition.ads +++ b/source/lsp_3.17/generated/lsp-progress_reports-definition.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-diagnostic.adb b/source/lsp_3.17/generated/lsp-progress_reports-diagnostic.adb index 31928a348..5caef9816 100644 --- a/source/lsp_3.17/generated/lsp-progress_reports-diagnostic.adb +++ b/source/lsp_3.17/generated/lsp-progress_reports-diagnostic.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Progress_Reports.Diagnostic is diff --git a/source/lsp_3.17/generated/lsp-progress_reports-diagnostic.ads b/source/lsp_3.17/generated/lsp-progress_reports-diagnostic.ads index 3826a4aea..5ce60157a 100644 --- a/source/lsp_3.17/generated/lsp-progress_reports-diagnostic.ads +++ b/source/lsp_3.17/generated/lsp-progress_reports-diagnostic.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-documentcolor.adb b/source/lsp_3.17/generated/lsp-progress_reports-documentcolor.adb index 2c6ce7fba..51289142a 100644 --- a/source/lsp_3.17/generated/lsp-progress_reports-documentcolor.adb +++ b/source/lsp_3.17/generated/lsp-progress_reports-documentcolor.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Progress_Reports.DocumentColor is diff --git a/source/lsp_3.17/generated/lsp-progress_reports-documentcolor.ads b/source/lsp_3.17/generated/lsp-progress_reports-documentcolor.ads index e77102063..705552372 100644 --- a/source/lsp_3.17/generated/lsp-progress_reports-documentcolor.ads +++ b/source/lsp_3.17/generated/lsp-progress_reports-documentcolor.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-documenthighlight.adb b/source/lsp_3.17/generated/lsp-progress_reports-documenthighlight.adb index a979ef88d..1baa51cb6 100644 --- a/source/lsp_3.17/generated/lsp-progress_reports-documenthighlight.adb +++ b/source/lsp_3.17/generated/lsp-progress_reports-documenthighlight.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Progress_Reports.DocumentHighlight is diff --git a/source/lsp_3.17/generated/lsp-progress_reports-documenthighlight.ads b/source/lsp_3.17/generated/lsp-progress_reports-documenthighlight.ads index e0479e335..98000a050 100644 --- a/source/lsp_3.17/generated/lsp-progress_reports-documenthighlight.ads +++ b/source/lsp_3.17/generated/lsp-progress_reports-documenthighlight.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-documentlink.adb b/source/lsp_3.17/generated/lsp-progress_reports-documentlink.adb index beb29da9e..cf3e24858 100644 --- a/source/lsp_3.17/generated/lsp-progress_reports-documentlink.adb +++ b/source/lsp_3.17/generated/lsp-progress_reports-documentlink.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Progress_Reports.DocumentLink is diff --git a/source/lsp_3.17/generated/lsp-progress_reports-documentlink.ads b/source/lsp_3.17/generated/lsp-progress_reports-documentlink.ads index 965ae91b5..3ec5e528d 100644 --- a/source/lsp_3.17/generated/lsp-progress_reports-documentlink.ads +++ b/source/lsp_3.17/generated/lsp-progress_reports-documentlink.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-documentsymbol.adb b/source/lsp_3.17/generated/lsp-progress_reports-documentsymbol.adb index ed9e1766e..310dd9fbe 100644 --- a/source/lsp_3.17/generated/lsp-progress_reports-documentsymbol.adb +++ b/source/lsp_3.17/generated/lsp-progress_reports-documentsymbol.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Progress_Reports.DocumentSymbol is diff --git a/source/lsp_3.17/generated/lsp-progress_reports-documentsymbol.ads b/source/lsp_3.17/generated/lsp-progress_reports-documentsymbol.ads index 55641a52d..acb15947e 100644 --- a/source/lsp_3.17/generated/lsp-progress_reports-documentsymbol.ads +++ b/source/lsp_3.17/generated/lsp-progress_reports-documentsymbol.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-foldingrange.adb b/source/lsp_3.17/generated/lsp-progress_reports-foldingrange.adb index ac4dd30aa..ba21f3a70 100644 --- a/source/lsp_3.17/generated/lsp-progress_reports-foldingrange.adb +++ b/source/lsp_3.17/generated/lsp-progress_reports-foldingrange.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Progress_Reports.FoldingRange is diff --git a/source/lsp_3.17/generated/lsp-progress_reports-foldingrange.ads b/source/lsp_3.17/generated/lsp-progress_reports-foldingrange.ads index 627193da6..b7dc669a6 100644 --- a/source/lsp_3.17/generated/lsp-progress_reports-foldingrange.ads +++ b/source/lsp_3.17/generated/lsp-progress_reports-foldingrange.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-full.adb b/source/lsp_3.17/generated/lsp-progress_reports-full.adb index 54690cadd..4c4777db9 100644 --- a/source/lsp_3.17/generated/lsp-progress_reports-full.adb +++ b/source/lsp_3.17/generated/lsp-progress_reports-full.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Progress_Reports.Full is diff --git a/source/lsp_3.17/generated/lsp-progress_reports-full.ads b/source/lsp_3.17/generated/lsp-progress_reports-full.ads index 01083e886..ea7658df2 100644 --- a/source/lsp_3.17/generated/lsp-progress_reports-full.ads +++ b/source/lsp_3.17/generated/lsp-progress_reports-full.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-implementation.adb b/source/lsp_3.17/generated/lsp-progress_reports-implementation.adb index 7a073a947..25916c90e 100644 --- a/source/lsp_3.17/generated/lsp-progress_reports-implementation.adb +++ b/source/lsp_3.17/generated/lsp-progress_reports-implementation.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Progress_Reports.Implementation is diff --git a/source/lsp_3.17/generated/lsp-progress_reports-implementation.ads b/source/lsp_3.17/generated/lsp-progress_reports-implementation.ads index 613131b03..c0411f16d 100644 --- a/source/lsp_3.17/generated/lsp-progress_reports-implementation.ads +++ b/source/lsp_3.17/generated/lsp-progress_reports-implementation.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-incomingcalls.adb b/source/lsp_3.17/generated/lsp-progress_reports-incomingcalls.adb index 8703418f7..e3e292ca0 100644 --- a/source/lsp_3.17/generated/lsp-progress_reports-incomingcalls.adb +++ b/source/lsp_3.17/generated/lsp-progress_reports-incomingcalls.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Progress_Reports.IncomingCalls is diff --git a/source/lsp_3.17/generated/lsp-progress_reports-incomingcalls.ads b/source/lsp_3.17/generated/lsp-progress_reports-incomingcalls.ads index 3aa76eb46..6ed7a0618 100644 --- a/source/lsp_3.17/generated/lsp-progress_reports-incomingcalls.ads +++ b/source/lsp_3.17/generated/lsp-progress_reports-incomingcalls.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-inlayhint.adb b/source/lsp_3.17/generated/lsp-progress_reports-inlayhint.adb index 8e67f2173..f8171ebbf 100644 --- a/source/lsp_3.17/generated/lsp-progress_reports-inlayhint.adb +++ b/source/lsp_3.17/generated/lsp-progress_reports-inlayhint.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Progress_Reports.InlayHint is diff --git a/source/lsp_3.17/generated/lsp-progress_reports-inlayhint.ads b/source/lsp_3.17/generated/lsp-progress_reports-inlayhint.ads index 3219b77a1..5de85b376 100644 --- a/source/lsp_3.17/generated/lsp-progress_reports-inlayhint.ads +++ b/source/lsp_3.17/generated/lsp-progress_reports-inlayhint.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-inlinevalue.adb b/source/lsp_3.17/generated/lsp-progress_reports-inlinevalue.adb index 51dc51ef0..4ab043933 100644 --- a/source/lsp_3.17/generated/lsp-progress_reports-inlinevalue.adb +++ b/source/lsp_3.17/generated/lsp-progress_reports-inlinevalue.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Progress_Reports.InlineValue is diff --git a/source/lsp_3.17/generated/lsp-progress_reports-inlinevalue.ads b/source/lsp_3.17/generated/lsp-progress_reports-inlinevalue.ads index 8c075682f..e3ec7f0de 100644 --- a/source/lsp_3.17/generated/lsp-progress_reports-inlinevalue.ads +++ b/source/lsp_3.17/generated/lsp-progress_reports-inlinevalue.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-moniker.adb b/source/lsp_3.17/generated/lsp-progress_reports-moniker.adb index da7df72df..ed744ce7d 100644 --- a/source/lsp_3.17/generated/lsp-progress_reports-moniker.adb +++ b/source/lsp_3.17/generated/lsp-progress_reports-moniker.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Progress_Reports.Moniker is diff --git a/source/lsp_3.17/generated/lsp-progress_reports-moniker.ads b/source/lsp_3.17/generated/lsp-progress_reports-moniker.ads index f352ca929..7370f528e 100644 --- a/source/lsp_3.17/generated/lsp-progress_reports-moniker.ads +++ b/source/lsp_3.17/generated/lsp-progress_reports-moniker.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-outgoingcalls.adb b/source/lsp_3.17/generated/lsp-progress_reports-outgoingcalls.adb index ee3c1e931..3abe740b3 100644 --- a/source/lsp_3.17/generated/lsp-progress_reports-outgoingcalls.adb +++ b/source/lsp_3.17/generated/lsp-progress_reports-outgoingcalls.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Progress_Reports.OutgoingCalls is diff --git a/source/lsp_3.17/generated/lsp-progress_reports-outgoingcalls.ads b/source/lsp_3.17/generated/lsp-progress_reports-outgoingcalls.ads index 445fa108f..c9fe4075e 100644 --- a/source/lsp_3.17/generated/lsp-progress_reports-outgoingcalls.ads +++ b/source/lsp_3.17/generated/lsp-progress_reports-outgoingcalls.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-progressbegin.adb b/source/lsp_3.17/generated/lsp-progress_reports-progressbegin.adb index 350bde951..92366cbee 100644 --- a/source/lsp_3.17/generated/lsp-progress_reports-progressbegin.adb +++ b/source/lsp_3.17/generated/lsp-progress_reports-progressbegin.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Progress_Reports.ProgressBegin is diff --git a/source/lsp_3.17/generated/lsp-progress_reports-progressbegin.ads b/source/lsp_3.17/generated/lsp-progress_reports-progressbegin.ads index 1d105f518..6c2786a65 100644 --- a/source/lsp_3.17/generated/lsp-progress_reports-progressbegin.ads +++ b/source/lsp_3.17/generated/lsp-progress_reports-progressbegin.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-progressend.adb b/source/lsp_3.17/generated/lsp-progress_reports-progressend.adb index f4bd31adc..43f7654fc 100644 --- a/source/lsp_3.17/generated/lsp-progress_reports-progressend.adb +++ b/source/lsp_3.17/generated/lsp-progress_reports-progressend.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Progress_Reports.ProgressEnd is diff --git a/source/lsp_3.17/generated/lsp-progress_reports-progressend.ads b/source/lsp_3.17/generated/lsp-progress_reports-progressend.ads index ba854847f..9dbaf1c14 100644 --- a/source/lsp_3.17/generated/lsp-progress_reports-progressend.ads +++ b/source/lsp_3.17/generated/lsp-progress_reports-progressend.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-progressreport.adb b/source/lsp_3.17/generated/lsp-progress_reports-progressreport.adb index ad8ae1847..64775d869 100644 --- a/source/lsp_3.17/generated/lsp-progress_reports-progressreport.adb +++ b/source/lsp_3.17/generated/lsp-progress_reports-progressreport.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Progress_Reports.ProgressReport is diff --git a/source/lsp_3.17/generated/lsp-progress_reports-progressreport.ads b/source/lsp_3.17/generated/lsp-progress_reports-progressreport.ads index a8111f14c..f7afc9f77 100644 --- a/source/lsp_3.17/generated/lsp-progress_reports-progressreport.ads +++ b/source/lsp_3.17/generated/lsp-progress_reports-progressreport.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-references.adb b/source/lsp_3.17/generated/lsp-progress_reports-references.adb index 4157d800f..15bbaf2b6 100644 --- a/source/lsp_3.17/generated/lsp-progress_reports-references.adb +++ b/source/lsp_3.17/generated/lsp-progress_reports-references.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Progress_Reports.References is diff --git a/source/lsp_3.17/generated/lsp-progress_reports-references.ads b/source/lsp_3.17/generated/lsp-progress_reports-references.ads index 9dafab220..fc5cbb062 100644 --- a/source/lsp_3.17/generated/lsp-progress_reports-references.ads +++ b/source/lsp_3.17/generated/lsp-progress_reports-references.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-selectionrange.adb b/source/lsp_3.17/generated/lsp-progress_reports-selectionrange.adb index ec9a4b6f3..55968c1df 100644 --- a/source/lsp_3.17/generated/lsp-progress_reports-selectionrange.adb +++ b/source/lsp_3.17/generated/lsp-progress_reports-selectionrange.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Progress_Reports.SelectionRange is diff --git a/source/lsp_3.17/generated/lsp-progress_reports-selectionrange.ads b/source/lsp_3.17/generated/lsp-progress_reports-selectionrange.ads index cc8af8be8..ed5b81937 100644 --- a/source/lsp_3.17/generated/lsp-progress_reports-selectionrange.ads +++ b/source/lsp_3.17/generated/lsp-progress_reports-selectionrange.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-subtypes.adb b/source/lsp_3.17/generated/lsp-progress_reports-subtypes.adb index 916d1af57..188f75d4f 100644 --- a/source/lsp_3.17/generated/lsp-progress_reports-subtypes.adb +++ b/source/lsp_3.17/generated/lsp-progress_reports-subtypes.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Progress_Reports.Subtypes is diff --git a/source/lsp_3.17/generated/lsp-progress_reports-subtypes.ads b/source/lsp_3.17/generated/lsp-progress_reports-subtypes.ads index 52a9d4b60..e11f85b78 100644 --- a/source/lsp_3.17/generated/lsp-progress_reports-subtypes.ads +++ b/source/lsp_3.17/generated/lsp-progress_reports-subtypes.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-supertypes.adb b/source/lsp_3.17/generated/lsp-progress_reports-supertypes.adb index 0df223504..e6756c7d2 100644 --- a/source/lsp_3.17/generated/lsp-progress_reports-supertypes.adb +++ b/source/lsp_3.17/generated/lsp-progress_reports-supertypes.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Progress_Reports.Supertypes is diff --git a/source/lsp_3.17/generated/lsp-progress_reports-supertypes.ads b/source/lsp_3.17/generated/lsp-progress_reports-supertypes.ads index e5452e630..1f9d9830b 100644 --- a/source/lsp_3.17/generated/lsp-progress_reports-supertypes.ads +++ b/source/lsp_3.17/generated/lsp-progress_reports-supertypes.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-symbol.adb b/source/lsp_3.17/generated/lsp-progress_reports-symbol.adb index 86db718d6..109075572 100644 --- a/source/lsp_3.17/generated/lsp-progress_reports-symbol.adb +++ b/source/lsp_3.17/generated/lsp-progress_reports-symbol.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Progress_Reports.Symbol is diff --git a/source/lsp_3.17/generated/lsp-progress_reports-symbol.ads b/source/lsp_3.17/generated/lsp-progress_reports-symbol.ads index 40d5e1ceb..43ed4e06c 100644 --- a/source/lsp_3.17/generated/lsp-progress_reports-symbol.ads +++ b/source/lsp_3.17/generated/lsp-progress_reports-symbol.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-tokens_delta.adb b/source/lsp_3.17/generated/lsp-progress_reports-tokens_delta.adb index b04520226..61ea74214 100644 --- a/source/lsp_3.17/generated/lsp-progress_reports-tokens_delta.adb +++ b/source/lsp_3.17/generated/lsp-progress_reports-tokens_delta.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Progress_Reports.Tokens_Delta is diff --git a/source/lsp_3.17/generated/lsp-progress_reports-tokens_delta.ads b/source/lsp_3.17/generated/lsp-progress_reports-tokens_delta.ads index d46ffd7d5..e0db32f8a 100644 --- a/source/lsp_3.17/generated/lsp-progress_reports-tokens_delta.ads +++ b/source/lsp_3.17/generated/lsp-progress_reports-tokens_delta.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-tokens_range.adb b/source/lsp_3.17/generated/lsp-progress_reports-tokens_range.adb index 63fc26488..e4b0c6ba0 100644 --- a/source/lsp_3.17/generated/lsp-progress_reports-tokens_range.adb +++ b/source/lsp_3.17/generated/lsp-progress_reports-tokens_range.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Progress_Reports.Tokens_Range is diff --git a/source/lsp_3.17/generated/lsp-progress_reports-tokens_range.ads b/source/lsp_3.17/generated/lsp-progress_reports-tokens_range.ads index 0cfa579bc..de004cb45 100644 --- a/source/lsp_3.17/generated/lsp-progress_reports-tokens_range.ads +++ b/source/lsp_3.17/generated/lsp-progress_reports-tokens_range.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-typedefinition.adb b/source/lsp_3.17/generated/lsp-progress_reports-typedefinition.adb index 396b72e5e..e669699b0 100644 --- a/source/lsp_3.17/generated/lsp-progress_reports-typedefinition.adb +++ b/source/lsp_3.17/generated/lsp-progress_reports-typedefinition.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Progress_Reports.TypeDefinition is diff --git a/source/lsp_3.17/generated/lsp-progress_reports-typedefinition.ads b/source/lsp_3.17/generated/lsp-progress_reports-typedefinition.ads index 930d62a9a..d644800f1 100644 --- a/source/lsp_3.17/generated/lsp-progress_reports-typedefinition.ads +++ b/source/lsp_3.17/generated/lsp-progress_reports-typedefinition.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-workspace_diagnostic.adb b/source/lsp_3.17/generated/lsp-progress_reports-workspace_diagnostic.adb index 56fd571a8..b1f0265c0 100644 --- a/source/lsp_3.17/generated/lsp-progress_reports-workspace_diagnostic.adb +++ b/source/lsp_3.17/generated/lsp-progress_reports-workspace_diagnostic.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Progress_Reports.Workspace_Diagnostic is diff --git a/source/lsp_3.17/generated/lsp-progress_reports-workspace_diagnostic.ads b/source/lsp_3.17/generated/lsp-progress_reports-workspace_diagnostic.ads index 5bbeb04bf..b147afd09 100644 --- a/source/lsp_3.17/generated/lsp-progress_reports-workspace_diagnostic.ads +++ b/source/lsp_3.17/generated/lsp-progress_reports-workspace_diagnostic.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_notification_readers.adb b/source/lsp_3.17/generated/lsp-server_notification_readers.adb index 74bafa6ad..679018800 100644 --- a/source/lsp_3.17/generated/lsp-server_notification_readers.adb +++ b/source/lsp_3.17/generated/lsp-server_notification_readers.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with Minimal_Perfect_Hash; with LSP.Inputs; @@ -35,26 +37,26 @@ package body LSP.Server_Notification_Readers is package Method_Map is new Minimal_Perfect_Hash (["$/cancelRequest", - "$/progress", - "$/setTrace", - "exit", - "initialized", - "notebookDocument/didChange", - "notebookDocument/didClose", - "notebookDocument/didOpen", - "notebookDocument/didSave", - "textDocument/didChange", - "textDocument/didClose", - "textDocument/didOpen", - "textDocument/didSave", - "textDocument/willSave", - "window/workDoneProgress/cancel", - "workspace/didChangeConfiguration", - "workspace/didChangeWatchedFiles", - "workspace/didChangeWorkspaceFolders", - "workspace/didCreateFiles", - "workspace/didDeleteFiles", - "workspace/didRenameFiles"]); + "$/progress", + "$/setTrace", + "exit", + "initialized", + "notebookDocument/didChange", + "notebookDocument/didClose", + "notebookDocument/didOpen", + "notebookDocument/didSave", + "textDocument/didChange", + "textDocument/didClose", + "textDocument/didOpen", + "textDocument/didSave", + "textDocument/willSave", + "window/workDoneProgress/cancel", + "workspace/didChangeConfiguration", + "workspace/didChangeWatchedFiles", + "workspace/didChangeWorkspaceFolders", + "workspace/didCreateFiles", + "workspace/didDeleteFiles", + "workspace/didRenameFiles"]); procedure Initialize is begin diff --git a/source/lsp_3.17/generated/lsp-server_notification_receivers.ads b/source/lsp_3.17/generated/lsp-server_notification_receivers.ads index 5195116f3..c313c0950 100644 --- a/source/lsp_3.17/generated/lsp-server_notification_receivers.ads +++ b/source/lsp_3.17/generated/lsp-server_notification_receivers.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Base_Notification_Receivers; with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_notification_writers.adb b/source/lsp_3.17/generated/lsp-server_notification_writers.adb index 33096f413..5c92165be 100644 --- a/source/lsp_3.17/generated/lsp-server_notification_writers.adb +++ b/source/lsp_3.17/generated/lsp-server_notification_writers.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with VSS.JSON.Content_Handlers; with LSP.Output_Tools; diff --git a/source/lsp_3.17/generated/lsp-server_notification_writers.ads b/source/lsp_3.17/generated/lsp-server_notification_writers.ads index 3c582af42..02f86f11e 100644 --- a/source/lsp_3.17/generated/lsp-server_notification_writers.ads +++ b/source/lsp_3.17/generated/lsp-server_notification_writers.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Base_Notification_Writers; with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_notifications-cancel.adb b/source/lsp_3.17/generated/lsp-server_notifications-cancel.adb index 298ebb578..7538df478 100644 --- a/source/lsp_3.17/generated/lsp-server_notifications-cancel.adb +++ b/source/lsp_3.17/generated/lsp-server_notifications-cancel.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Notifications.Cancel is diff --git a/source/lsp_3.17/generated/lsp-server_notifications-cancel.ads b/source/lsp_3.17/generated/lsp-server_notifications-cancel.ads index bb9e04ce4..ad144b177 100644 --- a/source/lsp_3.17/generated/lsp-server_notifications-cancel.ads +++ b/source/lsp_3.17/generated/lsp-server_notifications-cancel.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_notifications-cancelrequest.adb b/source/lsp_3.17/generated/lsp-server_notifications-cancelrequest.adb index afd5683f9..abf124374 100644 --- a/source/lsp_3.17/generated/lsp-server_notifications-cancelrequest.adb +++ b/source/lsp_3.17/generated/lsp-server_notifications-cancelrequest.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Notifications.CancelRequest is diff --git a/source/lsp_3.17/generated/lsp-server_notifications-cancelrequest.ads b/source/lsp_3.17/generated/lsp-server_notifications-cancelrequest.ads index 3521454c4..8ba9529f5 100644 --- a/source/lsp_3.17/generated/lsp-server_notifications-cancelrequest.ads +++ b/source/lsp_3.17/generated/lsp-server_notifications-cancelrequest.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_notifications-didchange.adb b/source/lsp_3.17/generated/lsp-server_notifications-didchange.adb index bbcdd8239..cadf72142 100644 --- a/source/lsp_3.17/generated/lsp-server_notifications-didchange.adb +++ b/source/lsp_3.17/generated/lsp-server_notifications-didchange.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Notifications.DidChange is diff --git a/source/lsp_3.17/generated/lsp-server_notifications-didchange.ads b/source/lsp_3.17/generated/lsp-server_notifications-didchange.ads index a061d2ae3..b68bedf8a 100644 --- a/source/lsp_3.17/generated/lsp-server_notifications-didchange.ads +++ b/source/lsp_3.17/generated/lsp-server_notifications-didchange.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_notifications-didchangeconfiguration.adb b/source/lsp_3.17/generated/lsp-server_notifications-didchangeconfiguration.adb index 7f5564d4c..322c954ca 100644 --- a/source/lsp_3.17/generated/lsp-server_notifications-didchangeconfiguration.adb +++ b/source/lsp_3.17/generated/lsp-server_notifications-didchangeconfiguration.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Notifications.DidChangeConfiguration is diff --git a/source/lsp_3.17/generated/lsp-server_notifications-didchangeconfiguration.ads b/source/lsp_3.17/generated/lsp-server_notifications-didchangeconfiguration.ads index 14932fb82..f0dcb93aa 100644 --- a/source/lsp_3.17/generated/lsp-server_notifications-didchangeconfiguration.ads +++ b/source/lsp_3.17/generated/lsp-server_notifications-didchangeconfiguration.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_notifications-didchangenotebook.adb b/source/lsp_3.17/generated/lsp-server_notifications-didchangenotebook.adb index 80bb391bf..2f02908c1 100644 --- a/source/lsp_3.17/generated/lsp-server_notifications-didchangenotebook.adb +++ b/source/lsp_3.17/generated/lsp-server_notifications-didchangenotebook.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Notifications.DidChangeNotebook is diff --git a/source/lsp_3.17/generated/lsp-server_notifications-didchangenotebook.ads b/source/lsp_3.17/generated/lsp-server_notifications-didchangenotebook.ads index 7791c65fc..837b679d2 100644 --- a/source/lsp_3.17/generated/lsp-server_notifications-didchangenotebook.ads +++ b/source/lsp_3.17/generated/lsp-server_notifications-didchangenotebook.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_notifications-didchangewatchedfiles.adb b/source/lsp_3.17/generated/lsp-server_notifications-didchangewatchedfiles.adb index c157b4ed0..83bc7ad04 100644 --- a/source/lsp_3.17/generated/lsp-server_notifications-didchangewatchedfiles.adb +++ b/source/lsp_3.17/generated/lsp-server_notifications-didchangewatchedfiles.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Notifications.DidChangeWatchedFiles is diff --git a/source/lsp_3.17/generated/lsp-server_notifications-didchangewatchedfiles.ads b/source/lsp_3.17/generated/lsp-server_notifications-didchangewatchedfiles.ads index bf4e06957..528d65871 100644 --- a/source/lsp_3.17/generated/lsp-server_notifications-didchangewatchedfiles.ads +++ b/source/lsp_3.17/generated/lsp-server_notifications-didchangewatchedfiles.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_notifications-didchangeworkspacefolders.adb b/source/lsp_3.17/generated/lsp-server_notifications-didchangeworkspacefolders.adb index 73410ac16..a87c72e7b 100644 --- a/source/lsp_3.17/generated/lsp-server_notifications-didchangeworkspacefolders.adb +++ b/source/lsp_3.17/generated/lsp-server_notifications-didchangeworkspacefolders.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Notifications.DidChangeWorkspaceFolders is diff --git a/source/lsp_3.17/generated/lsp-server_notifications-didchangeworkspacefolders.ads b/source/lsp_3.17/generated/lsp-server_notifications-didchangeworkspacefolders.ads index 30d43a613..91b3cc009 100644 --- a/source/lsp_3.17/generated/lsp-server_notifications-didchangeworkspacefolders.ads +++ b/source/lsp_3.17/generated/lsp-server_notifications-didchangeworkspacefolders.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_notifications-didclose.adb b/source/lsp_3.17/generated/lsp-server_notifications-didclose.adb index 1e3c53ae0..701df6bdd 100644 --- a/source/lsp_3.17/generated/lsp-server_notifications-didclose.adb +++ b/source/lsp_3.17/generated/lsp-server_notifications-didclose.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Notifications.DidClose is diff --git a/source/lsp_3.17/generated/lsp-server_notifications-didclose.ads b/source/lsp_3.17/generated/lsp-server_notifications-didclose.ads index 5da60c81c..96cd063f0 100644 --- a/source/lsp_3.17/generated/lsp-server_notifications-didclose.ads +++ b/source/lsp_3.17/generated/lsp-server_notifications-didclose.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_notifications-didclosenotebook.adb b/source/lsp_3.17/generated/lsp-server_notifications-didclosenotebook.adb index 8ff356c80..061116fbc 100644 --- a/source/lsp_3.17/generated/lsp-server_notifications-didclosenotebook.adb +++ b/source/lsp_3.17/generated/lsp-server_notifications-didclosenotebook.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Notifications.DidCloseNotebook is diff --git a/source/lsp_3.17/generated/lsp-server_notifications-didclosenotebook.ads b/source/lsp_3.17/generated/lsp-server_notifications-didclosenotebook.ads index e36055991..07c9ab865 100644 --- a/source/lsp_3.17/generated/lsp-server_notifications-didclosenotebook.ads +++ b/source/lsp_3.17/generated/lsp-server_notifications-didclosenotebook.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_notifications-didcreatefiles.adb b/source/lsp_3.17/generated/lsp-server_notifications-didcreatefiles.adb index eb010f80a..5a504bbbc 100644 --- a/source/lsp_3.17/generated/lsp-server_notifications-didcreatefiles.adb +++ b/source/lsp_3.17/generated/lsp-server_notifications-didcreatefiles.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Notifications.DidCreateFiles is diff --git a/source/lsp_3.17/generated/lsp-server_notifications-didcreatefiles.ads b/source/lsp_3.17/generated/lsp-server_notifications-didcreatefiles.ads index 86e68f48d..a053f5cb8 100644 --- a/source/lsp_3.17/generated/lsp-server_notifications-didcreatefiles.ads +++ b/source/lsp_3.17/generated/lsp-server_notifications-didcreatefiles.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_notifications-diddeletefiles.adb b/source/lsp_3.17/generated/lsp-server_notifications-diddeletefiles.adb index 8761f2fcc..b74beaaf7 100644 --- a/source/lsp_3.17/generated/lsp-server_notifications-diddeletefiles.adb +++ b/source/lsp_3.17/generated/lsp-server_notifications-diddeletefiles.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Notifications.DidDeleteFiles is diff --git a/source/lsp_3.17/generated/lsp-server_notifications-diddeletefiles.ads b/source/lsp_3.17/generated/lsp-server_notifications-diddeletefiles.ads index eacc02ae0..f7fbacf01 100644 --- a/source/lsp_3.17/generated/lsp-server_notifications-diddeletefiles.ads +++ b/source/lsp_3.17/generated/lsp-server_notifications-diddeletefiles.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_notifications-didopen.adb b/source/lsp_3.17/generated/lsp-server_notifications-didopen.adb index 1950f7d14..7fe9c4360 100644 --- a/source/lsp_3.17/generated/lsp-server_notifications-didopen.adb +++ b/source/lsp_3.17/generated/lsp-server_notifications-didopen.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Notifications.DidOpen is diff --git a/source/lsp_3.17/generated/lsp-server_notifications-didopen.ads b/source/lsp_3.17/generated/lsp-server_notifications-didopen.ads index cd545fb5c..2442dbe50 100644 --- a/source/lsp_3.17/generated/lsp-server_notifications-didopen.ads +++ b/source/lsp_3.17/generated/lsp-server_notifications-didopen.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_notifications-didopennotebook.adb b/source/lsp_3.17/generated/lsp-server_notifications-didopennotebook.adb index f319e4f2b..4611f1d94 100644 --- a/source/lsp_3.17/generated/lsp-server_notifications-didopennotebook.adb +++ b/source/lsp_3.17/generated/lsp-server_notifications-didopennotebook.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Notifications.DidOpenNotebook is diff --git a/source/lsp_3.17/generated/lsp-server_notifications-didopennotebook.ads b/source/lsp_3.17/generated/lsp-server_notifications-didopennotebook.ads index 8418d85aa..c1623c7ec 100644 --- a/source/lsp_3.17/generated/lsp-server_notifications-didopennotebook.ads +++ b/source/lsp_3.17/generated/lsp-server_notifications-didopennotebook.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_notifications-didrenamefiles.adb b/source/lsp_3.17/generated/lsp-server_notifications-didrenamefiles.adb index bb7052d29..b02e27f75 100644 --- a/source/lsp_3.17/generated/lsp-server_notifications-didrenamefiles.adb +++ b/source/lsp_3.17/generated/lsp-server_notifications-didrenamefiles.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Notifications.DidRenameFiles is diff --git a/source/lsp_3.17/generated/lsp-server_notifications-didrenamefiles.ads b/source/lsp_3.17/generated/lsp-server_notifications-didrenamefiles.ads index f6dc6f546..ee5836080 100644 --- a/source/lsp_3.17/generated/lsp-server_notifications-didrenamefiles.ads +++ b/source/lsp_3.17/generated/lsp-server_notifications-didrenamefiles.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_notifications-didsave.adb b/source/lsp_3.17/generated/lsp-server_notifications-didsave.adb index 91c1e2ca1..a5df94a83 100644 --- a/source/lsp_3.17/generated/lsp-server_notifications-didsave.adb +++ b/source/lsp_3.17/generated/lsp-server_notifications-didsave.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Notifications.DidSave is diff --git a/source/lsp_3.17/generated/lsp-server_notifications-didsave.ads b/source/lsp_3.17/generated/lsp-server_notifications-didsave.ads index 98314f5db..26c456781 100644 --- a/source/lsp_3.17/generated/lsp-server_notifications-didsave.ads +++ b/source/lsp_3.17/generated/lsp-server_notifications-didsave.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_notifications-didsavenotebook.adb b/source/lsp_3.17/generated/lsp-server_notifications-didsavenotebook.adb index 48d10d935..0baf3f9bc 100644 --- a/source/lsp_3.17/generated/lsp-server_notifications-didsavenotebook.adb +++ b/source/lsp_3.17/generated/lsp-server_notifications-didsavenotebook.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Notifications.DidSaveNotebook is diff --git a/source/lsp_3.17/generated/lsp-server_notifications-didsavenotebook.ads b/source/lsp_3.17/generated/lsp-server_notifications-didsavenotebook.ads index 05df8ad01..4b9811f21 100644 --- a/source/lsp_3.17/generated/lsp-server_notifications-didsavenotebook.ads +++ b/source/lsp_3.17/generated/lsp-server_notifications-didsavenotebook.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_notifications-exits.adb b/source/lsp_3.17/generated/lsp-server_notifications-exits.adb index fea7074d6..93c577684 100644 --- a/source/lsp_3.17/generated/lsp-server_notifications-exits.adb +++ b/source/lsp_3.17/generated/lsp-server_notifications-exits.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Notifications.Exits is diff --git a/source/lsp_3.17/generated/lsp-server_notifications-exits.ads b/source/lsp_3.17/generated/lsp-server_notifications-exits.ads index 00ff8be89..876142cc6 100644 --- a/source/lsp_3.17/generated/lsp-server_notifications-exits.ads +++ b/source/lsp_3.17/generated/lsp-server_notifications-exits.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package LSP.Server_Notifications.Exits is pragma Preelaborate; diff --git a/source/lsp_3.17/generated/lsp-server_notifications-initialized.adb b/source/lsp_3.17/generated/lsp-server_notifications-initialized.adb index 84ed418da..f3ff591ae 100644 --- a/source/lsp_3.17/generated/lsp-server_notifications-initialized.adb +++ b/source/lsp_3.17/generated/lsp-server_notifications-initialized.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Notifications.Initialized is diff --git a/source/lsp_3.17/generated/lsp-server_notifications-initialized.ads b/source/lsp_3.17/generated/lsp-server_notifications-initialized.ads index 50e2efa1b..48e1a5f69 100644 --- a/source/lsp_3.17/generated/lsp-server_notifications-initialized.ads +++ b/source/lsp_3.17/generated/lsp-server_notifications-initialized.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_notifications-progress.adb b/source/lsp_3.17/generated/lsp-server_notifications-progress.adb index 3ca0f584b..c385ae5fe 100644 --- a/source/lsp_3.17/generated/lsp-server_notifications-progress.adb +++ b/source/lsp_3.17/generated/lsp-server_notifications-progress.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Notifications.Progress is diff --git a/source/lsp_3.17/generated/lsp-server_notifications-progress.ads b/source/lsp_3.17/generated/lsp-server_notifications-progress.ads index 12f0ac509..5b7a84f86 100644 --- a/source/lsp_3.17/generated/lsp-server_notifications-progress.ads +++ b/source/lsp_3.17/generated/lsp-server_notifications-progress.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_notifications-settrace.adb b/source/lsp_3.17/generated/lsp-server_notifications-settrace.adb index 61d349181..02013a2cc 100644 --- a/source/lsp_3.17/generated/lsp-server_notifications-settrace.adb +++ b/source/lsp_3.17/generated/lsp-server_notifications-settrace.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Notifications.SetTrace is diff --git a/source/lsp_3.17/generated/lsp-server_notifications-settrace.ads b/source/lsp_3.17/generated/lsp-server_notifications-settrace.ads index 0b00253ca..39a9a8cd4 100644 --- a/source/lsp_3.17/generated/lsp-server_notifications-settrace.ads +++ b/source/lsp_3.17/generated/lsp-server_notifications-settrace.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_notifications-willsave.adb b/source/lsp_3.17/generated/lsp-server_notifications-willsave.adb index 9ddf98fc0..8fd18ef48 100644 --- a/source/lsp_3.17/generated/lsp-server_notifications-willsave.adb +++ b/source/lsp_3.17/generated/lsp-server_notifications-willsave.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Notifications.WillSave is diff --git a/source/lsp_3.17/generated/lsp-server_notifications-willsave.ads b/source/lsp_3.17/generated/lsp-server_notifications-willsave.ads index 52af4d68d..43fd74d51 100644 --- a/source/lsp_3.17/generated/lsp-server_notifications-willsave.ads +++ b/source/lsp_3.17/generated/lsp-server_notifications-willsave.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_request_readers.adb b/source/lsp_3.17/generated/lsp-server_request_readers.adb index c5bea6a4f..50a10c446 100644 --- a/source/lsp_3.17/generated/lsp-server_request_readers.adb +++ b/source/lsp_3.17/generated/lsp-server_request_readers.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with Minimal_Perfect_Hash; with LSP.Inputs; @@ -65,56 +67,56 @@ package body LSP.Server_Request_Readers is package Method_Map is new Minimal_Perfect_Hash (["callHierarchy/incomingCalls", - "callHierarchy/outgoingCalls", - "codeAction/resolve", - "codeLens/resolve", - "completionItem/resolve", - "documentLink/resolve", - "initialize", - "inlayHint/resolve", - "shutdown", - "textDocument/codeAction", - "textDocument/codeLens", - "textDocument/colorPresentation", - "textDocument/completion", - "textDocument/declaration", - "textDocument/definition", - "textDocument/diagnostic", - "textDocument/documentColor", - "textDocument/documentHighlight", - "textDocument/documentLink", - "textDocument/documentSymbol", - "textDocument/foldingRange", - "textDocument/formatting", - "textDocument/hover", - "textDocument/implementation", - "textDocument/inlayHint", - "textDocument/inlineValue", - "textDocument/linkedEditingRange", - "textDocument/moniker", - "textDocument/onTypeFormatting", - "textDocument/prepareCallHierarchy", - "textDocument/prepareRename", - "textDocument/prepareTypeHierarchy", - "textDocument/rangeFormatting", - "textDocument/references", - "textDocument/rename", - "textDocument/selectionRange", - "textDocument/semanticTokens/full", - "textDocument/semanticTokens/full/delta", - "textDocument/semanticTokens/range", - "textDocument/signatureHelp", - "textDocument/typeDefinition", - "textDocument/willSaveWaitUntil", - "typeHierarchy/subtypes", - "typeHierarchy/supertypes", - "workspace/diagnostic", - "workspace/executeCommand", - "workspace/symbol", - "workspace/willCreateFiles", - "workspace/willDeleteFiles", - "workspace/willRenameFiles", - "workspaceSymbol/resolve"]); + "callHierarchy/outgoingCalls", + "codeAction/resolve", + "codeLens/resolve", + "completionItem/resolve", + "documentLink/resolve", + "initialize", + "inlayHint/resolve", + "shutdown", + "textDocument/codeAction", + "textDocument/codeLens", + "textDocument/colorPresentation", + "textDocument/completion", + "textDocument/declaration", + "textDocument/definition", + "textDocument/diagnostic", + "textDocument/documentColor", + "textDocument/documentHighlight", + "textDocument/documentLink", + "textDocument/documentSymbol", + "textDocument/foldingRange", + "textDocument/formatting", + "textDocument/hover", + "textDocument/implementation", + "textDocument/inlayHint", + "textDocument/inlineValue", + "textDocument/linkedEditingRange", + "textDocument/moniker", + "textDocument/onTypeFormatting", + "textDocument/prepareCallHierarchy", + "textDocument/prepareRename", + "textDocument/prepareTypeHierarchy", + "textDocument/rangeFormatting", + "textDocument/references", + "textDocument/rename", + "textDocument/selectionRange", + "textDocument/semanticTokens/full", + "textDocument/semanticTokens/full/delta", + "textDocument/semanticTokens/range", + "textDocument/signatureHelp", + "textDocument/typeDefinition", + "textDocument/willSaveWaitUntil", + "typeHierarchy/subtypes", + "typeHierarchy/supertypes", + "workspace/diagnostic", + "workspace/executeCommand", + "workspace/symbol", + "workspace/willCreateFiles", + "workspace/willDeleteFiles", + "workspace/willRenameFiles", + "workspaceSymbol/resolve"]); procedure Initialize is begin diff --git a/source/lsp_3.17/generated/lsp-server_request_receivers.ads b/source/lsp_3.17/generated/lsp-server_request_receivers.ads index 5fe0a9651..1a08d5b6d 100644 --- a/source/lsp_3.17/generated/lsp-server_request_receivers.ads +++ b/source/lsp_3.17/generated/lsp-server_request_receivers.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_request_writers.adb b/source/lsp_3.17/generated/lsp-server_request_writers.adb index d8e47459d..682aed2a0 100644 --- a/source/lsp_3.17/generated/lsp-server_request_writers.adb +++ b/source/lsp_3.17/generated/lsp-server_request_writers.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Output_Tools; with LSP.Outputs; diff --git a/source/lsp_3.17/generated/lsp-server_request_writers.ads b/source/lsp_3.17/generated/lsp-server_request_writers.ads index 2016ebb18..ae534793b 100644 --- a/source/lsp_3.17/generated/lsp-server_request_writers.ads +++ b/source/lsp_3.17/generated/lsp-server_request_writers.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; with VSS.JSON.Content_Handlers; diff --git a/source/lsp_3.17/generated/lsp-server_requests-code_action_resolve.adb b/source/lsp_3.17/generated/lsp-server_requests-code_action_resolve.adb index 90e24680f..e347662fc 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-code_action_resolve.adb +++ b/source/lsp_3.17/generated/lsp-server_requests-code_action_resolve.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Requests.Code_Action_Resolve is diff --git a/source/lsp_3.17/generated/lsp-server_requests-code_action_resolve.ads b/source/lsp_3.17/generated/lsp-server_requests-code_action_resolve.ads index afa38d751..c494ee3ea 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-code_action_resolve.ads +++ b/source/lsp_3.17/generated/lsp-server_requests-code_action_resolve.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_requests-code_lens_resolve.adb b/source/lsp_3.17/generated/lsp-server_requests-code_lens_resolve.adb index 5084e6d50..3bdade37c 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-code_lens_resolve.adb +++ b/source/lsp_3.17/generated/lsp-server_requests-code_lens_resolve.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Requests.Code_Lens_Resolve is diff --git a/source/lsp_3.17/generated/lsp-server_requests-code_lens_resolve.ads b/source/lsp_3.17/generated/lsp-server_requests-code_lens_resolve.ads index c1161d864..629516cd4 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-code_lens_resolve.ads +++ b/source/lsp_3.17/generated/lsp-server_requests-code_lens_resolve.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_requests-codeaction.adb b/source/lsp_3.17/generated/lsp-server_requests-codeaction.adb index ada50cfdd..78e65b6ea 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-codeaction.adb +++ b/source/lsp_3.17/generated/lsp-server_requests-codeaction.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Requests.CodeAction is diff --git a/source/lsp_3.17/generated/lsp-server_requests-codeaction.ads b/source/lsp_3.17/generated/lsp-server_requests-codeaction.ads index e0d52cc5a..5f2f3e6b0 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-codeaction.ads +++ b/source/lsp_3.17/generated/lsp-server_requests-codeaction.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_requests-codelens.adb b/source/lsp_3.17/generated/lsp-server_requests-codelens.adb index 218dff411..3b9b9ece1 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-codelens.adb +++ b/source/lsp_3.17/generated/lsp-server_requests-codelens.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Requests.CodeLens is diff --git a/source/lsp_3.17/generated/lsp-server_requests-codelens.ads b/source/lsp_3.17/generated/lsp-server_requests-codelens.ads index 0e7bae335..52cb55778 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-codelens.ads +++ b/source/lsp_3.17/generated/lsp-server_requests-codelens.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_requests-colorpresentation.adb b/source/lsp_3.17/generated/lsp-server_requests-colorpresentation.adb index e167c354b..a44bcf692 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-colorpresentation.adb +++ b/source/lsp_3.17/generated/lsp-server_requests-colorpresentation.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Requests.ColorPresentation is diff --git a/source/lsp_3.17/generated/lsp-server_requests-colorpresentation.ads b/source/lsp_3.17/generated/lsp-server_requests-colorpresentation.ads index 2792fdbef..34b2f6933 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-colorpresentation.ads +++ b/source/lsp_3.17/generated/lsp-server_requests-colorpresentation.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_requests-completion.adb b/source/lsp_3.17/generated/lsp-server_requests-completion.adb index 8823648a4..0acb15af5 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-completion.adb +++ b/source/lsp_3.17/generated/lsp-server_requests-completion.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Requests.Completion is diff --git a/source/lsp_3.17/generated/lsp-server_requests-completion.ads b/source/lsp_3.17/generated/lsp-server_requests-completion.ads index 480f3b558..5d1771713 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-completion.ads +++ b/source/lsp_3.17/generated/lsp-server_requests-completion.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_requests-completion_resolve.adb b/source/lsp_3.17/generated/lsp-server_requests-completion_resolve.adb index 7bb796a3a..ffe01d15a 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-completion_resolve.adb +++ b/source/lsp_3.17/generated/lsp-server_requests-completion_resolve.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Requests.Completion_Resolve is diff --git a/source/lsp_3.17/generated/lsp-server_requests-completion_resolve.ads b/source/lsp_3.17/generated/lsp-server_requests-completion_resolve.ads index 573655217..3921f4545 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-completion_resolve.ads +++ b/source/lsp_3.17/generated/lsp-server_requests-completion_resolve.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_requests-declaration.adb b/source/lsp_3.17/generated/lsp-server_requests-declaration.adb index 1ddfc2834..75e2ec100 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-declaration.adb +++ b/source/lsp_3.17/generated/lsp-server_requests-declaration.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Requests.Declaration is diff --git a/source/lsp_3.17/generated/lsp-server_requests-declaration.ads b/source/lsp_3.17/generated/lsp-server_requests-declaration.ads index cf4c2133a..f03d7ea3b 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-declaration.ads +++ b/source/lsp_3.17/generated/lsp-server_requests-declaration.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_requests-definition.adb b/source/lsp_3.17/generated/lsp-server_requests-definition.adb index 2b32cc05b..2c4eb4ae1 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-definition.adb +++ b/source/lsp_3.17/generated/lsp-server_requests-definition.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Requests.Definition is diff --git a/source/lsp_3.17/generated/lsp-server_requests-definition.ads b/source/lsp_3.17/generated/lsp-server_requests-definition.ads index cc392d76b..34ad1215b 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-definition.ads +++ b/source/lsp_3.17/generated/lsp-server_requests-definition.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_requests-diagnostic.adb b/source/lsp_3.17/generated/lsp-server_requests-diagnostic.adb index 8e7a5e82e..06667de76 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-diagnostic.adb +++ b/source/lsp_3.17/generated/lsp-server_requests-diagnostic.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Requests.Diagnostic is diff --git a/source/lsp_3.17/generated/lsp-server_requests-diagnostic.ads b/source/lsp_3.17/generated/lsp-server_requests-diagnostic.ads index e79abbb3a..214a95a7c 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-diagnostic.ads +++ b/source/lsp_3.17/generated/lsp-server_requests-diagnostic.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_requests-documentcolor.adb b/source/lsp_3.17/generated/lsp-server_requests-documentcolor.adb index 12d97ce37..e58bfcbb7 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-documentcolor.adb +++ b/source/lsp_3.17/generated/lsp-server_requests-documentcolor.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Requests.DocumentColor is diff --git a/source/lsp_3.17/generated/lsp-server_requests-documentcolor.ads b/source/lsp_3.17/generated/lsp-server_requests-documentcolor.ads index 5ae57cda3..eac7c5c0a 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-documentcolor.ads +++ b/source/lsp_3.17/generated/lsp-server_requests-documentcolor.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_requests-documenthighlight.adb b/source/lsp_3.17/generated/lsp-server_requests-documenthighlight.adb index dbf4d237a..3cc8a19c5 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-documenthighlight.adb +++ b/source/lsp_3.17/generated/lsp-server_requests-documenthighlight.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Requests.DocumentHighlight is diff --git a/source/lsp_3.17/generated/lsp-server_requests-documenthighlight.ads b/source/lsp_3.17/generated/lsp-server_requests-documenthighlight.ads index 07d6233a8..624f08cd4 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-documenthighlight.ads +++ b/source/lsp_3.17/generated/lsp-server_requests-documenthighlight.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_requests-documentlink.adb b/source/lsp_3.17/generated/lsp-server_requests-documentlink.adb index c6baf0408..92e17a3d6 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-documentlink.adb +++ b/source/lsp_3.17/generated/lsp-server_requests-documentlink.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Requests.DocumentLink is diff --git a/source/lsp_3.17/generated/lsp-server_requests-documentlink.ads b/source/lsp_3.17/generated/lsp-server_requests-documentlink.ads index d37f95c72..63e98449c 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-documentlink.ads +++ b/source/lsp_3.17/generated/lsp-server_requests-documentlink.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_requests-documentsymbol.adb b/source/lsp_3.17/generated/lsp-server_requests-documentsymbol.adb index 0e046c245..269d647bc 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-documentsymbol.adb +++ b/source/lsp_3.17/generated/lsp-server_requests-documentsymbol.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Requests.DocumentSymbol is diff --git a/source/lsp_3.17/generated/lsp-server_requests-documentsymbol.ads b/source/lsp_3.17/generated/lsp-server_requests-documentsymbol.ads index c5bbfe9aa..54c288ac3 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-documentsymbol.ads +++ b/source/lsp_3.17/generated/lsp-server_requests-documentsymbol.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_requests-executecommand.adb b/source/lsp_3.17/generated/lsp-server_requests-executecommand.adb index 89e4e4ea9..3ea5fcc50 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-executecommand.adb +++ b/source/lsp_3.17/generated/lsp-server_requests-executecommand.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Requests.ExecuteCommand is diff --git a/source/lsp_3.17/generated/lsp-server_requests-executecommand.ads b/source/lsp_3.17/generated/lsp-server_requests-executecommand.ads index a7afe999c..bd9bc3b29 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-executecommand.ads +++ b/source/lsp_3.17/generated/lsp-server_requests-executecommand.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_requests-foldingrange.adb b/source/lsp_3.17/generated/lsp-server_requests-foldingrange.adb index 2e694519c..edce452f7 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-foldingrange.adb +++ b/source/lsp_3.17/generated/lsp-server_requests-foldingrange.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Requests.FoldingRange is diff --git a/source/lsp_3.17/generated/lsp-server_requests-foldingrange.ads b/source/lsp_3.17/generated/lsp-server_requests-foldingrange.ads index 82a186158..93c486615 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-foldingrange.ads +++ b/source/lsp_3.17/generated/lsp-server_requests-foldingrange.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_requests-formatting.adb b/source/lsp_3.17/generated/lsp-server_requests-formatting.adb index 2bb2bbd3b..7deb420bb 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-formatting.adb +++ b/source/lsp_3.17/generated/lsp-server_requests-formatting.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Requests.Formatting is diff --git a/source/lsp_3.17/generated/lsp-server_requests-formatting.ads b/source/lsp_3.17/generated/lsp-server_requests-formatting.ads index 76f41f6fc..eab45a83b 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-formatting.ads +++ b/source/lsp_3.17/generated/lsp-server_requests-formatting.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_requests-full.adb b/source/lsp_3.17/generated/lsp-server_requests-full.adb index 4681dbdc3..ced126e1a 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-full.adb +++ b/source/lsp_3.17/generated/lsp-server_requests-full.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Requests.Full is diff --git a/source/lsp_3.17/generated/lsp-server_requests-full.ads b/source/lsp_3.17/generated/lsp-server_requests-full.ads index a156b6049..0187c26fa 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-full.ads +++ b/source/lsp_3.17/generated/lsp-server_requests-full.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_requests-hover.adb b/source/lsp_3.17/generated/lsp-server_requests-hover.adb index 4ccde0ebe..8f51f096c 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-hover.adb +++ b/source/lsp_3.17/generated/lsp-server_requests-hover.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Requests.Hover is diff --git a/source/lsp_3.17/generated/lsp-server_requests-hover.ads b/source/lsp_3.17/generated/lsp-server_requests-hover.ads index bf63b6e01..cba6db010 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-hover.ads +++ b/source/lsp_3.17/generated/lsp-server_requests-hover.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_requests-implementation.adb b/source/lsp_3.17/generated/lsp-server_requests-implementation.adb index d84bf4611..2ceb7a0de 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-implementation.adb +++ b/source/lsp_3.17/generated/lsp-server_requests-implementation.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Requests.Implementation is diff --git a/source/lsp_3.17/generated/lsp-server_requests-implementation.ads b/source/lsp_3.17/generated/lsp-server_requests-implementation.ads index 10cacb336..a0bb8a990 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-implementation.ads +++ b/source/lsp_3.17/generated/lsp-server_requests-implementation.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_requests-incomingcalls.adb b/source/lsp_3.17/generated/lsp-server_requests-incomingcalls.adb index 834727d9e..559e94587 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-incomingcalls.adb +++ b/source/lsp_3.17/generated/lsp-server_requests-incomingcalls.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Requests.IncomingCalls is diff --git a/source/lsp_3.17/generated/lsp-server_requests-incomingcalls.ads b/source/lsp_3.17/generated/lsp-server_requests-incomingcalls.ads index f52cc7661..c579d50c7 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-incomingcalls.ads +++ b/source/lsp_3.17/generated/lsp-server_requests-incomingcalls.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_requests-initialize.adb b/source/lsp_3.17/generated/lsp-server_requests-initialize.adb index 50d159962..8e58c33f5 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-initialize.adb +++ b/source/lsp_3.17/generated/lsp-server_requests-initialize.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Requests.Initialize is diff --git a/source/lsp_3.17/generated/lsp-server_requests-initialize.ads b/source/lsp_3.17/generated/lsp-server_requests-initialize.ads index c2f245055..569c39564 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-initialize.ads +++ b/source/lsp_3.17/generated/lsp-server_requests-initialize.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_requests-inlay_resolve.adb b/source/lsp_3.17/generated/lsp-server_requests-inlay_resolve.adb index e7eae43a4..a1d775b1a 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-inlay_resolve.adb +++ b/source/lsp_3.17/generated/lsp-server_requests-inlay_resolve.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Requests.Inlay_Resolve is diff --git a/source/lsp_3.17/generated/lsp-server_requests-inlay_resolve.ads b/source/lsp_3.17/generated/lsp-server_requests-inlay_resolve.ads index 9245c3edf..56dc55d19 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-inlay_resolve.ads +++ b/source/lsp_3.17/generated/lsp-server_requests-inlay_resolve.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_requests-inlayhint.adb b/source/lsp_3.17/generated/lsp-server_requests-inlayhint.adb index 4a552727d..64c00c486 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-inlayhint.adb +++ b/source/lsp_3.17/generated/lsp-server_requests-inlayhint.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Requests.InlayHint is diff --git a/source/lsp_3.17/generated/lsp-server_requests-inlayhint.ads b/source/lsp_3.17/generated/lsp-server_requests-inlayhint.ads index 7d97b2b90..a49afb8a6 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-inlayhint.ads +++ b/source/lsp_3.17/generated/lsp-server_requests-inlayhint.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_requests-inlinevalue.adb b/source/lsp_3.17/generated/lsp-server_requests-inlinevalue.adb index acd785c6c..b0b2a9942 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-inlinevalue.adb +++ b/source/lsp_3.17/generated/lsp-server_requests-inlinevalue.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Requests.InlineValue is diff --git a/source/lsp_3.17/generated/lsp-server_requests-inlinevalue.ads b/source/lsp_3.17/generated/lsp-server_requests-inlinevalue.ads index c5091e0c5..b13e46de7 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-inlinevalue.ads +++ b/source/lsp_3.17/generated/lsp-server_requests-inlinevalue.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_requests-link_resolve.adb b/source/lsp_3.17/generated/lsp-server_requests-link_resolve.adb index 8988d656f..62af0fdd7 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-link_resolve.adb +++ b/source/lsp_3.17/generated/lsp-server_requests-link_resolve.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Requests.Link_Resolve is diff --git a/source/lsp_3.17/generated/lsp-server_requests-link_resolve.ads b/source/lsp_3.17/generated/lsp-server_requests-link_resolve.ads index 3e42b2b9a..b0356c313 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-link_resolve.ads +++ b/source/lsp_3.17/generated/lsp-server_requests-link_resolve.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_requests-linkededitingrange.adb b/source/lsp_3.17/generated/lsp-server_requests-linkededitingrange.adb index 10328fdc3..9b535a41e 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-linkededitingrange.adb +++ b/source/lsp_3.17/generated/lsp-server_requests-linkededitingrange.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Requests.LinkedEditingRange is diff --git a/source/lsp_3.17/generated/lsp-server_requests-linkededitingrange.ads b/source/lsp_3.17/generated/lsp-server_requests-linkededitingrange.ads index ef3a994cd..94fb2509a 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-linkededitingrange.ads +++ b/source/lsp_3.17/generated/lsp-server_requests-linkededitingrange.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_requests-moniker.adb b/source/lsp_3.17/generated/lsp-server_requests-moniker.adb index 661bd891c..b08bc41c4 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-moniker.adb +++ b/source/lsp_3.17/generated/lsp-server_requests-moniker.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Requests.Moniker is diff --git a/source/lsp_3.17/generated/lsp-server_requests-moniker.ads b/source/lsp_3.17/generated/lsp-server_requests-moniker.ads index 7521e2a38..70f85e7da 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-moniker.ads +++ b/source/lsp_3.17/generated/lsp-server_requests-moniker.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_requests-ontypeformatting.adb b/source/lsp_3.17/generated/lsp-server_requests-ontypeformatting.adb index 99fd91e5b..e36a9e7d1 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-ontypeformatting.adb +++ b/source/lsp_3.17/generated/lsp-server_requests-ontypeformatting.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Requests.OnTypeFormatting is diff --git a/source/lsp_3.17/generated/lsp-server_requests-ontypeformatting.ads b/source/lsp_3.17/generated/lsp-server_requests-ontypeformatting.ads index 90a7f6af7..f3a55fce3 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-ontypeformatting.ads +++ b/source/lsp_3.17/generated/lsp-server_requests-ontypeformatting.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_requests-outgoingcalls.adb b/source/lsp_3.17/generated/lsp-server_requests-outgoingcalls.adb index 67024881b..4f207c19a 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-outgoingcalls.adb +++ b/source/lsp_3.17/generated/lsp-server_requests-outgoingcalls.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Requests.OutgoingCalls is diff --git a/source/lsp_3.17/generated/lsp-server_requests-outgoingcalls.ads b/source/lsp_3.17/generated/lsp-server_requests-outgoingcalls.ads index b0be0d8b9..655aa946d 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-outgoingcalls.ads +++ b/source/lsp_3.17/generated/lsp-server_requests-outgoingcalls.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_requests-preparecallhierarchy.adb b/source/lsp_3.17/generated/lsp-server_requests-preparecallhierarchy.adb index 7a36ee24f..b6dc82bb0 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-preparecallhierarchy.adb +++ b/source/lsp_3.17/generated/lsp-server_requests-preparecallhierarchy.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Requests.PrepareCallHierarchy is diff --git a/source/lsp_3.17/generated/lsp-server_requests-preparecallhierarchy.ads b/source/lsp_3.17/generated/lsp-server_requests-preparecallhierarchy.ads index b366d7449..954458f65 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-preparecallhierarchy.ads +++ b/source/lsp_3.17/generated/lsp-server_requests-preparecallhierarchy.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_requests-preparerename.adb b/source/lsp_3.17/generated/lsp-server_requests-preparerename.adb index da6afaa97..1f5b6d116 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-preparerename.adb +++ b/source/lsp_3.17/generated/lsp-server_requests-preparerename.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Requests.PrepareRename is diff --git a/source/lsp_3.17/generated/lsp-server_requests-preparerename.ads b/source/lsp_3.17/generated/lsp-server_requests-preparerename.ads index 05aab8243..9572c4a61 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-preparerename.ads +++ b/source/lsp_3.17/generated/lsp-server_requests-preparerename.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_requests-preparetypehierarchy.adb b/source/lsp_3.17/generated/lsp-server_requests-preparetypehierarchy.adb index be317b5cc..527635f9d 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-preparetypehierarchy.adb +++ b/source/lsp_3.17/generated/lsp-server_requests-preparetypehierarchy.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Requests.PrepareTypeHierarchy is diff --git a/source/lsp_3.17/generated/lsp-server_requests-preparetypehierarchy.ads b/source/lsp_3.17/generated/lsp-server_requests-preparetypehierarchy.ads index 263370245..ab22eb752 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-preparetypehierarchy.ads +++ b/source/lsp_3.17/generated/lsp-server_requests-preparetypehierarchy.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_requests-rangeformatting.adb b/source/lsp_3.17/generated/lsp-server_requests-rangeformatting.adb index 3c295545e..df584741c 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-rangeformatting.adb +++ b/source/lsp_3.17/generated/lsp-server_requests-rangeformatting.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Requests.RangeFormatting is diff --git a/source/lsp_3.17/generated/lsp-server_requests-rangeformatting.ads b/source/lsp_3.17/generated/lsp-server_requests-rangeformatting.ads index 534776d33..6ccb57dc0 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-rangeformatting.ads +++ b/source/lsp_3.17/generated/lsp-server_requests-rangeformatting.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_requests-references.adb b/source/lsp_3.17/generated/lsp-server_requests-references.adb index bebb95712..e5a0be214 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-references.adb +++ b/source/lsp_3.17/generated/lsp-server_requests-references.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Requests.References is diff --git a/source/lsp_3.17/generated/lsp-server_requests-references.ads b/source/lsp_3.17/generated/lsp-server_requests-references.ads index 33be4802b..7392e9cc2 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-references.ads +++ b/source/lsp_3.17/generated/lsp-server_requests-references.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_requests-rename.adb b/source/lsp_3.17/generated/lsp-server_requests-rename.adb index 4bccb0996..f0247586c 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-rename.adb +++ b/source/lsp_3.17/generated/lsp-server_requests-rename.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Requests.Rename is diff --git a/source/lsp_3.17/generated/lsp-server_requests-rename.ads b/source/lsp_3.17/generated/lsp-server_requests-rename.ads index 87e261be1..40fee7e3b 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-rename.ads +++ b/source/lsp_3.17/generated/lsp-server_requests-rename.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_requests-selectionrange.adb b/source/lsp_3.17/generated/lsp-server_requests-selectionrange.adb index 94c91dc6b..2e924df3e 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-selectionrange.adb +++ b/source/lsp_3.17/generated/lsp-server_requests-selectionrange.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Requests.SelectionRange is diff --git a/source/lsp_3.17/generated/lsp-server_requests-selectionrange.ads b/source/lsp_3.17/generated/lsp-server_requests-selectionrange.ads index 21ebbbd81..a42b9e749 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-selectionrange.ads +++ b/source/lsp_3.17/generated/lsp-server_requests-selectionrange.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_requests-shutdown.adb b/source/lsp_3.17/generated/lsp-server_requests-shutdown.adb index ae064350a..426405741 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-shutdown.adb +++ b/source/lsp_3.17/generated/lsp-server_requests-shutdown.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Requests.Shutdown is diff --git a/source/lsp_3.17/generated/lsp-server_requests-shutdown.ads b/source/lsp_3.17/generated/lsp-server_requests-shutdown.ads index 412009ab5..eb519ac79 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-shutdown.ads +++ b/source/lsp_3.17/generated/lsp-server_requests-shutdown.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package LSP.Server_Requests.Shutdown is pragma Preelaborate; diff --git a/source/lsp_3.17/generated/lsp-server_requests-signaturehelp.adb b/source/lsp_3.17/generated/lsp-server_requests-signaturehelp.adb index 727f5d537..1fc4c7e96 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-signaturehelp.adb +++ b/source/lsp_3.17/generated/lsp-server_requests-signaturehelp.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Requests.SignatureHelp is diff --git a/source/lsp_3.17/generated/lsp-server_requests-signaturehelp.ads b/source/lsp_3.17/generated/lsp-server_requests-signaturehelp.ads index e5dd80920..9427923ff 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-signaturehelp.ads +++ b/source/lsp_3.17/generated/lsp-server_requests-signaturehelp.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_requests-subtypes.adb b/source/lsp_3.17/generated/lsp-server_requests-subtypes.adb index 513329e6c..d6640cc5c 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-subtypes.adb +++ b/source/lsp_3.17/generated/lsp-server_requests-subtypes.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Requests.Subtypes is diff --git a/source/lsp_3.17/generated/lsp-server_requests-subtypes.ads b/source/lsp_3.17/generated/lsp-server_requests-subtypes.ads index 39a9a70eb..03c9cd5a8 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-subtypes.ads +++ b/source/lsp_3.17/generated/lsp-server_requests-subtypes.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_requests-supertypes.adb b/source/lsp_3.17/generated/lsp-server_requests-supertypes.adb index 6264649f1..79eeebc73 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-supertypes.adb +++ b/source/lsp_3.17/generated/lsp-server_requests-supertypes.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Requests.Supertypes is diff --git a/source/lsp_3.17/generated/lsp-server_requests-supertypes.ads b/source/lsp_3.17/generated/lsp-server_requests-supertypes.ads index b22d59ca8..4a90a7698 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-supertypes.ads +++ b/source/lsp_3.17/generated/lsp-server_requests-supertypes.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_requests-symbol.adb b/source/lsp_3.17/generated/lsp-server_requests-symbol.adb index 04faefeaf..98a727de4 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-symbol.adb +++ b/source/lsp_3.17/generated/lsp-server_requests-symbol.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Requests.Symbol is diff --git a/source/lsp_3.17/generated/lsp-server_requests-symbol.ads b/source/lsp_3.17/generated/lsp-server_requests-symbol.ads index 073ec2349..a27061e27 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-symbol.ads +++ b/source/lsp_3.17/generated/lsp-server_requests-symbol.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_requests-symbol_resolve.adb b/source/lsp_3.17/generated/lsp-server_requests-symbol_resolve.adb index 31fa3987f..e675cae42 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-symbol_resolve.adb +++ b/source/lsp_3.17/generated/lsp-server_requests-symbol_resolve.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Requests.Symbol_Resolve is diff --git a/source/lsp_3.17/generated/lsp-server_requests-symbol_resolve.ads b/source/lsp_3.17/generated/lsp-server_requests-symbol_resolve.ads index e1aa3627a..03e3493e7 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-symbol_resolve.ads +++ b/source/lsp_3.17/generated/lsp-server_requests-symbol_resolve.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_requests-tokens_delta.adb b/source/lsp_3.17/generated/lsp-server_requests-tokens_delta.adb index 8703a1688..c0d9e7368 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-tokens_delta.adb +++ b/source/lsp_3.17/generated/lsp-server_requests-tokens_delta.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Requests.Tokens_Delta is diff --git a/source/lsp_3.17/generated/lsp-server_requests-tokens_delta.ads b/source/lsp_3.17/generated/lsp-server_requests-tokens_delta.ads index 92683bc6a..a7a911d05 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-tokens_delta.ads +++ b/source/lsp_3.17/generated/lsp-server_requests-tokens_delta.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_requests-tokens_range.adb b/source/lsp_3.17/generated/lsp-server_requests-tokens_range.adb index fe3e3dd54..93bf5d6da 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-tokens_range.adb +++ b/source/lsp_3.17/generated/lsp-server_requests-tokens_range.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Requests.Tokens_Range is diff --git a/source/lsp_3.17/generated/lsp-server_requests-tokens_range.ads b/source/lsp_3.17/generated/lsp-server_requests-tokens_range.ads index 3745ec8e0..ced933cee 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-tokens_range.ads +++ b/source/lsp_3.17/generated/lsp-server_requests-tokens_range.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_requests-typedefinition.adb b/source/lsp_3.17/generated/lsp-server_requests-typedefinition.adb index 75262a401..4af9ae9ab 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-typedefinition.adb +++ b/source/lsp_3.17/generated/lsp-server_requests-typedefinition.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Requests.TypeDefinition is diff --git a/source/lsp_3.17/generated/lsp-server_requests-typedefinition.ads b/source/lsp_3.17/generated/lsp-server_requests-typedefinition.ads index f7576c7b4..e7a92a981 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-typedefinition.ads +++ b/source/lsp_3.17/generated/lsp-server_requests-typedefinition.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_requests-willcreatefiles.adb b/source/lsp_3.17/generated/lsp-server_requests-willcreatefiles.adb index 8b03a5a81..c3c070e9a 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-willcreatefiles.adb +++ b/source/lsp_3.17/generated/lsp-server_requests-willcreatefiles.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Requests.WillCreateFiles is diff --git a/source/lsp_3.17/generated/lsp-server_requests-willcreatefiles.ads b/source/lsp_3.17/generated/lsp-server_requests-willcreatefiles.ads index 293ccd061..b49051f76 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-willcreatefiles.ads +++ b/source/lsp_3.17/generated/lsp-server_requests-willcreatefiles.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_requests-willdeletefiles.adb b/source/lsp_3.17/generated/lsp-server_requests-willdeletefiles.adb index 3fcb5ef69..d6c980931 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-willdeletefiles.adb +++ b/source/lsp_3.17/generated/lsp-server_requests-willdeletefiles.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Requests.WillDeleteFiles is diff --git a/source/lsp_3.17/generated/lsp-server_requests-willdeletefiles.ads b/source/lsp_3.17/generated/lsp-server_requests-willdeletefiles.ads index d58149557..a701e1068 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-willdeletefiles.ads +++ b/source/lsp_3.17/generated/lsp-server_requests-willdeletefiles.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_requests-willrenamefiles.adb b/source/lsp_3.17/generated/lsp-server_requests-willrenamefiles.adb index 8c413e053..abc7282b9 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-willrenamefiles.adb +++ b/source/lsp_3.17/generated/lsp-server_requests-willrenamefiles.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Requests.WillRenameFiles is diff --git a/source/lsp_3.17/generated/lsp-server_requests-willrenamefiles.ads b/source/lsp_3.17/generated/lsp-server_requests-willrenamefiles.ads index 4a81249f5..543c600b0 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-willrenamefiles.ads +++ b/source/lsp_3.17/generated/lsp-server_requests-willrenamefiles.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_requests-willsavewaituntil.adb b/source/lsp_3.17/generated/lsp-server_requests-willsavewaituntil.adb index 7b091c9fa..72e11baf0 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-willsavewaituntil.adb +++ b/source/lsp_3.17/generated/lsp-server_requests-willsavewaituntil.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Requests.WillSaveWaitUntil is diff --git a/source/lsp_3.17/generated/lsp-server_requests-willsavewaituntil.ads b/source/lsp_3.17/generated/lsp-server_requests-willsavewaituntil.ads index a7cf07dfc..a585936c7 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-willsavewaituntil.ads +++ b/source/lsp_3.17/generated/lsp-server_requests-willsavewaituntil.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_requests-workspace_diagnostic.adb b/source/lsp_3.17/generated/lsp-server_requests-workspace_diagnostic.adb index 82d59cc60..eab7675f2 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-workspace_diagnostic.adb +++ b/source/lsp_3.17/generated/lsp-server_requests-workspace_diagnostic.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Requests.Workspace_Diagnostic is diff --git a/source/lsp_3.17/generated/lsp-server_requests-workspace_diagnostic.ads b/source/lsp_3.17/generated/lsp-server_requests-workspace_diagnostic.ads index 7bbcf9d1e..3888054f4 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-workspace_diagnostic.ads +++ b/source/lsp_3.17/generated/lsp-server_requests-workspace_diagnostic.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_response_readers.adb b/source/lsp_3.17/generated/lsp-server_response_readers.adb index ccbe07ce1..33dd0d4f2 100644 --- a/source/lsp_3.17/generated/lsp-server_response_readers.adb +++ b/source/lsp_3.17/generated/lsp-server_response_readers.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with Minimal_Perfect_Hash; with LSP.Inputs; @@ -27,18 +29,18 @@ package body LSP.Server_Response_Readers is package Method_Map is new Minimal_Perfect_Hash (["client/registerCapability", - "client/unregisterCapability", - "window/showDocument", - "window/showMessageRequest", - "window/workDoneProgress/create", - "workspace/applyEdit", - "workspace/codeLens/refresh", - "workspace/configuration", - "workspace/diagnostic/refresh", - "workspace/inlayHint/refresh", - "workspace/inlineValue/refresh", - "workspace/semanticTokens/refresh", - "workspace/workspaceFolders"]); + "client/unregisterCapability", + "window/showDocument", + "window/showMessageRequest", + "window/workDoneProgress/create", + "workspace/applyEdit", + "workspace/codeLens/refresh", + "workspace/configuration", + "workspace/diagnostic/refresh", + "workspace/inlayHint/refresh", + "workspace/inlineValue/refresh", + "workspace/semanticTokens/refresh", + "workspace/workspaceFolders"]); procedure Initialize is begin diff --git a/source/lsp_3.17/generated/lsp-server_response_receivers.ads b/source/lsp_3.17/generated/lsp-server_response_receivers.ads index 1f5dcd239..e6971db3c 100644 --- a/source/lsp_3.17/generated/lsp-server_response_receivers.ads +++ b/source/lsp_3.17/generated/lsp-server_response_receivers.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Errors; with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_response_writers.adb b/source/lsp_3.17/generated/lsp-server_response_writers.adb index 7070fc2ae..09713a7e6 100644 --- a/source/lsp_3.17/generated/lsp-server_response_writers.adb +++ b/source/lsp_3.17/generated/lsp-server_response_writers.adb @@ -3,6 +3,10 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- + +with Interfaces; with LSP.Output_Tools; with LSP.Outputs; @@ -162,7 +166,7 @@ package body LSP.Server_Response_Writers is Self.Output.Key_Name ("error"); Self.Output.Start_Object; Self.Output.Key_Name ("code"); - LSP.Outputs.Write_ErrorCodes (Self.Output.all, Value.code); + Self.Output.Integer_Value (Interfaces.Integer_64'Val (Value.code)); Self.Output.Key_Name ("message"); Self.Output.String_Value (Value.message); Self.Output.End_Object; diff --git a/source/lsp_3.17/generated/lsp-server_response_writers.ads b/source/lsp_3.17/generated/lsp-server_response_writers.ads index a7bcaf797..4141812fc 100644 --- a/source/lsp_3.17/generated/lsp-server_response_writers.ads +++ b/source/lsp_3.17/generated/lsp-server_response_writers.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with VSS.JSON.Content_Handlers; diff --git a/source/lsp_3.17/generated/lsp-server_responses-applyedit.adb b/source/lsp_3.17/generated/lsp-server_responses-applyedit.adb index fff8f3de0..f7a45fe26 100644 --- a/source/lsp_3.17/generated/lsp-server_responses-applyedit.adb +++ b/source/lsp_3.17/generated/lsp-server_responses-applyedit.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Responses.ApplyEdit is diff --git a/source/lsp_3.17/generated/lsp-server_responses-applyedit.ads b/source/lsp_3.17/generated/lsp-server_responses-applyedit.ads index fd1dbfcdd..74906acc5 100644 --- a/source/lsp_3.17/generated/lsp-server_responses-applyedit.ads +++ b/source/lsp_3.17/generated/lsp-server_responses-applyedit.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_responses-code_lens_refresh.adb b/source/lsp_3.17/generated/lsp-server_responses-code_lens_refresh.adb index be80422f9..05c00ef1f 100644 --- a/source/lsp_3.17/generated/lsp-server_responses-code_lens_refresh.adb +++ b/source/lsp_3.17/generated/lsp-server_responses-code_lens_refresh.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Responses.Code_Lens_Refresh is diff --git a/source/lsp_3.17/generated/lsp-server_responses-code_lens_refresh.ads b/source/lsp_3.17/generated/lsp-server_responses-code_lens_refresh.ads index 93d73809d..a3f5b8dc3 100644 --- a/source/lsp_3.17/generated/lsp-server_responses-code_lens_refresh.ads +++ b/source/lsp_3.17/generated/lsp-server_responses-code_lens_refresh.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_responses-configuration.adb b/source/lsp_3.17/generated/lsp-server_responses-configuration.adb index cd9254243..f2c083107 100644 --- a/source/lsp_3.17/generated/lsp-server_responses-configuration.adb +++ b/source/lsp_3.17/generated/lsp-server_responses-configuration.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Responses.Configuration is diff --git a/source/lsp_3.17/generated/lsp-server_responses-configuration.ads b/source/lsp_3.17/generated/lsp-server_responses-configuration.ads index f3bcadb73..bc5a0f5b6 100644 --- a/source/lsp_3.17/generated/lsp-server_responses-configuration.ads +++ b/source/lsp_3.17/generated/lsp-server_responses-configuration.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_responses-diagnostic_refresh.adb b/source/lsp_3.17/generated/lsp-server_responses-diagnostic_refresh.adb index 05077b2a7..de729366f 100644 --- a/source/lsp_3.17/generated/lsp-server_responses-diagnostic_refresh.adb +++ b/source/lsp_3.17/generated/lsp-server_responses-diagnostic_refresh.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Responses.Diagnostic_Refresh is diff --git a/source/lsp_3.17/generated/lsp-server_responses-diagnostic_refresh.ads b/source/lsp_3.17/generated/lsp-server_responses-diagnostic_refresh.ads index 933681016..b23741e90 100644 --- a/source/lsp_3.17/generated/lsp-server_responses-diagnostic_refresh.ads +++ b/source/lsp_3.17/generated/lsp-server_responses-diagnostic_refresh.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_responses-inlay_refresh.adb b/source/lsp_3.17/generated/lsp-server_responses-inlay_refresh.adb index 0c3e3e3ee..683c0fcfb 100644 --- a/source/lsp_3.17/generated/lsp-server_responses-inlay_refresh.adb +++ b/source/lsp_3.17/generated/lsp-server_responses-inlay_refresh.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Responses.Inlay_Refresh is diff --git a/source/lsp_3.17/generated/lsp-server_responses-inlay_refresh.ads b/source/lsp_3.17/generated/lsp-server_responses-inlay_refresh.ads index 83ce351de..5ea1f003d 100644 --- a/source/lsp_3.17/generated/lsp-server_responses-inlay_refresh.ads +++ b/source/lsp_3.17/generated/lsp-server_responses-inlay_refresh.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_responses-inline_refresh.adb b/source/lsp_3.17/generated/lsp-server_responses-inline_refresh.adb index b9abb3fca..11729f22b 100644 --- a/source/lsp_3.17/generated/lsp-server_responses-inline_refresh.adb +++ b/source/lsp_3.17/generated/lsp-server_responses-inline_refresh.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Responses.Inline_Refresh is diff --git a/source/lsp_3.17/generated/lsp-server_responses-inline_refresh.ads b/source/lsp_3.17/generated/lsp-server_responses-inline_refresh.ads index 88f7b5297..e9c9e9070 100644 --- a/source/lsp_3.17/generated/lsp-server_responses-inline_refresh.ads +++ b/source/lsp_3.17/generated/lsp-server_responses-inline_refresh.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_responses-progress_create.adb b/source/lsp_3.17/generated/lsp-server_responses-progress_create.adb index 22b3ed326..e284c3c60 100644 --- a/source/lsp_3.17/generated/lsp-server_responses-progress_create.adb +++ b/source/lsp_3.17/generated/lsp-server_responses-progress_create.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Responses.Progress_Create is diff --git a/source/lsp_3.17/generated/lsp-server_responses-progress_create.ads b/source/lsp_3.17/generated/lsp-server_responses-progress_create.ads index 40f8064da..7f82c1eb2 100644 --- a/source/lsp_3.17/generated/lsp-server_responses-progress_create.ads +++ b/source/lsp_3.17/generated/lsp-server_responses-progress_create.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_responses-registercapability.adb b/source/lsp_3.17/generated/lsp-server_responses-registercapability.adb index bd658c97d..4c6ba0ff3 100644 --- a/source/lsp_3.17/generated/lsp-server_responses-registercapability.adb +++ b/source/lsp_3.17/generated/lsp-server_responses-registercapability.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Responses.RegisterCapability is diff --git a/source/lsp_3.17/generated/lsp-server_responses-registercapability.ads b/source/lsp_3.17/generated/lsp-server_responses-registercapability.ads index b14213f0f..4f7cc7ab9 100644 --- a/source/lsp_3.17/generated/lsp-server_responses-registercapability.ads +++ b/source/lsp_3.17/generated/lsp-server_responses-registercapability.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_responses-showdocument.adb b/source/lsp_3.17/generated/lsp-server_responses-showdocument.adb index f95b80760..7009e107d 100644 --- a/source/lsp_3.17/generated/lsp-server_responses-showdocument.adb +++ b/source/lsp_3.17/generated/lsp-server_responses-showdocument.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Responses.ShowDocument is diff --git a/source/lsp_3.17/generated/lsp-server_responses-showdocument.ads b/source/lsp_3.17/generated/lsp-server_responses-showdocument.ads index 2a25a546c..7b04ca2cf 100644 --- a/source/lsp_3.17/generated/lsp-server_responses-showdocument.ads +++ b/source/lsp_3.17/generated/lsp-server_responses-showdocument.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_responses-showmessagerequest.adb b/source/lsp_3.17/generated/lsp-server_responses-showmessagerequest.adb index d2a1acf94..4f0b343ef 100644 --- a/source/lsp_3.17/generated/lsp-server_responses-showmessagerequest.adb +++ b/source/lsp_3.17/generated/lsp-server_responses-showmessagerequest.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Responses.ShowMessageRequest is diff --git a/source/lsp_3.17/generated/lsp-server_responses-showmessagerequest.ads b/source/lsp_3.17/generated/lsp-server_responses-showmessagerequest.ads index 19fe28468..d2fa87d3a 100644 --- a/source/lsp_3.17/generated/lsp-server_responses-showmessagerequest.ads +++ b/source/lsp_3.17/generated/lsp-server_responses-showmessagerequest.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_responses-tokens_refresh.adb b/source/lsp_3.17/generated/lsp-server_responses-tokens_refresh.adb index 39ac00c75..c4d952dae 100644 --- a/source/lsp_3.17/generated/lsp-server_responses-tokens_refresh.adb +++ b/source/lsp_3.17/generated/lsp-server_responses-tokens_refresh.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Responses.Tokens_Refresh is diff --git a/source/lsp_3.17/generated/lsp-server_responses-tokens_refresh.ads b/source/lsp_3.17/generated/lsp-server_responses-tokens_refresh.ads index 710fd445c..3a2a7389a 100644 --- a/source/lsp_3.17/generated/lsp-server_responses-tokens_refresh.ads +++ b/source/lsp_3.17/generated/lsp-server_responses-tokens_refresh.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_responses-unregistercapability.adb b/source/lsp_3.17/generated/lsp-server_responses-unregistercapability.adb index 7d539f11c..0b75b711d 100644 --- a/source/lsp_3.17/generated/lsp-server_responses-unregistercapability.adb +++ b/source/lsp_3.17/generated/lsp-server_responses-unregistercapability.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Responses.UnregisterCapability is diff --git a/source/lsp_3.17/generated/lsp-server_responses-unregistercapability.ads b/source/lsp_3.17/generated/lsp-server_responses-unregistercapability.ads index 3214be253..61308622d 100644 --- a/source/lsp_3.17/generated/lsp-server_responses-unregistercapability.ads +++ b/source/lsp_3.17/generated/lsp-server_responses-unregistercapability.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-server_responses-workspacefolders.adb b/source/lsp_3.17/generated/lsp-server_responses-workspacefolders.adb index 432e42f72..83051eba5 100644 --- a/source/lsp_3.17/generated/lsp-server_responses-workspacefolders.adb +++ b/source/lsp_3.17/generated/lsp-server_responses-workspacefolders.adb @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- package body LSP.Server_Responses.WorkspaceFolders is diff --git a/source/lsp_3.17/generated/lsp-server_responses-workspacefolders.ads b/source/lsp_3.17/generated/lsp-server_responses-workspacefolders.ads index d9d0ca2ab..7cd16749d 100644 --- a/source/lsp_3.17/generated/lsp-server_responses-workspacefolders.ads +++ b/source/lsp_3.17/generated/lsp-server_responses-workspacefolders.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with LSP.Structures; diff --git a/source/lsp_3.17/generated/lsp-structures.ads b/source/lsp_3.17/generated/lsp-structures.ads index 0a64b3828..cf3b5387d 100644 --- a/source/lsp_3.17/generated/lsp-structures.ads +++ b/source/lsp_3.17/generated/lsp-structures.ads @@ -3,6 +3,8 @@ -- -- SPDX-License-Identifier: MIT -- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- with Ada.Containers.Hashed_Maps; with Ada.Containers.Vectors; @@ -410,7 +412,7 @@ package LSP.Structures is new TextEdit_Vector_Maps.Map with null record; type documentChanges_OfWorkspaceEdit_Item_Variant is - (Varian_1, create, rename, delete); + (Variant_1, create, rename, delete); type documentChanges_OfWorkspaceEdit_Item (Kind : documentChanges_OfWorkspaceEdit_Item_Variant := @@ -418,8 +420,8 @@ package LSP.Structures is is record case Kind is - when Varian_1 => - Varian_1 : LSP.Structures.TextDocumentEdit; + when Variant_1 => + Variant_1 : LSP.Structures.TextDocumentEdit; when create => create : LSP.Structures.CreateFile; when rename => @@ -6320,7 +6322,7 @@ package LSP.Structures is end record; type declarationProvider_OfServerCapabilities_Variant is - (Varian_1, Varian_2, Varian_3); + (Variant_1, Variant_2, Variant_3); type declarationProvider_OfServerCapabilities (Kind : declarationProvider_OfServerCapabilities_Variant := @@ -6328,12 +6330,12 @@ package LSP.Structures is is record case Kind is - when Varian_1 => - Varian_1 : Standard.Boolean; - when Varian_2 => - Varian_2 : LSP.Structures.DeclarationOptions; - when Varian_3 => - Varian_3 : LSP.Structures.DeclarationRegistrationOptions; + when Variant_1 => + Variant_1 : Standard.Boolean; + when Variant_2 => + Variant_2 : LSP.Structures.DeclarationOptions; + when Variant_3 => + Variant_3 : LSP.Structures.DeclarationRegistrationOptions; end case; end record; @@ -6368,7 +6370,7 @@ package LSP.Structures is end record; type typeDefinitionProvider_OfServerCapabilities_Variant is - (Varian_1, Varian_2, Varian_3); + (Variant_1, Variant_2, Variant_3); type typeDefinitionProvider_OfServerCapabilities (Kind : typeDefinitionProvider_OfServerCapabilities_Variant := @@ -6376,12 +6378,12 @@ package LSP.Structures is is record case Kind is - when Varian_1 => - Varian_1 : Standard.Boolean; - when Varian_2 => - Varian_2 : LSP.Structures.TypeDefinitionOptions; - when Varian_3 => - Varian_3 : LSP.Structures.TypeDefinitionRegistrationOptions; + when Variant_1 => + Variant_1 : Standard.Boolean; + when Variant_2 => + Variant_2 : LSP.Structures.TypeDefinitionOptions; + when Variant_3 => + Variant_3 : LSP.Structures.TypeDefinitionRegistrationOptions; end case; end record; @@ -6397,7 +6399,7 @@ package LSP.Structures is end record; type implementationProvider_OfServerCapabilities_Variant is - (Varian_1, Varian_2, Varian_3); + (Variant_1, Variant_2, Variant_3); type implementationProvider_OfServerCapabilities (Kind : implementationProvider_OfServerCapabilities_Variant := @@ -6405,12 +6407,12 @@ package LSP.Structures is is record case Kind is - when Varian_1 => - Varian_1 : Standard.Boolean; - when Varian_2 => - Varian_2 : LSP.Structures.ImplementationOptions; - when Varian_3 => - Varian_3 : LSP.Structures.ImplementationRegistrationOptions; + when Variant_1 => + Variant_1 : Standard.Boolean; + when Variant_2 => + Variant_2 : LSP.Structures.ImplementationOptions; + when Variant_3 => + Variant_3 : LSP.Structures.ImplementationRegistrationOptions; end case; end record; @@ -6506,7 +6508,7 @@ package LSP.Structures is end record; type colorProvider_OfServerCapabilities_Variant is - (Varian_1, Varian_2, Varian_3); + (Variant_1, Variant_2, Variant_3); type colorProvider_OfServerCapabilities (Kind : colorProvider_OfServerCapabilities_Variant := @@ -6514,12 +6516,12 @@ package LSP.Structures is is record case Kind is - when Varian_1 => - Varian_1 : Standard.Boolean; - when Varian_2 => - Varian_2 : LSP.Structures.DocumentColorOptions; - when Varian_3 => - Varian_3 : LSP.Structures.DocumentColorRegistrationOptions; + when Variant_1 => + Variant_1 : Standard.Boolean; + when Variant_2 => + Variant_2 : LSP.Structures.DocumentColorOptions; + when Variant_3 => + Variant_3 : LSP.Structures.DocumentColorRegistrationOptions; end case; end record; @@ -6619,7 +6621,7 @@ package LSP.Structures is end record; type foldingRangeProvider_OfServerCapabilities_Variant is - (Varian_1, Varian_2, Varian_3); + (Variant_1, Variant_2, Variant_3); type foldingRangeProvider_OfServerCapabilities (Kind : foldingRangeProvider_OfServerCapabilities_Variant := @@ -6627,12 +6629,12 @@ package LSP.Structures is is record case Kind is - when Varian_1 => - Varian_1 : Standard.Boolean; - when Varian_2 => - Varian_2 : LSP.Structures.FoldingRangeOptions; - when Varian_3 => - Varian_3 : LSP.Structures.FoldingRangeRegistrationOptions; + when Variant_1 => + Variant_1 : Standard.Boolean; + when Variant_2 => + Variant_2 : LSP.Structures.FoldingRangeOptions; + when Variant_3 => + Variant_3 : LSP.Structures.FoldingRangeRegistrationOptions; end case; end record; @@ -6648,7 +6650,7 @@ package LSP.Structures is end record; type selectionRangeProvider_OfServerCapabilities_Variant is - (Varian_1, Varian_2, Varian_3); + (Variant_1, Variant_2, Variant_3); type selectionRangeProvider_OfServerCapabilities (Kind : selectionRangeProvider_OfServerCapabilities_Variant := @@ -6656,12 +6658,12 @@ package LSP.Structures is is record case Kind is - when Varian_1 => - Varian_1 : Standard.Boolean; - when Varian_2 => - Varian_2 : LSP.Structures.SelectionRangeOptions; - when Varian_3 => - Varian_3 : LSP.Structures.SelectionRangeRegistrationOptions; + when Variant_1 => + Variant_1 : Standard.Boolean; + when Variant_2 => + Variant_2 : LSP.Structures.SelectionRangeOptions; + when Variant_3 => + Variant_3 : LSP.Structures.SelectionRangeRegistrationOptions; end case; end record; @@ -6677,7 +6679,7 @@ package LSP.Structures is end record; type callHierarchyProvider_OfServerCapabilities_Variant is - (Varian_1, Varian_2, Varian_3); + (Variant_1, Variant_2, Variant_3); type callHierarchyProvider_OfServerCapabilities (Kind : callHierarchyProvider_OfServerCapabilities_Variant := @@ -6685,12 +6687,12 @@ package LSP.Structures is is record case Kind is - when Varian_1 => - Varian_1 : Standard.Boolean; - when Varian_2 => - Varian_2 : LSP.Structures.CallHierarchyOptions; - when Varian_3 => - Varian_3 : LSP.Structures.CallHierarchyRegistrationOptions; + when Variant_1 => + Variant_1 : Standard.Boolean; + when Variant_2 => + Variant_2 : LSP.Structures.CallHierarchyOptions; + when Variant_3 => + Variant_3 : LSP.Structures.CallHierarchyRegistrationOptions; end case; end record; @@ -6706,7 +6708,7 @@ package LSP.Structures is end record; type linkedEditingRangeProvider_OfServerCapabilities_Variant is - (Varian_1, Varian_2, Varian_3); + (Variant_1, Variant_2, Variant_3); type linkedEditingRangeProvider_OfServerCapabilities (Kind : linkedEditingRangeProvider_OfServerCapabilities_Variant := @@ -6714,12 +6716,12 @@ package LSP.Structures is is record case Kind is - when Varian_1 => - Varian_1 : Standard.Boolean; - when Varian_2 => - Varian_2 : LSP.Structures.LinkedEditingRangeOptions; - when Varian_3 => - Varian_3 : LSP.Structures.LinkedEditingRangeRegistrationOptions; + when Variant_1 => + Variant_1 : Standard.Boolean; + when Variant_2 => + Variant_2 : LSP.Structures.LinkedEditingRangeOptions; + when Variant_3 => + Variant_3 : LSP.Structures.LinkedEditingRangeRegistrationOptions; end case; end record; @@ -6758,7 +6760,7 @@ package LSP.Structures is end record; type monikerProvider_OfServerCapabilities_Variant is - (Varian_1, Varian_2, Varian_3); + (Variant_1, Variant_2, Variant_3); type monikerProvider_OfServerCapabilities (Kind : monikerProvider_OfServerCapabilities_Variant := @@ -6766,12 +6768,12 @@ package LSP.Structures is is record case Kind is - when Varian_1 => - Varian_1 : Standard.Boolean; - when Varian_2 => - Varian_2 : LSP.Structures.MonikerOptions; - when Varian_3 => - Varian_3 : LSP.Structures.MonikerRegistrationOptions; + when Variant_1 => + Variant_1 : Standard.Boolean; + when Variant_2 => + Variant_2 : LSP.Structures.MonikerOptions; + when Variant_3 => + Variant_3 : LSP.Structures.MonikerRegistrationOptions; end case; end record; @@ -6787,7 +6789,7 @@ package LSP.Structures is end record; type typeHierarchyProvider_OfServerCapabilities_Variant is - (Varian_1, Varian_2, Varian_3); + (Variant_1, Variant_2, Variant_3); type typeHierarchyProvider_OfServerCapabilities (Kind : typeHierarchyProvider_OfServerCapabilities_Variant := @@ -6795,12 +6797,12 @@ package LSP.Structures is is record case Kind is - when Varian_1 => - Varian_1 : Standard.Boolean; - when Varian_2 => - Varian_2 : LSP.Structures.TypeHierarchyOptions; - when Varian_3 => - Varian_3 : LSP.Structures.TypeHierarchyRegistrationOptions; + when Variant_1 => + Variant_1 : Standard.Boolean; + when Variant_2 => + Variant_2 : LSP.Structures.TypeHierarchyOptions; + when Variant_3 => + Variant_3 : LSP.Structures.TypeHierarchyRegistrationOptions; end case; end record; @@ -6816,7 +6818,7 @@ package LSP.Structures is end record; type inlineValueProvider_OfServerCapabilities_Variant is - (Varian_1, Varian_2, Varian_3); + (Variant_1, Variant_2, Variant_3); type inlineValueProvider_OfServerCapabilities (Kind : inlineValueProvider_OfServerCapabilities_Variant := @@ -6824,12 +6826,12 @@ package LSP.Structures is is record case Kind is - when Varian_1 => - Varian_1 : Standard.Boolean; - when Varian_2 => - Varian_2 : LSP.Structures.InlineValueOptions; - when Varian_3 => - Varian_3 : LSP.Structures.InlineValueRegistrationOptions; + when Variant_1 => + Variant_1 : Standard.Boolean; + when Variant_2 => + Variant_2 : LSP.Structures.InlineValueOptions; + when Variant_3 => + Variant_3 : LSP.Structures.InlineValueRegistrationOptions; end case; end record; @@ -6845,7 +6847,7 @@ package LSP.Structures is end record; type inlayHintProvider_OfServerCapabilities_Variant is - (Varian_1, Varian_2, Varian_3); + (Variant_1, Variant_2, Variant_3); type inlayHintProvider_OfServerCapabilities (Kind : inlayHintProvider_OfServerCapabilities_Variant := @@ -6853,12 +6855,12 @@ package LSP.Structures is is record case Kind is - when Varian_1 => - Varian_1 : Standard.Boolean; - when Varian_2 => - Varian_2 : LSP.Structures.InlayHintOptions; - when Varian_3 => - Varian_3 : LSP.Structures.InlayHintRegistrationOptions; + when Variant_1 => + Variant_1 : Standard.Boolean; + when Variant_2 => + Variant_2 : LSP.Structures.InlayHintOptions; + when Variant_3 => + Variant_3 : LSP.Structures.InlayHintRegistrationOptions; end case; end record; @@ -8522,18 +8524,18 @@ package LSP.Structures is -- -- @since 3.17.0 - type InlineValue_Variant is (Varian_1, Varian_2, Varian_3); + type InlineValue_Variant is (Variant_1, Variant_2, Variant_3); type InlineValue (Kind : InlineValue_Variant := InlineValue_Variant'First) is record case Kind is - when Varian_1 => - Varian_1 : LSP.Structures.InlineValueText; - when Varian_2 => - Varian_2 : LSP.Structures.InlineValueVariableLookup; - when Varian_3 => - Varian_3 : LSP.Structures.InlineValueEvaluatableExpression; + when Variant_1 => + Variant_1 : LSP.Structures.InlineValueText; + when Variant_2 => + Variant_2 : LSP.Structures.InlineValueVariableLookup; + when Variant_3 => + Variant_3 : LSP.Structures.InlineValueEvaluatableExpression; end case; end record; -- Inline value information can be provided by different means: - directly @@ -8556,19 +8558,19 @@ package LSP.Structures is end record; - type PrepareRenameResult_Variant is (Varian_1, Varian_2, Varian_3); + type PrepareRenameResult_Variant is (Variant_1, Variant_2, Variant_3); type PrepareRenameResult (Kind : PrepareRenameResult_Variant := PrepareRenameResult_Variant'First) is record case Kind is - when Varian_1 => - Varian_1 : LSP.Structures.A_Range; - when Varian_2 => - Varian_2 : LSP.Structures.PrepareRenameResult_2; - when Varian_3 => - Varian_3 : LSP.Structures.PrepareRenameResult_3; + when Variant_1 => + Variant_1 : LSP.Structures.A_Range; + when Variant_2 => + Variant_2 : LSP.Structures.PrepareRenameResult_2; + when Variant_3 => + Variant_3 : LSP.Structures.PrepareRenameResult_3; end case; end record; @@ -8621,18 +8623,18 @@ package LSP.Structures is type ColorPresentation_Vector is new ColorPresentation_Vectors.Vector with null record; - type Completion_Result_Variant is (Varian_1, Varian_2, Varian_3); + type Completion_Result_Variant is (Variant_1, Variant_2, Variant_3); type Completion_Result (Kind : Completion_Result_Variant := Completion_Result_Variant'First) is record case Kind is - when Varian_1 => - Varian_1 : LSP.Structures.CompletionItem_Vector; - when Varian_2 => - Varian_2 : LSP.Structures.CompletionList; - when Varian_3 => - Varian_3 : LSP.Structures.Null_Record; + when Variant_1 => + Variant_1 : LSP.Structures.CompletionItem_Vector; + when Variant_2 => + Variant_2 : LSP.Structures.CompletionList; + when Variant_3 => + Variant_3 : LSP.Structures.Null_Record; end case; end record; @@ -8642,22 +8644,22 @@ package LSP.Structures is type DeclarationLink_Vector is new DeclarationLink_Vectors.Vector with null record; - type Declaration_Result_Variant is (Varian_1, Varian_2, Varian_3); + type Declaration_Result_Variant is (Variant_1, Variant_2, Variant_3); type Declaration_Result (Kind : Declaration_Result_Variant := Declaration_Result_Variant'First) is record case Kind is - when Varian_1 => - Varian_1 : LSP.Structures.Declaration; - when Varian_2 => - Varian_2 : LSP.Structures.DeclarationLink_Vector; - when Varian_3 => - Varian_3 : LSP.Structures.Null_Record; + when Variant_1 => + Variant_1 : LSP.Structures.Declaration; + when Variant_2 => + Variant_2 : LSP.Structures.DeclarationLink_Vector; + when Variant_3 => + Variant_3 : LSP.Structures.Null_Record; end case; end record; - type Declaration_Progress_Report_Variant is (Varian_1, Varian_2); + type Declaration_Progress_Report_Variant is (Variant_1, Variant_2); type Declaration_Progress_Report (Kind : Declaration_Progress_Report_Variant := @@ -8665,10 +8667,10 @@ package LSP.Structures is is record case Kind is - when Varian_1 => - Varian_1 : LSP.Structures.Location_Vector; - when Varian_2 => - Varian_2 : LSP.Structures.DeclarationLink_Vector; + when Variant_1 => + Variant_1 : LSP.Structures.Location_Vector; + when Variant_2 => + Variant_2 : LSP.Structures.DeclarationLink_Vector; end case; end record; @@ -8678,22 +8680,22 @@ package LSP.Structures is type DefinitionLink_Vector is new DefinitionLink_Vectors.Vector with null record; - type Definition_Result_Variant is (Varian_1, Varian_2, Varian_3); + type Definition_Result_Variant is (Variant_1, Variant_2, Variant_3); type Definition_Result (Kind : Definition_Result_Variant := Definition_Result_Variant'First) is record case Kind is - when Varian_1 => - Varian_1 : LSP.Structures.Definition; - when Varian_2 => - Varian_2 : LSP.Structures.DefinitionLink_Vector; - when Varian_3 => - Varian_3 : LSP.Structures.Null_Record; + when Variant_1 => + Variant_1 : LSP.Structures.Definition; + when Variant_2 => + Variant_2 : LSP.Structures.DefinitionLink_Vector; + when Variant_3 => + Variant_3 : LSP.Structures.Null_Record; end case; end record; - type Definition_Progress_Report_Variant is (Varian_1, Varian_2); + type Definition_Progress_Report_Variant is (Variant_1, Variant_2); type Definition_Progress_Report (Kind : Definition_Progress_Report_Variant := @@ -8701,10 +8703,10 @@ package LSP.Structures is is record case Kind is - when Varian_1 => - Varian_1 : LSP.Structures.Location_Vector; - when Varian_2 => - Varian_2 : LSP.Structures.DefinitionLink_Vector; + when Variant_1 => + Variant_1 : LSP.Structures.Location_Vector; + when Variant_2 => + Variant_2 : LSP.Structures.DefinitionLink_Vector; end case; end record; @@ -8736,7 +8738,7 @@ package LSP.Structures is type SymbolInformation_Vector is new SymbolInformation_Vectors.Vector with null record; - type DocumentSymbol_Result_Variant is (Varian_1, Varian_2, Varian_3); + type DocumentSymbol_Result_Variant is (Variant_1, Variant_2, Variant_3); type DocumentSymbol_Result (Kind : DocumentSymbol_Result_Variant := @@ -8744,16 +8746,16 @@ package LSP.Structures is is record case Kind is - when Varian_1 => - Varian_1 : LSP.Structures.SymbolInformation_Vector; - when Varian_2 => - Varian_2 : LSP.Structures.DocumentSymbol_Vector; - when Varian_3 => - Varian_3 : LSP.Structures.Null_Record; + when Variant_1 => + Variant_1 : LSP.Structures.SymbolInformation_Vector; + when Variant_2 => + Variant_2 : LSP.Structures.DocumentSymbol_Vector; + when Variant_3 => + Variant_3 : LSP.Structures.Null_Record; end case; end record; - type DocumentSymbol_Progress_Report_Variant is (Varian_1, Varian_2); + type DocumentSymbol_Progress_Report_Variant is (Variant_1, Variant_2); type DocumentSymbol_Progress_Report (Kind : DocumentSymbol_Progress_Report_Variant := @@ -8761,10 +8763,10 @@ package LSP.Structures is is record case Kind is - when Varian_1 => - Varian_1 : LSP.Structures.SymbolInformation_Vector; - when Varian_2 => - Varian_2 : LSP.Structures.DocumentSymbol_Vector; + when Variant_1 => + Variant_1 : LSP.Structures.SymbolInformation_Vector; + when Variant_2 => + Variant_2 : LSP.Structures.DocumentSymbol_Vector; end case; end record; @@ -8868,19 +8870,19 @@ package LSP.Structures is end case; end record; - type Tokens_Delta_Result_Variant is (Varian_1, Varian_2, Varian_3); + type Tokens_Delta_Result_Variant is (Variant_1, Variant_2, Variant_3); type Tokens_Delta_Result (Kind : Tokens_Delta_Result_Variant := Tokens_Delta_Result_Variant'First) is record case Kind is - when Varian_1 => - Varian_1 : LSP.Structures.SemanticTokens; - when Varian_2 => - Varian_2 : LSP.Structures.SemanticTokensDelta; - when Varian_3 => - Varian_3 : LSP.Structures.Null_Record; + when Variant_1 => + Variant_1 : LSP.Structures.SemanticTokens; + when Variant_2 => + Variant_2 : LSP.Structures.SemanticTokensDelta; + when Variant_3 => + Variant_3 : LSP.Structures.Null_Record; end case; end record; @@ -8930,22 +8932,22 @@ package LSP.Structures is type WorkspaceSymbol_Vector is new WorkspaceSymbol_Vectors.Vector with null record; - type Symbol_Result_Variant is (Varian_1, Varian_2, Varian_3); + type Symbol_Result_Variant is (Variant_1, Variant_2, Variant_3); type Symbol_Result (Kind : Symbol_Result_Variant := Symbol_Result_Variant'First) is record case Kind is - when Varian_1 => - Varian_1 : LSP.Structures.SymbolInformation_Vector; - when Varian_2 => - Varian_2 : LSP.Structures.WorkspaceSymbol_Vector; - when Varian_3 => - Varian_3 : LSP.Structures.Null_Record; + when Variant_1 => + Variant_1 : LSP.Structures.SymbolInformation_Vector; + when Variant_2 => + Variant_2 : LSP.Structures.WorkspaceSymbol_Vector; + when Variant_3 => + Variant_3 : LSP.Structures.Null_Record; end case; end record; - type Symbol_Progress_Report_Variant is (Varian_1, Varian_2); + type Symbol_Progress_Report_Variant is (Variant_1, Variant_2); type Symbol_Progress_Report (Kind : Symbol_Progress_Report_Variant := @@ -8953,10 +8955,10 @@ package LSP.Structures is is record case Kind is - when Varian_1 => - Varian_1 : LSP.Structures.SymbolInformation_Vector; - when Varian_2 => - Varian_2 : LSP.Structures.WorkspaceSymbol_Vector; + when Variant_1 => + Variant_1 : LSP.Structures.SymbolInformation_Vector; + when Variant_2 => + Variant_2 : LSP.Structures.WorkspaceSymbol_Vector; end case; end record; From 7b8d655d9c8772d4c35a510a767b3cc9fcaab630 Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Tue, 29 Aug 2023 12:22:56 +0300 Subject: [PATCH 066/152] Update sources after changes in generated files Refs #1172 --- ...ada_handlers-named_parameters_commands.adb | 13 ++--- source/ada/lsp-ada_handlers-refactor.adb | 5 +- source/ada/lsp-ada_handlers-renaming.adb | 22 ++++---- source/ada/lsp-ada_handlers.adb | 48 +++++++++--------- source/ada/lsp-ada_indexing.adb | 26 ++-------- source/lsp_3.17/lsp-constants.ads | 50 +++++++++++++++++-- source/lsp_3.17/lsp-errors.ads | 4 +- source/lsp_3.17/lsp-input_tools.adb | 4 +- source/lsp_3.17/lsp-input_tools.ads | 2 +- source/lsp_3.17/lsp-output_tools.adb | 4 +- source/lsp_3.17/lsp-output_tools.ads | 2 +- source/lsp_3.17/lsp-progress_reports.ads | 2 +- source/server/lsp-lifecycle_checkers.adb | 4 +- source/server/lsp-servers.adb | 16 +++--- 14 files changed, 111 insertions(+), 91 deletions(-) diff --git a/source/ada/lsp-ada_handlers-named_parameters_commands.adb b/source/ada/lsp-ada_handlers-named_parameters_commands.adb index 1b78ade3a..e7ba4a029 100644 --- a/source/ada/lsp-ada_handlers-named_parameters_commands.adb +++ b/source/ada/lsp-ada_handlers-named_parameters_commands.adb @@ -25,6 +25,7 @@ with Libadalang.Analysis; with Libadalang.Common; with LSP.Ada_Contexts; +with LSP.Constants; with LSP.Enumerations; with LSP.Structures.LSPAny_Vectors; use LSP.Structures.LSPAny_Vectors; with LSP.Utils; @@ -182,7 +183,7 @@ package body LSP.Ada_Handlers.Named_Parameters_Commands is Edit.newText := Name & " => "; if Self.Versioned_Documents then - Edits.documentChanges (1).Varian_1.edits.Append + Edits.documentChanges (1).Variant_1.edits.Append (LSP.Structures.TextEdit_Or_AnnotatedTextEdit' (Is_TextEdit => False, AnnotatedTextEdit => Edit)); else @@ -224,8 +225,8 @@ package body LSP.Ada_Handlers.Named_Parameters_Commands is Edits.documentChanges.Append (documentChanges_OfWorkspaceEdit_Item' (Kind => - documentChanges_OfWorkspaceEdit_Item_Variant'(Varian_1), - Varian_1 => + documentChanges_OfWorkspaceEdit_Item_Variant'(Variant_1), + Variant_1 => (textDocument => (uri => Version.uri, version => (Is_Null => False, @@ -243,7 +244,7 @@ package body LSP.Ada_Handlers.Named_Parameters_Commands is Error := (Is_Set => True, Value => - (code => LSP.Enumerations.InvalidRequest, + (code => LSP.Constants.InvalidRequest, message => "This is not a valid position to name parameters.")); return; end if; @@ -260,7 +261,7 @@ package body LSP.Ada_Handlers.Named_Parameters_Commands is Error := (Is_Set => True, Value => - (code => LSP.Enumerations.InvalidRequest, + (code => LSP.Constants.InvalidRequest, message => "Could not resolve this call expression precisely.")); return; @@ -290,7 +291,7 @@ package body LSP.Ada_Handlers.Named_Parameters_Commands is Error := (Is_Set => True, Value => - (code => LSP.Enumerations.UnknownErrorCode, + (code => LSP.Constants.UnknownErrorCode, message => VSS.Strings.Conversions.To_Virtual_String (Ada.Exceptions.Exception_Information (E)))); end Execute; diff --git a/source/ada/lsp-ada_handlers-refactor.adb b/source/ada/lsp-ada_handlers-refactor.adb index 03845216c..bfa834671 100644 --- a/source/ada/lsp-ada_handlers-refactor.adb +++ b/source/ada/lsp-ada_handlers-refactor.adb @@ -18,6 +18,7 @@ with VSS.Strings.Conversions; with LSP.Ada_Documents; use LSP.Ada_Documents; +with LSP.Constants; with LSP.Enumerations; with LSP.Structures; use LSP.Structures; with LSP.Utils; @@ -106,7 +107,7 @@ package body LSP.Ada_Handlers.Refactor is Error := (Is_Set => True, Value => - (code => LSP.Enumerations.UnknownErrorCode, + (code => LSP.Constants.UnknownErrorCode, message => VSS.Strings.Conversions.To_Virtual_String (Error_Msg))); @@ -172,7 +173,7 @@ package body LSP.Ada_Handlers.Refactor is Error := (Is_Set => True, Value => - (code => LSP.Enumerations.UnknownErrorCode, + (code => LSP.Constants.UnknownErrorCode, message => VSS.Strings.Conversions.To_Virtual_String (Error_Msg))); end Execute; diff --git a/source/ada/lsp-ada_handlers-renaming.adb b/source/ada/lsp-ada_handlers-renaming.adb index 0cde061e1..0932ae5d9 100644 --- a/source/ada/lsp-ada_handlers-renaming.adb +++ b/source/ada/lsp-ada_handlers-renaming.adb @@ -44,10 +44,10 @@ package body LSP.Ada_Handlers.Renaming is (X.Kind); begin case X.Kind is - when LSP.Structures.Varian_1 => - Result := @ + X.Varian_1.textDocument.uri.Get_Hash; + when LSP.Structures.Variant_1 => + Result := @ + X.Variant_1.textDocument.uri.Get_Hash; - for Item of X.Varian_1.edits loop + for Item of X.Variant_1.edits loop case Item.Is_TextEdit is when True => Result := @ + Ada.Containers.Hash_Type'Mod @@ -164,13 +164,13 @@ package body LSP.Ada_Handlers.Renaming is else - URI := Item.Varian_1.textDocument.uri; + URI := Item.Variant_1.textDocument.uri; if not Result.changes.Contains (URI) then Result.changes.Insert (URI, LSP.Structures.Empty); end if; - for X of Item.Varian_1.edits loop + for X of Item.Variant_1.edits loop Result.changes (URI).Append (X.TextEdit); end loop; end if; @@ -315,8 +315,8 @@ package body LSP.Ada_Handlers.Renaming is if not Set.Is_Empty then declare - Item : File_Edit (LSP.Structures.Varian_1); - Edit : LSP.Structures.TextDocumentEdit renames Item.Varian_1; + Item : File_Edit (LSP.Structures.Variant_1); + Edit : LSP.Structures.TextDocumentEdit renames Item.Variant_1; begin Edit := To_Edit (File_Name, Set); Append (Item); @@ -334,8 +334,8 @@ package body LSP.Ada_Handlers.Renaming is Text_Edits_Cursor : Text_Edit_Ordered_Maps.Cursor := Context_Edits.Text_Edits.First; - Item : File_Edit (LSP.Structures.Varian_1); - Edit : LSP.Structures.TextDocumentEdit renames Item.Varian_1; + Item : File_Edit (LSP.Structures.Variant_1); + Edit : LSP.Structures.TextDocumentEdit renames Item.Variant_1; begin Text_Edits_Cursor := Context_Edits.Text_Edits.First; @@ -464,8 +464,8 @@ package body LSP.Ada_Handlers.Renaming is Set : constant LAL_Refactor.Text_Edit_Ordered_Set := [Change]; - Item : File_Edit (LSP.Structures.Varian_1); - Edit : LSP.Structures.TextDocumentEdit renames Item.Varian_1; + Item : File_Edit (LSP.Structures.Variant_1); + Edit : LSP.Structures.TextDocumentEdit renames Item.Variant_1; begin Append (Create); Edit := To_Edit (File, Set); diff --git a/source/ada/lsp-ada_handlers.adb b/source/ada/lsp-ada_handlers.adb index a317fc802..f57a8c9da 100644 --- a/source/ada/lsp-ada_handlers.adb +++ b/source/ada/lsp-ada_handlers.adb @@ -1305,14 +1305,14 @@ package body LSP.Ada_Handlers is newText => "project Default is end Default;")); Insert : LSP.Structures. documentChanges_OfWorkspaceEdit_Item := - (LSP.Structures.Varian_1, + (LSP.Structures.Variant_1, (textDocument => (uri => URI, others => <>), edits => <>)); Item : LSP.Structures.CodeAction; Edit : LSP.Structures.WorkspaceEdit; begin - Insert.Varian_1.edits.Append (Text); + Insert.Variant_1.edits.Append (Text); Edit.documentChanges.Append (Create); Edit.documentChanges.Append (Insert); Item := @@ -1557,9 +1557,9 @@ package body LSP.Ada_Handlers is Node : Libadalang.Analysis.Ada_Node; Response : LSP.Structures.Completion_Result - (Kind => LSP.Structures.Varian_2); + (Kind => LSP.Structures.Variant_2); begin - Response.Varian_2.isIncomplete := False; + Response.Variant_2.isIncomplete := False; Document.Get_Completion_Node (Context => Context.all, @@ -1575,7 +1575,7 @@ package body LSP.Ada_Handlers is Token => Token, Node => Node, Names => Names, - Result => Response.Varian_2); + Result => Response.Variant_2); LSP.Ada_Completions.Write_Completions (Context => Context.all, @@ -1586,7 +1586,7 @@ package body LSP.Ada_Handlers is Named_Notation_Threshold => Self.Configuration.Named_Notation_Threshold, Compute_Doc_And_Details => Compute_Doc_And_Details, - Result => Response.Varian_2.items); + Result => Response.Variant_2.items); Self.Sender.On_Completion_Response (Id, Response); end On_Completion_Request; @@ -1689,8 +1689,8 @@ package body LSP.Ada_Handlers is -- Utility function, appends to Vector all results of the -- declaration requests found in context C. - Response : LSP.Structures.Declaration_Result (LSP.Structures.Varian_1); - Vector : LSP.Structures.Location_Vector renames Response.Varian_1; + Response : LSP.Structures.Declaration_Result (LSP.Structures.Variant_1); + Vector : LSP.Structures.Location_Vector renames Response.Variant_1; Display_Method_Policy : constant LSP.Ada_Configurations.DisplayMethodAncestryOnNavigationPolicy := @@ -1841,8 +1841,8 @@ package body LSP.Ada_Handlers is Trace : constant GNATCOLL.Traces.Trace_Handle := LSP.GNATCOLL_Tracers.Handle (Self.Tracer.all); - Response : LSP.Structures.Definition_Result (LSP.Structures.Varian_1); - Vector : LSP.Structures.Location_Vector renames Response.Varian_1; + Response : LSP.Structures.Definition_Result (LSP.Structures.Variant_1); + Vector : LSP.Structures.Location_Vector renames Response.Variant_1; Imprecise : Boolean := False; @@ -2666,7 +2666,7 @@ package body LSP.Ada_Handlers is if Tag = Ada.Tags.No_Tag then Self.Sender.On_Error_Response - (Id, (code => LSP.Enumerations.InternalError, + (Id, (code => LSP.Constants.InternalError, message => "Unknown command")); return; end if; @@ -2733,7 +2733,7 @@ package body LSP.Ada_Handlers is else Self.Sender.On_Error_Response - (Id, (code => LSP.Enumerations.InternalError, + (Id, (code => LSP.Constants.InternalError, message => "Document is not opened")); end if; end On_FoldingRange_Request; @@ -2901,9 +2901,9 @@ package body LSP.Ada_Handlers is Trace : constant GNATCOLL.Traces.Trace_Handle := LSP.GNATCOLL_Tracers.Handle (Self.Tracer.all); - Response : LSP.Structures.Definition_Result (LSP.Structures.Varian_1); + Response : LSP.Structures.Definition_Result (LSP.Structures.Variant_1); - Vector : LSP.Structures.Location_Vector renames Response.Varian_1; + Vector : LSP.Structures.Location_Vector renames Response.Variant_1; Display_Method_Ancestry_Policy : constant LSP.Ada_Configurations.DisplayMethodAncestryOnNavigationPolicy := @@ -3258,7 +3258,7 @@ package body LSP.Ada_Handlers is and then not Imprecise then -- Success only if the node is a name and can be resolved precisely - Response.Value.Varian_1 := Self.To_LSP_Location (Name_Node).a_range; + Response.Value.Variant_1 := Self.To_LSP_Location (Name_Node).a_range; end if; @@ -3539,7 +3539,7 @@ package body LSP.Ada_Handlers is else Self.Sender.On_Error_Response (Id, - (code => LSP.Enumerations.InternalError, -- RequestFailed, + (code => LSP.Constants.InternalError, -- RequestFailed, message => <>)); end if; end On_Rename_Request; @@ -3576,7 +3576,7 @@ package body LSP.Ada_Handlers is if not Self.Implemented then Self.Sender.On_Error_Response (Value.Id, - (code => LSP.Enumerations.MethodNotFound, + (code => LSP.Constants.MethodNotFound, message => "Not implemented")); end if; @@ -3594,7 +3594,7 @@ package body LSP.Ada_Handlers is Self.Sender.On_Error_Response (Value.Id, - (code => LSP.Enumerations.InternalError, + (code => LSP.Constants.InternalError, message => Message)); end; @@ -3780,8 +3780,8 @@ package body LSP.Ada_Handlers is Value : LSP.Structures.TypeDefinitionParams) is - Response : LSP.Structures.Definition_Result (LSP.Structures.Varian_1); - Vector : LSP.Structures.Location_Vector renames Response.Varian_1; + Response : LSP.Structures.Definition_Result (LSP.Structures.Variant_1); + Vector : LSP.Structures.Location_Vector renames Response.Variant_1; Imprecise : Boolean := False; procedure Resolve_In_Context (C : LSP.Ada_Context_Sets.Context_Access); @@ -3940,8 +3940,8 @@ package body LSP.Ada_Handlers is WE.documentChanges.Append (documentChanges_OfWorkspaceEdit_Item'( - (Kind => Varian_1, - Varian_1 => TextDocumentEdit' + (Kind => Variant_1, + Variant_1 => TextDocumentEdit' (textDocument => Self.Get_Open_Document_Version (File_URI), edits => Annotaded_Edits)))); @@ -3990,8 +3990,8 @@ package body LSP.Ada_Handlers is WE.documentChanges.Append (documentChanges_OfWorkspaceEdit_Item'( - (Kind => Varian_1, - Varian_1 => TextDocumentEdit' + (Kind => Variant_1, + Variant_1 => TextDocumentEdit' (edits => Annotaded_Edits, others => <>)))); end; diff --git a/source/ada/lsp-ada_indexing.adb b/source/ada/lsp-ada_indexing.adb index 3fe6ca24f..26bf36fce 100644 --- a/source/ada/lsp-ada_indexing.adb +++ b/source/ada/lsp-ada_indexing.adb @@ -22,26 +22,6 @@ with VSS.Strings.Templates; package body LSP.Ada_Indexing is - function From_ProgressToken - (Item : LSP.Structures.ProgressToken) - return LSP.Structures.Integer_Or_Virtual_String; - - ------------------------ - -- From_ProgressToken -- - ------------------------ - - function From_ProgressToken - (Item : LSP.Structures.ProgressToken) - return LSP.Structures.Integer_Or_Virtual_String is - begin - if Item.Is_Integer then - return (True, Item.Integer); - - else - return (False, Item.Virtual_String); - end if; - end From_ProgressToken; - ----------------- -- Index_Files -- ----------------- @@ -72,7 +52,7 @@ package body LSP.Ada_Indexing is Self.Progress_Report_Sent := Current; Self.Server.On_ProgressReport_Work_Done - (From_ProgressToken (Self.Indexing_Token), + (Self.Indexing_Token, (percentage => (True, (Files_Indexed * 100) / Total_Files), message => Message_Template.Format @@ -84,7 +64,7 @@ package body LSP.Ada_Indexing is begin if Self.Total_Files_Indexed = 0 then Self.Server.On_ProgressBegin_Work_Done - (From_ProgressToken (Self.Indexing_Token), + (Self.Indexing_Token, (title => "Indexing", percentage => (True, 0), others => <>)); end if; @@ -130,7 +110,7 @@ package body LSP.Ada_Indexing is -- Indexing done. Self.Server.On_ProgressEnd_Work_Done - (From_ProgressToken (Self.Indexing_Token), (message => <>)); + (Self.Indexing_Token, (message => <>)); return; end if; diff --git a/source/lsp_3.17/lsp-constants.ads b/source/lsp_3.17/lsp-constants.ads index e13bb490a..af9c83bfe 100644 --- a/source/lsp_3.17/lsp-constants.ads +++ b/source/lsp_3.17/lsp-constants.ads @@ -21,7 +21,7 @@ package LSP.Constants is function True return LSP.Structures.foldingRangeProvider_OfServerCapabilities - is (Kind => LSP.Structures.Varian_1, Varian_1 => True); + is (Kind => LSP.Structures.Variant_1, Variant_1 => True); function True return LSP.Structures.foldingRangeProvider_OfServerCapabilities_Optional @@ -29,7 +29,7 @@ package LSP.Constants is function True return LSP.Structures.implementationProvider_OfServerCapabilities - is (Kind => LSP.Structures.Varian_1, Varian_1 => True); + is (Kind => LSP.Structures.Variant_1, Variant_1 => True); function True return LSP.Structures.implementationProvider_OfServerCapabilities_Optional @@ -37,7 +37,7 @@ package LSP.Constants is function True return LSP.Structures.declarationProvider_OfServerCapabilities - is (Kind => LSP.Structures.Varian_1, Varian_1 => True); + is (Kind => LSP.Structures.Variant_1, Variant_1 => True); function True return LSP.Structures.declarationProvider_OfServerCapabilities_Optional @@ -53,7 +53,7 @@ package LSP.Constants is function True return LSP.Structures.callHierarchyProvider_OfServerCapabilities - is (Kind => LSP.Structures.Varian_1, Varian_1 => True); + is (Kind => LSP.Structures.Variant_1, Variant_1 => True); function True return LSP.Structures.callHierarchyProvider_OfServerCapabilities_Optional @@ -61,7 +61,7 @@ package LSP.Constants is function True return LSP.Structures.typeDefinitionProvider_OfServerCapabilities - is (Kind => LSP.Structures.Varian_1, Varian_1 => True); + is (Kind => LSP.Structures.Variant_1, Variant_1 => True); function True return LSP.Structures.typeDefinitionProvider_OfServerCapabilities_Optional @@ -102,4 +102,44 @@ package LSP.Constants is return LSP.Structures.DocumentUri is ((VSS.Strings.Empty_Virtual_String with null record)); + ErrorCodes_Map : constant array (LSP.Enumerations.ErrorCodes) of Integer := + [LSP.Enumerations.ParseError => -32700, + LSP.Enumerations.InvalidRequest => -32600, + LSP.Enumerations.MethodNotFound => -32601, + LSP.Enumerations.InvalidParams => -32602, + LSP.Enumerations.InternalError => -32603, + LSP.Enumerations.jsonrpcReservedErrorRangeStart => -32099, + LSP.Enumerations.serverErrorStart => -32099, + LSP.Enumerations.ServerNotInitialized => -32002, + LSP.Enumerations.UnknownErrorCode => -32001, + LSP.Enumerations.jsonrpcReservedErrorRangeEnd => -32000, + LSP.Enumerations.serverErrorEnd => -32000]; + + LSPErrorCodes_Map : constant array + (LSP.Enumerations.LSPErrorCodes) of Integer := + [LSP.Enumerations.lspReservedErrorRangeStart => -32899, + LSP.Enumerations.RequestFailed => -32803, + LSP.Enumerations.ServerCancelled => -32802, + LSP.Enumerations.ContentModified => -32801, + LSP.Enumerations.RequestCancelled => -32800, + LSP.Enumerations.lspReservedErrorRangeEnd => -32800]; + + function InternalError return Integer + is (ErrorCodes_Map (LSP.Enumerations.InternalError)); + + function MethodNotFound return Integer + is (ErrorCodes_Map (LSP.Enumerations.MethodNotFound)); + + function InvalidRequest return Integer + is (ErrorCodes_Map (LSP.Enumerations.InvalidRequest)); + + function UnknownErrorCode return Integer + is (ErrorCodes_Map (LSP.Enumerations.UnknownErrorCode)); + + function ServerNotInitialized return Integer + is (ErrorCodes_Map (LSP.Enumerations.ServerNotInitialized)); + + function InvalidParams return Integer + is (ErrorCodes_Map (LSP.Enumerations.InvalidParams)); + end LSP.Constants; diff --git a/source/lsp_3.17/lsp-errors.ads b/source/lsp_3.17/lsp-errors.ads index 95a475811..a2e09bb2b 100644 --- a/source/lsp_3.17/lsp-errors.ads +++ b/source/lsp_3.17/lsp-errors.ads @@ -6,13 +6,11 @@ with VSS.Strings; -with LSP.Enumerations; - package LSP.Errors is pragma Preelaborate; type ResponseError is record - code : LSP.Enumerations.ErrorCodes; + code : Integer; -- A number indicating the error type that occurred. message : VSS.Strings.Virtual_String; -- A string providing a short description of the error. diff --git a/source/lsp_3.17/lsp-input_tools.adb b/source/lsp_3.17/lsp-input_tools.adb index c3e406291..07bc1d51b 100644 --- a/source/lsp_3.17/lsp-input_tools.adb +++ b/source/lsp_3.17/lsp-input_tools.adb @@ -156,7 +156,7 @@ package body LSP.Input_Tools is procedure Read_Progress_Report (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; - Token : out LSP.Structures.Integer_Or_Virtual_String; + Token : out LSP.Structures.ProgressToken; Value : out Result_Type) is use type VSS.Strings.Virtual_String; @@ -193,7 +193,7 @@ package body LSP.Input_Tools is Handler.Read_Next; if Field = "token" then - LSP.Inputs.Read_Integer_Or_Virtual_String + LSP.Inputs.Read_ProgressToken (Handler, Token); elsif Field = "value" then Read_Progress_Report (Handler, Value); diff --git a/source/lsp_3.17/lsp-input_tools.ads b/source/lsp_3.17/lsp-input_tools.ads index 31172f388..3f5b6a5c3 100644 --- a/source/lsp_3.17/lsp-input_tools.ads +++ b/source/lsp_3.17/lsp-input_tools.ads @@ -76,7 +76,7 @@ package LSP.Input_Tools is procedure Read_Progress_Report (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; - Token : out LSP.Structures.Integer_Or_Virtual_String; + Token : out LSP.Structures.ProgressToken; Value : out Result_Type); end LSP.Input_Tools; diff --git a/source/lsp_3.17/lsp-output_tools.adb b/source/lsp_3.17/lsp-output_tools.adb index f66c57feb..c4b2cca54 100644 --- a/source/lsp_3.17/lsp-output_tools.adb +++ b/source/lsp_3.17/lsp-output_tools.adb @@ -69,7 +69,7 @@ package body LSP.Output_Tools is procedure Write_Start_Progress_Report (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; - Token : LSP.Structures.Integer_Or_Virtual_String) is + Token : LSP.Structures.ProgressToken) is begin Handler.Start_Object; Handler.Key_Name ("jsonrpc"); @@ -79,7 +79,7 @@ package body LSP.Output_Tools is Handler.Key_Name ("params"); Handler.Start_Object; Handler.Key_Name ("token"); - LSP.Outputs.Write_Integer_Or_Virtual_String (Handler, Token); + LSP.Outputs.Write_ProgressToken (Handler, Token); Handler.Key_Name ("value"); end Write_Start_Progress_Report; diff --git a/source/lsp_3.17/lsp-output_tools.ads b/source/lsp_3.17/lsp-output_tools.ads index 124eb84a9..1e5295e88 100644 --- a/source/lsp_3.17/lsp-output_tools.ads +++ b/source/lsp_3.17/lsp-output_tools.ads @@ -31,6 +31,6 @@ package LSP.Output_Tools is procedure Write_Start_Progress_Report (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; - Token : LSP.Structures.Integer_Or_Virtual_String); + Token : LSP.Structures.ProgressToken); end LSP.Output_Tools; diff --git a/source/lsp_3.17/lsp-progress_reports.ads b/source/lsp_3.17/lsp-progress_reports.ads index 3a25ac3f6..a42f000b3 100644 --- a/source/lsp_3.17/lsp-progress_reports.ads +++ b/source/lsp_3.17/lsp-progress_reports.ads @@ -14,7 +14,7 @@ package LSP.Progress_Reports is type Progress_Report is abstract limited new LSP.Client_Messages.Client_Message with record - Token : LSP.Structures.Integer_Or_Virtual_String; + Token : LSP.Structures.ProgressToken; end record; procedure Visit_Receiver diff --git a/source/server/lsp-lifecycle_checkers.adb b/source/server/lsp-lifecycle_checkers.adb index b7020d10f..0d152ce90 100644 --- a/source/server/lsp-lifecycle_checkers.adb +++ b/source/server/lsp-lifecycle_checkers.adb @@ -15,7 +15,7 @@ -- of the license. -- ------------------------------------------------------------------------------ -with LSP.Enumerations; +with LSP.Constants; package body LSP.Lifecycle_Checkers is @@ -45,7 +45,7 @@ package body LSP.Lifecycle_Checkers is Client.On_Error_Response (Id => Self.Request_Id.Value, Value => - (code => LSP.Enumerations.ServerNotInitialized, + (code => LSP.Constants.ServerNotInitialized, message => "No initialize request has been received")); end if; end Check_Message; diff --git a/source/server/lsp-servers.adb b/source/server/lsp-servers.adb index 4b3242cd6..1afce178d 100644 --- a/source/server/lsp-servers.adb +++ b/source/server/lsp-servers.adb @@ -29,7 +29,7 @@ with VSS.Text_Streams.Memory_UTF8_Input; with VSS.Text_Streams.Memory_UTF8_Output; with LSP.Client_Message_Writers; -with LSP.Enumerations; +with LSP.Constants; with LSP.Errors; with LSP.Lifecycle_Checkers; with LSP.Server_Notification_Readers; @@ -60,8 +60,8 @@ package body LSP.Servers is Message : VSS.Strings.Virtual_String; Request : VSS.Stream_Element_Vectors.Stream_Element_Vector; Request_Id : LSP.Structures.Integer_Or_Virtual_String; - Code : LSP.Enumerations.ErrorCodes := - LSP.Enumerations.InternalError); + Code : Integer := + LSP.Constants.InternalError); -- Send a response representing the exception to the client. This -- should be called whenever an exception occurred while processing -- a request. @@ -409,7 +409,7 @@ package body LSP.Servers is Self.Tracer.Trace (Vector); Self.On_Error_Response (Request_Id, - (code => LSP.Enumerations.InvalidParams, + (code => LSP.Constants.InvalidParams, message => "Unable to decode request.")); return; @@ -420,7 +420,7 @@ package body LSP.Servers is (Self, UR, "Unknown method.", Vector, Request_Id, - LSP.Enumerations.MethodNotFound); + LSP.Constants.MethodNotFound); return; when E : others => @@ -430,7 +430,7 @@ package body LSP.Servers is (Self, E, "Request decoding fails:", Vector, Request_Id, - LSP.Enumerations.InvalidParams); + LSP.Constants.InvalidParams); return; end; @@ -596,8 +596,8 @@ package body LSP.Servers is Message : VSS.Strings.Virtual_String; Request : VSS.Stream_Element_Vectors.Stream_Element_Vector; Request_Id : LSP.Structures.Integer_Or_Virtual_String; - Code : LSP.Enumerations.ErrorCodes := - LSP.Enumerations.InternalError) is + Code : Integer := + LSP.Constants.InternalError) is begin Self.Tracer.Trace_Exception (E, Message); Self.Tracer.Trace (Request); From a943ebd22685b6bdd8b5c63abc583920a8166e10 Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Tue, 29 Aug 2023 12:30:38 +0300 Subject: [PATCH 067/152] Revert to original error code in the test/source Refs #1170 --- source/ada/lsp-ada_handlers.adb | 2 +- source/lsp_3.17/lsp-constants.ads | 3 +++ testsuite/ada_lsp/SA11-038_Name_Collision/test.json | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/source/ada/lsp-ada_handlers.adb b/source/ada/lsp-ada_handlers.adb index f57a8c9da..934084a7e 100644 --- a/source/ada/lsp-ada_handlers.adb +++ b/source/ada/lsp-ada_handlers.adb @@ -3539,7 +3539,7 @@ package body LSP.Ada_Handlers is else Self.Sender.On_Error_Response (Id, - (code => LSP.Constants.InternalError, -- RequestFailed, + (code => LSP.Constants.RequestFailed, message => <>)); end if; end On_Rename_Request; diff --git a/source/lsp_3.17/lsp-constants.ads b/source/lsp_3.17/lsp-constants.ads index af9c83bfe..983919ff8 100644 --- a/source/lsp_3.17/lsp-constants.ads +++ b/source/lsp_3.17/lsp-constants.ads @@ -142,4 +142,7 @@ package LSP.Constants is function InvalidParams return Integer is (ErrorCodes_Map (LSP.Enumerations.InvalidParams)); + function RequestFailed return Integer + is (LSPErrorCodes_Map (LSP.Enumerations.RequestFailed)); + end LSP.Constants; diff --git a/testsuite/ada_lsp/SA11-038_Name_Collision/test.json b/testsuite/ada_lsp/SA11-038_Name_Collision/test.json index 6307aab9e..7194bfca9 100644 --- a/testsuite/ada_lsp/SA11-038_Name_Collision/test.json +++ b/testsuite/ada_lsp/SA11-038_Name_Collision/test.json @@ -210,6 +210,7 @@ "jsonrpc": "2.0", "id": "ada-4", "error": { + "code": -32803, "message": "" } } From 0e989467a9d9f2ececab0936fe43b7d5db231497 Mon Sep 17 00:00:00 2001 From: Andry Ogorodnik Date: Tue, 29 Aug 2023 13:02:32 +0000 Subject: [PATCH 068/152] Set codeActionProvider option in the ServerCapabilities --- Makefile | 2 +- source/ada/lsp-ada_client_capabilities.adb | 53 +++++++++++++++++++++- source/ada/lsp-ada_client_capabilities.ads | 8 ++++ source/lsp_3.17/lsp-structures-unwrap.ads | 4 ++ 4 files changed, 64 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index d0a27c085..b84d88f39 100644 --- a/Makefile +++ b/Makefile @@ -166,7 +166,7 @@ check: all set -e; \ export PYTHON=$(PYTHON); \ if [ `$(PYTHON) -c "import sys;print('e3' in sys.modules)"` = "True" ]; then\ - (cd testsuite ; sh run.sh ) ; \ + (cd testsuite ; sh run.sh $(test)) ; \ else \ for a in testsuite/*_lsp/*/*.json; do \ echo $$a ; \ diff --git a/source/ada/lsp-ada_client_capabilities.adb b/source/ada/lsp-ada_client_capabilities.adb index 0de942216..dd5410efc 100644 --- a/source/ada/lsp-ada_client_capabilities.adb +++ b/source/ada/lsp-ada_client_capabilities.adb @@ -24,6 +24,38 @@ with LSP.Structures.Unwrap; package body LSP.Ada_Client_Capabilities is + ----------------- + -- Code_Action -- + ----------------- + + function Code_Action + (Self : Client_Capability'Class) return Boolean + is + use LSP.Structures.Unwrap; + + Result : constant LSP.Structures.CodeActionClientCapabilities_Optional := + codeAction (Self.Value.capabilities.textDocument); + begin + return Result.Is_Set; + end Code_Action; + + ------------------------------- + -- Code_ActionLiteralSupport -- + ------------------------------- + + function Code_ActionLiteralSupport + (Self : Client_Capability'Class) return Boolean + is + use LSP.Structures.Unwrap; + + Result : constant LSP.Structures.CodeActionClientCapabilities_Optional := + codeAction (Self.Value.capabilities.textDocument); + begin + return (if Result.Is_Set + then Result.Value.codeActionLiteralSupport.Is_Set + else False); + end Code_ActionLiteralSupport; + ---------------- -- Initialize -- ---------------- @@ -147,8 +179,6 @@ package body LSP.Ada_Client_Capabilities is Token_Modifiers : LSP.Structures.Virtual_String_Vector) return LSP.Structures.ServerCapabilities is - pragma Unreferenced (Self); - use type VSS.Strings.Virtual_String; begin @@ -204,6 +234,25 @@ package body LSP.Ada_Client_Capabilities is (tokenTypes => Token_Types, tokenModifiers => Token_Modifiers), others => <>))); + + if Self.Code_Action + and then Self.Code_ActionLiteralSupport + then + Result.codeActionProvider := + (Is_Set => True, + Value => + (Is_Boolean => False, + CodeActionOptions => + (workDoneProgress => LSP.Constants.False, + codeActionKinds => + (LSP.Enumerations.QuickFix => True, + LSP.Enumerations.RefactorRewrite => True, + others => False), + resolveProvider => LSP.Constants.False))); + + else + Result.codeActionProvider := (Is_Set => True, others => <>); + end if; end return; end To_Server_Capabilities; diff --git a/source/ada/lsp-ada_client_capabilities.ads b/source/ada/lsp-ada_client_capabilities.ads index 56eaf5f6f..3facbfe37 100644 --- a/source/ada/lsp-ada_client_capabilities.ads +++ b/source/ada/lsp-ada_client_capabilities.ads @@ -96,6 +96,14 @@ package LSP.Ada_Client_Capabilities is function Refactoring_Replace_Type (Self : Client_Capability'Class) return Boolean; + -- Code actions -- + + function Code_Action + (Self : Client_Capability'Class) return Boolean; + + function Code_ActionLiteralSupport + (Self : Client_Capability'Class) return Boolean; + private type Advanced_Refactorings is diff --git a/source/lsp_3.17/lsp-structures-unwrap.ads b/source/lsp_3.17/lsp-structures-unwrap.ads index def525a68..8764c7765 100644 --- a/source/lsp_3.17/lsp-structures-unwrap.ads +++ b/source/lsp_3.17/lsp-structures-unwrap.ads @@ -71,4 +71,8 @@ package LSP.Structures.Unwrap is return Boolean_Optional is (if X.Is_Set then X.Value.relatedInformation else (Is_Set => False)); + function codeAction (X : TextDocumentClientCapabilities_Optional) + return CodeActionClientCapabilities_Optional is + (if X.Is_Set then X.Value.codeAction else (Is_Set => False)); + end LSP.Structures.Unwrap; From e71b3dbe61cf3c41c9d1d6500114b9d63a8c303c Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Tue, 29 Aug 2023 17:30:46 +0300 Subject: [PATCH 069/152] Restore cancel test Refs #1170 --- doc/debug.md | 21 +---- source/ada/lsp-ada_client_capabilities.adb | 77 ++++++++-------- source/ada/lsp-ada_client_capabilities.ads | 1 + source/ada/lsp-ada_driver.adb | 5 + .../lsp-ada_handlers-suspend_executions.adb | 91 +++++++++++++++++++ .../lsp-ada_handlers-suspend_executions.ads | 48 ++++++++++ source/ada/lsp-ada_handlers.adb | 10 ++ source/lsp_3.17/lsp-constants.ads | 15 +++ source/server/lsp-known_requests.adb | 13 ++- source/server/lsp-known_requests.ads | 9 +- source/server/lsp-servers.adb | 27 ++++-- testsuite/ada_lsp/cancel/cancel.json | 32 +++++-- testsuite/ada_lsp/cancel/test.yaml | 3 - 13 files changed, 270 insertions(+), 82 deletions(-) create mode 100644 source/ada/lsp-ada_handlers-suspend_executions.adb create mode 100644 source/ada/lsp-ada_handlers-suspend_executions.ads diff --git a/doc/debug.md b/doc/debug.md index f0fc6e80e..508576c56 100644 --- a/doc/debug.md +++ b/doc/debug.md @@ -2,30 +2,19 @@ ## Short introduction -This request is used to test language server. +This command `als-suspend-execution` is used to test language server. ## Change description -Currently debug request has only one kind: +Currently `als-suspend-execution` debug command has only one argument: -* Suspend_Execution - stop processing task until input queue has given +* inputQueueLength - integer + +On execution it stops processing task until input queue has given number of messages. After getting this request ALS stops message processing, but still accepts new requests/notifications. Once number of input messages reaches given limit, ALS resumes message processing. -New request: -* Method: `$/alsDebug` -* params: `AlsDebugParams` defined as follows: - -```typescript -interface AlsDebugSuspendExecution { - inputQueueLength : number; /* Min input queue length */ -} - -export type AlsDebugParams = AlsDebugSuspendExecution; - -``` - Response: * result: `null` diff --git a/source/ada/lsp-ada_client_capabilities.adb b/source/ada/lsp-ada_client_capabilities.adb index dd5410efc..b85c00340 100644 --- a/source/ada/lsp-ada_client_capabilities.adb +++ b/source/ada/lsp-ada_client_capabilities.adb @@ -173,14 +173,28 @@ package body LSP.Ada_Client_Capabilities is ---------------------------- function To_Server_Capabilities - (Self : Client_Capability'Class; + (Self : Client_Capability'Class; Incremental_Text_Changes : Boolean; + Commands : LSP.Structures.Virtual_String_Vector; Token_Types : LSP.Structures.Virtual_String_Vector; Token_Modifiers : LSP.Structures.Virtual_String_Vector) return LSP.Structures.ServerCapabilities is use type VSS.Strings.Virtual_String; + function Full_codeActionProvider + return LSP.Structures.Boolean_Or_CodeActionOptions_Optional is + (Is_Set => True, + Value => + (Is_Boolean => False, + CodeActionOptions => + (workDoneProgress => LSP.Constants.False, + codeActionKinds => + (LSP.Enumerations.QuickFix => True, + LSP.Enumerations.RefactorRewrite => True, + others => False), + resolveProvider => LSP.Constants.False))); + begin return Result : LSP.Structures.ServerCapabilities do Result.textDocumentSync := @@ -188,32 +202,34 @@ package body LSP.Ada_Client_Capabilities is Value => (Is_TextDocumentSyncOptions => False, TextDocumentSyncKind => - (if Incremental_Text_Changes then - LSP.Enumerations.Incremental - else - LSP.Enumerations.Full))); - - Result.completionProvider := - (Is_Set => True, - Value => (triggerCharacters => [".", ",", "'", "("], - resolveProvider => LSP.Constants.True, - others => <>)); + (if Incremental_Text_Changes then LSP.Enumerations.Incremental + else LSP.Enumerations.Full))); Result.callHierarchyProvider := LSP.Constants.True; Result.declarationProvider := LSP.Constants.True; Result.definitionProvider := LSP.Constants.True; Result.documentHighlightProvider := LSP.Constants.True; Result.foldingRangeProvider := LSP.Constants.True; - Result.referencesProvider := LSP.Constants.True; - Result.hoverProvider := (True, (True, True)); + Result.hoverProvider := LSP.Constants.True; Result.implementationProvider := LSP.Constants.True; - Result.signatureHelpProvider := + Result.referencesProvider := LSP.Constants.True; + Result.typeDefinitionProvider := LSP.Constants.True; + + Result.completionProvider := + (Is_Set => True, + Value => (triggerCharacters => [".", ",", "'", "("], + resolveProvider => LSP.Constants.True, + others => <>)); + + Result.codeActionProvider := + (if Self.Code_ActionLiteralSupport then Full_codeActionProvider + else LSP.Constants.True); + + Result.executeCommandProvider := (Is_Set => True, Value => - (triggerCharacters => [",", "("], - retriggerCharacters => [1 * VSS.Characters.Latin.Backspace], - workDoneProgress => <>)); - Result.typeDefinitionProvider := LSP.Constants.True; + (commands => Commands, + others => <>)); Result.renameProvider := (Is_Set => True, @@ -235,24 +251,13 @@ package body LSP.Ada_Client_Capabilities is tokenModifiers => Token_Modifiers), others => <>))); - if Self.Code_Action - and then Self.Code_ActionLiteralSupport - then - Result.codeActionProvider := - (Is_Set => True, - Value => - (Is_Boolean => False, - CodeActionOptions => - (workDoneProgress => LSP.Constants.False, - codeActionKinds => - (LSP.Enumerations.QuickFix => True, - LSP.Enumerations.RefactorRewrite => True, - others => False), - resolveProvider => LSP.Constants.False))); - - else - Result.codeActionProvider := (Is_Set => True, others => <>); - end if; + Result.signatureHelpProvider := + (Is_Set => True, + Value => + (triggerCharacters => [",", "("], + retriggerCharacters => [1 * VSS.Characters.Latin.Backspace], + workDoneProgress => <>)); + end return; end To_Server_Capabilities; diff --git a/source/ada/lsp-ada_client_capabilities.ads b/source/ada/lsp-ada_client_capabilities.ads index 3facbfe37..bd41bb5fd 100644 --- a/source/ada/lsp-ada_client_capabilities.ads +++ b/source/ada/lsp-ada_client_capabilities.ads @@ -34,6 +34,7 @@ package LSP.Ada_Client_Capabilities is function To_Server_Capabilities (Self : Client_Capability'Class; Incremental_Text_Changes : Boolean; + Commands : LSP.Structures.Virtual_String_Vector; Token_Types : LSP.Structures.Virtual_String_Vector; Token_Modifiers : LSP.Structures.Virtual_String_Vector) return LSP.Structures.ServerCapabilities; diff --git a/source/ada/lsp-ada_driver.adb b/source/ada/lsp-ada_driver.adb index 2bf81c2f7..3b237ae99 100644 --- a/source/ada/lsp-ada_driver.adb +++ b/source/ada/lsp-ada_driver.adb @@ -38,6 +38,8 @@ with GNATCOLL.VFS; use GNATCOLL.VFS; with GNATCOLL.Utils; with LSP.Ada_Handlers; +with LSP.Ada_Handlers.Suspend_Executions; +with LSP.Commands; with LSP.GNATCOLL_Tracers; with LSP.Memory_Statistics; with LSP.Servers; @@ -242,6 +244,9 @@ begin if VSS.Command_Line.Is_Specified (Language_GPR_Option) then Server.Run (GPR_Handler'Unchecked_Access, Tracer'Unchecked_Access); else + LSP.Commands.Register + (LSP.Ada_Handlers.Suspend_Executions.Suspend_Execution'Tag); + Server.Run (Ada_Handler'Unchecked_Access, Tracer'Unchecked_Access); end if; exception diff --git a/source/ada/lsp-ada_handlers-suspend_executions.adb b/source/ada/lsp-ada_handlers-suspend_executions.adb new file mode 100644 index 000000000..95f972a4b --- /dev/null +++ b/source/ada/lsp-ada_handlers-suspend_executions.adb @@ -0,0 +1,91 @@ +------------------------------------------------------------------------------ +-- Language Server Protocol -- +-- -- +-- Copyright (C) 2020-2023, AdaCore -- +-- -- +-- This is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 3, or (at your option) any later ver- -- +-- sion. This software is distributed in the hope that it will be useful, -- +-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- -- +-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -- +-- License for more details. You should have received a copy of the GNU -- +-- General Public License distributed with this software; see file -- +-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy -- +-- of the license. -- +------------------------------------------------------------------------------ + +with VSS.JSON.Streams; + +with LSP.Servers; + +package body LSP.Ada_Handlers.Suspend_Executions is + + ------------ + -- Create -- + ------------ + + overriding function Create + (Any : not null access LSP.Structures.LSPAny_Vector) + return Suspend_Execution + is + use type VSS.Strings.Virtual_String; + use all type VSS.JSON.Streams.JSON_Stream_Element_Kind; + use all type VSS.JSON.JSON_Number_Kind; + + Index : Natural := Any.First_Index; + begin + return Result : Suspend_Execution := + (Input_Queue_Length => 0) + do + if Index < Any.Last_Index + and then Any (Index).Kind = Start_Array + then + Index := Index + 1; + + if Index < Any.Last_Index + and then Any (Index).Kind = Start_Object + then + Index := Index + 1; + + if Index < Any.Last_Index + and then Any (Index).Kind = Key_Name + and then Any (Index).Key_Name = "inputQueueLength" + then + Index := Index + 1; + + if Index < Any.Last_Index + and then Any (Index).Kind = Number_Value + and then Any (Index).Number_Value.Kind = JSON_Integer + then + Result.Input_Queue_Length := + Natural (Any (Index).Number_Value.Integer_Value); + end if; + end if; + end if; + end if; + end return; + end Create; + + ------------- + -- Execute -- + ------------- + + overriding procedure Execute + (Self : Suspend_Execution; + Handler : not null access LSP.Server_Notification_Receivers + .Server_Notification_Receiver'Class; + Sender : not null access LSP.Client_Message_Receivers + .Client_Message_Receiver'Class; + Id : LSP.Structures.Integer_Or_Virtual_String; + Error : in out LSP.Errors.ResponseError_Optional) + is + Server : not null access LSP.Servers.Server'Class renames + Message_Handler'Class (Handler.all).Server; + begin + while Server.Input_Queue_Length < Self.Input_Queue_Length loop + delay 0.1; + end loop; + end Execute; + +end LSP.Ada_Handlers.Suspend_Executions; diff --git a/source/ada/lsp-ada_handlers-suspend_executions.ads b/source/ada/lsp-ada_handlers-suspend_executions.ads new file mode 100644 index 000000000..3861af2e6 --- /dev/null +++ b/source/ada/lsp-ada_handlers-suspend_executions.ads @@ -0,0 +1,48 @@ +------------------------------------------------------------------------------ +-- Language Server Protocol -- +-- -- +-- Copyright (C) 2020-2023, AdaCore -- +-- -- +-- This is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 3, or (at your option) any later ver- -- +-- sion. This software is distributed in the hope that it will be useful, -- +-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- -- +-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -- +-- License for more details. You should have received a copy of the GNU -- +-- General Public License distributed with this software; see file -- +-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy -- +-- of the license. -- +------------------------------------------------------------------------------ +-- +-- Implementation of the command to suspend execution for debugging purposes. + +with LSP.Client_Message_Receivers; +with LSP.Commands; +with LSP.Errors; + +package LSP.Ada_Handlers.Suspend_Executions is + + type Suspend_Execution is new LSP.Commands.Command with private; + +private + type Suspend_Execution is new LSP.Commands.Command with record + Input_Queue_Length : Natural; + end record; + + overriding function Create + (Any : not null access LSP.Structures.LSPAny_Vector) + return Suspend_Execution; + + overriding procedure Execute + (Self : Suspend_Execution; + Handler : not null access + LSP.Server_Notification_Receivers.Server_Notification_Receiver'Class; + Sender : not null access LSP.Client_Message_Receivers. + Client_Message_Receiver'Class; + Id : LSP.Structures.Integer_Or_Virtual_String; + Error : in out LSP.Errors.ResponseError_Optional); + + for Suspend_Execution'External_Tag use "als-suspend-execution"; + +end LSP.Ada_Handlers.Suspend_Executions; diff --git a/source/ada/lsp-ada_handlers.adb b/source/ada/lsp-ada_handlers.adb index 934084a7e..4cb621037 100644 --- a/source/ada/lsp-ada_handlers.adb +++ b/source/ada/lsp-ada_handlers.adb @@ -3095,6 +3095,7 @@ package body LSP.Ada_Handlers is Response.capabilities := Self.Client.To_Server_Capabilities (Self.Incremental_Text_Changes, + LSP.Commands.All_Commands, Token_Types, Token_Motifiers); @@ -3568,6 +3569,15 @@ package body LSP.Ada_Handlers is is package Canceled is new LSP.Generic_Cancel_Check (Value'Access, 127); begin + if Value.Canceled then + Self.Sender.On_Error_Response + (Value.Id, + (code => LSP.Constants.RequestCancelled, + message => "Request was canceled")); + + return; + end if; + Self.Implemented := True; Self.Is_Canceled := Canceled.Has_Been_Canceled'Unrestricted_Access; diff --git a/source/lsp_3.17/lsp-constants.ads b/source/lsp_3.17/lsp-constants.ads index 983919ff8..7f4a9765a 100644 --- a/source/lsp_3.17/lsp-constants.ads +++ b/source/lsp_3.17/lsp-constants.ads @@ -59,6 +59,18 @@ package LSP.Constants is return LSP.Structures.callHierarchyProvider_OfServerCapabilities_Optional is (Is_Set => True, Value => True); + function True return LSP.Structures.Boolean_Or_HoverOptions + is (Is_Boolean => True, Boolean => True); + + function True return LSP.Structures.Boolean_Or_HoverOptions_Optional + is (Is_Set => True, Value => True); + + function True return LSP.Structures.Boolean_Or_CodeActionOptions + is (Is_Boolean => True, Boolean => True); + + function True return LSP.Structures.Boolean_Or_CodeActionOptions_Optional + is (Is_Set => True, Value => True); + function True return LSP.Structures.typeDefinitionProvider_OfServerCapabilities is (Kind => LSP.Structures.Variant_1, Variant_1 => True); @@ -145,4 +157,7 @@ package LSP.Constants is function RequestFailed return Integer is (LSPErrorCodes_Map (LSP.Enumerations.RequestFailed)); + function RequestCancelled return Integer + is (LSPErrorCodes_Map (LSP.Enumerations.RequestCancelled)); + end LSP.Constants; diff --git a/source/server/lsp-known_requests.adb b/source/server/lsp-known_requests.adb index 78e586642..296756dff 100644 --- a/source/server/lsp-known_requests.adb +++ b/source/server/lsp-known_requests.adb @@ -59,7 +59,11 @@ package body LSP.Known_Requests is (Self : in out Visitor; Value : LSP.Server_Requests.Server_Request'Class) is begin - Self.Parent.Map.Insert (Value.Id, Cast (Value'Unchecked_Access)); + if Self.Parent.Removing then + Self.Parent.Map.Delete (Value.Id); + else + Self.Parent.Map.Insert (Value.Id, Cast (Value'Unchecked_Access)); + end if; end On_Server_Request; --------------------- @@ -70,6 +74,7 @@ package body LSP.Known_Requests is (Self : in out Known_Request_Map; Message : in out LSP.Server_Messages.Server_Message'Class) is begin + Self.Removing := False; Message.Visit_Server_Message_Visitor (Self.Visitor); end Process_Message; @@ -78,10 +83,10 @@ package body LSP.Known_Requests is -------------------- procedure Remove_Request - (Self : in out Known_Request_Map; - Id : LSP.Structures.Integer_Or_Virtual_String) is + (Self : in out Known_Request_Map; + Message : LSP.Server_Messages.Server_Message'Class) is begin - Self.Map.Exclude (Id); + Self.Removing := True; end Remove_Request; end LSP.Known_Requests; diff --git a/source/server/lsp-known_requests.ads b/source/server/lsp-known_requests.ads index 06f0cd7b9..68c7c9197 100644 --- a/source/server/lsp-known_requests.ads +++ b/source/server/lsp-known_requests.ads @@ -38,8 +38,8 @@ package LSP.Known_Requests is -- request and mark it as canceled. procedure Remove_Request - (Self : in out Known_Request_Map; - Id : LSP.Structures.Integer_Or_Virtual_String); + (Self : in out Known_Request_Map; + Message : LSP.Server_Messages.Server_Message'Class); -- Remove request with given Id from the map private @@ -81,10 +81,11 @@ private "=" => "="); type Known_Request_Map is tagged limited record - Visitor : LSP.Known_Requests.Visitor + Visitor : LSP.Known_Requests.Visitor (Known_Request_Map'Unchecked_Access); - Map : Request_Maps.Map; + Map : Request_Maps.Map; + Removing : Boolean; end record; end LSP.Known_Requests; diff --git a/source/server/lsp-servers.adb b/source/server/lsp-servers.adb index 1afce178d..551b98484 100644 --- a/source/server/lsp-servers.adb +++ b/source/server/lsp-servers.adb @@ -31,6 +31,7 @@ with VSS.Text_Streams.Memory_UTF8_Output; with LSP.Client_Message_Writers; with LSP.Constants; with LSP.Errors; +with LSP.Known_Requests; with LSP.Lifecycle_Checkers; with LSP.Server_Notification_Readers; with LSP.Server_Request_Readers; @@ -41,9 +42,10 @@ package body LSP.Servers is (Ada.Characters.Latin_1.CR, Ada.Characters.Latin_1.LF); procedure Process_One_Message - (Self : in out Server'Class; - Checker : in out LSP.Lifecycle_Checkers.Lifecycle_Checker; - EOF : in out Boolean); + (Self : in out Server'Class; + Checker : in out LSP.Lifecycle_Checkers.Lifecycle_Checker; + Map : in out LSP.Known_Requests.Known_Request_Map; + EOF : in out Boolean); -- Read data from stdin and create a message if there is enough data. -- Then put the message into Self.Input_Queue. -- Handle initialization logic by tracking 'initialize' request using @@ -170,9 +172,10 @@ package body LSP.Servers is ------------------------- procedure Process_One_Message - (Self : in out Server'Class; - Checker : in out LSP.Lifecycle_Checkers.Lifecycle_Checker; - EOF : in out Boolean) + (Self : in out Server'Class; + Checker : in out LSP.Lifecycle_Checkers.Lifecycle_Checker; + Map : in out LSP.Known_Requests.Known_Request_Map; + EOF : in out Boolean) is use type Ada.Streams.Stream_Element_Count; @@ -472,6 +475,7 @@ package body LSP.Servers is if Ok then -- Now we have a message to process. Push it to the processing -- task + Map.Process_Message (Message.all); Self.Input_Queue.Enqueue (Message); end if; @@ -636,9 +640,10 @@ package body LSP.Servers is --------------------- task body Input_Task_Type is - EOF : Boolean := False; - Message : Server_Message_Access; - Checker : LSP.Lifecycle_Checkers.Lifecycle_Checker; + EOF : Boolean := False; + Message : Server_Message_Access; + Map : LSP.Known_Requests.Known_Request_Map; + Checker : LSP.Lifecycle_Checkers.Lifecycle_Checker; begin accept Start; @@ -648,6 +653,7 @@ package body LSP.Servers is select -- Process all available outputs before acceptiong Stop Server.Destroy_Queue.Dequeue (Message); + Map.Remove_Request (Message.all); Free (Message); else @@ -659,7 +665,7 @@ package body LSP.Servers is accept Stop; exit; else - Server.Process_One_Message (Checker, EOF); + Server.Process_One_Message (Checker, Map, EOF); -- This call can block reading from stream if EOF then @@ -676,6 +682,7 @@ package body LSP.Servers is -- leaving this task. while Natural (Server.Destroy_Queue.Current_Use) > 0 loop Server.Destroy_Queue.Dequeue (Message); + Map.Remove_Request (Message.all); Free (Message); end loop; diff --git a/testsuite/ada_lsp/cancel/cancel.json b/testsuite/ada_lsp/cancel/cancel.json index 6a60ec8d2..b943b6a6c 100644 --- a/testsuite/ada_lsp/cancel/cancel.json +++ b/testsuite/ada_lsp/cancel/cancel.json @@ -17,7 +17,13 @@ "result":{ "capabilities":{ "textDocumentSync": 2, - "definitionProvider":true + "definitionProvider": true, + "executeCommandProvider": { + "commands": [ + "", + "als-suspend-execution" + ] + } } } }] @@ -51,15 +57,20 @@ "wait":[] } }, { - "send": { - "request": { - "jsonrpc":"2.0", - "id":"suspend-1", - "method":"$/alsDebug", - "params":{ + "send": { + "request": { + "jsonrpc": "2.0", + "id": "stop", + "method": "workspace/executeCommand", + "params": { + "arguments": [ + { "inputQueueLength": 2 - } - }, + } + ], + "command": "als-suspend-execution" + } + }, "wait":[] } }, { @@ -88,6 +99,9 @@ "params": {"id": "defname-1"} }, "wait":[{ + "id":"stop", + "result":null + }, { "id": "defname-1", "error": { "code":-32800, diff --git a/testsuite/ada_lsp/cancel/test.yaml b/testsuite/ada_lsp/cancel/test.yaml index 600266d87..cdc8d1fd1 100644 --- a/testsuite/ada_lsp/cancel/test.yaml +++ b/testsuite/ada_lsp/cancel/test.yaml @@ -1,4 +1 @@ title: 'cancel' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] From 5e57d090daf5b5d0a0e4ad1926b3a0ca68cffccc Mon Sep 17 00:00:00 2001 From: Andry Ogorodnik Date: Wed, 30 Aug 2023 09:29:57 +0000 Subject: [PATCH 070/152] Completions implementation --- .../ada/lsp-ada_completions-generic_assoc.adb | 3 +- source/ada/lsp-ada_completions.adb | 335 +++++++++++++++++- source/ada/lsp-ada_completions.ads | 4 +- source/ada/lsp-ada_configurations.adb | 16 + source/ada/lsp-ada_configurations.ads | 3 + source/ada/lsp-ada_documents.adb | 59 ++- source/ada/lsp-lal_utils.adb | 14 - source/ada/lsp-lal_utils.ads | 19 - source/ada/lsp-utils.adb | 19 +- source/ada/lsp-utils.ads | 10 + .../completion.aggregates.complex/test.json | 50 +-- .../completion.aggregates.complex/test.yaml | 3 - 12 files changed, 445 insertions(+), 90 deletions(-) diff --git a/source/ada/lsp-ada_completions-generic_assoc.adb b/source/ada/lsp-ada_completions-generic_assoc.adb index f99a1a395..b385a543b 100644 --- a/source/ada/lsp-ada_completions-generic_assoc.adb +++ b/source/ada/lsp-ada_completions-generic_assoc.adb @@ -380,8 +380,7 @@ package body LSP.Ada_Completions.Generic_Assoc is Self.Compute_Doc_And_Details); Pretty_Print_Snippet (Context => Self.Context.all, - Prefix => - VSS.Strings.Conversions.To_UTF_8_String (Prefix), + Prefix => Prefix, -- "column = offset - 1" Offset => Integer (Column) - 1, Span => Prefix_Span, diff --git a/source/ada/lsp-ada_completions.adb b/source/ada/lsp-ada_completions.adb index db11c7e49..51154956b 100644 --- a/source/ada/lsp-ada_completions.adb +++ b/source/ada/lsp-ada_completions.adb @@ -15,16 +15,39 @@ -- of the license. -- ------------------------------------------------------------------------------ +with Ada.Containers.Indefinite_Hashed_Maps; with Ada.Containers.Hashed_Sets; +with VSS.Characters.Latin; +with VSS.Regular_Expressions; +with VSS.Strings; use VSS.Strings; +with VSS.Strings.Conversions; +with VSS.Strings.Cursors.Iterators.Characters; +with VSS.Strings.Cursors.Markers; with VSS.Strings.Hash; +with LSP.Ada_Configurations; +with LSP.Ada_Contexts; with LSP.Ada_Documents; +with LSP.Enumerations; with LSP.Utils; +with Pp.Actions; +with Pp.Command_Lines; +with Pp.Scanner; +with Utils.Command_Lines; +with Utils.Command_Lines.Common; +with Utils.Char_Vectors; + package body LSP.Ada_Completions is pragma Warnings (Off); + package Encoding_Maps is new Ada.Containers.Indefinite_Hashed_Maps + (Key_Type => VSS.Strings.Virtual_String, + Element_Type => VSS.Strings.Virtual_String, + Hash => VSS.Strings.Hash, + Equivalent_Keys => VSS.Strings."="); + ------------------ -- Is_End_Token -- ------------------ @@ -157,14 +180,316 @@ package body LSP.Ada_Completions is -------------------------- procedure Pretty_Print_Snippet - (Context : LSP.Ada_Contexts.Context; Prefix : String; Offset : Natural; - Span : LSP.Structures.A_Range; Rule : Libadalang.Common.Grammar_Rule; + (Context : LSP.Ada_Contexts.Context; + Prefix : VSS.Strings.Virtual_String; + Offset : Natural; + Span : LSP.Structures.A_Range; + Rule : Libadalang.Common.Grammar_Rule; Result : in out LSP.Structures.CompletionItem) is + use LSP.Ada_Contexts; + + Encoding : Encoding_Maps.Map; + -- Map of Snippet fake name to snippet: + -- {"Foo_1" : "$1", "Foo_2" : "${2: Integer}"} + -- $0 will not be replaced + + procedure Set_PP_Switches + (Cmd : in out Standard.Utils.Command_Lines.Command_Line); + -- Force switches not enabled by default by GNATpp + + function Encode_String (S : Virtual_String) return Virtual_String; + -- Create pseudo code for the snippet + + function Decode_String (S : Virtual_String) return Virtual_String; + -- Recreate the snippet via the pseudo code + + function Snippet_Placeholder (S : Virtual_String) return Virtual_String + is ("FooBar_" & S); + -- Generate a fake entity for a snippet (S is the index of the snippet) + -- The length of the placeholder will affect where the strings is cut + -- to avoid exceeding line length => 8/9 characters seems to be + -- reasonable (most of the time a placeholder is replacing the + -- parameter type's name) + + function Find_Next_Placeholder + (S : Virtual_String; + Start : VSS.Strings.Cursors.Iterators.Characters. + Character_Iterator'Class) + return VSS.Regular_Expressions.Regular_Expression_Match; + -- Find the next placeholder starting from Start in S + + function Post_Pretty_Print (S : Virtual_String) return Virtual_String; + -- Indent the block using the initial location and add back $0 (it has + -- been removed to not generate invalid pseudo code) + + --------------------- + -- Set_PP_Switches -- + --------------------- + + procedure Set_PP_Switches + (Cmd : in out Standard.Utils.Command_Lines.Command_Line) is + + begin + -- If not set by the user: align parameters and aggregates + + if not Pp.Command_Lines.Pp_Nat_Switches.Explicit + (Cmd, Pp.Command_Lines.Call_Threshold) + then + Pp.Command_Lines.Pp_Nat_Switches.Set_Arg + (Cmd, Pp.Command_Lines.Call_Threshold, 1); + end if; + + if not Pp.Command_Lines.Pp_Nat_Switches.Explicit + (Cmd, Pp.Command_Lines.Par_Threshold) + then + Pp.Command_Lines.Pp_Nat_Switches.Set_Arg + (Cmd, Pp.Command_Lines.Par_Threshold, 1); + end if; + + if not Pp.Command_Lines.Pp_Boolean_Switches.Explicit + (Cmd, Pp.Command_Lines.Vertical_Named_Aggregates) + then + Pp.Command_Lines.Pp_Boolean_Switches.Set_Arg + (Cmd, Pp.Command_Lines.Vertical_Named_Aggregates); + end if; + end Set_PP_Switches; + + ------------------- + -- Encode_String -- + ------------------- + + function Encode_String (S : Virtual_String) return Virtual_String + is + Res : Virtual_String; + Start_Encoded : VSS.Strings.Cursors.Markers.Character_Marker; + Search_Index : Boolean := False; + Encoded_Index : Virtual_String; + In_Snippet : Boolean := False; + + procedure Add_Placeholder + (Cursor : VSS.Strings.Cursors.Abstract_Cursor'Class); + + --------------------- + -- Add_Placeholder -- + --------------------- + + procedure Add_Placeholder + (Cursor : VSS.Strings.Cursors.Abstract_Cursor'Class) + is + Placeholder : constant Virtual_String := + Snippet_Placeholder (Encoded_Index); + begin + if not Encoded_Index.Is_Empty then + Encoding.Insert + (Placeholder, + S.Slice (S.At_Character (Start_Encoded), Cursor)); + Append (Res, Placeholder); + Encoded_Index.Clear; + end if; + end Add_Placeholder; + + I : VSS.Strings.Cursors.Iterators.Characters. + Character_Iterator := S.At_First_Character; + Dummy : Boolean; + begin + while I.Has_Element loop + case I.Element is + when '$' => + Search_Index := True; + Start_Encoded := I.Marker; + Encoded_Index.Clear; + when '{' => + In_Snippet := True; + when '}' => + Add_Placeholder (I); + In_Snippet := False; + Search_Index := False; + when '0' .. '9' => + if Search_Index then + Append (Encoded_Index, I.Element); + elsif not In_Snippet then + Append (Res, I.Element); + end if; + when others => + Search_Index := False; + if not In_Snippet then + Add_Placeholder (I); + Append (Res, I.Element); + end if; + end case; + Dummy := I.Forward; + end loop; + + -- Do nothing for $0 which will be removed at the end + + return Res; + end Encode_String; + + ------------------- + -- Decode_String -- + ------------------- + + function Decode_String (S : Virtual_String) return Virtual_String + is + use type VSS.Characters.Virtual_Character; + + Res : Virtual_String; + U : Virtual_String := S; + Dummy : Boolean; + begin + -- Remove the extra whitespace at the start + while U.At_First_Character.Element = VSS.Characters.Latin.Space loop + U.Delete (U.At_First_Character, U.At_First_Character); + end loop; + + declare + Iterator : VSS.Strings.Cursors.Iterators.Characters. + Character_Iterator := U.At_First_Character; + begin + loop + declare + Match : constant VSS.Regular_Expressions. + Regular_Expression_Match := + Find_Next_Placeholder (U, Iterator); + begin + exit when not Match.Has_Match; + declare + Pos : VSS.Strings.Cursors.Iterators.Characters. + Character_Iterator := U.At_Character + (Match.First_Marker); + begin + Dummy := Pos.Backward; + Append (Res, U.Slice (Iterator, Pos)); + end; + Append (Res, Encoding (Match.Captured)); + Iterator.Set_At (Match.Last_Marker); + Dummy := Iterator.Forward; + end; + end loop; + + Append (Res, U.Slice (Iterator, U.At_Last_Character)); + end; + + return Res; + end Decode_String; + + --------------------------- + -- Find_Next_Placeholder -- + --------------------------- + + function Find_Next_Placeholder + (S : Virtual_String; + Start : VSS.Strings.Cursors.Iterators.Characters. + Character_Iterator'Class) + return VSS.Regular_Expressions.Regular_Expression_Match + is + Placeholder_Regexp : constant VSS.Regular_Expressions. + Regular_Expression := VSS.Regular_Expressions.To_Regular_Expression + ("FooBar_[0-9]+"); + begin + return Placeholder_Regexp.Match (S, Start); + end Find_Next_Placeholder; + + ----------------------- + -- Post_Pretty_Print -- + ----------------------- + + function Post_Pretty_Print (S : Virtual_String) return Virtual_String + is + Res : Virtual_String; + begin + -- Remove this condition when V725-006 is fixed + if Ends_With (S, New_Line_Function) then + declare + C : VSS.Strings.Cursors.Iterators.Characters. + Character_Iterator := S.At_Last_Character; + Dummy : Boolean; + begin + Dummy := C.Backward; + Res := Slice (S, S.At_First_Character, C); + end; + else + Res := S; + end if; + + -- Add back snippet terminator + Append (Res, "$0"); + return Res; + end Post_Pretty_Print; + + use type LSP.Enumerations.InsertTextFormat; begin - pragma Compile_Time_Warning - (Standard.True, "Pretty_Print_Snippet unimplemented"); - raise Program_Error with "Unimplemented procedure Pretty_Print_Snippet"; + if LSP.Ada_Configurations.Completion_Formatting + and then not Result.insertText.Is_Empty + and then Result.insertTextFormat.Is_Set + and then Result.insertTextFormat.Value = LSP.Enumerations.Snippet + then + declare + Input : Standard.Utils.Char_Vectors.Char_Vector; + Output : Standard.Utils.Char_Vectors.Char_Vector; + PP_Messages : Pp.Scanner.Source_Message_Vector; + S : Virtual_String; + Tmp_Unit : Libadalang.Analysis.Analysis_Unit; + Cmd : Standard.Utils.Command_Lines.Command_Line := + Context.Get_PP_Options; + Tmp_Context : constant Libadalang.Analysis.Analysis_Context := + Libadalang.Analysis.Create_Context + (Charset => Standard.Utils.Command_Lines.Common. + Wide_Character_Encoding (Cmd)); + begin + Set_PP_Switches (Cmd); + + declare + Full : constant String := + VSS.Strings.Conversions.To_UTF_8_String + (Prefix & Encode_String (Result.insertText)); + begin + Input.Append (Full); + Tmp_Unit := + Libadalang.Analysis.Get_From_Buffer + (Context => Tmp_Context, + Filename => "", + Buffer => Full, + Rule => Rule); + Pp.Actions.Format_Vector + (Cmd => Cmd, + Input => Input, + Node => Libadalang.Analysis.Root (Tmp_Unit), + Output => Output, + Messages => PP_Messages, + Initial_Indentation => Offset, + Partial_GNATPP => True); + exception + when E : others => + -- Failed to pretty print the snippet, keep the previous + -- value. + Context.Tracer.Trace_Exception (E); + return; + end; + + S := VSS.Strings.Conversions.To_Virtual_String (Output.To_Array); + + if not S.Is_Empty then + -- The text is already formatted, don't try to indent it + Result.insertTextMode := + (Is_Set => True, + Value => LSP.Enumerations.asIs); + + -- Label is too verbose and can conflict with client filtering + -- set filterText to the content of the span we are replacing. + Result.filterText := Prefix; + + Result.textEdit := + (Is_Set => True, + Value => + (Is_TextEdit => True, + TextEdit => + (a_range => Span, + newText => Post_Pretty_Print (Decode_String (S))))); + end if; + end; + end if; end Pretty_Print_Snippet; --------------------------- diff --git a/source/ada/lsp-ada_completions.ads b/source/ada/lsp-ada_completions.ads index ba63ad90e..50d9c1c07 100644 --- a/source/ada/lsp-ada_completions.ads +++ b/source/ada/lsp-ada_completions.ads @@ -25,6 +25,8 @@ with Langkit_Support.Text; with Libadalang.Analysis; with Libadalang.Common; +with VSS.Strings; + limited with LSP.Ada_Contexts; limited with LSP.Ada_Documents; limited with LSP.Ada_Completions.Filters; @@ -114,7 +116,7 @@ package LSP.Ada_Completions is procedure Pretty_Print_Snippet (Context : LSP.Ada_Contexts.Context; - Prefix : String; + Prefix : VSS.Strings.Virtual_String; Offset : Natural; Span : LSP.Structures.A_Range; Rule : Libadalang.Common.Grammar_Rule; diff --git a/source/ada/lsp-ada_configurations.adb b/source/ada/lsp-ada_configurations.adb index 6f1ac0288..080d5b8c6 100644 --- a/source/ada/lsp-ada_configurations.adb +++ b/source/ada/lsp-ada_configurations.adb @@ -19,6 +19,8 @@ pragma Ada_2022; with Ada.Containers.Generic_Anonymous_Array_Sort; +with GNATCOLL.Traces; + with VSS.Strings.Conversions; with VSS.JSON.Streams; @@ -35,6 +37,20 @@ package body LSP.Ada_Configurations is function "+" (X : VSS.Strings.Virtual_String'Class) return String renames VSS.Strings.Conversions.To_UTF_8_String; + ALS_COMPLETION_FORMATTING : constant GNATCOLL.Traces.Trace_Handle := + GNATCOLL.Traces.Create + ("ALS.COMPLETION.FORMATTING", Default => GNATCOLL.Traces.On); + -- Used in Completion_Formatting/LSP.Ada_Completions.Pretty_Print_Snippet + + --------------------------- + -- Completion_Formatting -- + --------------------------- + + function Completion_Formatting return Boolean is + begin + return ALS_COMPLETION_FORMATTING.Is_Active; + end Completion_Formatting; + --------------- -- Read_JSON -- --------------- diff --git a/source/ada/lsp-ada_configurations.ads b/source/ada/lsp-ada_configurations.ads index d9f4c8f3b..f4cdaaf99 100644 --- a/source/ada/lsp-ada_configurations.ads +++ b/source/ada/lsp-ada_configurations.ads @@ -97,6 +97,9 @@ package LSP.Ada_Configurations is function Display_Method_Ancestry_Policy (Self : Configuration'Class) return DisplayMethodAncestryOnNavigationPolicy; + function Completion_Formatting return Boolean; + -- Used in LSP.Ada_Completions.Pretty_Print_Snippet + private type Configuration is tagged limited record diff --git a/source/ada/lsp-ada_documents.adb b/source/ada/lsp-ada_documents.adb index b712ec76e..270ba18dc 100644 --- a/source/ada/lsp-ada_documents.adb +++ b/source/ada/lsp-ada_documents.adb @@ -43,11 +43,13 @@ with VSS.Unicode; with LSP.Ada_Completions.Filters; with LSP.Ada_Contexts; +with LSP.Ada_Documentation; with LSP.Ada_Documents.LAL_Diagnostics; with LSP.Ada_Id_Iterators; with LSP.Enumerations; with LSP.Predicates; with LSP.Utils; +with LSP.Structures.LSPAny_Vectors; package body LSP.Ada_Documents is pragma Warnings (Off); @@ -2087,15 +2089,60 @@ package body LSP.Ada_Documents is --------------------------------------- procedure Set_Completion_Item_Documentation - (Context : LSP.Ada_Contexts.Context; BD : Libadalang.Analysis.Basic_Decl; + (Context : LSP.Ada_Contexts.Context; + BD : Libadalang.Analysis.Basic_Decl; Item : in out LSP.Structures.CompletionItem; - Compute_Doc_And_Details : Boolean) + Compute_Doc_And_Details : Boolean) is begin - pragma Compile_Time_Warning - (Standard.True, "Set_Completion_Item_Documentation unimplemented"); - raise Program_Error - with "Unimplemented procedure Set_Completion_Item_Documentation"; + -- Compute the 'documentation' and 'detail' fields immediately if + -- requested (i.e: when the client does not support lazy computation + -- for these fields or if we are dealing with predefined types). + if Compute_Doc_And_Details or else LSP.Utils.Is_Synthetic (BD) then + declare + Qual_Text : VSS.Strings.Virtual_String; + Decl_Text : VSS.Strings.Virtual_String; + Loc_Text : VSS.Strings.Virtual_String; + Doc_Text : VSS.Strings.Virtual_String; + Aspects_Text : VSS.Strings.Virtual_String; + + begin + LSP.Ada_Documentation.Get_Tooltip_Text + (BD => BD, + Style => Context.Get_Documentation_Style, + Declaration_Text => Decl_Text, + Qualifier_Text => Qual_Text, + Location_Text => Loc_Text, + Documentation_Text => Doc_Text, + Aspects_Text => Aspects_Text); + + Item.detail := Decl_Text; + + if not Doc_Text.Is_Empty then + Loc_Text.Append + (VSS.Strings.To_Virtual_String + ((1 .. 2 => Ada.Characters.Wide_Wide_Latin_1.LF))); + + Loc_Text.Append (Doc_Text); + end if; + + Item.documentation := + (Is_Set => True, + Value => LSP.Structures.Virtual_String_Or_MarkupContent' + (Is_Virtual_String => True, + Virtual_String => Loc_Text)); + end; + + else + -- Set node's location to the 'data' field of the completion item, so + -- that we can retrieve it in the completionItem/resolve handler. + LSP.Structures.LSPAny_Vectors.To_Any + (LSP.Structures.Location' + (uri => LSP.Utils.To_DocumentUri (BD.Unit.Get_Filename), + a_range => LSP.Utils.To_Range (BD.Sloc_Range), + others => <>), + Item.data); + end if; end Set_Completion_Item_Documentation; --------------------- diff --git a/source/ada/lsp-lal_utils.adb b/source/ada/lsp-lal_utils.adb index e43da96cb..cc9c97994 100644 --- a/source/ada/lsp-lal_utils.adb +++ b/source/ada/lsp-lal_utils.adb @@ -659,20 +659,6 @@ package body LSP.Lal_Utils is return Token_Kind = Libadalang.Common.Ada_End; end Is_End_Token; - ------------------ - -- Is_Synthetic -- - ------------------ - - function Is_Synthetic - (Node : Libadalang.Analysis.Ada_Node'Class) return Boolean - is - Std : constant String := "__standard"; - File : constant String := Node.Unit.Get_Filename; - begin - return File'Length >= Std'Length - and then File (File'Last - Std'Length + 1 .. File'Last) = Std; - end Is_Synthetic; - ----------------------- -- Skip_Dotted_Names -- ----------------------- diff --git a/source/ada/lsp-lal_utils.ads b/source/ada/lsp-lal_utils.ads index e5b657968..cd92347ed 100644 --- a/source/ada/lsp-lal_utils.ads +++ b/source/ada/lsp-lal_utils.ads @@ -114,19 +114,6 @@ package LSP.Lal_Utils is with Pre => (if Versioned_Documents then Document_Provider /= null); -- Converts an Edit_Map into a WorkspaceEdit -<<<<<<< Updated upstream - function To_Workspace_Edit - (Edits : LAL_Refactor.Refactoring_Edits; - Resource_Operations : LSP.Messages.Optional_ResourceOperationKindSet := - LSP.Messages.Optional_ResourceOperationKindSet'(Is_Set => False); - Versioned_Documents : Boolean := False; - Document_Provider : access LSP.Ada_Documents.Document_Provider'Class := - null; - Rename : Boolean := False) - return LSP.Messages.WorkspaceEdit; - -- Converts a Refactoring_Edits into a WorkspaceEdit. The Rename flag - -- controls if files that are supposed to be deleted, are renamed instead. -======= --------------- -- Called_By -- --------------- @@ -176,7 +163,6 @@ package LSP.Lal_Utils is -- Convert the given Node and the given references to it to the -- corresponding CallHierarchyItem and its associated spans, which contains -- the references. This should be used for the callHierarchy requests. ->>>>>>> Stashed changes function Containing_Entity (Ref : Ada_Node; @@ -215,9 +201,4 @@ package LSP.Lal_Utils is (Node : Libadalang.Analysis.Ada_Node) return Libadalang.Analysis.Ada_Node; -- While Node.Kind is the Dotted_Name go up. - function Is_Synthetic - (Node : Libadalang.Analysis.Ada_Node'Class) return Boolean; - -- Check if Node is in a synthetic file (like "__standard"). - -- TODO: Replace this with LAL property as it will be available. - end LSP.Lal_Utils; diff --git a/source/ada/lsp-utils.adb b/source/ada/lsp-utils.adb index ffa52283c..f77a5694a 100644 --- a/source/ada/lsp-utils.adb +++ b/source/ada/lsp-utils.adb @@ -23,7 +23,6 @@ with Libadalang.Common; with Libadalang.Sources; with Langkit_Support.Symbols; -with VSS.Strings.Conversions; with VSS.Strings.Formatters.Generic_Modulars; with VSS.Strings.Formatters.Strings; with VSS.Strings.Templates; @@ -183,6 +182,24 @@ package body LSP.Utils is return Get_Location (Node.Unit, Node.Sloc_Range); end Get_Node_Location; + ------------------ + -- Is_Synthetic -- + ------------------ + + function Is_Synthetic + (Node : Libadalang.Analysis.Ada_Node'Class) return Boolean + is + use type Libadalang.Analysis.Analysis_Unit; + + Std : constant Libadalang.Analysis.Analysis_Unit := Node.Unit; + + Unit : constant Libadalang.Analysis.Analysis_Unit := + Node.P_Standard_Unit; + begin + + return Std = Unit; + end Is_Synthetic; + ---------- -- Hash -- ---------- diff --git a/source/ada/lsp-utils.ads b/source/ada/lsp-utils.ads index 0e87fe244..7eea9950e 100644 --- a/source/ada/lsp-utils.ads +++ b/source/ada/lsp-utils.ads @@ -20,6 +20,7 @@ with Ada.Containers; with VSS.Strings; +with VSS.Strings.Conversions; with Libadalang.Analysis; with Langkit_Support.Slocs; @@ -75,4 +76,13 @@ package LSP.Utils is function Hash (Value : LSP.Structures.A_Range) return Ada.Containers.Hash_Type; + function Is_Synthetic + (Node : Libadalang.Analysis.Ada_Node'Class) return Boolean; + -- Check if Node is in a synthetic file (like "__standard"). + + function To_DocumentUri + (X : String) + return LSP.Structures.DocumentUri is + (VSS.Strings.Conversions.To_Virtual_String (X) with null record); + end LSP.Utils; diff --git a/testsuite/ada_lsp/completion.aggregates.complex/test.json b/testsuite/ada_lsp/completion.aggregates.complex/test.json index 65ac18909..ea914c774 100644 --- a/testsuite/ada_lsp/completion.aggregates.complex/test.json +++ b/testsuite/ada_lsp/completion.aggregates.complex/test.json @@ -71,7 +71,6 @@ "id": 1, "result": { "capabilities": { - "textDocumentSync": 2, "completionProvider": { "triggerCharacters": [ ".", @@ -80,29 +79,7 @@ "(" ], "resolveProvider": true - }, - "hoverProvider": true, - "declarationProvider": true, - "definitionProvider": true, - "typeDefinitionProvider": true, - "implementationProvider": true, - "referencesProvider": true, - "codeActionProvider": { - }, - "renameProvider": { - }, - "foldingRangeProvider": true, - "executeCommandProvider": {}, - "alsReferenceKinds": [ - "reference", - "access", - "write", - "call", - "dispatching call", - "parent", - "child", - "overriding" - ] + } } } } @@ -217,7 +194,6 @@ "sortText": "+00", "insertText": "-6, ${2:A : Integer})$0", "insertTextFormat": 2, - "additionalTextEdits": [], "documentation": "at foo.adb (2:4)" }, { @@ -226,7 +202,7 @@ "sortText": "+01", "insertText": "X => -6", "insertTextFormat": 1, - "additionalTextEdits": [] + "documentation": "X => " }, { "label": "A", @@ -234,7 +210,7 @@ "sortText": "+02", "insertText": "A => ", "insertTextFormat": 1, - "additionalTextEdits": [] + "documentation": "A => " }, { "label": "Aggregate when X => -5 | -4", @@ -243,7 +219,6 @@ "sortText": "+03", "insertText": "${1:X : -5 | -4}, ${2:B : Integer})$0", "insertTextFormat": 2, - "additionalTextEdits": [], "documentation": "at foo.adb (2:4)" }, { @@ -252,7 +227,7 @@ "sortText": "+04", "insertText": "X => ", "insertTextFormat": 1, - "additionalTextEdits": [] + "documentation": "X => " }, { "label": "B", @@ -260,7 +235,7 @@ "sortText": "+05", "insertText": "B => ", "insertTextFormat": 1, - "additionalTextEdits": [] + "documentation": "B => " }, { "label": "Aggregate when X => -3 .. -1", @@ -269,7 +244,6 @@ "sortText": "+06", "insertText": "${1:X : -3 .. -1}, ${2:C : Integer})$0", "insertTextFormat": 2, - "additionalTextEdits": [], "documentation": "at foo.adb (2:4)" }, { @@ -278,7 +252,7 @@ "sortText": "+07", "insertText": "X => ", "insertTextFormat": 1, - "additionalTextEdits": [] + "documentation": "X => " }, { "label": "C", @@ -286,7 +260,7 @@ "sortText": "+08", "insertText": "C => ", "insertTextFormat": 1, - "additionalTextEdits": [] + "documentation": "C => " }, { "label": "Aggregate when X => Natural", @@ -295,7 +269,6 @@ "sortText": "+09", "insertText": "${1:X : Natural}, ${2:D : Integer})$0", "insertTextFormat": 2, - "additionalTextEdits": [], "documentation": "at foo.adb (2:4)" }, { @@ -304,7 +277,7 @@ "sortText": "+10", "insertText": "X => ", "insertTextFormat": 1, - "additionalTextEdits": [] + "documentation": "X => " }, { "label": "D", @@ -312,7 +285,7 @@ "sortText": "+11", "insertText": "D => ", "insertTextFormat": 1, - "additionalTextEdits": [] + "documentation": "D => " }, { "label": "Aggregate when X => others", @@ -321,7 +294,6 @@ "sortText": "+12", "insertText": "${1:X : others}, ${2:E : Integer})$0", "insertTextFormat": 2, - "additionalTextEdits": [], "documentation": "at foo.adb (2:4)" }, { @@ -330,7 +302,7 @@ "sortText": "+13", "insertText": "X => ", "insertTextFormat": 1, - "additionalTextEdits": [] + "documentation": "X => " }, { "label": "E", @@ -338,7 +310,7 @@ "sortText": "+14", "insertText": "E => ", "insertTextFormat": 1, - "additionalTextEdits": [] + "documentation": "E => " } ] } diff --git a/testsuite/ada_lsp/completion.aggregates.complex/test.yaml b/testsuite/ada_lsp/completion.aggregates.complex/test.yaml index b9b5c1c87..9d29b3e9b 100644 --- a/testsuite/ada_lsp/completion.aggregates.complex/test.yaml +++ b/testsuite/ada_lsp/completion.aggregates.complex/test.yaml @@ -1,4 +1 @@ title: 'completion.aggregates.complex' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] From 85319abb437b54fae6149074b4a339dae9b80ae9 Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Wed, 30 Aug 2023 14:01:05 +0300 Subject: [PATCH 071/152] Add document symbol request Refs #1170 --- source/ada/lsp-ada_client_capabilities.adb | 18 + source/ada/lsp-ada_client_capabilities.ads | 4 + source/ada/lsp-ada_handlers-symbols.adb | 394 +++++++++++++++++++ source/ada/lsp-ada_handlers-symbols.ads | 35 ++ source/ada/lsp-ada_handlers.adb | 34 ++ source/ada/lsp-ada_handlers.ads | 5 + source/lsp_3.17/lsp-constants.ads | 9 + source/lsp_3.17/lsp-structures-unwrap.ads | 10 + testsuite/ada_lsp/0003-get_symbols/test.yaml | 3 - 9 files changed, 509 insertions(+), 3 deletions(-) create mode 100644 source/ada/lsp-ada_handlers-symbols.adb create mode 100644 source/ada/lsp-ada_handlers-symbols.ads diff --git a/source/ada/lsp-ada_client_capabilities.adb b/source/ada/lsp-ada_client_capabilities.adb index b85c00340..479c8a8bd 100644 --- a/source/ada/lsp-ada_client_capabilities.adb +++ b/source/ada/lsp-ada_client_capabilities.adb @@ -56,6 +56,23 @@ package body LSP.Ada_Client_Capabilities is else False); end Code_ActionLiteralSupport; + ------------------------- + -- Hierarchical_Symbol -- + ------------------------- + + function Hierarchical_Symbol + (Self : Client_Capability'Class) return Boolean + is + use LSP.Structures.Unwrap; + + Result : constant LSP.Structures.Boolean_Optional := + hierarchicalDocumentSymbolSupport + (documentSymbol + (Self.Value.capabilities.textDocument)); + begin + return (if Result.Is_Set then Result.Value else False); + end Hierarchical_Symbol; + ---------------- -- Initialize -- ---------------- @@ -209,6 +226,7 @@ package body LSP.Ada_Client_Capabilities is Result.declarationProvider := LSP.Constants.True; Result.definitionProvider := LSP.Constants.True; Result.documentHighlightProvider := LSP.Constants.True; + Result.documentSymbolProvider := LSP.Constants.True; Result.foldingRangeProvider := LSP.Constants.True; Result.hoverProvider := LSP.Constants.True; Result.implementationProvider := LSP.Constants.True; diff --git a/source/ada/lsp-ada_client_capabilities.ads b/source/ada/lsp-ada_client_capabilities.ads index bd41bb5fd..e5279827a 100644 --- a/source/ada/lsp-ada_client_capabilities.ads +++ b/source/ada/lsp-ada_client_capabilities.ads @@ -72,6 +72,10 @@ package LSP.Ada_Client_Capabilities is (Self : Client_Capability'Class) return Boolean; -- Returns capabilities.textDocument.publishDiagnostics.relatedInformation + function Hierarchical_Symbol + (Self : Client_Capability'Class) return Boolean; + -- Returns textDocument.documentSymbol.hierarchicalDocumentSymbolSupport + -- Resource 0perations -- function Resource_Create_Supported diff --git a/source/ada/lsp-ada_handlers-symbols.adb b/source/ada/lsp-ada_handlers-symbols.adb new file mode 100644 index 000000000..2951e5e63 --- /dev/null +++ b/source/ada/lsp-ada_handlers-symbols.adb @@ -0,0 +1,394 @@ +------------------------------------------------------------------------------ +-- Language Server Protocol -- +-- -- +-- Copyright (C) 2018-2023, AdaCore -- +-- -- +-- This is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 3, or (at your option) any later ver- -- +-- sion. This software is distributed in the hope that it will be useful, -- +-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- -- +-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -- +-- License for more details. You should have received a copy of the GNU -- +-- General Public License distributed with this software; see file -- +-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy -- +-- of the license. -- +------------------------------------------------------------------------------ + +with Ada.Characters.Wide_Wide_Latin_1; + +with Langkit_Support.Text; + +with Libadalang.Common; +with Libadalang.Iterators; + +with VSS.Characters; + +with LSP.Ada_Handlers.Locations; +with LSP.Constants; +with LSP.Enumerations; +with LSP.Utils; + +package body LSP.Ada_Handlers.Symbols is + + function Get_Profile + (Node : Libadalang.Analysis.Basic_Decl; + Is_Function : out Boolean) + return VSS.Strings.Virtual_String; + -- Return the profile of Node. + + --------------------------- + -- Flat_Document_Symbols -- + --------------------------- + + procedure Flat_Document_Symbols + (Self : in out Message_Handler'Class; + Unit : Libadalang.Analysis.Analysis_Unit; + Pattern : LSP.Search.Search_Pattern'Class; + Result : in out LSP.Structures.DocumentSymbol_Result) + is + Element : Libadalang.Analysis.Ada_Node; + + Is_Defining_Name : constant Libadalang.Iterators.Ada_Node_Predicate := + Libadalang.Iterators.Kind_Is (Libadalang.Common.Ada_Defining_Name); + -- This object will be deallocated by Cursor's finalization + + Cursor : Libadalang.Iterators.Traverse_Iterator'Class := + Libadalang.Iterators.Find (Unit.Root, Is_Defining_Name); + + begin + while not Self.Is_Canceled.all + and then Cursor.Next (Element) + loop + declare + use type LSP.Enumerations.SymbolKind; + + Item : LSP.Structures.SymbolInformation; + Kind : constant LSP.Enumerations.SymbolKind := + LSP.Utils.Get_Decl_Kind + (Element.As_Defining_Name.P_Basic_Decl, Ignore_Local => True); + begin + if Kind /= LSP.Enumerations.A_Null + and then Pattern.Match + (VSS.Strings.To_Virtual_String (Element.Text)) + then + Item := + (name => + VSS.Strings.To_Virtual_String (Element.Text), + kind => Kind, + tags => LSP.Constants.Empty, + deprecated => <>, + location => + LSP.Ada_Handlers.Locations.To_LSP_Location (Self, Element), + containerName => <>); + + Result.Variant_1.Append (Item); + end if; + end; + end loop; + end Flat_Document_Symbols; + + ----------------- + -- Get_Profile -- + ----------------- + + function Get_Profile + (Node : Libadalang.Analysis.Basic_Decl; + Is_Function : out Boolean) return VSS.Strings.Virtual_String + is + use Libadalang.Analysis; + use Libadalang.Common; + + function To_Text + (Node : Ada_Node'Class) return VSS.Strings.Virtual_String; + -- Retrieve the node text and format it + + function To_Profile + (Node : Libadalang.Analysis.Subp_Spec'Class) + return VSS.Strings.Virtual_String; + + ------------- + -- To_Text -- + ------------- + + function To_Text + (Node : Ada_Node'Class) return VSS.Strings.Virtual_String + is + Node_Text : constant Langkit_Support.Text.Text_Type := Node.Text; + Was_Space : Boolean := False; + Result : VSS.Strings.Virtual_String; + begin + for I in Node_Text'Range loop + if Node_Text (I) = ' ' then + -- Trim multiple whitespace to only keep one + + if not Was_Space then + Result.Append + (VSS.Characters.Virtual_Character (Node_Text (I))); + end if; + + Was_Space := True; + + -- Remove the new line character + + elsif Node_Text (I) /= Ada.Characters.Wide_Wide_Latin_1.LF then + Was_Space := False; + Result.Append + (VSS.Characters.Virtual_Character (Node_Text (I))); + end if; + end loop; + + return Result; + end To_Text; + + ---------------- + -- To_Profile -- + ---------------- + + function To_Profile + (Node : Libadalang.Analysis.Subp_Spec'Class) + return VSS.Strings.Virtual_String + is + Result : VSS.Strings.Virtual_String; + Params : constant Param_Spec_Array := Node.P_Params; + Returns : constant Type_Expr := Node.F_Subp_Returns; + + begin + if Params'Length > 0 then + Result.Append ('('); + end if; + + for Param of Params loop + declare + use type VSS.Strings.Character_Count; + + Names : constant Defining_Name_List := Param.F_Ids; + Init : constant Expr := Param.F_Default_Expr; + Item : VSS.Strings.Virtual_String; + Mode : constant Ada_Mode := Param.F_Mode; + + begin + Item.Append (" :"); + + case Mode is + when Ada_Mode_Default | Ada_Mode_In => + Item.Append (" in "); + when Ada_Mode_In_Out => + Item.Append (" in out "); + when Ada_Mode_Out => + Item.Append (" out "); + end case; + + Item.Append (To_Text (Param.F_Type_Expr)); + + if not Init.Is_Null then + Item.Append (" := "); + Item.Append (To_Text (Init)); + end if; + + for J in Names.First_Child_Index .. Names.Last_Child_Index loop + if Result.Character_Length /= 1 then + Result.Append ("; "); + end if; + + Result.Append (To_Text (Names.Child (J))); + Result.Append (Item); + end loop; + end; + end loop; + + if Params'Length > 0 then + Result.Append (')'); + end if; + + if not Returns.Is_Null then + Is_Function := True; + Result.Append (" return "); + Result.Append (To_Text (Returns)); + end if; + + return Result; + end To_Profile; + + begin + Is_Function := False; + + case Node.Kind is + when Ada_Classic_Subp_Decl => + return To_Profile (Node.As_Classic_Subp_Decl.F_Subp_Spec); + when Ada_Base_Subp_Body => + return To_Profile (Node.As_Base_Subp_Body.F_Subp_Spec); + when Ada_Generic_Subp_Decl => + return To_Profile + (Node.As_Generic_Subp_Decl.F_Subp_Decl.F_Subp_Spec); + when others => + return VSS.Strings.Empty_Virtual_String; + end case; + end Get_Profile; + + ----------------------------------- + -- Hierarchical_Document_Symbols -- + ----------------------------------- + + procedure Hierarchical_Document_Symbols + (Self : in out Message_Handler'Class; + Unit : Libadalang.Analysis.Analysis_Unit; + Pattern : LSP.Search.Search_Pattern'Class; + Result : in out LSP.Structures.DocumentSymbol_Vector) + is + use all type LSP.Enumerations.SymbolKind; + + Empty : LSP.Structures.DocumentSymbol_Vector; + + procedure Walk + (Node : Libadalang.Analysis.Ada_Node; + Nested_Level : Integer; + Vector : in out LSP.Structures.DocumentSymbol_Vector); + -- Traverse Node and all its children recursively. Find any defining + -- name and construct corresponding symbol node, then append it to + -- the Tree under a position pointed by the Cursor. + + ---------- + -- Walk -- + ---------- + + procedure Walk + (Node : Libadalang.Analysis.Ada_Node; + Nested_Level : Integer; + Vector : in out LSP.Structures.DocumentSymbol_Vector) + is + use Libadalang.Analysis; + + Children : LSP.Structures.DocumentSymbol_Vector; + Next_Level : Integer := Nested_Level; + begin + if Node.Is_Null + or else Node.Kind in Libadalang.Common.Ada_Expr + or else Self.Is_Canceled.all + then + return; + + end if; + + Next_Level := Next_Level + + (if Node.Kind in Libadalang.Common.Ada_Basic_Decl then 1 else 0); + + for Child of Node.Children loop + if not Child.Is_Null then + Walk (Child, Next_Level, Children); + exit when Self.Is_Canceled.all; + end if; + end loop; + + case Node.Kind is + when Libadalang.Common.Ada_Basic_Decl => + declare + Decl : constant Libadalang.Analysis.Basic_Decl := + Node.As_Basic_Decl; + + Kind : constant LSP.Enumerations.SymbolKind := + LSP.Utils.Get_Decl_Kind + (Decl, Ignore_Local => Nested_Level > 1); + + begin + if Kind /= LSP.Enumerations.A_Null then + declare + Names : constant Libadalang.Analysis.Defining_Name_Array + := Decl.P_Defining_Names; + begin + + for Name of Names loop + exit when Name = Libadalang.Analysis.No_Defining_Name; + + if Pattern.Match + (VSS.Strings.To_Virtual_String (Name.Text)) + then + declare + Is_Function : Boolean; + Profile : constant VSS.Strings.Virtual_String := + Get_Profile (Decl, Is_Function); + Item : constant LSP.Structures.DocumentSymbol := + (name => + VSS.Strings.To_Virtual_String (Name.Text), + detail => Profile, + kind => Kind, + deprecated => (Is_Set => False), + tags => LSP.Constants.Empty, + a_range => Locations.To_LSP_Location + (Self, Node).a_range, + selectionRange => Locations.To_LSP_Location + (Self, Name).a_range, + children => Children); + begin + Vector.Append (Item); + end; + end if; + end loop; + end; + end if; + end; + + when Libadalang.Common.Ada_With_Clause_Range => + declare + With_Node : constant Libadalang.Analysis.With_Clause := + Node.As_With_Clause; + begin + for Name of With_Node.F_Packages loop + declare + Item : constant LSP.Structures.DocumentSymbol := + (name => + VSS.Strings.To_Virtual_String (Name.Text), + detail => VSS.Strings.Empty_Virtual_String, + kind => Namespace, + deprecated => (Is_Set => False), + tags => LSP.Constants.Empty, + a_range => Locations.To_LSP_Location + (Self, Node).a_range, + selectionRange => Locations.To_LSP_Location + (Self, Name).a_range, + children => Empty); + begin + Vector.Append (Item); + end; + end loop; + end; + + when Libadalang.Common.Ada_Pragma_Node => + declare + Pragma_Node : constant Libadalang.Analysis.Pragma_Node := + Node.As_Pragma_Node; + Name : constant Libadalang.Analysis.Identifier := + Pragma_Node.F_Id; + Item : constant LSP.Structures.DocumentSymbol := + (name => + VSS.Strings.To_Virtual_String (Name.Text), + detail => + VSS.Strings.To_Virtual_String + ("(" & (Pragma_Node.F_Args.Text & ")")), + kind => Property, + deprecated => (Is_Set => False), + tags => LSP.Constants.Empty, + a_range => Locations.To_LSP_Location + (Self, Node).a_range, + selectionRange => Locations.To_LSP_Location + (Self, Name).a_range, + children => Empty); + begin + if Nested_Level <= 1 then + Vector.Append (Item); + end if; + end; + + when others => + for J in 1 .. Children.Length loop + Vector.Append (Children (J)); + end loop; + end case; + end Walk; + + Root : constant Libadalang.Analysis.Ada_Node := Unit.Root; + begin + Walk (Root, 0, Result); + end Hierarchical_Document_Symbols; + +end LSP.Ada_Handlers.Symbols; diff --git a/source/ada/lsp-ada_handlers-symbols.ads b/source/ada/lsp-ada_handlers-symbols.ads new file mode 100644 index 000000000..42a46fd30 --- /dev/null +++ b/source/ada/lsp-ada_handlers-symbols.ads @@ -0,0 +1,35 @@ +------------------------------------------------------------------------------ +-- Language Server Protocol -- +-- -- +-- Copyright (C) 2018-2023, AdaCore -- +-- -- +-- This is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 3, or (at your option) any later ver- -- +-- sion. This software is distributed in the hope that it will be useful, -- +-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- -- +-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -- +-- License for more details. You should have received a copy of the GNU -- +-- General Public License distributed with this software; see file -- +-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy -- +-- of the license. -- +------------------------------------------------------------------------------ + +with Libadalang.Analysis; +with LSP.Search; + +package LSP.Ada_Handlers.Symbols is + + procedure Flat_Document_Symbols + (Self : in out Message_Handler'Class; + Unit : Libadalang.Analysis.Analysis_Unit; + Pattern : LSP.Search.Search_Pattern'Class; + Result : in out LSP.Structures.DocumentSymbol_Result); + + procedure Hierarchical_Document_Symbols + (Self : in out Message_Handler'Class; + Unit : Libadalang.Analysis.Analysis_Unit; + Pattern : LSP.Search.Search_Pattern'Class; + Result : in out LSP.Structures.DocumentSymbol_Vector); + +end LSP.Ada_Handlers.Symbols; diff --git a/source/ada/lsp-ada_handlers.adb b/source/ada/lsp-ada_handlers.adb index 4cb621037..296806237 100644 --- a/source/ada/lsp-ada_handlers.adb +++ b/source/ada/lsp-ada_handlers.adb @@ -78,6 +78,7 @@ with LSP.Ada_Handlers.Refactor.Replace_Type; with LSP.Ada_Handlers.Refactor.Sort_Dependencies; with LSP.Ada_Handlers.Refactor.Suppress_Seperate; with LSP.Ada_Handlers.Renaming; +with LSP.Ada_Handlers.Symbols; with LSP.Commands; with LSP.Constants; with LSP.Diagnostic_Sources; @@ -85,6 +86,7 @@ with LSP.Enumerations; with LSP.Errors; with LSP.Generic_Cancel_Check; with LSP.GNATCOLL_Tracers.Handle; +with LSP.Search; with LSP.Server_Notifications.DidChange; with LSP.Servers; with LSP.Structures.LSPAny_Vectors; @@ -2639,6 +2641,38 @@ package body LSP.Ada_Handlers is Self.Sender.On_DocumentHighlight_Response (Id, Response); end On_DocumentHighlight_Request; + ------------------------------- + -- On_DocumentSymbol_Request -- + ------------------------------- + + overriding procedure On_DocumentSymbol_Request + (Self : in out Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentSymbolParams) + is + Context : constant LSP.Ada_Context_Sets.Context_Access := + Self.Contexts.Get_Best_Context (Value.textDocument.uri); + + Unit : constant Libadalang.Analysis.Analysis_Unit := + Context.Get_AU (Self.To_File (Value.textDocument.uri)); + + Response : LSP.Structures.DocumentSymbol_Result; + Dummy : LSP.Search.Search_Pattern'Class := + LSP.Search.Build ("", Kind => LSP.Search.Start_Word_Text); + begin + if Self.Client.Hierarchical_Symbol then + Response := (Kind => LSP.Structures.Variant_2, Variant_2 => <>); + + LSP.Ada_Handlers.Symbols.Hierarchical_Document_Symbols + (Self, Unit, Dummy, Response.Variant_2); + else + LSP.Ada_Handlers.Symbols.Flat_Document_Symbols + (Self, Unit, Dummy, Response); + end if; + + Self.Sender.On_DocumentSymbol_Response (Id, Response); + end On_DocumentSymbol_Request; + ------------------------------- -- On_ExecuteCommand_Request -- ------------------------------- diff --git a/source/ada/lsp-ada_handlers.ads b/source/ada/lsp-ada_handlers.ads index 64d738654..59193ffb7 100644 --- a/source/ada/lsp-ada_handlers.ads +++ b/source/ada/lsp-ada_handlers.ads @@ -261,6 +261,11 @@ private Id : LSP.Structures.Integer_Or_Virtual_String; Value : LSP.Structures.DocumentHighlightParams); + overriding procedure On_DocumentSymbol_Request + (Self : in out Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentSymbolParams); + overriding procedure On_Exits_Notification (Self : in out Message_Handler); overriding procedure On_Hover_Request diff --git a/source/lsp_3.17/lsp-constants.ads b/source/lsp_3.17/lsp-constants.ads index 7f4a9765a..ebefd1aed 100644 --- a/source/lsp_3.17/lsp-constants.ads +++ b/source/lsp_3.17/lsp-constants.ads @@ -65,6 +65,13 @@ package LSP.Constants is function True return LSP.Structures.Boolean_Or_HoverOptions_Optional is (Is_Set => True, Value => True); + function True return LSP.Structures.Boolean_Or_DocumentSymbolOptions + is (Is_Boolean => True, Boolean => True); + + function True + return LSP.Structures.Boolean_Or_DocumentSymbolOptions_Optional + is (Is_Set => True, Value => True); + function True return LSP.Structures.Boolean_Or_CodeActionOptions is (Is_Boolean => True, Boolean => True); @@ -114,6 +121,8 @@ package LSP.Constants is return LSP.Structures.DocumentUri is ((VSS.Strings.Empty_Virtual_String with null record)); + function Empty return LSP.Structures.SymbolTag_Set is [others => False]; + ErrorCodes_Map : constant array (LSP.Enumerations.ErrorCodes) of Integer := [LSP.Enumerations.ParseError => -32700, LSP.Enumerations.InvalidRequest => -32600, diff --git a/source/lsp_3.17/lsp-structures-unwrap.ads b/source/lsp_3.17/lsp-structures-unwrap.ads index 8764c7765..a9afada23 100644 --- a/source/lsp_3.17/lsp-structures-unwrap.ads +++ b/source/lsp_3.17/lsp-structures-unwrap.ads @@ -75,4 +75,14 @@ package LSP.Structures.Unwrap is return CodeActionClientCapabilities_Optional is (if X.Is_Set then X.Value.codeAction else (Is_Set => False)); + function documentSymbol (X : TextDocumentClientCapabilities_Optional) + return DocumentSymbolClientCapabilities_Optional is + (if X.Is_Set then X.Value.documentSymbol else (Is_Set => False)); + + function hierarchicalDocumentSymbolSupport + (X : DocumentSymbolClientCapabilities_Optional) + return Boolean_Optional is + (if X.Is_Set then X.Value.hierarchicalDocumentSymbolSupport + else (Is_Set => False)); + end LSP.Structures.Unwrap; diff --git a/testsuite/ada_lsp/0003-get_symbols/test.yaml b/testsuite/ada_lsp/0003-get_symbols/test.yaml index ef14a8b70..585065161 100644 --- a/testsuite/ada_lsp/0003-get_symbols/test.yaml +++ b/testsuite/ada_lsp/0003-get_symbols/test.yaml @@ -1,4 +1 @@ title: '0003-get_symbols' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] From 7cbb22dc5449ae2af59e53e4f3e76c212c9eff5f Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Wed, 30 Aug 2023 14:46:39 +0300 Subject: [PATCH 072/152] Enable more tests working on LSP 3.17 Refs #1170 --- testsuite/ada_lsp/C825-005.xrefs.extending/test.yaml | 3 --- testsuite/ada_lsp/D803-003.xrefs.generics_go_to_body/test.yaml | 3 --- testsuite/ada_lsp/F222-029.xrefs.prefixed_notation/test.yaml | 3 --- .../ada_lsp/QB01-002.xrefs.non_ascii_documentation/test.yaml | 3 --- testsuite/ada_lsp/S510-020.exceptions_reporting/test.yaml | 3 --- testsuite/ada_lsp/S516-013.no_file/test.yaml | 3 --- .../SB08-025.goto.advanced_decltype/test.yaml | 3 --- testsuite/ada_lsp/completion.num_literals/test.yaml | 3 --- testsuite/ada_lsp/incorrect_fallback/test.yaml | 3 --- testsuite/ada_lsp/invalidation.file_contents/test.yaml | 3 --- testsuite/ada_lsp/non_project_files/test.yaml | 3 --- testsuite/ada_lsp/signature.aggregate2/test.yaml | 3 --- 12 files changed, 36 deletions(-) diff --git a/testsuite/ada_lsp/C825-005.xrefs.extending/test.yaml b/testsuite/ada_lsp/C825-005.xrefs.extending/test.yaml index 4599bc1a2..b22197cfb 100644 --- a/testsuite/ada_lsp/C825-005.xrefs.extending/test.yaml +++ b/testsuite/ada_lsp/C825-005.xrefs.extending/test.yaml @@ -1,4 +1 @@ title: 'C825-005.xrefs.extending' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/D803-003.xrefs.generics_go_to_body/test.yaml b/testsuite/ada_lsp/D803-003.xrefs.generics_go_to_body/test.yaml index 07a554598..423af828f 100644 --- a/testsuite/ada_lsp/D803-003.xrefs.generics_go_to_body/test.yaml +++ b/testsuite/ada_lsp/D803-003.xrefs.generics_go_to_body/test.yaml @@ -1,4 +1 @@ title: 'D803-003.xrefs.generics_go_to_body' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/F222-029.xrefs.prefixed_notation/test.yaml b/testsuite/ada_lsp/F222-029.xrefs.prefixed_notation/test.yaml index fe3f1a477..55ba61ef5 100644 --- a/testsuite/ada_lsp/F222-029.xrefs.prefixed_notation/test.yaml +++ b/testsuite/ada_lsp/F222-029.xrefs.prefixed_notation/test.yaml @@ -1,4 +1 @@ title: 'F222-029.xrefs.prefixed_notation' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/QB01-002.xrefs.non_ascii_documentation/test.yaml b/testsuite/ada_lsp/QB01-002.xrefs.non_ascii_documentation/test.yaml index dcac71881..52d5030c6 100644 --- a/testsuite/ada_lsp/QB01-002.xrefs.non_ascii_documentation/test.yaml +++ b/testsuite/ada_lsp/QB01-002.xrefs.non_ascii_documentation/test.yaml @@ -1,4 +1 @@ title: 'QB01-002.xrefs.non_ascii_documentation' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/S510-020.exceptions_reporting/test.yaml b/testsuite/ada_lsp/S510-020.exceptions_reporting/test.yaml index 0448db0dd..3c0110260 100644 --- a/testsuite/ada_lsp/S510-020.exceptions_reporting/test.yaml +++ b/testsuite/ada_lsp/S510-020.exceptions_reporting/test.yaml @@ -1,4 +1 @@ title: 'S510-020.exceptions_reporting' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/S516-013.no_file/test.yaml b/testsuite/ada_lsp/S516-013.no_file/test.yaml index a434bd3ed..d1704289e 100644 --- a/testsuite/ada_lsp/S516-013.no_file/test.yaml +++ b/testsuite/ada_lsp/S516-013.no_file/test.yaml @@ -1,4 +1 @@ title: 'S516-013.no_file' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/SB08-025.goto.advanced_decltype/SB08-025.goto.advanced_decltype/test.yaml b/testsuite/ada_lsp/SB08-025.goto.advanced_decltype/SB08-025.goto.advanced_decltype/test.yaml index effbec7fb..f389d4d3f 100644 --- a/testsuite/ada_lsp/SB08-025.goto.advanced_decltype/SB08-025.goto.advanced_decltype/test.yaml +++ b/testsuite/ada_lsp/SB08-025.goto.advanced_decltype/SB08-025.goto.advanced_decltype/test.yaml @@ -1,4 +1 @@ title: 'SB08-025.goto.advanced_decltype' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/completion.num_literals/test.yaml b/testsuite/ada_lsp/completion.num_literals/test.yaml index 292049918..e3468059c 100644 --- a/testsuite/ada_lsp/completion.num_literals/test.yaml +++ b/testsuite/ada_lsp/completion.num_literals/test.yaml @@ -1,4 +1 @@ title: 'completion.num_literals' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/incorrect_fallback/test.yaml b/testsuite/ada_lsp/incorrect_fallback/test.yaml index cf2128d75..b94bc808e 100644 --- a/testsuite/ada_lsp/incorrect_fallback/test.yaml +++ b/testsuite/ada_lsp/incorrect_fallback/test.yaml @@ -1,4 +1 @@ title: 'incorrect_fallback' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/invalidation.file_contents/test.yaml b/testsuite/ada_lsp/invalidation.file_contents/test.yaml index c38a8104f..2c0a137f6 100644 --- a/testsuite/ada_lsp/invalidation.file_contents/test.yaml +++ b/testsuite/ada_lsp/invalidation.file_contents/test.yaml @@ -1,4 +1 @@ title: 'invalidation.file_contents' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/non_project_files/test.yaml b/testsuite/ada_lsp/non_project_files/test.yaml index 2a986c8d2..c4b4adc5b 100644 --- a/testsuite/ada_lsp/non_project_files/test.yaml +++ b/testsuite/ada_lsp/non_project_files/test.yaml @@ -1,4 +1 @@ title: 'non_project_files' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/signature.aggregate2/test.yaml b/testsuite/ada_lsp/signature.aggregate2/test.yaml index fb366ea77..c42881385 100644 --- a/testsuite/ada_lsp/signature.aggregate2/test.yaml +++ b/testsuite/ada_lsp/signature.aggregate2/test.yaml @@ -1,4 +1 @@ title: 'signature.aggregate2' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] From aeb7a3b1995928704faed38a53ef60d343a86274 Mon Sep 17 00:00:00 2001 From: Vadim Godunko Date: Tue, 29 Aug 2023 14:49:32 +0400 Subject: [PATCH 073/152] Enable 'formating' tests. --- testsuite/ada_lsp/S628-009.formatting/test.yaml | 3 --- testsuite/ada_lsp/T616-016.formatting_incorrect_code/test.yaml | 3 --- testsuite/ada_lsp/T928-015.formatting.end_of_buffer/test.yaml | 3 --- 3 files changed, 9 deletions(-) diff --git a/testsuite/ada_lsp/S628-009.formatting/test.yaml b/testsuite/ada_lsp/S628-009.formatting/test.yaml index 708977865..04b82edae 100644 --- a/testsuite/ada_lsp/S628-009.formatting/test.yaml +++ b/testsuite/ada_lsp/S628-009.formatting/test.yaml @@ -1,4 +1 @@ title: 'S628-009.formatting' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/T616-016.formatting_incorrect_code/test.yaml b/testsuite/ada_lsp/T616-016.formatting_incorrect_code/test.yaml index 06991276d..cf8182bc4 100644 --- a/testsuite/ada_lsp/T616-016.formatting_incorrect_code/test.yaml +++ b/testsuite/ada_lsp/T616-016.formatting_incorrect_code/test.yaml @@ -1,4 +1 @@ title: 'T616-016.formatting_incorrect_code' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/T928-015.formatting.end_of_buffer/test.yaml b/testsuite/ada_lsp/T928-015.formatting.end_of_buffer/test.yaml index f57110592..95f343758 100644 --- a/testsuite/ada_lsp/T928-015.formatting.end_of_buffer/test.yaml +++ b/testsuite/ada_lsp/T928-015.formatting.end_of_buffer/test.yaml @@ -1,4 +1 @@ title: 'T928-015.formatting.end_of_buffer' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] From d9a423462d1d08ebcaf1ce79901e8c53f50e5ba3 Mon Sep 17 00:00:00 2001 From: Vadim Godunko Date: Tue, 29 Aug 2023 14:55:27 +0400 Subject: [PATCH 074/152] Implementation of 'formatting' request. --- source/ada/lsp-ada_client_capabilities.adb | 21 +- source/ada/lsp-ada_documents.adb | 163 +++++++++- source/ada/lsp-ada_documents.ads | 8 +- source/ada/lsp-ada_handlers-formatting.adb | 134 +++++++++ source/ada/lsp-ada_handlers-formatting.ads | 39 +++ source/ada/lsp-ada_handlers.adb | 45 +++ source/ada/lsp-ada_handlers.ads | 5 + source/ada/lsp-utils.adb | 335 ++++++++++++++++++++- source/ada/lsp-utils.ads | 21 +- source/lsp_3.17/lsp-constants.ads | 12 +- 10 files changed, 757 insertions(+), 26 deletions(-) create mode 100644 source/ada/lsp-ada_handlers-formatting.adb create mode 100644 source/ada/lsp-ada_handlers-formatting.ads diff --git a/source/ada/lsp-ada_client_capabilities.adb b/source/ada/lsp-ada_client_capabilities.adb index 479c8a8bd..56555ddeb 100644 --- a/source/ada/lsp-ada_client_capabilities.adb +++ b/source/ada/lsp-ada_client_capabilities.adb @@ -222,16 +222,17 @@ package body LSP.Ada_Client_Capabilities is (if Incremental_Text_Changes then LSP.Enumerations.Incremental else LSP.Enumerations.Full))); - Result.callHierarchyProvider := LSP.Constants.True; - Result.declarationProvider := LSP.Constants.True; - Result.definitionProvider := LSP.Constants.True; - Result.documentHighlightProvider := LSP.Constants.True; - Result.documentSymbolProvider := LSP.Constants.True; - Result.foldingRangeProvider := LSP.Constants.True; - Result.hoverProvider := LSP.Constants.True; - Result.implementationProvider := LSP.Constants.True; - Result.referencesProvider := LSP.Constants.True; - Result.typeDefinitionProvider := LSP.Constants.True; + Result.callHierarchyProvider := LSP.Constants.True; + Result.declarationProvider := LSP.Constants.True; + Result.definitionProvider := LSP.Constants.True; + Result.documentFormattingProvider := LSP.Constants.True; + Result.documentHighlightProvider := LSP.Constants.True; + Result.documentSymbolProvider := LSP.Constants.True; + Result.foldingRangeProvider := LSP.Constants.True; + Result.hoverProvider := LSP.Constants.True; + Result.implementationProvider := LSP.Constants.True; + Result.referencesProvider := LSP.Constants.True; + Result.typeDefinitionProvider := LSP.Constants.True; Result.completionProvider := (Is_Set => True, diff --git a/source/ada/lsp-ada_documents.adb b/source/ada/lsp-ada_documents.adb index 270ba18dc..bf412e4c1 100644 --- a/source/ada/lsp-ada_documents.adb +++ b/source/ada/lsp-ada_documents.adb @@ -19,7 +19,10 @@ with Ada.Characters.Wide_Wide_Latin_1; with Ada.Tags; with Ada.Unchecked_Deallocation; +with GNAT.Strings; +with GNATCOLL.Traces; with GNATCOLL.Utils; +with GNATCOLL.VFS; with Langkit_Support.Symbols; with Langkit_Support.Text; @@ -46,6 +49,7 @@ with LSP.Ada_Contexts; with LSP.Ada_Documentation; with LSP.Ada_Documents.LAL_Diagnostics; with LSP.Ada_Id_Iterators; +with LSP.Constants; with LSP.Enumerations; with LSP.Predicates; with LSP.Utils; @@ -56,10 +60,10 @@ package body LSP.Ada_Documents is package Utils renames Standard.Utils; - LSP_New_Line_Function_Set : constant VSS.Strings.Line_Terminator_Set := - (VSS.Strings.CR | VSS.Strings.CRLF | VSS.Strings.LF => True, - others => False); - -- LSP allows to use three kinds of line terminators: CR, CR+LF and LF. + Lal_PP_Output : constant GNATCOLL.Traces.Trace_Handle := + GNATCOLL.Traces.Create + ("ALS.LAL_PP_OUTPUT_ON_FORMATTING", GNATCOLL.Traces.Off); + -- Logging lalpp output if On procedure Recompute_Indexes (Self : in out Document'Class); -- Recompute the line-to-offset indexes in Self @@ -1036,14 +1040,157 @@ package body LSP.Ada_Documents is ---------------- function Formatting - (Self : Document; Context : LSP.Ada_Contexts.Context; - Span : LSP.Structures.A_Range; Cmd : Pp.Command_Lines.Cmd_Line; + (Self : Document; + Context : LSP.Ada_Contexts.Context; + Span : LSP.Structures.A_Range; + Cmd : Pp.Command_Lines.Cmd_Line; Edit : out LSP.Structures.TextEdit_Vector; Messages : out VSS.String_Vectors.Virtual_String_Vector) return Boolean is + use type Libadalang.Slocs.Source_Location_Range; + use type LSP.Structures.A_Range; + + Sloc : constant Libadalang.Slocs.Source_Location_Range := + (if Span = LSP.Constants.Empty + then Libadalang.Slocs.No_Source_Location_Range + else Libadalang.Slocs.Make_Range + (Self.Get_Source_Location (Span.start), + Self.Get_Source_Location (Span.an_end))); + + Input : Utils.Char_Vectors.Char_Vector; + Output : Utils.Char_Vectors.Char_Vector; + Out_Span : LSP.Structures.A_Range; + PP_Messages : Pp.Scanner.Source_Message_Vector; + Out_Sloc : Libadalang.Slocs.Source_Location_Range; + S : GNAT.Strings.String_Access; + begin - pragma Compile_Time_Warning (Standard.True, "Formatting unimplemented"); - return raise Program_Error with "Unimplemented function Formatting"; + if Span /= LSP.Constants.Empty then + -- Align Span to line bounds + + if Span.start.character /= 0 then + return Self.Formatting + (Context => Context, + Span => ((Span.start.line, 0), Span.an_end), + Cmd => Cmd, + Edit => Edit, + Messages => Messages); + + elsif Span.an_end.character /= 0 then + return Self.Formatting + (Context => Context, + Span => (Span.start, (Span.an_end.line + 1, 0)), + Cmd => Cmd, + Edit => Edit, + Messages => Messages); + end if; + end if; + + S := new String'(VSS.Strings.Conversions.To_UTF_8_String (Self.Text)); + Input.Append (S.all); + GNAT.Strings.Free (S); + + LSP.Utils.Format_Vector + (Cmd => Cmd, + Input => Input, + Node => Self.Unit (Context).Root, + In_Sloc => Sloc, + Output => Output, + Out_Sloc => Out_Sloc, + Messages => PP_Messages); + + -- Properly format the messages received from gnatpp, using the + -- the GNAT standard way for messages (i.e: :: ) + + if not PP_Messages.Is_Empty then + declare + File : constant GNATCOLL.VFS.Virtual_File := + Context.URI_To_File (Self.URI); + Template : constant VSS.Strings.Templates.Virtual_String_Template := + "{}:{}:{}: {}"; + + begin + for Error of PP_Messages loop + Messages.Append + (Template.Format + (VSS.Strings.Formatters.Strings.Image + (VSS.Strings.Conversions.To_Virtual_String + (File.Display_Base_Name)), + VSS.Strings.Formatters.Integers.Image (Error.Sloc.Line), + VSS.Strings.Formatters.Integers.Image (Error.Sloc.Col), + VSS.Strings.Formatters.Strings.Image + (VSS.Strings.Conversions.To_Virtual_String + (String + (Utils.Char_Vectors.Char_Vectors.To_Array + (Error.Text)))))); + end loop; + + return False; + end; + end if; + + S := new String'(Output.To_Array); + + if Lal_PP_Output.Is_Active then + Lal_PP_Output.Trace (S.all); + end if; + + if Span = LSP.Constants.Empty then + -- diff for the whole document + + Diff + (Self, + VSS.Strings.Conversions.To_Virtual_String (S.all), + Edit => Edit); + + elsif Out_Sloc = Libadalang.Slocs.No_Source_Location_Range then + -- Range formating fails. Do nothing, skip formating altogether + + null; + + else + -- diff for a part of the document + + Out_Span := Self.To_LSP_Range (Out_Sloc); + + -- Use line diff if the range is too wide + + if Span.an_end.line - Span.start.line > 5 then + Diff + (Self, + VSS.Strings.Conversions.To_Virtual_String (S.all), + Span, + Out_Span, + Edit); + + else + declare + Formatted : constant VSS.Strings.Virtual_String := + VSS.Strings.Conversions.To_Virtual_String (S.all); + Slice : VSS.Strings.Virtual_String; + + begin + LSP.Utils.Span_To_Slice (Formatted, Out_Span, Slice); + + Diff_Symbols + (Self, + Span, + Slice, + Edit); + end; + end if; + end if; + + GNAT.Strings.Free (S); + + return True; + + exception + when E : others => + Lal_PP_Output.Trace (E); + GNAT.Strings.Free (S); + + return False; end Formatting; -------------------- diff --git a/source/ada/lsp-ada_documents.ads b/source/ada/lsp-ada_documents.ads index aecdee5af..949d77c43 100644 --- a/source/ada/lsp-ada_documents.ads +++ b/source/ada/lsp-ada_documents.ads @@ -42,6 +42,11 @@ package LSP.Ada_Documents is MAX_NB_DIAGNOSTICS : constant := 2; + LSP_New_Line_Function_Set : constant VSS.Strings.Line_Terminator_Set := + (VSS.Strings.CR | VSS.Strings.CRLF | VSS.Strings.LF => True, + others => False); + -- LSP allows to use three kinds of line terminators: CR, CR+LF and LF. + type Document (Tracer : not null LSP.Tracers.Tracer_Access) is tagged limited private; -- An Ada document (file). @@ -212,8 +217,7 @@ package LSP.Ada_Documents is Span : LSP.Structures.A_Range; Cmd : Pp.Command_Lines.Cmd_Line; Edit : out LSP.Structures.TextEdit_Vector; - Messages : out VSS.String_Vectors.Virtual_String_Vector) - return Boolean; + Messages : out VSS.String_Vectors.Virtual_String_Vector) return Boolean; -- Format document or its part defined in Span function Range_Formatting diff --git a/source/ada/lsp-ada_handlers-formatting.adb b/source/ada/lsp-ada_handlers-formatting.adb new file mode 100644 index 000000000..26409a3aa --- /dev/null +++ b/source/ada/lsp-ada_handlers-formatting.adb @@ -0,0 +1,134 @@ +------------------------------------------------------------------------------ +-- Language Server Protocol -- +-- -- +-- Copyright (C) 2018-2023, AdaCore -- +-- -- +-- This is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 3, or (at your option) any later ver- -- +-- sion. This software is distributed in the hope that it will be useful, -- +-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- -- +-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -- +-- License for more details. You should have received a copy of the GNU -- +-- General Public License distributed with this software; see file -- +-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy -- +-- of the license. -- +------------------------------------------------------------------------------ + +with GNATCOLL.Traces; + +with Pp.Command_Lines; +with Utils.Command_Lines; + +with LSP.Constants; + +package body LSP.Ada_Handlers.Formatting is + + Formatting_Trace : constant GNATCOLL.Traces.Trace_Handle := + GNATCOLL.Traces.Create ("ALS.FORMATTING", GNATCOLL.Traces.On); + + procedure Update_Pp_Formatting_Options + (Pp_Options : in out Utils.Command_Lines.Command_Line; + LSP_Options : LSP.Structures.FormattingOptions); + -- Update the gnatpp formatting options using the LSP ones. + -- Options that are explicitly specified in the .gpr file take precedence + -- over LSP options. + + ------------ + -- Format -- + ------------ + + procedure Format + (Context : LSP.Ada_Contexts.Context; + Document : not null LSP.Ada_Documents.Document_Access; + Span : LSP.Structures.A_Range; + Options : LSP.Structures.FormattingOptions; + Success : out Boolean; + Response : out LSP.Structures.TextEdit_Vector; + Messages : out VSS.String_Vectors.Virtual_String_Vector; + Error : out LSP.Errors.ResponseError) + is + PP_Options : Utils.Command_Lines.Command_Line := Context.Get_PP_Options; + + begin + if Document.Has_Diagnostics (Context) then + Success := False; + Error := + (code => LSP.Constants.InternalError, + message => "Incorrect code can't be formatted"); + + return; + end if; + + -- Take into account the options set by the request only if the + -- corresponding GPR switches are not explicitly set. + + Update_Pp_Formatting_Options + (Pp_Options => PP_Options, LSP_Options => Options); + + Success := Document.Formatting + (Context => Context, + Span => Span, + Cmd => PP_Options, + Edit => Response, + Messages => Messages); + + if not Success then + Error := + (code => LSP.Constants.InternalError, + message => Messages.Join (' ')); + Messages.Clear; + end if; + end Format; + + ---------------------------------- + -- Update_Pp_Formatting_Options -- + ---------------------------------- + + procedure Update_Pp_Formatting_Options + (Pp_Options : in out Utils.Command_Lines.Command_Line; + LSP_Options : LSP.Structures.FormattingOptions) + is + Pp_Indentation : constant Natural := + Pp.Command_Lines.Pp_Nat_Switches.Arg + (Pp_Options, Pp.Command_Lines.Indentation); + Pp_No_Tab : constant Boolean := + Pp.Command_Lines.Pp_Flag_Switches.Arg + (Pp_Options, Pp.Command_Lines.No_Tab); + + begin + -- Check if intentation and 'no tab' policy options have been explictly + -- set in the project. + -- If it's not the case, use the LSP options. + + if not Pp.Command_Lines.Pp_Nat_Switches.Explicit + (Pp_Options, Pp.Command_Lines.Indentation) + then + Pp.Command_Lines.Pp_Nat_Switches.Set_Arg + (Pp_Options, + Pp.Command_Lines.Indentation, + LSP_Options.tabSize); + + elsif Pp_Indentation /= LSP_Options.tabSize then + Formatting_Trace.Trace + ("Project file defines an indentation " + & "of" & Pp_Indentation'Img & ", while LSP defines an " + & "indentation of" & LSP_Options.tabSize'Img & "."); + end if; + + if not Pp.Command_Lines.Pp_Flag_Switches.Explicit + (Pp_Options, Pp.Command_Lines.No_Tab) + then + Pp.Command_Lines.Pp_Flag_Switches.Set_Arg + (Pp_Options, + Pp.Command_Lines.No_Tab, + LSP_Options.insertSpaces); + + elsif Pp_No_Tab /= LSP_Options.insertSpaces then + Formatting_Trace.Trace + ("Project file no tab policy is set to " & Pp_No_Tab'Img + & ", while LSP is set to " & LSP_Options.insertSpaces'Img); + end if; + end Update_Pp_Formatting_Options; + +end LSP.Ada_Handlers.Formatting; diff --git a/source/ada/lsp-ada_handlers-formatting.ads b/source/ada/lsp-ada_handlers-formatting.ads new file mode 100644 index 000000000..3d4fb19dd --- /dev/null +++ b/source/ada/lsp-ada_handlers-formatting.ads @@ -0,0 +1,39 @@ +------------------------------------------------------------------------------ +-- Language Server Protocol -- +-- -- +-- Copyright (C) 2018-2023, AdaCore -- +-- -- +-- This is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 3, or (at your option) any later ver- -- +-- sion. This software is distributed in the hope that it will be useful, -- +-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- -- +-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -- +-- License for more details. You should have received a copy of the GNU -- +-- General Public License distributed with this software; see file -- +-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy -- +-- of the license. -- +------------------------------------------------------------------------------ + +-- This package provides implementation of the code formatting requests. + +with VSS.String_Vectors; + +with LSP.Ada_Contexts; +with LSP.Errors; +with LSP.Structures; + +private package LSP.Ada_Handlers.Formatting is + + procedure Format + (Context : LSP.Ada_Contexts.Context; + Document : not null LSP.Ada_Documents.Document_Access; + Span : LSP.Structures.A_Range; + Options : LSP.Structures.FormattingOptions; + Success : out Boolean; + Response : out LSP.Structures.TextEdit_Vector; + Messages : out VSS.String_Vectors.Virtual_String_Vector; + Error : out LSP.Errors.ResponseError); + -- Format the text of the given document in the given range (span). + +end LSP.Ada_Handlers.Formatting; diff --git a/source/ada/lsp-ada_handlers.adb b/source/ada/lsp-ada_handlers.adb index 296806237..2d197a3a8 100644 --- a/source/ada/lsp-ada_handlers.adb +++ b/source/ada/lsp-ada_handlers.adb @@ -26,6 +26,7 @@ with VSS.Characters.Latin; with VSS.Strings.Formatters.Integers; with VSS.Strings.Formatters.Strings; with VSS.Strings.Templates; +with VSS.String_Vectors; with VSS.JSON.Streams; with Libadalang.Analysis; @@ -59,6 +60,7 @@ with LSP.Ada_Completions; with LSP.Ada_Contexts; with LSP.Ada_Documentation; with LSP.Ada_Handlers.Call_Hierarchy; +with LSP.Ada_Handlers.Formatting; with LSP.Ada_Handlers.Invisibles; with LSP.Ada_Handlers.Locations; with LSP.Ada_Handlers.Named_Parameters_Commands; @@ -2772,6 +2774,49 @@ package body LSP.Ada_Handlers is end if; end On_FoldingRange_Request; + --------------------------- + -- On_Formatting_Request -- + --------------------------- + + overriding procedure On_Formatting_Request + (Self : in out Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentFormattingParams) + is + Context : constant LSP.Ada_Context_Sets.Context_Access := + Self.Contexts.Get_Best_Context (Value.textDocument.uri); + Document : constant LSP.Ada_Documents.Document_Access := + Self.Get_Open_Document (Value.textDocument.uri); + + Response : LSP.Structures.TextEdit_Vector_Or_Null; + Error : LSP.Errors.ResponseError; + Success : Boolean; + Messages : VSS.String_Vectors.Virtual_String_Vector; + + begin + LSP.Ada_Handlers.Formatting.Format + (Context.all, + Document, + LSP.Constants.Empty, + Value.options, + Success, + Response, + Messages, + Error); + + if Success then + Self.Sender.On_Formatting_Response (Id, Response); + + for Message of Messages loop + Self.Sender.On_ShowMessage_Notification + ((LSP.Enumerations.Info, Message)); + end loop; + + else + Self.Sender.On_Error_Response (Id, Error); + end if; + end On_Formatting_Request; + --------------------- -- On_Full_Request -- --------------------- diff --git a/source/ada/lsp-ada_handlers.ads b/source/ada/lsp-ada_handlers.ads index 59193ffb7..64f27c017 100644 --- a/source/ada/lsp-ada_handlers.ads +++ b/source/ada/lsp-ada_handlers.ads @@ -326,6 +326,11 @@ private Id : LSP.Structures.Integer_Or_Virtual_String; Value : LSP.Structures.FoldingRangeParams); + overriding procedure On_Formatting_Request + (Self : in out Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentFormattingParams); + overriding procedure On_Full_Request (Self : in out Message_Handler; Id : LSP.Structures.Integer_Or_Virtual_String; diff --git a/source/ada/lsp-utils.adb b/source/ada/lsp-utils.adb index f77a5694a..fea1fefc7 100644 --- a/source/ada/lsp-utils.adb +++ b/source/ada/lsp-utils.adb @@ -15,23 +15,37 @@ -- of the license. -- ------------------------------------------------------------------------------ --- This package provides some utility subprograms. +with Ada.Strings.Unbounded; +with System; with GNATCOLL.VFS; with Libadalang.Common; +with Libadalang.Lexer; with Libadalang.Sources; +with Langkit_Support.Diagnostics; with Langkit_Support.Symbols; +with Langkit_Support.Token_Data_Handlers; +with Pp.Actions; +with VSS.Strings.Character_Iterators; with VSS.Strings.Formatters.Generic_Modulars; with VSS.Strings.Formatters.Strings; with VSS.Strings.Templates; +with VSS.String_Vectors; +with VSS.Unicode; with Laltools.Common; +with LSP.Ada_Documents; with LSP.Constants; package body LSP.Utils is + function To_Unbounded_String + (Input : Standard.Utils.Char_Vectors.Char_Vector) + return Ada.Strings.Unbounded.Unbounded_String; + -- Convert Input to unbounded string. + ------------------ -- Canonicalize -- ------------------ @@ -54,6 +68,233 @@ package body LSP.Utils is end if; end Canonicalize; + ------------------- + -- Format_Vector -- + ------------------- + + procedure Format_Vector + (Cmd : Standard.Utils.Command_Lines.Command_Line; + Input : Standard.Utils.Char_Vectors.Char_Vector; + Node : Libadalang.Analysis.Ada_Node; + In_Sloc : Langkit_Support.Slocs.Source_Location_Range; + Output : out Standard.Utils.Char_Vectors.Char_Vector; + Out_Sloc : out Langkit_Support.Slocs.Source_Location_Range; + Messages : out Pp.Scanner.Source_Message_Vector) + is + use type Langkit_Support.Slocs.Source_Location_Range; + + procedure Tokenize_Output; + -- Split Output document into tokens and store them into TDH + + procedure Synchronize_Tokens + (In_Stop : Libadalang.Common.Token_Reference; + Out_Stop : out Langkit_Support.Token_Data_Handlers.Token_Index; + In_Start : Libadalang.Common.Token_Reference; + Out_Start : Langkit_Support.Token_Data_Handlers.Token_Index; + Ok : out Boolean); + -- Find a token in Output document that corresponds to Is_Stop token in + -- the Input document. Store token index into Out_Stop. To do this + -- start scanning both token chains starting from In_Start (for Input) + -- and Out_Start (for Output document). If no corresponding token found + -- return Ok = False. + + function Lookup_Token + (Sloc : Langkit_Support.Slocs.Source_Location) + return Libadalang.Common.Token_Reference; + -- Like Node.Unit.Lookup_Token, but skip Trivia + + TDH : Langkit_Support.Token_Data_Handlers.Token_Data_Handler; + Diags : Langkit_Support.Diagnostics.Diagnostics_Vectors.Vector; + Symbols : Langkit_Support.Symbols.Symbol_Table := + Langkit_Support.Symbols.Create_Symbol_Table; + + ------------------ + -- Lookup_Token -- + ------------------ + + function Lookup_Token + (Sloc : Langkit_Support.Slocs.Source_Location) + return Libadalang.Common.Token_Reference + is + Result : Libadalang.Common.Token_Reference := + Node.Unit.Lookup_Token (Sloc); + + begin + if Libadalang.Common.Is_Trivia (Result) then + Result := + Libadalang.Common.Previous (Result, Exclude_Trivia => True); + end if; + + return Result; + end Lookup_Token; + + ------------------------ + -- Synchronize_Tokens -- + ------------------------ + + procedure Synchronize_Tokens + (In_Stop : Libadalang.Common.Token_Reference; + Out_Stop : out Langkit_Support.Token_Data_Handlers.Token_Index; + In_Start : Libadalang.Common.Token_Reference; + Out_Start : Langkit_Support.Token_Data_Handlers.Token_Index; + Ok : out Boolean) + is + use type Libadalang.Common.Token_Reference; + + procedure Find_Next_Token + (Kind : Libadalang.Common.Token_Kind; + Index : in out Langkit_Support.Token_Data_Handlers.Token_Index; + Ok : out Boolean); + -- Find nearest token of a given Kind in the Output document starting + -- from Index. Set Ok to False in no such token found and don't + -- update Index in this case. + + --------------------- + -- Find_Next_Token -- + --------------------- + + procedure Find_Next_Token + (Kind : Libadalang.Common.Token_Kind; + Index : in out Langkit_Support.Token_Data_Handlers.Token_Index; + Ok : out Boolean) + is + use type Langkit_Support.Token_Data_Handlers.Token_Index; + use type Libadalang.Common.Token_Kind; + + Max_Look_Ahead : constant := 4; -- How far search for the token + Next_Kind : Libadalang.Common.Token_Kind; + + begin + Ok := False; + + for J in Index + 1 .. Index + Max_Look_Ahead loop + Next_Kind := Libadalang.Common.To_Token_Kind + (Langkit_Support.Token_Data_Handlers.Get_Token + (TDH, J).Kind); + + if Next_Kind = Kind then + Ok := True; + Index := J; + exit; + end if; + end loop; + end Find_Next_Token; + + Input : Libadalang.Common.Token_Reference; + + begin + Input := In_Start; + Out_Stop := Out_Start; + Ok := True; -- Now Out_Stop is synchronized with Input + + while Input /= In_Stop loop + Input := Libadalang.Common.Next (Input, Exclude_Trivia => True); + Find_Next_Token + (Libadalang.Common.Kind (Libadalang.Common.Data (Input)), + Out_Stop, + Ok); + end loop; + end Synchronize_Tokens; + + --------------------- + -- Tokenize_Output -- + --------------------- + + procedure Tokenize_Output is + Input : constant Libadalang.Lexer.Lexer_Input := + (Kind => Libadalang.Common.Bytes_Buffer, + Charset => Ada.Strings.Unbounded.To_Unbounded_String ("utf-8"), + Read_BOM => False, + Bytes => To_Unbounded_String (Output)); + + begin + Langkit_Support.Token_Data_Handlers.Initialize + (TDH, Symbols, System.Null_Address); + + Libadalang.Lexer.Extract_Tokens + (Input, + TDH => TDH, + Diagnostics => Diags, + With_Trivia => True); + end Tokenize_Output; + + use type Langkit_Support.Slocs.Line_Number; + + From : Libadalang.Common.Token_Reference; + -- Nearest to range start token (in Input document) + To : Libadalang.Common.Token_Reference; + -- Nearest to range end token (in Input document) + From_Index : Langkit_Support.Token_Data_Handlers.Token_Index; + -- Corresponding From-token in Output document + To_Index : Langkit_Support.Token_Data_Handlers.Token_Index; + -- Corresponding To-token in Output document + Ignore : Standard.Utils.Char_Vectors.Char_Subrange; + Ok : Boolean; + + begin + Pp.Actions.Format_Vector + (Cmd, Input, Node, Output, Messages); + + if In_Sloc = Langkit_Support.Slocs.No_Source_Location_Range then + -- Return full range of Output + + Out_Sloc := In_Sloc; + Langkit_Support.Symbols.Destroy (Symbols); + + return; + + elsif Node.Unit.Token_Count = 0 then -- Ignore a cornercase for now + Out_Sloc := Langkit_Support.Slocs.No_Source_Location_Range; + Langkit_Support.Symbols.Destroy (Symbols); + + return; + end if; + + Tokenize_Output; -- Fill TDH + From := Lookup_Token (Langkit_Support.Slocs.Start_Sloc (In_Sloc)); + To := Lookup_Token (Langkit_Support.Slocs.End_Sloc (In_Sloc)); + + Synchronize_Tokens + (In_Stop => From, + Out_Stop => From_Index, + In_Start => Node.Unit.First_Token, + Out_Start => Langkit_Support.Token_Data_Handlers.First_Token_Index, + Ok => Ok); + + if Ok then + Synchronize_Tokens + (In_Stop => To, + Out_Stop => To_Index, + In_Start => From, + Out_Start => From_Index, + Ok => Ok); + end if; + + if Ok then + Out_Sloc.Start_Line := + Langkit_Support.Token_Data_Handlers.Sloc_Start + (TDH, Langkit_Support.Token_Data_Handlers.Get_Token + (TDH, From_Index)).Line + + In_Sloc.Start_Line + - Libadalang.Common.Sloc_Range + (Libadalang.Common.Data (From)).Start_Line; + + Out_Sloc.End_Line := + Langkit_Support.Token_Data_Handlers.Sloc_End + (TDH, Langkit_Support.Token_Data_Handlers.Get_Token + (TDH, To_Index)).Line + + In_Sloc.End_Line + - Libadalang.Common.Sloc_Range + (Libadalang.Common.Data (To)).End_Line; + + Out_Sloc.Start_Column := 1; + Out_Sloc.End_Column := 1; + end if; + + Langkit_Support.Token_Data_Handlers.Free (TDH); + Langkit_Support.Symbols.Destroy (Symbols); + end Format_Vector; + ------------------- -- Get_Decl_Kind -- ------------------- @@ -250,6 +491,83 @@ package body LSP.Utils is Column_Number_Formatters.Image (Node.Sloc_Range.Start_Column)); end Node_Location_Image; + ------------------- + -- Span_To_Slice -- + ------------------- + + procedure Span_To_Slice + (Text : VSS.Strings.Virtual_String; + Span : LSP.Structures.A_Range; + Slice : out VSS.Strings.Virtual_String) + is + use type VSS.Unicode.UTF16_Code_Unit_Offset; + + Dummy : Boolean; + Lines : VSS.String_Vectors.Virtual_String_Vector; + Line : VSS.Strings.Virtual_String; + Num : Natural := Span.start.line + 1; + + begin + Lines := + Text.Split_Lines + (Terminators => LSP.Ada_Documents.LSP_New_Line_Function_Set, + Keep_Terminator => True); + Line := Lines.Element (Num); + + declare + J1 : VSS.Strings.Character_Iterators.Character_Iterator := + Line.At_First_Character; + U1 : constant VSS.Unicode.UTF16_Code_Unit_Offset := + J1.First_UTF16_Offset; + + begin + while VSS.Unicode.UTF16_Code_Unit_Offset (Span.start.character) + /= J1.First_UTF16_Offset - U1 + and then J1.Forward + loop + null; + end loop; + + if Span.start.line /= Span.an_end.line then + Slice.Append + (Line.Slice (J1.Marker, Line.At_Last_Character.Marker)); + end if; + + loop + Num := Num + 1; + + exit when Num > Span.start.line; + + Slice.Append (Lines.Element (Num)); + end loop; + + Line := Lines.Element (Span.an_end.line + 1); + + declare + J2 : VSS.Strings.Character_Iterators.Character_Iterator := + Line.At_First_Character; + U2 : constant VSS.Unicode.UTF16_Code_Unit_Offset := + J2.First_UTF16_Offset; + begin + while VSS.Unicode.UTF16_Code_Unit_Offset (Span.an_end.character) + /= J2.First_UTF16_Offset - U2 + and then J2.Forward + loop + null; + end loop; + + Dummy := J2.Backward; + + if Span.start.line /= Span.an_end.line then + Slice.Append (Line.Slice (Line.At_First_Character, J2)); + + else + Slice.Append (Line.Slice (J1, J2)); + end if; + end; + end; + end Span_To_Slice; + -------------- -- To_Range -- -------------- @@ -278,4 +596,19 @@ package body LSP.Utils is return Result; end To_Range; + ------------------------- + -- To_Unbounded_String -- + ------------------------- + + function To_Unbounded_String + (Input : Standard.Utils.Char_Vectors.Char_Vector) + return Ada.Strings.Unbounded.Unbounded_String is + begin + return Result : Ada.Strings.Unbounded.Unbounded_String do + for Char of Input loop + Ada.Strings.Unbounded.Append (Result, Char); + end loop; + end return; + end To_Unbounded_String; + end LSP.Utils; diff --git a/source/ada/lsp-utils.ads b/source/ada/lsp-utils.ads index 7eea9950e..740d62756 100644 --- a/source/ada/lsp-utils.ads +++ b/source/ada/lsp-utils.ads @@ -14,7 +14,7 @@ -- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy -- -- of the license. -- ------------------------------------------------------------------------------ --- + -- This package provides some utility subprograms. with Ada.Containers; @@ -24,6 +24,9 @@ with VSS.Strings.Conversions; with Libadalang.Analysis; with Langkit_Support.Slocs; +with Pp.Scanner; +with Utils.Char_Vectors; +with Utils.Command_Lines; with LSP.Enumerations; with LSP.Structures; @@ -85,4 +88,20 @@ package LSP.Utils is return LSP.Structures.DocumentUri is (VSS.Strings.Conversions.To_Virtual_String (X) with null record); + procedure Format_Vector + (Cmd : Standard.Utils.Command_Lines.Command_Line; + Input : Standard.Utils.Char_Vectors.Char_Vector; + Node : Libadalang.Analysis.Ada_Node; + In_Sloc : Langkit_Support.Slocs.Source_Location_Range; + Output : out Standard.Utils.Char_Vectors.Char_Vector; + Out_Sloc : out Langkit_Support.Slocs.Source_Location_Range; + Messages : out Pp.Scanner.Source_Message_Vector); + -- A wrapper around Pp.Actions.Format_Vector that populates Out_Range, + + procedure Span_To_Slice + (Text : VSS.Strings.Virtual_String; + Span : LSP.Structures.A_Range; + Slice : out VSS.Strings.Virtual_String); + -- Return a slice of the Text in Span range + end LSP.Utils; diff --git a/source/lsp_3.17/lsp-constants.ads b/source/lsp_3.17/lsp-constants.ads index ebefd1aed..50c09ac8f 100644 --- a/source/lsp_3.17/lsp-constants.ads +++ b/source/lsp_3.17/lsp-constants.ads @@ -108,21 +108,25 @@ package LSP.Constants is return LSP.Structures.Boolean_Or_DocumentHighlightOptions_Optional is (Is_Set => True, Value => (Is_Boolean => True, Boolean => True)); + function True + return LSP.Structures.Boolean_Or_DocumentFormattingOptions_Optional + is (Is_Set => True, Value => (Is_Boolean => True, Boolean => True)); + function Empty return LSP.Structures.Position - is (line => 0, character => 0); + is (line => 0, character => 0); function Empty return LSP.Structures.A_Range is (start => Empty, an_end => Empty); - function Error return LSP.Structures.DiagnosticSeverity_Optional - is (Is_Set => True, Value => LSP.Enumerations.Error); - function Empty return LSP.Structures.DocumentUri is ((VSS.Strings.Empty_Virtual_String with null record)); function Empty return LSP.Structures.SymbolTag_Set is [others => False]; + function Error return LSP.Structures.DiagnosticSeverity_Optional + is (Is_Set => True, Value => LSP.Enumerations.Error); + ErrorCodes_Map : constant array (LSP.Enumerations.ErrorCodes) of Integer := [LSP.Enumerations.ParseError => -32700, LSP.Enumerations.InvalidRequest => -32600, From 53d8eb60b5ffd3483c2ce136e43a5dba91a361fa Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Wed, 30 Aug 2023 18:12:14 +0300 Subject: [PATCH 075/152] Add `workspace/symbol` request Refs #1170 --- source/ada/lsp-ada_client_capabilities.adb | 1 + source/ada/lsp-ada_completions.adb | 23 +-- source/ada/lsp-ada_completions.ads | 6 - source/ada/lsp-ada_handlers-symbols.adb | 37 +++++ source/ada/lsp-ada_handlers-symbols.ads | 7 + source/ada/lsp-ada_handlers.adb | 139 +++++++++++++++++++ source/ada/lsp-ada_handlers.ads | 5 + source/ada/lsp-search.adb | 5 +- source/lsp_3.17/lsp-constants.ads | 7 + testsuite/ada_lsp/workspace_symbol/test.json | 1 + testsuite/ada_lsp/workspace_symbol/test.yaml | 3 - 11 files changed, 204 insertions(+), 30 deletions(-) diff --git a/source/ada/lsp-ada_client_capabilities.adb b/source/ada/lsp-ada_client_capabilities.adb index 56555ddeb..336bec6c0 100644 --- a/source/ada/lsp-ada_client_capabilities.adb +++ b/source/ada/lsp-ada_client_capabilities.adb @@ -233,6 +233,7 @@ package body LSP.Ada_Client_Capabilities is Result.implementationProvider := LSP.Constants.True; Result.referencesProvider := LSP.Constants.True; Result.typeDefinitionProvider := LSP.Constants.True; + Result.workspaceSymbolProvider := LSP.Constants.True; Result.completionProvider := (Is_Set => True, diff --git a/source/ada/lsp-ada_completions.adb b/source/ada/lsp-ada_completions.adb index 51154956b..89361418f 100644 --- a/source/ada/lsp-ada_completions.adb +++ b/source/ada/lsp-ada_completions.adb @@ -73,11 +73,11 @@ package body LSP.Ada_Completions is function Is_Full_Sloc_Equal (Left, Right : Libadalang.Analysis.Defining_Name) return Boolean is + use type Libadalang.Analysis.Analysis_Unit; + use type Langkit_Support.Slocs.Source_Location_Range; begin - pragma Compile_Time_Warning - (Standard.True, "Is_Full_Sloc_Equal unimplemented"); - return - raise Program_Error with "Unimplemented function Is_Full_Sloc_Equal"; + return Left.Sloc_Range = Right.Sloc_Range + and then Left.Unit = Right.Unit; end Is_Full_Sloc_Equal; ----------------------- @@ -492,19 +492,4 @@ package body LSP.Ada_Completions is end if; end Pretty_Print_Snippet; - --------------------------- - -- Generic_Write_Symbols -- - --------------------------- - - procedure Generic_Write_Symbols - (Names : Completion_Maps.Map; - Result : in out LSP.Structures.DocumentSymbol_Vector) - is - begin - pragma Assert (not Has_Been_Canceled); - pragma Compile_Time_Warning - (Standard.True, "Generic_Write_Symbols unimplemented"); - raise Program_Error with "Unimplemented procedure Generic_Write_Symbols"; - end Generic_Write_Symbols; - end LSP.Ada_Completions; diff --git a/source/ada/lsp-ada_completions.ads b/source/ada/lsp-ada_completions.ads index 50d9c1c07..7e87b2a5d 100644 --- a/source/ada/lsp-ada_completions.ads +++ b/source/ada/lsp-ada_completions.ads @@ -124,12 +124,6 @@ package LSP.Ada_Completions is -- If Result is a snippet then generate a textEdit over span using GNATpp. -- Rule must match the content of "Prefix & Result.insertText.Value" - generic - with function Has_Been_Canceled return Boolean; - procedure Generic_Write_Symbols - (Names : Completion_Maps.Map; - Result : in out LSP.Structures.DocumentSymbol_Vector); - type Completion_Provider_Access is access all LSP.Ada_Completions.Completion_Provider'Class; diff --git a/source/ada/lsp-ada_handlers-symbols.adb b/source/ada/lsp-ada_handlers-symbols.adb index 2951e5e63..26b127ece 100644 --- a/source/ada/lsp-ada_handlers-symbols.adb +++ b/source/ada/lsp-ada_handlers-symbols.adb @@ -391,4 +391,41 @@ package body LSP.Ada_Handlers.Symbols is Walk (Root, 0, Result); end Hierarchical_Document_Symbols; + ------------------- + -- Write_Symbols -- + ------------------- + + procedure Write_Symbols + (Self : in out Message_Handler'Class; + Names : LSP.Ada_Completions.Completion_Maps.Map; + Result : in out LSP.Structures.SymbolInformation_Vector) is + begin + for Cursor in Names.Iterate loop + declare + Name : constant Libadalang.Analysis.Defining_Name := + LSP.Ada_Completions.Completion_Maps.Key (Cursor); + Node : Libadalang.Analysis.Ada_Node := Name.As_Ada_Node; + begin + while not Node.Is_Null and then + Node.Kind not in Libadalang.Common.Ada_Basic_Decl + loop + Node := Node.Parent; + end loop; + + if not Node.Is_Null then + Result.Append + (LSP.Structures.SymbolInformation' + (name => VSS.Strings.To_Virtual_String (Name.Text), + kind => LSP.Utils.Get_Decl_Kind + (Node.As_Basic_Decl), + location => Locations.To_LSP_Location + (Self, Name), + tags => LSP.Constants.Empty, + deprecated => (Is_Set => False), + containerName => <>)); + end if; + end; + end loop; + end Write_Symbols; + end LSP.Ada_Handlers.Symbols; diff --git a/source/ada/lsp-ada_handlers-symbols.ads b/source/ada/lsp-ada_handlers-symbols.ads index 42a46fd30..7c744dff4 100644 --- a/source/ada/lsp-ada_handlers-symbols.ads +++ b/source/ada/lsp-ada_handlers-symbols.ads @@ -16,6 +16,8 @@ ------------------------------------------------------------------------------ with Libadalang.Analysis; + +with LSP.Ada_Completions; with LSP.Search; package LSP.Ada_Handlers.Symbols is @@ -32,4 +34,9 @@ package LSP.Ada_Handlers.Symbols is Pattern : LSP.Search.Search_Pattern'Class; Result : in out LSP.Structures.DocumentSymbol_Vector); + procedure Write_Symbols + (Self : in out Message_Handler'Class; + Names : LSP.Ada_Completions.Completion_Maps.Map; + Result : in out LSP.Structures.SymbolInformation_Vector); + end LSP.Ada_Handlers.Symbols; diff --git a/source/ada/lsp-ada_handlers.adb b/source/ada/lsp-ada_handlers.adb index 2d197a3a8..9cbc5ef12 100644 --- a/source/ada/lsp-ada_handlers.adb +++ b/source/ada/lsp-ada_handlers.adb @@ -3829,6 +3829,145 @@ package body LSP.Ada_Handlers is Self.Sender.On_SignatureHelp_Response (Id, Response); end On_SignatureHelp_Request; + ----------------------- + -- On_Symbol_Request -- + ----------------------- + + overriding procedure On_Symbol_Request + (Self : in out Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceSymbolParams) + is + use type Ada.Containers.Count_Type; + use type LSP.Search.Search_Kind; + use type VSS.Strings.Character_Count; + + procedure Send_Partial_Response; + + procedure On_Inaccessible_Name + (File : GNATCOLL.VFS.Virtual_File; + Name : Libadalang.Analysis.Defining_Name; + Stop : in out Boolean); + + Names : LSP.Ada_Completions.Completion_Maps.Map; + + -------------------------- + -- On_Inaccessible_Name -- + -------------------------- + + procedure On_Inaccessible_Name + (File : GNATCOLL.VFS.Virtual_File; + Name : Libadalang.Analysis.Defining_Name; + Stop : in out Boolean) is + begin + -- Skip all names in open documents, because they could have + -- stale references. Then skip already provided results. + if not Self.Open_Documents.Contains (File) + and then not Names.Contains (Name) + then + Names.Insert + (Name, + (Is_Dot_Call => False, + Is_Visible => False, + Use_Snippets => False, + Pos => <>, + Weight => <>)); + end if; + + Stop := Self.Is_Canceled.all; + end On_Inaccessible_Name; + + Partial_Response_Sended : Boolean := False; + + --------------------------- + -- Send_Partial_Response -- + --------------------------- + + procedure Send_Partial_Response is + P : LSP.Structures.Symbol_Progress_Report (LSP.Structures.Variant_1); + V : LSP.Structures.SymbolInformation_Vector renames + P.Variant_1; + begin + if Self.Is_Canceled.all then + return; + end if; + + LSP.Ada_Handlers.Symbols.Write_Symbols (Self, Names, V); + Names.Clear; + + Self.Sender.On_Symbol_Partial_Result + (Token => Value.partialResultToken.Value, + Value => P); + + Partial_Response_Sended := True; + end Send_Partial_Response; + + Response : LSP.Structures.Symbol_Result (LSP.Structures.Variant_1); + + Pattern : constant LSP.Search.Search_Pattern'Class := LSP.Search.Build + (Pattern => Value.query, + Kind => LSP.Search.Start_Word_Text); + + begin + if Pattern.Get_Kind /= LSP.Search.Start_Word_Text + and then Pattern.Get_Canonical_Pattern.Character_Length < 2 + then + -- Do not process too small pattern because + -- this produces a huge response that is useless + -- and costs a while. + + Self.Sender.On_Symbol_Response (Id, Response); + return; + end if; + + for Context of Self.Contexts.Each_Context loop + Context.Get_Any_Symbol + (Pattern => Pattern, + Only_Public => False, + Callback => On_Inaccessible_Name'Access); + + exit when Self.Is_Canceled.all; + + if Value.partialResultToken.Is_Set + and then Names.Length > 100 + then + Send_Partial_Response; + end if; + end loop; + + for Doc of Self.Open_Documents loop + declare + Context : constant LSP.Ada_Context_Sets.Context_Access := + Self.Contexts.Get_Best_Context (Doc.URI); + begin + Doc.Get_Any_Symbol + (Context.all, + Pattern, + Ada.Containers.Count_Type'Last, + False, + Self.Is_Canceled, + Names); + end; + + exit when Self.Is_Canceled.all; + + if Value.partialResultToken.Is_Set + and then Names.Length > 100 + then + Send_Partial_Response; + end if; + end loop; + + if Partial_Response_Sended then + Send_Partial_Response; + else + LSP.Ada_Handlers.Symbols.Write_Symbols + (Self, Names, Response.Variant_1); + end if; + + Self.Sender.On_Symbol_Response (Id, Response); + end On_Symbol_Request; + ----------------------------- -- On_Tokens_Range_Request -- ----------------------------- diff --git a/source/ada/lsp-ada_handlers.ads b/source/ada/lsp-ada_handlers.ads index 64f27c017..0406ae232 100644 --- a/source/ada/lsp-ada_handlers.ads +++ b/source/ada/lsp-ada_handlers.ads @@ -403,6 +403,11 @@ private Id : LSP.Structures.Integer_Or_Virtual_String; Value : LSP.Structures.CompletionItem); + overriding procedure On_Symbol_Request + (Self : in out Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceSymbolParams); + procedure Publish_Diagnostics (Self : in out Message_Handler'Class; Document : not null LSP.Ada_Documents.Document_Access; diff --git a/source/ada/lsp-search.adb b/source/ada/lsp-search.adb index 11ccb921a..bd8e3de76 100644 --- a/source/ada/lsp-search.adb +++ b/source/ada/lsp-search.adb @@ -16,6 +16,7 @@ ------------------------------------------------------------------------------ with LSP.Search.Start_Word; +with LSP.Utils; package body LSP.Search is @@ -66,9 +67,9 @@ package body LSP.Search is (Self : Search_Pattern) return VSS.Strings.Virtual_String is begin if Self.Case_Sensitive then - raise Program_Error with "Unimplemented"; -- FIXME - else return Self.Text; + else + return LSP.Utils.Canonicalize (Self.Text); end if; end Get_Canonical_Pattern; diff --git a/source/lsp_3.17/lsp-constants.ads b/source/lsp_3.17/lsp-constants.ads index 50c09ac8f..2ec4e7aa6 100644 --- a/source/lsp_3.17/lsp-constants.ads +++ b/source/lsp_3.17/lsp-constants.ads @@ -86,6 +86,13 @@ package LSP.Constants is return LSP.Structures.typeDefinitionProvider_OfServerCapabilities_Optional is (Is_Set => True, Value => True); + function True return LSP.Structures.Boolean_Or_WorkspaceSymbolOptions + is (Is_Boolean => True, Boolean => True); + + function True + return LSP.Structures.Boolean_Or_WorkspaceSymbolOptions_Optional + is (Is_Set => True, Value => True); + function True return LSP.Structures.Boolean_Or_Something is (Is_Boolean => True, Boolean => True); diff --git a/testsuite/ada_lsp/workspace_symbol/test.json b/testsuite/ada_lsp/workspace_symbol/test.json index 086312ca0..307cbc8c9 100644 --- a/testsuite/ada_lsp/workspace_symbol/test.json +++ b/testsuite/ada_lsp/workspace_symbol/test.json @@ -78,6 +78,7 @@ "wait":[{ "id": "wsSymbol", "result": [ + "", { "name": "Test1", "kind": 12, diff --git a/testsuite/ada_lsp/workspace_symbol/test.yaml b/testsuite/ada_lsp/workspace_symbol/test.yaml index 2600bcf46..bb6898958 100644 --- a/testsuite/ada_lsp/workspace_symbol/test.yaml +++ b/testsuite/ada_lsp/workspace_symbol/test.yaml @@ -1,4 +1 @@ title: 'workspace_symbol' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] From 71560198334274b04f981da1478086204143873b Mon Sep 17 00:00:00 2001 From: Andry Ogorodnik Date: Wed, 30 Aug 2023 17:00:41 +0000 Subject: [PATCH 076/152] Enable tests --- .../test.json | 10 +- .../test.yaml | 3 - .../test.json | 63 +--- .../test.yaml | 3 - .../test.json | 37 +-- .../test.yaml | 3 - .../completion.aggregates.simple/test.json | 37 +-- .../completion.aggregates.simple/test.yaml | 3 - .../test.json | 39 +-- .../test.yaml | 3 - .../ada_lsp/completion.aspects/test.json | 2 +- .../completion.complex_renames/test.json | 25 +- .../completion.complex_renames/test.yaml | 3 - .../completion.defining_names/test.json | 22 -- .../completion.defining_names/test.yaml | 3 - .../ada_lsp/completion.end_labels/test.json | 32 +- .../ada_lsp/completion.end_labels/test.yaml | 3 - .../ada_lsp/completion.end_labels2/test.json | 284 ++++++------------ .../ada_lsp/completion.end_labels2/test.yaml | 3 - .../ada_lsp/completion.invisible/test.json | 8 +- .../ada_lsp/completion.invisible/test.yaml | 3 - .../ada_lsp/completion.invisible3/test.json | 9 +- .../ada_lsp/completion.invisible3/test.yaml | 3 - .../ada_lsp/completion.invisible4/test.json | 7 +- .../ada_lsp/completion.invisible4/test.yaml | 3 - .../ada_lsp/completion.invisible5/test.json | 3 +- .../ada_lsp/completion.invisible5/test.yaml | 3 - .../test.json | 18 +- .../test.yaml | 3 - .../test.json | 30 +- .../test.yaml | 3 - .../completion.snippet.formatting3/test.json | 14 +- .../test.json | 49 +-- .../test.yaml | 3 - .../ada_lsp/completion.use_clauses/test.json | 2 +- 35 files changed, 157 insertions(+), 582 deletions(-) diff --git a/testsuite/ada_lsp/completion.aggregates.derived_private/test.json b/testsuite/ada_lsp/completion.aggregates.derived_private/test.json index fab0d17a9..f61dc2b99 100644 --- a/testsuite/ada_lsp/completion.aggregates.derived_private/test.json +++ b/testsuite/ada_lsp/completion.aggregates.derived_private/test.json @@ -174,7 +174,6 @@ "sortText": "+0", "insertText": "Base_Rec with Disc => ${1:Integer}, D => ${2:Integer}, X => ${3:Float})$0", "insertTextFormat": 2, - "additionalTextEdits": [], "documentation": "at main.adb (23:4)" }, { @@ -182,24 +181,21 @@ "kind": 5, "sortText": "+1", "insertText": "Disc => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "D", "kind": 5, "sortText": "+2", "insertText": "D => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "X", "kind": 5, "sortText": "+3", "insertText": "X => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 } ] } diff --git a/testsuite/ada_lsp/completion.aggregates.derived_private/test.yaml b/testsuite/ada_lsp/completion.aggregates.derived_private/test.yaml index f1d3ecf81..d880c5b4b 100644 --- a/testsuite/ada_lsp/completion.aggregates.derived_private/test.yaml +++ b/testsuite/ada_lsp/completion.aggregates.derived_private/test.yaml @@ -1,4 +1 @@ title: 'completion.aggregates.derived_private' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/completion.aggregates.derived_types/test.json b/testsuite/ada_lsp/completion.aggregates.derived_types/test.json index 3819e1ec7..e3a723aa0 100644 --- a/testsuite/ada_lsp/completion.aggregates.derived_types/test.json +++ b/testsuite/ada_lsp/completion.aggregates.derived_types/test.json @@ -81,29 +81,7 @@ "(" ], "resolveProvider": true - }, - "hoverProvider": true, - "declarationProvider": true, - "definitionProvider": true, - "typeDefinitionProvider": true, - "implementationProvider": true, - "referencesProvider": true, - "codeActionProvider": { - }, - "renameProvider": { - }, - "foldingRangeProvider": true, - "executeCommandProvider": {}, - "alsReferenceKinds": [ - "reference", - "access", - "write", - "call", - "dispatching call", - "parent", - "child", - "overriding" - ] + } } } } @@ -224,7 +202,6 @@ "label": "Aggregate when Disc => 1", "documentation": "at main.adb (14:4)", "sortText": "+00", - "additionalTextEdits": [], "insertTextFormat": 2 }, { @@ -232,27 +209,21 @@ "kind": 5, "sortText": "+01", "insertText": "Disc => 1", - "insertTextFormat": 1, - "additionalTextEdits": [ - ] + "insertTextFormat": 1 }, { "label": "A", "kind": 5, "sortText": "+02", "insertText": "A => ", - "insertTextFormat": 1, - "additionalTextEdits": [ - ] + "insertTextFormat": 1 }, { "label": "D", "kind": 5, "sortText": "+03", "insertText": "D => ", - "insertTextFormat": 1, - "additionalTextEdits": [ - ] + "insertTextFormat": 1 }, { "insertText": "Disc => 2, Z => ${2:Integer}, D => ${3:Integer})$0", @@ -261,7 +232,6 @@ "label": "Aggregate when Disc => 2", "documentation": "at main.adb (14:4)", "sortText": "+04", - "additionalTextEdits": [], "insertTextFormat": 2 }, { @@ -269,27 +239,21 @@ "kind": 5, "sortText": "+05", "insertText": "Disc => 2", - "insertTextFormat": 1, - "additionalTextEdits": [ - ] + "insertTextFormat": 1 }, { "label": "Z", "kind": 5, "sortText": "+06", "insertText": "Z => ", - "insertTextFormat": 1, - "additionalTextEdits": [ - ] + "insertTextFormat": 1 }, { "label": "D", "kind": 5, "sortText": "+07", "insertText": "D => ", - "insertTextFormat": 1, - "additionalTextEdits": [ - ] + "insertTextFormat": 1 }, { "insertText": "Disc => ${1:others}, B => ${2:Integer}, D => ${3:Integer})$0", @@ -298,7 +262,6 @@ "label": "Aggregate when Disc => others", "documentation": "at main.adb (14:4)", "sortText": "+08", - "additionalTextEdits": [], "insertTextFormat": 2 }, { @@ -306,27 +269,21 @@ "kind": 5, "sortText": "+09", "insertText": "Disc => ", - "insertTextFormat": 1, - "additionalTextEdits": [ - ] + "insertTextFormat": 1 }, { "label": "B", "kind": 5, "sortText": "+10", "insertText": "B => ", - "insertTextFormat": 1, - "additionalTextEdits": [ - ] + "insertTextFormat": 1 }, { "label": "D", "kind": 5, "sortText": "+11", "insertText": "D => ", - "insertTextFormat": 1, - "additionalTextEdits": [ - ] + "insertTextFormat": 1 } ] } diff --git a/testsuite/ada_lsp/completion.aggregates.derived_types/test.yaml b/testsuite/ada_lsp/completion.aggregates.derived_types/test.yaml index f7da393fc..1e59062c4 100644 --- a/testsuite/ada_lsp/completion.aggregates.derived_types/test.yaml +++ b/testsuite/ada_lsp/completion.aggregates.derived_types/test.yaml @@ -1,4 +1 @@ title: 'completion.aggregates.derived_types' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/completion.aggregates.incomplete_type/test.json b/testsuite/ada_lsp/completion.aggregates.incomplete_type/test.json index ded624e0d..e381e55b7 100644 --- a/testsuite/ada_lsp/completion.aggregates.incomplete_type/test.json +++ b/testsuite/ada_lsp/completion.aggregates.incomplete_type/test.json @@ -81,29 +81,7 @@ "(" ], "resolveProvider": true - }, - "hoverProvider": true, - "declarationProvider": true, - "definitionProvider": true, - "typeDefinitionProvider": true, - "implementationProvider": true, - "referencesProvider": true, - "codeActionProvider": { - }, - "renameProvider": { - }, - "foldingRangeProvider": true, - "executeCommandProvider": {}, - "alsReferenceKinds": [ - "reference", - "access", - "write", - "call", - "dispatching call", - "parent", - "child", - "overriding" - ] + } } } } @@ -201,7 +179,6 @@ "kind": 15, "detail": "type Cell is\nrecord\n Value : Integer;\n Succ : Link;\n Pred : Link;\nend record;", "label": "Aggregate for Cell", - "additionalTextEdits": [], "insertTextFormat": 2, "documentation": "at main.adb (6:4)", "sortText": "+0" @@ -211,27 +188,21 @@ "kind": 5, "sortText": "+1", "insertText": "Value => ", - "insertTextFormat": 1, - "additionalTextEdits": [ - ] + "insertTextFormat": 1 }, { "label": "Succ", "kind": 5, "sortText": "+2", "insertText": "Succ => ", - "insertTextFormat": 1, - "additionalTextEdits": [ - ] + "insertTextFormat": 1 }, { "label": "Pred", "kind": 5, "sortText": "+3", "insertText": "Pred => ", - "insertTextFormat": 1, - "additionalTextEdits": [ - ] + "insertTextFormat": 1 } ] } diff --git a/testsuite/ada_lsp/completion.aggregates.incomplete_type/test.yaml b/testsuite/ada_lsp/completion.aggregates.incomplete_type/test.yaml index fbffefa9c..dfa04d1cd 100644 --- a/testsuite/ada_lsp/completion.aggregates.incomplete_type/test.yaml +++ b/testsuite/ada_lsp/completion.aggregates.incomplete_type/test.yaml @@ -1,4 +1 @@ title: 'completion.aggregates.incomplete_type' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/completion.aggregates.simple/test.json b/testsuite/ada_lsp/completion.aggregates.simple/test.json index f07904bf0..b563095cb 100644 --- a/testsuite/ada_lsp/completion.aggregates.simple/test.json +++ b/testsuite/ada_lsp/completion.aggregates.simple/test.json @@ -81,29 +81,7 @@ "(" ], "resolveProvider": true - }, - "hoverProvider": true, - "declarationProvider": true, - "definitionProvider": true, - "typeDefinitionProvider": true, - "implementationProvider": true, - "referencesProvider": true, - "codeActionProvider": { - }, - "renameProvider": { - }, - "foldingRangeProvider": true, - "executeCommandProvider": {}, - "alsReferenceKinds": [ - "reference", - "access", - "write", - "call", - "dispatching call", - "parent", - "child", - "overriding" - ] + } } } } @@ -203,7 +181,6 @@ "label": "Aggregate for Aggr_Type_1", "documentation": "at main.adb (2:4)", "sortText": "+0", - "additionalTextEdits": [], "insertTextFormat": 2 }, { @@ -211,27 +188,21 @@ "kind": 5, "sortText": "+1", "insertText": "A => ", - "insertTextFormat": 1, - "additionalTextEdits": [ - ] + "insertTextFormat": 1 }, { "label": "B", "kind": 5, "sortText": "+2", "insertText": "B => ", - "insertTextFormat": 1, - "additionalTextEdits": [ - ] + "insertTextFormat": 1 }, { "label": "C", "kind": 5, "sortText": "+3", "insertText": "C => ", - "insertTextFormat": 1, - "additionalTextEdits": [ - ] + "insertTextFormat": 1 } ] } diff --git a/testsuite/ada_lsp/completion.aggregates.simple/test.yaml b/testsuite/ada_lsp/completion.aggregates.simple/test.yaml index bf645495a..e0231e160 100644 --- a/testsuite/ada_lsp/completion.aggregates.simple/test.yaml +++ b/testsuite/ada_lsp/completion.aggregates.simple/test.yaml @@ -1,4 +1 @@ title: 'completion.aggregates.simple' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/completion.aggregates.snippet_indexes/test.json b/testsuite/ada_lsp/completion.aggregates.snippet_indexes/test.json index cfcddac76..dcfdcb7cb 100644 --- a/testsuite/ada_lsp/completion.aggregates.snippet_indexes/test.json +++ b/testsuite/ada_lsp/completion.aggregates.snippet_indexes/test.json @@ -81,29 +81,7 @@ "(" ], "resolveProvider": true - }, - "hoverProvider": true, - "declarationProvider": true, - "definitionProvider": true, - "typeDefinitionProvider": true, - "implementationProvider": true, - "referencesProvider": true, - "codeActionProvider": { - }, - "renameProvider": { - }, - "foldingRangeProvider": true, - "executeCommandProvider": {}, - "alsReferenceKinds": [ - "reference", - "access", - "write", - "call", - "dispatching call", - "parent", - "child", - "overriding" - ] + } } } } @@ -219,35 +197,28 @@ "sortText": "+0", "detail": "type Aggr_Type_1 is record\n A, B, C : Integer;\nend record;", "insertText": "A => ${1:Integer}, B => ${2:Integer}, C => ${3:Integer})$0", - "insertTextFormat": 2, - "additionalTextEdits": [] + "insertTextFormat": 2 }, { "label": "A", "kind": 5, "sortText": "+1", "insertText": "A => ", - "insertTextFormat": 1, - "additionalTextEdits": [ - ] + "insertTextFormat": 1 }, { "label": "B", "kind": 5, "sortText": "+2", "insertText": "B => ", - "insertTextFormat": 1, - "additionalTextEdits": [ - ] + "insertTextFormat": 1 }, { "label": "C", "kind": 5, "sortText": "+3", "insertText": "C => ", - "insertTextFormat": 1, - "additionalTextEdits": [ - ] + "insertTextFormat": 1 } ] } diff --git a/testsuite/ada_lsp/completion.aggregates.snippet_indexes/test.yaml b/testsuite/ada_lsp/completion.aggregates.snippet_indexes/test.yaml index dec5cb88d..1c0ae5fe1 100644 --- a/testsuite/ada_lsp/completion.aggregates.snippet_indexes/test.yaml +++ b/testsuite/ada_lsp/completion.aggregates.snippet_indexes/test.yaml @@ -1,4 +1 @@ title: 'completion.aggregates.snippet_indexes' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/completion.aspects/test.json b/testsuite/ada_lsp/completion.aspects/test.json index ba7ee99dc..ee793a56a 100644 --- a/testsuite/ada_lsp/completion.aspects/test.json +++ b/testsuite/ada_lsp/completion.aspects/test.json @@ -276,4 +276,4 @@ "exit_code": 0 } } -] \ No newline at end of file +] diff --git a/testsuite/ada_lsp/completion.complex_renames/test.json b/testsuite/ada_lsp/completion.complex_renames/test.json index 22c5466dd..1c3f56488 100644 --- a/testsuite/ada_lsp/completion.complex_renames/test.json +++ b/testsuite/ada_lsp/completion.complex_renames/test.json @@ -80,29 +80,7 @@ "'", "(" ] - }, - "hoverProvider": true, - "declarationProvider": true, - "definitionProvider": true, - "typeDefinitionProvider": true, - "implementationProvider": true, - "referencesProvider": true, - "codeActionProvider": { - }, - "renameProvider": { - }, - "foldingRangeProvider": true, - "executeCommandProvider": {}, - "alsReferenceKinds": [ - "reference", - "access", - "write", - "call", - "dispatching call", - "parent", - "child", - "overriding" - ] + } } } } @@ -196,7 +174,6 @@ "isIncomplete": false, "items": [ { - "additionalTextEdits": [], "kind": 3, "documentation": "at parent-children.ads (7:4)", "detail": "procedure Do_Someting (D : Children.Child)", diff --git a/testsuite/ada_lsp/completion.complex_renames/test.yaml b/testsuite/ada_lsp/completion.complex_renames/test.yaml index 37ecadba2..f9a746df0 100644 --- a/testsuite/ada_lsp/completion.complex_renames/test.yaml +++ b/testsuite/ada_lsp/completion.complex_renames/test.yaml @@ -1,4 +1 @@ title: 'completion.complex_renames' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/completion.defining_names/test.json b/testsuite/ada_lsp/completion.defining_names/test.json index 30711da17..ae7d39362 100644 --- a/testsuite/ada_lsp/completion.defining_names/test.json +++ b/testsuite/ada_lsp/completion.defining_names/test.json @@ -72,28 +72,6 @@ "id": 1, "result": { "capabilities": { - "alsReferenceKinds": [ - "reference", - "access", - "write", - "call", - "dispatching call", - "parent", - "child", - "overriding" - ], - "implementationProvider": true, - "foldingRangeProvider": true, - "typeDefinitionProvider": true, - "alsShowDepsProvider": true, - "hoverProvider": true, - "definitionProvider": true, - "renameProvider": {}, - "referencesProvider": true, - "codeActionProvider": {}, - "textDocumentSync": 2, - "documentFormattingProvider": true, - "declarationProvider": true, "completionProvider": { "triggerCharacters": [ ".", diff --git a/testsuite/ada_lsp/completion.defining_names/test.yaml b/testsuite/ada_lsp/completion.defining_names/test.yaml index 28e82d8b6..af9515f9e 100644 --- a/testsuite/ada_lsp/completion.defining_names/test.yaml +++ b/testsuite/ada_lsp/completion.defining_names/test.yaml @@ -1,4 +1 @@ title: 'completion.defining_names' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/completion.end_labels/test.json b/testsuite/ada_lsp/completion.end_labels/test.json index 82d742a64..d53b1e259 100644 --- a/testsuite/ada_lsp/completion.end_labels/test.json +++ b/testsuite/ada_lsp/completion.end_labels/test.json @@ -81,29 +81,7 @@ "(" ], "resolveProvider": true - }, - "hoverProvider": true, - "declarationProvider": true, - "definitionProvider": true, - "typeDefinitionProvider": true, - "implementationProvider": true, - "referencesProvider": true, - "codeActionProvider": { - }, - "renameProvider": { - }, - "foldingRangeProvider": true, - "executeCommandProvider": {}, - "alsReferenceKinds": [ - "reference", - "access", - "write", - "call", - "dispatching call", - "parent", - "child", - "overriding" - ] + } } } } @@ -201,9 +179,7 @@ "kind": 14, "preselect": true, "sortText": "Add;", - "insertText": "Add;", - "additionalTextEdits": [ - ] + "insertText": "Add;" } ] } @@ -259,9 +235,7 @@ "kind": 14, "preselect": true, "sortText": "Add;", - "insertText": "Add;", - "additionalTextEdits": [ - ] + "insertText": "Add;" } ] } diff --git a/testsuite/ada_lsp/completion.end_labels/test.yaml b/testsuite/ada_lsp/completion.end_labels/test.yaml index 6b5ff43d7..1b1f9366e 100644 --- a/testsuite/ada_lsp/completion.end_labels/test.yaml +++ b/testsuite/ada_lsp/completion.end_labels/test.yaml @@ -1,4 +1 @@ title: 'completion.end_labels' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/completion.end_labels2/test.json b/testsuite/ada_lsp/completion.end_labels2/test.json index bb4d21bcc..8a8fbb6c9 100644 --- a/testsuite/ada_lsp/completion.end_labels2/test.json +++ b/testsuite/ada_lsp/completion.end_labels2/test.json @@ -221,8 +221,7 @@ "kind": 14, "preselect": true, "sortText": "T;", - "insertText": "T;", - "additionalTextEdits": [] + "insertText": "T;" } ] } @@ -255,8 +254,7 @@ "preselect": true, "sortText": "T;", "insertText": "T;", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 } } ] @@ -292,8 +290,7 @@ "kind": 14, "preselect": true, "sortText": "T;", - "insertText": "T;", - "additionalTextEdits": [] + "insertText": "T;" } ] } @@ -326,8 +323,7 @@ "preselect": true, "sortText": "T;", "insertText": "T;", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 } } ] @@ -363,8 +359,7 @@ "kind": 14, "preselect": true, "sortText": "Start;", - "insertText": "Start;", - "additionalTextEdits": [] + "insertText": "Start;" } ] } @@ -397,8 +392,7 @@ "preselect": true, "sortText": "Start;", "insertText": "Start;", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 } } ] @@ -434,8 +428,7 @@ "kind": 14, "preselect": true, "sortText": "Start;", - "insertText": "Start;", - "additionalTextEdits": [] + "insertText": "Start;" } ] } @@ -468,8 +461,7 @@ "preselect": true, "sortText": "Start;", "insertText": "Start;", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 } } ] @@ -505,8 +497,7 @@ "kind": 14, "preselect": true, "sortText": "select;", - "insertText": "select;", - "additionalTextEdits": [] + "insertText": "select;" } ] } @@ -539,8 +530,7 @@ "preselect": true, "sortText": "select;", "insertText": "select;", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 } } ] @@ -576,8 +566,7 @@ "kind": 14, "preselect": true, "sortText": "select;", - "insertText": "select;", - "additionalTextEdits": [] + "insertText": "select;" } ] } @@ -610,8 +599,7 @@ "preselect": true, "sortText": "select;", "insertText": "select;", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 } } ] @@ -647,8 +635,7 @@ "kind": 14, "preselect": true, "sortText": "T;", - "insertText": "T;", - "additionalTextEdits": [] + "insertText": "T;" } ] } @@ -681,8 +668,7 @@ "preselect": true, "sortText": "T;", "insertText": "T;", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 } } ] @@ -718,8 +704,7 @@ "kind": 14, "preselect": true, "sortText": "T;", - "insertText": "T;", - "additionalTextEdits": [] + "insertText": "T;" } ] } @@ -752,8 +737,7 @@ "preselect": true, "sortText": "T;", "insertText": "T;", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 } } ] @@ -789,8 +773,7 @@ "kind": 14, "preselect": true, "sortText": "return;", - "insertText": "return;", - "additionalTextEdits": [] + "insertText": "return;" } ] } @@ -823,8 +806,7 @@ "preselect": true, "sortText": "return;", "insertText": "return;", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 } } ] @@ -860,8 +842,7 @@ "kind": 14, "preselect": true, "sortText": "return;", - "insertText": "return;", - "additionalTextEdits": [] + "insertText": "return;" } ] } @@ -894,8 +875,7 @@ "preselect": true, "sortText": "return;", "insertText": "return;", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 } } ] @@ -931,8 +911,7 @@ "kind": 14, "preselect": true, "sortText": "\"+\";", - "insertText": "\"+\";", - "additionalTextEdits": [] + "insertText": "\"+\";" } ] } @@ -965,8 +944,7 @@ "preselect": true, "sortText": "\"+\";", "insertText": "\"+\";", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 } } ] @@ -1002,8 +980,7 @@ "kind": 14, "preselect": true, "sortText": "\"+\";", - "insertText": "\"+\";", - "additionalTextEdits": [] + "insertText": "\"+\";" } ] } @@ -1036,8 +1013,7 @@ "preselect": true, "sortText": "\"+\";", "insertText": "\"+\";", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 } } ] @@ -1073,8 +1049,7 @@ "kind": 14, "preselect": true, "sortText": "Pkg;", - "insertText": "Pkg;", - "additionalTextEdits": [] + "insertText": "Pkg;" } ] } @@ -1107,8 +1082,7 @@ "preselect": true, "sortText": "Pkg;", "insertText": "Pkg;", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 } } ] @@ -1144,8 +1118,7 @@ "kind": 14, "preselect": true, "sortText": "Pkg;", - "insertText": "Pkg;", - "additionalTextEdits": [] + "insertText": "Pkg;" } ] } @@ -1178,8 +1151,7 @@ "preselect": true, "sortText": "Pkg;", "insertText": "Pkg;", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 } } ] @@ -1215,8 +1187,7 @@ "kind": 14, "preselect": true, "sortText": "GP;", - "insertText": "GP;", - "additionalTextEdits": [] + "insertText": "GP;" } ] } @@ -1249,8 +1220,7 @@ "preselect": true, "sortText": "GP;", "insertText": "GP;", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 } } ] @@ -1286,8 +1256,7 @@ "kind": 14, "preselect": true, "sortText": "GP;", - "insertText": "GP;", - "additionalTextEdits": [] + "insertText": "GP;" } ] } @@ -1320,8 +1289,7 @@ "preselect": true, "sortText": "GP;", "insertText": "GP;", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 } } ] @@ -1357,8 +1325,7 @@ "kind": 14, "preselect": true, "sortText": "GF;", - "insertText": "GF;", - "additionalTextEdits": [] + "insertText": "GF;" } ] } @@ -1391,8 +1358,7 @@ "preselect": true, "sortText": "GF;", "insertText": "GF;", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 } } ] @@ -1428,8 +1394,7 @@ "kind": 14, "preselect": true, "sortText": "GF;", - "insertText": "GF;", - "additionalTextEdits": [] + "insertText": "GF;" } ] } @@ -1462,8 +1427,7 @@ "preselect": true, "sortText": "GF;", "insertText": "GF;", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 } } ] @@ -1499,8 +1463,7 @@ "kind": 14, "preselect": true, "sortText": "GP;", - "insertText": "GP;", - "additionalTextEdits": [] + "insertText": "GP;" } ] } @@ -1533,8 +1496,7 @@ "preselect": true, "sortText": "GP;", "insertText": "GP;", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 } } ] @@ -1570,8 +1532,7 @@ "kind": 14, "preselect": true, "sortText": "GP;", - "insertText": "GP;", - "additionalTextEdits": [] + "insertText": "GP;" } ] } @@ -1604,8 +1565,7 @@ "preselect": true, "sortText": "GP;", "insertText": "GP;", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 } } ] @@ -1641,8 +1601,7 @@ "kind": 14, "preselect": true, "sortText": "PO;", - "insertText": "PO;", - "additionalTextEdits": [] + "insertText": "PO;" } ] } @@ -1675,8 +1634,7 @@ "preselect": true, "sortText": "PO;", "insertText": "PO;", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 } } ] @@ -1712,8 +1670,7 @@ "kind": 14, "preselect": true, "sortText": "PO;", - "insertText": "PO;", - "additionalTextEdits": [] + "insertText": "PO;" } ] } @@ -1746,8 +1703,7 @@ "preselect": true, "sortText": "PO;", "insertText": "PO;", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 } } ] @@ -1783,8 +1739,7 @@ "kind": 14, "preselect": true, "sortText": "E;", - "insertText": "E;", - "additionalTextEdits": [] + "insertText": "E;" } ] } @@ -1817,8 +1772,7 @@ "preselect": true, "sortText": "E;", "insertText": "E;", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 } } ] @@ -1854,8 +1808,7 @@ "kind": 14, "preselect": true, "sortText": "E;", - "insertText": "E;", - "additionalTextEdits": [] + "insertText": "E;" } ] } @@ -1888,8 +1841,7 @@ "preselect": true, "sortText": "E;", "insertText": "E;", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 } } ] @@ -1925,8 +1877,7 @@ "kind": 14, "preselect": true, "sortText": "PO;", - "insertText": "PO;", - "additionalTextEdits": [] + "insertText": "PO;" } ] } @@ -1959,8 +1910,7 @@ "preselect": true, "sortText": "PO;", "insertText": "PO;", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 } } ] @@ -1996,8 +1946,7 @@ "kind": 14, "preselect": true, "sortText": "PO;", - "insertText": "PO;", - "additionalTextEdits": [] + "insertText": "PO;" } ] } @@ -2030,8 +1979,7 @@ "preselect": true, "sortText": "PO;", "insertText": "PO;", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 } } ] @@ -2067,8 +2015,7 @@ "kind": 14, "preselect": true, "sortText": "record;", - "insertText": "record;", - "additionalTextEdits": [] + "insertText": "record;" } ] } @@ -2101,8 +2048,7 @@ "preselect": true, "sortText": "record;", "insertText": "record;", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 } } ] @@ -2138,8 +2084,7 @@ "kind": 14, "preselect": true, "sortText": "record;", - "insertText": "record;", - "additionalTextEdits": [] + "insertText": "record;" } ] } @@ -2172,8 +2117,7 @@ "preselect": true, "sortText": "record;", "insertText": "record;", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 } } ] @@ -2209,8 +2153,7 @@ "kind": 14, "preselect": true, "sortText": "record;", - "insertText": "record;", - "additionalTextEdits": [] + "insertText": "record;" } ] } @@ -2243,8 +2186,7 @@ "preselect": true, "sortText": "record;", "insertText": "record;", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 } } ] @@ -2280,8 +2222,7 @@ "kind": 14, "preselect": true, "sortText": "record;", - "insertText": "record;", - "additionalTextEdits": [] + "insertText": "record;" } ] } @@ -2314,8 +2255,7 @@ "preselect": true, "sortText": "record;", "insertText": "record;", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 } } ] @@ -2351,8 +2291,7 @@ "kind": 14, "preselect": true, "sortText": "case;", - "insertText": "case;", - "additionalTextEdits": [] + "insertText": "case;" } ] } @@ -2385,8 +2324,7 @@ "preselect": true, "sortText": "case;", "insertText": "case;", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 } } ] @@ -2422,8 +2360,7 @@ "kind": 14, "preselect": true, "sortText": "case;", - "insertText": "case;", - "additionalTextEdits": [] + "insertText": "case;" } ] } @@ -2456,8 +2393,7 @@ "preselect": true, "sortText": "case;", "insertText": "case;", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 } } ] @@ -2493,8 +2429,7 @@ "kind": 14, "preselect": true, "sortText": "record;", - "insertText": "record;", - "additionalTextEdits": [] + "insertText": "record;" } ] } @@ -2527,8 +2462,7 @@ "preselect": true, "sortText": "record;", "insertText": "record;", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 } } ] @@ -2564,8 +2498,7 @@ "kind": 14, "preselect": true, "sortText": "record;", - "insertText": "record;", - "additionalTextEdits": [] + "insertText": "record;" } ] } @@ -2598,8 +2531,7 @@ "preselect": true, "sortText": "record;", "insertText": "record;", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 } } ] @@ -2635,8 +2567,7 @@ "kind": 14, "preselect": true, "sortText": "select;", - "insertText": "select;", - "additionalTextEdits": [] + "insertText": "select;" } ] } @@ -2669,8 +2600,7 @@ "preselect": true, "sortText": "select;", "insertText": "select;", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 } } ] @@ -2706,8 +2636,7 @@ "kind": 14, "preselect": true, "sortText": "select;", - "insertText": "select;", - "additionalTextEdits": [] + "insertText": "select;" } ] } @@ -2740,8 +2669,7 @@ "preselect": true, "sortText": "select;", "insertText": "select;", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 } } ] @@ -2777,8 +2705,7 @@ "kind": 14, "preselect": true, "sortText": "Blk;", - "insertText": "Blk;", - "additionalTextEdits": [] + "insertText": "Blk;" } ] } @@ -2811,8 +2738,7 @@ "preselect": true, "sortText": "Blk;", "insertText": "Blk;", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 } } ] @@ -2848,8 +2774,7 @@ "kind": 14, "preselect": true, "sortText": "Blk;", - "insertText": "Blk;", - "additionalTextEdits": [] + "insertText": "Blk;" } ] } @@ -2882,8 +2807,7 @@ "preselect": true, "sortText": "Blk;", "insertText": "Blk;", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 } } ] @@ -2919,8 +2843,7 @@ "kind": 14, "preselect": false, "sortText": "end;", - "insertText": "end;", - "additionalTextEdits": [] + "insertText": "end;" } ] } @@ -2953,8 +2876,7 @@ "preselect": false, "sortText": "end;", "insertText": "end;", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 } } ] @@ -2990,8 +2912,7 @@ "kind": 14, "preselect": true, "sortText": "loop;", - "insertText": "loop;", - "additionalTextEdits": [] + "insertText": "loop;" } ] } @@ -3024,8 +2945,7 @@ "preselect": true, "sortText": "loop;", "insertText": "loop;", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 } } ] @@ -3061,8 +2981,7 @@ "kind": 14, "preselect": true, "sortText": "loop;", - "insertText": "loop;", - "additionalTextEdits": [] + "insertText": "loop;" } ] } @@ -3095,8 +3014,7 @@ "preselect": true, "sortText": "loop;", "insertText": "loop;", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 } } ] @@ -3132,8 +3050,7 @@ "kind": 14, "preselect": true, "sortText": "if;", - "insertText": "if;", - "additionalTextEdits": [] + "insertText": "if;" } ] } @@ -3166,8 +3083,7 @@ "preselect": true, "sortText": "if;", "insertText": "if;", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 } } ] @@ -3203,8 +3119,7 @@ "kind": 14, "preselect": true, "sortText": "if;", - "insertText": "if;", - "additionalTextEdits": [] + "insertText": "if;" } ] } @@ -3237,8 +3152,7 @@ "preselect": true, "sortText": "if;", "insertText": "if;", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 } } ] @@ -3274,8 +3188,7 @@ "kind": 14, "preselect": true, "sortText": "case;", - "insertText": "case;", - "additionalTextEdits": [] + "insertText": "case;" } ] } @@ -3308,8 +3221,7 @@ "preselect": true, "sortText": "case;", "insertText": "case;", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 } } ] @@ -3345,8 +3257,7 @@ "kind": 14, "preselect": true, "sortText": "case;", - "insertText": "case;", - "additionalTextEdits": [] + "insertText": "case;" } ] } @@ -3379,8 +3290,7 @@ "preselect": true, "sortText": "case;", "insertText": "case;", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 } } ] @@ -3416,8 +3326,7 @@ "kind": 14, "preselect": true, "sortText": "GNAT.Main;", - "insertText": "GNAT.Main;", - "additionalTextEdits": [] + "insertText": "GNAT.Main;" } ] } @@ -3450,8 +3359,7 @@ "preselect": true, "sortText": "GNAT.Main;", "insertText": "GNAT.Main;", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 } } ] @@ -3487,8 +3395,7 @@ "kind": 14, "preselect": true, "sortText": "GNAT.Main;", - "insertText": "GNAT.Main;", - "additionalTextEdits": [] + "insertText": "GNAT.Main;" } ] } @@ -3521,8 +3428,7 @@ "preselect": true, "sortText": "GNAT.Main;", "insertText": "GNAT.Main;", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 } } ] @@ -3548,4 +3454,4 @@ "exit_code": 0 } } -] \ No newline at end of file +] diff --git a/testsuite/ada_lsp/completion.end_labels2/test.yaml b/testsuite/ada_lsp/completion.end_labels2/test.yaml index 35fea88cc..ea8cb569d 100644 --- a/testsuite/ada_lsp/completion.end_labels2/test.yaml +++ b/testsuite/ada_lsp/completion.end_labels2/test.yaml @@ -1,4 +1 @@ title: 'completion.end_labels2' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/completion.invisible/test.json b/testsuite/ada_lsp/completion.invisible/test.json index 0e8eb90e9..b8a9c3f10 100644 --- a/testsuite/ada_lsp/completion.invisible/test.json +++ b/testsuite/ada_lsp/completion.invisible/test.json @@ -160,9 +160,7 @@ "detail": "function Invisible_Function (X, Y : Integer) return Integer", "documentation": "at aaa.ads (4:4)", "sortText": "~100&1Invisible_Function", - "insertText": "Invisible_Function", - "additionalTextEdits": [ - ] + "insertText": "Invisible_Function" } ] } @@ -313,9 +311,7 @@ "detail": "function Invisible_Function (X, Y : Integer) return Integer", "documentation": "at aaa.ads (4:4)", "sortText": "~100&1Invisible_Function", - "insertText": "Invisible_Function", - "additionalTextEdits": [ - ] + "insertText": "Invisible_Function" } ] } diff --git a/testsuite/ada_lsp/completion.invisible/test.yaml b/testsuite/ada_lsp/completion.invisible/test.yaml index 238062a64..09458cf2b 100644 --- a/testsuite/ada_lsp/completion.invisible/test.yaml +++ b/testsuite/ada_lsp/completion.invisible/test.yaml @@ -1,4 +1 @@ title: 'completion.invisible' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/completion.invisible3/test.json b/testsuite/ada_lsp/completion.invisible3/test.json index 5ce7cbf88..ca0a399b9 100644 --- a/testsuite/ada_lsp/completion.invisible3/test.json +++ b/testsuite/ada_lsp/completion.invisible3/test.json @@ -149,8 +149,7 @@ "detail": "function ABC1 return Integer", "documentation": "at pkg.ads (3:4)", "sortText": "~100&0ABC1", - "insertText": "ABC1", - "additionalTextEdits": [] + "insertText": "ABC1" }, { "label": "ABC14 (invisible)", @@ -158,8 +157,7 @@ "detail": "generic\n ABC13 : Integer;\npackage ABC14", "documentation": "at pkg.ads (19:4)", "sortText": "~100&1ABC14", - "insertText": "ABC14", - "additionalTextEdits": [] + "insertText": "ABC14" }, { "label": "ABC4 (invisible)", @@ -167,8 +165,7 @@ "detail": "type ABC4 (ABC5 : Integer) is record\n ABC6 : Boolean := (for some ABC7 in Boolean => ABC7);\nend record;", "documentation": "at pkg.ads (5:4)", "sortText": "~100&2ABC4", - "insertText": "ABC4", - "additionalTextEdits": [] + "insertText": "ABC4" } ] } diff --git a/testsuite/ada_lsp/completion.invisible3/test.yaml b/testsuite/ada_lsp/completion.invisible3/test.yaml index 1c9c2425b..07773fc39 100644 --- a/testsuite/ada_lsp/completion.invisible3/test.yaml +++ b/testsuite/ada_lsp/completion.invisible3/test.yaml @@ -1,4 +1 @@ title: 'completion.invisible3' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/completion.invisible4/test.json b/testsuite/ada_lsp/completion.invisible4/test.json index fbebed57b..bdfbb7caf 100644 --- a/testsuite/ada_lsp/completion.invisible4/test.json +++ b/testsuite/ada_lsp/completion.invisible4/test.json @@ -148,8 +148,7 @@ "kind": 9, "detail": "package Pkg_1.Child", "documentation": "at pkg_1-child.ads (3:1)", - "sortText": "100&1Child", - "additionalTextEdits": [] + "sortText": "100&1Child" }, { "label": "Child2 (invisible)", @@ -157,9 +156,7 @@ "detail": "package Pkg_1.Child2", "documentation": "at pkg_1-child2.ads (1:1)", "sortText": "~100&2Child2", - "insertText": "Child2", - "additionalTextEdits": [ - ] + "insertText": "Child2" } ] } diff --git a/testsuite/ada_lsp/completion.invisible4/test.yaml b/testsuite/ada_lsp/completion.invisible4/test.yaml index 120f0f344..6a40dc690 100644 --- a/testsuite/ada_lsp/completion.invisible4/test.yaml +++ b/testsuite/ada_lsp/completion.invisible4/test.yaml @@ -1,4 +1 @@ title: 'completion.invisible4' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/completion.invisible5/test.json b/testsuite/ada_lsp/completion.invisible5/test.json index 490ec819b..8f5266a86 100644 --- a/testsuite/ada_lsp/completion.invisible5/test.json +++ b/testsuite/ada_lsp/completion.invisible5/test.json @@ -148,8 +148,7 @@ "kind": 9, "detail": "package Ada", "documentation": "", - "sortText": "100&1Ada", - "additionalTextEdits": [] + "sortText": "100&1Ada" } ] } diff --git a/testsuite/ada_lsp/completion.invisible5/test.yaml b/testsuite/ada_lsp/completion.invisible5/test.yaml index d3f962235..33d3311c2 100644 --- a/testsuite/ada_lsp/completion.invisible5/test.yaml +++ b/testsuite/ada_lsp/completion.invisible5/test.yaml @@ -1,4 +1 @@ title: 'completion.invisible5' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/completion.param.no_named_notation/test.json b/testsuite/ada_lsp/completion.param.no_named_notation/test.json index 3b693b3d4..4f509e10f 100644 --- a/testsuite/ada_lsp/completion.param.no_named_notation/test.json +++ b/testsuite/ada_lsp/completion.param.no_named_notation/test.json @@ -172,7 +172,6 @@ "sortText": "+0", "insertText": " A => ${2:Integer}, B => ${3:Float})$0", "insertTextFormat": 2, - "additionalTextEdits": [], "detail": "procedure Hello (M : access My_Type; A : Integer; B : Float)", "documentation": "at bar.ads (11:4)" }, @@ -182,8 +181,7 @@ "documentation": " A => ", "sortText": "+1", "insertText": " A => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "B", @@ -191,8 +189,7 @@ "documentation": " B => ", "sortText": "+2", "insertText": " B => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "Params of Hello", @@ -200,7 +197,6 @@ "sortText": "+3", "insertText": " ${2:B : Float})$0", "insertTextFormat": 2, - "additionalTextEdits": [], "detail": "procedure Hello (A : Integer; B : Float)", "documentation": "at bar.ads (3:4)" }, @@ -210,8 +206,7 @@ "documentation": " B => ", "sortText": "+4", "insertText": " B => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 } ] } @@ -280,7 +275,6 @@ "sortText": "+0", "insertText": " A => ${2:Integer})$0", "insertTextFormat": 2, - "additionalTextEdits": [], "detail": "procedure Hello (M : access My_Type; A : Integer; B : Float)", "documentation": "at bar.ads (11:4)" }, @@ -290,8 +284,7 @@ "documentation": " A => ", "sortText": "+1", "insertText": " A => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 } ] } @@ -369,8 +362,7 @@ "documentation": " B => ", "sortText": "+1", "insertText": " B => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 } ] } diff --git a/testsuite/ada_lsp/completion.param.no_named_notation/test.yaml b/testsuite/ada_lsp/completion.param.no_named_notation/test.yaml index 8e2e0dbfb..8da75c380 100644 --- a/testsuite/ada_lsp/completion.param.no_named_notation/test.yaml +++ b/testsuite/ada_lsp/completion.param.no_named_notation/test.yaml @@ -1,4 +1 @@ title: 'completion.param.no_named_notation' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/completion.param.non_basic_calls/test.json b/testsuite/ada_lsp/completion.param.non_basic_calls/test.json index 19f77bc4c..b693f3fb8 100644 --- a/testsuite/ada_lsp/completion.param.non_basic_calls/test.json +++ b/testsuite/ada_lsp/completion.param.non_basic_calls/test.json @@ -149,16 +149,14 @@ "documentation": "at foo.adb (5:4)", "sortText": "+00", "insertText": "C => ${1:String})$0", - "insertTextFormat": 2, - "additionalTextEdits": [] + "insertTextFormat": 2 }, { "label": "C", "kind": 5, "sortText": "+01", "insertText": "C => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "Params of Bar", @@ -167,24 +165,21 @@ "documentation": "at foo.adb (4:4)", "sortText": "+02", "insertText": "${1:A : Integer}, ${2:B : Integer})$0", - "insertTextFormat": 2, - "additionalTextEdits": [] + "insertTextFormat": 2 }, { "label": "A", "kind": 5, "sortText": "+03", "insertText": "A => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "B", "kind": 5, "sortText": "+04", "insertText": "B => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "Params of Bar", @@ -193,40 +188,35 @@ "documentation": "at foo.adb (2:4)", "sortText": "+05", "insertText": "I => ${1:Integer}, J => ${2:Integer}, K => ${3:Integer}, L => ${4:Float})$0", - "insertTextFormat": 2, - "additionalTextEdits": [] + "insertTextFormat": 2 }, { "label": "I", "kind": 5, "sortText": "+06", "insertText": "I => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "J", "kind": 5, "sortText": "+07", "insertText": "J => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "K", "kind": 5, "sortText": "+08", "insertText": "K => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "L", "kind": 5, "sortText": "+09", "insertText": "L => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 } ] } diff --git a/testsuite/ada_lsp/completion.param.non_basic_calls/test.yaml b/testsuite/ada_lsp/completion.param.non_basic_calls/test.yaml index 2af802807..4043a0eef 100644 --- a/testsuite/ada_lsp/completion.param.non_basic_calls/test.yaml +++ b/testsuite/ada_lsp/completion.param.non_basic_calls/test.yaml @@ -1,4 +1 @@ title: 'testsuite/ada_lsp/completion.param.non_basic_calls' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/completion.snippet.formatting3/test.json b/testsuite/ada_lsp/completion.snippet.formatting3/test.json index b902f9c0d..c6e2a1ab2 100644 --- a/testsuite/ada_lsp/completion.snippet.formatting3/test.json +++ b/testsuite/ada_lsp/completion.snippet.formatting3/test.json @@ -173,7 +173,6 @@ }, "newText": "Foo_Bar\n (A => ${1:A : Integer;},\n BBBBBB => ${2:BBBBBB : Float;},\n CCCC => ${3:CCCC : String;},\n Bar => ${4:with procedure Bar (X : Integer);})$0" }, - "additionalTextEdits": [], "data": { "uri": "$URI{foo.adb}", "range": { @@ -194,8 +193,7 @@ "documentation": "A => ", "sortText": "+1", "insertText": "A => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "BBBBBB", @@ -203,8 +201,7 @@ "documentation": "BBBBBB => ", "sortText": "+2", "insertText": "BBBBBB => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "CCCC", @@ -212,8 +209,7 @@ "documentation": "CCCC => ", "sortText": "+3", "insertText": "CCCC => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "Bar", @@ -221,8 +217,7 @@ "documentation": "Bar => ", "sortText": "+4", "insertText": "Bar => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 } ] } @@ -297,7 +292,6 @@ }, "newText": "Foo_Bar\n (A => ${1:A : Integer;},\n BBBBBB => ${2:BBBBBB : Float;},\n CCCC => ${3:CCCC : String;},\n Bar => ${4:with procedure Bar (X : Integer);})$0" }, - "additionalTextEdits": [], "data": { "uri": "$URI{foo.adb}", "range": { diff --git a/testsuite/ada_lsp/completion.use_clauses.multiple_with/test.json b/testsuite/ada_lsp/completion.use_clauses.multiple_with/test.json index 2f8c55e8b..6c0775f90 100644 --- a/testsuite/ada_lsp/completion.use_clauses.multiple_with/test.json +++ b/testsuite/ada_lsp/completion.use_clauses.multiple_with/test.json @@ -93,49 +93,7 @@ "(" ], "resolveProvider": true - }, - "hoverProvider": true, - "signatureHelpProvider": { - "triggerCharacters": [ - ",", - "(" - ], - "retriggerCharacters": [ - "\b" - ] - }, - "declarationProvider": true, - "definitionProvider": true, - "typeDefinitionProvider": true, - "implementationProvider": true, - "referencesProvider": true, - "documentHighlightProvider": true, - "documentSymbolProvider": true, - "codeActionProvider": {}, - "documentFormattingProvider": true, - "documentRangeFormattingProvider": true, - "renameProvider": {}, - "foldingRangeProvider": true, - "executeCommandProvider": { - "commands": [ - "", - "als-refactor-remove-parameters" - ] - }, - "workspaceSymbolProvider": true, - "callHierarchyProvider": {}, - "alsShowDepsProvider": true, - "alsReferenceKinds": [ - "reference", - "access", - "write", - "call", - "dispatching call", - "parent", - "child", - "overriding" - ], - "alsCheckSyntaxProvider": true + } } } } @@ -220,8 +178,7 @@ "documentation": "Insert the use-clause corresponding to the with-clause on the same line.", "preselect": false, "sortText": "+use Ada.Text_IO, GNAT.Strings;", - "insertText": "use Ada.Text_IO, GNAT.Strings;", - "additionalTextEdits": [] + "insertText": "use Ada.Text_IO, GNAT.Strings;" } ] } @@ -249,4 +206,4 @@ "exit_code": 0 } } -] \ No newline at end of file +] diff --git a/testsuite/ada_lsp/completion.use_clauses.multiple_with/test.yaml b/testsuite/ada_lsp/completion.use_clauses.multiple_with/test.yaml index acff3d145..fb702036a 100644 --- a/testsuite/ada_lsp/completion.use_clauses.multiple_with/test.yaml +++ b/testsuite/ada_lsp/completion.use_clauses.multiple_with/test.yaml @@ -1,4 +1 @@ title: 'completion.use_clauses.multiple_with' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/completion.use_clauses/test.json b/testsuite/ada_lsp/completion.use_clauses/test.json index fcbef6308..40608e744 100644 --- a/testsuite/ada_lsp/completion.use_clauses/test.json +++ b/testsuite/ada_lsp/completion.use_clauses/test.json @@ -270,4 +270,4 @@ "exit_code": 0 } } -] \ No newline at end of file +] From 861aa8cf8d900fcefa394abea14ec5b9878575fa Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Wed, 30 Aug 2023 19:34:59 +0300 Subject: [PATCH 077/152] Add "other file" command Refs #1170 --- gnat/ignore_in_317.txt | 2 - source/ada/lsp-ada_driver.adb | 19 +++- .../lsp-ada_handlers-other_file_commands.adb | 106 +++++++++--------- .../lsp-ada_handlers-other_file_commands.ads | 21 ++-- .../ada_lsp/commands.other_file/test.json | 6 +- .../ada_lsp/commands.other_file/test.yaml | 3 - 6 files changed, 78 insertions(+), 79 deletions(-) diff --git a/gnat/ignore_in_317.txt b/gnat/ignore_in_317.txt index 674936a19..9ae28b88f 100644 --- a/gnat/ignore_in_317.txt +++ b/gnat/ignore_in_317.txt @@ -1,7 +1,5 @@ lsp-ada_handlers-alire.adb lsp-ada_handlers-alire.ads -lsp-ada_handlers-other_file_commands.adb -lsp-ada_handlers-other_file_commands.ads lsp-ada_handlers-project_reload_commands.adb lsp-ada_handlers-project_reload_commands.ads lsp-client_side_file_monitors.adb diff --git a/source/ada/lsp-ada_driver.adb b/source/ada/lsp-ada_driver.adb index 3b237ae99..19c2c4bb4 100644 --- a/source/ada/lsp-ada_driver.adb +++ b/source/ada/lsp-ada_driver.adb @@ -38,6 +38,7 @@ with GNATCOLL.VFS; use GNATCOLL.VFS; with GNATCOLL.Utils; with LSP.Ada_Handlers; +with LSP.Ada_Handlers.Other_File_Commands; with LSP.Ada_Handlers.Suspend_Executions; with LSP.Commands; with LSP.GNATCOLL_Tracers; @@ -53,6 +54,21 @@ procedure LSP.Ada_Driver is use type VSS.Strings.Virtual_String; + procedure Register_Commands; + -- Register all known commands + + ----------------------- + -- Register_Commands -- + ----------------------- + + procedure Register_Commands is + begin + LSP.Commands.Register + (LSP.Ada_Handlers.Other_File_Commands.Command'Tag); + LSP.Commands.Register + (LSP.Ada_Handlers.Suspend_Executions.Suspend_Execution'Tag); + end Register_Commands; + Server_Trace : constant Trace_Handle := Create ("ALS.MAIN", From_Config); -- Main trace for the LSP. @@ -244,8 +260,7 @@ begin if VSS.Command_Line.Is_Specified (Language_GPR_Option) then Server.Run (GPR_Handler'Unchecked_Access, Tracer'Unchecked_Access); else - LSP.Commands.Register - (LSP.Ada_Handlers.Suspend_Executions.Suspend_Execution'Tag); + Register_Commands; Server.Run (Ada_Handler'Unchecked_Access, Tracer'Unchecked_Access); end if; diff --git a/source/ada/lsp-ada_handlers-other_file_commands.adb b/source/ada/lsp-ada_handlers-other_file_commands.adb index 72f679b4c..20d7bf607 100644 --- a/source/ada/lsp-ada_handlers-other_file_commands.adb +++ b/source/ada/lsp-ada_handlers-other_file_commands.adb @@ -15,15 +15,15 @@ -- of the license. -- ------------------------------------------------------------------------------ -with Ada.Strings.UTF_Encoding; +with VSS.JSON.Streams; with GNATCOLL.Tribooleans; with GPR2.Project.Source; +with GPR2.Path_Name; -with LSP.Messages.Client_Requests; - -with VSS.Strings.Conversions; +with LSP.Constants; +with LSP.Servers; package body LSP.Ada_Handlers.Other_File_Commands is @@ -32,29 +32,40 @@ package body LSP.Ada_Handlers.Other_File_Commands is ------------ overriding function Create - (JS : not null access LSP.JSON_Streams.JSON_Stream'Class) return Command + (Any : not null access LSP.Structures.LSPAny_Vector) + return Command is + use type VSS.Strings.Virtual_String; + use all type VSS.JSON.Streams.JSON_Stream_Element_Kind; + + Index : Natural := Any.First_Index; begin return V : Command do - pragma Assert (JS.R.Is_Start_Object); - JS.R.Read_Next; - while not JS.R.Is_End_Object loop - pragma Assert (JS.R.Is_Key_Name); - declare - Key : constant Ada.Strings.UTF_Encoding.UTF_8_String := - VSS.Strings.Conversions.To_UTF_8_String (JS.R.Key_Name); - begin - JS.R.Read_Next; - - if Key = "uri" then - LSP.Types.Read_LSP_URI (JS, V.URI); - else - JS.Skip_Value; + if Index < Any.Last_Index + and then Any (Index).Kind = Start_Array + then + Index := Index + 1; + + if Index < Any.Last_Index + and then Any (Index).Kind = Start_Object + then + Index := Index + 1; + + if Index < Any.Last_Index + and then Any (Index).Kind = Key_Name + and then Any (Index).Key_Name = "uri" + then + Index := Index + 1; + + if Index < Any.Last_Index + and then Any (Index).Kind = String_Value + then + V.URI := (Any (Index).String_Value with null record); + end if; end if; - end; - end loop; - JS.R.Read_Next; + end if; + end if; end return; end Create; @@ -64,13 +75,12 @@ package body LSP.Ada_Handlers.Other_File_Commands is overriding procedure Execute (Self : Command; - Handler : not null access LSP.Server_Notification_Receivers - .Server_Notification_Receiver' - Class; - Client : not null access LSP.Client_Message_Receivers - .Client_Message_Receiver' - Class; - Error : in out LSP.Errors.Optional_ResponseError) + Handler : not null access + LSP.Server_Notification_Receivers.Server_Notification_Receiver'Class; + Sender : not null access LSP.Client_Message_Receivers. + Client_Message_Receiver'Class; + Id : LSP.Structures.Integer_Or_Virtual_String; + Error : in out LSP.Errors.ResponseError_Optional) is Message_Handler : LSP.Ada_Handlers.Message_Handler renames LSP.Ada_Handlers.Message_Handler (Handler.all); @@ -123,17 +133,18 @@ package body LSP.Ada_Handlers.Other_File_Commands is return File; end Other_File; - URI : constant LSP.Messages.DocumentUri := - Message_Handler.From_File (Other_File); + URI : constant LSP.Structures.DocumentUri := + Message_Handler.To_URI (Other_File.Display_Full_Name); - Message : constant LSP.Messages.Client_Requests.ShowDocument_Request := - (params => - (uri => URI, - takeFocus => LSP.Types.True, - others => <>), - others => <>); + Message : constant LSP.Structures.ShowDocumentParams := + (uri => (VSS.Strings.Virtual_String (URI) with null record), + takeFocus => LSP.Constants.True, + others => <>); + + New_Id : constant LSP.Structures.Integer_Or_Virtual_String := + Message_Handler.Server.Allocate_Request_Id; begin - Client.On_ShowDocument_Request (Message); + Sender.On_ShowDocument_Request (New_Id, Message); end Execute; ---------------- @@ -141,26 +152,11 @@ package body LSP.Ada_Handlers.Other_File_Commands is ---------------- procedure Initialize - (Self : in out Command'Class; URI : LSP.Messages.DocumentUri) + (Self : in out Command'Class; + URI : LSP.Structures.DocumentUri) is begin Self.URI := URI; end Initialize; - ------------------- - -- Write_Command -- - ------------------- - - procedure Write_Command - (S : access Ada.Streams.Root_Stream_Type'Class; V : Command) - is - JS : LSP.JSON_Streams.JSON_Stream'Class renames - LSP.JSON_Streams.JSON_Stream'Class (S.all); - begin - JS.Start_Object; - JS.Key ("uri"); - LSP.Types.Write_LSP_URI (S, V.URI); - JS.End_Object; - end Write_Command; - end LSP.Ada_Handlers.Other_File_Commands; diff --git a/source/ada/lsp-ada_handlers-other_file_commands.ads b/source/ada/lsp-ada_handlers-other_file_commands.ads index 4c881ea0e..e35f32978 100644 --- a/source/ada/lsp-ada_handlers-other_file_commands.ads +++ b/source/ada/lsp-ada_handlers-other_file_commands.ads @@ -17,12 +17,9 @@ -- -- Implementation of the command to switch from .adb to .ads file and back. -with Ada.Streams; - with LSP.Client_Message_Receivers; with LSP.Commands; with LSP.Errors; -with LSP.JSON_Streams; package LSP.Ada_Handlers.Other_File_Commands is @@ -30,31 +27,27 @@ package LSP.Ada_Handlers.Other_File_Commands is procedure Initialize (Self : in out Command'Class; - URI : LSP.Messages.DocumentUri); + URI : LSP.Structures.DocumentUri); private type Command is new LSP.Commands.Command with record - URI : LSP.Messages.DocumentUri; + URI : LSP.Structures.DocumentUri; end record; overriding function Create - (JS : not null access LSP.JSON_Streams.JSON_Stream'Class) + (Any : not null access LSP.Structures.LSPAny_Vector) return Command; overriding procedure Execute (Self : Command; Handler : not null access LSP.Server_Notification_Receivers.Server_Notification_Receiver'Class; - Client : not null access - LSP.Client_Message_Receivers.Client_Message_Receiver'Class; - Error : in out LSP.Errors.Optional_ResponseError); - - procedure Write_Command - (S : access Ada.Streams.Root_Stream_Type'Class; - V : Command); + Sender : not null access LSP.Client_Message_Receivers. + Client_Message_Receiver'Class; + Id : LSP.Structures.Integer_Or_Virtual_String; + Error : in out LSP.Errors.ResponseError_Optional); - for Command'Write use Write_Command; for Command'External_Tag use "als-other-file"; end LSP.Ada_Handlers.Other_File_Commands; diff --git a/testsuite/ada_lsp/commands.other_file/test.json b/testsuite/ada_lsp/commands.other_file/test.json index a1c77045b..57ca82468 100644 --- a/testsuite/ada_lsp/commands.other_file/test.json +++ b/testsuite/ada_lsp/commands.other_file/test.json @@ -42,7 +42,7 @@ "wait":[ { "jsonrpc": "2.0", - "id": 2, + "id": 1, "method": "window/workDoneProgress/create", "params": { "token": "" @@ -84,7 +84,7 @@ "wait":[ { "jsonrpc": "2.0", - "id": 3, + "id": 2, "method": "window/showDocument", "params": { "uri": "$URI{aaa.adb}", @@ -116,7 +116,7 @@ "wait":[ { "jsonrpc": "2.0", - "id": 4, + "id": 3, "method": "window/showDocument", "params": { "uri": "$URI{aaa.ads}", diff --git a/testsuite/ada_lsp/commands.other_file/test.yaml b/testsuite/ada_lsp/commands.other_file/test.yaml index f50a37b5d..aad95470d 100644 --- a/testsuite/ada_lsp/commands.other_file/test.yaml +++ b/testsuite/ada_lsp/commands.other_file/test.yaml @@ -1,4 +1 @@ title: 'commands.other_file' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] From 62ec96b5c986f953e2137bfe07f5bd9dba3a0507 Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Wed, 30 Aug 2023 20:19:39 +0300 Subject: [PATCH 078/152] Restore reload project command. Refs #1170 --- gnat/ignore_in_317.txt | 2 - source/ada/lsp-ada_driver.adb | 48 +++++++++++++++++++ ...p-ada_handlers-project_reload_commands.adb | 36 +++++--------- ...p-ada_handlers-project_reload_commands.ads | 17 ++----- .../ada_lsp/project_reload.command/test.json | 18 +++---- .../ada_lsp/project_reload.command/test.yaml | 3 -- 6 files changed, 71 insertions(+), 53 deletions(-) diff --git a/gnat/ignore_in_317.txt b/gnat/ignore_in_317.txt index 9ae28b88f..6e26369fc 100644 --- a/gnat/ignore_in_317.txt +++ b/gnat/ignore_in_317.txt @@ -1,7 +1,5 @@ lsp-ada_handlers-alire.adb lsp-ada_handlers-alire.ads -lsp-ada_handlers-project_reload_commands.adb -lsp-ada_handlers-project_reload_commands.ads lsp-client_side_file_monitors.adb lsp-client_side_file_monitors.ads lsp-common.adb diff --git a/source/ada/lsp-ada_driver.adb b/source/ada/lsp-ada_driver.adb index 19c2c4bb4..e5db88eff 100644 --- a/source/ada/lsp-ada_driver.adb +++ b/source/ada/lsp-ada_driver.adb @@ -38,7 +38,22 @@ with GNATCOLL.VFS; use GNATCOLL.VFS; with GNATCOLL.Utils; with LSP.Ada_Handlers; +with LSP.Ada_Handlers.Named_Parameters_Commands; with LSP.Ada_Handlers.Other_File_Commands; +with LSP.Ada_Handlers.Project_Reload_Commands; +with LSP.Ada_Handlers.Refactor.Add_Parameter; +with LSP.Ada_Handlers.Refactor.Change_Parameter_Mode; +with LSP.Ada_Handlers.Refactor.Change_Parameters_Default_Value; +with LSP.Ada_Handlers.Refactor.Change_Parameters_Type; +with LSP.Ada_Handlers.Refactor.Extract_Subprogram; +with LSP.Ada_Handlers.Refactor.Imports_Commands; +with LSP.Ada_Handlers.Refactor.Introduce_Parameter; +with LSP.Ada_Handlers.Refactor.Move_Parameter; +with LSP.Ada_Handlers.Refactor.Pull_Up_Declaration; +with LSP.Ada_Handlers.Refactor.Remove_Parameter; +with LSP.Ada_Handlers.Refactor.Replace_Type; +with LSP.Ada_Handlers.Refactor.Sort_Dependencies; +with LSP.Ada_Handlers.Refactor.Suppress_Seperate; with LSP.Ada_Handlers.Suspend_Executions; with LSP.Commands; with LSP.GNATCOLL_Tracers; @@ -67,6 +82,39 @@ procedure LSP.Ada_Driver is (LSP.Ada_Handlers.Other_File_Commands.Command'Tag); LSP.Commands.Register (LSP.Ada_Handlers.Suspend_Executions.Suspend_Execution'Tag); + LSP.Commands.Register + (LSP.Ada_Handlers.Project_Reload_Commands.Command'Tag); + LSP.Commands.Register + (LSP.Ada_Handlers.Named_Parameters_Commands.Command'Tag); + LSP.Commands.Register + (LSP.Ada_Handlers.Refactor.Imports_Commands.Command'Tag); + LSP.Commands.Register + (LSP.Ada_Handlers.Refactor.Suppress_Seperate.Command'Tag); + LSP.Commands.Register + (LSP.Ada_Handlers.Refactor.Extract_Subprogram.Command'Tag); + LSP.Commands.Register + (LSP.Ada_Handlers.Refactor.Introduce_Parameter.Command'Tag); + LSP.Commands.Register + (LSP.Ada_Handlers.Refactor.Pull_Up_Declaration.Command'Tag); + LSP.Commands.Register + (LSP.Ada_Handlers.Refactor.Replace_Type.Command'Tag); + LSP.Commands.Register + (LSP.Ada_Handlers.Refactor.Sort_Dependencies.Command'Tag); + + -- Refactoring - Change Subprogram Signature Commands + LSP.Commands.Register + (LSP.Ada_Handlers.Refactor.Add_Parameter.Command'Tag); + LSP.Commands.Register + (LSP.Ada_Handlers.Refactor.Remove_Parameter.Command'Tag); + LSP.Commands.Register + (LSP.Ada_Handlers.Refactor.Move_Parameter.Command'Tag); + LSP.Commands.Register + (LSP.Ada_Handlers.Refactor.Change_Parameter_Mode.Command'Tag); + LSP.Commands.Register + (LSP.Ada_Handlers.Refactor.Change_Parameters_Type.Command'Tag); + LSP.Commands.Register + (LSP.Ada_Handlers.Refactor.Change_Parameters_Default_Value. + Command'Tag); end Register_Commands; Server_Trace : constant Trace_Handle := Create ("ALS.MAIN", From_Config); diff --git a/source/ada/lsp-ada_handlers-project_reload_commands.adb b/source/ada/lsp-ada_handlers-project_reload_commands.adb index 008282ade..c8e05c15d 100644 --- a/source/ada/lsp-ada_handlers-project_reload_commands.adb +++ b/source/ada/lsp-ada_handlers-project_reload_commands.adb @@ -15,6 +15,8 @@ -- of the license. -- ------------------------------------------------------------------------------ +with LSP.Ada_Handlers.Project_Loading; + package body LSP.Ada_Handlers.Project_Reload_Commands is ------------ @@ -22,9 +24,10 @@ package body LSP.Ada_Handlers.Project_Reload_Commands is ------------ overriding function Create - (JS : not null access LSP.JSON_Streams.JSON_Stream'Class) return Command + (Any : not null access LSP.Structures.LSPAny_Vector) + return Command is - pragma Unreferenced (JS); + pragma Unreferenced (Any); begin return (LSP.Commands.Command with null record); end Create; @@ -35,33 +38,18 @@ package body LSP.Ada_Handlers.Project_Reload_Commands is overriding procedure Execute (Self : Command; - Handler : not null access LSP.Server_Notification_Receivers - .Server_Notification_Receiver'Class; - Client : not null access LSP.Client_Message_Receivers - .Client_Message_Receiver'Class; - Error : in out LSP.Errors.Optional_ResponseError) + Handler : not null access + LSP.Server_Notification_Receivers.Server_Notification_Receiver'Class; + Sender : not null access LSP.Client_Message_Receivers. + Client_Message_Receiver'Class; + Id : LSP.Structures.Integer_Or_Virtual_String; + Error : in out LSP.Errors.ResponseError_Optional) is Message_Handler : LSP.Ada_Handlers.Message_Handler renames LSP.Ada_Handlers.Message_Handler (Handler.all); begin - Message_Handler.Reload_Project; + LSP.Ada_Handlers.Project_Loading.Reload_Project (Message_Handler); end Execute; - ------------------- - -- Write_Command -- - ------------------- - - procedure Write_Command - (S : access Ada.Streams.Root_Stream_Type'Class; - V : Command) - is - JS : LSP.JSON_Streams.JSON_Stream'Class renames - LSP.JSON_Streams.JSON_Stream'Class (S.all); - begin - JS.Start_Object; - -- no command arguments! - JS.End_Object; - end Write_Command; - end LSP.Ada_Handlers.Project_Reload_Commands; diff --git a/source/ada/lsp-ada_handlers-project_reload_commands.ads b/source/ada/lsp-ada_handlers-project_reload_commands.ads index 4ac85748f..a09123758 100644 --- a/source/ada/lsp-ada_handlers-project_reload_commands.ads +++ b/source/ada/lsp-ada_handlers-project_reload_commands.ads @@ -17,12 +17,9 @@ -- -- Implementation of the command to reload current project. -with Ada.Streams; - with LSP.Client_Message_Receivers; with LSP.Commands; with LSP.Errors; -with LSP.JSON_Streams; package LSP.Ada_Handlers.Project_Reload_Commands is @@ -33,22 +30,18 @@ private type Command is new LSP.Commands.Command with null record; overriding function Create - (JS : not null access LSP.JSON_Streams.JSON_Stream'Class) + (Any : not null access LSP.Structures.LSPAny_Vector) return Command; overriding procedure Execute (Self : Command; Handler : not null access LSP.Server_Notification_Receivers.Server_Notification_Receiver'Class; - Client : not null access - LSP.Client_Message_Receivers.Client_Message_Receiver'Class; - Error : in out LSP.Errors.Optional_ResponseError); - - procedure Write_Command - (S : access Ada.Streams.Root_Stream_Type'Class; - V : Command); + Sender : not null access LSP.Client_Message_Receivers. + Client_Message_Receiver'Class; + Id : LSP.Structures.Integer_Or_Virtual_String; + Error : in out LSP.Errors.ResponseError_Optional); - for Command'Write use Write_Command; for Command'External_Tag use "als-reload-project"; end LSP.Ada_Handlers.Project_Reload_Commands; diff --git a/testsuite/ada_lsp/project_reload.command/test.json b/testsuite/ada_lsp/project_reload.command/test.json index 7148f14f5..0afd4bda4 100644 --- a/testsuite/ada_lsp/project_reload.command/test.json +++ b/testsuite/ada_lsp/project_reload.command/test.json @@ -94,8 +94,7 @@ "line": 0, "character": 17 } - }, - "alsKind": ["reference"] + } }, { "uri": "$URI{choices/second.adb}", "range": { @@ -107,8 +106,7 @@ "line": 3, "character": 15 } - }, - "alsKind": ["call"] + } }] }] } @@ -167,8 +165,7 @@ "line": 0, "character": 17 } - }, - "alsKind": ["reference"] + } }, { "uri": "$URI{choices/second.adb}", "range": { @@ -180,8 +177,7 @@ "line": 3, "character": 15 } - }, - "alsKind": ["call"] + } }, { "uri": "$URI{subproject/third.adb}", "range": { @@ -193,8 +189,7 @@ "line": 0, "character": 17 } - }, - "alsKind": ["reference"] + } }, { "uri": "$URI{subproject/third.adb}", "range": { @@ -206,8 +201,7 @@ "line": 3, "character": 15 } - }, - "alsKind": ["call"] + } }] }] } diff --git a/testsuite/ada_lsp/project_reload.command/test.yaml b/testsuite/ada_lsp/project_reload.command/test.yaml index 287a268fe..9b9de08d3 100644 --- a/testsuite/ada_lsp/project_reload.command/test.yaml +++ b/testsuite/ada_lsp/project_reload.command/test.yaml @@ -1,4 +1 @@ title: 'project_reload.command' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] From 05e32b07b122d89da05f12997a7f8e872f082099 Mon Sep 17 00:00:00 2001 From: Andry Ogorodnik Date: Thu, 31 Aug 2023 18:28:53 +0300 Subject: [PATCH 079/152] Corrections for tests Refs #1170 --- ...da_handlers-refactor-sort_dependencies.adb | 3 +- .../lsp-structures-lspany_vectors.adb | 10 +- .../test.json | 211 +++++++----------- .../test.json | 160 +++++-------- .../test.yaml | 2 +- .../S314-015/test.yaml | 3 - .../UA25-015/test.yaml | 3 - .../V207-019/test.json | 74 +++--- .../SA22-035/test.json | 65 +++--- .../SA22-035/test.yaml | 3 - 10 files changed, 216 insertions(+), 318 deletions(-) diff --git a/source/ada/lsp-ada_handlers-refactor-sort_dependencies.adb b/source/ada/lsp-ada_handlers-refactor-sort_dependencies.adb index bf60d45bd..39da88126 100644 --- a/source/ada/lsp-ada_handlers-refactor-sort_dependencies.adb +++ b/source/ada/lsp-ada_handlers-refactor-sort_dependencies.adb @@ -110,6 +110,7 @@ package body LSP.Ada_Handlers.Refactor.Sort_Dependencies is Next (C); end loop; + Next (C); end return; end Create; @@ -135,7 +136,6 @@ package body LSP.Ada_Handlers.Refactor.Sort_Dependencies is LSP.Ada_Handlers.Message_Handler (Handler.all); Context : LSP.Ada_Contexts.Context renames Message_Handler.Contexts.Get (Self.Context).all; - Analysis_Unit : constant Libadalang.Analysis.Analysis_Unit := Context.LAL_Context.Get_From_File (VSS.Strings.Conversions.To_UTF_8_String (Self.Where.uri)); @@ -149,7 +149,6 @@ package body LSP.Ada_Handlers.Refactor.Sort_Dependencies is Sorter : constant Dependencies_Sorter := Create_Dependencies_Sorter (Compilation_Unit); - begin Edits := Sorter.Refactor (null); end Refactor; diff --git a/source/lsp_3.17/lsp-structures-lspany_vectors.adb b/source/lsp_3.17/lsp-structures-lspany_vectors.adb index ab8f69335..670df2a0a 100644 --- a/source/lsp_3.17/lsp-structures-lspany_vectors.adb +++ b/source/lsp_3.17/lsp-structures-lspany_vectors.adb @@ -85,7 +85,6 @@ package body LSP.Structures.LSPAny_Vectors is end; Next (Cursor); end loop; - Next (Cursor); return Result; end From_Any; @@ -121,7 +120,6 @@ package body LSP.Structures.LSPAny_Vectors is end; Next (Cursor); end loop; - Next (Cursor); return Result; end From_Any; @@ -157,7 +155,6 @@ package body LSP.Structures.LSPAny_Vectors is end; Next (Cursor); end loop; - Next (Cursor); return Result; end From_Any; @@ -193,7 +190,6 @@ package body LSP.Structures.LSPAny_Vectors is end; Next (Cursor); end loop; - Next (Cursor); return Result; end From_Any; @@ -230,7 +226,6 @@ package body LSP.Structures.LSPAny_Vectors is Next (Cursor); end loop; - Next (Cursor); return Result; end From_Any; @@ -250,7 +245,6 @@ package body LSP.Structures.LSPAny_Vectors is Result.Append (Element (Cursor).String_Value); Next (Cursor); end loop; - Next (Cursor); return Result; end From_Any; @@ -282,6 +276,10 @@ package body LSP.Structures.LSPAny_Vectors is Next (Cursor); end loop; + + if Element (Cursor).Kind = Key_Name then + Previous (Cursor); + end if; end Skip_Value; ------------ diff --git a/testsuite/ada_lsp/S314-015.refactor_remove_parameter_0/test.json b/testsuite/ada_lsp/S314-015.refactor_remove_parameter_0/test.json index ac8331ae1..a7364c0fa 100644 --- a/testsuite/ada_lsp/S314-015.refactor_remove_parameter_0/test.json +++ b/testsuite/ada_lsp/S314-015.refactor_remove_parameter_0/test.json @@ -178,52 +178,18 @@ "result": { "capabilities": { "textDocumentSync": 2, - "completionProvider": { - "triggerCharacters": [ - ".", - ",", - "'", - "(" - ], - "resolveProvider": true - }, - "hoverProvider": true, - "declarationProvider": true, - "definitionProvider": true, - "typeDefinitionProvider": true, - "implementationProvider": true, - "referencesProvider": true, - "documentHighlightProvider": true, "codeActionProvider": { "codeActionKinds": [ "", "refactor.rewrite" ] }, - "documentFormattingProvider": true, - "renameProvider": { - "prepareProvider": true - }, - "foldingRangeProvider": true, "executeCommandProvider": { "commands": [ "", "als-refactor-remove-parameters" ] - }, - "workspaceSymbolProvider": true, - "callHierarchyProvider": {}, - "alsShowDepsProvider": true, - "alsReferenceKinds": [ - "reference", - "access", - "write", - "call", - "dispatching call", - "parent", - "child", - "overriding" - ] + } } } } @@ -264,7 +230,7 @@ "wait": [ { "jsonrpc": "2.0", - "id": 3, + "id": 1, "method": "window/workDoneProgress/create", "params": { "token": "" @@ -326,22 +292,20 @@ "command": { "title": "", "command": "als-refactor-remove-parameters", - "arguments": [ - { - "context": "Default", - "where": { - "textDocument": { - "uri": "$URI{main.adb}" - }, - "position": { - "line": 1, - "character": 14 - } + "arguments": { + "context": "default", + "where": { + "textDocument": { + "uri": "$URI{main.adb}" }, - "first_parameter": 1, - "last_parameter": 1 - } - ] + "position": { + "line": 1, + "character": 14 + } + }, + "first_parameter": 1, + "last_parameter": 1 + } } } ] @@ -357,22 +321,21 @@ "method": "workspace/executeCommand", "params": { "command": "als-refactor-remove-parameters", - "arguments": [ - { - "context": "Default", - "where": { - "textDocument": { - "uri": "$URI{main.adb}" - }, - "position": { - "line": 1, - "character": 14 - } + "arguments": + { + "context": "default", + "where": { + "textDocument": { + "uri": "$URI{main.adb}" }, - "first_parameter": 1, - "last_parameter": 1 - } - ] + "position": { + "line": 1, + "character": 14 + } + }, + "first_parameter": 1, + "last_parameter": 1 + } } }, "wait": [ @@ -547,22 +510,21 @@ "command": { "title": "", "command": "als-refactor-remove-parameters", - "arguments": [ - { - "context": "Default", - "where": { - "textDocument": { - "uri": "$URI{main.adb}" - }, - "position": { - "line": 1, - "character": 14 - } + "arguments": + { + "context": "Default", + "where": { + "textDocument": { + "uri": "$URI{main.adb}" }, - "first_parameter": 1, - "last_parameter": 1 - } - ] + "position": { + "line": 1, + "character": 14 + } + }, + "first_parameter": 1, + "last_parameter": 1 + } } } ] @@ -578,22 +540,21 @@ "method": "workspace/executeCommand", "params": { "command": "als-refactor-remove-parameters", - "arguments": [ - { - "context": "Default", - "where": { - "textDocument": { - "uri": "$URI{main.adb}" - }, - "position": { - "line": 1, - "character": 14 - } + "arguments": + { + "context": "Default", + "where": { + "textDocument": { + "uri": "$URI{main.adb}" }, - "first_parameter": 1, - "last_parameter": 1 - } - ] + "position": { + "line": 1, + "character": 14 + } + }, + "first_parameter": 1, + "last_parameter": 1 + } } }, "wait": [ @@ -886,22 +847,21 @@ "command": { "title": "", "command": "als-refactor-remove-parameters", - "arguments": [ - { - "context": "Default", - "where": { - "textDocument": { - "uri": "$URI{main.adb}" - }, - "position": { - "line": 1, - "character": 14 - } + "arguments": + { + "context": "Default", + "where": { + "textDocument": { + "uri": "$URI{main.adb}" }, - "first_parameter": 1, - "last_parameter": 1 - } - ] + "position": { + "line": 1, + "character": 14 + } + }, + "first_parameter": 1, + "last_parameter": 1 + } } } ] @@ -917,22 +877,21 @@ "method": "workspace/executeCommand", "params": { "command": "als-refactor-remove-parameters", - "arguments": [ - { - "context": "Default", - "where": { - "textDocument": { - "uri": "$URI{main.adb}" - }, - "position": { - "line": 1, - "character": 14 - } + "arguments": + { + "context": "Default", + "where": { + "textDocument": { + "uri": "$URI{main.adb}" }, - "first_parameter": 1, - "last_parameter": 1 - } - ] + "position": { + "line": 1, + "character": 14 + } + }, + "first_parameter": 1, + "last_parameter": 1 + } } }, "wait": [ diff --git a/testsuite/ada_lsp/U416-030.refactor_change_parameter_mode_0/test.json b/testsuite/ada_lsp/U416-030.refactor_change_parameter_mode_0/test.json index 7dad1c333..d4288370d 100644 --- a/testsuite/ada_lsp/U416-030.refactor_change_parameter_mode_0/test.json +++ b/testsuite/ada_lsp/U416-030.refactor_change_parameter_mode_0/test.json @@ -178,52 +178,18 @@ "result": { "capabilities": { "textDocumentSync": 2, - "completionProvider": { - "triggerCharacters": [ - ".", - ",", - "'", - "(" - ], - "resolveProvider": true - }, - "hoverProvider": true, - "declarationProvider": true, - "definitionProvider": true, - "typeDefinitionProvider": true, - "implementationProvider": true, - "referencesProvider": true, - "documentHighlightProvider": true, "codeActionProvider": { "codeActionKinds": [ "", "refactor.rewrite" ] }, - "documentFormattingProvider": true, - "renameProvider": { - "prepareProvider": true - }, - "foldingRangeProvider": true, "executeCommandProvider": { "commands": [ "", "als-refactor-change-parameter-mode" ] - }, - "workspaceSymbolProvider": true, - "callHierarchyProvider": {}, - "alsShowDepsProvider": true, - "alsReferenceKinds": [ - "reference", - "access", - "write", - "call", - "dispatching call", - "parent", - "child", - "overriding" - ] + } } } } @@ -264,7 +230,7 @@ "wait": [ { "jsonrpc": "2.0", - "id": 3, + "id": 1, "method": "window/workDoneProgress/create", "params": { "token": "" @@ -327,23 +293,22 @@ "command": { "title": "", "command": "als-refactor-change-parameter-mode", - "arguments": [ - { - "context": "Default", - "where": { - "textDocument": { - "uri": "$URI{main.adb}" - }, - "position": { - "line": 1, - "character": 14 - } + "arguments": + { + "context": "default", + "where": { + "textDocument": { + "uri": "$URI{main.adb}" }, - "first_parameter": 1, - "last_parameter": 2, - "new_mode": "in" - } - ] + "position": { + "line": 1, + "character": 14 + } + }, + "first_parameter": 1, + "last_parameter": 2, + "new_mode": "in" + } } }, { @@ -352,23 +317,22 @@ "command": { "title": "", "command": "als-refactor-change-parameter-mode", - "arguments": [ - { - "context": "Default", - "where": { - "textDocument": { - "uri": "$URI{main.adb}" - }, - "position": { - "line": 1, - "character": 14 - } + "arguments": + { + "context": "default", + "where": { + "textDocument": { + "uri": "$URI{main.adb}" }, - "first_parameter": 1, - "last_parameter": 2, - "new_mode": "out" - } - ] + "position": { + "line": 1, + "character": 14 + } + }, + "first_parameter": 1, + "last_parameter": 2, + "new_mode": "out" + } } }, { @@ -377,23 +341,22 @@ "command": { "title": "", "command": "als-refactor-change-parameter-mode", - "arguments": [ - { - "context": "Default", - "where": { - "textDocument": { - "uri": "$URI{main.adb}" - }, - "position": { - "line": 1, - "character": 14 - } + "arguments": + { + "context": "default", + "where": { + "textDocument": { + "uri": "$URI{main.adb}" }, - "first_parameter": 1, - "last_parameter": 2, - "new_mode": "in out" - } - ] + "position": { + "line": 1, + "character": 14 + } + }, + "first_parameter": 1, + "last_parameter": 2, + "new_mode": "in out" + } } } ] @@ -409,22 +372,21 @@ "method": "workspace/executeCommand", "params": { "command": "als-refactor-remove-parameters", - "arguments": [ - { - "context": "Default", - "where": { - "textDocument": { - "uri": "$URI{main.adb}" - }, - "position": { - "line": 1, - "character": 14 - } + "arguments": + { + "context": "default", + "where": { + "textDocument": { + "uri": "$URI{main.adb}" }, - "first_parameter": 1, - "last_parameter": 2 - } - ] + "position": { + "line": 1, + "character": 14 + } + }, + "first_parameter": 1, + "last_parameter": 2 + } } }, "wait": [ diff --git a/testsuite/ada_lsp/U416-030.refactor_change_parameter_mode_0/test.yaml b/testsuite/ada_lsp/U416-030.refactor_change_parameter_mode_0/test.yaml index eb490028b..737465a4a 100644 --- a/testsuite/ada_lsp/U416-030.refactor_change_parameter_mode_0/test.yaml +++ b/testsuite/ada_lsp/U416-030.refactor_change_parameter_mode_0/test.yaml @@ -1,4 +1,4 @@ -title: 'S314-015.refactor_change_parameter_mode_0' +title: 'U416-030.refactor_change_parameter_mode_0' # Skip till 3.17 ready skip: - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/refactoring_add_parameter/S314-015/test.yaml b/testsuite/ada_lsp/refactoring_add_parameter/S314-015/test.yaml index f43843768..02a7aa171 100644 --- a/testsuite/ada_lsp/refactoring_add_parameter/S314-015/test.yaml +++ b/testsuite/ada_lsp/refactoring_add_parameter/S314-015/test.yaml @@ -3,6 +3,3 @@ title: 'refactoring_add_parameters_S314-015_0' description: > Check that the Add_Parameter codeAction is not available if the client does not provide the userInputProvider capability. -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/refactoring_add_parameter/UA25-015/test.yaml b/testsuite/ada_lsp/refactoring_add_parameter/UA25-015/test.yaml index 048c442b7..15420ab5f 100644 --- a/testsuite/ada_lsp/refactoring_add_parameter/UA25-015/test.yaml +++ b/testsuite/ada_lsp/refactoring_add_parameter/UA25-015/test.yaml @@ -4,6 +4,3 @@ description: > Check that the Add_Parameter codeAction is avaiable when the client provides the userInputProvider capability, and that it executes correctly. -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/refactoring_pull_up_declaration/V207-019/test.json b/testsuite/ada_lsp/refactoring_pull_up_declaration/V207-019/test.json index a01e8e388..7b7097ba9 100644 --- a/testsuite/ada_lsp/refactoring_pull_up_declaration/V207-019/test.json +++ b/testsuite/ada_lsp/refactoring_pull_up_declaration/V207-019/test.json @@ -43,7 +43,6 @@ "codeActionLiteralSupport": { "codeActionKind": { "valueSet": [ - "", "refactor", "refactor.extract", "refactor.inline", @@ -78,8 +77,7 @@ "", "als-refactor-extract-subprogram" ] - }, - "alsCheckSyntaxProvider": true + } } } } @@ -120,7 +118,7 @@ "wait": [ { "jsonrpc": "2.0", - "id": 2, + "id": 1, "method": "window/workDoneProgress/create", "params": { "token": "" @@ -182,24 +180,22 @@ "command": { "title": "", "command": "als-refactor-pull_up_declaration", - "arguments": [ - { - "context": "Default", - "where": { - "uri": "$URI{main.adb}", - "range": { - "start": { - "line": 3, - "character": 16 - }, - "end": { - "line": 3, - "character": 16 - } - } - } - } - ] + "arguments": { + "context": "Default", + "where": { + "uri": "$URI{main.adb}", + "range": { + "start": { + "line": 3, + "character": 16 + }, + "end": { + "line": 3, + "character": 16 + } + } + } + } } } ] @@ -215,24 +211,22 @@ "method": "workspace/executeCommand", "params": { "command": "als-refactor-pull_up_declaration", - "arguments": [ - { - "context": "Default", - "where": { - "uri": "$URI{main.adb}", - "range": { - "start": { - "line": 3, - "character": 16 - }, - "end": { - "line": 3, - "character": 16 - } - } - } - } - ] + "arguments": { + "context": "Default", + "where": { + "uri": "$URI{main.adb}", + "range": { + "start": { + "line": 3, + "character": 16 + }, + "end": { + "line": 3, + "character": 16 + } + } + } + } } }, "wait": [ diff --git a/testsuite/ada_lsp/refactoring_sort_dependencies/SA22-035/test.json b/testsuite/ada_lsp/refactoring_sort_dependencies/SA22-035/test.json index 33db00b27..c997449f2 100644 --- a/testsuite/ada_lsp/refactoring_sort_dependencies/SA22-035/test.json +++ b/testsuite/ada_lsp/refactoring_sort_dependencies/SA22-035/test.json @@ -43,7 +43,6 @@ "codeActionLiteralSupport": { "codeActionKind": { "valueSet": [ - "", "refactor", "refactor.extract", "refactor.inline", @@ -110,7 +109,7 @@ "wait": [ { "jsonrpc": "2.0", - "id": 2, + "id": 1, "method": "window/workDoneProgress/create", "params": { "token": "" @@ -182,24 +181,22 @@ "command": { "title": "", "command": "als-refactor-sort_dependencies", - "arguments": [ - { - "context": "Default", - "where": { - "uri": "$URI{main_package.ads}", - "range": { - "start": { - "line": 3, - "character": 15 - }, - "end": { - "line": 3, - "character": 15 - } - } - } - } - ] + "arguments": { + "context": "Default", + "where": { + "uri": "$URI{main_package.ads}", + "range": { + "start": { + "line": 3, + "character": 15 + }, + "end": { + "line": 3, + "character": 15 + } + } + } + } } } ] @@ -215,24 +212,22 @@ "method": "workspace/executeCommand", "params": { "command": "als-refactor-sort_dependencies", - "arguments": [ - { - "context": "Default", - "where": { - "uri": "$URI{main_package.ads}", - "range": { - "start": { - "line": 3, - "character": 15 - }, - "end": { - "line": 3, - "character": 15 - } + "arguments": { + "context": "Default", + "where": { + "uri": "$URI{main_package.ads}", + "range": { + "start": { + "line": 3, + "character": 15 + }, + "end": { + "line": 3, + "character": 15 } } } - ] + } } }, "wait": [ diff --git a/testsuite/ada_lsp/refactoring_sort_dependencies/SA22-035/test.yaml b/testsuite/ada_lsp/refactoring_sort_dependencies/SA22-035/test.yaml index 56e907375..ba299842b 100644 --- a/testsuite/ada_lsp/refactoring_sort_dependencies/SA22-035/test.yaml +++ b/testsuite/ada_lsp/refactoring_sort_dependencies/SA22-035/test.yaml @@ -1,4 +1 @@ title: 'refactoring_sort_dependencies/SA22-035' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] From 2bdff6461008c8f7e1f03eb07d041ebc0b2a91dd Mon Sep 17 00:00:00 2001 From: Andry Ogorodnik Date: Thu, 31 Aug 2023 19:21:30 +0300 Subject: [PATCH 080/152] Test --- .../ada_lsp/refactoring_add_parameter/S314-015/test.yaml | 5 ++++- .../ada_lsp/refactoring_add_parameter/UA25-015/test.yaml | 5 ++++- .../ada_lsp/refactoring_sort_dependencies/SA22-035/test.yaml | 3 +++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/testsuite/ada_lsp/refactoring_add_parameter/S314-015/test.yaml b/testsuite/ada_lsp/refactoring_add_parameter/S314-015/test.yaml index 02a7aa171..db4d80eef 100644 --- a/testsuite/ada_lsp/refactoring_add_parameter/S314-015/test.yaml +++ b/testsuite/ada_lsp/refactoring_add_parameter/S314-015/test.yaml @@ -1,5 +1,8 @@ -title: 'refactoring_add_parameters_S314-015_0' +title: 'refactoring_add_parameters_S314-015' description: > Check that the Add_Parameter codeAction is not available if the client does not provide the userInputProvider capability. +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/refactoring_add_parameter/UA25-015/test.yaml b/testsuite/ada_lsp/refactoring_add_parameter/UA25-015/test.yaml index 15420ab5f..773f6b338 100644 --- a/testsuite/ada_lsp/refactoring_add_parameter/UA25-015/test.yaml +++ b/testsuite/ada_lsp/refactoring_add_parameter/UA25-015/test.yaml @@ -1,6 +1,9 @@ -title: 'refactoring_add_parameters_UA25-015_0' +title: 'refactoring_add_parameters_UA25-015' description: > Check that the Add_Parameter codeAction is avaiable when the client provides the userInputProvider capability, and that it executes correctly. +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/refactoring_sort_dependencies/SA22-035/test.yaml b/testsuite/ada_lsp/refactoring_sort_dependencies/SA22-035/test.yaml index ba299842b..56e907375 100644 --- a/testsuite/ada_lsp/refactoring_sort_dependencies/SA22-035/test.yaml +++ b/testsuite/ada_lsp/refactoring_sort_dependencies/SA22-035/test.yaml @@ -1 +1,4 @@ title: 'refactoring_sort_dependencies/SA22-035' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] From 7764a906c4d727249af7611e45ff380f3d2c57a0 Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Fri, 1 Sep 2023 16:57:00 +0300 Subject: [PATCH 081/152] Fix to/from URI convertion in refactoring code. Refs #1170 --- .../ada/lsp-ada_handlers-refactor-pull_up_declaration.adb | 6 ++++-- source/ada/lsp-ada_handlers.adb | 5 ++--- .../refactoring_pull_up_declaration/V207-019/test.yaml | 3 --- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/source/ada/lsp-ada_handlers-refactor-pull_up_declaration.adb b/source/ada/lsp-ada_handlers-refactor-pull_up_declaration.adb index fa473627c..fb5f6a4fc 100644 --- a/source/ada/lsp-ada_handlers-refactor-pull_up_declaration.adb +++ b/source/ada/lsp-ada_handlers-refactor-pull_up_declaration.adb @@ -134,9 +134,11 @@ package body LSP.Ada_Handlers.Refactor.Pull_Up_Declaration is Context : LSP.Ada_Contexts.Context renames Message_Handler.Contexts.Get (Self.Context).all; + File : constant GNATCOLL.VFS.Virtual_File := + Message_Handler.To_File (Self.Where.uri); + Unit : constant Analysis_Unit := - Context.LAL_Context.Get_From_File - (VSS.Strings.Conversions.To_UTF_8_String (Self.Where.uri)); + Context.LAL_Context.Get_From_File (File.Display_Full_Name); Declaration_SLOC : constant Source_Location := (Langkit_Support.Slocs.Line_Number diff --git a/source/ada/lsp-ada_handlers.adb b/source/ada/lsp-ada_handlers.adb index 9cbc5ef12..f6cdd0826 100644 --- a/source/ada/lsp-ada_handlers.adb +++ b/source/ada/lsp-ada_handlers.adb @@ -4145,9 +4145,8 @@ package body LSP.Ada_Handlers is Text_Edits.Append (To_TextEdit (Edit)); end loop; - File_URI := To_DocumentUri - (VSS.Strings.Conversions.To_Virtual_String - (Text_Edit_Ordered_Maps.Key (Text_Edits_Cursor))); + File_URI := + Self.To_URI (Text_Edit_Ordered_Maps.Key (Text_Edits_Cursor)); -- If `workspace.workspaceEdit.documentChanges` client capability -- was true, then use `TextDocumentEdit[]` instead of diff --git a/testsuite/ada_lsp/refactoring_pull_up_declaration/V207-019/test.yaml b/testsuite/ada_lsp/refactoring_pull_up_declaration/V207-019/test.yaml index cf84bdcef..04e2109cf 100644 --- a/testsuite/ada_lsp/refactoring_pull_up_declaration/V207-019/test.yaml +++ b/testsuite/ada_lsp/refactoring_pull_up_declaration/V207-019/test.yaml @@ -1,4 +1 @@ title: 'refactoring_pull_up_declaration/V207-019' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] From 89558ddd2c7f006d63683aca4865c7d6923d48ab Mon Sep 17 00:00:00 2001 From: Andry Ogorodnik Date: Mon, 4 Sep 2023 18:42:35 +0000 Subject: [PATCH 082/152] Enable tests --- source/ada/lsp-utils.adb | 4 +- .../test.json | 159 ++++++--------- .../test.yaml | 3 - .../test.json | 180 +++++++---------- .../test.yaml | 3 - .../test.json | 17 +- .../test.yaml | 3 - .../TB12-017.named.parameters.2.json | 38 +--- .../TB12-017.named.parameters.2/test.yaml | 3 - .../test.yaml | 3 - .../S314-015/test.json | 6 +- .../S314-015/test.yaml | 2 +- .../UA25-015/test.json | 42 ++-- .../UA25-015/test.yaml | 2 +- .../S314-015/test.json | 17 +- .../S314-015/test.json | 94 +++++---- .../SA11-047_0/test.json | 2 +- .../test.json | 98 +++++----- .../test.yaml | 5 +- .../refactor_imports_commands.json | 185 +++++++----------- .../test.yaml | 5 +- .../SA11-051/test.json | 71 ++++--- .../SA11-051/test.yaml | 3 - .../Q817-007/test.yaml | 2 +- 24 files changed, 370 insertions(+), 577 deletions(-) diff --git a/source/ada/lsp-utils.adb b/source/ada/lsp-utils.adb index fea1fefc7..b296e62a8 100644 --- a/source/ada/lsp-utils.adb +++ b/source/ada/lsp-utils.adb @@ -38,6 +38,7 @@ with Laltools.Common; with LSP.Ada_Documents; with LSP.Constants; +with URIs; package body LSP.Utils is @@ -408,7 +409,8 @@ package body LSP.Utils is return (uri => (VSS.Strings.Conversions.To_Virtual_String - (Unit.Get_Filename) with null record), + (URIs.Conversions.From_File (Unit.Get_Filename)) + with null record), a_range => To_Range (Span)); end Get_Location; diff --git a/testsuite/ada_lsp/S314-015.refactor_change_parameter_mode_0/test.json b/testsuite/ada_lsp/S314-015.refactor_change_parameter_mode_0/test.json index b61e314a5..c312fe152 100644 --- a/testsuite/ada_lsp/S314-015.refactor_change_parameter_mode_0/test.json +++ b/testsuite/ada_lsp/S314-015.refactor_change_parameter_mode_0/test.json @@ -178,52 +178,21 @@ "result": { "capabilities": { "textDocumentSync": 2, - "completionProvider": { - "triggerCharacters": [ - ".", - ",", - "'", - "(" - ], - "resolveProvider": true - }, - "hoverProvider": true, - "declarationProvider": true, - "definitionProvider": true, - "typeDefinitionProvider": true, - "implementationProvider": true, - "referencesProvider": true, - "documentHighlightProvider": true, "codeActionProvider": { "codeActionKinds": [ - "", + "", "refactor.rewrite" ] }, - "documentFormattingProvider": true, "renameProvider": { "prepareProvider": true }, - "foldingRangeProvider": true, "executeCommandProvider": { "commands": [ "", "als-refactor-change-parameter-mode" ] - }, - "workspaceSymbolProvider": true, - "callHierarchyProvider": {}, - "alsShowDepsProvider": true, - "alsReferenceKinds": [ - "reference", - "access", - "write", - "call", - "dispatching call", - "parent", - "child", - "overriding" - ] + } } } } @@ -264,7 +233,7 @@ "wait": [ { "jsonrpc": "2.0", - "id": 3, + "id": 1, "method": "window/workDoneProgress/create", "params": { "token": "" @@ -326,23 +295,21 @@ "command": { "title": "", "command": "als-refactor-change-parameter-mode", - "arguments": [ - { - "context": "Default", - "where": { - "textDocument": { - "uri": "$URI{main.adb}" - }, - "position": { - "line": 1, - "character": 14 - } + "arguments": { + "context": "default", + "where": { + "textDocument": { + "uri": "$URI{main.adb}" }, - "first_parameter": 1, - "last_parameter": 1, - "new_mode": "in" - } - ] + "position": { + "line": 1, + "character": 14 + } + }, + "first_parameter": 1, + "last_parameter": 1, + "new_mode": "in" + } } }, { @@ -351,23 +318,21 @@ "command": { "title": "", "command": "als-refactor-change-parameter-mode", - "arguments": [ - { - "context": "Default", - "where": { - "textDocument": { - "uri": "$URI{main.adb}" - }, - "position": { - "line": 1, - "character": 14 - } + "arguments": { + "context": "default", + "where": { + "textDocument": { + "uri": "$URI{main.adb}" }, - "first_parameter": 1, - "last_parameter": 1, - "new_mode": "out" - } - ] + "position": { + "line": 1, + "character": 14 + } + }, + "first_parameter": 1, + "last_parameter": 1, + "new_mode": "out" + } } }, { @@ -376,23 +341,21 @@ "command": { "title": "", "command": "als-refactor-change-parameter-mode", - "arguments": [ - { - "context": "Default", - "where": { - "textDocument": { - "uri": "$URI{main.adb}" - }, - "position": { - "line": 1, - "character": 14 - } + "arguments": { + "context": "default", + "where": { + "textDocument": { + "uri": "$URI{main.adb}" }, - "first_parameter": 1, - "last_parameter": 1, - "new_mode": "in out" - } - ] + "position": { + "line": 1, + "character": 14 + } + }, + "first_parameter": 1, + "last_parameter": 1, + "new_mode": "in out" + } } } ] @@ -408,28 +371,26 @@ "method": "workspace/executeCommand", "params": { "command": "als-refactor-change-parameter-mode", - "arguments": [ - { - "context": "Default", - "where": { - "textDocument": { - "uri": "$URI{main.adb}" - }, - "position": { - "line": 1, - "character": 14 - } + "arguments": { + "context": "default", + "where": { + "textDocument": { + "uri": "$URI{main.adb}" }, - "first_parameter": 1, - "last_parameter": 1, - "new_mode": "in" - } - ] + "position": { + "line": 1, + "character": 14 + } + }, + "first_parameter": 1, + "last_parameter": 1, + "new_mode": "in" + } } }, "wait": [ { - "id": 4, + "id": 7, "method": "workspace/applyEdit", "params": { "edit": { diff --git a/testsuite/ada_lsp/S314-015.refactor_change_parameter_mode_0/test.yaml b/testsuite/ada_lsp/S314-015.refactor_change_parameter_mode_0/test.yaml index eb490028b..e9688a1ce 100644 --- a/testsuite/ada_lsp/S314-015.refactor_change_parameter_mode_0/test.yaml +++ b/testsuite/ada_lsp/S314-015.refactor_change_parameter_mode_0/test.yaml @@ -1,4 +1 @@ title: 'S314-015.refactor_change_parameter_mode_0' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/S314-015.refactor_move_parameter_0/test.json b/testsuite/ada_lsp/S314-015.refactor_move_parameter_0/test.json index 41f8affe2..d9ccd016e 100644 --- a/testsuite/ada_lsp/S314-015.refactor_move_parameter_0/test.json +++ b/testsuite/ada_lsp/S314-015.refactor_move_parameter_0/test.json @@ -178,22 +178,6 @@ "result": { "capabilities": { "textDocumentSync": 2, - "completionProvider": { - "triggerCharacters": [ - ".", - ",", - "'", - "(" - ], - "resolveProvider": true - }, - "hoverProvider": true, - "declarationProvider": true, - "definitionProvider": true, - "typeDefinitionProvider": true, - "implementationProvider": true, - "referencesProvider": true, - "documentHighlightProvider": true, "codeActionProvider": { "codeActionKinds": [ "", @@ -204,26 +188,12 @@ "renameProvider": { "prepareProvider": true }, - "foldingRangeProvider": true, "executeCommandProvider": { "commands": [ "", "als-refactor-move-parameter" ] - }, - "workspaceSymbolProvider": true, - "callHierarchyProvider": {}, - "alsShowDepsProvider": true, - "alsReferenceKinds": [ - "reference", - "access", - "write", - "call", - "dispatching call", - "parent", - "child", - "overriding" - ] + } } } } @@ -264,7 +234,7 @@ "wait": [ { "jsonrpc": "2.0", - "id": 3, + "id": 1, "method": "window/workDoneProgress/create", "params": { "token": "" @@ -326,22 +296,20 @@ "command": { "title": "", "command": "als-refactor-move-parameter", - "arguments": [ - { - "context": "Default", - "where": { - "textDocument": { - "uri": "$URI{main.adb}" - }, - "position": { - "line": 1, - "character": 14 - } + "arguments": { + "context": "default", + "where": { + "textDocument": { + "uri": "$URI{main.adb}" }, - "parameter_index": 1, - "direction": "forward" - } - ] + "position": { + "line": 1, + "character": 14 + } + }, + "parameter_index": 1, + "direction": "forward" + } } } ] @@ -357,27 +325,25 @@ "method": "workspace/executeCommand", "params": { "command": "als-refactor-move-parameter", - "arguments": [ - { - "context": "Default", - "where": { - "textDocument": { - "uri": "$URI{main.adb}" - }, - "position": { - "line": 1, - "character": 14 - } + "arguments": { + "context": "default", + "where": { + "textDocument": { + "uri": "$URI{main.adb}" }, - "parameter_index": 1, - "direction": "forward" - } - ] + "position": { + "line": 1, + "character": 14 + } + }, + "parameter_index": 1, + "direction": "forward" + } } }, "wait": [ { - "id": 4, + "id": 6, "method": "workspace/applyEdit", "params": { "edit": { @@ -612,22 +578,20 @@ "command": { "title": "", "command": "als-refactor-move-parameter", - "arguments": [ - { - "context": "Default", - "where": { - "textDocument": { - "uri": "$URI{main.adb}" - }, - "position": { - "line": 1, - "character": 14 - } + "arguments": { + "context": "default", + "where": { + "textDocument": { + "uri": "$URI{main.adb}" }, - "parameter_index": 2, - "direction": "backward" - } - ] + "position": { + "line": 1, + "character": 14 + } + }, + "parameter_index": 2, + "direction": "backward" + } } }, { @@ -636,22 +600,20 @@ "command": { "title": "", "command": "als-refactor-move-parameter", - "arguments": [ - { - "context": "Default", - "where": { - "textDocument": { - "uri": "$URI{main.adb}" - }, - "position": { - "line": 1, - "character": 14 - } + "arguments": { + "context": "default", + "where": { + "textDocument": { + "uri": "$URI{main.adb}" }, - "parameter_index": 2, - "direction": "forward" - } - ] + "position": { + "line": 1, + "character": 14 + } + }, + "parameter_index": 2, + "direction": "forward" + } } } ] @@ -667,27 +629,25 @@ "method": "workspace/executeCommand", "params": { "command": "als-refactor-move-parameter", - "arguments": [ - { - "context": "Default", - "where": { - "textDocument": { - "uri": "$URI{main.adb}" - }, - "position": { - "line": 1, - "character": 14 - } + "arguments": { + "context": "default", + "where": { + "textDocument": { + "uri": "$URI{main.adb}" }, - "parameter_index": 2, - "direction": "backward" - } - ] + "position": { + "line": 1, + "character": 14 + } + }, + "parameter_index": 2, + "direction": "backward" + } } }, "wait": [ { - "id": 5, + "id": 15, "method": "workspace/applyEdit", "params": { "edit": { @@ -805,4 +765,4 @@ "exit_code": 0 } } -] \ No newline at end of file +] diff --git a/testsuite/ada_lsp/S314-015.refactor_move_parameter_0/test.yaml b/testsuite/ada_lsp/S314-015.refactor_move_parameter_0/test.yaml index 02219d674..7f3f98bf5 100644 --- a/testsuite/ada_lsp/S314-015.refactor_move_parameter_0/test.yaml +++ b/testsuite/ada_lsp/S314-015.refactor_move_parameter_0/test.yaml @@ -1,4 +1 @@ title: 'S314-015.refactor_move_parameter_0' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/S314-015.refactor_remove_parameter_0/test.json b/testsuite/ada_lsp/S314-015.refactor_remove_parameter_0/test.json index a7364c0fa..13773fec4 100644 --- a/testsuite/ada_lsp/S314-015.refactor_remove_parameter_0/test.json +++ b/testsuite/ada_lsp/S314-015.refactor_remove_parameter_0/test.json @@ -340,7 +340,7 @@ }, "wait": [ { - "id": 4, + "id": 6, "method": "workspace/applyEdit", "params": { "edit": { @@ -510,9 +510,8 @@ "command": { "title": "", "command": "als-refactor-remove-parameters", - "arguments": - { - "context": "Default", + "arguments": { + "context": "default", "where": { "textDocument": { "uri": "$URI{main.adb}" @@ -542,7 +541,7 @@ "command": "als-refactor-remove-parameters", "arguments": { - "context": "Default", + "context": "default", "where": { "textDocument": { "uri": "$URI{main.adb}" @@ -559,7 +558,7 @@ }, "wait": [ { - "id": 5, + "id": 11, "method": "workspace/applyEdit", "params": { "edit": { @@ -849,7 +848,7 @@ "command": "als-refactor-remove-parameters", "arguments": { - "context": "Default", + "context": "default", "where": { "textDocument": { "uri": "$URI{main.adb}" @@ -879,7 +878,7 @@ "command": "als-refactor-remove-parameters", "arguments": { - "context": "Default", + "context": "default", "where": { "textDocument": { "uri": "$URI{main.adb}" @@ -896,7 +895,7 @@ }, "wait": [ { - "id": 6, + "id": 21, "method": "workspace/applyEdit", "params": { "edit": { diff --git a/testsuite/ada_lsp/S314-015.refactor_remove_parameter_0/test.yaml b/testsuite/ada_lsp/S314-015.refactor_remove_parameter_0/test.yaml index 452762ac8..3fae18358 100644 --- a/testsuite/ada_lsp/S314-015.refactor_remove_parameter_0/test.yaml +++ b/testsuite/ada_lsp/S314-015.refactor_remove_parameter_0/test.yaml @@ -1,4 +1 @@ title: 'S314-015.refactor_remove_parameter_0' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/TB12-017.named.parameters.2/TB12-017.named.parameters.2.json b/testsuite/ada_lsp/TB12-017.named.parameters.2/TB12-017.named.parameters.2.json index c34070d6c..1b79e4ab2 100644 --- a/testsuite/ada_lsp/TB12-017.named.parameters.2/TB12-017.named.parameters.2.json +++ b/testsuite/ada_lsp/TB12-017.named.parameters.2/TB12-017.named.parameters.2.json @@ -78,44 +78,12 @@ "result": { "capabilities": { "textDocumentSync": 2, - "completionProvider": { - "triggerCharacters": [ - ".", - ",", - "'", - "(" - ], - "resolveProvider": true - }, - "hoverProvider": true, - "declarationProvider": true, - "definitionProvider": true, - "typeDefinitionProvider": true, - "implementationProvider": true, - "referencesProvider": true, - "codeActionProvider": {}, - "documentFormattingProvider": true, - "renameProvider": {}, - "foldingRangeProvider": true, "executeCommandProvider": { "commands": [ "", "als-named-parameters" ] - }, - "workspaceSymbolProvider": true, - "callHierarchyProvider": {}, - "alsShowDepsProvider": true, - "alsReferenceKinds": [ - "reference", - "access", - "write", - "call", - "dispatching call", - "parent", - "child", - "overriding" - ] + } } } } @@ -149,7 +117,7 @@ "wait": [ { "jsonrpc": "2.0", - "id": 2, + "id": 1, "method": "window/workDoneProgress/create", "params": { "token": "" @@ -238,7 +206,7 @@ { "jsonrpc": "2.0", "id": "ada-3", - "result": [] + "result": null } ] } diff --git a/testsuite/ada_lsp/TB12-017.named.parameters.2/test.yaml b/testsuite/ada_lsp/TB12-017.named.parameters.2/test.yaml index a4ce3e0d7..b23876f0c 100644 --- a/testsuite/ada_lsp/TB12-017.named.parameters.2/test.yaml +++ b/testsuite/ada_lsp/TB12-017.named.parameters.2/test.yaml @@ -1,4 +1 @@ title: 'TB12-017.named.parameters.2' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/U416-030.refactor_change_parameter_mode_0/test.yaml b/testsuite/ada_lsp/U416-030.refactor_change_parameter_mode_0/test.yaml index 737465a4a..4de2fff5f 100644 --- a/testsuite/ada_lsp/U416-030.refactor_change_parameter_mode_0/test.yaml +++ b/testsuite/ada_lsp/U416-030.refactor_change_parameter_mode_0/test.yaml @@ -1,4 +1 @@ title: 'U416-030.refactor_change_parameter_mode_0' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/refactoring_add_parameter/S314-015/test.json b/testsuite/ada_lsp/refactoring_add_parameter/S314-015/test.json index a6f248479..7abe56074 100644 --- a/testsuite/ada_lsp/refactoring_add_parameter/S314-015/test.json +++ b/testsuite/ada_lsp/refactoring_add_parameter/S314-015/test.json @@ -38,7 +38,6 @@ "codeActionLiteralSupport": { "codeActionKind": { "valueSet": [ - "", "refactor", "refactor.extract", "refactor.inline", @@ -68,8 +67,7 @@ "", "als-refactor-add-parameters" ] - }, - "alsCheckSyntaxProvider": true + } } } } @@ -110,7 +108,7 @@ "wait": [ { "jsonrpc": "2.0", - "id": 2, + "id": 1, "method": "window/workDoneProgress/create", "params": { "token": "" diff --git a/testsuite/ada_lsp/refactoring_add_parameter/S314-015/test.yaml b/testsuite/ada_lsp/refactoring_add_parameter/S314-015/test.yaml index db4d80eef..39954cb17 100644 --- a/testsuite/ada_lsp/refactoring_add_parameter/S314-015/test.yaml +++ b/testsuite/ada_lsp/refactoring_add_parameter/S314-015/test.yaml @@ -1,4 +1,4 @@ -title: 'refactoring_add_parameters_S314-015' +title: 'refactoring_add_parameter/S314-015' description: > Check that the Add_Parameter codeAction is not available if the client diff --git a/testsuite/ada_lsp/refactoring_add_parameter/UA25-015/test.json b/testsuite/ada_lsp/refactoring_add_parameter/UA25-015/test.json index 438d1dbc3..e3cea10cb 100644 --- a/testsuite/ada_lsp/refactoring_add_parameter/UA25-015/test.json +++ b/testsuite/ada_lsp/refactoring_add_parameter/UA25-015/test.json @@ -38,7 +38,6 @@ "codeActionLiteralSupport": { "codeActionKind": { "valueSet": [ - "", "refactor", "refactor.extract", "refactor.inline", @@ -73,8 +72,7 @@ "", "als-refactor-add-parameters" ] - }, - "alsCheckSyntaxProvider": true + } } } } @@ -115,7 +113,7 @@ "wait": [ { "jsonrpc": "2.0", - "id": 2, + "id": 1, "method": "window/workDoneProgress/create", "params": { "token": "" @@ -178,26 +176,24 @@ "command": { "title": "", "command": "als-refactor-add-parameters", - "arguments": [ - { - "context_id": "Default", - "where": { - "uri": "$URI{main.adb}", - "range": { - "start": { - "line": 1, - "character": 18 - }, - "end": { - "line": 1, - "character": 18 - } + "arguments": { + "context_id": "Default", + "where": { + "uri": "$URI{main.adb}", + "range": { + "start": { + "line": 1, + "character": 18 + }, + "end": { + "line": 1, + "character": 18 } - }, - "newParameter": "", - "requiresFullSpecification": false - } - ] + } + }, + "newParameter": "", + "requiresFullSpecification": false + } } } ] diff --git a/testsuite/ada_lsp/refactoring_add_parameter/UA25-015/test.yaml b/testsuite/ada_lsp/refactoring_add_parameter/UA25-015/test.yaml index 773f6b338..34b5eb0fc 100644 --- a/testsuite/ada_lsp/refactoring_add_parameter/UA25-015/test.yaml +++ b/testsuite/ada_lsp/refactoring_add_parameter/UA25-015/test.yaml @@ -1,4 +1,4 @@ -title: 'refactoring_add_parameters_UA25-015' +title: 'refactoring_add_parameter/UA25-015' description: > Check that the Add_Parameter codeAction is avaiable when the client diff --git a/testsuite/ada_lsp/refactoring_change_parameters_default_values/S314-015/test.json b/testsuite/ada_lsp/refactoring_change_parameters_default_values/S314-015/test.json index af8e6f99f..2801c2885 100644 --- a/testsuite/ada_lsp/refactoring_change_parameters_default_values/S314-015/test.json +++ b/testsuite/ada_lsp/refactoring_change_parameters_default_values/S314-015/test.json @@ -43,7 +43,6 @@ "codeActionLiteralSupport": { "codeActionKind": { "valueSet": [ - "", "refactor", "refactor.extract", "refactor.inline", @@ -55,7 +54,6 @@ }, "experimental": { "advanced_refactorings": [ - "", "change_parameters_default_value" ] } @@ -79,8 +77,7 @@ "", "als-refactor-change_parameters_default_value" ] - }, - "alsCheckSyntaxProvider": true + } } } } @@ -121,7 +118,7 @@ "wait": [ { "jsonrpc": "2.0", - "id": 2, + "id": 1, "method": "window/workDoneProgress/create", "params": { "token": "" @@ -184,8 +181,7 @@ "command": { "title": "", "command": "als-refactor-change_parameters_default_value", - "arguments": [ - { + "arguments": { "context": "Default", "where": { "uri": "$URI{main.adb}", @@ -202,7 +198,6 @@ }, "newParametersDefaultValue": "" } - ] } } ] @@ -218,8 +213,7 @@ "method": "workspace/executeCommand", "params": { "command": "als-refactor-change_parameters_default_value", - "arguments": [ - { + "arguments": { "context": "Default", "where": { "uri": "$URI{main.adb}", @@ -236,7 +230,6 @@ }, "newParametersDefaultValue": "False" } - ] } }, "wait": [ @@ -308,4 +301,4 @@ "exit_code": 0 } } -] \ No newline at end of file +] diff --git a/testsuite/ada_lsp/refactoring_change_parameters_type/S314-015/test.json b/testsuite/ada_lsp/refactoring_change_parameters_type/S314-015/test.json index 3c01fd28d..a76ad64f7 100644 --- a/testsuite/ada_lsp/refactoring_change_parameters_type/S314-015/test.json +++ b/testsuite/ada_lsp/refactoring_change_parameters_type/S314-015/test.json @@ -43,7 +43,6 @@ "codeActionLiteralSupport": { "codeActionKind": { "valueSet": [ - "", "refactor", "refactor.extract", "refactor.inline", @@ -78,8 +77,7 @@ "", "als-refactor-change_parameters_type" ] - }, - "alsCheckSyntaxProvider": true + } } } } @@ -120,7 +118,7 @@ "wait": [ { "jsonrpc": "2.0", - "id": 2, + "id": 1, "method": "window/workDoneProgress/create", "params": { "token": "" @@ -183,29 +181,27 @@ "command": { "title": "", "command": "als-refactor-change_parameters_type", - "arguments": [ - { - "context": "Default", - "where": { - "uri": "$URI{main.adb}", - "range": { - "start": { - "line": 1, - "character": 18 - }, - "end": { - "line": 1, - "character": 22 - } - } - }, - "newParametersType": "", - "syntaxRules": [ - "SUBTYPE_INDICATION_RULE", - "ANONYMOUS_TYPE_RULE" - ] - } - ] + "arguments": { + "context": "Default", + "where": { + "uri": "$URI{main.adb}", + "range": { + "start": { + "line": 1, + "character": 18 + }, + "end": { + "line": 1, + "character": 22 + } + } + }, + "newParametersType": "", + "syntaxRules": [ + "SUBTYPE_INDICATION_RULE", + "ANONYMOUS_TYPE_RULE" + ] + } } } ] @@ -221,29 +217,27 @@ "method": "workspace/executeCommand", "params": { "command": "als-refactor-change_parameters_type", - "arguments": [ - { - "context": "Default", - "where": { - "uri": "$URI{main.adb}", - "range": { - "start": { - "line": 1, - "character": 18 - }, - "end": { - "line": 1, - "character": 22 - } - } - }, - "newParametersType": "Integer", - "syntaxRules": [ - "SUBTYPE_INDICATION_RULE", - "ANONYMOUS_TYPE_RULE" - ] - } - ] + "arguments": { + "context": "Default", + "where": { + "uri": "$URI{main.adb}", + "range": { + "start": { + "line": 1, + "character": 18 + }, + "end": { + "line": 1, + "character": 22 + } + } + }, + "newParametersType": "Integer", + "syntaxRules": [ + "SUBTYPE_INDICATION_RULE", + "ANONYMOUS_TYPE_RULE" + ] + } } }, "wait": [ diff --git a/testsuite/ada_lsp/refactoring_extract_subprogram/SA11-047_0/test.json b/testsuite/ada_lsp/refactoring_extract_subprogram/SA11-047_0/test.json index 22ca14507..9a585c5b6 100644 --- a/testsuite/ada_lsp/refactoring_extract_subprogram/SA11-047_0/test.json +++ b/testsuite/ada_lsp/refactoring_extract_subprogram/SA11-047_0/test.json @@ -304,4 +304,4 @@ "exit_code": 0 } } -] \ No newline at end of file +] diff --git a/testsuite/ada_lsp/refactoring_imports_commands/U511-009.refactoring.import_with_use/test.json b/testsuite/ada_lsp/refactoring_imports_commands/U511-009.refactoring.import_with_use/test.json index e96afe68b..a936bec49 100644 --- a/testsuite/ada_lsp/refactoring_imports_commands/U511-009.refactoring.import_with_use/test.json +++ b/testsuite/ada_lsp/refactoring_imports_commands/U511-009.refactoring.import_with_use/test.json @@ -86,7 +86,7 @@ "wait": [ { "jsonrpc": "2.0", - "id": 2, + "id": 1, "method": "window/workDoneProgress/create", "params": { "token": "" @@ -220,22 +220,20 @@ "command": { "title": "", "command": "als-refactor-imports", - "arguments": [ - { - "context": "Default", - "where": { - "textDocument": { - "uri": "$URI{foo.adb}" - }, - "position": { - "line": 8, - "character": 28 - } + "arguments": { + "context": "Default", + "where": { + "textDocument": { + "uri": "$URI{foo.adb}" }, - "with_clause": "Bar", - "prefix": "Bar." - } - ] + "position": { + "line": 8, + "character": 28 + } + }, + "with_clause": "Bar", + "prefix": "Bar." + } } } ] @@ -250,8 +248,8 @@ "id": "ada-11", "method": "workspace/executeCommand", "params": { - "arguments": [ - { + "command": "als-refactor-imports", + "arguments": { "context": "Default", "where": { "textDocument": { @@ -265,13 +263,11 @@ "with_clause": "Bar", "prefix": "Bar." } - ], - "command": "als-refactor-imports" } }, "wait": [ { - "id": 3, + "id": "ada-11", "method": "workspace/applyEdit", "params": { "edit": { @@ -435,22 +431,20 @@ "command": { "title": "", "command": "als-refactor-imports", - "arguments": [ - { - "context": "Default", - "where": { - "textDocument": { - "uri": "$URI{foo.adb}" - }, - "position": { - "line": 9, - "character": 20 - } + "arguments": { + "context": "Default", + "where": { + "textDocument": { + "uri": "$URI{foo.adb}" }, - "with_clause": "", - "prefix": "Nested." - } - ] + "position": { + "line": 9, + "character": 20 + } + }, + "with_clause": "", + "prefix": "Nested." + } } } ] @@ -465,28 +459,26 @@ "id": "ada-19", "method": "workspace/executeCommand", "params": { - "arguments": [ - { - "context": "Default", - "where": { - "textDocument": { - "uri": "$URI{foo.adb}" - }, - "position": { - "line": 9, - "character": 20 - } + "command": "als-refactor-imports", + "arguments": { + "context": "Default", + "where": { + "textDocument": { + "uri": "$URI{foo.adb}" }, - "with_clause": "", - "prefix": "Nested." - } - ], - "command": "als-refactor-imports" + "position": { + "line": 9, + "character": 20 + } + }, + "with_clause": "", + "prefix": "Nested." + } } }, "wait": [ { - "id": 4, + "id": "ada-19", "method": "workspace/applyEdit", "params": { "edit": { diff --git a/testsuite/ada_lsp/refactoring_imports_commands/U511-009.refactoring.import_with_use/test.yaml b/testsuite/ada_lsp/refactoring_imports_commands/U511-009.refactoring.import_with_use/test.yaml index ec7c8badb..b1ddcd6d3 100644 --- a/testsuite/ada_lsp/refactoring_imports_commands/U511-009.refactoring.import_with_use/test.yaml +++ b/testsuite/ada_lsp/refactoring_imports_commands/U511-009.refactoring.import_with_use/test.yaml @@ -1,4 +1 @@ -title: 'U511-009.refactoring.import_with_use' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] +title: 'refactoring_imports_commands/U511-009.refactoring.import_with_use' diff --git a/testsuite/ada_lsp/refactoring_imports_commands/suggestions_with_nested_packages/refactor_imports_commands.json b/testsuite/ada_lsp/refactoring_imports_commands/suggestions_with_nested_packages/refactor_imports_commands.json index a5996e948..7d37b04c8 100644 --- a/testsuite/ada_lsp/refactoring_imports_commands/suggestions_with_nested_packages/refactor_imports_commands.json +++ b/testsuite/ada_lsp/refactoring_imports_commands/suggestions_with_nested_packages/refactor_imports_commands.json @@ -36,43 +36,12 @@ "result": { "capabilities": { "textDocumentSync": 2, - "completionProvider": { - "triggerCharacters": [ - ".", - ",", - "'", - "(" - ], - "resolveProvider": true - }, - "hoverProvider": true, - "declarationProvider": true, - "definitionProvider": true, - "typeDefinitionProvider": true, - "implementationProvider": true, - "referencesProvider": true, - "codeActionProvider": {}, - "documentFormattingProvider": true, - "renameProvider": {}, - "foldingRangeProvider": true, "executeCommandProvider": { "commands": [ "", "als-refactor-imports" ] - }, - "workspaceSymbolProvider": true, - "alsShowDepsProvider": true, - "alsReferenceKinds": [ - "reference", - "access", - "write", - "call", - "dispatching call", - "parent", - "child", - "overriding" - ] + } } } } @@ -106,7 +75,7 @@ "wait": [ { "jsonrpc": "2.0", - "id": 2, + "id": 1, "method": "window/workDoneProgress/create", "params": { "token": "" @@ -179,22 +148,20 @@ "command": { "title": "", "command": "als-refactor-imports", - "arguments": [ - { - "context": "Default", - "where": { - "textDocument": { - "uri": "$URI{main.adb}" - }, - "position": { - "line": 2, - "character": 3 - } - }, - "with_clause": "A", - "prefix": "A." - } - ] + "arguments": { + "context": "Default", + "where": { + "textDocument": { + "uri": "$URI{main.adb}" + }, + "position": { + "line": 2, + "character": 3 + } + }, + "with_clause": "A", + "prefix": "A." + } } }, { @@ -203,22 +170,20 @@ "command": { "title": "", "command": "als-refactor-imports", - "arguments": [ - { - "context": "Default", - "where": { - "textDocument": { - "uri": "$URI{main.adb}" - }, - "position": { - "line": 2, - "character": 3 - } - }, - "with_clause": "A", - "prefix": "A.B." - } - ] + "arguments": { + "context": "Default", + "where": { + "textDocument": { + "uri": "$URI{main.adb}" + }, + "position": { + "line": 2, + "character": 3 + } + }, + "with_clause": "A", + "prefix": "A.B." + } } }, { @@ -227,22 +192,20 @@ "command": { "title": "", "command": "als-refactor-imports", - "arguments": [ - { - "context": "Default", - "where": { - "textDocument": { - "uri": "$URI{main.adb}" - }, - "position": { - "line": 2, - "character": 3 - } - }, - "with_clause": "E", - "prefix": "E." - } - ] + "arguments": { + "context": "Default", + "where": { + "textDocument": { + "uri": "$URI{main.adb}" + }, + "position": { + "line": 2, + "character": 3 + } + }, + "with_clause": "E", + "prefix": "E." + } } }, { @@ -251,22 +214,20 @@ "command": { "title": "", "command": "als-refactor-imports", - "arguments": [ - { - "context": "Default", - "where": { - "textDocument": { - "uri": "$URI{main.adb}" - }, - "position": { - "line": 2, - "character": 3 - } - }, - "with_clause": "E", - "prefix": "E.B." - } - ] + "arguments": { + "context": "Default", + "where": { + "textDocument": { + "uri": "$URI{main.adb}" + }, + "position": { + "line": 2, + "character": 3 + } + }, + "with_clause": "E", + "prefix": "E.B." + } } } ] @@ -282,22 +243,20 @@ "method": "workspace/executeCommand", "params": { "command": "als-refactor-imports", - "arguments": [ - { - "context": "Default", - "where": { - "textDocument": { - "uri": "$URI{main.adb}" - }, - "position": { - "line": 2, - "character": 3 - } - }, - "with_clause": "A", - "prefix": "A.B." - } - ] + "arguments": { + "context": "Default", + "where": { + "textDocument": { + "uri": "$URI{main.adb}" + }, + "position": { + "line": 2, + "character": 3 + } + }, + "with_clause": "A", + "prefix": "A.B." + } } }, "wait": [ diff --git a/testsuite/ada_lsp/refactoring_imports_commands/suggestions_with_nested_packages/test.yaml b/testsuite/ada_lsp/refactoring_imports_commands/suggestions_with_nested_packages/test.yaml index cb155740b..57c1304cb 100644 --- a/testsuite/ada_lsp/refactoring_imports_commands/suggestions_with_nested_packages/test.yaml +++ b/testsuite/ada_lsp/refactoring_imports_commands/suggestions_with_nested_packages/test.yaml @@ -1,4 +1 @@ -title: 'refactor_imports_commands' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] +title: 'refactoring_imports_commands/suggestions_with_nested_packages' diff --git a/testsuite/ada_lsp/refactoring_introduce_parameter/SA11-051/test.json b/testsuite/ada_lsp/refactoring_introduce_parameter/SA11-051/test.json index 085852bf5..799a2f5ed 100644 --- a/testsuite/ada_lsp/refactoring_introduce_parameter/SA11-051/test.json +++ b/testsuite/ada_lsp/refactoring_introduce_parameter/SA11-051/test.json @@ -83,8 +83,7 @@ "", "als-refactor-introduce-parameter" ] - }, - "alsCheckSyntaxProvider": true + } } } } @@ -190,24 +189,22 @@ "command": { "title": "", "command": "als-refactor-introduce-parameter", - "arguments": [ - { - "context_id": "Default", - "where": { - "uri": "$URI{main.adb}", - "range": { - "start": { - "line": 4, - "character": 33 - }, - "end": { - "line": 4, - "character": 46 - } - } - } - } - ] + "arguments": { + "context_id": "Default", + "where": { + "uri": "$URI{main.adb}", + "range": { + "start": { + "line": 4, + "character": 33 + }, + "end": { + "line": 4, + "character": 46 + } + } + } + } } } ] @@ -223,24 +220,22 @@ "method": "workspace/executeCommand", "params": { "command": "als-refactor-introduce-parameter", - "arguments": [ - { - "context_id": "Default", - "where": { - "uri": "$URI{main.adb}", - "range": { - "start": { - "line": 4, - "character": 33 - }, - "end": { - "line": 4, - "character": 46 - } - } - } - } - ] + "arguments": { + "context_id": "Default", + "where": { + "uri": "$URI{main.adb}", + "range": { + "start": { + "line": 4, + "character": 33 + }, + "end": { + "line": 4, + "character": 46 + } + } + } + } } }, "wait": [ diff --git a/testsuite/ada_lsp/refactoring_introduce_parameter/SA11-051/test.yaml b/testsuite/ada_lsp/refactoring_introduce_parameter/SA11-051/test.yaml index 6487d85e9..bc50abdec 100644 --- a/testsuite/ada_lsp/refactoring_introduce_parameter/SA11-051/test.yaml +++ b/testsuite/ada_lsp/refactoring_introduce_parameter/SA11-051/test.yaml @@ -1,4 +1 @@ title: 'refactoring_introduce_parameter/SA11-051' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/refactoring_replace_type/Q817-007/test.yaml b/testsuite/ada_lsp/refactoring_replace_type/Q817-007/test.yaml index 7b8156c29..043a61839 100644 --- a/testsuite/ada_lsp/refactoring_replace_type/Q817-007/test.yaml +++ b/testsuite/ada_lsp/refactoring_replace_type/Q817-007/test.yaml @@ -1,4 +1,4 @@ -title: 'foo_test' +title: 'refactoring_replace_type/Q817-007' # Skip till 3.17 ready skip: - ['XFAIL', 'True'] From 7eb2fad0918e979a62beb9762da42b86a109243f Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Mon, 4 Sep 2023 17:00:42 +0300 Subject: [PATCH 083/152] Read "model patch" and merge it into LSP model. * the patch is set in the config with `protocol extension` property * the patch has the same structure as `metaModel.json` * the generator copies all enumerations/requests items * for structures it copies properties if the structure already exists in LSP model. Refs #1172 --- source/lsp_gen/lsp_gen-configurations.adb | 3 + source/lsp_gen/lsp_gen-configurations.ads | 9 +++ source/lsp_gen/lsp_gen-meta_models.adb | 78 +++++++++++++++++++++++ 3 files changed, 90 insertions(+) diff --git a/source/lsp_gen/lsp_gen-configurations.adb b/source/lsp_gen/lsp_gen-configurations.adb index db713fb42..16c9f20c8 100644 --- a/source/lsp_gen/lsp_gen-configurations.adb +++ b/source/lsp_gen/lsp_gen-configurations.adb @@ -128,6 +128,9 @@ package body LSP_Gen.Configurations is if Method = "license header" then Read_License_Header (Reader); + elsif Method = "protocol extension" then + Self.Extension := Reader.String_Value; + Reader.Read_Next; else Read_Method (Reader, Method); end if; diff --git a/source/lsp_gen/lsp_gen-configurations.ads b/source/lsp_gen/lsp_gen-configurations.ads index a2a2fde04..d88c6e684 100644 --- a/source/lsp_gen/lsp_gen-configurations.ads +++ b/source/lsp_gen/lsp_gen-configurations.ads @@ -45,6 +45,10 @@ package LSP_Gen.Configurations is (Self : Configuration) return VSS.String_Vectors.Virtual_String_Vector; -- Lines of license header to be included in each generated file + function Protocol_Extension + (Self : Configuration) return VSS.Strings.Virtual_String; + -- Name of the file with LSP extension meta model + private type Message_Information is record @@ -60,6 +64,7 @@ private type Configuration is tagged limited record License : VSS.String_Vectors.Virtual_String_Vector; + Extension : VSS.Strings.Virtual_String; Map : Maps.Map; end record; @@ -67,4 +72,8 @@ private (Self : Configuration) return VSS.String_Vectors.Virtual_String_Vector is (Self.License); + function Protocol_Extension + (Self : Configuration) return VSS.Strings.Virtual_String + is (Self.Extension); + end LSP_Gen.Configurations; diff --git a/source/lsp_gen/lsp_gen-meta_models.adb b/source/lsp_gen/lsp_gen-meta_models.adb index 9221cc2be..2765d9c31 100644 --- a/source/lsp_gen/lsp_gen-meta_models.adb +++ b/source/lsp_gen/lsp_gen-meta_models.adb @@ -25,6 +25,8 @@ with LSP_Gen.Mappings; package body LSP_Gen.Meta_Models is + procedure Apply_Protocol_Extension (Self : in out Meta_Model'Class); + procedure Sort (List : in out VSS.String_Vectors.Virtual_String_Vector); ------------ @@ -39,6 +41,78 @@ package body LSP_Gen.Meta_Models is Self.Optional.Union (Value.Optional); end Append; + ------------------------------ + -- Apply_Protocol_Extension -- + ------------------------------ + + procedure Apply_Protocol_Extension (Self : in out Meta_Model'Class) is + use type VSS.Strings.Virtual_String; + + Name : constant VSS.Strings.Virtual_String := + Self.Config.Protocol_Extension; + + Input : aliased VSS.Text_Streams.File_Input.File_Input_Text_Stream; + Reader : VSS.JSON.Pull_Readers.Simple.JSON_Simple_Pull_Reader; + Patch : LSP_Gen.Entities.MetaModel; + Success : Boolean := True; + begin + Input.Open (Name, "utf-8"); + Reader.Set_Stream (Input'Unchecked_Access); + Reader.Read_Next; + pragma Assert (Reader.Is_Start_Document); + Reader.Read_Next; + LSP_Gen.Entities.Inputs.Input_MetaModel (Reader, Patch, Success); + pragma Assert (Success); + + -- Copy enumeration types + for J in 1 .. Patch.enumerations.Length loop + declare + Item : constant LSP_Gen.Entities.Enumeration := + Patch.enumerations (J); + begin + Self.Model.enumerations.Append (Item); + end; + end loop; + + -- Copy/patch structure types + for J in 1 .. Patch.structures.Length loop + declare + Found : Boolean := False; + Item : constant LSP_Gen.Entities.Structure := + Patch.structures (J); + begin + for K in 1 .. Self.Model.structures.Length loop + if Self.Model.structures (K).name = Item.name then + for P in 1 .. Item.properties.Length loop + declare + Prop : constant LSP_Gen.Entities.Property := + Item.properties (P); + begin + Self.Model.structures (K).properties.Append (Prop); + end; + end loop; + + Found := True; + exit; + end if; + end loop; + + if not Found then + Self.Model.structures.Append (Item); + end if; + end; + end loop; + + -- Copy extra requests + for J in 1 .. Patch.requests.Length loop + declare + Item : constant LSP_Gen.Entities.Request := Patch.requests (J); + begin + Self.Model.requests.Append (Item); + end; + end loop; + end Apply_Protocol_Extension; + ---------------- -- Dependency -- ---------------- @@ -471,6 +545,10 @@ package body LSP_Gen.Meta_Models is LSP_Gen.Entities.Inputs.Input_MetaModel (Reader, Self.Model, Success); pragma Assert (Success); + if not Self.Config.Protocol_Extension.Is_Empty then + Self.Apply_Protocol_Extension; + end if; + for J in 1 .. Self.Model.enumerations.Length loop declare Name : constant VSS.Strings.Virtual_String := From e39144d6863e95ca6310917d39d6eb28695397be Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Mon, 4 Sep 2023 17:06:54 +0300 Subject: [PATCH 084/152] Add `AlsReferenceKind` to `Location` type Refs #1172 --- doc/metaModel.patch.json | 80 ++++++++++++++++++++++++++++++++ source/lsp_gen/config/3_17.json5 | 8 +++- 2 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 doc/metaModel.patch.json diff --git a/doc/metaModel.patch.json b/doc/metaModel.patch.json new file mode 100644 index 000000000..8743dad07 --- /dev/null +++ b/doc/metaModel.patch.json @@ -0,0 +1,80 @@ +{ + "enumerations": [ + { + "name": "AlsReferenceKind", + "type": { + "kind": "base", + "name": "string" + }, + "values": [ + { + "name": "reference", + "value": "reference" + }, + { + "name": "access", + "value": "access" + }, + { + "name": "write", + "value": "write" + }, + { + "name": "call", + "value": "call" + }, + { + "name": "dispatching_call", + "value": "dispatching call" + }, + { + "name": "parent", + "value": "parent" + }, + { + "name": "child", + "value": "child" + }, + { + "name": "overriding", + "value": "overriding" + } + ] + } + ], + "structures": [ + { + "name": "Location", + "properties": [ + { + "name": "alsKind", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "AlsReferenceKind" + } + }, + "optional": true + } + ] + }, + { + "name": "ServerCapabilities", + "properties": [ + { + "name": "alsReferenceKinds", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "AlsReferenceKind" + } + }, + "optional": true, + "documentation": "List of reference kind supported by the server." + } + ] + } + ] +} \ No newline at end of file diff --git a/source/lsp_gen/config/3_17.json5 b/source/lsp_gen/config/3_17.json5 index ce9208b97..dd40cb0f9 100644 --- a/source/lsp_gen/config/3_17.json5 +++ b/source/lsp_gen/config/3_17.json5 @@ -10,6 +10,9 @@ "" ], + // LSP patch file name for ALS extensions + "protocol extension": "../../doc/metaModel.patch.json", + // Notification "$/cancelRequest": { @@ -154,7 +157,10 @@ // "textDocument/references" // "textDocument/rename" // "textDocument/selectionRange" - // "textDocument/semanticTokens/full" + "textDocument/semanticTokens/full": { + "from": "client", + "name": "Tokens_Full" + }, "textDocument/semanticTokens/full/delta": { "from": "client", "name": "Tokens_Delta" From dd9820e4006417bb41d271c9a891b664d9f50ea5 Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Mon, 4 Sep 2023 17:13:00 +0300 Subject: [PATCH 085/152] Regenerate LSP code with changes in the config and the patch. Refs #1172 --- .../lsp-client_message_factories.adb | 16 +- .../lsp-client_message_factories.ads | 4 +- .../generated/lsp-client_response_readers.adb | 8 +- .../lsp-client_response_receivers.ads | 2 +- .../generated/lsp-client_response_writers.adb | 4 +- .../generated/lsp-client_response_writers.ads | 2 +- ...b => lsp-client_responses-tokens_full.adb} | 6 +- ...s => lsp-client_responses-tokens_full.ads} | 4 +- .../lsp_3.17/generated/lsp-enumerations.ads | 4 + source/lsp_3.17/generated/lsp-inputs.adb | 295 +++++++++++------- source/lsp_3.17/generated/lsp-outputs.adb | 153 ++++++--- .../generated/lsp-progress_report_readers.adb | 8 +- .../lsp-progress_report_receivers.ads | 2 +- .../generated/lsp-progress_report_writers.adb | 4 +- .../generated/lsp-progress_report_writers.ads | 2 +- ...b => lsp-progress_reports-tokens_full.adb} | 6 +- ...s => lsp-progress_reports-tokens_full.ads} | 4 +- .../generated/lsp-server_request_readers.adb | 8 +- .../lsp-server_request_receivers.ads | 2 +- .../generated/lsp-server_request_writers.adb | 4 +- .../generated/lsp-server_request_writers.ads | 2 +- ...db => lsp-server_requests-tokens_full.adb} | 6 +- ...ds => lsp-server_requests-tokens_full.ads} | 4 +- source/lsp_3.17/generated/lsp-structures.ads | 8 + 24 files changed, 356 insertions(+), 202 deletions(-) rename source/lsp_3.17/generated/{lsp-client_responses-full.adb => lsp-client_responses-tokens_full.adb} (71%) rename source/lsp_3.17/generated/{lsp-client_responses-full.ads => lsp-client_responses-tokens_full.ads} (86%) rename source/lsp_3.17/generated/{lsp-progress_reports-full.adb => lsp-progress_reports-tokens_full.adb} (69%) rename source/lsp_3.17/generated/{lsp-progress_reports-full.ads => lsp-progress_reports-tokens_full.ads} (86%) rename source/lsp_3.17/generated/{lsp-server_requests-full.adb => lsp-server_requests-tokens_full.adb} (71%) rename source/lsp_3.17/generated/{lsp-server_requests-full.ads => lsp-server_requests-tokens_full.ads} (86%) diff --git a/source/lsp_3.17/generated/lsp-client_message_factories.adb b/source/lsp_3.17/generated/lsp-client_message_factories.adb index bead27fe4..dc24a3a6c 100644 --- a/source/lsp_3.17/generated/lsp-client_message_factories.adb +++ b/source/lsp_3.17/generated/lsp-client_message_factories.adb @@ -61,7 +61,7 @@ with LSP.Client_Responses.RangeFormatting; with LSP.Client_Responses.References; with LSP.Client_Responses.Rename; with LSP.Client_Responses.SelectionRange; -with LSP.Client_Responses.Full; +with LSP.Client_Responses.Tokens_Full; with LSP.Client_Responses.Tokens_Delta; with LSP.Client_Responses.Tokens_Range; with LSP.Client_Responses.SignatureHelp; @@ -96,7 +96,7 @@ with LSP.Progress_Reports.InlineValue; with LSP.Progress_Reports.Moniker; with LSP.Progress_Reports.References; with LSP.Progress_Reports.SelectionRange; -with LSP.Progress_Reports.Full; +with LSP.Progress_Reports.Tokens_Full; with LSP.Progress_Reports.Tokens_Delta; with LSP.Progress_Reports.Tokens_Range; with LSP.Progress_Reports.TypeDefinition; @@ -686,16 +686,16 @@ package body LSP.Client_Message_Factories is Result => Value)); end On_SelectionRange_Response; - overriding procedure On_Full_Response + overriding procedure On_Tokens_Full_Response (Self : in out Client_Message_Factory; Id : LSP.Structures.Integer_Or_Virtual_String; Value : LSP.Structures.SemanticTokens_Or_Null) is begin Client_Message_Factory'Class (Self).On_Message - (new LSP.Client_Responses.Full.Response' + (new LSP.Client_Responses.Tokens_Full.Response' (Id => Id, Result => Value)); - end On_Full_Response; + end On_Tokens_Full_Response; overriding procedure On_Tokens_Delta_Response (Self : in out Client_Message_Factory; @@ -1071,16 +1071,16 @@ package body LSP.Client_Message_Factories is Params => Value)); end On_SelectionRange_Partial_Result; - overriding procedure On_Full_Partial_Result + overriding procedure On_Tokens_Full_Partial_Result (Self : in out Client_Message_Factory; Token : LSP.Structures.ProgressToken; Value : LSP.Structures.SemanticTokensPartialResult) is begin Client_Message_Factory'Class (Self).On_Message - (new LSP.Progress_Reports.Full.Partial_Result' + (new LSP.Progress_Reports.Tokens_Full.Partial_Result' (Token => Token, Params => Value)); - end On_Full_Partial_Result; + end On_Tokens_Full_Partial_Result; overriding procedure On_Tokens_Delta_Partial_Result (Self : in out Client_Message_Factory; diff --git a/source/lsp_3.17/generated/lsp-client_message_factories.ads b/source/lsp_3.17/generated/lsp-client_message_factories.ads index 09fce7f46..2457f9fe6 100644 --- a/source/lsp_3.17/generated/lsp-client_message_factories.ads +++ b/source/lsp_3.17/generated/lsp-client_message_factories.ads @@ -286,7 +286,7 @@ package LSP.Client_Message_Factories is Id : LSP.Structures.Integer_Or_Virtual_String; Value : LSP.Structures.SelectionRange_Vector_Or_Null); - overriding procedure On_Full_Response + overriding procedure On_Tokens_Full_Response (Self : in out Client_Message_Factory; Id : LSP.Structures.Integer_Or_Virtual_String; Value : LSP.Structures.SemanticTokens_Or_Null); @@ -461,7 +461,7 @@ package LSP.Client_Message_Factories is Token : LSP.Structures.ProgressToken; Value : LSP.Structures.SelectionRange_Vector); - overriding procedure On_Full_Partial_Result + overriding procedure On_Tokens_Full_Partial_Result (Self : in out Client_Message_Factory; Token : LSP.Structures.ProgressToken; Value : LSP.Structures.SemanticTokensPartialResult); diff --git a/source/lsp_3.17/generated/lsp-client_response_readers.adb b/source/lsp_3.17/generated/lsp-client_response_readers.adb index a585a5484..af28066cd 100644 --- a/source/lsp_3.17/generated/lsp-client_response_readers.adb +++ b/source/lsp_3.17/generated/lsp-client_response_readers.adb @@ -47,7 +47,7 @@ with LSP.Client_Responses.RangeFormatting; with LSP.Client_Responses.References; with LSP.Client_Responses.Rename; with LSP.Client_Responses.SelectionRange; -with LSP.Client_Responses.Full; +with LSP.Client_Responses.Tokens_Full; with LSP.Client_Responses.Tokens_Delta; with LSP.Client_Responses.Tokens_Range; with LSP.Client_Responses.SignatureHelp; @@ -255,7 +255,7 @@ package body LSP.Client_Response_Readers is (LSP.Structures.SelectionRange_Vector_Or_Null, LSP.Inputs.Read_SelectionRange_Vector_Or_Null); - procedure Read_Full is new LSP.Input_Tools.Read_Response + procedure Read_Tokens_Full is new LSP.Input_Tools.Read_Response (LSP.Structures.SemanticTokens_Or_Null, LSP.Inputs.Read_SemanticTokens_Or_Null); @@ -501,8 +501,8 @@ package body LSP.Client_Response_Readers is end return; when 37 => -- textDocument/semanticTokens/full - return Result : LSP.Client_Responses.Full.Response do - Read_Full (Input, Result.Id, Result.Result); + return Result : LSP.Client_Responses.Tokens_Full.Response do + Read_Tokens_Full (Input, Result.Id, Result.Result); end return; when 38 => -- textDocument/semanticTokens/full/delta diff --git a/source/lsp_3.17/generated/lsp-client_response_receivers.ads b/source/lsp_3.17/generated/lsp-client_response_receivers.ads index e06800426..e39cb47f5 100644 --- a/source/lsp_3.17/generated/lsp-client_response_receivers.ads +++ b/source/lsp_3.17/generated/lsp-client_response_receivers.ads @@ -328,7 +328,7 @@ package LSP.Client_Response_Receivers is -- response is of type [SelectionRange[]](#SelectionRange[]) or a Thenable -- that resolves to such. - procedure On_Full_Response + procedure On_Tokens_Full_Response (Self : in out Client_Response_Receiver; Id : LSP.Structures.Integer_Or_Virtual_String; Value : LSP.Structures.SemanticTokens_Or_Null) is null; diff --git a/source/lsp_3.17/generated/lsp-client_response_writers.adb b/source/lsp_3.17/generated/lsp-client_response_writers.adb index a12a75b09..d5a1eb573 100644 --- a/source/lsp_3.17/generated/lsp-client_response_writers.adb +++ b/source/lsp_3.17/generated/lsp-client_response_writers.adb @@ -415,7 +415,7 @@ package body LSP.Client_Response_Writers is Self.Output.End_Object; end On_SelectionRange_Response; - overriding procedure On_Full_Response + overriding procedure On_Tokens_Full_Response (Self : in out Client_Response_Writer; Id : LSP.Structures.Integer_Or_Virtual_String; Value : LSP.Structures.SemanticTokens_Or_Null) is @@ -424,7 +424,7 @@ package body LSP.Client_Response_Writers is Self.Output.Key_Name ("result"); LSP.Outputs.Write_SemanticTokens_Or_Null (Self.Output.all, Value); Self.Output.End_Object; - end On_Full_Response; + end On_Tokens_Full_Response; overriding procedure On_Tokens_Delta_Response (Self : in out Client_Response_Writer; diff --git a/source/lsp_3.17/generated/lsp-client_response_writers.ads b/source/lsp_3.17/generated/lsp-client_response_writers.ads index 84198a431..245aab16a 100644 --- a/source/lsp_3.17/generated/lsp-client_response_writers.ads +++ b/source/lsp_3.17/generated/lsp-client_response_writers.ads @@ -199,7 +199,7 @@ package LSP.Client_Response_Writers is Id : LSP.Structures.Integer_Or_Virtual_String; Value : LSP.Structures.SelectionRange_Vector_Or_Null); - overriding procedure On_Full_Response + overriding procedure On_Tokens_Full_Response (Self : in out Client_Response_Writer; Id : LSP.Structures.Integer_Or_Virtual_String; Value : LSP.Structures.SemanticTokens_Or_Null); diff --git a/source/lsp_3.17/generated/lsp-client_responses-full.adb b/source/lsp_3.17/generated/lsp-client_responses-tokens_full.adb similarity index 71% rename from source/lsp_3.17/generated/lsp-client_responses-full.adb rename to source/lsp_3.17/generated/lsp-client_responses-tokens_full.adb index 1b9520b0c..1e80fd73a 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-full.adb +++ b/source/lsp_3.17/generated/lsp-client_responses-tokens_full.adb @@ -6,14 +6,14 @@ -- DON'T EDIT THIS FILE! It was generated from metaModel.json. -- -package body LSP.Client_Responses.Full is +package body LSP.Client_Responses.Tokens_Full is overriding procedure Visit_Client_Receiver (Self : Response; Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' Class) is begin - Value.On_Full_Response (Self.Id, Self.Result); + Value.On_Tokens_Full_Response (Self.Id, Self.Result); end Visit_Client_Receiver; -end LSP.Client_Responses.Full; +end LSP.Client_Responses.Tokens_Full; diff --git a/source/lsp_3.17/generated/lsp-client_responses-full.ads b/source/lsp_3.17/generated/lsp-client_responses-tokens_full.ads similarity index 86% rename from source/lsp_3.17/generated/lsp-client_responses-full.ads rename to source/lsp_3.17/generated/lsp-client_responses-tokens_full.ads index 03d8cefa1..4bf4f2eab 100644 --- a/source/lsp_3.17/generated/lsp-client_responses-full.ads +++ b/source/lsp_3.17/generated/lsp-client_responses-tokens_full.ads @@ -8,7 +8,7 @@ with LSP.Structures; -package LSP.Client_Responses.Full is +package LSP.Client_Responses.Tokens_Full is pragma Preelaborate; type Response is new LSP.Client_Responses.Client_Response with record @@ -20,4 +20,4 @@ package LSP.Client_Responses.Full is Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' Class); -end LSP.Client_Responses.Full; +end LSP.Client_Responses.Tokens_Full; diff --git a/source/lsp_3.17/generated/lsp-enumerations.ads b/source/lsp_3.17/generated/lsp-enumerations.ads index cfb7233c2..a02b425a3 100644 --- a/source/lsp_3.17/generated/lsp-enumerations.ads +++ b/source/lsp_3.17/generated/lsp-enumerations.ads @@ -9,6 +9,10 @@ package LSP.Enumerations is pragma Preelaborate; + type AlsReferenceKind is + (reference, an_access, write, call, dispatching_call, parent, child, + an_overriding); + type CodeActionKind is (Empty, QuickFix, Refactor, RefactorExtract, RefactorInline, RefactorRewrite, Source, SourceOrganizeImports, SourceFixAll); diff --git a/source/lsp_3.17/generated/lsp-inputs.adb b/source/lsp_3.17/generated/lsp-inputs.adb index 967a87298..5c1004e17 100644 --- a/source/lsp_3.17/generated/lsp-inputs.adb +++ b/source/lsp_3.17/generated/lsp-inputs.adb @@ -218,15 +218,15 @@ package body LSP.Inputs is (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; Value : out LSP.Structures.RelativePattern); + procedure Read_ReferenceOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.ReferenceOptions); + procedure Read_tagSupport_OfWorkspaceSymbolClientCapabilities (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; Value : out LSP.Structures .tagSupport_OfWorkspaceSymbolClientCapabilities); - procedure Read_ReferenceOptions - (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; - Value : out LSP.Structures.ReferenceOptions); - procedure Read_TextDocumentClientCapabilities (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; Value : out LSP.Structures.TextDocumentClientCapabilities); @@ -460,6 +460,10 @@ package body LSP.Inputs is (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; Value : out LSP.Structures.DeclarationRegistrationOptions); + procedure Read_TypeHierarchyRegistrationOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.TypeHierarchyRegistrationOptions); + procedure Read_DeleteFileOptions (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; Value : out LSP.Structures.DeleteFileOptions); @@ -468,10 +472,6 @@ package body LSP.Inputs is (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; Value : out LSP.Enumerations.WatchKind); - procedure Read_TypeHierarchyRegistrationOptions - (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; - Value : out LSP.Structures.TypeHierarchyRegistrationOptions); - procedure Read_DiagnosticSeverity (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; Value : out LSP.Enumerations.DiagnosticSeverity); @@ -918,6 +918,10 @@ package body LSP.Inputs is (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; Value : out LSP.Structures.CreateFileOptions); + procedure Read_AlsReferenceKind + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.AlsReferenceKind); + procedure Read_DiagnosticRelatedInformation (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; Value : out LSP.Structures.DiagnosticRelatedInformation); @@ -1259,6 +1263,10 @@ package body LSP.Inputs is (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; Value : out LSP.Enumerations.MarkupKind); + procedure Read_AlsReferenceKind_Set + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.AlsReferenceKind_Set); + procedure Read_LSPErrorCodes (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; Value : out LSP.Enumerations.LSPErrorCodes); @@ -2662,7 +2670,8 @@ package body LSP.Inputs is package Declaration_Result_Scope is package Declaration_Result_Map is new Minimal_Perfect_Hash (["uri", - "range"]); + "range", + "alsKind"]); end Declaration_Result_Scope; @@ -2708,6 +2717,11 @@ package body LSP.Inputs is (Kind => LSP.Structures.Variant_1, others => <>); exit; + when 3 => -- alsKind + Value := + (Kind => LSP.Structures.Variant_1, + others => <>); + exit; when others => Handler.Skip_Current_Value; end case; @@ -2736,6 +2750,7 @@ package body LSP.Inputs is package Definition_Progress_Report_Map is new Minimal_Perfect_Hash (["uri", "range", + "alsKind", "originSelectionRange", "targetUri", "targetRange", @@ -2781,22 +2796,27 @@ package body LSP.Inputs is (Kind => LSP.Structures.Variant_1, others => <>); exit; - when 3 => -- originSelectionRange + when 3 => -- alsKind + Value := + (Kind => LSP.Structures.Variant_1, + others => <>); + exit; + when 4 => -- originSelectionRange Value := (Kind => LSP.Structures.Variant_2, others => <>); exit; - when 4 => -- targetUri + when 5 => -- targetUri Value := (Kind => LSP.Structures.Variant_2, others => <>); exit; - when 5 => -- targetRange + when 6 => -- targetRange Value := (Kind => LSP.Structures.Variant_2, others => <>); exit; - when 6 => -- targetSelectionRange + when 7 => -- targetSelectionRange Value := (Kind => LSP.Structures.Variant_2, others => <>); @@ -3324,7 +3344,8 @@ package body LSP.Inputs is "inlayHintProvider", "diagnosticProvider", "workspace", - "experimental"]); + "experimental", + "alsReferenceKinds"]); package NotebookDocumentSyncOptions_Or_NotebookDocumentSyncRegistrationOptions_Scope is @@ -5099,6 +5120,8 @@ package body LSP.Inputs is (Is_Set => True, Value => <>); Read_T (Handler, Value.experimental.Value); + when 36 => -- alsReferenceKinds + Read_AlsReferenceKind_Set (Handler, Value.alsReferenceKinds); when others => Handler.Skip_Current_Value; end case; @@ -5855,30 +5878,33 @@ package body LSP.Inputs is Handler.Read_Next; end Read_WorkDoneProgressReport; - package tagSupport_OfWorkspaceSymbolClientCapabilities_Scope is - package tagSupport_OfWorkspaceSymbolClientCapabilities_Map is new Minimal_Perfect_Hash - (["valueSet"]); + package ReferenceOptions_Scope is + package ReferenceOptions_Map is new Minimal_Perfect_Hash + (["workDoneProgress"]); - end tagSupport_OfWorkspaceSymbolClientCapabilities_Scope; + end ReferenceOptions_Scope; - procedure Read_tagSupport_OfWorkspaceSymbolClientCapabilities + procedure Read_ReferenceOptions (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; - Value : out LSP.Structures - .tagSupport_OfWorkspaceSymbolClientCapabilities) is + Value : out LSP.Structures.ReferenceOptions) is + use ReferenceOptions_Scope; begin pragma Assert (Handler.Is_Start_Object); Handler.Read_Next; - while Handler.Is_Key_Name loop + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); declare - use tagSupport_OfWorkspaceSymbolClientCapabilities_Scope; Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; begin Handler.Read_Next; - case tagSupport_OfWorkspaceSymbolClientCapabilities_Map.Get_Index - (Key) is - when 1 => -- valueSet - Read_SymbolTag_Set (Handler, Value.valueSet); + case ReferenceOptions_Map.Get_Index (Key) is + when 1 => -- workDoneProgress + Value.workDoneProgress := + (Is_Set => True, + Value => <>); + Value.workDoneProgress.Value := Handler.Boolean_Value; + Handler.Read_Next; when others => Handler.Skip_Current_Value; end case; @@ -5886,35 +5912,32 @@ package body LSP.Inputs is end loop; Handler.Read_Next; - end Read_tagSupport_OfWorkspaceSymbolClientCapabilities; + end Read_ReferenceOptions; - package ReferenceOptions_Scope is - package ReferenceOptions_Map is new Minimal_Perfect_Hash - (["workDoneProgress"]); + package tagSupport_OfWorkspaceSymbolClientCapabilities_Scope is + package tagSupport_OfWorkspaceSymbolClientCapabilities_Map is new Minimal_Perfect_Hash + (["valueSet"]); - end ReferenceOptions_Scope; + end tagSupport_OfWorkspaceSymbolClientCapabilities_Scope; - procedure Read_ReferenceOptions + procedure Read_tagSupport_OfWorkspaceSymbolClientCapabilities (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; - Value : out LSP.Structures.ReferenceOptions) is - use ReferenceOptions_Scope; + Value : out LSP.Structures + .tagSupport_OfWorkspaceSymbolClientCapabilities) is begin pragma Assert (Handler.Is_Start_Object); Handler.Read_Next; - while not Handler.Is_End_Object loop - pragma Assert (Handler.Is_Key_Name); + while Handler.Is_Key_Name loop declare + use tagSupport_OfWorkspaceSymbolClientCapabilities_Scope; Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; begin Handler.Read_Next; - case ReferenceOptions_Map.Get_Index (Key) is - when 1 => -- workDoneProgress - Value.workDoneProgress := - (Is_Set => True, - Value => <>); - Value.workDoneProgress.Value := Handler.Boolean_Value; - Handler.Read_Next; + case tagSupport_OfWorkspaceSymbolClientCapabilities_Map.Get_Index + (Key) is + when 1 => -- valueSet + Read_SymbolTag_Set (Handler, Value.valueSet); when others => Handler.Skip_Current_Value; end case; @@ -5922,7 +5945,7 @@ package body LSP.Inputs is end loop; Handler.Read_Next; - end Read_ReferenceOptions; + end Read_tagSupport_OfWorkspaceSymbolClientCapabilities; package TextDocumentClientCapabilities_Scope is package TextDocumentClientCapabilities_Map is new Minimal_Perfect_Hash @@ -7746,6 +7769,7 @@ package body LSP.Inputs is package Declaration_Progress_Report_Map is new Minimal_Perfect_Hash (["uri", "range", + "alsKind", "originSelectionRange", "targetUri", "targetRange", @@ -7791,22 +7815,27 @@ package body LSP.Inputs is (Kind => LSP.Structures.Variant_1, others => <>); exit; - when 3 => -- originSelectionRange + when 3 => -- alsKind + Value := + (Kind => LSP.Structures.Variant_1, + others => <>); + exit; + when 4 => -- originSelectionRange Value := (Kind => LSP.Structures.Variant_2, others => <>); exit; - when 4 => -- targetUri + when 5 => -- targetUri Value := (Kind => LSP.Structures.Variant_2, others => <>); exit; - when 5 => -- targetRange + when 6 => -- targetRange Value := (Kind => LSP.Structures.Variant_2, others => <>); exit; - when 6 => -- targetSelectionRange + when 7 => -- targetSelectionRange Value := (Kind => LSP.Structures.Variant_2, others => <>); @@ -10112,6 +10141,7 @@ package body LSP.Inputs is package Location_Or_Something_Scope is package Location_Or_Something_Map is new Minimal_Perfect_Hash (["range", + "alsKind", "uri"]); end Location_Or_Something_Scope; @@ -10160,6 +10190,11 @@ package body LSP.Inputs is (Is_Location => True, others => <>); exit; + when 2 => -- alsKind + Value := + (Is_Location => True, + others => <>); + exit; when others => Handler.Skip_Current_Value; end case; @@ -10186,7 +10221,7 @@ package body LSP.Inputs is begin Handler.Read_Next; case Location_Or_Something_Map.Get_Index (Key) is - when 2 => -- uri + when 3 => -- uri Value.uri := (Handler.String_Value with null record); Handler.Read_Next; @@ -10237,59 +10272,6 @@ package body LSP.Inputs is Handler.Read_Next; end Read_WorkspaceSymbol; - package DeleteFileOptions_Scope is - package DeleteFileOptions_Map is new Minimal_Perfect_Hash - (["recursive", - "ignoreIfNotExists"]); - - end DeleteFileOptions_Scope; - - procedure Read_DeleteFileOptions - (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; - Value : out LSP.Structures.DeleteFileOptions) is - use DeleteFileOptions_Scope; - begin - pragma Assert (Handler.Is_Start_Object); - Handler.Read_Next; - - while not Handler.Is_End_Object loop - pragma Assert (Handler.Is_Key_Name); - declare - Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; - begin - Handler.Read_Next; - case DeleteFileOptions_Map.Get_Index (Key) is - when 1 => -- recursive - Value.recursive := - (Is_Set => True, - Value => <>); - Value.recursive.Value := Handler.Boolean_Value; - Handler.Read_Next; - when 2 => -- ignoreIfNotExists - Value.ignoreIfNotExists := - (Is_Set => True, - Value => <>); - Value.ignoreIfNotExists.Value := Handler.Boolean_Value; - Handler.Read_Next; - when others => - Handler.Skip_Current_Value; - end case; - end; - end loop; - - Handler.Read_Next; - end Read_DeleteFileOptions; - - procedure Read_WatchKind - (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; - Value : out LSP.Enumerations.WatchKind) is - begin - Value := - LSP.Enumerations.WatchKind'Val - (Handler.Number_Value.Integer_Value - 1); - Handler.Read_Next; - end Read_WatchKind; - package TypeHierarchyRegistrationOptions_Scope is package TypeHierarchyRegistrationOptions_Map is new Minimal_Perfect_Hash (["documentSelector", @@ -10353,6 +10335,59 @@ package body LSP.Inputs is Handler.Read_Next; end Read_TypeHierarchyRegistrationOptions; + package DeleteFileOptions_Scope is + package DeleteFileOptions_Map is new Minimal_Perfect_Hash + (["recursive", + "ignoreIfNotExists"]); + + end DeleteFileOptions_Scope; + + procedure Read_DeleteFileOptions + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.DeleteFileOptions) is + use DeleteFileOptions_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case DeleteFileOptions_Map.Get_Index (Key) is + when 1 => -- recursive + Value.recursive := + (Is_Set => True, + Value => <>); + Value.recursive.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 2 => -- ignoreIfNotExists + Value.ignoreIfNotExists := + (Is_Set => True, + Value => <>); + Value.ignoreIfNotExists.Value := Handler.Boolean_Value; + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_DeleteFileOptions; + + procedure Read_WatchKind + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.WatchKind) is + begin + Value := + LSP.Enumerations.WatchKind'Val + (Handler.Number_Value.Integer_Value - 1); + Handler.Read_Next; + end Read_WatchKind; + procedure Read_DiagnosticSeverity (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; Value : out LSP.Enumerations.DiagnosticSeverity) is @@ -13288,7 +13323,8 @@ package body LSP.Inputs is package Location_Scope is package Location_Map is new Minimal_Perfect_Hash (["uri", - "range"]); + "range", + "alsKind"]); end Location_Scope; @@ -13312,6 +13348,8 @@ package body LSP.Inputs is Handler.Read_Next; when 2 => -- range Read_A_Range (Handler, Value.a_range); + when 3 => -- alsKind + Read_AlsReferenceKind_Set (Handler, Value.alsKind); when others => Handler.Skip_Current_Value; end case; @@ -18153,6 +18191,26 @@ package body LSP.Inputs is Handler.Read_Next; end Read_CreateFileOptions; + package AlsReferenceKind_Map is new Minimal_Perfect_Hash + (["reference", + "access", + "write", + "call", + "dispatching call", + "parent", + "child", + "overriding"]); + + procedure Read_AlsReferenceKind + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.AlsReferenceKind) is + begin + Value := + LSP.Enumerations.AlsReferenceKind'Val + (AlsReferenceKind_Map.Get_Index (Handler.String_Value) - 1); + Handler.Read_Next; + end Read_AlsReferenceKind; + package DiagnosticRelatedInformation_Scope is package DiagnosticRelatedInformation_Map is new Minimal_Perfect_Hash (["location", @@ -20976,7 +21034,8 @@ package body LSP.Inputs is package Definition_Result_Scope is package Definition_Result_Map is new Minimal_Perfect_Hash (["uri", - "range"]); + "range", + "alsKind"]); end Definition_Result_Scope; @@ -21022,6 +21081,11 @@ package body LSP.Inputs is (Kind => LSP.Structures.Variant_1, others => <>); exit; + when 3 => -- alsKind + Value := + (Kind => LSP.Structures.Variant_1, + others => <>); + exit; when others => Handler.Skip_Current_Value; end case; @@ -23753,6 +23817,27 @@ package body LSP.Inputs is Handler.Read_Next; end Read_MarkupKind; + procedure Read_AlsReferenceKind_Set + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.AlsReferenceKind_Set) is + begin + pragma Assert (Handler.Is_Start_Array); + Handler.Read_Next; + + declare + Set : LSP.Structures.AlsReferenceKind_Set renames Value; + Value : LSP.Enumerations.AlsReferenceKind; + begin + Set := (others => False); + while not Handler.Is_End_Array loop + Read_AlsReferenceKind (Handler, Value); + Set (Value) := True; + end loop; + end; + + Handler.Read_Next; + end Read_AlsReferenceKind_Set; + package CallHierarchyPrepareParams_Scope is package CallHierarchyPrepareParams_Map is new Minimal_Perfect_Hash (["textDocument", diff --git a/source/lsp_3.17/generated/lsp-outputs.adb b/source/lsp_3.17/generated/lsp-outputs.adb index 91d84bc7f..ccdeece8b 100644 --- a/source/lsp_3.17/generated/lsp-outputs.adb +++ b/source/lsp_3.17/generated/lsp-outputs.adb @@ -217,14 +217,14 @@ package body LSP.Outputs is (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; Value : LSP.Structures.RelativePattern); - procedure Write_tagSupport_OfWorkspaceSymbolClientCapabilities - (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; - Value : LSP.Structures.tagSupport_OfWorkspaceSymbolClientCapabilities); - procedure Write_ReferenceOptions (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; Value : LSP.Structures.ReferenceOptions); + procedure Write_tagSupport_OfWorkspaceSymbolClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.tagSupport_OfWorkspaceSymbolClientCapabilities); + procedure Write_TextDocumentClientCapabilities (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; Value : LSP.Structures.TextDocumentClientCapabilities); @@ -457,6 +457,10 @@ package body LSP.Outputs is (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; Value : LSP.Structures.DeclarationRegistrationOptions); + procedure Write_TypeHierarchyRegistrationOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.TypeHierarchyRegistrationOptions); + procedure Write_DeleteFileOptions (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; Value : LSP.Structures.DeleteFileOptions); @@ -465,10 +469,6 @@ package body LSP.Outputs is (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; Value : LSP.Enumerations.WatchKind); - procedure Write_TypeHierarchyRegistrationOptions - (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; - Value : LSP.Structures.TypeHierarchyRegistrationOptions); - procedure Write_DiagnosticSeverity (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; Value : LSP.Enumerations.DiagnosticSeverity); @@ -915,6 +915,10 @@ package body LSP.Outputs is (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; Value : LSP.Structures.CreateFileOptions); + procedure Write_AlsReferenceKind + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.AlsReferenceKind); + procedure Write_DiagnosticRelatedInformation (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; Value : LSP.Structures.DiagnosticRelatedInformation); @@ -1256,6 +1260,10 @@ package body LSP.Outputs is (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; Value : LSP.Enumerations.MarkupKind); + procedure Write_AlsReferenceKind_Set + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.AlsReferenceKind_Set); + procedure Write_LSPErrorCodes (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; Value : LSP.Enumerations.LSPErrorCodes); @@ -2963,6 +2971,10 @@ package body LSP.Outputs is Handler.Key_Name ("experimental"); Write_T (Handler, Value.experimental.Value); end if; + if (for some Item of Value.alsReferenceKinds => Item) then + Handler.Key_Name ("alsReferenceKinds"); + Write_AlsReferenceKind_Set (Handler, Value.alsReferenceKinds); + end if; Handler.End_Object; end Write_ServerCapabilities; @@ -3324,16 +3336,6 @@ package body LSP.Outputs is Handler.End_Object; end Write_WorkDoneProgressReport; - procedure Write_tagSupport_OfWorkspaceSymbolClientCapabilities - (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; - Value : LSP.Structures.tagSupport_OfWorkspaceSymbolClientCapabilities) is - begin - Handler.Start_Object; - Handler.Key_Name ("valueSet"); - Write_SymbolTag_Set (Handler, Value.valueSet); - Handler.End_Object; - end Write_tagSupport_OfWorkspaceSymbolClientCapabilities; - procedure Write_ReferenceOptions (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; Value : LSP.Structures.ReferenceOptions) is @@ -3346,6 +3348,16 @@ package body LSP.Outputs is Handler.End_Object; end Write_ReferenceOptions; + procedure Write_tagSupport_OfWorkspaceSymbolClientCapabilities + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.tagSupport_OfWorkspaceSymbolClientCapabilities) is + begin + Handler.Start_Object; + Handler.Key_Name ("valueSet"); + Write_SymbolTag_Set (Handler, Value.valueSet); + Handler.End_Object; + end Write_tagSupport_OfWorkspaceSymbolClientCapabilities; + procedure Write_TextDocumentClientCapabilities (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; Value : LSP.Structures.TextDocumentClientCapabilities) is @@ -5306,36 +5318,6 @@ package body LSP.Outputs is Handler.End_Object; end Write_WorkspaceSymbol; - procedure Write_DeleteFileOptions - (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; - Value : LSP.Structures.DeleteFileOptions) is - begin - Handler.Start_Object; - if Value.recursive.Is_Set then - Handler.Key_Name ("recursive"); - Handler.Boolean_Value (Value.recursive.Value); - end if; - if Value.ignoreIfNotExists.Is_Set then - Handler.Key_Name ("ignoreIfNotExists"); - Handler.Boolean_Value (Value.ignoreIfNotExists.Value); - end if; - Handler.End_Object; - end Write_DeleteFileOptions; - - procedure Write_WatchKind - (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; - Value : LSP.Enumerations.WatchKind) is - begin - case Value is - when LSP.Enumerations.Create => - Handler.Integer_Value (1); - when LSP.Enumerations.Change => - Handler.Integer_Value (2); - when LSP.Enumerations.Delete => - Handler.Integer_Value (4); - end case; - end Write_WatchKind; - procedure Write_TypeHierarchyRegistrationOptions (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; Value : LSP.Structures.TypeHierarchyRegistrationOptions) is @@ -5369,6 +5351,36 @@ package body LSP.Outputs is Handler.End_Object; end Write_TypeHierarchyRegistrationOptions; + procedure Write_DeleteFileOptions + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.DeleteFileOptions) is + begin + Handler.Start_Object; + if Value.recursive.Is_Set then + Handler.Key_Name ("recursive"); + Handler.Boolean_Value (Value.recursive.Value); + end if; + if Value.ignoreIfNotExists.Is_Set then + Handler.Key_Name ("ignoreIfNotExists"); + Handler.Boolean_Value (Value.ignoreIfNotExists.Value); + end if; + Handler.End_Object; + end Write_DeleteFileOptions; + + procedure Write_WatchKind + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.WatchKind) is + begin + case Value is + when LSP.Enumerations.Create => + Handler.Integer_Value (1); + when LSP.Enumerations.Change => + Handler.Integer_Value (2); + when LSP.Enumerations.Delete => + Handler.Integer_Value (4); + end case; + end Write_WatchKind; + procedure Write_DiagnosticSeverity (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; Value : LSP.Enumerations.DiagnosticSeverity) is @@ -6677,6 +6689,10 @@ package body LSP.Outputs is Handler.String_Value (Value.uri); Handler.Key_Name ("range"); Write_A_Range (Handler, Value.a_range); + if (for some Item of Value.alsKind => Item) then + Handler.Key_Name ("alsKind"); + Write_AlsReferenceKind_Set (Handler, Value.alsKind); + end if; Handler.End_Object; end Write_Location; @@ -8715,6 +8731,30 @@ package body LSP.Outputs is Handler.End_Object; end Write_CreateFileOptions; + procedure Write_AlsReferenceKind + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.AlsReferenceKind) is + begin + case Value is + when LSP.Enumerations.reference => + Handler.String_Value ("reference"); + when LSP.Enumerations.an_access => + Handler.String_Value ("access"); + when LSP.Enumerations.write => + Handler.String_Value ("write"); + when LSP.Enumerations.call => + Handler.String_Value ("call"); + when LSP.Enumerations.dispatching_call => + Handler.String_Value ("dispatching call"); + when LSP.Enumerations.parent => + Handler.String_Value ("parent"); + when LSP.Enumerations.child => + Handler.String_Value ("child"); + when LSP.Enumerations.an_overriding => + Handler.String_Value ("overriding"); + end case; + end Write_AlsReferenceKind; + procedure Write_DiagnosticRelatedInformation (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; Value : LSP.Structures.DiagnosticRelatedInformation) is @@ -11189,6 +11229,23 @@ package body LSP.Outputs is end case; end Write_MarkupKind; + procedure Write_AlsReferenceKind_Set + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.AlsReferenceKind_Set) is + begin + Handler.Start_Array; + declare + Set : LSP.Structures.AlsReferenceKind_Set renames Value; + begin + for Value in Set'Range loop + if Set (Value) then + Write_AlsReferenceKind (Handler, Value); + end if; + end loop; + end; + Handler.End_Array; + end Write_AlsReferenceKind_Set; + procedure Write_CallHierarchyPrepareParams (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; Value : LSP.Structures.CallHierarchyPrepareParams) is diff --git a/source/lsp_3.17/generated/lsp-progress_report_readers.adb b/source/lsp_3.17/generated/lsp-progress_report_readers.adb index c336afdab..c1fc82684 100644 --- a/source/lsp_3.17/generated/lsp-progress_report_readers.adb +++ b/source/lsp_3.17/generated/lsp-progress_report_readers.adb @@ -31,7 +31,7 @@ with LSP.Progress_Reports.InlineValue; with LSP.Progress_Reports.Moniker; with LSP.Progress_Reports.References; with LSP.Progress_Reports.SelectionRange; -with LSP.Progress_Reports.Full; +with LSP.Progress_Reports.Tokens_Full; with LSP.Progress_Reports.Tokens_Delta; with LSP.Progress_Reports.Tokens_Range; with LSP.Progress_Reports.TypeDefinition; @@ -155,7 +155,7 @@ package body LSP.Progress_Report_Readers is (LSP.Structures.SelectionRange_Vector, LSP.Inputs.Read_SelectionRange_Vector); - procedure Read_Full is new LSP.Input_Tools.Read_Progress_Report + procedure Read_Tokens_Full is new LSP.Input_Tools.Read_Progress_Report (LSP.Structures.SemanticTokensPartialResult, LSP.Inputs.Read_SemanticTokensPartialResult); @@ -317,8 +317,8 @@ package body LSP.Progress_Report_Readers is end return; when 21 => -- textDocument/semanticTokens/full - return Result : LSP.Progress_Reports.Full.Partial_Result do - Read_Full (Input, Result.Token, Result.Params); + return Result : LSP.Progress_Reports.Tokens_Full.Partial_Result do + Read_Tokens_Full (Input, Result.Token, Result.Params); end return; when 22 => -- textDocument/semanticTokens/full/delta diff --git a/source/lsp_3.17/generated/lsp-progress_report_receivers.ads b/source/lsp_3.17/generated/lsp-progress_report_receivers.ads index aba65a525..c8ef5701c 100644 --- a/source/lsp_3.17/generated/lsp-progress_report_receivers.ads +++ b/source/lsp_3.17/generated/lsp-progress_report_receivers.ads @@ -198,7 +198,7 @@ package LSP.Progress_Report_Receivers is -- response is of type [SelectionRange[]](#SelectionRange[]) or a Thenable -- that resolves to such. - procedure On_Full_Partial_Result + procedure On_Tokens_Full_Partial_Result (Self : in out Progress_Report_Receiver; Token : LSP.Structures.ProgressToken; Value : LSP.Structures.SemanticTokensPartialResult) is null; diff --git a/source/lsp_3.17/generated/lsp-progress_report_writers.adb b/source/lsp_3.17/generated/lsp-progress_report_writers.adb index 6cdf7f9fd..3933085c4 100644 --- a/source/lsp_3.17/generated/lsp-progress_report_writers.adb +++ b/source/lsp_3.17/generated/lsp-progress_report_writers.adb @@ -235,7 +235,7 @@ package body LSP.Progress_Report_Writers is Self.Output.End_Object; end On_SelectionRange_Partial_Result; - overriding procedure On_Full_Partial_Result + overriding procedure On_Tokens_Full_Partial_Result (Self : in out Progress_Report_Writer; Token : LSP.Structures.ProgressToken; Value : LSP.Structures.SemanticTokensPartialResult) is @@ -244,7 +244,7 @@ package body LSP.Progress_Report_Writers is LSP.Outputs.Write_SemanticTokensPartialResult (Self.Output.all, Value); Self.Output.End_Object; Self.Output.End_Object; - end On_Full_Partial_Result; + end On_Tokens_Full_Partial_Result; overriding procedure On_Tokens_Delta_Partial_Result (Self : in out Progress_Report_Writer; diff --git a/source/lsp_3.17/generated/lsp-progress_report_writers.ads b/source/lsp_3.17/generated/lsp-progress_report_writers.ads index eeda8f9f0..8e01dc9c7 100644 --- a/source/lsp_3.17/generated/lsp-progress_report_writers.ads +++ b/source/lsp_3.17/generated/lsp-progress_report_writers.ads @@ -117,7 +117,7 @@ package LSP.Progress_Report_Writers is Token : LSP.Structures.ProgressToken; Value : LSP.Structures.SelectionRange_Vector); - overriding procedure On_Full_Partial_Result + overriding procedure On_Tokens_Full_Partial_Result (Self : in out Progress_Report_Writer; Token : LSP.Structures.ProgressToken; Value : LSP.Structures.SemanticTokensPartialResult); diff --git a/source/lsp_3.17/generated/lsp-progress_reports-full.adb b/source/lsp_3.17/generated/lsp-progress_reports-tokens_full.adb similarity index 69% rename from source/lsp_3.17/generated/lsp-progress_reports-full.adb rename to source/lsp_3.17/generated/lsp-progress_reports-tokens_full.adb index 4c4777db9..49f5b6e3f 100644 --- a/source/lsp_3.17/generated/lsp-progress_reports-full.adb +++ b/source/lsp_3.17/generated/lsp-progress_reports-tokens_full.adb @@ -6,14 +6,14 @@ -- DON'T EDIT THIS FILE! It was generated from metaModel.json. -- -package body LSP.Progress_Reports.Full is +package body LSP.Progress_Reports.Tokens_Full is overriding procedure Visit_Receiver (Self : Partial_Result; Value : in out LSP.Progress_Report_Receivers.Progress_Report_Receiver' Class) is begin - Value.On_Full_Partial_Result (Self.Token, Self.Params); + Value.On_Tokens_Full_Partial_Result (Self.Token, Self.Params); end Visit_Receiver; -end LSP.Progress_Reports.Full; +end LSP.Progress_Reports.Tokens_Full; diff --git a/source/lsp_3.17/generated/lsp-progress_reports-full.ads b/source/lsp_3.17/generated/lsp-progress_reports-tokens_full.ads similarity index 86% rename from source/lsp_3.17/generated/lsp-progress_reports-full.ads rename to source/lsp_3.17/generated/lsp-progress_reports-tokens_full.ads index ea7658df2..b9a941283 100644 --- a/source/lsp_3.17/generated/lsp-progress_reports-full.ads +++ b/source/lsp_3.17/generated/lsp-progress_reports-tokens_full.ads @@ -8,7 +8,7 @@ with LSP.Structures; -package LSP.Progress_Reports.Full is +package LSP.Progress_Reports.Tokens_Full is pragma Preelaborate; type Partial_Result is new LSP.Progress_Reports.Progress_Report with record @@ -20,4 +20,4 @@ package LSP.Progress_Reports.Full is Value : in out LSP.Progress_Report_Receivers.Progress_Report_Receiver' Class); -end LSP.Progress_Reports.Full; +end LSP.Progress_Reports.Tokens_Full; diff --git a/source/lsp_3.17/generated/lsp-server_request_readers.adb b/source/lsp_3.17/generated/lsp-server_request_readers.adb index 50a10c446..75592bcdc 100644 --- a/source/lsp_3.17/generated/lsp-server_request_readers.adb +++ b/source/lsp_3.17/generated/lsp-server_request_readers.adb @@ -47,7 +47,7 @@ with LSP.Server_Requests.RangeFormatting; with LSP.Server_Requests.References; with LSP.Server_Requests.Rename; with LSP.Server_Requests.SelectionRange; -with LSP.Server_Requests.Full; +with LSP.Server_Requests.Tokens_Full; with LSP.Server_Requests.Tokens_Delta; with LSP.Server_Requests.Tokens_Range; with LSP.Server_Requests.SignatureHelp; @@ -280,7 +280,7 @@ package body LSP.Server_Request_Readers is (LSP.Structures.SelectionRangeParams, "textDocument/selectionRange", LSP.Inputs.Read_SelectionRangeParams); - procedure Read_Full is new LSP.Input_Tools.Read_Request + procedure Read_Tokens_Full is new LSP.Input_Tools.Read_Request (LSP.Structures.SemanticTokensParams, "textDocument/semanticTokens/full", LSP.Inputs.Read_SemanticTokensParams); @@ -531,8 +531,8 @@ package body LSP.Server_Request_Readers is end return; when 37 => -- textDocument/semanticTokens/full - return Result : LSP.Server_Requests.Full.Request do - Read_Full (Input, Result.Id, Result.Params); + return Result : LSP.Server_Requests.Tokens_Full.Request do + Read_Tokens_Full (Input, Result.Id, Result.Params); end return; when 38 => -- textDocument/semanticTokens/full/delta diff --git a/source/lsp_3.17/generated/lsp-server_request_receivers.ads b/source/lsp_3.17/generated/lsp-server_request_receivers.ads index 1a08d5b6d..cd281e42f 100644 --- a/source/lsp_3.17/generated/lsp-server_request_receivers.ads +++ b/source/lsp_3.17/generated/lsp-server_request_receivers.ads @@ -326,7 +326,7 @@ package LSP.Server_Request_Receivers is -- response is of type [SelectionRange[]](#SelectionRange[]) or a Thenable -- that resolves to such. - procedure On_Full_Request + procedure On_Tokens_Full_Request (Self : in out Server_Request_Receiver; Id : LSP.Structures.Integer_Or_Virtual_String; Value : LSP.Structures.SemanticTokensParams) is null; diff --git a/source/lsp_3.17/generated/lsp-server_request_writers.adb b/source/lsp_3.17/generated/lsp-server_request_writers.adb index 682aed2a0..77114d008 100644 --- a/source/lsp_3.17/generated/lsp-server_request_writers.adb +++ b/source/lsp_3.17/generated/lsp-server_request_writers.adb @@ -441,7 +441,7 @@ package body LSP.Server_Request_Writers is Self.Output.End_Object; end On_SelectionRange_Request; - overriding procedure On_Full_Request + overriding procedure On_Tokens_Full_Request (Self : in out Server_Request_Writer; Id : LSP.Structures.Integer_Or_Virtual_String; Value : LSP.Structures.SemanticTokensParams) is @@ -451,7 +451,7 @@ package body LSP.Server_Request_Writers is Self.Output.Key_Name ("params"); LSP.Outputs.Write_SemanticTokensParams (Self.Output.all, Value); Self.Output.End_Object; - end On_Full_Request; + end On_Tokens_Full_Request; overriding procedure On_Tokens_Delta_Request (Self : in out Server_Request_Writer; diff --git a/source/lsp_3.17/generated/lsp-server_request_writers.ads b/source/lsp_3.17/generated/lsp-server_request_writers.ads index ae534793b..ac7de2fe7 100644 --- a/source/lsp_3.17/generated/lsp-server_request_writers.ads +++ b/source/lsp_3.17/generated/lsp-server_request_writers.ads @@ -196,7 +196,7 @@ package LSP.Server_Request_Writers is Id : LSP.Structures.Integer_Or_Virtual_String; Value : LSP.Structures.SelectionRangeParams); - overriding procedure On_Full_Request + overriding procedure On_Tokens_Full_Request (Self : in out Server_Request_Writer; Id : LSP.Structures.Integer_Or_Virtual_String; Value : LSP.Structures.SemanticTokensParams); diff --git a/source/lsp_3.17/generated/lsp-server_requests-full.adb b/source/lsp_3.17/generated/lsp-server_requests-tokens_full.adb similarity index 71% rename from source/lsp_3.17/generated/lsp-server_requests-full.adb rename to source/lsp_3.17/generated/lsp-server_requests-tokens_full.adb index ced126e1a..e419eb37c 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-full.adb +++ b/source/lsp_3.17/generated/lsp-server_requests-tokens_full.adb @@ -6,14 +6,14 @@ -- DON'T EDIT THIS FILE! It was generated from metaModel.json. -- -package body LSP.Server_Requests.Full is +package body LSP.Server_Requests.Tokens_Full is overriding procedure Visit_Server_Receiver (Self : Request; Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' Class) is begin - Value.On_Full_Request (Self.Id, Self.Params); + Value.On_Tokens_Full_Request (Self.Id, Self.Params); end Visit_Server_Receiver; -end LSP.Server_Requests.Full; +end LSP.Server_Requests.Tokens_Full; diff --git a/source/lsp_3.17/generated/lsp-server_requests-full.ads b/source/lsp_3.17/generated/lsp-server_requests-tokens_full.ads similarity index 86% rename from source/lsp_3.17/generated/lsp-server_requests-full.ads rename to source/lsp_3.17/generated/lsp-server_requests-tokens_full.ads index 0187c26fa..b79f49f71 100644 --- a/source/lsp_3.17/generated/lsp-server_requests-full.ads +++ b/source/lsp_3.17/generated/lsp-server_requests-tokens_full.ads @@ -8,7 +8,7 @@ with LSP.Structures; -package LSP.Server_Requests.Full is +package LSP.Server_Requests.Tokens_Full is pragma Preelaborate; type Request is new LSP.Server_Requests.Server_Request with record @@ -20,4 +20,4 @@ package LSP.Server_Requests.Full is Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' Class); -end LSP.Server_Requests.Full; +end LSP.Server_Requests.Tokens_Full; diff --git a/source/lsp_3.17/generated/lsp-structures.ads b/source/lsp_3.17/generated/lsp-structures.ads index cf3b5387d..7f4e7388f 100644 --- a/source/lsp_3.17/generated/lsp-structures.ads +++ b/source/lsp_3.17/generated/lsp-structures.ads @@ -2966,11 +2966,16 @@ package LSP.Structures is end case; end record; + type AlsReferenceKind_Set is array (AlsReferenceKind) of Boolean with + Pack, Default_Component_Value => False; + type Location is record uri : LSP.Structures.DocumentUri; a_range : LSP.Structures.A_Range; + alsKind : LSP.Structures.AlsReferenceKind_Set; + end record; -- Represents a location inside a resource, such as a line inside a text -- file. @@ -7059,6 +7064,9 @@ package LSP.Structures is experimental : T_Optional; -- Experimental server capabilities. + alsReferenceKinds : LSP.Structures.AlsReferenceKind_Set; + -- List of reference kind supported by the server. + end record; -- Defines the capabilities provided by a language server. From d08c55447c1d11bc15518880377d5ca30ccd79c2 Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Mon, 4 Sep 2023 17:49:11 +0300 Subject: [PATCH 086/152] Update sources after changes in generated files Refs #1170 --- source/ada/lsp-ada_documents.adb | 8 +- source/ada/lsp-ada_documents.ads | 6 +- source/ada/lsp-ada_handlers-locations.adb | 20 ++-- source/ada/lsp-ada_handlers-locations.ads | 24 +--- source/ada/lsp-ada_handlers-refactor.adb | 3 +- source/ada/lsp-ada_handlers.adb | 119 ++++++++++--------- source/ada/lsp-ada_handlers.ads | 2 +- source/ada/lsp-utils.adb | 3 +- source/lsp_3.17/lsp-constants.ads | 3 + source/server/lsp-unimplemented_handlers.adb | 4 +- source/server/lsp-unimplemented_handlers.ads | 2 +- 11 files changed, 102 insertions(+), 92 deletions(-) diff --git a/source/ada/lsp-ada_documents.adb b/source/ada/lsp-ada_documents.adb index bf412e4c1..97157f3c5 100644 --- a/source/ada/lsp-ada_documents.adb +++ b/source/ada/lsp-ada_documents.adb @@ -49,7 +49,6 @@ with LSP.Ada_Contexts; with LSP.Ada_Documentation; with LSP.Ada_Documents.LAL_Diagnostics; with LSP.Ada_Id_Iterators; -with LSP.Constants; with LSP.Enumerations; with LSP.Predicates; with LSP.Utils; @@ -2340,10 +2339,13 @@ package body LSP.Ada_Documents is --------------------- function To_LSP_Location - (Self : Document; Segment : Langkit_Support.Slocs.Source_Location_Range) + (Self : Document; + Segment : Langkit_Support.Slocs.Source_Location_Range; + Kinds : LSP.Structures.AlsReferenceKind_Set := LSP.Constants.Empty) return LSP.Structures.Location is (uri => Self.URI, - a_range => Self.To_LSP_Range (Segment)); + a_range => Self.To_LSP_Range (Segment), + alsKind => Kinds); ------------------ -- To_LSP_Range -- diff --git a/source/ada/lsp-ada_documents.ads b/source/ada/lsp-ada_documents.ads index 949d77c43..0f27fdd6e 100644 --- a/source/ada/lsp-ada_documents.ads +++ b/source/ada/lsp-ada_documents.ads @@ -32,8 +32,9 @@ with Pp.Command_Lines; limited with LSP.Ada_Contexts; with LSP.Ada_Completions; -with LSP.Diagnostic_Sources; with LSP.Ada_Highlighters; +with LSP.Constants; +with LSP.Diagnostic_Sources; with LSP.Search; with LSP.Structures; with LSP.Tracers; @@ -89,7 +90,8 @@ package LSP.Ada_Documents is function To_LSP_Location (Self : Document; - Segment : Langkit_Support.Slocs.Source_Location_Range) + Segment : Langkit_Support.Slocs.Source_Location_Range; + Kinds : LSP.Structures.AlsReferenceKind_Set := LSP.Constants.Empty) return LSP.Structures.Location; -- Convert LAL's Source_Location_Range and document's uri to a LSP location diff --git a/source/ada/lsp-ada_handlers-locations.adb b/source/ada/lsp-ada_handlers-locations.adb index ba563e1ba..fbddbf7e3 100644 --- a/source/ada/lsp-ada_handlers-locations.adb +++ b/source/ada/lsp-ada_handlers-locations.adb @@ -35,10 +35,10 @@ package body LSP.Ada_Handlers.Locations is (Self : in out Message_Handler; Result : in out LSP.Structures.Location_Vector; Node : Libadalang.Analysis.Ada_Node'Class; - Ignore : AlsReferenceKind_Array := Empty) is + Kinds : LSP.Structures.AlsReferenceKind_Set := LSP.Constants.Empty) is begin if not Node.Is_Synthetic then - Result.Append (To_LSP_Location (Self, Node)); + Result.Append (To_LSP_Location (Self, Node, Kinds)); end if; end Append_Location; @@ -158,7 +158,8 @@ package body LSP.Ada_Handlers.Locations is (Self : in out Message_Handler'Class; Context : LSP.Ada_Contexts.Context; File : String; - Sloc : Langkit_Support.Slocs.Source_Location_Range) + Sloc : Langkit_Support.Slocs.Source_Location_Range; + Kinds : LSP.Structures.AlsReferenceKind_Set := LSP.Constants.Empty) return LSP.Structures.Location is use type LSP.Ada_Documents.Document_Access; @@ -173,12 +174,13 @@ package body LSP.Ada_Handlers.Locations is begin if Doc /= null then - return Doc.To_LSP_Location (Sloc); + return Doc.To_LSP_Location (Sloc, Kinds); else return (uri => URI, a_range => To_LSP_Range - (Context.Get_AU (GNATCOLL.VFS.Create_From_UTF8 (File)), Sloc)); + (Context.Get_AU (GNATCOLL.VFS.Create_From_UTF8 (File)), Sloc), + alsKind => Kinds); end if; end To_LSP_Location; @@ -188,7 +190,8 @@ package body LSP.Ada_Handlers.Locations is function To_LSP_Location (Self : in out Message_Handler'Class; - Node : Libadalang.Analysis.Ada_Node'Class) + Node : Libadalang.Analysis.Ada_Node'Class; + Kind : LSP.Structures.AlsReferenceKind_Set := LSP.Constants.Empty) return LSP.Structures.Location is use type LSP.Ada_Documents.Document_Access; @@ -206,12 +209,13 @@ package body LSP.Ada_Handlers.Locations is begin if Doc /= null then - return Doc.To_LSP_Location (Sloc); + return Doc.To_LSP_Location (Sloc, Kind); else return (uri => URI, - a_range => To_LSP_Range (Node.Unit, Sloc)); + a_range => To_LSP_Range (Node.Unit, Sloc), + alsKind => Kind); end if; end To_LSP_Location; diff --git a/source/ada/lsp-ada_handlers-locations.ads b/source/ada/lsp-ada_handlers-locations.ads index 855afba0b..47601e02a 100644 --- a/source/ada/lsp-ada_handlers-locations.ads +++ b/source/ada/lsp-ada_handlers-locations.ads @@ -25,12 +25,14 @@ with Libadalang.Analysis; with Libadalang.Common; with LSP.Ada_Contexts; +with LSP.Constants; package LSP.Ada_Handlers.Locations is function To_LSP_Location (Self : in out Message_Handler'Class; - Node : Libadalang.Analysis.Ada_Node'Class) + Node : Libadalang.Analysis.Ada_Node'Class; + Kind : LSP.Structures.AlsReferenceKind_Set := LSP.Constants.Empty) return LSP.Structures.Location; -- Convert LAL's Node to a LSP location @@ -38,7 +40,8 @@ package LSP.Ada_Handlers.Locations is (Self : in out Message_Handler'Class; Context : LSP.Ada_Contexts.Context; File : String; - Sloc : Langkit_Support.Slocs.Source_Location_Range) + Sloc : Langkit_Support.Slocs.Source_Location_Range; + Kinds : LSP.Structures.AlsReferenceKind_Set := LSP.Constants.Empty) return LSP.Structures.Location; function Get_Node_At @@ -51,26 +54,11 @@ package LSP.Ada_Handlers.Locations is (Token : Libadalang.Common.Token_Reference) return LSP.Structures.Position; - type AlsReferenceKind is - (Simple, - Access_Ref, - Write, - Static_Call, - Dispatching_Call, - Parent, - Child, - Overriding_Decl); - -- This should be part of the protocol - - type AlsReferenceKind_Array is array (AlsReferenceKind) of Boolean; - - function Empty return AlsReferenceKind_Array is ([others => False]); - procedure Append_Location (Self : in out Message_Handler; Result : in out LSP.Structures.Location_Vector; Node : Libadalang.Analysis.Ada_Node'Class; - Ignore : AlsReferenceKind_Array := Empty); + Kinds : LSP.Structures.AlsReferenceKind_Set := LSP.Constants.Empty); -- Append given Node location to the Result. -- Do nothing if the item inside of an synthetic file (like __standard). diff --git a/source/ada/lsp-ada_handlers-refactor.adb b/source/ada/lsp-ada_handlers-refactor.adb index bfa834671..7e18e71e4 100644 --- a/source/ada/lsp-ada_handlers-refactor.adb +++ b/source/ada/lsp-ada_handlers-refactor.adb @@ -77,7 +77,8 @@ package body LSP.Ada_Handlers.Refactor is (LSP.Structures.DiagnosticRelatedInformation'( location => LSP.Structures.Location' (uri => To_DocumentUri (Problem.Filename), - a_range => LSP.Utils.To_Range (Problem.Location)), + a_range => LSP.Utils.To_Range (Problem.Location), + alsKind => LSP.Constants.Empty), message => VSS.Strings.Conversions.To_Virtual_String (Problem.Info))); diff --git a/source/ada/lsp-ada_handlers.adb b/source/ada/lsp-ada_handlers.adb index f6cdd0826..8b06569ca 100644 --- a/source/ada/lsp-ada_handlers.adb +++ b/source/ada/lsp-ada_handlers.adb @@ -98,14 +98,13 @@ package body LSP.Ada_Handlers is pragma Style_Checks ("o"); -- check subprogram bodies in alphabetical ordr - subtype AlsReferenceKind_Array is - LSP.Ada_Handlers.Locations.AlsReferenceKind_Array; + subtype AlsReferenceKind_Array is LSP.Structures.AlsReferenceKind_Set; function Is_Parent return AlsReferenceKind_Array is - ([LSP.Ada_Handlers.Locations.Parent => True, others => False]); + ([LSP.Enumerations.parent => True, others => False]); function Is_Child return AlsReferenceKind_Array is - ([LSP.Ada_Handlers.Locations.Child => True, others => False]); + ([LSP.Enumerations.child => True, others => False]); function Contexts_For_URI (Self : access Message_Handler; @@ -144,7 +143,8 @@ package body LSP.Ada_Handlers is function To_LSP_Location (Self : in out Message_Handler'Class; - Node : Libadalang.Analysis.Ada_Node'Class) + Node : Libadalang.Analysis.Ada_Node'Class; + Kind : LSP.Structures.AlsReferenceKind_Set := LSP.Constants.Empty) return LSP.Structures.Location renames LSP.Ada_Handlers.Locations.To_LSP_Location; @@ -159,7 +159,7 @@ package body LSP.Ada_Handlers is (Self : in out Message_Handler; Result : in out LSP.Structures.Location_Vector; Node : Libadalang.Analysis.Ada_Node'Class; - Ignore : AlsReferenceKind_Array := LSP.Ada_Handlers.Locations.Empty) + Kinds : AlsReferenceKind_Array := LSP.Constants.Empty) renames LSP.Ada_Handlers.Locations.Append_Location; function Imprecise_Resolve_Name @@ -576,7 +576,8 @@ package body LSP.Ada_Handlers is Commands_Vector => Result, Where => (uri => Value.textDocument.uri, - a_range => Value.a_range)); + a_range => Value.a_range, + alsKind => LSP.Constants.Empty)); Found := True; end if; @@ -614,7 +615,8 @@ package body LSP.Ada_Handlers is Commands_Vector => Result, Where => (uri => Value.textDocument.uri, - a_range => Value.a_range), + a_range => Value.a_range, + alsKind => LSP.Constants.Empty), Syntax_Rules => Syntax_Rules); Found := True; @@ -659,7 +661,8 @@ package body LSP.Ada_Handlers is Commands_Vector => Result, Where => (Value.textDocument.uri, - Value.a_range), + Value.a_range, + LSP.Constants.Empty), Subprogram_Kind => Ada_Subp_Kind_Procedure); end if; @@ -669,7 +672,8 @@ package body LSP.Ada_Handlers is Commands_Vector => Result, Where => (Value.textDocument.uri, - Value.a_range), + Value.a_range, + LSP.Constants.Empty), Subprogram_Kind => Ada_Subp_Kind_Function); end if; @@ -859,7 +863,8 @@ package body LSP.Ada_Handlers is Commands_Vector => Result, Where => (uri => Value.textDocument.uri, - a_range => Value.a_range)); + a_range => Value.a_range, + alsKind => LSP.Constants.Empty)); Found := True; end if; @@ -974,7 +979,8 @@ package body LSP.Ada_Handlers is Commands_Vector => Result, Where => (uri => Value.textDocument.uri, - a_range => Value.a_range)); + a_range => Value.a_range, + alsKind => LSP.Constants.Empty)); Found := True; end if; @@ -1005,7 +1011,8 @@ package body LSP.Ada_Handlers is Commands_Vector => Result, Where => (Value.textDocument.uri, - Value.a_range)); + Value.a_range, + LSP.Constants.Empty)); Found := True; end if; @@ -1037,7 +1044,8 @@ package body LSP.Ada_Handlers is Commands_Vector => Result, Where => (uri => Value.textDocument.uri, - a_range => Value.a_range)); + a_range => Value.a_range, + alsKind => LSP.Constants.Empty)); Found := True; end if; @@ -1102,7 +1110,8 @@ package body LSP.Ada_Handlers is Commands_Vector => Result, Where => (Value.textDocument.uri, - Value.a_range), + Value.a_range, + LSP.Constants.Empty), Requires_Full_Specification => Requires_Full_Specification); @@ -2817,35 +2826,6 @@ package body LSP.Ada_Handlers is end if; end On_Formatting_Request; - --------------------- - -- On_Full_Request -- - --------------------- - - overriding procedure On_Full_Request - (Self : in out Message_Handler; - Id : LSP.Structures.Integer_Or_Virtual_String; - Value : LSP.Structures.SemanticTokensParams) - is - use type LSP.Ada_Documents.Document_Access; - - Document : constant LSP.Ada_Documents.Document_Access := - Self.Get_Open_Document (Value.textDocument.uri); - - Context : constant LSP.Ada_Context_Sets.Context_Access := - Self.Contexts.Get_Best_Context (Value.textDocument.uri); - - Response : LSP.Structures.SemanticTokens_Or_Null (Is_Null => False); - - Result : LSP.Structures.Natural_Vector renames - Response.Value.data; - begin - if Document /= null then - Result := Document.Get_Tokens (Context.all, Self.Highlighter); - end if; - - Self.Sender.On_Full_Response (Id, Response); - end On_Full_Request; - ---------------------- -- On_Hover_Request -- ---------------------- @@ -3045,7 +3025,7 @@ package body LSP.Ada_Handlers is -- First list the bodies of this definition Update_Response (Laltools.Common.List_Bodies_Of (Definition, Trace, Imprecise), - LSP.Ada_Handlers.Locations.Empty); + LSP.Constants.Empty); -- Then list the bodies of the parent implementations Decl := Definition.P_Basic_Decl; @@ -3354,7 +3334,7 @@ package body LSP.Ada_Handlers is Id : LSP.Structures.Integer_Or_Virtual_String; Value : LSP.Structures.ReferenceParams) is - use all type LSP.Ada_Handlers.Locations.AlsReferenceKind; + use all type LSP.Enumerations.AlsReferenceKind; Response : LSP.Structures.Location_Vector_Or_Null; Imprecise : Boolean := False; @@ -3389,14 +3369,14 @@ package body LSP.Ada_Handlers is Result : AlsReferenceKind_Array := [others => False]; begin begin - Result (Write) := Id.P_Is_Write_Reference; + Result (write) := Id.P_Is_Write_Reference; exception when E : Libadalang.Common.Property_Error => Self.Tracer.Trace_Exception (E); end; begin - Result (Access_Ref) := + Result (an_access) := Laltools.Common.Is_Access_Ref (Id.As_Ada_Node); exception when E : Libadalang.Common.Property_Error => @@ -3404,14 +3384,14 @@ package body LSP.Ada_Handlers is end; begin - Result (Static_Call) := Id.P_Is_Static_Call; + Result (call) := Id.P_Is_Static_Call; exception when E : Libadalang.Common.Property_Error => Self.Tracer.Trace_Exception (E); end; begin - Result (Dispatching_Call) := + Result (dispatching_call) := Id.P_Is_Dispatching_Call; exception when E : Libadalang.Common.Property_Error => @@ -3419,19 +3399,19 @@ package body LSP.Ada_Handlers is end; begin - Result (Child) := + Result (child) := Laltools.Common.Is_Type_Derivation (Id.As_Ada_Node); exception when E : Libadalang.Common.Property_Error => Self.Tracer.Trace_Exception (E); end; - Result (Overriding_Decl) := Is_Overriding_Decl; + Result (an_overriding) := Is_Overriding_Decl; -- If the result has not any set flags at this point, flag it as a -- simple reference. if Result = [Result'Range => False] then - Result (Simple) := True; + Result (reference) := True; end if; -- Apply additional kinds @@ -3487,7 +3467,7 @@ package body LSP.Ada_Handlers is if not Decl.Is_Null and then Libadalang.Analysis.Kind (Decl) = Ada_Enum_Literal_Decl then - Additional_Kinds (Simple) := True; + Additional_Kinds (reference) := True; end if; -- Find all the references @@ -3968,6 +3948,35 @@ package body LSP.Ada_Handlers is Self.Sender.On_Symbol_Response (Id, Response); end On_Symbol_Request; + ---------------------------- + -- On_Tokens_Full_Request -- + ---------------------------- + + overriding procedure On_Tokens_Full_Request + (Self : in out Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SemanticTokensParams) + is + use type LSP.Ada_Documents.Document_Access; + + Document : constant LSP.Ada_Documents.Document_Access := + Self.Get_Open_Document (Value.textDocument.uri); + + Context : constant LSP.Ada_Context_Sets.Context_Access := + Self.Contexts.Get_Best_Context (Value.textDocument.uri); + + Response : LSP.Structures.SemanticTokens_Or_Null (Is_Null => False); + + Result : LSP.Structures.Natural_Vector renames + Response.Value.data; + begin + if Document /= null then + Result := Document.Get_Tokens (Context.all, Self.Highlighter); + end if; + + Self.Sender.On_Tokens_Full_Response (Id, Response); + end On_Tokens_Full_Request; + ----------------------------- -- On_Tokens_Range_Request -- ----------------------------- @@ -3995,7 +4004,7 @@ package body LSP.Ada_Handlers is (Context.all, Self.Highlighter, Value.a_range); end if; - Self.Sender.On_Full_Response (Id, Response); + Self.Sender.On_Tokens_Full_Response (Id, Response); end On_Tokens_Range_Request; ------------------------------- diff --git a/source/ada/lsp-ada_handlers.ads b/source/ada/lsp-ada_handlers.ads index 0406ae232..ee32cff30 100644 --- a/source/ada/lsp-ada_handlers.ads +++ b/source/ada/lsp-ada_handlers.ads @@ -331,7 +331,7 @@ private Id : LSP.Structures.Integer_Or_Virtual_String; Value : LSP.Structures.DocumentFormattingParams); - overriding procedure On_Full_Request + overriding procedure On_Tokens_Full_Request (Self : in out Message_Handler; Id : LSP.Structures.Integer_Or_Virtual_String; Value : LSP.Structures.SemanticTokensParams); diff --git a/source/ada/lsp-utils.adb b/source/ada/lsp-utils.adb index b296e62a8..0c69252c5 100644 --- a/source/ada/lsp-utils.adb +++ b/source/ada/lsp-utils.adb @@ -411,7 +411,8 @@ package body LSP.Utils is (VSS.Strings.Conversions.To_Virtual_String (URIs.Conversions.From_File (Unit.Get_Filename)) with null record), - a_range => To_Range (Span)); + a_range => To_Range (Span), + alsKind => LSP.Constants.Empty); end Get_Location; ----------------------- diff --git a/source/lsp_3.17/lsp-constants.ads b/source/lsp_3.17/lsp-constants.ads index 2ec4e7aa6..48f9b8eb5 100644 --- a/source/lsp_3.17/lsp-constants.ads +++ b/source/lsp_3.17/lsp-constants.ads @@ -131,6 +131,9 @@ package LSP.Constants is function Empty return LSP.Structures.SymbolTag_Set is [others => False]; + function Empty return LSP.Structures.AlsReferenceKind_Set is + [others => False]; + function Error return LSP.Structures.DiagnosticSeverity_Optional is (Is_Set => True, Value => LSP.Enumerations.Error); diff --git a/source/server/lsp-unimplemented_handlers.adb b/source/server/lsp-unimplemented_handlers.adb index 78e5844cc..8d7e93efa 100644 --- a/source/server/lsp-unimplemented_handlers.adb +++ b/source/server/lsp-unimplemented_handlers.adb @@ -259,7 +259,7 @@ package body LSP.Unimplemented_Handlers is -- On_Full_Request -- --------------------- - overriding procedure On_Full_Request + overriding procedure On_Tokens_Full_Request (Self : in out Unimplemented_Handler; Id : LSP.Structures.Integer_Or_Virtual_String; Value : LSP.Structures.SemanticTokensParams) @@ -267,7 +267,7 @@ package body LSP.Unimplemented_Handlers is begin Self.Implemented := False; - end On_Full_Request; + end On_Tokens_Full_Request; ---------------------- -- On_Hover_Request -- diff --git a/source/server/lsp-unimplemented_handlers.ads b/source/server/lsp-unimplemented_handlers.ads index e534e013e..5ac711fb9 100644 --- a/source/server/lsp-unimplemented_handlers.ads +++ b/source/server/lsp-unimplemented_handlers.ads @@ -208,7 +208,7 @@ package LSP.Unimplemented_Handlers is Id : LSP.Structures.Integer_Or_Virtual_String; Value : LSP.Structures.SelectionRangeParams); - overriding procedure On_Full_Request + overriding procedure On_Tokens_Full_Request (Self : in out Unimplemented_Handler; Id : LSP.Structures.Integer_Or_Virtual_String; Value : LSP.Structures.SemanticTokensParams); From cb8bc2805960a6c8ed8b8a2c2af0f31849a846b3 Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Mon, 4 Sep 2023 19:26:13 +0300 Subject: [PATCH 087/152] Enable more tests Refs #1170 --- source/ada/lsp-ada_client_capabilities.adb | 2 + source/ada/lsp-ada_handlers.adb | 6 +-- .../test.yaml | 3 -- testsuite/ada_lsp/find_all_refs/test.yaml | 3 -- .../ada_lsp/find_all_refs_kinds/test.yaml | 3 -- .../ada_lsp/find_all_refs_subp/test.yaml | 3 -- testsuite/ada_lsp/references.child/test.json | 25 ++--------- testsuite/ada_lsp/references.child/test.yaml | 3 -- .../ada_lsp/references.overriding/test.json | 43 +------------------ .../ada_lsp/references.overriding/test.yaml | 3 -- 10 files changed, 10 insertions(+), 84 deletions(-) diff --git a/source/ada/lsp-ada_client_capabilities.adb b/source/ada/lsp-ada_client_capabilities.adb index 336bec6c0..9132c3bfd 100644 --- a/source/ada/lsp-ada_client_capabilities.adb +++ b/source/ada/lsp-ada_client_capabilities.adb @@ -214,6 +214,8 @@ package body LSP.Ada_Client_Capabilities is begin return Result : LSP.Structures.ServerCapabilities do + Result.alsReferenceKinds := (others => True); + Result.textDocumentSync := (Is_Set => True, Value => diff --git a/source/ada/lsp-ada_handlers.adb b/source/ada/lsp-ada_handlers.adb index 8b06569ca..3112c8398 100644 --- a/source/ada/lsp-ada_handlers.adb +++ b/source/ada/lsp-ada_handlers.adb @@ -2987,7 +2987,7 @@ package body LSP.Ada_Handlers is procedure Update_Response (Bodies : Laltools.Common.Bodies_List.List; - Ignore : AlsReferenceKind_Array); + Kinds : AlsReferenceKind_Array); -- Utility function to update response with the bodies --------------------- @@ -2996,11 +2996,11 @@ package body LSP.Ada_Handlers is procedure Update_Response (Bodies : Laltools.Common.Bodies_List.List; - Ignore : AlsReferenceKind_Array) + Kinds : AlsReferenceKind_Array) is begin for E of Bodies loop - Self.Append_Location (Vector, E); + Self.Append_Location (Vector, E, Kinds); end loop; end Update_Response; diff --git a/testsuite/ada_lsp/JB24-033.xrefs.no_refs_for_non_loaded_projects/test.yaml b/testsuite/ada_lsp/JB24-033.xrefs.no_refs_for_non_loaded_projects/test.yaml index 163f229a4..dda78a768 100644 --- a/testsuite/ada_lsp/JB24-033.xrefs.no_refs_for_non_loaded_projects/test.yaml +++ b/testsuite/ada_lsp/JB24-033.xrefs.no_refs_for_non_loaded_projects/test.yaml @@ -1,4 +1 @@ title: 'JB24-033.xrefs.no_refs_for_non_loaded_projects' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/find_all_refs/test.yaml b/testsuite/ada_lsp/find_all_refs/test.yaml index 64dbb17fa..4be0e72c6 100644 --- a/testsuite/ada_lsp/find_all_refs/test.yaml +++ b/testsuite/ada_lsp/find_all_refs/test.yaml @@ -1,4 +1 @@ title: 'find_all_refs' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/find_all_refs_kinds/test.yaml b/testsuite/ada_lsp/find_all_refs_kinds/test.yaml index b0e63542e..6cd2cddd6 100644 --- a/testsuite/ada_lsp/find_all_refs_kinds/test.yaml +++ b/testsuite/ada_lsp/find_all_refs_kinds/test.yaml @@ -1,4 +1 @@ title: 'find_all_refs_kinds' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/find_all_refs_subp/test.yaml b/testsuite/ada_lsp/find_all_refs_subp/test.yaml index e2d8d38e1..5038036ed 100644 --- a/testsuite/ada_lsp/find_all_refs_subp/test.yaml +++ b/testsuite/ada_lsp/find_all_refs_subp/test.yaml @@ -1,4 +1 @@ title: 'find_all_refs_subp' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/references.child/test.json b/testsuite/ada_lsp/references.child/test.json index 41e599d79..26bf92566 100644 --- a/testsuite/ada_lsp/references.child/test.json +++ b/testsuite/ada_lsp/references.child/test.json @@ -51,33 +51,14 @@ "id": 1, "result": { "capabilities": { - "typeDefinitionProvider": true, "alsReferenceKinds": [ + "", "reference", - "access", - "write", - "call", - "dispatching call", - "parent", - "child", - "overriding" + "child" ], - "hoverProvider": true, "definitionProvider": true, - "renameProvider": {}, "referencesProvider": true, - "textDocumentSync": 2, - "declarationProvider": true, - "completionProvider": { - "triggerCharacters": [ - ".", - ",", - "'", - "(" - ], - "resolveProvider": true - }, - "documentSymbolProvider": true + "textDocumentSync": 2 } } } diff --git a/testsuite/ada_lsp/references.child/test.yaml b/testsuite/ada_lsp/references.child/test.yaml index c14c644af..5bb27a1b4 100644 --- a/testsuite/ada_lsp/references.child/test.yaml +++ b/testsuite/ada_lsp/references.child/test.yaml @@ -1,4 +1 @@ title: 'references.child' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/references.overriding/test.json b/testsuite/ada_lsp/references.overriding/test.json index b4183c71d..1227864c1 100644 --- a/testsuite/ada_lsp/references.overriding/test.json +++ b/testsuite/ada_lsp/references.overriding/test.json @@ -74,50 +74,11 @@ "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": {}, - "documentFormattingProvider": true, - "renameProvider": {}, - "foldingRangeProvider": true, - "workspaceSymbolProvider": true, - "callHierarchyProvider": {}, - "alsShowDepsProvider": true, "alsReferenceKinds": [ - "reference", - "access", - "write", - "call", - "dispatching call", - "parent", - "child", + "", "overriding" - ], - "alsCheckSyntaxProvider": true + ] } } } diff --git a/testsuite/ada_lsp/references.overriding/test.yaml b/testsuite/ada_lsp/references.overriding/test.yaml index a1be780ea..892e2b5ef 100644 --- a/testsuite/ada_lsp/references.overriding/test.yaml +++ b/testsuite/ada_lsp/references.overriding/test.yaml @@ -1,4 +1 @@ title: 'references.overriding' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] From f4e5afcb9fedeaf68e886c52419353935c4087f5 Mon Sep 17 00:00:00 2001 From: Andry Ogorodnik Date: Tue, 5 Sep 2023 13:10:49 +0000 Subject: [PATCH 088/152] Enable tests --- ...ada_handlers-named_parameters_commands.adb | 4 ++ ...sp-ada_handlers-refactor-add_parameter.adb | 4 ++ ...andlers-refactor-change_parameter_mode.adb | 4 ++ ...factor-change_parameters_default_value.adb | 6 ++- ...ndlers-refactor-change_parameters_type.adb | 4 ++ ...a_handlers-refactor-extract_subprogram.adb | 8 +++- ...ada_handlers-refactor-imports_commands.adb | 4 ++ ..._handlers-refactor-introduce_parameter.adb | 4 ++ ...p-ada_handlers-refactor-move_parameter.adb | 4 ++ ..._handlers-refactor-pull_up_declaration.adb | 4 ++ ...ada_handlers-refactor-remove_parameter.adb | 4 ++ ...lsp-ada_handlers-refactor-replace_type.adb | 4 ++ ...da_handlers-refactor-sort_dependencies.adb | 4 ++ ...da_handlers-refactor-suppress_seperate.adb | 4 ++ .../test.json | 16 +++---- .../test.json | 20 ++++---- .../test.json | 24 +++++----- .../TB12-017.named.parameters.0.json | 47 +++---------------- .../TB12-017.named.parameters.0/test.yaml | 3 -- .../TB12-017.named.parameters.1.json | 47 +++---------------- .../TB12-017.named.parameters.1/test.yaml | 3 -- .../test.json | 16 +++---- .../test.json | 16 +++---- .../refactor_imports_commands.json | 20 ++++---- .../SA11-051/test.json | 8 ++-- .../V207-019/test.json | 8 ++-- 26 files changed, 137 insertions(+), 153 deletions(-) diff --git a/source/ada/lsp-ada_handlers-named_parameters_commands.adb b/source/ada/lsp-ada_handlers-named_parameters_commands.adb index e7ba4a029..ebec38c23 100644 --- a/source/ada/lsp-ada_handlers-named_parameters_commands.adb +++ b/source/ada/lsp-ada_handlers-named_parameters_commands.adb @@ -67,6 +67,8 @@ package body LSP.Ada_Handlers.Named_Parameters_Commands is C : Cursor := Any.First; begin return Self : Command do + pragma Assert (Element (C).Kind = Start_Array); + Next (C); pragma Assert (Element (C).Kind = Start_Object); Next (C); @@ -521,6 +523,7 @@ package body LSP.Ada_Handlers.Named_Parameters_Commands is Result : LSP.Structures.LSPAny_Vector; begin + Result.Append (JSON_Stream_Element'(Kind => Start_Array)); Result.Append (JSON_Stream_Element'(Kind => Start_Object)); -- "context" @@ -536,6 +539,7 @@ package body LSP.Ada_Handlers.Named_Parameters_Commands is To_Any (Self.Versioned_Documents, Result); Result.Append (JSON_Stream_Element'(Kind => End_Object)); + Result.Append (JSON_Stream_Element'(Kind => End_Array)); return Result; end Write_Command; diff --git a/source/ada/lsp-ada_handlers-refactor-add_parameter.adb b/source/ada/lsp-ada_handlers-refactor-add_parameter.adb index e541b62d9..efe0cadaf 100644 --- a/source/ada/lsp-ada_handlers-refactor-add_parameter.adb +++ b/source/ada/lsp-ada_handlers-refactor-add_parameter.adb @@ -88,6 +88,8 @@ package body LSP.Ada_Handlers.Refactor.Add_Parameter is C : Cursor := Any.First; begin return Self : Command do + pragma Assert (Element (C).Kind = Start_Array); + Next (C); pragma Assert (Element (C).Kind = Start_Object); Next (C); @@ -191,6 +193,7 @@ package body LSP.Ada_Handlers.Refactor.Add_Parameter is Result : LSP.Structures.LSPAny_Vector; begin + Result.Append (JSON_Stream_Element'(Kind => Start_Array)); Result.Append (JSON_Stream_Element'(Kind => Start_Object)); -- "context_id" @@ -210,6 +213,7 @@ package body LSP.Ada_Handlers.Refactor.Add_Parameter is To_Any (Self.Requires_Full_Specification, Result); Result.Append (JSON_Stream_Element'(Kind => End_Object)); + Result.Append (JSON_Stream_Element'(Kind => End_Array)); return Result; end Write_Command; diff --git a/source/ada/lsp-ada_handlers-refactor-change_parameter_mode.adb b/source/ada/lsp-ada_handlers-refactor-change_parameter_mode.adb index 2569d39b5..1ff9949f2 100644 --- a/source/ada/lsp-ada_handlers-refactor-change_parameter_mode.adb +++ b/source/ada/lsp-ada_handlers-refactor-change_parameter_mode.adb @@ -201,6 +201,8 @@ package body LSP.Ada_Handlers.Refactor.Change_Parameter_Mode is C : Cursor := Any.First; begin return Self : Command do + pragma Assert (Element (C).Kind = Start_Array); + Next (C); pragma Assert (Element (C).Kind = Start_Object); Next (C); @@ -348,6 +350,7 @@ package body LSP.Ada_Handlers.Refactor.Change_Parameter_Mode is Result : LSP.Structures.LSPAny_Vector; begin + Result.Append (JSON_Stream_Element'(Kind => Start_Array)); Result.Append (JSON_Stream_Element'(Kind => Start_Object)); -- "context" @@ -371,6 +374,7 @@ package body LSP.Ada_Handlers.Refactor.Change_Parameter_Mode is To_Any (Self.New_Mode, Result); Result.Append (JSON_Stream_Element'(Kind => End_Object)); + Result.Append (JSON_Stream_Element'(Kind => End_Array)); return Result; end Write_Command; diff --git a/source/ada/lsp-ada_handlers-refactor-change_parameters_default_value.adb b/source/ada/lsp-ada_handlers-refactor-change_parameters_default_value.adb index bf7721cd3..d098b932f 100644 --- a/source/ada/lsp-ada_handlers-refactor-change_parameters_default_value.adb +++ b/source/ada/lsp-ada_handlers-refactor-change_parameters_default_value.adb @@ -22,7 +22,7 @@ ------------------------------------------------------------------------------ with Langkit_Support.Slocs; use Langkit_Support.Slocs; -with Libadalang.Analysis; use Libadalang.Analysis; +with Libadalang.Analysis; use Libadalang.Analysis; with LAL_Refactor.Subprogram_Signature.Change_Parameters_Default_Value; @@ -91,6 +91,8 @@ package body LSP.Ada_Handlers.Refactor.Change_Parameters_Default_Value is C : Cursor := Any.First; begin return Self : Command do + pragma Assert (Element (C).Kind = Start_Array); + Next (C); pragma Assert (Element (C).Kind = Start_Object); Next (C); @@ -198,6 +200,7 @@ package body LSP.Ada_Handlers.Refactor.Change_Parameters_Default_Value is Result : LSP.Structures.LSPAny_Vector; begin + Result.Append (JSON_Stream_Element'(Kind => Start_Array)); Result.Append (JSON_Stream_Element'(Kind => Start_Object)); -- "context" @@ -213,6 +216,7 @@ package body LSP.Ada_Handlers.Refactor.Change_Parameters_Default_Value is To_Any (Self.New_Parameters_Default_Value, Result); Result.Append (JSON_Stream_Element'(Kind => End_Object)); + Result.Append (JSON_Stream_Element'(Kind => End_Array)); return Result; end Write_Command; diff --git a/source/ada/lsp-ada_handlers-refactor-change_parameters_type.adb b/source/ada/lsp-ada_handlers-refactor-change_parameters_type.adb index afe0c9f9c..8dd963955 100644 --- a/source/ada/lsp-ada_handlers-refactor-change_parameters_type.adb +++ b/source/ada/lsp-ada_handlers-refactor-change_parameters_type.adb @@ -115,6 +115,8 @@ package body LSP.Ada_Handlers.Refactor.Change_Parameters_Type is C : Cursor := Any.First; begin return Self : Command do + pragma Assert (Element (C).Kind = Start_Array); + Next (C); pragma Assert (Element (C).Kind = Start_Object); Next (C); @@ -227,6 +229,7 @@ package body LSP.Ada_Handlers.Refactor.Change_Parameters_Type is Result : LSP.Structures.LSPAny_Vector; begin + Result.Append (JSON_Stream_Element'(Kind => Start_Array)); Result.Append (JSON_Stream_Element'(Kind => Start_Object)); -- "context" @@ -246,6 +249,7 @@ package body LSP.Ada_Handlers.Refactor.Change_Parameters_Type is To_Any (Self.Syntax_Rules, Result); Result.Append (JSON_Stream_Element'(Kind => End_Object)); + Result.Append (JSON_Stream_Element'(Kind => End_Array)); return Result; end Write_Command; diff --git a/source/ada/lsp-ada_handlers-refactor-extract_subprogram.adb b/source/ada/lsp-ada_handlers-refactor-extract_subprogram.adb index dd13d265d..22c584050 100644 --- a/source/ada/lsp-ada_handlers-refactor-extract_subprogram.adb +++ b/source/ada/lsp-ada_handlers-refactor-extract_subprogram.adb @@ -17,8 +17,8 @@ with Langkit_Support.Slocs; use Langkit_Support.Slocs; -with Libadalang.Analysis; use Libadalang.Analysis; -with Libadalang.Common; use Libadalang.Common; +with Libadalang.Analysis; use Libadalang.Analysis; +with Libadalang.Common; use Libadalang.Common; with LAL_Refactor; use LAL_Refactor; with LAL_Refactor.Extract_Subprogram; @@ -95,6 +95,8 @@ package body LSP.Ada_Handlers.Refactor.Extract_Subprogram is C : Cursor := Any.First; begin return Self : Command do + pragma Assert (Element (C).Kind = Start_Array); + Next (C); pragma Assert (Element (C).Kind = Start_Object); Next (C); @@ -205,6 +207,7 @@ package body LSP.Ada_Handlers.Refactor.Extract_Subprogram is Result : LSP.Structures.LSPAny_Vector; begin + Result.Append (JSON_Stream_Element'(Kind => Start_Array)); Result.Append (JSON_Stream_Element'(Kind => Start_Object)); -- "context_id" @@ -223,6 +226,7 @@ package body LSP.Ada_Handlers.Refactor.Extract_Subprogram is Result); Result.Append (JSON_Stream_Element'(Kind => End_Object)); + Result.Append (JSON_Stream_Element'(Kind => End_Array)); return Result; end Write_Command; diff --git a/source/ada/lsp-ada_handlers-refactor-imports_commands.adb b/source/ada/lsp-ada_handlers-refactor-imports_commands.adb index 1eadb99bc..c8b58bcdd 100644 --- a/source/ada/lsp-ada_handlers-refactor-imports_commands.adb +++ b/source/ada/lsp-ada_handlers-refactor-imports_commands.adb @@ -64,6 +64,8 @@ package body LSP.Ada_Handlers.Refactor.Imports_Commands is C : Cursor := Any.First; begin return Self : Command do + pragma Assert (Element (C).Kind = Start_Array); + Next (C); pragma Assert (Element (C).Kind = Start_Object); Next (C); @@ -353,6 +355,7 @@ package body LSP.Ada_Handlers.Refactor.Imports_Commands is Result : LSP.Structures.LSPAny_Vector; begin + Result.Append (JSON_Stream_Element'(Kind => Start_Array)); Result.Append (JSON_Stream_Element'(Kind => Start_Object)); -- "context" @@ -372,6 +375,7 @@ package body LSP.Ada_Handlers.Refactor.Imports_Commands is To_Any (Self.Prefix, Result); Result.Append (JSON_Stream_Element'(Kind => End_Object)); + Result.Append (JSON_Stream_Element'(Kind => End_Array)); return Result; end Write_Command; diff --git a/source/ada/lsp-ada_handlers-refactor-introduce_parameter.adb b/source/ada/lsp-ada_handlers-refactor-introduce_parameter.adb index c64bcd103..f7151560a 100644 --- a/source/ada/lsp-ada_handlers-refactor-introduce_parameter.adb +++ b/source/ada/lsp-ada_handlers-refactor-introduce_parameter.adb @@ -81,6 +81,8 @@ package body LSP.Ada_Handlers.Refactor.Introduce_Parameter is C : Cursor := Any.First; begin return Self : Command do + pragma Assert (Element (C).Kind = Start_Array); + Next (C); pragma Assert (Element (C).Kind = Start_Object); Next (C); @@ -173,6 +175,7 @@ package body LSP.Ada_Handlers.Refactor.Introduce_Parameter is Result : LSP.Structures.LSPAny_Vector; begin + Result.Append (JSON_Stream_Element'(Kind => Start_Array)); Result.Append (JSON_Stream_Element'(Kind => Start_Object)); -- "context_id" @@ -184,6 +187,7 @@ package body LSP.Ada_Handlers.Refactor.Introduce_Parameter is To_Any (Self.Where, Result); Result.Append (JSON_Stream_Element'(Kind => End_Object)); + Result.Append (JSON_Stream_Element'(Kind => End_Array)); return Result; end Write_Command; diff --git a/source/ada/lsp-ada_handlers-refactor-move_parameter.adb b/source/ada/lsp-ada_handlers-refactor-move_parameter.adb index 1e3454c0b..7313a34d6 100644 --- a/source/ada/lsp-ada_handlers-refactor-move_parameter.adb +++ b/source/ada/lsp-ada_handlers-refactor-move_parameter.adb @@ -151,6 +151,8 @@ package body LSP.Ada_Handlers.Refactor.Move_Parameter is C : Cursor := Any.First; begin return Self : Command do + pragma Assert (Element (C).Kind = Start_Array); + Next (C); pragma Assert (Element (C).Kind = Start_Object); Next (C); @@ -260,6 +262,7 @@ package body LSP.Ada_Handlers.Refactor.Move_Parameter is Result : LSP.Structures.LSPAny_Vector; begin + Result.Append (JSON_Stream_Element'(Kind => Start_Array)); Result.Append (JSON_Stream_Element'(Kind => Start_Object)); -- "context" @@ -279,6 +282,7 @@ package body LSP.Ada_Handlers.Refactor.Move_Parameter is To_Any (Self.Direction, Result); Result.Append (JSON_Stream_Element'(Kind => End_Object)); + Result.Append (JSON_Stream_Element'(Kind => End_Array)); return Result; end Write_Command; diff --git a/source/ada/lsp-ada_handlers-refactor-pull_up_declaration.adb b/source/ada/lsp-ada_handlers-refactor-pull_up_declaration.adb index fb5f6a4fc..10341a3c6 100644 --- a/source/ada/lsp-ada_handlers-refactor-pull_up_declaration.adb +++ b/source/ada/lsp-ada_handlers-refactor-pull_up_declaration.adb @@ -83,6 +83,8 @@ package body LSP.Ada_Handlers.Refactor.Pull_Up_Declaration is C : Cursor := Any.First; begin return Self : Command do + pragma Assert (Element (C).Kind = Start_Array); + Next (C); pragma Assert (Element (C).Kind = Start_Object); Next (C); @@ -182,6 +184,7 @@ package body LSP.Ada_Handlers.Refactor.Pull_Up_Declaration is Result : LSP.Structures.LSPAny_Vector; begin + Result.Append (JSON_Stream_Element'(Kind => Start_Array)); Result.Append (JSON_Stream_Element'(Kind => Start_Object)); -- "context" @@ -193,6 +196,7 @@ package body LSP.Ada_Handlers.Refactor.Pull_Up_Declaration is To_Any (Self.Where, Result); Result.Append (JSON_Stream_Element'(Kind => End_Object)); + Result.Append (JSON_Stream_Element'(Kind => End_Array)); return Result; end Write_Command; diff --git a/source/ada/lsp-ada_handlers-refactor-remove_parameter.adb b/source/ada/lsp-ada_handlers-refactor-remove_parameter.adb index b028ff8ea..d57b61c67 100644 --- a/source/ada/lsp-ada_handlers-refactor-remove_parameter.adb +++ b/source/ada/lsp-ada_handlers-refactor-remove_parameter.adb @@ -139,6 +139,8 @@ package body LSP.Ada_Handlers.Refactor.Remove_Parameter is C : Cursor := Any.First; begin return Self : Command do + pragma Assert (Element (C).Kind = Start_Array); + Next (C); pragma Assert (Element (C).Kind = Start_Object); Next (C); @@ -253,6 +255,7 @@ package body LSP.Ada_Handlers.Refactor.Remove_Parameter is Result : LSP.Structures.LSPAny_Vector; begin + Result.Append (JSON_Stream_Element'(Kind => Start_Array)); Result.Append (JSON_Stream_Element'(Kind => Start_Object)); -- "context" @@ -272,6 +275,7 @@ package body LSP.Ada_Handlers.Refactor.Remove_Parameter is To_Any (Self.Last_Parameter, Result); Result.Append (JSON_Stream_Element'(Kind => End_Object)); + Result.Append (JSON_Stream_Element'(Kind => End_Array)); return Result; end Write_Command; diff --git a/source/ada/lsp-ada_handlers-refactor-replace_type.adb b/source/ada/lsp-ada_handlers-refactor-replace_type.adb index 155e5beb6..51ca52c02 100644 --- a/source/ada/lsp-ada_handlers-refactor-replace_type.adb +++ b/source/ada/lsp-ada_handlers-refactor-replace_type.adb @@ -85,6 +85,8 @@ package body LSP.Ada_Handlers.Refactor.Replace_Type is C : Cursor := Any.First; begin return Self : Command do + pragma Assert (Element (C).Kind = Start_Array); + Next (C); pragma Assert (Element (C).Kind = Start_Object); Next (C); @@ -183,6 +185,7 @@ package body LSP.Ada_Handlers.Refactor.Replace_Type is Result : LSP.Structures.LSPAny_Vector; begin + Result.Append (JSON_Stream_Element'(Kind => Start_Array)); Result.Append (JSON_Stream_Element'(Kind => Start_Object)); -- "context_id" @@ -198,6 +201,7 @@ package body LSP.Ada_Handlers.Refactor.Replace_Type is To_Any (Self.New_Type, Result); Result.Append (JSON_Stream_Element'(Kind => End_Object)); + Result.Append (JSON_Stream_Element'(Kind => End_Array)); return Result; end Write_Command; diff --git a/source/ada/lsp-ada_handlers-refactor-sort_dependencies.adb b/source/ada/lsp-ada_handlers-refactor-sort_dependencies.adb index 39da88126..5a9d639c1 100644 --- a/source/ada/lsp-ada_handlers-refactor-sort_dependencies.adb +++ b/source/ada/lsp-ada_handlers-refactor-sort_dependencies.adb @@ -85,6 +85,8 @@ package body LSP.Ada_Handlers.Refactor.Sort_Dependencies is C : Cursor := Any.First; begin return Self : Command do + pragma Assert (Element (C).Kind = Start_Array); + Next (C); pragma Assert (Element (C).Kind = Start_Object); Next (C); @@ -177,6 +179,7 @@ package body LSP.Ada_Handlers.Refactor.Sort_Dependencies is Result : LSP.Structures.LSPAny_Vector; begin + Result.Append (JSON_Stream_Element'(Kind => Start_Array)); Result.Append (JSON_Stream_Element'(Kind => Start_Object)); -- "context" @@ -188,6 +191,7 @@ package body LSP.Ada_Handlers.Refactor.Sort_Dependencies is To_Any (Self.Where, Result); Result.Append (JSON_Stream_Element'(Kind => End_Object)); + Result.Append (JSON_Stream_Element'(Kind => End_Array)); return Result; end Write_Command; diff --git a/source/ada/lsp-ada_handlers-refactor-suppress_seperate.adb b/source/ada/lsp-ada_handlers-refactor-suppress_seperate.adb index 19e950aae..d8a76177a 100644 --- a/source/ada/lsp-ada_handlers-refactor-suppress_seperate.adb +++ b/source/ada/lsp-ada_handlers-refactor-suppress_seperate.adb @@ -94,6 +94,8 @@ package body LSP.Ada_Handlers.Refactor.Suppress_Seperate is C : Cursor := Any.First; begin return Self : Command do + pragma Assert (Element (C).Kind = Start_Array); + Next (C); pragma Assert (Element (C).Kind = Start_Object); Next (C); @@ -198,6 +200,7 @@ package body LSP.Ada_Handlers.Refactor.Suppress_Seperate is Result : LSP.Structures.LSPAny_Vector; begin + Result.Append (JSON_Stream_Element'(Kind => Start_Array)); Result.Append (JSON_Stream_Element'(Kind => Start_Object)); -- "context" @@ -209,6 +212,7 @@ package body LSP.Ada_Handlers.Refactor.Suppress_Seperate is To_Any (Self.Where, Result); Result.Append (JSON_Stream_Element'(Kind => End_Object)); + Result.Append (JSON_Stream_Element'(Kind => End_Array)); return Result; end Write_Command; diff --git a/testsuite/ada_lsp/S314-015.refactor_change_parameter_mode_0/test.json b/testsuite/ada_lsp/S314-015.refactor_change_parameter_mode_0/test.json index c312fe152..234c2084d 100644 --- a/testsuite/ada_lsp/S314-015.refactor_change_parameter_mode_0/test.json +++ b/testsuite/ada_lsp/S314-015.refactor_change_parameter_mode_0/test.json @@ -295,7 +295,7 @@ "command": { "title": "", "command": "als-refactor-change-parameter-mode", - "arguments": { + "arguments": [{ "context": "default", "where": { "textDocument": { @@ -309,7 +309,7 @@ "first_parameter": 1, "last_parameter": 1, "new_mode": "in" - } + }] } }, { @@ -318,7 +318,7 @@ "command": { "title": "", "command": "als-refactor-change-parameter-mode", - "arguments": { + "arguments": [{ "context": "default", "where": { "textDocument": { @@ -332,7 +332,7 @@ "first_parameter": 1, "last_parameter": 1, "new_mode": "out" - } + }] } }, { @@ -341,7 +341,7 @@ "command": { "title": "", "command": "als-refactor-change-parameter-mode", - "arguments": { + "arguments": [{ "context": "default", "where": { "textDocument": { @@ -355,7 +355,7 @@ "first_parameter": 1, "last_parameter": 1, "new_mode": "in out" - } + }] } } ] @@ -371,7 +371,7 @@ "method": "workspace/executeCommand", "params": { "command": "als-refactor-change-parameter-mode", - "arguments": { + "arguments": [{ "context": "default", "where": { "textDocument": { @@ -385,7 +385,7 @@ "first_parameter": 1, "last_parameter": 1, "new_mode": "in" - } + }] } }, "wait": [ diff --git a/testsuite/ada_lsp/S314-015.refactor_move_parameter_0/test.json b/testsuite/ada_lsp/S314-015.refactor_move_parameter_0/test.json index d9ccd016e..dec6c12a9 100644 --- a/testsuite/ada_lsp/S314-015.refactor_move_parameter_0/test.json +++ b/testsuite/ada_lsp/S314-015.refactor_move_parameter_0/test.json @@ -296,7 +296,7 @@ "command": { "title": "", "command": "als-refactor-move-parameter", - "arguments": { + "arguments": [{ "context": "default", "where": { "textDocument": { @@ -309,7 +309,7 @@ }, "parameter_index": 1, "direction": "forward" - } + }] } } ] @@ -325,7 +325,7 @@ "method": "workspace/executeCommand", "params": { "command": "als-refactor-move-parameter", - "arguments": { + "arguments": [{ "context": "default", "where": { "textDocument": { @@ -338,7 +338,7 @@ }, "parameter_index": 1, "direction": "forward" - } + }] } }, "wait": [ @@ -578,7 +578,7 @@ "command": { "title": "", "command": "als-refactor-move-parameter", - "arguments": { + "arguments": [{ "context": "default", "where": { "textDocument": { @@ -591,7 +591,7 @@ }, "parameter_index": 2, "direction": "backward" - } + }] } }, { @@ -600,7 +600,7 @@ "command": { "title": "", "command": "als-refactor-move-parameter", - "arguments": { + "arguments": [{ "context": "default", "where": { "textDocument": { @@ -613,7 +613,7 @@ }, "parameter_index": 2, "direction": "forward" - } + }] } } ] @@ -629,7 +629,7 @@ "method": "workspace/executeCommand", "params": { "command": "als-refactor-move-parameter", - "arguments": { + "arguments": [{ "context": "default", "where": { "textDocument": { @@ -642,7 +642,7 @@ }, "parameter_index": 2, "direction": "backward" - } + }] } }, "wait": [ diff --git a/testsuite/ada_lsp/S314-015.refactor_remove_parameter_0/test.json b/testsuite/ada_lsp/S314-015.refactor_remove_parameter_0/test.json index 13773fec4..871a53a7c 100644 --- a/testsuite/ada_lsp/S314-015.refactor_remove_parameter_0/test.json +++ b/testsuite/ada_lsp/S314-015.refactor_remove_parameter_0/test.json @@ -292,7 +292,7 @@ "command": { "title": "", "command": "als-refactor-remove-parameters", - "arguments": { + "arguments": [{ "context": "default", "where": { "textDocument": { @@ -305,7 +305,7 @@ }, "first_parameter": 1, "last_parameter": 1 - } + }] } } ] @@ -321,7 +321,7 @@ "method": "workspace/executeCommand", "params": { "command": "als-refactor-remove-parameters", - "arguments": + "arguments": [ { "context": "default", "where": { @@ -335,7 +335,7 @@ }, "first_parameter": 1, "last_parameter": 1 - } + }] } }, "wait": [ @@ -510,7 +510,7 @@ "command": { "title": "", "command": "als-refactor-remove-parameters", - "arguments": { + "arguments": [{ "context": "default", "where": { "textDocument": { @@ -523,7 +523,7 @@ }, "first_parameter": 1, "last_parameter": 1 - } + }] } } ] @@ -539,7 +539,7 @@ "method": "workspace/executeCommand", "params": { "command": "als-refactor-remove-parameters", - "arguments": + "arguments": [ { "context": "default", "where": { @@ -553,7 +553,7 @@ }, "first_parameter": 1, "last_parameter": 1 - } + }] } }, "wait": [ @@ -846,7 +846,7 @@ "command": { "title": "", "command": "als-refactor-remove-parameters", - "arguments": + "arguments": [ { "context": "default", "where": { @@ -860,7 +860,7 @@ }, "first_parameter": 1, "last_parameter": 1 - } + }] } } ] @@ -876,7 +876,7 @@ "method": "workspace/executeCommand", "params": { "command": "als-refactor-remove-parameters", - "arguments": + "arguments": [ { "context": "default", "where": { @@ -890,7 +890,7 @@ }, "first_parameter": 1, "last_parameter": 1 - } + }] } }, "wait": [ diff --git a/testsuite/ada_lsp/TB12-017.named.parameters.0/TB12-017.named.parameters.0.json b/testsuite/ada_lsp/TB12-017.named.parameters.0/TB12-017.named.parameters.0.json index 66d77a267..19e30d4dd 100644 --- a/testsuite/ada_lsp/TB12-017.named.parameters.0/TB12-017.named.parameters.0.json +++ b/testsuite/ada_lsp/TB12-017.named.parameters.0/TB12-017.named.parameters.0.json @@ -78,44 +78,12 @@ "result": { "capabilities": { "textDocumentSync": 2, - "completionProvider": { - "triggerCharacters": [ - ".", - ",", - "'", - "(" - ], - "resolveProvider": true - }, - "hoverProvider": true, - "declarationProvider": true, - "definitionProvider": true, - "typeDefinitionProvider": true, - "implementationProvider": true, - "referencesProvider": true, - "codeActionProvider": {}, - "documentFormattingProvider": true, - "renameProvider": {}, - "foldingRangeProvider": true, "executeCommandProvider": { "commands": [ "", "als-named-parameters" ] - }, - "workspaceSymbolProvider": true, - "callHierarchyProvider": {}, - "alsShowDepsProvider": true, - "alsReferenceKinds": [ - "reference", - "access", - "write", - "call", - "dispatching call", - "parent", - "child", - "overriding" - ] + } } } } @@ -149,7 +117,7 @@ "wait": [ { "jsonrpc": "2.0", - "id": 2, + "id": 1, "method": "window/workDoneProgress/create", "params": { "token": "" @@ -216,8 +184,8 @@ "id": "ada-2", "method": "workspace/executeCommand", "params": { - "arguments": [ - { + "command": "als-named-parameters", + "arguments": [{ "context": "Default", "where": { "textDocument": { @@ -227,10 +195,9 @@ "line": 6, "character": 8 } - } - } - ], - "command": "als-named-parameters" + }, + "versioned_documents": true + }] } }, "wait": [ diff --git a/testsuite/ada_lsp/TB12-017.named.parameters.0/test.yaml b/testsuite/ada_lsp/TB12-017.named.parameters.0/test.yaml index 175570a4d..18282236c 100644 --- a/testsuite/ada_lsp/TB12-017.named.parameters.0/test.yaml +++ b/testsuite/ada_lsp/TB12-017.named.parameters.0/test.yaml @@ -1,4 +1 @@ title: 'TB12-017.named.parameters.0' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/TB12-017.named.parameters.1/TB12-017.named.parameters.1.json b/testsuite/ada_lsp/TB12-017.named.parameters.1/TB12-017.named.parameters.1.json index df3e51e27..e46c38f0e 100644 --- a/testsuite/ada_lsp/TB12-017.named.parameters.1/TB12-017.named.parameters.1.json +++ b/testsuite/ada_lsp/TB12-017.named.parameters.1/TB12-017.named.parameters.1.json @@ -78,44 +78,12 @@ "result": { "capabilities": { "textDocumentSync": 2, - "completionProvider": { - "triggerCharacters": [ - ".", - ",", - "'", - "(" - ], - "resolveProvider": true - }, - "hoverProvider": true, - "declarationProvider": true, - "definitionProvider": true, - "typeDefinitionProvider": true, - "implementationProvider": true, - "referencesProvider": true, - "codeActionProvider": {}, - "documentFormattingProvider": true, - "renameProvider": {}, - "foldingRangeProvider": true, "executeCommandProvider": { "commands": [ "", "als-named-parameters" ] - }, - "workspaceSymbolProvider": true, - "callHierarchyProvider": {}, - "alsShowDepsProvider": true, - "alsReferenceKinds": [ - "reference", - "access", - "write", - "call", - "dispatching call", - "parent", - "child", - "overriding" - ] + } } } } @@ -149,7 +117,7 @@ "wait": [ { "jsonrpc": "2.0", - "id": 2, + "id": 1, "method": "window/workDoneProgress/create", "params": { "token": "" @@ -193,8 +161,8 @@ "id": "ada-2", "method": "workspace/executeCommand", "params": { - "arguments": [ - { + "command": "als-named-parameters", + "arguments": [{ "context": "Default", "where": { "textDocument": { @@ -204,10 +172,9 @@ "line": 2, "character": 18 } - } - } - ], - "command": "als-named-parameters" + }, + "versioned_documents": true + }] } }, "wait": [ diff --git a/testsuite/ada_lsp/TB12-017.named.parameters.1/test.yaml b/testsuite/ada_lsp/TB12-017.named.parameters.1/test.yaml index 3ce276661..5e30832d0 100644 --- a/testsuite/ada_lsp/TB12-017.named.parameters.1/test.yaml +++ b/testsuite/ada_lsp/TB12-017.named.parameters.1/test.yaml @@ -1,4 +1 @@ title: 'TB12-017.named.parameters.1' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/U416-030.refactor_change_parameter_mode_0/test.json b/testsuite/ada_lsp/U416-030.refactor_change_parameter_mode_0/test.json index d4288370d..6639c6a0f 100644 --- a/testsuite/ada_lsp/U416-030.refactor_change_parameter_mode_0/test.json +++ b/testsuite/ada_lsp/U416-030.refactor_change_parameter_mode_0/test.json @@ -293,7 +293,7 @@ "command": { "title": "", "command": "als-refactor-change-parameter-mode", - "arguments": + "arguments": [ { "context": "default", "where": { @@ -308,7 +308,7 @@ "first_parameter": 1, "last_parameter": 2, "new_mode": "in" - } + }] } }, { @@ -317,7 +317,7 @@ "command": { "title": "", "command": "als-refactor-change-parameter-mode", - "arguments": + "arguments": [ { "context": "default", "where": { @@ -332,7 +332,7 @@ "first_parameter": 1, "last_parameter": 2, "new_mode": "out" - } + }] } }, { @@ -341,7 +341,7 @@ "command": { "title": "", "command": "als-refactor-change-parameter-mode", - "arguments": + "arguments": [ { "context": "default", "where": { @@ -356,7 +356,7 @@ "first_parameter": 1, "last_parameter": 2, "new_mode": "in out" - } + }] } } ] @@ -372,7 +372,7 @@ "method": "workspace/executeCommand", "params": { "command": "als-refactor-remove-parameters", - "arguments": + "arguments": [ { "context": "default", "where": { @@ -386,7 +386,7 @@ }, "first_parameter": 1, "last_parameter": 2 - } + }] } }, "wait": [ diff --git a/testsuite/ada_lsp/refactoring_imports_commands/U511-009.refactoring.import_with_use/test.json b/testsuite/ada_lsp/refactoring_imports_commands/U511-009.refactoring.import_with_use/test.json index a936bec49..a75f4cad7 100644 --- a/testsuite/ada_lsp/refactoring_imports_commands/U511-009.refactoring.import_with_use/test.json +++ b/testsuite/ada_lsp/refactoring_imports_commands/U511-009.refactoring.import_with_use/test.json @@ -220,7 +220,7 @@ "command": { "title": "", "command": "als-refactor-imports", - "arguments": { + "arguments": [{ "context": "Default", "where": { "textDocument": { @@ -233,7 +233,7 @@ }, "with_clause": "Bar", "prefix": "Bar." - } + }] } } ] @@ -249,7 +249,7 @@ "method": "workspace/executeCommand", "params": { "command": "als-refactor-imports", - "arguments": { + "arguments": [{ "context": "Default", "where": { "textDocument": { @@ -262,7 +262,7 @@ }, "with_clause": "Bar", "prefix": "Bar." - } + }] } }, "wait": [ @@ -431,7 +431,7 @@ "command": { "title": "", "command": "als-refactor-imports", - "arguments": { + "arguments": [{ "context": "Default", "where": { "textDocument": { @@ -444,7 +444,7 @@ }, "with_clause": "", "prefix": "Nested." - } + }] } } ] @@ -460,7 +460,7 @@ "method": "workspace/executeCommand", "params": { "command": "als-refactor-imports", - "arguments": { + "arguments": [{ "context": "Default", "where": { "textDocument": { @@ -473,7 +473,7 @@ }, "with_clause": "", "prefix": "Nested." - } + }] } }, "wait": [ diff --git a/testsuite/ada_lsp/refactoring_imports_commands/suggestions_with_nested_packages/refactor_imports_commands.json b/testsuite/ada_lsp/refactoring_imports_commands/suggestions_with_nested_packages/refactor_imports_commands.json index 7d37b04c8..75722cb80 100644 --- a/testsuite/ada_lsp/refactoring_imports_commands/suggestions_with_nested_packages/refactor_imports_commands.json +++ b/testsuite/ada_lsp/refactoring_imports_commands/suggestions_with_nested_packages/refactor_imports_commands.json @@ -148,7 +148,7 @@ "command": { "title": "", "command": "als-refactor-imports", - "arguments": { + "arguments": [{ "context": "Default", "where": { "textDocument": { @@ -161,7 +161,7 @@ }, "with_clause": "A", "prefix": "A." - } + }] } }, { @@ -170,7 +170,7 @@ "command": { "title": "", "command": "als-refactor-imports", - "arguments": { + "arguments": [{ "context": "Default", "where": { "textDocument": { @@ -183,7 +183,7 @@ }, "with_clause": "A", "prefix": "A.B." - } + }] } }, { @@ -192,7 +192,7 @@ "command": { "title": "", "command": "als-refactor-imports", - "arguments": { + "arguments": [{ "context": "Default", "where": { "textDocument": { @@ -205,7 +205,7 @@ }, "with_clause": "E", "prefix": "E." - } + }] } }, { @@ -214,7 +214,7 @@ "command": { "title": "", "command": "als-refactor-imports", - "arguments": { + "arguments": [{ "context": "Default", "where": { "textDocument": { @@ -227,7 +227,7 @@ }, "with_clause": "E", "prefix": "E.B." - } + }] } } ] @@ -243,7 +243,7 @@ "method": "workspace/executeCommand", "params": { "command": "als-refactor-imports", - "arguments": { + "arguments": [{ "context": "Default", "where": { "textDocument": { @@ -256,7 +256,7 @@ }, "with_clause": "A", "prefix": "A.B." - } + }] } }, "wait": [ diff --git a/testsuite/ada_lsp/refactoring_introduce_parameter/SA11-051/test.json b/testsuite/ada_lsp/refactoring_introduce_parameter/SA11-051/test.json index 799a2f5ed..492e23eef 100644 --- a/testsuite/ada_lsp/refactoring_introduce_parameter/SA11-051/test.json +++ b/testsuite/ada_lsp/refactoring_introduce_parameter/SA11-051/test.json @@ -189,7 +189,7 @@ "command": { "title": "", "command": "als-refactor-introduce-parameter", - "arguments": { + "arguments": [{ "context_id": "Default", "where": { "uri": "$URI{main.adb}", @@ -204,7 +204,7 @@ } } } - } + }] } } ] @@ -220,7 +220,7 @@ "method": "workspace/executeCommand", "params": { "command": "als-refactor-introduce-parameter", - "arguments": { + "arguments": [{ "context_id": "Default", "where": { "uri": "$URI{main.adb}", @@ -235,7 +235,7 @@ } } } - } + }] } }, "wait": [ diff --git a/testsuite/ada_lsp/refactoring_pull_up_declaration/V207-019/test.json b/testsuite/ada_lsp/refactoring_pull_up_declaration/V207-019/test.json index 7b7097ba9..537cabc7b 100644 --- a/testsuite/ada_lsp/refactoring_pull_up_declaration/V207-019/test.json +++ b/testsuite/ada_lsp/refactoring_pull_up_declaration/V207-019/test.json @@ -180,7 +180,7 @@ "command": { "title": "", "command": "als-refactor-pull_up_declaration", - "arguments": { + "arguments": [{ "context": "Default", "where": { "uri": "$URI{main.adb}", @@ -195,7 +195,7 @@ } } } - } + }] } } ] @@ -211,7 +211,7 @@ "method": "workspace/executeCommand", "params": { "command": "als-refactor-pull_up_declaration", - "arguments": { + "arguments": [{ "context": "Default", "where": { "uri": "$URI{main.adb}", @@ -226,7 +226,7 @@ } } } - } + }] } }, "wait": [ From 11fc181267d5ac8709ee094ab6aee5ad40c2d7cc Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Tue, 5 Sep 2023 14:57:08 +0300 Subject: [PATCH 089/152] Restore location sorting procedure Refs #1170 --- .../ada/lsp-ada_handlers-call_hierarchy.adb | 16 +- .../ada/lsp-ada_handlers-call_hierarchy.ads | 14 +- source/ada/lsp-ada_handlers-locations.adb | 136 ++++++++++++++++- source/ada/lsp-ada_handlers-locations.ads | 16 ++ source/ada/lsp-ada_handlers.adb | 45 +++--- source/ada/lsp-lal_utils.adb | 137 ------------------ source/ada/lsp-lal_utils.ads | 4 - .../ada_lsp/D301-004.xrefs.generics/test.yaml | 3 - .../F131-024.xrefs.separate_body/test.yaml | 3 - .../SA11-040.definition.fallback/test.yaml | 3 - .../test.yaml | 3 - .../SB14-037.references.access_kind/test.yaml | 3 - .../SC16-095.fallback_when_no_body/test.yaml | 3 - .../U121-013.enum_references/test.json | 32 +--- .../U121-013.enum_references/test.yaml | 3 - .../V201-024.goto.entry_and_asserts/test.yaml | 3 - .../test.yaml | 3 - testsuite/ada_lsp/aggregate.simple/test.yaml | 3 - .../definition_and_overridings/test.yaml | 3 - .../ada_lsp/definition_parents/test.yaml | 3 - .../ada_lsp/editor.incremental/test.yaml | 3 - .../find_all_refs_child_package/test.yaml | 3 - .../find_all_refs_defining_names/test.yaml | 3 - .../implementation.overridings/test.yaml | 3 - 24 files changed, 183 insertions(+), 265 deletions(-) diff --git a/source/ada/lsp-ada_handlers-call_hierarchy.adb b/source/ada/lsp-ada_handlers-call_hierarchy.adb index e08054f32..1c10751a2 100644 --- a/source/ada/lsp-ada_handlers-call_hierarchy.adb +++ b/source/ada/lsp-ada_handlers-call_hierarchy.adb @@ -22,7 +22,6 @@ with Libadalang.Common; with Laltools.Common; with Laltools.Call_Hierarchy; -with LSP.Ada_Handlers.Locations; with LSP.GNATCOLL_Tracers.Handle; with LSP.Utils; @@ -70,7 +69,7 @@ package body LSP.Ada_Handlers.Call_Hierarchy is procedure Find_Incoming_Calls (Self : in out Message_Handler; Response : in out LSP.Structures.CallHierarchyIncomingCall_Vector; - Filter : in out File_Span_Sets.Set; + Filter : in out LSP.Ada_Handlers.Locations.File_Span_Sets.Set; Context : LSP.Ada_Contexts.Context; Definition : Libadalang.Analysis.Defining_Name) is @@ -207,7 +206,7 @@ package body LSP.Ada_Handlers.Call_Hierarchy is procedure Find_Outgoing_Calls (Self : in out Message_Handler; Response : in out LSP.Structures.CallHierarchyOutgoingCall_Vector; - Filter : in out File_Span_Sets.Set; + Filter : in out LSP.Ada_Handlers.Locations.File_Span_Sets.Set; Definition : Libadalang.Analysis.Defining_Name) is use Laltools.Common.References_By_Subprogram; @@ -340,15 +339,4 @@ package body LSP.Ada_Handlers.Call_Hierarchy is end loop; end Find_Outgoing_Calls; - ---------- - -- Hash -- - ---------- - - function Hash - (Value : LSP.Structures.Location) return Ada.Containers.Hash_Type is - use type Ada.Containers.Hash_Type; - begin - return Value.uri.Get_Hash + LSP.Utils.Hash (Value.a_range); - end Hash; - end LSP.Ada_Handlers.Call_Hierarchy; diff --git a/source/ada/lsp-ada_handlers-call_hierarchy.ads b/source/ada/lsp-ada_handlers-call_hierarchy.ads index 97edfaa09..7c0699dde 100644 --- a/source/ada/lsp-ada_handlers-call_hierarchy.ads +++ b/source/ada/lsp-ada_handlers-call_hierarchy.ads @@ -18,22 +18,14 @@ with Libadalang.Analysis; with LSP.Ada_Contexts; +with LSP.Ada_Handlers.Locations; package LSP.Ada_Handlers.Call_Hierarchy is - function Hash - (Value : LSP.Structures.Location) return Ada.Containers.Hash_Type; - - package File_Span_Sets is new Ada.Containers.Hashed_Sets - (Element_Type => LSP.Structures.Location, - Hash => Hash, - Equivalent_Elements => LSP.Structures."=", - "=" => LSP.Structures."="); - procedure Find_Incoming_Calls (Self : in out Message_Handler; Response : in out LSP.Structures.CallHierarchyIncomingCall_Vector; - Filter : in out File_Span_Sets.Set; + Filter : in out LSP.Ada_Handlers.Locations.File_Span_Sets.Set; Context : LSP.Ada_Contexts.Context; Definition : Libadalang.Analysis.Defining_Name) with Pre => Definition.P_Basic_Decl.P_Is_Subprogram; @@ -44,7 +36,7 @@ package LSP.Ada_Handlers.Call_Hierarchy is procedure Find_Outgoing_Calls (Self : in out Message_Handler; Response : in out LSP.Structures.CallHierarchyOutgoingCall_Vector; - Filter : in out File_Span_Sets.Set; + Filter : in out LSP.Ada_Handlers.Locations.File_Span_Sets.Set; Definition : Libadalang.Analysis.Defining_Name) with Pre => Definition.P_Basic_Decl.P_Is_Subprogram; -- Return the list of all the calls made in the subprogram pointed at by diff --git a/source/ada/lsp-ada_handlers-locations.adb b/source/ada/lsp-ada_handlers-locations.adb index fbddbf7e3..4389962ef 100644 --- a/source/ada/lsp-ada_handlers-locations.adb +++ b/source/ada/lsp-ada_handlers-locations.adb @@ -15,8 +15,12 @@ -- of the license. -- ------------------------------------------------------------------------------ -with VSS.Strings.Conversions; +with VSS.Characters; +with VSS.String_Vectors; with VSS.Strings.Character_Iterators; +with VSS.Strings.Conversions; + +with LSP.Utils; with URIs; @@ -34,11 +38,20 @@ package body LSP.Ada_Handlers.Locations is procedure Append_Location (Self : in out Message_Handler; Result : in out LSP.Structures.Location_Vector; + Filter : in out LSP.Ada_Handlers.Locations.File_Span_Sets.Set; Node : Libadalang.Analysis.Ada_Node'Class; - Kinds : LSP.Structures.AlsReferenceKind_Set := LSP.Constants.Empty) is + Kinds : LSP.Structures.AlsReferenceKind_Set := LSP.Constants.Empty) is begin if not Node.Is_Synthetic then - Result.Append (To_LSP_Location (Self, Node, Kinds)); + declare + Value : constant LSP.Structures.Location := + To_LSP_Location (Self, Node, Kinds); + begin + if not Filter.Contains (Value) then + Result.Append (Value); + Filter.Insert (Value); + end if; + end; end if; end Append_Location; @@ -119,6 +132,123 @@ package body LSP.Ada_Handlers.Locations is end; end Get_Node_At; + ---------- + -- Hash -- + ---------- + + function Hash + (Value : LSP.Structures.Location) return Ada.Containers.Hash_Type is + use type Ada.Containers.Hash_Type; + begin + return Value.uri.Get_Hash + LSP.Utils.Hash (Value.a_range); + end Hash; + + ---------- + -- Sort -- + ---------- + + procedure Sort (Result : in out LSP.Structures.Location_Vector) is + + function Less + (Left, Right : LSP.Structures.DocumentUri) return Boolean; + -- Comparison function for URIs, return True if Left < Right + + function "<" (Left, Right : LSP.Structures.Location) return Boolean is + (Less (Left.uri, Right.uri) or else + (LSP.Structures."=" (Left.uri, Right.uri) + and then + (Left.a_range.start.line < Right.a_range.start.line + or else + (Left.a_range.start.line = Right.a_range.start.line + and then Left.a_range.start.character < + Right.a_range.start.character)))); + + ---------- + -- Less -- + ---------- + + function Less + (Left, Right : LSP.Structures.DocumentUri) return Boolean + is + use type VSS.Strings.Virtual_String; + use type VSS.Characters.Virtual_Character; + + function Last_Component + (X : LSP.Structures.DocumentUri) return VSS.Strings.Virtual_String; + -- Return the last component of the URI + + function Last_Component + (X : LSP.Structures.DocumentUri) return VSS.Strings.Virtual_String + is + List : constant VSS.String_Vectors.Virtual_String_Vector := + X.Split ('/'); + begin + return List (List.Length); + end Last_Component; + + L_File : constant VSS.Strings.Virtual_String := Last_Component (Left); + + R_File : constant VSS.Strings.Virtual_String := + Last_Component (Right); + + L_Cursor : VSS.Strings.Character_Iterators.Character_Iterator := + L_File.Before_First_Character; + + R_Cursor : VSS.Strings.Character_Iterators.Character_Iterator := + R_File.Before_First_Character; + + L : VSS.Characters.Virtual_Character'Base; + R : VSS.Characters.Virtual_Character'Base; + + L_Spec : Boolean := False; + -- Prev L is `s` and R is `b` + R_Spec : Boolean := False; + -- Prev L is `b` and R is `s` + + begin + if L_File = R_File then + -- for the same last component, compare full pathes + return LSP.Structures."<" (Left, Right); + end if; + + -- Compare the filenames + while L_Cursor.Forward (L) and R_Cursor.Forward (R) loop + + if L_Spec or R_Spec then + -- Prev L /= R in non-endigng position + return R_Spec; + elsif L = R then + null; -- Skip equal characters + elsif L = '-' and R = '.' then + -- Return "pack.adb" before "pack-child.adb" + return False; + elsif L = '.' and R = '-' then + -- Other side + return True; + elsif L = 's' and R = 'b' then + L_Spec := True; -- Special case to check at the end + elsif L = 'b' and R = 's' then + R_Spec := True; -- Special case to check at the end + else + return L < R; + end if; + end loop; + + if not L_Cursor.Has_Element and not R_Cursor.Has_Element then + -- Return ".ads" before ".adb" + return L_Spec; + else + return R_Cursor.Has_Element; + end if; + end Less; + + package Sorting is new + LSP.Structures.Location_Vectors.Generic_Sorting; + + begin + Sorting.Sort (LSP.Structures.Location_Vectors.Vector (Result)); + end Sort; + -------------------- -- Start_Position -- -------------------- diff --git a/source/ada/lsp-ada_handlers-locations.ads b/source/ada/lsp-ada_handlers-locations.ads index 47601e02a..f41038c20 100644 --- a/source/ada/lsp-ada_handlers-locations.ads +++ b/source/ada/lsp-ada_handlers-locations.ads @@ -29,6 +29,15 @@ with LSP.Constants; package LSP.Ada_Handlers.Locations is + function Hash + (Value : LSP.Structures.Location) return Ada.Containers.Hash_Type; + + package File_Span_Sets is new Ada.Containers.Hashed_Sets + (Element_Type => LSP.Structures.Location, + Hash => Hash, + Equivalent_Elements => LSP.Structures."=", + "=" => LSP.Structures."="); + function To_LSP_Location (Self : in out Message_Handler'Class; Node : Libadalang.Analysis.Ada_Node'Class; @@ -57,6 +66,7 @@ package LSP.Ada_Handlers.Locations is procedure Append_Location (Self : in out Message_Handler; Result : in out LSP.Structures.Location_Vector; + Filter : in out LSP.Ada_Handlers.Locations.File_Span_Sets.Set; Node : Libadalang.Analysis.Ada_Node'Class; Kinds : LSP.Structures.AlsReferenceKind_Set := LSP.Constants.Empty); -- Append given Node location to the Result. @@ -75,4 +85,10 @@ package LSP.Ada_Handlers.Locations is -- associated Virtual_File or Node can able to return URI of the enclosing -- file. + procedure Sort (Result : in out LSP.Structures.Location_Vector); + -- Sort Result using next rules: + -- We're being a bit clever when comparing two URIs: + -- * for a same file, return ".ads" before ".adb" + -- * return "pack.adb" before "pack-child.adb" + end LSP.Ada_Handlers.Locations; diff --git a/source/ada/lsp-ada_handlers.adb b/source/ada/lsp-ada_handlers.adb index 3112c8398..3eca2e48b 100644 --- a/source/ada/lsp-ada_handlers.adb +++ b/source/ada/lsp-ada_handlers.adb @@ -158,6 +158,7 @@ package body LSP.Ada_Handlers is procedure Append_Location (Self : in out Message_Handler; Result : in out LSP.Structures.Location_Vector; + Filter : in out LSP.Ada_Handlers.Locations.File_Span_Sets.Set; Node : Libadalang.Analysis.Ada_Node'Class; Kinds : AlsReferenceKind_Array := LSP.Constants.Empty) renames LSP.Ada_Handlers.Locations.Append_Location; @@ -1704,6 +1705,7 @@ package body LSP.Ada_Handlers is Response : LSP.Structures.Declaration_Result (LSP.Structures.Variant_1); Vector : LSP.Structures.Location_Vector renames Response.Variant_1; + Filter : LSP.Ada_Handlers.Locations.File_Span_Sets.Set; Display_Method_Policy : constant LSP.Ada_Configurations.DisplayMethodAncestryOnNavigationPolicy := @@ -1788,10 +1790,10 @@ package body LSP.Ada_Handlers is if not Prev_Part.Is_Null then -- We have found previous part, return it. - Self.Append_Location (Vector, Prev_Part); + Self.Append_Location (Vector, Filter, Prev_Part); elsif not Definition.Is_Null then -- No previous part, return definition itself. - Self.Append_Location (Vector, Definition); + Self.Append_Location (Vector, Filter, Definition); end if; if not Decl_For_Find_Overrides.Is_Null then @@ -1808,12 +1810,12 @@ package body LSP.Ada_Handlers is begin for Subp of Bases loop Self.Append_Location - (Vector, Subp.P_Defining_Name, Is_Parent); + (Vector, Filter, Subp.P_Defining_Name, Is_Parent); end loop; for Subp of Overridings loop Self.Append_Location - (Vector, Subp.P_Defining_Name, Is_Child); + (Vector, Filter, Subp.P_Defining_Name, Is_Child); end loop; end; end if; @@ -1833,7 +1835,7 @@ package body LSP.Ada_Handlers is exit when Self.Is_Canceled.all; end loop; - -- Sort_And_Remove_Duplicates (Response.result.Locations); + Locations.Sort (Vector); Self.Sender.On_Declaration_Response (Id, Response); end On_Declaration_Request; @@ -1856,6 +1858,7 @@ package body LSP.Ada_Handlers is Response : LSP.Structures.Definition_Result (LSP.Structures.Variant_1); Vector : LSP.Structures.Location_Vector renames Response.Variant_1; + Filter : LSP.Ada_Handlers.Locations.File_Span_Sets.Set; Imprecise : Boolean := False; @@ -1898,7 +1901,7 @@ package body LSP.Ada_Handlers is Imprecise => Imprecise); if not Definition.Is_Null then - Self.Append_Location (Vector, Definition); + Self.Append_Location (Vector, Filter, Definition); if Display_Method_Ancestry_Policy in Usage_And_Abstract_Only | Always @@ -1948,7 +1951,7 @@ package body LSP.Ada_Handlers is end if; if not Other_Part.Is_Null then - Self.Append_Location (Vector, Other_Part); + Self.Append_Location (Vector, Filter, Other_Part); else -- We were on a defining name, but did not manage to find @@ -1962,7 +1965,7 @@ package body LSP.Ada_Handlers is -- We have found a result using the imprecise heuristics. -- We'll warn the user and send the result. Imprecise := True; - Self.Append_Location (Vector, Manual_Fallback); + Self.Append_Location (Vector, Filter, Manual_Fallback); end if; end if; end if; @@ -1981,12 +1984,12 @@ package body LSP.Ada_Handlers is begin for Subp of Bases loop Self.Append_Location - (Vector, Subp.P_Defining_Name, Is_Parent); + (Vector, Filter, Subp.P_Defining_Name, Is_Parent); end loop; for Subp of Overridings loop Self.Append_Location - (Vector, Subp.P_Defining_Name, Is_Child); + (Vector, Filter, Subp.P_Defining_Name, Is_Child); end loop; end; end if; @@ -1994,7 +1997,7 @@ package body LSP.Ada_Handlers is if not Entry_Decl_Node.Is_Null then for Accept_Node of Entry_Decl_Node.P_Accept_Stmts loop Self.Append_Location - (Vector, Accept_Node.F_Body_Decl.F_Name); + (Vector, Filter, Accept_Node.F_Body_Decl.F_Name); end loop; end if; end Resolve_In_Context; @@ -2013,7 +2016,7 @@ package body LSP.Ada_Handlers is exit when Self.Is_Canceled.all; end loop; - -- Sort_And_Remove_Duplicates (Vector); + Locations.Sort (Vector); Self.Sender.On_Definition_Response (Id, Response); end On_Definition_Request; @@ -2963,6 +2966,7 @@ package body LSP.Ada_Handlers is Response : LSP.Structures.Definition_Result (LSP.Structures.Variant_1); Vector : LSP.Structures.Location_Vector renames Response.Variant_1; + Filter : LSP.Ada_Handlers.Locations.File_Span_Sets.Set; Display_Method_Ancestry_Policy : constant LSP.Ada_Configurations.DisplayMethodAncestryOnNavigationPolicy := @@ -3000,7 +3004,7 @@ package body LSP.Ada_Handlers is is begin for E of Bodies loop - Self.Append_Location (Vector, E, Kinds); + Self.Append_Location (Vector, Filter, E, Kinds); end loop; end Update_Response; @@ -3069,7 +3073,7 @@ package body LSP.Ada_Handlers is exit when Self.Is_Canceled.all; end loop; - -- Sort_And_Remove_Duplicates (Response.result.Locations); + Locations.Sort (Vector); Self.Sender.On_Implementation_Response (Id, Response); end On_Implementation_Request; @@ -3098,7 +3102,7 @@ package body LSP.Ada_Handlers is (textDocument => (uri => Item.uri), position => Item.selectionRange.start); - Filter : Call_Hierarchy.File_Span_Sets.Set; + Filter : LSP.Ada_Handlers.Locations.File_Span_Sets.Set; --------------------- -- Process_Context -- @@ -3185,7 +3189,7 @@ package body LSP.Ada_Handlers is (textDocument => (uri => Item.uri), position => Item.selectionRange.start); - Filter : Call_Hierarchy.File_Span_Sets.Set; + Filter : LSP.Ada_Handlers.Locations.File_Span_Sets.Set; --------------------- -- Process_Context -- @@ -3338,6 +3342,7 @@ package body LSP.Ada_Handlers is Response : LSP.Structures.Location_Vector_Or_Null; Imprecise : Boolean := False; + Filter : LSP.Ada_Handlers.Locations.File_Span_Sets.Set; Additional_Kinds : AlsReferenceKind_Array := [others => False]; @@ -3441,6 +3446,7 @@ package body LSP.Ada_Handlers is Self.Append_Location (Response, + Filter, Node, Get_Reference_Kind (Node)); end if; @@ -3477,6 +3483,7 @@ package body LSP.Ada_Handlers is for Subp of C.Find_All_Overrides (Decl, Imprecise) loop Self.Append_Location (Response, + Filter, Subp.P_Defining_Name, Get_Reference_Kind (Definition, @@ -3486,6 +3493,7 @@ package body LSP.Ada_Handlers is if Value.context.includeDeclaration then Self.Append_Location (Response, + Filter, Definition, Get_Reference_Kind (Definition)); end if; @@ -3499,7 +3507,7 @@ package body LSP.Ada_Handlers is exit when Self.Is_Canceled.all; end loop; - -- Sort_And_Remove_Duplicates (Response.result); + Locations.Sort (Response); Self.Sender.On_References_Response (Id, Response); end On_References_Request; @@ -4019,6 +4027,7 @@ package body LSP.Ada_Handlers is Response : LSP.Structures.Definition_Result (LSP.Structures.Variant_1); Vector : LSP.Structures.Location_Vector renames Response.Variant_1; + Filter : LSP.Ada_Handlers.Locations.File_Span_Sets.Set; Imprecise : Boolean := False; procedure Resolve_In_Context (C : LSP.Ada_Context_Sets.Context_Access); @@ -4071,7 +4080,7 @@ package body LSP.Ada_Handlers is end if; if not Definition.Is_Null then - Self.Append_Location (Vector, Definition); + Self.Append_Location (Vector, Filter, Definition); end if; end Resolve_In_Context; diff --git a/source/ada/lsp-lal_utils.adb b/source/ada/lsp-lal_utils.adb index cc9c97994..831367a86 100644 --- a/source/ada/lsp-lal_utils.adb +++ b/source/ada/lsp-lal_utils.adb @@ -108,143 +108,6 @@ package body LSP.Lal_Utils is end if; end Append_Location; - -------------------------------- - -- Sort_And_Remove_Duplicates -- - -------------------------------- - - procedure Sort_And_Remove_Duplicates - (Result : in out LSP.Messages.Location_Vector) - is - use type VSS.Unicode.UTF16_Code_Unit_Count; - - function URI_Inf (Left, Right : LSP.Types.LSP_URI) return Boolean; - -- Comparison function for URIs, return True if Left < Right - - function "<" (Left, Right : LSP.Messages.Location) return Boolean is - (URI_Inf (Left.uri, Right.uri) or else - (LSP.Types.Equal (Left.uri, Right.uri) - and then (Left.span.first.line < Right.span.first.line - or else (Left.span.first.line = Right.span.first.line - and then Left.span.first.character < - Right.span.first.character)))); - - ------------- - -- URI_Inf -- - ------------- - - function URI_Inf (Left, Right : LSP.Types.LSP_URI) return Boolean is - - function URI_Dir (X : String) return String; - -- Return the dir in X - - ------------- - -- URI_Dir -- - ------------- - - function URI_Dir (X : String) return String is - begin - for J in reverse X'First .. X'Last loop - -- In an URI the directory separator is '/' - if X (J) = '/' then - return X (X'First .. J - 1); - end if; - end loop; - return X; - end URI_Dir; - - L : constant String := To_UTF_8_String (Left); - R : constant String := To_UTF_8_String (Right); - - L_Dir : constant String := URI_Dir (L); - R_Dir : constant String := URI_Dir (R); - Ind : Natural; - begin - -- We're being a bit clever when comparing two URIs: - -- * for a same file, return ".ads" before ".adb" - -- * return "pack.adb" before "pack-child.adb" - - if L_Dir'Length /= R_Dir'Length then - -- The directories are different: compare them - return L_Dir < R_Dir; - else - -- The directories have the same length: are they the same? - for Ind in 1 .. L_Dir'Length - 1 loop - if L_Dir (L_Dir'First + Ind) /= R_Dir (R_Dir'First + Ind) then - return L_Dir (L_Dir'First + Ind) < R_Dir (R_Dir'First + Ind); - end if; - end loop; - - -- The directories are the same: compare the filenames - Ind := L_Dir'Length + 1; - loop - if L'First + Ind > L'Last then - if R'First + Ind > R'Last then - return False; - end if; - return True; - end if; - - if R'First + Ind > R'Last then - return False; - end if; - - if L (L'First + Ind) /= R (R'First + Ind) then - -- Return "pack.adb" before "pack-child.adb" - if L (L'First + Ind) = '-' - and then R (R'First + Ind) = '.' - then - return False; - elsif L (L'First + Ind) = '.' - and then R (R'First + Ind) = '-' - then - return True; - - -- Return ".ads" before ".adb" - elsif L'First + Ind = L'Last - and then R'First + Ind = R'Last - then - if L (L'First + Ind) = 's' - and then R (R'First + Ind) = 'b' - then - return True; - elsif L (L'First + Ind) = 'b' - and then R (R'First + Ind) = 's' - then - return False; - else - return L (L'First + Ind) < R (R'First + Ind); - end if; - - -- Normal comparison - else - return L (L'First + Ind) < R (R'First + Ind); - end if; - end if; - - Ind := Ind + 1; - end loop; - end if; - end URI_Inf; - - package Sort is new - LSP.Messages.Location_Vectors.Element_Vectors.Generic_Sorting; - - R : LSP.Messages.Location_Vectors.Element_Vectors.Vector := - LSP.Messages.Location_Vectors.Element_Vectors.Vector (Result); - New_Result : LSP.Messages.Location_Vector; - use type LSP.Messages.Location; - begin - Sort.Sort (R); - for Loc of R loop - if New_Result.Is_Empty - or else Loc /= New_Result.Last_Element - then - New_Result.Append (Loc); - end if; - end loop; - Result := New_Result; - end Sort_And_Remove_Duplicates; - ------------------------ -- Get_Token_Location -- ------------------------ diff --git a/source/ada/lsp-lal_utils.ads b/source/ada/lsp-lal_utils.ads index cd92347ed..6012bc78c 100644 --- a/source/ada/lsp-lal_utils.ads +++ b/source/ada/lsp-lal_utils.ads @@ -74,10 +74,6 @@ package LSP.Lal_Utils is -- associated Virtual_File or Node can able to return URI of the enclosing -- file. - procedure Sort_And_Remove_Duplicates - (Result : in out LSP.Messages.Location_Vector); - -- Sort Result and remove duplicates from it. - function Get_Token_Span (Token : Libadalang.Common.Token_Reference) return LSP.Messages.Span; diff --git a/testsuite/ada_lsp/D301-004.xrefs.generics/test.yaml b/testsuite/ada_lsp/D301-004.xrefs.generics/test.yaml index a5b2efabd..4061ba58c 100644 --- a/testsuite/ada_lsp/D301-004.xrefs.generics/test.yaml +++ b/testsuite/ada_lsp/D301-004.xrefs.generics/test.yaml @@ -1,4 +1 @@ title: 'D301-004.xrefs.generics' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/F131-024.xrefs.separate_body/test.yaml b/testsuite/ada_lsp/F131-024.xrefs.separate_body/test.yaml index 783c63e30..e51005203 100644 --- a/testsuite/ada_lsp/F131-024.xrefs.separate_body/test.yaml +++ b/testsuite/ada_lsp/F131-024.xrefs.separate_body/test.yaml @@ -1,4 +1 @@ title: 'F131-024.xrefs.separate_body' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/SA11-040.definition.fallback/test.yaml b/testsuite/ada_lsp/SA11-040.definition.fallback/test.yaml index 7c189d630..f2901910c 100644 --- a/testsuite/ada_lsp/SA11-040.definition.fallback/test.yaml +++ b/testsuite/ada_lsp/SA11-040.definition.fallback/test.yaml @@ -1,4 +1 @@ title: 'SA11-040.definition.fallback' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/SB14-027.references.tagged_access_kind/test.yaml b/testsuite/ada_lsp/SB14-027.references.tagged_access_kind/test.yaml index 394a1c577..1fb50e67f 100644 --- a/testsuite/ada_lsp/SB14-027.references.tagged_access_kind/test.yaml +++ b/testsuite/ada_lsp/SB14-027.references.tagged_access_kind/test.yaml @@ -1,4 +1 @@ title: 'ada_lsp/SB14-027.references.tagged_access_kind' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/SB14-037.references.access_kind/test.yaml b/testsuite/ada_lsp/SB14-037.references.access_kind/test.yaml index 4d5dc492f..90f31395c 100644 --- a/testsuite/ada_lsp/SB14-037.references.access_kind/test.yaml +++ b/testsuite/ada_lsp/SB14-037.references.access_kind/test.yaml @@ -1,4 +1 @@ title: 'SB14-037.references.access_kind' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/SC16-095.fallback_when_no_body/test.yaml b/testsuite/ada_lsp/SC16-095.fallback_when_no_body/test.yaml index 92b0e3daf..afb1465d5 100644 --- a/testsuite/ada_lsp/SC16-095.fallback_when_no_body/test.yaml +++ b/testsuite/ada_lsp/SC16-095.fallback_when_no_body/test.yaml @@ -1,4 +1 @@ title: 'SC16-095.fallback_when_no_body' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/U121-013.enum_references/test.json b/testsuite/ada_lsp/U121-013.enum_references/test.json index 660fb8a60..fe1684b6c 100644 --- a/testsuite/ada_lsp/U121-013.enum_references/test.json +++ b/testsuite/ada_lsp/U121-013.enum_references/test.json @@ -77,39 +77,11 @@ "result": { "capabilities": { "textDocumentSync": 2, - "completionProvider": { - "triggerCharacters": [ - ".", - ",", - "'", - "(" - ], - "resolveProvider": true - }, - "hoverProvider": true, - "declarationProvider": true, - "definitionProvider": true, - "typeDefinitionProvider": true, - "implementationProvider": true, "referencesProvider": true, - "documentHighlightProvider": true, - "codeActionProvider": {}, - "documentFormattingProvider": true, - "renameProvider": {}, - "foldingRangeProvider": true, - "executeCommandProvider": {}, - "workspaceSymbolProvider": true, - "callHierarchyProvider": {}, - "alsShowDepsProvider": true, "alsReferenceKinds": [ + "", "reference", - "access", - "write", - "call", - "dispatching call", - "parent", - "child", - "overriding" + "call" ] } } diff --git a/testsuite/ada_lsp/U121-013.enum_references/test.yaml b/testsuite/ada_lsp/U121-013.enum_references/test.yaml index 54f3c33f4..0c8696a1a 100644 --- a/testsuite/ada_lsp/U121-013.enum_references/test.yaml +++ b/testsuite/ada_lsp/U121-013.enum_references/test.yaml @@ -1,4 +1 @@ title: 'U121-013.enum_references' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/V201-024.goto.entry_and_asserts/test.yaml b/testsuite/ada_lsp/V201-024.goto.entry_and_asserts/test.yaml index 1ec303c8e..dd0b13873 100644 --- a/testsuite/ada_lsp/V201-024.goto.entry_and_asserts/test.yaml +++ b/testsuite/ada_lsp/V201-024.goto.entry_and_asserts/test.yaml @@ -1,4 +1 @@ title: 'V201-024.goto.entry_and_asserts' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/aggregate.references_after_update/test.yaml b/testsuite/ada_lsp/aggregate.references_after_update/test.yaml index b0d55ee57..e307ec768 100644 --- a/testsuite/ada_lsp/aggregate.references_after_update/test.yaml +++ b/testsuite/ada_lsp/aggregate.references_after_update/test.yaml @@ -1,4 +1 @@ title: 'aggregate.references_after_update' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/aggregate.simple/test.yaml b/testsuite/ada_lsp/aggregate.simple/test.yaml index 2ecca90b5..f1c3e1554 100644 --- a/testsuite/ada_lsp/aggregate.simple/test.yaml +++ b/testsuite/ada_lsp/aggregate.simple/test.yaml @@ -1,4 +1 @@ title: 'aggregate.simple' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/definition_and_overridings/test.yaml b/testsuite/ada_lsp/definition_and_overridings/test.yaml index 77ecc029e..c817524bf 100644 --- a/testsuite/ada_lsp/definition_and_overridings/test.yaml +++ b/testsuite/ada_lsp/definition_and_overridings/test.yaml @@ -1,4 +1 @@ title: 'definition_and_overridings' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/definition_parents/test.yaml b/testsuite/ada_lsp/definition_parents/test.yaml index 1f6a55214..a7b307755 100644 --- a/testsuite/ada_lsp/definition_parents/test.yaml +++ b/testsuite/ada_lsp/definition_parents/test.yaml @@ -1,4 +1 @@ title: 'definition_parents' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/editor.incremental/test.yaml b/testsuite/ada_lsp/editor.incremental/test.yaml index da905a803..076b8d532 100644 --- a/testsuite/ada_lsp/editor.incremental/test.yaml +++ b/testsuite/ada_lsp/editor.incremental/test.yaml @@ -1,4 +1 @@ title: 'editor.incremental' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/find_all_refs_child_package/test.yaml b/testsuite/ada_lsp/find_all_refs_child_package/test.yaml index 3b86b4924..70cd3af66 100644 --- a/testsuite/ada_lsp/find_all_refs_child_package/test.yaml +++ b/testsuite/ada_lsp/find_all_refs_child_package/test.yaml @@ -1,4 +1 @@ title: 'find_all_refs_child_package' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/find_all_refs_defining_names/test.yaml b/testsuite/ada_lsp/find_all_refs_defining_names/test.yaml index e398a35e3..1895995d4 100644 --- a/testsuite/ada_lsp/find_all_refs_defining_names/test.yaml +++ b/testsuite/ada_lsp/find_all_refs_defining_names/test.yaml @@ -1,4 +1 @@ title: 'find_all_refs_defining_names' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/implementation.overridings/test.yaml b/testsuite/ada_lsp/implementation.overridings/test.yaml index b38a2bc73..91a3a9ca9 100644 --- a/testsuite/ada_lsp/implementation.overridings/test.yaml +++ b/testsuite/ada_lsp/implementation.overridings/test.yaml @@ -1,4 +1 @@ title: 'implementation.overridings' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] From c3f2e74d427f0ad9578ae04b59f3c28bbb972231 Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Tue, 5 Sep 2023 16:55:56 +0300 Subject: [PATCH 090/152] Fix implicit project loading Refs #1170 --- source/ada/lsp-ada_driver.adb | 2 ++ source/ada/lsp-ada_handlers-project_loading.adb | 2 +- .../test.json | 8 ++++---- .../S314-015.refactor_move_parameter_0/test.json | 10 +++++----- .../S314-015.refactor_remove_parameter_0/test.json | 12 ++++++------ .../ada_lsp/T123-048.incremental_editing/test.yaml | 3 --- .../test.json | 8 ++++---- .../ada_lsp/implementation.aggregates/test.yaml | 3 --- testsuite/ada_lsp/project_config.file/test.yaml | 3 +++ .../ada_lsp/type_definition.aggregate/test.yaml | 3 --- 10 files changed, 25 insertions(+), 29 deletions(-) diff --git a/source/ada/lsp-ada_driver.adb b/source/ada/lsp-ada_driver.adb index e5db88eff..56a483b0c 100644 --- a/source/ada/lsp-ada_driver.adb +++ b/source/ada/lsp-ada_driver.adb @@ -300,6 +300,8 @@ begin begin Ada_Handler.Initialize (Incremental_Text_Changes => Allow_Incremental_Text_Changes.Is_Active); + GPR_Handler.Initialize + (Incremental_Text_Changes => Allow_Incremental_Text_Changes.Is_Active); end; Server.Initialize (Stream'Unchecked_Access); diff --git a/source/ada/lsp-ada_handlers-project_loading.adb b/source/ada/lsp-ada_handlers-project_loading.adb index 8a83cc390..db802e125 100644 --- a/source/ada/lsp-ada_handlers-project_loading.adb +++ b/source/ada/lsp-ada_handlers-project_loading.adb @@ -159,7 +159,7 @@ package body LSP.Ada_Handlers.Project_Loading is if not Self.Client.Root.Is_Empty then declare Files : GNATCOLL.VFS.File_Array_Access := - Root (Self).Dir.Read_Dir (GNATCOLL.VFS.Files_Only); + Root (Self).Read_Dir (GNATCOLL.VFS.Files_Only); begin for X of Files.all loop if X.Has_Suffix (".gpr") then diff --git a/testsuite/ada_lsp/S314-015.refactor_change_parameter_mode_0/test.json b/testsuite/ada_lsp/S314-015.refactor_change_parameter_mode_0/test.json index 234c2084d..9f44267be 100644 --- a/testsuite/ada_lsp/S314-015.refactor_change_parameter_mode_0/test.json +++ b/testsuite/ada_lsp/S314-015.refactor_change_parameter_mode_0/test.json @@ -296,7 +296,7 @@ "title": "", "command": "als-refactor-change-parameter-mode", "arguments": [{ - "context": "default", + "context": "Default", "where": { "textDocument": { "uri": "$URI{main.adb}" @@ -319,7 +319,7 @@ "title": "", "command": "als-refactor-change-parameter-mode", "arguments": [{ - "context": "default", + "context": "Default", "where": { "textDocument": { "uri": "$URI{main.adb}" @@ -342,7 +342,7 @@ "title": "", "command": "als-refactor-change-parameter-mode", "arguments": [{ - "context": "default", + "context": "Default", "where": { "textDocument": { "uri": "$URI{main.adb}" @@ -372,7 +372,7 @@ "params": { "command": "als-refactor-change-parameter-mode", "arguments": [{ - "context": "default", + "context": "Default", "where": { "textDocument": { "uri": "$URI{main.adb}" diff --git a/testsuite/ada_lsp/S314-015.refactor_move_parameter_0/test.json b/testsuite/ada_lsp/S314-015.refactor_move_parameter_0/test.json index dec6c12a9..8c4257f63 100644 --- a/testsuite/ada_lsp/S314-015.refactor_move_parameter_0/test.json +++ b/testsuite/ada_lsp/S314-015.refactor_move_parameter_0/test.json @@ -297,7 +297,7 @@ "title": "", "command": "als-refactor-move-parameter", "arguments": [{ - "context": "default", + "context": "Default", "where": { "textDocument": { "uri": "$URI{main.adb}" @@ -326,7 +326,7 @@ "params": { "command": "als-refactor-move-parameter", "arguments": [{ - "context": "default", + "context": "Default", "where": { "textDocument": { "uri": "$URI{main.adb}" @@ -579,7 +579,7 @@ "title": "", "command": "als-refactor-move-parameter", "arguments": [{ - "context": "default", + "context": "Default", "where": { "textDocument": { "uri": "$URI{main.adb}" @@ -601,7 +601,7 @@ "title": "", "command": "als-refactor-move-parameter", "arguments": [{ - "context": "default", + "context": "Default", "where": { "textDocument": { "uri": "$URI{main.adb}" @@ -630,7 +630,7 @@ "params": { "command": "als-refactor-move-parameter", "arguments": [{ - "context": "default", + "context": "Default", "where": { "textDocument": { "uri": "$URI{main.adb}" diff --git a/testsuite/ada_lsp/S314-015.refactor_remove_parameter_0/test.json b/testsuite/ada_lsp/S314-015.refactor_remove_parameter_0/test.json index 871a53a7c..3cd1a3036 100644 --- a/testsuite/ada_lsp/S314-015.refactor_remove_parameter_0/test.json +++ b/testsuite/ada_lsp/S314-015.refactor_remove_parameter_0/test.json @@ -293,7 +293,7 @@ "title": "", "command": "als-refactor-remove-parameters", "arguments": [{ - "context": "default", + "context": "Default", "where": { "textDocument": { "uri": "$URI{main.adb}" @@ -323,7 +323,7 @@ "command": "als-refactor-remove-parameters", "arguments": [ { - "context": "default", + "context": "Default", "where": { "textDocument": { "uri": "$URI{main.adb}" @@ -511,7 +511,7 @@ "title": "", "command": "als-refactor-remove-parameters", "arguments": [{ - "context": "default", + "context": "Default", "where": { "textDocument": { "uri": "$URI{main.adb}" @@ -541,7 +541,7 @@ "command": "als-refactor-remove-parameters", "arguments": [ { - "context": "default", + "context": "Default", "where": { "textDocument": { "uri": "$URI{main.adb}" @@ -848,7 +848,7 @@ "command": "als-refactor-remove-parameters", "arguments": [ { - "context": "default", + "context": "Default", "where": { "textDocument": { "uri": "$URI{main.adb}" @@ -878,7 +878,7 @@ "command": "als-refactor-remove-parameters", "arguments": [ { - "context": "default", + "context": "Default", "where": { "textDocument": { "uri": "$URI{main.adb}" diff --git a/testsuite/ada_lsp/T123-048.incremental_editing/test.yaml b/testsuite/ada_lsp/T123-048.incremental_editing/test.yaml index ce760b0dc..0dbde29c0 100644 --- a/testsuite/ada_lsp/T123-048.incremental_editing/test.yaml +++ b/testsuite/ada_lsp/T123-048.incremental_editing/test.yaml @@ -1,4 +1 @@ title: 'T123-048.incremental_editing' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/U416-030.refactor_change_parameter_mode_0/test.json b/testsuite/ada_lsp/U416-030.refactor_change_parameter_mode_0/test.json index 6639c6a0f..97e424886 100644 --- a/testsuite/ada_lsp/U416-030.refactor_change_parameter_mode_0/test.json +++ b/testsuite/ada_lsp/U416-030.refactor_change_parameter_mode_0/test.json @@ -295,7 +295,7 @@ "command": "als-refactor-change-parameter-mode", "arguments": [ { - "context": "default", + "context": "Default", "where": { "textDocument": { "uri": "$URI{main.adb}" @@ -319,7 +319,7 @@ "command": "als-refactor-change-parameter-mode", "arguments": [ { - "context": "default", + "context": "Default", "where": { "textDocument": { "uri": "$URI{main.adb}" @@ -343,7 +343,7 @@ "command": "als-refactor-change-parameter-mode", "arguments": [ { - "context": "default", + "context": "Default", "where": { "textDocument": { "uri": "$URI{main.adb}" @@ -374,7 +374,7 @@ "command": "als-refactor-remove-parameters", "arguments": [ { - "context": "default", + "context": "Default", "where": { "textDocument": { "uri": "$URI{main.adb}" diff --git a/testsuite/ada_lsp/implementation.aggregates/test.yaml b/testsuite/ada_lsp/implementation.aggregates/test.yaml index 40d2cf51c..e29a63983 100644 --- a/testsuite/ada_lsp/implementation.aggregates/test.yaml +++ b/testsuite/ada_lsp/implementation.aggregates/test.yaml @@ -1,4 +1 @@ title: 'implementation.aggregates' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/project_config.file/test.yaml b/testsuite/ada_lsp/project_config.file/test.yaml index 43ac894d0..cbf8d2630 100644 --- a/testsuite/ada_lsp/project_config.file/test.yaml +++ b/testsuite/ada_lsp/project_config.file/test.yaml @@ -1 +1,4 @@ title: 'project_config.file' +# Skip till 3.17 ready +skip: + - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/type_definition.aggregate/test.yaml b/testsuite/ada_lsp/type_definition.aggregate/test.yaml index 574180802..be682af55 100644 --- a/testsuite/ada_lsp/type_definition.aggregate/test.yaml +++ b/testsuite/ada_lsp/type_definition.aggregate/test.yaml @@ -1,4 +1 @@ title: 'type_definition.aggregate' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] From d5af4126271e020a70022408ad1b990cc0b3ad39 Mon Sep 17 00:00:00 2001 From: Andry Ogorodnik Date: Tue, 5 Sep 2023 16:27:12 +0000 Subject: [PATCH 091/152] Implemented LSP.Ada_Client_Capabilities.Parse_Experimental --- source/ada/lsp-ada_client_capabilities.adb | 48 +++++++++++++++++-- source/ada/lsp-ada_client_capabilities.ads | 2 +- ...ndlers-refactor-change_parameters_type.adb | 6 ++- ...da_handlers-refactor-sort_dependencies.adb | 9 ++-- .../lsp-structures-lspany_vectors.ads | 1 + .../S314-015/test.json | 8 ++-- .../S314-015/test.yaml | 3 -- .../SA22-035/test.json | 8 ++-- .../SA22-035/test.yaml | 3 -- 9 files changed, 64 insertions(+), 24 deletions(-) diff --git a/source/ada/lsp-ada_client_capabilities.adb b/source/ada/lsp-ada_client_capabilities.adb index 9132c3bfd..f2613c52a 100644 --- a/source/ada/lsp-ada_client_capabilities.adb +++ b/source/ada/lsp-ada_client_capabilities.adb @@ -16,12 +16,16 @@ ------------------------------------------------------------------------------ with VSS.Characters.Latin; +with VSS.JSON.Streams; with VSS.String_Vectors; +with VSS.Strings.Conversions; with LSP.Constants; with LSP.Enumerations; with LSP.Structures.Unwrap; +with LSP.Structures.LSPAny_Vectors; + package body LSP.Ada_Client_Capabilities is ----------------- @@ -101,13 +105,51 @@ package body LSP.Ada_Client_Capabilities is -- Parse_Experimental -- ------------------------ - procedure Parse_Experimental (Self : Client_Capability'Class) is + procedure Parse_Experimental (Self : in out Client_Capability'Class) is + use VSS.JSON.Streams; + use VSS.Strings; + use LSP.Structures.JSON_Event_Vectors; + use LSP.Structures.LSPAny_Vectors; + + C : Cursor := Self.Value.capabilities.experimental.First; begin - if Self.Value.capabilities.experimental.Is_Empty then + if not Has_Element (C) then return; end if; - -- FIXME: Implement parsing + pragma Assert (Element (C).Kind = Start_Object); + Next (C); + + while Has_Element (C) + and then Element (C).Kind /= End_Object + loop + pragma Assert (Element (C).Kind = Key_Name); + declare + Key : constant Virtual_String := Element (C).Key_Name; + begin + Next (C); + + if Key = "advanced_refactorings" then + pragma Assert (Element (C).Kind = Start_Array); + Next (C); + + while Has_Element (C) + and then Element (C).Kind /= End_Array + loop + pragma Assert (Element (C).Kind = String_Value); + Self.Advanced_Refactorings + (Advanced_Refactorings'Value + (VSS.Strings.Conversions.To_UTF_8_String + (Element (C).String_Value))) := True; + Next (C); + end loop; + else + Skip_Value (C); + end if; + end; + + Next (C); + end loop; end Parse_Experimental; ------------------------------- diff --git a/source/ada/lsp-ada_client_capabilities.ads b/source/ada/lsp-ada_client_capabilities.ads index e5279827a..ab5d7e939 100644 --- a/source/ada/lsp-ada_client_capabilities.ads +++ b/source/ada/lsp-ada_client_capabilities.ads @@ -135,6 +135,6 @@ private function Root (Self : Client_Capability'Class) return VSS.Strings.Virtual_String is (Self.Root); - procedure Parse_Experimental (Self : Client_Capability'Class); + procedure Parse_Experimental (Self : in out Client_Capability'Class); end LSP.Ada_Client_Capabilities; diff --git a/source/ada/lsp-ada_handlers-refactor-change_parameters_type.adb b/source/ada/lsp-ada_handlers-refactor-change_parameters_type.adb index 8dd963955..62267ec8b 100644 --- a/source/ada/lsp-ada_handlers-refactor-change_parameters_type.adb +++ b/source/ada/lsp-ada_handlers-refactor-change_parameters_type.adb @@ -191,9 +191,11 @@ package body LSP.Ada_Handlers.Refactor.Change_Parameters_Type is LSP.Ada_Handlers.Message_Handler (Handler.all); Context : LSP.Ada_Contexts.Context renames Message_Handler.Contexts.Get (Self.Context).all; + File : constant GNATCOLL.VFS.Virtual_File := + Message_Handler.To_File (Self.Where.uri); - Unit : constant Analysis_Unit := Context.LAL_Context.Get_From_File - (VSS.Strings.Conversions.To_UTF_8_String (Self.Where.uri)); + Unit : constant Analysis_Unit := + Unit : constant Analysis_Unit := Context.Get_AU (File); Parameters_SLOC_Range : constant Source_Location_Range := (Langkit_Support.Slocs.Line_Number diff --git a/source/ada/lsp-ada_handlers-refactor-sort_dependencies.adb b/source/ada/lsp-ada_handlers-refactor-sort_dependencies.adb index 5a9d639c1..ff3c1442d 100644 --- a/source/ada/lsp-ada_handlers-refactor-sort_dependencies.adb +++ b/source/ada/lsp-ada_handlers-refactor-sort_dependencies.adb @@ -134,13 +134,14 @@ package body LSP.Ada_Handlers.Refactor.Sort_Dependencies is use LAL_Refactor; use LAL_Refactor.Sort_Dependencies; - Message_Handler : LSP.Ada_Handlers.Message_Handler renames + Message_Handler : LSP.Ada_Handlers.Message_Handler renames LSP.Ada_Handlers.Message_Handler (Handler.all); - Context : LSP.Ada_Contexts.Context renames + Context : LSP.Ada_Contexts.Context renames Message_Handler.Contexts.Get (Self.Context).all; + File : constant GNATCOLL.VFS.Virtual_File := + Message_Handler.To_File (Self.Where.uri); Analysis_Unit : constant Libadalang.Analysis.Analysis_Unit := - Context.LAL_Context.Get_From_File - (VSS.Strings.Conversions.To_UTF_8_String (Self.Where.uri)); + Context.Get_AU (File); Sloc : constant Source_Location := (Langkit_Support.Slocs.Line_Number (Self.Where.a_range.start.line) + 1, diff --git a/source/lsp_3.17/lsp-structures-lspany_vectors.ads b/source/lsp_3.17/lsp-structures-lspany_vectors.ads index 896f5c42b..0bf75cebd 100644 --- a/source/lsp_3.17/lsp-structures-lspany_vectors.ads +++ b/source/lsp_3.17/lsp-structures-lspany_vectors.ads @@ -7,6 +7,7 @@ with VSS.String_Vectors; package LSP.Structures.LSPAny_Vectors is + pragma Preelaborate; procedure To_Any (Value : Integer; diff --git a/testsuite/ada_lsp/refactoring_change_parameters_type/S314-015/test.json b/testsuite/ada_lsp/refactoring_change_parameters_type/S314-015/test.json index a76ad64f7..9f269c1c5 100644 --- a/testsuite/ada_lsp/refactoring_change_parameters_type/S314-015/test.json +++ b/testsuite/ada_lsp/refactoring_change_parameters_type/S314-015/test.json @@ -181,7 +181,7 @@ "command": { "title": "", "command": "als-refactor-change_parameters_type", - "arguments": { + "arguments": [{ "context": "Default", "where": { "uri": "$URI{main.adb}", @@ -201,7 +201,7 @@ "SUBTYPE_INDICATION_RULE", "ANONYMOUS_TYPE_RULE" ] - } + }] } } ] @@ -217,7 +217,7 @@ "method": "workspace/executeCommand", "params": { "command": "als-refactor-change_parameters_type", - "arguments": { + "arguments": [{ "context": "Default", "where": { "uri": "$URI{main.adb}", @@ -237,7 +237,7 @@ "SUBTYPE_INDICATION_RULE", "ANONYMOUS_TYPE_RULE" ] - } + }] } }, "wait": [ diff --git a/testsuite/ada_lsp/refactoring_change_parameters_type/S314-015/test.yaml b/testsuite/ada_lsp/refactoring_change_parameters_type/S314-015/test.yaml index 70e45128e..4eb744bf9 100644 --- a/testsuite/ada_lsp/refactoring_change_parameters_type/S314-015/test.yaml +++ b/testsuite/ada_lsp/refactoring_change_parameters_type/S314-015/test.yaml @@ -1,4 +1 @@ title: 'refactoring_change_parameters_type/S314-015' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/refactoring_sort_dependencies/SA22-035/test.json b/testsuite/ada_lsp/refactoring_sort_dependencies/SA22-035/test.json index c997449f2..d23143991 100644 --- a/testsuite/ada_lsp/refactoring_sort_dependencies/SA22-035/test.json +++ b/testsuite/ada_lsp/refactoring_sort_dependencies/SA22-035/test.json @@ -181,7 +181,7 @@ "command": { "title": "", "command": "als-refactor-sort_dependencies", - "arguments": { + "arguments": [{ "context": "Default", "where": { "uri": "$URI{main_package.ads}", @@ -196,7 +196,7 @@ } } } - } + }] } } ] @@ -212,7 +212,7 @@ "method": "workspace/executeCommand", "params": { "command": "als-refactor-sort_dependencies", - "arguments": { + "arguments": [{ "context": "Default", "where": { "uri": "$URI{main_package.ads}", @@ -227,7 +227,7 @@ } } } - } + }] } }, "wait": [ diff --git a/testsuite/ada_lsp/refactoring_sort_dependencies/SA22-035/test.yaml b/testsuite/ada_lsp/refactoring_sort_dependencies/SA22-035/test.yaml index 56e907375..ba299842b 100644 --- a/testsuite/ada_lsp/refactoring_sort_dependencies/SA22-035/test.yaml +++ b/testsuite/ada_lsp/refactoring_sort_dependencies/SA22-035/test.yaml @@ -1,4 +1 @@ title: 'refactoring_sort_dependencies/SA22-035' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] From bc2c6794e2b82e934486047ab38b523bd96fb08d Mon Sep 17 00:00:00 2001 From: Vadim Godunko Date: Tue, 5 Sep 2023 18:56:50 +0400 Subject: [PATCH 092/152] Enable 'rangeFormating' tests. --- .../ada_lsp/T527-019.range_formatting/test.json | 5 +++-- .../ada_lsp/T527-019.range_formatting/test.yaml | 3 --- .../test.json | 16 +--------------- .../test.yaml | 3 --- 4 files changed, 4 insertions(+), 23 deletions(-) diff --git a/testsuite/ada_lsp/T527-019.range_formatting/test.json b/testsuite/ada_lsp/T527-019.range_formatting/test.json index a7c6c0adf..334d6e331 100644 --- a/testsuite/ada_lsp/T527-019.range_formatting/test.json +++ b/testsuite/ada_lsp/T527-019.range_formatting/test.json @@ -26,7 +26,8 @@ "id": 1, "result": { "capabilities": { - "textDocumentSync": 2 + "textDocumentSync": 2, + "documentRangeFormattingProvider": true } } } @@ -278,4 +279,4 @@ "exit_code": 0 } } -] \ No newline at end of file +] diff --git a/testsuite/ada_lsp/T527-019.range_formatting/test.yaml b/testsuite/ada_lsp/T527-019.range_formatting/test.yaml index 21e9b3c30..774cb511c 100644 --- a/testsuite/ada_lsp/T527-019.range_formatting/test.yaml +++ b/testsuite/ada_lsp/T527-019.range_formatting/test.yaml @@ -1,4 +1 @@ title: 'T527-019.range_formatting' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/range_formatting/UB30-006_range_format_whole_document/test.json b/testsuite/ada_lsp/range_formatting/UB30-006_range_format_whole_document/test.json index 75190c586..da6d14fc4 100644 --- a/testsuite/ada_lsp/range_formatting/UB30-006_range_format_whole_document/test.json +++ b/testsuite/ada_lsp/range_formatting/UB30-006_range_format_whole_document/test.json @@ -38,20 +38,6 @@ } }, "textDocument": { - "codeAction": { - "dynamicRegistration": true, - "codeActionLiteralSupport": { - "codeActionKind": { - "valueSet": [ - "", - "refactor", - "refactor.extract", - "refactor.inline", - "refactor.rewrite" - ] - } - } - }, "rangeFormatting": { "dynamicRegistration": true } @@ -180,4 +166,4 @@ "exit_code": 0 } } -] \ No newline at end of file +] diff --git a/testsuite/ada_lsp/range_formatting/UB30-006_range_format_whole_document/test.yaml b/testsuite/ada_lsp/range_formatting/UB30-006_range_format_whole_document/test.yaml index 6d7bbe96d..788725536 100644 --- a/testsuite/ada_lsp/range_formatting/UB30-006_range_format_whole_document/test.yaml +++ b/testsuite/ada_lsp/range_formatting/UB30-006_range_format_whole_document/test.yaml @@ -1,4 +1 @@ title: 'UB30-006_range_format_whole_document' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] From 9fd9c9c06b363a77c64d1bc3d8ef536df107131f Mon Sep 17 00:00:00 2001 From: Vadim Godunko Date: Tue, 5 Sep 2023 18:58:11 +0400 Subject: [PATCH 093/152] Support of 'rangeFormatting' request --- source/ada/lsp-ada_client_capabilities.adb | 25 ++++----- source/ada/lsp-ada_handlers-formatting.adb | 46 ++++++++++++++++ source/ada/lsp-ada_handlers-formatting.ads | 10 ++++ source/ada/lsp-ada_handlers.adb | 62 ++++++++++++++++++++++ source/ada/lsp-ada_handlers.ads | 5 ++ source/lsp_3.17/lsp-constants.ads | 4 ++ 6 files changed, 140 insertions(+), 12 deletions(-) diff --git a/source/ada/lsp-ada_client_capabilities.adb b/source/ada/lsp-ada_client_capabilities.adb index f2613c52a..25b2b1588 100644 --- a/source/ada/lsp-ada_client_capabilities.adb +++ b/source/ada/lsp-ada_client_capabilities.adb @@ -266,18 +266,19 @@ package body LSP.Ada_Client_Capabilities is (if Incremental_Text_Changes then LSP.Enumerations.Incremental else LSP.Enumerations.Full))); - Result.callHierarchyProvider := LSP.Constants.True; - Result.declarationProvider := LSP.Constants.True; - Result.definitionProvider := LSP.Constants.True; - Result.documentFormattingProvider := LSP.Constants.True; - Result.documentHighlightProvider := LSP.Constants.True; - Result.documentSymbolProvider := LSP.Constants.True; - Result.foldingRangeProvider := LSP.Constants.True; - Result.hoverProvider := LSP.Constants.True; - Result.implementationProvider := LSP.Constants.True; - Result.referencesProvider := LSP.Constants.True; - Result.typeDefinitionProvider := LSP.Constants.True; - Result.workspaceSymbolProvider := LSP.Constants.True; + Result.callHierarchyProvider := LSP.Constants.True; + Result.declarationProvider := LSP.Constants.True; + Result.definitionProvider := LSP.Constants.True; + Result.documentFormattingProvider := LSP.Constants.True; + Result.documentHighlightProvider := LSP.Constants.True; + Result.documentRangeFormattingProvider := LSP.Constants.True; + Result.documentSymbolProvider := LSP.Constants.True; + Result.foldingRangeProvider := LSP.Constants.True; + Result.hoverProvider := LSP.Constants.True; + Result.implementationProvider := LSP.Constants.True; + Result.referencesProvider := LSP.Constants.True; + Result.typeDefinitionProvider := LSP.Constants.True; + Result.workspaceSymbolProvider := LSP.Constants.True; Result.completionProvider := (Is_Set => True, diff --git a/source/ada/lsp-ada_handlers-formatting.adb b/source/ada/lsp-ada_handlers-formatting.adb index 26409a3aa..1bf7eefca 100644 --- a/source/ada/lsp-ada_handlers-formatting.adb +++ b/source/ada/lsp-ada_handlers-formatting.adb @@ -81,6 +81,52 @@ package body LSP.Ada_Handlers.Formatting is end if; end Format; + ------------------ + -- Range_Format -- + ------------------ + + procedure Range_Format + (Context : LSP.Ada_Contexts.Context; + Document : not null LSP.Ada_Documents.Document_Access; + Span : LSP.Structures.A_Range; + Options : LSP.Structures.FormattingOptions; + Success : out Boolean; + Response : out LSP.Structures.TextEdit_Vector; + Error : out LSP.Errors.ResponseError) + is + PP_Options : Utils.Command_Lines.Command_Line := Context.Get_PP_Options; + Messages : VSS.String_Vectors.Virtual_String_Vector; + + begin + if Document.Has_Diagnostics (Context) then + Success := False; + Error := + (code => LSP.Constants.InternalError, + message => "Syntactically incorrect code can't be formatted"); + + return; + end if; + + -- Take into account the options set by the request only if the + -- corresponding GPR switches are not explicitly set. + + Update_Pp_Formatting_Options + (Pp_Options => PP_Options, LSP_Options => Options); + + Success := Document.Range_Formatting + (Context => Context, + Span => Span, + PP_Options => PP_Options, + Edit => Response, + Messages => Messages); + + if not Success then + Error := + (code => LSP.Constants.InternalError, + message => Messages.Join (' ')); + end if; + end Range_Format; + ---------------------------------- -- Update_Pp_Formatting_Options -- ---------------------------------- diff --git a/source/ada/lsp-ada_handlers-formatting.ads b/source/ada/lsp-ada_handlers-formatting.ads index 3d4fb19dd..ba9d4a7af 100644 --- a/source/ada/lsp-ada_handlers-formatting.ads +++ b/source/ada/lsp-ada_handlers-formatting.ads @@ -36,4 +36,14 @@ private package LSP.Ada_Handlers.Formatting is Error : out LSP.Errors.ResponseError); -- Format the text of the given document in the given range (span). + procedure Range_Format + (Context : LSP.Ada_Contexts.Context; + Document : not null LSP.Ada_Documents.Document_Access; + Span : LSP.Structures.A_Range; + Options : LSP.Structures.FormattingOptions; + Success : out Boolean; + Response : out LSP.Structures.TextEdit_Vector; + Error : out LSP.Errors.ResponseError); + -- Format the text of the given document in the given range (span). + end LSP.Ada_Handlers.Formatting; diff --git a/source/ada/lsp-ada_handlers.adb b/source/ada/lsp-ada_handlers.adb index 3eca2e48b..325895e84 100644 --- a/source/ada/lsp-ada_handlers.adb +++ b/source/ada/lsp-ada_handlers.adb @@ -100,6 +100,13 @@ package body LSP.Ada_Handlers is subtype AlsReferenceKind_Array is LSP.Structures.AlsReferenceKind_Set; + Partial_Gnatpp_Trace : constant GNATCOLL.Traces.Trace_Handle := + GNATCOLL.Traces.Create + (Unit_Name => "ALS.PARTIAL_GNATPP", + Default => GNATCOLL.Traces.On); + -- Trace to enable/disable using partial Gnatpp in the rangeFormatting + -- request. + function Is_Parent return AlsReferenceKind_Array is ([LSP.Enumerations.parent => True, others => False]); @@ -3329,6 +3336,61 @@ package body LSP.Ada_Handlers is Self.Sender.On_PrepareRename_Response (Id, Response); end On_PrepareRename_Request; + -------------------------------- + -- On_RangeFormatting_Request -- + -------------------------------- + + overriding procedure On_RangeFormatting_Request + (Self : in out Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentRangeFormattingParams) + is + Context : constant LSP.Ada_Context_Sets.Context_Access := + Self.Contexts.Get_Best_Context (Value.textDocument.uri); + Document : constant LSP.Ada_Documents.Document_Access := + Self.Get_Open_Document (Value.textDocument.uri); + + Response : LSP.Structures.TextEdit_Vector_Or_Null; + Error : LSP.Errors.ResponseError; + Success : Boolean; + Messages : VSS.String_Vectors.Virtual_String_Vector; + + begin + if Partial_Gnatpp_Trace.Is_Active then + LSP.Ada_Handlers.Formatting.Range_Format + (Context.all, + Document, + Value.a_range, + Value.options, + Success, + Response, + Error); + + else + LSP.Ada_Handlers.Formatting.Format + (Context.all, + Document, + Value.a_range, + Value.options, + Success, + Response, + Messages, + Error); + end if; + + if Success then + Self.Sender.On_RangeFormatting_Response (Id, Response); + + for Message of Messages loop + Self.Sender.On_ShowMessage_Notification + ((LSP.Enumerations.Info, Message)); + end loop; + + else + Self.Sender.On_Error_Response (Id, Error); + end if; + end On_RangeFormatting_Request; + --------------------------- -- On_References_Request -- --------------------------- diff --git a/source/ada/lsp-ada_handlers.ads b/source/ada/lsp-ada_handlers.ads index ee32cff30..9ca954447 100644 --- a/source/ada/lsp-ada_handlers.ads +++ b/source/ada/lsp-ada_handlers.ads @@ -336,6 +336,11 @@ private Id : LSP.Structures.Integer_Or_Virtual_String; Value : LSP.Structures.SemanticTokensParams); + overriding procedure On_RangeFormatting_Request + (Self : in out Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentRangeFormattingParams); + overriding procedure On_DidChangeConfiguration_Notification (Self : in out Message_Handler; Value : LSP.Structures.DidChangeConfigurationParams); diff --git a/source/lsp_3.17/lsp-constants.ads b/source/lsp_3.17/lsp-constants.ads index 48f9b8eb5..da7ed31dc 100644 --- a/source/lsp_3.17/lsp-constants.ads +++ b/source/lsp_3.17/lsp-constants.ads @@ -119,6 +119,10 @@ package LSP.Constants is return LSP.Structures.Boolean_Or_DocumentFormattingOptions_Optional is (Is_Set => True, Value => (Is_Boolean => True, Boolean => True)); + function True + return LSP.Structures.Boolean_Or_DocumentRangeFormattingOptions_Optional + is (Is_Set => True, Value => (Is_Boolean => True, Boolean => True)); + function Empty return LSP.Structures.Position is (line => 0, character => 0); From c6ae26a2d8089ecdbc96ce7f2bf3c758ef5d2857 Mon Sep 17 00:00:00 2001 From: Vadim Godunko Date: Tue, 5 Sep 2023 19:55:02 +0400 Subject: [PATCH 094/152] Configure GPR2 at startup. --- source/ada/lsp-ada_contexts.adb | 21 ++++-------------- source/ada/lsp-ada_projects.adb | 39 +++++++++++++++++++++++++++++++++ source/ada/lsp-ada_projects.ads | 39 +++++++++++++++++++++++++++++++++ 3 files changed, 82 insertions(+), 17 deletions(-) create mode 100644 source/ada/lsp-ada_projects.adb create mode 100644 source/ada/lsp-ada_projects.ads diff --git a/source/ada/lsp-ada_contexts.adb b/source/ada/lsp-ada_contexts.adb index b25ee3294..3432915e6 100644 --- a/source/ada/lsp-ada_contexts.adb +++ b/source/ada/lsp-ada_contexts.adb @@ -41,6 +41,7 @@ with Langkit_Support.Text; with URIs; with LSP.Ada_Id_Iterators; +with LSP.Ada_Projects; package body LSP.Ada_Contexts is @@ -666,32 +667,18 @@ package body LSP.Ada_Contexts is -------------------------- procedure Pretty_Printer_Setup is - - use type GPR2.Package_Id; - use type GPR2.Optional_Attribute_Id; - - Pretty_Printer_Id : constant GPR2.Package_Id := +"pretty_printer"; - - package Pretty_Printer is - Switches : constant GPR2.Q_Attribute_Id := - (Pretty_Printer_Id, +"switches"); - end Pretty_Printer; - - Ada_Index : constant GPR2.Project.Attribute_Index.Object := - GPR2.Project.Attribute_Index.Create - (GPR2.Ada_Language); - Validated : GNAT.Strings.String_List_Access; Index : Integer := 0; Attribute : GPR2.Project.Attribute.Object; Values : GPR2.Containers.Value_List; + begin -- Initialize an gnatpp command line object if Root.Check_Attribute - (Name => Pretty_Printer.Switches, - Index => Ada_Index, + (Name => LSP.Ada_Projects.Pretty_Printer.Switches, + Index => LSP.Ada_Projects.Pretty_Printer.Ada_Index, Result => Attribute) then diff --git a/source/ada/lsp-ada_projects.adb b/source/ada/lsp-ada_projects.adb new file mode 100644 index 000000000..d223ae479 --- /dev/null +++ b/source/ada/lsp-ada_projects.adb @@ -0,0 +1,39 @@ +------------------------------------------------------------------------------ +-- Language Server Protocol -- +-- -- +-- Copyright (C) 2018-2023, AdaCore -- +-- -- +-- This is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 3, or (at your option) any later ver- -- +-- sion. This software is distributed in the hope that it will be useful, -- +-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- -- +-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -- +-- License for more details. You should have received a copy of the GNU -- +-- General Public License distributed with this software; see file -- +-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy -- +-- of the license. -- +------------------------------------------------------------------------------ + +with GPR2.Project.Registry.Attribute; +with GPR2.Project.Registry.Pack; + +package body LSP.Ada_Projects is + +begin + GPR2.Project.Registry.Pack.Add + (Name => Pretty_Printer.Pretty_Printer_Id, + Projects => GPR2.Project.Registry.Pack.Everywhere); + + GPR2.Project.Registry.Attribute.Add + (Name => Pretty_Printer.Switches, + Index_Type => GPR2.Project.Registry.Attribute. + FileGlob_Or_Language_Index, + Index_Optional => True, + Value => GPR2.Project.Registry.Attribute.List, + Value_Case_Sensitive => True, + Is_Allowed_In => GPR2.Project.Registry.Attribute.Everywhere); + + GPR2.Project.Registry.Attribute.Add_Alias + (Pretty_Printer.Default_Switches, Pretty_Printer.Switches); +end LSP.Ada_Projects; diff --git a/source/ada/lsp-ada_projects.ads b/source/ada/lsp-ada_projects.ads new file mode 100644 index 000000000..7aa627709 --- /dev/null +++ b/source/ada/lsp-ada_projects.ads @@ -0,0 +1,39 @@ +------------------------------------------------------------------------------ +-- Language Server Protocol -- +-- -- +-- Copyright (C) 2018-2023, AdaCore -- +-- -- +-- This is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 3, or (at your option) any later ver- -- +-- sion. This software is distributed in the hope that it will be useful, -- +-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- -- +-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -- +-- License for more details. You should have received a copy of the GNU -- +-- General Public License distributed with this software; see file -- +-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy -- +-- of the license. -- +------------------------------------------------------------------------------ + +with GPR2.Project.Attribute_Index; + +package LSP.Ada_Projects is + + pragma Elaborate_Body; + + package Pretty_Printer is + + use type GPR2.Package_Id; + use type GPR2.Optional_Attribute_Id; + + Pretty_Printer_Id : constant GPR2.Package_Id := +"pretty_printer"; + Default_Switches : constant GPR2.Q_Attribute_Id := + (Pretty_Printer_Id, +"default_switches"); + Switches : constant GPR2.Q_Attribute_Id := + (Pretty_Printer_Id, +"switches"); + Ada_Index : constant GPR2.Project.Attribute_Index.Object := + GPR2.Project.Attribute_Index.Create (GPR2.Ada_Language); + + end Pretty_Printer; + +end LSP.Ada_Projects; From 21043baa0229496718b957c89ac25d8a78fe2e84 Mon Sep 17 00:00:00 2001 From: Vadim Godunko Date: Tue, 5 Sep 2023 19:58:29 +0400 Subject: [PATCH 095/152] Enable more 'rangeFormatting' tests. --- .../ada_lsp/range_formatting/W103-015_GitHub-1008/test.yaml | 3 --- .../range_formatting/W103-015_GitHub-1073-1074/test.yaml | 3 --- .../ada_lsp/range_formatting/W103-015_GitHub-1086/test.yaml | 3 --- 3 files changed, 9 deletions(-) diff --git a/testsuite/ada_lsp/range_formatting/W103-015_GitHub-1008/test.yaml b/testsuite/ada_lsp/range_formatting/W103-015_GitHub-1008/test.yaml index 9432af60f..e5531c3d5 100644 --- a/testsuite/ada_lsp/range_formatting/W103-015_GitHub-1008/test.yaml +++ b/testsuite/ada_lsp/range_formatting/W103-015_GitHub-1008/test.yaml @@ -1,4 +1 @@ title: 'W103-015_GitHub-1008' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/range_formatting/W103-015_GitHub-1073-1074/test.yaml b/testsuite/ada_lsp/range_formatting/W103-015_GitHub-1073-1074/test.yaml index ce26df2c2..ce967cb61 100644 --- a/testsuite/ada_lsp/range_formatting/W103-015_GitHub-1073-1074/test.yaml +++ b/testsuite/ada_lsp/range_formatting/W103-015_GitHub-1073-1074/test.yaml @@ -1,4 +1 @@ title: 'W103-015_GitHub-1073-1074' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/range_formatting/W103-015_GitHub-1086/test.yaml b/testsuite/ada_lsp/range_formatting/W103-015_GitHub-1086/test.yaml index bc55cad20..6a5d83caa 100644 --- a/testsuite/ada_lsp/range_formatting/W103-015_GitHub-1086/test.yaml +++ b/testsuite/ada_lsp/range_formatting/W103-015_GitHub-1086/test.yaml @@ -1,4 +1 @@ title: 'W103-015_GitHub-1086' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] From b619ee7a265e9aaf3e06315b572a1c4481699fa9 Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Tue, 5 Sep 2023 18:10:53 +0300 Subject: [PATCH 096/152] Skip name from `Standard` Refs #1170 --- source/ada/lsp-ada_handlers-locations.adb | 2 +- testsuite/ada_lsp/skip__standard/test.yaml | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/source/ada/lsp-ada_handlers-locations.adb b/source/ada/lsp-ada_handlers-locations.adb index 4389962ef..937860cd6 100644 --- a/source/ada/lsp-ada_handlers-locations.adb +++ b/source/ada/lsp-ada_handlers-locations.adb @@ -42,7 +42,7 @@ package body LSP.Ada_Handlers.Locations is Node : Libadalang.Analysis.Ada_Node'Class; Kinds : LSP.Structures.AlsReferenceKind_Set := LSP.Constants.Empty) is begin - if not Node.Is_Synthetic then + if not LSP.Utils.Is_Synthetic (Node) then declare Value : constant LSP.Structures.Location := To_LSP_Location (Self, Node, Kinds); diff --git a/testsuite/ada_lsp/skip__standard/test.yaml b/testsuite/ada_lsp/skip__standard/test.yaml index a98623397..9dad6b62c 100644 --- a/testsuite/ada_lsp/skip__standard/test.yaml +++ b/testsuite/ada_lsp/skip__standard/test.yaml @@ -1,4 +1 @@ title: 'skip__standard' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] From d22f8e6c570dbf29e228708a98f159f363303888 Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Tue, 5 Sep 2023 19:24:45 +0300 Subject: [PATCH 097/152] Rebase some tests Refs #1170 --- .../test.json | 3 +- .../test.yaml | 3 -- testsuite/ada_lsp/SA22-032.folding/test.json | 32 +---------- testsuite/ada_lsp/SA22-032.folding/test.yaml | 3 -- .../U614-038.edits.no_project/test.json | 53 +------------------ .../U614-038.edits.no_project/test.yaml | 3 -- .../U805-023.signatureHelp.context/test.json | 37 +------------ .../U805-023.signatureHelp.context/test.yaml | 3 -- .../test.json | 2 +- .../test.yaml | 3 -- .../ada_lsp/aggregate.is_called_by/test.json | 35 +----------- .../ada_lsp/aggregate.is_called_by/test.yaml | 3 -- testsuite/ada_lsp/called_by.renames/test.json | 35 +----------- testsuite/ada_lsp/called_by.renames/test.yaml | 3 -- testsuite/ada_lsp/preprocessor/test.json | 35 +----------- testsuite/ada_lsp/preprocessor/test.yaml | 3 -- 16 files changed, 11 insertions(+), 245 deletions(-) diff --git a/testsuite/ada_lsp/O208-003.xrefs.aggregate_library_projects/test.json b/testsuite/ada_lsp/O208-003.xrefs.aggregate_library_projects/test.json index 34083ad73..d05082435 100644 --- a/testsuite/ada_lsp/O208-003.xrefs.aggregate_library_projects/test.json +++ b/testsuite/ada_lsp/O208-003.xrefs.aggregate_library_projects/test.json @@ -175,7 +175,7 @@ "wait": [ { "id": 4, - "result": [ + "result": { "range": { "start": { @@ -189,7 +189,6 @@ }, "uri": "$URI{srclib/sublib.adb}" } - ] } ] } diff --git a/testsuite/ada_lsp/O208-003.xrefs.aggregate_library_projects/test.yaml b/testsuite/ada_lsp/O208-003.xrefs.aggregate_library_projects/test.yaml index 6eab161d9..7031b5e0a 100644 --- a/testsuite/ada_lsp/O208-003.xrefs.aggregate_library_projects/test.yaml +++ b/testsuite/ada_lsp/O208-003.xrefs.aggregate_library_projects/test.yaml @@ -1,4 +1 @@ title: 'O208-003.xrefs.aggregate_library_projects' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/SA22-032.folding/test.json b/testsuite/ada_lsp/SA22-032.folding/test.json index 40966893e..de913e1d1 100644 --- a/testsuite/ada_lsp/SA22-032.folding/test.json +++ b/testsuite/ada_lsp/SA22-032.folding/test.json @@ -37,37 +37,7 @@ "result": { "capabilities": { "textDocumentSync": 2, - "completionProvider": { - "resolveProvider": true, - "triggerCharacters": [ - ".", - ",", - "'", - "(" - ] - }, - "hoverProvider": true, - "declarationProvider": true, - "definitionProvider": true, - "typeDefinitionProvider": true, - "implementationProvider": true, - "referencesProvider": true, - "codeActionProvider": { - }, - "renameProvider": { - }, - "foldingRangeProvider": true, - "executeCommandProvider": {}, - "alsReferenceKinds": [ - "reference", - "access", - "write", - "call", - "dispatching call", - "parent", - "child", - "overriding" - ] + "foldingRangeProvider": true } } } diff --git a/testsuite/ada_lsp/SA22-032.folding/test.yaml b/testsuite/ada_lsp/SA22-032.folding/test.yaml index ad1816f99..54e3772e0 100644 --- a/testsuite/ada_lsp/SA22-032.folding/test.yaml +++ b/testsuite/ada_lsp/SA22-032.folding/test.yaml @@ -1,4 +1 @@ title: 'SA22-032.folding' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/U614-038.edits.no_project/test.json b/testsuite/ada_lsp/U614-038.edits.no_project/test.json index 97b49dbfb..3409c3176 100644 --- a/testsuite/ada_lsp/U614-038.edits.no_project/test.json +++ b/testsuite/ada_lsp/U614-038.edits.no_project/test.json @@ -228,56 +228,7 @@ "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": { - "codeActionKinds": [ - "", - "refactor.rewrite" - ] - }, - "documentFormattingProvider": true, - "renameProvider": { - "prepareProvider": true - }, - "foldingRangeProvider": true, - "workspaceSymbolProvider": true, - "callHierarchyProvider": {}, - "alsShowDepsProvider": true, - "alsReferenceKinds": [ - "reference", - "access", - "write", - "call", - "dispatching call", - "parent", - "child", - "overriding" - ] + "hoverProvider": true } } } @@ -462,4 +413,4 @@ "exit_code": 0 } } -] \ No newline at end of file +] diff --git a/testsuite/ada_lsp/U614-038.edits.no_project/test.yaml b/testsuite/ada_lsp/U614-038.edits.no_project/test.yaml index 85e9d0237..c87bb1cf7 100644 --- a/testsuite/ada_lsp/U614-038.edits.no_project/test.yaml +++ b/testsuite/ada_lsp/U614-038.edits.no_project/test.yaml @@ -1,4 +1 @@ title: 'U614-038.edits.no_project' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/U805-023.signatureHelp.context/test.json b/testsuite/ada_lsp/U805-023.signatureHelp.context/test.json index a15135628..7fae00cc9 100644 --- a/testsuite/ada_lsp/U805-023.signatureHelp.context/test.json +++ b/testsuite/ada_lsp/U805-023.signatureHelp.context/test.json @@ -81,16 +81,6 @@ "result": { "capabilities": { "textDocumentSync": 2, - "completionProvider": { - "triggerCharacters": [ - ".", - ",", - "'", - "(" - ], - "resolveProvider": true - }, - "hoverProvider": true, "signatureHelpProvider": { "triggerCharacters": [ ",", @@ -100,30 +90,7 @@ "\b" ] }, - "declarationProvider": true, - "definitionProvider": true, - "typeDefinitionProvider": true, - "implementationProvider": true, - "referencesProvider": true, - "documentHighlightProvider": true, - "documentSymbolProvider": true, - "codeActionProvider": {}, - "documentFormattingProvider": true, - "renameProvider": {}, - "foldingRangeProvider": true, - "workspaceSymbolProvider": true, - "callHierarchyProvider": {}, - "alsShowDepsProvider": true, - "alsReferenceKinds": [ - "reference", - "access", - "write", - "call", - "dispatching call", - "parent", - "child", - "overriding" - ] + "codeActionProvider": true } } } @@ -707,7 +674,7 @@ "wait": [ { "id": 24, - "result": [] + "result": null } ] } diff --git a/testsuite/ada_lsp/U805-023.signatureHelp.context/test.yaml b/testsuite/ada_lsp/U805-023.signatureHelp.context/test.yaml index 1eff25d00..940306588 100644 --- a/testsuite/ada_lsp/U805-023.signatureHelp.context/test.yaml +++ b/testsuite/ada_lsp/U805-023.signatureHelp.context/test.yaml @@ -1,4 +1 @@ title: 'U805-023.signatureHelp.context' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/U909-007.signatureHelp.type_cast/test.json b/testsuite/ada_lsp/U909-007.signatureHelp.type_cast/test.json index e1e8c2e40..698ffaa12 100644 --- a/testsuite/ada_lsp/U909-007.signatureHelp.type_cast/test.json +++ b/testsuite/ada_lsp/U909-007.signatureHelp.type_cast/test.json @@ -675,7 +675,7 @@ "wait": [ { "id": 41, - "result": [] + "result": null } ] } diff --git a/testsuite/ada_lsp/U909-007.signatureHelp.type_cast/test.yaml b/testsuite/ada_lsp/U909-007.signatureHelp.type_cast/test.yaml index 897b2799b..cd66946c6 100644 --- a/testsuite/ada_lsp/U909-007.signatureHelp.type_cast/test.yaml +++ b/testsuite/ada_lsp/U909-007.signatureHelp.type_cast/test.yaml @@ -1,4 +1 @@ title: 'U909-007.signatureHelp.type_cast' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/aggregate.is_called_by/test.json b/testsuite/ada_lsp/aggregate.is_called_by/test.json index f093fa709..1d3a97ee0 100644 --- a/testsuite/ada_lsp/aggregate.is_called_by/test.json +++ b/testsuite/ada_lsp/aggregate.is_called_by/test.json @@ -80,40 +80,7 @@ "result": { "capabilities": { "textDocumentSync": 2, - "completionProvider": { - "triggerCharacters": [ - ".", - ",", - "'", - "(" - ], - "resolveProvider": true - }, - "hoverProvider": true, - "declarationProvider": true, - "definitionProvider": true, - "typeDefinitionProvider": true, - "implementationProvider": true, - "referencesProvider": true, - "documentHighlightProvider": true, - "documentSymbolProvider": true, - "codeActionProvider": {}, - "documentFormattingProvider": true, - "renameProvider": {}, - "foldingRangeProvider": true, - "workspaceSymbolProvider": true, - "callHierarchyProvider": {}, - "alsShowDepsProvider": true, - "alsReferenceKinds": [ - "reference", - "access", - "write", - "call", - "dispatching call", - "parent", - "child", - "overriding" - ] + "callHierarchyProvider": true } } } diff --git a/testsuite/ada_lsp/aggregate.is_called_by/test.yaml b/testsuite/ada_lsp/aggregate.is_called_by/test.yaml index 079d8d474..d635ca355 100644 --- a/testsuite/ada_lsp/aggregate.is_called_by/test.yaml +++ b/testsuite/ada_lsp/aggregate.is_called_by/test.yaml @@ -1,4 +1 @@ title: 'aggregate.is_called_by' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/called_by.renames/test.json b/testsuite/ada_lsp/called_by.renames/test.json index 56eef5535..e21c2bb83 100644 --- a/testsuite/ada_lsp/called_by.renames/test.json +++ b/testsuite/ada_lsp/called_by.renames/test.json @@ -79,40 +79,9 @@ "result": { "capabilities": { "textDocumentSync": 2, - "completionProvider": { - "triggerCharacters": [ - ".", - ",", - "'", - "(" - ], - "resolveProvider": true - }, - "hoverProvider": true, - "declarationProvider": true, - "definitionProvider": true, - "typeDefinitionProvider": true, - "implementationProvider": true, - "referencesProvider": true, "documentHighlightProvider": true, - "documentSymbolProvider": true, - "codeActionProvider": {}, - "documentFormattingProvider": true, - "renameProvider": {}, - "foldingRangeProvider": true, - "workspaceSymbolProvider": true, - "callHierarchyProvider": {}, - "alsShowDepsProvider": true, - "alsReferenceKinds": [ - "reference", - "access", - "write", - "call", - "dispatching call", - "parent", - "child", - "overriding" - ] + "codeActionProvider": true, + "callHierarchyProvider": true } } } diff --git a/testsuite/ada_lsp/called_by.renames/test.yaml b/testsuite/ada_lsp/called_by.renames/test.yaml index 2025cf193..5b2f50365 100644 --- a/testsuite/ada_lsp/called_by.renames/test.yaml +++ b/testsuite/ada_lsp/called_by.renames/test.yaml @@ -1,4 +1 @@ title: 'called_by.renames' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/preprocessor/test.json b/testsuite/ada_lsp/preprocessor/test.json index 0f2a48531..7e80441ba 100644 --- a/testsuite/ada_lsp/preprocessor/test.json +++ b/testsuite/ada_lsp/preprocessor/test.json @@ -77,40 +77,7 @@ "result": { "capabilities": { "textDocumentSync": 2, - "completionProvider": { - "triggerCharacters": [ - ".", - ",", - "'", - "(" - ], - "resolveProvider": true - }, - "hoverProvider": true, - "declarationProvider": true, - "definitionProvider": true, - "typeDefinitionProvider": true, - "implementationProvider": true, - "referencesProvider": true, - "documentHighlightProvider": true, - "documentSymbolProvider": true, - "codeActionProvider": {}, - "documentFormattingProvider": true, - "renameProvider": {}, - "foldingRangeProvider": true, - "workspaceSymbolProvider": true, - "callHierarchyProvider": {}, - "alsShowDepsProvider": true, - "alsReferenceKinds": [ - "reference", - "access", - "write", - "call", - "dispatching call", - "parent", - "child", - "overriding" - ] + "definitionProvider": true } } } diff --git a/testsuite/ada_lsp/preprocessor/test.yaml b/testsuite/ada_lsp/preprocessor/test.yaml index c13dbc157..68bcf2116 100644 --- a/testsuite/ada_lsp/preprocessor/test.yaml +++ b/testsuite/ada_lsp/preprocessor/test.yaml @@ -1,4 +1 @@ title: 'preprocessor' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] From 72d21ddf006fbf93e96d7053a7f052a089e858d1 Mon Sep 17 00:00:00 2001 From: Vadim Godunko Date: Wed, 6 Sep 2023 12:55:52 +0400 Subject: [PATCH 098/152] Enable more 'formatting' tests. --- .../T623-017.format_uses_project/test.yaml | 3 -- .../test.json | 46 +------------------ .../test.yaml | 3 -- 3 files changed, 2 insertions(+), 50 deletions(-) diff --git a/testsuite/ada_lsp/T623-017.format_uses_project/test.yaml b/testsuite/ada_lsp/T623-017.format_uses_project/test.yaml index 80b5ee6ca..918b608e7 100644 --- a/testsuite/ada_lsp/T623-017.format_uses_project/test.yaml +++ b/testsuite/ada_lsp/T623-017.format_uses_project/test.yaml @@ -1,4 +1 @@ title: 'T623-017.format_uses_project' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/V701-011.formatting.options_precedence/test.json b/testsuite/ada_lsp/V701-011.formatting.options_precedence/test.json index 56af75321..80eaad7cf 100644 --- a/testsuite/ada_lsp/V701-011.formatting.options_precedence/test.json +++ b/testsuite/ada_lsp/V701-011.formatting.options_precedence/test.json @@ -80,49 +80,7 @@ "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": {}, - "documentFormattingProvider": true, - "documentRangeFormattingProvider": true, - "renameProvider": {}, - "foldingRangeProvider": true, - "executeCommandProvider": { - "commands": [ - "", - "als-named-parameters"] - }, - "workspaceSymbolProvider": true, - "callHierarchyProvider": {}, - "alsShowDepsProvider": true, - "alsReferenceKinds": [ - "", - "reference"], - "alsCheckSyntaxProvider": true + "documentFormattingProvider": true } } } @@ -526,4 +484,4 @@ "exit_code": 0 } } -] \ No newline at end of file +] diff --git a/testsuite/ada_lsp/V701-011.formatting.options_precedence/test.yaml b/testsuite/ada_lsp/V701-011.formatting.options_precedence/test.yaml index 531a10eb0..06adf7211 100644 --- a/testsuite/ada_lsp/V701-011.formatting.options_precedence/test.yaml +++ b/testsuite/ada_lsp/V701-011.formatting.options_precedence/test.yaml @@ -1,4 +1 @@ title: 'V701-011.formatting.options_precedence' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] From d6a667b852f47d668fde580ae9aad5236cc26a57 Mon Sep 17 00:00:00 2001 From: Vadim Godunko Date: Wed, 6 Sep 2023 12:56:05 +0400 Subject: [PATCH 099/152] Fix syntax error. --- source/ada/lsp-ada_handlers-refactor-change_parameters_type.adb | 1 - 1 file changed, 1 deletion(-) diff --git a/source/ada/lsp-ada_handlers-refactor-change_parameters_type.adb b/source/ada/lsp-ada_handlers-refactor-change_parameters_type.adb index 62267ec8b..ffaef9d6a 100644 --- a/source/ada/lsp-ada_handlers-refactor-change_parameters_type.adb +++ b/source/ada/lsp-ada_handlers-refactor-change_parameters_type.adb @@ -194,7 +194,6 @@ package body LSP.Ada_Handlers.Refactor.Change_Parameters_Type is File : constant GNATCOLL.VFS.Virtual_File := Message_Handler.To_File (Self.Where.uri); - Unit : constant Analysis_Unit := Unit : constant Analysis_Unit := Context.Get_AU (File); Parameters_SLOC_Range : constant Source_Location_Range := From e0611554c584fe13ea5aede0fc2fb270e1839702 Mon Sep 17 00:00:00 2001 From: Vadim Godunko Date: Wed, 6 Sep 2023 14:49:12 +0400 Subject: [PATCH 100/152] Fix bug in slice extraction code. --- source/ada/lsp-utils.adb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/ada/lsp-utils.adb b/source/ada/lsp-utils.adb index 0c69252c5..3a9eb9bda 100644 --- a/source/ada/lsp-utils.adb +++ b/source/ada/lsp-utils.adb @@ -539,7 +539,7 @@ package body LSP.Utils is loop Num := Num + 1; - exit when Num > Span.start.line; + exit when Num > Span.an_end.line; Slice.Append (Lines.Element (Num)); end loop; From ea8d96e773f023e221fd23ca41b37c78716857c3 Mon Sep 17 00:00:00 2001 From: Vadim Godunko Date: Wed, 6 Sep 2023 14:51:23 +0400 Subject: [PATCH 101/152] Symplify code a bit. --- source/ada/lsp-utils.adb | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/source/ada/lsp-utils.adb b/source/ada/lsp-utils.adb index 3a9eb9bda..029df6d95 100644 --- a/source/ada/lsp-utils.adb +++ b/source/ada/lsp-utils.adb @@ -515,7 +515,7 @@ package body LSP.Utils is Text.Split_Lines (Terminators => LSP.Ada_Documents.LSP_New_Line_Function_Set, Keep_Terminator => True); - Line := Lines.Element (Num); + Line := Lines (Num); declare J1 : VSS.Strings.Character_Iterators.Character_Iterator := @@ -532,8 +532,7 @@ package body LSP.Utils is end loop; if Span.start.line /= Span.an_end.line then - Slice.Append - (Line.Slice (J1.Marker, Line.At_Last_Character.Marker)); + Slice.Append (Line.Slice (J1.Marker, Line.At_Last_Character)); end if; loop @@ -541,10 +540,10 @@ package body LSP.Utils is exit when Num > Span.an_end.line; - Slice.Append (Lines.Element (Num)); + Slice.Append (Lines (Num)); end loop; - Line := Lines.Element (Span.an_end.line + 1); + Line := Lines (Span.an_end.line + 1); declare J2 : VSS.Strings.Character_Iterators.Character_Iterator := From d1664dac25ac7bc708991dcbf5dc31a5f0e97feb Mon Sep 17 00:00:00 2001 From: Vadim Godunko Date: Wed, 6 Sep 2023 15:03:18 +0400 Subject: [PATCH 102/152] Enable 'rangeFormatting' test --- testsuite/ada_lsp/V628-024.symbol_diff/test.json | 7 ------- testsuite/ada_lsp/V628-024.symbol_diff/test.yaml | 3 --- 2 files changed, 10 deletions(-) diff --git a/testsuite/ada_lsp/V628-024.symbol_diff/test.json b/testsuite/ada_lsp/V628-024.symbol_diff/test.json index 51f0e3da4..297439186 100644 --- a/testsuite/ada_lsp/V628-024.symbol_diff/test.json +++ b/testsuite/ada_lsp/V628-024.symbol_diff/test.json @@ -231,13 +231,6 @@ } }, "wait": [ - { - "method": "textDocument/publishDiagnostics", - "params": { - "uri": "$URI{main.adb}", - "diagnostics": [] - } - } ] } }, diff --git a/testsuite/ada_lsp/V628-024.symbol_diff/test.yaml b/testsuite/ada_lsp/V628-024.symbol_diff/test.yaml index 5eac5e910..63b6bd529 100644 --- a/testsuite/ada_lsp/V628-024.symbol_diff/test.yaml +++ b/testsuite/ada_lsp/V628-024.symbol_diff/test.yaml @@ -1,4 +1 @@ title: 'V628-024.symbol_diff' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] From 7eb6337c0d0a75a6542ba8026ffbdb092c985490 Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Tue, 5 Sep 2023 18:25:06 +0300 Subject: [PATCH 103/152] Fix prepare rename null response Refs #1170 --- source/ada/lsp-ada_handlers.adb | 9 ++++++--- testsuite/ada_lsp/rename.prepare/test.yaml | 3 --- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/source/ada/lsp-ada_handlers.adb b/source/ada/lsp-ada_handlers.adb index 325895e84..4dbaf4cbc 100644 --- a/source/ada/lsp-ada_handlers.adb +++ b/source/ada/lsp-ada_handlers.adb @@ -3302,7 +3302,7 @@ package body LSP.Ada_Handlers is Trace : constant GNATCOLL.Traces.Trace_Handle := LSP.GNATCOLL_Tracers.Handle (Self.Tracer.all); - Response : LSP.Structures.PrepareRenameResult_Or_Null (Is_Null => False); + Response : LSP.Structures.PrepareRenameResult_Or_Null; Context : constant LSP.Ada_Context_Sets.Context_Access := Self.Contexts.Get_Best_Context (Value.textDocument.uri); @@ -3329,8 +3329,11 @@ package body LSP.Ada_Handlers is and then not Imprecise then -- Success only if the node is a name and can be resolved precisely - Response.Value.Variant_1 := Self.To_LSP_Location (Name_Node).a_range; - + Response := + (Is_Null => False, + Value => + (Kind => LSP.Structures.Variant_1, + Variant_1 => Self.To_LSP_Location (Name_Node).a_range)); end if; Self.Sender.On_PrepareRename_Response (Id, Response); diff --git a/testsuite/ada_lsp/rename.prepare/test.yaml b/testsuite/ada_lsp/rename.prepare/test.yaml index a504e5c09..c7c534518 100644 --- a/testsuite/ada_lsp/rename.prepare/test.yaml +++ b/testsuite/ada_lsp/rename.prepare/test.yaml @@ -1,4 +1 @@ title: 'rename.prepare' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] From 53d80a939b2681ad27e3786f4eeba4717ca2832b Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Wed, 6 Sep 2023 14:28:53 +0300 Subject: [PATCH 104/152] Avoid VSS_Common usage, because it's missed if vss is installed Refs #1170 --- gnat/lsp_3_17.gpr | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gnat/lsp_3_17.gpr b/gnat/lsp_3_17.gpr index 8e65552bb..b2a4ba586 100644 --- a/gnat/lsp_3_17.gpr +++ b/gnat/lsp_3_17.gpr @@ -15,12 +15,15 @@ -- of the license. -- ------------------------------------------------------------------------------ -with "vss_common"; with "vss_text"; with "vss_json"; project LSP_3_17 is + type OS_API_Kind is ("unix", "osx", "Windows_NT"); + OS_API : OS_API_Kind := + external ("LSP_OS", external ("OS", "unix")); + type Any_Build_Mode is ( "prod", -- Produce efficient code to be used in production and don't treat @@ -107,7 +110,7 @@ project LSP_3_17 is end Compiler; package Naming is - case VSS_Common.OS_API is + case OS_API is when "Windows_NT" => for Implementation ("LSP.Stdio_Streams.Initialize") use "lsp-stdio_streams-init_windows.adb"; From a563d2803cf761f01cc2f14b12068e202f6ca42a Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Wed, 6 Sep 2023 16:03:15 +0300 Subject: [PATCH 105/152] Use handler to make LSP Location in completion routines. Refs #1170 --- source/ada/lsp-ada_completions-generic_assoc.adb | 11 +++++++++-- source/ada/lsp-ada_completions-parameters.ads | 7 +++++-- source/ada/lsp-ada_completions.adb | 7 ++++--- source/ada/lsp-ada_completions.ads | 4 +++- source/ada/lsp-ada_documents.adb | 16 +++++++++------- source/ada/lsp-ada_documents.ads | 5 ++++- source/ada/lsp-ada_handlers.adb | 8 +++++--- source/ada/lsp-utils.adb | 1 + source/ada/lsp-utils.ads | 6 ------ .../test.json | 9 +++------ .../test.yaml | 3 --- 11 files changed, 43 insertions(+), 34 deletions(-) diff --git a/source/ada/lsp-ada_completions-generic_assoc.adb b/source/ada/lsp-ada_completions-generic_assoc.adb index b385a543b..681ebc8ba 100644 --- a/source/ada/lsp-ada_completions-generic_assoc.adb +++ b/source/ada/lsp-ada_completions-generic_assoc.adb @@ -18,13 +18,17 @@ with GNATCOLL.Utils; with GNATCOLL.Traces; with Laltools.Common; -with LSP.Ada_Documents; with LSP.Ada_Documentation; +with LSP.Ada_Documents; with LSP.Enumerations; with VSS.Strings.Character_Iterators; with VSS.Strings.Conversions; with VSS.Unicode; +pragma Warnings (Off, "is not referenced"); +with LSP.Ada_Handlers; -- to be able to write `Self.Handler.all` +pragma Warnings (On, "is not referenced"); + package body LSP.Ada_Completions.Generic_Assoc is Me_Debug : constant GNATCOLL.Traces.Trace_Handle := @@ -372,12 +376,15 @@ package body LSP.Ada_Completions.Generic_Assoc is Item.insertText.Append (Whitespace_Prefix); Item.insertText.Append (Params_Snippet); Item.kind := (True, LSP.Enumerations.Snippet); + LSP.Ada_Documents.Set_Completion_Item_Documentation - (Context => Self.Context.all, + (Handler => Self.Handler.all, + Context => Self.Context.all, BD => Decl, Item => Item, Compute_Doc_And_Details => Self.Compute_Doc_And_Details); + Pretty_Print_Snippet (Context => Self.Context.all, Prefix => Prefix, diff --git a/source/ada/lsp-ada_completions-parameters.ads b/source/ada/lsp-ada_completions-parameters.ads index ee131503c..7892c8813 100644 --- a/source/ada/lsp-ada_completions-parameters.ads +++ b/source/ada/lsp-ada_completions-parameters.ads @@ -18,12 +18,15 @@ with LSP.Ada_Context_Sets; with LSP.Ada_Documents; +limited with LSP.Ada_Handlers; package LSP.Ada_Completions.Parameters is type Parameter_Completion_Provider - (Context : not null LSP.Ada_Context_Sets.Context_Access; - Document : LSP.Ada_Documents.Document_Access; + (Context : not null LSP.Ada_Context_Sets.Context_Access; + Handler : not null access LSP.Ada_Handlers.Message_Handler; + Document : LSP.Ada_Documents.Document_Access; + Named_Notation_Threshold : Natural; Compute_Doc_And_Details : Boolean) is new Completion_Provider with null record; diff --git a/source/ada/lsp-ada_completions.adb b/source/ada/lsp-ada_completions.adb index 89361418f..80005acaf 100644 --- a/source/ada/lsp-ada_completions.adb +++ b/source/ada/lsp-ada_completions.adb @@ -105,7 +105,8 @@ package body LSP.Ada_Completions is ----------------------- procedure Write_Completions - (Context : LSP.Ada_Contexts.Context; + (Handler : in out LSP.Ada_Handlers.Message_Handler; + Context : LSP.Ada_Contexts.Context; Document : LSP.Ada_Documents.Document; Sloc : Langkit_Support.Slocs.Source_Location; Node : Libadalang.Analysis.Ada_Node; @@ -154,8 +155,8 @@ package body LSP.Ada_Completions is if Append then Result.Append - (LSP.Ada_Documents.Compute_Completion_Item - (Document => Document, + (Document.Compute_Completion_Item + (Handler => Handler, Context => Context, Sloc => Sloc, Node => Node, diff --git a/source/ada/lsp-ada_completions.ads b/source/ada/lsp-ada_completions.ads index 7e87b2a5d..6e0454904 100644 --- a/source/ada/lsp-ada_completions.ads +++ b/source/ada/lsp-ada_completions.ads @@ -29,6 +29,7 @@ with VSS.Strings; limited with LSP.Ada_Contexts; limited with LSP.Ada_Documents; +limited with LSP.Ada_Handlers; limited with LSP.Ada_Completions.Filters; with LSP.Structures; @@ -98,7 +99,8 @@ package LSP.Ada_Completions is -- The Filter could be used to quick check common completion contexts. procedure Write_Completions - (Context : LSP.Ada_Contexts.Context; + (Handler : in out LSP.Ada_Handlers.Message_Handler; + Context : LSP.Ada_Contexts.Context; Document : LSP.Ada_Documents.Document; Sloc : Langkit_Support.Slocs.Source_Location; Node : Libadalang.Analysis.Ada_Node; diff --git a/source/ada/lsp-ada_documents.adb b/source/ada/lsp-ada_documents.adb index 97157f3c5..c4093f78d 100644 --- a/source/ada/lsp-ada_documents.adb +++ b/source/ada/lsp-ada_documents.adb @@ -53,6 +53,7 @@ with LSP.Enumerations; with LSP.Predicates; with LSP.Utils; with LSP.Structures.LSPAny_Vectors; +with LSP.Ada_Handlers.Locations; package body LSP.Ada_Documents is pragma Warnings (Off); @@ -214,6 +215,7 @@ package body LSP.Ada_Documents is function Compute_Completion_Item (Document : LSP.Ada_Documents.Document; + Handler : in out LSP.Ada_Handlers.Message_Handler; Context : LSP.Ada_Contexts.Context; Sloc : Langkit_Support.Slocs.Source_Location; Node : Libadalang.Analysis.Ada_Node; @@ -226,7 +228,8 @@ package body LSP.Ada_Documents is Is_Visible : Boolean; Pos : Integer; Weight : Ada_Completions.Completion_Item_Weight_Type; - Completions_Count : Natural) return LSP.Structures.CompletionItem + Completions_Count : Natural) + return LSP.Structures.CompletionItem is package Weight_Formatters renames VSS.Strings.Formatters.Integers; @@ -282,7 +285,8 @@ package body LSP.Ada_Documents is Item.sortText := Get_Sort_Text (Label); Set_Completion_Item_Documentation - (Context => Context, + (Handler => Handler, + Context => Context, BD => BD, Item => Item, Compute_Doc_And_Details => Compute_Doc_And_Details); @@ -2235,7 +2239,8 @@ package body LSP.Ada_Documents is --------------------------------------- procedure Set_Completion_Item_Documentation - (Context : LSP.Ada_Contexts.Context; + (Handler : in out LSP.Ada_Handlers.Message_Handler; + Context : LSP.Ada_Contexts.Context; BD : Libadalang.Analysis.Basic_Decl; Item : in out LSP.Structures.CompletionItem; Compute_Doc_And_Details : Boolean) @@ -2283,10 +2288,7 @@ package body LSP.Ada_Documents is -- Set node's location to the 'data' field of the completion item, so -- that we can retrieve it in the completionItem/resolve handler. LSP.Structures.LSPAny_Vectors.To_Any - (LSP.Structures.Location' - (uri => LSP.Utils.To_DocumentUri (BD.Unit.Get_Filename), - a_range => LSP.Utils.To_Range (BD.Sloc_Range), - others => <>), + (LSP.Ada_Handlers.Locations.To_LSP_Location (Handler, BD), Item.data); end if; end Set_Completion_Item_Documentation; diff --git a/source/ada/lsp-ada_documents.ads b/source/ada/lsp-ada_documents.ads index 0f27fdd6e..d769b17bd 100644 --- a/source/ada/lsp-ada_documents.ads +++ b/source/ada/lsp-ada_documents.ads @@ -31,6 +31,7 @@ with Laltools.Partial_GNATPP; with Pp.Command_Lines; limited with LSP.Ada_Contexts; +limited with LSP.Ada_Handlers; with LSP.Ada_Completions; with LSP.Ada_Highlighters; with LSP.Constants; @@ -275,6 +276,7 @@ package LSP.Ada_Documents is function Compute_Completion_Item (Document : LSP.Ada_Documents.Document; + Handler : in out LSP.Ada_Handlers.Message_Handler; Context : LSP.Ada_Contexts.Context; Sloc : Langkit_Support.Slocs.Source_Location; Node : Libadalang.Analysis.Ada_Node; @@ -304,7 +306,8 @@ package LSP.Ada_Documents is -- Completions_Count is the total number of completion items. procedure Set_Completion_Item_Documentation - (Context : LSP.Ada_Contexts.Context; + (Handler : in out LSP.Ada_Handlers.Message_Handler; + Context : LSP.Ada_Contexts.Context; BD : Libadalang.Analysis.Basic_Decl; Item : in out LSP.Structures.CompletionItem; Compute_Doc_And_Details : Boolean); diff --git a/source/ada/lsp-ada_handlers.adb b/source/ada/lsp-ada_handlers.adb index 4dbaf4cbc..3800cf511 100644 --- a/source/ada/lsp-ada_handlers.adb +++ b/source/ada/lsp-ada_handlers.adb @@ -1554,7 +1554,8 @@ package body LSP.Ada_Handlers is (Self'Access, Context); P7 : aliased LSP.Ada_Completions.Parameters.Parameter_Completion_Provider - (Context => Context, + (Handler => Self'Unchecked_Access, + Context => Context, Document => Document, Compute_Doc_And_Details => Compute_Doc_And_Details, Named_Notation_Threshold => @@ -1599,7 +1600,8 @@ package body LSP.Ada_Handlers is Result => Response.Variant_2); LSP.Ada_Completions.Write_Completions - (Context => Context.all, + (Handler => Self, + Context => Context.all, Document => Document.all, Sloc => Sloc, Node => Node, @@ -1625,7 +1627,7 @@ package body LSP.Ada_Handlers is Node : Libadalang.Analysis.Ada_Node; C : LSP.Structures.JSON_Event_Vectors.Cursor; Location : LSP.Structures.Location; - Response : LSP.Structures.CompletionItem; + Response : LSP.Structures.CompletionItem := Value; begin -- Return immediately if we don't have data that allows us to compute diff --git a/source/ada/lsp-utils.adb b/source/ada/lsp-utils.adb index 029df6d95..ef37daf3c 100644 --- a/source/ada/lsp-utils.adb +++ b/source/ada/lsp-utils.adb @@ -29,6 +29,7 @@ with Langkit_Support.Token_Data_Handlers; with Pp.Actions; with VSS.Strings.Character_Iterators; +with VSS.Strings.Conversions; with VSS.Strings.Formatters.Generic_Modulars; with VSS.Strings.Formatters.Strings; with VSS.Strings.Templates; diff --git a/source/ada/lsp-utils.ads b/source/ada/lsp-utils.ads index 740d62756..944e1dd9e 100644 --- a/source/ada/lsp-utils.ads +++ b/source/ada/lsp-utils.ads @@ -20,7 +20,6 @@ with Ada.Containers; with VSS.Strings; -with VSS.Strings.Conversions; with Libadalang.Analysis; with Langkit_Support.Slocs; @@ -83,11 +82,6 @@ package LSP.Utils is (Node : Libadalang.Analysis.Ada_Node'Class) return Boolean; -- Check if Node is in a synthetic file (like "__standard"). - function To_DocumentUri - (X : String) - return LSP.Structures.DocumentUri is - (VSS.Strings.Conversions.To_Virtual_String (X) with null record); - procedure Format_Vector (Cmd : Standard.Utils.Command_Lines.Command_Line; Input : Standard.Utils.Char_Vectors.Char_Vector; diff --git a/testsuite/ada_lsp/documentation.subprogram-from-generic/test.json b/testsuite/ada_lsp/documentation.subprogram-from-generic/test.json index 51d76050f..61eee1d41 100644 --- a/testsuite/ada_lsp/documentation.subprogram-from-generic/test.json +++ b/testsuite/ada_lsp/documentation.subprogram-from-generic/test.json @@ -157,8 +157,7 @@ { "label": "Do_Nothing", "kind": 3, - "sortText": "025&1Do_Nothing", - "additionalTextEdits": [], + "sortText": "25&1Do_Nothing", "data": { "uri": "$URI{foo.adb}", "range": { @@ -188,8 +187,7 @@ "params": { "label": "Do_Nothing", "kind": 3, - "sortText": "025&1Do_Nothing", - "additionalTextEdits": [], + "sortText": "25&1Do_Nothing", "data": { "uri": "$URI{foo.adb}", "range": { @@ -213,8 +211,7 @@ "kind": 3, "detail": "procedure Do_Nothing", "documentation": "at foo.adb (5:7)\n\nIt doesn't do anything, but test documentation extraction.", - "sortText": "025&1Do_Nothing", - "additionalTextEdits": [], + "sortText": "25&1Do_Nothing", "data": { "uri": "$URI{foo.adb}", "range": { diff --git a/testsuite/ada_lsp/documentation.subprogram-from-generic/test.yaml b/testsuite/ada_lsp/documentation.subprogram-from-generic/test.yaml index 3cb491b9b..d37b34bc9 100644 --- a/testsuite/ada_lsp/documentation.subprogram-from-generic/test.yaml +++ b/testsuite/ada_lsp/documentation.subprogram-from-generic/test.yaml @@ -1,4 +1 @@ title: 'documentation.subprogram-from-generic' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] From 6a64416a66cae4b1d2226b20eba71dba2c51a665 Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Wed, 6 Sep 2023 19:32:27 +0300 Subject: [PATCH 106/152] Clear diagnostics before deallocating the document Refs #1170 --- source/ada/lsp-ada_handlers.adb | 8 ++--- .../T923-019.project_reload.gnatpp/test.json | 34 +------------------ .../T923-019.project_reload.gnatpp/test.yaml | 3 -- testsuite/ada_lsp/publish_diag/test.yaml | 3 -- 4 files changed, 5 insertions(+), 43 deletions(-) diff --git a/source/ada/lsp-ada_handlers.adb b/source/ada/lsp-ada_handlers.adb index 3800cf511..e488369c3 100644 --- a/source/ada/lsp-ada_handlers.adb +++ b/source/ada/lsp-ada_handlers.adb @@ -2269,6 +2269,10 @@ package body LSP.Ada_Handlers is Context.Flush_Document (File); end loop; + -- Clean diagnostics up on closing document + Self.Clean_Diagnostics + (LSP.Ada_Documents.Document_Access (Document)); + Free (Document); else @@ -2280,10 +2284,6 @@ package body LSP.Ada_Handlers is & "with uri: "); Self.Tracer.Trace_Text (URI); end if; - - -- Clean diagnostics up on closing document - Self.Clean_Diagnostics - (LSP.Ada_Documents.Document_Access (Document)); end On_DidClose_Notification; ------------------------------------ diff --git a/testsuite/ada_lsp/T923-019.project_reload.gnatpp/test.json b/testsuite/ada_lsp/T923-019.project_reload.gnatpp/test.json index 0bac722c9..3185be31b 100644 --- a/testsuite/ada_lsp/T923-019.project_reload.gnatpp/test.json +++ b/testsuite/ada_lsp/T923-019.project_reload.gnatpp/test.json @@ -75,39 +75,7 @@ "id": "ada-1", "result": { "capabilities": { - "textDocumentSync": 2, - "completionProvider": { - "triggerCharacters": [ - ".", - ",", - "'", - "(" - ], - "resolveProvider": true - }, - "hoverProvider": true, - "declarationProvider": true, - "definitionProvider": true, - "typeDefinitionProvider": true, - "implementationProvider": true, - "referencesProvider": true, - "codeActionProvider": {}, - "documentFormattingProvider": true, - "renameProvider": {}, - "foldingRangeProvider": true, - "executeCommandProvider": {}, - "workspaceSymbolProvider": true, - "alsShowDepsProvider": true, - "alsReferenceKinds": [ - "reference", - "access", - "write", - "call", - "dispatching call", - "parent", - "child", - "overriding" - ] + "textDocumentSync": 2 } } } diff --git a/testsuite/ada_lsp/T923-019.project_reload.gnatpp/test.yaml b/testsuite/ada_lsp/T923-019.project_reload.gnatpp/test.yaml index 7dd18811c..e120f21ea 100644 --- a/testsuite/ada_lsp/T923-019.project_reload.gnatpp/test.yaml +++ b/testsuite/ada_lsp/T923-019.project_reload.gnatpp/test.yaml @@ -1,4 +1 @@ title: 'T923-019.project_reload.gnatpp' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/publish_diag/test.yaml b/testsuite/ada_lsp/publish_diag/test.yaml index 3a6fb7d24..5407b203c 100644 --- a/testsuite/ada_lsp/publish_diag/test.yaml +++ b/testsuite/ada_lsp/publish_diag/test.yaml @@ -1,4 +1 @@ title: 'publish_diag' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] From 3cf6273affb93a579eb3f5807daad3d9a38c396c Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Wed, 6 Sep 2023 19:57:36 +0300 Subject: [PATCH 107/152] Remember scenario variables after parsing Refs #1170 --- source/ada/lsp-ada_configurations.adb | 3 +++ testsuite/ada_lsp/completion.snippet.formatting3/test.yaml | 3 --- testsuite/ada_lsp/project_reload/test.yaml | 3 --- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/source/ada/lsp-ada_configurations.adb b/source/ada/lsp-ada_configurations.adb index 080d5b8c6..03158d088 100644 --- a/source/ada/lsp-ada_configurations.adb +++ b/source/ada/lsp-ada_configurations.adb @@ -307,6 +307,9 @@ package body LSP.Ada_Configurations is Reload := Reload or else Variables_Names /= Self.Variables_Names or else Variables_Values /= Self.Variables_Values; + + Self.Variables_Names := Variables_Names; + Self.Variables_Values := Variables_Values; end Read_JSON; end LSP.Ada_Configurations; diff --git a/testsuite/ada_lsp/completion.snippet.formatting3/test.yaml b/testsuite/ada_lsp/completion.snippet.formatting3/test.yaml index 61af73928..fd4f2d176 100644 --- a/testsuite/ada_lsp/completion.snippet.formatting3/test.yaml +++ b/testsuite/ada_lsp/completion.snippet.formatting3/test.yaml @@ -1,4 +1 @@ title: 'completion.snippet.formatting3' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/project_reload/test.yaml b/testsuite/ada_lsp/project_reload/test.yaml index 893aaa5b9..f74b5a50a 100644 --- a/testsuite/ada_lsp/project_reload/test.yaml +++ b/testsuite/ada_lsp/project_reload/test.yaml @@ -1,4 +1 @@ title: 'project_reload' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] From a48a225be49c2707f7964e399c0d8f9efdf6ee9f Mon Sep 17 00:00:00 2001 From: Andry Ogorodnik Date: Thu, 7 Sep 2023 12:13:15 +0000 Subject: [PATCH 108/152] Enable tests --- ...ada_handlers-named_parameters_commands.ads | 2 +- ...factor-change_parameters_default_value.adb | 8 +-- ...a_handlers-refactor-extract_subprogram.adb | 8 +-- ..._handlers-refactor-pull_up_declaration.adb | 3 +- .../SC28-001.named.parameters.0.json | 52 ++++--------------- .../SC28-001.named.parameters.0/test.yaml | 3 -- .../test.json | 38 +------------- .../test.yaml | 3 -- .../ada_lsp/named_params.dot_calls/test.json | 32 +----------- .../ada_lsp/named_params.dot_calls/test.yaml | 3 -- testsuite/ada_lsp/named_params/test.json | 2 +- .../S314-015/test.json | 8 +-- .../S314-015/test.yaml | 3 -- .../SA11-047_0/test.json | 6 +-- .../SA11-047_0/test.yaml | 3 -- .../SA11-047_1/test.json | 8 ++- .../SA11-047_1/test.yaml | 3 -- .../Q817-007/test.json | 27 +--------- .../Q817-007/test.yaml | 3 -- 19 files changed, 35 insertions(+), 180 deletions(-) diff --git a/source/ada/lsp-ada_handlers-named_parameters_commands.ads b/source/ada/lsp-ada_handlers-named_parameters_commands.ads index 5bf294e69..93eeb0845 100644 --- a/source/ada/lsp-ada_handlers-named_parameters_commands.ads +++ b/source/ada/lsp-ada_handlers-named_parameters_commands.ads @@ -45,7 +45,7 @@ private type Command is new LSP.Commands.Command with record Context : VSS.Strings.Virtual_String; Where : LSP.Structures.TextDocumentPositionParams; - Versioned_Documents : Boolean; + Versioned_Documents : Boolean := True; end record; overriding function Create diff --git a/source/ada/lsp-ada_handlers-refactor-change_parameters_default_value.adb b/source/ada/lsp-ada_handlers-refactor-change_parameters_default_value.adb index d098b932f..762159536 100644 --- a/source/ada/lsp-ada_handlers-refactor-change_parameters_default_value.adb +++ b/source/ada/lsp-ada_handlers-refactor-change_parameters_default_value.adb @@ -111,7 +111,7 @@ package body LSP.Ada_Handlers.Refactor.Change_Parameters_Default_Value is elsif Key = "where" then Self.Where := From_Any (C); - elsif Key = "newParametersType" then + elsif Key = "newParametersDefaultValue" then Self.New_Parameters_Default_Value := Element (C).String_Value; @@ -147,9 +147,9 @@ package body LSP.Ada_Handlers.Refactor.Change_Parameters_Default_Value is LSP.Ada_Handlers.Message_Handler (Handler.all); Context : LSP.Ada_Contexts.Context renames Message_Handler.Contexts.Get (Self.Context).all; - - Unit : constant Analysis_Unit := Context.LAL_Context.Get_From_File - (VSS.Strings.Conversions.To_UTF_8_String (Self.Where.uri)); + File : constant GNATCOLL.VFS.Virtual_File := + Message_Handler.To_File (Self.Where.uri); + Unit : constant Analysis_Unit := Context.Get_AU (File); Parameters_SLOC_Range : constant Source_Location_Range := (Langkit_Support.Slocs.Line_Number diff --git a/source/ada/lsp-ada_handlers-refactor-extract_subprogram.adb b/source/ada/lsp-ada_handlers-refactor-extract_subprogram.adb index 22c584050..549fd4f4b 100644 --- a/source/ada/lsp-ada_handlers-refactor-extract_subprogram.adb +++ b/source/ada/lsp-ada_handlers-refactor-extract_subprogram.adb @@ -152,10 +152,10 @@ package body LSP.Ada_Handlers.Refactor.Extract_Subprogram is (Context.Analysis_Units); -- Provides the Context Analysis_Unit_Array to the Mode_Changer - Unit : constant Analysis_Unit := - Context.LAL_Context.Get_From_File - (VSS.Strings.Conversions.To_UTF_8_String - (Self.Section_To_Extract_SLOC.uri)); + File : constant GNATCOLL.VFS.Virtual_File := + Message_Handler.To_File (Self.Section_To_Extract_SLOC.uri); + + Unit : constant Analysis_Unit := Context.Get_AU (File); Section_To_Extract : constant Source_Location_Range := (Langkit_Support.Slocs.Line_Number (Self.Section_To_Extract_SLOC.a_range.start.line) + 1, diff --git a/source/ada/lsp-ada_handlers-refactor-pull_up_declaration.adb b/source/ada/lsp-ada_handlers-refactor-pull_up_declaration.adb index 10341a3c6..c2693c150 100644 --- a/source/ada/lsp-ada_handlers-refactor-pull_up_declaration.adb +++ b/source/ada/lsp-ada_handlers-refactor-pull_up_declaration.adb @@ -139,8 +139,7 @@ package body LSP.Ada_Handlers.Refactor.Pull_Up_Declaration is File : constant GNATCOLL.VFS.Virtual_File := Message_Handler.To_File (Self.Where.uri); - Unit : constant Analysis_Unit := - Context.LAL_Context.Get_From_File (File.Display_Full_Name); + Unit : constant Analysis_Unit := Context.Get_AU (File); Declaration_SLOC : constant Source_Location := (Langkit_Support.Slocs.Line_Number diff --git a/testsuite/ada_lsp/SC28-001.named.parameters.0/SC28-001.named.parameters.0.json b/testsuite/ada_lsp/SC28-001.named.parameters.0/SC28-001.named.parameters.0.json index 8cf2c3c4f..64f1f1b81 100644 --- a/testsuite/ada_lsp/SC28-001.named.parameters.0/SC28-001.named.parameters.0.json +++ b/testsuite/ada_lsp/SC28-001.named.parameters.0/SC28-001.named.parameters.0.json @@ -80,44 +80,12 @@ "result": { "capabilities": { "textDocumentSync": 2, - "completionProvider": { - "triggerCharacters": [ - ".", - ",", - "'", - "(" - ], - "resolveProvider": true - }, - "hoverProvider": true, - "declarationProvider": true, - "definitionProvider": true, - "typeDefinitionProvider": true, - "implementationProvider": true, - "referencesProvider": true, - "codeActionProvider": {}, - "documentFormattingProvider": true, - "renameProvider": {}, - "foldingRangeProvider": true, "executeCommandProvider": { "commands": [ "", "als-named-parameters" ] - }, - "workspaceSymbolProvider": true, - "callHierarchyProvider": {}, - "alsShowDepsProvider": true, - "alsReferenceKinds": [ - "reference", - "access", - "write", - "call", - "dispatching call", - "parent", - "child", - "overriding" - ] + } } } } @@ -151,7 +119,7 @@ "wait": [ { "jsonrpc": "2.0", - "id": 2, + "id": 1, "method": "window/workDoneProgress/create", "params": { "token": "" @@ -272,7 +240,7 @@ "wait": [ { "jsonrpc": "2.0", - "id": 3, + "id": "ada-3", "method": "workspace/applyEdit", "params": { "edit": { @@ -332,7 +300,7 @@ "wait": [ { "jsonrpc": "2.0", - "id": 4, + "id": "ada-4", "method": "workspace/applyEdit", "params": { "edit": { @@ -392,7 +360,7 @@ "wait": [ { "jsonrpc": "2.0", - "id": 5, + "id": "ada-5", "method": "workspace/applyEdit", "params": { "edit": { @@ -452,7 +420,7 @@ "wait": [ { "jsonrpc": "2.0", - "id": 6, + "id": "ada-6", "method": "workspace/applyEdit", "params": { "edit": { @@ -512,7 +480,7 @@ "wait": [ { "jsonrpc": "2.0", - "id": 7, + "id": "ada-7", "method": "workspace/applyEdit", "params": { "edit": { @@ -572,7 +540,7 @@ "wait": [ { "jsonrpc": "2.0", - "id": 8, + "id": "ada-8", "method": "workspace/applyEdit", "params": { "edit": { @@ -632,7 +600,7 @@ "wait": [ { "jsonrpc": "2.0", - "id": 9, + "id": "ada-9", "method": "workspace/applyEdit", "params": { "edit": { @@ -692,7 +660,7 @@ "wait": [ { "jsonrpc": "2.0", - "id": 10, + "id": "ada-10", "method": "workspace/applyEdit", "params": { "edit": { diff --git a/testsuite/ada_lsp/SC28-001.named.parameters.0/test.yaml b/testsuite/ada_lsp/SC28-001.named.parameters.0/test.yaml index 25ba1c4e9..c007b5663 100644 --- a/testsuite/ada_lsp/SC28-001.named.parameters.0/test.yaml +++ b/testsuite/ada_lsp/SC28-001.named.parameters.0/test.yaml @@ -1,4 +1 @@ title: 'SC28-001.named.parameters.0' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/U416-030.refactor_remove_parameter_0/test.json b/testsuite/ada_lsp/U416-030.refactor_remove_parameter_0/test.json index bd135e70d..5e10fed5e 100644 --- a/testsuite/ada_lsp/U416-030.refactor_remove_parameter_0/test.json +++ b/testsuite/ada_lsp/U416-030.refactor_remove_parameter_0/test.json @@ -178,52 +178,18 @@ "result": { "capabilities": { "textDocumentSync": 2, - "completionProvider": { - "triggerCharacters": [ - ".", - ",", - "'", - "(" - ], - "resolveProvider": true - }, - "hoverProvider": true, - "declarationProvider": true, - "definitionProvider": true, - "typeDefinitionProvider": true, - "implementationProvider": true, - "referencesProvider": true, - "documentHighlightProvider": true, "codeActionProvider": { "codeActionKinds": [ "", "refactor.rewrite" ] }, - "documentFormattingProvider": true, - "renameProvider": { - "prepareProvider": true - }, - "foldingRangeProvider": true, "executeCommandProvider": { "commands": [ "", "als-refactor-remove-parameters" ] - }, - "workspaceSymbolProvider": true, - "callHierarchyProvider": {}, - "alsShowDepsProvider": true, - "alsReferenceKinds": [ - "reference", - "access", - "write", - "call", - "dispatching call", - "parent", - "child", - "overriding" - ] + } } } } @@ -264,7 +230,7 @@ "wait": [ { "jsonrpc": "2.0", - "id": 3, + "id": 1, "method": "window/workDoneProgress/create", "params": { "token": "" diff --git a/testsuite/ada_lsp/U416-030.refactor_remove_parameter_0/test.yaml b/testsuite/ada_lsp/U416-030.refactor_remove_parameter_0/test.yaml index eb490028b..e9688a1ce 100644 --- a/testsuite/ada_lsp/U416-030.refactor_remove_parameter_0/test.yaml +++ b/testsuite/ada_lsp/U416-030.refactor_remove_parameter_0/test.yaml @@ -1,4 +1 @@ title: 'S314-015.refactor_change_parameter_mode_0' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/named_params.dot_calls/test.json b/testsuite/ada_lsp/named_params.dot_calls/test.json index c365730f8..f39f5bb53 100644 --- a/testsuite/ada_lsp/named_params.dot_calls/test.json +++ b/testsuite/ada_lsp/named_params.dot_calls/test.json @@ -70,42 +70,12 @@ "result": { "capabilities": { "textDocumentSync": 2, - "completionProvider": { - "resolveProvider": true, - "triggerCharacters": [ - ".", - ",", - "'", - "(" - ] - }, - "hoverProvider": true, - "declarationProvider": true, - "definitionProvider": true, - "typeDefinitionProvider": true, - "implementationProvider": true, - "referencesProvider": true, - "codeActionProvider": { - }, - "renameProvider": { - }, - "foldingRangeProvider": true, "executeCommandProvider": { "commands": [ "", "als-named-parameters" ] - }, - "alsReferenceKinds": [ - "reference", - "access", - "write", - "call", - "dispatching call", - "parent", - "child", - "overriding" - ] + } } } } diff --git a/testsuite/ada_lsp/named_params.dot_calls/test.yaml b/testsuite/ada_lsp/named_params.dot_calls/test.yaml index 1dc519ee0..ada715aa1 100644 --- a/testsuite/ada_lsp/named_params.dot_calls/test.yaml +++ b/testsuite/ada_lsp/named_params.dot_calls/test.yaml @@ -1,4 +1 @@ title: 'named_params.dot_calls' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/named_params/test.json b/testsuite/ada_lsp/named_params/test.json index 5dd334012..9a18fa1ea 100644 --- a/testsuite/ada_lsp/named_params/test.json +++ b/testsuite/ada_lsp/named_params/test.json @@ -72,7 +72,7 @@ "wait": [ { "jsonrpc": "2.0", - "id": 2, + "id": 1, "method": "window/workDoneProgress/create", "params": { "token": "" diff --git a/testsuite/ada_lsp/refactoring_change_parameters_default_values/S314-015/test.json b/testsuite/ada_lsp/refactoring_change_parameters_default_values/S314-015/test.json index 2801c2885..52ea9abfc 100644 --- a/testsuite/ada_lsp/refactoring_change_parameters_default_values/S314-015/test.json +++ b/testsuite/ada_lsp/refactoring_change_parameters_default_values/S314-015/test.json @@ -181,7 +181,7 @@ "command": { "title": "", "command": "als-refactor-change_parameters_default_value", - "arguments": { + "arguments": [{ "context": "Default", "where": { "uri": "$URI{main.adb}", @@ -197,7 +197,7 @@ } }, "newParametersDefaultValue": "" - } + }] } } ] @@ -213,7 +213,7 @@ "method": "workspace/executeCommand", "params": { "command": "als-refactor-change_parameters_default_value", - "arguments": { + "arguments": [{ "context": "Default", "where": { "uri": "$URI{main.adb}", @@ -229,7 +229,7 @@ } }, "newParametersDefaultValue": "False" - } + }] } }, "wait": [ diff --git a/testsuite/ada_lsp/refactoring_change_parameters_default_values/S314-015/test.yaml b/testsuite/ada_lsp/refactoring_change_parameters_default_values/S314-015/test.yaml index 3fa8ff28a..3ef6451e6 100644 --- a/testsuite/ada_lsp/refactoring_change_parameters_default_values/S314-015/test.yaml +++ b/testsuite/ada_lsp/refactoring_change_parameters_default_values/S314-015/test.yaml @@ -1,4 +1 @@ title: 'refactoring_change_parameters_default_values/S314-015' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/refactoring_extract_subprogram/SA11-047_0/test.json b/testsuite/ada_lsp/refactoring_extract_subprogram/SA11-047_0/test.json index 9a585c5b6..b3d8682f9 100644 --- a/testsuite/ada_lsp/refactoring_extract_subprogram/SA11-047_0/test.json +++ b/testsuite/ada_lsp/refactoring_extract_subprogram/SA11-047_0/test.json @@ -43,7 +43,6 @@ "codeActionLiteralSupport": { "codeActionKind": { "valueSet": [ - "", "refactor", "refactor.extract", "refactor.inline", @@ -78,8 +77,7 @@ "", "als-refactor-extract-subprogram" ] - }, - "alsCheckSyntaxProvider": true + } } } } @@ -120,7 +118,7 @@ "wait": [ { "jsonrpc": "2.0", - "id": 2, + "id": 1, "method": "window/workDoneProgress/create", "params": { "token": "" diff --git a/testsuite/ada_lsp/refactoring_extract_subprogram/SA11-047_0/test.yaml b/testsuite/ada_lsp/refactoring_extract_subprogram/SA11-047_0/test.yaml index 87a9e3e62..9f0e99c25 100644 --- a/testsuite/ada_lsp/refactoring_extract_subprogram/SA11-047_0/test.yaml +++ b/testsuite/ada_lsp/refactoring_extract_subprogram/SA11-047_0/test.yaml @@ -1,4 +1 @@ title: 'refactoring_extract_subprogram/SA11-047_0' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/refactoring_extract_subprogram/SA11-047_1/test.json b/testsuite/ada_lsp/refactoring_extract_subprogram/SA11-047_1/test.json index d4c48e006..f0f69e8e3 100644 --- a/testsuite/ada_lsp/refactoring_extract_subprogram/SA11-047_1/test.json +++ b/testsuite/ada_lsp/refactoring_extract_subprogram/SA11-047_1/test.json @@ -43,7 +43,6 @@ "codeActionLiteralSupport": { "codeActionKind": { "valueSet": [ - "", "refactor", "refactor.extract", "refactor.inline", @@ -78,8 +77,7 @@ "", "als-refactor-extract-subprogram" ] - }, - "alsCheckSyntaxProvider": true + } } } } @@ -120,7 +118,7 @@ "wait": [ { "jsonrpc": "2.0", - "id": 2, + "id": 1, "method": "window/workDoneProgress/create", "params": { "token": "" @@ -331,4 +329,4 @@ "exit_code": 0 } } -] \ No newline at end of file +] diff --git a/testsuite/ada_lsp/refactoring_extract_subprogram/SA11-047_1/test.yaml b/testsuite/ada_lsp/refactoring_extract_subprogram/SA11-047_1/test.yaml index 5b557ae5e..09d270119 100644 --- a/testsuite/ada_lsp/refactoring_extract_subprogram/SA11-047_1/test.yaml +++ b/testsuite/ada_lsp/refactoring_extract_subprogram/SA11-047_1/test.yaml @@ -1,4 +1 @@ title: 'refactoring_extract_subprogram/SA11-047_1' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/refactoring_replace_type/Q817-007/test.json b/testsuite/ada_lsp/refactoring_replace_type/Q817-007/test.json index 09ed69d4e..7c24c0cd9 100644 --- a/testsuite/ada_lsp/refactoring_replace_type/Q817-007/test.json +++ b/testsuite/ada_lsp/refactoring_replace_type/Q817-007/test.json @@ -43,7 +43,6 @@ "codeActionLiteralSupport": { "codeActionKind": { "valueSet": [ - "", "refactor", "refactor.extract", "refactor.inline", @@ -78,8 +77,7 @@ "", "als-refactor-replace-type" ] - }, - "alsCheckSyntaxProvider": true + } } } } @@ -111,7 +109,7 @@ "wait": [ { "jsonrpc": "2.0", - "id": 2, + "id": 1, "method": "window/workDoneProgress/create", "params": { "token": "" @@ -225,27 +223,6 @@ ] } }, - { - "send": { - "request": { - "jsonrpc": "2.0", - "id": 2, - "method": "$/alsCheckSyntax", - "params": { - "input": "Fox", - "rules": [ - "Defining_Name_Rule" - ] - } - }, - "wait": [ - { - "id": 2, - "result": {} - } - ] - } - }, { "send": { "request": { diff --git a/testsuite/ada_lsp/refactoring_replace_type/Q817-007/test.yaml b/testsuite/ada_lsp/refactoring_replace_type/Q817-007/test.yaml index 043a61839..9f447eac5 100644 --- a/testsuite/ada_lsp/refactoring_replace_type/Q817-007/test.yaml +++ b/testsuite/ada_lsp/refactoring_replace_type/Q817-007/test.yaml @@ -1,4 +1 @@ title: 'refactoring_replace_type/Q817-007' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] From 415fbd6385dd3bce4ba968eaff32f98dd4cc3d5b Mon Sep 17 00:00:00 2001 From: Andry Ogorodnik Date: Thu, 7 Sep 2023 15:39:32 +0000 Subject: [PATCH 109/152] Enable tests --- .../test.json | 44 ++-------- .../test.yaml | 3 - .../test.json | 20 ++--- .../test.yaml | 3 - .../U913-028.completion.params/test.json | 35 +++----- .../U913-028.completion.params/test.yaml | 3 - .../test.json | 37 +-------- .../test.yaml | 3 - .../test.json | 37 +-------- .../test.yaml | 3 - .../test.json | 60 +++++--------- .../test.yaml | 3 - .../test.json | 45 +++------- .../test.yaml | 3 - .../test.json | 49 +---------- .../test.json | 46 +--------- .../test.yaml | 3 - .../test.json | 52 ++++-------- .../test.yaml | 3 - .../completion.aspects.filtering/test.json | 7 +- .../completion.aspects.filtering/test.yaml | 5 +- .../ada_lsp/completion.aspects/test.json | 9 +- .../completion.dotted_call.keyword/test.json | 13 +-- .../completion.dotted_call.keyword/test.yaml | 3 - .../ada_lsp/completion.duplicates/test.json | 37 +-------- .../ada_lsp/completion.duplicates/test.yaml | 3 - .../completion.invisible.runtime/test.json | 39 +-------- .../ada_lsp/completion.invisible2/test.json | 8 +- .../ada_lsp/completion.invisible2/test.yaml | 3 - .../completion.lazy_computation/test.json | 73 +--------------- .../completion.lazy_computation/test.yaml | 3 - .../test.json | 27 +----- .../test.yaml | 3 - .../completion.snippet.formatting/test.json | 54 ++++-------- .../completion.snippet.formatting/test.yaml | 3 - .../completion.snippet.formatting2/test.json | 26 ++---- .../completion.snippet.formatting2/test.yaml | 3 - .../completion.subp_parameters/test.json | 83 ++++--------------- .../completion.subp_parameters/test.yaml | 3 - .../test.json | 32 +------ .../test.yaml | 3 - .../ada_lsp/completion.use_clauses/test.json | 47 +---------- .../ada_lsp/completion.use_clauses/test.yaml | 3 - 43 files changed, 148 insertions(+), 794 deletions(-) diff --git a/testsuite/ada_lsp/T713-012.completion.generic_package/test.json b/testsuite/ada_lsp/T713-012.completion.generic_package/test.json index 61a26b031..721510914 100644 --- a/testsuite/ada_lsp/T713-012.completion.generic_package/test.json +++ b/testsuite/ada_lsp/T713-012.completion.generic_package/test.json @@ -86,29 +86,7 @@ "(" ], "resolveProvider": true - }, - "hoverProvider": true, - "declarationProvider": true, - "definitionProvider": true, - "typeDefinitionProvider": true, - "implementationProvider": true, - "referencesProvider": true, - "codeActionProvider": { - }, - "renameProvider": { - }, - "foldingRangeProvider": true, - "executeCommandProvider": {}, - "alsReferenceKinds": [ - "reference", - "access", - "write", - "call", - "dispatching call", - "parent", - "child", - "overriding" - ] + } } } } @@ -202,7 +180,6 @@ "sortText": "+0", "insertText": "${1:Elt_Type : type Elt_Type(<>) is limited private;}, ${2:Elt_Ptr : type Elt_Ptr is access all Elt_Type;})$0", "insertTextFormat": 2, - "additionalTextEdits": [], "data": { "uri": "$URI{src/g.ads}", "range": { @@ -223,8 +200,7 @@ "documentation": "Elt_Type => ", "sortText": "+1", "insertText": "Elt_Type => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "Elt_Ptr", @@ -232,8 +208,7 @@ "documentation": "Elt_Ptr => ", "sortText": "+2", "insertText": "Elt_Ptr => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 } ] } @@ -280,7 +255,6 @@ "sortText": "+0", "insertText": "${1:Elt_Type : type Elt_Type(<>) is limited private;}, ${2:Elt_Ptr : type Elt_Ptr is access all Elt_Type;})$0", "insertTextFormat": 2, - "additionalTextEdits": [], "data": { "uri": "$URI{src/g.ads}", "range": { @@ -311,8 +285,7 @@ "documentation": "Elt_Type => ", "sortText": "+1", "insertText": "Elt_Type => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 } }, "wait": [ @@ -324,8 +297,7 @@ "documentation": "Elt_Type => ", "sortText": "+1", "insertText": "Elt_Type => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 } } ] @@ -452,7 +424,6 @@ "sortText": "+0", "insertText": " Elt_Ptr => ${2:type Elt_Ptr is access all Elt_Type;})$0", "insertTextFormat": 2, - "additionalTextEdits": [], "data": { "uri": "$URI{src/g.ads}", "range": { @@ -473,8 +444,7 @@ "documentation": " Elt_Ptr => ", "sortText": "+1", "insertText": " Elt_Ptr => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 } ] } @@ -494,7 +464,6 @@ "sortText": "+0", "insertText": " Elt_Ptr => ${2:type Elt_Ptr is access all Elt_Type;})$0", "insertTextFormat": 2, - "additionalTextEdits": [], "data": { "uri": "$URI{src/g.ads}", "range": { @@ -521,7 +490,6 @@ "sortText": "+0", "insertText": " Elt_Ptr => ${2:type Elt_Ptr is access all Elt_Type;})$0", "insertTextFormat": 2, - "additionalTextEdits": [], "data": { "uri": "$URI{src/g.ads}", "range": { diff --git a/testsuite/ada_lsp/T713-012.completion.generic_package/test.yaml b/testsuite/ada_lsp/T713-012.completion.generic_package/test.yaml index 3f50b7e27..6446caeb2 100644 --- a/testsuite/ada_lsp/T713-012.completion.generic_package/test.yaml +++ b/testsuite/ada_lsp/T713-012.completion.generic_package/test.yaml @@ -1,4 +1 @@ title: 'T713-012.completion.generic_package' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/U614-031.completion.simple_aggregate_formatting/test.json b/testsuite/ada_lsp/U614-031.completion.simple_aggregate_formatting/test.json index 6c92f0c49..c9b254997 100644 --- a/testsuite/ada_lsp/U614-031.completion.simple_aggregate_formatting/test.json +++ b/testsuite/ada_lsp/U614-031.completion.simple_aggregate_formatting/test.json @@ -172,7 +172,6 @@ }, "newText": "My_Record'\n (I => ${1:Integer},\n J => ${2:Integer},\n F => ${3:Float})$0" }, - "additionalTextEdits": [], "data": { "uri": "$URI{src/foo.adb}", "range": { @@ -193,8 +192,7 @@ "documentation": "I => ", "sortText": "+1", "insertText": "I => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "J", @@ -202,8 +200,7 @@ "documentation": "J => ", "sortText": "+2", "insertText": "J => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "F", @@ -211,8 +208,7 @@ "documentation": "F => ", "sortText": "+3", "insertText": "F => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 } ] } @@ -326,7 +322,6 @@ }, "newText": "(I => ${1:Integer},\n J => ${2:Integer},\n F => ${3:Float})$0" }, - "additionalTextEdits": [], "data": { "uri": "$URI{src/foo.adb}", "range": { @@ -347,8 +342,7 @@ "documentation": "I => ", "sortText": "+1", "insertText": "I => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "J", @@ -356,8 +350,7 @@ "documentation": "J => ", "sortText": "+2", "insertText": "J => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "F", @@ -365,8 +358,7 @@ "documentation": "F => ", "sortText": "+3", "insertText": "F => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 } ] } diff --git a/testsuite/ada_lsp/U614-031.completion.simple_aggregate_formatting/test.yaml b/testsuite/ada_lsp/U614-031.completion.simple_aggregate_formatting/test.yaml index 5d0df4386..3541f432f 100644 --- a/testsuite/ada_lsp/U614-031.completion.simple_aggregate_formatting/test.yaml +++ b/testsuite/ada_lsp/U614-031.completion.simple_aggregate_formatting/test.yaml @@ -1,4 +1 @@ title: 'U614-031.completion.simple_aggregate_formatting' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/U913-028.completion.params/test.json b/testsuite/ada_lsp/U913-028.completion.params/test.json index 37fe2eae1..ecb142453 100644 --- a/testsuite/ada_lsp/U913-028.completion.params/test.json +++ b/testsuite/ada_lsp/U913-028.completion.params/test.json @@ -168,7 +168,6 @@ "sortText": "+0", "insertText": "${1:I : Integer}, ${2:F : Float})$0", "insertTextFormat": 2, - "additionalTextEdits": [], "data": { "uri": "$URI{foo.adb}", "range": { @@ -188,16 +187,14 @@ "kind": 5, "sortText": "+1", "insertText": "I => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "F", "kind": 5, "sortText": "+2", "insertText": "F => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "Params of Bar", @@ -205,7 +202,6 @@ "sortText": "+3", "insertText": "${1:I : Integer}, ${2:J : Integer})$0", "insertTextFormat": 2, - "additionalTextEdits": [], "data": { "uri": "$URI{foo.adb}", "range": { @@ -225,16 +221,14 @@ "kind": 5, "sortText": "+4", "insertText": "I => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "J", "kind": 5, "sortText": "+5", "insertText": "J => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 } ] } @@ -263,9 +257,8 @@ "label": "F", "kind": 1, "insertText": "F => ", - "insertTextFormat": 1, - "additionalTextEdits": [] - } + "insertTextFormat": 1 + } } ] } @@ -418,7 +411,6 @@ "sortText": "+0", "insertText": "I => ${1:Integer})$0", "insertTextFormat": 2, - "additionalTextEdits": [], "data": { "uri": "$URI{foo.adb}", "range": { @@ -438,8 +430,7 @@ "kind": 5, "sortText": "+1", "insertText": "I => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 } ] } @@ -457,8 +448,7 @@ "label": "I", "kind": 1, "insertText": "I => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 } }, "wait": [ @@ -468,8 +458,7 @@ "label": "I", "kind": 1, "insertText": "I => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 } } ] @@ -485,8 +474,7 @@ "label": "Params of Bar", "kind": 15, "insertText": "I => $1)$0", - "insertTextFormat": 2, - "additionalTextEdits": [] + "insertTextFormat": 2 } }, "wait": [ @@ -496,8 +484,7 @@ "label": "Params of Bar", "kind": 15, "insertText": "I => $1)$0", - "insertTextFormat": 2, - "additionalTextEdits": [] + "insertTextFormat": 2 } } ] diff --git a/testsuite/ada_lsp/U913-028.completion.params/test.yaml b/testsuite/ada_lsp/U913-028.completion.params/test.yaml index 726e4ed55..dd1e51997 100644 --- a/testsuite/ada_lsp/U913-028.completion.params/test.yaml +++ b/testsuite/ada_lsp/U913-028.completion.params/test.yaml @@ -1,4 +1 @@ title: 'U913-028.completion.params' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/U915-024.completion.invisible_snippets/test.json b/testsuite/ada_lsp/U915-024.completion.invisible_snippets/test.json index 4bdf132e6..1d83526e4 100644 --- a/testsuite/ada_lsp/U915-024.completion.invisible_snippets/test.json +++ b/testsuite/ada_lsp/U915-024.completion.invisible_snippets/test.json @@ -82,41 +82,7 @@ "(" ], "resolveProvider": true - }, - "hoverProvider": true, - "signatureHelpProvider": { - "triggerCharacters": [ - ",", - "(" - ], - "retriggerCharacters": [ - "\b" - ] - }, - "declarationProvider": true, - "definitionProvider": true, - "typeDefinitionProvider": true, - "implementationProvider": true, - "referencesProvider": true, - "documentHighlightProvider": true, - "documentSymbolProvider": true, - "codeActionProvider": {}, - "documentFormattingProvider": true, - "renameProvider": {}, - "foldingRangeProvider": true, - "workspaceSymbolProvider": true, - "callHierarchyProvider": {}, - "alsShowDepsProvider": true, - "alsReferenceKinds": [ - "reference", - "access", - "write", - "call", - "dispatching call", - "parent", - "child", - "overriding" - ] + } } } } @@ -207,7 +173,6 @@ "sortText": "~100&0Do_Something", "filterText": "Do_Something", "insertText": "Do_Something", - "additionalTextEdits": [], "data": { "uri": "$URI{test.ads}", "range": { diff --git a/testsuite/ada_lsp/U915-024.completion.invisible_snippets/test.yaml b/testsuite/ada_lsp/U915-024.completion.invisible_snippets/test.yaml index 652d40faa..70f915ef1 100644 --- a/testsuite/ada_lsp/U915-024.completion.invisible_snippets/test.yaml +++ b/testsuite/ada_lsp/U915-024.completion.invisible_snippets/test.yaml @@ -1,4 +1 @@ title: 'U915-024.completion.invisible_snippets' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/U921-010.completion.no_generic_duplicates/test.json b/testsuite/ada_lsp/U921-010.completion.no_generic_duplicates/test.json index ed79da78b..3eb5fe17a 100644 --- a/testsuite/ada_lsp/U921-010.completion.no_generic_duplicates/test.json +++ b/testsuite/ada_lsp/U921-010.completion.no_generic_duplicates/test.json @@ -83,41 +83,7 @@ "(" ], "resolveProvider": true - }, - "hoverProvider": true, - "signatureHelpProvider": { - "triggerCharacters": [ - ",", - "(" - ], - "retriggerCharacters": [ - "\b" - ] - }, - "declarationProvider": true, - "definitionProvider": true, - "typeDefinitionProvider": true, - "implementationProvider": true, - "referencesProvider": true, - "documentHighlightProvider": true, - "documentSymbolProvider": true, - "codeActionProvider": {}, - "documentFormattingProvider": true, - "renameProvider": {}, - "foldingRangeProvider": true, - "workspaceSymbolProvider": true, - "callHierarchyProvider": {}, - "alsShowDepsProvider": true, - "alsReferenceKinds": [ - "reference", - "access", - "write", - "call", - "dispatching call", - "parent", - "child", - "overriding" - ] + } } } } @@ -247,7 +213,6 @@ "sortText": "100&2Primitive", "insertText": "Primitive (${1:Obj : Parent})$0", "insertTextFormat": 2, - "additionalTextEdits": [], "data": { "uri": "$URI{parents.ads}", "range": { diff --git a/testsuite/ada_lsp/U921-010.completion.no_generic_duplicates/test.yaml b/testsuite/ada_lsp/U921-010.completion.no_generic_duplicates/test.yaml index c3f7f089c..b39efddf7 100644 --- a/testsuite/ada_lsp/U921-010.completion.no_generic_duplicates/test.yaml +++ b/testsuite/ada_lsp/U921-010.completion.no_generic_duplicates/test.yaml @@ -1,4 +1 @@ title: 'U921-010.completion.no_generic_duplicates' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/UA20-011.parameter_completion.multiple_order/test.json b/testsuite/ada_lsp/UA20-011.parameter_completion.multiple_order/test.json index 76bf11902..4f601d551 100644 --- a/testsuite/ada_lsp/UA20-011.parameter_completion.multiple_order/test.json +++ b/testsuite/ada_lsp/UA20-011.parameter_completion.multiple_order/test.json @@ -173,7 +173,6 @@ "sortText": "+00", "insertText": "A1 => ${1:String}, A2 => ${2:String}, A3 => ${3:String}, A4 => ${4:String}, A5 => ${5:String})$0", "insertTextFormat": 2, - "additionalTextEdits": [], "data": { "uri": "$URI{foo.adb}", "range": { @@ -193,40 +192,35 @@ "kind": 5, "sortText": "+01", "insertText": "A1 => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "A2", "kind": 5, "sortText": "+02", "insertText": "A2 => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "A3", "kind": 5, "sortText": "+03", "insertText": "A3 => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "A4", "kind": 5, "sortText": "+04", "insertText": "A4 => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "A5", "kind": 5, "sortText": "+05", "insertText": "A5 => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "Params of Bar", @@ -234,7 +228,6 @@ "sortText": "+06", "insertText": "A => ${1:Float}, B => ${2:Float}, C => ${3:Float}, D => ${4:Float}, E => ${5:Float}, F => ${6:Float})$0", "insertTextFormat": 2, - "additionalTextEdits": [], "data": { "uri": "$URI{foo.adb}", "range": { @@ -254,48 +247,42 @@ "kind": 5, "sortText": "+07", "insertText": "A => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "B", "kind": 5, "sortText": "+08", "insertText": "B => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "C", "kind": 5, "sortText": "+09", "insertText": "C => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "D", "kind": 5, "sortText": "+10", "insertText": "D => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "E", "kind": 5, "sortText": "+11", "insertText": "E => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "F", "kind": 5, "sortText": "+12", "insertText": "F => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "Params of Bar", @@ -303,7 +290,6 @@ "sortText": "+13", "insertText": "I => ${1:Integer}, J => ${2:Integer}, K => ${3:Integer}, L => ${4:Integer}, M => ${5:Integer}, N => ${6:Integer}, O => ${7:Integer}, P => ${8:Integer})$0", "insertTextFormat": 2, - "additionalTextEdits": [], "data": { "uri": "$URI{foo.adb}", "range": { @@ -323,64 +309,56 @@ "kind": 5, "sortText": "+14", "insertText": "I => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "J", "kind": 5, "sortText": "+15", "insertText": "J => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "K", "kind": 5, "sortText": "+16", "insertText": "K => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "L", "kind": 5, "sortText": "+17", "insertText": "L => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "M", "kind": 5, "sortText": "+18", "insertText": "M => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "N", "kind": 5, "sortText": "+19", "insertText": "N => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "O", "kind": 5, "sortText": "+20", "insertText": "O => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "P", "kind": 5, "sortText": "+21", "insertText": "P => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 } ] } diff --git a/testsuite/ada_lsp/UA20-011.parameter_completion.multiple_order/test.yaml b/testsuite/ada_lsp/UA20-011.parameter_completion.multiple_order/test.yaml index d4005610e..16f38bee1 100644 --- a/testsuite/ada_lsp/UA20-011.parameter_completion.multiple_order/test.yaml +++ b/testsuite/ada_lsp/UA20-011.parameter_completion.multiple_order/test.yaml @@ -1,4 +1 @@ title: 'UA20-011.parameter_completion.multiple_order' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/UA21-041.parameter_completion.dotted_call/test.json b/testsuite/ada_lsp/UA21-041.parameter_completion.dotted_call/test.json index 132461b2b..74d8729a0 100644 --- a/testsuite/ada_lsp/UA21-041.parameter_completion.dotted_call/test.json +++ b/testsuite/ada_lsp/UA21-041.parameter_completion.dotted_call/test.json @@ -171,7 +171,6 @@ "sortText": "+0", "insertText": "M => ${1:access My_Type}, A => ${2:Integer}, B => ${3:Float})$0", "insertTextFormat": 2, - "additionalTextEdits": [], "data": { "uri": "$URI{bar.ads}", "range": { @@ -191,24 +190,21 @@ "kind": 5, "sortText": "+1", "insertText": "M => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "A", "kind": 5, "sortText": "+2", "insertText": "A => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "B", "kind": 5, "sortText": "+3", "insertText": "B => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "Params of Hello", @@ -216,7 +212,6 @@ "sortText": "+4", "insertText": "${1:A : Integer}, ${2:B : Float})$0", "insertTextFormat": 2, - "additionalTextEdits": [], "data": { "uri": "$URI{bar.ads}", "range": { @@ -236,16 +231,14 @@ "kind": 5, "sortText": "+5", "insertText": "A => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "B", "kind": 5, "sortText": "+6", "insertText": "B => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 } ] } @@ -265,7 +258,6 @@ "sortText": "+0", "insertText": "M => ${1:access My_Type}, A => ${2:Integer}, B => ${3:Float})$0", "insertTextFormat": 2, - "additionalTextEdits": [], "data": { "uri": "$URI{bar.ads}", "range": { @@ -292,7 +284,6 @@ "sortText": "+0", "insertText": "M => ${1:access My_Type}, A => ${2:Integer}, B => ${3:Float})$0", "insertTextFormat": 2, - "additionalTextEdits": [], "data": { "uri": "$URI{bar.ads}", "range": { @@ -399,7 +390,6 @@ "sortText": "+0", "insertText": "M => ${1:access My_Type}, A => ${2:Integer}, B => ${3:Float})$0", "insertTextFormat": 2, - "additionalTextEdits": [], "data": { "uri": "$URI{bar.ads}", "range": { @@ -419,24 +409,21 @@ "kind": 5, "sortText": "+1", "insertText": "M => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "A", "kind": 5, "sortText": "+2", "insertText": "A => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "B", "kind": 5, "sortText": "+3", "insertText": "B => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "Params of Bar.Hello", @@ -444,7 +431,6 @@ "sortText": "+4", "insertText": "${1:A : Integer}, ${2:B : Float})$0", "insertTextFormat": 2, - "additionalTextEdits": [], "data": { "uri": "$URI{bar.ads}", "range": { @@ -464,16 +450,14 @@ "kind": 5, "sortText": "+5", "insertText": "A => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "B", "kind": 5, "sortText": "+6", "insertText": "B => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 } ] } @@ -520,7 +504,6 @@ "sortText": "+0", "insertText": "M => ${1:access My_Type}, A => ${2:Integer}, B => ${3:Float})$0", "insertTextFormat": 2, - "additionalTextEdits": [], "data": { "uri": "$URI{bar.ads}", "range": { @@ -627,7 +610,6 @@ "sortText": "+0", "insertText": "${1:A : Integer}, ${2:B : Float})$0", "insertTextFormat": 2, - "additionalTextEdits": [], "data": { "uri": "$URI{bar.ads}", "range": { @@ -647,16 +629,14 @@ "kind": 5, "sortText": "+1", "insertText": "A => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "B", "kind": 5, "sortText": "+2", "insertText": "B => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 } ] } @@ -703,7 +683,6 @@ "sortText": "+0", "insertText": "${1:A : Integer}, ${2:B : Float})$0", "insertTextFormat": 2, - "additionalTextEdits": [], "data": { "uri": "$URI{bar.ads}", "range": { diff --git a/testsuite/ada_lsp/UA21-041.parameter_completion.dotted_call/test.yaml b/testsuite/ada_lsp/UA21-041.parameter_completion.dotted_call/test.yaml index 77b5454b4..ff3f0d391 100644 --- a/testsuite/ada_lsp/UA21-041.parameter_completion.dotted_call/test.yaml +++ b/testsuite/ada_lsp/UA21-041.parameter_completion.dotted_call/test.yaml @@ -1,4 +1 @@ title: 'UA21-041.parameter_completion.dotted_call' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/V216-030.completion.attribute_in_decl/test.json b/testsuite/ada_lsp/V216-030.completion.attribute_in_decl/test.json index 8a13d9823..3bdee93d5 100644 --- a/testsuite/ada_lsp/V216-030.completion.attribute_in_decl/test.json +++ b/testsuite/ada_lsp/V216-030.completion.attribute_in_decl/test.json @@ -87,48 +87,7 @@ "(" ], "resolveProvider": true - }, - "hoverProvider": true, - "signatureHelpProvider": { - "triggerCharacters": [ - ",", - "(" - ], - "retriggerCharacters": [ - "\b" - ] - }, - "declarationProvider": true, - "definitionProvider": true, - "typeDefinitionProvider": true, - "implementationProvider": true, - "referencesProvider": true, - "documentHighlightProvider": true, - "documentSymbolProvider": true, - "codeActionProvider": {}, - "documentFormattingProvider": true, - "renameProvider": {}, - "foldingRangeProvider": true, - "executeCommandProvider": { - "commands": [ - "", - "als-named-parameters" - ] - }, - "workspaceSymbolProvider": true, - "callHierarchyProvider": {}, - "alsShowDepsProvider": true, - "alsReferenceKinds": [ - "reference", - "access", - "write", - "call", - "dispatching call", - "parent", - "child", - "overriding" - ], - "alsCheckSyntaxProvider": true + } } } } @@ -247,15 +206,13 @@ "label": "Abort_Signal", "kind": 1, "detail": "GNAT RM", - "documentation": "`Standard'Abort_Signal' (`Standard' is the only allowed prefix)\nprovides the entity for the special exception used to signal task abort\nor asynchronous transfer of control. Normally this attribute should\nonly be used in the tasking runtime (it is highly peculiar, and\ncompletely outside the normal semantics of Ada, for a user program to\nintercept the abort exception).", - "additionalTextEdits": [] + "documentation": "`Standard'Abort_Signal' (`Standard' is the only allowed prefix)\nprovides the entity for the special exception used to signal task abort\nor asynchronous transfer of control. Normally this attribute should\nonly be used in the tasking runtime (it is highly peculiar, and\ncompletely outside the normal semantics of Ada, for a user program to\nintercept the abort exception)." }, { "label": "First_Bit", "kind": 1, "detail": "Ada RM", - "documentation": "For a component C of a composite, non-array object R:\n\n\nIf the nondefault bit ordering applies to the composite type,\nand if a component_clause specifies the placement of C,\ndenotes the value given for the first_bit of the\ncomponent_clause; otherwise, denotes the offset, from the\nstart of the first of the storage elements occupied by C, of\nthe first bit occupied by C. This offset is measured in bits.\nThe first bit of a storage element is numbered zero. The value\nof this attribute is of the type universal_integer. See", - "additionalTextEdits": [] + "documentation": "For a component C of a composite, non-array object R:\n\n\nIf the nondefault bit ordering applies to the composite type,\nand if a component_clause specifies the placement of C,\ndenotes the value given for the first_bit of the\ncomponent_clause; otherwise, denotes the offset, from the\nstart of the first of the storage elements occupied by C, of\nthe first bit occupied by C. This offset is measured in bits.\nThe first bit of a storage element is numbered zero. The value\nof this attribute is of the type universal_integer. See" } ] } diff --git a/testsuite/ada_lsp/V705-026.completion.predefined_types/test.json b/testsuite/ada_lsp/V705-026.completion.predefined_types/test.json index 6117485ff..baaf2ff71 100644 --- a/testsuite/ada_lsp/V705-026.completion.predefined_types/test.json +++ b/testsuite/ada_lsp/V705-026.completion.predefined_types/test.json @@ -89,42 +89,7 @@ "(" ], "resolveProvider": true - }, - "hoverProvider": true, - "signatureHelpProvider": { - "triggerCharacters": [ - ",", - "(" - ], - "retriggerCharacters": [ - "\b" - ] - }, - "declarationProvider": true, - "definitionProvider": true, - "typeDefinitionProvider": true, - "implementationProvider": true, - "referencesProvider": true, - "documentHighlightProvider": true, - "documentSymbolProvider": true, - "codeActionProvider": {}, - "documentFormattingProvider": true, - "renameProvider": {}, - "foldingRangeProvider": true, - "workspaceSymbolProvider": true, - "callHierarchyProvider": {}, - "alsShowDepsProvider": true, - "alsReferenceKinds": [ - "reference", - "access", - "write", - "call", - "dispatching call", - "parent", - "child", - "overriding" - ], - "alsCheckSyntaxProvider": true + } } } } @@ -237,16 +202,14 @@ "label": "interface", "kind": 14, "insertText": "interface", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "Integer", "kind": 7, "detail": "type Integer is range -(2 ** 31) .. +(2 ** 31 - 1);", "documentation": "at __standard (4:3)", - "sortText": "000&2Integer", - "additionalTextEdits": [] + "sortText": "0&2Integer" } ] } @@ -277,8 +240,7 @@ "kind": 7, "detail": "type Integer is range -(2 ** 31) .. +(2 ** 31 - 1);", "documentation": "at __standard (4:3)", - "sortText": "000&2Integer", - "additionalTextEdits": [] + "sortText": "000&2Integer" } } ] diff --git a/testsuite/ada_lsp/V705-026.completion.predefined_types/test.yaml b/testsuite/ada_lsp/V705-026.completion.predefined_types/test.yaml index af4c6d3d8..ead4cad6e 100644 --- a/testsuite/ada_lsp/V705-026.completion.predefined_types/test.yaml +++ b/testsuite/ada_lsp/V705-026.completion.predefined_types/test.yaml @@ -1,4 +1 @@ title: 'V705-026.completion.predefined_types' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/completion.aggregates.multiple_discriminants/test.json b/testsuite/ada_lsp/completion.aggregates.multiple_discriminants/test.json index 232041b3d..a5a59f5e5 100644 --- a/testsuite/ada_lsp/completion.aggregates.multiple_discriminants/test.json +++ b/testsuite/ada_lsp/completion.aggregates.multiple_discriminants/test.json @@ -150,7 +150,6 @@ "sortText": "+00", "insertText": "X => True, Y => True, Z => ${3:Boolean}, A => ${4:Integer})$0", "insertTextFormat": 2, - "additionalTextEdits": [], "data": { "uri": "$URI{foo.adb}", "range": { @@ -170,32 +169,28 @@ "kind": 5, "sortText": "+01", "insertText": "X => True", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "Y => True", "kind": 5, "sortText": "+02", "insertText": "Y => True", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "Z", "kind": 5, "sortText": "+03", "insertText": "Z => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "A", "kind": 5, "sortText": "+04", "insertText": "A => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "Aggregate when X => True, Y => False", @@ -203,7 +198,6 @@ "sortText": "+05", "insertText": "X => True, Y => False, Z => ${3:Boolean}, B => ${4:Integer})$0", "insertTextFormat": 2, - "additionalTextEdits": [], "data": { "uri": "$URI{foo.adb}", "range": { @@ -223,32 +217,28 @@ "kind": 5, "sortText": "+06", "insertText": "X => True", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "Y => False", "kind": 5, "sortText": "+07", "insertText": "Y => False", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "Z", "kind": 5, "sortText": "+08", "insertText": "Z => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "B", "kind": 5, "sortText": "+09", "insertText": "B => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "Aggregate when X => others, Z => True", @@ -256,7 +246,6 @@ "sortText": "+10", "insertText": "X => ${1:others}, Z => True, Y => ${3:Boolean}, C => ${4:Float})$0", "insertTextFormat": 2, - "additionalTextEdits": [], "data": { "uri": "$URI{foo.adb}", "range": { @@ -276,32 +265,28 @@ "kind": 5, "sortText": "+11", "insertText": "X => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "Z => True", "kind": 5, "sortText": "+12", "insertText": "Z => True", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "Y", "kind": 5, "sortText": "+13", "insertText": "Y => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "C", "kind": 5, "sortText": "+14", "insertText": "C => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "Aggregate when X => others, Z => False", @@ -309,7 +294,6 @@ "sortText": "+15", "insertText": "X => ${1:others}, Z => False, Y => ${3:Boolean}, D => ${4:Float})$0", "insertTextFormat": 2, - "additionalTextEdits": [], "data": { "uri": "$URI{foo.adb}", "range": { @@ -329,32 +313,28 @@ "kind": 5, "sortText": "+16", "insertText": "X => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "Z => False", "kind": 5, "sortText": "+17", "insertText": "Z => False", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "Y", "kind": 5, "sortText": "+18", "insertText": "Y => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "D", "kind": 5, "sortText": "+19", "insertText": "D => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 } ] } diff --git a/testsuite/ada_lsp/completion.aggregates.multiple_discriminants/test.yaml b/testsuite/ada_lsp/completion.aggregates.multiple_discriminants/test.yaml index d8103dcf5..0d5eb1caa 100644 --- a/testsuite/ada_lsp/completion.aggregates.multiple_discriminants/test.yaml +++ b/testsuite/ada_lsp/completion.aggregates.multiple_discriminants/test.yaml @@ -1,4 +1 @@ title: 'completion.aggregates.multiple_discriminants' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/completion.aspects.filtering/test.json b/testsuite/ada_lsp/completion.aspects.filtering/test.json index 964f4e28c..8530b4cb8 100644 --- a/testsuite/ada_lsp/completion.aspects.filtering/test.json +++ b/testsuite/ada_lsp/completion.aspects.filtering/test.json @@ -223,7 +223,6 @@ "label": "Even_Integer", "kind": 7, "sortText": "", - "additionalTextEdits": [], "data": { "uri": "", "range": { @@ -244,7 +243,6 @@ "sortText": "", "filterText": "", "insertText": "", - "additionalTextEdits": [], "data": { "uri": "", "range": { @@ -284,8 +282,7 @@ "result": { "label": "Address", "kind": 1, - "detail": "Ada RM", - "additionalTextEdits": [] + "detail": "Ada RM" } } ] @@ -311,4 +308,4 @@ "exit_code": 0 } } -] \ No newline at end of file +] diff --git a/testsuite/ada_lsp/completion.aspects.filtering/test.yaml b/testsuite/ada_lsp/completion.aspects.filtering/test.yaml index afb2ec0d5..b554be18b 100644 --- a/testsuite/ada_lsp/completion.aspects.filtering/test.yaml +++ b/testsuite/ada_lsp/completion.aspects.filtering/test.yaml @@ -1,4 +1 @@ -title: 'completion.aspects' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] +title: 'completion.aspects.fviltering' diff --git a/testsuite/ada_lsp/completion.aspects/test.json b/testsuite/ada_lsp/completion.aspects/test.json index ee793a56a..b4308947b 100644 --- a/testsuite/ada_lsp/completion.aspects/test.json +++ b/testsuite/ada_lsp/completion.aspects/test.json @@ -221,8 +221,7 @@ "label": "Address", "kind": 1, "detail": "Ada RM", - "documentation": "", - "additionalTextEdits": [] + "documentation": "" } ] } @@ -239,8 +238,7 @@ "params": { "label": "Address", "kind": 1, - "detail": "Ada RM", - "additionalTextEdits": [] + "detail": "Ada RM" } }, "wait": [ @@ -249,8 +247,7 @@ "result": { "label": "Address", "kind": 1, - "detail": "Ada RM", - "additionalTextEdits": [] + "detail": "Ada RM" } } ] diff --git a/testsuite/ada_lsp/completion.dotted_call.keyword/test.json b/testsuite/ada_lsp/completion.dotted_call.keyword/test.json index 16396a1db..23fd0535c 100644 --- a/testsuite/ada_lsp/completion.dotted_call.keyword/test.json +++ b/testsuite/ada_lsp/completion.dotted_call.keyword/test.json @@ -124,8 +124,7 @@ { "label": "A", "kind": 5, - "sortText": "000&1A", - "additionalTextEdits": [], + "sortText": "0&1A", "data": { "uri": "$URI{bar.ads}", "range": { @@ -143,10 +142,9 @@ { "label": "Do_Nothing", "kind": 3, - "sortText": "025&2Do_Nothing", + "sortText": "25&2Do_Nothing", "insertText": "Do_Nothing (${1:A : Integer}, ${2:B : Integer})$0", "insertTextFormat": 2, - "additionalTextEdits": [], "data": { "uri": "$URI{bar.ads}", "range": { @@ -225,8 +223,7 @@ { "label": "A", "kind": 5, - "sortText": "000&1A", - "additionalTextEdits": [], + "sortText": "0&1A", "data": { "uri": "$URI{bar.ads}", "range": { @@ -244,10 +241,9 @@ { "label": "Do_Nothing", "kind": 3, - "sortText": "025&2Do_Nothing", + "sortText": "25&2Do_Nothing", "insertText": "Do_Nothing (${1:A : Integer}, ${2:B : Integer})$0", "insertTextFormat": 2, - "additionalTextEdits": [], "data": { "uri": "$URI{bar.ads}", "range": { @@ -329,7 +325,6 @@ "sortText": "100&1Do_Nothing", "insertText": "Do_Nothing (${1:A : Integer}, ${2:B : Integer})$0", "insertTextFormat": 2, - "additionalTextEdits": [], "data": { "uri": "$URI{bar.ads}", "range": { diff --git a/testsuite/ada_lsp/completion.dotted_call.keyword/test.yaml b/testsuite/ada_lsp/completion.dotted_call.keyword/test.yaml index 68261fd01..6af60bbf3 100644 --- a/testsuite/ada_lsp/completion.dotted_call.keyword/test.yaml +++ b/testsuite/ada_lsp/completion.dotted_call.keyword/test.yaml @@ -1,4 +1 @@ title: 'completion.dotted_call.keyword' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/completion.duplicates/test.json b/testsuite/ada_lsp/completion.duplicates/test.json index c62278955..8ecca24e3 100644 --- a/testsuite/ada_lsp/completion.duplicates/test.json +++ b/testsuite/ada_lsp/completion.duplicates/test.json @@ -88,41 +88,7 @@ "(" ], "resolveProvider": true - }, - "hoverProvider": true, - "signatureHelpProvider": { - "triggerCharacters": [ - ",", - "(" - ], - "retriggerCharacters": [ - "\b" - ] - }, - "declarationProvider": true, - "definitionProvider": true, - "typeDefinitionProvider": true, - "implementationProvider": true, - "referencesProvider": true, - "documentHighlightProvider": true, - "documentSymbolProvider": true, - "codeActionProvider": {}, - "documentFormattingProvider": true, - "renameProvider": {}, - "foldingRangeProvider": true, - "workspaceSymbolProvider": true, - "callHierarchyProvider": {}, - "alsShowDepsProvider": true, - "alsReferenceKinds": [ - "reference", - "access", - "write", - "call", - "dispatching call", - "parent", - "child", - "overriding" - ] + } } } } @@ -200,7 +166,6 @@ "label": "Do_Something", "kind": 3, "sortText": "100&2Do_Something", - "additionalTextEdits": [], "data": { "uri": "$URI{main.adb}", "range": { diff --git a/testsuite/ada_lsp/completion.duplicates/test.yaml b/testsuite/ada_lsp/completion.duplicates/test.yaml index 86811d7d4..6617dc41d 100644 --- a/testsuite/ada_lsp/completion.duplicates/test.yaml +++ b/testsuite/ada_lsp/completion.duplicates/test.yaml @@ -1,4 +1 @@ title: 'completion.duplicates' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/completion.invisible.runtime/test.json b/testsuite/ada_lsp/completion.invisible.runtime/test.json index b6f15c700..ac372540d 100644 --- a/testsuite/ada_lsp/completion.invisible.runtime/test.json +++ b/testsuite/ada_lsp/completion.invisible.runtime/test.json @@ -88,41 +88,7 @@ "(" ], "resolveProvider": true - }, - "hoverProvider": true, - "signatureHelpProvider": { - "triggerCharacters": [ - ",", - "(" - ], - "retriggerCharacters": [ - "\b" - ] - }, - "declarationProvider": true, - "definitionProvider": true, - "typeDefinitionProvider": true, - "implementationProvider": true, - "referencesProvider": true, - "documentHighlightProvider": true, - "documentSymbolProvider": true, - "codeActionProvider": {}, - "documentFormattingProvider": true, - "renameProvider": {}, - "foldingRangeProvider": true, - "workspaceSymbolProvider": true, - "callHierarchyProvider": {}, - "alsShowDepsProvider": true, - "alsReferenceKinds": [ - "reference", - "access", - "write", - "call", - "dispatching call", - "parent", - "child", - "overriding" - ] + } } } } @@ -215,8 +181,7 @@ "documentation": "at a-decima.ads (38:1)\n\nThe compiler makes a number of assumptions based on the following five\nconstants (e.g. there is an assumption that decimal values can always\nbe represented in 128-bit signed binary form), so code modifications are\nrequired to increase these constants.", "sortText": "~100&08Decimal", "filterText": "Decimal", - "insertText": "Decimal", - "additionalTextEdits": [] + "insertText": "Decimal" } ] } diff --git a/testsuite/ada_lsp/completion.invisible2/test.json b/testsuite/ada_lsp/completion.invisible2/test.json index 4b3cce9c7..ade70c89b 100644 --- a/testsuite/ada_lsp/completion.invisible2/test.json +++ b/testsuite/ada_lsp/completion.invisible2/test.json @@ -148,18 +148,16 @@ "kind": 5, "detail": "type My_Int is tagged record\n A : Integer;\nend record;", "documentation": "at bar.ads (4:7)\n\n@field A", - "sortText": "000&1A", - "additionalTextEdits": [] + "sortText": "0&1A" }, { "label": "Do_Nothing", "kind": 3, "detail": "procedure Do_Nothing (Obj : My_Int; A :Integer; B : Integer)", "documentation": "at bar.ads (7:4)", - "sortText": "025&2Do_Nothing", + "sortText": "25&2Do_Nothing", "insertText": "Do_Nothing (${1:A : Integer}, ${2:B : Integer})$0", - "insertTextFormat": 2, - "additionalTextEdits": [] + "insertTextFormat": 2 } ] } diff --git a/testsuite/ada_lsp/completion.invisible2/test.yaml b/testsuite/ada_lsp/completion.invisible2/test.yaml index 9cbfe19d6..a9f066055 100644 --- a/testsuite/ada_lsp/completion.invisible2/test.yaml +++ b/testsuite/ada_lsp/completion.invisible2/test.yaml @@ -1,4 +1 @@ title: 'completion.invisible2' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/completion.lazy_computation/test.json b/testsuite/ada_lsp/completion.lazy_computation/test.json index 628924857..5694792e2 100644 --- a/testsuite/ada_lsp/completion.lazy_computation/test.json +++ b/testsuite/ada_lsp/completion.lazy_computation/test.json @@ -150,14 +150,12 @@ "label": "select", "kind": 14, "insertText": "select", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "Select_Some", "kind": 3, "sortText": "100&2Select_Some", - "additionalTextEdits": [], "data": { "uri": "$URI{test.ads}", "range": { @@ -189,7 +187,6 @@ "insertTextFormat": 1, "kind": 3, "sortText": "100&1Select_Some", - "additionalTextEdits": [], "data": { "uri": "$URI{test.ads}", "range": { @@ -215,7 +212,6 @@ "documentation": "at test.ads (3:4)\n\nThis a very useful comment.", "sortText": "100&1Select_Some", "insertTextFormat": 1, - "additionalTextEdits": [], "data": { "uri": "$URI{test.ads}", "range": { @@ -234,67 +230,6 @@ ] } }, - { - "send": { - "request": { - "jsonrpc": "2.0", - "id": 20, - "method": "textDocument/codeAction", - "params": { - "textDocument": { - "uri": "$URI{main.adb}" - }, - "range": { - "start": { - "line": 4, - "character": 8 - }, - "end": { - "line": 4, - "character": 8 - } - }, - "context": { - "diagnostics": [] - } - } - }, - "wait": [ - { - "id": 20, - "result": [] - } - ] - } - }, - { - "send": { - "request": { - "jsonrpc": "2.0", - "id": 21, - "method": "textDocument/codeAction", - "params": { - "textDocument": { - "uri": "$URI{main.adb}" - }, - "range": { - "start": { - "line": 4, - "character": 8 - }, - "end": { - "line": 4, - "character": 8 - } - }, - "context": { - "diagnostics": [] - } - } - }, - "wait": [] - } - }, { "send": { "request": { @@ -305,8 +240,7 @@ "label": "select", "insertTextFormat": 1, "insertText": "select", - "kind": 14, - "additionalTextEdits": [] + "kind": 14 } }, "wait": [ @@ -316,8 +250,7 @@ "label": "select", "kind": 14, "insertText": "select", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 } } ] diff --git a/testsuite/ada_lsp/completion.lazy_computation/test.yaml b/testsuite/ada_lsp/completion.lazy_computation/test.yaml index a05237a9f..dc3083cdb 100644 --- a/testsuite/ada_lsp/completion.lazy_computation/test.yaml +++ b/testsuite/ada_lsp/completion.lazy_computation/test.yaml @@ -1,4 +1 @@ title: 'completion.lazy_computation' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/completion.no_snippet_for_params/test.json b/testsuite/ada_lsp/completion.no_snippet_for_params/test.json index f7dc083c7..d11a0cf44 100644 --- a/testsuite/ada_lsp/completion.no_snippet_for_params/test.json +++ b/testsuite/ada_lsp/completion.no_snippet_for_params/test.json @@ -81,29 +81,7 @@ "(" ], "resolveProvider": true - }, - "hoverProvider": true, - "declarationProvider": true, - "definitionProvider": true, - "typeDefinitionProvider": true, - "implementationProvider": true, - "referencesProvider": true, - "codeActionProvider": {}, - "documentFormattingProvider": true, - "renameProvider": {}, - "foldingRangeProvider": true, - "executeCommandProvider": {}, - "alsShowDepsProvider": true, - "alsReferenceKinds": [ - "reference", - "access", - "write", - "call", - "dispatching call", - "parent", - "child", - "overriding" - ] + } } } } @@ -228,8 +206,7 @@ "label": "Print_Integer", "kind": 3, "detail": "procedure Print_Integer (A : integer)", - "documentation": "at main.adb (7:4)", - "additionalTextEdits": [] + "documentation": "at main.adb (7:4)" } ] } diff --git a/testsuite/ada_lsp/completion.no_snippet_for_params/test.yaml b/testsuite/ada_lsp/completion.no_snippet_for_params/test.yaml index 7e89fb494..276aa41fc 100644 --- a/testsuite/ada_lsp/completion.no_snippet_for_params/test.yaml +++ b/testsuite/ada_lsp/completion.no_snippet_for_params/test.yaml @@ -1,4 +1 @@ title: 'completion.no_snippet_for_params' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/completion.snippet.formatting/test.json b/testsuite/ada_lsp/completion.snippet.formatting/test.json index 7d495cc98..72ba7be80 100644 --- a/testsuite/ada_lsp/completion.snippet.formatting/test.json +++ b/testsuite/ada_lsp/completion.snippet.formatting/test.json @@ -161,7 +161,6 @@ }, "newText": "Bar (${1:A : Integer}, ${2:B : Integer})$0" }, - "additionalTextEdits": [], "data": { "uri": "$URI{foo.adb}", "range": { @@ -181,16 +180,14 @@ "kind": 5, "sortText": "+01", "insertText": "A => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "B", "kind": 5, "sortText": "+02", "insertText": "B => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "Params of Bar", @@ -212,7 +209,6 @@ }, "newText": "Bar\n (AAAAAAAA => ${1:Integer},\n BB => ${2:Integer},\n CCCCCCCC => ${3:Integer},\n DDDDDDDDDDDD => ${4:Integer},\n E => ${5:Integer})$0" }, - "additionalTextEdits": [], "data": { "uri": "$URI{foo.adb}", "range": { @@ -232,40 +228,35 @@ "kind": 5, "sortText": "+04", "insertText": "AAAAAAAA => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "BB", "kind": 5, "sortText": "+05", "insertText": "BB => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "CCCCCCCC", "kind": 5, "sortText": "+06", "insertText": "CCCCCCCC => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "DDDDDDDDDDDD", "kind": 5, "sortText": "+07", "insertText": "DDDDDDDDDDDD => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "E", "kind": 5, "sortText": "+08", "insertText": "E => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "Params of Bar", @@ -287,7 +278,6 @@ }, "newText": "Bar\n (A => ${1:Integer},\n B => ${2:Integer},\n C => ${3:Integer},\n D => ${4:Integer},\n E => ${5:Integer},\n F => ${6:Integer},\n G => ${7:Integer},\n H => ${8:Integer},\n I => ${9:Integer},\n J => ${10:Integer})$0" }, - "additionalTextEdits": [], "data": { "uri": "$URI{foo.adb}", "range": { @@ -307,80 +297,70 @@ "kind": 5, "sortText": "+10", "insertText": "A => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "B", "kind": 5, "sortText": "+11", "insertText": "B => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "C", "kind": 5, "sortText": "+12", "insertText": "C => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "D", "kind": 5, "sortText": "+13", "insertText": "D => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "E", "kind": 5, "sortText": "+14", "insertText": "E => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "F", "kind": 5, "sortText": "+15", "insertText": "F => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "G", "kind": 5, "sortText": "+16", "insertText": "G => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "H", "kind": 5, "sortText": "+17", "insertText": "H => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "I", "kind": 5, "sortText": "+18", "insertText": "I => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "J", "kind": 5, "sortText": "+19", "insertText": "J => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 } ] } diff --git a/testsuite/ada_lsp/completion.snippet.formatting/test.yaml b/testsuite/ada_lsp/completion.snippet.formatting/test.yaml index ccda29f3d..981628ef8 100644 --- a/testsuite/ada_lsp/completion.snippet.formatting/test.yaml +++ b/testsuite/ada_lsp/completion.snippet.formatting/test.yaml @@ -1,4 +1 @@ title: 'completion.snippet.formatting' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/completion.snippet.formatting2/test.json b/testsuite/ada_lsp/completion.snippet.formatting2/test.json index 149f89ed0..fbc708621 100644 --- a/testsuite/ada_lsp/completion.snippet.formatting2/test.json +++ b/testsuite/ada_lsp/completion.snippet.formatting2/test.json @@ -172,7 +172,6 @@ }, "newText": "Bar\n (A => ${1:Integer},\n BBBBB => ${2:Integer},\n CCCCCCC => ${3:Integer},\n DDD => ${4:Float})$0" }, - "additionalTextEdits": [], "data": { "uri": "$URI{foo.adb}", "range": { @@ -192,32 +191,28 @@ "kind": 5, "sortText": "+1", "insertText": "A => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "BBBBB", "kind": 5, "sortText": "+2", "insertText": "BBBBB => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "CCCCCCC", "kind": 5, "sortText": "+3", "insertText": "CCCCCCC => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "DDD", "kind": 5, "sortText": "+4", "insertText": "DDD => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 } ] } @@ -248,8 +243,7 @@ "kind": 5, "sortText": "+1", "insertText": "A => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 } } ] @@ -360,7 +354,6 @@ }, "newText": "Bar\n (A => 1,\n BBBBB => ${2:Integer},\n CCCCCCC => ${3:Integer},\n DDD => ${4:Float})$0" }, - "additionalTextEdits": [], "data": { "uri": "$URI{foo.adb}", "range": { @@ -380,24 +373,21 @@ "kind": 5, "sortText": "+1", "insertText": " BBBBB => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "CCCCCCC", "kind": 5, "sortText": "+2", "insertText": " CCCCCCC => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 }, { "label": "DDD", "kind": 5, "sortText": "+3", "insertText": " DDD => ", - "insertTextFormat": 1, - "additionalTextEdits": [] + "insertTextFormat": 1 } ] } diff --git a/testsuite/ada_lsp/completion.snippet.formatting2/test.yaml b/testsuite/ada_lsp/completion.snippet.formatting2/test.yaml index 09ec70335..d398cd5c7 100644 --- a/testsuite/ada_lsp/completion.snippet.formatting2/test.yaml +++ b/testsuite/ada_lsp/completion.snippet.formatting2/test.yaml @@ -1,4 +1 @@ title: 'completion.snippet.formatting2' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/completion.subp_parameters/test.json b/testsuite/ada_lsp/completion.subp_parameters/test.json index 5bf8d9196..9ab5d13f5 100644 --- a/testsuite/ada_lsp/completion.subp_parameters/test.json +++ b/testsuite/ada_lsp/completion.subp_parameters/test.json @@ -81,29 +81,7 @@ "'", "(" ] - }, - "hoverProvider": true, - "declarationProvider": true, - "definitionProvider": true, - "typeDefinitionProvider": true, - "implementationProvider": true, - "referencesProvider": true, - "codeActionProvider": { - }, - "renameProvider": { - }, - "foldingRangeProvider": true, - "executeCommandProvider": {}, - "alsReferenceKinds": [ - "reference", - "access", - "write", - "call", - "dispatching call", - "parent", - "child", - "overriding" - ] + } } } } @@ -137,7 +115,7 @@ "wait": [ { "jsonrpc": "2.0", - "id": 2, + "id": 1, "method": "window/workDoneProgress/create", "params": { "token": "" @@ -250,18 +228,16 @@ "kind": 5, "detail": "type My_Int is tagged record\n A : Integer;\nend record;", "documentation": "at bar.ads (4:7)\n\n@field A", - "sortText": "000&1A", - "additionalTextEdits": [] + "sortText": "0&1A" }, { "label": "Do_Nothing", "kind": 3, "detail": "procedure Do_Nothing (Obj : My_Int; A :Integer)", "documentation": "at bar.ads (7:4)", - "sortText": "025&2Do_Nothing", + "sortText": "25&2Do_Nothing", "insertText": "Do_Nothing (${1:A : Integer})$0", - "insertTextFormat": 2, - "additionalTextEdits": [] + "insertTextFormat": 2 } ] } @@ -396,15 +372,13 @@ "label": "A", "kind": 6, "detail": "A : Integer := 3;", - "documentation": "at main.adb (10:4)", - "additionalTextEdits": [] + "documentation": "at main.adb (10:4)" }, { "label": "ASCII", "kind": 9, "detail": "package ASCII", - "documentation": "", - "additionalTextEdits": [] + "documentation": "" }, { "label": "Add", @@ -412,88 +386,67 @@ "detail": "function Add (A, B : Integer) return Integer", "documentation": "at main.adb (6:4)", "insertText": "Add (${1:A : Integer}, ${2:B : Integer})$0", - "insertTextFormat": 2, - "additionalTextEdits": [] + "insertTextFormat": 2 }, { "label": "abort", "kind": 14, "insertText": "abort", - "insertTextFormat": 1, - "additionalTextEdits": [ - ] + "insertTextFormat": 1 }, { "label": "abs", "kind": 14, "insertText": "abs", - "insertTextFormat": 1, - "additionalTextEdits": [ - ] + "insertTextFormat": 1 }, { "label": "abstract", "kind": 14, "insertText": "abstract", - "insertTextFormat": 1, - "additionalTextEdits": [ - ] + "insertTextFormat": 1 }, { "label": "accept", "kind": 14, "insertText": "accept", - "insertTextFormat": 1, - "additionalTextEdits": [ - ] + "insertTextFormat": 1 }, { "label": "access", "kind": 14, "insertText": "access", - "insertTextFormat": 1, - "additionalTextEdits": [ - ] + "insertTextFormat": 1 }, { "label": "aliased", "kind": 14, "insertText": "aliased", - "insertTextFormat": 1, - "additionalTextEdits": [ - ] + "insertTextFormat": 1 }, { "label": "all", "kind": 14, "insertText": "all", - "insertTextFormat": 1, - "additionalTextEdits": [ - ] + "insertTextFormat": 1 }, { "label": "and", "kind": 14, "insertText": "and", - "insertTextFormat": 1, - "additionalTextEdits": [ - ] + "insertTextFormat": 1 }, { "label": "array", "kind": 14, "insertText": "array", - "insertTextFormat": 1, - "additionalTextEdits": [ - ] + "insertTextFormat": 1 }, { "label": "at", "kind": 14, "insertText": "at", - "insertTextFormat": 1, - "additionalTextEdits": [ - ] + "insertTextFormat": 1 } ] diff --git a/testsuite/ada_lsp/completion.subp_parameters/test.yaml b/testsuite/ada_lsp/completion.subp_parameters/test.yaml index fe8eaf965..6712d001b 100644 --- a/testsuite/ada_lsp/completion.subp_parameters/test.yaml +++ b/testsuite/ada_lsp/completion.subp_parameters/test.yaml @@ -1,4 +1 @@ title: 'completion.subp_parameters' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/completion.subp_params_dotted_names/test.json b/testsuite/ada_lsp/completion.subp_params_dotted_names/test.json index b83601a91..ab2c2ebe0 100644 --- a/testsuite/ada_lsp/completion.subp_params_dotted_names/test.json +++ b/testsuite/ada_lsp/completion.subp_params_dotted_names/test.json @@ -81,29 +81,7 @@ "'", "(" ] - }, - "hoverProvider": true, - "declarationProvider": true, - "definitionProvider": true, - "typeDefinitionProvider": true, - "implementationProvider": true, - "referencesProvider": true, - "codeActionProvider": { - }, - "renameProvider": { - }, - "foldingRangeProvider": true, - "executeCommandProvider": {}, - "alsReferenceKinds": [ - "reference", - "access", - "write", - "call", - "dispatching call", - "parent", - "child", - "overriding" - ] + } } } } @@ -203,17 +181,13 @@ "detail": "procedure Do_Nothing (Obj : My_Int; A :Integer)", "documentation": "at bar.ads (7:4)", "insertText": "Do_Nothing (${1:Obj : My_Int}, ${2:A : Integer})$0", - "insertTextFormat": 2, - "additionalTextEdits": [ - ] + "insertTextFormat": 2 }, { "label": "My_Int", "kind": 7, "detail": "type My_Int is tagged record\n A : Integer;\nend record;", - "documentation": "at bar.ads (3:4)", - "additionalTextEdits": [ - ] + "documentation": "at bar.ads (3:4)" } ] } diff --git a/testsuite/ada_lsp/completion.subp_params_dotted_names/test.yaml b/testsuite/ada_lsp/completion.subp_params_dotted_names/test.yaml index 1988e74f3..c39537535 100644 --- a/testsuite/ada_lsp/completion.subp_params_dotted_names/test.yaml +++ b/testsuite/ada_lsp/completion.subp_params_dotted_names/test.yaml @@ -1,4 +1 @@ title: 'completion.subp_params_dotted_names' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/completion.use_clauses/test.json b/testsuite/ada_lsp/completion.use_clauses/test.json index 40608e744..8a22dcd7b 100644 --- a/testsuite/ada_lsp/completion.use_clauses/test.json +++ b/testsuite/ada_lsp/completion.use_clauses/test.json @@ -92,49 +92,7 @@ "(" ], "resolveProvider": true - }, - "hoverProvider": true, - "signatureHelpProvider": { - "triggerCharacters": [ - ",", - "(" - ], - "retriggerCharacters": [ - "\b" - ] - }, - "declarationProvider": true, - "definitionProvider": true, - "typeDefinitionProvider": true, - "implementationProvider": true, - "referencesProvider": true, - "documentHighlightProvider": true, - "documentSymbolProvider": true, - "codeActionProvider": {}, - "documentFormattingProvider": true, - "documentRangeFormattingProvider": true, - "renameProvider": {}, - "foldingRangeProvider": true, - "executeCommandProvider": { - "commands": [ - "", - "als-refactor-remove-parameters" - ] - }, - "workspaceSymbolProvider": true, - "callHierarchyProvider": {}, - "alsShowDepsProvider": true, - "alsReferenceKinds": [ - "reference", - "access", - "write", - "call", - "dispatching call", - "parent", - "child", - "overriding" - ], - "alsCheckSyntaxProvider": true + } } } } @@ -219,8 +177,7 @@ "documentation": "Insert the use-clause corresponding to the with-clause on the same line.", "preselect": false, "sortText": "+use Ada.Text_IO;", - "insertText": "use Ada.Text_IO;", - "additionalTextEdits": [] + "insertText": "use Ada.Text_IO;" } ] } diff --git a/testsuite/ada_lsp/completion.use_clauses/test.yaml b/testsuite/ada_lsp/completion.use_clauses/test.yaml index 000088442..e1c462914 100644 --- a/testsuite/ada_lsp/completion.use_clauses/test.yaml +++ b/testsuite/ada_lsp/completion.use_clauses/test.yaml @@ -1,4 +1 @@ title: 'completion.use_clauses' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] From e2a3da4b9c1b701ed2922e7f3b8fad53cece43cd Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Thu, 7 Sep 2023 18:41:19 +0300 Subject: [PATCH 110/152] Allocate_Request_Id and pass it to Execute command to be used for applyEdit request. Refs #1170 --- source/ada/lsp-ada_handlers.adb | 132 +++++++++--------- .../test.json | 2 +- .../test.json | 4 +- .../test.json | 6 +- .../SC28-001.named.parameters.0.json | 16 +-- .../T318-086.suppress.separates.0/test.json | 7 +- .../T318-086.suppress.separates.0/test.yaml | 3 - .../test.json | 2 +- .../test.json | 2 +- .../ada_lsp/commands.other_file/test.json | 2 - .../ada_lsp/named_params.dot_calls/test.json | 4 +- testsuite/ada_lsp/named_params/test.json | 8 +- testsuite/ada_lsp/named_params/test.yaml | 3 - .../S314-015/test.json | 2 +- .../S314-015/test.json | 2 +- .../SA11-047_0/test.json | 2 +- .../SA11-047_1/test.json | 2 +- .../test.json | 4 +- .../refactor_imports_commands.json | 2 +- .../SA11-051/test.json | 2 +- .../V207-019/test.json | 2 +- .../Q817-007/test.json | 2 +- .../SA22-035/test.json | 2 +- 23 files changed, 101 insertions(+), 112 deletions(-) diff --git a/source/ada/lsp-ada_handlers.adb b/source/ada/lsp-ada_handlers.adb index e488369c3..da5c8558d 100644 --- a/source/ada/lsp-ada_handlers.adb +++ b/source/ada/lsp-ada_handlers.adb @@ -16,6 +16,7 @@ ------------------------------------------------------------------------------ with Ada.Exceptions; +with Ada.Strings.Unbounded; with Ada.Tags.Generic_Dispatching_Constructor; with Ada.Unchecked_Deallocation; @@ -1305,12 +1306,11 @@ package body LSP.Ada_Handlers is Title : constant VSS.Strings.Virtual_String := "Create a default project file (default.gpr)"; URI : constant LSP.Structures.DocumentUri := - To_DocumentUri - (VSS.Strings.Conversions.To_Virtual_String - (GNATCOLL.VFS.Create_From_UTF8 + Self.To_URI + (GNATCOLL.VFS.Create_From_UTF8 (VSS.Strings.Conversions.To_UTF_8_String (Self.Client.Root)).Join - ("default.gpr").Display_Full_Name)); + ("default.gpr").Display_Full_Name); Create : constant LSP.Structures. documentChanges_OfWorkspaceEdit_Item := @@ -2168,8 +2168,7 @@ package body LSP.Ada_Handlers is -- Process_Created_File -- -------------------------- - procedure Process_Created_File - is + procedure Process_Created_File is use VSS.Strings.Conversions; Contexts : constant LSP.Ada_Context_Sets.Context_Lists.List := @@ -2358,20 +2357,14 @@ package body LSP.Ada_Handlers is for File of Value.files loop declare - Deleted_File : constant GNATCOLL.VFS.Virtual_File := - Self.To_File (To_DocumentUri (File.uri)); + Deleted_URI : constant LSP.Structures.DocumentUri := + To_DocumentUri (File.uri); - function Has_File - (Context : LSP.Ada_Contexts.Context) - return Boolean - is (Context.Is_Part_Of_Project (To_DocumentUri (File.uri))); - -- Return True if Old_File is a source of the project held by - -- Context. + Deleted_File : constant GNATCOLL.VFS.Virtual_File := + Self.To_File (Deleted_URI); begin - for Context of Self.Contexts.Each_Context - (Has_File'Unrestricted_Access) - loop + for Context of Self.Contexts_For_File (Deleted_File) loop Context.Exclude_File (Deleted_File); Context.Index_File (Deleted_File); @@ -2481,23 +2474,16 @@ package body LSP.Ada_Handlers is declare use VSS.Strings.Conversions; - Old_File : constant GNATCOLL.VFS.Virtual_File := - Self.To_File (To_DocumentUri (File_Rename.oldUri)); + Old_URI : constant LSP.Structures.DocumentUri := + To_DocumentUri (File_Rename.oldUri); - function Has_File - (Context : LSP.Ada_Contexts.Context) - return Boolean - is (Context.Is_Part_Of_Project - (To_DocumentUri (File_Rename.oldUri))); - -- Return True if Old_File is a source of the project held by - -- Context. + Old_File : constant GNATCOLL.VFS.Virtual_File := + Self.To_File (Old_URI); URI_Contexts : Context_Lists.List; begin - for Context of Self.Contexts.Each_Context - (Has_File'Unrestricted_Access) - loop + for Context of Self.Contexts_For_File (Old_File) loop URI_Contexts.Append (Context); Context.Exclude_File (Old_File); Context.Index_File (Old_File); @@ -2507,8 +2493,7 @@ package body LSP.Ada_Handlers is & " from context " & To_UTF_8_String (Context.Id)); end loop; - URIs_Contexts.Insert - (To_DocumentUri (File_Rename.oldUri), URI_Contexts); + URIs_Contexts.Insert (Old_URI, URI_Contexts); end; end loop; @@ -2522,22 +2507,30 @@ package body LSP.Ada_Handlers is use VSS.Strings.Conversions; use type LSP.Ada_Documents.Document_Access; + New_URI : constant LSP.Structures.DocumentUri := + To_DocumentUri (File_Rename.newUri); + + Old_URI : constant LSP.Structures.DocumentUri := + To_DocumentUri (File_Rename.oldUri); + New_File : constant GNATCOLL.VFS.Virtual_File := - Self.To_File (To_DocumentUri (File_Rename.newUri)); + Self.To_File (New_URI); + Document : constant LSP.Ada_Documents.Document_Access := - Get_Open_Document (Self, To_DocumentUri (File_Rename.newUri)); + Get_Open_Document (Self, New_URI); + Is_Document_Open : constant Boolean := Document /= null; begin - for Context of URIs_Contexts.Constant_Reference - (To_DocumentUri (File_Rename.oldUri)) - loop + for Context of URIs_Contexts (Old_URI) loop Context.Include_File (New_File); + if Is_Document_Open then Context.Index_Document (Document.all); else Context.Index_File (New_File); end if; + Self.Tracer.Trace ("Included " & New_File.Display_Base_Name & " in context " & To_UTF_8_String (Context.Id)); @@ -2729,13 +2722,16 @@ package body LSP.Ada_Handlers is end if; declare + New_Id : constant LSP.Structures.Integer_Or_Virtual_String := + Self.Server.Allocate_Request_Id; + Command : constant LSP.Commands.Command'Class := Create_Command (Tag, Value.arguments'Unrestricted_Access); begin Command.Execute (Handler => Self'Access, Sender => Self.Sender, - Id => Id, + Id => New_Id, Error => Error); if Error.Is_Set then @@ -4209,8 +4205,6 @@ package body LSP.Ada_Handlers is Text_Edits_Cursor : Text_Edit_Ordered_Maps.Cursor := Edits.Text_Edits.First; - File_Deletions_Cursor : Unbounded_String_Ordered_Sets.Cursor := - Edits.File_Deletions.First; function To_TextEdit (E : LAL_Refactor.Text_Edit) @@ -4282,8 +4276,8 @@ package body LSP.Ada_Handlers is (documentChanges_OfWorkspaceEdit_Item'( (Kind => create, create => CreateFile' - (uri => To_DocumentUri - (VSS.Strings.Conversions.To_Virtual_String + (uri => Self.To_URI + (Ada.Strings.Unbounded.To_String (File_Creation.Filepath)), others => <>)))); @@ -4312,29 +4306,33 @@ package body LSP.Ada_Handlers is -- File deletions - if Self.Client.Versioned_Documents - and then Self.Client.Resource_Delete_Supported - then - while Unbounded_String_Ordered_Sets.Has_Element - (File_Deletions_Cursor) - loop - File_URI := To_DocumentUri - (VSS.Strings.Conversions.To_Virtual_String - (Unbounded_String_Ordered_Sets.Element - (File_Deletions_Cursor))); + if Self.Client.Versioned_Documents then + for Item of Edits.File_Deletions loop + File_URI := Self.To_URI + (Ada.Strings.Unbounded.To_String (Item)); - WE.documentChanges.Append - (documentChanges_OfWorkspaceEdit_Item'( - (Kind => LSP.Structures.rename, - rename => RenameFile' - (oldUri => File_URI, - newUri => - (if Rename - then File_URI & ".bak" - else File_URI), - others => <>)))); + if Rename and then Self.Client.Resource_Rename_Supported then - Unbounded_String_Ordered_Sets.Next (File_Deletions_Cursor); + WE.documentChanges.Append + (documentChanges_OfWorkspaceEdit_Item'( + (Kind => LSP.Structures.rename, + rename => LSP.Structures.RenameFile' + (oldUri => File_URI, + newUri => File_URI & ".bak", + others => <>)))); + + elsif not Rename + and then Self.Client.Resource_Delete_Supported + then + + WE.documentChanges.Append + (documentChanges_OfWorkspaceEdit_Item'( + (Kind => LSP.Structures.delete, + delete => LSP.Structures.DeleteFile' + (uri => File_URI, + others => <>)))); + + end if; end loop; end if; @@ -4347,12 +4345,12 @@ package body LSP.Ada_Handlers is WE.documentChanges.Append (documentChanges_OfWorkspaceEdit_Item'( (Kind => LSP.Structures.rename, - rename => RenameFile' - (oldUri => To_DocumentUri - (VSS.Strings.Conversions.To_Virtual_String + rename => LSP.Structures.RenameFile' + (oldUri => Self.To_URI + (Ada.Strings.Unbounded.To_String (File_Rename.Filepath)), - newUri => To_DocumentUri - (VSS.Strings.Conversions.To_Virtual_String + newUri => Self.To_URI + (Ada.Strings.Unbounded.To_String (File_Rename.New_Name)), others => <>)))); end loop; diff --git a/testsuite/ada_lsp/S314-015.refactor_change_parameter_mode_0/test.json b/testsuite/ada_lsp/S314-015.refactor_change_parameter_mode_0/test.json index 9f44267be..daa59db1a 100644 --- a/testsuite/ada_lsp/S314-015.refactor_change_parameter_mode_0/test.json +++ b/testsuite/ada_lsp/S314-015.refactor_change_parameter_mode_0/test.json @@ -390,7 +390,7 @@ }, "wait": [ { - "id": 7, + "id": 2, "method": "workspace/applyEdit", "params": { "edit": { diff --git a/testsuite/ada_lsp/S314-015.refactor_move_parameter_0/test.json b/testsuite/ada_lsp/S314-015.refactor_move_parameter_0/test.json index 8c4257f63..e5f637c06 100644 --- a/testsuite/ada_lsp/S314-015.refactor_move_parameter_0/test.json +++ b/testsuite/ada_lsp/S314-015.refactor_move_parameter_0/test.json @@ -343,7 +343,7 @@ }, "wait": [ { - "id": 6, + "id": 2, "method": "workspace/applyEdit", "params": { "edit": { @@ -647,7 +647,7 @@ }, "wait": [ { - "id": 15, + "id": 3, "method": "workspace/applyEdit", "params": { "edit": { diff --git a/testsuite/ada_lsp/S314-015.refactor_remove_parameter_0/test.json b/testsuite/ada_lsp/S314-015.refactor_remove_parameter_0/test.json index 3cd1a3036..eb5e597b5 100644 --- a/testsuite/ada_lsp/S314-015.refactor_remove_parameter_0/test.json +++ b/testsuite/ada_lsp/S314-015.refactor_remove_parameter_0/test.json @@ -340,7 +340,7 @@ }, "wait": [ { - "id": 6, + "id": 2, "method": "workspace/applyEdit", "params": { "edit": { @@ -558,7 +558,7 @@ }, "wait": [ { - "id": 11, + "id": 3, "method": "workspace/applyEdit", "params": { "edit": { @@ -895,7 +895,7 @@ }, "wait": [ { - "id": 21, + "id": 4, "method": "workspace/applyEdit", "params": { "edit": { diff --git a/testsuite/ada_lsp/SC28-001.named.parameters.0/SC28-001.named.parameters.0.json b/testsuite/ada_lsp/SC28-001.named.parameters.0/SC28-001.named.parameters.0.json index 64f1f1b81..c7d5ff39a 100644 --- a/testsuite/ada_lsp/SC28-001.named.parameters.0/SC28-001.named.parameters.0.json +++ b/testsuite/ada_lsp/SC28-001.named.parameters.0/SC28-001.named.parameters.0.json @@ -240,7 +240,7 @@ "wait": [ { "jsonrpc": "2.0", - "id": "ada-3", + "id": 2, "method": "workspace/applyEdit", "params": { "edit": { @@ -300,7 +300,7 @@ "wait": [ { "jsonrpc": "2.0", - "id": "ada-4", + "id": 3, "method": "workspace/applyEdit", "params": { "edit": { @@ -360,7 +360,7 @@ "wait": [ { "jsonrpc": "2.0", - "id": "ada-5", + "id": 4, "method": "workspace/applyEdit", "params": { "edit": { @@ -420,7 +420,7 @@ "wait": [ { "jsonrpc": "2.0", - "id": "ada-6", + "id": 5, "method": "workspace/applyEdit", "params": { "edit": { @@ -480,7 +480,7 @@ "wait": [ { "jsonrpc": "2.0", - "id": "ada-7", + "id": 6, "method": "workspace/applyEdit", "params": { "edit": { @@ -540,7 +540,7 @@ "wait": [ { "jsonrpc": "2.0", - "id": "ada-8", + "id": 7, "method": "workspace/applyEdit", "params": { "edit": { @@ -600,7 +600,7 @@ "wait": [ { "jsonrpc": "2.0", - "id": "ada-9", + "id": 8, "method": "workspace/applyEdit", "params": { "edit": { @@ -660,7 +660,7 @@ "wait": [ { "jsonrpc": "2.0", - "id": "ada-10", + "id": 9, "method": "workspace/applyEdit", "params": { "edit": { diff --git a/testsuite/ada_lsp/T318-086.suppress.separates.0/test.json b/testsuite/ada_lsp/T318-086.suppress.separates.0/test.json index c3576d3e7..0bda78326 100644 --- a/testsuite/ada_lsp/T318-086.suppress.separates.0/test.json +++ b/testsuite/ada_lsp/T318-086.suppress.separates.0/test.json @@ -142,7 +142,7 @@ "wait": [ { "jsonrpc": "2.0", - "id": 3, + "id": 1, "method": "window/workDoneProgress/create", "params": { "token": "" @@ -253,7 +253,7 @@ "wait": [ { "jsonrpc": "2.0", - "id": 4, + "id": 2, "method": "workspace/applyEdit", "params": { "label": "Suppress Separate", @@ -296,8 +296,7 @@ { "kind": "rename", "oldUri": "$URI{test-bar.adb}", - "newUri": "$URI{test-bar.adb.bak}", - "options": {} + "newUri": "$URI{test-bar.adb.bak}" } ] } diff --git a/testsuite/ada_lsp/T318-086.suppress.separates.0/test.yaml b/testsuite/ada_lsp/T318-086.suppress.separates.0/test.yaml index 96ce7f29e..f89e21490 100644 --- a/testsuite/ada_lsp/T318-086.suppress.separates.0/test.yaml +++ b/testsuite/ada_lsp/T318-086.suppress.separates.0/test.yaml @@ -1,4 +1 @@ title: 'T318-086.suppress.separates.0' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/U416-030.refactor_change_parameter_mode_0/test.json b/testsuite/ada_lsp/U416-030.refactor_change_parameter_mode_0/test.json index 97e424886..a72b98381 100644 --- a/testsuite/ada_lsp/U416-030.refactor_change_parameter_mode_0/test.json +++ b/testsuite/ada_lsp/U416-030.refactor_change_parameter_mode_0/test.json @@ -392,7 +392,7 @@ "wait": [ { "jsonrpc": "2.0", - "id": 4, + "id": 2, "method": "workspace/applyEdit", "params": { "edit": { diff --git a/testsuite/ada_lsp/U416-030.refactor_remove_parameter_0/test.json b/testsuite/ada_lsp/U416-030.refactor_remove_parameter_0/test.json index 5e10fed5e..a7153936b 100644 --- a/testsuite/ada_lsp/U416-030.refactor_remove_parameter_0/test.json +++ b/testsuite/ada_lsp/U416-030.refactor_remove_parameter_0/test.json @@ -346,7 +346,7 @@ "wait": [ { "jsonrpc": "2.0", - "id": 4, + "id": 2, "method": "workspace/applyEdit", "params": { "edit": { diff --git a/testsuite/ada_lsp/commands.other_file/test.json b/testsuite/ada_lsp/commands.other_file/test.json index 57ca82468..9c0569247 100644 --- a/testsuite/ada_lsp/commands.other_file/test.json +++ b/testsuite/ada_lsp/commands.other_file/test.json @@ -84,7 +84,6 @@ "wait":[ { "jsonrpc": "2.0", - "id": 2, "method": "window/showDocument", "params": { "uri": "$URI{aaa.adb}", @@ -116,7 +115,6 @@ "wait":[ { "jsonrpc": "2.0", - "id": 3, "method": "window/showDocument", "params": { "uri": "$URI{aaa.ads}", diff --git a/testsuite/ada_lsp/named_params.dot_calls/test.json b/testsuite/ada_lsp/named_params.dot_calls/test.json index f39f5bb53..cbac7f363 100644 --- a/testsuite/ada_lsp/named_params.dot_calls/test.json +++ b/testsuite/ada_lsp/named_params.dot_calls/test.json @@ -180,7 +180,7 @@ ] } }, - "id": 2, + "id": 1, "jsonrpc": "2.0", "method": "workspace/applyEdit" }, @@ -276,7 +276,7 @@ ] } }, - "id": 3, + "id": 2, "method": "workspace/applyEdit" }, { diff --git a/testsuite/ada_lsp/named_params/test.json b/testsuite/ada_lsp/named_params/test.json index 9a18fa1ea..31fe983ce 100644 --- a/testsuite/ada_lsp/named_params/test.json +++ b/testsuite/ada_lsp/named_params/test.json @@ -176,7 +176,7 @@ } }, "wait":[{ - "id":3, + "id":2, "method":"workspace/applyEdit", "params":{ "edit":{ @@ -316,7 +316,7 @@ } }, "wait":[{ - "id":4, + "id":3, "method":"workspace/applyEdit", "params":{ "edit":{ @@ -479,7 +479,7 @@ } }, "wait":[{ - "id":5, + "id":4, "method":"workspace/applyEdit", "params":{ "edit":{ @@ -621,7 +621,7 @@ } }, "wait":[{ - "id":6, + "id":5, "method":"workspace/applyEdit", "params":{ "edit":{ diff --git a/testsuite/ada_lsp/named_params/test.yaml b/testsuite/ada_lsp/named_params/test.yaml index 540de3465..e30d4f298 100644 --- a/testsuite/ada_lsp/named_params/test.yaml +++ b/testsuite/ada_lsp/named_params/test.yaml @@ -1,4 +1 @@ title: 'named_params' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/refactoring_change_parameters_default_values/S314-015/test.json b/testsuite/ada_lsp/refactoring_change_parameters_default_values/S314-015/test.json index 52ea9abfc..9185a1c1b 100644 --- a/testsuite/ada_lsp/refactoring_change_parameters_default_values/S314-015/test.json +++ b/testsuite/ada_lsp/refactoring_change_parameters_default_values/S314-015/test.json @@ -235,7 +235,7 @@ "wait": [ { "jsonrpc": "2.0", - "id": 3, + "id": 2, "method": "workspace/applyEdit", "params": { "edit": { diff --git a/testsuite/ada_lsp/refactoring_change_parameters_type/S314-015/test.json b/testsuite/ada_lsp/refactoring_change_parameters_type/S314-015/test.json index 9f269c1c5..fc3ab5722 100644 --- a/testsuite/ada_lsp/refactoring_change_parameters_type/S314-015/test.json +++ b/testsuite/ada_lsp/refactoring_change_parameters_type/S314-015/test.json @@ -243,7 +243,7 @@ "wait": [ { "jsonrpc": "2.0", - "id": 3, + "id": 2, "method": "workspace/applyEdit", "params": { "edit": { diff --git a/testsuite/ada_lsp/refactoring_extract_subprogram/SA11-047_0/test.json b/testsuite/ada_lsp/refactoring_extract_subprogram/SA11-047_0/test.json index b3d8682f9..4b789b218 100644 --- a/testsuite/ada_lsp/refactoring_extract_subprogram/SA11-047_0/test.json +++ b/testsuite/ada_lsp/refactoring_extract_subprogram/SA11-047_0/test.json @@ -236,7 +236,7 @@ }, "wait": [ { - "id": 3, + "id": 2, "method": "workspace/applyEdit", "params": { "edit": { diff --git a/testsuite/ada_lsp/refactoring_extract_subprogram/SA11-047_1/test.json b/testsuite/ada_lsp/refactoring_extract_subprogram/SA11-047_1/test.json index f0f69e8e3..01caf8687 100644 --- a/testsuite/ada_lsp/refactoring_extract_subprogram/SA11-047_1/test.json +++ b/testsuite/ada_lsp/refactoring_extract_subprogram/SA11-047_1/test.json @@ -263,7 +263,7 @@ }, "wait": [ { - "id": 3, + "id": 2, "method": "workspace/applyEdit", "params": { "edit": { diff --git a/testsuite/ada_lsp/refactoring_imports_commands/U511-009.refactoring.import_with_use/test.json b/testsuite/ada_lsp/refactoring_imports_commands/U511-009.refactoring.import_with_use/test.json index a75f4cad7..7787fd5e6 100644 --- a/testsuite/ada_lsp/refactoring_imports_commands/U511-009.refactoring.import_with_use/test.json +++ b/testsuite/ada_lsp/refactoring_imports_commands/U511-009.refactoring.import_with_use/test.json @@ -267,7 +267,7 @@ }, "wait": [ { - "id": "ada-11", + "id": 2, "method": "workspace/applyEdit", "params": { "edit": { @@ -478,7 +478,7 @@ }, "wait": [ { - "id": "ada-19", + "id": 3, "method": "workspace/applyEdit", "params": { "edit": { diff --git a/testsuite/ada_lsp/refactoring_imports_commands/suggestions_with_nested_packages/refactor_imports_commands.json b/testsuite/ada_lsp/refactoring_imports_commands/suggestions_with_nested_packages/refactor_imports_commands.json index 75722cb80..356c6eec2 100644 --- a/testsuite/ada_lsp/refactoring_imports_commands/suggestions_with_nested_packages/refactor_imports_commands.json +++ b/testsuite/ada_lsp/refactoring_imports_commands/suggestions_with_nested_packages/refactor_imports_commands.json @@ -262,7 +262,7 @@ "wait": [ { "jsonrpc": "2.0", - "id": 3, + "id": 2, "method": "workspace/applyEdit", "params": { "edit": { diff --git a/testsuite/ada_lsp/refactoring_introduce_parameter/SA11-051/test.json b/testsuite/ada_lsp/refactoring_introduce_parameter/SA11-051/test.json index 492e23eef..0eb319cd3 100644 --- a/testsuite/ada_lsp/refactoring_introduce_parameter/SA11-051/test.json +++ b/testsuite/ada_lsp/refactoring_introduce_parameter/SA11-051/test.json @@ -240,7 +240,7 @@ }, "wait": [ { - "id": 3, + "id": 2, "method": "workspace/applyEdit", "params": { "edit": { diff --git a/testsuite/ada_lsp/refactoring_pull_up_declaration/V207-019/test.json b/testsuite/ada_lsp/refactoring_pull_up_declaration/V207-019/test.json index 537cabc7b..6f8a8c944 100644 --- a/testsuite/ada_lsp/refactoring_pull_up_declaration/V207-019/test.json +++ b/testsuite/ada_lsp/refactoring_pull_up_declaration/V207-019/test.json @@ -231,7 +231,7 @@ }, "wait": [ { - "id": 3, + "id": 2, "method": "workspace/applyEdit", "params": { "edit": { diff --git a/testsuite/ada_lsp/refactoring_replace_type/Q817-007/test.json b/testsuite/ada_lsp/refactoring_replace_type/Q817-007/test.json index 7c24c0cd9..e79ac1526 100644 --- a/testsuite/ada_lsp/refactoring_replace_type/Q817-007/test.json +++ b/testsuite/ada_lsp/refactoring_replace_type/Q817-007/test.json @@ -254,7 +254,7 @@ }, "wait": [ { - "id": 3, + "id": 2, "method": "workspace/applyEdit", "params": { "label": "Replace Type", diff --git a/testsuite/ada_lsp/refactoring_sort_dependencies/SA22-035/test.json b/testsuite/ada_lsp/refactoring_sort_dependencies/SA22-035/test.json index d23143991..1232866d3 100644 --- a/testsuite/ada_lsp/refactoring_sort_dependencies/SA22-035/test.json +++ b/testsuite/ada_lsp/refactoring_sort_dependencies/SA22-035/test.json @@ -233,7 +233,7 @@ "wait": [ { "jsonrpc": "2.0", - "id": 3, + "id": 2, "method": "workspace/applyEdit", "params": { "label": "Sort Dependencies", From e96bb6d7e9df478b11fa9a4a19d0e5b5d39c199b Mon Sep 17 00:00:00 2001 From: Vadim Godunko Date: Wed, 6 Sep 2023 16:18:14 +0400 Subject: [PATCH 111/152] Move formatting method control into configuration. --- source/ada/lsp-ada_configurations.adb | 16 ++++++++++++++++ source/ada/lsp-ada_configurations.ads | 3 +++ source/ada/lsp-ada_handlers.adb | 9 +-------- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/source/ada/lsp-ada_configurations.adb b/source/ada/lsp-ada_configurations.adb index 03158d088..d7ef34ae8 100644 --- a/source/ada/lsp-ada_configurations.adb +++ b/source/ada/lsp-ada_configurations.adb @@ -42,6 +42,13 @@ package body LSP.Ada_Configurations is ("ALS.COMPLETION.FORMATTING", Default => GNATCOLL.Traces.On); -- Used in Completion_Formatting/LSP.Ada_Completions.Pretty_Print_Snippet + Partial_Gnatpp_Trace : constant GNATCOLL.Traces.Trace_Handle := + GNATCOLL.Traces.Create + (Unit_Name => "ALS.PARTIAL_GNATPP", + Default => GNATCOLL.Traces.On); + -- Trace to enable/disable using partial Gnatpp in the rangeFormatting + -- request. + --------------------------- -- Completion_Formatting -- --------------------------- @@ -312,4 +319,13 @@ package body LSP.Ada_Configurations is Self.Variables_Values := Variables_Values; end Read_JSON; + -------------------- + -- Partial_GNATPP -- + -------------------- + + function Partial_GNATPP return Boolean is + begin + return Partial_Gnatpp_Trace.Is_Active; + end Partial_GNATPP; + end LSP.Ada_Configurations; diff --git a/source/ada/lsp-ada_configurations.ads b/source/ada/lsp-ada_configurations.ads index f4cdaaf99..972eecf87 100644 --- a/source/ada/lsp-ada_configurations.ads +++ b/source/ada/lsp-ada_configurations.ads @@ -100,6 +100,9 @@ package LSP.Ada_Configurations is function Completion_Formatting return Boolean; -- Used in LSP.Ada_Completions.Pretty_Print_Snippet + function Partial_GNATPP return Boolean; + -- Whether partial GNATPP is enabled. + private type Configuration is tagged limited record diff --git a/source/ada/lsp-ada_handlers.adb b/source/ada/lsp-ada_handlers.adb index da5c8558d..5e99b2ec9 100644 --- a/source/ada/lsp-ada_handlers.adb +++ b/source/ada/lsp-ada_handlers.adb @@ -101,13 +101,6 @@ package body LSP.Ada_Handlers is subtype AlsReferenceKind_Array is LSP.Structures.AlsReferenceKind_Set; - Partial_Gnatpp_Trace : constant GNATCOLL.Traces.Trace_Handle := - GNATCOLL.Traces.Create - (Unit_Name => "ALS.PARTIAL_GNATPP", - Default => GNATCOLL.Traces.On); - -- Trace to enable/disable using partial Gnatpp in the rangeFormatting - -- request. - function Is_Parent return AlsReferenceKind_Array is ([LSP.Enumerations.parent => True, others => False]); @@ -3357,7 +3350,7 @@ package body LSP.Ada_Handlers is Messages : VSS.String_Vectors.Virtual_String_Vector; begin - if Partial_Gnatpp_Trace.Is_Active then + if LSP.Ada_Configurations.Partial_GNATPP then LSP.Ada_Handlers.Formatting.Range_Format (Context.all, Document, From 8b0148a90713783ac8803b70146f9f44dd4950c8 Mon Sep 17 00:00:00 2001 From: Vadim Godunko Date: Fri, 8 Sep 2023 11:00:40 +0400 Subject: [PATCH 112/152] Implementation of 'onTypeFormatting' --- source/ada/lsp-ada_client_capabilities.adb | 7 + source/ada/lsp-ada_client_capabilities.ads | 1 - source/ada/lsp-ada_configurations.adb | 17 +- source/ada/lsp-ada_configurations.ads | 14 ++ source/ada/lsp-ada_documents.adb | 9 +- source/ada/lsp-ada_documents.ads | 2 +- source/ada/lsp-ada_handlers.adb | 246 +++++++++++++++++++++ source/ada/lsp-ada_handlers.ads | 5 + 8 files changed, 294 insertions(+), 7 deletions(-) diff --git a/source/ada/lsp-ada_client_capabilities.adb b/source/ada/lsp-ada_client_capabilities.adb index 25b2b1588..2a9f2b5ce 100644 --- a/source/ada/lsp-ada_client_capabilities.adb +++ b/source/ada/lsp-ada_client_capabilities.adb @@ -20,6 +20,7 @@ with VSS.JSON.Streams; with VSS.String_Vectors; with VSS.Strings.Conversions; +with LSP.Ada_Configurations; with LSP.Constants; with LSP.Enumerations; with LSP.Structures.Unwrap; @@ -290,6 +291,12 @@ package body LSP.Ada_Client_Capabilities is (if Self.Code_ActionLiteralSupport then Full_codeActionProvider else LSP.Constants.True); + Result.documentOnTypeFormattingProvider := + (if LSP.Ada_Configurations.On_Type_Formatting + then (Is_Set => True, + Value => LSP.Ada_Configurations.On_Type_Formatting_Settings) + else (Is_Set => False)); + Result.executeCommandProvider := (Is_Set => True, Value => diff --git a/source/ada/lsp-ada_client_capabilities.ads b/source/ada/lsp-ada_client_capabilities.ads index ab5d7e939..69ee3df7c 100644 --- a/source/ada/lsp-ada_client_capabilities.ads +++ b/source/ada/lsp-ada_client_capabilities.ads @@ -20,7 +20,6 @@ with VSS.Strings; with LSP.Structures; package LSP.Ada_Client_Capabilities is - pragma Preelaborate; type Client_Capability is tagged limited private; -- This type holds client initialization response and provides handy diff --git a/source/ada/lsp-ada_configurations.adb b/source/ada/lsp-ada_configurations.adb index d7ef34ae8..23818def2 100644 --- a/source/ada/lsp-ada_configurations.adb +++ b/source/ada/lsp-ada_configurations.adb @@ -49,6 +49,13 @@ package body LSP.Ada_Configurations is -- Trace to enable/disable using partial Gnatpp in the rangeFormatting -- request. + On_Type_Formatting_Trace : constant GNATCOLL.Traces.Trace_Handle := + GNATCOLL.Traces.Create + (Unit_Name => "ALS.ON_TYPE_FORMATTING", + Default => GNATCOLL.Traces.On); + -- Trace to enable/disable ALS from providing the + -- documentOnTypeFormattingProvider capability. + --------------------------- -- Completion_Formatting -- --------------------------- @@ -58,6 +65,15 @@ package body LSP.Ada_Configurations is return ALS_COMPLETION_FORMATTING.Is_Active; end Completion_Formatting; + ------------------------ + -- On_Type_Formatting -- + ------------------------ + + function On_Type_Formatting return Boolean is + begin + return On_Type_Formatting_Trace.Is_Active; + end On_Type_Formatting; + --------------- -- Read_JSON -- --------------- @@ -69,7 +85,6 @@ package body LSP.Ada_Configurations is is use all type VSS.JSON.JSON_Number_Kind; use all type VSS.JSON.Streams.JSON_Stream_Element_Kind; - use type VSS.Strings.Virtual_String; use type VSS.String_Vectors.Virtual_String_Vector; Index : Positive := JSON.First_Index; diff --git a/source/ada/lsp-ada_configurations.ads b/source/ada/lsp-ada_configurations.ads index 972eecf87..d8386b270 100644 --- a/source/ada/lsp-ada_configurations.ads +++ b/source/ada/lsp-ada_configurations.ads @@ -17,6 +17,7 @@ with GNATdoc.Comments.Options; +private with VSS.Characters.Latin; with VSS.Strings; with VSS.String_Vectors; @@ -103,8 +104,16 @@ package LSP.Ada_Configurations is function Partial_GNATPP return Boolean; -- Whether partial GNATPP is enabled. + function On_Type_Formatting return Boolean; + -- Whether onTypeFormatting is enabled. + + function On_Type_Formatting_Settings + return LSP.Structures.DocumentOnTypeFormattingOptions; + private + use type VSS.Strings.Virtual_String; + type Configuration is tagged limited record Project_File : VSS.Strings.Virtual_String; Charset : VSS.Strings.Virtual_String; @@ -187,4 +196,9 @@ private return DisplayMethodAncestryOnNavigationPolicy is (Self.Method_Ancestry_Policy); + function On_Type_Formatting_Settings + return LSP.Structures.DocumentOnTypeFormattingOptions is + (firstTriggerCharacter => 1 * VSS.Characters.Latin.Line_Feed, + moreTriggerCharacter => <>); + end LSP.Ada_Configurations; diff --git a/source/ada/lsp-ada_documents.adb b/source/ada/lsp-ada_documents.adb index c4093f78d..ef2368e1f 100644 --- a/source/ada/lsp-ada_documents.adb +++ b/source/ada/lsp-ada_documents.adb @@ -1803,11 +1803,12 @@ package body LSP.Ada_Documents is (Self : Document; Context : LSP.Ada_Contexts.Context; Line : Positive) - return Natural + return VSS.Strings.Character_Count is - (Laltools.Partial_GNATPP.Estimate_Indentation - (Self.Unit (Context), - Self.Get_Source_Location ((Line, 1)).Line)); + (VSS.Strings.Character_Count + (Laltools.Partial_GNATPP.Estimate_Indentation + (Self.Unit (Context), + Self.Get_Source_Location ((Line, 1)).Line))); ----------------- -- Get_Node_At -- diff --git a/source/ada/lsp-ada_documents.ads b/source/ada/lsp-ada_documents.ads index d769b17bd..474425fac 100644 --- a/source/ada/lsp-ada_documents.ads +++ b/source/ada/lsp-ada_documents.ads @@ -147,7 +147,7 @@ package LSP.Ada_Documents is (Self : Document; Context : LSP.Ada_Contexts.Context; Line : Positive) - return Natural; + return VSS.Strings.Character_Count; -- Estimates the indention a line should have function Get_Node_At diff --git a/source/ada/lsp-ada_handlers.adb b/source/ada/lsp-ada_handlers.adb index 5e99b2ec9..f662bd294 100644 --- a/source/ada/lsp-ada_handlers.adb +++ b/source/ada/lsp-ada_handlers.adb @@ -35,6 +35,7 @@ with Libadalang.Common; with Libadalang.Helpers; with Laltools.Common; +with Laltools.Partial_GNATPP; with Langkit_Support.Slocs; @@ -3163,6 +3164,251 @@ package body LSP.Ada_Handlers is Self.Sender.On_Initialize_Response (Id, Response); end On_Initialize_Request; + --------------------------------- + -- On_OnTypeFormatting_Request -- + --------------------------------- + + overriding procedure On_OnTypeFormatting_Request + (Self : in out Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentOnTypeFormattingParams) + is + use type VSS.Strings.Character_Count; + use type VSS.Strings.Virtual_String; + + procedure Compute_Response; + + procedure Handle_Document_With_Diagnostics; + -- Simply adds indentation to the new line + + procedure Handle_Document_Without_Diagnostics; + -- Adds indentation to the new line and formats the previous node + -- if configured to do so and taking into account where the cursor + -- is. + + Context : constant LSP.Ada_Context_Sets.Context_Access := + Self.Contexts.Get_Best_Context (Value.textDocument.uri); + Document : constant LSP.Ada_Documents.Document_Access := + Self.Get_Open_Document (Value.textDocument.uri); + Response : LSP.Structures.TextEdit_Vector_Or_Null; + Indentation : constant VSS.Strings.Character_Count := + (declare + Indentation_First_Guess : constant VSS.Strings.Character_Count := + Document.Get_Indentation (Context.all, Value.position.line); + + begin + (if Indentation_First_Guess + >= VSS.Strings.Character_Count (Value.position.character) + then Indentation_First_Guess + - VSS.Strings.Character_Count (Value.position.character) + else 0)); + -- Do not add any indentation if the current cursor position is greater + -- than the calculated one. + -- XXX position.character is counted as UTF-16 code units, actual + -- position need to be computed. + + ---------------------- + -- Compute_Response -- + ---------------------- + + procedure Compute_Response is + begin + if not LSP.Ada_Configurations.On_Type_Formatting then + Self.Tracer.Trace + ("'onTypeFormatting' is not active, yet, ALS received a request - " + & "exiting earlier"); + + return; + end if; + + if Value.ch /= + LSP.Ada_Configurations.On_Type_Formatting_Settings + .firstTriggerCharacter + then + Self.Tracer.Trace + ("Trigger character ch is not a new line - exiting earlier"); + + return; + end if; + + if Document.Has_Diagnostics (Context.all) then + -- This is the unhappy path: when this Document has diagnostics. + -- Get the previous node (based on the previous non whitespace + -- token), compute the indentation and format it (if configured to + -- to so). + + Self.Tracer.Trace ("Document has diagnostics"); + Handle_Document_With_Diagnostics; + + else + -- This is the happy path: when this Document does not have any + -- diagnostics. + -- Get the previous node (based on the previous non whitespace + -- token) and compute the indentation. + + Self.Tracer.Trace ("Document does not have any diagnostics"); + Handle_Document_Without_Diagnostics; + end if; + + Self.Tracer.Trace ("Exiting 'onTypeFormatting' Request"); + end Compute_Response; + + -------------------------------------- + -- Handle_Document_With_Diagnostics -- + -------------------------------------- + + procedure Handle_Document_With_Diagnostics is + begin + Response.Append + (LSP.Structures.TextEdit' + (a_range => + (start => Value.position, + an_end => Value.position), + newText => Indentation * VSS.Characters.Latin.Space)); + end Handle_Document_With_Diagnostics; + + ----------------------------------------- + -- Handle_Document_Without_Diagnostics -- + ----------------------------------------- + + procedure Handle_Document_Without_Diagnostics is + + function Is_Between + (Position : LSP.Structures.Position; + Span : LSP.Structures.A_Range) return Boolean; + -- Checks if Position is between Span + + ---------------- + -- Is_Between -- + ---------------- + + function Is_Between + (Position : LSP.Structures.Position; + Span : LSP.Structures.A_Range) + return Boolean + is ((Position.line = Span.start.line + and then Position.character >= Span.start.character) + or else (Position.line = Span.an_end.line + and then Position.character <= Span.an_end.character) + or else (Position.line > Span.start.line + and then Position.line < Span.an_end.line)); + + Token : + constant Libadalang.Common.Token_Reference := + Document.Get_Token_At (Context.all, Value.position); + Previous_NWNC_Token : + constant Libadalang.Common.Token_Reference := + Laltools.Partial_GNATPP.Previous_Non_Whitespace_Non_Comment_Token + (Token); + Previous_NWNC_Token_Span : constant LSP.Structures.A_Range := + Document.To_LSP_Range + (Libadalang.Common.Sloc_Range + (Libadalang.Common.Data (Previous_NWNC_Token))); + + Formatting_Region : + constant Laltools.Partial_GNATPP.Formatting_Region_Type := + Document.Get_Formatting_Region + (Context.all, Previous_NWNC_Token_Span.start); + Formatting_Span : constant LSP.Structures.A_Range := + Document.To_LSP_Range + (Libadalang.Slocs.Make_Range + (Libadalang.Slocs.Start_Sloc + (Libadalang.Common.Sloc_Range + (Libadalang.Common.Data + (Formatting_Region.Start_Token))), + Libadalang.Slocs.Start_Sloc + (Libadalang.Common.Sloc_Range + (Libadalang.Common.Data + (Formatting_Region.End_Token))))); + -- This is the span that would be formatted based on the cursor + -- position. + + begin + if Self.Configuration.Indent_Only then + Self.Tracer.Trace + ("'onTypeFormatting' request configured to indent only"); + + Response.Append + (LSP.Structures.TextEdit' + (a_range => + (start => Value.position, + an_end => Value.position), + newText => Indentation * ' ')); + + return; + end if; + + -- onTypeFormatting is configured to also format the previous node, + -- however, we can only do this if the cursor is not between the + -- Formatting_Span. + + if Is_Between (Value.position, Formatting_Span) then + Self.Tracer.Trace + ("Current position is within the Formatting_Span"); + Self.Tracer.Trace ("Adding indentation only"); + + Response.Append + (LSP.Structures.TextEdit' + (a_range => + (start => Value.position, + an_end => Value.position), + newText => Indentation * ' ')); + + return; + end if; + + Self.Tracer.Trace + ("Formatting previous node and adding indentation"); + + declare + Success : Boolean; + Error : LSP.Errors.ResponseError; + + begin + LSP.Ada_Handlers.Formatting.Range_Format + (Context.all, + Document, + Previous_NWNC_Token_Span, + Value.options, + Success, + Response, + Error); + + if Success then + -- Result contains the Range_Format result. + -- Add indentation to the next line. + + Response.Append + (LSP.Structures.TextEdit' + (a_range => + (start => Value.position, + an_end => Value.position), + newText => Indentation * ' ')); + + return; + end if; + + Self.Tracer.Trace + ("The 'onTypeFormatting' has failed because of a " + & "Range_Format error"); + + Response.Append + (LSP.Structures.TextEdit' + (a_range => + (start => Value.position, + an_end => Value.position), + newText => Indentation * ' ')); + end; + end Handle_Document_Without_Diagnostics; + + begin + Self.Tracer.Trace ("On 'onTypeFormatting' Request"); + + Compute_Response; + + Self.Sender.On_OnTypeFormatting_Response (Id, Response); + end On_OnTypeFormatting_Request; + ------------------------------ -- On_OutgoingCalls_Request -- ------------------------------ diff --git a/source/ada/lsp-ada_handlers.ads b/source/ada/lsp-ada_handlers.ads index 9ca954447..c85798f82 100644 --- a/source/ada/lsp-ada_handlers.ads +++ b/source/ada/lsp-ada_handlers.ads @@ -378,6 +378,11 @@ private Id : LSP.Structures.Integer_Or_Virtual_String; Value : LSP.Structures.CompletionParams); + overriding procedure On_OnTypeFormatting_Request + (Self : in out Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentOnTypeFormattingParams); + overriding procedure On_SignatureHelp_Request (Self : in out Message_Handler; Id : LSP.Structures.Integer_Or_Virtual_String; From c89d1df700c8ebc03ef2414a9ed37ab80319de93 Mon Sep 17 00:00:00 2001 From: Vadim Godunko Date: Fri, 8 Sep 2023 11:02:10 +0400 Subject: [PATCH 113/152] Enable 'onTypeFormatting' tests. --- testsuite/ada_lsp/onTypeFormatting/indentOnlyFalse/test.yaml | 3 --- testsuite/ada_lsp/onTypeFormatting/indentOnlyTrue/test.yaml | 3 --- 2 files changed, 6 deletions(-) diff --git a/testsuite/ada_lsp/onTypeFormatting/indentOnlyFalse/test.yaml b/testsuite/ada_lsp/onTypeFormatting/indentOnlyFalse/test.yaml index cf5fb0aa8..1e828283a 100644 --- a/testsuite/ada_lsp/onTypeFormatting/indentOnlyFalse/test.yaml +++ b/testsuite/ada_lsp/onTypeFormatting/indentOnlyFalse/test.yaml @@ -1,4 +1 @@ title: 'testi' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/onTypeFormatting/indentOnlyTrue/test.yaml b/testsuite/ada_lsp/onTypeFormatting/indentOnlyTrue/test.yaml index cf5fb0aa8..1e828283a 100644 --- a/testsuite/ada_lsp/onTypeFormatting/indentOnlyTrue/test.yaml +++ b/testsuite/ada_lsp/onTypeFormatting/indentOnlyTrue/test.yaml @@ -1,4 +1 @@ title: 'testi' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] From 941a51661dd65de0801705c07d2f9e19f850e8c9 Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Fri, 8 Sep 2023 16:46:26 +0300 Subject: [PATCH 114/152] Add `$/alsCheckSyntax` request Refs #1170 --- doc/metaModel.patch.json | 52 ++++++++++++++++++++ source/server/lsp-unimplemented_handlers.adb | 12 +++++ source/server/lsp-unimplemented_handlers.ads | 5 ++ 3 files changed, 69 insertions(+) diff --git a/doc/metaModel.patch.json b/doc/metaModel.patch.json index 8743dad07..973902242 100644 --- a/doc/metaModel.patch.json +++ b/doc/metaModel.patch.json @@ -1,4 +1,18 @@ { + "requests": [ + { + "method": "$/alsCheckSyntax", + "result": { + "kind": "reference", + "name": "AlsCheckSyntaxResult" + }, + "params": { + "kind": "reference", + "name": "AlsCheckSyntaxParams" + }, + "documentation": "query if a given input has a valid syntax according to a set of rules." + } + ], "enumerations": [ { "name": "AlsReferenceKind", @@ -43,6 +57,44 @@ } ], "structures": [ + { + "name": "AlsCheckSyntaxParams", + "properties": [ + { + "name": "input", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "Text to check syntax." + }, + { + "name": "rules", + "type": { + "kind": "array", + "element": { + "kind": "base", + "name": "string" + } + }, + "documentation": "Libadalang `Ada_Node_Kind_Type` values." + } + ] + }, + { + "name": "AlsCheckSyntaxResult", + "properties": [ + { + "name": "diagnostic", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "Diagnostic from check syntax." + } + ] + }, { "name": "Location", "properties": [ diff --git a/source/server/lsp-unimplemented_handlers.adb b/source/server/lsp-unimplemented_handlers.adb index 8d7e93efa..2b08dc5e6 100644 --- a/source/server/lsp-unimplemented_handlers.adb +++ b/source/server/lsp-unimplemented_handlers.adb @@ -17,6 +17,18 @@ package body LSP.Unimplemented_Handlers is + ------------------------------- + -- On_AlsCheckSyntax_Request -- + ------------------------------- + + overriding procedure On_AlsCheckSyntax_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.AlsCheckSyntaxParams) is + begin + Self.Implemented := False; + end On_AlsCheckSyntax_Request; + ------------------------------------ -- On_Code_Action_Resolve_Request -- ------------------------------------ diff --git a/source/server/lsp-unimplemented_handlers.ads b/source/server/lsp-unimplemented_handlers.ads index 5ac711fb9..91a0ad72d 100644 --- a/source/server/lsp-unimplemented_handlers.ads +++ b/source/server/lsp-unimplemented_handlers.ads @@ -29,6 +29,11 @@ package LSP.Unimplemented_Handlers is -- A flag to check if a request was handled end record; + overriding procedure On_AlsCheckSyntax_Request + (Self : in out Unimplemented_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.AlsCheckSyntaxParams); + overriding procedure On_IncomingCalls_Request (Self : in out Unimplemented_Handler; Id : LSP.Structures.Integer_Or_Virtual_String; From bd37d1934df171b78b62695699e275fac41261c8 Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Fri, 8 Sep 2023 17:11:28 +0300 Subject: [PATCH 115/152] Add extra undocumented properties to `DocumentSymbol` Refs #1170 --- doc/metaModel.patch.json | 50 +++++++++++++++++++++++++ source/ada/lsp-ada_handlers-symbols.adb | 12 ++++-- 2 files changed, 59 insertions(+), 3 deletions(-) diff --git a/doc/metaModel.patch.json b/doc/metaModel.patch.json index 973902242..f3be41667 100644 --- a/doc/metaModel.patch.json +++ b/doc/metaModel.patch.json @@ -54,6 +54,27 @@ "value": "overriding" } ] + }, + { + "name": "AlsVisibility", + "type": { + "kind": "base", + "name": "integer" + }, + "values": [ + { + "name": "Als_Public", + "value": 1 + }, + { + "name": "Als_Protected", + "value": 2 + }, + { + "name": "Als_Private", + "value": 3 + } + ] } ], "structures": [ @@ -95,6 +116,35 @@ } ] }, + { + "name": "DocumentSymbol", + "properties": [ + { + "name": "alsIsDeclaration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true + }, + { + "name": "alsIsAdaProcedure", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true + }, + { + "name": "alsVisibility", + "type": { + "kind": "reference", + "name": "AlsVisibility" + }, + "optional": true + } + ] + }, { "name": "Location", "properties": [ diff --git a/source/ada/lsp-ada_handlers-symbols.adb b/source/ada/lsp-ada_handlers-symbols.adb index 26b127ece..2c0d2e412 100644 --- a/source/ada/lsp-ada_handlers-symbols.adb +++ b/source/ada/lsp-ada_handlers-symbols.adb @@ -318,7 +318,11 @@ package body LSP.Ada_Handlers.Symbols is (Self, Node).a_range, selectionRange => Locations.To_LSP_Location (Self, Name).a_range, - children => Children); + children => Children, + alsIsDeclaration => LSP.Constants.True, + alsIsAdaProcedure => LSP.Constants.True, + alsVisibility => + (True, LSP.Enumerations.Als_Private)); begin Vector.Append (Item); end; @@ -346,7 +350,8 @@ package body LSP.Ada_Handlers.Symbols is (Self, Node).a_range, selectionRange => Locations.To_LSP_Location (Self, Name).a_range, - children => Empty); + children => Empty, + others => <>); begin Vector.Append (Item); end; @@ -372,7 +377,8 @@ package body LSP.Ada_Handlers.Symbols is (Self, Node).a_range, selectionRange => Locations.To_LSP_Location (Self, Name).a_range, - children => Empty); + children => Empty, + others => <>); begin if Nested_Level <= 1 then Vector.Append (Item); From 3999617afc3824415e780b8b44b75b41cc9145a3 Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Fri, 8 Sep 2023 20:21:01 +0300 Subject: [PATCH 116/152] Add extra option to `DocumentSymbolParams` Refs #1170 --- doc/metaModel.patch.json | 69 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/doc/metaModel.patch.json b/doc/metaModel.patch.json index f3be41667..fca19ae8f 100644 --- a/doc/metaModel.patch.json +++ b/doc/metaModel.patch.json @@ -55,6 +55,35 @@ } ] }, + { + "name": "AlsSearchKind", + "type": { + "kind": "base", + "name": "integer" + }, + "values": [ + { + "name": "Full_Text", + "value": 1 + }, + { + "name": "Regexp", + "value": 2 + }, + { + "name": "Fuzzy", + "value": 3 + }, + { + "name": "Approximate", + "value": 4 + }, + { + "name": "Start_Word_Text", + "value": 5 + } + ] + }, { "name": "AlsVisibility", "type": { @@ -145,6 +174,46 @@ } ] }, + { + "name": "DocumentSymbolParams", + "properties": [ + { + "name": "case_sensitive", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "To take letters' case into account." + }, + { + "name": "whole_word", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "To match the whole word instead of a part of it." + }, + { + "name": "negate", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "To invert matching." + }, + { + "name": "kind", + "type": { + "kind": "reference", + "name": "AlsSearchKind" + }, + "optional": true + } + ] + }, { "name": "Location", "properties": [ From 5558a24d0ea4566597243a5f0a17f682df672468 Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Fri, 8 Sep 2023 20:21:41 +0300 Subject: [PATCH 117/152] Add `AlsDisplayMethodAncestryOnNavigationPolicy` type/prop Refs #1170 --- doc/metaModel.patch.json | 69 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 68 insertions(+), 1 deletion(-) diff --git a/doc/metaModel.patch.json b/doc/metaModel.patch.json index fca19ae8f..2bb33e487 100644 --- a/doc/metaModel.patch.json +++ b/doc/metaModel.patch.json @@ -14,6 +14,31 @@ } ], "enumerations": [ + { + "name": "AlsDisplayMethodAncestryOnNavigationPolicy", + "type": { + "kind": "base", + "name": "string" + }, + "values": [ + { + "name": "Never", + "value": "Never" + }, + { + "name": "Usage_And_Abstract_Only", + "value": "Usage_And_Abstract_Only" + }, + { + "name": "Definition_Only", + "value": "Definition_Only" + }, + { + "name": "Always", + "value": "Always" + } + ] + }, { "name": "AlsReferenceKind", "type": { @@ -145,6 +170,48 @@ } ] }, + { + "name": "DeclarationParams", + "properties": [ + { + "name": "alsDisplayMethodAncestryOnNavigation", + "type": { + "kind": "reference", + "name": "AlsDisplayMethodAncestryOnNavigationPolicy" + }, + "optional": true, + "documentation": "whether or now we should list overriding/overridden subprograms." + } + ] + }, + { + "name": "DefinitionParams", + "properties": [ + { + "name": "alsDisplayMethodAncestryOnNavigation", + "type": { + "kind": "reference", + "name": "AlsDisplayMethodAncestryOnNavigationPolicy" + }, + "optional": true, + "documentation": "whether or now we should list overriding/overridden subprograms." + } + ] + }, + { + "name": "ImplementationParams", + "properties": [ + { + "name": "alsDisplayMethodAncestryOnNavigation", + "type": { + "kind": "reference", + "name": "AlsDisplayMethodAncestryOnNavigationPolicy" + }, + "optional": true, + "documentation": "whether or now we should list overriding/overridden subprograms." + } + ] + }, { "name": "DocumentSymbol", "properties": [ @@ -248,4 +315,4 @@ ] } ] -} \ No newline at end of file +} From 78affb3416c4dc176fab9f03d4a78beb289c5b8e Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Fri, 8 Sep 2023 20:27:38 +0300 Subject: [PATCH 118/152] Regenerate sources from patched metamodel Refs #1170 --- .../lsp-client_message_factories.adb | 12 + .../lsp-client_message_factories.ads | 5 + .../generated/lsp-client_response_readers.adb | 115 +++++---- .../lsp-client_response_receivers.ads | 6 + .../generated/lsp-client_response_writers.adb | 11 + .../generated/lsp-client_response_writers.ads | 5 + .../lsp-client_responses-alschecksyntax.adb | 19 ++ .../lsp-client_responses-alschecksyntax.ads | 23 ++ .../lsp_3.17/generated/lsp-enumerations.ads | 8 + source/lsp_3.17/generated/lsp-inputs.adb | 243 +++++++++++++++++- source/lsp_3.17/generated/lsp-inputs.ads | 8 + source/lsp_3.17/generated/lsp-outputs.adb | 127 +++++++++ source/lsp_3.17/generated/lsp-outputs.ads | 8 + .../generated/lsp-server_request_readers.adb | 115 +++++---- .../lsp-server_request_receivers.ads | 6 + .../generated/lsp-server_request_writers.adb | 12 + .../generated/lsp-server_request_writers.ads | 5 + .../lsp-server_requests-alschecksyntax.adb | 19 ++ .../lsp-server_requests-alschecksyntax.ads | 23 ++ source/lsp_3.17/generated/lsp-structures.ads | 70 +++++ 20 files changed, 729 insertions(+), 111 deletions(-) create mode 100644 source/lsp_3.17/generated/lsp-client_responses-alschecksyntax.adb create mode 100644 source/lsp_3.17/generated/lsp-client_responses-alschecksyntax.ads create mode 100644 source/lsp_3.17/generated/lsp-server_requests-alschecksyntax.adb create mode 100644 source/lsp_3.17/generated/lsp-server_requests-alschecksyntax.ads diff --git a/source/lsp_3.17/generated/lsp-client_message_factories.adb b/source/lsp_3.17/generated/lsp-client_message_factories.adb index dc24a3a6c..e0ac0644b 100644 --- a/source/lsp_3.17/generated/lsp-client_message_factories.adb +++ b/source/lsp_3.17/generated/lsp-client_message_factories.adb @@ -25,6 +25,7 @@ with LSP.Client_Requests.Inlay_Refresh; with LSP.Client_Requests.Inline_Refresh; with LSP.Client_Requests.Tokens_Refresh; with LSP.Client_Requests.WorkspaceFolders; +with LSP.Client_Responses.AlsCheckSyntax; with LSP.Client_Responses.IncomingCalls; with LSP.Client_Responses.OutgoingCalls; with LSP.Client_Responses.Code_Action_Resolve; @@ -290,6 +291,17 @@ package body LSP.Client_Message_Factories is (new LSP.Client_Requests.WorkspaceFolders.Request'(Id => Id)); end On_WorkspaceFolders_Request; + overriding procedure On_AlsCheckSyntax_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.AlsCheckSyntaxResult) is + begin + Client_Message_Factory'Class (Self).On_Message + (new LSP.Client_Responses.AlsCheckSyntax.Response' + (Id => Id, + Result => Value)); + end On_AlsCheckSyntax_Response; + overriding procedure On_IncomingCalls_Response (Self : in out Client_Message_Factory; Id : LSP.Structures.Integer_Or_Virtual_String; diff --git a/source/lsp_3.17/generated/lsp-client_message_factories.ads b/source/lsp_3.17/generated/lsp-client_message_factories.ads index 2457f9fe6..d7d2eb4a5 100644 --- a/source/lsp_3.17/generated/lsp-client_message_factories.ads +++ b/source/lsp_3.17/generated/lsp-client_message_factories.ads @@ -106,6 +106,11 @@ package LSP.Client_Message_Factories is (Self : in out Client_Message_Factory; Id : LSP.Structures.Integer_Or_Virtual_String); + overriding procedure On_AlsCheckSyntax_Response + (Self : in out Client_Message_Factory; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.AlsCheckSyntaxResult); + overriding procedure On_IncomingCalls_Response (Self : in out Client_Message_Factory; Id : LSP.Structures.Integer_Or_Virtual_String; diff --git a/source/lsp_3.17/generated/lsp-client_response_readers.adb b/source/lsp_3.17/generated/lsp-client_response_readers.adb index af28066cd..6975f4c7e 100644 --- a/source/lsp_3.17/generated/lsp-client_response_readers.adb +++ b/source/lsp_3.17/generated/lsp-client_response_readers.adb @@ -11,6 +11,7 @@ with LSP.Inputs; with LSP.Input_Tools; with LSP.Structures; +with LSP.Client_Responses.AlsCheckSyntax; with LSP.Client_Responses.IncomingCalls; with LSP.Client_Responses.OutgoingCalls; with LSP.Client_Responses.Code_Action_Resolve; @@ -66,7 +67,8 @@ with LSP.Client_Responses.Symbol_Resolve; package body LSP.Client_Response_Readers is package Method_Map is new Minimal_Perfect_Hash - (["callHierarchy/incomingCalls", + (["$/alsCheckSyntax", + "callHierarchy/incomingCalls", "callHierarchy/outgoingCalls", "codeAction/resolve", "codeLens/resolve", @@ -123,6 +125,10 @@ package body LSP.Client_Response_Readers is Method_Map.Initialize; end Initialize; + procedure Read_AlsCheckSyntax is new LSP.Input_Tools.Read_Response + (LSP.Structures.AlsCheckSyntaxResult, + LSP.Inputs.Read_AlsCheckSyntaxResult); + procedure Read_IncomingCalls is new LSP.Input_Tools.Read_Response (LSP.Structures.CallHierarchyIncomingCall_Vector_Or_Null, LSP.Inputs.Read_CallHierarchyIncomingCall_Vector_Or_Null); @@ -317,261 +323,266 @@ package body LSP.Client_Response_Readers is Index : constant Natural := Method_Map.Get_Index (Method); begin case Index is - when 1 => -- callHierarchy/incomingCalls + when 1 => -- $/alsCheckSyntax + return Result : LSP.Client_Responses.AlsCheckSyntax.Response do + Read_AlsCheckSyntax (Input, Result.Id, Result.Result); + end return; + + when 2 => -- callHierarchy/incomingCalls return Result : LSP.Client_Responses.IncomingCalls.Response do Read_IncomingCalls (Input, Result.Id, Result.Result); end return; - when 2 => -- callHierarchy/outgoingCalls + when 3 => -- callHierarchy/outgoingCalls return Result : LSP.Client_Responses.OutgoingCalls.Response do Read_OutgoingCalls (Input, Result.Id, Result.Result); end return; - when 3 => -- codeAction/resolve + when 4 => -- codeAction/resolve return Result : LSP.Client_Responses.Code_Action_Resolve.Response do Read_Code_Action_Resolve (Input, Result.Id, Result.Result); end return; - when 4 => -- codeLens/resolve + when 5 => -- codeLens/resolve return Result : LSP.Client_Responses.Code_Lens_Resolve.Response do Read_Code_Lens_Resolve (Input, Result.Id, Result.Result); end return; - when 5 => -- completionItem/resolve + when 6 => -- completionItem/resolve return Result : LSP.Client_Responses.Completion_Resolve.Response do Read_Completion_Resolve (Input, Result.Id, Result.Result); end return; - when 6 => -- documentLink/resolve + when 7 => -- documentLink/resolve return Result : LSP.Client_Responses.Link_Resolve.Response do Read_Link_Resolve (Input, Result.Id, Result.Result); end return; - when 7 => -- initialize + when 8 => -- initialize return Result : LSP.Client_Responses.Initialize.Response do Read_Initialize (Input, Result.Id, Result.Result); end return; - when 8 => -- inlayHint/resolve + when 9 => -- inlayHint/resolve return Result : LSP.Client_Responses.Inlay_Resolve.Response do Read_Inlay_Resolve (Input, Result.Id, Result.Result); end return; - when 9 => -- shutdown + when 10 => -- shutdown return Result : LSP.Client_Responses.Shutdown.Response do Read_Shutdown (Input, Result.Id, Result.Result); end return; - when 10 => -- textDocument/codeAction + when 11 => -- textDocument/codeAction return Result : LSP.Client_Responses.CodeAction.Response do Read_CodeAction (Input, Result.Id, Result.Result); end return; - when 11 => -- textDocument/codeLens + when 12 => -- textDocument/codeLens return Result : LSP.Client_Responses.CodeLens.Response do Read_CodeLens (Input, Result.Id, Result.Result); end return; - when 12 => -- textDocument/colorPresentation + when 13 => -- textDocument/colorPresentation return Result : LSP.Client_Responses.ColorPresentation.Response do Read_ColorPresentation (Input, Result.Id, Result.Result); end return; - when 13 => -- textDocument/completion + when 14 => -- textDocument/completion return Result : LSP.Client_Responses.Completion.Response do Read_Completion (Input, Result.Id, Result.Result); end return; - when 14 => -- textDocument/declaration + when 15 => -- textDocument/declaration return Result : LSP.Client_Responses.Declaration.Response do Read_Declaration (Input, Result.Id, Result.Result); end return; - when 15 => -- textDocument/definition + when 16 => -- textDocument/definition return Result : LSP.Client_Responses.Definition.Response do Read_Definition (Input, Result.Id, Result.Result); end return; - when 16 => -- textDocument/diagnostic + when 17 => -- textDocument/diagnostic return Result : LSP.Client_Responses.Diagnostic.Response do Read_Diagnostic (Input, Result.Id, Result.Result); end return; - when 17 => -- textDocument/documentColor + when 18 => -- textDocument/documentColor return Result : LSP.Client_Responses.DocumentColor.Response do Read_DocumentColor (Input, Result.Id, Result.Result); end return; - when 18 => -- textDocument/documentHighlight + when 19 => -- textDocument/documentHighlight return Result : LSP.Client_Responses.DocumentHighlight.Response do Read_DocumentHighlight (Input, Result.Id, Result.Result); end return; - when 19 => -- textDocument/documentLink + when 20 => -- textDocument/documentLink return Result : LSP.Client_Responses.DocumentLink.Response do Read_DocumentLink (Input, Result.Id, Result.Result); end return; - when 20 => -- textDocument/documentSymbol + when 21 => -- textDocument/documentSymbol return Result : LSP.Client_Responses.DocumentSymbol.Response do Read_DocumentSymbol (Input, Result.Id, Result.Result); end return; - when 21 => -- textDocument/foldingRange + when 22 => -- textDocument/foldingRange return Result : LSP.Client_Responses.FoldingRange.Response do Read_FoldingRange (Input, Result.Id, Result.Result); end return; - when 22 => -- textDocument/formatting + when 23 => -- textDocument/formatting return Result : LSP.Client_Responses.Formatting.Response do Read_Formatting (Input, Result.Id, Result.Result); end return; - when 23 => -- textDocument/hover + when 24 => -- textDocument/hover return Result : LSP.Client_Responses.Hover.Response do Read_Hover (Input, Result.Id, Result.Result); end return; - when 24 => -- textDocument/implementation + when 25 => -- textDocument/implementation return Result : LSP.Client_Responses.Implementation.Response do Read_Implementation (Input, Result.Id, Result.Result); end return; - when 25 => -- textDocument/inlayHint + when 26 => -- textDocument/inlayHint return Result : LSP.Client_Responses.InlayHint.Response do Read_InlayHint (Input, Result.Id, Result.Result); end return; - when 26 => -- textDocument/inlineValue + when 27 => -- textDocument/inlineValue return Result : LSP.Client_Responses.InlineValue.Response do Read_InlineValue (Input, Result.Id, Result.Result); end return; - when 27 => -- textDocument/linkedEditingRange + when 28 => -- textDocument/linkedEditingRange return Result : LSP.Client_Responses.LinkedEditingRange.Response do Read_LinkedEditingRange (Input, Result.Id, Result.Result); end return; - when 28 => -- textDocument/moniker + when 29 => -- textDocument/moniker return Result : LSP.Client_Responses.Moniker.Response do Read_Moniker (Input, Result.Id, Result.Result); end return; - when 29 => -- textDocument/onTypeFormatting + when 30 => -- textDocument/onTypeFormatting return Result : LSP.Client_Responses.OnTypeFormatting.Response do Read_OnTypeFormatting (Input, Result.Id, Result.Result); end return; - when 30 => -- textDocument/prepareCallHierarchy + when 31 => -- textDocument/prepareCallHierarchy return Result : LSP.Client_Responses.PrepareCallHierarchy.Response do Read_PrepareCallHierarchy (Input, Result.Id, Result.Result); end return; - when 31 => -- textDocument/prepareRename + when 32 => -- textDocument/prepareRename return Result : LSP.Client_Responses.PrepareRename.Response do Read_PrepareRename (Input, Result.Id, Result.Result); end return; - when 32 => -- textDocument/prepareTypeHierarchy + when 33 => -- textDocument/prepareTypeHierarchy return Result : LSP.Client_Responses.PrepareTypeHierarchy.Response do Read_PrepareTypeHierarchy (Input, Result.Id, Result.Result); end return; - when 33 => -- textDocument/rangeFormatting + when 34 => -- textDocument/rangeFormatting return Result : LSP.Client_Responses.RangeFormatting.Response do Read_RangeFormatting (Input, Result.Id, Result.Result); end return; - when 34 => -- textDocument/references + when 35 => -- textDocument/references return Result : LSP.Client_Responses.References.Response do Read_References (Input, Result.Id, Result.Result); end return; - when 35 => -- textDocument/rename + when 36 => -- textDocument/rename return Result : LSP.Client_Responses.Rename.Response do Read_Rename (Input, Result.Id, Result.Result); end return; - when 36 => -- textDocument/selectionRange + when 37 => -- textDocument/selectionRange return Result : LSP.Client_Responses.SelectionRange.Response do Read_SelectionRange (Input, Result.Id, Result.Result); end return; - when 37 => -- textDocument/semanticTokens/full + when 38 => -- textDocument/semanticTokens/full return Result : LSP.Client_Responses.Tokens_Full.Response do Read_Tokens_Full (Input, Result.Id, Result.Result); end return; - when 38 => -- textDocument/semanticTokens/full/delta + when 39 => -- textDocument/semanticTokens/full/delta return Result : LSP.Client_Responses.Tokens_Delta.Response do Read_Tokens_Delta (Input, Result.Id, Result.Result); end return; - when 39 => -- textDocument/semanticTokens/range + when 40 => -- textDocument/semanticTokens/range return Result : LSP.Client_Responses.Tokens_Range.Response do Read_Tokens_Range (Input, Result.Id, Result.Result); end return; - when 40 => -- textDocument/signatureHelp + when 41 => -- textDocument/signatureHelp return Result : LSP.Client_Responses.SignatureHelp.Response do Read_SignatureHelp (Input, Result.Id, Result.Result); end return; - when 41 => -- textDocument/typeDefinition + when 42 => -- textDocument/typeDefinition return Result : LSP.Client_Responses.TypeDefinition.Response do Read_TypeDefinition (Input, Result.Id, Result.Result); end return; - when 42 => -- textDocument/willSaveWaitUntil + when 43 => -- textDocument/willSaveWaitUntil return Result : LSP.Client_Responses.WillSaveWaitUntil.Response do Read_WillSaveWaitUntil (Input, Result.Id, Result.Result); end return; - when 43 => -- typeHierarchy/subtypes + when 44 => -- typeHierarchy/subtypes return Result : LSP.Client_Responses.Subtypes.Response do Read_Subtypes (Input, Result.Id, Result.Result); end return; - when 44 => -- typeHierarchy/supertypes + when 45 => -- typeHierarchy/supertypes return Result : LSP.Client_Responses.Supertypes.Response do Read_Supertypes (Input, Result.Id, Result.Result); end return; - when 45 => -- workspace/diagnostic + when 46 => -- workspace/diagnostic return Result : LSP.Client_Responses.Workspace_Diagnostic.Response do Read_Workspace_Diagnostic (Input, Result.Id, Result.Result); end return; - when 46 => -- workspace/executeCommand + when 47 => -- workspace/executeCommand return Result : LSP.Client_Responses.ExecuteCommand.Response do Read_ExecuteCommand (Input, Result.Id, Result.Result); end return; - when 47 => -- workspace/symbol + when 48 => -- workspace/symbol return Result : LSP.Client_Responses.Symbol.Response do Read_Symbol (Input, Result.Id, Result.Result); end return; - when 48 => -- workspace/willCreateFiles + when 49 => -- workspace/willCreateFiles return Result : LSP.Client_Responses.WillCreateFiles.Response do Read_WillCreateFiles (Input, Result.Id, Result.Result); end return; - when 49 => -- workspace/willDeleteFiles + when 50 => -- workspace/willDeleteFiles return Result : LSP.Client_Responses.WillDeleteFiles.Response do Read_WillDeleteFiles (Input, Result.Id, Result.Result); end return; - when 50 => -- workspace/willRenameFiles + when 51 => -- workspace/willRenameFiles return Result : LSP.Client_Responses.WillRenameFiles.Response do Read_WillRenameFiles (Input, Result.Id, Result.Result); end return; - when 51 => -- workspaceSymbol/resolve + when 52 => -- workspaceSymbol/resolve return Result : LSP.Client_Responses.Symbol_Resolve.Response do Read_Symbol_Resolve (Input, Result.Id, Result.Result); end return; diff --git a/source/lsp_3.17/generated/lsp-client_response_receivers.ads b/source/lsp_3.17/generated/lsp-client_response_receivers.ads index e39cb47f5..cc50da3e2 100644 --- a/source/lsp_3.17/generated/lsp-client_response_receivers.ads +++ b/source/lsp_3.17/generated/lsp-client_response_receivers.ads @@ -14,6 +14,12 @@ package LSP.Client_Response_Receivers is type Client_Response_Receiver is limited interface; + procedure On_AlsCheckSyntax_Response + (Self : in out Client_Response_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.AlsCheckSyntaxResult) is null; + -- query if a given input has a valid syntax according to a set of rules. + procedure On_IncomingCalls_Response (Self : in out Client_Response_Receiver; Id : LSP.Structures.Integer_Or_Virtual_String; diff --git a/source/lsp_3.17/generated/lsp-client_response_writers.adb b/source/lsp_3.17/generated/lsp-client_response_writers.adb index d5a1eb573..17efe31be 100644 --- a/source/lsp_3.17/generated/lsp-client_response_writers.adb +++ b/source/lsp_3.17/generated/lsp-client_response_writers.adb @@ -13,6 +13,17 @@ with LSP.Outputs; package body LSP.Client_Response_Writers is + overriding procedure On_AlsCheckSyntax_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.AlsCheckSyntaxResult) is + begin + LSP.Output_Tools.Write_Start_Response (Self.Output.all, Id); + Self.Output.Key_Name ("result"); + LSP.Outputs.Write_AlsCheckSyntaxResult (Self.Output.all, Value); + Self.Output.End_Object; + end On_AlsCheckSyntax_Response; + overriding procedure On_IncomingCalls_Response (Self : in out Client_Response_Writer; Id : LSP.Structures.Integer_Or_Virtual_String; diff --git a/source/lsp_3.17/generated/lsp-client_response_writers.ads b/source/lsp_3.17/generated/lsp-client_response_writers.ads index 245aab16a..8a985956a 100644 --- a/source/lsp_3.17/generated/lsp-client_response_writers.ads +++ b/source/lsp_3.17/generated/lsp-client_response_writers.ads @@ -19,6 +19,11 @@ package LSP.Client_Response_Writers is (Output : access VSS.JSON.Content_Handlers.JSON_Content_Handler'Class) is new LSP.Client_Response_Receivers.Client_Response_Receiver with null record; + overriding procedure On_AlsCheckSyntax_Response + (Self : in out Client_Response_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.AlsCheckSyntaxResult); + overriding procedure On_IncomingCalls_Response (Self : in out Client_Response_Writer; Id : LSP.Structures.Integer_Or_Virtual_String; diff --git a/source/lsp_3.17/generated/lsp-client_responses-alschecksyntax.adb b/source/lsp_3.17/generated/lsp-client_responses-alschecksyntax.adb new file mode 100644 index 000000000..32dc35a3f --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-alschecksyntax.adb @@ -0,0 +1,19 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- + +package body LSP.Client_Responses.AlsCheckSyntax is + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class) is + begin + Value.On_AlsCheckSyntax_Response (Self.Id, Self.Result); + end Visit_Client_Receiver; + +end LSP.Client_Responses.AlsCheckSyntax; diff --git a/source/lsp_3.17/generated/lsp-client_responses-alschecksyntax.ads b/source/lsp_3.17/generated/lsp-client_responses-alschecksyntax.ads new file mode 100644 index 000000000..097f235da --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_responses-alschecksyntax.ads @@ -0,0 +1,23 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- + +with LSP.Structures; + +package LSP.Client_Responses.AlsCheckSyntax is + pragma Preelaborate; + + type Response is new LSP.Client_Responses.Client_Response with record + Result : LSP.Structures.AlsCheckSyntaxResult; + end record; + + overriding procedure Visit_Client_Receiver + (Self : Response; + Value : in out LSP.Client_Response_Receivers.Client_Response_Receiver' + Class); + +end LSP.Client_Responses.AlsCheckSyntax; diff --git a/source/lsp_3.17/generated/lsp-enumerations.ads b/source/lsp_3.17/generated/lsp-enumerations.ads index a02b425a3..fda6c60d1 100644 --- a/source/lsp_3.17/generated/lsp-enumerations.ads +++ b/source/lsp_3.17/generated/lsp-enumerations.ads @@ -9,10 +9,18 @@ package LSP.Enumerations is pragma Preelaborate; + type AlsDisplayMethodAncestryOnNavigationPolicy is + (Never, Usage_And_Abstract_Only, Definition_Only, Always); + type AlsReferenceKind is (reference, an_access, write, call, dispatching_call, parent, child, an_overriding); + type AlsSearchKind is + (Full_Text, Regexp, Fuzzy, Approximate, Start_Word_Text); + + type AlsVisibility is (Als_Public, Als_Protected, Als_Private); + type CodeActionKind is (Empty, QuickFix, Refactor, RefactorExtract, RefactorInline, RefactorRewrite, Source, SourceOrganizeImports, SourceFixAll); diff --git a/source/lsp_3.17/generated/lsp-inputs.adb b/source/lsp_3.17/generated/lsp-inputs.adb index 5c1004e17..b8cafa3d3 100644 --- a/source/lsp_3.17/generated/lsp-inputs.adb +++ b/source/lsp_3.17/generated/lsp-inputs.adb @@ -782,6 +782,10 @@ package body LSP.Inputs is (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; Value : out LSP.Structures.Moniker); + procedure Read_AlsDisplayMethodAncestryOnNavigationPolicy + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.AlsDisplayMethodAncestryOnNavigationPolicy); + procedure Read_DiagnosticWorkspaceClientCapabilities (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; Value : out LSP.Structures.DiagnosticWorkspaceClientCapabilities); @@ -806,6 +810,10 @@ package body LSP.Inputs is (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; Value : out LSP.Structures.WorkspaceEdit); + procedure Read_AlsVisibility + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.AlsVisibility); + procedure Read_DocumentHighlight (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; Value : out LSP.Structures.DocumentHighlight); @@ -1159,6 +1167,10 @@ package body LSP.Inputs is (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; Value : out LSP.Structures.InlineValueWorkspaceClientCapabilities); + procedure Read_AlsSearchKind + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.AlsSearchKind); + procedure Read_ResourceOperation (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; Value : out LSP.Structures.ResourceOperation); @@ -2950,7 +2962,10 @@ package body LSP.Inputs is "detail", "range", "selectionRange", - "children"]); + "children", + "alsIsDeclaration", + "alsIsAdaProcedure", + "alsVisibility"]); end DocumentSymbol_Progress_Report_Scope; @@ -3012,6 +3027,21 @@ package body LSP.Inputs is (Kind => LSP.Structures.Variant_2, others => <>); exit; + when 7 => -- alsIsDeclaration + Value := + (Kind => LSP.Structures.Variant_2, + others => <>); + exit; + when 8 => -- alsIsAdaProcedure + Value := + (Kind => LSP.Structures.Variant_2, + others => <>); + exit; + when 9 => -- alsVisibility + Value := + (Kind => LSP.Structures.Variant_2, + others => <>); + exit; when others => Handler.Skip_Current_Value; end case; @@ -10715,7 +10745,8 @@ package body LSP.Inputs is (["textDocument", "position", "workDoneToken", - "partialResultToken"]); + "partialResultToken", + "alsDisplayMethodAncestryOnNavigation"]); end DefinitionParams_Scope; @@ -10748,6 +10779,13 @@ package body LSP.Inputs is (Is_Set => True, Value => <>); Read_ProgressToken (Handler, Value.partialResultToken.Value); + when 5 => -- alsDisplayMethodAncestryOnNavigation + Value.alsDisplayMethodAncestryOnNavigation := + (Is_Set => True, + Value => <>); + Read_AlsDisplayMethodAncestryOnNavigationPolicy + (Handler, + Value.alsDisplayMethodAncestryOnNavigation.Value); when others => Handler.Skip_Current_Value; end case; @@ -12491,7 +12529,8 @@ package body LSP.Inputs is (["textDocument", "position", "workDoneToken", - "partialResultToken"]); + "partialResultToken", + "alsDisplayMethodAncestryOnNavigation"]); end DeclarationParams_Scope; @@ -12524,6 +12563,13 @@ package body LSP.Inputs is (Is_Set => True, Value => <>); Read_ProgressToken (Handler, Value.partialResultToken.Value); + when 5 => -- alsDisplayMethodAncestryOnNavigation + Value.alsDisplayMethodAncestryOnNavigation := + (Is_Set => True, + Value => <>); + Read_AlsDisplayMethodAncestryOnNavigationPolicy + (Handler, + Value.alsDisplayMethodAncestryOnNavigation.Value); when others => Handler.Skip_Current_Value; end case; @@ -14452,6 +14498,40 @@ package body LSP.Inputs is Handler.Read_Next; end Read_DefinitionRegistrationOptions; + package AlsCheckSyntaxResult_Scope is + package AlsCheckSyntaxResult_Map is new Minimal_Perfect_Hash + (["diagnostic"]); + + end AlsCheckSyntaxResult_Scope; + + procedure Read_AlsCheckSyntaxResult + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.AlsCheckSyntaxResult) is + use AlsCheckSyntaxResult_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case AlsCheckSyntaxResult_Map.Get_Index (Key) is + when 1 => -- diagnostic + Value.diagnostic.Clear; + Value.diagnostic.Append (Handler.String_Value); + Handler.Read_Next; + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_AlsCheckSyntaxResult; + package clientInfo_Of_InitializeParams_Scope is package clientInfo_Of_InitializeParams_Map is new Minimal_Perfect_Hash (["name", @@ -16066,6 +16146,25 @@ package body LSP.Inputs is Handler.Read_Next; end Read_WorkDoneProgressBegin; + package AlsDisplayMethodAncestryOnNavigationPolicy_Map is new Minimal_Perfect_Hash + (["Never", + "Usage_And_Abstract_Only", + "Definition_Only", + "Always"]); + + procedure Read_AlsDisplayMethodAncestryOnNavigationPolicy + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations + .AlsDisplayMethodAncestryOnNavigationPolicy) is + begin + Value := + LSP.Enumerations.AlsDisplayMethodAncestryOnNavigationPolicy'Val + (AlsDisplayMethodAncestryOnNavigationPolicy_Map.Get_Index + (Handler.String_Value) - + 1); + Handler.Read_Next; + end Read_AlsDisplayMethodAncestryOnNavigationPolicy; + package DiagnosticWorkspaceClientCapabilities_Scope is package DiagnosticWorkspaceClientCapabilities_Map is new Minimal_Perfect_Hash (["refreshSupport"]); @@ -16526,6 +16625,16 @@ package body LSP.Inputs is Handler.Read_Next; end Read_WorkspaceEdit; + procedure Read_AlsVisibility + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.AlsVisibility) is + begin + Value := + LSP.Enumerations.AlsVisibility'Val + (Handler.Number_Value.Integer_Value - 1); + Handler.Read_Next; + end Read_AlsVisibility; + package DocumentHighlight_Scope is package DocumentHighlight_Map is new Minimal_Perfect_Hash (["range", @@ -19557,7 +19666,11 @@ package body LSP.Inputs is package DocumentSymbolParams_Map is new Minimal_Perfect_Hash (["workDoneToken", "partialResultToken", - "textDocument"]); + "textDocument", + "case_sensitive", + "whole_word", + "negate", + "kind"]); end DocumentSymbolParams_Scope; @@ -19588,6 +19701,29 @@ package body LSP.Inputs is Read_ProgressToken (Handler, Value.partialResultToken.Value); when 3 => -- textDocument Read_TextDocumentIdentifier (Handler, Value.textDocument); + when 4 => -- case_sensitive + Value.case_sensitive := + (Is_Set => True, + Value => <>); + Value.case_sensitive.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 5 => -- whole_word + Value.whole_word := + (Is_Set => True, + Value => <>); + Value.whole_word.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 6 => -- negate + Value.negate := + (Is_Set => True, + Value => <>); + Value.negate.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 7 => -- kind + Value.kind := + (Is_Set => True, + Value => <>); + Read_AlsSearchKind (Handler, Value.kind.Value); when others => Handler.Skip_Current_Value; end case; @@ -20705,7 +20841,10 @@ package body LSP.Inputs is "detail", "range", "selectionRange", - "children"]); + "children", + "alsIsDeclaration", + "alsIsAdaProcedure", + "alsVisibility"]); end DocumentSymbol_Result_Scope; @@ -20771,6 +20910,21 @@ package body LSP.Inputs is (Kind => LSP.Structures.Variant_2, others => <>); exit; + when 7 => -- alsIsDeclaration + Value := + (Kind => LSP.Structures.Variant_2, + others => <>); + exit; + when 8 => -- alsIsAdaProcedure + Value := + (Kind => LSP.Structures.Variant_2, + others => <>); + exit; + when 9 => -- alsVisibility + Value := + (Kind => LSP.Structures.Variant_2, + others => <>); + exit; when others => Handler.Skip_Current_Value; end case; @@ -21230,6 +21384,43 @@ package body LSP.Inputs is Handler.Read_Next; end Read_SymbolTag; + package AlsCheckSyntaxParams_Scope is + package AlsCheckSyntaxParams_Map is new Minimal_Perfect_Hash + (["input", + "rules"]); + + end AlsCheckSyntaxParams_Scope; + + procedure Read_AlsCheckSyntaxParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.AlsCheckSyntaxParams) is + use AlsCheckSyntaxParams_Scope; + begin + pragma Assert (Handler.Is_Start_Object); + Handler.Read_Next; + + while not Handler.Is_End_Object loop + pragma Assert (Handler.Is_Key_Name); + declare + Key : constant VSS.Strings.Virtual_String := Handler.Key_Name; + begin + Handler.Read_Next; + case AlsCheckSyntaxParams_Map.Get_Index (Key) is + when 1 => -- input + Value.input.Clear; + Value.input.Append (Handler.String_Value); + Handler.Read_Next; + when 2 => -- rules + Read_Virtual_String_Vector (Handler, Value.rules); + when others => + Handler.Skip_Current_Value; + end case; + end; + end loop; + + Handler.Read_Next; + end Read_AlsCheckSyntaxParams; + package Registration_Scope is package Registration_Map is new Minimal_Perfect_Hash (["id", @@ -21650,7 +21841,10 @@ package body LSP.Inputs is "deprecated", "range", "selectionRange", - "children"]); + "children", + "alsIsDeclaration", + "alsIsAdaProcedure", + "alsVisibility"]); end DocumentSymbol_Scope; @@ -21693,6 +21887,23 @@ package body LSP.Inputs is Read_A_Range (Handler, Value.selectionRange); when 8 => -- children Read_DocumentSymbol_Vector (Handler, Value.children); + when 9 => -- alsIsDeclaration + Value.alsIsDeclaration := + (Is_Set => True, + Value => <>); + Value.alsIsDeclaration.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 10 => -- alsIsAdaProcedure + Value.alsIsAdaProcedure := + (Is_Set => True, + Value => <>); + Value.alsIsAdaProcedure.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 11 => -- alsVisibility + Value.alsVisibility := + (Is_Set => True, + Value => <>); + Read_AlsVisibility (Handler, Value.alsVisibility.Value); when others => Handler.Skip_Current_Value; end case; @@ -22156,6 +22367,16 @@ package body LSP.Inputs is Handler.Read_Next; end Read_InlineValueWorkspaceClientCapabilities; + procedure Read_AlsSearchKind + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Enumerations.AlsSearchKind) is + begin + Value := + LSP.Enumerations.AlsSearchKind'Val + (Handler.Number_Value.Integer_Value - 1); + Handler.Read_Next; + end Read_AlsSearchKind; + package ResourceOperation_Scope is package ResourceOperation_Map is new Minimal_Perfect_Hash (["kind", @@ -23571,7 +23792,8 @@ package body LSP.Inputs is (["textDocument", "position", "workDoneToken", - "partialResultToken"]); + "partialResultToken", + "alsDisplayMethodAncestryOnNavigation"]); end ImplementationParams_Scope; @@ -23604,6 +23826,13 @@ package body LSP.Inputs is (Is_Set => True, Value => <>); Read_ProgressToken (Handler, Value.partialResultToken.Value); + when 5 => -- alsDisplayMethodAncestryOnNavigation + Value.alsDisplayMethodAncestryOnNavigation := + (Is_Set => True, + Value => <>); + Read_AlsDisplayMethodAncestryOnNavigationPolicy + (Handler, + Value.alsDisplayMethodAncestryOnNavigation.Value); when others => Handler.Skip_Current_Value; end case; diff --git a/source/lsp_3.17/generated/lsp-inputs.ads b/source/lsp_3.17/generated/lsp-inputs.ads index f0ad86f96..90385e666 100644 --- a/source/lsp_3.17/generated/lsp-inputs.ads +++ b/source/lsp_3.17/generated/lsp-inputs.ads @@ -316,6 +316,10 @@ package LSP.Inputs is (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; Value : out LSP.Structures.DidChangeWorkspaceFoldersParams); + procedure Read_AlsCheckSyntaxResult + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.AlsCheckSyntaxResult); + procedure Read_CodeLensParams (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; Value : out LSP.Structures.CodeLensParams); @@ -537,6 +541,10 @@ package LSP.Inputs is (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; Value : out LSP.Structures.Definition_Result); + procedure Read_AlsCheckSyntaxParams + (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; + Value : out LSP.Structures.AlsCheckSyntaxParams); + procedure Read_CompletionItem (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; Value : out LSP.Structures.CompletionItem); diff --git a/source/lsp_3.17/generated/lsp-outputs.adb b/source/lsp_3.17/generated/lsp-outputs.adb index ccdeece8b..dc77f2ddd 100644 --- a/source/lsp_3.17/generated/lsp-outputs.adb +++ b/source/lsp_3.17/generated/lsp-outputs.adb @@ -779,6 +779,10 @@ package body LSP.Outputs is (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; Value : LSP.Structures.Moniker); + procedure Write_AlsDisplayMethodAncestryOnNavigationPolicy + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.AlsDisplayMethodAncestryOnNavigationPolicy); + procedure Write_DiagnosticWorkspaceClientCapabilities (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; Value : LSP.Structures.DiagnosticWorkspaceClientCapabilities); @@ -803,6 +807,10 @@ package body LSP.Outputs is (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; Value : LSP.Structures.WorkspaceEdit); + procedure Write_AlsVisibility + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.AlsVisibility); + procedure Write_DocumentHighlight (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; Value : LSP.Structures.DocumentHighlight); @@ -1156,6 +1164,10 @@ package body LSP.Outputs is (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; Value : LSP.Structures.InlineValueWorkspaceClientCapabilities); + procedure Write_AlsSearchKind + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.AlsSearchKind); + procedure Write_ResourceOperation (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; Value : LSP.Structures.ResourceOperation); @@ -5557,6 +5569,11 @@ package body LSP.Outputs is Handler.Key_Name ("partialResultToken"); Write_ProgressToken (Handler, Value.partialResultToken.Value); end if; + if Value.alsDisplayMethodAncestryOnNavigation.Is_Set then + Handler.Key_Name ("alsDisplayMethodAncestryOnNavigation"); + Write_AlsDisplayMethodAncestryOnNavigationPolicy + (Handler, Value.alsDisplayMethodAncestryOnNavigation.Value); + end if; Handler.End_Object; end Write_DefinitionParams; @@ -6336,6 +6353,11 @@ package body LSP.Outputs is Handler.Key_Name ("partialResultToken"); Write_ProgressToken (Handler, Value.partialResultToken.Value); end if; + if Value.alsDisplayMethodAncestryOnNavigation.Is_Set then + Handler.Key_Name ("alsDisplayMethodAncestryOnNavigation"); + Write_AlsDisplayMethodAncestryOnNavigationPolicy + (Handler, Value.alsDisplayMethodAncestryOnNavigation.Value); + end if; Handler.End_Object; end Write_DeclarationParams; @@ -7193,6 +7215,18 @@ package body LSP.Outputs is Handler.End_Object; end Write_DefinitionRegistrationOptions; + procedure Write_AlsCheckSyntaxResult + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.AlsCheckSyntaxResult) is + begin + Handler.Start_Object; + if not Value.diagnostic.Is_Null then + Handler.Key_Name ("diagnostic"); + Handler.String_Value (Value.diagnostic); + end if; + Handler.End_Object; + end Write_AlsCheckSyntaxResult; + procedure Write_clientInfo_Of_InitializeParams (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; Value : LSP.Structures.clientInfo_Of_InitializeParams) is @@ -7828,6 +7862,22 @@ package body LSP.Outputs is Handler.End_Object; end Write_WorkDoneProgressBegin; + procedure Write_AlsDisplayMethodAncestryOnNavigationPolicy + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.AlsDisplayMethodAncestryOnNavigationPolicy) is + begin + case Value is + when LSP.Enumerations.Never => + Handler.String_Value ("Never"); + when LSP.Enumerations.Usage_And_Abstract_Only => + Handler.String_Value ("Usage_And_Abstract_Only"); + when LSP.Enumerations.Definition_Only => + Handler.String_Value ("Definition_Only"); + when LSP.Enumerations.Always => + Handler.String_Value ("Always"); + end case; + end Write_AlsDisplayMethodAncestryOnNavigationPolicy; + procedure Write_DiagnosticWorkspaceClientCapabilities (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; Value : LSP.Structures.DiagnosticWorkspaceClientCapabilities) is @@ -8032,6 +8082,20 @@ package body LSP.Outputs is Handler.End_Object; end Write_WorkspaceEdit; + procedure Write_AlsVisibility + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.AlsVisibility) is + begin + case Value is + when LSP.Enumerations.Als_Public => + Handler.Integer_Value (1); + when LSP.Enumerations.Als_Protected => + Handler.Integer_Value (2); + when LSP.Enumerations.Als_Private => + Handler.Integer_Value (3); + end case; + end Write_AlsVisibility; + procedure Write_DocumentHighlight (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; Value : LSP.Structures.DocumentHighlight) is @@ -9395,6 +9459,22 @@ package body LSP.Outputs is end if; Handler.Key_Name ("textDocument"); Write_TextDocumentIdentifier (Handler, Value.textDocument); + if Value.case_sensitive.Is_Set then + Handler.Key_Name ("case_sensitive"); + Handler.Boolean_Value (Value.case_sensitive.Value); + end if; + if Value.whole_word.Is_Set then + Handler.Key_Name ("whole_word"); + Handler.Boolean_Value (Value.whole_word.Value); + end if; + if Value.negate.Is_Set then + Handler.Key_Name ("negate"); + Handler.Boolean_Value (Value.negate.Value); + end if; + if Value.kind.Is_Set then + Handler.Key_Name ("kind"); + Write_AlsSearchKind (Handler, Value.kind.Value); + end if; Handler.End_Object; end Write_DocumentSymbolParams; @@ -10068,6 +10148,18 @@ package body LSP.Outputs is end case; end Write_SymbolTag; + procedure Write_AlsCheckSyntaxParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.AlsCheckSyntaxParams) is + begin + Handler.Start_Object; + Handler.Key_Name ("input"); + Handler.String_Value (Value.input); + Handler.Key_Name ("rules"); + Write_Virtual_String_Vector (Handler, Value.rules); + Handler.End_Object; + end Write_AlsCheckSyntaxParams; + procedure Write_Registration (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; Value : LSP.Structures.Registration) is @@ -10284,6 +10376,18 @@ package body LSP.Outputs is Handler.Key_Name ("children"); Write_DocumentSymbol_Vector (Handler, Value.children); end if; + if Value.alsIsDeclaration.Is_Set then + Handler.Key_Name ("alsIsDeclaration"); + Handler.Boolean_Value (Value.alsIsDeclaration.Value); + end if; + if Value.alsIsAdaProcedure.Is_Set then + Handler.Key_Name ("alsIsAdaProcedure"); + Handler.Boolean_Value (Value.alsIsAdaProcedure.Value); + end if; + if Value.alsVisibility.Is_Set then + Handler.Key_Name ("alsVisibility"); + Write_AlsVisibility (Handler, Value.alsVisibility.Value); + end if; Handler.End_Object; end Write_DocumentSymbol; @@ -10495,6 +10599,24 @@ package body LSP.Outputs is Handler.End_Object; end Write_InlineValueWorkspaceClientCapabilities; + procedure Write_AlsSearchKind + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Enumerations.AlsSearchKind) is + begin + case Value is + when LSP.Enumerations.Full_Text => + Handler.Integer_Value (1); + when LSP.Enumerations.Regexp => + Handler.Integer_Value (2); + when LSP.Enumerations.Fuzzy => + Handler.Integer_Value (3); + when LSP.Enumerations.Approximate => + Handler.Integer_Value (4); + when LSP.Enumerations.Start_Word_Text => + Handler.Integer_Value (5); + end case; + end Write_AlsSearchKind; + procedure Write_ResourceOperation (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; Value : LSP.Structures.ResourceOperation) is @@ -11141,6 +11263,11 @@ package body LSP.Outputs is Handler.Key_Name ("partialResultToken"); Write_ProgressToken (Handler, Value.partialResultToken.Value); end if; + if Value.alsDisplayMethodAncestryOnNavigation.Is_Set then + Handler.Key_Name ("alsDisplayMethodAncestryOnNavigation"); + Write_AlsDisplayMethodAncestryOnNavigationPolicy + (Handler, Value.alsDisplayMethodAncestryOnNavigation.Value); + end if; Handler.End_Object; end Write_ImplementationParams; diff --git a/source/lsp_3.17/generated/lsp-outputs.ads b/source/lsp_3.17/generated/lsp-outputs.ads index 830092259..c5579452a 100644 --- a/source/lsp_3.17/generated/lsp-outputs.ads +++ b/source/lsp_3.17/generated/lsp-outputs.ads @@ -318,6 +318,10 @@ package LSP.Outputs is (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; Value : LSP.Structures.DidChangeWorkspaceFoldersParams); + procedure Write_AlsCheckSyntaxResult + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.AlsCheckSyntaxResult); + procedure Write_CodeLensParams (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; Value : LSP.Structures.CodeLensParams); @@ -539,6 +543,10 @@ package LSP.Outputs is (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; Value : LSP.Structures.Definition_Result); + procedure Write_AlsCheckSyntaxParams + (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; + Value : LSP.Structures.AlsCheckSyntaxParams); + procedure Write_CompletionItem (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; Value : LSP.Structures.CompletionItem); diff --git a/source/lsp_3.17/generated/lsp-server_request_readers.adb b/source/lsp_3.17/generated/lsp-server_request_readers.adb index 75592bcdc..69e9a6ca1 100644 --- a/source/lsp_3.17/generated/lsp-server_request_readers.adb +++ b/source/lsp_3.17/generated/lsp-server_request_readers.adb @@ -11,6 +11,7 @@ with LSP.Inputs; with LSP.Input_Tools; with LSP.Structures; +with LSP.Server_Requests.AlsCheckSyntax; with LSP.Server_Requests.IncomingCalls; with LSP.Server_Requests.OutgoingCalls; with LSP.Server_Requests.Code_Action_Resolve; @@ -66,7 +67,8 @@ with LSP.Server_Requests.Symbol_Resolve; package body LSP.Server_Request_Readers is package Method_Map is new Minimal_Perfect_Hash - (["callHierarchy/incomingCalls", + (["$/alsCheckSyntax", + "callHierarchy/incomingCalls", "callHierarchy/outgoingCalls", "codeAction/resolve", "codeLens/resolve", @@ -123,6 +125,10 @@ package body LSP.Server_Request_Readers is Method_Map.Initialize; end Initialize; + procedure Read_AlsCheckSyntax is new LSP.Input_Tools.Read_Request + (LSP.Structures.AlsCheckSyntaxParams, "$/alsCheckSyntax", + LSP.Inputs.Read_AlsCheckSyntaxParams); + procedure Read_IncomingCalls is new LSP.Input_Tools.Read_Request (LSP.Structures.CallHierarchyIncomingCallsParams, "callHierarchy/incomingCalls", @@ -350,257 +356,262 @@ package body LSP.Server_Request_Readers is Index : constant Natural := Method_Map.Get_Index (Method); begin case Index is - when 1 => -- callHierarchy/incomingCalls + when 1 => -- $/alsCheckSyntax + return Result : LSP.Server_Requests.AlsCheckSyntax.Request do + Read_AlsCheckSyntax (Input, Result.Id, Result.Params); + end return; + + when 2 => -- callHierarchy/incomingCalls return Result : LSP.Server_Requests.IncomingCalls.Request do Read_IncomingCalls (Input, Result.Id, Result.Params); end return; - when 2 => -- callHierarchy/outgoingCalls + when 3 => -- callHierarchy/outgoingCalls return Result : LSP.Server_Requests.OutgoingCalls.Request do Read_OutgoingCalls (Input, Result.Id, Result.Params); end return; - when 3 => -- codeAction/resolve + when 4 => -- codeAction/resolve return Result : LSP.Server_Requests.Code_Action_Resolve.Request do Read_Code_Action_Resolve (Input, Result.Id, Result.Params); end return; - when 4 => -- codeLens/resolve + when 5 => -- codeLens/resolve return Result : LSP.Server_Requests.Code_Lens_Resolve.Request do Read_Code_Lens_Resolve (Input, Result.Id, Result.Params); end return; - when 5 => -- completionItem/resolve + when 6 => -- completionItem/resolve return Result : LSP.Server_Requests.Completion_Resolve.Request do Read_Completion_Resolve (Input, Result.Id, Result.Params); end return; - when 6 => -- documentLink/resolve + when 7 => -- documentLink/resolve return Result : LSP.Server_Requests.Link_Resolve.Request do Read_Link_Resolve (Input, Result.Id, Result.Params); end return; - when 7 => -- initialize + when 8 => -- initialize return Result : LSP.Server_Requests.Initialize.Request do Read_Initialize (Input, Result.Id, Result.Params); end return; - when 8 => -- inlayHint/resolve + when 9 => -- inlayHint/resolve return Result : LSP.Server_Requests.Inlay_Resolve.Request do Read_Inlay_Resolve (Input, Result.Id, Result.Params); end return; - when 9 => -- shutdown + when 10 => -- shutdown return Result : LSP.Server_Requests.Shutdown.Request do Read_Shutdown (Input, Result.Id); end return; - when 10 => -- textDocument/codeAction + when 11 => -- textDocument/codeAction return Result : LSP.Server_Requests.CodeAction.Request do Read_CodeAction (Input, Result.Id, Result.Params); end return; - when 11 => -- textDocument/codeLens + when 12 => -- textDocument/codeLens return Result : LSP.Server_Requests.CodeLens.Request do Read_CodeLens (Input, Result.Id, Result.Params); end return; - when 12 => -- textDocument/colorPresentation + when 13 => -- textDocument/colorPresentation return Result : LSP.Server_Requests.ColorPresentation.Request do Read_ColorPresentation (Input, Result.Id, Result.Params); end return; - when 13 => -- textDocument/completion + when 14 => -- textDocument/completion return Result : LSP.Server_Requests.Completion.Request do Read_Completion (Input, Result.Id, Result.Params); end return; - when 14 => -- textDocument/declaration + when 15 => -- textDocument/declaration return Result : LSP.Server_Requests.Declaration.Request do Read_Declaration (Input, Result.Id, Result.Params); end return; - when 15 => -- textDocument/definition + when 16 => -- textDocument/definition return Result : LSP.Server_Requests.Definition.Request do Read_Definition (Input, Result.Id, Result.Params); end return; - when 16 => -- textDocument/diagnostic + when 17 => -- textDocument/diagnostic return Result : LSP.Server_Requests.Diagnostic.Request do Read_Diagnostic (Input, Result.Id, Result.Params); end return; - when 17 => -- textDocument/documentColor + when 18 => -- textDocument/documentColor return Result : LSP.Server_Requests.DocumentColor.Request do Read_DocumentColor (Input, Result.Id, Result.Params); end return; - when 18 => -- textDocument/documentHighlight + when 19 => -- textDocument/documentHighlight return Result : LSP.Server_Requests.DocumentHighlight.Request do Read_DocumentHighlight (Input, Result.Id, Result.Params); end return; - when 19 => -- textDocument/documentLink + when 20 => -- textDocument/documentLink return Result : LSP.Server_Requests.DocumentLink.Request do Read_DocumentLink (Input, Result.Id, Result.Params); end return; - when 20 => -- textDocument/documentSymbol + when 21 => -- textDocument/documentSymbol return Result : LSP.Server_Requests.DocumentSymbol.Request do Read_DocumentSymbol (Input, Result.Id, Result.Params); end return; - when 21 => -- textDocument/foldingRange + when 22 => -- textDocument/foldingRange return Result : LSP.Server_Requests.FoldingRange.Request do Read_FoldingRange (Input, Result.Id, Result.Params); end return; - when 22 => -- textDocument/formatting + when 23 => -- textDocument/formatting return Result : LSP.Server_Requests.Formatting.Request do Read_Formatting (Input, Result.Id, Result.Params); end return; - when 23 => -- textDocument/hover + when 24 => -- textDocument/hover return Result : LSP.Server_Requests.Hover.Request do Read_Hover (Input, Result.Id, Result.Params); end return; - when 24 => -- textDocument/implementation + when 25 => -- textDocument/implementation return Result : LSP.Server_Requests.Implementation.Request do Read_Implementation (Input, Result.Id, Result.Params); end return; - when 25 => -- textDocument/inlayHint + when 26 => -- textDocument/inlayHint return Result : LSP.Server_Requests.InlayHint.Request do Read_InlayHint (Input, Result.Id, Result.Params); end return; - when 26 => -- textDocument/inlineValue + when 27 => -- textDocument/inlineValue return Result : LSP.Server_Requests.InlineValue.Request do Read_InlineValue (Input, Result.Id, Result.Params); end return; - when 27 => -- textDocument/linkedEditingRange + when 28 => -- textDocument/linkedEditingRange return Result : LSP.Server_Requests.LinkedEditingRange.Request do Read_LinkedEditingRange (Input, Result.Id, Result.Params); end return; - when 28 => -- textDocument/moniker + when 29 => -- textDocument/moniker return Result : LSP.Server_Requests.Moniker.Request do Read_Moniker (Input, Result.Id, Result.Params); end return; - when 29 => -- textDocument/onTypeFormatting + when 30 => -- textDocument/onTypeFormatting return Result : LSP.Server_Requests.OnTypeFormatting.Request do Read_OnTypeFormatting (Input, Result.Id, Result.Params); end return; - when 30 => -- textDocument/prepareCallHierarchy + when 31 => -- textDocument/prepareCallHierarchy return Result : LSP.Server_Requests.PrepareCallHierarchy.Request do Read_PrepareCallHierarchy (Input, Result.Id, Result.Params); end return; - when 31 => -- textDocument/prepareRename + when 32 => -- textDocument/prepareRename return Result : LSP.Server_Requests.PrepareRename.Request do Read_PrepareRename (Input, Result.Id, Result.Params); end return; - when 32 => -- textDocument/prepareTypeHierarchy + when 33 => -- textDocument/prepareTypeHierarchy return Result : LSP.Server_Requests.PrepareTypeHierarchy.Request do Read_PrepareTypeHierarchy (Input, Result.Id, Result.Params); end return; - when 33 => -- textDocument/rangeFormatting + when 34 => -- textDocument/rangeFormatting return Result : LSP.Server_Requests.RangeFormatting.Request do Read_RangeFormatting (Input, Result.Id, Result.Params); end return; - when 34 => -- textDocument/references + when 35 => -- textDocument/references return Result : LSP.Server_Requests.References.Request do Read_References (Input, Result.Id, Result.Params); end return; - when 35 => -- textDocument/rename + when 36 => -- textDocument/rename return Result : LSP.Server_Requests.Rename.Request do Read_Rename (Input, Result.Id, Result.Params); end return; - when 36 => -- textDocument/selectionRange + when 37 => -- textDocument/selectionRange return Result : LSP.Server_Requests.SelectionRange.Request do Read_SelectionRange (Input, Result.Id, Result.Params); end return; - when 37 => -- textDocument/semanticTokens/full + when 38 => -- textDocument/semanticTokens/full return Result : LSP.Server_Requests.Tokens_Full.Request do Read_Tokens_Full (Input, Result.Id, Result.Params); end return; - when 38 => -- textDocument/semanticTokens/full/delta + when 39 => -- textDocument/semanticTokens/full/delta return Result : LSP.Server_Requests.Tokens_Delta.Request do Read_Tokens_Delta (Input, Result.Id, Result.Params); end return; - when 39 => -- textDocument/semanticTokens/range + when 40 => -- textDocument/semanticTokens/range return Result : LSP.Server_Requests.Tokens_Range.Request do Read_Tokens_Range (Input, Result.Id, Result.Params); end return; - when 40 => -- textDocument/signatureHelp + when 41 => -- textDocument/signatureHelp return Result : LSP.Server_Requests.SignatureHelp.Request do Read_SignatureHelp (Input, Result.Id, Result.Params); end return; - when 41 => -- textDocument/typeDefinition + when 42 => -- textDocument/typeDefinition return Result : LSP.Server_Requests.TypeDefinition.Request do Read_TypeDefinition (Input, Result.Id, Result.Params); end return; - when 42 => -- textDocument/willSaveWaitUntil + when 43 => -- textDocument/willSaveWaitUntil return Result : LSP.Server_Requests.WillSaveWaitUntil.Request do Read_WillSaveWaitUntil (Input, Result.Id, Result.Params); end return; - when 43 => -- typeHierarchy/subtypes + when 44 => -- typeHierarchy/subtypes return Result : LSP.Server_Requests.Subtypes.Request do Read_Subtypes (Input, Result.Id, Result.Params); end return; - when 44 => -- typeHierarchy/supertypes + when 45 => -- typeHierarchy/supertypes return Result : LSP.Server_Requests.Supertypes.Request do Read_Supertypes (Input, Result.Id, Result.Params); end return; - when 45 => -- workspace/diagnostic + when 46 => -- workspace/diagnostic return Result : LSP.Server_Requests.Workspace_Diagnostic.Request do Read_Workspace_Diagnostic (Input, Result.Id, Result.Params); end return; - when 46 => -- workspace/executeCommand + when 47 => -- workspace/executeCommand return Result : LSP.Server_Requests.ExecuteCommand.Request do Read_ExecuteCommand (Input, Result.Id, Result.Params); end return; - when 47 => -- workspace/symbol + when 48 => -- workspace/symbol return Result : LSP.Server_Requests.Symbol.Request do Read_Symbol (Input, Result.Id, Result.Params); end return; - when 48 => -- workspace/willCreateFiles + when 49 => -- workspace/willCreateFiles return Result : LSP.Server_Requests.WillCreateFiles.Request do Read_WillCreateFiles (Input, Result.Id, Result.Params); end return; - when 49 => -- workspace/willDeleteFiles + when 50 => -- workspace/willDeleteFiles return Result : LSP.Server_Requests.WillDeleteFiles.Request do Read_WillDeleteFiles (Input, Result.Id, Result.Params); end return; - when 50 => -- workspace/willRenameFiles + when 51 => -- workspace/willRenameFiles return Result : LSP.Server_Requests.WillRenameFiles.Request do Read_WillRenameFiles (Input, Result.Id, Result.Params); end return; - when 51 => -- workspaceSymbol/resolve + when 52 => -- workspaceSymbol/resolve return Result : LSP.Server_Requests.Symbol_Resolve.Request do Read_Symbol_Resolve (Input, Result.Id, Result.Params); end return; diff --git a/source/lsp_3.17/generated/lsp-server_request_receivers.ads b/source/lsp_3.17/generated/lsp-server_request_receivers.ads index cd281e42f..776a6f73d 100644 --- a/source/lsp_3.17/generated/lsp-server_request_receivers.ads +++ b/source/lsp_3.17/generated/lsp-server_request_receivers.ads @@ -13,6 +13,12 @@ package LSP.Server_Request_Receivers is type Server_Request_Receiver is limited interface; + procedure On_AlsCheckSyntax_Request + (Self : in out Server_Request_Receiver; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.AlsCheckSyntaxParams) is null; + -- query if a given input has a valid syntax according to a set of rules. + procedure On_IncomingCalls_Request (Self : in out Server_Request_Receiver; Id : LSP.Structures.Integer_Or_Virtual_String; diff --git a/source/lsp_3.17/generated/lsp-server_request_writers.adb b/source/lsp_3.17/generated/lsp-server_request_writers.adb index 77114d008..b67f78236 100644 --- a/source/lsp_3.17/generated/lsp-server_request_writers.adb +++ b/source/lsp_3.17/generated/lsp-server_request_writers.adb @@ -11,6 +11,18 @@ with LSP.Outputs; package body LSP.Server_Request_Writers is + overriding procedure On_AlsCheckSyntax_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.AlsCheckSyntaxParams) is + begin + LSP.Output_Tools.Write_Start_Request + (Self.Output.all, "$/alsCheckSyntax", Id); + Self.Output.Key_Name ("params"); + LSP.Outputs.Write_AlsCheckSyntaxParams (Self.Output.all, Value); + Self.Output.End_Object; + end On_AlsCheckSyntax_Request; + overriding procedure On_IncomingCalls_Request (Self : in out Server_Request_Writer; Id : LSP.Structures.Integer_Or_Virtual_String; diff --git a/source/lsp_3.17/generated/lsp-server_request_writers.ads b/source/lsp_3.17/generated/lsp-server_request_writers.ads index ac7de2fe7..0db14cd15 100644 --- a/source/lsp_3.17/generated/lsp-server_request_writers.ads +++ b/source/lsp_3.17/generated/lsp-server_request_writers.ads @@ -17,6 +17,11 @@ package LSP.Server_Request_Writers is (Output : access VSS.JSON.Content_Handlers.JSON_Content_Handler'Class) is new LSP.Server_Request_Receivers.Server_Request_Receiver with null record; + overriding procedure On_AlsCheckSyntax_Request + (Self : in out Server_Request_Writer; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.AlsCheckSyntaxParams); + overriding procedure On_IncomingCalls_Request (Self : in out Server_Request_Writer; Id : LSP.Structures.Integer_Or_Virtual_String; diff --git a/source/lsp_3.17/generated/lsp-server_requests-alschecksyntax.adb b/source/lsp_3.17/generated/lsp-server_requests-alschecksyntax.adb new file mode 100644 index 000000000..895f029e0 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-alschecksyntax.adb @@ -0,0 +1,19 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- + +package body LSP.Server_Requests.AlsCheckSyntax is + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class) is + begin + Value.On_AlsCheckSyntax_Request (Self.Id, Self.Params); + end Visit_Server_Receiver; + +end LSP.Server_Requests.AlsCheckSyntax; diff --git a/source/lsp_3.17/generated/lsp-server_requests-alschecksyntax.ads b/source/lsp_3.17/generated/lsp-server_requests-alschecksyntax.ads new file mode 100644 index 000000000..545c09875 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_requests-alschecksyntax.ads @@ -0,0 +1,23 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- + +with LSP.Structures; + +package LSP.Server_Requests.AlsCheckSyntax is + pragma Preelaborate; + + type Request is new LSP.Server_Requests.Server_Request with record + Params : LSP.Structures.AlsCheckSyntaxParams; + end record; + + overriding procedure Visit_Server_Receiver + (Self : Request; + Value : in out LSP.Server_Request_Receivers.Server_Request_Receiver' + Class); + +end LSP.Server_Requests.AlsCheckSyntax; diff --git a/source/lsp_3.17/generated/lsp-structures.ads b/source/lsp_3.17/generated/lsp-structures.ads index 7f4e7388f..6609981b8 100644 --- a/source/lsp_3.17/generated/lsp-structures.ads +++ b/source/lsp_3.17/generated/lsp-structures.ads @@ -110,6 +110,21 @@ package LSP.Structures is return LSP.Structures.ProgressToken_Optional is abstract; -- An optional token that a server can use to report work done progress. + type AlsCheckSyntaxParams is record + input : LSP.Structures.Virtual_String; + -- Text to check syntax. + + rules : LSP.Structures.Virtual_String_Vector; + -- Libadalang `Ada_Node_Kind_Type` values. + + end record; + + type AlsCheckSyntaxResult is record + diagnostic : Virtual_String_Optional; + -- Diagnostic from check syntax. + + end record; + type Position is record line : Natural; -- Line position in a document (zero-based). @@ -3971,6 +3986,17 @@ package LSP.Structures is (Self : DeclarationOptions) return Boolean_Optional is (Self.workDoneProgress); + type AlsDisplayMethodAncestryOnNavigationPolicy_Optional + (Is_Set : Boolean := False) is + record + case Is_Set is + when False => + null; + when True => + Value : AlsDisplayMethodAncestryOnNavigationPolicy; + end case; + end record; + type DeclarationParams is new TextDocumentPositionParams and WorkDoneProgressParams and PartialResultParams with record @@ -3981,6 +4007,9 @@ package LSP.Structures is -- An optional token that a server can use to report partial results -- (e.g. streaming) to the client. + alsDisplayMethodAncestryOnNavigation : AlsDisplayMethodAncestryOnNavigationPolicy_Optional; + -- whether or now we should list overriding/overridden subprograms. + end record; overriding function workDoneToken @@ -4024,6 +4053,9 @@ package LSP.Structures is -- An optional token that a server can use to report partial results -- (e.g. streaming) to the client. + alsDisplayMethodAncestryOnNavigation : AlsDisplayMethodAncestryOnNavigationPolicy_Optional; + -- whether or now we should list overriding/overridden subprograms. + end record; -- Parameters for a [DefinitionRequest](#DefinitionRequest). @@ -5076,6 +5108,15 @@ package LSP.Structures is -- Registration options for a -- [DocumentRangeFormattingRequest](#DocumentRangeFormattingRequest). + type AlsVisibility_Optional (Is_Set : Boolean := False) is record + case Is_Set is + when False => + null; + when True => + Value : AlsVisibility; + end case; + end record; + type DocumentSymbol_Vector is tagged private with Variable_Indexing => Get_DocumentSymbol_Variable_Reference, Constant_Indexing => Get_DocumentSymbol_Constant_Reference; @@ -5116,6 +5157,12 @@ package LSP.Structures is children : LSP.Structures.DocumentSymbol_Vector; -- Children of this symbol, e.g. properties of a class. + alsIsDeclaration : Boolean_Optional; + + alsIsAdaProcedure : Boolean_Optional; + + alsVisibility : AlsVisibility_Optional; + end record; -- Represents programming constructs like variables, classes, interfaces -- etc. that appear in a document. Document symbols can be hierarchical @@ -5138,6 +5185,15 @@ package LSP.Structures is (Self : DocumentSymbolOptions) return Boolean_Optional is (Self.workDoneProgress); + type AlsSearchKind_Optional (Is_Set : Boolean := False) is record + case Is_Set is + when False => + null; + when True => + Value : AlsSearchKind; + end case; + end record; + type DocumentSymbolParams is new WorkDoneProgressParams and PartialResultParams with record workDoneToken : ProgressToken_Optional; @@ -5150,6 +5206,17 @@ package LSP.Structures is textDocument : LSP.Structures.TextDocumentIdentifier; -- The text document. + case_sensitive : Boolean_Optional; + -- To take letters' case into account. + + whole_word : Boolean_Optional; + -- To match the whole word instead of a part of it. + + negate : Boolean_Optional; + -- To invert matching. + + kind : AlsSearchKind_Optional; + end record; -- Parameters for a [DocumentSymbolRequest](#DocumentSymbolRequest). @@ -5532,6 +5599,9 @@ package LSP.Structures is -- An optional token that a server can use to report partial results -- (e.g. streaming) to the client. + alsDisplayMethodAncestryOnNavigation : AlsDisplayMethodAncestryOnNavigationPolicy_Optional; + -- whether or now we should list overriding/overridden subprograms. + end record; overriding function workDoneToken From 5fc9463f04891f1c9ce28ac6f3324ba8d817ed70 Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Sat, 9 Sep 2023 15:09:34 +0300 Subject: [PATCH 119/152] Rebase tests after implementing zero-padding in VSS --- .../U915-024.completion.invisible_snippets/test.json | 2 +- .../test.json | 2 +- .../V705-026.completion.predefined_types/test.json | 6 +++--- .../ada_lsp/completion.dotted_call.keyword/test.json | 10 +++++----- testsuite/ada_lsp/completion.duplicates/test.json | 2 +- testsuite/ada_lsp/completion.invisible/test.json | 10 +++++----- testsuite/ada_lsp/completion.invisible2/test.json | 4 ++-- testsuite/ada_lsp/completion.invisible3/test.json | 6 +++--- testsuite/ada_lsp/completion.invisible4/test.json | 4 ++-- testsuite/ada_lsp/completion.invisible5/test.json | 2 +- .../ada_lsp/completion.lazy_computation/test.json | 6 +++--- testsuite/ada_lsp/completion.subp_parameters/test.json | 6 +++--- .../documentation.subprogram-from-generic/test.json | 6 +++--- 13 files changed, 33 insertions(+), 33 deletions(-) diff --git a/testsuite/ada_lsp/U915-024.completion.invisible_snippets/test.json b/testsuite/ada_lsp/U915-024.completion.invisible_snippets/test.json index 1d83526e4..372c54325 100644 --- a/testsuite/ada_lsp/U915-024.completion.invisible_snippets/test.json +++ b/testsuite/ada_lsp/U915-024.completion.invisible_snippets/test.json @@ -170,7 +170,7 @@ { "label": "Do_Something (invisible)", "kind": 3, - "sortText": "~100&0Do_Something", + "sortText": "~100&00000Do_Something", "filterText": "Do_Something", "insertText": "Do_Something", "data": { diff --git a/testsuite/ada_lsp/U921-010.completion.no_generic_duplicates/test.json b/testsuite/ada_lsp/U921-010.completion.no_generic_duplicates/test.json index 3eb5fe17a..9e4a61b84 100644 --- a/testsuite/ada_lsp/U921-010.completion.no_generic_duplicates/test.json +++ b/testsuite/ada_lsp/U921-010.completion.no_generic_duplicates/test.json @@ -210,7 +210,7 @@ { "label": "Primitive", "kind": 3, - "sortText": "100&2Primitive", + "sortText": "100&00002Primitive", "insertText": "Primitive (${1:Obj : Parent})$0", "insertTextFormat": 2, "data": { diff --git a/testsuite/ada_lsp/V705-026.completion.predefined_types/test.json b/testsuite/ada_lsp/V705-026.completion.predefined_types/test.json index baaf2ff71..fdd22e2d0 100644 --- a/testsuite/ada_lsp/V705-026.completion.predefined_types/test.json +++ b/testsuite/ada_lsp/V705-026.completion.predefined_types/test.json @@ -209,7 +209,7 @@ "kind": 7, "detail": "type Integer is range -(2 ** 31) .. +(2 ** 31 - 1);", "documentation": "at __standard (4:3)", - "sortText": "0&2Integer" + "sortText": "00&00002Integer" } ] } @@ -228,7 +228,7 @@ "kind": 7, "detail": "type Integer is range -(2 ** 31) .. +(2 ** 31 - 1);", "documentation": "at __standard (4:3)", - "sortText": "000&2Integer", + "sortText": "00&00002Integer", "additionalTextEdits": [] } }, @@ -240,7 +240,7 @@ "kind": 7, "detail": "type Integer is range -(2 ** 31) .. +(2 ** 31 - 1);", "documentation": "at __standard (4:3)", - "sortText": "000&2Integer" + "sortText": "00&00002Integer" } } ] diff --git a/testsuite/ada_lsp/completion.dotted_call.keyword/test.json b/testsuite/ada_lsp/completion.dotted_call.keyword/test.json index 23fd0535c..177648a22 100644 --- a/testsuite/ada_lsp/completion.dotted_call.keyword/test.json +++ b/testsuite/ada_lsp/completion.dotted_call.keyword/test.json @@ -124,7 +124,7 @@ { "label": "A", "kind": 5, - "sortText": "0&1A", + "sortText": "00&00001A", "data": { "uri": "$URI{bar.ads}", "range": { @@ -142,7 +142,7 @@ { "label": "Do_Nothing", "kind": 3, - "sortText": "25&2Do_Nothing", + "sortText": "25&00002Do_Nothing", "insertText": "Do_Nothing (${1:A : Integer}, ${2:B : Integer})$0", "insertTextFormat": 2, "data": { @@ -223,7 +223,7 @@ { "label": "A", "kind": 5, - "sortText": "0&1A", + "sortText": "00&00001A", "data": { "uri": "$URI{bar.ads}", "range": { @@ -241,7 +241,7 @@ { "label": "Do_Nothing", "kind": 3, - "sortText": "25&2Do_Nothing", + "sortText": "25&00002Do_Nothing", "insertText": "Do_Nothing (${1:A : Integer}, ${2:B : Integer})$0", "insertTextFormat": 2, "data": { @@ -322,7 +322,7 @@ { "label": "Do_Nothing", "kind": 3, - "sortText": "100&1Do_Nothing", + "sortText": "100&00001Do_Nothing", "insertText": "Do_Nothing (${1:A : Integer}, ${2:B : Integer})$0", "insertTextFormat": 2, "data": { diff --git a/testsuite/ada_lsp/completion.duplicates/test.json b/testsuite/ada_lsp/completion.duplicates/test.json index 8ecca24e3..284655398 100644 --- a/testsuite/ada_lsp/completion.duplicates/test.json +++ b/testsuite/ada_lsp/completion.duplicates/test.json @@ -165,7 +165,7 @@ { "label": "Do_Something", "kind": 3, - "sortText": "100&2Do_Something", + "sortText": "100&00002Do_Something", "data": { "uri": "$URI{main.adb}", "range": { diff --git a/testsuite/ada_lsp/completion.invisible/test.json b/testsuite/ada_lsp/completion.invisible/test.json index b8a9c3f10..1bd1572dd 100644 --- a/testsuite/ada_lsp/completion.invisible/test.json +++ b/testsuite/ada_lsp/completion.invisible/test.json @@ -152,14 +152,14 @@ "kind": 6, "detail": "Invisible : Integer;", "documentation": "at aaa.ads (2:4)", - "sortText": "~100&0Invisible" + "sortText": "~100&00000Invisible" }, { "label": "Invisible_Function (invisible)", "kind": 3, "detail": "function Invisible_Function (X, Y : Integer) return Integer", "documentation": "at aaa.ads (4:4)", - "sortText": "~100&1Invisible_Function", + "sortText": "~100&00001Invisible_Function", "insertText": "Invisible_Function" } ] @@ -248,7 +248,7 @@ "kind": 6, "detail": "Invisible : Integer;", "documentation": "at aaa.ads (3:4)", - "sortText": "~100&-1Invisible" + "sortText": "~100&-00001Invisible" } ] } @@ -303,14 +303,14 @@ "kind": 6, "detail": "Invisible : Integer;", "documentation": "at aaa.ads (2:4)", - "sortText": "~100&0Invisible" + "sortText": "~100&00000Invisible" }, { "label": "Invisible_Function (invisible)", "kind": 3, "detail": "function Invisible_Function (X, Y : Integer) return Integer", "documentation": "at aaa.ads (4:4)", - "sortText": "~100&1Invisible_Function", + "sortText": "~100&00001Invisible_Function", "insertText": "Invisible_Function" } ] diff --git a/testsuite/ada_lsp/completion.invisible2/test.json b/testsuite/ada_lsp/completion.invisible2/test.json index ade70c89b..b0f22f0c1 100644 --- a/testsuite/ada_lsp/completion.invisible2/test.json +++ b/testsuite/ada_lsp/completion.invisible2/test.json @@ -148,14 +148,14 @@ "kind": 5, "detail": "type My_Int is tagged record\n A : Integer;\nend record;", "documentation": "at bar.ads (4:7)\n\n@field A", - "sortText": "0&1A" + "sortText": "00&00001A" }, { "label": "Do_Nothing", "kind": 3, "detail": "procedure Do_Nothing (Obj : My_Int; A :Integer; B : Integer)", "documentation": "at bar.ads (7:4)", - "sortText": "25&2Do_Nothing", + "sortText": "25&00002Do_Nothing", "insertText": "Do_Nothing (${1:A : Integer}, ${2:B : Integer})$0", "insertTextFormat": 2 } diff --git a/testsuite/ada_lsp/completion.invisible3/test.json b/testsuite/ada_lsp/completion.invisible3/test.json index ca0a399b9..92a4039d4 100644 --- a/testsuite/ada_lsp/completion.invisible3/test.json +++ b/testsuite/ada_lsp/completion.invisible3/test.json @@ -148,7 +148,7 @@ "kind": 3, "detail": "function ABC1 return Integer", "documentation": "at pkg.ads (3:4)", - "sortText": "~100&0ABC1", + "sortText": "~100&00000ABC1", "insertText": "ABC1" }, { @@ -156,7 +156,7 @@ "kind": 9, "detail": "generic\n ABC13 : Integer;\npackage ABC14", "documentation": "at pkg.ads (19:4)", - "sortText": "~100&1ABC14", + "sortText": "~100&00001ABC14", "insertText": "ABC14" }, { @@ -164,7 +164,7 @@ "kind": 7, "detail": "type ABC4 (ABC5 : Integer) is record\n ABC6 : Boolean := (for some ABC7 in Boolean => ABC7);\nend record;", "documentation": "at pkg.ads (5:4)", - "sortText": "~100&2ABC4", + "sortText": "~100&00002ABC4", "insertText": "ABC4" } ] diff --git a/testsuite/ada_lsp/completion.invisible4/test.json b/testsuite/ada_lsp/completion.invisible4/test.json index bdfbb7caf..1f7be8fd0 100644 --- a/testsuite/ada_lsp/completion.invisible4/test.json +++ b/testsuite/ada_lsp/completion.invisible4/test.json @@ -148,14 +148,14 @@ "kind": 9, "detail": "package Pkg_1.Child", "documentation": "at pkg_1-child.ads (3:1)", - "sortText": "100&1Child" + "sortText": "100&00001Child" }, { "label": "Child2 (invisible)", "kind": 9, "detail": "package Pkg_1.Child2", "documentation": "at pkg_1-child2.ads (1:1)", - "sortText": "~100&2Child2", + "sortText": "~100&00002Child2", "insertText": "Child2" } ] diff --git a/testsuite/ada_lsp/completion.invisible5/test.json b/testsuite/ada_lsp/completion.invisible5/test.json index 8f5266a86..bf4e14950 100644 --- a/testsuite/ada_lsp/completion.invisible5/test.json +++ b/testsuite/ada_lsp/completion.invisible5/test.json @@ -148,7 +148,7 @@ "kind": 9, "detail": "package Ada", "documentation": "", - "sortText": "100&1Ada" + "sortText": "100&00001Ada" } ] } diff --git a/testsuite/ada_lsp/completion.lazy_computation/test.json b/testsuite/ada_lsp/completion.lazy_computation/test.json index 5694792e2..6be217f47 100644 --- a/testsuite/ada_lsp/completion.lazy_computation/test.json +++ b/testsuite/ada_lsp/completion.lazy_computation/test.json @@ -155,7 +155,7 @@ { "label": "Select_Some", "kind": 3, - "sortText": "100&2Select_Some", + "sortText": "100&00002Select_Some", "data": { "uri": "$URI{test.ads}", "range": { @@ -186,7 +186,7 @@ "label": "Select_Some", "insertTextFormat": 1, "kind": 3, - "sortText": "100&1Select_Some", + "sortText": "100&00001Select_Some", "data": { "uri": "$URI{test.ads}", "range": { @@ -210,7 +210,7 @@ "kind": 3, "detail": "procedure Select_Some", "documentation": "at test.ads (3:4)\n\nThis a very useful comment.", - "sortText": "100&1Select_Some", + "sortText": "100&00001Select_Some", "insertTextFormat": 1, "data": { "uri": "$URI{test.ads}", diff --git a/testsuite/ada_lsp/completion.subp_parameters/test.json b/testsuite/ada_lsp/completion.subp_parameters/test.json index 9ab5d13f5..b60dea4d3 100644 --- a/testsuite/ada_lsp/completion.subp_parameters/test.json +++ b/testsuite/ada_lsp/completion.subp_parameters/test.json @@ -228,14 +228,14 @@ "kind": 5, "detail": "type My_Int is tagged record\n A : Integer;\nend record;", "documentation": "at bar.ads (4:7)\n\n@field A", - "sortText": "0&1A" + "sortText": "00&00001A" }, { "label": "Do_Nothing", "kind": 3, "detail": "procedure Do_Nothing (Obj : My_Int; A :Integer)", "documentation": "at bar.ads (7:4)", - "sortText": "25&2Do_Nothing", + "sortText": "25&00002Do_Nothing", "insertText": "Do_Nothing (${1:A : Integer})$0", "insertTextFormat": 2 } @@ -361,13 +361,13 @@ "id": 6, "method": "textDocument/completion" }, - "sortReply": { "result": {"items": ["label", "documentation"]} }, "wait": [ { "id": 6, "result": { "isIncomplete": false, "items": [ + "", { "label": "A", "kind": 6, diff --git a/testsuite/ada_lsp/documentation.subprogram-from-generic/test.json b/testsuite/ada_lsp/documentation.subprogram-from-generic/test.json index 61eee1d41..40e3247eb 100644 --- a/testsuite/ada_lsp/documentation.subprogram-from-generic/test.json +++ b/testsuite/ada_lsp/documentation.subprogram-from-generic/test.json @@ -157,7 +157,7 @@ { "label": "Do_Nothing", "kind": 3, - "sortText": "25&1Do_Nothing", + "sortText": "25&00001Do_Nothing", "data": { "uri": "$URI{foo.adb}", "range": { @@ -187,7 +187,7 @@ "params": { "label": "Do_Nothing", "kind": 3, - "sortText": "25&1Do_Nothing", + "sortText": "25&00001Do_Nothing", "data": { "uri": "$URI{foo.adb}", "range": { @@ -211,7 +211,7 @@ "kind": 3, "detail": "procedure Do_Nothing", "documentation": "at foo.adb (5:7)\n\nIt doesn't do anything, but test documentation extraction.", - "sortText": "25&1Do_Nothing", + "sortText": "25&00001Do_Nothing", "data": { "uri": "$URI{foo.adb}", "range": { From ec154f1fea5564823da151954f47cfe67069f071 Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Mon, 11 Sep 2023 15:04:22 +0300 Subject: [PATCH 120/152] Restore AlsCheckSyntax request Refs #1170 --- source/ada/lsp-ada_handlers.adb | 69 +++++++++++++++++++ source/ada/lsp-ada_handlers.ads | 5 ++ .../S314-015/test.json | 2 +- .../S314-015/test.yaml | 3 - .../UA25-015/test.json | 6 +- .../UA25-015/test.yaml | 3 - 6 files changed, 78 insertions(+), 10 deletions(-) diff --git a/source/ada/lsp-ada_handlers.adb b/source/ada/lsp-ada_handlers.adb index f662bd294..298b0a692 100644 --- a/source/ada/lsp-ada_handlers.adb +++ b/source/ada/lsp-ada_handlers.adb @@ -17,6 +17,7 @@ with Ada.Exceptions; with Ada.Strings.Unbounded; +with Ada.Strings.UTF_Encoding; with Ada.Tags.Generic_Dispatching_Constructor; with Ada.Unchecked_Deallocation; @@ -442,6 +443,74 @@ package body LSP.Ada_Handlers is Self.Tracer.Trace ("Out Message_Handler " & Name); end Log_Method_Out; + ------------------------------- + -- On_AlsCheckSyntax_Request -- + ------------------------------- + + overriding procedure On_AlsCheckSyntax_Request + (Self : in out Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.AlsCheckSyntaxParams) + is + + function "+" + (Item : VSS.Strings.Virtual_String'Class) + return Ada.Strings.UTF_Encoding.UTF_8_String + renames VSS.Strings.Conversions.To_UTF_8_String; + + function "+" + (Item : VSS.Strings.Virtual_String'Class) + return Ada.Strings.Unbounded.Unbounded_String + renames VSS.Strings.Conversions.To_Unbounded_UTF_8_String; + + Response : LSP.Structures.AlsCheckSyntaxResult; + + Invalid_Rule_Error_Message : constant VSS.Strings.Virtual_String := + "Error parsing the grammar rules for the syntax check"; + + Rules : Laltools.Common.Grammar_Rule_Vector; + + begin + -- The input cannot be empty and only needs to be valid against one of + -- the rules. + + if Value.rules.Length = 0 then + -- We need at least one rule in order to validate the input + + Self.Sender.On_Error_Response + (Id, (LSP.Constants.InvalidParams, "Rule list is empty")); + + return; + elsif Value.input.Is_Empty then + + Response.diagnostic := "Invalid Syntax"; + Self.Sender.On_AlsCheckSyntax_Response (Id, Response); + + return; + end if; + + for Rule of Value.rules loop + begin + -- A Constraint_Error can be raised here is an invalid rule is + -- received in the request parameters. + Rules.Append (Libadalang.Common.Grammar_Rule'Value (+Rule)); + exception + when Constraint_Error => + Self.Sender.On_Error_Response + (Id, + (LSP.Constants.InvalidParams, Invalid_Rule_Error_Message)); + + return; + end; + end loop; + + if not Laltools.Common.Validate_Syntax (+Value.input, Rules) then + Response.diagnostic := "Invalid Syntax"; + end if; + + Self.Sender.On_AlsCheckSyntax_Response (Id, Response); + end On_AlsCheckSyntax_Request; + --------------------------- -- On_CodeAction_Request -- --------------------------- diff --git a/source/ada/lsp-ada_handlers.ads b/source/ada/lsp-ada_handlers.ads index c85798f82..c96383a07 100644 --- a/source/ada/lsp-ada_handlers.ads +++ b/source/ada/lsp-ada_handlers.ads @@ -246,6 +246,11 @@ private (Self : in out Message_Handler; Value : LSP.Server_Requests.Server_Request'Class); + overriding procedure On_AlsCheckSyntax_Request + (Self : in out Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.AlsCheckSyntaxParams); + overriding procedure On_Declaration_Request (Self : in out Message_Handler; Id : LSP.Structures.Integer_Or_Virtual_String; diff --git a/testsuite/ada_lsp/refactoring_add_parameter/S314-015/test.json b/testsuite/ada_lsp/refactoring_add_parameter/S314-015/test.json index 7abe56074..651bb2b01 100644 --- a/testsuite/ada_lsp/refactoring_add_parameter/S314-015/test.json +++ b/testsuite/ada_lsp/refactoring_add_parameter/S314-015/test.json @@ -282,7 +282,7 @@ "wait": [ { "jsonrpc": "2.0", - "id": 3, + "id": 2, "method": "workspace/applyEdit", "params": { "edit": { diff --git a/testsuite/ada_lsp/refactoring_add_parameter/S314-015/test.yaml b/testsuite/ada_lsp/refactoring_add_parameter/S314-015/test.yaml index 39954cb17..101e074f8 100644 --- a/testsuite/ada_lsp/refactoring_add_parameter/S314-015/test.yaml +++ b/testsuite/ada_lsp/refactoring_add_parameter/S314-015/test.yaml @@ -3,6 +3,3 @@ title: 'refactoring_add_parameter/S314-015' description: > Check that the Add_Parameter codeAction is not available if the client does not provide the userInputProvider capability. -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/refactoring_add_parameter/UA25-015/test.json b/testsuite/ada_lsp/refactoring_add_parameter/UA25-015/test.json index e3cea10cb..edf02ff24 100644 --- a/testsuite/ada_lsp/refactoring_add_parameter/UA25-015/test.json +++ b/testsuite/ada_lsp/refactoring_add_parameter/UA25-015/test.json @@ -176,7 +176,7 @@ "command": { "title": "", "command": "als-refactor-add-parameters", - "arguments": { + "arguments": [{ "context_id": "Default", "where": { "uri": "$URI{main.adb}", @@ -193,7 +193,7 @@ }, "newParameter": "", "requiresFullSpecification": false - } + }] } } ] @@ -284,7 +284,7 @@ "wait": [ { "jsonrpc": "2.0", - "id": 3, + "id": 2, "method": "workspace/applyEdit", "params": { "edit": { diff --git a/testsuite/ada_lsp/refactoring_add_parameter/UA25-015/test.yaml b/testsuite/ada_lsp/refactoring_add_parameter/UA25-015/test.yaml index 34b5eb0fc..b358fc821 100644 --- a/testsuite/ada_lsp/refactoring_add_parameter/UA25-015/test.yaml +++ b/testsuite/ada_lsp/refactoring_add_parameter/UA25-015/test.yaml @@ -4,6 +4,3 @@ description: > Check that the Add_Parameter codeAction is avaiable when the client provides the userInputProvider capability, and that it executes correctly. -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] From c919f96f5c974780a4e21199a62b1fc0ca419fc0 Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Mon, 11 Sep 2023 17:34:55 +0300 Subject: [PATCH 121/152] Restore extra fields in document symbols reply Refs #1170 --- source/ada/lsp-ada_handlers-symbols.adb | 74 ++++++++++++++++++- .../test.json | 17 +---- .../test.yaml | 3 - .../test.json | 23 ++---- .../test.yaml | 3 - .../SA21-029.documentSymbol.with/test.json | 13 +--- .../SA21-029.documentSymbol.with/test.yaml | 3 - .../T827-018.documentSymbol.pragma/test.json | 15 +--- .../ada_lsp/callgraph.named_blocks/test.json | 47 ++---------- .../ada_lsp/callgraph.named_blocks/test.yaml | 3 - testsuite/ada_lsp/get_symbol_hier/test.json | 15 +--- testsuite/ada_lsp/get_symbol_hier/test.yaml | 3 - 12 files changed, 96 insertions(+), 123 deletions(-) diff --git a/source/ada/lsp-ada_handlers-symbols.adb b/source/ada/lsp-ada_handlers-symbols.adb index 2c0d2e412..58a361ffd 100644 --- a/source/ada/lsp-ada_handlers-symbols.adb +++ b/source/ada/lsp-ada_handlers-symbols.adb @@ -37,6 +37,13 @@ package body LSP.Ada_Handlers.Symbols is return VSS.Strings.Virtual_String; -- Return the profile of Node. + function Is_Declaration (Node : Libadalang.Analysis.Basic_Decl) + return LSP.Structures.Boolean_Optional; + + function Get_Visibility + (Node : Libadalang.Analysis.Basic_Decl) + return LSP.Structures.AlsVisibility_Optional; + --------------------------- -- Flat_Document_Symbols -- --------------------------- @@ -226,6 +233,26 @@ package body LSP.Ada_Handlers.Symbols is end case; end Get_Profile; + -------------------- + -- Get_Visibility -- + -------------------- + + function Get_Visibility + (Node : Libadalang.Analysis.Basic_Decl) + return LSP.Structures.AlsVisibility_Optional + is + use Libadalang.Common; + begin + for Parent of Node.Parents loop + if Parent.Kind = Ada_Private_Part then + return (True, LSP.Enumerations.Als_Private); + elsif Parent.Kind in Ada_Protected_Body | Ada_Protected_Def then + return (True, LSP.Enumerations.Als_Protected); + end if; + end loop; + return (True, LSP.Enumerations.Als_Public); + end Get_Visibility; + ----------------------------------- -- Hierarchical_Document_Symbols -- ----------------------------------- @@ -319,10 +346,11 @@ package body LSP.Ada_Handlers.Symbols is selectionRange => Locations.To_LSP_Location (Self, Name).a_range, children => Children, - alsIsDeclaration => LSP.Constants.True, - alsIsAdaProcedure => LSP.Constants.True, - alsVisibility => - (True, LSP.Enumerations.Als_Private)); + alsIsDeclaration => Is_Declaration (Decl), + alsIsAdaProcedure => + (if Is_Function then (Is_Set => False) + else (True, True)), + alsVisibility => Get_Visibility (Decl)); begin Vector.Append (Item); end; @@ -397,6 +425,44 @@ package body LSP.Ada_Handlers.Symbols is Walk (Root, 0, Result); end Hierarchical_Document_Symbols; + -------------------- + -- Is_Declaration -- + -------------------- + + function Is_Declaration (Node : Libadalang.Analysis.Basic_Decl) + return LSP.Structures.Boolean_Optional + is + use Libadalang.Common; + begin + return + (case Node.Kind is + when Ada_Base_Package_Decl | + Ada_Generic_Package_Decl | + Ada_Generic_Package_Instantiation | + Ada_Generic_Package_Renaming_Decl | + Ada_Package_Renaming_Decl | + Ada_Abstract_Subp_Decl | + Ada_Formal_Subp_Decl | + Ada_Subp_Decl | + Ada_Subp_Renaming_Decl | + Ada_Generic_Subp_Instantiation | + Ada_Generic_Subp_Renaming_Decl | + Ada_Generic_Subp_Decl | + Ada_Null_Subp_Decl | + Ada_Expr_Function | + Ada_Protected_Type_Decl | + Ada_Single_Protected_Decl | + Ada_Entry_Decl | + Ada_Type_Decl | + Ada_Single_Task_Decl | + Ada_Task_Type_Decl => + + (Is_Set => True, Value => True), + + when others => + (Is_Set => True, Value => False)); + end Is_Declaration; + ------------------- -- Write_Symbols -- ------------------- diff --git a/testsuite/ada_lsp/S312-063.documentSymbol.constant/test.json b/testsuite/ada_lsp/S312-063.documentSymbol.constant/test.json index cb0a51680..50cb8e249 100644 --- a/testsuite/ada_lsp/S312-063.documentSymbol.constant/test.json +++ b/testsuite/ada_lsp/S312-063.documentSymbol.constant/test.json @@ -105,7 +105,6 @@ }, "alsVisibility": 1, "alsIsDeclaration": false, - "detail": "", "range": { "start": { "line": 0, @@ -133,7 +132,6 @@ }, "alsVisibility": 1, "alsIsDeclaration": false, - "detail": "", "range": { "start": { "line": 1, @@ -144,8 +142,7 @@ "character": 33 } }, - "alsIsAdaProcedure": true, - "children": [] + "alsIsAdaProcedure": true }, { "kind": 13, @@ -162,7 +159,6 @@ }, "alsVisibility": 1, "alsIsDeclaration": false, - "detail": "", "range": { "start": { "line": 2, @@ -173,8 +169,7 @@ "character": 24 } }, - "alsIsAdaProcedure": true, - "children": [] + "alsIsAdaProcedure": true }, { "kind": 14, @@ -191,7 +186,6 @@ }, "alsVisibility": 1, "alsIsDeclaration": false, - "detail": "", "range": { "start": { "line": 5, @@ -202,8 +196,7 @@ "character": 36 } }, - "alsIsAdaProcedure": true, - "children": [] + "alsIsAdaProcedure": true }, { "kind": 13, @@ -220,7 +213,6 @@ }, "alsVisibility": 1, "alsIsDeclaration": false, - "detail": "", "range": { "start": { "line": 6, @@ -231,8 +223,7 @@ "character": 27 } }, - "alsIsAdaProcedure": true, - "children": [] + "alsIsAdaProcedure": true } ] } diff --git a/testsuite/ada_lsp/S312-063.documentSymbol.constant/test.yaml b/testsuite/ada_lsp/S312-063.documentSymbol.constant/test.yaml index 37ed7ad4a..c45e0c130 100644 --- a/testsuite/ada_lsp/S312-063.documentSymbol.constant/test.yaml +++ b/testsuite/ada_lsp/S312-063.documentSymbol.constant/test.yaml @@ -1,4 +1 @@ title: 'S312-063.documentSymbol.constant' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/SA21-029.documentSymbol.function/test.json b/testsuite/ada_lsp/SA21-029.documentSymbol.function/test.json index c3ae0c4b5..f6c9e0503 100644 --- a/testsuite/ada_lsp/SA21-029.documentSymbol.function/test.json +++ b/testsuite/ada_lsp/SA21-029.documentSymbol.function/test.json @@ -81,7 +81,6 @@ "result": [ { "name": "Foo", - "detail": "", "kind": 12, "range": { "start": { @@ -108,7 +107,6 @@ "children": [ { "name": "Bar", - "detail": "", "kind": 12, "range": { "start": { @@ -132,9 +130,7 @@ }, "alsIsDeclaration": true, "alsIsAdaProcedure": true, - "alsVisibility": 1, - "children": [ - ] + "alsVisibility": 1 }, { "name": "Bar", @@ -161,9 +157,7 @@ } }, "alsIsDeclaration": true, - "alsVisibility": 1, - "children": [ - ] + "alsVisibility": 1 }, { "name": "FooBar", @@ -190,13 +184,10 @@ } }, "alsIsDeclaration": true, - "alsVisibility": 1, - "children": [ - ] + "alsVisibility": 1 }, { "name": "Bar", - "detail": "", "kind": 12, "range": { "start": { @@ -220,9 +211,7 @@ }, "alsIsDeclaration": false, "alsIsAdaProcedure": true, - "alsVisibility": 1, - "children": [ - ] + "alsVisibility": 1 }, { "name": "Bar", @@ -249,9 +238,7 @@ } }, "alsIsDeclaration": false, - "alsVisibility": 1, - "children": [ - ] + "alsVisibility": 1 } ] } diff --git a/testsuite/ada_lsp/SA21-029.documentSymbol.function/test.yaml b/testsuite/ada_lsp/SA21-029.documentSymbol.function/test.yaml index 37ee1d85c..7b48ac5f4 100644 --- a/testsuite/ada_lsp/SA21-029.documentSymbol.function/test.yaml +++ b/testsuite/ada_lsp/SA21-029.documentSymbol.function/test.yaml @@ -1,4 +1 @@ title: 'SA21-029.documentSymbol.function' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/SA21-029.documentSymbol.with/test.json b/testsuite/ada_lsp/SA21-029.documentSymbol.with/test.json index beb5136e5..0f4a5fc57 100644 --- a/testsuite/ada_lsp/SA21-029.documentSymbol.with/test.json +++ b/testsuite/ada_lsp/SA21-029.documentSymbol.with/test.json @@ -120,7 +120,6 @@ "alsVisibility": 1, "alsIsAdaProcedure": true, "alsIsDeclaration": false, - "detail": "", "range": { "start": { "line": 2, @@ -147,7 +146,6 @@ }, "alsVisibility": 1, "alsIsDeclaration": false, - "detail": "", "range": { "start": { "line": 3, @@ -157,8 +155,7 @@ "line": 3, "character": 15 } - }, - "children": [] + } }, { "kind": 12, @@ -176,7 +173,6 @@ "alsVisibility": 1, "alsIsAdaProcedure": true, "alsIsDeclaration": true, - "detail": "", "range": { "start": { "line": 5, @@ -186,8 +182,7 @@ "line": 5, "character": 17 } - }, - "children": [] + } }, { "kind": 12, @@ -205,7 +200,6 @@ "alsVisibility": 1, "alsIsAdaProcedure": true, "alsIsDeclaration": false, - "detail": "", "range": { "start": { "line": 7, @@ -215,8 +209,7 @@ "line": 11, "character": 11 } - }, - "children": [] + } } ] } diff --git a/testsuite/ada_lsp/SA21-029.documentSymbol.with/test.yaml b/testsuite/ada_lsp/SA21-029.documentSymbol.with/test.yaml index b9f5554d4..4cde640d4 100644 --- a/testsuite/ada_lsp/SA21-029.documentSymbol.with/test.yaml +++ b/testsuite/ada_lsp/SA21-029.documentSymbol.with/test.yaml @@ -1,4 +1 @@ title: 'SA21-029.documentSymbol.with' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/T827-018.documentSymbol.pragma/test.json b/testsuite/ada_lsp/T827-018.documentSymbol.pragma/test.json index de2dc34d2..367b60a4d 100644 --- a/testsuite/ada_lsp/T827-018.documentSymbol.pragma/test.json +++ b/testsuite/ada_lsp/T827-018.documentSymbol.pragma/test.json @@ -105,7 +105,6 @@ }, "alsVisibility": 1, "alsIsDeclaration": false, - "detail": "", "range": { "start": { "line": 0, @@ -144,8 +143,7 @@ "character": 34 } }, - "alsIsAdaProcedure": true, - "children": [] + "alsIsAdaProcedure": true }, { "kind": 12, @@ -173,8 +171,7 @@ "character": 14 } }, - "alsIsAdaProcedure": true, - "children": [] + "alsIsAdaProcedure": true }, { "kind": 12, @@ -191,7 +188,6 @@ }, "alsVisibility": 1, "alsIsDeclaration": true, - "detail": "", "range": { "start": { "line": 16, @@ -202,8 +198,7 @@ "character": 20 } }, - "alsIsAdaProcedure": true, - "children": [] + "alsIsAdaProcedure": true }, { "range": { @@ -245,7 +240,6 @@ }, "alsVisibility": 1, "alsIsDeclaration": false, - "detail": "", "range": { "start": { "line": 23, @@ -256,8 +250,7 @@ "character": 14 } }, - "alsIsAdaProcedure": true, - "children": [] + "alsIsAdaProcedure": true }, { "range": { diff --git a/testsuite/ada_lsp/callgraph.named_blocks/test.json b/testsuite/ada_lsp/callgraph.named_blocks/test.json index 0bf9f5e4d..ddb728afa 100644 --- a/testsuite/ada_lsp/callgraph.named_blocks/test.json +++ b/testsuite/ada_lsp/callgraph.named_blocks/test.json @@ -79,40 +79,12 @@ "result": { "capabilities": { "textDocumentSync": 2, - "completionProvider": { - "triggerCharacters": [ - ".", - ",", - "'", - "(" - ], - "resolveProvider": true - }, "hoverProvider": true, - "declarationProvider": true, - "definitionProvider": true, - "typeDefinitionProvider": true, - "implementationProvider": true, - "referencesProvider": true, "documentHighlightProvider": true, "documentSymbolProvider": true, - "codeActionProvider": {}, - "documentFormattingProvider": true, - "renameProvider": {}, + "codeActionProvider": true, "foldingRangeProvider": true, - "workspaceSymbolProvider": true, - "callHierarchyProvider": {}, - "alsShowDepsProvider": true, - "alsReferenceKinds": [ - "reference", - "access", - "write", - "call", - "dispatching call", - "parent", - "child", - "overriding" - ] + "callHierarchyProvider": true } } } @@ -193,7 +165,6 @@ "result": [ { "name": "P1", - "detail": "", "kind": 12, "range": { "start": { @@ -221,7 +192,6 @@ "children": [ { "name": "A", - "detail": "", "kind": 12, "range": { "start": { @@ -245,12 +215,10 @@ }, "alsIsDeclaration": false, "alsIsAdaProcedure": true, - "alsVisibility": 1, - "children": [] + "alsVisibility": 1 }, { "name": "B", - "detail": "", "kind": 12, "range": { "start": { @@ -274,8 +242,7 @@ }, "alsIsDeclaration": false, "alsIsAdaProcedure": true, - "alsVisibility": 1, - "children": [] + "alsVisibility": 1 } ] } @@ -387,7 +354,7 @@ "wait": [ { "id": "ada-5", - "result": [] + "result": null } ] } @@ -411,7 +378,7 @@ "wait": [ { "id": "ada-6", - "result": [] + "result": null } ] } @@ -476,7 +443,7 @@ "wait": [ { "id": "ada-8", - "result": [] + "result": null } ] } diff --git a/testsuite/ada_lsp/callgraph.named_blocks/test.yaml b/testsuite/ada_lsp/callgraph.named_blocks/test.yaml index e5943b097..5ec3fcae7 100644 --- a/testsuite/ada_lsp/callgraph.named_blocks/test.yaml +++ b/testsuite/ada_lsp/callgraph.named_blocks/test.yaml @@ -1,4 +1 @@ title: 'callgraph.named_blocks' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/get_symbol_hier/test.json b/testsuite/ada_lsp/get_symbol_hier/test.json index bdecdc1e8..a3b34ca88 100644 --- a/testsuite/ada_lsp/get_symbol_hier/test.json +++ b/testsuite/ada_lsp/get_symbol_hier/test.json @@ -82,7 +82,6 @@ "result": [ { "name": "Aaa", - "detail": "", "kind": 4, "range": { "start": { @@ -109,7 +108,6 @@ "children": [ { "name": "Enum", - "detail": "", "kind": 5, "range": { "start": { @@ -133,12 +131,10 @@ }, "alsIsDeclaration": true, "alsIsAdaProcedure": true, - "alsVisibility": 1, - "children": [] + "alsVisibility": 1 }, { "name": "Variable", - "detail": "", "kind": 13, "range": { "start": { @@ -161,13 +157,10 @@ } }, "alsIsDeclaration": false, - "alsVisibility": 1, - "children": [ - ] + "alsVisibility": 1 }, { "name": "Nested_Package", - "detail": "", "kind": 4, "range": { "start": { @@ -218,9 +211,7 @@ }, "alsIsDeclaration": true, "alsIsAdaProcedure": true, - "alsVisibility": 1, - "children": [ - ] + "alsVisibility": 1 } ] } diff --git a/testsuite/ada_lsp/get_symbol_hier/test.yaml b/testsuite/ada_lsp/get_symbol_hier/test.yaml index 92253d150..b8e2fcdcb 100644 --- a/testsuite/ada_lsp/get_symbol_hier/test.yaml +++ b/testsuite/ada_lsp/get_symbol_hier/test.yaml @@ -1,4 +1 @@ title: 'get_symbol_hier' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] From 94fee8341517dfa35d0bbf8453434b5f93ec1fbb Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Mon, 11 Sep 2023 19:10:57 +0300 Subject: [PATCH 122/152] Use navigatio policy in requests Refs #1170 --- source/ada/lsp-ada_configurations.adb | 8 ++-- source/ada/lsp-ada_configurations.ads | 13 +++--- source/ada/lsp-ada_handlers.adb | 42 ++++++++++--------- .../test.json | 37 +--------------- .../test.yaml | 3 -- 5 files changed, 35 insertions(+), 68 deletions(-) diff --git a/source/ada/lsp-ada_configurations.adb b/source/ada/lsp-ada_configurations.adb index 23818def2..3d3ec648f 100644 --- a/source/ada/lsp-ada_configurations.adb +++ b/source/ada/lsp-ada_configurations.adb @@ -31,8 +31,8 @@ package body LSP.Ada_Configurations is VSS.Strings.To_Virtual_String (Item'Wide_Wide_Image).To_Lowercase]; Display_Method_Values : constant VSS.String_Vectors.Virtual_String_Vector := - [for Item in DisplayMethodAncestryOnNavigationPolicy => - VSS.Strings.To_Virtual_String (Item'Wide_Wide_Image).To_Lowercase]; + [for Item in LSP.Enumerations.AlsDisplayMethodAncestryOnNavigationPolicy + => VSS.Strings.To_Virtual_String (Item'Wide_Wide_Image).To_Lowercase]; function "+" (X : VSS.Strings.Virtual_String'Class) return String renames VSS.Strings.Conversions.To_UTF_8_String; @@ -195,8 +195,8 @@ package body LSP.Ada_Configurations is (JSON (Index).String_Value) then Self.Method_Ancestry_Policy := - DisplayMethodAncestryOnNavigationPolicy'Value - (+JSON (Index).String_Value); + LSP.Enumerations.AlsDisplayMethodAncestryOnNavigationPolicy + 'Value (+JSON (Index).String_Value); elsif Name = "followSymlinks" and then JSON (Index).Kind = Boolean_Value diff --git a/source/ada/lsp-ada_configurations.ads b/source/ada/lsp-ada_configurations.ads index d8386b270..512cdbcf0 100644 --- a/source/ada/lsp-ada_configurations.ads +++ b/source/ada/lsp-ada_configurations.ads @@ -21,6 +21,7 @@ private with VSS.Characters.Latin; with VSS.Strings; with VSS.String_Vectors; +with LSP.Enumerations; with LSP.Structures; package LSP.Ada_Configurations is @@ -92,11 +93,8 @@ package LSP.Ada_Configurations is (Self : Configuration'Class) return Variable_List; -- Scenario variables, if provided by the user on Configuration/Init - type DisplayMethodAncestryOnNavigationPolicy is - (Never, Usage_And_Abstract_Only, Definition_Only, Always); - function Display_Method_Ancestry_Policy (Self : Configuration'Class) - return DisplayMethodAncestryOnNavigationPolicy; + return LSP.Enumerations.AlsDisplayMethodAncestryOnNavigationPolicy; function Completion_Formatting return Boolean; -- Used in LSP.Ada_Completions.Pretty_Print_Snippet @@ -132,8 +130,9 @@ private Documentation_Style : GNATdoc.Comments.Options.Documentation_Style := GNATdoc.Comments.Options.GNAT; - Method_Ancestry_Policy : DisplayMethodAncestryOnNavigationPolicy := - Usage_And_Abstract_Only; + Method_Ancestry_Policy : + LSP.Enumerations.AlsDisplayMethodAncestryOnNavigationPolicy := + LSP.Enumerations.Usage_And_Abstract_Only; Variables_Names : VSS.String_Vectors.Virtual_String_Vector; Variables_Values : VSS.String_Vectors.Virtual_String_Vector; @@ -193,7 +192,7 @@ private (Self.Documentation_Style); function Display_Method_Ancestry_Policy (Self : Configuration'Class) - return DisplayMethodAncestryOnNavigationPolicy is + return LSP.Enumerations.AlsDisplayMethodAncestryOnNavigationPolicy is (Self.Method_Ancestry_Policy); function On_Type_Formatting_Settings diff --git a/source/ada/lsp-ada_handlers.adb b/source/ada/lsp-ada_handlers.adb index 298b0a692..72ce837c8 100644 --- a/source/ada/lsp-ada_handlers.adb +++ b/source/ada/lsp-ada_handlers.adb @@ -1768,8 +1768,7 @@ package body LSP.Ada_Handlers is Value : LSP.Structures.DeclarationParams) is use Libadalang.Analysis; - use all type LSP.Ada_Configurations. - DisplayMethodAncestryOnNavigationPolicy; + use all type LSP.Enumerations.AlsDisplayMethodAncestryOnNavigationPolicy; procedure Resolve_In_Context (C : LSP.Ada_Context_Sets.Context_Access); -- Utility function, appends to Vector all results of the @@ -1780,8 +1779,10 @@ package body LSP.Ada_Handlers is Filter : LSP.Ada_Handlers.Locations.File_Span_Sets.Set; Display_Method_Policy : constant - LSP.Ada_Configurations.DisplayMethodAncestryOnNavigationPolicy := - Self.Configuration.Display_Method_Ancestry_Policy; + LSP.Enumerations.AlsDisplayMethodAncestryOnNavigationPolicy := + (if Value.alsDisplayMethodAncestryOnNavigation.Is_Set + then Value.alsDisplayMethodAncestryOnNavigation.Value + else Self.Configuration.Display_Method_Ancestry_Policy); ------------------------ -- Resolve_In_Context -- @@ -1922,8 +1923,7 @@ package body LSP.Ada_Handlers is Value : LSP.Structures.DefinitionParams) is use Libadalang.Analysis; - use all type LSP.Ada_Configurations. - DisplayMethodAncestryOnNavigationPolicy; + use all type LSP.Enumerations.AlsDisplayMethodAncestryOnNavigationPolicy; Trace : constant GNATCOLL.Traces.Trace_Handle := LSP.GNATCOLL_Tracers.Handle (Self.Tracer.all); @@ -1934,9 +1934,11 @@ package body LSP.Ada_Handlers is Imprecise : Boolean := False; - Display_Method_Ancestry_Policy : constant - LSP.Ada_Configurations.DisplayMethodAncestryOnNavigationPolicy := - Self.Configuration.Display_Method_Ancestry_Policy; + Display_Method_Policy : constant + LSP.Enumerations.AlsDisplayMethodAncestryOnNavigationPolicy := + (if Value.alsDisplayMethodAncestryOnNavigation.Is_Set + then Value.alsDisplayMethodAncestryOnNavigation.Value + else Self.Configuration.Display_Method_Ancestry_Policy); procedure Resolve_In_Context (C : LSP.Ada_Context_Sets.Context_Access); -- Utility function, appends to Vector all results of the @@ -1975,7 +1977,7 @@ package body LSP.Ada_Handlers is if not Definition.Is_Null then Self.Append_Location (Vector, Filter, Definition); - if Display_Method_Ancestry_Policy + if Display_Method_Policy in Usage_And_Abstract_Only | Always then Decl_For_Find_Overrides := Definition.P_Basic_Decl; @@ -1988,9 +1990,9 @@ package body LSP.Ada_Handlers is -- Search for overriding subprograms only if we are on an -- abstract subprogram. - if Display_Method_Ancestry_Policy /= Never + if Display_Method_Policy /= Never and then - (Display_Method_Ancestry_Policy /= Usage_And_Abstract_Only + (Display_Method_Policy /= Usage_And_Abstract_Only or else Definition_Node.Kind in Ada_Abstract_Subp_Decl_Range) then Decl_For_Find_Overrides := Definition_Node; @@ -3036,9 +3038,11 @@ package body LSP.Ada_Handlers is Vector : LSP.Structures.Location_Vector renames Response.Variant_1; Filter : LSP.Ada_Handlers.Locations.File_Span_Sets.Set; - Display_Method_Ancestry_Policy : constant - LSP.Ada_Configurations.DisplayMethodAncestryOnNavigationPolicy := - Self.Configuration.Display_Method_Ancestry_Policy; + Display_Method_Policy : constant + LSP.Enumerations.AlsDisplayMethodAncestryOnNavigationPolicy := + (if Value.alsDisplayMethodAncestryOnNavigation.Is_Set + then Value.alsDisplayMethodAncestryOnNavigation.Value + else Self.Configuration.Display_Method_Ancestry_Policy); procedure Resolve_In_Context (C : LSP.Ada_Context_Sets.Context_Access); -- Utility function to gather results on one context @@ -3049,8 +3053,8 @@ package body LSP.Ada_Handlers is procedure Resolve_In_Context (C : LSP.Ada_Context_Sets.Context_Access) is - use all type LSP.Ada_Configurations. - DisplayMethodAncestryOnNavigationPolicy; + use all type LSP.Enumerations + .AlsDisplayMethodAncestryOnNavigationPolicy; use Libadalang.Common; @@ -3104,9 +3108,9 @@ package body LSP.Ada_Handlers is -- Display overriding/overridden subprograms depending on the -- displayMethodAncestryOnNavigation flag. - if Display_Method_Ancestry_Policy in Definition_Only | Always + if Display_Method_Policy in Definition_Only | Always or else - (Display_Method_Ancestry_Policy = Usage_And_Abstract_Only + (Display_Method_Policy = Usage_And_Abstract_Only and then Decl.Kind in Ada_Abstract_Subp_Decl_Range) then for Subp of C.Find_All_Base_Declarations (Decl, Imprecise) diff --git a/testsuite/ada_lsp/declaration.overridings_on_usage/test.json b/testsuite/ada_lsp/declaration.overridings_on_usage/test.json index c0213fb7f..12f0775f6 100644 --- a/testsuite/ada_lsp/declaration.overridings_on_usage/test.json +++ b/testsuite/ada_lsp/declaration.overridings_on_usage/test.json @@ -79,39 +79,7 @@ "result": { "capabilities": { "textDocumentSync": 2, - "completionProvider": { - "triggerCharacters": [ - ".", - ",", - "'", - "(" - ], - "resolveProvider": true - }, - "hoverProvider": true, - "declarationProvider": true, - "definitionProvider": true, - "typeDefinitionProvider": true, - "implementationProvider": true, - "referencesProvider": true, - "codeActionProvider": {}, - "documentFormattingProvider": true, - "renameProvider": {}, - "foldingRangeProvider": true, - "executeCommandProvider": {}, - "workspaceSymbolProvider": true, - "callHierarchyProvider": {}, - "alsShowDepsProvider": true, - "alsReferenceKinds": [ - "reference", - "access", - "write", - "call", - "dispatching call", - "parent", - "child", - "overriding" - ] + "declarationProvider": true } } } @@ -269,7 +237,7 @@ "wait": [ { "id": "ada-8", - "result": [ + "result": { "uri": "$URI{class_definition.ads}", "range": { @@ -283,7 +251,6 @@ } } } - ] } ] } diff --git a/testsuite/ada_lsp/declaration.overridings_on_usage/test.yaml b/testsuite/ada_lsp/declaration.overridings_on_usage/test.yaml index c268d3d59..2cf12ec5b 100644 --- a/testsuite/ada_lsp/declaration.overridings_on_usage/test.yaml +++ b/testsuite/ada_lsp/declaration.overridings_on_usage/test.yaml @@ -1,4 +1 @@ title: 'declaration.overridings_on_usage' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] From e1180d86db931e5d892b524e53c33fafa546b89c Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Tue, 12 Sep 2023 12:40:34 +0300 Subject: [PATCH 123/152] Add extra properties to `WorkspaceSymbolParams` Add `query` property to `DocumentSymbolParams`. Refs #1170 --- doc/metaModel.patch.json | 49 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/doc/metaModel.patch.json b/doc/metaModel.patch.json index 2bb33e487..e71ad62c0 100644 --- a/doc/metaModel.patch.json +++ b/doc/metaModel.patch.json @@ -244,6 +244,15 @@ { "name": "DocumentSymbolParams", "properties": [ + { + "name": "query", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "A query string to filter symbols by. Clients may send an empty\nstring here to request all symbols." + }, { "name": "case_sensitive", "type": { @@ -313,6 +322,46 @@ "documentation": "List of reference kind supported by the server." } ] + }, + { + "name": "WorkspaceSymbolParams", + "properties": [ + { + "name": "case_sensitive", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "To take letters' case into account." + }, + { + "name": "whole_word", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "To match the whole word instead of a part of it." + }, + { + "name": "negate", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "To invert matching." + }, + { + "name": "kind", + "type": { + "kind": "reference", + "name": "AlsSearchKind" + }, + "optional": true + } + ] } ] } From 9aad6bce37831396bb652e15f7d1a601ff6cbd13 Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Tue, 12 Sep 2023 12:50:30 +0300 Subject: [PATCH 124/152] Regenerate LSP code after changes in `metaModel.patch.json` Refs #1170 --- source/lsp_3.17/generated/lsp-inputs.adb | 42 +++++++++++++++++--- source/lsp_3.17/generated/lsp-outputs.adb | 20 ++++++++++ source/lsp_3.17/generated/lsp-structures.ads | 15 +++++++ 3 files changed, 72 insertions(+), 5 deletions(-) diff --git a/source/lsp_3.17/generated/lsp-inputs.adb b/source/lsp_3.17/generated/lsp-inputs.adb index b8cafa3d3..639a1d3d0 100644 --- a/source/lsp_3.17/generated/lsp-inputs.adb +++ b/source/lsp_3.17/generated/lsp-inputs.adb @@ -6218,7 +6218,11 @@ package body LSP.Inputs is package WorkspaceSymbolParams_Map is new Minimal_Perfect_Hash (["workDoneToken", "partialResultToken", - "query"]); + "query", + "case_sensitive", + "whole_word", + "negate", + "kind"]); end WorkspaceSymbolParams_Scope; @@ -6251,6 +6255,29 @@ package body LSP.Inputs is Value.query.Clear; Value.query.Append (Handler.String_Value); Handler.Read_Next; + when 4 => -- case_sensitive + Value.case_sensitive := + (Is_Set => True, + Value => <>); + Value.case_sensitive.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 5 => -- whole_word + Value.whole_word := + (Is_Set => True, + Value => <>); + Value.whole_word.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 6 => -- negate + Value.negate := + (Is_Set => True, + Value => <>); + Value.negate.Value := Handler.Boolean_Value; + Handler.Read_Next; + when 7 => -- kind + Value.kind := + (Is_Set => True, + Value => <>); + Read_AlsSearchKind (Handler, Value.kind.Value); when others => Handler.Skip_Current_Value; end case; @@ -19667,6 +19694,7 @@ package body LSP.Inputs is (["workDoneToken", "partialResultToken", "textDocument", + "query", "case_sensitive", "whole_word", "negate", @@ -19701,25 +19729,29 @@ package body LSP.Inputs is Read_ProgressToken (Handler, Value.partialResultToken.Value); when 3 => -- textDocument Read_TextDocumentIdentifier (Handler, Value.textDocument); - when 4 => -- case_sensitive + when 4 => -- query + Value.query.Clear; + Value.query.Append (Handler.String_Value); + Handler.Read_Next; + when 5 => -- case_sensitive Value.case_sensitive := (Is_Set => True, Value => <>); Value.case_sensitive.Value := Handler.Boolean_Value; Handler.Read_Next; - when 5 => -- whole_word + when 6 => -- whole_word Value.whole_word := (Is_Set => True, Value => <>); Value.whole_word.Value := Handler.Boolean_Value; Handler.Read_Next; - when 6 => -- negate + when 7 => -- negate Value.negate := (Is_Set => True, Value => <>); Value.negate.Value := Handler.Boolean_Value; Handler.Read_Next; - when 7 => -- kind + when 8 => -- kind Value.kind := (Is_Set => True, Value => <>); diff --git a/source/lsp_3.17/generated/lsp-outputs.adb b/source/lsp_3.17/generated/lsp-outputs.adb index dc77f2ddd..7956cb0f5 100644 --- a/source/lsp_3.17/generated/lsp-outputs.adb +++ b/source/lsp_3.17/generated/lsp-outputs.adb @@ -3533,6 +3533,22 @@ package body LSP.Outputs is end if; Handler.Key_Name ("query"); Handler.String_Value (Value.query); + if Value.case_sensitive.Is_Set then + Handler.Key_Name ("case_sensitive"); + Handler.Boolean_Value (Value.case_sensitive.Value); + end if; + if Value.whole_word.Is_Set then + Handler.Key_Name ("whole_word"); + Handler.Boolean_Value (Value.whole_word.Value); + end if; + if Value.negate.Is_Set then + Handler.Key_Name ("negate"); + Handler.Boolean_Value (Value.negate.Value); + end if; + if Value.kind.Is_Set then + Handler.Key_Name ("kind"); + Write_AlsSearchKind (Handler, Value.kind.Value); + end if; Handler.End_Object; end Write_WorkspaceSymbolParams; @@ -9459,6 +9475,10 @@ package body LSP.Outputs is end if; Handler.Key_Name ("textDocument"); Write_TextDocumentIdentifier (Handler, Value.textDocument); + if not Value.query.Is_Null then + Handler.Key_Name ("query"); + Handler.String_Value (Value.query); + end if; if Value.case_sensitive.Is_Set then Handler.Key_Name ("case_sensitive"); Handler.Boolean_Value (Value.case_sensitive.Value); diff --git a/source/lsp_3.17/generated/lsp-structures.ads b/source/lsp_3.17/generated/lsp-structures.ads index 6609981b8..a35f669a0 100644 --- a/source/lsp_3.17/generated/lsp-structures.ads +++ b/source/lsp_3.17/generated/lsp-structures.ads @@ -5206,6 +5206,10 @@ package LSP.Structures is textDocument : LSP.Structures.TextDocumentIdentifier; -- The text document. + query : Virtual_String_Optional; + -- A query string to filter symbols by. Clients may send an empty string + -- here to request all symbols. + case_sensitive : Boolean_Optional; -- To take letters' case into account. @@ -8528,6 +8532,17 @@ package LSP.Structures is -- A query string to filter symbols by. Clients may send an empty string -- here to request all symbols. + case_sensitive : Boolean_Optional; + -- To take letters' case into account. + + whole_word : Boolean_Optional; + -- To match the whole word instead of a part of it. + + negate : Boolean_Optional; + -- To invert matching. + + kind : AlsSearchKind_Optional; + end record; -- The parameters of a [WorkspaceSymbolRequest](#WorkspaceSymbolRequest). From 28c3dc875b0196684e35c10a64d8d60e2f10ab9f Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Tue, 12 Sep 2023 13:05:04 +0300 Subject: [PATCH 125/152] Restore extra search methods in symbols requests. Refs #1170 --- gnat/ignore_in_317.txt | 10 ---- source/ada/lsp-ada_documents.adb | 4 +- source/ada/lsp-ada_handlers-invisibles.adb | 3 +- source/ada/lsp-ada_handlers.adb | 38 ++++++++++---- source/ada/lsp-search-approximate.adb | 2 +- source/ada/lsp-search-full_text.adb | 2 +- source/ada/lsp-search-fuzzy.adb | 2 +- source/ada/lsp-search-regexp.adb | 2 +- source/ada/lsp-search-start_word.adb | 2 +- source/ada/lsp-search.adb | 58 ++++++++++++++++++--- source/ada/lsp-search.ads | 9 ++-- testsuite/ada_lsp/T826-026.search/test.json | 46 +--------------- testsuite/ada_lsp/T826-026.search/test.yaml | 3 -- 13 files changed, 96 insertions(+), 85 deletions(-) diff --git a/gnat/ignore_in_317.txt b/gnat/ignore_in_317.txt index 6e26369fc..8e6ca1a19 100644 --- a/gnat/ignore_in_317.txt +++ b/gnat/ignore_in_317.txt @@ -10,16 +10,6 @@ lsp-fuzz_decorators.adb lsp-fuzz_decorators.ads lsp-lal_utils.adb lsp-lal_utils.ads -lsp-search-approximate.adb -lsp-search-approximate.ads -lsp-search-empty.adb -lsp-search-empty.ads -lsp-search-full_text.adb -lsp-search-full_text.ads -lsp-search-fuzzy.adb -lsp-search-fuzzy.ads -lsp-search-regexp.adb -lsp-search-regexp.ads lsp-file_monitors.ads lsp-message_loggers.adb lsp-message_loggers.ads diff --git a/source/ada/lsp-ada_documents.adb b/source/ada/lsp-ada_documents.adb index ef2368e1f..d9b81d008 100644 --- a/source/ada/lsp-ada_documents.adb +++ b/source/ada/lsp-ada_documents.adb @@ -1321,9 +1321,9 @@ package body LSP.Ada_Documents is -- matches lowercased pattern as is. Use_Celling : constant Boolean := not Pattern.Get_Negate - and then ((Pattern.Get_Kind = LSP.Search.Full_Text + and then ((Pattern.Get_Kind = LSP.Enumerations.Full_Text and then Pattern.Get_Whole_Word) - or else Pattern.Get_Kind = LSP.Search.Start_Word_Text); + or else Pattern.Get_Kind = LSP.Enumerations.Start_Word_Text); begin if Self.Refresh_Symbol_Cache then diff --git a/source/ada/lsp-ada_handlers-invisibles.adb b/source/ada/lsp-ada_handlers-invisibles.adb index 94b3fa90a..b0a7a5b7c 100644 --- a/source/ada/lsp-ada_handlers-invisibles.adb +++ b/source/ada/lsp-ada_handlers-invisibles.adb @@ -19,6 +19,7 @@ with GNATCOLL.VFS; with VSS.Strings; +with LSP.Enumerations; with LSP.Search; with LSP.Utils; @@ -136,7 +137,7 @@ package body LSP.Ada_Handlers.Invisibles is Case_Sensitive => False, Whole_Word => False, Negate => False, - Kind => LSP.Search.Start_Word_Text); + Kind => LSP.Enumerations.Start_Word_Text); begin Self.Context.Get_Any_Symbol (Pattern => Pattern, diff --git a/source/ada/lsp-ada_handlers.adb b/source/ada/lsp-ada_handlers.adb index 72ce837c8..a3d9d1e7e 100644 --- a/source/ada/lsp-ada_handlers.adb +++ b/source/ada/lsp-ada_handlers.adb @@ -2731,6 +2731,8 @@ package body LSP.Ada_Handlers is Id : LSP.Structures.Integer_Or_Virtual_String; Value : LSP.Structures.DocumentSymbolParams) is + use type LSP.Structures.Boolean_Optional; + Context : constant LSP.Ada_Context_Sets.Context_Access := Self.Contexts.Get_Best_Context (Value.textDocument.uri); @@ -2738,17 +2740,26 @@ package body LSP.Ada_Handlers is Context.Get_AU (Self.To_File (Value.textDocument.uri)); Response : LSP.Structures.DocumentSymbol_Result; - Dummy : LSP.Search.Search_Pattern'Class := - LSP.Search.Build ("", Kind => LSP.Search.Start_Word_Text); + + Pattern : constant LSP.Search.Search_Pattern'Class := + LSP.Search.Build + (Pattern => Value.query, + Case_Sensitive => Value.case_sensitive = LSP.Constants.True, + Whole_Word => Value.whole_word = LSP.Constants.True, + Negate => Value.negate = LSP.Constants.True, + Kind => + (if Value.kind.Is_Set + then Value.kind.Value + else LSP.Enumerations.Start_Word_Text)); begin if Self.Client.Hierarchical_Symbol then Response := (Kind => LSP.Structures.Variant_2, Variant_2 => <>); LSP.Ada_Handlers.Symbols.Hierarchical_Document_Symbols - (Self, Unit, Dummy, Response.Variant_2); + (Self, Unit, Pattern, Response.Variant_2); else LSP.Ada_Handlers.Symbols.Flat_Document_Symbols - (Self, Unit, Dummy, Response); + (Self, Unit, Pattern, Response); end if; Self.Sender.On_DocumentSymbol_Response (Id, Response); @@ -4265,14 +4276,23 @@ package body LSP.Ada_Handlers is Partial_Response_Sended := True; end Send_Partial_Response; - Response : LSP.Structures.Symbol_Result (LSP.Structures.Variant_1); + use type LSP.Structures.Boolean_Optional; - Pattern : constant LSP.Search.Search_Pattern'Class := LSP.Search.Build - (Pattern => Value.query, - Kind => LSP.Search.Start_Word_Text); + Pattern : constant LSP.Search.Search_Pattern'Class := + LSP.Search.Build + (Pattern => Value.query, + Case_Sensitive => Value.case_sensitive = LSP.Constants.True, + Whole_Word => Value.whole_word = LSP.Constants.True, + Negate => Value.negate = LSP.Constants.True, + Kind => + (if Value.kind.Is_Set + then Value.kind.Value + else LSP.Enumerations.Start_Word_Text)); + + Response : LSP.Structures.Symbol_Result (LSP.Structures.Variant_1); begin - if Pattern.Get_Kind /= LSP.Search.Start_Word_Text + if Pattern.Get_Kind /= LSP.Enumerations.Start_Word_Text and then Pattern.Get_Canonical_Pattern.Character_Length < 2 then -- Do not process too small pattern because diff --git a/source/ada/lsp-search-approximate.adb b/source/ada/lsp-search-approximate.adb index 04b13cd44..52cb3ede3 100644 --- a/source/ada/lsp-search-approximate.adb +++ b/source/ada/lsp-search-approximate.adb @@ -76,7 +76,7 @@ package body LSP.Search.Approximate is Text => Pattern, Case_Sensitive => Case_Sensitive, Whole_Word => Whole_Word, - Kind => LSP.Messages.Approximate, + Kind => LSP.Enumerations.Approximate, Negate => Negate, Pattern => Mask, Max_Errors => diff --git a/source/ada/lsp-search-full_text.adb b/source/ada/lsp-search-full_text.adb index 3d282c50b..aa6bb14e6 100644 --- a/source/ada/lsp-search-full_text.adb +++ b/source/ada/lsp-search-full_text.adb @@ -48,7 +48,7 @@ package body LSP.Search.Full_Text is Case_Sensitive => Case_Sensitive, Negate => Negate, Whole_Word => Whole_Word, - Kind => LSP.Messages.Full_Text); + Kind => LSP.Enumerations.Full_Text); end Build; -------------- diff --git a/source/ada/lsp-search-fuzzy.adb b/source/ada/lsp-search-fuzzy.adb index eaeb662c5..36c36af2d 100644 --- a/source/ada/lsp-search-fuzzy.adb +++ b/source/ada/lsp-search-fuzzy.adb @@ -38,7 +38,7 @@ package body LSP.Search.Fuzzy is Case_Sensitive => Case_Sensitive, Whole_Word => Whole_Word, Negate => Negate, - Kind => LSP.Messages.Fuzzy); + Kind => LSP.Enumerations.Fuzzy); end Build; ----------- diff --git a/source/ada/lsp-search-regexp.adb b/source/ada/lsp-search-regexp.adb index fce976868..3358d39e2 100644 --- a/source/ada/lsp-search-regexp.adb +++ b/source/ada/lsp-search-regexp.adb @@ -56,7 +56,7 @@ package body LSP.Search.Regexp is Text => Pattern, Case_Sensitive => Case_Sensitive, Whole_Word => Whole_Word, - Kind => LSP.Messages.Regexp, + Kind => LSP.Enumerations.Regexp, Negate => Negate); end Build; diff --git a/source/ada/lsp-search-start_word.adb b/source/ada/lsp-search-start_word.adb index 5751a75af..d2c3dea3a 100644 --- a/source/ada/lsp-search-start_word.adb +++ b/source/ada/lsp-search-start_word.adb @@ -35,7 +35,7 @@ package body LSP.Search.Start_Word is Case_Sensitive => Case_Sensitive, Negate => Negate, Whole_Word => Whole_Word, - Kind => Start_Word_Text); + Kind => LSP.Enumerations.Start_Word_Text); end Build; -------------- diff --git a/source/ada/lsp-search.adb b/source/ada/lsp-search.adb index bd8e3de76..905365ef7 100644 --- a/source/ada/lsp-search.adb +++ b/source/ada/lsp-search.adb @@ -15,6 +15,13 @@ -- of the license. -- ------------------------------------------------------------------------------ +with GNAT.Regpat; + +with LSP.Search.Approximate; +with LSP.Search.Empty; +with LSP.Search.Full_Text; +with LSP.Search.Fuzzy; +with LSP.Search.Regexp; with LSP.Search.Start_Word; with LSP.Utils; @@ -29,15 +36,52 @@ package body LSP.Search is Case_Sensitive : Boolean := False; Whole_Word : Boolean := False; Negate : Boolean := False; - Kind : Search_Kind := Full_Text) - return Search_Pattern'Class is + Kind : Search_Kind := LSP.Enumerations.Full_Text) + return Search_Pattern'Class + is + function Fixed_Case_Pattern return VSS.Strings.Virtual_String + is (if Case_Sensitive then Pattern + else LSP.Utils.Canonicalize (Pattern)); + begin + if Pattern.Is_Empty then + return LSP.Search.Empty.Build; + end if; + case Kind is - when Start_Word_Text => - return Start_Word.Build - (Pattern, Case_Sensitive, Whole_Word, Negate); - when others => - raise Program_Error with "Unimplemented"; -- FIXME + when LSP.Enumerations.Full_Text => + return LSP.Search.Full_Text.Build + (Fixed_Case_Pattern, Case_Sensitive, Whole_Word, Negate); + + when LSP.Enumerations.Start_Word_Text => + return LSP.Search.Start_Word.Build + (Fixed_Case_Pattern, Case_Sensitive, Whole_Word, Negate); + + when LSP.Enumerations.Fuzzy => + return LSP.Search.Fuzzy.Build + (Fixed_Case_Pattern, Case_Sensitive, Whole_Word, Negate); + + when LSP.Enumerations.Approximate => + if Pattern.Character_Length not in 4 .. 63 then + -- Fallback to Full_Text, pattern is too long or too short + return LSP.Search.Full_Text.Build + (Fixed_Case_Pattern, Case_Sensitive, Whole_Word, Negate); + + else + return LSP.Search.Approximate.Build + (Fixed_Case_Pattern, Case_Sensitive, Whole_Word, Negate); + end if; + + when LSP.Enumerations.Regexp => + begin + return LSP.Search.Regexp.Build + (Fixed_Case_Pattern, Case_Sensitive, Whole_Word, Negate); + exception + when GNAT.Regpat.Expression_Error => + return LSP.Search.Full_Text.Build + (Fixed_Case_Pattern, Case_Sensitive, Whole_Word, Negate); + end; + end case; end Build; diff --git a/source/ada/lsp-search.ads b/source/ada/lsp-search.ads index 053a91652..0667ae6f4 100644 --- a/source/ada/lsp-search.ads +++ b/source/ada/lsp-search.ads @@ -19,10 +19,11 @@ with Ada.Finalization; with VSS.Strings; +with LSP.Enumerations; + package LSP.Search is - type Search_Kind is - (Full_Text, Regexp, Fuzzy, Approximate, Start_Word_Text); + subtype Search_Kind is LSP.Enumerations.AlsSearchKind; -- A Full_Text match searches the pattern exactly in the contents. -- -- A Start_Word_Text works like a Full_Text but tested word should mutch @@ -61,7 +62,7 @@ package LSP.Search is Case_Sensitive : Boolean := False; Whole_Word : Boolean := False; Negate : Boolean := False; - Kind : Search_Kind := Full_Text) + Kind : Search_Kind := LSP.Enumerations.Full_Text) return Search_Pattern'Class; -- Create a new search matcher. -- It can be shared among multiple search providers, since it does not @@ -102,7 +103,7 @@ private Text : VSS.Strings.Virtual_String; Case_Sensitive : Boolean := False; Whole_Word : Boolean := False; - Kind : Search_Kind := Full_Text; + Kind : Search_Kind := LSP.Enumerations.Full_Text; Negate : Boolean := False; end record; diff --git a/testsuite/ada_lsp/T826-026.search/test.json b/testsuite/ada_lsp/T826-026.search/test.json index 84eac978f..e001e33b9 100644 --- a/testsuite/ada_lsp/T826-026.search/test.json +++ b/testsuite/ada_lsp/T826-026.search/test.json @@ -79,49 +79,7 @@ "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": {}, - "documentFormattingProvider": true, - "renameProvider": {}, - "foldingRangeProvider": true, - "workspaceSymbolProvider": true, - "callHierarchyProvider": {}, - "alsShowDepsProvider": true, - "alsReferenceKinds": [ - "reference", - "access", - "write", - "call", - "dispatching call", - "parent", - "child", - "overriding" - ] + "workspaceSymbolProvider": true } } } @@ -422,4 +380,4 @@ "exit_code": 0 } } -] \ No newline at end of file +] diff --git a/testsuite/ada_lsp/T826-026.search/test.yaml b/testsuite/ada_lsp/T826-026.search/test.yaml index 628562203..91d90bd5d 100644 --- a/testsuite/ada_lsp/T826-026.search/test.yaml +++ b/testsuite/ada_lsp/T826-026.search/test.yaml @@ -1,4 +1 @@ title: 'T826-026.search' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] From 70a05409dc5bfd3708e6487b2be4d50d32842add Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Tue, 12 Sep 2023 13:43:03 +0300 Subject: [PATCH 126/152] Fix more tests Refs #1170 --- testsuite/ada_lsp/completion.invisible.runtime/test.json | 2 +- testsuite/ada_lsp/completion.invisible.runtime/test.yaml | 2 -- testsuite/ada_lsp/project_config/project_config_2.json | 4 ++-- testsuite/ada_lsp/project_config/test.yaml | 3 --- testsuite/ada_lsp/project_symlinks/test.json | 4 ++-- testsuite/ada_lsp/project_symlinks/test.yaml | 2 -- 6 files changed, 5 insertions(+), 12 deletions(-) diff --git a/testsuite/ada_lsp/completion.invisible.runtime/test.json b/testsuite/ada_lsp/completion.invisible.runtime/test.json index ac372540d..deff3a437 100644 --- a/testsuite/ada_lsp/completion.invisible.runtime/test.json +++ b/testsuite/ada_lsp/completion.invisible.runtime/test.json @@ -179,7 +179,7 @@ "kind": 9, "detail": "package Ada.Decimal", "documentation": "at a-decima.ads (38:1)\n\nThe compiler makes a number of assumptions based on the following five\nconstants (e.g. there is an assumption that decimal values can always\nbe represented in 128-bit signed binary form), so code modifications are\nrequired to increase these constants.", - "sortText": "~100&08Decimal", + "sortText": "~100&00008Decimal", "filterText": "Decimal", "insertText": "Decimal" } diff --git a/testsuite/ada_lsp/completion.invisible.runtime/test.yaml b/testsuite/ada_lsp/completion.invisible.runtime/test.yaml index 84d769199..3f6cfc0ad 100644 --- a/testsuite/ada_lsp/completion.invisible.runtime/test.yaml +++ b/testsuite/ada_lsp/completion.invisible.runtime/test.yaml @@ -3,5 +3,3 @@ title: 'completion.invisible.runtime' # different depending on the platform skip: - ['SKIP', 'env.build.os.name != "linux"'] - # Skip till 3.17 ready - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/project_config/project_config_2.json b/testsuite/ada_lsp/project_config/project_config_2.json index 9dfe23285..dc2ed3c86 100644 --- a/testsuite/ada_lsp/project_config/project_config_2.json +++ b/testsuite/ada_lsp/project_config/project_config_2.json @@ -75,7 +75,7 @@ }, "wait":[{ "id": "defname-1", - "result":[{ + "result":{ "uri": "$URI{third.ads}", "range": { "start": { @@ -87,7 +87,7 @@ "character": 22 } } - }] + } }] } }, { diff --git a/testsuite/ada_lsp/project_config/test.yaml b/testsuite/ada_lsp/project_config/test.yaml index 27896db8e..06e6e95fa 100644 --- a/testsuite/ada_lsp/project_config/test.yaml +++ b/testsuite/ada_lsp/project_config/test.yaml @@ -1,4 +1 @@ title: 'project_config' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/project_symlinks/test.json b/testsuite/ada_lsp/project_symlinks/test.json index c09b97dcb..00f061974 100644 --- a/testsuite/ada_lsp/project_symlinks/test.json +++ b/testsuite/ada_lsp/project_symlinks/test.json @@ -76,7 +76,7 @@ } } }, - "wait":{ + "wait": [{ "id": "defname-1", "result":{ "uri": "$URI{link/aaa.ads}", @@ -91,7 +91,7 @@ } } } - } + }] } }, { "send": { diff --git a/testsuite/ada_lsp/project_symlinks/test.yaml b/testsuite/ada_lsp/project_symlinks/test.yaml index 6d279b3f8..4a1e46c99 100644 --- a/testsuite/ada_lsp/project_symlinks/test.yaml +++ b/testsuite/ada_lsp/project_symlinks/test.yaml @@ -1,5 +1,3 @@ title: 'project_symlinks' skip: - ['SKIP', 'env.build.os.name == "windows"'] - # Skip till 3.17 ready - - ['XFAIL', 'True'] From 3b2055d9b2b945730800175ca6c6ce14edc9d1b8 Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Tue, 12 Sep 2023 17:01:51 +0300 Subject: [PATCH 127/152] Move LSP.Commands into `ada/` Refs #1170 --- .../lsp-ada_commands.adb} | 4 +- .../lsp-ada_commands.ads} | 14 ++----- source/ada/lsp-ada_driver.adb | 36 +++++++++--------- ...ada_handlers-named_parameters_commands.adb | 12 +++--- ...ada_handlers-named_parameters_commands.ads | 15 +++----- .../lsp-ada_handlers-other_file_commands.adb | 23 ++++-------- .../lsp-ada_handlers-other_file_commands.ads | 13 ++----- ...p-ada_handlers-project_reload_commands.adb | 16 ++------ ...p-ada_handlers-project_reload_commands.ads | 13 ++----- ...sp-ada_handlers-refactor-add_parameter.adb | 5 +-- ...sp-ada_handlers-refactor-add_parameter.ads | 6 +-- ...andlers-refactor-change_parameter_mode.adb | 5 +-- ...andlers-refactor-change_parameter_mode.ads | 7 +--- ...factor-change_parameters_default_value.adb | 5 +-- ...factor-change_parameters_default_value.ads | 6 +-- ...ndlers-refactor-change_parameters_type.adb | 5 +-- ...ndlers-refactor-change_parameters_type.ads | 7 +--- ...a_handlers-refactor-extract_subprogram.adb | 5 +-- ...a_handlers-refactor-extract_subprogram.ads | 6 +-- ...ada_handlers-refactor-imports_commands.adb | 5 +-- ...ada_handlers-refactor-imports_commands.ads | 6 +-- ..._handlers-refactor-introduce_parameter.adb | 5 +-- ..._handlers-refactor-introduce_parameter.ads | 6 +-- ...p-ada_handlers-refactor-move_parameter.adb | 5 +-- ...p-ada_handlers-refactor-move_parameter.ads | 7 +--- ..._handlers-refactor-pull_up_declaration.adb | 5 +-- ..._handlers-refactor-pull_up_declaration.ads | 6 +-- ...ada_handlers-refactor-remove_parameter.adb | 5 +-- ...ada_handlers-refactor-remove_parameter.ads | 7 +--- ...lsp-ada_handlers-refactor-replace_type.adb | 5 +-- ...lsp-ada_handlers-refactor-replace_type.ads | 6 +-- ...da_handlers-refactor-sort_dependencies.adb | 5 +-- ...da_handlers-refactor-sort_dependencies.ads | 6 +-- ...da_handlers-refactor-suppress_seperate.adb | 5 +-- ...da_handlers-refactor-suppress_seperate.ads | 7 +--- source/ada/lsp-ada_handlers-refactor.adb | 37 +++++++------------ source/ada/lsp-ada_handlers-refactor.ads | 18 +++------ .../lsp-ada_handlers-suspend_executions.adb | 13 ++----- .../lsp-ada_handlers-suspend_executions.ads | 13 ++----- source/ada/lsp-ada_handlers.adb | 15 +++----- .../ada_lsp/refactoring_diagnostics/test.yaml | 3 -- 41 files changed, 111 insertions(+), 282 deletions(-) rename source/{lsp_3.17/lsp-commands.adb => ada/lsp-ada_commands.adb} (97%) rename source/{lsp_3.17/lsp-commands.ads => ada/lsp-ada_commands.ads} (84%) diff --git a/source/lsp_3.17/lsp-commands.adb b/source/ada/lsp-ada_commands.adb similarity index 97% rename from source/lsp_3.17/lsp-commands.adb rename to source/ada/lsp-ada_commands.adb index a4bcfc308..51e31af81 100644 --- a/source/lsp_3.17/lsp-commands.adb +++ b/source/ada/lsp-ada_commands.adb @@ -17,7 +17,7 @@ with VSS.Strings.Conversions; -package body LSP.Commands is +package body LSP.Ada_Commands is Command_Name_List : VSS.String_Vectors.Virtual_String_Vector; @@ -43,4 +43,4 @@ package body LSP.Commands is return Command_Name_List; end All_Commands; -end LSP.Commands; +end LSP.Ada_Commands; diff --git a/source/lsp_3.17/lsp-commands.ads b/source/ada/lsp-ada_commands.ads similarity index 84% rename from source/lsp_3.17/lsp-commands.ads rename to source/ada/lsp-ada_commands.ads index 198f67c16..62980df62 100644 --- a/source/lsp_3.17/lsp-commands.ads +++ b/source/ada/lsp-ada_commands.ads @@ -29,10 +29,9 @@ with VSS.String_Vectors; with LSP.Structures; with LSP.Errors; -limited with LSP.Client_Message_Receivers; -limited with LSP.Server_Notification_Receivers; +limited with LSP.Ada_Handlers; -package LSP.Commands is +package LSP.Ada_Commands is type Command is abstract tagged null record; type Command_Access is access all Command'Class with Storage_Size => 0; @@ -43,14 +42,9 @@ package LSP.Commands is procedure Execute (Self : Command; - Handler : not null access - LSP.Server_Notification_Receivers.Server_Notification_Receiver'Class; - Sender : not null access LSP.Client_Message_Receivers. - Client_Message_Receiver'Class; - Id : LSP.Structures.Integer_Or_Virtual_String; + Handler : not null access LSP.Ada_Handlers.Message_Handler'Class; Error : in out LSP.Errors.ResponseError_Optional) is abstract; -- Execute given command and return Error is something went wrong. - -- Use Client object to send requests and notifications to the client. -- Commands are executed on the server side only. -- The Handler is the access to the message handler executing the command. @@ -60,4 +54,4 @@ package LSP.Commands is function All_Commands return VSS.String_Vectors.Virtual_String_Vector; -- Return all registered command names. -end LSP.Commands; +end LSP.Ada_Commands; diff --git a/source/ada/lsp-ada_driver.adb b/source/ada/lsp-ada_driver.adb index 56a483b0c..f92c124bb 100644 --- a/source/ada/lsp-ada_driver.adb +++ b/source/ada/lsp-ada_driver.adb @@ -37,6 +37,7 @@ with GNATCOLL.Traces; use GNATCOLL.Traces; with GNATCOLL.VFS; use GNATCOLL.VFS; with GNATCOLL.Utils; +with LSP.Ada_Commands; with LSP.Ada_Handlers; with LSP.Ada_Handlers.Named_Parameters_Commands; with LSP.Ada_Handlers.Other_File_Commands; @@ -55,7 +56,6 @@ with LSP.Ada_Handlers.Refactor.Replace_Type; with LSP.Ada_Handlers.Refactor.Sort_Dependencies; with LSP.Ada_Handlers.Refactor.Suppress_Seperate; with LSP.Ada_Handlers.Suspend_Executions; -with LSP.Commands; with LSP.GNATCOLL_Tracers; with LSP.Memory_Statistics; with LSP.Servers; @@ -78,41 +78,41 @@ procedure LSP.Ada_Driver is procedure Register_Commands is begin - LSP.Commands.Register + LSP.Ada_Commands.Register (LSP.Ada_Handlers.Other_File_Commands.Command'Tag); - LSP.Commands.Register + LSP.Ada_Commands.Register (LSP.Ada_Handlers.Suspend_Executions.Suspend_Execution'Tag); - LSP.Commands.Register + LSP.Ada_Commands.Register (LSP.Ada_Handlers.Project_Reload_Commands.Command'Tag); - LSP.Commands.Register + LSP.Ada_Commands.Register (LSP.Ada_Handlers.Named_Parameters_Commands.Command'Tag); - LSP.Commands.Register + LSP.Ada_Commands.Register (LSP.Ada_Handlers.Refactor.Imports_Commands.Command'Tag); - LSP.Commands.Register + LSP.Ada_Commands.Register (LSP.Ada_Handlers.Refactor.Suppress_Seperate.Command'Tag); - LSP.Commands.Register + LSP.Ada_Commands.Register (LSP.Ada_Handlers.Refactor.Extract_Subprogram.Command'Tag); - LSP.Commands.Register + LSP.Ada_Commands.Register (LSP.Ada_Handlers.Refactor.Introduce_Parameter.Command'Tag); - LSP.Commands.Register + LSP.Ada_Commands.Register (LSP.Ada_Handlers.Refactor.Pull_Up_Declaration.Command'Tag); - LSP.Commands.Register + LSP.Ada_Commands.Register (LSP.Ada_Handlers.Refactor.Replace_Type.Command'Tag); - LSP.Commands.Register + LSP.Ada_Commands.Register (LSP.Ada_Handlers.Refactor.Sort_Dependencies.Command'Tag); -- Refactoring - Change Subprogram Signature Commands - LSP.Commands.Register + LSP.Ada_Commands.Register (LSP.Ada_Handlers.Refactor.Add_Parameter.Command'Tag); - LSP.Commands.Register + LSP.Ada_Commands.Register (LSP.Ada_Handlers.Refactor.Remove_Parameter.Command'Tag); - LSP.Commands.Register + LSP.Ada_Commands.Register (LSP.Ada_Handlers.Refactor.Move_Parameter.Command'Tag); - LSP.Commands.Register + LSP.Ada_Commands.Register (LSP.Ada_Handlers.Refactor.Change_Parameter_Mode.Command'Tag); - LSP.Commands.Register + LSP.Ada_Commands.Register (LSP.Ada_Handlers.Refactor.Change_Parameters_Type.Command'Tag); - LSP.Commands.Register + LSP.Ada_Commands.Register (LSP.Ada_Handlers.Refactor.Change_Parameters_Default_Value. Command'Tag); end Register_Commands; diff --git a/source/ada/lsp-ada_handlers-named_parameters_commands.adb b/source/ada/lsp-ada_handlers-named_parameters_commands.adb index ebec38c23..0cbc4a01d 100644 --- a/source/ada/lsp-ada_handlers-named_parameters_commands.adb +++ b/source/ada/lsp-ada_handlers-named_parameters_commands.adb @@ -27,6 +27,7 @@ with Libadalang.Common; with LSP.Ada_Contexts; with LSP.Constants; with LSP.Enumerations; +with LSP.Servers; with LSP.Structures.LSPAny_Vectors; use LSP.Structures.LSPAny_Vectors; with LSP.Utils; @@ -146,12 +147,8 @@ package body LSP.Ada_Handlers.Named_Parameters_Commands is overriding procedure Execute (Self : Command; - Handler : not null access - LSP.Server_Notification_Receivers.Server_Notification_Receiver'Class; - Client : not null access - LSP.Client_Message_Receivers.Client_Message_Receiver'Class; - Id : LSP.Structures.Integer_Or_Virtual_String; - Error : in out LSP.Errors.ResponseError_Optional) + Handler : not null access LSP.Ada_Handlers.Message_Handler'Class; + Error : in out LSP.Errors.ResponseError_Optional) is use LSP.Structures; @@ -287,7 +284,8 @@ package body LSP.Ada_Handlers.Named_Parameters_Commands is Index := Index - 1; end loop; - Client.On_ApplyEdit_Request (Id, Apply); + Handler.Sender.On_ApplyEdit_Request + (Handler.Server.Allocate_Request_Id, Apply); exception when E : others => Error := diff --git a/source/ada/lsp-ada_handlers-named_parameters_commands.ads b/source/ada/lsp-ada_handlers-named_parameters_commands.ads index 93eeb0845..acf0553a3 100644 --- a/source/ada/lsp-ada_handlers-named_parameters_commands.ads +++ b/source/ada/lsp-ada_handlers-named_parameters_commands.ads @@ -18,13 +18,12 @@ -- Implementation of the command to refactor positional parameters into -- named parameters in given subprogram call. -with LSP.Client_Message_Receivers; -with LSP.Commands; +with LSP.Ada_Commands; with LSP.Errors; package LSP.Ada_Handlers.Named_Parameters_Commands is - type Command is new LSP.Commands.Command with private; + type Command is new LSP.Ada_Commands.Command with private; procedure Initialize (Self : in out Command'Class; @@ -42,7 +41,7 @@ package LSP.Ada_Handlers.Named_Parameters_Commands is private - type Command is new LSP.Commands.Command with record + type Command is new LSP.Ada_Commands.Command with record Context : VSS.Strings.Virtual_String; Where : LSP.Structures.TextDocumentPositionParams; Versioned_Documents : Boolean := True; @@ -54,12 +53,8 @@ private overriding procedure Execute (Self : Command; - Handler : not null access - LSP.Server_Notification_Receivers.Server_Notification_Receiver'Class; - Client : not null access - LSP.Client_Message_Receivers.Client_Message_Receiver'Class; - Id : LSP.Structures.Integer_Or_Virtual_String; - Error : in out LSP.Errors.ResponseError_Optional); + Handler : not null access LSP.Ada_Handlers.Message_Handler'Class; + Error : in out LSP.Errors.ResponseError_Optional); function Write_Command (Self : Command) return LSP.Structures.LSPAny_Vector; diff --git a/source/ada/lsp-ada_handlers-other_file_commands.adb b/source/ada/lsp-ada_handlers-other_file_commands.adb index 20d7bf607..347d516a3 100644 --- a/source/ada/lsp-ada_handlers-other_file_commands.adb +++ b/source/ada/lsp-ada_handlers-other_file_commands.adb @@ -75,18 +75,11 @@ package body LSP.Ada_Handlers.Other_File_Commands is overriding procedure Execute (Self : Command; - Handler : not null access - LSP.Server_Notification_Receivers.Server_Notification_Receiver'Class; - Sender : not null access LSP.Client_Message_Receivers. - Client_Message_Receiver'Class; - Id : LSP.Structures.Integer_Or_Virtual_String; + Handler : not null access LSP.Ada_Handlers.Message_Handler'Class; Error : in out LSP.Errors.ResponseError_Optional) is - Message_Handler : LSP.Ada_Handlers.Message_Handler renames - LSP.Ada_Handlers.Message_Handler (Handler.all); - File : constant GNATCOLL.VFS.Virtual_File := - Message_Handler.To_File (Self.URI); + Handler.To_File (Self.URI); function Other_File return GNATCOLL.VFS.Virtual_File; @@ -97,7 +90,7 @@ package body LSP.Ada_Handlers.Other_File_Commands is function Other_File return GNATCOLL.VFS.Virtual_File is F : constant GPR2.Path_Name.Object := GPR2.Path_Name.Create (File); begin - for V in Message_Handler.Project_Tree.Iterate + for V in Handler.Project_Tree.Iterate (Status => (GPR2.Project.S_Externally_Built => GNATCOLL.Tribooleans.Indeterminate)) loop @@ -115,10 +108,10 @@ package body LSP.Ada_Handlers.Other_File_Commands is end; end loop; - if Message_Handler.Project_Tree.Has_Runtime_Project then + if Handler.Project_Tree.Has_Runtime_Project then declare Source : constant GPR2.Project.Source.Object := - Message_Handler.Project_Tree.Runtime_Project. + Handler.Project_Tree.Runtime_Project. Source (F); Other_Part : GPR2.Project.Source.Source_Part; begin @@ -134,7 +127,7 @@ package body LSP.Ada_Handlers.Other_File_Commands is end Other_File; URI : constant LSP.Structures.DocumentUri := - Message_Handler.To_URI (Other_File.Display_Full_Name); + Handler.To_URI (Other_File.Display_Full_Name); Message : constant LSP.Structures.ShowDocumentParams := (uri => (VSS.Strings.Virtual_String (URI) with null record), @@ -142,9 +135,9 @@ package body LSP.Ada_Handlers.Other_File_Commands is others => <>); New_Id : constant LSP.Structures.Integer_Or_Virtual_String := - Message_Handler.Server.Allocate_Request_Id; + Handler.Server.Allocate_Request_Id; begin - Sender.On_ShowDocument_Request (New_Id, Message); + Handler.Sender.On_ShowDocument_Request (New_Id, Message); end Execute; ---------------- diff --git a/source/ada/lsp-ada_handlers-other_file_commands.ads b/source/ada/lsp-ada_handlers-other_file_commands.ads index e35f32978..1375af459 100644 --- a/source/ada/lsp-ada_handlers-other_file_commands.ads +++ b/source/ada/lsp-ada_handlers-other_file_commands.ads @@ -17,13 +17,12 @@ -- -- Implementation of the command to switch from .adb to .ads file and back. -with LSP.Client_Message_Receivers; -with LSP.Commands; +with LSP.Ada_Commands; with LSP.Errors; package LSP.Ada_Handlers.Other_File_Commands is - type Command is new LSP.Commands.Command with private; + type Command is new LSP.Ada_Commands.Command with private; procedure Initialize (Self : in out Command'Class; @@ -31,7 +30,7 @@ package LSP.Ada_Handlers.Other_File_Commands is private - type Command is new LSP.Commands.Command with record + type Command is new LSP.Ada_Commands.Command with record URI : LSP.Structures.DocumentUri; end record; @@ -41,11 +40,7 @@ private overriding procedure Execute (Self : Command; - Handler : not null access - LSP.Server_Notification_Receivers.Server_Notification_Receiver'Class; - Sender : not null access LSP.Client_Message_Receivers. - Client_Message_Receiver'Class; - Id : LSP.Structures.Integer_Or_Virtual_String; + Handler : not null access LSP.Ada_Handlers.Message_Handler'Class; Error : in out LSP.Errors.ResponseError_Optional); for Command'External_Tag use "als-other-file"; diff --git a/source/ada/lsp-ada_handlers-project_reload_commands.adb b/source/ada/lsp-ada_handlers-project_reload_commands.adb index c8e05c15d..ba3e9013f 100644 --- a/source/ada/lsp-ada_handlers-project_reload_commands.adb +++ b/source/ada/lsp-ada_handlers-project_reload_commands.adb @@ -29,7 +29,7 @@ package body LSP.Ada_Handlers.Project_Reload_Commands is is pragma Unreferenced (Any); begin - return (LSP.Commands.Command with null record); + return (LSP.Ada_Commands.Command with null record); end Create; ------------- @@ -38,18 +38,10 @@ package body LSP.Ada_Handlers.Project_Reload_Commands is overriding procedure Execute (Self : Command; - Handler : not null access - LSP.Server_Notification_Receivers.Server_Notification_Receiver'Class; - Sender : not null access LSP.Client_Message_Receivers. - Client_Message_Receiver'Class; - Id : LSP.Structures.Integer_Or_Virtual_String; - Error : in out LSP.Errors.ResponseError_Optional) - is - Message_Handler : LSP.Ada_Handlers.Message_Handler renames - LSP.Ada_Handlers.Message_Handler (Handler.all); - + Handler : not null access LSP.Ada_Handlers.Message_Handler'Class; + Error : in out LSP.Errors.ResponseError_Optional) is begin - LSP.Ada_Handlers.Project_Loading.Reload_Project (Message_Handler); + LSP.Ada_Handlers.Project_Loading.Reload_Project (Handler.all); end Execute; end LSP.Ada_Handlers.Project_Reload_Commands; diff --git a/source/ada/lsp-ada_handlers-project_reload_commands.ads b/source/ada/lsp-ada_handlers-project_reload_commands.ads index a09123758..1f453bd73 100644 --- a/source/ada/lsp-ada_handlers-project_reload_commands.ads +++ b/source/ada/lsp-ada_handlers-project_reload_commands.ads @@ -17,17 +17,16 @@ -- -- Implementation of the command to reload current project. -with LSP.Client_Message_Receivers; -with LSP.Commands; +with LSP.Ada_Commands; with LSP.Errors; package LSP.Ada_Handlers.Project_Reload_Commands is - type Command is new LSP.Commands.Command with private; + type Command is new LSP.Ada_Commands.Command with private; private - type Command is new LSP.Commands.Command with null record; + type Command is new LSP.Ada_Commands.Command with null record; overriding function Create (Any : not null access LSP.Structures.LSPAny_Vector) @@ -35,11 +34,7 @@ private overriding procedure Execute (Self : Command; - Handler : not null access - LSP.Server_Notification_Receivers.Server_Notification_Receiver'Class; - Sender : not null access LSP.Client_Message_Receivers. - Client_Message_Receiver'Class; - Id : LSP.Structures.Integer_Or_Virtual_String; + Handler : not null access LSP.Ada_Handlers.Message_Handler'Class; Error : in out LSP.Errors.ResponseError_Optional); for Command'External_Tag use "als-reload-project"; diff --git a/source/ada/lsp-ada_handlers-refactor-add_parameter.adb b/source/ada/lsp-ada_handlers-refactor-add_parameter.adb index efe0cadaf..a42b620a2 100644 --- a/source/ada/lsp-ada_handlers-refactor-add_parameter.adb +++ b/source/ada/lsp-ada_handlers-refactor-add_parameter.adb @@ -130,10 +130,7 @@ package body LSP.Ada_Handlers.Refactor.Add_Parameter is overriding procedure Refactor (Self : Command; - Handler : not null access LSP.Server_Notification_Receivers. - Server_Notification_Receiver'Class; - Client : not null access LSP.Client_Message_Receivers. - Client_Message_Receiver'Class; + Handler : not null access LSP.Ada_Handlers.Message_Handler'Class; Edits : out LAL_Refactor.Refactoring_Edits) is use Langkit_Support.Slocs; diff --git a/source/ada/lsp-ada_handlers-refactor-add_parameter.ads b/source/ada/lsp-ada_handlers-refactor-add_parameter.ads index 88a635646..4160c3ce6 100644 --- a/source/ada/lsp-ada_handlers-refactor-add_parameter.ads +++ b/source/ada/lsp-ada_handlers-refactor-add_parameter.ads @@ -18,7 +18,6 @@ -- Implementation of the refactoring command to add parameters with LSP.Ada_Contexts; -with LSP.Client_Message_Receivers; with VSS.Strings; @@ -57,10 +56,7 @@ private overriding procedure Refactor (Self : Command; - Handler : not null access - LSP.Server_Notification_Receivers.Server_Notification_Receiver'Class; - Client : not null access - LSP.Client_Message_Receivers.Client_Message_Receiver'Class; + Handler : not null access LSP.Ada_Handlers.Message_Handler'Class; Edits : out LAL_Refactor.Refactoring_Edits); -- Executes Self by computing the necessary refactorings diff --git a/source/ada/lsp-ada_handlers-refactor-change_parameter_mode.adb b/source/ada/lsp-ada_handlers-refactor-change_parameter_mode.adb index 1ff9949f2..107b7b572 100644 --- a/source/ada/lsp-ada_handlers-refactor-change_parameter_mode.adb +++ b/source/ada/lsp-ada_handlers-refactor-change_parameter_mode.adb @@ -247,10 +247,7 @@ package body LSP.Ada_Handlers.Refactor.Change_Parameter_Mode is overriding procedure Refactor (Self : Command; - Handler : not null access LSP.Server_Notification_Receivers. - Server_Notification_Receiver'Class; - Client : not null access LSP.Client_Message_Receivers. - Client_Message_Receiver'Class; + Handler : not null access LSP.Ada_Handlers.Message_Handler'Class; Edits : out LAL_Refactor.Refactoring_Edits) is use LAL_Refactor; diff --git a/source/ada/lsp-ada_handlers-refactor-change_parameter_mode.ads b/source/ada/lsp-ada_handlers-refactor-change_parameter_mode.ads index 002862196..cec8e116d 100644 --- a/source/ada/lsp-ada_handlers-refactor-change_parameter_mode.ads +++ b/source/ada/lsp-ada_handlers-refactor-change_parameter_mode.ads @@ -19,8 +19,6 @@ private with VSS.Strings; -with LSP.Client_Message_Receivers; - with Libadalang.Analysis; with Libadalang.Common; @@ -62,10 +60,7 @@ private overriding procedure Refactor (Self : Command; - Handler : not null access - LSP.Server_Notification_Receivers.Server_Notification_Receiver'Class; - Client : not null access - LSP.Client_Message_Receivers.Client_Message_Receiver'Class; + Handler : not null access LSP.Ada_Handlers.Message_Handler'Class; Edits : out LAL_Refactor.Refactoring_Edits); -- Executes Self by computing the necessary refactorings diff --git a/source/ada/lsp-ada_handlers-refactor-change_parameters_default_value.adb b/source/ada/lsp-ada_handlers-refactor-change_parameters_default_value.adb index 762159536..18761185f 100644 --- a/source/ada/lsp-ada_handlers-refactor-change_parameters_default_value.adb +++ b/source/ada/lsp-ada_handlers-refactor-change_parameters_default_value.adb @@ -132,10 +132,7 @@ package body LSP.Ada_Handlers.Refactor.Change_Parameters_Default_Value is overriding procedure Refactor (Self : Command; - Handler : not null access LSP.Server_Notification_Receivers. - Server_Notification_Receiver'Class; - Client : not null access LSP.Client_Message_Receivers. - Client_Message_Receiver'Class; + Handler : not null access LSP.Ada_Handlers.Message_Handler'Class; Edits : out LAL_Refactor.Refactoring_Edits) is use LAL_Refactor; diff --git a/source/ada/lsp-ada_handlers-refactor-change_parameters_default_value.ads b/source/ada/lsp-ada_handlers-refactor-change_parameters_default_value.ads index 840efbf50..9baf6d188 100644 --- a/source/ada/lsp-ada_handlers-refactor-change_parameters_default_value.ads +++ b/source/ada/lsp-ada_handlers-refactor-change_parameters_default_value.ads @@ -19,7 +19,6 @@ -- parameter default value with LSP.Ada_Contexts; -with LSP.Client_Message_Receivers; private with VSS.Strings; @@ -55,10 +54,7 @@ private overriding procedure Refactor (Self : Command; - Handler : not null access - LSP.Server_Notification_Receivers.Server_Notification_Receiver'Class; - Client : not null access - LSP.Client_Message_Receivers.Client_Message_Receiver'Class; + Handler : not null access LSP.Ada_Handlers.Message_Handler'Class; Edits : out LAL_Refactor.Refactoring_Edits); -- Executes Self by computing the necessary refactorings diff --git a/source/ada/lsp-ada_handlers-refactor-change_parameters_type.adb b/source/ada/lsp-ada_handlers-refactor-change_parameters_type.adb index ffaef9d6a..970c73352 100644 --- a/source/ada/lsp-ada_handlers-refactor-change_parameters_type.adb +++ b/source/ada/lsp-ada_handlers-refactor-change_parameters_type.adb @@ -177,10 +177,7 @@ package body LSP.Ada_Handlers.Refactor.Change_Parameters_Type is overriding procedure Refactor (Self : Command; - Handler : not null access LSP.Server_Notification_Receivers. - Server_Notification_Receiver'Class; - Client : not null access LSP.Client_Message_Receivers. - Client_Message_Receiver'Class; + Handler : not null access LSP.Ada_Handlers.Message_Handler'Class; Edits : out LAL_Refactor.Refactoring_Edits) is use LAL_Refactor; diff --git a/source/ada/lsp-ada_handlers-refactor-change_parameters_type.ads b/source/ada/lsp-ada_handlers-refactor-change_parameters_type.ads index ad2ba5953..7af1dc8a4 100644 --- a/source/ada/lsp-ada_handlers-refactor-change_parameters_type.ads +++ b/source/ada/lsp-ada_handlers-refactor-change_parameters_type.ads @@ -20,8 +20,6 @@ with Laltools.Common; -with LSP.Client_Message_Receivers; - private with VSS.String_Vectors; private with LSP.Ada_Contexts; @@ -59,10 +57,7 @@ private overriding procedure Refactor (Self : Command; - Handler : not null access - LSP.Server_Notification_Receivers.Server_Notification_Receiver'Class; - Client : not null access - LSP.Client_Message_Receivers.Client_Message_Receiver'Class; + Handler : not null access LSP.Ada_Handlers.Message_Handler'Class; Edits : out LAL_Refactor.Refactoring_Edits); -- Executes Self by computing the necessary refactorings diff --git a/source/ada/lsp-ada_handlers-refactor-extract_subprogram.adb b/source/ada/lsp-ada_handlers-refactor-extract_subprogram.adb index 549fd4f4b..dcbcfa8bb 100644 --- a/source/ada/lsp-ada_handlers-refactor-extract_subprogram.adb +++ b/source/ada/lsp-ada_handlers-refactor-extract_subprogram.adb @@ -137,10 +137,7 @@ package body LSP.Ada_Handlers.Refactor.Extract_Subprogram is overriding procedure Refactor (Self : Command; - Handler : not null access LSP.Server_Notification_Receivers. - Server_Notification_Receiver'Class; - Client : not null access LSP.Client_Message_Receivers. - Client_Message_Receiver'Class; + Handler : not null access LSP.Ada_Handlers.Message_Handler'Class; Edits : out LAL_Refactor.Refactoring_Edits) is Message_Handler : LSP.Ada_Handlers.Message_Handler renames diff --git a/source/ada/lsp-ada_handlers-refactor-extract_subprogram.ads b/source/ada/lsp-ada_handlers-refactor-extract_subprogram.ads index 6be24f469..900d379c7 100644 --- a/source/ada/lsp-ada_handlers-refactor-extract_subprogram.ads +++ b/source/ada/lsp-ada_handlers-refactor-extract_subprogram.ads @@ -20,7 +20,6 @@ with Libadalang.Common; with LSP.Ada_Contexts; -with LSP.Client_Message_Receivers; with VSS.Strings; @@ -57,10 +56,7 @@ private overriding procedure Refactor (Self : Command; - Handler : not null access - LSP.Server_Notification_Receivers.Server_Notification_Receiver'Class; - Client : not null access - LSP.Client_Message_Receivers.Client_Message_Receiver'Class; + Handler : not null access LSP.Ada_Handlers.Message_Handler'Class; Edits : out LAL_Refactor.Refactoring_Edits); -- Executes Self by computing the necessary refactorings diff --git a/source/ada/lsp-ada_handlers-refactor-imports_commands.adb b/source/ada/lsp-ada_handlers-refactor-imports_commands.adb index c8b58bcdd..9f3a23ae9 100644 --- a/source/ada/lsp-ada_handlers-refactor-imports_commands.adb +++ b/source/ada/lsp-ada_handlers-refactor-imports_commands.adb @@ -324,10 +324,7 @@ package body LSP.Ada_Handlers.Refactor.Imports_Commands is overriding procedure Refactor (Self : Command; - Handler : not null access LSP.Server_Notification_Receivers. - Server_Notification_Receiver'Class; - Client : not null access LSP.Client_Message_Receivers. - Client_Message_Receiver'Class; + Handler : not null access LSP.Ada_Handlers.Message_Handler'Class; Edits : out LAL_Refactor.Refactoring_Edits) is use LAL_Refactor; diff --git a/source/ada/lsp-ada_handlers-refactor-imports_commands.ads b/source/ada/lsp-ada_handlers-refactor-imports_commands.ads index b0abe9a36..bb1a267d4 100644 --- a/source/ada/lsp-ada_handlers-refactor-imports_commands.ads +++ b/source/ada/lsp-ada_handlers-refactor-imports_commands.ads @@ -21,7 +21,6 @@ with LAL_Refactor; with LAL_Refactor.Refactor_Imports; with LSP.Ada_Contexts; -with LSP.Client_Message_Receivers; package LSP.Ada_Handlers.Refactor.Imports_Commands is @@ -63,10 +62,7 @@ private overriding procedure Refactor (Self : Command; - Handler : not null access - LSP.Server_Notification_Receivers.Server_Notification_Receiver'Class; - Client : not null access - LSP.Client_Message_Receivers.Client_Message_Receiver'Class; + Handler : not null access LSP.Ada_Handlers.Message_Handler'Class; Edits : out LAL_Refactor.Refactoring_Edits); function Write_Command diff --git a/source/ada/lsp-ada_handlers-refactor-introduce_parameter.adb b/source/ada/lsp-ada_handlers-refactor-introduce_parameter.adb index f7151560a..e4fc8e346 100644 --- a/source/ada/lsp-ada_handlers-refactor-introduce_parameter.adb +++ b/source/ada/lsp-ada_handlers-refactor-introduce_parameter.adb @@ -117,10 +117,7 @@ package body LSP.Ada_Handlers.Refactor.Introduce_Parameter is overriding procedure Refactor (Self : Command; - Handler : not null access LSP.Server_Notification_Receivers. - Server_Notification_Receiver'Class; - Client : not null access LSP.Client_Message_Receivers. - Client_Message_Receiver'Class; + Handler : not null access LSP.Ada_Handlers.Message_Handler'Class; Edits : out LAL_Refactor.Refactoring_Edits) is use Langkit_Support.Slocs; diff --git a/source/ada/lsp-ada_handlers-refactor-introduce_parameter.ads b/source/ada/lsp-ada_handlers-refactor-introduce_parameter.ads index d66c471cd..f3dd2f633 100644 --- a/source/ada/lsp-ada_handlers-refactor-introduce_parameter.ads +++ b/source/ada/lsp-ada_handlers-refactor-introduce_parameter.ads @@ -18,7 +18,6 @@ -- Implementation of the refactoring tool to introduce a parameter with LSP.Ada_Contexts; -with LSP.Client_Message_Receivers; with VSS.Strings; @@ -53,10 +52,7 @@ private overriding procedure Refactor (Self : Command; - Handler : not null access - LSP.Server_Notification_Receivers.Server_Notification_Receiver'Class; - Client : not null access - LSP.Client_Message_Receivers.Client_Message_Receiver'Class; + Handler : not null access LSP.Ada_Handlers.Message_Handler'Class; Edits : out LAL_Refactor.Refactoring_Edits); -- Executes Self by computing the necessary refactorings diff --git a/source/ada/lsp-ada_handlers-refactor-move_parameter.adb b/source/ada/lsp-ada_handlers-refactor-move_parameter.adb index 7313a34d6..45be7401e 100644 --- a/source/ada/lsp-ada_handlers-refactor-move_parameter.adb +++ b/source/ada/lsp-ada_handlers-refactor-move_parameter.adb @@ -193,10 +193,7 @@ package body LSP.Ada_Handlers.Refactor.Move_Parameter is overriding procedure Refactor (Self : Command; - Handler : not null access LSP.Server_Notification_Receivers. - Server_Notification_Receiver'Class; - Client : not null access LSP.Client_Message_Receivers. - Client_Message_Receiver'Class; + Handler : not null access LSP.Ada_Handlers.Message_Handler'Class; Edits : out LAL_Refactor.Refactoring_Edits) is use LAL_Refactor; diff --git a/source/ada/lsp-ada_handlers-refactor-move_parameter.ads b/source/ada/lsp-ada_handlers-refactor-move_parameter.ads index e6eb709e6..1b1c56471 100644 --- a/source/ada/lsp-ada_handlers-refactor-move_parameter.ads +++ b/source/ada/lsp-ada_handlers-refactor-move_parameter.ads @@ -20,8 +20,6 @@ private with VSS.Strings; -with LSP.Client_Message_Receivers; - with LAL_Refactor.Subprogram_Signature; use LAL_Refactor.Subprogram_Signature; @@ -60,10 +58,7 @@ private overriding procedure Refactor (Self : Command; - Handler : not null access - LSP.Server_Notification_Receivers.Server_Notification_Receiver'Class; - Client : not null access - LSP.Client_Message_Receivers.Client_Message_Receiver'Class; + Handler : not null access LSP.Ada_Handlers.Message_Handler'Class; Edits : out LAL_Refactor.Refactoring_Edits); -- Executes Self by computing the necessary refactorings diff --git a/source/ada/lsp-ada_handlers-refactor-pull_up_declaration.adb b/source/ada/lsp-ada_handlers-refactor-pull_up_declaration.adb index c2693c150..d2f9a3097 100644 --- a/source/ada/lsp-ada_handlers-refactor-pull_up_declaration.adb +++ b/source/ada/lsp-ada_handlers-refactor-pull_up_declaration.adb @@ -120,10 +120,7 @@ package body LSP.Ada_Handlers.Refactor.Pull_Up_Declaration is overriding procedure Refactor (Self : Command; - Handler : not null access LSP.Server_Notification_Receivers. - Server_Notification_Receiver'Class; - Client : not null access LSP.Client_Message_Receivers. - Client_Message_Receiver'Class; + Handler : not null access LSP.Ada_Handlers.Message_Handler'Class; Edits : out LAL_Refactor.Refactoring_Edits) is use Langkit_Support.Slocs; diff --git a/source/ada/lsp-ada_handlers-refactor-pull_up_declaration.ads b/source/ada/lsp-ada_handlers-refactor-pull_up_declaration.ads index 1676b1a63..b0435c825 100644 --- a/source/ada/lsp-ada_handlers-refactor-pull_up_declaration.ads +++ b/source/ada/lsp-ada_handlers-refactor-pull_up_declaration.ads @@ -18,7 +18,6 @@ -- Implementation of the refactoring command to extract a declaration with LSP.Ada_Contexts; -with LSP.Client_Message_Receivers; private with VSS.Strings; @@ -53,10 +52,7 @@ private overriding procedure Refactor (Self : Command; - Handler : not null access - LSP.Server_Notification_Receivers.Server_Notification_Receiver'Class; - Client : not null access - LSP.Client_Message_Receivers.Client_Message_Receiver'Class; + Handler : not null access LSP.Ada_Handlers.Message_Handler'Class; Edits : out LAL_Refactor.Refactoring_Edits); -- Executes Self by computing the necessary refactorings diff --git a/source/ada/lsp-ada_handlers-refactor-remove_parameter.adb b/source/ada/lsp-ada_handlers-refactor-remove_parameter.adb index d57b61c67..1d4dba8f6 100644 --- a/source/ada/lsp-ada_handlers-refactor-remove_parameter.adb +++ b/source/ada/lsp-ada_handlers-refactor-remove_parameter.adb @@ -181,10 +181,7 @@ package body LSP.Ada_Handlers.Refactor.Remove_Parameter is overriding procedure Refactor (Self : Command; - Handler : not null access LSP.Server_Notification_Receivers. - Server_Notification_Receiver'Class; - Client : not null access LSP.Client_Message_Receivers. - Client_Message_Receiver'Class; + Handler : not null access LSP.Ada_Handlers.Message_Handler'Class; Edits : out LAL_Refactor.Refactoring_Edits) is use LAL_Refactor; diff --git a/source/ada/lsp-ada_handlers-refactor-remove_parameter.ads b/source/ada/lsp-ada_handlers-refactor-remove_parameter.ads index 698417024..61976c158 100644 --- a/source/ada/lsp-ada_handlers-refactor-remove_parameter.ads +++ b/source/ada/lsp-ada_handlers-refactor-remove_parameter.ads @@ -19,8 +19,6 @@ private with VSS.Strings; -with LSP.Client_Message_Receivers; - with Libadalang.Analysis; with LAL_Refactor.Subprogram_Signature; @@ -58,10 +56,7 @@ private overriding procedure Refactor (Self : Command; - Handler : not null access - LSP.Server_Notification_Receivers.Server_Notification_Receiver'Class; - Client : not null access - LSP.Client_Message_Receivers.Client_Message_Receiver'Class; + Handler : not null access LSP.Ada_Handlers.Message_Handler'Class; Edits : out LAL_Refactor.Refactoring_Edits); -- Executes Self by computing the necessary refactorings diff --git a/source/ada/lsp-ada_handlers-refactor-replace_type.adb b/source/ada/lsp-ada_handlers-refactor-replace_type.adb index 51ca52c02..7ec9e65fb 100644 --- a/source/ada/lsp-ada_handlers-refactor-replace_type.adb +++ b/source/ada/lsp-ada_handlers-refactor-replace_type.adb @@ -124,10 +124,7 @@ package body LSP.Ada_Handlers.Refactor.Replace_Type is overriding procedure Refactor (Self : Command; - Handler : not null access LSP.Server_Notification_Receivers. - Server_Notification_Receiver'Class; - Client : not null access LSP.Client_Message_Receivers. - Client_Message_Receiver'Class; + Handler : not null access LSP.Ada_Handlers.Message_Handler'Class; Edits : out LAL_Refactor.Refactoring_Edits) is use Langkit_Support.Slocs; diff --git a/source/ada/lsp-ada_handlers-refactor-replace_type.ads b/source/ada/lsp-ada_handlers-refactor-replace_type.ads index ff12525ac..e8f6e233f 100644 --- a/source/ada/lsp-ada_handlers-refactor-replace_type.ads +++ b/source/ada/lsp-ada_handlers-refactor-replace_type.ads @@ -18,7 +18,6 @@ -- Implementation of the refactoring command to replace a type with LSP.Ada_Contexts; -with LSP.Client_Message_Receivers; private with VSS.Strings; @@ -54,10 +53,7 @@ private overriding procedure Refactor (Self : Command; - Handler : not null access - LSP.Server_Notification_Receivers.Server_Notification_Receiver'Class; - Client : not null access - LSP.Client_Message_Receivers.Client_Message_Receiver'Class; + Handler : not null access LSP.Ada_Handlers.Message_Handler'Class; Edits : out LAL_Refactor.Refactoring_Edits); -- Executes Self by computing the necessary refactorings diff --git a/source/ada/lsp-ada_handlers-refactor-sort_dependencies.adb b/source/ada/lsp-ada_handlers-refactor-sort_dependencies.adb index ff3c1442d..8712a487d 100644 --- a/source/ada/lsp-ada_handlers-refactor-sort_dependencies.adb +++ b/source/ada/lsp-ada_handlers-refactor-sort_dependencies.adb @@ -123,10 +123,7 @@ package body LSP.Ada_Handlers.Refactor.Sort_Dependencies is overriding procedure Refactor (Self : Command; - Handler : not null access LSP.Server_Notification_Receivers. - Server_Notification_Receiver'Class; - Client : not null access LSP.Client_Message_Receivers. - Client_Message_Receiver'Class; + Handler : not null access LSP.Ada_Handlers.Message_Handler'Class; Edits : out LAL_Refactor.Refactoring_Edits) is use Langkit_Support.Slocs; diff --git a/source/ada/lsp-ada_handlers-refactor-sort_dependencies.ads b/source/ada/lsp-ada_handlers-refactor-sort_dependencies.ads index 01d2aa94e..38b1a0430 100644 --- a/source/ada/lsp-ada_handlers-refactor-sort_dependencies.ads +++ b/source/ada/lsp-ada_handlers-refactor-sort_dependencies.ads @@ -18,7 +18,6 @@ -- Implementation of the refactoring command to sort dependencies with LSP.Ada_Contexts; -with LSP.Client_Message_Receivers; private with VSS.Strings; @@ -53,10 +52,7 @@ private overriding procedure Refactor (Self : Command; - Handler : not null access - LSP.Server_Notification_Receivers.Server_Notification_Receiver'Class; - Client : not null access - LSP.Client_Message_Receivers.Client_Message_Receiver'Class; + Handler : not null access LSP.Ada_Handlers.Message_Handler'Class; Edits : out LAL_Refactor.Refactoring_Edits); -- Executes Self by computing the necessary refactorings diff --git a/source/ada/lsp-ada_handlers-refactor-suppress_seperate.adb b/source/ada/lsp-ada_handlers-refactor-suppress_seperate.adb index d8a76177a..e88c5c3b8 100644 --- a/source/ada/lsp-ada_handlers-refactor-suppress_seperate.adb +++ b/source/ada/lsp-ada_handlers-refactor-suppress_seperate.adb @@ -130,10 +130,7 @@ package body LSP.Ada_Handlers.Refactor.Suppress_Seperate is overriding procedure Refactor (Self : Command; - Handler : not null access LSP.Server_Notification_Receivers. - Server_Notification_Receiver'Class; - Client : not null access LSP.Client_Message_Receivers. - Client_Message_Receiver'Class; + Handler : not null access LSP.Ada_Handlers.Message_Handler'Class; Edits : out LAL_Refactor.Refactoring_Edits) is use LAL_Refactor; diff --git a/source/ada/lsp-ada_handlers-refactor-suppress_seperate.ads b/source/ada/lsp-ada_handlers-refactor-suppress_seperate.ads index 6e9a11fdc..c2b0341e2 100644 --- a/source/ada/lsp-ada_handlers-refactor-suppress_seperate.ads +++ b/source/ada/lsp-ada_handlers-refactor-suppress_seperate.ads @@ -19,8 +19,6 @@ private with VSS.Strings; -with LSP.Client_Message_Receivers; - with Libadalang.Analysis; package LSP.Ada_Handlers.Refactor.Suppress_Seperate is @@ -52,10 +50,7 @@ private overriding procedure Refactor (Self : Command; - Handler : not null access - LSP.Server_Notification_Receivers.Server_Notification_Receiver'Class; - Client : not null access - LSP.Client_Message_Receivers.Client_Message_Receiver'Class; + Handler : not null access LSP.Ada_Handlers.Message_Handler'Class; Edits : out LAL_Refactor.Refactoring_Edits); -- Executes Self by computing the necessary refactorings diff --git a/source/ada/lsp-ada_handlers-refactor.adb b/source/ada/lsp-ada_handlers-refactor.adb index 7e18e71e4..dc0217a7f 100644 --- a/source/ada/lsp-ada_handlers-refactor.adb +++ b/source/ada/lsp-ada_handlers-refactor.adb @@ -20,26 +20,19 @@ with VSS.Strings.Conversions; with LSP.Ada_Documents; use LSP.Ada_Documents; with LSP.Constants; with LSP.Enumerations; +with LSP.Servers; with LSP.Structures; use LSP.Structures; with LSP.Utils; package body LSP.Ada_Handlers.Refactor is - function To_DocumentUri (X : String) - return LSP.Structures.DocumentUri is - (VSS.Strings.Conversions.To_Virtual_String (X) with null record); - ------------- -- Execute -- ------------- overriding procedure Execute (Self : Command; - Handler : not null access - LSP.Server_Notification_Receivers.Server_Notification_Receiver'Class; - Sender : not null access LSP.Client_Message_Receivers. - Client_Message_Receiver'Class; - Id : LSP.Structures.Integer_Or_Virtual_String; + Handler : not null access LSP.Ada_Handlers.Message_Handler'Class; Error : in out LSP.Errors.ResponseError_Optional) is use LAL_Refactor; @@ -76,7 +69,7 @@ package body LSP.Ada_Handlers.Refactor is Diagnostic.relatedInformation.Append (LSP.Structures.DiagnosticRelatedInformation'( location => LSP.Structures.Location' - (uri => To_DocumentUri (Problem.Filename), + (uri => Handler.To_URI (Problem.Filename), a_range => LSP.Utils.To_Range (Problem.Location), alsKind => LSP.Constants.Empty), message => VSS.Strings.Conversions.To_Virtual_String @@ -90,8 +83,6 @@ package body LSP.Ada_Handlers.Refactor is Error_Msg : constant String := "Failed to execute the " & Name & " refactoring."; - Message_Handler : LSP.Ada_Handlers.Message_Handler renames - LSP.Ada_Handlers.Message_Handler (Handler.all); Apply : LSP.Structures.ApplyWorkspaceEditParams; Workspace_Edits : LSP.Structures.WorkspaceEdit renames Apply.edit; Label : Virtual_String_Optional renames Apply.label; @@ -99,7 +90,6 @@ package body LSP.Ada_Handlers.Refactor is begin LSP.Ada_Handlers.Refactor.Command'Class (Self).Refactor (Handler => Handler, - Sender => Sender, Edits => Edits); -- The refactoring failed to compute edits: send an error response @@ -117,29 +107,29 @@ package body LSP.Ada_Handlers.Refactor is declare Diagnostic : LSP.Structures.Diagnostic; Diagnostics : LSP.Structures.Diagnostic_Vector; - URI : LSP.Structures.DocumentUri := To_DocumentUri (""); + URI : LSP.Structures.DocumentUri := ""; Document : Document_Access; Idx : Integer := 1; begin for Problem of Edits.Diagnostics loop Document := Get_Open_Document - (Self => Message_Handler, - URI => To_DocumentUri (Problem.Filename), + (Self => Handler.all, + URI => Handler.To_URI (Problem.Filename), Force => False); -- Publish any processed diagnostic when switching to a -- different file. if not Diagnostics.Is_Empty - and then URI /= To_DocumentUri (Problem.Filename) + and then URI /= Handler.To_URI (Problem.Filename) then Publish_Diagnostics - (Self => Message_Handler, + (Self => Handler.all, Document => Document, Other_Diagnostics => Diagnostics, Force => True); end if; - URI := To_DocumentUri (Problem.Filename); + URI := Handler.To_URI (Problem.Filename); Diagnostic := To_LSP_Diagnostic (Problem, Error_Msg); Diagnostics.Append (Diagnostic); @@ -147,7 +137,7 @@ package body LSP.Ada_Handlers.Refactor is -- publish all the LSP diagnostics we have. if Idx = Integer (Edits.Diagnostics.Length) then Publish_Diagnostics - (Self => Message_Handler, + (Self => Handler.all, Document => Document, Other_Diagnostics => Diagnostics, Force => True); @@ -160,17 +150,18 @@ package body LSP.Ada_Handlers.Refactor is else -- Apply the computed refactoring edits Workspace_Edits := To_Workspace_Edit - (Self => Message_Handler, + (Self => Handler.all, Edits => Edits, Rename => True); Label := VSS.Strings.Conversions.To_Virtual_String (Name); - Sender.On_ApplyEdit_Request (Id, Apply); + Handler.Sender.On_ApplyEdit_Request + (Handler.Server.Allocate_Request_Id, Apply); end if; exception when E : others => - Message_Handler.Tracer.Trace_Exception (E); + Handler.Tracer.Trace_Exception (E); Error := (Is_Set => True, Value => diff --git a/source/ada/lsp-ada_handlers-refactor.ads b/source/ada/lsp-ada_handlers-refactor.ads index 2a5548c34..38c3f04d7 100644 --- a/source/ada/lsp-ada_handlers-refactor.ads +++ b/source/ada/lsp-ada_handlers-refactor.ads @@ -19,36 +19,28 @@ with LAL_Refactor; -with LSP.Client_Message_Receivers; -with LSP.Commands; +with LSP.Ada_Commands; with LSP.Errors; package LSP.Ada_Handlers.Refactor is - type Command is abstract new LSP.Commands.Command with private; + type Command is abstract new LSP.Ada_Commands.Command with private; function Name (Self : Command) return String is abstract; overriding procedure Execute (Self : Command; - Handler : not null access - LSP.Server_Notification_Receivers.Server_Notification_Receiver'Class; - Sender : not null access LSP.Client_Message_Receivers. - Client_Message_Receiver'Class; - Id : LSP.Structures.Integer_Or_Virtual_String; + Handler : not null access LSP.Ada_Handlers.Message_Handler'Class; Error : in out LSP.Errors.ResponseError_Optional); procedure Refactor (Self : Command; - Handler : not null access - LSP.Server_Notification_Receivers.Server_Notification_Receiver'Class; - Sender : not null access LSP.Client_Message_Receivers - .Client_Message_Receiver'Class; + Handler : not null access LSP.Ada_Handlers.Message_Handler'Class; Edits : out LAL_Refactor.Refactoring_Edits) is abstract; -- Abstract procedure used to compute the refactoring edits. private - type Command is abstract new LSP.Commands.Command with null record; + type Command is abstract new LSP.Ada_Commands.Command with null record; end LSP.Ada_Handlers.Refactor; diff --git a/source/ada/lsp-ada_handlers-suspend_executions.adb b/source/ada/lsp-ada_handlers-suspend_executions.adb index 95f972a4b..3343804bb 100644 --- a/source/ada/lsp-ada_handlers-suspend_executions.adb +++ b/source/ada/lsp-ada_handlers-suspend_executions.adb @@ -73,17 +73,10 @@ package body LSP.Ada_Handlers.Suspend_Executions is overriding procedure Execute (Self : Suspend_Execution; - Handler : not null access LSP.Server_Notification_Receivers - .Server_Notification_Receiver'Class; - Sender : not null access LSP.Client_Message_Receivers - .Client_Message_Receiver'Class; - Id : LSP.Structures.Integer_Or_Virtual_String; - Error : in out LSP.Errors.ResponseError_Optional) - is - Server : not null access LSP.Servers.Server'Class renames - Message_Handler'Class (Handler.all).Server; + Handler : not null access LSP.Ada_Handlers.Message_Handler'Class; + Error : in out LSP.Errors.ResponseError_Optional) is begin - while Server.Input_Queue_Length < Self.Input_Queue_Length loop + while Handler.Server.Input_Queue_Length < Self.Input_Queue_Length loop delay 0.1; end loop; end Execute; diff --git a/source/ada/lsp-ada_handlers-suspend_executions.ads b/source/ada/lsp-ada_handlers-suspend_executions.ads index 3861af2e6..3fa0a83be 100644 --- a/source/ada/lsp-ada_handlers-suspend_executions.ads +++ b/source/ada/lsp-ada_handlers-suspend_executions.ads @@ -17,16 +17,15 @@ -- -- Implementation of the command to suspend execution for debugging purposes. -with LSP.Client_Message_Receivers; -with LSP.Commands; +with LSP.Ada_Commands; with LSP.Errors; package LSP.Ada_Handlers.Suspend_Executions is - type Suspend_Execution is new LSP.Commands.Command with private; + type Suspend_Execution is new LSP.Ada_Commands.Command with private; private - type Suspend_Execution is new LSP.Commands.Command with record + type Suspend_Execution is new LSP.Ada_Commands.Command with record Input_Queue_Length : Natural; end record; @@ -36,11 +35,7 @@ private overriding procedure Execute (Self : Suspend_Execution; - Handler : not null access - LSP.Server_Notification_Receivers.Server_Notification_Receiver'Class; - Sender : not null access LSP.Client_Message_Receivers. - Client_Message_Receiver'Class; - Id : LSP.Structures.Integer_Or_Virtual_String; + Handler : not null access LSP.Ada_Handlers.Message_Handler'Class; Error : in out LSP.Errors.ResponseError_Optional); for Suspend_Execution'External_Tag use "als-suspend-execution"; diff --git a/source/ada/lsp-ada_handlers.adb b/source/ada/lsp-ada_handlers.adb index a3d9d1e7e..a1d0d98be 100644 --- a/source/ada/lsp-ada_handlers.adb +++ b/source/ada/lsp-ada_handlers.adb @@ -84,7 +84,7 @@ with LSP.Ada_Handlers.Refactor.Sort_Dependencies; with LSP.Ada_Handlers.Refactor.Suppress_Seperate; with LSP.Ada_Handlers.Renaming; with LSP.Ada_Handlers.Symbols; -with LSP.Commands; +with LSP.Ada_Commands; with LSP.Constants; with LSP.Diagnostic_Sources; with LSP.Enumerations; @@ -2770,9 +2770,9 @@ package body LSP.Ada_Handlers is ------------------------------- function Create_Command is new Ada.Tags.Generic_Dispatching_Constructor - (T => LSP.Commands.Command, + (T => LSP.Ada_Commands.Command, Parameters => LSP.Structures.LSPAny_Vector, - Constructor => LSP.Commands.Create); + Constructor => LSP.Ada_Commands.Create); overriding procedure On_ExecuteCommand_Request (Self : in out Message_Handler; @@ -2798,16 +2798,11 @@ package body LSP.Ada_Handlers is end if; declare - New_Id : constant LSP.Structures.Integer_Or_Virtual_String := - Self.Server.Allocate_Request_Id; - - Command : constant LSP.Commands.Command'Class := + Command : constant LSP.Ada_Commands.Command'Class := Create_Command (Tag, Value.arguments'Unrestricted_Access); begin Command.Execute (Handler => Self'Access, - Sender => Self.Sender, - Id => New_Id, Error => Error); if Error.Is_Set then @@ -3241,7 +3236,7 @@ package body LSP.Ada_Handlers is Response.capabilities := Self.Client.To_Server_Capabilities (Self.Incremental_Text_Changes, - LSP.Commands.All_Commands, + LSP.Ada_Commands.All_Commands, Token_Types, Token_Motifiers); diff --git a/testsuite/ada_lsp/refactoring_diagnostics/test.yaml b/testsuite/ada_lsp/refactoring_diagnostics/test.yaml index 28cb3d211..3790b7b3d 100644 --- a/testsuite/ada_lsp/refactoring_diagnostics/test.yaml +++ b/testsuite/ada_lsp/refactoring_diagnostics/test.yaml @@ -1,4 +1 @@ title: 'refactoring_diagnostics' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] From 69b047c0bf2726e10a938d8d5a27f58a87f271e9 Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Tue, 12 Sep 2023 18:58:17 +0300 Subject: [PATCH 128/152] Parse configuration file if `--config` option present. Refs #1170 --- source/ada/lsp-ada_configurations.adb | 396 ++++++++++-------- source/ada/lsp-ada_configurations.ads | 4 + source/ada/lsp-ada_driver.adb | 7 +- source/ada/lsp-ada_handlers.adb | 28 +- source/ada/lsp-ada_handlers.ads | 5 +- .../ada_lsp/project_config.file/test.yaml | 3 - 6 files changed, 264 insertions(+), 179 deletions(-) diff --git a/source/ada/lsp-ada_configurations.adb b/source/ada/lsp-ada_configurations.adb index 3d3ec648f..7fa640f30 100644 --- a/source/ada/lsp-ada_configurations.adb +++ b/source/ada/lsp-ada_configurations.adb @@ -21,8 +21,10 @@ with Ada.Containers.Generic_Anonymous_Array_Sort; with GNATCOLL.Traces; -with VSS.Strings.Conversions; +with VSS.JSON.Pull_Readers.Simple; with VSS.JSON.Streams; +with VSS.Strings.Conversions; +with VSS.Text_Streams.File_Input; package body LSP.Ada_Configurations is @@ -56,6 +58,16 @@ package body LSP.Ada_Configurations is -- Trace to enable/disable ALS from providing the -- documentOnTypeFormattingProvider capability. + procedure Skip_Value + (JSON : LSP.Structures.LSPAny; + Index : in out Positive); + + procedure Parse_Ada + (Self : in out Configuration'Class; + JSON : LSP.Structures.LSPAny; + From : Positive; + Reload : out Boolean); + --------------------------- -- Completion_Formatting -- --------------------------- @@ -75,170 +87,54 @@ package body LSP.Ada_Configurations is end On_Type_Formatting; --------------- - -- Read_JSON -- + -- Parse_Ada -- --------------- - procedure Read_JSON + procedure Parse_Ada (Self : in out Configuration'Class; JSON : LSP.Structures.LSPAny; + From : Positive; Reload : out Boolean) is use all type VSS.JSON.JSON_Number_Kind; use all type VSS.JSON.Streams.JSON_Stream_Element_Kind; use type VSS.String_Vectors.Virtual_String_Vector; - Index : Positive := JSON.First_Index; + Index : Positive := From; Variables_Names : VSS.String_Vectors.Virtual_String_Vector; Variables_Values : VSS.String_Vectors.Virtual_String_Vector; + procedure Parse_Variables (From : Positive); procedure Swap_Variables (Left, Right : Positive); - procedure Parse_Ada; - procedure Skip_Value; procedure Set (Target : in out VSS.Strings.Virtual_String; Value : VSS.Strings.Virtual_String); - --------------- - -- Parse_Ada -- - --------------- + --------------------- + -- Parse_Variables -- + --------------------- - procedure Parse_Ada is - procedure Parse_Variables (From : Positive); - - procedure Parse_Variables (From : Positive) is - Name : VSS.Strings.Virtual_String; - Value : VSS.Strings.Virtual_String; - Index : Positive := From + 1; - begin - while Index <= JSON.Last_Index - and then JSON (Index).Kind = Key_Name - loop - Name := JSON (Index).Key_Name; - Index := Index + 1; - - Value := (if JSON (Index).Kind = String_Value - then JSON (Index).String_Value else ""); - - Index := Index + 1; - - Variables_Names.Append (Name); - Variables_Values.Append (Value); - end loop; - end Parse_Variables; - - Name : VSS.Strings.Virtual_String; + procedure Parse_Variables (From : Positive) is + Name : VSS.Strings.Virtual_String; + Value : VSS.Strings.Virtual_String; + Index : Positive := From + 1; begin - Index := Index + 1; -- skip start object - while Index <= JSON.Last_Index and then JSON (Index).Kind = Key_Name loop Name := JSON (Index).Key_Name; Index := Index + 1; - if Name = "relocateBuildTree" - and then JSON (Index).Kind = String_Value - then - Set (Self.Relocate_Build_Tree, JSON (Index).String_Value); - - elsif Name = "rootDir" - and then JSON (Index).Kind = String_Value - then - Set (Self.Relocate_Root, JSON (Index).String_Value); - - elsif Name = "projectFile" - and then JSON (Index).Kind = String_Value - then - Set (Self.Project_File, JSON (Index).String_Value); - - elsif Name = "scenarioVariables" - and then JSON (Index).Kind = Start_Object - then - Parse_Variables (Index); - - elsif Name = "defaultCharset" - and then JSON (Index).Kind = String_Value - then - Set (Self.Charset, JSON (Index).String_Value); - - elsif Name = "enableDiagnostics" - and then JSON (Index).Kind = Boolean_Value - then - Self.Diagnostics_Enabled := JSON (Index).Boolean_Value; - - elsif Name = "enableIndexing" - and then JSON (Index).Kind = Boolean_Value - then - Self.Indexing_Enabled := JSON (Index).Boolean_Value; - - elsif Name = "renameInComments" - and then JSON (Index).Kind = Boolean_Value - then - Self.Rename_In_Comments := JSON (Index).Boolean_Value; - - elsif Name = "namedNotationThreshold" - and then JSON (Index).Kind = Number_Value - and then JSON (Index).Number_Value.Kind = JSON_Integer - then - Self.Named_Notation_Threshold := - Natural (JSON (Index).Number_Value.Integer_Value); - - elsif Name = "foldComments" - and then JSON (Index).Kind = Boolean_Value - then - Self.Folding_Comments := JSON (Index).Boolean_Value; - - elsif Name = "displayMethodAncestryOnNavigation" - and then JSON (Index).Kind = String_Value - and then Display_Method_Values.Contains - (JSON (Index).String_Value) - then - Self.Method_Ancestry_Policy := - LSP.Enumerations.AlsDisplayMethodAncestryOnNavigationPolicy - 'Value (+JSON (Index).String_Value); - - elsif Name = "followSymlinks" - and then JSON (Index).Kind = Boolean_Value - then - Self.Follow_Symlinks := JSON (Index).Boolean_Value; - - elsif Name = "documentationStyle" - and then JSON (Index).Kind = String_Value - and then Doc_Style_Values.Contains (JSON (Index).String_Value) - then - Self.Documentation_Style := - GNATdoc.Comments.Options.Documentation_Style'Value - (+JSON (Index).String_Value); - - elsif Name = "useCompletionSnippets" - and then JSON (Index).Kind = Boolean_Value - then - Self.Use_Completion_Snippets := JSON (Index).Boolean_Value; - - elsif Name = "logThreshold" - and then JSON (Index).Kind = Number_Value - and then JSON (Index).Number_Value.Kind = JSON_Integer - then - Self.Log_Threshold := - Natural (JSON (Index).Number_Value.Integer_Value); - - elsif Name = "onTypeFormatting" - and then JSON (Index).Kind = Start_Object - then - Name := JSON (Index + 1).Key_Name; - - if Name = "indentOnly" - and then JSON (Index + 2).Kind = Boolean_Value - then - Self.Indent_Only := JSON (Index + 2).Boolean_Value; + Value := (if JSON (Index).Kind = String_Value + then JSON (Index).String_Value else ""); - end if; - end if; + Index := Index + 1; - Skip_Value; + Variables_Names.Append (Name); + Variables_Values.Append (Value); end loop; - end Parse_Ada; + end Parse_Variables; --------- -- Set -- @@ -250,29 +146,9 @@ package body LSP.Ada_Configurations is begin if Target /= Value then Target := Value; - Reload := True; end if; end Set; - ---------------- - -- Skip_Value -- - ---------------- - - procedure Skip_Value is - Level : Natural := 0; - begin - while Index <= JSON.Last_Index loop - Level := (case JSON (Index).Kind is - when Start_Object | Start_Array => Level + 1, - when End_Object | End_Array => Level - 1, - when others => Level); - - Index := Index + 1; - - exit when Level = 0; - end loop; - end Skip_Value; - -------------------- -- Swap_Variables -- -------------------- @@ -295,10 +171,181 @@ package body LSP.Ada_Configurations is procedure Sort_Variables is new Ada.Containers.Generic_Anonymous_Array_Sort (Positive, Less, Swap_Variables); + + Name : VSS.Strings.Virtual_String; begin Reload := False; + Index := Index + 1; -- skip start object + + while Index <= JSON.Last_Index + and then JSON (Index).Kind = Key_Name + loop + Name := JSON (Index).Key_Name; + Index := Index + 1; + + if Name = "relocateBuildTree" + and then JSON (Index).Kind = String_Value + then + Set (Self.Relocate_Build_Tree, JSON (Index).String_Value); + + elsif Name = "rootDir" + and then JSON (Index).Kind = String_Value + then + Set (Self.Relocate_Root, JSON (Index).String_Value); + + elsif Name = "projectFile" + and then JSON (Index).Kind = String_Value + then + Set (Self.Project_File, JSON (Index).String_Value); + + elsif Name = "scenarioVariables" + and then JSON (Index).Kind = Start_Object + then + Parse_Variables (Index); + + elsif Name = "defaultCharset" + and then JSON (Index).Kind = String_Value + then + Set (Self.Charset, JSON (Index).String_Value); + + elsif Name = "enableDiagnostics" + and then JSON (Index).Kind = Boolean_Value + then + Self.Diagnostics_Enabled := JSON (Index).Boolean_Value; + + elsif Name = "enableIndexing" + and then JSON (Index).Kind = Boolean_Value + then + Self.Indexing_Enabled := JSON (Index).Boolean_Value; + + elsif Name = "renameInComments" + and then JSON (Index).Kind = Boolean_Value + then + Self.Rename_In_Comments := JSON (Index).Boolean_Value; + + elsif Name = "namedNotationThreshold" + and then JSON (Index).Kind = Number_Value + and then JSON (Index).Number_Value.Kind = JSON_Integer + then + Self.Named_Notation_Threshold := + Natural (JSON (Index).Number_Value.Integer_Value); + + elsif Name = "foldComments" + and then JSON (Index).Kind = Boolean_Value + then + Self.Folding_Comments := JSON (Index).Boolean_Value; + + elsif Name = "displayMethodAncestryOnNavigation" + and then JSON (Index).Kind = String_Value + and then Display_Method_Values.Contains + (JSON (Index).String_Value) + then + Self.Method_Ancestry_Policy := + LSP.Enumerations.AlsDisplayMethodAncestryOnNavigationPolicy + 'Value (+JSON (Index).String_Value); + + elsif Name = "followSymlinks" + and then JSON (Index).Kind = Boolean_Value + then + Self.Follow_Symlinks := JSON (Index).Boolean_Value; + + elsif Name = "documentationStyle" + and then JSON (Index).Kind = String_Value + and then Doc_Style_Values.Contains (JSON (Index).String_Value) + then + Self.Documentation_Style := + GNATdoc.Comments.Options.Documentation_Style'Value + (+JSON (Index).String_Value); + + elsif Name = "useCompletionSnippets" + and then JSON (Index).Kind = Boolean_Value + then + Self.Use_Completion_Snippets := JSON (Index).Boolean_Value; + + elsif Name = "logThreshold" + and then JSON (Index).Kind = Number_Value + and then JSON (Index).Number_Value.Kind = JSON_Integer + then + Self.Log_Threshold := + Natural (JSON (Index).Number_Value.Integer_Value); + + elsif Name = "onTypeFormatting" + and then JSON (Index).Kind = Start_Object + then + Name := JSON (Index + 1).Key_Name; + + if Name = "indentOnly" + and then JSON (Index + 2).Kind = Boolean_Value + then + Self.Indent_Only := JSON (Index + 2).Boolean_Value; + end if; + end if; + + Skip_Value (JSON, Index); + end loop; + + Sort_Variables (1, Variables_Names.Length); + + Reload := Reload or else + Variables_Names /= Self.Variables_Names or else + Variables_Values /= Self.Variables_Values; + + Self.Variables_Names := Variables_Names; + Self.Variables_Values := Variables_Values; + end Parse_Ada; + + -------------------- + -- Partial_GNATPP -- + -------------------- + + function Partial_GNATPP return Boolean is + begin + return Partial_Gnatpp_Trace.Is_Active; + end Partial_GNATPP; + + --------------- + -- Read_File -- + --------------- + + procedure Read_File + (Self : in out Configuration'Class; + File : VSS.Strings.Virtual_String) + is + Input : aliased VSS.Text_Streams.File_Input.File_Input_Text_Stream; + Reader : VSS.JSON.Pull_Readers.Simple.JSON_Simple_Pull_Reader; + JSON : LSP.Structures.LSPAny; + Ignore : Boolean; + begin + Input.Open (File, "utf-8"); + Reader.Set_Stream (Input'Unchecked_Access); + Reader.Read_Next; + pragma Assert (Reader.Is_Start_Document); + Reader.Read_Next; + + while not Reader.Is_End_Document loop + JSON.Append (Reader.Element); + Reader.Read_Next; + end loop; + + Self.Parse_Ada (JSON, JSON.First_Index, Ignore); + end Read_File; + + --------------- + -- Read_JSON -- + --------------- + + procedure Read_JSON + (Self : in out Configuration'Class; + JSON : LSP.Structures.LSPAny; + Reload : out Boolean) + is + use all type VSS.JSON.Streams.JSON_Stream_Element_Kind; + Index : Positive := JSON.First_Index; + + begin if JSON.Is_Empty or else JSON (Index).Kind /= Start_Object then + Reload := False; return; else Index := Index + 1; @@ -316,31 +363,36 @@ package body LSP.Ada_Configurations is Index <= JSON.Last_Index and then JSON (Index).Kind = Start_Object then - Parse_Ada; + Self.Parse_Ada (JSON, Index, Reload); else - Skip_Value; + Skip_Value (JSON, Index); end if; end; end loop; - - Sort_Variables (1, Variables_Names.Length); - - Reload := Reload or else - Variables_Names /= Self.Variables_Names or else - Variables_Values /= Self.Variables_Values; - - Self.Variables_Names := Variables_Names; - Self.Variables_Values := Variables_Values; end Read_JSON; - -------------------- - -- Partial_GNATPP -- - -------------------- + ---------------- + -- Skip_Value -- + ---------------- - function Partial_GNATPP return Boolean is + procedure Skip_Value + (JSON : LSP.Structures.LSPAny; + Index : in out Positive) + is + use all type VSS.JSON.Streams.JSON_Stream_Element_Kind; + Level : Natural := 0; begin - return Partial_Gnatpp_Trace.Is_Active; - end Partial_GNATPP; + while Index <= JSON.Last_Index loop + Level := (case JSON (Index).Kind is + when Start_Object | Start_Array => Level + 1, + when End_Object | End_Array => Level - 1, + when others => Level); + + Index := Index + 1; + + exit when Level = 0; + end loop; + end Skip_Value; end LSP.Ada_Configurations; diff --git a/source/ada/lsp-ada_configurations.ads b/source/ada/lsp-ada_configurations.ads index 512cdbcf0..5ab303b08 100644 --- a/source/ada/lsp-ada_configurations.ads +++ b/source/ada/lsp-ada_configurations.ads @@ -33,6 +33,10 @@ package LSP.Ada_Configurations is JSON : LSP.Structures.LSPAny; Reload : out Boolean); + procedure Read_File + (Self : in out Configuration'Class; + File : VSS.Strings.Virtual_String); + function Project_File (Self : Configuration'Class) return VSS.Strings.Virtual_String; -- The project file, if provided by the user on Configuration/Init diff --git a/source/ada/lsp-ada_driver.adb b/source/ada/lsp-ada_driver.adb index f92c124bb..79a7ed0de 100644 --- a/source/ada/lsp-ada_driver.adb +++ b/source/ada/lsp-ada_driver.adb @@ -299,9 +299,12 @@ begin -- Trace to activate the support for incremental text changes. begin Ada_Handler.Initialize - (Incremental_Text_Changes => Allow_Incremental_Text_Changes.Is_Active); + (Incremental_Text_Changes => Allow_Incremental_Text_Changes.Is_Active, + Config_File => VSS.Command_Line.Value (Config_File_Option)); + GPR_Handler.Initialize - (Incremental_Text_Changes => Allow_Incremental_Text_Changes.Is_Active); + (Incremental_Text_Changes => Allow_Incremental_Text_Changes.Is_Active, + Config_File => VSS.Command_Line.Value (Config_File_Option)); end; Server.Initialize (Stream'Unchecked_Access); diff --git a/source/ada/lsp-ada_handlers.adb b/source/ada/lsp-ada_handlers.adb index a1d0d98be..0ae11e074 100644 --- a/source/ada/lsp-ada_handlers.adb +++ b/source/ada/lsp-ada_handlers.adb @@ -392,9 +392,35 @@ package body LSP.Ada_Handlers is procedure Initialize (Self : in out Message_Handler'Class; - Incremental_Text_Changes : Boolean) is + Incremental_Text_Changes : Boolean; + Config_File : VSS.Strings.Virtual_String) + is + function Directory (File : VSS.Strings.Virtual_String) + return VSS.Strings.Virtual_String; + + --------------- + -- Directory -- + --------------- + + function Directory (File : VSS.Strings.Virtual_String) + return VSS.Strings.Virtual_String is + + Value : constant GNATCOLL.VFS.Virtual_File := + GNATCOLL.VFS.Create_From_UTF8 + (VSS.Strings.Conversions.To_UTF_8_String (File)); + begin + return VSS.Strings.Conversions.To_Virtual_String + (Value.Dir.Display_Full_Name); + end Directory; + begin Self.Incremental_Text_Changes := Incremental_Text_Changes; + + if not Config_File.Is_Empty then + Self.Configuration.Read_File (Config_File); + Self.Client.Set_Root_If_Empty (Directory (Config_File)); + LSP.Ada_Handlers.Project_Loading.Reload_Project (Self); + end if; end Initialize; ---------------------- diff --git a/source/ada/lsp-ada_handlers.ads b/source/ada/lsp-ada_handlers.ads index c96383a07..0e0759859 100644 --- a/source/ada/lsp-ada_handlers.ads +++ b/source/ada/lsp-ada_handlers.ads @@ -63,11 +63,14 @@ package LSP.Ada_Handlers is procedure Initialize (Self : in out Message_Handler'Class; - Incremental_Text_Changes : Boolean); + Incremental_Text_Changes : Boolean; + Config_File : VSS.Strings.Virtual_String); -- Initialize the message handler and configure it. -- -- Incremental_Text_Changes - activate the support for incremental text -- changes. + -- + -- Config_File - custom configuration file, if present function Contexts_For_File (Self : access Message_Handler; diff --git a/testsuite/ada_lsp/project_config.file/test.yaml b/testsuite/ada_lsp/project_config.file/test.yaml index cbf8d2630..43ac894d0 100644 --- a/testsuite/ada_lsp/project_config.file/test.yaml +++ b/testsuite/ada_lsp/project_config.file/test.yaml @@ -1,4 +1 @@ title: 'project_config.file' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] From 33f8f34efb60c4be566aaac649d90a5c09867b78 Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Tue, 12 Sep 2023 19:27:02 +0300 Subject: [PATCH 129/152] Exit notification doesn't have parameters. Refs #1170 --- testsuite/ada_lsp/0002-shutdown/0002-shutdown.json | 2 +- testsuite/ada_lsp/0002-shutdown/dont_close_stdin.json | 2 +- testsuite/ada_lsp/0003-get_symbols/0003-get_symbols.json | 2 +- testsuite/ada_lsp/S312-063.documentSymbol.constant/test.json | 2 +- testsuite/ada_lsp/S516-013.no_file/no_file.json | 2 +- testsuite/ada_lsp/SA21-029.documentSymbol.function/test.json | 2 +- testsuite/ada_lsp/SA21-029.documentSymbol.with/test.json | 2 +- testsuite/ada_lsp/T123-048.incremental_editing/test.json | 1 - testsuite/ada_lsp/T623-017.format_uses_project/test.json | 2 +- testsuite/ada_lsp/cancel/cancel.json | 2 +- testsuite/ada_lsp/commands.other_file/test.json | 2 +- testsuite/ada_lsp/declaration/declaration.json | 2 +- testsuite/ada_lsp/def_name/def_name.json | 2 +- testsuite/ada_lsp/def_name/uri_with_slash.json | 2 +- testsuite/ada_lsp/editor.incremental/test.json | 1 - testsuite/ada_lsp/find_all_refs/find_all_refs.json | 2 +- testsuite/ada_lsp/find_all_refs_kinds/find_all_refs_kinds.json | 2 +- testsuite/ada_lsp/find_all_refs_subp/find_all_refs_subp.json | 2 +- testsuite/ada_lsp/get_symbol_hier/test.json | 2 +- testsuite/ada_lsp/incorrect_fallback/incorrect_fallback.json | 1 - testsuite/ada_lsp/named_params/test.json | 2 +- testsuite/ada_lsp/no_root/no_root.json | 2 +- testsuite/ada_lsp/no_root/uri_with_slash.json | 2 +- testsuite/ada_lsp/non_project_files/non_project_files.json | 2 +- testsuite/ada_lsp/project_config.alire/test.json | 2 +- testsuite/ada_lsp/project_config.file/project_config.json | 2 +- testsuite/ada_lsp/project_config.init/project_config.json | 2 +- testsuite/ada_lsp/project_config.missing_file/test.json | 2 +- testsuite/ada_lsp/project_config/project_config.json | 2 +- testsuite/ada_lsp/project_config/project_config_2.json | 2 +- testsuite/ada_lsp/project_reload.command/test.json | 2 +- testsuite/ada_lsp/project_reload/project_reload.json | 2 +- testsuite/ada_lsp/project_search/project_search.json | 2 +- testsuite/ada_lsp/project_symlinks/test.json | 2 +- testsuite/ada_lsp/publish_diag/diag_on_open.json | 2 +- testsuite/ada_lsp/publish_diag/publish_diag.json | 2 +- testsuite/ada_lsp/publish_diag/publish_diag_disabled.json | 2 +- testsuite/ada_lsp/rename.prepare/test.json | 2 +- testsuite/ada_lsp/rename/rename.json | 2 +- testsuite/ada_lsp/skip__standard/skip__standard.json | 2 +- testsuite/ada_lsp/spec_from_body/spec_from_body.json | 2 +- testsuite/ada_lsp/type_definition.def_name/test.json | 2 +- testsuite/ada_lsp/type_definition/type_definition.json | 2 +- testsuite/ada_lsp/unknown_request/unknown_request.json | 2 +- testsuite/ada_lsp/workspace_symbol/test.json | 2 +- testsuite/gpr_lsp/get_symbols/get_symbols.json | 3 +-- testsuite/gpr_lsp/get_symbols_hierarchy/test.json | 3 +-- testsuite/gpr_lsp/shutdown/shutdown.json | 2 +- 48 files changed, 45 insertions(+), 50 deletions(-) diff --git a/testsuite/ada_lsp/0002-shutdown/0002-shutdown.json b/testsuite/ada_lsp/0002-shutdown/0002-shutdown.json index e2d01c393..fb8a29dad 100644 --- a/testsuite/ada_lsp/0002-shutdown/0002-shutdown.json +++ b/testsuite/ada_lsp/0002-shutdown/0002-shutdown.json @@ -19,7 +19,7 @@ } }, { "send": { - "request": {"jsonrpc":"2.0", "method":"exit", "params":{}}, + "request": {"jsonrpc":"2.0", "method":"exit"}, "wait":[] } }, { diff --git a/testsuite/ada_lsp/0002-shutdown/dont_close_stdin.json b/testsuite/ada_lsp/0002-shutdown/dont_close_stdin.json index a01e75811..63cc65f75 100644 --- a/testsuite/ada_lsp/0002-shutdown/dont_close_stdin.json +++ b/testsuite/ada_lsp/0002-shutdown/dont_close_stdin.json @@ -19,7 +19,7 @@ } }, { "send": { - "request": {"jsonrpc":"2.0", "method":"exit", "params":{}}, + "request": {"jsonrpc":"2.0", "method":"exit"}, "wait":[] } }, { diff --git a/testsuite/ada_lsp/0003-get_symbols/0003-get_symbols.json b/testsuite/ada_lsp/0003-get_symbols/0003-get_symbols.json index cb7ca2255..d135105c2 100644 --- a/testsuite/ada_lsp/0003-get_symbols/0003-get_symbols.json +++ b/testsuite/ada_lsp/0003-get_symbols/0003-get_symbols.json @@ -94,7 +94,7 @@ } }, { "send": { - "request": {"jsonrpc":"2.0", "method":"exit", "params":{}}, + "request": {"jsonrpc":"2.0", "method":"exit"}, "wait":[] } }, { diff --git a/testsuite/ada_lsp/S312-063.documentSymbol.constant/test.json b/testsuite/ada_lsp/S312-063.documentSymbol.constant/test.json index 50cb8e249..9dc60d92d 100644 --- a/testsuite/ada_lsp/S312-063.documentSymbol.constant/test.json +++ b/testsuite/ada_lsp/S312-063.documentSymbol.constant/test.json @@ -258,7 +258,7 @@ } }, { "send": { - "request": {"jsonrpc":"2.0", "method":"exit", "params":{}}, + "request": {"jsonrpc":"2.0", "method":"exit"}, "wait":[] } }, diff --git a/testsuite/ada_lsp/S516-013.no_file/no_file.json b/testsuite/ada_lsp/S516-013.no_file/no_file.json index fd853ea3f..b6648f525 100644 --- a/testsuite/ada_lsp/S516-013.no_file/no_file.json +++ b/testsuite/ada_lsp/S516-013.no_file/no_file.json @@ -85,7 +85,7 @@ } }, { "send": { - "request": {"jsonrpc":"2.0", "method":"exit", "params":{}}, + "request": {"jsonrpc":"2.0", "method":"exit"}, "wait":[] } }, { diff --git a/testsuite/ada_lsp/SA21-029.documentSymbol.function/test.json b/testsuite/ada_lsp/SA21-029.documentSymbol.function/test.json index f6c9e0503..ed2a77a4c 100644 --- a/testsuite/ada_lsp/SA21-029.documentSymbol.function/test.json +++ b/testsuite/ada_lsp/SA21-029.documentSymbol.function/test.json @@ -258,7 +258,7 @@ } }, { "send": { - "request": {"jsonrpc":"2.0", "method":"exit", "params":{}}, + "request": {"jsonrpc":"2.0", "method":"exit"}, "wait":[] } }, { diff --git a/testsuite/ada_lsp/SA21-029.documentSymbol.with/test.json b/testsuite/ada_lsp/SA21-029.documentSymbol.with/test.json index 0f4a5fc57..1625ac700 100644 --- a/testsuite/ada_lsp/SA21-029.documentSymbol.with/test.json +++ b/testsuite/ada_lsp/SA21-029.documentSymbol.with/test.json @@ -229,7 +229,7 @@ } }, { "send": { - "request": {"jsonrpc":"2.0", "method":"exit", "params":{}}, + "request": {"jsonrpc":"2.0", "method":"exit"}, "wait":[] } }, { diff --git a/testsuite/ada_lsp/T123-048.incremental_editing/test.json b/testsuite/ada_lsp/T123-048.incremental_editing/test.json index 1414ecb8e..6dc504d83 100644 --- a/testsuite/ada_lsp/T123-048.incremental_editing/test.json +++ b/testsuite/ada_lsp/T123-048.incremental_editing/test.json @@ -592,7 +592,6 @@ { "send": { "request": { - "params": null, "jsonrpc": "2.0", "method": "exit" }, diff --git a/testsuite/ada_lsp/T623-017.format_uses_project/test.json b/testsuite/ada_lsp/T623-017.format_uses_project/test.json index 6a99bea05..7b8a695fc 100644 --- a/testsuite/ada_lsp/T623-017.format_uses_project/test.json +++ b/testsuite/ada_lsp/T623-017.format_uses_project/test.json @@ -100,7 +100,7 @@ } }, { "send": { - "request": {"jsonrpc":"2.0", "method":"exit", "params":{}}, + "request": {"jsonrpc":"2.0", "method":"exit"}, "wait":[] } }, { diff --git a/testsuite/ada_lsp/cancel/cancel.json b/testsuite/ada_lsp/cancel/cancel.json index b943b6a6c..afed784d1 100644 --- a/testsuite/ada_lsp/cancel/cancel.json +++ b/testsuite/ada_lsp/cancel/cancel.json @@ -154,7 +154,7 @@ } }, { "send": { - "request": {"jsonrpc":"2.0", "method":"exit", "params":{}}, + "request": {"jsonrpc":"2.0", "method":"exit"}, "wait":[] } }, { diff --git a/testsuite/ada_lsp/commands.other_file/test.json b/testsuite/ada_lsp/commands.other_file/test.json index 9c0569247..4e9deef08 100644 --- a/testsuite/ada_lsp/commands.other_file/test.json +++ b/testsuite/ada_lsp/commands.other_file/test.json @@ -140,7 +140,7 @@ } }, { "send": { - "request": {"jsonrpc":"2.0", "method":"exit", "params":{}}, + "request": {"jsonrpc":"2.0", "method":"exit"}, "wait":[] } }, { diff --git a/testsuite/ada_lsp/declaration/declaration.json b/testsuite/ada_lsp/declaration/declaration.json index 60b94568d..6db26a9d8 100644 --- a/testsuite/ada_lsp/declaration/declaration.json +++ b/testsuite/ada_lsp/declaration/declaration.json @@ -124,7 +124,7 @@ } }, { "send": { - "request": {"jsonrpc":"2.0", "method":"exit", "params":{}}, + "request": {"jsonrpc":"2.0", "method":"exit"}, "wait":[] } }, { diff --git a/testsuite/ada_lsp/def_name/def_name.json b/testsuite/ada_lsp/def_name/def_name.json index 24f3c63d6..e58454c82 100644 --- a/testsuite/ada_lsp/def_name/def_name.json +++ b/testsuite/ada_lsp/def_name/def_name.json @@ -124,7 +124,7 @@ } }, { "send": { - "request": {"jsonrpc":"2.0", "method":"exit", "params":{}}, + "request": {"jsonrpc":"2.0", "method":"exit"}, "wait":[] } }, { diff --git a/testsuite/ada_lsp/def_name/uri_with_slash.json b/testsuite/ada_lsp/def_name/uri_with_slash.json index 1065e38fc..e6527e328 100644 --- a/testsuite/ada_lsp/def_name/uri_with_slash.json +++ b/testsuite/ada_lsp/def_name/uri_with_slash.json @@ -124,7 +124,7 @@ } }, { "send": { - "request": {"jsonrpc":"2.0", "method":"exit", "params":{}}, + "request": {"jsonrpc":"2.0", "method":"exit"}, "wait":[] } }, { diff --git a/testsuite/ada_lsp/editor.incremental/test.json b/testsuite/ada_lsp/editor.incremental/test.json index faffc7ac8..ef7c67bd4 100644 --- a/testsuite/ada_lsp/editor.incremental/test.json +++ b/testsuite/ada_lsp/editor.incremental/test.json @@ -1381,7 +1381,6 @@ { "send": { "request": { - "params": null, "jsonrpc": "2.0", "method": "exit" }, diff --git a/testsuite/ada_lsp/find_all_refs/find_all_refs.json b/testsuite/ada_lsp/find_all_refs/find_all_refs.json index a5502324f..3f3e78c86 100644 --- a/testsuite/ada_lsp/find_all_refs/find_all_refs.json +++ b/testsuite/ada_lsp/find_all_refs/find_all_refs.json @@ -129,7 +129,7 @@ } }, { "send": { - "request": {"jsonrpc":"2.0", "method":"exit", "params":{}}, + "request": {"jsonrpc":"2.0", "method":"exit"}, "wait":[] } }, { diff --git a/testsuite/ada_lsp/find_all_refs_kinds/find_all_refs_kinds.json b/testsuite/ada_lsp/find_all_refs_kinds/find_all_refs_kinds.json index 6167c9694..7bc2a5c06 100644 --- a/testsuite/ada_lsp/find_all_refs_kinds/find_all_refs_kinds.json +++ b/testsuite/ada_lsp/find_all_refs_kinds/find_all_refs_kinds.json @@ -180,7 +180,7 @@ } }, { "send": { - "request": {"jsonrpc":"2.0", "method":"exit", "params":{}}, + "request": {"jsonrpc":"2.0", "method":"exit"}, "wait":[] } }, { diff --git a/testsuite/ada_lsp/find_all_refs_subp/find_all_refs_subp.json b/testsuite/ada_lsp/find_all_refs_subp/find_all_refs_subp.json index 0fb2b818f..b0e71c894 100644 --- a/testsuite/ada_lsp/find_all_refs_subp/find_all_refs_subp.json +++ b/testsuite/ada_lsp/find_all_refs_subp/find_all_refs_subp.json @@ -236,7 +236,7 @@ } }, { "send": { - "request": {"jsonrpc":"2.0", "method":"exit", "params":{}}, + "request": {"jsonrpc":"2.0", "method":"exit"}, "wait":[] } }, diff --git a/testsuite/ada_lsp/get_symbol_hier/test.json b/testsuite/ada_lsp/get_symbol_hier/test.json index a3b34ca88..40f9bc14c 100644 --- a/testsuite/ada_lsp/get_symbol_hier/test.json +++ b/testsuite/ada_lsp/get_symbol_hier/test.json @@ -233,7 +233,7 @@ } }, { "send": { - "request": {"jsonrpc":"2.0", "method":"exit", "params":{}}, + "request": {"jsonrpc":"2.0", "method":"exit"}, "wait":[] } }, { diff --git a/testsuite/ada_lsp/incorrect_fallback/incorrect_fallback.json b/testsuite/ada_lsp/incorrect_fallback/incorrect_fallback.json index 1a8fd4ed2..2aa35d6bd 100644 --- a/testsuite/ada_lsp/incorrect_fallback/incorrect_fallback.json +++ b/testsuite/ada_lsp/incorrect_fallback/incorrect_fallback.json @@ -246,7 +246,6 @@ { "send": { "request": { - "params": null, "jsonrpc": "2.0", "method": "exit" }, diff --git a/testsuite/ada_lsp/named_params/test.json b/testsuite/ada_lsp/named_params/test.json index 31fe983ce..cb2359eea 100644 --- a/testsuite/ada_lsp/named_params/test.json +++ b/testsuite/ada_lsp/named_params/test.json @@ -702,7 +702,7 @@ } }, { "send": { - "request": {"jsonrpc":"2.0", "method":"exit", "params":{}}, + "request": {"jsonrpc":"2.0", "method":"exit"}, "wait":[] } }, { diff --git a/testsuite/ada_lsp/no_root/no_root.json b/testsuite/ada_lsp/no_root/no_root.json index 64a399ad7..d43223d3d 100644 --- a/testsuite/ada_lsp/no_root/no_root.json +++ b/testsuite/ada_lsp/no_root/no_root.json @@ -124,7 +124,7 @@ } }, { "send": { - "request": {"jsonrpc":"2.0", "method":"exit", "params":{}}, + "request": {"jsonrpc":"2.0", "method":"exit"}, "wait":[] } }, { diff --git a/testsuite/ada_lsp/no_root/uri_with_slash.json b/testsuite/ada_lsp/no_root/uri_with_slash.json index 1065e38fc..e6527e328 100644 --- a/testsuite/ada_lsp/no_root/uri_with_slash.json +++ b/testsuite/ada_lsp/no_root/uri_with_slash.json @@ -124,7 +124,7 @@ } }, { "send": { - "request": {"jsonrpc":"2.0", "method":"exit", "params":{}}, + "request": {"jsonrpc":"2.0", "method":"exit"}, "wait":[] } }, { diff --git a/testsuite/ada_lsp/non_project_files/non_project_files.json b/testsuite/ada_lsp/non_project_files/non_project_files.json index 795598822..ab965e591 100644 --- a/testsuite/ada_lsp/non_project_files/non_project_files.json +++ b/testsuite/ada_lsp/non_project_files/non_project_files.json @@ -197,7 +197,7 @@ } }, { "send": { - "request": {"jsonrpc":"2.0", "method":"exit", "params":{}}, + "request": {"jsonrpc":"2.0", "method":"exit"}, "wait":[] } }, { diff --git a/testsuite/ada_lsp/project_config.alire/test.json b/testsuite/ada_lsp/project_config.alire/test.json index 645f19e59..5e9328e31 100644 --- a/testsuite/ada_lsp/project_config.alire/test.json +++ b/testsuite/ada_lsp/project_config.alire/test.json @@ -104,7 +104,7 @@ } }, { "send": { - "request": {"jsonrpc":"2.0", "method":"exit", "params":{}}, + "request": {"jsonrpc":"2.0", "method":"exit"}, "wait":[] } }, { diff --git a/testsuite/ada_lsp/project_config.file/project_config.json b/testsuite/ada_lsp/project_config.file/project_config.json index 87842eec2..df1965fda 100644 --- a/testsuite/ada_lsp/project_config.file/project_config.json +++ b/testsuite/ada_lsp/project_config.file/project_config.json @@ -99,7 +99,7 @@ } }, { "send": { - "request": {"jsonrpc":"2.0", "method":"exit", "params":{}}, + "request": {"jsonrpc":"2.0", "method":"exit"}, "wait":[] } }, { diff --git a/testsuite/ada_lsp/project_config.init/project_config.json b/testsuite/ada_lsp/project_config.init/project_config.json index 842bfcd7f..c6645fe75 100644 --- a/testsuite/ada_lsp/project_config.init/project_config.json +++ b/testsuite/ada_lsp/project_config.init/project_config.json @@ -95,7 +95,7 @@ } }, { "send": { - "request": {"jsonrpc":"2.0", "method":"exit", "params":{}}, + "request": {"jsonrpc":"2.0", "method":"exit"}, "wait":[] } }, { diff --git a/testsuite/ada_lsp/project_config.missing_file/test.json b/testsuite/ada_lsp/project_config.missing_file/test.json index 1b9c51841..ff63a7e5e 100644 --- a/testsuite/ada_lsp/project_config.missing_file/test.json +++ b/testsuite/ada_lsp/project_config.missing_file/test.json @@ -102,7 +102,7 @@ } }, { "send": { - "request": {"jsonrpc":"2.0", "method":"exit", "params":{}}, + "request": {"jsonrpc":"2.0", "method":"exit"}, "wait":[] } }, { diff --git a/testsuite/ada_lsp/project_config/project_config.json b/testsuite/ada_lsp/project_config/project_config.json index c5a1350e0..a5e845f8b 100644 --- a/testsuite/ada_lsp/project_config/project_config.json +++ b/testsuite/ada_lsp/project_config/project_config.json @@ -102,7 +102,7 @@ } }, { "send": { - "request": {"jsonrpc":"2.0", "method":"exit", "params":{}}, + "request": {"jsonrpc":"2.0", "method":"exit"}, "wait":[] } }, { diff --git a/testsuite/ada_lsp/project_config/project_config_2.json b/testsuite/ada_lsp/project_config/project_config_2.json index dc2ed3c86..c5004e58c 100644 --- a/testsuite/ada_lsp/project_config/project_config_2.json +++ b/testsuite/ada_lsp/project_config/project_config_2.json @@ -102,7 +102,7 @@ } }, { "send": { - "request": {"jsonrpc":"2.0", "method":"exit", "params":{}}, + "request": {"jsonrpc":"2.0", "method":"exit"}, "wait":[] } }, { diff --git a/testsuite/ada_lsp/project_reload.command/test.json b/testsuite/ada_lsp/project_reload.command/test.json index 0afd4bda4..a5b786562 100644 --- a/testsuite/ada_lsp/project_reload.command/test.json +++ b/testsuite/ada_lsp/project_reload.command/test.json @@ -217,7 +217,7 @@ } }, { "send": { - "request": {"jsonrpc":"2.0", "method":"exit", "params":{}}, + "request": {"jsonrpc":"2.0", "method":"exit"}, "wait":[] } }, { diff --git a/testsuite/ada_lsp/project_reload/project_reload.json b/testsuite/ada_lsp/project_reload/project_reload.json index c9f037584..3dd0dc538 100644 --- a/testsuite/ada_lsp/project_reload/project_reload.json +++ b/testsuite/ada_lsp/project_reload/project_reload.json @@ -190,7 +190,7 @@ } }, { "send": { - "request": {"jsonrpc":"2.0", "method":"exit", "params":{}}, + "request": {"jsonrpc":"2.0", "method":"exit"}, "wait":[] } }, { diff --git a/testsuite/ada_lsp/project_search/project_search.json b/testsuite/ada_lsp/project_search/project_search.json index e36b38e33..55e19add9 100644 --- a/testsuite/ada_lsp/project_search/project_search.json +++ b/testsuite/ada_lsp/project_search/project_search.json @@ -99,7 +99,7 @@ } }, { "send": { - "request": {"jsonrpc":"2.0", "method":"exit", "params":{}}, + "request": {"jsonrpc":"2.0", "method":"exit"}, "wait":[] } }, { diff --git a/testsuite/ada_lsp/project_symlinks/test.json b/testsuite/ada_lsp/project_symlinks/test.json index 00f061974..69d6b7b54 100644 --- a/testsuite/ada_lsp/project_symlinks/test.json +++ b/testsuite/ada_lsp/project_symlinks/test.json @@ -105,7 +105,7 @@ } }, { "send": { - "request": {"jsonrpc":"2.0", "method":"exit", "params":{}}, + "request": {"jsonrpc":"2.0", "method":"exit"}, "wait":[] } }, { diff --git a/testsuite/ada_lsp/publish_diag/diag_on_open.json b/testsuite/ada_lsp/publish_diag/diag_on_open.json index 200c5059f..fd690d5ad 100644 --- a/testsuite/ada_lsp/publish_diag/diag_on_open.json +++ b/testsuite/ada_lsp/publish_diag/diag_on_open.json @@ -113,7 +113,7 @@ } }, { "send": { - "request": {"jsonrpc":"2.0", "method":"exit", "params":{}}, + "request": {"jsonrpc":"2.0", "method":"exit"}, "wait":[] } }, { diff --git a/testsuite/ada_lsp/publish_diag/publish_diag.json b/testsuite/ada_lsp/publish_diag/publish_diag.json index 5fafad039..17346e0c0 100644 --- a/testsuite/ada_lsp/publish_diag/publish_diag.json +++ b/testsuite/ada_lsp/publish_diag/publish_diag.json @@ -151,7 +151,7 @@ } }, { "send": { - "request": {"jsonrpc":"2.0", "method":"exit", "params":{}}, + "request": {"jsonrpc":"2.0", "method":"exit"}, "wait":[] } }, { diff --git a/testsuite/ada_lsp/publish_diag/publish_diag_disabled.json b/testsuite/ada_lsp/publish_diag/publish_diag_disabled.json index 034e622d5..0df002611 100644 --- a/testsuite/ada_lsp/publish_diag/publish_diag_disabled.json +++ b/testsuite/ada_lsp/publish_diag/publish_diag_disabled.json @@ -80,7 +80,7 @@ } }, { "send": { - "request": {"jsonrpc":"2.0", "method":"exit", "params":{}}, + "request": {"jsonrpc":"2.0", "method":"exit"}, "wait":[] } }, { diff --git a/testsuite/ada_lsp/rename.prepare/test.json b/testsuite/ada_lsp/rename.prepare/test.json index 6e4a19b2b..89bb76122 100644 --- a/testsuite/ada_lsp/rename.prepare/test.json +++ b/testsuite/ada_lsp/rename.prepare/test.json @@ -214,7 +214,7 @@ } }, { "send": { - "request": {"jsonrpc":"2.0", "method":"exit", "params":{}}, + "request": {"jsonrpc":"2.0", "method":"exit"}, "wait":[] } }, { diff --git a/testsuite/ada_lsp/rename/rename.json b/testsuite/ada_lsp/rename/rename.json index 4af1c39b4..74a0a0cb5 100644 --- a/testsuite/ada_lsp/rename/rename.json +++ b/testsuite/ada_lsp/rename/rename.json @@ -210,7 +210,7 @@ } }, { "send": { - "request": {"jsonrpc":"2.0", "method":"exit", "params":{}}, + "request": {"jsonrpc":"2.0", "method":"exit"}, "wait":[] } }, { diff --git a/testsuite/ada_lsp/skip__standard/skip__standard.json b/testsuite/ada_lsp/skip__standard/skip__standard.json index fb88266d3..71fdff6bc 100644 --- a/testsuite/ada_lsp/skip__standard/skip__standard.json +++ b/testsuite/ada_lsp/skip__standard/skip__standard.json @@ -85,7 +85,7 @@ } }, { "send": { - "request": {"jsonrpc":"2.0", "method":"exit", "params":{}}, + "request": {"jsonrpc":"2.0", "method":"exit"}, "wait":[] } }, { diff --git a/testsuite/ada_lsp/spec_from_body/spec_from_body.json b/testsuite/ada_lsp/spec_from_body/spec_from_body.json index 74caba511..3d2652536 100644 --- a/testsuite/ada_lsp/spec_from_body/spec_from_body.json +++ b/testsuite/ada_lsp/spec_from_body/spec_from_body.json @@ -214,7 +214,7 @@ } }, { "send": { - "request": {"jsonrpc":"2.0", "method":"exit", "params":{}}, + "request": {"jsonrpc":"2.0", "method":"exit"}, "wait":[] } }, { diff --git a/testsuite/ada_lsp/type_definition.def_name/test.json b/testsuite/ada_lsp/type_definition.def_name/test.json index c1a6eb4ad..2aeb214da 100644 --- a/testsuite/ada_lsp/type_definition.def_name/test.json +++ b/testsuite/ada_lsp/type_definition.def_name/test.json @@ -185,7 +185,7 @@ } }, { "send": { - "request": {"jsonrpc":"2.0", "method":"exit", "params":{}}, + "request": {"jsonrpc":"2.0", "method":"exit"}, "wait":[] } }, { diff --git a/testsuite/ada_lsp/type_definition/type_definition.json b/testsuite/ada_lsp/type_definition/type_definition.json index a1e2d1720..537cc14fe 100644 --- a/testsuite/ada_lsp/type_definition/type_definition.json +++ b/testsuite/ada_lsp/type_definition/type_definition.json @@ -98,7 +98,7 @@ } }, { "send": { - "request": {"jsonrpc":"2.0", "method":"exit", "params":{}}, + "request": {"jsonrpc":"2.0", "method":"exit"}, "wait":[] } }, { diff --git a/testsuite/ada_lsp/unknown_request/unknown_request.json b/testsuite/ada_lsp/unknown_request/unknown_request.json index 122a0a4cd..97f2876e5 100644 --- a/testsuite/ada_lsp/unknown_request/unknown_request.json +++ b/testsuite/ada_lsp/unknown_request/unknown_request.json @@ -29,7 +29,7 @@ } }, { "send": { - "request": {"jsonrpc":"2.0", "method":"exit", "params":{}}, + "request": {"jsonrpc":"2.0", "method":"exit"}, "wait":[] } }, { diff --git a/testsuite/ada_lsp/workspace_symbol/test.json b/testsuite/ada_lsp/workspace_symbol/test.json index 307cbc8c9..a14aa5759 100644 --- a/testsuite/ada_lsp/workspace_symbol/test.json +++ b/testsuite/ada_lsp/workspace_symbol/test.json @@ -128,7 +128,7 @@ } }, { "send": { - "request": {"jsonrpc":"2.0", "method":"exit", "params":{}}, + "request": {"jsonrpc":"2.0", "method":"exit"}, "wait":[] } }, { diff --git a/testsuite/gpr_lsp/get_symbols/get_symbols.json b/testsuite/gpr_lsp/get_symbols/get_symbols.json index 4ea0395c9..3a3c7ba7e 100644 --- a/testsuite/gpr_lsp/get_symbols/get_symbols.json +++ b/testsuite/gpr_lsp/get_symbols/get_symbols.json @@ -325,8 +325,7 @@ "send": { "request": { "jsonrpc": "2.0", - "method": "exit", - "params": {} + "method": "exit" }, "wait": [] } diff --git a/testsuite/gpr_lsp/get_symbols_hierarchy/test.json b/testsuite/gpr_lsp/get_symbols_hierarchy/test.json index 9c6365633..df7d5a076 100644 --- a/testsuite/gpr_lsp/get_symbols_hierarchy/test.json +++ b/testsuite/gpr_lsp/get_symbols_hierarchy/test.json @@ -568,8 +568,7 @@ "send": { "request": { "jsonrpc": "2.0", - "method": "exit", - "params": {} + "method": "exit" }, "wait": [] } diff --git a/testsuite/gpr_lsp/shutdown/shutdown.json b/testsuite/gpr_lsp/shutdown/shutdown.json index 281146fa2..72c12fd78 100644 --- a/testsuite/gpr_lsp/shutdown/shutdown.json +++ b/testsuite/gpr_lsp/shutdown/shutdown.json @@ -19,7 +19,7 @@ } }, { "send": { - "request": {"jsonrpc":"2.0", "method":"exit", "params":{}}, + "request": {"jsonrpc":"2.0", "method":"exit"}, "wait":[] } }, { From 93183d3a0e56e59e336263c44891fe034ac42183 Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Wed, 13 Sep 2023 13:15:12 +0300 Subject: [PATCH 130/152] Fix Read_Location_Or_Link_Vector procedure in 3.16 to be able to read single object response. The new 3.17 encoder sends definition/declaration/etc response as an object instead of a single element array. Old decoder wasn't be able to read it properly. --- source/protocol/lsp-messages.adb | 41 +++++++++++++++++++++++++------- 1 file changed, 32 insertions(+), 9 deletions(-) diff --git a/source/protocol/lsp-messages.adb b/source/protocol/lsp-messages.adb index b5a8ef052..3cc877769 100644 --- a/source/protocol/lsp-messages.adb +++ b/source/protocol/lsp-messages.adb @@ -2833,13 +2833,14 @@ package body LSP.Messages is Nested : aliased LSP.JSON_Streams.JSON_Stream (JS.Is_Server_Side, Look_Ahead'Unchecked_Access); begin - pragma Assert (Look_Ahead.Is_Start_Array); - Look_Ahead.Read_Next; - - if Look_Ahead.Is_End_Array then + if Look_Ahead.Is_Start_Array then Look_Ahead.Read_Next; - V := (Kind => Empty_Vector_Kind); - return; + + if Look_Ahead.Is_End_Array then + Look_Ahead.Read_Next; + V := (Kind => Empty_Vector_Kind); + return; + end if; end if; pragma Assert (Look_Ahead.Is_Start_Object); @@ -2857,16 +2858,38 @@ package body LSP.Messages is then V := (Kind => LocationLink_Vector_Kind, LocationLinks => <>); Look_Ahead.Rewind; -- Rewind to Start_Array and read - LocationLink_Vector'Read - (Nested'Unchecked_Access, V.LocationLinks); + + if Look_Ahead.Is_Start_Array then + LocationLink_Vector'Read + (Nested'Unchecked_Access, V.LocationLinks); + else + declare + Item : LocationLink; + begin + LocationLink'Read (Nested'Unchecked_Access, Item); + V.LocationLinks.Append (Item); + end; + end if; return; + elsif Key in "uri" | "range" then V := (Kind => Location_Vector_Kind, Locations => <>); Look_Ahead.Rewind; -- Rewind to Start_Array and read - Location_Vector'Read (Nested'Unchecked_Access, V.Locations); + + if Look_Ahead.Is_Start_Array then + Location_Vector'Read (Nested'Unchecked_Access, V.Locations); + else + declare + Item : Location; + begin + Location'Read (Nested'Unchecked_Access, Item); + V.Locations.Append (Item); + end; + end if; return; + else -- Go to next field and try again Nested.Skip_Value; From 697d09b74f9e86634ad0d519e773588fc8af523a Mon Sep 17 00:00:00 2001 From: Vadim Godunko Date: Wed, 13 Sep 2023 16:47:49 +0400 Subject: [PATCH 131/152] Remove use of Ada.Characters.Wide_Wide_Latin_1 when possible. --- source/ada/lsp-ada_documents.adb | 30 ++++++++++--------- .../ada/lsp-ada_handlers-project_loading.adb | 18 +++++------ 2 files changed, 25 insertions(+), 23 deletions(-) diff --git a/source/ada/lsp-ada_documents.adb b/source/ada/lsp-ada_documents.adb index d9b81d008..afae7b45e 100644 --- a/source/ada/lsp-ada_documents.adb +++ b/source/ada/lsp-ada_documents.adb @@ -15,7 +15,6 @@ -- of the license. -- ------------------------------------------------------------------------------ -with Ada.Characters.Wide_Wide_Latin_1; with Ada.Tags; with Ada.Unchecked_Deallocation; @@ -34,7 +33,7 @@ with Utils.Char_Vectors; with Libadalang.Iterators; with Libadalang.Sources; -with VSS.Characters; +with VSS.Characters.Latin; with VSS.Strings.Character_Iterators; with VSS.Strings.Conversions; with VSS.Strings.Cursors; @@ -2018,16 +2017,20 @@ package body LSP.Ada_Documents is function Line_Terminator (Self : Document'Class) return VSS.Strings.Virtual_String is - (if Self.Line_Terminator.Is_Empty then - -- Document has no line terminator yet, return LF as most used - -- - -- Should it be platform specific? CRLF for Windows, CR for Mac? + use type VSS.Strings.Virtual_String; - VSS.Strings.To_Virtual_String - ((1 => Ada.Characters.Wide_Wide_Latin_1.LF)) + begin + return + (if Self.Line_Terminator.Is_Empty then + -- Document has no line terminator yet, return LF as most used + -- + -- Should it be platform specific? CRLF for Windows, CR for Mac? - else - Self.Line_Terminator); + 1 * VSS.Characters.Latin.Line_Feed + + else + Self.Line_Terminator); + end Line_Terminator; ---------------------- -- Range_Formatting -- @@ -2246,6 +2249,8 @@ package body LSP.Ada_Documents is Item : in out LSP.Structures.CompletionItem; Compute_Doc_And_Details : Boolean) is + use type VSS.Strings.Virtual_String; + begin -- Compute the 'documentation' and 'detail' fields immediately if -- requested (i.e: when the client does not support lazy computation @@ -2271,10 +2276,7 @@ package body LSP.Ada_Documents is Item.detail := Decl_Text; if not Doc_Text.Is_Empty then - Loc_Text.Append - (VSS.Strings.To_Virtual_String - ((1 .. 2 => Ada.Characters.Wide_Wide_Latin_1.LF))); - + Loc_Text.Append (2 * VSS.Characters.Latin.Line_Feed); Loc_Text.Append (Doc_Text); end if; diff --git a/source/ada/lsp-ada_handlers-project_loading.adb b/source/ada/lsp-ada_handlers-project_loading.adb index db802e125..016be08f6 100644 --- a/source/ada/lsp-ada_handlers-project_loading.adb +++ b/source/ada/lsp-ada_handlers-project_loading.adb @@ -15,8 +15,6 @@ -- of the license. -- ------------------------------------------------------------------------------ -with Ada.Characters.Wide_Wide_Latin_1; - with GNATCOLL.Traces; with GNATCOLL.VFS; @@ -31,6 +29,7 @@ with GPR2.Project.Tree.View_Builder; with Libadalang.Preprocessing; +with VSS.Characters.Latin; with VSS.Strings.Conversions; with VSS.String_Vectors; @@ -47,9 +46,6 @@ with URIs; package body LSP.Ada_Handlers.Project_Loading is - Line_Feed : constant Wide_Wide_Character := - Ada.Characters.Wide_Wide_Latin_1.LF; - Runtime_Indexing : constant GNATCOLL.Traces.Trace_Handle := GNATCOLL.Traces.Create ("ALS.RUNTIME_INDEXING", GNATCOLL.Traces.On); @@ -129,8 +125,11 @@ package body LSP.Ada_Handlers.Project_Loading is --------------------------- procedure Ensure_Project_Loaded (Self : in out Message_Handler'Class) is + use type VSS.Strings.Virtual_String; + GPRs_Found : Natural := 0; Project_File : VSS.Strings.Virtual_String; + begin if not Self.Contexts.Is_Empty then -- Rely on the fact that there is at least one context initialized @@ -196,10 +195,11 @@ package body LSP.Ada_Handlers.Project_Loading is Self.Sender.On_ShowMessage_Notification ((a_type => LSP.Enumerations.Error, - message => VSS.Strings.To_Virtual_String - ("More than one .gpr found." & Line_Feed & - "Note: you can configure a project " & - " through the ada.projectFile setting."))); + message => + "More than one .gpr found." + & VSS.Characters.Latin.Line_Feed + & "Note: you can configure a project " + & " through the ada.projectFile setting.")); Load_Implicit_Project (Self, Multiple_Projects_Found); end if; From a1c04c603a24c59c8ef81bc048ea0e3abbfa8214 Mon Sep 17 00:00:00 2001 From: Vadim Godunko Date: Thu, 14 Sep 2023 11:40:18 +0400 Subject: [PATCH 132/152] File name formatters. --- source/ada/lsp-ada_documents.adb | 5 +-- source/ada/lsp-formatters-file_names.adb | 50 ++++++++++++++++++++++++ source/ada/lsp-formatters-file_names.ads | 41 +++++++++++++++++++ source/ada/lsp-formatters.ads | 22 +++++++++++ source/ada/lsp-utils.adb | 6 +-- 5 files changed, 117 insertions(+), 7 deletions(-) create mode 100644 source/ada/lsp-formatters-file_names.adb create mode 100644 source/ada/lsp-formatters-file_names.ads create mode 100644 source/ada/lsp-formatters.ads diff --git a/source/ada/lsp-ada_documents.adb b/source/ada/lsp-ada_documents.adb index afae7b45e..efa6c9b97 100644 --- a/source/ada/lsp-ada_documents.adb +++ b/source/ada/lsp-ada_documents.adb @@ -49,6 +49,7 @@ with LSP.Ada_Documentation; with LSP.Ada_Documents.LAL_Diagnostics; with LSP.Ada_Id_Iterators; with LSP.Enumerations; +with LSP.Formatters.File_Names; with LSP.Predicates; with LSP.Utils; with LSP.Structures.LSPAny_Vectors; @@ -1115,9 +1116,7 @@ package body LSP.Ada_Documents is for Error of PP_Messages loop Messages.Append (Template.Format - (VSS.Strings.Formatters.Strings.Image - (VSS.Strings.Conversions.To_Virtual_String - (File.Display_Base_Name)), + (LSP.Formatters.File_Names.Image (File), VSS.Strings.Formatters.Integers.Image (Error.Sloc.Line), VSS.Strings.Formatters.Integers.Image (Error.Sloc.Col), VSS.Strings.Formatters.Strings.Image diff --git a/source/ada/lsp-formatters-file_names.adb b/source/ada/lsp-formatters-file_names.adb new file mode 100644 index 000000000..8ada95916 --- /dev/null +++ b/source/ada/lsp-formatters-file_names.adb @@ -0,0 +1,50 @@ +------------------------------------------------------------------------------ +-- Language Server Protocol -- +-- -- +-- Copyright (C) 2023, AdaCore -- +-- -- +-- This is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 3, or (at your option) any later ver- -- +-- sion. This software is distributed in the hope that it will be useful, -- +-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- -- +-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -- +-- License for more details. You should have received a copy of the GNU -- +-- General Public License distributed with this software; see file -- +-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy -- +-- of the license. -- +------------------------------------------------------------------------------ + +with VSS.Strings.Conversions; + +package body LSP.Formatters.File_Names is + + ----------- + -- Image -- + ----------- + + function Image (Item : GNATCOLL.VFS.Virtual_File) return Formatter is + begin + return + (VSS.Strings.Formatters.Strings.Image + (VSS.Strings.Conversions.To_Virtual_String + (Item.Display_Base_Name)) with null record); + end Image; + + ----------- + -- Image -- + ----------- + + function Image + (Name : VSS.Strings.Virtual_String; + Item : GNATCOLL.VFS.Virtual_File) return Formatter is + begin + return + (VSS.Strings.Formatters.Strings.Image + (Name, + VSS.Strings.Conversions.To_Virtual_String + (Item.Display_Base_Name)) + with null record); + end Image; + +end LSP.Formatters.File_Names; diff --git a/source/ada/lsp-formatters-file_names.ads b/source/ada/lsp-formatters-file_names.ads new file mode 100644 index 000000000..48e8cc5bd --- /dev/null +++ b/source/ada/lsp-formatters-file_names.ads @@ -0,0 +1,41 @@ +------------------------------------------------------------------------------ +-- Language Server Protocol -- +-- -- +-- Copyright (C) 2023, AdaCore -- +-- -- +-- This is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 3, or (at your option) any later ver- -- +-- sion. This software is distributed in the hope that it will be useful, -- +-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- -- +-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -- +-- License for more details. You should have received a copy of the GNU -- +-- General Public License distributed with this software; see file -- +-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy -- +-- of the license. -- +------------------------------------------------------------------------------ + +-- Formatter to include base file names of Virtual_Files into the text. + +with GNATCOLL.VFS; + +with VSS.Strings.Formatters; +private with VSS.Strings.Formatters.Strings; + +package LSP.Formatters.File_Names is + + type Formatter is + new VSS.Strings.Formatters.Abstract_Formatter with private; + + function Image (Item : GNATCOLL.VFS.Virtual_File) return Formatter; + + function Image + (Name : VSS.Strings.Virtual_String; + Item : GNATCOLL.VFS.Virtual_File) return Formatter; + +private + + type Formatter is + new VSS.Strings.Formatters.Strings.Formatter with null record; + +end LSP.Formatters.File_Names; diff --git a/source/ada/lsp-formatters.ads b/source/ada/lsp-formatters.ads new file mode 100644 index 000000000..c28d2c186 --- /dev/null +++ b/source/ada/lsp-formatters.ads @@ -0,0 +1,22 @@ +------------------------------------------------------------------------------ +-- Language Server Protocol -- +-- -- +-- Copyright (C) 2023, AdaCore -- +-- -- +-- This is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 3, or (at your option) any later ver- -- +-- sion. This software is distributed in the hope that it will be useful, -- +-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- -- +-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -- +-- License for more details. You should have received a copy of the GNU -- +-- General Public License distributed with this software; see file -- +-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy -- +-- of the license. -- +------------------------------------------------------------------------------ + +package LSP.Formatters is + + pragma Pure; + +end LSP.Formatters; diff --git a/source/ada/lsp-utils.adb b/source/ada/lsp-utils.adb index ef37daf3c..40f1a62c1 100644 --- a/source/ada/lsp-utils.adb +++ b/source/ada/lsp-utils.adb @@ -31,7 +31,6 @@ with Pp.Actions; with VSS.Strings.Character_Iterators; with VSS.Strings.Conversions; with VSS.Strings.Formatters.Generic_Modulars; -with VSS.Strings.Formatters.Strings; with VSS.Strings.Templates; with VSS.String_Vectors; with VSS.Unicode; @@ -39,6 +38,7 @@ with Laltools.Common; with LSP.Ada_Documents; with LSP.Constants; +with LSP.Formatters.File_Names; with URIs; package body LSP.Utils is @@ -488,9 +488,7 @@ package body LSP.Utils is begin return Template.Format - (VSS.Strings.Formatters.Strings.Image - (VSS.Strings.Conversions.To_Virtual_String - (File.Display_Base_Name)), + (LSP.Formatters.File_Names.Image (File), Line_Number_Formatters.Image (Node.Sloc_Range.Start_Line), Column_Number_Formatters.Image (Node.Sloc_Range.Start_Column)); end Node_Location_Image; From 49e2f89cd80a2ef2310207af7394e840f0a3a532 Mon Sep 17 00:00:00 2001 From: Vadim Godunko Date: Thu, 14 Sep 2023 11:40:40 +0400 Subject: [PATCH 133/152] Langkit's Text_Type formatters. --- source/ada/lsp-ada_documents.adb | 69 +++++++++++++---------------- source/ada/lsp-ada_handlers.adb | 13 +++--- source/ada/lsp-formatters-texts.adb | 44 ++++++++++++++++++ source/ada/lsp-formatters-texts.ads | 39 ++++++++++++++++ 4 files changed, 120 insertions(+), 45 deletions(-) create mode 100644 source/ada/lsp-formatters-texts.adb create mode 100644 source/ada/lsp-formatters-texts.ads diff --git a/source/ada/lsp-ada_documents.adb b/source/ada/lsp-ada_documents.adb index efa6c9b97..85a8c330d 100644 --- a/source/ada/lsp-ada_documents.adb +++ b/source/ada/lsp-ada_documents.adb @@ -20,7 +20,6 @@ with Ada.Unchecked_Deallocation; with GNAT.Strings; with GNATCOLL.Traces; -with GNATCOLL.Utils; with GNATCOLL.VFS; with Langkit_Support.Symbols; @@ -47,13 +46,14 @@ with LSP.Ada_Completions.Filters; with LSP.Ada_Contexts; with LSP.Ada_Documentation; with LSP.Ada_Documents.LAL_Diagnostics; +with LSP.Ada_Handlers.Locations; with LSP.Ada_Id_Iterators; with LSP.Enumerations; with LSP.Formatters.File_Names; +with LSP.Formatters.Texts; with LSP.Predicates; -with LSP.Utils; with LSP.Structures.LSPAny_Vectors; -with LSP.Ada_Handlers.Locations; +with LSP.Utils; package body LSP.Ada_Documents is pragma Warnings (Off); @@ -347,50 +347,41 @@ package body LSP.Ada_Documents is for Param of Params loop for Id of Param.F_Ids loop declare - Mode : constant Langkit_Support.Text.Text_Type := + Mode : constant Langkit_Support.Text.Text_Type := Param.F_Mode.Text; + Mode_Text : constant Langkit_Support.Text.Text_Type := + (if Mode /= "" then Mode & " " else ""); + + Named_Template : constant + VSS.Strings.Templates.Virtual_String_Template := + "{} => ${{{}:{} : {}{}}, "; + Positional_Template : constant + VSS.Strings.Templates.Virtual_String_Template := + "${{{}:{} : {}{}}, "; + Text : VSS.Strings.Virtual_String; begin if Use_Named_Notation then - Insert_Text.Append - (VSS.Strings.To_Virtual_String (Id.Text)); - Insert_Text.Append (" => "); - Insert_Text.Append ("${"); - Insert_Text.Append - (VSS.Strings.Conversions.To_Virtual_String - (GNATCOLL.Utils.Image (Idx, Min_Width => 1))); - Insert_Text.Append (':'); - Insert_Text.Append - (VSS.Strings.To_Virtual_String (Id.Text)); - Insert_Text.Append (" : "); - Insert_Text.Append - ((if Mode /= "" - then VSS.Strings.To_Virtual_String (Mode & " ") - else "")); - Insert_Text.Append - (VSS.Strings.To_Virtual_String - (Param.F_Type_Expr.Text)); - Insert_Text.Append ("}, "); + Text := + Named_Template.Format + (LSP.Formatters.Texts.Image (Id.Text), + VSS.Strings.Formatters.Integers.Image (Idx), + LSP.Formatters.Texts.Image (Id.Text), + LSP.Formatters.Texts.Image (Mode_Text), + LSP.Formatters.Texts.Image + (Param.F_Type_Expr.Text)); else - Insert_Text.Append ("${"); - Insert_Text.Append - (VSS.Strings.Conversions.To_Virtual_String - (GNATCOLL.Utils.Image (Idx, Min_Width => 1))); - Insert_Text.Append (':'); - Insert_Text.Append - (VSS.Strings.To_Virtual_String (Id.Text)); - Insert_Text.Append (" : "); - Insert_Text.Append - ((if Mode /= "" - then VSS.Strings.To_Virtual_String (Mode & " ") - else "")); - Insert_Text.Append - (VSS.Strings.To_Virtual_String - (Param.F_Type_Expr.Text)); - Insert_Text.Append ("}, "); + Text := + Positional_Template.Format + (VSS.Strings.Formatters.Integers.Image (Idx), + LSP.Formatters.Texts.Image (Id.Text), + LSP.Formatters.Texts.Image (Mode_Text), + LSP.Formatters.Texts.Image + (Param.F_Type_Expr.Text)); end if; + Insert_Text.Append (Text); Idx := Idx + 1; end; end loop; diff --git a/source/ada/lsp-ada_handlers.adb b/source/ada/lsp-ada_handlers.adb index 0ae11e074..849a61185 100644 --- a/source/ada/lsp-ada_handlers.adb +++ b/source/ada/lsp-ada_handlers.adb @@ -89,6 +89,7 @@ with LSP.Constants; with LSP.Diagnostic_Sources; with LSP.Enumerations; with LSP.Errors; +with LSP.Formatters.Texts; with LSP.Generic_Cancel_Check; with LSP.GNATCOLL_Tracers.Handle; with LSP.Search; @@ -3959,16 +3960,16 @@ package body LSP.Ada_Handlers is if not Errors.Is_Empty then declare - Template : VSS.Strings.Templates.Virtual_String_Template := - "Can't rename identifier '{}'"; - - Message : constant VSS.Strings.Virtual_String := + Template : constant + VSS.Strings.Templates.Virtual_String_Template := + "Can't rename identifier '{}'"; + Message : constant VSS.Strings.Virtual_String := Template.Format - (VSS.Strings.Formatters.Strings.Image - (VSS.Strings.To_Virtual_String (Name_Node.Text))); + (LSP.Formatters.Texts.Image (Name_Node.Text)); Diag_Params : LSP.Structures.PublishDiagnosticsParams; Diagnostic : LSP.Structures.Diagnostic; + begin Diagnostic.a_range := Self.To_LSP_Location (Name_Node).a_range; diff --git a/source/ada/lsp-formatters-texts.adb b/source/ada/lsp-formatters-texts.adb new file mode 100644 index 000000000..34f8e074d --- /dev/null +++ b/source/ada/lsp-formatters-texts.adb @@ -0,0 +1,44 @@ +------------------------------------------------------------------------------ +-- Language Server Protocol -- +-- -- +-- Copyright (C) 2023, AdaCore -- +-- -- +-- This is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 3, or (at your option) any later ver- -- +-- sion. This software is distributed in the hope that it will be useful, -- +-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- -- +-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -- +-- License for more details. You should have received a copy of the GNU -- +-- General Public License distributed with this software; see file -- +-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy -- +-- of the license. -- +------------------------------------------------------------------------------ + +package body LSP.Formatters.Texts is + + ----------- + -- Image -- + ----------- + + function Image (Item : Langkit_Support.Text.Text_Type) return Formatter is + begin + return + (VSS.Strings.Formatters.Strings.Image + (VSS.Strings.To_Virtual_String (Item)) with null record); + end Image; + + ----------- + -- Image -- + ----------- + + function Image + (Name : VSS.Strings.Virtual_String; + Item : Langkit_Support.Text.Text_Type) return Formatter is + begin + return + (VSS.Strings.Formatters.Strings.Image + (Name, VSS.Strings.To_Virtual_String (Item)) with null record); + end Image; + +end LSP.Formatters.Texts; diff --git a/source/ada/lsp-formatters-texts.ads b/source/ada/lsp-formatters-texts.ads new file mode 100644 index 000000000..84d2f517f --- /dev/null +++ b/source/ada/lsp-formatters-texts.ads @@ -0,0 +1,39 @@ +------------------------------------------------------------------------------ +-- Language Server Protocol -- +-- -- +-- Copyright (C) 2023, AdaCore -- +-- -- +-- This is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 3, or (at your option) any later ver- -- +-- sion. This software is distributed in the hope that it will be useful, -- +-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- -- +-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -- +-- License for more details. You should have received a copy of the GNU -- +-- General Public License distributed with this software; see file -- +-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy -- +-- of the license. -- +------------------------------------------------------------------------------ + +with Langkit_Support.Text; + +with VSS.Strings.Formatters; +private with VSS.Strings.Formatters.Strings; + +package LSP.Formatters.Texts is + + type Formatter is + new VSS.Strings.Formatters.Abstract_Formatter with private; + + function Image (Item : Langkit_Support.Text.Text_Type) return Formatter; + + function Image + (Name : VSS.Strings.Virtual_String; + Item : Langkit_Support.Text.Text_Type) return Formatter; + +private + + type Formatter is + new VSS.Strings.Formatters.Strings.Formatter with null record; + +end LSP.Formatters.Texts; From fc09a104b2f393e7c765aa19ace20dc773ccf12d Mon Sep 17 00:00:00 2001 From: Andry Ogorodnik Date: Sat, 16 Sep 2023 10:12:37 +0000 Subject: [PATCH 134/152] Fix Predefined_Completion --- source/ada/lsp-ada_completions-aspects.adb | 1 + source/ada/lsp-ada_driver.adb | 4 +++- testsuite/ada_lsp/completion.aspects/test.yaml | 3 --- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/source/ada/lsp-ada_completions-aspects.adb b/source/ada/lsp-ada_completions-aspects.adb index 9f058ff3e..3cb01a9ba 100644 --- a/source/ada/lsp-ada_completions-aspects.adb +++ b/source/ada/lsp-ada_completions-aspects.adb @@ -53,6 +53,7 @@ package body LSP.Ada_Completions.Aspects is (Prefix => Prefix, Result => Result.items); end; + elsif Node.Kind in Libadalang.Common.Ada_Aspect_Spec_Range then LSP.Predefined_Completion.Get_Aspects (Prefix => VSS.Strings.Empty_Virtual_String, diff --git a/source/ada/lsp-ada_driver.adb b/source/ada/lsp-ada_driver.adb index 79a7ed0de..82b77d3f3 100644 --- a/source/ada/lsp-ada_driver.adb +++ b/source/ada/lsp-ada_driver.adb @@ -58,6 +58,7 @@ with LSP.Ada_Handlers.Refactor.Suppress_Seperate; with LSP.Ada_Handlers.Suspend_Executions; with LSP.GNATCOLL_Tracers; with LSP.Memory_Statistics; +with LSP.Predefined_Completion; with LSP.Servers; with LSP.Stdio_Streams; @@ -286,7 +287,8 @@ begin if not VSS.Command_Line.Is_Specified (Language_GPR_Option) then -- Load predefined completion items - pragma Assert (not VSS.Command_Line.Is_Specified (Language_GPR_Option)); + LSP.Predefined_Completion.Load_Predefined_Completion_Db (Server_Trace); + Register_Commands; end if; Ada.Text_IO.Set_Output (Ada.Text_IO.Standard_Error); diff --git a/testsuite/ada_lsp/completion.aspects/test.yaml b/testsuite/ada_lsp/completion.aspects/test.yaml index afb2ec0d5..76eb79396 100644 --- a/testsuite/ada_lsp/completion.aspects/test.yaml +++ b/testsuite/ada_lsp/completion.aspects/test.yaml @@ -1,4 +1 @@ title: 'completion.aspects' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] From fae619fb4884b16564aac2c5158340e4bc0d8557 Mon Sep 17 00:00:00 2001 From: Andry Ogorodnik Date: Mon, 18 Sep 2023 10:34:19 +0000 Subject: [PATCH 135/152] Enable a test --- .../ada_lsp/V216-030.completion.attribute_in_decl/test.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/testsuite/ada_lsp/V216-030.completion.attribute_in_decl/test.yaml b/testsuite/ada_lsp/V216-030.completion.attribute_in_decl/test.yaml index 6398fc0c1..ad0e20240 100644 --- a/testsuite/ada_lsp/V216-030.completion.attribute_in_decl/test.yaml +++ b/testsuite/ada_lsp/V216-030.completion.attribute_in_decl/test.yaml @@ -1,4 +1 @@ title: 'V216-030.completion.attribute_in_decl' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] From dcd8ed6aba5b709c513d1d93aec1f469966258ad Mon Sep 17 00:00:00 2001 From: Andry Ogorodnik Date: Mon, 18 Sep 2023 14:34:02 +0000 Subject: [PATCH 136/152] Enable a test --- testsuite/ada_lsp/T827-018.documentSymbol.pragma/test.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/testsuite/ada_lsp/T827-018.documentSymbol.pragma/test.yaml b/testsuite/ada_lsp/T827-018.documentSymbol.pragma/test.yaml index 0af64fb9e..c5fe2ffd2 100644 --- a/testsuite/ada_lsp/T827-018.documentSymbol.pragma/test.yaml +++ b/testsuite/ada_lsp/T827-018.documentSymbol.pragma/test.yaml @@ -1,4 +1 @@ title: 'T827-018.documentSymbol.pragma' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] From c75fe6ef30d21c195f11e09dac9b092425810737 Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Tue, 19 Sep 2023 14:26:40 +0300 Subject: [PATCH 137/152] Take `supportsCustomValues` prop into account for enumeration types. For this types generate new string, integer or modular type. Fix corresponding array types and optional array types, I/O subprograms. Refs #1172 --- source/lsp_gen/lsp_gen-enumerations.adb | 74 ++++++++++++++++++++++++- source/lsp_gen/lsp_gen-inputs.adb | 26 ++++++++- source/lsp_gen/lsp_gen-meta_models.adb | 13 +++++ source/lsp_gen/lsp_gen-meta_models.ads | 5 ++ source/lsp_gen/lsp_gen-outputs.adb | 43 ++++++++++++-- source/lsp_gen/lsp_gen-structures.adb | 50 ++++++++++------- 6 files changed, 181 insertions(+), 30 deletions(-) diff --git a/source/lsp_gen/lsp_gen-enumerations.adb b/source/lsp_gen/lsp_gen-enumerations.adb index ce676fe51..b66ea7db9 100644 --- a/source/lsp_gen/lsp_gen-enumerations.adb +++ b/source/lsp_gen/lsp_gen-enumerations.adb @@ -21,6 +21,65 @@ with LSP_Gen.Puts; use LSP_Gen.Puts; package body LSP_Gen.Enumerations is procedure Write_Type (Enum : LSP_Gen.Entities.Enumeration); + procedure Write_Pseudo_Enum (Enum : LSP_Gen.Entities.Enumeration); + -- When enumeration supports custom values we can't use enumeration type, + -- so instead create new string or integer types and set of functions + -- for corresponding literals. + + ----------------------- + -- Write_Pseudo_Enum -- + ----------------------- + + procedure Write_Pseudo_Enum (Enum : LSP_Gen.Entities.Enumeration) is + Last : constant Positive := Enum.values.Length; + begin + Put ("type "); + Put_Id (Enum.name); + Put_Line (" is "); + + case Enum.a_type.name is + when LSP_Gen.Entities.Enum.string => + Put_Line ("new VSS.Strings.Virtual_String with null record"); + when LSP_Gen.Entities.Enum.integer => + Put_Line ("new Integer"); + when LSP_Gen.Entities.Enum.uinteger => + Put_Line ("mod 2 ** 16"); + end case; + + Put_Line (";"); + Put_Lines (Enum.documentation.Split_Lines, " -- "); + + for J in 1 .. Last loop + declare + Item : constant LSP_Gen.Entities.EnumerationEntry := + Enum.values (J); + begin + New_Line; + Put ("function "); + Put_Id (Item.name); + Put (" return "); + Put_Id (Enum.name); + Put (" is ("); + + case Item.value.Is_String is + when True => + Put (""""); + Put (Item.value.String); + Put (""""); + when False => + Put (Item.value.Integer); + end case; + + Put_Line (");"); + + if not Item.documentation.Is_Empty then + Put_Lines (Item.documentation.Split_Lines, " -- "); + end if; + end; + end loop; + + New_Line; + end Write_Pseudo_Enum; ---------------- -- Write_Type -- @@ -43,8 +102,6 @@ package body LSP_Gen.Enumerations is if J /= Last then Put (", "); end if; - --- Put_Lines (Item.documentation.Split_Lines, " -- "); end; end loop; @@ -77,11 +134,22 @@ package body LSP_Gen.Enumerations is begin Put_Lines (Model.License_Header, "-- "); New_Line; + Put_Line ("with VSS.Strings;"); + New_Line; Put_Line ("package LSP.Enumerations is"); Put_Line (" pragma Preelaborate;"); New_Line; for Name of Model.Enumerations loop - Write_Type (Model.Enumeration (Name)); + declare + Enum : constant LSP_Gen.Entities.Enumeration := + Model.Enumeration (Name); + begin + if Enum.supportsCustomValues then + Write_Pseudo_Enum (Enum); + else + Write_Type (Enum); + end if; + end; end loop; Put_Line ("end LSP.Enumerations;"); diff --git a/source/lsp_gen/lsp_gen-inputs.adb b/source/lsp_gen/lsp_gen-inputs.adb index feb5f09c0..996c313a1 100644 --- a/source/lsp_gen/lsp_gen-inputs.adb +++ b/source/lsp_gen/lsp_gen-inputs.adb @@ -817,6 +817,22 @@ package body LSP_Gen.Inputs is if Spec then Put_Line (";"); + elsif Info.supportsCustomValues then + Put_Line (" is"); + Put_Line ("begin"); + + case Info.a_type.name is + when LSP_Gen.Entities.Enum.string => + Put_Line ("Value := (Handler.String_Value with null record);"); + + when others => + Put ("Value := LSP.Enumerations."); + Put_Id (Name); + Put_Line (" (Handler.Number_Value.Integer_Value);"); + end case; + + Put_Line ("Handler.Read_Next;"); + Put_Line ("end;"); else Put_Line (" is"); Put_Line ("begin"); @@ -1562,6 +1578,9 @@ package body LSP_Gen.Inputs is is use all type LSP_Gen.Mappings.Or_Mapping_Kind; + function Array_Element return LSP_Gen.Entities.AType is + (Tipe.Union.an_array.element.Value); + begin if Name = "LSPArray" then return; -- TBD @@ -1636,7 +1655,12 @@ package body LSP_Gen.Inputs is Put_Line (";"); Put_Line ("begin"); - if Name.Ends_With ("_Set") then + if Name.Ends_With ("_Set") + and then + (Array_Element.Union.Kind /= reference + or else not Model.Is_Custom_Enumeration + (Array_Element.Union.reference.name)) + then Put_Line ("Set := (others => False);"); Put_Line (" while not Handler.Is_End_Array loop"); Write_Call (Done, Tipe.Union.an_array.element.Value, ""); diff --git a/source/lsp_gen/lsp_gen-meta_models.adb b/source/lsp_gen/lsp_gen-meta_models.adb index 2765d9c31..839c11aa7 100644 --- a/source/lsp_gen/lsp_gen-meta_models.adb +++ b/source/lsp_gen/lsp_gen-meta_models.adb @@ -442,6 +442,19 @@ package body LSP_Gen.Meta_Models is end case; end Is_Base_Type; + --------------------------- + -- Is_Custom_Enumeration -- + --------------------------- + + function Is_Custom_Enumeration + (Self : Meta_Model'Class; + Name : VSS.Strings.Virtual_String) return Boolean is + begin + return Self.Is_Enumeration (Name) and then + Self.Model.enumerations (Self.Index (Name).Position) + .supportsCustomValues; + end Is_Custom_Enumeration; + -------------------- -- Is_Enumeration -- -------------------- diff --git a/source/lsp_gen/lsp_gen-meta_models.ads b/source/lsp_gen/lsp_gen-meta_models.ads index 54cbbf329..0ac61b639 100644 --- a/source/lsp_gen/lsp_gen-meta_models.ads +++ b/source/lsp_gen/lsp_gen-meta_models.ads @@ -71,6 +71,11 @@ package LSP_Gen.Meta_Models is (Self : Meta_Model'Class; Name : VSS.Strings.Virtual_String) return Boolean; + function Is_Custom_Enumeration + (Self : Meta_Model'Class; + Name : VSS.Strings.Virtual_String) return Boolean; + -- Enumeration type that supports custom values + function Is_Base_Type (Self : Meta_Model'Class; Tipe : LSP_Gen.Entities.AType) return Boolean; diff --git a/source/lsp_gen/lsp_gen-outputs.adb b/source/lsp_gen/lsp_gen-outputs.adb index 7fdaa78c1..dc3f1c774 100644 --- a/source/lsp_gen/lsp_gen-outputs.adb +++ b/source/lsp_gen/lsp_gen-outputs.adb @@ -111,6 +111,8 @@ package body LSP_Gen.Outputs is and then Tipe.Union.an_array.element.Value.Union.Kind = reference and then Model.Is_Enumeration (Tipe.Union.an_array.element.Value.Union.reference.name) + and then not Model.Is_Custom_Enumeration + (Tipe.Union.an_array.element.Value.Union.reference.name) and then not Tipe.Union.an_array.element.Value.Union.reference.name .Starts_With ("MarkupKind")); @@ -158,12 +160,12 @@ package body LSP_Gen.Outputs is New_Line; Put_Line ("with Ada.Containers;"); Put_Line ("with Interfaces;"); + Put_Line ("with VSS.Strings;"); Put_Line ("with LSP.Output_Tools;"); New_Line; Put_Line ("package body LSP.Outputs is"); New_Line; Put_Line ("pragma Warnings (Off, ""is not referenced"");"); - Put_Line ("use type Interfaces.Integer_64;"); New_Line; Put_Line ("use type Ada.Containers.Count_Type;"); New_Line; for Cursor in Done.Iterate loop @@ -299,6 +301,23 @@ package body LSP_Gen.Outputs is if Spec then Put_Line (";"); + + elsif Info.supportsCustomValues then + Put_Line (" is"); + Put_Line ("begin"); + + case Info.a_type.name is + when LSP_Gen.Entities.Enum.string => + Put ("Handler.String_Value"); + Put_Line (" (VSS.Strings.Virtual_String (Value));"); + + when others => + Put ("Handler.Integer_Value (LSP.Enumerations."); + Put_Id (Name); + Put_Line ("'Pos (Value));"); + end case; + + Put_Line ("end;"); else Put_Line (" is"); Put_Line ("begin"); @@ -609,7 +628,11 @@ package body LSP_Gen.Outputs is Done : LSP_Gen.Dependencies.Dependency_Map; Name : VSS.Strings.Virtual_String; Tipe : LSP_Gen.Entities.AType; - Spec : Boolean) is + Spec : Boolean) + is + function Array_Element return LSP_Gen.Entities.AType is + (Tipe.Union.an_array.element.Value); + begin if Name = "LSPArray" then return; -- TBD @@ -656,7 +679,16 @@ package body LSP_Gen.Outputs is when an_array => Put_Line ("Handler.Start_Array;"); - if Name.Ends_With ("_Set") then + if Array_Element.Union.Kind = reference + and then Model.Is_Custom_Enumeration + (Array_Element.Union.reference.name) + then + Put_Line + ("for J in Value.First_Index .. Value.Last_Index loop"); + Write_Call (Done, Array_Element, " (J)"); + Put_Line ("end loop;"); + + elsif Name.Ends_With ("_Set") then Put_Line ("declare"); Put ("Set : LSP.Structures."); Put (Name); @@ -664,7 +696,7 @@ package body LSP_Gen.Outputs is Put_Line ("begin"); Put_Line (" for Value in Set'Range loop"); Put_Line (" if Set (Value) then"); - Write_Call (Done, Tipe.Union.an_array.element.Value, ""); + Write_Call (Done, Array_Element, ""); Put_Line (" end if;"); Put_Line (" end loop;"); Put_Line ("end;"); @@ -678,8 +710,7 @@ package body LSP_Gen.Outputs is ("for J in Value.First_Index .. Value.Last_Index loop"); end if; - Write_Call - (Done, Tipe.Union.an_array.element.Value, " (J)"); + Write_Call (Done, Array_Element, " (J)"); Put_Line ("end loop;"); end if; Put_Line ("Handler.End_Array;"); diff --git a/source/lsp_gen/lsp_gen-structures.adb b/source/lsp_gen/lsp_gen-structures.adb index 590e1ce92..82c15e080 100644 --- a/source/lsp_gen/lsp_gen-structures.adb +++ b/source/lsp_gen/lsp_gen-structures.adb @@ -76,9 +76,10 @@ package body LSP_Gen.Structures is Done : Dependency_Map); procedure Write_Optional_Type (Name : VSS.Strings.Virtual_String); procedure Write_Vector_Type - (Model : LSP_Gen.Meta_Models.Meta_Model; - Name : VSS.Strings.Virtual_String; - Item : VSS.Strings.Virtual_String); + (Model : LSP_Gen.Meta_Models.Meta_Model; + Name : VSS.Strings.Virtual_String; + Element : LSP_Gen.Entities.AType; + Fallback : VSS.Strings.Virtual_String); procedure Write_Enumeration (Name : VSS.Strings.Virtual_String; List : LSP_Gen.Entities.AType_Vector); @@ -1010,19 +1011,12 @@ package body LSP_Gen.Structures is null; end case; when an_array => - declare - Element : constant VSS.Strings.Virtual_String := - Short_Name - (Model, - Item.Union.an_array.element.Value, - Fallback & "_Item"); - begin - if Name /= "LSPAny_Vector" - and Name /= "Virtual_String_Vector" - then - Write_Vector_Type (Model, Name, Element); - end if; - end; + if Name /= "LSPAny_Vector" + and Name /= "Virtual_String_Vector" + then + Write_Vector_Type + (Model, Name, Item.Union.an_array.element.Value, Fallback); + end if; when map => declare Element : constant VSS.Strings.Virtual_String := Short_Name @@ -1775,11 +1769,16 @@ package body LSP_Gen.Structures is ----------------------- procedure Write_Vector_Type - (Model : LSP_Gen.Meta_Models.Meta_Model; - Name : VSS.Strings.Virtual_String; - Item : VSS.Strings.Virtual_String) + (Model : LSP_Gen.Meta_Models.Meta_Model; + Name : VSS.Strings.Virtual_String; + Element : LSP_Gen.Entities.AType; + Fallback : VSS.Strings.Virtual_String) is - pragma Unreferenced (Model); + Item : constant VSS.Strings.Virtual_String := + Short_Name + (Model, + Element, + Fallback & "_Item"); begin if Name = "DocumentSymbol_Vector" or Name = "SelectionRange_Vector" then declare @@ -1797,6 +1796,17 @@ package body LSP_Gen.Structures is New_Line; return; end; + + elsif Element.Union.Kind = reference + and then Model.Is_Custom_Enumeration (Element.Union.reference.name) + then + -- array of enum that supports custom values. + -- + -- For string-based enumeration do nothing and create ordinary + -- vector of enum (strings). Current LSP doesn't have non-string + -- "custom" enums in arrays. + null; + elsif Name.Ends_With ("_Set") then -- It looks like any enum array in LSP is a set. Let's define them -- as sets. From a46e9804c8f5841fa2ac2e2f97d5b148fca73578 Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Tue, 19 Sep 2023 14:28:32 +0300 Subject: [PATCH 138/152] Regenerate sources after changes in the lsp_gen. Refs #1170 --- .../lsp_3.17/generated/lsp-enumerations.ads | 151 ++++++++++-------- source/lsp_3.17/generated/lsp-inputs.adb | 34 ++-- source/lsp_3.17/generated/lsp-outputs.adb | 137 +++------------- source/lsp_3.17/generated/lsp-structures.ads | 20 ++- 4 files changed, 127 insertions(+), 215 deletions(-) diff --git a/source/lsp_3.17/generated/lsp-enumerations.ads b/source/lsp_3.17/generated/lsp-enumerations.ads index fda6c60d1..17522726b 100644 --- a/source/lsp_3.17/generated/lsp-enumerations.ads +++ b/source/lsp_3.17/generated/lsp-enumerations.ads @@ -6,6 +6,8 @@ -- DON'T EDIT THIS FILE! It was generated from metaModel.json. -- +with VSS.Strings; + package LSP.Enumerations is pragma Preelaborate; @@ -21,21 +23,19 @@ package LSP.Enumerations is type AlsVisibility is (Als_Public, Als_Protected, Als_Private); - type CodeActionKind is - (Empty, QuickFix, Refactor, RefactorExtract, RefactorInline, - RefactorRewrite, Source, SourceOrganizeImports, SourceFixAll); + type CodeActionKind is new VSS.Strings.Virtual_String with null record; -- A set of predefined code action kinds - -- - -- @value Empty + + function Empty return CodeActionKind is (""); -- Empty kind. - -- - -- @value QuickFix + + function QuickFix return CodeActionKind is ("quickfix"); -- Base kind for quickfix actions: 'quickfix' - -- - -- @value Refactor + + function Refactor return CodeActionKind is ("refactor"); -- Base kind for refactoring actions: 'refactor' - -- - -- @value RefactorExtract + + function RefactorExtract return CodeActionKind is ("refactor.extract"); -- Base kind for refactoring extraction actions: 'refactor.extract' -- -- Example extract actions: @@ -44,8 +44,8 @@ package LSP.Enumerations is -- - Extract function -- - Extract variable -- - Extract interface from class - ... - -- - -- @value RefactorInline + + function RefactorInline return CodeActionKind is ("refactor.inline"); -- Base kind for refactoring inline actions: 'refactor.inline' -- -- Example inline actions: @@ -54,25 +54,26 @@ package LSP.Enumerations is -- - Inline variable -- - Inline constant -- - ... - -- - -- @value RefactorRewrite + + function RefactorRewrite return CodeActionKind is ("refactor.rewrite"); -- Base kind for refactoring rewrite actions: 'refactor.rewrite' -- -- Example rewrite actions: -- -- - Convert JavaScript function to class - Add or remove parameter - -- Encapsulate field - Make method static - Move method to base class - ... - -- - -- @value Source + + function Source return CodeActionKind is ("source"); -- Base kind for source actions: `source` -- -- Source code actions apply to the entire file. - -- - -- @value SourceOrganizeImports + + function SourceOrganizeImports return CodeActionKind is + ("source.organizeImports"); -- Base kind for an organize imports source action: -- `source.organizeImports` - -- - -- @value SourceFixAll + + function SourceFixAll return CodeActionKind is ("source.fixAll"); -- Base kind for auto-fix source actions: `source.fixAll`. -- -- Fix all actions automatically fix errors that have a clear fix that @@ -170,34 +171,43 @@ package LSP.Enumerations is -- @value Write -- Write-access of a symbol, like writing to a variable. - type ErrorCodes is - (ParseError, InvalidRequest, MethodNotFound, InvalidParams, InternalError, - jsonrpcReservedErrorRangeStart, serverErrorStart, ServerNotInitialized, - UnknownErrorCode, jsonrpcReservedErrorRangeEnd, serverErrorEnd); + type ErrorCodes is new Integer; -- Predefined error codes. - -- - -- @value jsonrpcReservedErrorRangeStart + + function ParseError return ErrorCodes is (-32_700); + + function InvalidRequest return ErrorCodes is (-32_600); + + function MethodNotFound return ErrorCodes is (-32_601); + + function InvalidParams return ErrorCodes is (-32_602); + + function InternalError return ErrorCodes is (-32_603); + + function jsonrpcReservedErrorRangeStart return ErrorCodes is (-32_099); -- This is the start range of JSON RPC reserved error codes. It doesn't -- denote a real error code. No application error codes should be defined -- between the start and end range. For backwards compatibility the -- `ServerNotInitialized` and the `UnknownErrorCode` are left in the range. -- -- @since 3.16.0 - -- - -- @value serverErrorStart + + function serverErrorStart return ErrorCodes is (-32_099); -- @deprecated use jsonrpcReservedErrorRangeStart */ - -- - -- @value ServerNotInitialized + + function ServerNotInitialized return ErrorCodes is (-32_002); -- Error code indicating that a server received a notification or request -- before the server has received the `initialize` request. - -- - -- @value jsonrpcReservedErrorRangeEnd + + function UnknownErrorCode return ErrorCodes is (-32_001); + + function jsonrpcReservedErrorRangeEnd return ErrorCodes is (-32_000); -- This is the end range of JSON RPC reserved error codes. It doesn't -- denote a real error code. -- -- @since 3.16.0 - -- - -- @value serverErrorEnd + + function serverErrorEnd return ErrorCodes is (-32_000); -- @deprecated use jsonrpcReservedErrorRangeEnd */ type FailureHandlingKind is @@ -245,16 +255,16 @@ package LSP.Enumerations is -- @value folder -- The pattern matches a folder only. - type FoldingRangeKind is (Comment, Imports, Region); + type FoldingRangeKind is new VSS.Strings.Virtual_String with null record; -- A set of predefined range kinds. - -- - -- @value Comment + + function Comment return FoldingRangeKind is ("comment"); -- Folding range for a comment - -- - -- @value Imports + + function Imports return FoldingRangeKind is ("imports"); -- Folding range for an import or include - -- - -- @value Region + + function Region return FoldingRangeKind is ("region"); -- Folding range for a region (e.g. `#region`) type InlayHintKind is (A_Type, Parameter); @@ -307,30 +317,28 @@ package LSP.Enumerations is -- line completion item is indented using 2 tabs and all following lines -- inserted will be indented using 2 tabs as well. - type LSPErrorCodes is - (lspReservedErrorRangeStart, RequestFailed, ServerCancelled, - ContentModified, RequestCancelled, lspReservedErrorRangeEnd); - -- - -- @value lspReservedErrorRangeStart + type LSPErrorCodes is new Integer; + + function lspReservedErrorRangeStart return LSPErrorCodes is (-32_899); -- This is the start range of LSP reserved error codes. It doesn't denote a -- real error code. -- -- @since 3.16.0 - -- - -- @value RequestFailed + + function RequestFailed return LSPErrorCodes is (-32_803); -- A request failed but it was syntactically correct, e.g the method -- name was known and the parameters were valid. The error message -- should contain human readable information about why the request failed. -- -- @since 3.17.0 - -- - -- @value ServerCancelled + + function ServerCancelled return LSPErrorCodes is (-32_802); -- The server cancelled the request. This error code should only be used -- for requests that explicitly support being server cancellable. -- -- @since 3.17.0 - -- - -- @value ContentModified + + function ContentModified return LSPErrorCodes is (-32_801); -- The server detected that the content of a document got modified outside -- normal conditions. A server should NOT send this error code if it -- detects a content change in it unprocessed messages. The result @@ -338,11 +346,11 @@ package LSP.Enumerations is -- -- If a client decides that a result is not of any use anymore the client -- should cancel the request. - -- - -- @value RequestCancelled + + function RequestCancelled return LSPErrorCodes is (-32_800); -- The client has canceled a request and a server as detected the cancel. - -- - -- @value lspReservedErrorRangeEnd + + function lspReservedErrorRangeEnd return LSPErrorCodes is (-32_800); -- This is the end range of LSP reserved error codes. It doesn't denote a -- real error code. -- @@ -402,20 +410,21 @@ package LSP.Enumerations is -- @value Code -- A code-cell is source code. - type PositionEncodingKind is (UTF8, UTF16, UTF32); + type PositionEncodingKind is + new VSS.Strings.Virtual_String with null record; -- A set of predefined position encoding kinds. -- -- @since 3.17.0 - -- - -- @value UTF8 + + function UTF8 return PositionEncodingKind is ("utf-8"); -- Character offsets count UTF-8 code units. - -- - -- @value UTF16 + + function UTF16 return PositionEncodingKind is ("utf-16"); -- Character offsets count UTF-16 code units. -- -- This is the default and must always be supported by servers - -- - -- @value UTF32 + + function UTF32 return PositionEncodingKind is ("utf-32"); -- Character offsets count UTF-32 code units. -- -- Implementation note: these are the same as Unicode code points, so @@ -556,15 +565,15 @@ package LSP.Enumerations is -- @value global -- The moniker is globally unique - type WatchKind is (Create, Change, Delete); - -- - -- @value Create + type WatchKind is mod 2**16; + + function Create return WatchKind is (1); -- Interested in create events. - -- - -- @value Change + + function Change return WatchKind is (2); -- Interested in change events - -- - -- @value Delete + + function Delete return WatchKind is (4); -- Interested in delete events end LSP.Enumerations; diff --git a/source/lsp_3.17/generated/lsp-inputs.adb b/source/lsp_3.17/generated/lsp-inputs.adb index 639a1d3d0..d341feef6 100644 --- a/source/lsp_3.17/generated/lsp-inputs.adb +++ b/source/lsp_3.17/generated/lsp-inputs.adb @@ -1787,10 +1787,10 @@ package body LSP.Inputs is Set : LSP.Structures.FoldingRangeKind_Set renames Value; Value : LSP.Enumerations.FoldingRangeKind; begin - Set := (others => False); + Set.Clear; while not Handler.Is_End_Array loop Read_FoldingRangeKind (Handler, Value); - Set (Value) := True; + Set.Append (Value); end loop; end; @@ -2073,9 +2073,7 @@ package body LSP.Inputs is (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; Value : out LSP.Enumerations.CodeActionKind) is begin - Value := - LSP.Enumerations.CodeActionKind'Val - (CodeActionKind_Map.Get_Index (Handler.String_Value) - 1); + Value := (Handler.String_Value with null record); Handler.Read_Next; end Read_CodeActionKind; @@ -6908,10 +6906,10 @@ package body LSP.Inputs is Set : LSP.Structures.PositionEncodingKind_Set renames Value; Value : LSP.Enumerations.PositionEncodingKind; begin - Set := (others => False); + Set.Clear; while not Handler.Is_End_Array loop Read_PositionEncodingKind (Handler, Value); - Set (Value) := True; + Set.Append (Value); end loop; end; @@ -8340,10 +8338,10 @@ package body LSP.Inputs is Set : LSP.Structures.CodeActionKind_Set renames Value; Value : LSP.Enumerations.CodeActionKind; begin - Set := (others => False); + Set.Clear; while not Handler.Is_End_Array loop Read_CodeActionKind (Handler, Value); - Set (Value) := True; + Set.Append (Value); end loop; end; @@ -10439,9 +10437,7 @@ package body LSP.Inputs is (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; Value : out LSP.Enumerations.WatchKind) is begin - Value := - LSP.Enumerations.WatchKind'Val - (Handler.Number_Value.Integer_Value - 1); + Value := LSP.Enumerations.WatchKind (Handler.Number_Value.Integer_Value); Handler.Read_Next; end Read_WatchKind; @@ -10968,8 +10964,7 @@ package body LSP.Inputs is Value : out LSP.Enumerations.ErrorCodes) is begin Value := - LSP.Enumerations.ErrorCodes'Val - (Handler.Number_Value.Integer_Value + 32_700); + LSP.Enumerations.ErrorCodes (Handler.Number_Value.Integer_Value); Handler.Read_Next; end Read_ErrorCodes; @@ -13591,9 +13586,7 @@ package body LSP.Inputs is (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; Value : out LSP.Enumerations.PositionEncodingKind) is begin - Value := - LSP.Enumerations.PositionEncodingKind'Val - (PositionEncodingKind_Map.Get_Index (Handler.String_Value) - 1); + Value := (Handler.String_Value with null record); Handler.Read_Next; end Read_PositionEncodingKind; @@ -14969,9 +14962,7 @@ package body LSP.Inputs is (Handler : in out VSS.JSON.Pull_Readers.JSON_Pull_Reader'Class; Value : out LSP.Enumerations.FoldingRangeKind) is begin - Value := - LSP.Enumerations.FoldingRangeKind'Val - (FoldingRangeKind_Map.Get_Index (Handler.String_Value) - 1); + Value := (Handler.String_Value with null record); Handler.Read_Next; end Read_FoldingRangeKind; @@ -24145,8 +24136,7 @@ package body LSP.Inputs is Value : out LSP.Enumerations.LSPErrorCodes) is begin Value := - LSP.Enumerations.LSPErrorCodes'Val - (Handler.Number_Value.Integer_Value + 32_899); + LSP.Enumerations.LSPErrorCodes (Handler.Number_Value.Integer_Value); Handler.Read_Next; end Read_LSPErrorCodes; diff --git a/source/lsp_3.17/generated/lsp-outputs.adb b/source/lsp_3.17/generated/lsp-outputs.adb index 7956cb0f5..23522d0dc 100644 --- a/source/lsp_3.17/generated/lsp-outputs.adb +++ b/source/lsp_3.17/generated/lsp-outputs.adb @@ -8,13 +8,12 @@ with Ada.Containers; with Interfaces; +with VSS.Strings; with LSP.Output_Tools; package body LSP.Outputs is pragma Warnings (Off, "is not referenced"); - use type Interfaces.Integer_64; - use type Ada.Containers.Count_Type; procedure Write_ClientCapabilities @@ -1575,15 +1574,9 @@ package body LSP.Outputs is Value : LSP.Structures.FoldingRangeKind_Set) is begin Handler.Start_Array; - declare - Set : LSP.Structures.FoldingRangeKind_Set renames Value; - begin - for Value in Set'Range loop - if Set (Value) then - Write_FoldingRangeKind (Handler, Value); - end if; - end loop; - end; + for J in Value.First_Index .. Value.Last_Index loop + Write_FoldingRangeKind (Handler, Value (J)); + end loop; Handler.End_Array; end Write_FoldingRangeKind_Set; @@ -1593,7 +1586,7 @@ package body LSP.Outputs is .foldingRangeKind_OfFoldingRangeClientCapabilities) is begin Handler.Start_Object; - if (for some Item of Value.valueSet => Item) then + if not Value.valueSet.Is_Empty then Handler.Key_Name ("valueSet"); Write_FoldingRangeKind_Set (Handler, Value.valueSet); end if; @@ -1713,26 +1706,7 @@ package body LSP.Outputs is (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; Value : LSP.Enumerations.CodeActionKind) is begin - case Value is - when LSP.Enumerations.Empty => - Handler.String_Value (""); - when LSP.Enumerations.QuickFix => - Handler.String_Value ("quickfix"); - when LSP.Enumerations.Refactor => - Handler.String_Value ("refactor"); - when LSP.Enumerations.RefactorExtract => - Handler.String_Value ("refactor.extract"); - when LSP.Enumerations.RefactorInline => - Handler.String_Value ("refactor.inline"); - when LSP.Enumerations.RefactorRewrite => - Handler.String_Value ("refactor.rewrite"); - when LSP.Enumerations.Source => - Handler.String_Value ("source"); - when LSP.Enumerations.SourceOrganizeImports => - Handler.String_Value ("source.organizeImports"); - when LSP.Enumerations.SourceFixAll => - Handler.String_Value ("source.fixAll"); - end case; + Handler.String_Value (VSS.Strings.Virtual_String (Value)); end Write_CodeActionKind; procedure Write_RelatedUnchangedDocumentDiagnosticReport @@ -3805,15 +3779,9 @@ package body LSP.Outputs is Value : LSP.Structures.PositionEncodingKind_Set) is begin Handler.Start_Array; - declare - Set : LSP.Structures.PositionEncodingKind_Set renames Value; - begin - for Value in Set'Range loop - if Set (Value) then - Write_PositionEncodingKind (Handler, Value); - end if; - end loop; - end; + for J in Value.First_Index .. Value.Last_Index loop + Write_PositionEncodingKind (Handler, Value (J)); + end loop; Handler.End_Array; end Write_PositionEncodingKind_Set; @@ -3846,7 +3814,7 @@ package body LSP.Outputs is Handler.Key_Name ("markdown"); Write_MarkdownClientCapabilities (Handler, Value.markdown.Value); end if; - if (for some Item of Value.positionEncodings => Item) then + if not Value.positionEncodings.Is_Empty then Handler.Key_Name ("positionEncodings"); Write_PositionEncodingKind_Set (Handler, Value.positionEncodings); end if; @@ -4127,7 +4095,7 @@ package body LSP.Outputs is Handler.Start_Object; Handler.Key_Name ("diagnostics"); Write_Diagnostic_Vector (Handler, Value.diagnostics); - if (for some Item of Value.only => Item) then + if not Value.only.Is_Empty then Handler.Key_Name ("only"); Write_CodeActionKind_Set (Handler, Value.only); end if; @@ -4397,15 +4365,9 @@ package body LSP.Outputs is Value : LSP.Structures.CodeActionKind_Set) is begin Handler.Start_Array; - declare - Set : LSP.Structures.CodeActionKind_Set renames Value; - begin - for Value in Set'Range loop - if Set (Value) then - Write_CodeActionKind (Handler, Value); - end if; - end loop; - end; + for J in Value.First_Index .. Value.Last_Index loop + Write_CodeActionKind (Handler, Value (J)); + end loop; Handler.End_Array; end Write_CodeActionKind_Set; @@ -4526,7 +4488,7 @@ package body LSP.Outputs is Handler.Key_Name ("workDoneProgress"); Handler.Boolean_Value (Value.workDoneProgress.Value); end if; - if (for some Item of Value.codeActionKinds => Item) then + if not Value.codeActionKinds.Is_Empty then Handler.Key_Name ("codeActionKinds"); Write_CodeActionKind_Set (Handler, Value.codeActionKinds); end if; @@ -5399,14 +5361,7 @@ package body LSP.Outputs is (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; Value : LSP.Enumerations.WatchKind) is begin - case Value is - when LSP.Enumerations.Create => - Handler.Integer_Value (1); - when LSP.Enumerations.Change => - Handler.Integer_Value (2); - when LSP.Enumerations.Delete => - Handler.Integer_Value (4); - end case; + Handler.Integer_Value (LSP.Enumerations.WatchKind'Pos (Value)); end Write_WatchKind; procedure Write_DiagnosticSeverity @@ -5651,30 +5606,7 @@ package body LSP.Outputs is (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; Value : LSP.Enumerations.ErrorCodes) is begin - case Value is - when LSP.Enumerations.ParseError => - Handler.Integer_Value (-32_700); - when LSP.Enumerations.InvalidRequest => - Handler.Integer_Value (-32_600); - when LSP.Enumerations.MethodNotFound => - Handler.Integer_Value (-32_601); - when LSP.Enumerations.InvalidParams => - Handler.Integer_Value (-32_602); - when LSP.Enumerations.InternalError => - Handler.Integer_Value (-32_603); - when LSP.Enumerations.jsonrpcReservedErrorRangeStart => - Handler.Integer_Value (-32_099); - when LSP.Enumerations.serverErrorStart => - Handler.Integer_Value (-32_099); - when LSP.Enumerations.ServerNotInitialized => - Handler.Integer_Value (-32_002); - when LSP.Enumerations.UnknownErrorCode => - Handler.Integer_Value (-32_001); - when LSP.Enumerations.jsonrpcReservedErrorRangeEnd => - Handler.Integer_Value (-32_000); - when LSP.Enumerations.serverErrorEnd => - Handler.Integer_Value (-32_000); - end case; + Handler.Integer_Value (LSP.Enumerations.ErrorCodes'Pos (Value)); end Write_ErrorCodes; procedure Write_InsertTextFormat @@ -6817,14 +6749,7 @@ package body LSP.Outputs is (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; Value : LSP.Enumerations.PositionEncodingKind) is begin - case Value is - when LSP.Enumerations.UTF8 => - Handler.String_Value ("utf-8"); - when LSP.Enumerations.UTF16 => - Handler.String_Value ("utf-16"); - when LSP.Enumerations.UTF32 => - Handler.String_Value ("utf-32"); - end case; + Handler.String_Value (VSS.Strings.Virtual_String (Value)); end Write_PositionEncodingKind; procedure Write_Symbol_Progress_Report @@ -7405,14 +7330,7 @@ package body LSP.Outputs is (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; Value : LSP.Enumerations.FoldingRangeKind) is begin - case Value is - when LSP.Enumerations.Comment => - Handler.String_Value ("comment"); - when LSP.Enumerations.Imports => - Handler.String_Value ("imports"); - when LSP.Enumerations.Region => - Handler.String_Value ("region"); - end case; + Handler.String_Value (VSS.Strings.Virtual_String (Value)); end Write_FoldingRangeKind; procedure Write_PublishDiagnosticsParams @@ -8947,7 +8865,7 @@ package body LSP.Outputs is Handler.Key_Name ("workDoneProgress"); Handler.Boolean_Value (Value.workDoneProgress.Value); end if; - if (for some Item of Value.codeActionKinds => Item) then + if not Value.codeActionKinds.Is_Empty then Handler.Key_Name ("codeActionKinds"); Write_CodeActionKind_Set (Handler, Value.codeActionKinds); end if; @@ -11413,20 +11331,7 @@ package body LSP.Outputs is (Handler : in out VSS.JSON.Content_Handlers.JSON_Content_Handler'Class; Value : LSP.Enumerations.LSPErrorCodes) is begin - case Value is - when LSP.Enumerations.lspReservedErrorRangeStart => - Handler.Integer_Value (-32_899); - when LSP.Enumerations.RequestFailed => - Handler.Integer_Value (-32_803); - when LSP.Enumerations.ServerCancelled => - Handler.Integer_Value (-32_802); - when LSP.Enumerations.ContentModified => - Handler.Integer_Value (-32_801); - when LSP.Enumerations.RequestCancelled => - Handler.Integer_Value (-32_800); - when LSP.Enumerations.lspReservedErrorRangeEnd => - Handler.Integer_Value (-32_800); - end case; + Handler.Integer_Value (LSP.Enumerations.LSPErrorCodes'Pos (Value)); end Write_LSPErrorCodes; procedure Write_ReferenceRegistrationOptions diff --git a/source/lsp_3.17/generated/lsp-structures.ads b/source/lsp_3.17/generated/lsp-structures.ads index a35f669a0..d6e4dd01e 100644 --- a/source/lsp_3.17/generated/lsp-structures.ads +++ b/source/lsp_3.17/generated/lsp-structures.ads @@ -1545,9 +1545,11 @@ package LSP.Structures is end case; end record; + package PositionEncodingKind_Vectors is new Ada.Containers.Vectors + (Positive, PositionEncodingKind, "="); + type PositionEncodingKind_Set is - array (PositionEncodingKind) of Boolean with - Pack, Default_Component_Value => False; + new PositionEncodingKind_Vectors.Vector with null record; type GeneralClientCapabilities is record staleRequestSupport : staleRequestSupport_OfGeneralClientCapabilities_Optional; @@ -1832,8 +1834,11 @@ package LSP.Structures is end case; end record; - type CodeActionKind_Set is array (CodeActionKind) of Boolean with - Pack, Default_Component_Value => False; + package CodeActionKind_Vectors is new Ada.Containers.Vectors + (Positive, CodeActionKind, "="); + + type CodeActionKind_Set is + new CodeActionKind_Vectors.Vector with null record; type codeActionKind_OfcodeActionLiteralSupport_OfCodeActionClientCapabilities is record @@ -2135,8 +2140,11 @@ package LSP.Structures is end case; end record; - type FoldingRangeKind_Set is array (FoldingRangeKind) of Boolean with - Pack, Default_Component_Value => False; + package FoldingRangeKind_Vectors is new Ada.Containers.Vectors + (Positive, FoldingRangeKind, "="); + + type FoldingRangeKind_Set is + new FoldingRangeKind_Vectors.Vector with null record; type foldingRangeKind_OfFoldingRangeClientCapabilities is record valueSet : LSP.Structures.FoldingRangeKind_Set; From b4dbb4c2280a55babbd6bc8371a4036523580d09 Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Tue, 19 Sep 2023 14:29:11 +0300 Subject: [PATCH 139/152] Change code after lsp_gen update for `supportsCustomValues` Refs #1170 --- source/ada/lsp-ada_client_capabilities.adb | 13 +++-- source/ada/lsp-ada_handlers-formatting.adb | 10 ++-- ...ada_handlers-named_parameters_commands.adb | 7 ++- source/ada/lsp-ada_handlers-refactor.adb | 4 +- source/ada/lsp-ada_handlers.adb | 13 ++--- source/lsp_3.17/lsp-constants.ads | 50 ++----------------- source/lsp_3.17/lsp-errors.ads | 4 +- source/server/lsp-lifecycle_checkers.adb | 4 +- source/server/lsp-servers.adb | 16 +++--- 9 files changed, 44 insertions(+), 77 deletions(-) diff --git a/source/ada/lsp-ada_client_capabilities.adb b/source/ada/lsp-ada_client_capabilities.adb index 2a9f2b5ce..f4124ead6 100644 --- a/source/ada/lsp-ada_client_capabilities.adb +++ b/source/ada/lsp-ada_client_capabilities.adb @@ -15,6 +15,8 @@ -- of the license. -- ------------------------------------------------------------------------------ +pragma Ada_2022; + with VSS.Characters.Latin; with VSS.JSON.Streams; with VSS.String_Vectors; @@ -242,6 +244,11 @@ package body LSP.Ada_Client_Capabilities is is use type VSS.Strings.Virtual_String; + function Supported_Code_Action_Kinds + return LSP.Structures.CodeActionKind_Vectors.Vector is + [LSP.Enumerations.QuickFix, + LSP.Enumerations.RefactorRewrite]; + function Full_codeActionProvider return LSP.Structures.Boolean_Or_CodeActionOptions_Optional is (Is_Set => True, @@ -249,10 +256,8 @@ package body LSP.Ada_Client_Capabilities is (Is_Boolean => False, CodeActionOptions => (workDoneProgress => LSP.Constants.False, - codeActionKinds => - (LSP.Enumerations.QuickFix => True, - LSP.Enumerations.RefactorRewrite => True, - others => False), + codeActionKinds => (Supported_Code_Action_Kinds + with null record), resolveProvider => LSP.Constants.False))); begin diff --git a/source/ada/lsp-ada_handlers-formatting.adb b/source/ada/lsp-ada_handlers-formatting.adb index 1bf7eefca..d9d8b414b 100644 --- a/source/ada/lsp-ada_handlers-formatting.adb +++ b/source/ada/lsp-ada_handlers-formatting.adb @@ -20,7 +20,7 @@ with GNATCOLL.Traces; with Pp.Command_Lines; with Utils.Command_Lines; -with LSP.Constants; +with LSP.Enumerations; package body LSP.Ada_Handlers.Formatting is @@ -54,7 +54,7 @@ package body LSP.Ada_Handlers.Formatting is if Document.Has_Diagnostics (Context) then Success := False; Error := - (code => LSP.Constants.InternalError, + (code => LSP.Enumerations.InternalError, message => "Incorrect code can't be formatted"); return; @@ -75,7 +75,7 @@ package body LSP.Ada_Handlers.Formatting is if not Success then Error := - (code => LSP.Constants.InternalError, + (code => LSP.Enumerations.InternalError, message => Messages.Join (' ')); Messages.Clear; end if; @@ -101,7 +101,7 @@ package body LSP.Ada_Handlers.Formatting is if Document.Has_Diagnostics (Context) then Success := False; Error := - (code => LSP.Constants.InternalError, + (code => LSP.Enumerations.InternalError, message => "Syntactically incorrect code can't be formatted"); return; @@ -122,7 +122,7 @@ package body LSP.Ada_Handlers.Formatting is if not Success then Error := - (code => LSP.Constants.InternalError, + (code => LSP.Enumerations.InternalError, message => Messages.Join (' ')); end if; end Range_Format; diff --git a/source/ada/lsp-ada_handlers-named_parameters_commands.adb b/source/ada/lsp-ada_handlers-named_parameters_commands.adb index 0cbc4a01d..fceee8095 100644 --- a/source/ada/lsp-ada_handlers-named_parameters_commands.adb +++ b/source/ada/lsp-ada_handlers-named_parameters_commands.adb @@ -25,7 +25,6 @@ with Libadalang.Analysis; with Libadalang.Common; with LSP.Ada_Contexts; -with LSP.Constants; with LSP.Enumerations; with LSP.Servers; with LSP.Structures.LSPAny_Vectors; use LSP.Structures.LSPAny_Vectors; @@ -243,7 +242,7 @@ package body LSP.Ada_Handlers.Named_Parameters_Commands is Error := (Is_Set => True, Value => - (code => LSP.Constants.InvalidRequest, + (code => LSP.Enumerations.InvalidRequest, message => "This is not a valid position to name parameters.")); return; end if; @@ -260,7 +259,7 @@ package body LSP.Ada_Handlers.Named_Parameters_Commands is Error := (Is_Set => True, Value => - (code => LSP.Constants.InvalidRequest, + (code => LSP.Enumerations.InvalidRequest, message => "Could not resolve this call expression precisely.")); return; @@ -291,7 +290,7 @@ package body LSP.Ada_Handlers.Named_Parameters_Commands is Error := (Is_Set => True, Value => - (code => LSP.Constants.UnknownErrorCode, + (code => LSP.Enumerations.UnknownErrorCode, message => VSS.Strings.Conversions.To_Virtual_String (Ada.Exceptions.Exception_Information (E)))); end Execute; diff --git a/source/ada/lsp-ada_handlers-refactor.adb b/source/ada/lsp-ada_handlers-refactor.adb index dc0217a7f..01d60c19b 100644 --- a/source/ada/lsp-ada_handlers-refactor.adb +++ b/source/ada/lsp-ada_handlers-refactor.adb @@ -98,7 +98,7 @@ package body LSP.Ada_Handlers.Refactor is Error := (Is_Set => True, Value => - (code => LSP.Constants.UnknownErrorCode, + (code => LSP.Enumerations.UnknownErrorCode, message => VSS.Strings.Conversions.To_Virtual_String (Error_Msg))); @@ -165,7 +165,7 @@ package body LSP.Ada_Handlers.Refactor is Error := (Is_Set => True, Value => - (code => LSP.Constants.UnknownErrorCode, + (code => LSP.Enumerations.UnknownErrorCode, message => VSS.Strings.Conversions.To_Virtual_String (Error_Msg))); end Execute; diff --git a/source/ada/lsp-ada_handlers.adb b/source/ada/lsp-ada_handlers.adb index 849a61185..693e91928 100644 --- a/source/ada/lsp-ada_handlers.adb +++ b/source/ada/lsp-ada_handlers.adb @@ -505,7 +505,7 @@ package body LSP.Ada_Handlers is -- We need at least one rule in order to validate the input Self.Sender.On_Error_Response - (Id, (LSP.Constants.InvalidParams, "Rule list is empty")); + (Id, (LSP.Enumerations.InvalidParams, "Rule list is empty")); return; elsif Value.input.Is_Empty then @@ -525,7 +525,8 @@ package body LSP.Ada_Handlers is when Constraint_Error => Self.Sender.On_Error_Response (Id, - (LSP.Constants.InvalidParams, Invalid_Rule_Error_Message)); + (LSP.Enumerations.InvalidParams, + Invalid_Rule_Error_Message)); return; end; @@ -2819,7 +2820,7 @@ package body LSP.Ada_Handlers is if Tag = Ada.Tags.No_Tag then Self.Sender.On_Error_Response - (Id, (code => LSP.Constants.InternalError, + (Id, (code => LSP.Enumerations.InternalError, message => "Unknown command")); return; end if; @@ -2884,7 +2885,7 @@ package body LSP.Ada_Handlers is else Self.Sender.On_Error_Response - (Id, (code => LSP.Constants.InternalError, + (Id, (code => LSP.Enumerations.InternalError, message => "Document is not opened")); end if; end On_FoldingRange_Request; @@ -4061,7 +4062,7 @@ package body LSP.Ada_Handlers is if not Self.Implemented then Self.Sender.On_Error_Response (Value.Id, - (code => LSP.Constants.MethodNotFound, + (code => LSP.Enumerations.MethodNotFound, message => "Not implemented")); end if; @@ -4079,7 +4080,7 @@ package body LSP.Ada_Handlers is Self.Sender.On_Error_Response (Value.Id, - (code => LSP.Constants.InternalError, + (code => LSP.Enumerations.InternalError, message => Message)); end; diff --git a/source/lsp_3.17/lsp-constants.ads b/source/lsp_3.17/lsp-constants.ads index da7ed31dc..7319bc1d3 100644 --- a/source/lsp_3.17/lsp-constants.ads +++ b/source/lsp_3.17/lsp-constants.ads @@ -141,50 +141,10 @@ package LSP.Constants is function Error return LSP.Structures.DiagnosticSeverity_Optional is (Is_Set => True, Value => LSP.Enumerations.Error); - ErrorCodes_Map : constant array (LSP.Enumerations.ErrorCodes) of Integer := - [LSP.Enumerations.ParseError => -32700, - LSP.Enumerations.InvalidRequest => -32600, - LSP.Enumerations.MethodNotFound => -32601, - LSP.Enumerations.InvalidParams => -32602, - LSP.Enumerations.InternalError => -32603, - LSP.Enumerations.jsonrpcReservedErrorRangeStart => -32099, - LSP.Enumerations.serverErrorStart => -32099, - LSP.Enumerations.ServerNotInitialized => -32002, - LSP.Enumerations.UnknownErrorCode => -32001, - LSP.Enumerations.jsonrpcReservedErrorRangeEnd => -32000, - LSP.Enumerations.serverErrorEnd => -32000]; - - LSPErrorCodes_Map : constant array - (LSP.Enumerations.LSPErrorCodes) of Integer := - [LSP.Enumerations.lspReservedErrorRangeStart => -32899, - LSP.Enumerations.RequestFailed => -32803, - LSP.Enumerations.ServerCancelled => -32802, - LSP.Enumerations.ContentModified => -32801, - LSP.Enumerations.RequestCancelled => -32800, - LSP.Enumerations.lspReservedErrorRangeEnd => -32800]; - - function InternalError return Integer - is (ErrorCodes_Map (LSP.Enumerations.InternalError)); - - function MethodNotFound return Integer - is (ErrorCodes_Map (LSP.Enumerations.MethodNotFound)); - - function InvalidRequest return Integer - is (ErrorCodes_Map (LSP.Enumerations.InvalidRequest)); - - function UnknownErrorCode return Integer - is (ErrorCodes_Map (LSP.Enumerations.UnknownErrorCode)); - - function ServerNotInitialized return Integer - is (ErrorCodes_Map (LSP.Enumerations.ServerNotInitialized)); - - function InvalidParams return Integer - is (ErrorCodes_Map (LSP.Enumerations.InvalidParams)); - - function RequestFailed return Integer - is (LSPErrorCodes_Map (LSP.Enumerations.RequestFailed)); - - function RequestCancelled return Integer - is (LSPErrorCodes_Map (LSP.Enumerations.RequestCancelled)); + function RequestFailed return LSP.Enumerations.ErrorCodes is + (LSP.Enumerations.ErrorCodes (LSP.Enumerations.RequestFailed)); + + function RequestCancelled return LSP.Enumerations.ErrorCodes is + (LSP.Enumerations.ErrorCodes (LSP.Enumerations.RequestCancelled)); end LSP.Constants; diff --git a/source/lsp_3.17/lsp-errors.ads b/source/lsp_3.17/lsp-errors.ads index a2e09bb2b..95a475811 100644 --- a/source/lsp_3.17/lsp-errors.ads +++ b/source/lsp_3.17/lsp-errors.ads @@ -6,11 +6,13 @@ with VSS.Strings; +with LSP.Enumerations; + package LSP.Errors is pragma Preelaborate; type ResponseError is record - code : Integer; + code : LSP.Enumerations.ErrorCodes; -- A number indicating the error type that occurred. message : VSS.Strings.Virtual_String; -- A string providing a short description of the error. diff --git a/source/server/lsp-lifecycle_checkers.adb b/source/server/lsp-lifecycle_checkers.adb index 0d152ce90..b7020d10f 100644 --- a/source/server/lsp-lifecycle_checkers.adb +++ b/source/server/lsp-lifecycle_checkers.adb @@ -15,7 +15,7 @@ -- of the license. -- ------------------------------------------------------------------------------ -with LSP.Constants; +with LSP.Enumerations; package body LSP.Lifecycle_Checkers is @@ -45,7 +45,7 @@ package body LSP.Lifecycle_Checkers is Client.On_Error_Response (Id => Self.Request_Id.Value, Value => - (code => LSP.Constants.ServerNotInitialized, + (code => LSP.Enumerations.ServerNotInitialized, message => "No initialize request has been received")); end if; end Check_Message; diff --git a/source/server/lsp-servers.adb b/source/server/lsp-servers.adb index 551b98484..8981e82cd 100644 --- a/source/server/lsp-servers.adb +++ b/source/server/lsp-servers.adb @@ -29,7 +29,7 @@ with VSS.Text_Streams.Memory_UTF8_Input; with VSS.Text_Streams.Memory_UTF8_Output; with LSP.Client_Message_Writers; -with LSP.Constants; +with LSP.Enumerations; with LSP.Errors; with LSP.Known_Requests; with LSP.Lifecycle_Checkers; @@ -62,8 +62,8 @@ package body LSP.Servers is Message : VSS.Strings.Virtual_String; Request : VSS.Stream_Element_Vectors.Stream_Element_Vector; Request_Id : LSP.Structures.Integer_Or_Virtual_String; - Code : Integer := - LSP.Constants.InternalError); + Code : LSP.Enumerations.ErrorCodes := + LSP.Enumerations.InternalError); -- Send a response representing the exception to the client. This -- should be called whenever an exception occurred while processing -- a request. @@ -412,7 +412,7 @@ package body LSP.Servers is Self.Tracer.Trace (Vector); Self.On_Error_Response (Request_Id, - (code => LSP.Constants.InvalidParams, + (code => LSP.Enumerations.InvalidParams, message => "Unable to decode request.")); return; @@ -423,7 +423,7 @@ package body LSP.Servers is (Self, UR, "Unknown method.", Vector, Request_Id, - LSP.Constants.MethodNotFound); + LSP.Enumerations.MethodNotFound); return; when E : others => @@ -433,7 +433,7 @@ package body LSP.Servers is (Self, E, "Request decoding fails:", Vector, Request_Id, - LSP.Constants.InvalidParams); + LSP.Enumerations.InvalidParams); return; end; @@ -600,8 +600,8 @@ package body LSP.Servers is Message : VSS.Strings.Virtual_String; Request : VSS.Stream_Element_Vectors.Stream_Element_Vector; Request_Id : LSP.Structures.Integer_Or_Virtual_String; - Code : Integer := - LSP.Constants.InternalError) is + Code : LSP.Enumerations.ErrorCodes := + LSP.Enumerations.InternalError) is begin Self.Tracer.Trace_Exception (E, Message); Self.Tracer.Trace (Request); From 9a3f1b5c02b2cb009250f5fe488b1b7ae885c03e Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Wed, 20 Sep 2023 10:12:26 +0300 Subject: [PATCH 140/152] Restore client_side_file_monitors and fs_watch Implement `DidChangeWatchedFiles` notification. Refs #1170 --- gnat/ignore_in_317.txt | 5 - source/ada/lsp-ada_client_capabilities.adb | 17 ++ source/ada/lsp-ada_client_capabilities.ads | 2 + .../ada/lsp-ada_handlers-project_loading.adb | 22 ++- source/ada/lsp-ada_handlers.adb | 153 ++++++++++++++++-- source/ada/lsp-ada_handlers.ads | 21 ++- source/ada/lsp-client_side_file_monitors.adb | 95 +++++++---- source/ada/lsp-client_side_file_monitors.ads | 12 +- source/ada/lsp-utils.adb | 9 ++ source/ada/lsp-utils.ads | 3 + .../lsp-structures-lspany_vectors.adb | 44 +++++ .../lsp-structures-lspany_vectors.ads | 4 + source/lsp_3.17/lsp-structures-unwrap.ads | 9 ++ source/server/lsp-servers-fs_watch.adb | 67 ++++---- source/server/lsp-servers-fs_watch.ads | 6 +- .../test.json | 3 - .../test.json | 3 - .../test.json | 3 - .../T318-086.suppress.separates.0/test.json | 3 - .../test.json | 3 - .../test.json | 3 - .../test.json | 139 +--------------- 22 files changed, 370 insertions(+), 256 deletions(-) diff --git a/gnat/ignore_in_317.txt b/gnat/ignore_in_317.txt index 8e6ca1a19..903e5fd13 100644 --- a/gnat/ignore_in_317.txt +++ b/gnat/ignore_in_317.txt @@ -1,7 +1,5 @@ lsp-ada_handlers-alire.adb lsp-ada_handlers-alire.ads -lsp-client_side_file_monitors.adb -lsp-client_side_file_monitors.ads lsp-common.adb lsp-common.ads lsp-error_decorators.adb @@ -10,7 +8,6 @@ lsp-fuzz_decorators.adb lsp-fuzz_decorators.ads lsp-lal_utils.adb lsp-lal_utils.ads -lsp-file_monitors.ads lsp-message_loggers.adb lsp-message_loggers.ads lsp-server_backends.ads @@ -18,6 +15,4 @@ lsp-servers-decode_notification.adb lsp-servers-decode_notification.ads lsp-servers-decode_request.adb lsp-servers-decode_request.ads -lsp-servers-fs_watch.adb -lsp-servers-fs_watch.ads lsp-servers-handle_request.ads diff --git a/source/ada/lsp-ada_client_capabilities.adb b/source/ada/lsp-ada_client_capabilities.adb index f4124ead6..04b8bc67e 100644 --- a/source/ada/lsp-ada_client_capabilities.adb +++ b/source/ada/lsp-ada_client_capabilities.adb @@ -63,6 +63,23 @@ package body LSP.Ada_Client_Capabilities is else False); end Code_ActionLiteralSupport; + ----------------------------------------------- + -- didChangeWatchedFiles_dynamicRegistration -- + ----------------------------------------------- + + function didChangeWatchedFiles_dynamicRegistration + (Self : Client_Capability'Class) return Boolean + is + use LSP.Structures.Unwrap; + + Result : constant LSP.Structures.Boolean_Optional := + dynamicRegistration + (didChangeWatchedFiles + (Self.Value.capabilities.workspace)); + begin + return (if Result.Is_Set then Result.Value else False); + end didChangeWatchedFiles_dynamicRegistration; + ------------------------- -- Hierarchical_Symbol -- ------------------------- diff --git a/source/ada/lsp-ada_client_capabilities.ads b/source/ada/lsp-ada_client_capabilities.ads index 69ee3df7c..4da0816f9 100644 --- a/source/ada/lsp-ada_client_capabilities.ads +++ b/source/ada/lsp-ada_client_capabilities.ads @@ -75,6 +75,8 @@ package LSP.Ada_Client_Capabilities is (Self : Client_Capability'Class) return Boolean; -- Returns textDocument.documentSymbol.hierarchicalDocumentSymbolSupport + function didChangeWatchedFiles_dynamicRegistration + (Self : Client_Capability'Class) return Boolean; -- Resource 0perations -- function Resource_Create_Supported diff --git a/source/ada/lsp-ada_handlers-project_loading.adb b/source/ada/lsp-ada_handlers-project_loading.adb index 016be08f6..20e5415d1 100644 --- a/source/ada/lsp-ada_handlers-project_loading.adb +++ b/source/ada/lsp-ada_handlers-project_loading.adb @@ -501,23 +501,19 @@ package body LSP.Ada_Handlers.Project_Loading is -- Reindex all open documents immediately after project reload, so -- that navigation from editors is accurate. - -- for Document of Self.Open_Documents loop - -- for Context of Self.Contexts_For_URI (Document.URI) loop - -- Context.Index_Document (Document.all); - -- end loop; - -- - -- Self.Publish_Diagnostics (Document_Access (Document)); - -- end loop; + for Document of Self.Open_Documents loop + for Context of Self.Contexts_For_URI (Document.URI) loop + Context.Index_Document (Document.all); + end loop; - -- if not Self.File_Monitor.Assigned then - -- Self.File_Monitor := - -- new LSP.Servers.FS_Watch.FS_Watch_Monitor (Self.Server); - -- end if; + Self.Publish_Diagnostics + (LSP.Ada_Documents.Document_Access (Document)); + end loop; -- We have successfully loaded a real project: monitor the filesystem -- for any changes on the sources of the project - -- Self.File_Monitor.Monitor_Directories - -- (Self.Contexts.All_Source_Directories); + Self.File_Monitor.Monitor_Directories + (Self.Contexts.All_Source_Directories); -- Reindex the files from disk in the background after a project reload Mark_Source_Files_For_Indexing (Self); diff --git a/source/ada/lsp-ada_handlers.adb b/source/ada/lsp-ada_handlers.adb index 693e91928..f6ed29130 100644 --- a/source/ada/lsp-ada_handlers.adb +++ b/source/ada/lsp-ada_handlers.adb @@ -85,6 +85,7 @@ with LSP.Ada_Handlers.Refactor.Suppress_Seperate; with LSP.Ada_Handlers.Renaming; with LSP.Ada_Handlers.Symbols; with LSP.Ada_Commands; +with LSP.Client_Side_File_Monitors; with LSP.Constants; with LSP.Diagnostic_Sources; with LSP.Enumerations; @@ -95,6 +96,7 @@ with LSP.GNATCOLL_Tracers.Handle; with LSP.Search; with LSP.Server_Notifications.DidChange; with LSP.Servers; +with LSP.Servers.FS_Watch; with LSP.Structures.LSPAny_Vectors; with LSP.Utils; @@ -110,15 +112,6 @@ package body LSP.Ada_Handlers is function Is_Child return AlsReferenceKind_Array is ([LSP.Enumerations.child => True, others => False]); - function Contexts_For_URI - (Self : access Message_Handler; - URI : LSP.Structures.DocumentUri) - return LSP.Ada_Context_Sets.Context_Lists.List; - -- Return a list of contexts that are suitable for the given File/URI: - -- a list of all contexts where the file is known to be part of the - -- project tree, or is a runtime file for this project. If the file - -- is not known to any project, return an empty list. - procedure Clean_Diagnostics (Self : in out Message_Handler'Class; Document : not null LSP.Ada_Documents.Document_Access); @@ -392,7 +385,7 @@ package body LSP.Ada_Handlers is ---------------- procedure Initialize - (Self : in out Message_Handler'Class; + (Self : access Message_Handler'Class; Incremental_Text_Changes : Boolean; Config_File : VSS.Strings.Virtual_String) is @@ -416,11 +409,13 @@ package body LSP.Ada_Handlers is begin Self.Incremental_Text_Changes := Incremental_Text_Changes; + Self.File_Monitor := + new LSP.Servers.FS_Watch.FS_Watch_Monitor (Self.Server); if not Config_File.Is_Empty then Self.Configuration.Read_File (Config_File); Self.Client.Set_Root_If_Empty (Directory (Config_File)); - LSP.Ada_Handlers.Project_Loading.Reload_Project (Self); + LSP.Ada_Handlers.Project_Loading.Reload_Project (Self.all); end if; end Initialize; @@ -2238,6 +2233,130 @@ package body LSP.Ada_Handlers is end if; end On_DidChangeConfiguration_Notification; + ------------------------------------------- + -- On_DidChangeWatchedFiles_Notification -- + ------------------------------------------- + + overriding procedure On_DidChangeWatchedFiles_Notification + (Self : in out Message_Handler; + Value : LSP.Structures.DidChangeWatchedFilesParams) + is + use type LSP.Ada_Documents.Document_Access; + + URI : LSP.Structures.DocumentUri; + File : GNATCOLL.VFS.Virtual_File; + + procedure Process_Created_File; + -- Processes a created file + + procedure Process_Deleted_File; + -- Processes a deleted file + + procedure Process_Changed_File; + -- Processes a changed file + + -------------------------- + -- Process_Changed_File -- + -------------------------- + + procedure Process_Changed_File is + begin + if Self.Get_Open_Document (URI) = null then + -- If there is no document, reindex the file for each + -- context where it is relevant. + File := Self.To_File (URI); + + for C of Self.Contexts_For_File (File) loop + C.Index_File (File); + end loop; + end if; + end Process_Changed_File; + + -------------------------- + -- Process_Created_File -- + -------------------------- + + procedure Process_Created_File + is + use VSS.Strings.Conversions; + + Contexts : constant LSP.Ada_Context_Sets.Context_Lists.List := + Self.Contexts_For_File (File); + + function Has_Dir + (Context : LSP.Ada_Contexts.Context) + return Boolean + is (Context.List_Source_Directories.Contains (File.Dir)); + -- Return True if File is in a source directory of the project held + -- by Context. + + begin + -- If the file was created by the client, then the DidCreateFiles + -- notification might have been received from it. In that case, + -- Contexts wont be empty, and all we need to do is check if + -- there's an open document. If there is, it takes precedence over + -- the filesystem. + -- If Contexts is empty, then we need to check if is a new source + -- that needs to be added. For instance, a source that was moved + -- to the the project source directories. + + if Contexts.Is_Empty then + for Context of Self.Contexts.Each_Context + (Has_Dir'Unrestricted_Access) + loop + Context.Include_File (File); + Context.Index_File (File); + + Self.Tracer.Trace + ("Included " & File.Display_Base_Name + & " in context " & To_UTF_8_String (Context.Id)); + end loop; + + else + if Self.Get_Open_Document (URI) = null then + for Context of Contexts loop + Context.Index_File (File); + end loop; + end if; + end if; + end Process_Created_File; + + --------------------------- + -- Process_Deleted_Files -- + --------------------------- + + procedure Process_Deleted_File is + begin + if Self.Get_Open_Document (URI) = null then + -- If there is no document, remove from the sources list + -- and reindex the file for each context where it is + -- relevant. + File := Self.To_File (URI); + + for C of Self.Contexts_For_File (File) loop + C.Exclude_File (File); + C.Index_File (File); + end loop; + end if; + end Process_Deleted_File; + + begin + -- Look through each change, filtering non Ada source files + for Change of Value.changes loop + URI := Change.uri; + File := Self.To_File (URI); + + case Change.a_type is + when LSP.Enumerations.Created => + Process_Created_File; + when LSP.Enumerations.Deleted => + Process_Deleted_File; + when LSP.Enumerations.Changed => + Process_Changed_File; + end case; + end loop; + end On_DidChangeWatchedFiles_Notification; + ----------------------------------------------- -- On_DidChangeWorkspaceFolders_Notification -- ----------------------------------------------- @@ -3253,6 +3372,10 @@ package body LSP.Ada_Handlers is Id : LSP.Structures.Integer_Or_Virtual_String; Value : LSP.Structures.InitializeParams) is + procedure Free is new Ada.Unchecked_Deallocation + (LSP.File_Monitors.File_Monitor'Class, + LSP.File_Monitors.File_Monitor_Access); + Response : LSP.Structures.InitializeResult; Token_Types : LSP.Structures.Virtual_String_Vector; Token_Motifiers : LSP.Structures.Virtual_String_Vector; @@ -3268,6 +3391,14 @@ package body LSP.Ada_Handlers is Token_Types, Token_Motifiers); + if Self.Client.didChangeWatchedFiles_dynamicRegistration then + Free (Self.File_Monitor); + + Self.File_Monitor := + new LSP.Client_Side_File_Monitors.File_Monitor + (Self'Unchecked_Access); + end if; + Self.Sender.On_Initialize_Response (Id, Response); end On_Initialize_Request; diff --git a/source/ada/lsp-ada_handlers.ads b/source/ada/lsp-ada_handlers.ads index 0e0759859..729b980c3 100644 --- a/source/ada/lsp-ada_handlers.ads +++ b/source/ada/lsp-ada_handlers.ads @@ -34,6 +34,7 @@ with LSP.Ada_Documents; with LSP.Ada_File_Sets; with LSP.Ada_Highlighters; with LSP.Client_Message_Receivers; +with LSP.File_Monitors; with LSP.Server_Message_Visitors; with LSP.Server_Notification_Receivers; with LSP.Server_Notifications; @@ -62,9 +63,9 @@ package LSP.Ada_Handlers is with private; procedure Initialize - (Self : in out Message_Handler'Class; + (Self : access Message_Handler'Class; Incremental_Text_Changes : Boolean; - Config_File : VSS.Strings.Virtual_String); + Config_File : VSS.Strings.Virtual_String); -- Initialize the message handler and configure it. -- -- Incremental_Text_Changes - activate the support for incremental text @@ -218,6 +219,9 @@ private Token_Id : Integer := 0; -- An ever-increasing number used to generate unique progress tokens + File_Monitor : LSP.File_Monitors.File_Monitor_Access; + -- Filesystem monitoring + ---------------------- -- Project handling -- ---------------------- @@ -353,6 +357,10 @@ private (Self : in out Message_Handler; Value : LSP.Structures.DidChangeConfigurationParams); + overriding procedure On_DidChangeWatchedFiles_Notification + (Self : in out Message_Handler; + Value : LSP.Structures.DidChangeWatchedFilesParams); + overriding procedure On_DidOpen_Notification (Self : in out Message_Handler; Value : LSP.Structures.DidOpenTextDocumentParams); @@ -462,4 +470,13 @@ private -- Converts a Refactoring_Edits into a WorkspaceEdit. The Rename flag -- controls if files that are supposed to be deleted, are renamed instead. + function Contexts_For_URI + (Self : access Message_Handler; + URI : LSP.Structures.DocumentUri) + return LSP.Ada_Context_Sets.Context_Lists.List; + -- Return a list of contexts that are suitable for the given File/URI: + -- a list of all contexts where the file is known to be part of the + -- project tree, or is a runtime file for this project. If the file + -- is not known to any project, return an empty list. + end LSP.Ada_Handlers; diff --git a/source/ada/lsp-client_side_file_monitors.adb b/source/ada/lsp-client_side_file_monitors.adb index b9cd0d04f..87847943c 100644 --- a/source/ada/lsp-client_side_file_monitors.adb +++ b/source/ada/lsp-client_side_file_monitors.adb @@ -15,10 +15,13 @@ -- of the license. -- ------------------------------------------------------------------------------ +with VSS.JSON.Streams; with VSS.Strings.Conversions; -with LSP.Messages.Client_Requests; -with LSP.Types; +with LSP.Enumerations; +with LSP.Servers; +with LSP.Structures.LSPAny_Vectors; +with LSP.Utils; package body LSP.Client_Side_File_Monitors is @@ -33,46 +36,75 @@ package body LSP.Client_Side_File_Monitors is (Self : access File_Monitor; Directories : GNATCOLL.VFS.File_Array) is - Request : LSP.Messages.Client_Requests.RegisterCapability_Request; - Registration : LSP.Messages.Registration := - ((id => <>, - method => method, - registerOptions => - (Kind => LSP.Types.Did_Change_Watched_Files_Registration_Option, - others => <>))); + use type LSP.Enumerations.WatchKind; + Create_Change_Delete : constant LSP.Enumerations.WatchKind := + LSP.Enumerations.Create + + LSP.Enumerations.Change + + LSP.Enumerations.Delete; + + Request_Id : constant LSP.Structures.Integer_Or_Virtual_String := + Self.Handler.Server.Allocate_Request_Id; + + Request : LSP.Structures.RegistrationParams; + + Registration : LSP.Structures.Registration := + (id => <>, + method => method, + registerOptions => <>); + + Options : LSP.Structures.LSPAny_Optional renames + Registration.registerOptions; + -- JSON: { watchers: FileSystemWatcher[]; } begin Self.Stop_Monitoring_Directories; -- Construct a registration id - Self.Registration_Id := - VSS.Strings.To_Virtual_String - ("fm" & Integer'Wide_Wide_Image (-Self.Last_Id)); - Self.Last_Id := Self.Last_Id + 1; + Self.Registration_Id := LSP.Utils.Image (Request_Id); Registration.id := Self.Registration_Id; + Options.Append + (VSS.JSON.Streams.JSON_Stream_Element' + (Kind => VSS.JSON.Streams.Start_Object)); + + Options.Append + (VSS.JSON.Streams.JSON_Stream_Element' + (Kind => VSS.JSON.Streams.Key_Name, + Key_Name => "watchers")); + + Options.Append + (VSS.JSON.Streams.JSON_Stream_Element' + (Kind => VSS.JSON.Streams.Start_Array)); + for Dir of Directories loop declare - use type VSS.Strings.Virtual_String; + Full_Name : constant String := Dir.Display_Full_Name; - Full_Name : constant GNATCOLL.VFS.Filesystem_String := - Dir.Full_Name; + Pattern : constant LSP.Structures.Pattern := + (VSS.Strings.Conversions.To_Virtual_String (Full_Name & '*') + with null record); - Glob : constant VSS.Strings.Virtual_String := - VSS.Strings.Conversions.To_Virtual_String (String (Full_Name)) - & "*"; + Glob : constant LSP.Structures.GlobPattern := + (Is_Pattern => True, Pattern => Pattern); - Watcher : constant LSP.Messages.FileSystemWatcher := - (kind => (LSP.Messages.WatchKind => True), + Watcher : constant LSP.Structures.FileSystemWatcher := + (kind => (Is_Set => True, Value => Create_Change_Delete), globPattern => Glob); begin - Registration.registerOptions.DidChangeWatchedFiles.watchers.Append - (Watcher); + LSP.Structures.LSPAny_Vectors.To_Any (Watcher, Options); end; end loop; - Request.params.registrations.Append (Registration); - Self.Client.On_RegisterCapability_Request (Request); + Options.Append + (VSS.JSON.Streams.JSON_Stream_Element' + (Kind => VSS.JSON.Streams.End_Array)); + + Options.Append + (VSS.JSON.Streams.JSON_Stream_Element' + (Kind => VSS.JSON.Streams.End_Object)); + + Request.registrations.Append (Registration); + Self.Handler.Server.On_RegisterCapability_Request (Request_Id, Request); end Monitor_Directories; --------------------------------- @@ -82,15 +114,20 @@ package body LSP.Client_Side_File_Monitors is overriding procedure Stop_Monitoring_Directories (Self : access File_Monitor) is - Request : LSP.Messages.Client_Requests.UnregisterCapability_Request; - Unregistration : constant LSP.Messages.Unregistration := + Request_Id : constant LSP.Structures.Integer_Or_Virtual_String := + Self.Handler.Server.Allocate_Request_Id; + + Request : LSP.Structures.UnregistrationParams; + + Unregistration : constant LSP.Structures.Unregistration := ((id => Self.Registration_Id, method => method)); begin if not Self.Registration_Id.Is_Empty then - Request.params.unregisterations.Append (Unregistration); - Self.Client.On_UnregisterCapability_Request (Request); + Request.unregisterations.Append (Unregistration); + Self.Handler.Server.On_UnregisterCapability_Request + (Request_Id, Request); Self.Registration_Id := VSS.Strings.Empty_Virtual_String; end if; end Stop_Monitoring_Directories; diff --git a/source/ada/lsp-client_side_file_monitors.ads b/source/ada/lsp-client_side_file_monitors.ads index 14068b28c..bd326bb89 100644 --- a/source/ada/lsp-client_side_file_monitors.ads +++ b/source/ada/lsp-client_side_file_monitors.ads @@ -19,18 +19,20 @@ with GNATCOLL.VFS; with VSS.Strings; -with LSP.Client_Request_Receivers; use LSP.Client_Request_Receivers; +with LSP.Ada_Handlers; with LSP.File_Monitors; package LSP.Client_Side_File_Monitors is - type File_Monitor (Client : not null access Client_Request_Receiver'Class) - is limited new LSP.File_Monitors.File_Monitor with private; + type File_Monitor + (Handler : not null access LSP.Ada_Handlers.Message_Handler) + is limited new LSP.File_Monitors.File_Monitor with private; private - type File_Monitor (Client : not null access Client_Request_Receiver'Class) - is limited new LSP.File_Monitors.File_Monitor with + type File_Monitor + (Handler : not null access LSP.Ada_Handlers.Message_Handler) + is limited new LSP.File_Monitors.File_Monitor with record Last_Id : Positive := 1; Registration_Id : VSS.Strings.Virtual_String; diff --git a/source/ada/lsp-utils.adb b/source/ada/lsp-utils.adb index 40f1a62c1..d8c9db178 100644 --- a/source/ada/lsp-utils.adb +++ b/source/ada/lsp-utils.adb @@ -31,6 +31,7 @@ with Pp.Actions; with VSS.Strings.Character_Iterators; with VSS.Strings.Conversions; with VSS.Strings.Formatters.Generic_Modulars; +with VSS.Strings.Formatters.Integers; with VSS.Strings.Templates; with VSS.String_Vectors; with VSS.Unicode; @@ -427,6 +428,14 @@ package body LSP.Utils is return Get_Location (Node.Unit, Node.Sloc_Range); end Get_Node_Location; + function Image (Value : LSP.Structures.Integer_Or_Virtual_String) + return VSS.Strings.Virtual_String is + (case Value.Is_Integer is + when True => VSS.Strings.Templates.Format + ("{}", + VSS.Strings.Formatters.Integers.Image (Value.Integer)), + when False => Value.Virtual_String); + ------------------ -- Is_Synthetic -- ------------------ diff --git a/source/ada/lsp-utils.ads b/source/ada/lsp-utils.ads index 944e1dd9e..827945cb7 100644 --- a/source/ada/lsp-utils.ads +++ b/source/ada/lsp-utils.ads @@ -98,4 +98,7 @@ package LSP.Utils is Slice : out VSS.Strings.Virtual_String); -- Return a slice of the Text in Span range + function Image (Value : LSP.Structures.Integer_Or_Virtual_String) + return VSS.Strings.Virtual_String; + end LSP.Utils; diff --git a/source/lsp_3.17/lsp-structures-lspany_vectors.adb b/source/lsp_3.17/lsp-structures-lspany_vectors.adb index 670df2a0a..a70da7d77 100644 --- a/source/lsp_3.17/lsp-structures-lspany_vectors.adb +++ b/source/lsp_3.17/lsp-structures-lspany_vectors.adb @@ -418,4 +418,48 @@ package body LSP.Structures.LSPAny_Vectors is Vector.Append (JSON_Stream_Element'(Kind => End_Array)); end To_Any; + procedure To_Any + (Self : FileSystemWatcher; + Vector : in out LSPAny_Vector) + is + procedure To_Any + (Self : GlobPattern; + Vector : in out LSPAny_Vector); + + procedure To_Any + (Self : WatchKind; + Vector : in out LSPAny_Vector); + + procedure To_Any + (Self : GlobPattern; + Vector : in out LSPAny_Vector) is + begin + case Self.Is_Pattern is + when True => + To_Any (VSS.Strings.Virtual_String (Self.Pattern), Vector); + when False => + raise Program_Error with "unimplemented"; + end case; + end To_Any; + + procedure To_Any + (Self : WatchKind; + Vector : in out LSPAny_Vector) is + begin + To_Any (Integer (Self), Vector); + end To_Any; + + begin + Vector.Append (JSON_Stream_Element'(Kind => Start_Object)); + Add_Key ("globPattern", Vector); + To_Any (Self.globPattern, Vector); + + if Self.kind.Is_Set then + Add_Key ("kind", Vector); + To_Any (Self.kind.Value, Vector); + end if; + + Vector.Append (JSON_Stream_Element'(Kind => End_Object)); + end To_Any; + end LSP.Structures.LSPAny_Vectors; diff --git a/source/lsp_3.17/lsp-structures-lspany_vectors.ads b/source/lsp_3.17/lsp-structures-lspany_vectors.ads index 0bf75cebd..74f4c56e7 100644 --- a/source/lsp_3.17/lsp-structures-lspany_vectors.ads +++ b/source/lsp_3.17/lsp-structures-lspany_vectors.ads @@ -84,6 +84,10 @@ package LSP.Structures.LSPAny_Vectors is (Cursor : in out JSON_Event_Vectors.Cursor) return TextDocumentIdentifier; + procedure To_Any + (Self : FileSystemWatcher; + Vector : in out LSPAny_Vector); + procedure Add_Key (Key : VSS.Strings.Virtual_String; Vector : in out LSPAny_Vector); diff --git a/source/lsp_3.17/lsp-structures-unwrap.ads b/source/lsp_3.17/lsp-structures-unwrap.ads index a9afada23..ea657db29 100644 --- a/source/lsp_3.17/lsp-structures-unwrap.ads +++ b/source/lsp_3.17/lsp-structures-unwrap.ads @@ -85,4 +85,13 @@ package LSP.Structures.Unwrap is (if X.Is_Set then X.Value.hierarchicalDocumentSymbolSupport else (Is_Set => False)); + function didChangeWatchedFiles (X : WorkspaceClientCapabilities_Optional) + return DidChangeWatchedFilesClientCapabilities_Optional is + (if X.Is_Set then X.Value.didChangeWatchedFiles else (Is_Set => False)); + + function dynamicRegistration + (X : DidChangeWatchedFilesClientCapabilities_Optional) + return Boolean_Optional is + (if X.Is_Set then X.Value.dynamicRegistration else (Is_Set => False)); + end LSP.Structures.Unwrap; diff --git a/source/server/lsp-servers-fs_watch.adb b/source/server/lsp-servers-fs_watch.adb index ce8411cb3..7d7811cb1 100644 --- a/source/server/lsp-servers-fs_watch.adb +++ b/source/server/lsp-servers-fs_watch.adb @@ -21,6 +21,13 @@ with Ada.Unchecked_Deallocation; with Libfswatch; use Libfswatch; with GNATCOLL.VFS; use GNATCOLL.VFS; +with GNATCOLL.Traces; + +with VSS.Strings.Conversions; + +with LSP.Server_Notifications.DidChangeWatchedFiles; +with LSP.Enumerations; +with URIs; package body LSP.Servers.FS_Watch is @@ -35,26 +42,14 @@ package body LSP.Servers.FS_Watch is overriding procedure Callback (Self : in out LSP_Monitor; Events : Libfswatch.Event_Vectors.Vector) is - function Flag_To_FileChangeType - (X : Event_Flags) return LSP.Messages.FileChangeType; - -- Utility conversion function - - ---------------------------- - -- Flag_To_FileChangeType -- - ---------------------------- + -- Utility conversion function function Flag_To_FileChangeType - (X : Event_Flags) return LSP.Messages.FileChangeType is - begin - case X is - when Created | Moved_From => - return LSP.Messages.Created; - when Removed => - return LSP.Messages.Deleted; - when others => - return LSP.Messages.Changed; - end case; - end Flag_To_FileChangeType; + (X : Event_Flags) return LSP.Enumerations.FileChangeType is + (case X is + when Created | Moved_From => LSP.Enumerations.Created, + when Removed => LSP.Enumerations.Deleted, + when others => LSP.Enumerations.Changed); File : Virtual_File; @@ -67,22 +62,23 @@ package body LSP.Servers.FS_Watch is -- server will process it in the processing thread. declare - use LSP.Messages; - use LSP.Messages.Server_Notifications; - Message : Message_Access; - Changes : DidChangeWatchedFilesParams; - URI : constant LSP.Messages.DocumentUri := - LSP.Types.File_To_URI (File.Display_Full_Name); + Message : Server_Message_Access; + Changes : LSP.Structures.DidChangeWatchedFilesParams; + URI : constant LSP.Structures.DocumentUri := + (VSS.Strings.Conversions.To_Virtual_String + (URIs.Conversions.From_File (File.Display_Full_Name)) + with null record); + begin for F of E.Flags loop Changes.changes.Append - (FileEvent'(uri => URI, - a_type => Flag_To_FileChangeType (F))); + (LSP.Structures.FileEvent' + (uri => URI, + a_type => Flag_To_FileChangeType (F))); end loop; - Message := new DidChangeWatchedFiles_Notification' - (method => "workspace/didChangeWatchedFiles", - jsonrpc => "2.0", - params => Changes); + + Message := new LSP.Server_Notifications.DidChangeWatchedFiles + .Notification'(Params => Changes); Self.The_Server.Input_Queue.Enqueue (Message); end; @@ -182,8 +178,7 @@ package body LSP.Servers.FS_Watch is overriding procedure Monitor_Directories (Self : access FS_Watch_Monitor; - Directories : GNATCOLL.VFS.File_Array) - is + Directories : GNATCOLL.VFS.File_Array) is begin -- If the trace is deactivated, do nothing, and do not launch the task if not Filesystem_Monitoring_Trace.Active then @@ -195,12 +190,12 @@ package body LSP.Servers.FS_Watch is Self.Filesystem_Monitor_Task := new Monitor_Task; end if; - if Self.To_Monitor /= null then - -- If we were previously monitoring directories, stop this now - Self.To_Monitor.Stop_Monitor; - else + if Self.To_Monitor = null then -- Create the shared data if it didn't exist before Self.To_Monitor := new Data_To_Monitor (Self.Server); + else + -- If we were previously monitoring directories, stop this now + Self.To_Monitor.Stop_Monitor; end if; -- Tell the task to start monitoring directories diff --git a/source/server/lsp-servers-fs_watch.ads b/source/server/lsp-servers-fs_watch.ads index ff64feeac..695671fb8 100644 --- a/source/server/lsp-servers-fs_watch.ads +++ b/source/server/lsp-servers-fs_watch.ads @@ -24,7 +24,7 @@ private with Libfswatch; package LSP.Servers.FS_Watch is - type FS_Watch_Monitor (Server : access LSP.Servers.Server) is + type FS_Watch_Monitor (Server : access LSP.Servers.Server'Class) is limited new LSP.File_Monitors.File_Monitor with private; private @@ -39,7 +39,7 @@ private type LSP_Monitor_Access is access LSP_Monitor; - protected type Data_To_Monitor (Server : access LSP.Servers.Server) is + protected type Data_To_Monitor (Server : access LSP.Servers.Server'Class) is -- This is used to share data with the Filesystem_Monitoring_Task procedure Stop_Monitor; @@ -66,7 +66,7 @@ private end Monitor_Task; type Monitor_Task_Access is access Monitor_Task; - type FS_Watch_Monitor (Server : access LSP.Servers.Server) is + type FS_Watch_Monitor (Server : access LSP.Servers.Server'Class) is limited new LSP.File_Monitors.File_Monitor with record Filesystem_Monitor_Task : Monitor_Task_Access; diff --git a/testsuite/ada_lsp/S314-015.refactor_change_parameter_mode_0/test.json b/testsuite/ada_lsp/S314-015.refactor_change_parameter_mode_0/test.json index daa59db1a..c920262f2 100644 --- a/testsuite/ada_lsp/S314-015.refactor_change_parameter_mode_0/test.json +++ b/testsuite/ada_lsp/S314-015.refactor_change_parameter_mode_0/test.json @@ -39,9 +39,6 @@ "didChangeConfiguration": { "dynamicRegistration": true }, - "didChangeWatchedFiles": { - "dynamicRegistration": true - }, "symbol": {}, "codeLens": { "refreshSupport": true diff --git a/testsuite/ada_lsp/S314-015.refactor_move_parameter_0/test.json b/testsuite/ada_lsp/S314-015.refactor_move_parameter_0/test.json index e5f637c06..43942f2f6 100644 --- a/testsuite/ada_lsp/S314-015.refactor_move_parameter_0/test.json +++ b/testsuite/ada_lsp/S314-015.refactor_move_parameter_0/test.json @@ -39,9 +39,6 @@ "didChangeConfiguration": { "dynamicRegistration": true }, - "didChangeWatchedFiles": { - "dynamicRegistration": true - }, "symbol": {}, "codeLens": { "refreshSupport": true diff --git a/testsuite/ada_lsp/S314-015.refactor_remove_parameter_0/test.json b/testsuite/ada_lsp/S314-015.refactor_remove_parameter_0/test.json index eb5e597b5..f231e9d08 100644 --- a/testsuite/ada_lsp/S314-015.refactor_remove_parameter_0/test.json +++ b/testsuite/ada_lsp/S314-015.refactor_remove_parameter_0/test.json @@ -39,9 +39,6 @@ "didChangeConfiguration": { "dynamicRegistration": true }, - "didChangeWatchedFiles": { - "dynamicRegistration": true - }, "symbol": {}, "codeLens": { "refreshSupport": true diff --git a/testsuite/ada_lsp/T318-086.suppress.separates.0/test.json b/testsuite/ada_lsp/T318-086.suppress.separates.0/test.json index 0bda78326..a4adb65c0 100644 --- a/testsuite/ada_lsp/T318-086.suppress.separates.0/test.json +++ b/testsuite/ada_lsp/T318-086.suppress.separates.0/test.json @@ -33,9 +33,6 @@ "didChangeConfiguration": { "dynamicRegistration": true }, - "didChangeWatchedFiles": { - "dynamicRegistration": true - }, "executeCommand": { "dynamicRegistration": true }, diff --git a/testsuite/ada_lsp/U416-030.refactor_change_parameter_mode_0/test.json b/testsuite/ada_lsp/U416-030.refactor_change_parameter_mode_0/test.json index a72b98381..87a19f108 100644 --- a/testsuite/ada_lsp/U416-030.refactor_change_parameter_mode_0/test.json +++ b/testsuite/ada_lsp/U416-030.refactor_change_parameter_mode_0/test.json @@ -39,9 +39,6 @@ "didChangeConfiguration": { "dynamicRegistration": true }, - "didChangeWatchedFiles": { - "dynamicRegistration": true - }, "symbol": {}, "codeLens": { "refreshSupport": true diff --git a/testsuite/ada_lsp/U416-030.refactor_remove_parameter_0/test.json b/testsuite/ada_lsp/U416-030.refactor_remove_parameter_0/test.json index a7153936b..9d9855a5c 100644 --- a/testsuite/ada_lsp/U416-030.refactor_remove_parameter_0/test.json +++ b/testsuite/ada_lsp/U416-030.refactor_remove_parameter_0/test.json @@ -39,9 +39,6 @@ "didChangeConfiguration": { "dynamicRegistration": true }, - "didChangeWatchedFiles": { - "dynamicRegistration": true - }, "symbol": {}, "codeLens": { "refreshSupport": true diff --git a/testsuite/ada_lsp/UA28-007.Did_Change_Watched_Files_0/test.json b/testsuite/ada_lsp/UA28-007.Did_Change_Watched_Files_0/test.json index 8251d5693..c1a7029bf 100644 --- a/testsuite/ada_lsp/UA28-007.Did_Change_Watched_Files_0/test.json +++ b/testsuite/ada_lsp/UA28-007.Did_Change_Watched_Files_0/test.json @@ -322,45 +322,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": { - "codeActionKinds": [ - "quickfix", - "refactor.rewrite" - ] - }, - "documentFormattingProvider": true, - "renameProvider": { - "prepareProvider": true - }, - "foldingRangeProvider": true, - "workspaceSymbolProvider": true, - "callHierarchyProvider": {} + "documentSymbolProvider": true } } } @@ -401,110 +364,18 @@ "wait": [ { "jsonrpc": "2.0", - "id": 2, + "id": 1, "method": "client/registerCapability", "params": { "registrations": [ { - "id": "fm-1", + "id": "1", "method": "workspace/didChangeWatchedFiles", "registerOptions": { "watchers": [ { - "globPattern": "${DIR}${DIR_SEP}*" - } - ] - } - } - ] - } - }, - { - "jsonrpc": "2.0", - "id": 3, - "method": "client/registerCapability", - "params": { - "registrations": [ - { - "id": "Will_Create", - "method": "workspace/willCreateFiles", - "registerOptions": { - "filters": [ - { - "scheme": "file", - "pattern": { - "glob": "${DIR}${DIR_SEP}*{.ads,.adb}" - } - } - ] - } - }, - { - "id": "Did_Create", - "method": "workspace/didCreateFiles", - "registerOptions": { - "filters": [ - { - "scheme": "file", - "pattern": { - "glob": "${DIR}${DIR_SEP}*{.ads,.adb}" - } - } - ] - } - }, - { - "id": "Will_Rename", - "method": "workspace/willRenameFiles", - "registerOptions": { - "filters": [ - { - "scheme": "file", - "pattern": { - "glob": "${DIR}${DIR_SEP}*{.ads,.adb}" - } - } - ] - } - }, - { - "id": "Did_Rename", - "method": "workspace/didRenameFiles", - "registerOptions": { - "filters": [ - { - "scheme": "file", - "pattern": { - "glob": "${DIR}${DIR_SEP}*{.ads,.adb}" - } - } - ] - } - }, - { - "id": "Will_Delete", - "method": "workspace/willDeleteFiles", - "registerOptions": { - "filters": [ - { - "scheme": "file", - "pattern": { - "glob": "${DIR}${DIR_SEP}*{.ads,.adb}" - } - } - ] - } - }, - { - "id": "Did_Delete", - "method": "workspace/didDeleteFiles", - "registerOptions": { - "filters": [ - { - "scheme": "file", - "pattern": { - "glob": "${DIR}${DIR_SEP}*{.ads,.adb}" - } + "globPattern": "${DIR}${DIR_SEP}*", + "kind": 7 } ] } From dbf888eece828a6edfb2a1a37c50b319b9e04318 Mon Sep 17 00:00:00 2001 From: Andry Ogorodnik Date: Wed, 20 Sep 2023 15:31:32 +0000 Subject: [PATCH 141/152] Send empty report on Libadalang.Common.Property_Error --- source/ada/lsp-ada_empty_handlers.adb | 747 ++++++++++++++++++++++++++ source/ada/lsp-ada_empty_handlers.ads | 290 ++++++++++ source/ada/lsp-ada_handlers.adb | 8 + 3 files changed, 1045 insertions(+) create mode 100644 source/ada/lsp-ada_empty_handlers.adb create mode 100644 source/ada/lsp-ada_empty_handlers.ads diff --git a/source/ada/lsp-ada_empty_handlers.adb b/source/ada/lsp-ada_empty_handlers.adb new file mode 100644 index 000000000..a41269e6b --- /dev/null +++ b/source/ada/lsp-ada_empty_handlers.adb @@ -0,0 +1,747 @@ +------------------------------------------------------------------------------ +-- Language Server Protocol -- +-- -- +-- Copyright (C) 2023, AdaCore -- +-- -- +-- This is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 3, or (at your option) any later ver- -- +-- sion. This software is distributed in the hope that it will be useful, -- +-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- -- +-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -- +-- License for more details. You should have received a copy of the GNU -- +-- General Public License distributed with this software; see file -- +-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy -- +-- of the license. -- +------------------------------------------------------------------------------ + +package body LSP.Ada_Empty_Handlers is + + ------------------------------- + -- On_AlsCheckSyntax_Request -- + ------------------------------- + + overriding procedure On_AlsCheckSyntax_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.AlsCheckSyntaxParams) + is + Empty : LSP.Structures.AlsCheckSyntaxResult; + begin + Self.Sender.On_AlsCheckSyntax_Response (Id, Empty); + end On_AlsCheckSyntax_Request; + + ------------------------------ + -- On_IncomingCalls_Request -- + ------------------------------ + + overriding procedure On_IncomingCalls_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CallHierarchyIncomingCallsParams) + is + Empty : LSP.Structures.CallHierarchyIncomingCall_Vector_Or_Null; + begin + Self.Sender.On_IncomingCalls_Response (Id, Empty); + end On_IncomingCalls_Request; + + ------------------------------ + -- On_OutgoingCalls_Request -- + ------------------------------ + + overriding procedure On_OutgoingCalls_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CallHierarchyOutgoingCallsParams) + is + Empty : LSP.Structures.CallHierarchyOutgoingCall_Vector_Or_Null; + begin + Self.Sender.On_OutgoingCalls_Response (Id, Empty); + end On_OutgoingCalls_Request; + + ------------------------------------ + -- On_Code_Action_Resolve_Request -- + ------------------------------------ + + overriding procedure On_Code_Action_Resolve_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CodeAction) + is + Empty : LSP.Structures.CodeAction; + begin + Self.Sender.On_Code_Action_Resolve_Response (Id, Empty); + end On_Code_Action_Resolve_Request; + + ---------------------------------- + -- On_Code_Lens_Resolve_Request -- + ---------------------------------- + + overriding procedure On_Code_Lens_Resolve_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CodeLens) + is + Empty : LSP.Structures.CodeLens; + begin + Self.Sender.On_Code_Lens_Resolve_Response (Id, Empty); + end On_Code_Lens_Resolve_Request; + + ----------------------------------- + -- On_Completion_Resolve_Request -- + ----------------------------------- + + overriding procedure On_Completion_Resolve_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CompletionItem) + is + Empty : LSP.Structures.CompletionItem; + begin + Self.Sender.On_Completion_Resolve_Response (Id, Empty); + end On_Completion_Resolve_Request; + + ----------------------------- + -- On_Link_Resolve_Request -- + ----------------------------- + + overriding procedure On_Link_Resolve_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentLink) + is + Empty : LSP.Structures.DocumentLink; + begin + Self.Sender.On_Link_Resolve_Response (Id, Empty); + end On_Link_Resolve_Request; + + --------------------------- + -- On_Initialize_Request -- + --------------------------- + + overriding procedure On_Initialize_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InitializeParams) + is + Empty : LSP.Structures.InitializeResult; + begin + Self.Sender.On_Initialize_Response (Id, Empty); + end On_Initialize_Request; + + ------------------------------ + -- On_Inlay_Resolve_Request -- + ------------------------------ + + overriding procedure On_Inlay_Resolve_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InlayHint) + is + Empty : LSP.Structures.InlayHint; + begin + Self.Sender.On_Inlay_Resolve_Response (Id, Empty); + end On_Inlay_Resolve_Request; + + ------------------------- + -- On_Shutdown_Request -- + ------------------------- + + overriding procedure On_Shutdown_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String) + is + Empty : LSP.Structures.Null_Record; + begin + Self.Sender.On_Shutdown_Response (Id, Empty); + end On_Shutdown_Request; + + --------------------------- + -- On_CodeAction_Request -- + --------------------------- + + overriding procedure On_CodeAction_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CodeActionParams) + is + Empty : LSP.Structures.Command_Or_CodeAction_Vector_Or_Null; + begin + Self.Sender.On_CodeAction_Response (Id, Empty); + end On_CodeAction_Request; + + ------------------------- + -- On_CodeLens_Request -- + ------------------------- + + overriding procedure On_CodeLens_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CodeLensParams) + is + Empty : LSP.Structures.CodeLens_Vector_Or_Null; + begin + Self.Sender.On_CodeLens_Response (Id, Empty); + end On_CodeLens_Request; + + ---------------------------------- + -- On_ColorPresentation_Request -- + ---------------------------------- + + overriding procedure On_ColorPresentation_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ColorPresentationParams) + is + Empty : LSP.Structures.ColorPresentation_Vector; + begin + Self.Sender.On_ColorPresentation_Response (Id, Empty); + end On_ColorPresentation_Request; + + --------------------------- + -- On_Completion_Request -- + --------------------------- + + overriding procedure On_Completion_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CompletionParams) + is + Empty : LSP.Structures.Completion_Result; + begin + Self.Sender.On_Completion_Response (Id, Empty); + end On_Completion_Request; + + ---------------------------- + -- On_Declaration_Request -- + ---------------------------- + + overriding procedure On_Declaration_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DeclarationParams) + is + Empty : LSP.Structures.Declaration_Result; + begin + Self.Sender.On_Declaration_Response (Id, Empty); + end On_Declaration_Request; + + --------------------------- + -- On_Definition_Request -- + --------------------------- + + overriding procedure On_Definition_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DefinitionParams) + is + Empty : LSP.Structures.Definition_Result; + begin + Self.Sender.On_Definition_Response (Id, Empty); + end On_Definition_Request; + + --------------------------- + -- On_Diagnostic_Request -- + --------------------------- + + overriding procedure On_Diagnostic_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentDiagnosticParams) + is + Empty : LSP.Structures.DocumentDiagnosticReport; + begin + Self.Sender.On_Diagnostic_Response (Id, Empty); + end On_Diagnostic_Request; + + ------------------------------ + -- On_DocumentColor_Request -- + ------------------------------ + + overriding procedure On_DocumentColor_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentColorParams) + is + Empty : LSP.Structures.ColorInformation_Vector; + begin + Self.Sender.On_DocumentColor_Response (Id, Empty); + end On_DocumentColor_Request; + + ---------------------------------- + -- On_DocumentHighlight_Request -- + ---------------------------------- + + overriding procedure On_DocumentHighlight_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentHighlightParams) + is + Empty : LSP.Structures.DocumentHighlight_Vector_Or_Null; + begin + Self.Sender.On_DocumentHighlight_Response (Id, Empty); + end On_DocumentHighlight_Request; + + ----------------------------- + -- On_DocumentLink_Request -- + ----------------------------- + + overriding procedure On_DocumentLink_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentLinkParams) + is + Empty : LSP.Structures.DocumentLink_Vector_Or_Null; + begin + Self.Sender.On_DocumentLink_Response (Id, Empty); + end On_DocumentLink_Request; + + ------------------------------- + -- On_DocumentSymbol_Request -- + ------------------------------- + + overriding procedure On_DocumentSymbol_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentSymbolParams) + is + Empty : LSP.Structures.DocumentSymbol_Result; + begin + Self.Sender.On_DocumentSymbol_Response (Id, Empty); + end On_DocumentSymbol_Request; + + ----------------------------- + -- On_FoldingRange_Request -- + ----------------------------- + + overriding procedure On_FoldingRange_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.FoldingRangeParams) + is + Empty : LSP.Structures.FoldingRange_Vector_Or_Null; + begin + Self.Sender.On_FoldingRange_Response (Id, Empty); + end On_FoldingRange_Request; + + --------------------------- + -- On_Formatting_Request -- + --------------------------- + + overriding procedure On_Formatting_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentFormattingParams) + is + Empty : LSP.Structures.TextEdit_Vector_Or_Null; + begin + Self.Sender.On_Formatting_Response (Id, Empty); + end On_Formatting_Request; + + ---------------------- + -- On_Hover_Request -- + ---------------------- + + overriding procedure On_Hover_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.HoverParams) + is + Empty : LSP.Structures.Hover_Or_Null; + begin + Self.Sender.On_Hover_Response (Id, Empty); + end On_Hover_Request; + + ------------------------------- + -- On_Implementation_Request -- + ------------------------------- + + overriding procedure On_Implementation_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ImplementationParams) + is + Empty : LSP.Structures.Definition_Result; + begin + Self.Sender.On_Implementation_Response (Id, Empty); + end On_Implementation_Request; + + -------------------------- + -- On_InlayHint_Request -- + -------------------------- + + overriding procedure On_InlayHint_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InlayHintParams) + is + Empty : LSP.Structures.InlayHint_Vector_Or_Null; + begin + Self.Sender.On_InlayHint_Response (Id, Empty); + end On_InlayHint_Request; + + ---------------------------- + -- On_InlineValue_Request -- + ---------------------------- + + overriding procedure On_InlineValue_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InlineValueParams) + is + Empty : LSP.Structures.InlineValue_Vector_Or_Null; + begin + Self.Sender.On_InlineValue_Response (Id, Empty); + end On_InlineValue_Request; + + ----------------------------------- + -- On_LinkedEditingRange_Request -- + ----------------------------------- + + overriding procedure On_LinkedEditingRange_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.LinkedEditingRangeParams) + is + Empty : LSP.Structures.LinkedEditingRanges_Or_Null; + begin + Self.Sender.On_LinkedEditingRange_Response (Id, Empty); + end On_LinkedEditingRange_Request; + + ------------------------ + -- On_Moniker_Request -- + ------------------------ + + overriding procedure On_Moniker_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.MonikerParams) + is + Empty : LSP.Structures.Moniker_Vector_Or_Null; + begin + Self.Sender.On_Moniker_Response (Id, Empty); + end On_Moniker_Request; + + --------------------------------- + -- On_OnTypeFormatting_Request -- + --------------------------------- + + overriding procedure On_OnTypeFormatting_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentOnTypeFormattingParams) + is + Empty : LSP.Structures.TextEdit_Vector_Or_Null; + begin + Self.Sender.On_OnTypeFormatting_Response (Id, Empty); + end On_OnTypeFormatting_Request; + + ------------------------------------- + -- On_PrepareCallHierarchy_Request -- + ------------------------------------- + + overriding procedure On_PrepareCallHierarchy_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CallHierarchyPrepareParams) + is + Empty : LSP.Structures.CallHierarchyItem_Vector_Or_Null; + begin + Self.Sender.On_PrepareCallHierarchy_Response (Id, Empty); + end On_PrepareCallHierarchy_Request; + + ------------------------------ + -- On_PrepareRename_Request -- + ------------------------------ + + overriding procedure On_PrepareRename_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.PrepareRenameParams) + is + Empty : LSP.Structures.PrepareRenameResult_Or_Null; + begin + Self.Sender.On_PrepareRename_Response (Id, Empty); + end On_PrepareRename_Request; + + ------------------------------------- + -- On_PrepareTypeHierarchy_Request -- + ------------------------------------- + + overriding procedure On_PrepareTypeHierarchy_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TypeHierarchyPrepareParams) + is + Empty : LSP.Structures.TypeHierarchyItem_Vector_Or_Null; + begin + Self.Sender.On_PrepareTypeHierarchy_Response (Id, Empty); + end On_PrepareTypeHierarchy_Request; + + -------------------------------- + -- On_RangeFormatting_Request -- + -------------------------------- + + overriding procedure On_RangeFormatting_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentRangeFormattingParams) + is + Empty : LSP.Structures.TextEdit_Vector_Or_Null; + begin + Self.Sender.On_RangeFormatting_Response (Id, Empty); + end On_RangeFormatting_Request; + + --------------------------- + -- On_References_Request -- + --------------------------- + + overriding procedure On_References_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ReferenceParams) + is + Empty : LSP.Structures.Location_Vector_Or_Null; + begin + Self.Sender.On_References_Response (Id, Empty); + end On_References_Request; + + ----------------------- + -- On_Rename_Request -- + ----------------------- + + overriding procedure On_Rename_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.RenameParams) + is + Empty : LSP.Structures.WorkspaceEdit_Or_Null; + begin + Self.Sender.On_Rename_Response (Id, Empty); + end On_Rename_Request; + + ------------------------------- + -- On_SelectionRange_Request -- + ------------------------------- + + overriding procedure On_SelectionRange_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SelectionRangeParams) + is + Empty : LSP.Structures.SelectionRange_Vector_Or_Null; + begin + Self.Sender.On_SelectionRange_Response (Id, Empty); + end On_SelectionRange_Request; + + ---------------------------- + -- On_Tokens_Full_Request -- + ---------------------------- + + overriding procedure On_Tokens_Full_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SemanticTokensParams) + is + Empty : LSP.Structures.SemanticTokens_Or_Null; + begin + Self.Sender.On_Tokens_Full_Response (Id, Empty); + end On_Tokens_Full_Request; + + ----------------------------- + -- On_Tokens_Delta_Request -- + ----------------------------- + + overriding procedure On_Tokens_Delta_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SemanticTokensDeltaParams) + is + Empty : LSP.Structures.Tokens_Delta_Result; + begin + Self.Sender.On_Tokens_Delta_Response (Id, Empty); + end On_Tokens_Delta_Request; + + ----------------------------- + -- On_Tokens_Range_Request -- + ----------------------------- + + overriding procedure On_Tokens_Range_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SemanticTokensRangeParams) + is + Empty : LSP.Structures.SemanticTokens_Or_Null; + begin + Self.Sender.On_Tokens_Range_Response (Id, Empty); + end On_Tokens_Range_Request; + + ------------------------------ + -- On_SignatureHelp_Request -- + ------------------------------ + + overriding procedure On_SignatureHelp_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SignatureHelpParams) + is + Empty : LSP.Structures.SignatureHelp_Or_Null; + begin + Self.Sender.On_SignatureHelp_Response (Id, Empty); + end On_SignatureHelp_Request; + + ------------------------------- + -- On_TypeDefinition_Request -- + ------------------------------- + + overriding procedure On_TypeDefinition_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TypeDefinitionParams) + is + Empty : LSP.Structures.Definition_Result; + begin + Self.Sender.On_TypeDefinition_Response (Id, Empty); + end On_TypeDefinition_Request; + + ---------------------------------- + -- On_WillSaveWaitUntil_Request -- + ---------------------------------- + + overriding procedure On_WillSaveWaitUntil_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WillSaveTextDocumentParams) + is + Empty : LSP.Structures.TextEdit_Vector_Or_Null; + begin + Self.Sender.On_WillSaveWaitUntil_Response (Id, Empty); + end On_WillSaveWaitUntil_Request; + + ------------------------- + -- On_Subtypes_Request -- + ------------------------- + + overriding procedure On_Subtypes_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TypeHierarchySubtypesParams) + is + Empty : LSP.Structures.TypeHierarchyItem_Vector_Or_Null; + begin + Self.Sender.On_Subtypes_Response (Id, Empty); + end On_Subtypes_Request; + + --------------------------- + -- On_Supertypes_Request -- + --------------------------- + + overriding procedure On_Supertypes_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TypeHierarchySupertypesParams) + is + Empty : LSP.Structures.TypeHierarchyItem_Vector_Or_Null; + begin + Self.Sender.On_Supertypes_Response (Id, Empty); + end On_Supertypes_Request; + + ------------------------------------- + -- On_Workspace_Diagnostic_Request -- + ------------------------------------- + + overriding procedure On_Workspace_Diagnostic_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceDiagnosticParams) + is + Empty : LSP.Structures.WorkspaceDiagnosticReport; + begin + Self.Sender.On_Workspace_Diagnostic_Response (Id, Empty); + end On_Workspace_Diagnostic_Request; + + ------------------------------- + -- On_ExecuteCommand_Request -- + ------------------------------- + + overriding procedure On_ExecuteCommand_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ExecuteCommandParams) + is + Empty : LSP.Structures.LSPAny_Or_Null; + begin + Self.Sender.On_ExecuteCommand_Response (Id, Empty); + end On_ExecuteCommand_Request; + + ----------------------- + -- On_Symbol_Request -- + ----------------------- + + overriding procedure On_Symbol_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceSymbolParams) + is + Empty : LSP.Structures.Symbol_Result; + begin + Self.Sender.On_Symbol_Response (Id, Empty); + end On_Symbol_Request; + + -------------------------------- + -- On_WillCreateFiles_Request -- + -------------------------------- + + overriding procedure On_WillCreateFiles_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CreateFilesParams) + is + Empty : LSP.Structures.WorkspaceEdit_Or_Null; + begin + Self.Sender.On_WillCreateFiles_Response (Id, Empty); + end On_WillCreateFiles_Request; + + -------------------------------- + -- On_WillDeleteFiles_Request -- + -------------------------------- + + overriding procedure On_WillDeleteFiles_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DeleteFilesParams) + is + Empty : LSP.Structures.WorkspaceEdit_Or_Null; + begin + Self.Sender.On_WillDeleteFiles_Response (Id, Empty); + end On_WillDeleteFiles_Request; + + -------------------------------- + -- On_WillRenameFiles_Request -- + -------------------------------- + + overriding procedure On_WillRenameFiles_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.RenameFilesParams) + is + Empty : LSP.Structures.WorkspaceEdit_Or_Null; + begin + Self.Sender.On_WillRenameFiles_Response (Id, Empty); + end On_WillRenameFiles_Request; + + ------------------------------- + -- On_Symbol_Resolve_Request -- + ------------------------------- + + overriding procedure On_Symbol_Resolve_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceSymbol) + is + Empty : LSP.Structures.WorkspaceSymbol; + begin + Self.Sender.On_Symbol_Resolve_Response (Id, Empty); + end On_Symbol_Resolve_Request; + +end LSP.Ada_Empty_Handlers; diff --git a/source/ada/lsp-ada_empty_handlers.ads b/source/ada/lsp-ada_empty_handlers.ads new file mode 100644 index 000000000..c6bcfd515 --- /dev/null +++ b/source/ada/lsp-ada_empty_handlers.ads @@ -0,0 +1,290 @@ +------------------------------------------------------------------------------ +-- Language Server Protocol -- +-- -- +-- Copyright (C) 2023, AdaCore -- +-- -- +-- This is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 3, or (at your option) any later ver- -- +-- sion. This software is distributed in the hope that it will be useful, -- +-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- -- +-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -- +-- License for more details. You should have received a copy of the GNU -- +-- General Public License distributed with this software; see file -- +-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy -- +-- of the license. -- +------------------------------------------------------------------------------ +-- +-- This package provides empty responses for requests. + +with LSP.Client_Message_Receivers; +with LSP.Server_Request_Receivers; +with LSP.Structures; + +package LSP.Ada_Empty_Handlers is + + type Empty_Message_Handler + (Sender : not null access LSP.Client_Message_Receivers + .Client_Message_Receiver'Class) is + new LSP.Server_Request_Receivers.Server_Request_Receiver with null record; + + overriding procedure On_AlsCheckSyntax_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.AlsCheckSyntaxParams); + + overriding procedure On_IncomingCalls_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CallHierarchyIncomingCallsParams); + + overriding procedure On_OutgoingCalls_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CallHierarchyOutgoingCallsParams); + + overriding procedure On_Code_Action_Resolve_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CodeAction); + + overriding procedure On_Code_Lens_Resolve_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CodeLens); + + overriding procedure On_Completion_Resolve_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CompletionItem); + + overriding procedure On_Link_Resolve_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentLink); + + overriding procedure On_Initialize_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InitializeParams); + + overriding procedure On_Inlay_Resolve_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InlayHint); + + overriding procedure On_Shutdown_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String); + + overriding procedure On_CodeAction_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CodeActionParams); + + overriding procedure On_CodeLens_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CodeLensParams); + + overriding procedure On_ColorPresentation_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ColorPresentationParams); + + overriding procedure On_Completion_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CompletionParams); + + overriding procedure On_Declaration_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DeclarationParams); + + overriding procedure On_Definition_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DefinitionParams); + + overriding procedure On_Diagnostic_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentDiagnosticParams); + + overriding procedure On_DocumentColor_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentColorParams); + + overriding procedure On_DocumentHighlight_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentHighlightParams); + + overriding procedure On_DocumentLink_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentLinkParams); + + overriding procedure On_DocumentSymbol_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentSymbolParams); + + overriding procedure On_FoldingRange_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.FoldingRangeParams); + + overriding procedure On_Formatting_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentFormattingParams); + + overriding procedure On_Hover_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.HoverParams); + + overriding procedure On_Implementation_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ImplementationParams); + + overriding procedure On_InlayHint_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InlayHintParams); + + overriding procedure On_InlineValue_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InlineValueParams); + + overriding procedure On_LinkedEditingRange_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.LinkedEditingRangeParams); + + overriding procedure On_Moniker_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.MonikerParams); + + overriding procedure On_OnTypeFormatting_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentOnTypeFormattingParams); + + overriding procedure On_PrepareCallHierarchy_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CallHierarchyPrepareParams); + + overriding procedure On_PrepareRename_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.PrepareRenameParams); + + overriding procedure On_PrepareTypeHierarchy_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TypeHierarchyPrepareParams); + + overriding procedure On_RangeFormatting_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentRangeFormattingParams); + + overriding procedure On_References_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ReferenceParams); + + overriding procedure On_Rename_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.RenameParams); + + overriding procedure On_SelectionRange_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SelectionRangeParams); + + overriding procedure On_Tokens_Full_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SemanticTokensParams); + + overriding procedure On_Tokens_Delta_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SemanticTokensDeltaParams); + + overriding procedure On_Tokens_Range_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SemanticTokensRangeParams); + + overriding procedure On_SignatureHelp_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SignatureHelpParams); + + overriding procedure On_TypeDefinition_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TypeDefinitionParams); + + overriding procedure On_WillSaveWaitUntil_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WillSaveTextDocumentParams); + + overriding procedure On_Subtypes_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TypeHierarchySubtypesParams); + + overriding procedure On_Supertypes_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TypeHierarchySupertypesParams); + + overriding procedure On_Workspace_Diagnostic_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceDiagnosticParams); + + overriding procedure On_ExecuteCommand_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ExecuteCommandParams); + + overriding procedure On_Symbol_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceSymbolParams); + + overriding procedure On_WillCreateFiles_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CreateFilesParams); + + overriding procedure On_WillDeleteFiles_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DeleteFilesParams); + + overriding procedure On_WillRenameFiles_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.RenameFilesParams); + + overriding procedure On_Symbol_Resolve_Request + (Self : in out Empty_Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceSymbol); + +end LSP.Ada_Empty_Handlers; diff --git a/source/ada/lsp-ada_handlers.adb b/source/ada/lsp-ada_handlers.adb index f6ed29130..ba90149ef 100644 --- a/source/ada/lsp-ada_handlers.adb +++ b/source/ada/lsp-ada_handlers.adb @@ -62,6 +62,7 @@ with LSP.Ada_Completions.Use_Clauses; with LSP.Ada_Completions; with LSP.Ada_Contexts; with LSP.Ada_Documentation; +with LSP.Ada_Empty_Handlers; with LSP.Ada_Handlers.Call_Hierarchy; with LSP.Ada_Handlers.Formatting; with LSP.Ada_Handlers.Invisibles; @@ -4198,6 +4199,13 @@ package body LSP.Ada_Handlers is end if; exception + when Libadalang.Common.Property_Error => + declare + R : LSP.Ada_Empty_Handlers.Empty_Message_Handler (Self.Sender); + begin + Value.Visit_Server_Receiver (R); + end; + when E : others => declare Message : constant VSS.Strings.Virtual_String := From 36f006bc4bdc335696da87a9d190b881c86e03cd Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Mon, 25 Sep 2023 13:15:03 +0300 Subject: [PATCH 142/152] Rebase tests for did/Create/Delete/Rename/file Refs #1170 --- source/ada/lsp-ada_client_capabilities.adb | 104 +++++++++ source/ada/lsp-ada_client_capabilities.ads | 18 ++ source/lsp_3.17/lsp-constants.ads | 7 + source/lsp_3.17/lsp-structures-unwrap.ads | 24 +++ .../test.json | 9 +- .../test.yaml | 2 - .../UA28-007.Did_Create_Files_0/test.json | 199 +++-------------- .../UA28-007.Did_Create_Files_0/test.yaml | 3 - .../UA28-007.Did_Delete_Files_0/test.json | 189 ++-------------- .../UA28-007.Did_Delete_Files_0/test.yaml | 2 - .../UA28-007.Did_Rename_Files_0/test.json | 204 +++--------------- .../UA28-007.Did_Rename_Files_0/test.yaml | 3 - 12 files changed, 231 insertions(+), 533 deletions(-) diff --git a/source/ada/lsp-ada_client_capabilities.adb b/source/ada/lsp-ada_client_capabilities.adb index 04b8bc67e..8b84a726c 100644 --- a/source/ada/lsp-ada_client_capabilities.adb +++ b/source/ada/lsp-ada_client_capabilities.adb @@ -80,6 +80,74 @@ package body LSP.Ada_Client_Capabilities is return (if Result.Is_Set then Result.Value else False); end didChangeWatchedFiles_dynamicRegistration; + ------------------------------ + -- fileOperations_didCreate -- + ------------------------------ + + function fileOperations_didCreate + (Self : Client_Capability'Class) return Boolean + is + use LSP.Structures.Unwrap; + + Result : constant LSP.Structures.Boolean_Optional := + didCreate + (fileOperations + (Self.Value.capabilities.workspace)); + begin + return (if Result.Is_Set then Result.Value else False); + end fileOperations_didCreate; + + ------------------------------ + -- fileOperations_didDelete -- + ------------------------------ + + function fileOperations_didDelete + (Self : Client_Capability'Class) return Boolean + is + use LSP.Structures.Unwrap; + + Result : constant LSP.Structures.Boolean_Optional := + didDelete + (fileOperations + (Self.Value.capabilities.workspace)); + begin + return (if Result.Is_Set then Result.Value else False); + end fileOperations_didDelete; + + ------------------------------ + -- fileOperations_didRename -- + ------------------------------ + + function fileOperations_didRename + (Self : Client_Capability'Class) return Boolean + is + use LSP.Structures.Unwrap; + + Result : constant LSP.Structures.Boolean_Optional := + didDelete + (fileOperations + (Self.Value.capabilities.workspace)); + begin + return (if Result.Is_Set then Result.Value else False); + end fileOperations_didRename; + + ---------------------------------------- + -- fileOperations_dynamicRegistration -- + ---------------------------------------- + + function fileOperations_dynamicRegistration + (Self : Client_Capability'Class) return Boolean + is + use LSP.Structures.Unwrap; + + Result : constant LSP.Structures.Boolean_Optional := + dynamicRegistration + (fileOperations + (Self.Value.capabilities.workspace)); + begin + return (if Result.Is_Set then Result.Value else False); + end fileOperations_dynamicRegistration; + ------------------------- -- Hierarchical_Symbol -- ------------------------- @@ -261,6 +329,36 @@ package body LSP.Ada_Client_Capabilities is is use type VSS.Strings.Virtual_String; + function Ada_Patterns + return LSP.Structures.FileOperationFilter_Vectors.Vector is + [(scheme => "file", -- shell we also support `untitled`??? + pattern => + (glob => "**/*.ad{a,s,b,c}", + matches => LSP.Constants.file, + options => LSP.Constants.ignoreCase))]; + + function Ada_Extensions (Enabled : Boolean) + return LSP.Structures.FileOperationRegistrationOptions_Optional is + (if Enabled then + (Is_Set => True, + Value => (filters => (Ada_Patterns with null record))) + else (Is_Set => False)); + + function fileOperations + return LSP.Structures.FileOperationOptions_Optional is + (if Self.fileOperations_didCreate + or else Self.fileOperations_didRename + or else Self.fileOperations_didDelete + then + (Is_Set => True, + Value => + (didCreate => Ada_Extensions (Self.fileOperations_didCreate), + didRename => Ada_Extensions (Self.fileOperations_didRename), + didDelete => Ada_Extensions (Self.fileOperations_didDelete), + others => <>)) + else + (Is_Set => False)); + function Supported_Code_Action_Kinds return LSP.Structures.CodeActionKind_Vectors.Vector is [LSP.Enumerations.QuickFix, @@ -352,6 +450,12 @@ package body LSP.Ada_Client_Capabilities is retriggerCharacters => [1 * VSS.Characters.Latin.Backspace], workDoneProgress => <>)); + Result.workspace := + (Is_Set => True, + Value => + (fileOperations => fileOperations, + workspaceFolders => <>)); + end return; end To_Server_Capabilities; diff --git a/source/ada/lsp-ada_client_capabilities.ads b/source/ada/lsp-ada_client_capabilities.ads index 4da0816f9..f74d2256b 100644 --- a/source/ada/lsp-ada_client_capabilities.ads +++ b/source/ada/lsp-ada_client_capabilities.ads @@ -77,6 +77,24 @@ package LSP.Ada_Client_Capabilities is function didChangeWatchedFiles_dynamicRegistration (Self : Client_Capability'Class) return Boolean; + -- Returns capabilities.workspace.didChangeWatchedFiles.dynamicRegistration + + function fileOperations_dynamicRegistration + (Self : Client_Capability'Class) return Boolean; + -- Returns capabilities.workspace.fileOperations.dynamicRegistration + + function fileOperations_didCreate + (Self : Client_Capability'Class) return Boolean; + -- Returns capabilities.workspace.fileOperations.didCreate + + function fileOperations_didRename + (Self : Client_Capability'Class) return Boolean; + -- Returns capabilities.workspace.fileOperations.didRename + + function fileOperations_didDelete + (Self : Client_Capability'Class) return Boolean; + -- Returns capabilities.workspace.fileOperations.didDelete + -- Resource 0perations -- function Resource_Create_Supported diff --git a/source/lsp_3.17/lsp-constants.ads b/source/lsp_3.17/lsp-constants.ads index 7319bc1d3..fa4193c55 100644 --- a/source/lsp_3.17/lsp-constants.ads +++ b/source/lsp_3.17/lsp-constants.ads @@ -147,4 +147,11 @@ package LSP.Constants is function RequestCancelled return LSP.Enumerations.ErrorCodes is (LSP.Enumerations.ErrorCodes (LSP.Enumerations.RequestCancelled)); + function file return LSP.Structures.FileOperationPatternKind_Optional is + (Is_Set => True, Value => LSP.Enumerations.file); + + function ignoreCase + return LSP.Structures.FileOperationPatternOptions_Optional is + (Is_Set => True, Value => (ignoreCase => True)); + end LSP.Constants; diff --git a/source/lsp_3.17/lsp-structures-unwrap.ads b/source/lsp_3.17/lsp-structures-unwrap.ads index ea657db29..3d766cac5 100644 --- a/source/lsp_3.17/lsp-structures-unwrap.ads +++ b/source/lsp_3.17/lsp-structures-unwrap.ads @@ -94,4 +94,28 @@ package LSP.Structures.Unwrap is return Boolean_Optional is (if X.Is_Set then X.Value.dynamicRegistration else (Is_Set => False)); + function fileOperations (X : WorkspaceClientCapabilities_Optional) + return FileOperationClientCapabilities_Optional is + (if X.Is_Set then X.Value.fileOperations else (Is_Set => False)); + + function dynamicRegistration + (X : FileOperationClientCapabilities_Optional) + return Boolean_Optional is + (if X.Is_Set then X.Value.dynamicRegistration else (Is_Set => False)); + + function didCreate + (X : FileOperationClientCapabilities_Optional) + return Boolean_Optional is + (if X.Is_Set then X.Value.didCreate else (Is_Set => False)); + + function didDelete + (X : FileOperationClientCapabilities_Optional) + return Boolean_Optional is + (if X.Is_Set then X.Value.didDelete else (Is_Set => False)); + + function didRename + (X : FileOperationClientCapabilities_Optional) + return Boolean_Optional is + (if X.Is_Set then X.Value.didRename else (Is_Set => False)); + end LSP.Structures.Unwrap; diff --git a/testsuite/ada_lsp/UA28-007.Did_Change_Watched_Files_0/test.json b/testsuite/ada_lsp/UA28-007.Did_Change_Watched_Files_0/test.json index c1a7029bf..a8e39b43a 100644 --- a/testsuite/ada_lsp/UA28-007.Did_Change_Watched_Files_0/test.json +++ b/testsuite/ada_lsp/UA28-007.Did_Change_Watched_Files_0/test.json @@ -565,7 +565,6 @@ }, { "name": "Main", - "detail": "", "kind": 12, "range": { "start": { @@ -589,8 +588,7 @@ }, "alsIsDeclaration": false, "alsIsAdaProcedure": true, - "alsVisibility": 1, - "children": [] + "alsVisibility": 1 } ] } @@ -656,7 +654,6 @@ }, { "name": "Qux", - "detail": "", "kind": 4, "range": { "start": { @@ -684,7 +681,6 @@ "children": [ { "name": "Bar", - "detail": "", "kind": 12, "range": { "start": { @@ -708,8 +704,7 @@ }, "alsIsDeclaration": true, "alsIsAdaProcedure": true, - "alsVisibility": 1, - "children": [] + "alsVisibility": 1 } ] } diff --git a/testsuite/ada_lsp/UA28-007.Did_Change_Watched_Files_0/test.yaml b/testsuite/ada_lsp/UA28-007.Did_Change_Watched_Files_0/test.yaml index f13ab6736..700d4c822 100644 --- a/testsuite/ada_lsp/UA28-007.Did_Change_Watched_Files_0/test.yaml +++ b/testsuite/ada_lsp/UA28-007.Did_Change_Watched_Files_0/test.yaml @@ -1,5 +1,3 @@ title: 'UA28-007.Did_Change_Watched_Files_0' skip: - ['SKIP', 'env.build.os.name == "windows"'] - # Skip till 3.17 ready - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/UA28-007.Did_Create_Files_0/test.json b/testsuite/ada_lsp/UA28-007.Did_Create_Files_0/test.json index 0ac0a6ab8..e9e39d7b7 100644 --- a/testsuite/ada_lsp/UA28-007.Did_Create_Files_0/test.json +++ b/testsuite/ada_lsp/UA28-007.Did_Create_Files_0/test.json @@ -421,47 +421,26 @@ "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": { - "codeActionKinds": [ - "quickfix", - "refactor.rewrite" - ] - }, - "documentFormattingProvider": true, - "renameProvider": { - "prepareProvider": true - }, - "foldingRangeProvider": true, - "workspaceSymbolProvider": true, - "callHierarchyProvider": {}, - "alsShowDepsProvider": true, - "alsCheckSyntaxProvider": true + "definitionProvider": true, + "workspace": { + "fileOperations": { + "didCreate": { + "filters": [ + { + "scheme": "file", + "pattern": { + "glob": "**/*.ad{a,s,b,c}", + "matches": "file", + "options": { + "ignoreCase": true + } + } + } + ] + } + } + } } } } @@ -502,110 +481,18 @@ "wait": [ { "jsonrpc": "2.0", - "id": 2, + "id": 1, "method": "client/registerCapability", "params": { "registrations": [ { - "id": "fm-1", + "id": "1", "method": "workspace/didChangeWatchedFiles", "registerOptions": { "watchers": [ { - "globPattern": "${DIR}${DIR_SEP}*" - } - ] - } - } - ] - } - }, - { - "jsonrpc": "2.0", - "id": 3, - "method": "client/registerCapability", - "params": { - "registrations": [ - { - "id": "Will_Create", - "method": "workspace/willCreateFiles", - "registerOptions": { - "filters": [ - { - "scheme": "file", - "pattern": { - "glob": "${DIR}${DIR_SEP}*{.ads,.adb}" - } - } - ] - } - }, - { - "id": "Did_Create", - "method": "workspace/didCreateFiles", - "registerOptions": { - "filters": [ - { - "scheme": "file", - "pattern": { - "glob": "${DIR}${DIR_SEP}*{.ads,.adb}" - } - } - ] - } - }, - { - "id": "Will_Rename", - "method": "workspace/willRenameFiles", - "registerOptions": { - "filters": [ - { - "scheme": "file", - "pattern": { - "glob": "${DIR}${DIR_SEP}*{.ads,.adb}" - } - } - ] - } - }, - { - "id": "Did_Rename", - "method": "workspace/didRenameFiles", - "registerOptions": { - "filters": [ - { - "scheme": "file", - "pattern": { - "glob": "${DIR}${DIR_SEP}*{.ads,.adb}" - } - } - ] - } - }, - { - "id": "Will_Delete", - "method": "workspace/willDeleteFiles", - "registerOptions": { - "filters": [ - { - "scheme": "file", - "pattern": { - "glob": "${DIR}${DIR_SEP}*{.ads,.adb}" - } - } - ] - } - }, - { - "id": "Did_Delete", - "method": "workspace/didDeleteFiles", - "registerOptions": { - "filters": [ - { - "scheme": "file", - "pattern": { - "glob": "${DIR}${DIR_SEP}*{.ads,.adb}" - } + "globPattern": "${DIR}${DIR_SEP}*", + "kind": 7 } ] } @@ -643,28 +530,6 @@ "wait": [] } }, - { - "send": { - "request": { - "jsonrpc": "2.0", - "id": 6, - "method": "workspace/willCreateFiles", - "params": { - "files": [ - { - "uri": "$URI{qux.ads}" - } - ] - } - }, - "wait": [ - { - "id": 6, - "result": null - } - ] - } - }, { "send": { "request": { @@ -731,7 +596,6 @@ }, { "name": "Main", - "detail": "", "kind": 12, "range": { "start": { @@ -755,8 +619,7 @@ }, "alsIsDeclaration": false, "alsIsAdaProcedure": true, - "alsVisibility": 1, - "children": [] + "alsVisibility": 1 } ] } @@ -906,7 +769,6 @@ }, { "name": "Qux", - "detail": "", "kind": 4, "range": { "start": { @@ -934,7 +796,6 @@ "children": [ { "name": "Bar", - "detail": "", "kind": 12, "range": { "start": { @@ -958,8 +819,7 @@ }, "alsIsDeclaration": true, "alsIsAdaProcedure": true, - "alsVisibility": 1, - "children": [] + "alsVisibility": 1 } ] } @@ -1034,7 +894,6 @@ }, { "name": "Main", - "detail": "", "kind": 12, "range": { "start": { @@ -1058,8 +917,7 @@ }, "alsIsDeclaration": false, "alsIsAdaProcedure": true, - "alsVisibility": 1, - "children": [] + "alsVisibility": 1 } ] } @@ -1145,7 +1003,6 @@ }, { "name": "Qux", - "detail": "", "kind": 4, "range": { "start": { @@ -1173,7 +1030,6 @@ "children": [ { "name": "Bar", - "detail": "", "kind": 12, "range": { "start": { @@ -1197,8 +1053,7 @@ }, "alsIsDeclaration": true, "alsIsAdaProcedure": true, - "alsVisibility": 1, - "children": [] + "alsVisibility": 1 } ] } diff --git a/testsuite/ada_lsp/UA28-007.Did_Create_Files_0/test.yaml b/testsuite/ada_lsp/UA28-007.Did_Create_Files_0/test.yaml index d78feb211..288558cdb 100644 --- a/testsuite/ada_lsp/UA28-007.Did_Create_Files_0/test.yaml +++ b/testsuite/ada_lsp/UA28-007.Did_Create_Files_0/test.yaml @@ -1,4 +1 @@ title: 'UA28-007.Did_Create_Files_0' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/UA28-007.Did_Delete_Files_0/test.json b/testsuite/ada_lsp/UA28-007.Did_Delete_Files_0/test.json index 825d3cb83..f22b011dd 100644 --- a/testsuite/ada_lsp/UA28-007.Did_Delete_Files_0/test.json +++ b/testsuite/ada_lsp/UA28-007.Did_Delete_Files_0/test.json @@ -421,47 +421,26 @@ "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": { - "codeActionKinds": [ - "quickfix", - "refactor.rewrite" - ] - }, - "documentFormattingProvider": true, - "renameProvider": { - "prepareProvider": true - }, - "foldingRangeProvider": true, - "workspaceSymbolProvider": true, - "callHierarchyProvider": {}, - "alsShowDepsProvider": true, - "alsCheckSyntaxProvider": true + "workspace": { + "fileOperations": { + "didDelete": { + "filters": [ + { + "scheme": "file", + "pattern": { + "glob": "**/*.ad{a,s,b,c}", + "matches": "file", + "options": { + "ignoreCase": true + } + } + } + ] + } + } + } } } } @@ -502,12 +481,12 @@ "wait": [ { "jsonrpc": "2.0", - "id": 2, + "id": 1, "method": "client/registerCapability", "params": { "registrations": [ { - "id": "fm-1", + "id": "1", "method": "workspace/didChangeWatchedFiles", "registerOptions": { "watchers": [ @@ -520,99 +499,6 @@ ] } }, - { - "jsonrpc": "2.0", - "id": 3, - "method": "client/registerCapability", - "params": { - "registrations": [ - { - "id": "Will_Create", - "method": "workspace/willCreateFiles", - "registerOptions": { - "filters": [ - { - "scheme": "file", - "pattern": { - "glob": "${DIR}${DIR_SEP}*{.ads,.adb}" - } - } - ] - } - }, - { - "id": "Did_Create", - "method": "workspace/didCreateFiles", - "registerOptions": { - "filters": [ - { - "scheme": "file", - "pattern": { - "glob": "${DIR}${DIR_SEP}*{.ads,.adb}" - } - } - ] - } - }, - { - "id": "Will_Rename", - "method": "workspace/willRenameFiles", - "registerOptions": { - "filters": [ - { - "scheme": "file", - "pattern": { - "glob": "${DIR}${DIR_SEP}*{.ads,.adb}" - } - } - ] - } - }, - { - "id": "Did_Rename", - "method": "workspace/didRenameFiles", - "registerOptions": { - "filters": [ - { - "scheme": "file", - "pattern": { - "glob": "${DIR}${DIR_SEP}*{.ads,.adb}" - } - } - ] - } - }, - { - "id": "Will_Delete", - "method": "workspace/willDeleteFiles", - "registerOptions": { - "filters": [ - { - "scheme": "file", - "pattern": { - "glob": "${DIR}${DIR_SEP}*{.ads,.adb}" - } - } - ] - } - }, - { - "id": "Did_Delete", - "method": "workspace/didDeleteFiles", - "registerOptions": { - "filters": [ - { - "scheme": "file", - "pattern": { - "glob": "${DIR}${DIR_SEP}*{.ads,.adb}" - } - } - ] - } - } - ] - } - }, { "jsonrpc": "2.0", "method": "$/progress", @@ -709,7 +595,6 @@ }, { "name": "Main", - "detail": "", "kind": 12, "range": { "start": { @@ -733,8 +618,7 @@ }, "alsIsDeclaration": false, "alsIsAdaProcedure": true, - "alsVisibility": 1, - "children": [] + "alsVisibility": 1 } ] } @@ -837,7 +721,6 @@ }, { "name": "Qux", - "detail": "", "kind": 4, "range": { "start": { @@ -865,7 +748,6 @@ "children": [ { "name": "Bar", - "detail": "", "kind": 12, "range": { "start": { @@ -889,8 +771,7 @@ }, "alsIsDeclaration": true, "alsIsAdaProcedure": true, - "alsVisibility": 1, - "children": [] + "alsVisibility": 1 } ] } @@ -899,28 +780,6 @@ ] } }, - { - "send": { - "request": { - "jsonrpc": "2.0", - "id": 13, - "method": "workspace/willDeleteFiles", - "params": { - "files": [ - { - "uri": "$URI{qux.ads}" - } - ] - } - }, - "wait": [ - { - "id": 13, - "result": null - } - ] - } - }, { "send": { "request": { @@ -1023,7 +882,6 @@ }, { "name": "Main", - "detail": "", "kind": 12, "range": { "start": { @@ -1047,8 +905,7 @@ }, "alsIsDeclaration": false, "alsIsAdaProcedure": true, - "alsVisibility": 1, - "children": [] + "alsVisibility": 1 } ] } diff --git a/testsuite/ada_lsp/UA28-007.Did_Delete_Files_0/test.yaml b/testsuite/ada_lsp/UA28-007.Did_Delete_Files_0/test.yaml index 61b3007e2..b4b5b0bb8 100644 --- a/testsuite/ada_lsp/UA28-007.Did_Delete_Files_0/test.yaml +++ b/testsuite/ada_lsp/UA28-007.Did_Delete_Files_0/test.yaml @@ -1,5 +1,3 @@ title: 'UA28-007.Did_Delete_Files_0' skip: - ['SKIP', 'env.build.os.name == "windows"'] - # Skip till 3.17 ready - - ['XFAIL', 'True'] diff --git a/testsuite/ada_lsp/UA28-007.Did_Rename_Files_0/test.json b/testsuite/ada_lsp/UA28-007.Did_Rename_Files_0/test.json index 6c355eb53..9527ff646 100644 --- a/testsuite/ada_lsp/UA28-007.Did_Rename_Files_0/test.json +++ b/testsuite/ada_lsp/UA28-007.Did_Rename_Files_0/test.json @@ -421,47 +421,27 @@ "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": { - "codeActionKinds": [ - "quickfix", - "refactor.rewrite" - ] - }, - "documentFormattingProvider": true, - "renameProvider": { - "prepareProvider": true - }, - "foldingRangeProvider": true, - "workspaceSymbolProvider": true, - "callHierarchyProvider": {}, - "alsShowDepsProvider": true, - "alsCheckSyntaxProvider": true + "workspace": { + "fileOperations": { + "didRename": { + "filters": [ + { + "scheme": "file", + "pattern": { + "glob": "**/*.ad{a,s,b,c}", + "matches": "file", + "options": { + "ignoreCase": true + } + } + } + ] + } + } + } } } } @@ -502,12 +482,12 @@ "wait": [ { "jsonrpc": "2.0", - "id": 2, + "id": 1, "method": "client/registerCapability", "params": { "registrations": [ { - "id": "fm-1", + "id": "1", "method": "workspace/didChangeWatchedFiles", "registerOptions": { "watchers": [ @@ -520,99 +500,6 @@ ] } }, - { - "jsonrpc": "2.0", - "id": 3, - "method": "client/registerCapability", - "params": { - "registrations": [ - { - "id": "Will_Create", - "method": "workspace/willCreateFiles", - "registerOptions": { - "filters": [ - { - "scheme": "file", - "pattern": { - "glob": "${DIR}${DIR_SEP}*{.ads,.adb}" - } - } - ] - } - }, - { - "id": "Did_Create", - "method": "workspace/didCreateFiles", - "registerOptions": { - "filters": [ - { - "scheme": "file", - "pattern": { - "glob": "${DIR}${DIR_SEP}*{.ads,.adb}" - } - } - ] - } - }, - { - "id": "Will_Rename", - "method": "workspace/willRenameFiles", - "registerOptions": { - "filters": [ - { - "scheme": "file", - "pattern": { - "glob": "${DIR}${DIR_SEP}*{.ads,.adb}" - } - } - ] - } - }, - { - "id": "Did_Rename", - "method": "workspace/didRenameFiles", - "registerOptions": { - "filters": [ - { - "scheme": "file", - "pattern": { - "glob": "${DIR}${DIR_SEP}*{.ads,.adb}" - } - } - ] - } - }, - { - "id": "Will_Delete", - "method": "workspace/willDeleteFiles", - "registerOptions": { - "filters": [ - { - "scheme": "file", - "pattern": { - "glob": "${DIR}${DIR_SEP}*{.ads,.adb}" - } - } - ] - } - }, - { - "id": "Did_Delete", - "method": "workspace/didDeleteFiles", - "registerOptions": { - "filters": [ - { - "scheme": "file", - "pattern": { - "glob": "${DIR}${DIR_SEP}*{.ads,.adb}" - } - } - ] - } - } - ] - } - }, { "jsonrpc": "2.0", "method": "$/progress", @@ -803,14 +690,12 @@ { "kind": "rename", "oldUri": "$URI{foo.adb}", - "newUri": "$URI{qux.adb}", - "options": {} + "newUri": "$URI{qux.adb}" }, { "kind": "rename", "oldUri": "$URI{foo.ads}", - "newUri": "$URI{qux.ads}", - "options": {} + "newUri": "$URI{qux.ads}" } ] } @@ -987,33 +872,6 @@ "wait": [] } }, - { - "send": { - "request": { - "jsonrpc": "2.0", - "id": 9, - "method": "workspace/willRenameFiles", - "params": { - "files": [ - { - "oldUri": "$URI{foo.adb}", - "newUri": "$URI{qux.adb}" - }, - { - "oldUri": "$URI{foo.ads}", - "newUri": "$URI{qux.ads}" - } - ] - } - }, - "wait": [ - { - "id": 9, - "result": null - } - ] - } - }, { "send": { "request": { @@ -1139,7 +997,6 @@ }, { "name": "Main", - "detail": "", "kind": 12, "range": { "start": { @@ -1163,8 +1020,7 @@ }, "alsIsDeclaration": false, "alsIsAdaProcedure": true, - "alsVisibility": 1, - "children": [] + "alsVisibility": 1 } ] } @@ -1242,7 +1098,6 @@ }, { "name": "Main", - "detail": "", "kind": 12, "range": { "start": { @@ -1266,8 +1121,7 @@ }, "alsIsDeclaration": false, "alsIsAdaProcedure": true, - "alsVisibility": 1, - "children": [] + "alsVisibility": 1 } ] } @@ -1361,7 +1215,6 @@ "result": [ { "name": "Qux", - "detail": "", "kind": 4, "range": { "start": { @@ -1389,7 +1242,6 @@ "children": [ { "name": "Bar", - "detail": "", "kind": 12, "range": { "start": { @@ -1413,8 +1265,7 @@ }, "alsIsDeclaration": true, "alsIsAdaProcedure": true, - "alsVisibility": 1, - "children": [] + "alsVisibility": 1 } ] } @@ -1510,7 +1361,6 @@ "result": [ { "name": "Qux", - "detail": "", "kind": 2, "range": { "start": { @@ -1538,7 +1388,6 @@ "children": [ { "name": "Bar", - "detail": "", "kind": 12, "range": { "start": { @@ -1562,8 +1411,7 @@ }, "alsIsDeclaration": true, "alsIsAdaProcedure": true, - "alsVisibility": 1, - "children": [] + "alsVisibility": 1 } ] } diff --git a/testsuite/ada_lsp/UA28-007.Did_Rename_Files_0/test.yaml b/testsuite/ada_lsp/UA28-007.Did_Rename_Files_0/test.yaml index e789a82de..907cdb1fd 100644 --- a/testsuite/ada_lsp/UA28-007.Did_Rename_Files_0/test.yaml +++ b/testsuite/ada_lsp/UA28-007.Did_Rename_Files_0/test.yaml @@ -1,4 +1 @@ title: 'UA28-007.Did_Rename_Files_0' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] From 5fb97caf6f90975f12608a5fb0c3aba0b6e1f692 Mon Sep 17 00:00:00 2001 From: Andry Ogorodnik Date: Mon, 25 Sep 2023 11:49:40 +0000 Subject: [PATCH 143/152] Enable Alire --- gnat/ignore_in_317.txt | 2 -- source/ada/lsp-ada_handlers-alire.adb | 1 + .../ada/lsp-ada_handlers-project_loading.adb | 25 +++---------------- .../ada_lsp/project_config.alire/test.json | 4 +-- .../ada_lsp/project_config.alire/test.yaml | 2 -- 5 files changed, 6 insertions(+), 28 deletions(-) diff --git a/gnat/ignore_in_317.txt b/gnat/ignore_in_317.txt index 903e5fd13..09a449f0a 100644 --- a/gnat/ignore_in_317.txt +++ b/gnat/ignore_in_317.txt @@ -1,5 +1,3 @@ -lsp-ada_handlers-alire.adb -lsp-ada_handlers-alire.ads lsp-common.adb lsp-common.ads lsp-error_decorators.adb diff --git a/source/ada/lsp-ada_handlers-alire.adb b/source/ada/lsp-ada_handlers-alire.adb index 7b50ae682..9957a2b17 100644 --- a/source/ada/lsp-ada_handlers-alire.adb +++ b/source/ada/lsp-ada_handlers-alire.adb @@ -21,6 +21,7 @@ with GNAT.OS_Lib; with VSS.Stream_Element_Vectors; with VSS.Strings.Conversions; with VSS.Strings.Converters.Decoders; +with VSS.String_Vectors; with VSS.Characters.Latin; with VSS.Regular_Expressions; diff --git a/source/ada/lsp-ada_handlers-project_loading.adb b/source/ada/lsp-ada_handlers-project_loading.adb index 20e5415d1..069304c2e 100644 --- a/source/ada/lsp-ada_handlers-project_loading.adb +++ b/source/ada/lsp-ada_handlers-project_loading.adb @@ -37,6 +37,7 @@ with Spawn.Environments; with LSP.Ada_Contexts; with LSP.Ada_Context_Sets; +with LSP.Ada_Handlers.Alire; with LSP.Ada_Handlers.File_Readers; with LSP.Ada_Indexing; with LSP.Enumerations; @@ -51,26 +52,6 @@ package body LSP.Ada_Handlers.Project_Loading is GNATCOLL.Traces.On); -- Trace to enable/disable runtime indexing. Useful for the testsuite. - package Alire is - - procedure Run_Alire - (Root : String; - Has_Alire : out Boolean; - Error : out VSS.Strings.Virtual_String; - Project : out VSS.Strings.Virtual_String; - Environment : in out GPR2.Environment.Object) is null; - -- if Root directory contains `alire.toml` file, then run - -- `alr printenv` and fetch the first project from `alire.toml`. - - procedure Run_Alire - (Root : String; - Has_Alire : out Boolean; - Error : out VSS.Strings.Virtual_String; - Environment : in out GPR2.Environment.Object) is null; - -- The same as above, but without fetching the project file - - end Alire; - procedure Load_Project_With_Alire (Self : in out Message_Handler'Class; Project_File : VSS.Strings.Virtual_String := ""; @@ -552,7 +533,7 @@ package body LSP.Ada_Handlers.Project_Loading is if Project.Is_Empty then - Alire.Run_Alire + LSP.Ada_Handlers.Alire.Run_Alire (Root => Root (Self).Display_Full_Name, Has_Alire => Has_Alire, Error => Errors, @@ -562,7 +543,7 @@ package body LSP.Ada_Handlers.Project_Loading is Status := Alire_Project; else - Alire.Run_Alire + LSP.Ada_Handlers.Alire.Run_Alire (Root => Root (Self).Display_Full_Name, Has_Alire => Has_Alire, Error => Errors, diff --git a/testsuite/ada_lsp/project_config.alire/test.json b/testsuite/ada_lsp/project_config.alire/test.json index 5e9328e31..c21112d25 100644 --- a/testsuite/ada_lsp/project_config.alire/test.json +++ b/testsuite/ada_lsp/project_config.alire/test.json @@ -77,7 +77,7 @@ }, "wait":[{ "id": "defname-1", - "result":[{ + "result":{ "uri": "$URI{alire/cache/dependencies/libhello_1.0.1_3c15bc7f/src/libhello.ads}", "range": { "start": { @@ -89,7 +89,7 @@ "character": 24 } } - }] + } }] } }, { diff --git a/testsuite/ada_lsp/project_config.alire/test.yaml b/testsuite/ada_lsp/project_config.alire/test.yaml index 11c6f15e6..ee5a7106f 100644 --- a/testsuite/ada_lsp/project_config.alire/test.yaml +++ b/testsuite/ada_lsp/project_config.alire/test.yaml @@ -1,5 +1,3 @@ title: 'project_config.alire' skip: - ['SKIP', 'env.build.os.name == "windows"'] - # Skip till 3.17 ready - - ['XFAIL', 'True'] From 2c84138b12e34f34f26aa567224b45bf10394e74 Mon Sep 17 00:00:00 2001 From: Vadim Godunko Date: Mon, 25 Sep 2023 21:27:44 +0400 Subject: [PATCH 144/152] Transition of the GPR LSP server to LSP 3.17 --- gnat/lsp_server.gpr | 3 +- source/ada/lsp-ada_driver.adb | 12 +- source/gpr/lsp-gpr_documents.adb | 95 +-- source/gpr/lsp-gpr_documents.ads | 41 +- source/gpr/lsp-gpr_file_readers.adb | 123 +-- source/gpr/lsp-gpr_files-symbols.adb | 218 +++--- source/gpr/lsp-gpr_files-symbols.ads | 19 +- source/gpr/lsp-gpr_files.ads | 7 +- source/gpr/lsp-gpr_handlers.adb | 1051 ++++++++------------------ source/gpr/lsp-gpr_handlers.ads | 384 ++-------- 10 files changed, 655 insertions(+), 1298 deletions(-) diff --git a/gnat/lsp_server.gpr b/gnat/lsp_server.gpr index fd8451d70..65c5e9871 100644 --- a/gnat/lsp_server.gpr +++ b/gnat/lsp_server.gpr @@ -47,8 +47,7 @@ project LSP_Server is "../source/memory"); for Excluded_Source_Dirs use - ("../source/server/generated", - "../source/gpr"); + ("../source/server/generated"); for Excluded_Source_List_File use "ignore_in_317.txt"; diff --git a/source/ada/lsp-ada_driver.adb b/source/ada/lsp-ada_driver.adb index 82b77d3f3..53df983a1 100644 --- a/source/ada/lsp-ada_driver.adb +++ b/source/ada/lsp-ada_driver.adb @@ -57,6 +57,7 @@ with LSP.Ada_Handlers.Refactor.Sort_Dependencies; with LSP.Ada_Handlers.Refactor.Suppress_Seperate; with LSP.Ada_Handlers.Suspend_Executions; with LSP.GNATCOLL_Tracers; +with LSP.GPR_Handlers; with LSP.Memory_Statistics; with LSP.Predefined_Completion; with LSP.Servers; @@ -130,8 +131,8 @@ procedure LSP.Ada_Driver is Stream : aliased LSP.Stdio_Streams.Stdio_Stream; Ada_Handler : aliased LSP.Ada_Handlers.Message_Handler (Server'Access, Server'Access, Tracer'Unchecked_Access); - GPR_Handler : aliased LSP.Ada_Handlers.Message_Handler - (Server'Access, Server'Access, Tracer'Unchecked_Access); + GPR_Handler : aliased LSP.GPR_Handlers.Message_Handler + (Server'Access, Tracer'Unchecked_Access); Fuzzing_Activated : constant Boolean := not VSS.Application.System_Environment.Value ("ALS_FUZZING").Is_Empty; @@ -299,14 +300,11 @@ begin := GNATCOLL.Traces.Create ("ALS.ALLOW_INCREMENTAL_TEXT_CHANGES", GNATCOLL.Traces.On); -- Trace to activate the support for incremental text changes. + begin Ada_Handler.Initialize (Incremental_Text_Changes => Allow_Incremental_Text_Changes.Is_Active, Config_File => VSS.Command_Line.Value (Config_File_Option)); - - GPR_Handler.Initialize - (Incremental_Text_Changes => Allow_Incremental_Text_Changes.Is_Active, - Config_File => VSS.Command_Line.Value (Config_File_Option)); end; Server.Initialize (Stream'Unchecked_Access); @@ -314,9 +312,9 @@ begin begin if VSS.Command_Line.Is_Specified (Language_GPR_Option) then Server.Run (GPR_Handler'Unchecked_Access, Tracer'Unchecked_Access); + else Register_Commands; - Server.Run (Ada_Handler'Unchecked_Access, Tracer'Unchecked_Access); end if; exception diff --git a/source/gpr/lsp-gpr_documents.adb b/source/gpr/lsp-gpr_documents.adb index e78c0ec54..7a5f48d7f 100644 --- a/source/gpr/lsp-gpr_documents.adb +++ b/source/gpr/lsp-gpr_documents.adb @@ -15,13 +15,13 @@ -- of the license. -- ------------------------------------------------------------------------------ -with Ada.Characters.Wide_Wide_Latin_1; +with GNATCOLL.Traces; with GPR2.Message; -with VSS.Strings.Cursors.Iterators.Characters; - +with VSS.Characters.Latin; with VSS.Strings.Character_Iterators; +with VSS.Strings.Conversions; with VSS.Strings.Line_Iterators; with VSS.Unicode; @@ -39,7 +39,7 @@ package body LSP.GPR_Documents is procedure Span_To_Markers (Self : Document'Class; - Span : LSP.Messages.Span; + Span : LSP.Structures.A_Range; From : out VSS.Strings.Markers.Character_Marker; To : out VSS.Strings.Markers.Character_Marker); @@ -48,7 +48,7 @@ package body LSP.GPR_Documents is procedure Recompute_Markers (Self : in out Document'Class; - Low_Line : LSP.Types.Line_Number; + Low_Line : Natural; Start_Marker : VSS.Strings.Markers.Character_Marker; End_Marker : VSS.Strings.Markers.Character_Marker); -- Recompute line-to-marker index starting from Start_Marker till @@ -62,27 +62,26 @@ package body LSP.GPR_Documents is procedure Apply_Changes (Self : aliased in out Document; - Version : LSP.Types.LSP_Number; - Vector : LSP.Messages.TextDocumentContentChangeEvent_Vector) + Version : Integer; + Vector : LSP.Structures.TextDocumentContentChangeEvent_Vector) is - URI : constant String := Types.To_UTF_8_String (Self.URI); - use LSP.Types; + URI : constant String := + VSS.Strings.Conversions.To_UTF_8_String (Self.URI); + begin Document_Changes_Trace.Trace ("Applying changes for document " & URI); Self.Version := Version; for Change of Vector loop - if Change.span.Is_Set then + if Change.a_range.Is_Set then -- We're replacing a range declare - Low_Line : LSP.Types.Line_Number := - Change.span.Value.first.line; - High_Line : LSP.Types.Line_Number := - Change.span.Value.last.line; - Delete_High : LSP.Types.Line_Number := High_Line; - Start_Index : LSP.Types.Line_Number; + Low_Line : Natural := Change.a_range.Value.start.line; + High_Line : Natural := Change.a_range.Value.an_end.line; + Delete_High : Natural := High_Line; + Start_Index : Natural; First_Marker : VSS.Strings.Markers.Character_Marker; Last_Marker : VSS.Strings.Markers.Character_Marker; @@ -93,7 +92,7 @@ package body LSP.GPR_Documents is -- Do text replacement Self.Span_To_Markers - (Change.span.Value, First_Marker, Last_Marker); + (Change.a_range.Value, First_Marker, Last_Marker); Self.Text.Replace (First_Marker, Last_Marker, Change.text); -- Markers inside modified range of lines need to be @@ -150,9 +149,11 @@ package body LSP.GPR_Documents is Self.Text := Change.text; -- We're setting the whole text: compute the indexes now. + Self.Recompute_Indexes; end if; end loop; + Document_Changes_Trace.Trace ("Done applying changes for document " & URI); end Apply_Changes; @@ -243,10 +244,9 @@ package body LSP.GPR_Documents is function Get_Source_Location (Self : Document'Class; - Position : LSP.Messages.Position) + Position : LSP.Structures.Position) return Langkit_Support.Slocs.Source_Location is - use type LSP.Types.Line_Number; use type VSS.Unicode.UTF16_Code_Unit_Offset; use type VSS.Strings.Character_Index; @@ -258,16 +258,19 @@ package body LSP.GPR_Documents is Line_First_Character : constant VSS.Strings.Character_Index := Iterator.Character_Index; + begin - while Iterator.First_UTF16_Offset - Line_Offset <= Position.character + while Integer (Iterator.First_UTF16_Offset - Line_Offset) + <= Position.character and then Iterator.Forward loop null; end loop; - return ((Line => Langkit_Support.Slocs.Line_Number (Position.line + 1), - Column => Langkit_Support.Slocs.Column_Number - (Iterator.Character_Index - Line_First_Character))); + return + ((Line => Langkit_Support.Slocs.Line_Number (Position.line + 1), + Column => Langkit_Support.Slocs.Column_Number + (Iterator.Character_Index - Line_First_Character))); end Get_Source_Location; ----------------- @@ -276,8 +279,8 @@ package body LSP.GPR_Documents is function Get_Text_At (Self : Document; - Start_Pos : LSP.Messages.Position; - End_Pos : LSP.Messages.Position) return VSS.Strings.Virtual_String + Start_Pos : LSP.Structures.Position; + End_Pos : LSP.Structures.Position) return VSS.Strings.Virtual_String is First_Marker : VSS.Strings.Markers.Character_Marker; Last_Marker : VSS.Strings.Markers.Character_Marker; @@ -295,7 +298,7 @@ package body LSP.GPR_Documents is function Get_Word_At (Self : Document; - Position : LSP.Messages.Position) + Position : LSP.Structures.Position) return VSS.Strings.Virtual_String is Result : VSS.Strings.Virtual_String; @@ -321,17 +324,17 @@ package body LSP.GPR_Documents is procedure Initialize (Self : in out Document; - URI : LSP.Messages.DocumentUri; + URI : LSP.Structures.DocumentUri; File : GPR2.Path_Name.Object; Text : VSS.Strings.Virtual_String; - Provider : LSP.GPR_Files.File_Provider_Access) - is + Provider : LSP.GPR_Files.File_Provider_Access) is begin - Self.URI := URI; - Self.File := File; - Self.Version := 1; - Self.Text := Text; + Self.URI := URI; + Self.File := File; + Self.Version := 1; + Self.Text := Text; Self.File_Provider := Provider; + Recompute_Indexes (Self); end Initialize; @@ -340,16 +343,17 @@ package body LSP.GPR_Documents is --------------------- function Line_Terminator - (Self : Document'Class) return VSS.Strings.Virtual_String is + (Self : Document'Class) return VSS.Strings.Virtual_String + is + use type VSS.Strings.Virtual_String; + begin if Self.Line_Terminator.Is_Empty then -- Document has no line terminator yet, return LF as most used -- -- Should it be platform specific? CRLF for Windows, CR for Mac? - return - VSS.Strings.To_Virtual_String - ((1 => Ada.Characters.Wide_Wide_Latin_1.LF)); + return 1 * VSS.Characters.Latin.Line_Feed; else return Self.Line_Terminator; @@ -466,11 +470,10 @@ package body LSP.GPR_Documents is procedure Recompute_Markers (Self : in out Document'Class; - Low_Line : LSP.Types.Line_Number; + Low_Line : Natural; Start_Marker : VSS.Strings.Markers.Character_Marker; End_Marker : VSS.Strings.Markers.Character_Marker) is - use type LSP.Types.Line_Number; use type VSS.Strings.Character_Count; M : VSS.Strings.Markers.Character_Marker; @@ -479,7 +482,7 @@ package body LSP.GPR_Documents is (Position => Start_Marker, Terminators => LSP_New_Line_Function_Set, Keep_Terminator => True); - Line : LSP.Types.Line_Number := Low_Line; + Line : Natural := Low_Line; begin if J.Has_Element then @@ -508,26 +511,26 @@ package body LSP.GPR_Documents is procedure Span_To_Markers (Self : Document'Class; - Span : LSP.Messages.Span; + Span : LSP.Structures.A_Range; From : out VSS.Strings.Markers.Character_Marker; To : out VSS.Strings.Markers.Character_Marker) is use type VSS.Unicode.UTF16_Code_Unit_Offset; J1 : VSS.Strings.Character_Iterators.Character_Iterator := - Self.Text.At_Character (Self.Line_To_Marker (Span.first.line)); + Self.Text.At_Character (Self.Line_To_Marker (Span.start.line)); U1 : constant VSS.Unicode.UTF16_Code_Unit_Offset := J1.First_UTF16_Offset; J2 : VSS.Strings.Character_Iterators.Character_Iterator := - Self.Text.At_Character (Self.Line_To_Marker (Span.last.line)); + Self.Text.At_Character (Self.Line_To_Marker (Span.an_end.line)); U2 : constant VSS.Unicode.UTF16_Code_Unit_Offset := J2.First_UTF16_Offset; Dummy : Boolean; begin - while Span.first.character /= J1.First_UTF16_Offset - U1 + while Span.start.character /= Integer (J1.First_UTF16_Offset - U1) and then J1.Forward loop null; @@ -535,7 +538,7 @@ package body LSP.GPR_Documents is From := J1.Marker; - while Span.last.character /= J2.First_UTF16_Offset - U2 + while Span.an_end.character /= Integer (J2.First_UTF16_Offset - U2) and then J2.Forward loop null; @@ -560,7 +563,7 @@ package body LSP.GPR_Documents is -------------------------- function Versioned_Identifier - (Self : Document) return LSP.Messages.VersionedTextDocumentIdentifier is + (Self : Document) return LSP.Structures.VersionedTextDocumentIdentifier is begin return (uri => Self.URI, version => Self.Version); diff --git a/source/gpr/lsp-gpr_documents.ads b/source/gpr/lsp-gpr_documents.ads index 35da50d38..c9b82fc79 100644 --- a/source/gpr/lsp-gpr_documents.ads +++ b/source/gpr/lsp-gpr_documents.ads @@ -23,7 +23,6 @@ with Ada.Containers.Vectors; with Langkit_Support.Slocs; -with GNATCOLL.Traces; with GNATCOLL.VFS; with GPR2.Context; @@ -34,15 +33,15 @@ with GPR2.Path_Name.Set; with GPR2.Project.Tree; with LSP.GPR_Files; -with LSP.Messages; -with LSP.Types; +with LSP.Structures; +with LSP.Tracers; with VSS.Strings; private with VSS.Strings.Markers; package LSP.GPR_Documents is - type Document (Trace : GNATCOLL.Traces.Trace_Handle) is + type Document (Tracer : not null LSP.Tracers.Tracer_Access) is tagged limited private; -- A GPR document (file). @@ -63,7 +62,7 @@ package LSP.GPR_Documents is procedure Initialize (Self : in out Document; - URI : LSP.Messages.DocumentUri; + URI : LSP.Structures.DocumentUri; File : GPR2.Path_Name.Object; Text : VSS.Strings.Virtual_String; Provider : LSP.GPR_Files.File_Provider_Access); @@ -80,7 +79,7 @@ package LSP.GPR_Documents is -- Contents handling -- ----------------------- - function URI (Self : Document) return LSP.Messages.DocumentUri; + function URI (Self : Document) return LSP.Structures.DocumentUri; -- Return the URI associated with Self function Text (Self : Document) return VSS.Strings.Virtual_String; @@ -88,18 +87,18 @@ package LSP.GPR_Documents is function Get_Text_At (Self : Document; - Start_Pos : LSP.Messages.Position; - End_Pos : LSP.Messages.Position) return VSS.Strings.Virtual_String; + Start_Pos : LSP.Structures.Position; + End_Pos : LSP.Structures.Position) return VSS.Strings.Virtual_String; -- Return the text in the specified range. procedure Apply_Changes (Self : aliased in out Document; - Version : LSP.Types.LSP_Number; - Vector : LSP.Messages.TextDocumentContentChangeEvent_Vector); + Version : Integer; + Vector : LSP.Structures.TextDocumentContentChangeEvent_Vector); -- Modify document according to event vector provided by LSP client. function Versioned_Identifier - (Self : Document) return LSP.Messages.VersionedTextDocumentIdentifier; + (Self : Document) return LSP.Structures.VersionedTextDocumentIdentifier; -------------- -- Requests -- @@ -121,7 +120,7 @@ package LSP.GPR_Documents is function Get_Word_At (Self : Document; - Position : LSP.Messages.Position) + Position : LSP.Structures.Position) return VSS.Strings.Virtual_String; -- Get an identifier at given position in the document or an empty string. @@ -141,7 +140,7 @@ package LSP.GPR_Documents is function Get_Open_Document (Self : access Document_Provider; - URI : LSP.Messages.DocumentUri; + URI : LSP.Structures.DocumentUri; Force : Boolean := False) return Document_Access is abstract; -- Return the open document for the given URI. @@ -151,15 +150,15 @@ package LSP.GPR_Documents is function Get_Open_Document_Version (Self : access Document_Provider; - URI : LSP.Messages.DocumentUri) - return LSP.Messages.OptionalVersionedTextDocumentIdentifier is abstract; + URI : LSP.Structures.DocumentUri) + return LSP.Structures.OptionalVersionedTextDocumentIdentifier is abstract; -- Return the version of an open document for the given URI. -- If the document is not opened, then it returns a -- VersionedTextDocumentIdentifier with a null version. function Get_Source_Location (Self : Document'Class; - Position : LSP.Messages.Position) + Position : LSP.Structures.Position) return Langkit_Support.Slocs.Source_Location; -- Convert a Position to a Source_Location @@ -173,7 +172,7 @@ package LSP.GPR_Documents is private package Line_Marker_Vectors is new Ada.Containers.Vectors - (Index_Type => LSP.Types.Line_Number, + (Index_Type => Natural, Element_Type => VSS.Strings.Markers.Character_Marker, "=" => VSS.Strings.Markers."="); @@ -192,15 +191,15 @@ private "=" => Name_Vectors."="); type Document - (Trace : GNATCOLL.Traces.Trace_Handle) is tagged limited record + (Tracer : not null LSP.Tracers.Tracer_Access) is tagged limited record - URI : LSP.Messages.DocumentUri; + URI : LSP.Structures.DocumentUri; -- document's file URI File : GPR2.Path_Name.Object; -- document's file path - Version : LSP.Types.LSP_Number := 1; + Version : Integer := 1; -- Document version Text : VSS.Strings.Virtual_String; @@ -243,7 +242,7 @@ private end record; - function URI (Self : Document) return LSP.Messages.DocumentUri is + function URI (Self : Document) return LSP.Structures.DocumentUri is (Self.URI); function Text (Self : Document) return VSS.Strings.Virtual_String is (Self.Text); diff --git a/source/gpr/lsp-gpr_file_readers.adb b/source/gpr/lsp-gpr_file_readers.adb index 195abcb8c..d432ba82d 100644 --- a/source/gpr/lsp-gpr_file_readers.adb +++ b/source/gpr/lsp-gpr_file_readers.adb @@ -36,7 +36,8 @@ with VSS.Strings.Converters.Decoders; with VSS.Strings.Conversions; with LSP.GPR_Documents; use LSP.GPR_Documents; -with LSP.Types; +with LSP.Structures; +with URIs; with Langkit_Support.Text; @@ -66,6 +67,8 @@ package body LSP.GPR_File_Readers is -- present -- Default flags for the text decoder. + function To_URI (Item : String) return LSP.Structures.DocumentUri; + ------------ -- Create -- ------------ @@ -83,60 +86,6 @@ package body LSP.GPR_File_Readers is return Reference; end Create; - --------------------- - -- Read_And_Decode -- - --------------------- - - procedure Read_And_Decode - (Filename : String; - Charset : VSS.Strings.Virtual_String; - Decoded : out VSS.Strings.Virtual_String; - Error : out VSS.Strings.Virtual_String) - is - Raw : GNAT.Strings.String_Access; - Decoder : VSS.Strings.Converters.Decoders.Virtual_String_Decoder; - - begin - -- Read the file (this call uses MMAP) - - Raw := Create_From_UTF8 (Filename).Read_File; - - if Raw = null then - Decoded.Clear; - Error := "Unable to read file"; - - return; - end if; - - Decoder.Initialize (Charset, Decoder_Flags); - - if not Decoder.Is_Valid then - -- Charset is not supported, fallback to "utf-8". - - Me.Trace - ("Encoding '" - & VSS.Strings.Conversions.To_UTF_8_String (Charset) - & "' is not supported by text decoder."); - - Decoder.Initialize ("utf-8", Decoder_Flags); - end if; - - pragma Assert (Decoder.Is_Valid); - -- At this point decoder is initialized to decode ether given encoding - -- or fallback encoding "utf-8", which is known to be supported. - - declare - Encoded : constant Ada.Streams.Stream_Element_Array (1 .. Raw'Length) - with Import, Address => Raw.all'Address; - - begin - Decoded := Decoder.Decode (Encoded); - Error := Decoder.Error_Message; - end; - - GNAT.Strings.Free (Raw); - end Read_And_Decode; - ---------- -- Read -- ---------- @@ -157,7 +106,7 @@ package body LSP.GPR_File_Readers is -- First check if the file is an open document Doc := Self.Handler.Get_Open_Document - (URI => LSP.Types.File_To_URI (Filename), + (URI => To_URI (Filename), Force => False); -- Preprocess the document's contents if open, or the file contents if @@ -201,4 +150,66 @@ package body LSP.GPR_File_Readers is (Text, Contents.Buffer.all); end Read; + --------------------- + -- Read_And_Decode -- + --------------------- + + procedure Read_And_Decode + (Filename : String; + Charset : VSS.Strings.Virtual_String; + Decoded : out VSS.Strings.Virtual_String; + Error : out VSS.Strings.Virtual_String) + is + Raw : GNAT.Strings.String_Access; + Decoder : VSS.Strings.Converters.Decoders.Virtual_String_Decoder; + + begin + -- Read the file (this call uses MMAP) + + Raw := Create_From_UTF8 (Filename).Read_File; + + if Raw = null then + Decoded.Clear; + Error := "Unable to read file"; + + return; + end if; + + Decoder.Initialize (Charset, Decoder_Flags); + + if not Decoder.Is_Valid then + -- Charset is not supported, fallback to "utf-8". + + Me.Trace + ("Encoding '" + & VSS.Strings.Conversions.To_UTF_8_String (Charset) + & "' is not supported by text decoder."); + + Decoder.Initialize ("utf-8", Decoder_Flags); + end if; + + pragma Assert (Decoder.Is_Valid); + -- At this point decoder is initialized to decode ether given encoding + -- or fallback encoding "utf-8", which is known to be supported. + + declare + Encoded : constant Ada.Streams.Stream_Element_Array (1 .. Raw'Length) + with Import, Address => Raw.all'Address; + + begin + Decoded := Decoder.Decode (Encoded); + Error := Decoder.Error_Message; + end; + + GNAT.Strings.Free (Raw); + end Read_And_Decode; + + ------------ + -- To_URI -- + ------------ + + function To_URI (Item : String) return LSP.Structures.DocumentUri is + (VSS.Strings.Conversions.To_Virtual_String + (URIs.Conversions.From_File (Item)) with null record); + end LSP.GPR_File_Readers; diff --git a/source/gpr/lsp-gpr_files-symbols.adb b/source/gpr/lsp-gpr_files-symbols.adb index c71268475..599a8e4d2 100644 --- a/source/gpr/lsp-gpr_files-symbols.adb +++ b/source/gpr/lsp-gpr_files-symbols.adb @@ -14,94 +14,55 @@ -- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy -- -- of the license. -- ------------------------------------------------------------------------------ --- --- This package provides Get_Symbols request implementation -with LSP.GPR_Handlers; -with LSP.Types; +with LSP.Constants; +with LSP.Enumerations; package body LSP.GPR_Files.Symbols is - package Added_Lists is - new Ada.Containers.Indefinite_Vectors - (Positive, Gpr_Parser.Common.Token_Reference); - subtype Added_List is Added_Lists.Vector; - function Get_File - (Provider : LSP.GPR_Files.File_Provider_Access; - Request : LSP.Messages.Server_Requests.Document_Symbols_Request) - return File_Access is - (LSP.GPR_Files.Parse - (Provider, - LSP.GPR_Handlers.To_File - (Request.params.textDocument.uri, Provider.Follow_Symlinks))); + (Provider : LSP.GPR_Files.File_Provider_Access; + File_Name : GPR2.Path_Name.Object) return File_Access + is + (LSP.GPR_Files.Parse (Provider, File_Name)); function To_Symbol_Kind - (Symbol : LSP.GPR_Files.Symbol) return LSP.Messages.SymbolKind; - - function To_Span (Symbol : LSP.GPR_Files.Symbol) return LSP.Messages.Span is - (first => - (line => - LSP.Types.Line_Number (Symbol.Start_Position.Line - 1), - character => - LSP.Types.UTF_16_Index (Symbol.Start_Position.Column - 1)), - last => - (line => - LSP.Types.Line_Number (Symbol.End_Position.Line - 1), - character => - LSP.Types.UTF_16_Index (Symbol.End_Position.Column - 1))); - - -------------------- - -- To_Symbol_Kind -- - -------------------- + (Symbol : LSP.GPR_Files.Symbol) return LSP.Enumerations.SymbolKind; - function To_Symbol_Kind - (Symbol : LSP.GPR_Files.Symbol) return LSP.Messages.SymbolKind is - begin - case Symbol.Kind is - when K_Imported => - return LSP.Messages.Namespace; - when K_Project => - return LSP.Messages.Module; - when K_Type => - return LSP.Messages.Enum; - when K_Variable => - return LSP.Messages.Variable; - when K_Attribute => - return LSP.Messages.Property; - when K_Package => - return LSP.Messages.A_Package; - end case; - end To_Symbol_Kind; + function To_Range + (Symbol : LSP.GPR_Files.Symbol) return LSP.Structures.A_Range; ----------------- -- Get_Symbols -- ----------------- procedure Get_Symbols - (Provider : LSP.GPR_Files.File_Provider_Access; - Request : LSP.Messages.Server_Requests.Document_Symbols_Request; - Result : out LSP.Messages.Symbol_Vector) is - File : constant File_Access := Get_File (Provider, Request); + (Provider : LSP.GPR_Files.File_Provider_Access; + Document_URI : LSP.Structures.DocumentUri; + File_Name : GPR2.Path_Name.Object; + Result : out LSP.Structures.SymbolInformation_Vector) + is + File : constant File_Access := Get_File (Provider, File_Name); + begin for Symbol of File.Document_Symbols.Document_Symbols loop declare - Item : LSP.Messages.SymbolInformation; - Kind : constant LSP.Messages.SymbolKind := + Item : LSP.Structures.SymbolInformation; + Kind : constant LSP.Enumerations.SymbolKind := To_Symbol_Kind (Symbol); + begin Item := - (name => Symbol.Name, - kind => Kind, - alsIsAdaProcedure => <>, - tags => LSP.Messages.Empty, - deprecated => <>, - location => - (uri => Request.params.textDocument.uri, - span => To_Span (Symbol), - alsKind => LSP.Messages.Empty_Set), - containerName => <>); - Result.Vector.Append (Item); + (name => Symbol.Name, + kind => Kind, + tags => LSP.Constants.Empty, + deprecated => <>, + location => + (uri => Document_URI, + a_range => To_Range (Symbol), + alsKind => LSP.Constants.Empty), + containerName => <>); + Result.Append (Item); end; end loop; end Get_Symbols; @@ -111,21 +72,18 @@ package body LSP.GPR_Files.Symbols is --------------------------- procedure Get_Symbols_Hierarchy - (Provider : LSP.GPR_Files.File_Provider_Access; - Request : LSP.Messages.Server_Requests.Document_Symbols_Request; - Result : out LSP.Messages.Symbol_Vector) is - - use LSP.Messages; - - File : constant File_Access := Get_File (Provider, Request); + (Provider : LSP.GPR_Files.File_Provider_Access; + Document_URI : LSP.Structures.DocumentUri; + File_Name : GPR2.Path_Name.Object; + Result : out LSP.Structures.DocumentSymbol_Vector) + is + pragma Unreferenced (Document_URI); - Added : Added_List; - -- Used to protect against infinite loop on incorrect tree. + File : constant File_Access := Get_File (Provider, File_Name); procedure Walk (Symbols : LSP.GPR_Files.Symbol_List; - Cursor : LSP.Messages.DocumentSymbol_Trees.Cursor; - Tree : in out LSP.Messages.DocumentSymbol_Tree); + Result : in out LSP.Structures.DocumentSymbol_Vector); ---------- -- Walk -- @@ -133,60 +91,84 @@ package body LSP.GPR_Files.Symbols is procedure Walk (Symbols : LSP.GPR_Files.Symbol_List; - Cursor : LSP.Messages.DocumentSymbol_Trees.Cursor; - Tree : in out LSP.Messages.DocumentSymbol_Tree) is - Next : LSP.Messages.DocumentSymbol_Trees.Cursor := Cursor; + Result : in out LSP.Structures.DocumentSymbol_Vector) is begin for Symbol of Symbols loop - if not Added.Contains (Symbol.Ref) then - Added.Append (Symbol.Ref); - - declare - Item : constant LSP.Messages.DocumentSymbol := - (name => Symbol.Name, - detail => <>, - kind => To_Symbol_Kind (Symbol), - tags => LSP.Messages.Empty, - deprecated => <>, - span => To_Span (Symbol), - selectionRange => To_Span (Symbol), - alsIsDeclaration => (Is_Set => False), - alsIsAdaProcedure => <>, - alsVisibility => <>, - children => - Symbol.Children /= Gpr_Parser.Common.No_Token); - begin - Tree.Insert_Child - (Parent => Cursor, - Before => - LSP.Messages.DocumentSymbol_Trees.No_Element, - New_Item => Item, - Position => Next); - end; - + declare + Item : LSP.Structures.DocumentSymbol := + (name => Symbol.Name, + detail => <>, + kind => To_Symbol_Kind (Symbol), + tags => LSP.Constants.Empty, + deprecated => <>, + a_range => To_Range (Symbol), + selectionRange => To_Range (Symbol), + alsIsDeclaration => (Is_Set => False), + alsIsAdaProcedure => <>, + alsVisibility => <>, + children => <>); + + begin if Symbol.Children /= Gpr_Parser.Common.No_Token then declare C : constant LSP.GPR_Files.Symbols_Maps.Cursor := - File.Document_Symbols.Children.Find - (Symbol.Children); + File.Document_Symbols.Children.Find + (Symbol.Children); + begin if LSP.GPR_Files.Symbols_Maps.Has_Element (C) then Walk - (Symbols => LSP.GPR_Files.Symbols_Maps.Element (C), - Cursor => Next, - Tree => Tree); + (LSP.GPR_Files.Symbols_Maps.Element (C), + Item.children); end if; end; end if; - end if; + + Result.Append (Item); + end; end loop; end Walk; begin - Result := (Is_Tree => True, others => <>); - Walk (File.Document_Symbols.Document_Symbols, - Result.Tree.Root, - Result.Tree); + Walk (File.Document_Symbols.Document_Symbols, Result); end Get_Symbols_Hierarchy; + -------------- + -- To_Range -- + -------------- + + function To_Range + (Symbol : LSP.GPR_Files.Symbol) return LSP.Structures.A_Range + is + (start => + (line => Symbol.Start_Position.Line - 1, + character => Symbol.Start_Position.Column - 1), + an_end => + (line => Symbol.End_Position.Line - 1, + character => Symbol.End_Position.Column - 1)); + -- XXX Incorrect conversion + + -------------------- + -- To_Symbol_Kind -- + -------------------- + + function To_Symbol_Kind + (Symbol : LSP.GPR_Files.Symbol) return LSP.Enumerations.SymbolKind is + begin + case Symbol.Kind is + when K_Imported => + return LSP.Enumerations.Namespace; + when K_Project => + return LSP.Enumerations.Module; + when K_Type => + return LSP.Enumerations.Enum; + when K_Variable => + return LSP.Enumerations.Variable; + when K_Attribute => + return LSP.Enumerations.Property; + when K_Package => + return LSP.Enumerations.A_Package; + end case; + end To_Symbol_Kind; + end LSP.GPR_Files.Symbols; diff --git a/source/gpr/lsp-gpr_files-symbols.ads b/source/gpr/lsp-gpr_files-symbols.ads index b4a05ae6f..13020ac6d 100644 --- a/source/gpr/lsp-gpr_files-symbols.ads +++ b/source/gpr/lsp-gpr_files-symbols.ads @@ -14,22 +14,23 @@ -- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy -- -- of the license. -- ------------------------------------------------------------------------------ --- + -- This package provides Get_Symbols requests implementation -with LSP.Messages; -with LSP.Messages.Server_Requests; +with LSP.Structures; package LSP.GPR_Files.Symbols is procedure Get_Symbols - (Provider : LSP.GPR_Files.File_Provider_Access; - Request : LSP.Messages.Server_Requests.Document_Symbols_Request; - Result : out LSP.Messages.Symbol_Vector); + (Provider : LSP.GPR_Files.File_Provider_Access; + Document_URI : LSP.Structures.DocumentUri; + File_Name : GPR2.Path_Name.Object; + Result : out LSP.Structures.SymbolInformation_Vector); procedure Get_Symbols_Hierarchy - (Provider : LSP.GPR_Files.File_Provider_Access; - Request : LSP.Messages.Server_Requests.Document_Symbols_Request; - Result : out LSP.Messages.Symbol_Vector); + (Provider : LSP.GPR_Files.File_Provider_Access; + Document_URI : LSP.Structures.DocumentUri; + File_Name : GPR2.Path_Name.Object; + Result : out LSP.Structures.DocumentSymbol_Vector); end LSP.GPR_Files.Symbols; diff --git a/source/gpr/lsp-gpr_files.ads b/source/gpr/lsp-gpr_files.ads index 5d85b60e5..e1c231b8c 100644 --- a/source/gpr/lsp-gpr_files.ads +++ b/source/gpr/lsp-gpr_files.ads @@ -27,7 +27,6 @@ with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Ada.Strings.Hash; with Ada.Strings.Equal_Case_Insensitive; -with GNATCOLL.Traces; with GNATCOLL.VFS; with GPR2.File_Readers; @@ -43,9 +42,11 @@ with VSS.Strings; with VSS.Strings.Hash; with VSS.String_Vectors; +with LSP.Tracers; + package LSP.GPR_Files is - type File (Trace : GNATCOLL.Traces.Trace_Handle) is + type File (Tracer : not null LSP.Tracers.Tracer_Access) is tagged limited private; -- A parsed GPR file. @@ -356,7 +357,7 @@ private new Ada.Containers.Vectors (Positive, Project_Id); -- Project_Id list used for imported & limited_imported projects - type File (Trace : GNATCOLL.Traces.Trace_Handle) is tagged limited + type File (Tracer : not null LSP.Tracers.Tracer_Access) is tagged limited record Path : GPR2.Path_Name.Object; -- project path of this gpr file diff --git a/source/gpr/lsp-gpr_handlers.adb b/source/gpr/lsp-gpr_handlers.adb index 16eb435bc..b1c47c098 100644 --- a/source/gpr/lsp-gpr_handlers.adb +++ b/source/gpr/lsp-gpr_handlers.adb @@ -15,22 +15,26 @@ -- of the license. -- ------------------------------------------------------------------------------ +with Ada.Exceptions; with Ada.Unchecked_Deallocation; +with GNATCOLL.Traces; + with GPR2.Log; with GPR2.Message; with GPR2.Path_Name.Set; with GPR2.Source_Reference; -with LSP.Errors; +with LSP.Constants; +with LSP.Enumerations; +with LSP.Generic_Cancel_Check; with LSP.GPR_File_Readers; with LSP.GPR_Files.Symbols; -with LSP.Messages.Server_Notifications; - +with LSP.Servers; +with LSP.Server_Notifications.DidChange; with URIs; -with VSS.Strings.Conversions; use VSS.Strings.Conversions; -with VSS.Unicode; +with VSS.Strings.Conversions; package body LSP.GPR_Handlers is @@ -39,6 +43,21 @@ package body LSP.GPR_Handlers is GNATCOLL.Traces.On); -- Trace to activate the support for incremental text changes. + function To_File + (Self : Message_Handler'Class; + Item : LSP.Structures.DocumentUri) return GNATCOLL.VFS.Virtual_File; + -- Turn URI into Virtual_File + + function To_File + (Self : Message_Handler'Class; + Item : LSP.Structures.DocumentUri) return GPR2.Path_Name.Object; + -- Turn URI into GPR2 path object. + + function To_URI + (Self : Message_Handler'Class; + Item : GPR2.Path_Name.Object) return LSP.Structures.DocumentUri; + -- Turn GPR2 path object into URI. + procedure Publish_Diagnostics (Self : access Message_Handler'Class; Document : not null LSP.GPR_Documents.Document_Access); @@ -51,91 +70,60 @@ package body LSP.GPR_Handlers is function To_Optional_DiagnosticSeverity (Level : GPR2.Message.Level_Value) - return LSP.Messages.Optional_DiagnosticSeverity; + return LSP.Structures.DiagnosticSeverity_Optional; - function To_Span - (Sloc : GPR2.Source_Reference.Object) return LSP.Messages.Span; + function To_Range + (Sloc : GPR2.Source_Reference.Object) return LSP.Structures.A_Range; + + procedure Free (Self : in out Internal_Document_Access); + -- Free all the data for the given document. ---------- -- Free -- ---------- procedure Free (Self : in out Internal_Document_Access) is - procedure Unchecked_Free is new Ada.Unchecked_Deallocation - (LSP.GPR_Documents.Document, Internal_Document_Access); + + procedure Unchecked_Free is + new Ada.Unchecked_Deallocation + (LSP.GPR_Documents.Document, Internal_Document_Access); + begin Self.Cleanup; Unchecked_Free (Self); end Free; - --------------- - -- From_File -- - --------------- - - function From_File - (Self : Message_Handler'Class; - File : GNATCOLL.VFS.Virtual_File) return LSP.Messages.DocumentUri is - (LSP.Types.To_LSP_URI - (VSS.Strings.Conversions.To_Virtual_String - (URIs.Conversions.From_File (File.Display_Full_Name)))); - - ------------- - -- To_File -- - ------------- - - function To_File - (Self : Message_Handler'Class; - URI : LSP.Types.LSP_URI) return GNATCOLL.VFS.Virtual_File - is - To : constant URIs.URI_String := LSP.Types.To_UTF_8_String (URI); - Result : constant String := URIs.Conversions.To_File - (To, Normalize => Self.Follow_Symlinks); - begin - return GNATCOLL.VFS.Create_From_UTF8 (Result); - end To_File; - - ------------- - -- To_File -- - ------------- - - function To_File - (URI : LSP.Types.LSP_URI; - Follow_Symlinks : Boolean) return GPR2.Path_Name.Object - is - To : constant URIs.URI_String := LSP.Types.To_UTF_8_String (URI); - Result : constant String := URIs.Conversions.To_File - (To, Normalize => Follow_Symlinks); - begin - return GPR2.Path_Name.Create_File (GPR2.Filename_Type (Result)); - end To_File; - ----------------------- -- Get_Open_Document -- ----------------------- overriding function Get_Open_Document (Self : access Message_Handler; - URI : LSP.Messages.DocumentUri; - Force : Boolean := False) - return LSP.GPR_Documents.Document_Access + URI : LSP.Structures.DocumentUri; + Force : Boolean := False) return LSP.GPR_Documents.Document_Access is File : constant GNATCOLL.VFS.Virtual_File := Self.To_File (URI); - begin + begin if Self.Open_Documents.Contains (File) then - return LSP.GPR_Documents.Document_Access - (Self.Open_Documents.Element (File)); + return + LSP.GPR_Documents.Document_Access + (Self.Open_Documents.Element (File)); + elsif Force then declare Document : constant Internal_Document_Access := - new LSP.GPR_Documents.Document (Self.Trace); + new LSP.GPR_Documents.Document (Self.Tracer); begin - Document.Initialize (URI, - GPR2.Path_Name.Create (File), - VSS.Strings.Empty_Virtual_String, - Self); + Document.Initialize + (URI, + GPR2.Path_Name.Create (File), + VSS.Strings.Empty_Virtual_String, + Self); + return LSP.GPR_Documents.Document_Access (Document); end; + else return null; end if; @@ -145,17 +133,16 @@ package body LSP.GPR_Handlers is -- Get_Open_Document_Version -- ------------------------------- - overriding - function Get_Open_Document_Version + overriding function Get_Open_Document_Version (Self : access Message_Handler; - URI : LSP.Messages.DocumentUri) - return LSP.Messages.OptionalVersionedTextDocumentIdentifier + URI : LSP.Structures.DocumentUri) + return LSP.Structures.OptionalVersionedTextDocumentIdentifier is + use type LSP.GPR_Documents.Document_Access; + Target_Text_Document : constant LSP.GPR_Documents.Document_Access := Self.Get_Open_Document (URI); - use type LSP.GPR_Documents.Document_Access; - begin -- If the target textDocument hasn't been opened in the editor -- then ALS hasn't received an open notification before. Therefore @@ -164,13 +151,14 @@ package body LSP.GPR_Handlers is -- be null. if Target_Text_Document = null then - return (URI, LSP.Messages.Nullable_Number'(Is_Set => False)); + return (URI, (Is_Null => True)); else return (uri => Target_Text_Document.Versioned_Identifier.uri, version => - (True, Target_Text_Document.Versioned_Identifier.version)); + (Is_Null => False, + Value => Target_Text_Document.Versioned_Identifier.version)); end if; end Get_Open_Document_Version; @@ -181,23 +169,28 @@ package body LSP.GPR_Handlers is overriding function Get_Parsed_File (Self : access Message_Handler; Path : GPR2.Path_Name.Object) - return LSP.GPR_Files.File_Access is + return LSP.GPR_Files.File_Access + is C : constant LSP.GPR_Handlers.Files_Maps.Cursor := Self.Parsed_Files.Find (Path); + begin if LSP.GPR_Handlers.Files_Maps.Has_Element (C) then return LSP.GPR_Files.File_Access (LSP.GPR_Handlers.Files_Maps.Element (C)); + else declare Parsed_File : constant Internal_File_Access := - new LSP.GPR_Files.File (Self.Trace); + new LSP.GPR_Files.File (Self.Tracer); + begin Parsed_File.Initialize (Path => Path, File_Provider => Self); Self.Parsed_Files.Insert (Path, Parsed_File); + return LSP.GPR_Files.File_Access (Parsed_File); end; end if; @@ -211,185 +204,20 @@ package body LSP.GPR_Handlers is (Self : access Message_Handler; Where : String) is begin - Self.Trace.Trace ("Unexpected null document in " & Where); + Self.Tracer.Trace ("Unexpected null document in " & Where); end Log_Unexpected_Null_Document; - -------------------------------- - -- On_GLS_Project_File_Request -- - -------------------------------- - - overriding function On_GLS_Project_File_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.GLS_Project_File_Request) - return LSP.Messages.Server_Responses.GLS_Project_File_Response is - begin - return raise Program_Error with "Unimplemented request"; - end On_GLS_Project_File_Request; - - -------------------------------- - -- On_GLS_ObjectDir_Request -- - -------------------------------- - - overriding function On_GLS_Object_Dir_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.GLS_Object_Dir_Request) - return LSP.Messages.Server_Responses.GLS_Object_Dir_Response is - begin - return raise Program_Error with "Unimplemented request"; - end On_GLS_Object_Dir_Request; - - -------------------------------- - -- On_GLS_Executables_Request -- - -------------------------------- - - overriding function On_GLS_Executables_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.GLS_Executables_Request) - return LSP.Messages.Server_Responses.GLS_Executables_Response is - begin - return raise Program_Error with "Unimplemented request"; - end On_GLS_Executables_Request; - - -------------------------- - -- On_GLS_Mains_Request -- - -------------------------- - - overriding function On_GLS_Mains_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.GLS_Mains_Request) - return LSP.Messages.Server_Responses.GLS_Mains_Response is - begin - return raise Program_Error with "Unimplemented request"; - end On_GLS_Mains_Request; - - --------------------------------- - -- On_ALS_Check_Syntax_Request -- - --------------------------------- - - overriding function On_ALS_Check_Syntax_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.ALS_Check_Syntax_Request) - return LSP.Messages.Server_Responses.ALS_Check_Syntax_Response is - begin - return raise Program_Error with "Unimplemented request"; - end On_ALS_Check_Syntax_Request; - - -------------------------- - -- On_ALS_Debug_Request -- - -------------------------- - - overriding function On_ALS_Debug_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.ALS_Debug_Request) - return LSP.Messages.Server_Responses.ALS_Debug_Response is - begin - return raise Program_Error with "Unimplemented request"; - end On_ALS_Debug_Request; - - -------------------------------------- - -- On_ALS_Show_Dependencies_Request -- - -------------------------------------- - - overriding function On_ALS_Show_Dependencies_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.ALS_Show_Dependencies_Request) - return LSP.Messages.Server_Responses.ALS_ShowDependencies_Response is - begin - return raise Program_Error with "Unimplemented request"; - end On_ALS_Show_Dependencies_Request; - - -------------------------------- - -- On_ALS_Source_Dirs_Request -- - -------------------------------- - - overriding function On_ALS_Source_Dirs_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.ALS_Source_Dirs_Request) - return LSP.Messages.Server_Responses.ALS_SourceDirs_Response is - begin - return raise Program_Error with "Unimplemented request"; - end On_ALS_Source_Dirs_Request; - - --------------------------- - -- On_CodeAction_Request -- - --------------------------- - - overriding function On_CodeAction_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.CodeAction_Request) - return LSP.Messages.Server_Responses.CodeAction_Response is - begin - return raise Program_Error with "Unimplemented request"; - end On_CodeAction_Request; - - ----------------------------------- - -- On_Color_Presentation_Request -- - ----------------------------------- - - overriding function On_Color_Presentation_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Color_Presentation_Request) - return LSP.Messages.Server_Responses.ColorPresentation_Response is - begin - return raise Program_Error with "Unimplemented request"; - end On_Color_Presentation_Request; - - --------------------------- - -- On_Completion_Request -- - --------------------------- - - overriding function On_Completion_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Completion_Request) - return LSP.Messages.Server_Responses.Completion_Response is - begin - return raise Program_Error with "Unimplemented request"; - end On_Completion_Request; - - -------------------------------------- - -- On_CompletionItemResolve_Request -- - -------------------------------------- - - overriding function On_CompletionItemResolve_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.CompletionItemResolve_Request) - return LSP.Messages.Server_Responses.CompletionItemResolve_Response is - begin - return raise Program_Error with "Unimplemented request"; - end On_CompletionItemResolve_Request; - - ---------------------------- - -- On_Declaration_Request -- - ---------------------------- - - overriding function On_Declaration_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Declaration_Request) - return LSP.Messages.Server_Responses.Location_Link_Response is - begin - return raise Program_Error with "Unimplemented request"; - end On_Declaration_Request; - - --------------------------- - -- On_Definition_Request -- - --------------------------- - - overriding function On_Definition_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Definition_Request) - return LSP.Messages.Server_Responses.Location_Link_Response is - begin - return raise Program_Error with "Unimplemented request"; - end On_Definition_Request; - - ------------------------------------------- - -- On_DidChangeTextDocument_Notification -- - ------------------------------------------- + ------------------------------- + -- On_DidChange_Notification -- + ------------------------------- - overriding procedure On_DidChangeTextDocument_Notification - (Self : access Message_Handler; - Value : LSP.Messages.DidChangeTextDocumentParams) + overriding procedure On_DidChange_Notification + (Self : in out Message_Handler; + Value : LSP.Structures.DidChangeTextDocumentParams) is + use type GNATCOLL.VFS.Virtual_File; + use type LSP.GPR_Documents.Document_Access; + function Skip_Did_Change return Boolean; -- Check if the following message in the queue is didChange for -- the same document @@ -399,43 +227,37 @@ package body LSP.GPR_Handlers is --------------------- function Skip_Did_Change return Boolean is - use type LSP.Servers.Message_Access; + use type LSP.Servers.Server_Message_Access; + + subtype DidChange_Notification is + LSP.Server_Notifications.DidChange.Notification; - subtype DidChangeTextDocument_Notification is LSP.Messages - .Server_Notifications.DidChangeTextDocument_Notification; + Next : constant LSP.Servers.Server_Message_Access := + LSP.Servers.Server'Class (Self.Sender.all).Look_Ahead_Message; - Next : constant LSP.Servers.Message_Access := - Self.Server.Look_Ahead_Message; begin if Next = null - or else Next.all not in - DidChangeTextDocument_Notification'Class + or else Next.all not in DidChange_Notification'Class then return False; end if; declare - Object : DidChangeTextDocument_Notification'Class renames - DidChangeTextDocument_Notification'Class (Next.all); + Object : DidChange_Notification'Class renames + DidChange_Notification'Class (Next.all); Object_File : constant GNATCOLL.VFS.Virtual_File := - Self.To_File (Object.params.textDocument.uri); - Value_File : constant GNATCOLL.VFS.Virtual_File := + Self.To_File (Object.Params.textDocument.uri); + Value_File : constant GNATCOLL.VFS.Virtual_File := Self.To_File (Value.textDocument.uri); - use type GNATCOLL.VFS.Virtual_File; begin - if Object_File /= Value_File then - return False; - end if; + return Object_File = Value_File; end; - - return True; end Skip_Did_Change; Document : constant LSP.GPR_Documents.Document_Access := - Get_Open_Document (Self, Value.textDocument.uri); + Self.Get_Open_Document (Value.textDocument.uri); - use type LSP.GPR_Documents.Document_Access; begin if Document = null then Self.Log_Unexpected_Null_Document @@ -445,51 +267,57 @@ package body LSP.GPR_Handlers is if Allow_Incremental_Text_Changes.Active then -- If we are applying incremental changes, we can't skip the -- call to Apply_Changes, since this would break synchronization. + Document.Apply_Changes - (Value.textDocument.version, - Value.contentChanges); + (Value.textDocument.version, Value.contentChanges); -- However, we should skip the Indexing part if the next change in -- the queue will re-change the text document. + if Skip_Did_Change then return; end if; + else -- If we are not applying incremental changes, we can skip -- Apply_Changes: the next change will contain the full text. + if Skip_Did_Change then return; end if; + Document.Apply_Changes - (Value.textDocument.version, - Value.contentChanges); + (Value.textDocument.version, Value.contentChanges); end if; -- Load gpr tree & prepare diagnostics + Document.Load; -- Build GPR file for LSP needs. + LSP.GPR_Files.Parse_Modified_Document - (File_Provider => Self, - Path => - To_File (Value.textDocument.uri, Self.Follow_Symlinks)); + (File_Provider => Self'Unchecked_Access, + Path => Self.To_File (Value.textDocument.uri)); -- Emit diagnostics + Self.Publish_Diagnostics (Document); - end On_DidChangeTextDocument_Notification; + end On_DidChange_Notification; - ------------------------------------------ - -- On_DidCloseTextDocument_Notification -- - ------------------------------------------ + ------------------------------ + -- On_DidClose_Notification -- + ------------------------------ - overriding procedure On_DidCloseTextDocument_Notification - (Self : access Message_Handler; - Value : LSP.Messages.DidCloseTextDocumentParams) + overriding procedure On_DidClose_Notification + (Self : in out Message_Handler; + Value : LSP.Structures.DidCloseTextDocumentParams) is - URI : LSP.Messages.DocumentUri renames Value.textDocument.uri; - File : constant GNATCOLL.VFS.Virtual_File := Self.To_File (URI); - Diag : LSP.Messages.PublishDiagnosticsParams; + URI : constant LSP.Structures.DocumentUri := Value.textDocument.uri; + File : constant GNATCOLL.VFS.Virtual_File := Self.To_File (URI); + Diag : LSP.Structures.PublishDiagnosticsParams; Document : Internal_Document_Access; + begin if Self.Open_Documents.Contains (File) then Document := Self.Open_Documents.Element (File); @@ -497,476 +325,229 @@ package body LSP.GPR_Handlers is -- Remove the URI from the set of open documents now: this way, -- the call to Flush_Document below will not attempt to reindex -- from an open document, but from the file on disk. + Self.Open_Documents.Delete (File); Free (Document); -- Build GPR file for LSP needs using disk content. + LSP.GPR_Files.Parse_Modified_Document - (File_Provider => Self, - Path => - To_File (Value.textDocument.uri, Self.Follow_Symlinks)); + (File_Provider => Self'Unchecked_Access, + Path => Self.To_File (Value.textDocument.uri)); else -- We have received a didCloseTextDocument but the document was -- not open: this is not supposed to happen, log it. - Self.Trace.Trace + Self.Tracer.Trace ("received a didCloseTextDocument for non-open document with uri: " - & LSP.Types.To_UTF_8_String (URI)); + & VSS.Strings.Conversions.To_UTF_8_String (URI)); end if; -- Clean diagnostics up on closing document + if Self.Diagnostics_Enabled then Diag.uri := URI; - Self.Server.On_Publish_Diagnostics (Diag); + Self.Sender.On_PublishDiagnostics_Notification (Diag); end if; - end On_DidCloseTextDocument_Notification; + end On_DidClose_Notification; - ----------------------------------------- - -- On_DidOpenTextDocument_Notification -- - ----------------------------------------- + ----------------------------- + -- On_DidOpen_Notification -- + ----------------------------- - overriding procedure On_DidOpenTextDocument_Notification - (Self : access Message_Handler; - Value : LSP.Messages.DidOpenTextDocumentParams) + overriding procedure On_DidOpen_Notification + (Self : in out Message_Handler; + Value : LSP.Structures.DidOpenTextDocumentParams) is - URI : LSP.Messages.DocumentUri renames Value.textDocument.uri; - File : constant GNATCOLL.VFS.Virtual_File := Self.To_File (URI); - Object : constant Internal_Document_Access := - new LSP.GPR_Documents.Document (Self.Trace); + URI : constant LSP.Structures.DocumentUri := Value.textDocument.uri; + File : constant GNATCOLL.VFS.Virtual_File := Self.To_File (URI); + Object : constant Internal_Document_Access := + new LSP.GPR_Documents.Document (Self.Tracer); + begin - Self.Trace.Trace ("In Text_Document_Did_Open"); - Self.Trace.Trace ("Uri : " & LSP.Types.To_UTF_8_String (URI)); + Self.Tracer.Trace ("In Text_Document_Did_Open"); + Self.Tracer.Trace + ("Uri : " & VSS.Strings.Conversions.To_UTF_8_String (URI)); -- We have received a document: add it to the documents container - Object.Initialize (URI, - GPR2.Path_Name.Create (Self.To_File (URI)), - Value.textDocument.text, - Self); + Object.Initialize + (URI, + GPR2.Path_Name.Create (Self.To_File (URI)), + Value.textDocument.text, + Self'Unchecked_Access); Self.Open_Documents.Include (File, Object); -- Load gpr tree & prepare diagnostics + Object.Load; -- Build GPR file for LSP needs. + LSP.GPR_Files.Parse_Modified_Document - (File_Provider => Self, - Path => - To_File (Value.textDocument.uri, Self.Follow_Symlinks)); + (File_Provider => Self'Unchecked_Access, + Path => Self.To_File (Value.textDocument.uri)); -- Emit diagnostics - Self.Publish_Diagnostics (LSP.GPR_Documents.Document_Access (Object)); - Self.Trace.Trace ("Finished Text_Document_Did_Open"); - end On_DidOpenTextDocument_Notification; - - ------------------------------- - -- On_Document_Color_Request -- - ------------------------------- + Self.Publish_Diagnostics (LSP.GPR_Documents.Document_Access (Object)); - overriding function On_Document_Color_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Document_Color_Request) - return LSP.Messages.Server_Responses.DocumentColor_Response is - begin - return raise Program_Error with "Unimplemented request"; - end On_Document_Color_Request; + Self.Tracer.Trace ("Finished Text_Document_Did_Open"); + end On_DidOpen_Notification; ------------------------------- - -- On_Document_Links_Request -- + -- On_DocumentSymbol_Request -- ------------------------------- - overriding function On_Document_Links_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Document_Links_Request) - return LSP.Messages.Server_Responses.Links_Response is - begin - return raise Program_Error with "Unimplemented request"; - end On_Document_Links_Request; - - ------------------------------------- - -- On_Document_Tokens_Full_Request -- - ------------------------------------- - - overriding function On_Document_Tokens_Full_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Document_Tokens_Full_Request) - return LSP.Messages.Server_Responses.SemanticTokens_Response is - begin - return raise Program_Error with "Unimplemented request"; - end On_Document_Tokens_Full_Request; - - -------------------------------------- - -- On_Document_Tokens_Range_Request -- - -------------------------------------- - - overriding function On_Document_Tokens_Range_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Document_Tokens_Range_Request) - return LSP.Messages.Server_Responses.SemanticTokens_Response + overriding procedure On_DocumentSymbol_Request + (Self : in out Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentSymbolParams) is - pragma Unreferenced (Self, Request); - - Response : LSP.Messages.Server_Responses.SemanticTokens_Response - (Is_Error => True); - begin - Response.error := - (True, - (code => LSP.Errors.InternalError, - message => "Not implemented", - data => <>)); - return Response; - end On_Document_Tokens_Range_Request; - - --------------------------------- - -- On_Document_Symbols_Request -- - --------------------------------- - - overriding function On_Document_Symbols_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Document_Symbols_Request) - return LSP.Messages.Server_Responses.Symbol_Response is - - Result : LSP.Messages.Server_Responses.Symbol_Response := - (Is_Error => False, - result => <>, - error => (Is_Set => False), - others => <>); - - begin - Self.Get_Symbols (Self, Request, Result.result); - return Result; - end On_Document_Symbols_Request; - - -------------------------------- - -- On_Execute_Command_Request -- - -------------------------------- - - overriding function On_Execute_Command_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Execute_Command_Request) - return LSP.Messages.Server_Responses.ExecuteCommand_Response is - begin - return raise Program_Error with "Unimplemented request"; - end On_Execute_Command_Request; - - ------------------------------ - -- On_Folding_Range_Request -- - ------------------------------ - - overriding function On_Folding_Range_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Folding_Range_Request) - return LSP.Messages.Server_Responses.FoldingRange_Response is - begin - return raise Program_Error with "Unimplemented request"; - end On_Folding_Range_Request; - - --------------------------- - -- On_Formatting_Request -- - --------------------------- - - overriding function On_Formatting_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Formatting_Request) - return LSP.Messages.Server_Responses.Formatting_Response is - begin - return raise Program_Error with "Unimplemented request"; - end On_Formatting_Request; - - -------------------------- - -- On_Highlight_Request -- - -------------------------- - - overriding function On_Highlight_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Highlight_Request) - return LSP.Messages.Server_Responses.Highlight_Response is - begin - return raise Program_Error with "Unimplemented request"; - end On_Highlight_Request; - - ---------------------- - -- On_Hover_Request -- - ---------------------- - - overriding function On_Hover_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Hover_Request) - return LSP.Messages.Server_Responses.Hover_Response is - begin - return raise Program_Error with "Unimplemented request"; - end On_Hover_Request; - - ------------------------------- - -- On_Implementation_Request -- - ------------------------------- + Response : LSP.Structures.DocumentSymbol_Result; - overriding function On_Implementation_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Implementation_Request) - return LSP.Messages.Server_Responses.Location_Link_Response is begin - return raise Program_Error with "Unimplemented request"; - end On_Implementation_Request; + if Self.Hierarchical_Symbols then + Response := (Kind => LSP.Structures.Variant_2, others => <>); + LSP.GPR_Files.Symbols.Get_Symbols_Hierarchy + (Self'Unchecked_Access, + Value.textDocument.uri, + Self.To_File (Value.textDocument.uri), + Response.Variant_2); - ------------------------------- - -- On_Incoming_Calls_Request -- - ------------------------------- + else + LSP.GPR_Files.Symbols.Get_Symbols + (Self'Unchecked_Access, + Value.textDocument.uri, + Self.To_File (Value.textDocument.uri), + Response.Variant_1); + end if; - overriding function On_Incoming_Calls_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Incoming_Calls_Request) - return LSP.Messages.Server_Responses.IncomingCalls_Response is - begin - return raise Program_Error with "Unimplemented request"; - end On_Incoming_Calls_Request; + Self.Sender.On_DocumentSymbol_Response (Id, Response); + end On_DocumentSymbol_Request; --------------------------- -- On_Initialize_Request -- --------------------------- - overriding function On_Initialize_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Initialize_Request) - return LSP.Messages.Server_Responses.Initialize_Response + overriding procedure On_Initialize_Request + (Self : in out Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InitializeParams) is - use all type LSP.Types.Optional_Boolean; - - Value : LSP.Messages.InitializeParams renames Request.params; + Response : LSP.Structures.InitializeResult; - Response : LSP.Messages.Server_Responses.Initialize_Response - (Is_Error => False); begin - Self.Client_Settings := Value; - - Self.File_Reader := LSP.GPR_File_Readers.Create (Self); - - Response.result.capabilities.textDocumentSync := - (Is_Set => True, - Is_Number => False, - Options => - (openClose => True, - change => (True, LSP.Messages.Full), - others => <>)); + Self.File_Reader := LSP.GPR_File_Readers.Create (Self'Unchecked_Access); - Response.result.capabilities.documentSymbolProvider := + Response.capabilities.textDocumentSync := (Is_Set => True, - Value => (workDoneProgress => LSP.Types.None, label => <>)); - - if Value.capabilities.textDocument.documentSymbol.Is_Set - and then Value.capabilities.textDocument.documentSymbol.Value - .hierarchicalDocumentSymbolSupport = True - then - Self.Get_Symbols := - LSP.GPR_Files.Symbols.Get_Symbols_Hierarchy'Access; - else - Self.Get_Symbols := - LSP.GPR_Files.Symbols.Get_Symbols'Access; - end if; - - return Response; + Value => (Is_TextDocumentSyncOptions => True, + TextDocumentSyncOptions => + (openClose => (Is_Set => True, Value => True), + change => + (Is_Set => True, Value => LSP.Enumerations.Full), + others => <>))); + + Response.capabilities.documentSymbolProvider := + (Is_Set => True, + Value => + (Is_Boolean => False, + DocumentSymbolOptions => + (workDoneProgress => (Is_Set => False), label => <>))); + + Self.Hierarchical_Symbols := + Value.capabilities.textDocument.Is_Set + and then Value.capabilities.textDocument.Value.documentSymbol.Is_Set + and then Value.capabilities.textDocument.Value.documentSymbol.Value + .hierarchicalDocumentSymbolSupport.Is_Set + and then Value.capabilities.textDocument.Value.documentSymbol.Value + .hierarchicalDocumentSymbolSupport.Value; + + Self.Sender.On_Initialize_Response (Id, Response); end On_Initialize_Request; - ------------------------------- - -- On_Outgoing_Calls_Request -- - ------------------------------- + ---------------------------- + -- On_Server_Notification -- + ---------------------------- - overriding function On_Outgoing_Calls_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Outgoing_Calls_Request) - return LSP.Messages.Server_Responses.OutgoingCalls_Response is + overriding procedure On_Server_Notification + (Self : in out Message_Handler; + Value : LSP.Server_Notifications.Server_Notification'Class) is begin - return raise Program_Error with "Unimplemented request"; - end On_Outgoing_Calls_Request; + Value.Visit_Server_Receiver (Self); - --------------------------------------- - -- On_Prepare_Call_Hierarchy_Request -- - --------------------------------------- + exception + when E : others => + Self.Tracer.Trace_Exception (E, "On_Server_Notification"); + end On_Server_Notification; - overriding function On_Prepare_Call_Hierarchy_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Prepare_Call_Hierarchy_Request) - return LSP.Messages.Server_Responses.PrepareCallHierarchy_Response is - begin - return raise Program_Error with "Unimplemented request"; - end On_Prepare_Call_Hierarchy_Request; + ----------------------- + -- On_Server_Request -- + ----------------------- - ------------------------------- - -- On_Prepare_Rename_Request -- - ------------------------------- + overriding procedure On_Server_Request + (Self : in out Message_Handler; + Value : LSP.Server_Requests.Server_Request'Class) + is + package Canceled is new LSP.Generic_Cancel_Check (Value'Access, 127); - overriding function On_Prepare_Rename_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Prepare_Rename_Request) - return LSP.Messages.Server_Responses.Prepare_Rename_Response is begin - return raise Program_Error with "Unimplemented request"; - end On_Prepare_Rename_Request; + if Value.Canceled then + Self.Sender.On_Error_Response + (Value.Id, + (code => LSP.Constants.RequestCancelled, + message => "Request was canceled")); - --------------------------------- - -- On_Range_Formatting_Request -- - --------------------------------- - - overriding function On_Range_Formatting_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Range_Formatting_Request) - return LSP.Messages.Server_Responses.Range_Formatting_Response is - begin - return raise Program_Error with "Unimplemented request"; - end On_Range_Formatting_Request; + return; + end if; - ----------------------------------- - -- On_On_Type_Formatting_Request -- - ----------------------------------- + Self.Implemented := True; + Self.Is_Canceled := Canceled.Has_Been_Canceled'Unrestricted_Access; - overriding function On_On_Type_Formatting_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.On_Type_Formatting_Request) - return LSP.Messages.Server_Responses.On_Type_Formatting_Response is - begin - return raise Program_Error with "Unimplemented request"; - end On_On_Type_Formatting_Request; + Value.Visit_Server_Receiver (Self); - --------------------------- - -- On_References_Request -- - --------------------------- - - overriding function On_References_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.References_Request) - return LSP.Messages.Server_Responses.Location_Response is - begin - return raise Program_Error with "Unimplemented request"; - end On_References_Request; - - ----------------------- - -- On_Rename_Request -- - ----------------------- + if not Self.Implemented then + Self.Sender.On_Error_Response + (Value.Id, + (code => LSP.Enumerations.MethodNotFound, + message => "Not implemented")); + end if; - overriding function On_Rename_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Rename_Request) - return LSP.Messages.Server_Responses.Rename_Response is - begin - return raise Program_Error with "Unimplemented request"; - end On_Rename_Request; + exception + when E : others => + declare + Message : constant VSS.Strings.Virtual_String := + VSS.Strings.Conversions.To_Virtual_String + ("Exception: " & + Ada.Exceptions.Exception_Name (E) & " (" & + Ada.Exceptions.Exception_Message (E) & ")"); - -------------------------------- - -- On_Selection_Range_Request -- - -------------------------------- + begin + Self.Tracer.Trace_Exception (E, "On_Server_Request"); - overriding function On_Selection_Range_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Selection_Range_Request) - return LSP.Messages.Server_Responses.SelectionRange_Response is - begin - return raise Program_Error with "Unimplemented request"; - end On_Selection_Range_Request; + Self.Sender.On_Error_Response + (Value.Id, + (code => LSP.Enumerations.InternalError, + message => Message)); + end; + end On_Server_Request; ------------------------- -- On_Shutdown_Request -- ------------------------- - overriding function On_Shutdown_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Shutdown_Request) - return LSP.Messages.Server_Responses.Shutdown_Response + overriding procedure On_Shutdown_Request + (Self : in out Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String) is - pragma Unreferenced (Request); - begin - return Response : LSP.Messages.Server_Responses.Shutdown_Response - (Is_Error => False); - end On_Shutdown_Request; - - ------------------------------- - -- On_Signature_Help_Request -- - ------------------------------- + Response : LSP.Structures.Null_Record; - overriding function On_Signature_Help_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Signature_Help_Request) - return LSP.Messages.Server_Responses.SignatureHelp_Response is begin - return raise Program_Error with "Unimplemented request"; - end On_Signature_Help_Request; - - -------------------------------- - -- On_Type_Definition_Request -- - -------------------------------- - - overriding function On_Type_Definition_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Type_Definition_Request) - return LSP.Messages.Server_Responses.Location_Link_Response is - begin - return raise Program_Error with "Unimplemented request"; - end On_Type_Definition_Request; - - ------------------------------------------ - -- On_Workspace_Execute_Command_Request -- - ------------------------------------------ - - overriding function On_Workspace_Execute_Command_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Workspace_Execute_Command_Request) - return LSP.Messages.Server_Responses.ExecuteCommand_Response is - begin - return raise Program_Error with "Unimplemented request"; - end On_Workspace_Execute_Command_Request; - - ---------------------------------- - -- On_Workspace_Symbols_Request -- - ---------------------------------- - - overriding function On_Workspace_Symbols_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Workspace_Symbols_Request) - return LSP.Messages.Server_Responses.Symbol_Response is - begin - return raise Program_Error with "Unimplemented request"; - end On_Workspace_Symbols_Request; - - -------------------------------------------- - -- On_Workspace_Will_Create_Files_Request -- - -------------------------------------------- - - overriding function On_Workspace_Will_Create_Files_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests - .Workspace_Will_Create_Files_Request) - return LSP.Messages.Server_Responses.WillCreateFiles_Response is - begin - return raise Program_Error with "Unimplemented request"; - end On_Workspace_Will_Create_Files_Request; - - -------------------------------------------- - -- On_Workspace_Will_Delete_Files_Request -- - -------------------------------------------- - - overriding function On_Workspace_Will_Delete_Files_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests - .Workspace_Will_Delete_Files_Request) - return LSP.Messages.Server_Responses.WillDeleteFiles_Response is - begin - return raise Program_Error with "Unimplemented request"; - end On_Workspace_Will_Delete_Files_Request; - - -------------------------------------------- - -- On_Workspace_Will_Rename_Files_Request -- - -------------------------------------------- - - overriding function On_Workspace_Will_Rename_Files_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests - .Workspace_Will_Rename_Files_Request) - return LSP.Messages.Server_Responses.WillRenameFiles_Response is - begin - return raise Program_Error with "Unimplemented request"; - end On_Workspace_Will_Rename_Files_Request; + Self.Sender.On_Shutdown_Response (Id, Response); + end On_Shutdown_Request; ------------------------- -- Publish_Diagnostics -- @@ -978,7 +559,6 @@ package body LSP.GPR_Handlers is is Changed : Boolean; Msg_Map : LSP.GPR_Documents.Message_Map; - Files_With_Diags : GPR2.Path_Name.Set.Object; -- Used to update Document.Files_With_Diags @@ -992,91 +572,128 @@ package body LSP.GPR_Handlers is if Changed then for C in Msg_Map.Iterate loop declare - File : constant GPR2.Path_Name.Object := - LSP.GPR_Documents.Message_Maps.Key (C); - Log : constant GPR2.Log.Object := - LSP.GPR_Documents.Message_Maps.Element (C); - Diag : LSP.Messages.PublishDiagnosticsParams; - - Diag_Empty : Boolean := True; + File : constant GPR2.Path_Name.Object := + LSP.GPR_Documents.Message_Maps.Key (C); + Log : constant GPR2.Log.Object := + LSP.GPR_Documents.Message_Maps.Element (C); + Diag : LSP.Structures.PublishDiagnosticsParams := + (uri => + (if File.Is_Defined + then Self.To_URI (File) else Document.URI), + others => <>); begin - if not File.Is_Defined then - Diag.uri := Document.URI; - else - Diag.uri := LSP.Types.File_To_URI (File.Value); - end if; for C in Log.Iterate loop declare Message : constant GPR2.Message.Object := C.Element; - Diagnostic : LSP.Messages.Diagnostic; + Diagnostic : LSP.Structures.Diagnostic; + begin - Diagnostic.span := To_Span (Message.Sloc); + Diagnostic.a_range := To_Range (Message.Sloc); Diagnostic.severity := To_Optional_DiagnosticSeverity (Message.Level); Diagnostic.message := VSS.Strings.Conversions.To_Virtual_String (Message.Message); Diag.diagnostics.Append (Diagnostic); - Diag_Empty := False; end; end loop; - if not Diag_Empty then + + if not Diag.diagnostics.Is_Empty then Files_With_Diags.Append (File); end if; - Self.Server.On_Publish_Diagnostics (Diag); + + Self.Sender.On_PublishDiagnostics_Notification (Diag); end; end loop; + Document.Update_Files_With_Diags (Files_With_Diags); end if; end if; end Publish_Diagnostics; + ------------- + -- To_File -- + ------------- + + function To_File + (Self : Message_Handler'Class; + Item : LSP.Structures.DocumentUri) return GNATCOLL.VFS.Virtual_File + is + (GNATCOLL.VFS.Create_From_UTF8 + (URIs.Conversions.To_File + (URI => VSS.Strings.Conversions.To_UTF_8_String (Item), + Normalize => Self.Follow_Symlinks))); + + ------------- + -- To_File -- + ------------- + + function To_File + (Self : Message_Handler'Class; + Item : LSP.Structures.DocumentUri) return GPR2.Path_Name.Object + is + (GPR2.Path_Name.Create_File + (GPR2.Filename_Type + (URIs.Conversions.To_File + (URI => VSS.Strings.Conversions.To_UTF_8_String (Item), + Normalize => Self.Follow_Symlinks)))); + ------------------------------------ -- To_Optional_DiagnosticSeverity -- ------------------------------------ function To_Optional_DiagnosticSeverity (Level : GPR2.Message.Level_Value) - return LSP.Messages.Optional_DiagnosticSeverity + return LSP.Structures.DiagnosticSeverity_Optional is - use GPR2.Message; + use all type GPR2.Message.Level_Value; + begin case Level is when Information => - return (True, LSP.Messages.Information); + return (True, LSP.Enumerations.Information); when Warning => - return (True, LSP.Messages.Warning); + return (True, LSP.Enumerations.Warning); when Error => - return (True, LSP.Messages.Error); + return (True, LSP.Enumerations.Error); when Lint => - return (True, LSP.Messages.Hint); + return (True, LSP.Enumerations.Hint); end case; end To_Optional_DiagnosticSeverity; - ------------- - -- To_Span -- - ------------- + -------------- + -- To_Range -- + -------------- - function To_Span - (Sloc : GPR2.Source_Reference.Object) return LSP.Messages.Span + function To_Range + (Sloc : GPR2.Source_Reference.Object) return LSP.Structures.A_Range is - use type VSS.Unicode.UTF16_Code_Unit_Count; - use LSP.Types; - - Result : constant LSP.Messages.Span := + Result : constant LSP.Structures.A_Range := (if Sloc.Is_Defined and then Sloc.Has_Source_Reference then - (first => - (line => LSP.Types.Line_Number (Sloc.Line) - 1, - character => LSP.Types.UTF_16_Index -- FIXME (UTF16 index)! - (Sloc.Column) - 1), - last => - (line => LSP.Types.Line_Number (Sloc.Line) - 1, - character => LSP.Types.UTF_16_Index -- FIXME (UTF16 index)! - (Sloc.Column) - 1)) - else LSP.Messages.Empty_Span); + (start => + (line => Sloc.Line - 1, + character => Sloc.Column - 1), + -- FIXME (UTF16 index)! + an_end => + (line => Sloc.Line - 1, + character => Sloc.Column - 1)) + -- FIXME (UTF16 index)! + else LSP.Constants.Empty); + begin return Result; - end To_Span; + end To_Range; + + ------------ + -- To_URI -- + ------------ + + function To_URI + (Self : Message_Handler'Class; + Item : GPR2.Path_Name.Object) return LSP.Structures.DocumentUri + is + (VSS.Strings.Conversions.To_Virtual_String + (URIs.Conversions.From_File (Item.Value)) with null record); end LSP.GPR_Handlers; diff --git a/source/gpr/lsp-gpr_handlers.ads b/source/gpr/lsp-gpr_handlers.ads index bc9d8a496..4e071bc80 100644 --- a/source/gpr/lsp-gpr_handlers.ads +++ b/source/gpr/lsp-gpr_handlers.ads @@ -14,32 +14,36 @@ -- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy -- -- of the license. -- ------------------------------------------------------------------------------ --- + -- This package provides requests and notifications handler for GPR language. -with Ada.Containers.Hashed_Maps; +private with Ada.Containers.Hashed_Maps; -with GNATCOLL.Traces; -with GNATCOLL.VFS; +private with GNATCOLL.VFS; -with GPR2.File_Readers; -with GPR2.Path_Name; +private with GPR2.File_Readers; +private with GPR2.Path_Name; +with LSP.Client_Message_Receivers; with LSP.GPR_Documents; with LSP.GPR_Files; -with LSP.Messages.Server_Requests; -with LSP.Messages.Server_Responses; -with LSP.Server_Request_Handlers; +with LSP.Server_Message_Visitors; +private with LSP.Server_Requests; +with LSP.Server_Request_Receivers; +private with LSP.Server_Notifications; with LSP.Server_Notification_Receivers; -with LSP.Servers; -with LSP.Types; +private with LSP.Structures; +with LSP.Tracers; +with LSP.Unimplemented_Handlers; package LSP.GPR_Handlers is type Message_Handler - (Server : access LSP.Servers.Server; - Trace : GNATCOLL.Traces.Trace_Handle) is - limited new LSP.Server_Request_Handlers.Server_Request_Handler + (Sender : not null access LSP.Client_Message_Receivers + .Client_Message_Receiver'Class; + Tracer : not null LSP.Tracers.Tracer_Access) is + limited new LSP.Server_Message_Visitors.Server_Message_Visitor + and LSP.Server_Request_Receivers.Server_Request_Receiver and LSP.Server_Notification_Receivers.Server_Notification_Receiver and LSP.GPR_Documents.Document_Provider and LSP.GPR_Files.File_Provider @@ -47,361 +51,103 @@ package LSP.GPR_Handlers is -- A handler of LSP notifications and requests from GPR language -- A LSP notifications/requests handler for GPR language - function From_File - (Self : Message_Handler'Class; - File : GNATCOLL.VFS.Virtual_File) return LSP.Messages.DocumentUri; - -- Turn Virtual_File to URI - - function To_File - (Self : Message_Handler'Class; - URI : LSP.Types.LSP_URI) return GNATCOLL.VFS.Virtual_File; - -- Turn URI into Virtual_File - - function To_File - (URI : LSP.Types.LSP_URI; - Follow_Symlinks : Boolean) return GPR2.Path_Name.Object; - -- Turn URI into GPR2 path object. - private type Internal_Document_Access is access all LSP.GPR_Documents.Document; - procedure Free (Self : in out Internal_Document_Access); - -- Free all the data for the given document. - - -- Container for documents indexed by URI (diagnostics request) package Document_Maps is new Ada.Containers.Hashed_Maps (Key_Type => GNATCOLL.VFS.Virtual_File, Element_Type => Internal_Document_Access, Hash => GNATCOLL.VFS.Full_Name_Hash, Equivalent_Keys => GNATCOLL.VFS."="); + -- Container for documents indexed by URI (diagnostics request) type Internal_File_Access is access all LSP.GPR_Files.File; - -- Container for documents indexed by URI (others request) package Files_Maps is new Ada.Containers.Hashed_Maps (Key_Type => GPR2.Path_Name.Object, Element_Type => Internal_File_Access, Hash => GPR2.Path_Name.Hash, Equivalent_Keys => GPR2.Path_Name."="); + -- Container for documents indexed by URI (others request) - type Get_Symbol_Access is access procedure - (Provider : LSP.GPR_Files.File_Provider_Access; - Request : LSP.Messages.Server_Requests.Document_Symbols_Request; - Result : out LSP.Messages.Symbol_Vector); - -- textDocument/documentSymbol handler + type Has_Been_Canceled_Function is access function return Boolean; type Message_Handler - (Server : access LSP.Servers.Server; - Trace : GNATCOLL.Traces.Trace_Handle) is - limited new LSP.Server_Request_Handlers.Server_Request_Handler + (Sender : not null access LSP.Client_Message_Receivers + .Client_Message_Receiver'Class; + Tracer : not null LSP.Tracers.Tracer_Access) is + limited new LSP.Unimplemented_Handlers.Unimplemented_Handler + and LSP.Server_Message_Visitors.Server_Message_Visitor + and LSP.Server_Request_Receivers.Server_Request_Receiver and LSP.Server_Notification_Receivers.Server_Notification_Receiver and LSP.GPR_Documents.Document_Provider and LSP.GPR_Files.File_Provider with record - Client_Settings : LSP.Messages.InitializeParams; - -- Client information from the initialization request - - Open_Documents : Document_Maps.Map; + Open_Documents : Document_Maps.Map; -- The documents that are currently open - Parsed_Files : Files_Maps.Map; + Parsed_Files : Files_Maps.Map; -- open document & related files (imported, extended, aggregated) - Get_Symbols : Get_Symbol_Access; + Hierarchical_Symbols : Boolean := False; -- textDocument/documentSymbol handler. Actual value depends on -- client's capabilities. - Follow_Symlinks : Boolean := True; + Follow_Symlinks : Boolean := True; -- False if the client disables symlink following. In this case -- URIs from client should match file names reported by GPR2.Path_Name - Diagnostics_Enabled : Boolean := True; + Diagnostics_Enabled : Boolean := True; -- Whether to publish diagnostics - File_Reader : GPR2.File_Readers.File_Reader_Reference; - end record; - - overriding function On_Initialize_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Initialize_Request) - return LSP.Messages.Server_Responses.Initialize_Response; - - overriding function On_Shutdown_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Shutdown_Request) - return LSP.Messages.Server_Responses.Shutdown_Response; - - overriding function On_CodeAction_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.CodeAction_Request) - return LSP.Messages.Server_Responses.CodeAction_Response; - - overriding function On_Completion_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Completion_Request) - return LSP.Messages.Server_Responses.Completion_Response; - - overriding function On_CompletionItemResolve_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.CompletionItemResolve_Request) - return LSP.Messages.Server_Responses.CompletionItemResolve_Response; - - overriding function On_Definition_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Definition_Request) - return LSP.Messages.Server_Responses.Location_Link_Response; - - overriding function On_Declaration_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Declaration_Request) - return LSP.Messages.Server_Responses.Location_Link_Response; - - overriding function On_Implementation_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Implementation_Request) - return LSP.Messages.Server_Responses.Location_Link_Response; - - overriding function On_Type_Definition_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Type_Definition_Request) - return LSP.Messages.Server_Responses.Location_Link_Response; - - overriding function On_Highlight_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Highlight_Request) - return LSP.Messages.Server_Responses.Highlight_Response; - - overriding function On_Hover_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Hover_Request) - return LSP.Messages.Server_Responses.Hover_Response; - - overriding function On_References_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.References_Request) - return LSP.Messages.Server_Responses.Location_Response; - - overriding function On_Signature_Help_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Signature_Help_Request) - return LSP.Messages.Server_Responses.SignatureHelp_Response; - - overriding function On_Document_Links_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Document_Links_Request) - return LSP.Messages.Server_Responses.Links_Response; - - overriding function On_Document_Tokens_Full_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Document_Tokens_Full_Request) - return LSP.Messages.Server_Responses.SemanticTokens_Response; - - overriding function On_Document_Tokens_Range_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Document_Tokens_Range_Request) - return LSP.Messages.Server_Responses.SemanticTokens_Response; - - overriding function On_Document_Symbols_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Document_Symbols_Request) - return LSP.Messages.Server_Responses.Symbol_Response; - - overriding function On_Folding_Range_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Folding_Range_Request) - return LSP.Messages.Server_Responses.FoldingRange_Response; - - overriding function On_Prepare_Call_Hierarchy_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Prepare_Call_Hierarchy_Request) - return LSP.Messages.Server_Responses.PrepareCallHierarchy_Response; - - overriding function On_Incoming_Calls_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Incoming_Calls_Request) - return LSP.Messages.Server_Responses.IncomingCalls_Response; - - overriding function On_Outgoing_Calls_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Outgoing_Calls_Request) - return LSP.Messages.Server_Responses.OutgoingCalls_Response; - - overriding function On_Selection_Range_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Selection_Range_Request) - return LSP.Messages.Server_Responses.SelectionRange_Response; - - overriding function On_Rename_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Rename_Request) - return LSP.Messages.Server_Responses.Rename_Response; - - overriding function On_Prepare_Rename_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Prepare_Rename_Request) - return LSP.Messages.Server_Responses.Prepare_Rename_Response; - - overriding function On_Execute_Command_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Execute_Command_Request) - return LSP.Messages.Server_Responses.ExecuteCommand_Response; - - overriding function On_Workspace_Symbols_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Workspace_Symbols_Request) - return LSP.Messages.Server_Responses.Symbol_Response; - - overriding function On_Workspace_Execute_Command_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Workspace_Execute_Command_Request) - return LSP.Messages.Server_Responses.ExecuteCommand_Response; - - overriding function On_Workspace_Will_Create_Files_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests. - Workspace_Will_Create_Files_Request) - return LSP.Messages.Server_Responses.WillCreateFiles_Response; - - overriding procedure On_DidCreateFiles_Notification - (Self : access Message_Handler; - Value : LSP.Messages.CreateFilesParams) is null; - - overriding function On_Workspace_Will_Rename_Files_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests. - Workspace_Will_Rename_Files_Request) - return LSP.Messages.Server_Responses.WillRenameFiles_Response; + File_Reader : GPR2.File_Readers.File_Reader_Reference; - overriding procedure On_DidRenameFiles_Notification - (Self : access Message_Handler; - Value : LSP.Messages.RenameFilesParams) is null; + Is_Canceled : Has_Been_Canceled_Function; + -- Is request has been canceled + end record; - overriding function On_Workspace_Will_Delete_Files_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests. - Workspace_Will_Delete_Files_Request) - return LSP.Messages.Server_Responses.WillDeleteFiles_Response; + overriding procedure On_Server_Notification + (Self : in out Message_Handler; + Value : LSP.Server_Notifications.Server_Notification'Class); - overriding procedure On_DidDeleteFiles_Notification - (Self : access Message_Handler; - Value : LSP.Messages.DeleteFilesParams) is null; - - overriding function On_Color_Presentation_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Color_Presentation_Request) - return LSP.Messages.Server_Responses.ColorPresentation_Response; - - overriding function On_Document_Color_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Document_Color_Request) - return LSP.Messages.Server_Responses.DocumentColor_Response; - - overriding function On_ALS_Show_Dependencies_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.ALS_Show_Dependencies_Request) - return LSP.Messages.Server_Responses.ALS_ShowDependencies_Response; - - overriding function On_ALS_Source_Dirs_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.ALS_Source_Dirs_Request) - return LSP.Messages.Server_Responses.ALS_SourceDirs_Response; - - overriding function On_ALS_Debug_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.ALS_Debug_Request) - return LSP.Messages.Server_Responses.ALS_Debug_Response; - - overriding function On_Formatting_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Formatting_Request) - return LSP.Messages.Server_Responses.Formatting_Response; - - overriding function On_Range_Formatting_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.Range_Formatting_Request) - return LSP.Messages.Server_Responses.Range_Formatting_Response; - - overriding function On_On_Type_Formatting_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.On_Type_Formatting_Request) - return LSP.Messages.Server_Responses.On_Type_Formatting_Response; - - overriding procedure On_Initialized_Notification - (Self : access Message_Handler) is null; - - overriding procedure On_Exit_Notification - (Self : access Message_Handler) is null; - - overriding procedure On_DidChangeTextDocument_Notification - (Self : access Message_Handler; - Value : LSP.Messages.DidChangeTextDocumentParams); + overriding procedure On_Server_Request + (Self : in out Message_Handler; + Value : LSP.Server_Requests.Server_Request'Class); - overriding procedure On_DidCloseTextDocument_Notification - (Self : access Message_Handler; - Value : LSP.Messages.DidCloseTextDocumentParams); + overriding procedure On_Initialize_Request + (Self : in out Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InitializeParams); - overriding procedure On_DidOpenTextDocument_Notification - (Self : access Message_Handler; - Value : LSP.Messages.DidOpenTextDocumentParams); + overriding procedure On_Shutdown_Request + (Self : in out Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String); - overriding procedure On_DidSaveTextDocument_Notification - (Self : access Message_Handler; - Value : LSP.Messages.DidSaveTextDocumentParams) is null; + overriding procedure On_DocumentSymbol_Request + (Self : in out Message_Handler; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentSymbolParams); - overriding procedure On_DidChangeConfiguration_Notification - (Self : access Message_Handler; - Value : LSP.Messages.DidChangeConfigurationParams) is null; - - overriding procedure On_DidChangeWorkspaceFolders_Notification - (Self : access Message_Handler; - Value : LSP.Messages.DidChangeWorkspaceFoldersParams) is null; + overriding procedure On_DidChange_Notification + (Self : in out Message_Handler; + Value : LSP.Structures.DidChangeTextDocumentParams); - overriding procedure On_DidChangeWatchedFiles_Notification - (Self : access Message_Handler; - Value : LSP.Messages.DidChangeWatchedFilesParams) is null; + overriding procedure On_DidClose_Notification + (Self : in out Message_Handler; + Value : LSP.Structures.DidCloseTextDocumentParams); - overriding procedure On_Cancel_Notification - (Self : access Message_Handler; - Value : LSP.Messages.CancelParams) is null; - -- This is intentionally null procedure, because cancel is implemented by - -- LSP server itself. + overriding procedure On_DidOpen_Notification + (Self : in out Message_Handler; + Value : LSP.Structures.DidOpenTextDocumentParams); - overriding procedure On_SetTrace_Notification - (Self : access Message_Handler; - Value : LSP.Messages.SetTraceParams) is null; - - overriding function On_ALS_Check_Syntax_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.ALS_Check_Syntax_Request) - return LSP.Messages.Server_Responses.ALS_Check_Syntax_Response; - - overriding function On_GLS_Mains_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.GLS_Mains_Request) - return LSP.Messages.Server_Responses.GLS_Mains_Response; - - overriding function On_GLS_Executables_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.GLS_Executables_Request) - return LSP.Messages.Server_Responses.GLS_Executables_Response; - - overriding function On_GLS_Object_Dir_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.GLS_Object_Dir_Request) - return LSP.Messages.Server_Responses.GLS_Object_Dir_Response; - - overriding function On_GLS_Project_File_Request - (Self : access Message_Handler; - Request : LSP.Messages.Server_Requests.GLS_Project_File_Request) - return LSP.Messages.Server_Responses.GLS_Project_File_Response; ----------------------------------------- -- LSP.GPR_Documents.Document_Provider -- ----------------------------------------- overriding function Get_Open_Document (Self : access Message_Handler; - URI : LSP.Messages.DocumentUri; + URI : LSP.Structures.DocumentUri; Force : Boolean := False) return LSP.GPR_Documents.Document_Access; -- Return the open document for the given URI. @@ -411,8 +157,8 @@ private overriding function Get_Open_Document_Version (Self : access Message_Handler; - URI : LSP.Messages.DocumentUri) - return LSP.Messages.OptionalVersionedTextDocumentIdentifier; + URI : LSP.Structures.DocumentUri) + return LSP.Structures.OptionalVersionedTextDocumentIdentifier; -- Return the version of an open document for the given URI. -- If the document is not opened, then it returns a -- VersionedTextDocumentIdentifier with a null version. From 706b9f12b7b4f35c378bfe61c7709ec20435a028 Mon Sep 17 00:00:00 2001 From: Vadim Godunko Date: Mon, 25 Sep 2023 21:28:25 +0400 Subject: [PATCH 145/152] Enable tests. --- testsuite/gpr_lsp/get_symbols/test.yaml | 3 --- testsuite/gpr_lsp/get_symbols_hierarchy/test.yaml | 3 --- testsuite/gpr_lsp/publish_diag/test.yaml | 3 --- 3 files changed, 9 deletions(-) diff --git a/testsuite/gpr_lsp/get_symbols/test.yaml b/testsuite/gpr_lsp/get_symbols/test.yaml index d242ff582..dd06e4d51 100644 --- a/testsuite/gpr_lsp/get_symbols/test.yaml +++ b/testsuite/gpr_lsp/get_symbols/test.yaml @@ -1,4 +1 @@ title: 'textDocument/documentSymbol request (no hierarchicalDocumentSymbolSupport)' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/gpr_lsp/get_symbols_hierarchy/test.yaml b/testsuite/gpr_lsp/get_symbols_hierarchy/test.yaml index 6681866a7..f107dd526 100644 --- a/testsuite/gpr_lsp/get_symbols_hierarchy/test.yaml +++ b/testsuite/gpr_lsp/get_symbols_hierarchy/test.yaml @@ -1,4 +1 @@ title: 'textDocument/documentSymbol request using hierarchicalDocumentSymbolSupport' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] diff --git a/testsuite/gpr_lsp/publish_diag/test.yaml b/testsuite/gpr_lsp/publish_diag/test.yaml index a2487c50c..2f8fa1edd 100644 --- a/testsuite/gpr_lsp/publish_diag/test.yaml +++ b/testsuite/gpr_lsp/publish_diag/test.yaml @@ -1,4 +1 @@ title: 'invalid_project' -# Skip till 3.17 ready -skip: - - ['XFAIL', 'True'] From 39c8799260864c8951ef366dd3c0442377467899 Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Mon, 25 Sep 2023 15:02:20 +0300 Subject: [PATCH 146/152] Introduce Output_Stream implemented over the GNATCOLL trace. --- source/ada/lsp-gnatcoll_trace_streams.adb | 91 +++++++++++++++++++++++ source/ada/lsp-gnatcoll_trace_streams.ads | 70 +++++++++++++++++ 2 files changed, 161 insertions(+) create mode 100644 source/ada/lsp-gnatcoll_trace_streams.adb create mode 100644 source/ada/lsp-gnatcoll_trace_streams.ads diff --git a/source/ada/lsp-gnatcoll_trace_streams.adb b/source/ada/lsp-gnatcoll_trace_streams.adb new file mode 100644 index 000000000..2d29d29e8 --- /dev/null +++ b/source/ada/lsp-gnatcoll_trace_streams.adb @@ -0,0 +1,91 @@ +------------------------------------------------------------------------------ +-- Language Server Protocol -- +-- -- +-- Copyright (C) 2022-2023, AdaCore -- +-- -- +-- This is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 3, or (at your option) any later ver- -- +-- sion. This software is distributed in the hope that it will be useful, -- +-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- -- +-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -- +-- License for more details. You should have received a copy of the GNU -- +-- General Public License distributed with this software; see file -- +-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy -- +-- of the license. -- +------------------------------------------------------------------------------ + +with VSS.Strings.Conversions; + +package body LSP.GNATCOLL_Trace_Streams is + + ---------------- + -- Initialize -- + ---------------- + + procedure Initialize + (Self : in out Output_Text_Stream'Class; + Trace : GNATCOLL.Traces.Trace_Handle) is + begin + Self.Trace := Trace; + end Initialize; + + -------------- + -- New_Line -- + -------------- + + overriding procedure New_Line + (Self : in out Output_Text_Stream; + Success : in out Boolean) is + begin + if Success then + Self.Trace.Trace + (VSS.Strings.Conversions.To_UTF_8_String (Self.Incomplete)); + Self.Incomplete.Clear; + end if; + end New_Line; + + --------- + -- Put -- + --------- + + overriding procedure Put + (Self : in out Output_Text_Stream; + Item : VSS.Characters.Virtual_Character; + Success : in out Boolean) is + begin + if Success then + Self.Incomplete.Append (Item); + end if; + end Put; + + --------- + -- Put -- + --------- + + overriding procedure Put + (Self : in out Output_Text_Stream; + Item : VSS.Strings.Virtual_String; + Success : in out Boolean) is + begin + if Success then + Self.Incomplete.Append (Item); + end if; + end Put; + + -------------- + -- Put_Line -- + -------------- + + overriding procedure Put_Line + (Self : in out Output_Text_Stream; + Item : VSS.Strings.Virtual_String; + Success : in out Boolean) is + begin + if Success then + Self.Incomplete.Append (Item); + Self.New_Line (Success); + end if; + end Put_Line; + +end LSP.GNATCOLL_Trace_Streams; diff --git a/source/ada/lsp-gnatcoll_trace_streams.ads b/source/ada/lsp-gnatcoll_trace_streams.ads new file mode 100644 index 000000000..2d7fca8a5 --- /dev/null +++ b/source/ada/lsp-gnatcoll_trace_streams.ads @@ -0,0 +1,70 @@ +------------------------------------------------------------------------------ +-- Language Server Protocol -- +-- -- +-- Copyright (C) 2022-2023, AdaCore -- +-- -- +-- This is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 3, or (at your option) any later ver- -- +-- sion. This software is distributed in the hope that it will be useful, -- +-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- -- +-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -- +-- License for more details. You should have received a copy of the GNU -- +-- General Public License distributed with this software; see file -- +-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy -- +-- of the license. -- +------------------------------------------------------------------------------ + +with GNATCOLL.Traces; + +with VSS.Characters; +with VSS.Strings; +with VSS.Text_Streams; + +package LSP.GNATCOLL_Trace_Streams is + + type Output_Text_Stream is limited + new VSS.Text_Streams.Output_Text_Stream with private; + -- Implementation of the text stream interface over GNATCOLL.Traces + + procedure Initialize + (Self : in out Output_Text_Stream'Class; + Trace : GNATCOLL.Traces.Trace_Handle); + -- Server_Trace - main trace for the LSP. + +private + + type Output_Text_Stream is limited + new VSS.Text_Streams.Output_Text_Stream with + record + Incomplete : VSS.Strings.Virtual_String; + Trace : GNATCOLL.Traces.Trace_Handle; + end record; + + overriding procedure Put + (Self : in out Output_Text_Stream; + Item : VSS.Characters.Virtual_Character; + Success : in out Boolean); + + overriding procedure Put + (Self : in out Output_Text_Stream; + Item : VSS.Strings.Virtual_String; + Success : in out Boolean); + + overriding procedure Put_Line + (Self : in out Output_Text_Stream; + Item : VSS.Strings.Virtual_String; + Success : in out Boolean); + + overriding procedure New_Line + (Self : in out Output_Text_Stream; + Success : in out Boolean); + + overriding function Has_Error (Self : Output_Text_Stream) return Boolean is + (False); + + overriding function Error_Message + (Self : Output_Text_Stream) return VSS.Strings.Virtual_String + is (VSS.Strings.Empty_Virtual_String); + +end LSP.GNATCOLL_Trace_Streams; From 2e2a2958bf27c0c88b8b446f71d16f19d6a97dcc Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Tue, 26 Sep 2023 17:41:17 +0300 Subject: [PATCH 147/152] Make LSP_Gen create trivial message loggers We can use them to derive customized loggers. Refs #1170 --- source/lsp_gen/lsp_gen-notifications.adb | 132 +++++++++++++++++ source/lsp_gen/lsp_gen-requests.adb | 150 ++++++++++++++++++++ source/lsp_gen/lsp_gen-responses.adb | 171 +++++++++++++++++++++++ 3 files changed, 453 insertions(+) diff --git a/source/lsp_gen/lsp_gen-notifications.adb b/source/lsp_gen/lsp_gen-notifications.adb index 273dff762..9b93ebb6c 100644 --- a/source/lsp_gen/lsp_gen-notifications.adb +++ b/source/lsp_gen/lsp_gen-notifications.adb @@ -37,6 +37,10 @@ package body LSP_Gen.Notifications is (Model : LSP_Gen.Meta_Models.Meta_Model; From : LSP_Gen.Configurations.Message_Direction); + procedure Write_Loggers + (Model : LSP_Gen.Meta_Models.Meta_Model; + From : LSP_Gen.Configurations.Message_Direction); + procedure Write_Notification_Types (Model : LSP_Gen.Meta_Models.Meta_Model; From : LSP_Gen.Configurations.Message_Direction); @@ -50,6 +54,131 @@ package body LSP_Gen.Notifications is when LSP_Gen.Configurations.From_Client => "Server", when LSP_Gen.Configurations.From_Server => "Client")); + ------------------- + -- Write_Loggers -- + ------------------- + + procedure Write_Loggers + (Model : LSP_Gen.Meta_Models.Meta_Model; + From : LSP_Gen.Configurations.Message_Direction) + is + use all type LSP_Gen.Configurations.Message_Direction; + + Kind : constant VSS.Strings.Virtual_String := Prefix (From); + Name : constant VSS.Strings.Virtual_String := + Kind & "_Notification_Logger"; + begin + Put_Lines (Model.License_Header, "-- "); + New_Line; + + if From = From_Both then + Put_Line ("with VSS.Text_Streams;"); + else + Put_Line ("with LSP.Base_Notification_Loggers;"); + end if; + + Put_Line ("with LSP.Structures;"); + Put ("with LSP."); + Put (Kind); + Put_Line ("_Notification_Receivers;"); + New_Line; + Put ("package LSP."); + Put (Name); + Put_Line ("s is"); + Put_Line ("pragma Preelaborate;"); + New_Line; + Put ("type "); + Put_Line (Name); + + if From = From_Both then + Put ("(Output : access VSS.Text_Streams"); + Put_Line (".Output_Text_Stream'Class)"); + Put ("is new "); + else + Put ("is new LSP.Base_Notification_Loggers.Base_Notification_Logger"); + Put (" and "); + end if; + + Put ("LSP."); + Put (Kind); + Put ("_Notification_Receivers."); + Put (Kind); + Put_Line ("_Notification_Receiver"); + Put_Line ("with null record;"); + New_Line; + + for J of Model.Notifications loop + if Model.Message_Direction (J) = From then + Put ("overriding procedure On_"); + Put (Model.Message_Name (J)); + Put_Line ("_Notification"); + Put ("(Self : in out "); + Put (Name); + + if Model.Notification (J).params.Is_Set then + Put_Line (";"); + Put ("Value : LSP.Structures."); + Put (Model.Notification (J).params.Value.Union.reference.name); + end if; + + Put_Line (");"); + New_Line; + end if; + end loop; + + Put_Line ("end;"); + + New_Line; + Put_Lines (Model.License_Header, "-- "); + New_Line; + + Put_Line ("with VSS.Strings;"); + New_Line; + + Put ("package body LSP."); + Put (Name); + Put_Line ("s is"); + New_Line; + + for J of Model.Notifications loop + if Model.Message_Direction (J) = From then + Put ("overriding procedure On_"); + Put (Model.Message_Name (J)); + Put_Line ("_Notification"); + Put ("(Self : in out "); + Put (Name); + + if Model.Notification (J).params.Is_Set then + Put_Line (";"); + Put ("Value : LSP.Structures."); + Put (Model.Notification (J).params.Value.Union.reference.name); + end if; + + Put_Line (")"); + Put_Line ("is"); + Put_Line ("Ok : Boolean := False;"); + Put_Line ("begin"); + Put ("Self.Output.Put (""'"); + Put (J); + Put_Line ("'"", Ok);"); + + if Model.Notification (J).params.Is_Set then + Put_Line ("Self.Output.Put ("" Params : "", Ok);"); + + Put ("Self.Output.Put (VSS.Strings.To_Virtual_String"); + Put_Line (" (Value'Wide_Wide_Image), Ok);"); + end if; + + Put ("Self.Output.New_Line (Ok);"); + Put_Line ("end;"); + New_Line; + end if; + end loop; + + Put_Line ("end;"); + + end Write_Loggers; + ------------------------------ -- Write_Notification_Types -- ------------------------------ @@ -372,6 +501,9 @@ package body LSP_Gen.Notifications is Write_Receivers (Model, From_Server); Write_Notification_Types (Model, From_Client); Write_Notification_Types (Model, From_Server); + Write_Loggers (Model, From_Server); + Write_Loggers (Model, From_Client); + Write_Loggers (Model, From_Both); end Write; ------------------- diff --git a/source/lsp_gen/lsp_gen-requests.adb b/source/lsp_gen/lsp_gen-requests.adb index 2ed8779fb..fbf4afa37 100644 --- a/source/lsp_gen/lsp_gen-requests.adb +++ b/source/lsp_gen/lsp_gen-requests.adb @@ -39,6 +39,10 @@ package body LSP_Gen.Requests is (Model : LSP_Gen.Meta_Models.Meta_Model; From : LSP_Gen.Configurations.Message_Direction); + procedure Write_Loggers + (Model : LSP_Gen.Meta_Models.Meta_Model; + From : LSP_Gen.Configurations.Message_Direction); + function Prefix (From : LSP_Gen.Configurations.Message_Direction) return VSS.Strings.Virtual_String is @@ -48,6 +52,150 @@ package body LSP_Gen.Requests is when LSP_Gen.Configurations.From_Client => "Server", when LSP_Gen.Configurations.From_Server => "Client")); + ------------------- + -- Write_Loggers -- + ------------------- + + procedure Write_Loggers + (Model : LSP_Gen.Meta_Models.Meta_Model; + From : LSP_Gen.Configurations.Message_Direction) + is + use all type LSP_Gen.Configurations.Message_Direction; + + Kind : constant VSS.Strings.Virtual_String := Prefix (From); + Name : constant VSS.Strings.Virtual_String := + Kind & "_Request_Logger"; + begin + Put_Lines (Model.License_Header, "-- "); + New_Line; + Put_Line ("with LSP.Structures;"); + Put_Line ("with VSS.Text_Streams;"); + Put ("with LSP."); + Put (Kind); + Put_Line ("_Request_Receivers;"); + New_Line; + Put ("package LSP."); + Put (Name); + Put_Line ("s is"); + Put_Line ("pragma Preelaborate;"); + New_Line; + Put ("type "); + Put_Line (Name); + + Put ("(Output : access VSS.Text_Streams"); + Put_Line (".Output_Text_Stream'Class)"); + Put ("is new "); + + Put ("LSP."); + Put (Kind); + Put ("_Request_Receivers."); + Put (Kind); + Put_Line ("_Request_Receiver"); + Put_Line ("with null record;"); + New_Line; + + for J of Model.Requests loop + if Model.Message_Direction (J) = From then + Put ("overriding procedure On_"); + Put (Model.Message_Name (J)); + Put_Line ("_Request"); + Put ("(Self : in out "); + Put (Name); + Put_Line (";"); + Put_Line ("Id : LSP.Structures.Integer_Or_Virtual_String"); + + if Model.Request (J).params.Is_Set then + Put_Line (";"); + Put ("Value : LSP.Structures."); + Put (Param_Type (Model, J)); + end if; + + Put_Line (");"); + New_Line; + end if; + end loop; + + Put_Line ("procedure Put_Id"); + Put (" (Self : in out "); + Put (Name); + Put_Line ("'Class;"); + Put_Line (" Id : LSP.Structures.Integer_Or_Virtual_String;"); + Put_Line (" Ok : in out Boolean);"); + New_Line; + + Put_Line ("end;"); + + New_Line; + Put_Lines (Model.License_Header, "-- "); + + New_Line; + Put_Line ("with VSS.Strings;"); + New_Line; + Put ("package body LSP."); + Put (Name); + Put_Line ("s is"); + New_Line; + + for J of Model.Requests + when Model.Message_Direction (J) = From + loop + Put ("overriding procedure On_"); + Put (Model.Message_Name (J)); + Put_Line ("_Request"); + Put ("(Self : in out "); + Put (Name); + Put_Line (";"); + Put_Line ("Id : LSP.Structures.Integer_Or_Virtual_String"); + + if Model.Request (J).params.Is_Set then + Put_Line (";"); + Put ("Value : LSP.Structures."); + Put (Param_Type (Model, J)); + end if; + + Put_Line (")"); + Put_Line ("is"); + Put_Line ("Ok : Boolean := False;"); + Put_Line ("begin"); + Put ("Self.Output.Put (""'"); + Put (J); + Put_Line ("'"", Ok);"); + Put_Line ("Self.Put_Id (Id, Ok);"); + + if Model.Request (J).params.Is_Set then + Put_Line ("Self.Output.Put ("" Params : "", Ok);"); + + Put ("Self.Output.Put (VSS.Strings.To_Virtual_String"); + Put_Line (" (Value'Wide_Wide_Image), Ok);"); + end if; + + Put ("Self.Output.New_Line (Ok);"); + Put_Line ("end;"); + New_Line; + end loop; + + Put_Line ("procedure Put_Id"); + Put (" (Self : in out "); + Put (Name); + Put_Line ("'Class;"); + Put_Line ("Id : LSP.Structures.Integer_Or_Virtual_String;"); + Put_Line ("Ok : in out Boolean) is"); + Put_Line ("begin"); + Put_Line ("Self.Output.Put ("" Id="", Ok);"); + New_Line; + Put_Line ("if Id.Is_Integer then"); + Put ("Self.Output.Put (VSS.Strings.To_Virtual_String"); + Put_Line (" (Id.Integer'Wide_Wide_Image), Ok);"); + Put_Line ("else"); + Put_Line ("Self.Output.Put (Id.Virtual_String, Ok);"); + Put_Line ("end if;"); + Put_Line ("end Put_Id;"); + New_Line; + + Put_Line ("end;"); + + end Write_Loggers; + ------------------------------ -- Write_Request_Types -- ------------------------------ @@ -369,6 +517,8 @@ package body LSP_Gen.Requests is Write_Receivers (Model, From_Server); Write_Request_Types (Model, From_Client); Write_Request_Types (Model, From_Server); + Write_Loggers (Model, From_Server); + Write_Loggers (Model, From_Client); end Write; ------------------- diff --git a/source/lsp_gen/lsp_gen-responses.adb b/source/lsp_gen/lsp_gen-responses.adb index 5c477c993..cd45532d4 100644 --- a/source/lsp_gen/lsp_gen-responses.adb +++ b/source/lsp_gen/lsp_gen-responses.adb @@ -43,6 +43,11 @@ package body LSP_Gen.Responses is From : LSP_Gen.Configurations.Message_Direction; Done : LSP_Gen.Dependencies.Dependency_Map); + procedure Write_Loggers + (Model : LSP_Gen.Meta_Models.Meta_Model; + Done : LSP_Gen.Dependencies.Dependency_Map; + From : LSP_Gen.Configurations.Message_Direction); + function Prefix (From : LSP_Gen.Configurations.Message_Direction) return VSS.Strings.Virtual_String is @@ -69,6 +74,170 @@ package body LSP_Gen.Responses is return LSP_Gen.Dependencies.Dependency_Maps.Element (Found).Short_Name; end Result_Type; + ------------------- + -- Write_Loggers -- + ------------------- + + procedure Write_Loggers + (Model : LSP_Gen.Meta_Models.Meta_Model; + Done : LSP_Gen.Dependencies.Dependency_Map; + From : LSP_Gen.Configurations.Message_Direction) + is + use all type LSP_Gen.Configurations.Message_Direction; + + Kind : constant VSS.Strings.Virtual_String := Prefix (From); + Name : constant VSS.Strings.Virtual_String := + Kind & "_Response_Logger"; + begin + Put_Lines (Model.License_Header, "-- "); + New_Line; + Put_Line ("with VSS.Text_Streams;"); + New_Line; + Put_Line ("with LSP.Errors;"); + Put_Line ("with LSP.Structures;"); + Put ("with LSP."); + Put (Kind); + Put_Line ("_Response_Receivers;"); + New_Line; + Put ("package LSP."); + Put (Name); + Put_Line ("s is"); + Put_Line ("pragma Preelaborate;"); + New_Line; + Put ("type "); + Put_Line (Name); + + Put ("(Output : access VSS.Text_Streams"); + Put_Line (".Output_Text_Stream'Class)"); + Put ("is new "); + + Put ("LSP."); + Put (Kind); + Put ("_Response_Receivers."); + Put (Kind); + Put_Line ("_Response_Receiver"); + Put_Line ("with null record;"); + New_Line; + + for J of Model.Requests loop + if Model.Message_Direction (J) = From then + Put ("overriding procedure On_"); + Put (Model.Message_Name (J)); + Put_Line ("_Response"); + Put ("(Self : in out "); + Put (Name); + Put_Line (";"); + Put_Line ("Id : LSP.Structures.Integer_Or_Virtual_String;"); + Put ("Value : LSP.Structures."); + Put (Result_Type (Model, Done, J)); + + Put_Line (");"); + New_Line; + end if; + end loop; + + Put_Line ("overriding procedure On_Error_Response"); + Put ("(Self : in out "); + Put (Name); + Put_Line (";"); + Put_Line ("Id : LSP.Structures.Integer_Or_Virtual_String;"); + Put_Line ("Value : LSP.Errors.ResponseError);"); + New_Line; + + Put_Line ("procedure Put_Id"); + Put (" (Self : in out "); + Put (Name); + Put_Line ("'Class;"); + Put_Line (" Id : LSP.Structures.Integer_Or_Virtual_String;"); + Put_Line (" Ok : in out Boolean);"); + New_Line; + + Put_Line ("end;"); + + Put_Lines (Model.License_Header, "-- "); + New_Line; + Put_Line ("with VSS.Strings;"); + New_Line; + Put ("package body LSP."); + Put (Name); + Put_Line ("s is"); + New_Line; + + for J of Model.Requests loop + if Model.Message_Direction (J) = From then + Put ("overriding procedure On_"); + Put (Model.Message_Name (J)); + Put_Line ("_Response"); + Put ("(Self : in out "); + Put (Name); + Put_Line (";"); + Put_Line ("Id : LSP.Structures.Integer_Or_Virtual_String"); + + Put_Line (";"); + Put ("Value : LSP.Structures."); + Put (Result_Type (Model, Done, J)); + + Put_Line (")"); + Put_Line ("is"); + Put_Line ("Ok : Boolean := False;"); + Put_Line ("begin"); + Put ("Self.Output.Put (""'"); + Put (J); + Put_Line ("'"", Ok);"); + Put_Line ("Self.Put_Id (Id, Ok);"); + + Put_Line ("Self.Output.Put ("" result : "", Ok);"); + Put ("Self.Output.Put (VSS.Strings.To_Virtual_String"); + Put_Line (" (Value'Wide_Wide_Image), Ok);"); + + Put ("Self.Output.New_Line (Ok);"); + Put_Line ("end;"); + New_Line; + end if; + end loop; + + Put_Line ("overriding procedure On_Error_Response"); + Put ("(Self : in out "); + Put (Name); + Put_Line (";"); + Put_Line ("Id : LSP.Structures.Integer_Or_Virtual_String;"); + Put_Line ("Value : LSP.Errors.ResponseError)"); + Put_Line ("is"); + Put_Line ("Ok : Boolean := False;"); + Put_Line ("begin"); + Put ("Self.Output.Put (""'Error response'"", Ok);"); + Put_Line ("Self.Put_Id (Id, Ok);"); + + Put_Line ("Self.Output.Put ("" error : "", Ok);"); + Put ("Self.Output.Put (VSS.Strings.To_Virtual_String"); + Put_Line (" (Value'Wide_Wide_Image), Ok);"); + + Put ("Self.Output.New_Line (Ok);"); + Put_Line ("end;"); + New_Line; + + Put_Line ("procedure Put_Id"); + Put (" (Self : in out "); + Put (Name); + Put_Line ("'Class;"); + Put_Line ("Id : LSP.Structures.Integer_Or_Virtual_String;"); + Put_Line ("Ok : in out Boolean) is"); + Put_Line ("begin"); + Put_Line ("Self.Output.Put ("" Id="", Ok);"); + New_Line; + Put_Line ("if Id.Is_Integer then"); + Put ("Self.Output.Put (VSS.Strings.To_Virtual_String"); + Put_Line (" (Id.Integer'Wide_Wide_Image), Ok);"); + Put_Line ("else"); + Put_Line ("Self.Output.Put (Id.Virtual_String, Ok);"); + Put_Line ("end if;"); + Put_Line ("end Put_Id;"); + New_Line; + + Put_Line ("end;"); + + end Write_Loggers; + -------------------------- -- Write_Response_Types -- -------------------------- @@ -361,6 +530,8 @@ package body LSP_Gen.Responses is Write_Receivers (Model, Done, From_Server); Write_Response_Types (Model, From_Client, Done); Write_Response_Types (Model, From_Server, Done); + Write_Loggers (Model, Done, From_Server); + Write_Loggers (Model, Done, From_Client); end Write; ------------------- From e709d67061ccfcd03fee2fe753890af38e52f220 Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Tue, 26 Sep 2023 17:44:11 +0300 Subject: [PATCH 148/152] Regenerate LSP 3.17 code after changes in LSP_Gen. Refs #1170 --- .../lsp-base_notification_loggers.adb | 37 + .../lsp-base_notification_loggers.ads | 29 + .../lsp-client_notification_loggers.adb | 73 ++ .../lsp-client_notification_loggers.ads | 40 + .../generated/lsp-client_request_loggers.adb | 186 +++++ .../generated/lsp-client_request_loggers.ads | 84 ++ .../generated/lsp-client_response_loggers.adb | 770 ++++++++++++++++++ .../generated/lsp-client_response_loggers.ads | 292 +++++++ .../lsp-server_notification_loggers.adb | 237 ++++++ .../lsp-server_notification_loggers.ads | 96 +++ .../generated/lsp-server_request_loggers.adb | 752 +++++++++++++++++ .../generated/lsp-server_request_loggers.ads | 284 +++++++ .../generated/lsp-server_response_loggers.adb | 224 +++++ .../generated/lsp-server_response_loggers.ads | 97 +++ 14 files changed, 3201 insertions(+) create mode 100644 source/lsp_3.17/generated/lsp-base_notification_loggers.adb create mode 100644 source/lsp_3.17/generated/lsp-base_notification_loggers.ads create mode 100644 source/lsp_3.17/generated/lsp-client_notification_loggers.adb create mode 100644 source/lsp_3.17/generated/lsp-client_notification_loggers.ads create mode 100644 source/lsp_3.17/generated/lsp-client_request_loggers.adb create mode 100644 source/lsp_3.17/generated/lsp-client_request_loggers.ads create mode 100644 source/lsp_3.17/generated/lsp-client_response_loggers.adb create mode 100644 source/lsp_3.17/generated/lsp-client_response_loggers.ads create mode 100644 source/lsp_3.17/generated/lsp-server_notification_loggers.adb create mode 100644 source/lsp_3.17/generated/lsp-server_notification_loggers.ads create mode 100644 source/lsp_3.17/generated/lsp-server_request_loggers.adb create mode 100644 source/lsp_3.17/generated/lsp-server_request_loggers.ads create mode 100644 source/lsp_3.17/generated/lsp-server_response_loggers.adb create mode 100644 source/lsp_3.17/generated/lsp-server_response_loggers.ads diff --git a/source/lsp_3.17/generated/lsp-base_notification_loggers.adb b/source/lsp_3.17/generated/lsp-base_notification_loggers.adb new file mode 100644 index 000000000..1248f8945 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-base_notification_loggers.adb @@ -0,0 +1,37 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- + +with VSS.Strings; + +package body LSP.Base_Notification_Loggers is + + overriding procedure On_CancelRequest_Notification + (Self : in out Base_Notification_Logger; + Value : LSP.Structures.CancelParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'$/cancelRequest'", Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_CancelRequest_Notification; + + overriding procedure On_Progress_Notification + (Self : in out Base_Notification_Logger; + Value : LSP.Structures.ProgressParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'$/progress'", Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_Progress_Notification; + +end LSP.Base_Notification_Loggers; diff --git a/source/lsp_3.17/generated/lsp-base_notification_loggers.ads b/source/lsp_3.17/generated/lsp-base_notification_loggers.ads new file mode 100644 index 000000000..7f22bc691 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-base_notification_loggers.ads @@ -0,0 +1,29 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- + +with VSS.Text_Streams; +with LSP.Structures; +with LSP.Base_Notification_Receivers; + +package LSP.Base_Notification_Loggers is + pragma Preelaborate; + + type Base_Notification_Logger + (Output : access VSS.Text_Streams.Output_Text_Stream'Class) is + new LSP.Base_Notification_Receivers.Base_Notification_Receiver with + null record; + + overriding procedure On_CancelRequest_Notification + (Self : in out Base_Notification_Logger; + Value : LSP.Structures.CancelParams); + + overriding procedure On_Progress_Notification + (Self : in out Base_Notification_Logger; + Value : LSP.Structures.ProgressParams); + +end LSP.Base_Notification_Loggers; diff --git a/source/lsp_3.17/generated/lsp-client_notification_loggers.adb b/source/lsp_3.17/generated/lsp-client_notification_loggers.adb new file mode 100644 index 000000000..94f795aea --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_notification_loggers.adb @@ -0,0 +1,73 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- + +with VSS.Strings; + +package body LSP.Client_Notification_Loggers is + + overriding procedure On_LogTrace_Notification + (Self : in out Client_Notification_Logger; + Value : LSP.Structures.LogTraceParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'$/logTrace'", Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_LogTrace_Notification; + + overriding procedure On_Event_Notification + (Self : in out Client_Notification_Logger; + Value : LSP.Structures.LSPAny) is + Ok : Boolean := False; + begin + Self.Output.Put ("'telemetry/event'", Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_Event_Notification; + + overriding procedure On_PublishDiagnostics_Notification + (Self : in out Client_Notification_Logger; + Value : LSP.Structures.PublishDiagnosticsParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'textDocument/publishDiagnostics'", Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_PublishDiagnostics_Notification; + + overriding procedure On_LogMessage_Notification + (Self : in out Client_Notification_Logger; + Value : LSP.Structures.LogMessageParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'window/logMessage'", Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_LogMessage_Notification; + + overriding procedure On_ShowMessage_Notification + (Self : in out Client_Notification_Logger; + Value : LSP.Structures.ShowMessageParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'window/showMessage'", Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_ShowMessage_Notification; + +end LSP.Client_Notification_Loggers; diff --git a/source/lsp_3.17/generated/lsp-client_notification_loggers.ads b/source/lsp_3.17/generated/lsp-client_notification_loggers.ads new file mode 100644 index 000000000..75d36714b --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_notification_loggers.ads @@ -0,0 +1,40 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- + +with LSP.Base_Notification_Loggers; +with LSP.Structures; +with LSP.Client_Notification_Receivers; + +package LSP.Client_Notification_Loggers is + pragma Preelaborate; + + type Client_Notification_Logger is + new LSP.Base_Notification_Loggers.Base_Notification_Logger and + LSP.Client_Notification_Receivers.Client_Notification_Receiver with + null record; + + overriding procedure On_LogTrace_Notification + (Self : in out Client_Notification_Logger; + Value : LSP.Structures.LogTraceParams); + + overriding procedure On_Event_Notification + (Self : in out Client_Notification_Logger; Value : LSP.Structures.LSPAny); + + overriding procedure On_PublishDiagnostics_Notification + (Self : in out Client_Notification_Logger; + Value : LSP.Structures.PublishDiagnosticsParams); + + overriding procedure On_LogMessage_Notification + (Self : in out Client_Notification_Logger; + Value : LSP.Structures.LogMessageParams); + + overriding procedure On_ShowMessage_Notification + (Self : in out Client_Notification_Logger; + Value : LSP.Structures.ShowMessageParams); + +end LSP.Client_Notification_Loggers; diff --git a/source/lsp_3.17/generated/lsp-client_request_loggers.adb b/source/lsp_3.17/generated/lsp-client_request_loggers.adb new file mode 100644 index 000000000..c9de7b745 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_request_loggers.adb @@ -0,0 +1,186 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- + +with VSS.Strings; + +package body LSP.Client_Request_Loggers is + + overriding procedure On_RegisterCapability_Request + (Self : in out Client_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.RegistrationParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'client/registerCapability'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_RegisterCapability_Request; + + overriding procedure On_UnregisterCapability_Request + (Self : in out Client_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.UnregistrationParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'client/unregisterCapability'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_UnregisterCapability_Request; + + overriding procedure On_ShowDocument_Request + (Self : in out Client_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ShowDocumentParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'window/showDocument'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_ShowDocument_Request; + + overriding procedure On_ShowMessageRequest_Request + (Self : in out Client_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ShowMessageRequestParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'window/showMessageRequest'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_ShowMessageRequest_Request; + + overriding procedure On_Progress_Create_Request + (Self : in out Client_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkDoneProgressCreateParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'window/workDoneProgress/create'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_Progress_Create_Request; + + overriding procedure On_ApplyEdit_Request + (Self : in out Client_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ApplyWorkspaceEditParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'workspace/applyEdit'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_ApplyEdit_Request; + + overriding procedure On_Code_Lens_Refresh_Request + (Self : in out Client_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String) is + Ok : Boolean := False; + begin + Self.Output.Put ("'workspace/codeLens/refresh'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.New_Line (Ok); + end On_Code_Lens_Refresh_Request; + + overriding procedure On_Configuration_Request + (Self : in out Client_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ConfigurationParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'workspace/configuration'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_Configuration_Request; + + overriding procedure On_Diagnostic_Refresh_Request + (Self : in out Client_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String) is + Ok : Boolean := False; + begin + Self.Output.Put ("'workspace/diagnostic/refresh'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.New_Line (Ok); + end On_Diagnostic_Refresh_Request; + + overriding procedure On_Inlay_Refresh_Request + (Self : in out Client_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String) is + Ok : Boolean := False; + begin + Self.Output.Put ("'workspace/inlayHint/refresh'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.New_Line (Ok); + end On_Inlay_Refresh_Request; + + overriding procedure On_Inline_Refresh_Request + (Self : in out Client_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String) is + Ok : Boolean := False; + begin + Self.Output.Put ("'workspace/inlineValue/refresh'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.New_Line (Ok); + end On_Inline_Refresh_Request; + + overriding procedure On_Tokens_Refresh_Request + (Self : in out Client_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String) is + Ok : Boolean := False; + begin + Self.Output.Put ("'workspace/semanticTokens/refresh'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.New_Line (Ok); + end On_Tokens_Refresh_Request; + + overriding procedure On_WorkspaceFolders_Request + (Self : in out Client_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String) is + Ok : Boolean := False; + begin + Self.Output.Put ("'workspace/workspaceFolders'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.New_Line (Ok); + end On_WorkspaceFolders_Request; + + procedure Put_Id + (Self : in out Client_Request_Logger'Class; + Id : LSP.Structures.Integer_Or_Virtual_String; + Ok : in out Boolean) is + begin + Self.Output.Put (" Id=", Ok); + + if Id.Is_Integer then + Self.Output.Put + (VSS.Strings.To_Virtual_String (Id.Integer'Wide_Wide_Image), Ok); + else + Self.Output.Put (Id.Virtual_String, Ok); + end if; + end Put_Id; + +end LSP.Client_Request_Loggers; diff --git a/source/lsp_3.17/generated/lsp-client_request_loggers.ads b/source/lsp_3.17/generated/lsp-client_request_loggers.ads new file mode 100644 index 000000000..43308118a --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_request_loggers.ads @@ -0,0 +1,84 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- + +with LSP.Structures; +with VSS.Text_Streams; +with LSP.Client_Request_Receivers; + +package LSP.Client_Request_Loggers is + pragma Preelaborate; + + type Client_Request_Logger + (Output : access VSS.Text_Streams.Output_Text_Stream'Class) is + new LSP.Client_Request_Receivers.Client_Request_Receiver with null record; + + overriding procedure On_RegisterCapability_Request + (Self : in out Client_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.RegistrationParams); + + overriding procedure On_UnregisterCapability_Request + (Self : in out Client_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.UnregistrationParams); + + overriding procedure On_ShowDocument_Request + (Self : in out Client_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ShowDocumentParams); + + overriding procedure On_ShowMessageRequest_Request + (Self : in out Client_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ShowMessageRequestParams); + + overriding procedure On_Progress_Create_Request + (Self : in out Client_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkDoneProgressCreateParams); + + overriding procedure On_ApplyEdit_Request + (Self : in out Client_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ApplyWorkspaceEditParams); + + overriding procedure On_Code_Lens_Refresh_Request + (Self : in out Client_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String); + + overriding procedure On_Configuration_Request + (Self : in out Client_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ConfigurationParams); + + overriding procedure On_Diagnostic_Refresh_Request + (Self : in out Client_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String); + + overriding procedure On_Inlay_Refresh_Request + (Self : in out Client_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String); + + overriding procedure On_Inline_Refresh_Request + (Self : in out Client_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String); + + overriding procedure On_Tokens_Refresh_Request + (Self : in out Client_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String); + + overriding procedure On_WorkspaceFolders_Request + (Self : in out Client_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String); + + procedure Put_Id + (Self : in out Client_Request_Logger'Class; + Id : LSP.Structures.Integer_Or_Virtual_String; + Ok : in out Boolean); + +end LSP.Client_Request_Loggers; diff --git a/source/lsp_3.17/generated/lsp-client_response_loggers.adb b/source/lsp_3.17/generated/lsp-client_response_loggers.adb new file mode 100644 index 000000000..2cbb2dfbb --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_response_loggers.adb @@ -0,0 +1,770 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- + +with VSS.Strings; + +package body LSP.Client_Response_Loggers is + + overriding procedure On_AlsCheckSyntax_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.AlsCheckSyntaxResult) is + Ok : Boolean := False; + begin + Self.Output.Put ("'$/alsCheckSyntax'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" result : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_AlsCheckSyntax_Response; + + overriding procedure On_IncomingCalls_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CallHierarchyIncomingCall_Vector_Or_Null) is + Ok : Boolean := False; + begin + Self.Output.Put ("'callHierarchy/incomingCalls'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" result : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_IncomingCalls_Response; + + overriding procedure On_OutgoingCalls_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CallHierarchyOutgoingCall_Vector_Or_Null) is + Ok : Boolean := False; + begin + Self.Output.Put ("'callHierarchy/outgoingCalls'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" result : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_OutgoingCalls_Response; + + overriding procedure On_Code_Action_Resolve_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CodeAction) is + Ok : Boolean := False; + begin + Self.Output.Put ("'codeAction/resolve'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" result : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_Code_Action_Resolve_Response; + + overriding procedure On_Code_Lens_Resolve_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CodeLens) is + Ok : Boolean := False; + begin + Self.Output.Put ("'codeLens/resolve'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" result : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_Code_Lens_Resolve_Response; + + overriding procedure On_Completion_Resolve_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CompletionItem) is + Ok : Boolean := False; + begin + Self.Output.Put ("'completionItem/resolve'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" result : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_Completion_Resolve_Response; + + overriding procedure On_Link_Resolve_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentLink) is + Ok : Boolean := False; + begin + Self.Output.Put ("'documentLink/resolve'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" result : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_Link_Resolve_Response; + + overriding procedure On_Initialize_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InitializeResult) is + Ok : Boolean := False; + begin + Self.Output.Put ("'initialize'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" result : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_Initialize_Response; + + overriding procedure On_Inlay_Resolve_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InlayHint) is + Ok : Boolean := False; + begin + Self.Output.Put ("'inlayHint/resolve'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" result : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_Inlay_Resolve_Response; + + overriding procedure On_Shutdown_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Null_Record) is + Ok : Boolean := False; + begin + Self.Output.Put ("'shutdown'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" result : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_Shutdown_Response; + + overriding procedure On_CodeAction_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Command_Or_CodeAction_Vector_Or_Null) is + Ok : Boolean := False; + begin + Self.Output.Put ("'textDocument/codeAction'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" result : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_CodeAction_Response; + + overriding procedure On_CodeLens_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CodeLens_Vector_Or_Null) is + Ok : Boolean := False; + begin + Self.Output.Put ("'textDocument/codeLens'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" result : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_CodeLens_Response; + + overriding procedure On_ColorPresentation_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ColorPresentation_Vector) is + Ok : Boolean := False; + begin + Self.Output.Put ("'textDocument/colorPresentation'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" result : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_ColorPresentation_Response; + + overriding procedure On_Completion_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Completion_Result) is + Ok : Boolean := False; + begin + Self.Output.Put ("'textDocument/completion'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" result : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_Completion_Response; + + overriding procedure On_Declaration_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Declaration_Result) is + Ok : Boolean := False; + begin + Self.Output.Put ("'textDocument/declaration'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" result : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_Declaration_Response; + + overriding procedure On_Definition_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Definition_Result) is + Ok : Boolean := False; + begin + Self.Output.Put ("'textDocument/definition'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" result : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_Definition_Response; + + overriding procedure On_Diagnostic_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentDiagnosticReport) is + Ok : Boolean := False; + begin + Self.Output.Put ("'textDocument/diagnostic'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" result : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_Diagnostic_Response; + + overriding procedure On_DocumentColor_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ColorInformation_Vector) is + Ok : Boolean := False; + begin + Self.Output.Put ("'textDocument/documentColor'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" result : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_DocumentColor_Response; + + overriding procedure On_DocumentHighlight_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentHighlight_Vector_Or_Null) is + Ok : Boolean := False; + begin + Self.Output.Put ("'textDocument/documentHighlight'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" result : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_DocumentHighlight_Response; + + overriding procedure On_DocumentLink_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentLink_Vector_Or_Null) is + Ok : Boolean := False; + begin + Self.Output.Put ("'textDocument/documentLink'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" result : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_DocumentLink_Response; + + overriding procedure On_DocumentSymbol_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentSymbol_Result) is + Ok : Boolean := False; + begin + Self.Output.Put ("'textDocument/documentSymbol'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" result : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_DocumentSymbol_Response; + + overriding procedure On_FoldingRange_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.FoldingRange_Vector_Or_Null) is + Ok : Boolean := False; + begin + Self.Output.Put ("'textDocument/foldingRange'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" result : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_FoldingRange_Response; + + overriding procedure On_Formatting_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TextEdit_Vector_Or_Null) is + Ok : Boolean := False; + begin + Self.Output.Put ("'textDocument/formatting'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" result : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_Formatting_Response; + + overriding procedure On_Hover_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Hover_Or_Null) is + Ok : Boolean := False; + begin + Self.Output.Put ("'textDocument/hover'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" result : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_Hover_Response; + + overriding procedure On_Implementation_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Definition_Result) is + Ok : Boolean := False; + begin + Self.Output.Put ("'textDocument/implementation'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" result : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_Implementation_Response; + + overriding procedure On_InlayHint_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InlayHint_Vector_Or_Null) is + Ok : Boolean := False; + begin + Self.Output.Put ("'textDocument/inlayHint'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" result : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_InlayHint_Response; + + overriding procedure On_InlineValue_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InlineValue_Vector_Or_Null) is + Ok : Boolean := False; + begin + Self.Output.Put ("'textDocument/inlineValue'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" result : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_InlineValue_Response; + + overriding procedure On_LinkedEditingRange_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.LinkedEditingRanges_Or_Null) is + Ok : Boolean := False; + begin + Self.Output.Put ("'textDocument/linkedEditingRange'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" result : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_LinkedEditingRange_Response; + + overriding procedure On_Moniker_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Moniker_Vector_Or_Null) is + Ok : Boolean := False; + begin + Self.Output.Put ("'textDocument/moniker'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" result : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_Moniker_Response; + + overriding procedure On_OnTypeFormatting_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TextEdit_Vector_Or_Null) is + Ok : Boolean := False; + begin + Self.Output.Put ("'textDocument/onTypeFormatting'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" result : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_OnTypeFormatting_Response; + + overriding procedure On_PrepareCallHierarchy_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CallHierarchyItem_Vector_Or_Null) is + Ok : Boolean := False; + begin + Self.Output.Put ("'textDocument/prepareCallHierarchy'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" result : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_PrepareCallHierarchy_Response; + + overriding procedure On_PrepareRename_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.PrepareRenameResult_Or_Null) is + Ok : Boolean := False; + begin + Self.Output.Put ("'textDocument/prepareRename'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" result : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_PrepareRename_Response; + + overriding procedure On_PrepareTypeHierarchy_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TypeHierarchyItem_Vector_Or_Null) is + Ok : Boolean := False; + begin + Self.Output.Put ("'textDocument/prepareTypeHierarchy'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" result : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_PrepareTypeHierarchy_Response; + + overriding procedure On_RangeFormatting_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TextEdit_Vector_Or_Null) is + Ok : Boolean := False; + begin + Self.Output.Put ("'textDocument/rangeFormatting'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" result : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_RangeFormatting_Response; + + overriding procedure On_References_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Location_Vector_Or_Null) is + Ok : Boolean := False; + begin + Self.Output.Put ("'textDocument/references'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" result : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_References_Response; + + overriding procedure On_Rename_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceEdit_Or_Null) is + Ok : Boolean := False; + begin + Self.Output.Put ("'textDocument/rename'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" result : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_Rename_Response; + + overriding procedure On_SelectionRange_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SelectionRange_Vector_Or_Null) is + Ok : Boolean := False; + begin + Self.Output.Put ("'textDocument/selectionRange'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" result : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_SelectionRange_Response; + + overriding procedure On_Tokens_Full_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SemanticTokens_Or_Null) is + Ok : Boolean := False; + begin + Self.Output.Put ("'textDocument/semanticTokens/full'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" result : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_Tokens_Full_Response; + + overriding procedure On_Tokens_Delta_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Tokens_Delta_Result) is + Ok : Boolean := False; + begin + Self.Output.Put ("'textDocument/semanticTokens/full/delta'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" result : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_Tokens_Delta_Response; + + overriding procedure On_Tokens_Range_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SemanticTokens_Or_Null) is + Ok : Boolean := False; + begin + Self.Output.Put ("'textDocument/semanticTokens/range'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" result : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_Tokens_Range_Response; + + overriding procedure On_SignatureHelp_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SignatureHelp_Or_Null) is + Ok : Boolean := False; + begin + Self.Output.Put ("'textDocument/signatureHelp'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" result : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_SignatureHelp_Response; + + overriding procedure On_TypeDefinition_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Definition_Result) is + Ok : Boolean := False; + begin + Self.Output.Put ("'textDocument/typeDefinition'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" result : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_TypeDefinition_Response; + + overriding procedure On_WillSaveWaitUntil_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TextEdit_Vector_Or_Null) is + Ok : Boolean := False; + begin + Self.Output.Put ("'textDocument/willSaveWaitUntil'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" result : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_WillSaveWaitUntil_Response; + + overriding procedure On_Subtypes_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TypeHierarchyItem_Vector_Or_Null) is + Ok : Boolean := False; + begin + Self.Output.Put ("'typeHierarchy/subtypes'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" result : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_Subtypes_Response; + + overriding procedure On_Supertypes_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TypeHierarchyItem_Vector_Or_Null) is + Ok : Boolean := False; + begin + Self.Output.Put ("'typeHierarchy/supertypes'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" result : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_Supertypes_Response; + + overriding procedure On_Workspace_Diagnostic_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceDiagnosticReport) is + Ok : Boolean := False; + begin + Self.Output.Put ("'workspace/diagnostic'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" result : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_Workspace_Diagnostic_Response; + + overriding procedure On_ExecuteCommand_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.LSPAny_Or_Null) is + Ok : Boolean := False; + begin + Self.Output.Put ("'workspace/executeCommand'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" result : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_ExecuteCommand_Response; + + overriding procedure On_Symbol_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Symbol_Result) is + Ok : Boolean := False; + begin + Self.Output.Put ("'workspace/symbol'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" result : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_Symbol_Response; + + overriding procedure On_WillCreateFiles_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceEdit_Or_Null) is + Ok : Boolean := False; + begin + Self.Output.Put ("'workspace/willCreateFiles'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" result : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_WillCreateFiles_Response; + + overriding procedure On_WillDeleteFiles_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceEdit_Or_Null) is + Ok : Boolean := False; + begin + Self.Output.Put ("'workspace/willDeleteFiles'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" result : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_WillDeleteFiles_Response; + + overriding procedure On_WillRenameFiles_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceEdit_Or_Null) is + Ok : Boolean := False; + begin + Self.Output.Put ("'workspace/willRenameFiles'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" result : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_WillRenameFiles_Response; + + overriding procedure On_Symbol_Resolve_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceSymbol) is + Ok : Boolean := False; + begin + Self.Output.Put ("'workspaceSymbol/resolve'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" result : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_Symbol_Resolve_Response; + + overriding procedure On_Error_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Errors.ResponseError) is + Ok : Boolean := False; + begin + Self.Output.Put ("'Error response'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" error : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_Error_Response; + + procedure Put_Id + (Self : in out Client_Response_Logger'Class; + Id : LSP.Structures.Integer_Or_Virtual_String; + Ok : in out Boolean) is + begin + Self.Output.Put (" Id=", Ok); + + if Id.Is_Integer then + Self.Output.Put + (VSS.Strings.To_Virtual_String (Id.Integer'Wide_Wide_Image), Ok); + else + Self.Output.Put (Id.Virtual_String, Ok); + end if; + end Put_Id; + +end LSP.Client_Response_Loggers; diff --git a/source/lsp_3.17/generated/lsp-client_response_loggers.ads b/source/lsp_3.17/generated/lsp-client_response_loggers.ads new file mode 100644 index 000000000..84729e123 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-client_response_loggers.ads @@ -0,0 +1,292 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- + +with VSS.Text_Streams; + +with LSP.Errors; +with LSP.Structures; +with LSP.Client_Response_Receivers; + +package LSP.Client_Response_Loggers is + pragma Preelaborate; + + type Client_Response_Logger + (Output : access VSS.Text_Streams.Output_Text_Stream'Class) is + new LSP.Client_Response_Receivers.Client_Response_Receiver with null record; + + overriding procedure On_AlsCheckSyntax_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.AlsCheckSyntaxResult); + + overriding procedure On_IncomingCalls_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CallHierarchyIncomingCall_Vector_Or_Null); + + overriding procedure On_OutgoingCalls_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CallHierarchyOutgoingCall_Vector_Or_Null); + + overriding procedure On_Code_Action_Resolve_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CodeAction); + + overriding procedure On_Code_Lens_Resolve_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CodeLens); + + overriding procedure On_Completion_Resolve_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CompletionItem); + + overriding procedure On_Link_Resolve_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentLink); + + overriding procedure On_Initialize_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InitializeResult); + + overriding procedure On_Inlay_Resolve_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InlayHint); + + overriding procedure On_Shutdown_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Null_Record); + + overriding procedure On_CodeAction_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Command_Or_CodeAction_Vector_Or_Null); + + overriding procedure On_CodeLens_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CodeLens_Vector_Or_Null); + + overriding procedure On_ColorPresentation_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ColorPresentation_Vector); + + overriding procedure On_Completion_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Completion_Result); + + overriding procedure On_Declaration_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Declaration_Result); + + overriding procedure On_Definition_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Definition_Result); + + overriding procedure On_Diagnostic_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentDiagnosticReport); + + overriding procedure On_DocumentColor_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ColorInformation_Vector); + + overriding procedure On_DocumentHighlight_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentHighlight_Vector_Or_Null); + + overriding procedure On_DocumentLink_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentLink_Vector_Or_Null); + + overriding procedure On_DocumentSymbol_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentSymbol_Result); + + overriding procedure On_FoldingRange_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.FoldingRange_Vector_Or_Null); + + overriding procedure On_Formatting_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TextEdit_Vector_Or_Null); + + overriding procedure On_Hover_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Hover_Or_Null); + + overriding procedure On_Implementation_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Definition_Result); + + overriding procedure On_InlayHint_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InlayHint_Vector_Or_Null); + + overriding procedure On_InlineValue_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InlineValue_Vector_Or_Null); + + overriding procedure On_LinkedEditingRange_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.LinkedEditingRanges_Or_Null); + + overriding procedure On_Moniker_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Moniker_Vector_Or_Null); + + overriding procedure On_OnTypeFormatting_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TextEdit_Vector_Or_Null); + + overriding procedure On_PrepareCallHierarchy_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CallHierarchyItem_Vector_Or_Null); + + overriding procedure On_PrepareRename_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.PrepareRenameResult_Or_Null); + + overriding procedure On_PrepareTypeHierarchy_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TypeHierarchyItem_Vector_Or_Null); + + overriding procedure On_RangeFormatting_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TextEdit_Vector_Or_Null); + + overriding procedure On_References_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Location_Vector_Or_Null); + + overriding procedure On_Rename_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceEdit_Or_Null); + + overriding procedure On_SelectionRange_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SelectionRange_Vector_Or_Null); + + overriding procedure On_Tokens_Full_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SemanticTokens_Or_Null); + + overriding procedure On_Tokens_Delta_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Tokens_Delta_Result); + + overriding procedure On_Tokens_Range_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SemanticTokens_Or_Null); + + overriding procedure On_SignatureHelp_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SignatureHelp_Or_Null); + + overriding procedure On_TypeDefinition_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Definition_Result); + + overriding procedure On_WillSaveWaitUntil_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TextEdit_Vector_Or_Null); + + overriding procedure On_Subtypes_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TypeHierarchyItem_Vector_Or_Null); + + overriding procedure On_Supertypes_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TypeHierarchyItem_Vector_Or_Null); + + overriding procedure On_Workspace_Diagnostic_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceDiagnosticReport); + + overriding procedure On_ExecuteCommand_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.LSPAny_Or_Null); + + overriding procedure On_Symbol_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Symbol_Result); + + overriding procedure On_WillCreateFiles_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceEdit_Or_Null); + + overriding procedure On_WillDeleteFiles_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceEdit_Or_Null); + + overriding procedure On_WillRenameFiles_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceEdit_Or_Null); + + overriding procedure On_Symbol_Resolve_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceSymbol); + + overriding procedure On_Error_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Errors.ResponseError); + + procedure Put_Id + (Self : in out Client_Response_Logger'Class; + Id : LSP.Structures.Integer_Or_Virtual_String; + Ok : in out Boolean); + +end LSP.Client_Response_Loggers; diff --git a/source/lsp_3.17/generated/lsp-server_notification_loggers.adb b/source/lsp_3.17/generated/lsp-server_notification_loggers.adb new file mode 100644 index 000000000..ca9ce4935 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_notification_loggers.adb @@ -0,0 +1,237 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- + +with VSS.Strings; + +package body LSP.Server_Notification_Loggers is + + overriding procedure On_SetTrace_Notification + (Self : in out Server_Notification_Logger; + Value : LSP.Structures.SetTraceParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'$/setTrace'", Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_SetTrace_Notification; + + overriding procedure On_Exits_Notification + (Self : in out Server_Notification_Logger) is + Ok : Boolean := False; + begin + Self.Output.Put ("'exit'", Ok); + Self.Output.New_Line (Ok); + end On_Exits_Notification; + + overriding procedure On_Initialized_Notification + (Self : in out Server_Notification_Logger; + Value : LSP.Structures.InitializedParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'initialized'", Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_Initialized_Notification; + + overriding procedure On_DidChangeNotebook_Notification + (Self : in out Server_Notification_Logger; + Value : LSP.Structures.DidChangeNotebookDocumentParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'notebookDocument/didChange'", Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_DidChangeNotebook_Notification; + + overriding procedure On_DidCloseNotebook_Notification + (Self : in out Server_Notification_Logger; + Value : LSP.Structures.DidCloseNotebookDocumentParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'notebookDocument/didClose'", Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_DidCloseNotebook_Notification; + + overriding procedure On_DidOpenNotebook_Notification + (Self : in out Server_Notification_Logger; + Value : LSP.Structures.DidOpenNotebookDocumentParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'notebookDocument/didOpen'", Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_DidOpenNotebook_Notification; + + overriding procedure On_DidSaveNotebook_Notification + (Self : in out Server_Notification_Logger; + Value : LSP.Structures.DidSaveNotebookDocumentParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'notebookDocument/didSave'", Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_DidSaveNotebook_Notification; + + overriding procedure On_DidChange_Notification + (Self : in out Server_Notification_Logger; + Value : LSP.Structures.DidChangeTextDocumentParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'textDocument/didChange'", Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_DidChange_Notification; + + overriding procedure On_DidClose_Notification + (Self : in out Server_Notification_Logger; + Value : LSP.Structures.DidCloseTextDocumentParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'textDocument/didClose'", Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_DidClose_Notification; + + overriding procedure On_DidOpen_Notification + (Self : in out Server_Notification_Logger; + Value : LSP.Structures.DidOpenTextDocumentParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'textDocument/didOpen'", Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_DidOpen_Notification; + + overriding procedure On_DidSave_Notification + (Self : in out Server_Notification_Logger; + Value : LSP.Structures.DidSaveTextDocumentParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'textDocument/didSave'", Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_DidSave_Notification; + + overriding procedure On_WillSave_Notification + (Self : in out Server_Notification_Logger; + Value : LSP.Structures.WillSaveTextDocumentParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'textDocument/willSave'", Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_WillSave_Notification; + + overriding procedure On_Cancel_Notification + (Self : in out Server_Notification_Logger; + Value : LSP.Structures.WorkDoneProgressCancelParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'window/workDoneProgress/cancel'", Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_Cancel_Notification; + + overriding procedure On_DidChangeConfiguration_Notification + (Self : in out Server_Notification_Logger; + Value : LSP.Structures.DidChangeConfigurationParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'workspace/didChangeConfiguration'", Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_DidChangeConfiguration_Notification; + + overriding procedure On_DidChangeWatchedFiles_Notification + (Self : in out Server_Notification_Logger; + Value : LSP.Structures.DidChangeWatchedFilesParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'workspace/didChangeWatchedFiles'", Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_DidChangeWatchedFiles_Notification; + + overriding procedure On_DidChangeWorkspaceFolders_Notification + (Self : in out Server_Notification_Logger; + Value : LSP.Structures.DidChangeWorkspaceFoldersParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'workspace/didChangeWorkspaceFolders'", Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_DidChangeWorkspaceFolders_Notification; + + overriding procedure On_DidCreateFiles_Notification + (Self : in out Server_Notification_Logger; + Value : LSP.Structures.CreateFilesParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'workspace/didCreateFiles'", Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_DidCreateFiles_Notification; + + overriding procedure On_DidDeleteFiles_Notification + (Self : in out Server_Notification_Logger; + Value : LSP.Structures.DeleteFilesParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'workspace/didDeleteFiles'", Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_DidDeleteFiles_Notification; + + overriding procedure On_DidRenameFiles_Notification + (Self : in out Server_Notification_Logger; + Value : LSP.Structures.RenameFilesParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'workspace/didRenameFiles'", Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_DidRenameFiles_Notification; + +end LSP.Server_Notification_Loggers; diff --git a/source/lsp_3.17/generated/lsp-server_notification_loggers.ads b/source/lsp_3.17/generated/lsp-server_notification_loggers.ads new file mode 100644 index 000000000..ead5bfedc --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_notification_loggers.ads @@ -0,0 +1,96 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- + +with LSP.Base_Notification_Loggers; +with LSP.Structures; +with LSP.Server_Notification_Receivers; + +package LSP.Server_Notification_Loggers is + pragma Preelaborate; + + type Server_Notification_Logger is + new LSP.Base_Notification_Loggers.Base_Notification_Logger and + LSP.Server_Notification_Receivers.Server_Notification_Receiver with + null record; + + overriding procedure On_SetTrace_Notification + (Self : in out Server_Notification_Logger; + Value : LSP.Structures.SetTraceParams); + + overriding procedure On_Exits_Notification + (Self : in out Server_Notification_Logger); + + overriding procedure On_Initialized_Notification + (Self : in out Server_Notification_Logger; + Value : LSP.Structures.InitializedParams); + + overriding procedure On_DidChangeNotebook_Notification + (Self : in out Server_Notification_Logger; + Value : LSP.Structures.DidChangeNotebookDocumentParams); + + overriding procedure On_DidCloseNotebook_Notification + (Self : in out Server_Notification_Logger; + Value : LSP.Structures.DidCloseNotebookDocumentParams); + + overriding procedure On_DidOpenNotebook_Notification + (Self : in out Server_Notification_Logger; + Value : LSP.Structures.DidOpenNotebookDocumentParams); + + overriding procedure On_DidSaveNotebook_Notification + (Self : in out Server_Notification_Logger; + Value : LSP.Structures.DidSaveNotebookDocumentParams); + + overriding procedure On_DidChange_Notification + (Self : in out Server_Notification_Logger; + Value : LSP.Structures.DidChangeTextDocumentParams); + + overriding procedure On_DidClose_Notification + (Self : in out Server_Notification_Logger; + Value : LSP.Structures.DidCloseTextDocumentParams); + + overriding procedure On_DidOpen_Notification + (Self : in out Server_Notification_Logger; + Value : LSP.Structures.DidOpenTextDocumentParams); + + overriding procedure On_DidSave_Notification + (Self : in out Server_Notification_Logger; + Value : LSP.Structures.DidSaveTextDocumentParams); + + overriding procedure On_WillSave_Notification + (Self : in out Server_Notification_Logger; + Value : LSP.Structures.WillSaveTextDocumentParams); + + overriding procedure On_Cancel_Notification + (Self : in out Server_Notification_Logger; + Value : LSP.Structures.WorkDoneProgressCancelParams); + + overriding procedure On_DidChangeConfiguration_Notification + (Self : in out Server_Notification_Logger; + Value : LSP.Structures.DidChangeConfigurationParams); + + overriding procedure On_DidChangeWatchedFiles_Notification + (Self : in out Server_Notification_Logger; + Value : LSP.Structures.DidChangeWatchedFilesParams); + + overriding procedure On_DidChangeWorkspaceFolders_Notification + (Self : in out Server_Notification_Logger; + Value : LSP.Structures.DidChangeWorkspaceFoldersParams); + + overriding procedure On_DidCreateFiles_Notification + (Self : in out Server_Notification_Logger; + Value : LSP.Structures.CreateFilesParams); + + overriding procedure On_DidDeleteFiles_Notification + (Self : in out Server_Notification_Logger; + Value : LSP.Structures.DeleteFilesParams); + + overriding procedure On_DidRenameFiles_Notification + (Self : in out Server_Notification_Logger; + Value : LSP.Structures.RenameFilesParams); + +end LSP.Server_Notification_Loggers; diff --git a/source/lsp_3.17/generated/lsp-server_request_loggers.adb b/source/lsp_3.17/generated/lsp-server_request_loggers.adb new file mode 100644 index 000000000..a6419fa90 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_request_loggers.adb @@ -0,0 +1,752 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- + +with VSS.Strings; + +package body LSP.Server_Request_Loggers is + + overriding procedure On_AlsCheckSyntax_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.AlsCheckSyntaxParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'$/alsCheckSyntax'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_AlsCheckSyntax_Request; + + overriding procedure On_IncomingCalls_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CallHierarchyIncomingCallsParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'callHierarchy/incomingCalls'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_IncomingCalls_Request; + + overriding procedure On_OutgoingCalls_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CallHierarchyOutgoingCallsParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'callHierarchy/outgoingCalls'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_OutgoingCalls_Request; + + overriding procedure On_Code_Action_Resolve_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CodeAction) is + Ok : Boolean := False; + begin + Self.Output.Put ("'codeAction/resolve'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_Code_Action_Resolve_Request; + + overriding procedure On_Code_Lens_Resolve_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CodeLens) is + Ok : Boolean := False; + begin + Self.Output.Put ("'codeLens/resolve'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_Code_Lens_Resolve_Request; + + overriding procedure On_Completion_Resolve_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CompletionItem) is + Ok : Boolean := False; + begin + Self.Output.Put ("'completionItem/resolve'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_Completion_Resolve_Request; + + overriding procedure On_Link_Resolve_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentLink) is + Ok : Boolean := False; + begin + Self.Output.Put ("'documentLink/resolve'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_Link_Resolve_Request; + + overriding procedure On_Initialize_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InitializeParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'initialize'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_Initialize_Request; + + overriding procedure On_Inlay_Resolve_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InlayHint) is + Ok : Boolean := False; + begin + Self.Output.Put ("'inlayHint/resolve'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_Inlay_Resolve_Request; + + overriding procedure On_Shutdown_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String) is + Ok : Boolean := False; + begin + Self.Output.Put ("'shutdown'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.New_Line (Ok); + end On_Shutdown_Request; + + overriding procedure On_CodeAction_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CodeActionParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'textDocument/codeAction'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_CodeAction_Request; + + overriding procedure On_CodeLens_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CodeLensParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'textDocument/codeLens'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_CodeLens_Request; + + overriding procedure On_ColorPresentation_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ColorPresentationParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'textDocument/colorPresentation'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_ColorPresentation_Request; + + overriding procedure On_Completion_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CompletionParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'textDocument/completion'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_Completion_Request; + + overriding procedure On_Declaration_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DeclarationParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'textDocument/declaration'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_Declaration_Request; + + overriding procedure On_Definition_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DefinitionParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'textDocument/definition'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_Definition_Request; + + overriding procedure On_Diagnostic_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentDiagnosticParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'textDocument/diagnostic'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_Diagnostic_Request; + + overriding procedure On_DocumentColor_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentColorParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'textDocument/documentColor'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_DocumentColor_Request; + + overriding procedure On_DocumentHighlight_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentHighlightParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'textDocument/documentHighlight'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_DocumentHighlight_Request; + + overriding procedure On_DocumentLink_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentLinkParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'textDocument/documentLink'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_DocumentLink_Request; + + overriding procedure On_DocumentSymbol_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentSymbolParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'textDocument/documentSymbol'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_DocumentSymbol_Request; + + overriding procedure On_FoldingRange_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.FoldingRangeParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'textDocument/foldingRange'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_FoldingRange_Request; + + overriding procedure On_Formatting_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentFormattingParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'textDocument/formatting'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_Formatting_Request; + + overriding procedure On_Hover_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.HoverParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'textDocument/hover'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_Hover_Request; + + overriding procedure On_Implementation_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ImplementationParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'textDocument/implementation'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_Implementation_Request; + + overriding procedure On_InlayHint_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InlayHintParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'textDocument/inlayHint'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_InlayHint_Request; + + overriding procedure On_InlineValue_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InlineValueParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'textDocument/inlineValue'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_InlineValue_Request; + + overriding procedure On_LinkedEditingRange_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.LinkedEditingRangeParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'textDocument/linkedEditingRange'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_LinkedEditingRange_Request; + + overriding procedure On_Moniker_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.MonikerParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'textDocument/moniker'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_Moniker_Request; + + overriding procedure On_OnTypeFormatting_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentOnTypeFormattingParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'textDocument/onTypeFormatting'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_OnTypeFormatting_Request; + + overriding procedure On_PrepareCallHierarchy_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CallHierarchyPrepareParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'textDocument/prepareCallHierarchy'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_PrepareCallHierarchy_Request; + + overriding procedure On_PrepareRename_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.PrepareRenameParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'textDocument/prepareRename'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_PrepareRename_Request; + + overriding procedure On_PrepareTypeHierarchy_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TypeHierarchyPrepareParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'textDocument/prepareTypeHierarchy'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_PrepareTypeHierarchy_Request; + + overriding procedure On_RangeFormatting_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentRangeFormattingParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'textDocument/rangeFormatting'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_RangeFormatting_Request; + + overriding procedure On_References_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ReferenceParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'textDocument/references'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_References_Request; + + overriding procedure On_Rename_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.RenameParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'textDocument/rename'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_Rename_Request; + + overriding procedure On_SelectionRange_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SelectionRangeParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'textDocument/selectionRange'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_SelectionRange_Request; + + overriding procedure On_Tokens_Full_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SemanticTokensParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'textDocument/semanticTokens/full'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_Tokens_Full_Request; + + overriding procedure On_Tokens_Delta_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SemanticTokensDeltaParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'textDocument/semanticTokens/full/delta'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_Tokens_Delta_Request; + + overriding procedure On_Tokens_Range_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SemanticTokensRangeParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'textDocument/semanticTokens/range'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_Tokens_Range_Request; + + overriding procedure On_SignatureHelp_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SignatureHelpParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'textDocument/signatureHelp'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_SignatureHelp_Request; + + overriding procedure On_TypeDefinition_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TypeDefinitionParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'textDocument/typeDefinition'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_TypeDefinition_Request; + + overriding procedure On_WillSaveWaitUntil_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WillSaveTextDocumentParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'textDocument/willSaveWaitUntil'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_WillSaveWaitUntil_Request; + + overriding procedure On_Subtypes_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TypeHierarchySubtypesParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'typeHierarchy/subtypes'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_Subtypes_Request; + + overriding procedure On_Supertypes_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TypeHierarchySupertypesParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'typeHierarchy/supertypes'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_Supertypes_Request; + + overriding procedure On_Workspace_Diagnostic_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceDiagnosticParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'workspace/diagnostic'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_Workspace_Diagnostic_Request; + + overriding procedure On_ExecuteCommand_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ExecuteCommandParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'workspace/executeCommand'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_ExecuteCommand_Request; + + overriding procedure On_Symbol_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceSymbolParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'workspace/symbol'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_Symbol_Request; + + overriding procedure On_WillCreateFiles_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CreateFilesParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'workspace/willCreateFiles'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_WillCreateFiles_Request; + + overriding procedure On_WillDeleteFiles_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DeleteFilesParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'workspace/willDeleteFiles'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_WillDeleteFiles_Request; + + overriding procedure On_WillRenameFiles_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.RenameFilesParams) is + Ok : Boolean := False; + begin + Self.Output.Put ("'workspace/willRenameFiles'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_WillRenameFiles_Request; + + overriding procedure On_Symbol_Resolve_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceSymbol) is + Ok : Boolean := False; + begin + Self.Output.Put ("'workspaceSymbol/resolve'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" Params : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_Symbol_Resolve_Request; + + procedure Put_Id + (Self : in out Server_Request_Logger'Class; + Id : LSP.Structures.Integer_Or_Virtual_String; + Ok : in out Boolean) is + begin + Self.Output.Put (" Id=", Ok); + + if Id.Is_Integer then + Self.Output.Put + (VSS.Strings.To_Virtual_String (Id.Integer'Wide_Wide_Image), Ok); + else + Self.Output.Put (Id.Virtual_String, Ok); + end if; + end Put_Id; + +end LSP.Server_Request_Loggers; diff --git a/source/lsp_3.17/generated/lsp-server_request_loggers.ads b/source/lsp_3.17/generated/lsp-server_request_loggers.ads new file mode 100644 index 000000000..3a9777c95 --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_request_loggers.ads @@ -0,0 +1,284 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- + +with LSP.Structures; +with VSS.Text_Streams; +with LSP.Server_Request_Receivers; + +package LSP.Server_Request_Loggers is + pragma Preelaborate; + + type Server_Request_Logger + (Output : access VSS.Text_Streams.Output_Text_Stream'Class) is + new LSP.Server_Request_Receivers.Server_Request_Receiver with null record; + + overriding procedure On_AlsCheckSyntax_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.AlsCheckSyntaxParams); + + overriding procedure On_IncomingCalls_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CallHierarchyIncomingCallsParams); + + overriding procedure On_OutgoingCalls_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CallHierarchyOutgoingCallsParams); + + overriding procedure On_Code_Action_Resolve_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CodeAction); + + overriding procedure On_Code_Lens_Resolve_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CodeLens); + + overriding procedure On_Completion_Resolve_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CompletionItem); + + overriding procedure On_Link_Resolve_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentLink); + + overriding procedure On_Initialize_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InitializeParams); + + overriding procedure On_Inlay_Resolve_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InlayHint); + + overriding procedure On_Shutdown_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String); + + overriding procedure On_CodeAction_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CodeActionParams); + + overriding procedure On_CodeLens_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CodeLensParams); + + overriding procedure On_ColorPresentation_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ColorPresentationParams); + + overriding procedure On_Completion_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CompletionParams); + + overriding procedure On_Declaration_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DeclarationParams); + + overriding procedure On_Definition_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DefinitionParams); + + overriding procedure On_Diagnostic_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentDiagnosticParams); + + overriding procedure On_DocumentColor_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentColorParams); + + overriding procedure On_DocumentHighlight_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentHighlightParams); + + overriding procedure On_DocumentLink_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentLinkParams); + + overriding procedure On_DocumentSymbol_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentSymbolParams); + + overriding procedure On_FoldingRange_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.FoldingRangeParams); + + overriding procedure On_Formatting_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentFormattingParams); + + overriding procedure On_Hover_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.HoverParams); + + overriding procedure On_Implementation_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ImplementationParams); + + overriding procedure On_InlayHint_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InlayHintParams); + + overriding procedure On_InlineValue_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.InlineValueParams); + + overriding procedure On_LinkedEditingRange_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.LinkedEditingRangeParams); + + overriding procedure On_Moniker_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.MonikerParams); + + overriding procedure On_OnTypeFormatting_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentOnTypeFormattingParams); + + overriding procedure On_PrepareCallHierarchy_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CallHierarchyPrepareParams); + + overriding procedure On_PrepareRename_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.PrepareRenameParams); + + overriding procedure On_PrepareTypeHierarchy_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TypeHierarchyPrepareParams); + + overriding procedure On_RangeFormatting_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentRangeFormattingParams); + + overriding procedure On_References_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ReferenceParams); + + overriding procedure On_Rename_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.RenameParams); + + overriding procedure On_SelectionRange_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SelectionRangeParams); + + overriding procedure On_Tokens_Full_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SemanticTokensParams); + + overriding procedure On_Tokens_Delta_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SemanticTokensDeltaParams); + + overriding procedure On_Tokens_Range_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SemanticTokensRangeParams); + + overriding procedure On_SignatureHelp_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SignatureHelpParams); + + overriding procedure On_TypeDefinition_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TypeDefinitionParams); + + overriding procedure On_WillSaveWaitUntil_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WillSaveTextDocumentParams); + + overriding procedure On_Subtypes_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TypeHierarchySubtypesParams); + + overriding procedure On_Supertypes_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.TypeHierarchySupertypesParams); + + overriding procedure On_Workspace_Diagnostic_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceDiagnosticParams); + + overriding procedure On_ExecuteCommand_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ExecuteCommandParams); + + overriding procedure On_Symbol_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceSymbolParams); + + overriding procedure On_WillCreateFiles_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.CreateFilesParams); + + overriding procedure On_WillDeleteFiles_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DeleteFilesParams); + + overriding procedure On_WillRenameFiles_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.RenameFilesParams); + + overriding procedure On_Symbol_Resolve_Request + (Self : in out Server_Request_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceSymbol); + + procedure Put_Id + (Self : in out Server_Request_Logger'Class; + Id : LSP.Structures.Integer_Or_Virtual_String; + Ok : in out Boolean); + +end LSP.Server_Request_Loggers; diff --git a/source/lsp_3.17/generated/lsp-server_response_loggers.adb b/source/lsp_3.17/generated/lsp-server_response_loggers.adb new file mode 100644 index 000000000..8693e770d --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_response_loggers.adb @@ -0,0 +1,224 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- + +with VSS.Strings; + +package body LSP.Server_Response_Loggers is + + overriding procedure On_RegisterCapability_Response + (Self : in out Server_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Null_Record) is + Ok : Boolean := False; + begin + Self.Output.Put ("'client/registerCapability'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" result : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_RegisterCapability_Response; + + overriding procedure On_UnregisterCapability_Response + (Self : in out Server_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Null_Record) is + Ok : Boolean := False; + begin + Self.Output.Put ("'client/unregisterCapability'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" result : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_UnregisterCapability_Response; + + overriding procedure On_ShowDocument_Response + (Self : in out Server_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ShowDocumentResult) is + Ok : Boolean := False; + begin + Self.Output.Put ("'window/showDocument'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" result : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_ShowDocument_Response; + + overriding procedure On_ShowMessageRequest_Response + (Self : in out Server_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.MessageActionItem_Or_Null) is + Ok : Boolean := False; + begin + Self.Output.Put ("'window/showMessageRequest'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" result : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_ShowMessageRequest_Response; + + overriding procedure On_Progress_Create_Response + (Self : in out Server_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Null_Record) is + Ok : Boolean := False; + begin + Self.Output.Put ("'window/workDoneProgress/create'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" result : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_Progress_Create_Response; + + overriding procedure On_ApplyEdit_Response + (Self : in out Server_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ApplyWorkspaceEditResult) is + Ok : Boolean := False; + begin + Self.Output.Put ("'workspace/applyEdit'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" result : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_ApplyEdit_Response; + + overriding procedure On_Code_Lens_Refresh_Response + (Self : in out Server_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Null_Record) is + Ok : Boolean := False; + begin + Self.Output.Put ("'workspace/codeLens/refresh'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" result : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_Code_Lens_Refresh_Response; + + overriding procedure On_Configuration_Response + (Self : in out Server_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.LSPAny_Vector) is + Ok : Boolean := False; + begin + Self.Output.Put ("'workspace/configuration'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" result : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_Configuration_Response; + + overriding procedure On_Diagnostic_Refresh_Response + (Self : in out Server_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Null_Record) is + Ok : Boolean := False; + begin + Self.Output.Put ("'workspace/diagnostic/refresh'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" result : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_Diagnostic_Refresh_Response; + + overriding procedure On_Inlay_Refresh_Response + (Self : in out Server_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Null_Record) is + Ok : Boolean := False; + begin + Self.Output.Put ("'workspace/inlayHint/refresh'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" result : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_Inlay_Refresh_Response; + + overriding procedure On_Inline_Refresh_Response + (Self : in out Server_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Null_Record) is + Ok : Boolean := False; + begin + Self.Output.Put ("'workspace/inlineValue/refresh'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" result : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_Inline_Refresh_Response; + + overriding procedure On_Tokens_Refresh_Response + (Self : in out Server_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Null_Record) is + Ok : Boolean := False; + begin + Self.Output.Put ("'workspace/semanticTokens/refresh'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" result : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_Tokens_Refresh_Response; + + overriding procedure On_WorkspaceFolders_Response + (Self : in out Server_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceFolder_Vector_Or_Null) is + Ok : Boolean := False; + begin + Self.Output.Put ("'workspace/workspaceFolders'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" result : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_WorkspaceFolders_Response; + + overriding procedure On_Error_Response + (Self : in out Server_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Errors.ResponseError) is + Ok : Boolean := False; + begin + Self.Output.Put ("'Error response'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" error : ", Ok); + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value'Wide_Wide_Image), Ok); + Self.Output.New_Line (Ok); + end On_Error_Response; + + procedure Put_Id + (Self : in out Server_Response_Logger'Class; + Id : LSP.Structures.Integer_Or_Virtual_String; + Ok : in out Boolean) is + begin + Self.Output.Put (" Id=", Ok); + + if Id.Is_Integer then + Self.Output.Put + (VSS.Strings.To_Virtual_String (Id.Integer'Wide_Wide_Image), Ok); + else + Self.Output.Put (Id.Virtual_String, Ok); + end if; + end Put_Id; + +end LSP.Server_Response_Loggers; diff --git a/source/lsp_3.17/generated/lsp-server_response_loggers.ads b/source/lsp_3.17/generated/lsp-server_response_loggers.ads new file mode 100644 index 000000000..0e3e9208b --- /dev/null +++ b/source/lsp_3.17/generated/lsp-server_response_loggers.ads @@ -0,0 +1,97 @@ +-- +-- Copyright (C) , +-- +-- SPDX-License-Identifier: MIT +-- +-- DON'T EDIT THIS FILE! It was generated from metaModel.json. +-- + +with VSS.Text_Streams; + +with LSP.Errors; +with LSP.Structures; +with LSP.Server_Response_Receivers; + +package LSP.Server_Response_Loggers is + pragma Preelaborate; + + type Server_Response_Logger + (Output : access VSS.Text_Streams.Output_Text_Stream'Class) is + new LSP.Server_Response_Receivers.Server_Response_Receiver with null record; + + overriding procedure On_RegisterCapability_Response + (Self : in out Server_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Null_Record); + + overriding procedure On_UnregisterCapability_Response + (Self : in out Server_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Null_Record); + + overriding procedure On_ShowDocument_Response + (Self : in out Server_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ShowDocumentResult); + + overriding procedure On_ShowMessageRequest_Response + (Self : in out Server_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.MessageActionItem_Or_Null); + + overriding procedure On_Progress_Create_Response + (Self : in out Server_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Null_Record); + + overriding procedure On_ApplyEdit_Response + (Self : in out Server_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.ApplyWorkspaceEditResult); + + overriding procedure On_Code_Lens_Refresh_Response + (Self : in out Server_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Null_Record); + + overriding procedure On_Configuration_Response + (Self : in out Server_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.LSPAny_Vector); + + overriding procedure On_Diagnostic_Refresh_Response + (Self : in out Server_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Null_Record); + + overriding procedure On_Inlay_Refresh_Response + (Self : in out Server_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Null_Record); + + overriding procedure On_Inline_Refresh_Response + (Self : in out Server_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Null_Record); + + overriding procedure On_Tokens_Refresh_Response + (Self : in out Server_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Null_Record); + + overriding procedure On_WorkspaceFolders_Response + (Self : in out Server_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.WorkspaceFolder_Vector_Or_Null); + + overriding procedure On_Error_Response + (Self : in out Server_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Errors.ResponseError); + + procedure Put_Id + (Self : in out Server_Response_Logger'Class; + Id : LSP.Structures.Integer_Or_Virtual_String; + Ok : in out Boolean); + +end LSP.Server_Response_Loggers; From cb07aee388451fc3b3d77f411cf88e260b8b948b Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Tue, 26 Sep 2023 18:25:52 +0300 Subject: [PATCH 149/152] Use in/out loggers to dump messages. Refs #1170 --- source/ada/lsp-ada_driver.adb | 13 +++++++++++-- source/server/lsp-servers.adb | 31 +++++++++++++++++++++++++------ source/server/lsp-servers.ads | 16 ++++++++++++---- 3 files changed, 48 insertions(+), 12 deletions(-) diff --git a/source/ada/lsp-ada_driver.adb b/source/ada/lsp-ada_driver.adb index 53df983a1..5585d7601 100644 --- a/source/ada/lsp-ada_driver.adb +++ b/source/ada/lsp-ada_driver.adb @@ -311,11 +311,20 @@ begin begin if VSS.Command_Line.Is_Specified (Language_GPR_Option) then - Server.Run (GPR_Handler'Unchecked_Access, Tracer'Unchecked_Access); + Server.Run + (GPR_Handler'Unchecked_Access, + Tracer'Unchecked_Access, + In_Logger => null, + Out_Logger => null); else Register_Commands; - Server.Run (Ada_Handler'Unchecked_Access, Tracer'Unchecked_Access); + + Server.Run + (Ada_Handler'Unchecked_Access, + Tracer'Unchecked_Access, + In_Logger => null, + Out_Logger => null); end if; exception when E : others => diff --git a/source/server/lsp-servers.adb b/source/server/lsp-servers.adb index 8981e82cd..b75149247 100644 --- a/source/server/lsp-servers.adb +++ b/source/server/lsp-servers.adb @@ -45,6 +45,7 @@ package body LSP.Servers is (Self : in out Server'Class; Checker : in out LSP.Lifecycle_Checkers.Lifecycle_Checker; Map : in out LSP.Known_Requests.Known_Request_Map; + Logger : Server_Message_Visitor_Access; EOF : in out Boolean); -- Read data from stdin and create a message if there is enough data. -- Then put the message into Self.Input_Queue. @@ -175,6 +176,7 @@ package body LSP.Servers is (Self : in out Server'Class; Checker : in out LSP.Lifecycle_Checkers.Lifecycle_Checker; Map : in out LSP.Known_Requests.Known_Request_Map; + Logger : Server_Message_Visitor_Access; EOF : in out Boolean) is use type Ada.Streams.Stream_Element_Count; @@ -464,6 +466,10 @@ package body LSP.Servers is Message := Server_Message_Access (Notification); end if; + if Logger /= null then + Message.Visit_Server_Message_Visitor (Logger.all); + end if; + Checker.Check_Message (Self, Message.all, Ok, Is_Exit_Notification); -- Check initialization status and send a response if this is a -- request before initialization. @@ -567,12 +573,14 @@ package body LSP.Servers is procedure Run (Self : in out Server; Handler : not null Server_Message_Visitor_Access; - Tracer : not null LSP.Tracers.Tracer_Access) is + Tracer : not null LSP.Tracers.Tracer_Access; + In_Logger : Server_Message_Visitor_Access; + Out_Logger : Client_Message_Visitor_Access) is begin Self.Tracer := Tracer; Self.Processing_Task.Start (Handler); - Self.Output_Task.Start; - Self.Input_Task.Start; + Self.Output_Task.Start (Out_Logger); + Self.Input_Task.Start (In_Logger); -- Wait for stop signal Self.Stop_Signal.Seize; @@ -644,8 +652,11 @@ package body LSP.Servers is Message : Server_Message_Access; Map : LSP.Known_Requests.Known_Request_Map; Checker : LSP.Lifecycle_Checkers.Lifecycle_Checker; + Logger : Server_Message_Visitor_Access; begin - accept Start; + accept Start (In_Logger : Server_Message_Visitor_Access) do + Logger := In_Logger; + end Start; loop loop @@ -665,7 +676,7 @@ package body LSP.Servers is accept Stop; exit; else - Server.Process_One_Message (Checker, Map, EOF); + Server.Process_One_Message (Checker, Map, Logger, EOF); -- This call can block reading from stream if EOF then @@ -697,6 +708,8 @@ package body LSP.Servers is ---------------------- task body Output_Task_Type is + Logger : Client_Message_Visitor_Access; + Message : Client_Message_Access; Output_Queue : Output_Message_Queues.Queue renames Server.Output_Queue; @@ -733,13 +746,19 @@ package body LSP.Servers is end Write_JSON_RPC; begin - accept Start; + accept Start (Out_Logger : Client_Message_Visitor_Access) do + Logger := Out_Logger; + end Start; loop select -- Process all available outputs before acceptiong Stop Output_Queue.Dequeue (Message); + if Logger /= null then + Message.Visit_Client_Message_Visitor (Logger.all); + end if; + declare Stream : aliased VSS.Text_Streams.Memory_UTF8_Output .Memory_UTF8_Output_Stream; diff --git a/source/server/lsp-servers.ads b/source/server/lsp-servers.ads index 7e738ae2b..e91860968 100644 --- a/source/server/lsp-servers.ads +++ b/source/server/lsp-servers.ads @@ -23,6 +23,7 @@ with Ada.Streams; with LSP.Client_Message_Receivers; +with LSP.Client_Message_Visitors; with LSP.Server_Message_Visitors; with LSP.Structures; @@ -62,14 +63,21 @@ package LSP.Servers is LSP.Server_Message_Visitors.Server_Message_Visitor'Class with Storage_Size => 0; + type Client_Message_Visitor_Access is access all + LSP.Client_Message_Visitors.Client_Message_Visitor'Class + with Storage_Size => 0; + procedure Run (Self : in out Server; Handler : not null Server_Message_Visitor_Access; - Tracer : not null LSP.Tracers.Tracer_Access); + Tracer : not null LSP.Tracers.Tracer_Access; + In_Logger : Server_Message_Visitor_Access; + Out_Logger : Client_Message_Visitor_Access); -- Run the server using given Request and Notification handler. -- Tracer object provides tracing/logging capabilities for the main trace, -- all input & output traces for debugging purposes. - -- Call On_Error in case of uncaught exceptions. + -- In/out loggers are used to dump client-to-server and server-to-client + -- messages. procedure Stop (Self : in out Server); -- Ask server to stop @@ -177,7 +185,7 @@ private task type Output_Task_Type (Server : access LSP.Servers.Server) is - entry Start; + entry Start (Out_Logger : Client_Message_Visitor_Access); -- Start the task. Should be called once. entry Stop; @@ -188,7 +196,7 @@ private task type Input_Task_Type (Server : access LSP.Servers.Server) is - entry Start; + entry Start (In_Logger : Server_Message_Visitor_Access); -- Start the task. Should be called once. entry Stop; From 9c73cafc45188ae6f5f0f9e522a9c1fb4c4b45fe Mon Sep 17 00:00:00 2001 From: Maxim Reznik Date: Wed, 27 Sep 2023 14:15:54 +0300 Subject: [PATCH 150/152] Add Secure_Message_Loggers package to skip dumps of long messages or edited code. --- source/ada/lsp-ada_driver.adb | 24 +- .../lsp_3.17/lsp-client_message_loggers.adb | 42 +++ .../lsp_3.17/lsp-client_message_loggers.ads | 44 +++ .../lsp_3.17/lsp-server_message_loggers.adb | 42 +++ .../lsp_3.17/lsp-server_message_loggers.ads | 44 +++ source/server/lsp-secure_message_loggers.adb | 325 ++++++++++++++++++ source/server/lsp-secure_message_loggers.ads | 133 +++++++ 7 files changed, 650 insertions(+), 4 deletions(-) create mode 100644 source/lsp_3.17/lsp-client_message_loggers.adb create mode 100644 source/lsp_3.17/lsp-client_message_loggers.ads create mode 100644 source/lsp_3.17/lsp-server_message_loggers.adb create mode 100644 source/lsp_3.17/lsp-server_message_loggers.ads create mode 100644 source/server/lsp-secure_message_loggers.adb create mode 100644 source/server/lsp-secure_message_loggers.ads diff --git a/source/ada/lsp-ada_driver.adb b/source/ada/lsp-ada_driver.adb index 5585d7601..49f61f5ff 100644 --- a/source/ada/lsp-ada_driver.adb +++ b/source/ada/lsp-ada_driver.adb @@ -56,10 +56,12 @@ with LSP.Ada_Handlers.Refactor.Replace_Type; with LSP.Ada_Handlers.Refactor.Sort_Dependencies; with LSP.Ada_Handlers.Refactor.Suppress_Seperate; with LSP.Ada_Handlers.Suspend_Executions; +with LSP.GNATCOLL_Trace_Streams; with LSP.GNATCOLL_Tracers; with LSP.GPR_Handlers; with LSP.Memory_Statistics; with LSP.Predefined_Completion; +with LSP.Secure_Message_Loggers; with LSP.Servers; with LSP.Stdio_Streams; @@ -127,6 +129,17 @@ procedure LSP.Ada_Driver is -- Traces that logs all input & output. For debugging purposes. Tracer : aliased LSP.GNATCOLL_Tracers.Tracer; + In_Stream : aliased LSP.GNATCOLL_Trace_Streams.Output_Text_Stream; + -- Output stream for logging input messages into the trace + In_Logger : aliased LSP.Secure_Message_Loggers.Server_Logger + (In_Stream'Unchecked_Access); + -- Logger for logging input messages + Out_Stream : aliased LSP.GNATCOLL_Trace_Streams.Output_Text_Stream; + -- Output stream for logging output messages into the trace + Out_Logger : aliased LSP.Secure_Message_Loggers.Client_Logger + (Out_Stream'Unchecked_Access); + -- Logger for logging output messages + Server : aliased LSP.Servers.Server; Stream : aliased LSP.Stdio_Streams.Stdio_Stream; Ada_Handler : aliased LSP.Ada_Handlers.Message_Handler @@ -268,6 +281,9 @@ begin end; end if; + In_Stream.Initialize (Server_Trace); + Out_Stream.Initialize (Server_Trace); + Tracer.Initialize (Server_Trace, In_Trace, Out_Trace); Tracer.Trace ("ALS version: " & $VERSION & " (" & $BUILD_DATE & ")"); @@ -314,8 +330,8 @@ begin Server.Run (GPR_Handler'Unchecked_Access, Tracer'Unchecked_Access, - In_Logger => null, - Out_Logger => null); + In_Logger => In_Logger'Unchecked_Access, + Out_Logger => Out_Logger'Unchecked_Access); else Register_Commands; @@ -323,8 +339,8 @@ begin Server.Run (Ada_Handler'Unchecked_Access, Tracer'Unchecked_Access, - In_Logger => null, - Out_Logger => null); + In_Logger => In_Logger'Unchecked_Access, + Out_Logger => Out_Logger'Unchecked_Access); end if; exception when E : others => diff --git a/source/lsp_3.17/lsp-client_message_loggers.adb b/source/lsp_3.17/lsp-client_message_loggers.adb new file mode 100644 index 000000000..6cd9ba292 --- /dev/null +++ b/source/lsp_3.17/lsp-client_message_loggers.adb @@ -0,0 +1,42 @@ +-- +-- Copyright (C) 2022-2023, AdaCore +-- +-- SPDX-License-Identifier: Apache-2.0 +-- + +package body LSP.Client_Message_Loggers is + + ---------------------------- + -- On_Client_Notification -- + ---------------------------- + + overriding procedure On_Client_Notification + (Self : in out Client_Logger; + Value : LSP.Client_Notifications.Client_Notification'Class) is + begin + Value.Visit_Client_Receiver (Self.Notification); + end On_Client_Notification; + + ----------------------- + -- On_Client_Request -- + ----------------------- + + overriding procedure On_Client_Request + (Self : in out Client_Logger; + Value : LSP.Client_Requests.Client_Request'Class) is + begin + Value.Visit_Client_Receiver (Self.Request); + end On_Client_Request; + + ------------------------ + -- On_Client_Response -- + ------------------------ + + overriding procedure On_Client_Response + (Self : in out Client_Logger; + Value : LSP.Client_Responses.Client_Response'Class) is + begin + Value.Visit_Client_Receiver (Self.Response); + end On_Client_Response; + +end LSP.Client_Message_Loggers; diff --git a/source/lsp_3.17/lsp-client_message_loggers.ads b/source/lsp_3.17/lsp-client_message_loggers.ads new file mode 100644 index 000000000..96eb641fa --- /dev/null +++ b/source/lsp_3.17/lsp-client_message_loggers.ads @@ -0,0 +1,44 @@ +-- +-- Copyright (C) 2022-2023, AdaCore +-- +-- SPDX-License-Identifier: Apache-2.0 +-- + +-- Simple server-to-client message logger that uses 'Image to dump messages. + +with VSS.Text_Streams; + +with LSP.Client_Message_Visitors; +with LSP.Client_Notification_Loggers; +with LSP.Client_Notifications; +with LSP.Client_Request_Loggers; +with LSP.Client_Requests; +with LSP.Client_Response_Loggers; +with LSP.Client_Responses; + +package LSP.Client_Message_Loggers is + pragma Preelaborate; + + type Client_Logger + (Output : not null access VSS.Text_Streams.Output_Text_Stream'Class) + is new LSP.Client_Message_Visitors.Client_Message_Visitor with record + Request : LSP.Client_Request_Loggers.Client_Request_Logger (Output); + Response : LSP.Client_Response_Loggers.Client_Response_Logger (Output); + + Notification : + LSP.Client_Notification_Loggers.Client_Notification_Logger (Output); + end record; + + overriding procedure On_Client_Notification + (Self : in out Client_Logger; + Value : LSP.Client_Notifications.Client_Notification'Class); + + overriding procedure On_Client_Request + (Self : in out Client_Logger; + Value : LSP.Client_Requests.Client_Request'Class); + + overriding procedure On_Client_Response + (Self : in out Client_Logger; + Value : LSP.Client_Responses.Client_Response'Class); + +end LSP.Client_Message_Loggers; diff --git a/source/lsp_3.17/lsp-server_message_loggers.adb b/source/lsp_3.17/lsp-server_message_loggers.adb new file mode 100644 index 000000000..3fc6cc03a --- /dev/null +++ b/source/lsp_3.17/lsp-server_message_loggers.adb @@ -0,0 +1,42 @@ +-- +-- Copyright (C) 2022-2023, AdaCore +-- +-- SPDX-License-Identifier: Apache-2.0 +-- + +package body LSP.Server_Message_Loggers is + + ---------------------------- + -- On_Server_Notification -- + ---------------------------- + + overriding procedure On_Server_Notification + (Self : in out Server_Message_Logger; + Value : LSP.Server_Notifications.Server_Notification'Class) is + begin + Value.Visit_Server_Receiver (Self.Notification); + end On_Server_Notification; + + ----------------------- + -- On_Server_Request -- + ----------------------- + + overriding procedure On_Server_Request + (Self : in out Server_Message_Logger; + Value : LSP.Server_Requests.Server_Request'Class) is + begin + Value.Visit_Server_Receiver (Self.Request); + end On_Server_Request; + + ------------------------ + -- On_Server_Response -- + ------------------------ + + overriding procedure On_Server_Response + (Self : in out Server_Message_Logger; + Value : LSP.Server_Responses.Server_Response'Class) is + begin + Value.Visit_Server_Receiver (Self.Response); + end On_Server_Response; + +end LSP.Server_Message_Loggers; diff --git a/source/lsp_3.17/lsp-server_message_loggers.ads b/source/lsp_3.17/lsp-server_message_loggers.ads new file mode 100644 index 000000000..94c922b23 --- /dev/null +++ b/source/lsp_3.17/lsp-server_message_loggers.ads @@ -0,0 +1,44 @@ +-- +-- Copyright (C) 2022-2023, AdaCore +-- +-- SPDX-License-Identifier: Apache-2.0 +-- + +-- Simple client-to-server message logger that uses 'Image to dump messages. + +with VSS.Text_Streams; + +with LSP.Server_Message_Visitors; +with LSP.Server_Notification_Loggers; +with LSP.Server_Notifications; +with LSP.Server_Request_Loggers; +with LSP.Server_Requests; +with LSP.Server_Response_Loggers; +with LSP.Server_Responses; + +package LSP.Server_Message_Loggers is + pragma Preelaborate; + + type Server_Message_Logger + (Output : not null access VSS.Text_Streams.Output_Text_Stream'Class) + is new LSP.Server_Message_Visitors.Server_Message_Visitor with record + Request : LSP.Server_Request_Loggers.Server_Request_Logger (Output); + Response : LSP.Server_Response_Loggers.Server_Response_Logger (Output); + + Notification : + LSP.Server_Notification_Loggers.Server_Notification_Logger (Output); + end record; + + overriding procedure On_Server_Notification + (Self : in out Server_Message_Logger; + Value : LSP.Server_Notifications.Server_Notification'Class); + + overriding procedure On_Server_Request + (Self : in out Server_Message_Logger; + Value : LSP.Server_Requests.Server_Request'Class); + + overriding procedure On_Server_Response + (Self : in out Server_Message_Logger; + Value : LSP.Server_Responses.Server_Response'Class); + +end LSP.Server_Message_Loggers; diff --git a/source/server/lsp-secure_message_loggers.adb b/source/server/lsp-secure_message_loggers.adb new file mode 100644 index 000000000..b1e43d5df --- /dev/null +++ b/source/server/lsp-secure_message_loggers.adb @@ -0,0 +1,325 @@ +------------------------------------------------------------------------------ +-- Language Client Protocol -- +-- -- +-- Copyright (C) 2022-2023, AdaCore -- +-- -- +-- This is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 3, or (at your option) any later ver- -- +-- sion. This software is distributed in the hope that it will be useful, -- +-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- -- +-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -- +-- License for more details. You should have received a copy of the GNU -- +-- General Public License distributed with this software; see file -- +-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy -- +-- of the license. -- +------------------------------------------------------------------------------ + +with Ada.Containers; + +with VSS.Strings; + +package body LSP.Secure_Message_Loggers is + + ---------------------------- + -- On_Client_Notification -- + ---------------------------- + + overriding procedure On_Client_Notification + (Self : in out Client_Logger; + Value : LSP.Client_Notifications.Client_Notification'Class) is + begin + Value.Visit_Client_Receiver (Self.Notification); + end On_Client_Notification; + + ----------------------- + -- On_Client_Request -- + ----------------------- + + overriding procedure On_Client_Request + (Self : in out Client_Logger; + Value : LSP.Client_Requests.Client_Request'Class) is + begin + Value.Visit_Client_Receiver (Self.Request); + end On_Client_Request; + + ------------------------ + -- On_Client_Response -- + ------------------------ + + overriding procedure On_Client_Response + (Self : in out Client_Logger; + Value : LSP.Client_Responses.Client_Response'Class) is + begin + Value.Visit_Client_Receiver (Self.Response); + end On_Client_Response; + + ---------------------------- + -- On_Server_Notification -- + ---------------------------- + + overriding procedure On_Server_Notification + (Self : in out Server_Logger; + Value : LSP.Server_Notifications.Server_Notification'Class) is + begin + Value.Visit_Server_Receiver (Self.Notification); + end On_Server_Notification; + + ----------------------- + -- On_Server_Request -- + ----------------------- + + overriding procedure On_Server_Request + (Self : in out Server_Logger; + Value : LSP.Server_Requests.Server_Request'Class) is + begin + Value.Visit_Server_Receiver (Self.Request); + end On_Server_Request; + + ------------------------ + -- On_Server_Response -- + ------------------------ + + overriding procedure On_Server_Response + (Self : in out Server_Logger; + Value : LSP.Server_Responses.Server_Response'Class) is + begin + Value.Visit_Server_Receiver (Self.Response); + end On_Server_Response; + + ---------------------------- + -- On_Completion_Response -- + ---------------------------- + + overriding procedure On_Completion_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Completion_Result) + is + Ok : Boolean := True; + begin + -- Hide response, because it could be lengthly and expose names + Self.Output.Put ("'textDocument/completion'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" result : ", Ok); + + Self.Output.Put + (VSS.Strings.To_Virtual_String + (case Value.Kind is + when LSP.Structures.Variant_1 => + "CompletionItem_Vector len=" + & Value.Variant_1.Length'Wide_Wide_Image, + when LSP.Structures.Variant_2 => + "CompletionList len=" + & Value.Variant_2.items.Length'Wide_Wide_Image + & " isIncomplete=" + & Value.Variant_2.isIncomplete'Wide_Wide_Image, + when LSP.Structures.Variant_3 => + "Null_Record"), + Ok); + + Self.Output.New_Line (Ok); + end On_Completion_Response; + + -------------------------------- + -- On_DocumentSymbol_Response -- + -------------------------------- + + overriding procedure On_DocumentSymbol_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentSymbol_Result) + is + Ok : Boolean := True; + begin + -- Hide response, because it could be lengthly and expose names + Self.Output.Put ("'textDocument/documentSymbol'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" result : ", Ok); + + Self.Output.Put + (VSS.Strings.To_Virtual_String + (case Value.Kind is + when LSP.Structures.Variant_1 => + "SymbolInformation_Vector len=" + & Value.Variant_1.Length'Wide_Wide_Image, + when LSP.Structures.Variant_2 => + "DocumentSymbol_Vector len=" + & Value.Variant_2.Length'Wide_Wide_Image, + when LSP.Structures.Variant_3 => + "Null_Record"), + Ok); + + Self.Output.New_Line (Ok); + end On_DocumentSymbol_Response; + + ------------------------------ + -- On_FoldingRange_Response -- + ------------------------------ + + overriding procedure On_FoldingRange_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.FoldingRange_Vector_Or_Null) + is + Ok : Boolean := True; + begin + -- Hide response, because it could be lengthly + Self.Output.Put ("'textDocument/foldingRange'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" result : len=", Ok); + + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value.Length'Wide_Wide_Image), Ok); + + Self.Output.New_Line (Ok); + end On_FoldingRange_Response; + + ---------------------------- + -- On_References_Response -- + ---------------------------- + + overriding procedure On_References_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Location_Vector_Or_Null) + is + Ok : Boolean := True; + begin + -- Hide response, because it could be lengthly and expose names + Self.Output.Put ("'textDocument/references'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" result : len=", Ok); + + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value.Length'Wide_Wide_Image), Ok); + + Self.Output.New_Line (Ok); + end On_References_Response; + + ----------------------------- + -- On_Tokens_Full_Response -- + ----------------------------- + + overriding procedure On_Tokens_Full_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SemanticTokens_Or_Null) + is + Ok : Boolean := True; + begin + -- Hide response, because it could be lengthly + Self.Output.Put ("'textDocument/semanticTokens/full'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" result : ", Ok); + + Self.Output.Put + (VSS.Strings.To_Virtual_String + (case Value.Is_Null is + when True => "null", + when False => "len=" + & Value.Value.data.Length'Wide_Wide_Image), Ok); + + Self.Output.New_Line (Ok); + end On_Tokens_Full_Response; + + ------------------------ + -- On_Symbol_Response -- + ------------------------ + + overriding procedure On_Symbol_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Symbol_Result) + is + Ok : Boolean := True; + begin + -- Hide response, because it could be lengthly and expose names + Self.Output.Put ("'workspace/symbol'", Ok); + Self.Put_Id (Id, Ok); + Self.Output.Put (" result : ", Ok); + + Self.Output.Put + (VSS.Strings.To_Virtual_String + (case Value.Kind is + when LSP.Structures.Variant_1 => + "SymbolInformation_Vector len=" + & Value.Variant_1.Length'Wide_Wide_Image, + when LSP.Structures.Variant_2 => + "WorkspaceSymbol_Vector len=" + & Value.Variant_2.Length'Wide_Wide_Image, + when LSP.Structures.Variant_3 => + "Null_Record"), + Ok); + + Self.Output.New_Line (Ok); + end On_Symbol_Response; + + ------------------------------- + -- On_DidChange_Notification -- + ------------------------------- + + overriding procedure On_DidChange_Notification + (Self : in out Server_Notification_Logger; + Value : LSP.Structures.DidChangeTextDocumentParams) + is + use type Ada.Containers.Count_Type; + + Ok : Boolean := True; + + Content : constant LSP.Structures.TextDocumentContentChangeEvent := + (if Value.contentChanges.Length = 1 + then Value.contentChanges.First_Element + else (text => VSS.Strings.Empty_Virtual_String, + others => <>)); + begin + -- Hide notification, because it could expose code + Self.Output.Put ("'textDocument/didChange'", Ok); + Self.Output.Put (" Params : textDocument=", Ok); + + Self.Output.Put + (VSS.Strings.To_Virtual_String (Value.textDocument'Wide_Wide_Image), + Ok); + + Self.Output.Put (" contentChanges=", Ok); + + -- If contentChanges has a single item with full text, hide it + if Value.contentChanges.Length = 1 + and then not Content.a_range.Is_Set + and then not Content.rangeLength.Is_Set + then + Self.Output.Put ("", Ok); + else + Self.Output.Put + (VSS.Strings.To_Virtual_String + (Value.contentChanges'Wide_Wide_Image), + Ok); + end if; + + Self.Output.New_Line (Ok); + end On_DidChange_Notification; + + ----------------------------- + -- On_DidOpen_Notification -- + ----------------------------- + + overriding procedure On_DidOpen_Notification + (Self : in out Server_Notification_Logger; + Value : LSP.Structures.DidOpenTextDocumentParams) + is + Ok : Boolean := True; + Item : LSP.Structures.TextDocumentItem := Value.textDocument; + begin + -- Hide notification, because it could expose code + Self.Output.Put ("'textDocument/didOpen'", Ok); + Self.Output.Put (" Params : ", Ok); + + Item.text := ""; + + Self.Output.Put + (VSS.Strings.To_Virtual_String (Item'Wide_Wide_Image), Ok); + + Self.Output.New_Line (Ok); + end On_DidOpen_Notification; + +end LSP.Secure_Message_Loggers; diff --git a/source/server/lsp-secure_message_loggers.ads b/source/server/lsp-secure_message_loggers.ads new file mode 100644 index 000000000..0865f3eb8 --- /dev/null +++ b/source/server/lsp-secure_message_loggers.ads @@ -0,0 +1,133 @@ +------------------------------------------------------------------------------ +-- Language Client Protocol -- +-- -- +-- Copyright (C) 2022-2023, AdaCore -- +-- -- +-- This is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 3, or (at your option) any later ver- -- +-- sion. This software is distributed in the hope that it will be useful, -- +-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- -- +-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -- +-- License for more details. You should have received a copy of the GNU -- +-- General Public License distributed with this software; see file -- +-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy -- +-- of the license. -- +------------------------------------------------------------------------------ + +-- Client-to-server and server-to-client message loggers that uses 'Image to +-- dump most of messages, but reduces output for other messages to avoid too +-- large dumps or leaking edited code. + +with VSS.Text_Streams; + +with LSP.Client_Message_Visitors; +with LSP.Client_Notification_Loggers; +with LSP.Client_Notifications; +with LSP.Client_Request_Loggers; +with LSP.Client_Requests; +with LSP.Client_Response_Loggers; +with LSP.Client_Responses; +with LSP.Server_Message_Visitors; +with LSP.Server_Notification_Loggers; +with LSP.Server_Notifications; +with LSP.Server_Request_Loggers; +with LSP.Server_Requests; +with LSP.Server_Response_Loggers; +with LSP.Server_Responses; + +with LSP.Structures; + +package LSP.Secure_Message_Loggers is + pragma Preelaborate; + + type Client_Response_Logger is + new LSP.Client_Response_Loggers.Client_Response_Logger + with null record; + + overriding procedure On_Completion_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Completion_Result); + + overriding procedure On_DocumentSymbol_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.DocumentSymbol_Result); + + overriding procedure On_FoldingRange_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.FoldingRange_Vector_Or_Null); + + overriding procedure On_References_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Location_Vector_Or_Null); + + overriding procedure On_Tokens_Full_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.SemanticTokens_Or_Null); + + overriding procedure On_Symbol_Response + (Self : in out Client_Response_Logger; + Id : LSP.Structures.Integer_Or_Virtual_String; + Value : LSP.Structures.Symbol_Result); + + type Server_Notification_Logger is + new LSP.Server_Notification_Loggers.Server_Notification_Logger + with null record; + + overriding procedure On_DidChange_Notification + (Self : in out Server_Notification_Logger; + Value : LSP.Structures.DidChangeTextDocumentParams); + + overriding procedure On_DidOpen_Notification + (Self : in out Server_Notification_Logger; + Value : LSP.Structures.DidOpenTextDocumentParams); + + type Client_Logger + (Output : not null access VSS.Text_Streams.Output_Text_Stream'Class) + is new LSP.Client_Message_Visitors.Client_Message_Visitor with record + Request : LSP.Client_Request_Loggers.Client_Request_Logger (Output); + Response : Client_Response_Logger (Output); + + Notification : + LSP.Client_Notification_Loggers.Client_Notification_Logger (Output); + end record; + + overriding procedure On_Client_Notification + (Self : in out Client_Logger; + Value : LSP.Client_Notifications.Client_Notification'Class); + + overriding procedure On_Client_Request + (Self : in out Client_Logger; + Value : LSP.Client_Requests.Client_Request'Class); + + overriding procedure On_Client_Response + (Self : in out Client_Logger; + Value : LSP.Client_Responses.Client_Response'Class); + + type Server_Logger + (Output : not null access VSS.Text_Streams.Output_Text_Stream'Class) + is new LSP.Server_Message_Visitors.Server_Message_Visitor with record + Request : LSP.Server_Request_Loggers.Server_Request_Logger (Output); + Response : LSP.Server_Response_Loggers.Server_Response_Logger (Output); + + Notification : Server_Notification_Logger (Output); + end record; + + overriding procedure On_Server_Notification + (Self : in out Server_Logger; + Value : LSP.Server_Notifications.Server_Notification'Class); + + overriding procedure On_Server_Request + (Self : in out Server_Logger; + Value : LSP.Server_Requests.Server_Request'Class); + + overriding procedure On_Server_Response + (Self : in out Server_Logger; + Value : LSP.Server_Responses.Server_Response'Class); + +end LSP.Secure_Message_Loggers; From 9c25a9da5a9f47e8d14e539d9f470f37e9407b4c Mon Sep 17 00:00:00 2001 From: Boulanger Date: Tue, 26 Sep 2023 12:19:22 +0200 Subject: [PATCH 151/152] Manual cherry-pick of eng/ide/ada_language_server!1345 eng/ide/gnatstudio#85 --- source/ada/lsp-ada_documents.adb | 3 +-- testsuite/ada_lsp/completion.param.threshold/test.json | 6 ++---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/source/ada/lsp-ada_documents.adb b/source/ada/lsp-ada_documents.adb index 85a8c330d..c12515925 100644 --- a/source/ada/lsp-ada_documents.adb +++ b/source/ada/lsp-ada_documents.adb @@ -354,7 +354,7 @@ package body LSP.Ada_Documents is Named_Template : constant VSS.Strings.Templates.Virtual_String_Template := - "{} => ${{{}:{} : {}{}}, "; + "{} => ${{{}:{}{}}, "; Positional_Template : constant VSS.Strings.Templates.Virtual_String_Template := "${{{}:{} : {}{}}, "; @@ -366,7 +366,6 @@ package body LSP.Ada_Documents is Named_Template.Format (LSP.Formatters.Texts.Image (Id.Text), VSS.Strings.Formatters.Integers.Image (Idx), - LSP.Formatters.Texts.Image (Id.Text), LSP.Formatters.Texts.Image (Mode_Text), LSP.Formatters.Texts.Image (Param.F_Type_Expr.Text)); diff --git a/testsuite/ada_lsp/completion.param.threshold/test.json b/testsuite/ada_lsp/completion.param.threshold/test.json index 39d89f971..91dd1fa17 100644 --- a/testsuite/ada_lsp/completion.param.threshold/test.json +++ b/testsuite/ada_lsp/completion.param.threshold/test.json @@ -169,20 +169,18 @@ { "label": "Foo", "kind": 3, - "sortText": "100&1Foo", + "sortText": "100&00001Foo", "insertText": "Foo (S => ${1:String})$0", "insertTextFormat": 2, - "additionalTextEdits": [], "detail": "procedure Foo (S : String)", "documentation": "at pack.ads (4:4)" }, { "label": "Foo", "kind": 3, - "sortText": "100&2Foo", + "sortText": "100&00002Foo", "insertText": "Foo (I => ${1:Integer}, J => ${2:Integer})$0", "insertTextFormat": 2, - "additionalTextEdits": [], "detail": "procedure Foo (I : Integer; J : Integer)", "documentation": "at pack.ads (3:4)" } From af3ed7535555a66841fb39b21de852a427e0a6ca Mon Sep 17 00:00:00 2001 From: Vadim Godunko Date: Wed, 27 Sep 2023 17:05:56 +0400 Subject: [PATCH 152/152] Code refactoring... ... to share code of Text_Document between Ada and GPR servers. --- .../ada/lsp-ada_completions-generic_assoc.adb | 5 +- .../ada/lsp-ada_documents-lal_diagnostics.adb | 9 +- source/ada/lsp-ada_documents.adb | 1051 +---------------- source/ada/lsp-ada_documents.ads | 104 +- source/ada/lsp-ada_handlers-locations.adb | 2 +- ...ada_handlers-named_parameters_commands.adb | 7 +- source/ada/lsp-ada_handlers.adb | 11 +- source/ada/lsp-utils.adb | 4 +- source/gpr/lsp-gpr_documents.adb | 385 +----- source/gpr/lsp-gpr_documents.ads | 80 +- source/gpr/lsp-gpr_handlers.adb | 6 +- .../lsp-text_documents-langkit_documents.adb | 152 +++ .../lsp-text_documents-langkit_documents.ads | 57 + source/server/lsp-text_documents.adb | 950 +++++++++++++++ source/server/lsp-text_documents.ads | 140 +++ 15 files changed, 1350 insertions(+), 1613 deletions(-) create mode 100644 source/server/lsp-text_documents-langkit_documents.adb create mode 100644 source/server/lsp-text_documents-langkit_documents.ads create mode 100644 source/server/lsp-text_documents.adb create mode 100644 source/server/lsp-text_documents.ads diff --git a/source/ada/lsp-ada_completions-generic_assoc.adb b/source/ada/lsp-ada_completions-generic_assoc.adb index 681ebc8ba..aaf63f197 100644 --- a/source/ada/lsp-ada_completions-generic_assoc.adb +++ b/source/ada/lsp-ada_completions-generic_assoc.adb @@ -405,13 +405,12 @@ package body LSP.Ada_Completions.Generic_Assoc is end if; Prefix_Span := - Self.Document.To_LSP_Range + Self.Document.To_A_Range (Langkit_Support.Slocs.Make_Range (Langkit_Support.Slocs.Start_Sloc (Get_Prefix_Node (Elem_Node, Column => Column).Sloc_Range), Sloc)); - Prefix := Self.Document.Get_Text_At - (Prefix_Span.start, Prefix_Span.an_end); + Prefix := Self.Document.Slice (Prefix_Span); Parameters := Get_Parameters (Elem_Node, Prefixed); Using_Name := Has_Designator (Unnamed_Params); diff --git a/source/ada/lsp-ada_documents-lal_diagnostics.adb b/source/ada/lsp-ada_documents-lal_diagnostics.adb index ac44a35ac..b91c4d245 100644 --- a/source/ada/lsp-ada_documents-lal_diagnostics.adb +++ b/source/ada/lsp-ada_documents-lal_diagnostics.adb @@ -40,11 +40,12 @@ package body LSP.Ada_Documents.LAL_Diagnostics is Self.Errors := Self.Get_Diagnostics (Context); for J in Self.Errors.List'Range loop - Item.a_range := Self.Document.To_LSP_Range - (Self.Errors.List (J).Sloc_Range); + Item.a_range := + Self.Document.To_A_Range (Self.Errors.List (J).Sloc_Range); - Item.message := VSS.Strings.Conversions.To_Virtual_String - (Self.Errors.List (J).Message); + Item.message := + VSS.Strings.Conversions.To_Virtual_String + (Self.Errors.List (J).Message); Errors.Append (Item); end loop; diff --git a/source/ada/lsp-ada_documents.adb b/source/ada/lsp-ada_documents.adb index c12515925..fffa3a305 100644 --- a/source/ada/lsp-ada_documents.adb +++ b/source/ada/lsp-ada_documents.adb @@ -16,7 +16,6 @@ ------------------------------------------------------------------------------ with Ada.Tags; -with Ada.Unchecked_Deallocation; with GNAT.Strings; with GNATCOLL.Traces; @@ -35,12 +34,9 @@ with Libadalang.Sources; with VSS.Characters.Latin; with VSS.Strings.Character_Iterators; with VSS.Strings.Conversions; -with VSS.Strings.Cursors; with VSS.Strings.Formatters.Integers; with VSS.Strings.Formatters.Strings; -with VSS.Strings.Line_Iterators; with VSS.Strings.Templates; -with VSS.Unicode; with LSP.Ada_Completions.Filters; with LSP.Ada_Contexts; @@ -65,25 +61,6 @@ package body LSP.Ada_Documents is ("ALS.LAL_PP_OUTPUT_ON_FORMATTING", GNATCOLL.Traces.Off); -- Logging lalpp output if On - procedure Recompute_Indexes (Self : in out Document'Class); - -- Recompute the line-to-offset indexes in Self - - procedure Recompute_Markers - (Self : in out Document'Class; - Low_Line : Natural; - Start_Marker : VSS.Strings.Markers.Character_Marker; - End_Marker : VSS.Strings.Markers.Character_Marker); - -- Recompute line-to-marker index starting from Start_Marker till - -- End_Marker and filling index table starting at Low_Line. End_Marker - -- may be invalid marker, in this case indexing down to the end of the - -- text. - - procedure Span_To_Markers - (Self : Document'Class; - Span : LSP.Structures.A_Range; - From : out VSS.Strings.Markers.Character_Marker; - To : out VSS.Strings.Markers.Character_Marker); - function To_Completion_Kind (K : LSP.Enumerations.SymbolKind) return LSP.Enumerations.CompletionItemKind is @@ -104,100 +81,6 @@ package body LSP.Ada_Documents is -- TODO: It might be better to have a unified kind, and then convert to -- specific kind types, but for the moment this is good enough. - ------------------- - -- Apply_Changes -- - ------------------- - - procedure Apply_Changes - (Self : aliased in out Document; - Version : Integer; - Vector : LSP.Structures.TextDocumentContentChangeEvent_Vector) - is - Dummy : Libadalang.Analysis.Analysis_Unit; - begin - Self.Version := Version; - - for Change of Vector loop - if Change.a_range.Is_Set then - -- We're replacing a range - - declare - Low_Line : Natural := Change.a_range.Value.start.line; - High_Line : Natural := Change.a_range.Value.an_end.line; - Delete_High : Natural := High_Line; - Start_Index : Natural; - - First_Marker : VSS.Strings.Markers.Character_Marker; - Last_Marker : VSS.Strings.Markers.Character_Marker; - Start_Marker : VSS.Strings.Markers.Character_Marker; - End_Marker : VSS.Strings.Markers.Character_Marker; - - begin - -- Do text replacement - - Self.Span_To_Markers - (Change.a_range.Value, First_Marker, Last_Marker); - Self.Text.Replace (First_Marker, Last_Marker, Change.text); - - -- Markers inside modified range of lines need to be - -- recomputed, markers outside of this range has been - -- recomputed by call to Replace. - - -- Use marker of the line before the first modified line as - -- start marker for recompute because marker of the first - -- modified line may be ether invalidated or moved by Replace, - -- or start from first character of the new text when first - -- line was modified. - - if Low_Line /= Self.Line_To_Marker.First_Index then - Low_Line := Low_Line - 1; - Start_Index := Low_Line; - Start_Marker := Self.Line_To_Marker (Low_Line); - - else - Start_Index := Self.Line_To_Marker.First_Index; - Start_Marker := Self.Text.At_First_Character.Marker; - end if; - - -- Use marker of the line after the last modified line as end - -- marker for recompute because marker of the last modified - -- line may be ether invalidated or moved and not point to the - -- beginning of the line, or use invalid marker when last line - -- was modified. - - if High_Line /= Self.Line_To_Marker.Last_Index then - Delete_High := High_Line; - High_Line := High_Line + 1; - End_Marker := Self.Line_To_Marker (High_Line); - end if; - - if Low_Line = Self.Line_To_Marker.First_Index - and then High_Line = Self.Line_To_Marker.Last_Index - then - Self.Recompute_Indexes; - - else - if Delete_High >= Low_Line then - Self.Line_To_Marker.Delete - (Low_Line, - Ada.Containers.Count_Type - (Delete_High - Low_Line + 1)); - end if; - - Self.Recompute_Markers - (Start_Index, Start_Marker, End_Marker); - end if; - end; - - else - Self.Text := Change.text; - - -- We're setting the whole text: compute the indexes now. - Self.Recompute_Indexes; - end if; - end loop; - end Apply_Changes; - ------------- -- Cleanup -- ------------- @@ -416,597 +299,6 @@ package body LSP.Ada_Documents is return Item; end Compute_Completion_Item; - ---------- - -- Diff -- - ---------- - - procedure Diff - (Self : Document; - New_Text : VSS.Strings.Virtual_String; - Old_Span : LSP.Structures.A_Range := Empty_Range; - New_Span : LSP.Structures.A_Range := Empty_Range; - Edit : out LSP.Structures.TextEdit_Vector) - is - use type LSP.Structures.A_Range; - use type LSP.Structures.Position; - - Old_First_Line : Natural; - New_First_Line : Natural; - - Old_Lines, New_Lines : VSS.String_Vectors.Virtual_String_Vector; - Old_Length, New_Length : Natural; - - begin - Old_Lines := - Self.Text.Split_Lines - (Terminators => LSP_New_Line_Function_Set, - Keep_Terminator => True); - New_Lines := - New_Text.Split_Lines - (Terminators => LSP_New_Line_Function_Set, - Keep_Terminator => True); - - if Old_Span = Empty_Range then - Old_First_Line := 1; - Old_Length := Old_Lines.Length; - - else - Old_First_Line := Natural (Old_Span.start.line + 1); - Old_Length := - Natural (Old_Span.an_end.line - Old_Span.start.line + 1); - end if; - - if New_Span = Empty_Range then - New_First_Line := 1; - New_Length := New_Lines.Length; - else - New_First_Line := Natural (New_Span.start.line + 1); - New_Length := - Natural (New_Span.an_end.line - New_Span.start.line + 1); - end if; - - declare - use type VSS.Strings.Virtual_String; - - type LCS_Array is array - (Natural range 0 .. Old_Length, - Natural range 0 .. New_Length) of Integer; - type LCS_Array_Access is access all LCS_Array; - - procedure Free is - new Ada.Unchecked_Deallocation (LCS_Array, LCS_Array_Access); - - LCS : LCS_Array_Access := new LCS_Array; - Match : Integer; - Delete : Integer; - Insert : Integer; - - Old_Index : Natural := Old_Length; - New_Index : Natural := New_Length; - - Old_Natural : Natural; - -- needed to determine which line number in the old buffer is - -- changed, deleted or before which new lines are inserted - - Changed_Block_Text : VSS.Strings.Virtual_String; - Changed_Block_Span : LSP.Structures.A_Range := ((0, 0), (0, 0)); - - procedure Prepare - (Line : Natural; - Text : VSS.Strings.Virtual_String); - -- Store imformation for Text_Etid in New_String and Span - - procedure Add (From_Line : Natural); - -- Add prepared New_String and Span into Text_Edit - - ------------- - -- Prepare -- - ------------- - - procedure Prepare - (Line : Natural; - Text : VSS.Strings.Virtual_String) is - begin - if Changed_Block_Span.an_end = (0, 0) then - -- it is the first portion of a changed block so store - -- last position of the changes - Changed_Block_Span.an_end := (Line, 0); - end if; - - -- accumulating new text for the changed block - Changed_Block_Text.Prepend (Text); - end Prepare; - - --------- - -- Add -- - --------- - - procedure Add (From_Line : Natural) is - begin - if Changed_Block_Span.an_end = (0, 0) then - -- No information for Text_Edit - return; - end if; - - Changed_Block_Span.start := - (line => From_Line, - character => 0); - - Edit.Prepend - (LSP.Structures.TextEdit' - (a_range => Changed_Block_Span, - newText => Changed_Block_Text)); - - -- clearing - Changed_Block_Text.Clear; - Changed_Block_Span := ((0, 0), (0, 0)); - end Add; - - begin - -- prepare LCS - - -- default values for line 0 - for Index in 0 .. Old_Length loop - LCS (Index, 0) := -5 * Index; - end loop; - - -- default values for the first column - for Index in 0 .. New_Length loop - LCS (0, Index) := -5 * Index; - end loop; - - -- calculate LCS - for Row in 1 .. Old_Length loop - for Column in 1 .. New_Length loop - Match := LCS (Row - 1, Column - 1) + - (if Old_Lines (Old_First_Line + Row - 1) = - New_Lines (New_First_Line + Column - 1) - then 10 -- +10 is the 'weight' for equal lines - else -1); -- and -1 for the different - - Delete := LCS (Row - 1, Column) - 5; - Insert := LCS (Row, Column - 1) - 5; - - LCS (Row, Column) := Integer'Max (Match, Insert); - LCS (Row, Column) := Integer'Max (LCS (Row, Column), Delete); - end loop; - end loop; - - -- iterate over LCS and create Text_Edit - - Old_Natural := Natural (Old_First_Line + Old_Length - 1); - - while Old_Index > 0 - and then New_Index > 0 - loop - if LCS (Old_Index, New_Index) = - LCS (Old_Index - 1, New_Index - 1) + - (if Old_Lines (Old_First_Line + Old_Index - 1) = - New_Lines (New_First_Line + New_Index - 1) - then 10 - else -1) - then - -- both has lines - if New_Lines.Element (New_First_Line + New_Index - 1) = - Old_Lines.Element (Old_First_Line + Old_Index - 1) - then - -- lines are equal, add Text_Edit after current line - -- if any is already prepared - Add (Old_Natural); - else - -- lines are different, change old line by new one, - -- we deleted whole line so 'To' position will be - -- the beginning of the next line - Prepare - (Old_Natural, - New_Lines.Element (New_First_Line + New_Index - 1)); - end if; - - -- move lines cursor backward - Old_Natural := Old_Natural - 1; - - New_Index := New_Index - 1; - Old_Index := Old_Index - 1; - - elsif LCS (Old_Index, New_Index) = - LCS (Old_Index - 1, New_Index) - 5 - then - -- line has been deleted, move lines cursor backward - Prepare (Old_Natural, VSS.Strings.Empty_Virtual_String); - - Old_Natural := Old_Natural - 1; - Old_Index := Old_Index - 1; - - elsif LCS (Old_Index, New_Index) = - LCS (Old_Index, New_Index - 1) - 5 - then - -- line has been inserted - -- insert Text_Edit information with insertion after - -- current line, do not move lines cursor because it is - -- additional line not present in the old document - Prepare - (Old_Natural, - New_Lines.Element (New_First_Line + New_Index - 1)); - - New_Index := New_Index - 1; - end if; - end loop; - - while Old_Index > 0 loop - -- deleted - Prepare (Old_Natural, VSS.Strings.Empty_Virtual_String); - - Old_Natural := Old_Natural - 1; - Old_Index := Old_Index - 1; - end loop; - - while New_Index > 0 loop - -- inserted - Prepare - (Old_Natural, - New_Lines.Element (New_First_Line + New_Index - 1)); - - New_Index := New_Index - 1; - end loop; - - Add (Old_Natural); - Free (LCS); - - -- Handle the edge case where the last location of - -- the edit is trying to affect a non existent line. - -- The edits are ordered so we only need to check the last one. - - if not Edit.Is_Empty - and then not Self.Line_To_Marker.Is_Empty - and then Edit.Last_Element.a_range.an_end.line not in - Self.Line_To_Marker.First_Index .. Self.Line_To_Marker.Last_Index - then - declare - use type VSS.Unicode.UTF16_Code_Unit_Offset; - - Element : LSP.Structures.TextEdit := Edit.Last_Element; - Last_Line : constant VSS.Strings.Virtual_String := - Old_Lines (Old_Lines.Length); - Iterator : - constant VSS.Strings.Character_Iterators.Character_Iterator := - Last_Line.At_Last_Character; - - begin - -- Replace the wrong location by the end of the buffer - Element.a_range.an_end := - (line => Natural (Old_Lines.Length) - 1, - character => Natural (Iterator.Last_UTF16_Offset) + 1); - Edit.Replace_Element (Edit.Last, Element); - end; - end if; - - exception - when others => - Free (LCS); - raise; - end; - end Diff; - - ------------------ - -- Diff_Symbols -- - ------------------ - - procedure Diff_Symbols - (Self : Document; - Span : LSP.Structures.A_Range; - New_Text : VSS.Strings.Virtual_String; - Edit : in out LSP.Structures.TextEdit_Vector) - is - use VSS.Strings; - use VSS.Characters; - - Old_Text : VSS.Strings.Virtual_String; - Old_Lines : VSS.String_Vectors.Virtual_String_Vector; - Old_Line : VSS.Strings.Virtual_String; - Old_Length, New_Length : Natural; - - First_Marker : VSS.Strings.Markers.Character_Marker; - Last_Marker : VSS.Strings.Markers.Character_Marker; - - begin - Self.Span_To_Markers (Span, First_Marker, Last_Marker); - - Old_Text := Self.Text.Slice (First_Marker, Last_Marker); - Old_Lines := Old_Text.Split_Lines - (Terminators => LSP_New_Line_Function_Set, - Keep_Terminator => True); - Old_Line := Old_Lines.Element (Old_Lines.Length); - - Old_Length := Integer (Character_Length (Old_Text)); - New_Length := Integer (Character_Length (New_Text)); - - declare - type LCS_Array is array - (Natural range 0 .. Old_Length, - Natural range 0 .. New_Length) of Integer; - type LCS_Array_Access is access all LCS_Array; - - procedure Free is - new Ada.Unchecked_Deallocation (LCS_Array, LCS_Array_Access); - - LCS : LCS_Array_Access := new LCS_Array; - Match : Integer; - Delete : Integer; - Insert : Integer; - - Old_Char : VSS.Strings.Character_Iterators.Character_Iterator := - Old_Text.At_First_Character; - - New_Char : VSS.Strings.Character_Iterators.Character_Iterator := - New_Text.At_First_Character; - - Dummy : Boolean; - - Old_Index, New_Index : Integer; - - Changed_Block_Text : VSS.Strings.Virtual_String; - Changed_Block_Span : LSP.Structures.A_Range := ((0, 0), (0, 0)); - Span_Set : Boolean := False; - - -- to calculate span - Current_Natural : Natural := - (if Natural (Span.an_end.character) = 0 - then Span.an_end.line - 1 - else Span.an_end.line); - -- we do not have a line at all when the range end is on the - -- begin of a line, so set Current_Natural to the previous one - Old_Lines_Number : Natural := Old_Lines.Length; - - Cursor : VSS.Strings.Character_Iterators.Character_Iterator := - Old_Line.After_Last_Character; - - procedure Backward; - -- Move old line Cursor backward, update Old_Line and - -- Old_Lines_Number if needed - - function Get_Position - (Insert : Boolean) return LSP.Structures.Position; - -- get Position for a Span based on Cursor to prepare first/last - -- position for changes - - procedure Prepare_Last_Span (Insert : Boolean); - -- Store position based on Cursor to Changed_Block_Span.an_end if - -- it is not stored yet - - procedure Prepare_Change - (Insert : Boolean; - Char : VSS.Characters.Virtual_Character); - -- Collect change information for Text_Edit in Changed_Block_Text - -- and Changed_Block_Span - - procedure Add_Prepared_Change; - -- Add prepared New_String and corresponding Span into Text_Edit - - -------------- - -- Backward -- - -------------- - - procedure Backward is - begin - if not Cursor.Backward - and then Old_Lines_Number > 1 - then - Current_Natural := Current_Natural - 1; - Old_Lines_Number := Old_Lines_Number - 1; - Old_Line := Old_Lines.Element (Old_Lines_Number); - Cursor.Set_At_Last (Old_Line); - end if; - - Old_Index := Old_Index - 1; - Dummy := Old_Char.Backward; - end Backward; - - ------------------ - -- Get_Position -- - ------------------ - - function Get_Position - (Insert : Boolean) return LSP.Structures.Position - is - -------------- - -- Backward -- - -------------- - - function Backward return LSP.Structures.Position; - - function Backward return LSP.Structures.Position is - C : VSS.Strings.Character_Iterators.Character_Iterator := - Old_Line.At_Character (Cursor); - begin - -- "Cursor" is after the current character but we should - -- insert before it - if C.Backward then - return - (line => Current_Natural, - character => Natural (C.First_UTF16_Offset)); - else - return - (line => Current_Natural, - character => 0); - end if; - end Backward; - - begin - if not Cursor.Has_Element then - return - (line => Current_Natural, - character => 0); - - elsif Insert then - -- "Cursor" is after the current character but we should - -- insert before it - return Backward; - - else - return - (line => Current_Natural, - character => Natural (Cursor.First_UTF16_Offset)); - end if; - end Get_Position; - - ----------------------- - -- Prepare_Last_Span -- - ----------------------- - - procedure Prepare_Last_Span (Insert : Boolean) is - begin - if not Span_Set then - -- it is the first portion of a changed block so store - -- last position of the changes - Span_Set := True; - Changed_Block_Span.an_end := Get_Position (Insert); - end if; - end Prepare_Last_Span; - - -------------------- - -- Prepare_Change -- - -------------------- - - procedure Prepare_Change - (Insert : Boolean; - Char : VSS.Characters.Virtual_Character) is - begin - Prepare_Last_Span (Insert); - -- accumulating new text for the changed block - Changed_Block_Text.Prepend (Char); - end Prepare_Change; - - ------------------------- - -- Add_Prepared_Change -- - ------------------------- - - procedure Add_Prepared_Change is - begin - if not Span_Set then - -- No information for Text_Edit - return; - end if; - - Changed_Block_Span.start := Get_Position (False); - - Edit.Prepend - (LSP.Structures.TextEdit' - (a_range => Changed_Block_Span, - newText => Changed_Block_Text)); - - -- clearing - Changed_Block_Text.Clear; - - Changed_Block_Span := ((0, 0), (0, 0)); - Span_Set := False; - end Add_Prepared_Change; - - begin - -- prepare LCS - - -- default values for line 0 - for Index in 0 .. Old_Length loop - LCS (Index, 0) := -5 * Index; - end loop; - - -- default values for the first column - for Index in 0 .. New_Length loop - LCS (0, Index) := -5 * Index; - end loop; - - -- calculate LCS - for Row in 1 .. Old_Length loop - New_Char.Set_At_First (New_Text); - for Column in 1 .. New_Length loop - Match := LCS (Row - 1, Column - 1) + - (if Old_Char.Element = New_Char.Element - then 10 -- +10 is the 'weight' for equal lines - else -1); -- and -1 for the different - - Delete := LCS (Row - 1, Column) - 5; - Insert := LCS (Row, Column - 1) - 5; - - LCS (Row, Column) := Integer'Max (Match, Insert); - LCS (Row, Column) := Integer'Max (LCS (Row, Column), Delete); - - Dummy := New_Char.Forward; - end loop; - Dummy := Old_Char.Forward; - end loop; - - -- iterate over LCS and create Text_Edit - - Old_Char.Set_At_Last (Old_Text); - New_Char.Set_At_Last (New_Text); - Old_Index := Old_Length; - New_Index := New_Length; - - while Old_Index > 0 - and then New_Index > 0 - loop - if LCS (Old_Index, New_Index) = - LCS (Old_Index - 1, New_Index - 1) + - (if Old_Char.Element = New_Char.Element - then 10 - else -1) - then - -- both has elements - if Old_Char.Element = New_Char.Element then - -- elements are equal, add prepared Text_Edit - Add_Prepared_Change; - else - -- elements are different, change old one by new - Prepare_Change (False, New_Char.Element); - end if; - - -- move old element cursors backward - Backward; - - New_Index := New_Index - 1; - Dummy := New_Char.Backward; - - elsif LCS (Old_Index, New_Index) = - LCS (Old_Index - 1, New_Index) - 5 - then - -- element has been deleted, move old cursor backward - Prepare_Last_Span (False); - Backward; - - elsif LCS (Old_Index, New_Index) = - LCS (Old_Index, New_Index - 1) - 5 - then - -- element has been inserted - Prepare_Change (True, New_Char.Element); - - New_Index := New_Index - 1; - Dummy := New_Char.Backward; - end if; - end loop; - - while Old_Index > 0 loop - -- deleted - Prepare_Last_Span (False); - Backward; - end loop; - - while New_Index > 0 loop - -- inserted - Prepare_Change (True, New_Char.Element); - - New_Index := New_Index - 1; - Dummy := New_Char.Backward; - end loop; - - Add_Prepared_Change; - Free (LCS); - - exception - when others => - Free (LCS); - raise; - end; - end Diff_Symbols; - ------------------------- -- Find_All_References -- ------------------------- @@ -1046,10 +338,7 @@ package body LSP.Ada_Documents is Sloc : constant Libadalang.Slocs.Source_Location_Range := (if Span = LSP.Constants.Empty then Libadalang.Slocs.No_Source_Location_Range - else Libadalang.Slocs.Make_Range - (Self.Get_Source_Location (Span.start), - Self.Get_Source_Location (Span.an_end))); - + else Self.To_Source_Location_Range (Span)); Input : Utils.Char_Vectors.Char_Vector; Output : Utils.Char_Vectors.Char_Vector; Out_Span : LSP.Structures.A_Range; @@ -1129,9 +418,8 @@ package body LSP.Ada_Documents is if Span = LSP.Constants.Empty then -- diff for the whole document - Diff - (Self, - VSS.Strings.Conversions.To_Virtual_String (S.all), + Self.Diff + (VSS.Strings.Conversions.To_Virtual_String (S.all), Edit => Edit); elsif Out_Sloc = Libadalang.Slocs.No_Source_Location_Range then @@ -1142,14 +430,13 @@ package body LSP.Ada_Documents is else -- diff for a part of the document - Out_Span := Self.To_LSP_Range (Out_Sloc); + Out_Span := Self.To_A_Range (Out_Sloc); -- Use line diff if the range is too wide if Span.an_end.line - Span.start.line > 5 then - Diff - (Self, - VSS.Strings.Conversions.To_Virtual_String (S.all), + Self.Diff + (VSS.Strings.Conversions.To_Virtual_String (S.all), Span, Out_Span, Edit); @@ -1163,11 +450,7 @@ package body LSP.Ada_Documents is begin LSP.Utils.Span_To_Slice (Formatted, Out_Span, Slice); - Diff_Symbols - (Self, - Span, - Slice, - Edit); + Self.Diff_Symbols (Span, Slice, Edit); end; end if; end if; @@ -1426,7 +709,7 @@ package body LSP.Ada_Documents is return Token; end Completion_Token; begin - Sloc := Self.Get_Source_Location (Position); + Sloc := Self.To_Source_Location (Position); Token := Completion_Token (Sloc); declare From : constant Langkit_Support.Slocs.Source_Location := @@ -1747,10 +1030,10 @@ package body LSP.Ada_Documents is if not foldingRange.kind.Is_Set then foldingRange.kind := (Is_Set => True, Value => LSP.Enumerations.Comment); - Span := Self.To_LSP_Range (Sloc_Range (Data (Token))); + Span := Self.To_A_Range (Sloc_Range (Data (Token))); else Span.an_end := - Self.To_LSP_Range (Sloc_Range (Data (Token))).an_end; + Self.To_A_Range (Sloc_Range (Data (Token))).an_end; end if; when Ada_Whitespace => @@ -1779,9 +1062,7 @@ package body LSP.Ada_Documents is is (Laltools.Partial_GNATPP.Get_Formatting_Region (Unit => Self.Unit (Context), Input_Range => - Langkit_Support.Slocs.Make_Range - (Self.Get_Source_Location (Position), - Self.Get_Source_Location (Position)))); + Self.To_Source_Location_Range ((Position, Position)))); --------------------- -- Get_Indentation -- @@ -1796,7 +1077,7 @@ package body LSP.Ada_Documents is (VSS.Strings.Character_Count (Laltools.Partial_GNATPP.Estimate_Indentation (Self.Unit (Context), - Self.Get_Source_Location ((Line, 1)).Line))); + Self.To_Source_Location ((Line, 1)).Line))); ----------------- -- Get_Node_At -- @@ -1810,41 +1091,9 @@ package body LSP.Ada_Documents is Unit : constant Libadalang.Analysis.Analysis_Unit := Self.Unit (Context); begin return (if Unit.Root.Is_Null then Libadalang.Analysis.No_Ada_Node - else Unit.Root.Lookup (Self.Get_Source_Location (Position))); + else Unit.Root.Lookup (Self.To_Source_Location (Position))); end Get_Node_At; - ------------------------- - -- Get_Source_Location -- - ------------------------- - - function Get_Source_Location - (Self : Document'Class; Position : LSP.Structures.Position) - return Langkit_Support.Slocs.Source_Location - is - use type VSS.Unicode.UTF16_Code_Unit_Offset; - use type VSS.Strings.Character_Index; - - Iterator : VSS.Strings.Character_Iterators.Character_Iterator := - Self.Text.At_Character (Self.Line_To_Marker (Position.line)); - - Line_Offset : constant VSS.Unicode.UTF16_Code_Unit_Offset := - Iterator.First_UTF16_Offset; - - Line_First_Character : constant VSS.Strings.Character_Index := - Iterator.Character_Index; - begin - while Integer (Iterator.First_UTF16_Offset - Line_Offset) - <= Position.character - and then Iterator.Forward - loop - null; - end loop; - - return ((Line => Langkit_Support.Slocs.Line_Number (Position.line + 1), - Column => Langkit_Support.Slocs.Column_Number - (Iterator.Character_Index - Line_First_Character))); - end Get_Source_Location; - -------------------------- -- Get_Symbol_Hierarchy -- -------------------------- @@ -1876,24 +1125,6 @@ package body LSP.Ada_Documents is raise Program_Error with "Unimplemented procedure Get_Symbols"; end Get_Symbols; - ----------------- - -- Get_Text_At -- - ----------------- - - function Get_Text_At - (Self : Document; Start_Pos : LSP.Structures.Position; - End_Pos : LSP.Structures.Position) return VSS.Strings.Virtual_String - is - First_Marker : VSS.Strings.Markers.Character_Marker; - Last_Marker : VSS.Strings.Markers.Character_Marker; - - begin - Self.Span_To_Markers - ((Start_Pos, End_Pos), First_Marker, Last_Marker); - - return Self.Text.Slice (First_Marker, Last_Marker); - end Get_Text_At; - ------------------ -- Get_Token_At -- ------------------ @@ -1903,7 +1134,7 @@ package body LSP.Ada_Documents is Position : LSP.Structures.Position) return Libadalang.Common.Token_Reference is - (Self.Unit (Context).Lookup_Token (Self.Get_Source_Location (Position))); + (Self.Unit (Context).Lookup_Token (Self.To_Source_Location (Position))); ---------------- -- Get_Tokens -- @@ -1934,7 +1165,7 @@ package body LSP.Ada_Documents is Unit : constant Libadalang.Analysis.Analysis_Unit := Self.Unit (Context); - Origin : constant Source_Location := Self.Get_Source_Location (Position); + Origin : constant Source_Location := Self.To_Source_Location (Position); Where : constant Source_Location := (Origin.Line, Origin.Column - 1); -- Compute the position we want for completion, which is one character -- before the cursor. @@ -1985,42 +1216,17 @@ package body LSP.Ada_Documents is (Self : in out Document; URI : LSP.Structures.DocumentUri; Text : VSS.Strings.Virtual_String; - Diagnostic : LSP.Diagnostic_Sources.Diagnostic_Source_Access) - is + Diagnostic : LSP.Diagnostic_Sources.Diagnostic_Source_Access) is begin - Self.URI := URI; - Self.Version := 1; - Self.Text := Text; - Self.Refresh_Symbol_Cache := True; + LSP.Text_Documents.Constructors.Initialize (Self, URI, Text); + + Self.Refresh_Symbol_Cache := True; Self.Diagnostic_Sources (1) := new LSP.Ada_Documents.LAL_Diagnostics.Diagnostic_Source (Self'Unchecked_Access); - Self.Diagnostic_Sources (2) := Diagnostic; - Recompute_Indexes (Self); + Self.Diagnostic_Sources (2) := Diagnostic; end Initialize; - --------------------- - -- Line_Terminator -- - --------------------- - - function Line_Terminator - (Self : Document'Class) return VSS.Strings.Virtual_String - is - use type VSS.Strings.Virtual_String; - - begin - return - (if Self.Line_Terminator.Is_Empty then - -- Document has no line terminator yet, return LF as most used - -- - -- Should it be platform specific? CRLF for Windows, CR for Mac? - - 1 * VSS.Characters.Latin.Line_Feed - - else - Self.Line_Terminator); - end Line_Terminator; - ---------------------- -- Range_Formatting -- ---------------------- @@ -2078,10 +1284,9 @@ package body LSP.Ada_Documents is Unit : constant Analysis_Unit := Self.Unit (Context); Input_Selection_Range : constant Source_Location_Range := - (if Span = Empty_Range then No_Source_Location_Range - else Make_Range - (Self.Get_Source_Location (Span.start), - Self.Get_Source_Location (Span.an_end))); + (if Span = LSP.Text_Documents.Empty_Range + then No_Source_Location_Range + else Self.To_Source_Location_Range (Span)); Partial_Formatting_Edit : constant Laltools.Partial_GNATPP.Partial_Formatting_Edit := Format_Selection (Unit, Input_Selection_Range, PP_Options); @@ -2099,7 +1304,7 @@ package body LSP.Ada_Documents is Edit.Clear; declare Edit_Span : constant LSP.Structures.A_Range := - Self.To_LSP_Range (Partial_Formatting_Edit.Edit.Location); + Self.To_A_Range (Partial_Formatting_Edit.Edit.Location); Edit_Text : constant VSS.Strings.Virtual_String := VSS.Strings.Conversions.To_Virtual_String (Partial_Formatting_Edit.Edit.Text); @@ -2117,100 +1322,6 @@ package body LSP.Ada_Documents is return False; end Range_Formatting; - ----------------------- - -- Recompute_Indexes -- - ----------------------- - - procedure Recompute_Indexes (Self : in out Document'Class) is - use type VSS.Strings.Character_Count; - - begin - Self.Line_To_Marker.Clear; - - -- To avoid too many reallocations during the initial filling - -- of the index vector, pre-allocate it. Give a generous - -- pre-allocation assuming that there is a line break every - -- 20 characters on average (this file has one line break - -- every 33 characters). - Self.Line_To_Marker.Reserve_Capacity - (Ada.Containers.Count_Type (Self.Text.Character_Length / 20)); - - declare - J : VSS.Strings.Line_Iterators.Line_Iterator := - Self.Text.At_First_Line - (Terminators => LSP_New_Line_Function_Set, - Keep_Terminator => True); - Last_Line_Terminated : Boolean := False; - - begin - if J.Has_Element then - -- Update Line_Terminator of the document - Self.Line_Terminator := Self.Text.Slice - (J.Terminator_First_Marker, J.Terminator_Last_Marker); - - loop - Self.Line_To_Marker.Append (J.First_Marker); - Last_Line_Terminated := J.Has_Line_Terminator; - - exit when not J.Forward; - end loop; - - else - Last_Line_Terminated := True; - -- Force to add one line for an empty document. - end if; - - -- Append marker at the end of the text when the last line has line - -- terminator sequence or text is empty. It allows to avoid checks - -- for corner cases. - - if Last_Line_Terminated then - Self.Line_To_Marker.Append (J.First_Marker); - end if; - end; - end Recompute_Indexes; - - ----------------------- - -- Recompute_Markers -- - ----------------------- - - procedure Recompute_Markers - (Self : in out Document'Class; - Low_Line : Natural; - Start_Marker : VSS.Strings.Markers.Character_Marker; - End_Marker : VSS.Strings.Markers.Character_Marker) - is - use type VSS.Strings.Character_Count; - - M : VSS.Strings.Markers.Character_Marker; - J : VSS.Strings.Line_Iterators.Line_Iterator := - Self.Text.At_Line - (Position => Start_Marker, - Terminators => LSP_New_Line_Function_Set, - Keep_Terminator => True); - Line : Natural := Low_Line; - - begin - if J.Has_Element then - loop - M := J.First_Marker; - - exit - when End_Marker.Is_Valid - and then M.Character_Index = End_Marker.Character_Index; - - Self.Line_To_Marker.Insert (Line, M); - Line := Line + 1; - - exit when not J.Forward; - end loop; - - if not End_Marker.Is_Valid then - Self.Line_To_Marker.Append (J.First_Marker); - end if; - end if; - end Recompute_Markers; - ------------------------ -- Reset_Symbol_Cache -- ------------------------ @@ -2285,49 +1396,6 @@ package body LSP.Ada_Documents is end if; end Set_Completion_Item_Documentation; - --------------------- - -- Span_To_Markers -- - --------------------- - - procedure Span_To_Markers - (Self : Document'Class; - Span : LSP.Structures.A_Range; - From : out VSS.Strings.Markers.Character_Marker; - To : out VSS.Strings.Markers.Character_Marker) - is - use type VSS.Unicode.UTF16_Code_Unit_Offset; - - J1 : VSS.Strings.Character_Iterators.Character_Iterator := - Self.Text.At_Character (Self.Line_To_Marker (Span.start.line)); - U1 : constant VSS.Unicode.UTF16_Code_Unit_Offset := - J1.First_UTF16_Offset; - - J2 : VSS.Strings.Character_Iterators.Character_Iterator := - Self.Text.At_Character (Self.Line_To_Marker (Span.an_end.line)); - U2 : constant VSS.Unicode.UTF16_Code_Unit_Offset := - J2.First_UTF16_Offset; - - Dummy : Boolean; - - begin - while Span.start.character /= Integer (J1.First_UTF16_Offset - U1) - and then J1.Forward - loop - null; - end loop; - - From := J1.Marker; - - while Span.an_end.character /= Integer (J2.First_UTF16_Offset - U2) - and then J2.Forward - loop - null; - end loop; - - Dummy := J2.Backward; - To := J2.Marker; - end Span_To_Markers; - --------------------- -- To_LSP_Location -- --------------------- @@ -2338,70 +1406,9 @@ package body LSP.Ada_Documents is Kinds : LSP.Structures.AlsReferenceKind_Set := LSP.Constants.Empty) return LSP.Structures.Location is (uri => Self.URI, - a_range => Self.To_LSP_Range (Segment), + a_range => Self.To_A_Range (Segment), alsKind => Kinds); - ------------------ - -- To_LSP_Range -- - ------------------ - - function To_LSP_Range - (Self : Document; - Segment : Langkit_Support.Slocs.Source_Location_Range) - return LSP.Structures.A_Range - is - - Start_Line : constant Natural := Natural (Segment.Start_Line) - 1; - - Start_Line_Text : constant VSS.Strings.Virtual_String := - (if Self.Line_To_Marker.Last_Index = Start_Line then - Self.Text.Slice - (Self.Line_To_Marker (Start_Line), Self.Text.After_Last_Character) - else - Self.Text.Slice - (Self.Line_To_Marker (Start_Line), - Self.Line_To_Marker (Start_Line + 1))); - Start_Iterator : VSS.Strings.Character_Iterators.Character_Iterator := - Start_Line_Text.At_First_Character; - - End_Line : constant Natural := Natural (Segment.End_Line) - 1; - End_Line_Text : constant VSS.Strings.Virtual_String := - (if Self.Line_To_Marker.Last_Index = End_Line then - Self.Text.Slice - (Self.Line_To_Marker (End_Line), Self.Text.After_Last_Character) - else - Self.Text.Slice - (Self.Line_To_Marker (End_Line), - Self.Line_To_Marker (End_Line + 1))); - End_Iterator : VSS.Strings.Character_Iterators.Character_Iterator := - End_Line_Text.At_First_Character; - Success : Boolean with Unreferenced; - - begin - -- Iterating forward through the line of the start position, initial - -- iterator points to the first characters, thus "starts" from the - -- second one. - - for J in 2 .. Segment.Start_Column loop - Success := Start_Iterator.Forward; - end loop; - - -- Iterating forward through the line of the end position. For the same - -- reason "starts" from second character. - - for J in 2 .. Segment.End_Column loop - Success := End_Iterator.Forward; - end loop; - - return - (start => - (line => Start_Line, - character => Natural (Start_Iterator.First_UTF16_Offset)), - an_end => - (line => End_Line, - character => Natural (End_Iterator.Last_UTF16_Offset))); - end To_LSP_Range; - ---------- -- Unit -- ---------- @@ -2415,12 +1422,4 @@ package body LSP.Ada_Documents is Charset => Context.Charset, Reparse => False)); - -------------------------- - -- Versioned_Identifier -- - -------------------------- - - function Versioned_Identifier - (Self : Document) return LSP.Structures.VersionedTextDocumentIdentifier - is (Self.URI, Self.Version); - end LSP.Ada_Documents; diff --git a/source/ada/lsp-ada_documents.ads b/source/ada/lsp-ada_documents.ads index 474425fac..ae498ef5c 100644 --- a/source/ada/lsp-ada_documents.ads +++ b/source/ada/lsp-ada_documents.ads @@ -21,7 +21,6 @@ with Ada.Containers.Ordered_Maps; with Ada.Containers.Vectors; with VSS.String_Vectors; with VSS.Strings; -private with VSS.Strings.Markers; with Libadalang.Analysis; with Libadalang.Common; @@ -36,6 +35,7 @@ with LSP.Ada_Completions; with LSP.Ada_Highlighters; with LSP.Constants; with LSP.Diagnostic_Sources; +with LSP.Text_Documents.Langkit_Documents; with LSP.Search; with LSP.Structures; with LSP.Tracers; @@ -44,13 +44,9 @@ package LSP.Ada_Documents is MAX_NB_DIAGNOSTICS : constant := 2; - LSP_New_Line_Function_Set : constant VSS.Strings.Line_Terminator_Set := - (VSS.Strings.CR | VSS.Strings.CRLF | VSS.Strings.LF => True, - others => False); - -- LSP allows to use three kinds of line terminators: CR, CR+LF and LF. - type Document (Tracer : not null LSP.Tracers.Tracer_Access) is - tagged limited private; + new LSP.Text_Documents.Langkit_Documents.Langkit_Text_Document + with private; -- An Ada document (file). type Document_Access is access all LSP.Ada_Documents.Document @@ -67,28 +63,6 @@ package LSP.Ada_Documents is procedure Cleanup (Self : in out Document); -- Free all the data associated to this document. - ----------------------- - -- Contents handling -- - ----------------------- - - function URI (Self : Document) return LSP.Structures.DocumentUri; - -- Return the URI associated with Self - - function Text (Self : Document) return VSS.Strings.Virtual_String; - -- Return the text associated with Self - - function Get_Text_At - (Self : Document; - Start_Pos : LSP.Structures.Position; - End_Pos : LSP.Structures.Position) return VSS.Strings.Virtual_String; - -- Return the text in the specified range. - - function To_LSP_Range - (Self : Document; - Segment : Langkit_Support.Slocs.Source_Location_Range) - return LSP.Structures.A_Range; - -- Convert LAL's Source_Location_Range to LSP's Range - function To_LSP_Location (Self : Document; Segment : Langkit_Support.Slocs.Source_Location_Range; @@ -96,15 +70,6 @@ package LSP.Ada_Documents is return LSP.Structures.Location; -- Convert LAL's Source_Location_Range and document's uri to a LSP location - procedure Apply_Changes - (Self : aliased in out Document; - Version : Integer; - Vector : LSP.Structures.TextDocumentContentChangeEvent_Vector); - -- Modify document according to event vector provided by LSP client. - - function Versioned_Identifier - (Self : Document) return LSP.Structures.VersionedTextDocumentIdentifier; - -------------- -- Requests -- -------------- @@ -314,16 +279,6 @@ package LSP.Ada_Documents is -- Either set the item documentation and details or setup it to produce -- them for the Completion_Resolve request. - function Get_Source_Location - (Self : Document'Class; - Position : LSP.Structures.Position) - return Langkit_Support.Slocs.Source_Location; - -- Convert a Positon to a Source_Location - - function Line_Terminator - (Self : Document'Class) return VSS.Strings.Virtual_String; - -- Return line terminator for the document - function Get_Token_At (Self : Document'Class; Context : LSP.Ada_Contexts.Context; @@ -341,11 +296,6 @@ package LSP.Ada_Documents is private - package Line_Marker_Vectors is new Ada.Containers.Vectors - (Index_Type => Natural, - Element_Type => VSS.Strings.Markers.Character_Marker, - "=" => VSS.Strings.Markers."="); - type Name_Information is record Loc : Langkit_Support.Slocs.Source_Location; Is_Public : Boolean; @@ -364,61 +314,15 @@ private LSP.Diagnostic_Sources.Diagnostic_Source_Access; type Document (Tracer : not null LSP.Tracers.Tracer_Access) is - tagged limited - record - URI : LSP.Structures.DocumentUri; - - Version : Integer := 1; - -- Document version - - Text : VSS.Strings.Virtual_String; - -- The text of the document - - Line_To_Marker : Line_Marker_Vectors.Vector; - -- Within text, an array associating a line number (starting at 0) to - -- the marker of the first character of that line in Text. - -- This serves as cache to be able to modify text ranges in Text - -- given in line/column coordinates without having to scan the whole - -- text from the beginning. - + new LSP.Text_Documents.Langkit_Documents.Langkit_Text_Document with record Symbol_Cache : Symbol_Maps.Map; -- Cache of all defining name symbol of the document. Refresh_Symbol_Cache : Boolean := False; -- Symbol_Cache rebuild is required before. - Line_Terminator : VSS.Strings.Virtual_String; - -- Line terminator for the text, if known, "" otherwise Diagnostic_Sources : Diagnostic_Source_Array (1 .. 2); -- Known sources of diagnostics end record; - Empty_Range : LSP.Structures.A_Range := ((1, 1), (0, 0)); - - procedure Diff - (Self : Document; - New_Text : VSS.Strings.Virtual_String; - Old_Span : LSP.Structures.A_Range := Empty_Range; - New_Span : LSP.Structures.A_Range := Empty_Range; - Edit : out LSP.Structures.TextEdit_Vector); - -- Create a diff between document Text and New_Text and return Text_Edit - -- based on Needleman-Wunsch algorithm. - -- Old_Span and New_Span are used when we need to compare certain - -- old/new lines instead of whole buffers. - - procedure Diff_Symbols - (Self : Document; - Span : LSP.Structures.A_Range; - New_Text : VSS.Strings.Virtual_String; - Edit : in out LSP.Structures.TextEdit_Vector); - -- Create a diff between document Text inside Span and New_Chunk and - -- return Text_Edit. Tests individual symbols instead of lines - -- as above. Do not use it for large text slices because it - -- creates an N^M map for symbols. - - function URI (Self : Document) return LSP.Structures.DocumentUri is - (Self.URI); - function Text (Self : Document) return VSS.Strings.Virtual_String is - (Self.Text); - function Unit (Self : Document'Class; Context : LSP.Ada_Contexts.Context) diff --git a/source/ada/lsp-ada_handlers-locations.adb b/source/ada/lsp-ada_handlers-locations.adb index 937860cd6..1fc3342b9 100644 --- a/source/ada/lsp-ada_handlers-locations.adb +++ b/source/ada/lsp-ada_handlers-locations.adb @@ -75,7 +75,7 @@ package body LSP.Ada_Handlers.Locations is if File = Node_File then Result.Append (LSP.Structures.DocumentHighlight' - (a_range => Document.To_LSP_Range (Node.Sloc_Range), + (a_range => Document.To_A_Range (Node.Sloc_Range), kind => Kind)); end if; end Append_Location; diff --git a/source/ada/lsp-ada_handlers-named_parameters_commands.adb b/source/ada/lsp-ada_handlers-named_parameters_commands.adb index fceee8095..68396ef56 100644 --- a/source/ada/lsp-ada_handlers-named_parameters_commands.adb +++ b/source/ada/lsp-ada_handlers-named_parameters_commands.adb @@ -212,8 +212,6 @@ package body LSP.Ada_Handlers.Named_Parameters_Commands is Args : Libadalang.Analysis.Basic_Assoc_List; Params : VSS.String_Vectors.Virtual_String_Vector; Index : Natural := 0; - Version : constant LSP.Structures.VersionedTextDocumentIdentifier := - Document.Versioned_Identifier; begin Apply.label := VSS.Strings.Conversions.To_Virtual_String @@ -225,10 +223,7 @@ package body LSP.Ada_Handlers.Named_Parameters_Commands is (Kind => documentChanges_OfWorkspaceEdit_Item_Variant'(Variant_1), Variant_1 => - (textDocument => - (uri => Version.uri, - version => (Is_Null => False, - Value => Version.version)), + (textDocument => Document.Identifier, edits => <>))); end if; diff --git a/source/ada/lsp-ada_handlers.adb b/source/ada/lsp-ada_handlers.adb index ba90149ef..5b99b61ff 100644 --- a/source/ada/lsp-ada_handlers.adb +++ b/source/ada/lsp-ada_handlers.adb @@ -345,10 +345,7 @@ package body LSP.Ada_Handlers is return (URI, LSP.Structures.Integer_Or_Null'(Is_Null => True)); else - return - (uri => Document.Versioned_Identifier.uri, - version => (Is_Null => False, - Value => Document.Versioned_Identifier.version)); + return Document.Identifier; end if; end Get_Open_Document_Version; @@ -3540,7 +3537,7 @@ package body LSP.Ada_Handlers is Laltools.Partial_GNATPP.Previous_Non_Whitespace_Non_Comment_Token (Token); Previous_NWNC_Token_Span : constant LSP.Structures.A_Range := - Document.To_LSP_Range + Document.To_A_Range (Libadalang.Common.Sloc_Range (Libadalang.Common.Data (Previous_NWNC_Token))); @@ -3549,7 +3546,7 @@ package body LSP.Ada_Handlers is Document.Get_Formatting_Region (Context.all, Previous_NWNC_Token_Span.start); Formatting_Span : constant LSP.Structures.A_Range := - Document.To_LSP_Range + Document.To_A_Range (Libadalang.Slocs.Make_Range (Libadalang.Slocs.Start_Sloc (Libadalang.Common.Sloc_Range @@ -4263,7 +4260,7 @@ package body LSP.Ada_Handlers is Document : constant LSP.Ada_Documents.Document_Access := Self.Get_Open_Document (Value.textDocument.uri); Location : constant Langkit_Support.Slocs.Source_Location := - Document.Get_Source_Location (Value.position); + Document.To_Source_Location (Value.position); Position : LSP.Structures.Position := Value.position; Node : Libadalang.Analysis.Ada_Node; diff --git a/source/ada/lsp-utils.adb b/source/ada/lsp-utils.adb index d8c9db178..a034a1ab4 100644 --- a/source/ada/lsp-utils.adb +++ b/source/ada/lsp-utils.adb @@ -37,7 +37,7 @@ with VSS.String_Vectors; with VSS.Unicode; with Laltools.Common; -with LSP.Ada_Documents; +with LSP.Text_Documents; with LSP.Constants; with LSP.Formatters.File_Names; with URIs; @@ -521,7 +521,7 @@ package body LSP.Utils is begin Lines := Text.Split_Lines - (Terminators => LSP.Ada_Documents.LSP_New_Line_Function_Set, + (Terminators => LSP.Text_Documents.LSP_New_Line_Function_Set, Keep_Terminator => True); Line := Lines (Num); diff --git a/source/gpr/lsp-gpr_documents.adb b/source/gpr/lsp-gpr_documents.adb index 7a5f48d7f..f82015a76 100644 --- a/source/gpr/lsp-gpr_documents.adb +++ b/source/gpr/lsp-gpr_documents.adb @@ -15,149 +15,10 @@ -- of the license. -- ------------------------------------------------------------------------------ -with GNATCOLL.Traces; - with GPR2.Message; -with VSS.Characters.Latin; -with VSS.Strings.Character_Iterators; -with VSS.Strings.Conversions; -with VSS.Strings.Line_Iterators; -with VSS.Unicode; - package body LSP.GPR_Documents is - Document_Changes_Trace : constant GNATCOLL.Traces.Trace_Handle := - GNATCOLL.Traces.Create ("ALS.DOCUMENT_CHANGES", - GNATCOLL.Traces.Off); - -- Logging each document change - - LSP_New_Line_Function_Set : constant VSS.Strings.Line_Terminator_Set := - (VSS.Strings.CR | VSS.Strings.CRLF | VSS.Strings.LF => True, - others => False); - -- LSP allows to use three kinds of line terminators: CR, CR+LF and LF. - - procedure Span_To_Markers - (Self : Document'Class; - Span : LSP.Structures.A_Range; - From : out VSS.Strings.Markers.Character_Marker; - To : out VSS.Strings.Markers.Character_Marker); - - procedure Recompute_Indexes (Self : in out Document); - -- Recompute the line-to-offset indexes in Self - - procedure Recompute_Markers - (Self : in out Document'Class; - Low_Line : Natural; - Start_Marker : VSS.Strings.Markers.Character_Marker; - End_Marker : VSS.Strings.Markers.Character_Marker); - -- Recompute line-to-marker index starting from Start_Marker till - -- End_Marker and filling index table starting at Low_Line. End_Marker - -- may be invalid marker, in this case indexing down to the end of the - -- text. - - ------------------- - -- Apply_Changes -- - ------------------- - - procedure Apply_Changes - (Self : aliased in out Document; - Version : Integer; - Vector : LSP.Structures.TextDocumentContentChangeEvent_Vector) - is - URI : constant String := - VSS.Strings.Conversions.To_UTF_8_String (Self.URI); - - begin - Document_Changes_Trace.Trace ("Applying changes for document " & URI); - - Self.Version := Version; - - for Change of Vector loop - if Change.a_range.Is_Set then - -- We're replacing a range - - declare - Low_Line : Natural := Change.a_range.Value.start.line; - High_Line : Natural := Change.a_range.Value.an_end.line; - Delete_High : Natural := High_Line; - Start_Index : Natural; - - First_Marker : VSS.Strings.Markers.Character_Marker; - Last_Marker : VSS.Strings.Markers.Character_Marker; - Start_Marker : VSS.Strings.Markers.Character_Marker; - End_Marker : VSS.Strings.Markers.Character_Marker; - - begin - -- Do text replacement - - Self.Span_To_Markers - (Change.a_range.Value, First_Marker, Last_Marker); - Self.Text.Replace (First_Marker, Last_Marker, Change.text); - - -- Markers inside modified range of lines need to be - -- recomputed, markers outside of this range has been - -- recomputed by call to Replace. - - -- Use marker of the line before the first modified line as - -- start marker for recompute because marker of the first - -- modified line may be ether invalidated or moved by Replace, - -- or start from first character of the new text when first - -- line was modified. - - if Low_Line /= Self.Line_To_Marker.First_Index then - Low_Line := Low_Line - 1; - Start_Index := Low_Line; - Start_Marker := Self.Line_To_Marker (Low_Line); - - else - Start_Index := Self.Line_To_Marker.First_Index; - Start_Marker := Self.Text.At_First_Character.Marker; - end if; - - -- Use marker of the line after the last modified line as end - -- marker for recompute because marker of the last modified - -- line may be ether invalidated or moved and not point to the - -- beginning of the line, or use invalid marker when last line - -- was modified. - - if High_Line /= Self.Line_To_Marker.Last_Index then - Delete_High := High_Line; - High_Line := High_Line + 1; - End_Marker := Self.Line_To_Marker (High_Line); - end if; - - if Low_Line = Self.Line_To_Marker.First_Index - and then High_Line = Self.Line_To_Marker.Last_Index - then - Self.Recompute_Indexes; - - else - if Delete_High >= Low_Line then - Self.Line_To_Marker.Delete - (Low_Line, - Ada.Containers.Count_Type - (Delete_High - Low_Line + 1)); - end if; - - Self.Recompute_Markers - (Start_Index, Start_Marker, End_Marker); - end if; - end; - - else - Self.Text := Change.text; - - -- We're setting the whole text: compute the indexes now. - - Self.Recompute_Indexes; - end if; - end loop; - - Document_Changes_Trace.Trace - ("Done applying changes for document " & URI); - end Apply_Changes; - ------------- -- Cleanup -- ------------- @@ -238,75 +99,6 @@ package body LSP.GPR_Documents is end if; end Get_Errors; - ------------------------- - -- Get_Source_Location -- - ------------------------- - - function Get_Source_Location - (Self : Document'Class; - Position : LSP.Structures.Position) - return Langkit_Support.Slocs.Source_Location - is - use type VSS.Unicode.UTF16_Code_Unit_Offset; - use type VSS.Strings.Character_Index; - - Iterator : VSS.Strings.Character_Iterators.Character_Iterator := - Self.Text.At_Character (Self.Line_To_Marker (Position.line)); - - Line_Offset : constant VSS.Unicode.UTF16_Code_Unit_Offset := - Iterator.First_UTF16_Offset; - - Line_First_Character : constant VSS.Strings.Character_Index := - Iterator.Character_Index; - - begin - while Integer (Iterator.First_UTF16_Offset - Line_Offset) - <= Position.character - and then Iterator.Forward - loop - null; - end loop; - - return - ((Line => Langkit_Support.Slocs.Line_Number (Position.line + 1), - Column => Langkit_Support.Slocs.Column_Number - (Iterator.Character_Index - Line_First_Character))); - end Get_Source_Location; - - ----------------- - -- Get_Text_At -- - ----------------- - - function Get_Text_At - (Self : Document; - Start_Pos : LSP.Structures.Position; - End_Pos : LSP.Structures.Position) return VSS.Strings.Virtual_String - is - First_Marker : VSS.Strings.Markers.Character_Marker; - Last_Marker : VSS.Strings.Markers.Character_Marker; - - begin - Self.Span_To_Markers - ((Start_Pos, End_Pos), First_Marker, Last_Marker); - - return Self.Text.Slice (First_Marker, Last_Marker); - end Get_Text_At; - - ----------------- - -- Get_Word_At -- - ----------------- - - function Get_Word_At - (Self : Document; - Position : LSP.Structures.Position) - return VSS.Strings.Virtual_String - is - Result : VSS.Strings.Virtual_String; - - begin - return Result; - end Get_Word_At; - --------------------- -- Has_Diagnostics -- --------------------- @@ -329,37 +121,12 @@ package body LSP.GPR_Documents is Text : VSS.Strings.Virtual_String; Provider : LSP.GPR_Files.File_Provider_Access) is begin - Self.URI := URI; + LSP.Text_Documents.Constructors.Initialize (Self, URI, Text); + Self.File := File; - Self.Version := 1; - Self.Text := Text; Self.File_Provider := Provider; - - Recompute_Indexes (Self); end Initialize; - --------------------- - -- Line_Terminator -- - --------------------- - - function Line_Terminator - (Self : Document'Class) return VSS.Strings.Virtual_String - is - use type VSS.Strings.Virtual_String; - - begin - if Self.Line_Terminator.Is_Empty then - -- Document has no line terminator yet, return LF as most used - -- - -- Should it be platform specific? CRLF for Windows, CR for Mac? - - return 1 * VSS.Characters.Latin.Line_Feed; - - else - return Self.Line_Terminator; - end if; - end Line_Terminator; - ---------- -- Load -- ---------- @@ -411,143 +178,6 @@ package body LSP.GPR_Documents is end Load; - ----------------------- - -- Recompute_Indexes -- - ----------------------- - - procedure Recompute_Indexes (Self : in out Document) is - use type VSS.Strings.Character_Count; - - begin - Self.Line_To_Marker.Clear; - - -- To avoid too many reallocations during the initial filling - -- of the index vector, pre-allocate it. Give a generous - -- pre-allocation assuming that there is a line break every - -- 20 characters on average (this file has one line break - -- every 33 characters). - Self.Line_To_Marker.Reserve_Capacity - (Ada.Containers.Count_Type (Self.Text.Character_Length / 20)); - - declare - J : VSS.Strings.Line_Iterators.Line_Iterator := - Self.Text.At_First_Line - (Terminators => LSP_New_Line_Function_Set, - Keep_Terminator => True); - Last_Line_Terminated : Boolean := False; - - begin - if J.Has_Element then - -- Update Line_Terminator of the document - Self.Line_Terminator := Self.Text.Slice - (J.Terminator_First_Marker, J.Terminator_Last_Marker); - - loop - Self.Line_To_Marker.Append (J.First_Marker); - Last_Line_Terminated := J.Has_Line_Terminator; - - exit when not J.Forward; - end loop; - - else - Last_Line_Terminated := True; - -- Force to add one line for an empty document. - end if; - - -- Append marker at the end of the text when the last line has line - -- terminator sequence or text is empty. It allows to avoid checks - -- for corner cases. - - if Last_Line_Terminated then - Self.Line_To_Marker.Append (J.First_Marker); - end if; - end; - end Recompute_Indexes; - - ----------------------- - -- Recompute_Markers -- - ----------------------- - - procedure Recompute_Markers - (Self : in out Document'Class; - Low_Line : Natural; - Start_Marker : VSS.Strings.Markers.Character_Marker; - End_Marker : VSS.Strings.Markers.Character_Marker) - is - use type VSS.Strings.Character_Count; - - M : VSS.Strings.Markers.Character_Marker; - J : VSS.Strings.Line_Iterators.Line_Iterator := - Self.Text.At_Line - (Position => Start_Marker, - Terminators => LSP_New_Line_Function_Set, - Keep_Terminator => True); - Line : Natural := Low_Line; - - begin - if J.Has_Element then - loop - M := J.First_Marker; - - exit - when End_Marker.Is_Valid - and then M.Character_Index = End_Marker.Character_Index; - - Self.Line_To_Marker.Insert (Line, M); - Line := Line + 1; - - exit when not J.Forward; - end loop; - - if not End_Marker.Is_Valid then - Self.Line_To_Marker.Append (J.First_Marker); - end if; - end if; - end Recompute_Markers; - - --------------------- - -- Span_To_Markers -- - --------------------- - - procedure Span_To_Markers - (Self : Document'Class; - Span : LSP.Structures.A_Range; - From : out VSS.Strings.Markers.Character_Marker; - To : out VSS.Strings.Markers.Character_Marker) - is - use type VSS.Unicode.UTF16_Code_Unit_Offset; - - J1 : VSS.Strings.Character_Iterators.Character_Iterator := - Self.Text.At_Character (Self.Line_To_Marker (Span.start.line)); - U1 : constant VSS.Unicode.UTF16_Code_Unit_Offset := - J1.First_UTF16_Offset; - - J2 : VSS.Strings.Character_Iterators.Character_Iterator := - Self.Text.At_Character (Self.Line_To_Marker (Span.an_end.line)); - U2 : constant VSS.Unicode.UTF16_Code_Unit_Offset := - J2.First_UTF16_Offset; - - Dummy : Boolean; - - begin - while Span.start.character /= Integer (J1.First_UTF16_Offset - U1) - and then J1.Forward - loop - null; - end loop; - - From := J1.Marker; - - while Span.an_end.character /= Integer (J2.First_UTF16_Offset - U2) - and then J2.Forward - loop - null; - end loop; - - Dummy := J2.Backward; - To := J2.Marker; - end Span_To_Markers; - ----------------------------- -- Update_Files_With_Diags -- ----------------------------- @@ -558,15 +188,4 @@ package body LSP.GPR_Documents is Self.Published_Files_With_Diags := Files; end Update_Files_With_Diags; - -------------------------- - -- Versioned_Identifier -- - -------------------------- - - function Versioned_Identifier - (Self : Document) return LSP.Structures.VersionedTextDocumentIdentifier is - begin - return (uri => Self.URI, - version => Self.Version); - end Versioned_Identifier; - end LSP.GPR_Documents; diff --git a/source/gpr/lsp-gpr_documents.ads b/source/gpr/lsp-gpr_documents.ads index c9b82fc79..5bd81a27f 100644 --- a/source/gpr/lsp-gpr_documents.ads +++ b/source/gpr/lsp-gpr_documents.ads @@ -32,17 +32,17 @@ with GPR2.Path_Name; with GPR2.Path_Name.Set; with GPR2.Project.Tree; +with LSP.Text_Documents; with LSP.GPR_Files; with LSP.Structures; with LSP.Tracers; with VSS.Strings; -private with VSS.Strings.Markers; package LSP.GPR_Documents is type Document (Tracer : not null LSP.Tracers.Tracer_Access) is - tagged limited private; + new LSP.Text_Documents.Text_Document with private; -- A GPR document (file). type Document_Access is access all LSP.GPR_Documents.Document @@ -75,31 +75,6 @@ package LSP.GPR_Documents is procedure Cleanup (Self : in out Document); -- Free all the data associated to this document. - ----------------------- - -- Contents handling -- - ----------------------- - - function URI (Self : Document) return LSP.Structures.DocumentUri; - -- Return the URI associated with Self - - function Text (Self : Document) return VSS.Strings.Virtual_String; - -- Return the text associated with Self - - function Get_Text_At - (Self : Document; - Start_Pos : LSP.Structures.Position; - End_Pos : LSP.Structures.Position) return VSS.Strings.Virtual_String; - -- Return the text in the specified range. - - procedure Apply_Changes - (Self : aliased in out Document; - Version : Integer; - Vector : LSP.Structures.TextDocumentContentChangeEvent_Vector); - -- Modify document according to event vector provided by LSP client. - - function Versioned_Identifier - (Self : Document) return LSP.Structures.VersionedTextDocumentIdentifier; - -------------- -- Requests -- -------------- @@ -118,12 +93,6 @@ package LSP.GPR_Documents is return Boolean; -- Returns True when errors found during document parsing. - function Get_Word_At - (Self : Document; - Position : LSP.Structures.Position) - return VSS.Strings.Virtual_String; - -- Get an identifier at given position in the document or an empty string. - ----------------------- -- Document_Provider -- ----------------------- @@ -156,26 +125,11 @@ package LSP.GPR_Documents is -- If the document is not opened, then it returns a -- VersionedTextDocumentIdentifier with a null version. - function Get_Source_Location - (Self : Document'Class; - Position : LSP.Structures.Position) - return Langkit_Support.Slocs.Source_Location; - -- Convert a Position to a Source_Location - - function Line_Terminator - (Self : Document'Class) return VSS.Strings.Virtual_String; - -- Return line terminator for the document - procedure Update_Files_With_Diags (Self : in out Document'Class; Files : GPR2.Path_Name.Set.Object); private - package Line_Marker_Vectors is new Ada.Containers.Vectors - (Index_Type => Natural, - Element_Type => VSS.Strings.Markers.Character_Marker, - "=" => VSS.Strings.Markers."="); - type Name_Information is record Loc : Langkit_Support.Slocs.Source_Location; Is_Public : Boolean; @@ -190,21 +144,11 @@ private "<" => VSS.Strings."<", "=" => Name_Vectors."="); - type Document - (Tracer : not null LSP.Tracers.Tracer_Access) is tagged limited record - - URI : LSP.Structures.DocumentUri; - -- document's file URI - + type Document (Tracer : not null LSP.Tracers.Tracer_Access) is + new LSP.Text_Documents.Text_Document with record File : GPR2.Path_Name.Object; -- document's file path - Version : Integer := 1; - -- Document version - - Text : VSS.Strings.Virtual_String; - -- The text of the document - Tree : GPR2.Project.Tree.Object; -- The loaded tree @@ -226,25 +170,9 @@ private Errors_Changed : Boolean; -- True if Messages content was not yet published - Line_To_Marker : Line_Marker_Vectors.Vector; - -- Within text, an array associating a line number (starting at 0) to - -- the marker of the first character of that line in Text. - -- This serves as cache to be able to modify text ranges in Text - -- given in line/column coordinates without having to scan the whole - -- text from the beginning. - - Line_Terminator : VSS.Strings.Virtual_String; - -- Line terminator for the text, if known, "" otherwise - Published_Files_With_Diags : GPR2.Path_Name.Set.Object; -- Protocol requires publishing empty diags to clear diags on client. -- This set records files with diags previously published. - end record; - function URI (Self : Document) return LSP.Structures.DocumentUri is - (Self.URI); - function Text (Self : Document) return VSS.Strings.Virtual_String is - (Self.Text); - end LSP.GPR_Documents; diff --git a/source/gpr/lsp-gpr_handlers.adb b/source/gpr/lsp-gpr_handlers.adb index b1c47c098..34cbfd2e0 100644 --- a/source/gpr/lsp-gpr_handlers.adb +++ b/source/gpr/lsp-gpr_handlers.adb @@ -154,11 +154,7 @@ package body LSP.GPR_Handlers is return (URI, (Is_Null => True)); else - return - (uri => Target_Text_Document.Versioned_Identifier.uri, - version => - (Is_Null => False, - Value => Target_Text_Document.Versioned_Identifier.version)); + return Target_Text_Document.Identifier; end if; end Get_Open_Document_Version; diff --git a/source/server/lsp-text_documents-langkit_documents.adb b/source/server/lsp-text_documents-langkit_documents.adb new file mode 100644 index 000000000..2af66a809 --- /dev/null +++ b/source/server/lsp-text_documents-langkit_documents.adb @@ -0,0 +1,152 @@ +------------------------------------------------------------------------------ +-- Language Server Protocol -- +-- -- +-- Copyright (C) 2023, AdaCore -- +-- -- +-- This is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 3, or (at your option) any later ver- -- +-- sion. This software is distributed in the hope that it will be useful, -- +-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- -- +-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -- +-- License for more details. You should have received a copy of the GNU -- +-- General Public License distributed with this software; see file -- +-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy -- +-- of the license. -- +------------------------------------------------------------------------------ + +with VSS.Strings.Character_Iterators; +with VSS.Unicode; + +package body LSP.Text_Documents.Langkit_Documents is + + function To_LSP_Line + (Line : Langkit_Support.Slocs.Line_Number) return Natural + is (Natural (Line) - 1); + + function Line + (Self : Langkit_Text_Document'Class; + Index : Langkit_Support.Slocs.Line_Number) + return VSS.Strings.Virtual_String; + + ---------- + -- Line -- + ---------- + + function Line + (Self : Langkit_Text_Document'Class; + Index : Langkit_Support.Slocs.Line_Number) + return VSS.Strings.Virtual_String + is + Line : constant Natural := To_LSP_Line (Index); + + begin + if Self.Line_Marker.Last_Index = Line then + return + Self.Text.Slice + (Self.Line_Marker (Line), Self.Text.After_Last_Character); + + else + return + Self.Text.Slice + (Self.Line_Marker (Line), Self.Line_Marker (Line + 1)); + end if; + end Line; + + ---------------- + -- To_A_Range -- + ---------------- + + function To_A_Range + (Self : Langkit_Text_Document'Class; + A_Range : Langkit_Support.Slocs.Source_Location_Range) + return LSP.Structures.A_Range + is + Start_Line : constant Natural := To_LSP_Line (A_Range.Start_Line); + Start_Line_Text : constant VSS.Strings.Virtual_String := + Self.Line (A_Range.Start_Line); + Start_Iterator : VSS.Strings.Character_Iterators.Character_Iterator := + Start_Line_Text.At_First_Character; + + End_Line : constant Natural := Natural (A_Range.End_Line) - 1; + End_Line_Text : constant VSS.Strings.Virtual_String := + Self.Line (A_Range.End_Line); + End_Iterator : VSS.Strings.Character_Iterators.Character_Iterator := + End_Line_Text.At_First_Character; + + Success : Boolean with Unreferenced; + + begin + -- Iterating forward through the line of the start position, initial + -- iterator points to the first characters, thus "starts" from the + -- second one. + + for J in 2 .. A_Range.Start_Column loop + Success := Start_Iterator.Forward; + end loop; + + -- Iterating forward through the line of the end position. For the same + -- reason "starts" from second character. + + for J in 2 .. A_Range.End_Column loop + Success := End_Iterator.Forward; + end loop; + + return + (start => + (line => Start_Line, + character => Natural (Start_Iterator.First_UTF16_Offset)), + an_end => + (line => End_Line, + character => Natural (End_Iterator.Last_UTF16_Offset))); + end To_A_Range; + + ------------------------ + -- To_Source_Location -- + ------------------------ + + function To_Source_Location + (Self : Langkit_Text_Document'Class; + Position : LSP.Structures.Position) + return Langkit_Support.Slocs.Source_Location + is + use type VSS.Strings.Character_Index; + use type VSS.Unicode.UTF16_Code_Unit_Offset; + + Iterator : VSS.Strings.Character_Iterators.Character_Iterator := + Self.Text.At_Character (Self.Line_Marker (Position.line)); + + Line_Offset : constant VSS.Unicode.UTF16_Code_Unit_Offset := + Iterator.First_UTF16_Offset; + Line_First_Character : constant VSS.Strings.Character_Index := + Iterator.Character_Index; + + begin + while Integer (Iterator.First_UTF16_Offset - Line_Offset) + <= Position.character + and then Iterator.Forward + loop + null; + end loop; + + return ((Line => Langkit_Support.Slocs.Line_Number (Position.line + 1), + Column => Langkit_Support.Slocs.Column_Number + (Iterator.Character_Index - Line_First_Character))); + end To_Source_Location; + + ------------------------------ + -- To_Source_Location_Range -- + ------------------------------ + + function To_Source_Location_Range + (Self : Langkit_Text_Document'Class; + A_Range : LSP.Structures.A_Range) + return Langkit_Support.Slocs.Source_Location_Range is + begin + return + Langkit_Support.Slocs.Make_Range + (Self.To_Source_Location (A_Range.start), + Self.To_Source_Location (A_Range.an_end)); + end To_Source_Location_Range; + +end LSP.Text_Documents.Langkit_Documents; diff --git a/source/server/lsp-text_documents-langkit_documents.ads b/source/server/lsp-text_documents-langkit_documents.ads new file mode 100644 index 000000000..c85d6a3d3 --- /dev/null +++ b/source/server/lsp-text_documents-langkit_documents.ads @@ -0,0 +1,57 @@ +------------------------------------------------------------------------------ +-- Language Server Protocol -- +-- -- +-- Copyright (C) 2023, AdaCore -- +-- -- +-- This is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 3, or (at your option) any later ver- -- +-- sion. This software is distributed in the hope that it will be useful, -- +-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- -- +-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -- +-- License for more details. You should have received a copy of the GNU -- +-- General Public License distributed with this software; see file -- +-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy -- +-- of the license. -- +------------------------------------------------------------------------------ + +-- This package provides an text document that use Langkit's conventions of +-- indexing characters, positions, and slices (ranges). +-- +-- The indexing conventions in Langkit align with VSS's +-- Line_Index/Character_Index when tabulation expansion in Langkit is turned +-- off (with a tabulation size set to 1). In a similar manner, the indices of +-- ranges (spans, slices) directly correspond to the characters themselves. +-- +-- LSP employs a distinct set of conventions, and it's essential to avoid +-- converting VSS/Langkit indexes and ranges directly through type conversion. + +with Langkit_Support.Slocs; + +package LSP.Text_Documents.Langkit_Documents is + + type Langkit_Text_Document is abstract new Text_Document with private; + + function To_Source_Location + (Self : Langkit_Text_Document'Class; + Position : LSP.Structures.Position) + return Langkit_Support.Slocs.Source_Location; + -- Convert a LSP's Position to a Langkit's Source_Location + + function To_Source_Location_Range + (Self : Langkit_Text_Document'Class; + A_Range : LSP.Structures.A_Range) + return Langkit_Support.Slocs.Source_Location_Range; + -- Convert a LSP's A_Range to a Langkit's Source_Location_Range + + function To_A_Range + (Self : Langkit_Text_Document'Class; + A_Range : Langkit_Support.Slocs.Source_Location_Range) + return LSP.Structures.A_Range; + -- Convert LAL's Source_Location_Range to LSP's A_Range + +private + + type Langkit_Text_Document is abstract new Text_Document with null record; + +end LSP.Text_Documents.Langkit_Documents; diff --git a/source/server/lsp-text_documents.adb b/source/server/lsp-text_documents.adb new file mode 100644 index 000000000..f5fba562e --- /dev/null +++ b/source/server/lsp-text_documents.adb @@ -0,0 +1,950 @@ +------------------------------------------------------------------------------ +-- Language Server Protocol -- +-- -- +-- Copyright (C) 2023, AdaCore -- +-- -- +-- This is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 3, or (at your option) any later ver- -- +-- sion. This software is distributed in the hope that it will be useful, -- +-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- -- +-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -- +-- License for more details. You should have received a copy of the GNU -- +-- General Public License distributed with this software; see file -- +-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy -- +-- of the license. -- +------------------------------------------------------------------------------ + +with Ada.Unchecked_Deallocation; + +with VSS.Characters.Latin; +with VSS.Strings.Character_Iterators; +with VSS.Strings.Line_Iterators; +with VSS.String_Vectors; +with VSS.Unicode; + +package body LSP.Text_Documents is + + procedure Range_To_Markers + (Self : Text_Document'Class; + Span : LSP.Structures.A_Range; + From : out VSS.Strings.Markers.Character_Marker; + To : out VSS.Strings.Markers.Character_Marker); + + procedure Recompute_Indexes (Self : in out Text_Document'Class); + -- Recompute the line-to-offset indexes in Self + + procedure Recompute_Markers + (Self : in out Text_Document'Class; + Low_Line : Natural; + Start_Marker : VSS.Strings.Markers.Character_Marker; + End_Marker : VSS.Strings.Markers.Character_Marker); + -- Recompute line-to-marker index starting from Start_Marker till + -- End_Marker and filling index table starting at Low_Line. End_Marker + -- may be invalid marker, in this case indexing down to the end of the + -- text. + + ------------------- + -- Apply_Changes -- + ------------------- + + procedure Apply_Changes + (Self : in out Text_Document'Class; + Version : Integer; + Vector : LSP.Structures.TextDocumentContentChangeEvent_Vector) is + begin + Self.Version := Version; + + for Change of Vector loop + if Change.a_range.Is_Set then + -- We're replacing a range + + declare + Low_Line : Natural := Change.a_range.Value.start.line; + High_Line : Natural := Change.a_range.Value.an_end.line; + Delete_High : Natural := High_Line; + Start_Index : Natural; + + First_Marker : VSS.Strings.Markers.Character_Marker; + Last_Marker : VSS.Strings.Markers.Character_Marker; + Start_Marker : VSS.Strings.Markers.Character_Marker; + End_Marker : VSS.Strings.Markers.Character_Marker; + + begin + -- Do text replacement + + Self.Range_To_Markers + (Change.a_range.Value, First_Marker, Last_Marker); + Self.Text.Replace (First_Marker, Last_Marker, Change.text); + + -- Markers inside modified range of lines need to be + -- recomputed, markers outside of this range has been + -- recomputed by call to Replace. + + -- Use marker of the line before the first modified line as + -- start marker for recompute because marker of the first + -- modified line may be ether invalidated or moved by Replace, + -- or start from first character of the new text when first + -- line was modified. + + if Low_Line /= Self.Line_Marker.First_Index then + Low_Line := Low_Line - 1; + Start_Index := Low_Line; + Start_Marker := Self.Line_Marker (Low_Line); + + else + Start_Index := Self.Line_Marker.First_Index; + Start_Marker := Self.Text.At_First_Character.Marker; + end if; + + -- Use marker of the line after the last modified line as end + -- marker for recompute because marker of the last modified + -- line may be ether invalidated or moved and not point to the + -- beginning of the line, or use invalid marker when last line + -- was modified. + + if High_Line /= Self.Line_Marker.Last_Index then + Delete_High := High_Line; + High_Line := High_Line + 1; + End_Marker := Self.Line_Marker (High_Line); + end if; + + if Low_Line = Self.Line_Marker.First_Index + and then High_Line = Self.Line_Marker.Last_Index + then + Self.Recompute_Indexes; + + else + if Delete_High >= Low_Line then + Self.Line_Marker.Delete + (Low_Line, + Ada.Containers.Count_Type + (Delete_High - Low_Line + 1)); + end if; + + Self.Recompute_Markers + (Start_Index, Start_Marker, End_Marker); + end if; + end; + + else + Self.Text := Change.text; + + -- We're setting the whole text: compute the indexes now. + Self.Recompute_Indexes; + end if; + end loop; + end Apply_Changes; + + ------------------ + -- Constructors -- + ------------------ + + package body Constructors is + + ---------------- + -- Initialize -- + ---------------- + + procedure Initialize + (Self : in out Text_Document'Class; + URI : LSP.Structures.DocumentUri; + Text : VSS.Strings.Virtual_String) is + begin + Self.URI := URI; + Self.Text := Text; + + Self.Recompute_Indexes; + end Initialize; + + end Constructors; + + ---------- + -- Diff -- + ---------- + + procedure Diff + (Self : Text_Document'Class; + New_Text : VSS.Strings.Virtual_String; + Old_Span : LSP.Structures.A_Range := Empty_Range; + New_Span : LSP.Structures.A_Range := Empty_Range; + Edit : out LSP.Structures.TextEdit_Vector) + is + use type LSP.Structures.A_Range; + use type LSP.Structures.Position; + + Old_First_Line : Natural; + New_First_Line : Natural; + + Old_Lines, New_Lines : VSS.String_Vectors.Virtual_String_Vector; + Old_Length, New_Length : Natural; + + begin + Old_Lines := + Self.Text.Split_Lines + (Terminators => LSP_New_Line_Function_Set, + Keep_Terminator => True); + New_Lines := + New_Text.Split_Lines + (Terminators => LSP_New_Line_Function_Set, + Keep_Terminator => True); + + if Old_Span = Empty_Range then + Old_First_Line := 1; + Old_Length := Old_Lines.Length; + + else + Old_First_Line := Natural (Old_Span.start.line + 1); + Old_Length := + Natural (Old_Span.an_end.line - Old_Span.start.line + 1); + end if; + + if New_Span = Empty_Range then + New_First_Line := 1; + New_Length := New_Lines.Length; + else + New_First_Line := Natural (New_Span.start.line + 1); + New_Length := + Natural (New_Span.an_end.line - New_Span.start.line + 1); + end if; + + declare + use type VSS.Strings.Virtual_String; + + type LCS_Array is array + (Natural range 0 .. Old_Length, + Natural range 0 .. New_Length) of Integer; + type LCS_Array_Access is access all LCS_Array; + + procedure Free is + new Ada.Unchecked_Deallocation (LCS_Array, LCS_Array_Access); + + LCS : LCS_Array_Access := new LCS_Array; + Match : Integer; + Delete : Integer; + Insert : Integer; + + Old_Index : Natural := Old_Length; + New_Index : Natural := New_Length; + + Old_Natural : Natural; + -- needed to determine which line number in the old buffer is + -- changed, deleted or before which new lines are inserted + + Changed_Block_Text : VSS.Strings.Virtual_String; + Changed_Block_Span : LSP.Structures.A_Range := ((0, 0), (0, 0)); + + procedure Prepare + (Line : Natural; + Text : VSS.Strings.Virtual_String); + -- Store imformation for Text_Etid in New_String and Span + + procedure Add (From_Line : Natural); + -- Add prepared New_String and Span into Text_Edit + + ------------- + -- Prepare -- + ------------- + + procedure Prepare + (Line : Natural; + Text : VSS.Strings.Virtual_String) is + begin + if Changed_Block_Span.an_end = (0, 0) then + -- it is the first portion of a changed block so store + -- last position of the changes + Changed_Block_Span.an_end := (Line, 0); + end if; + + -- accumulating new text for the changed block + Changed_Block_Text.Prepend (Text); + end Prepare; + + --------- + -- Add -- + --------- + + procedure Add (From_Line : Natural) is + begin + if Changed_Block_Span.an_end = (0, 0) then + -- No information for Text_Edit + return; + end if; + + Changed_Block_Span.start := + (line => From_Line, + character => 0); + + Edit.Prepend + (LSP.Structures.TextEdit' + (a_range => Changed_Block_Span, + newText => Changed_Block_Text)); + + -- clearing + Changed_Block_Text.Clear; + Changed_Block_Span := ((0, 0), (0, 0)); + end Add; + + begin + -- prepare LCS + + -- default values for line 0 + + for Index in 0 .. Old_Length loop + LCS (Index, 0) := -5 * Index; + end loop; + + -- default values for the first column + + for Index in 0 .. New_Length loop + LCS (0, Index) := -5 * Index; + end loop; + + -- calculate LCS + + for Row in 1 .. Old_Length loop + for Column in 1 .. New_Length loop + Match := LCS (Row - 1, Column - 1) + + (if Old_Lines (Old_First_Line + Row - 1) = + New_Lines (New_First_Line + Column - 1) + then 10 -- +10 is the 'weight' for equal lines + else -1); -- and -1 for the different + + Delete := LCS (Row - 1, Column) - 5; + Insert := LCS (Row, Column - 1) - 5; + + LCS (Row, Column) := Integer'Max (Match, Insert); + LCS (Row, Column) := Integer'Max (LCS (Row, Column), Delete); + end loop; + end loop; + + -- iterate over LCS and create Text_Edit + + Old_Natural := Natural (Old_First_Line + Old_Length - 1); + + while Old_Index > 0 + and then New_Index > 0 + loop + if LCS (Old_Index, New_Index) = + LCS (Old_Index - 1, New_Index - 1) + + (if Old_Lines (Old_First_Line + Old_Index - 1) = + New_Lines (New_First_Line + New_Index - 1) + then 10 + else -1) + then + -- both has lines + + if New_Lines.Element (New_First_Line + New_Index - 1) = + Old_Lines.Element (Old_First_Line + Old_Index - 1) + then + -- lines are equal, add Text_Edit after current line + -- if any is already prepared + Add (Old_Natural); + else + -- lines are different, change old line by new one, + -- we deleted whole line so 'To' position will be + -- the beginning of the next line + Prepare + (Old_Natural, + New_Lines.Element (New_First_Line + New_Index - 1)); + end if; + + -- move lines cursor backward + Old_Natural := Old_Natural - 1; + + New_Index := New_Index - 1; + Old_Index := Old_Index - 1; + + elsif LCS (Old_Index, New_Index) = + LCS (Old_Index - 1, New_Index) - 5 + then + -- line has been deleted, move lines cursor backward + + Prepare (Old_Natural, VSS.Strings.Empty_Virtual_String); + + Old_Natural := Old_Natural - 1; + Old_Index := Old_Index - 1; + + elsif LCS (Old_Index, New_Index) = + LCS (Old_Index, New_Index - 1) - 5 + then + -- line has been inserted + -- insert Text_Edit information with insertion after + -- current line, do not move lines cursor because it is + -- additional line not present in the old document + Prepare + (Old_Natural, + New_Lines.Element (New_First_Line + New_Index - 1)); + + New_Index := New_Index - 1; + end if; + end loop; + + while Old_Index > 0 loop + -- deleted + + Prepare (Old_Natural, VSS.Strings.Empty_Virtual_String); + + Old_Natural := Old_Natural - 1; + Old_Index := Old_Index - 1; + end loop; + + while New_Index > 0 loop + -- inserted + + Prepare + (Old_Natural, + New_Lines.Element (New_First_Line + New_Index - 1)); + + New_Index := New_Index - 1; + end loop; + + Add (Old_Natural); + Free (LCS); + + -- Handle the edge case where the last location of + -- the edit is trying to affect a non existent line. + -- The edits are ordered so we only need to check the last one. + + if not Edit.Is_Empty + and then not Self.Line_Marker.Is_Empty + and then Edit.Last_Element.a_range.an_end.line not in + Self.Line_Marker.First_Index .. Self.Line_Marker.Last_Index + then + declare + Element : LSP.Structures.TextEdit := Edit.Last_Element; + Last_Line : constant VSS.Strings.Virtual_String := + Old_Lines (Old_Lines.Length); + Iterator : + constant VSS.Strings.Character_Iterators.Character_Iterator := + Last_Line.At_Last_Character; + + begin + -- Replace the wrong location by the end of the buffer + + Element.a_range.an_end := + (line => Old_Lines.Length - 1, + character => Natural (Iterator.Last_UTF16_Offset) + 1); + Edit.Replace_Element (Edit.Last, Element); + end; + end if; + + exception + when others => + Free (LCS); + raise; + end; + end Diff; + + ------------------ + -- Diff_Symbols -- + ------------------ + + procedure Diff_Symbols + (Self : Text_Document'Class; + Span : LSP.Structures.A_Range; + New_Text : VSS.Strings.Virtual_String; + Edit : in out LSP.Structures.TextEdit_Vector) + is + use VSS.Strings; + use VSS.Characters; + + Old_Text : VSS.Strings.Virtual_String; + Old_Lines : VSS.String_Vectors.Virtual_String_Vector; + Old_Line : VSS.Strings.Virtual_String; + Old_Length, New_Length : Natural; + + First_Marker : VSS.Strings.Markers.Character_Marker; + Last_Marker : VSS.Strings.Markers.Character_Marker; + + begin + Self.Range_To_Markers (Span, First_Marker, Last_Marker); + + Old_Text := Self.Text.Slice (First_Marker, Last_Marker); + Old_Lines := Old_Text.Split_Lines + (Terminators => LSP_New_Line_Function_Set, + Keep_Terminator => True); + Old_Line := Old_Lines.Element (Old_Lines.Length); + + Old_Length := Integer (Character_Length (Old_Text)); + New_Length := Integer (Character_Length (New_Text)); + + declare + type LCS_Array is array + (Natural range 0 .. Old_Length, + Natural range 0 .. New_Length) of Integer; + type LCS_Array_Access is access all LCS_Array; + + procedure Free is + new Ada.Unchecked_Deallocation (LCS_Array, LCS_Array_Access); + + LCS : LCS_Array_Access := new LCS_Array; + Match : Integer; + Delete : Integer; + Insert : Integer; + + Old_Char : VSS.Strings.Character_Iterators.Character_Iterator := + Old_Text.At_First_Character; + + New_Char : VSS.Strings.Character_Iterators.Character_Iterator := + New_Text.At_First_Character; + + Dummy : Boolean; + + Old_Index, New_Index : Integer; + + Changed_Block_Text : VSS.Strings.Virtual_String; + Changed_Block_Span : LSP.Structures.A_Range := ((0, 0), (0, 0)); + Span_Set : Boolean := False; + + -- to calculate span + Current_Natural : Natural := + (if Span.an_end.character = 0 + then Span.an_end.line - 1 + else Span.an_end.line); + -- we do not have a line at all when the range end is on the + -- begin of a line, so set Current_Natural to the previous one + Old_Lines_Number : Natural := Old_Lines.Length; + + Cursor : VSS.Strings.Character_Iterators.Character_Iterator := + Old_Line.After_Last_Character; + + procedure Backward; + -- Move old line Cursor backward, update Old_Line and + -- Old_Lines_Number if needed + + function Get_Position + (Insert : Boolean) return LSP.Structures.Position; + -- get Position for a Span based on Cursor to prepare first/last + -- position for changes + + procedure Prepare_Last_Span (Insert : Boolean); + -- Store position based on Cursor to Changed_Block_Span.an_end if + -- it is not stored yet + + procedure Prepare_Change + (Insert : Boolean; + Char : VSS.Characters.Virtual_Character); + -- Collect change information for Text_Edit in Changed_Block_Text + -- and Changed_Block_Span + + procedure Add_Prepared_Change; + -- Add prepared New_String and corresponding Span into Text_Edit + + -------------- + -- Backward -- + -------------- + + procedure Backward is + begin + if not Cursor.Backward + and then Old_Lines_Number > 1 + then + Current_Natural := Current_Natural - 1; + Old_Lines_Number := Old_Lines_Number - 1; + Old_Line := Old_Lines.Element (Old_Lines_Number); + Cursor.Set_At_Last (Old_Line); + end if; + + Old_Index := Old_Index - 1; + Dummy := Old_Char.Backward; + end Backward; + + ------------------ + -- Get_Position -- + ------------------ + + function Get_Position + (Insert : Boolean) return LSP.Structures.Position + is + -------------- + -- Backward -- + -------------- + + function Backward return LSP.Structures.Position; + + function Backward return LSP.Structures.Position is + C : VSS.Strings.Character_Iterators.Character_Iterator := + Old_Line.At_Character (Cursor); + begin + -- "Cursor" is after the current character but we should + -- insert before it + if C.Backward then + return + (line => Current_Natural, + character => Natural (C.First_UTF16_Offset)); + else + return + (line => Current_Natural, + character => 0); + end if; + end Backward; + + begin + if not Cursor.Has_Element then + return + (line => Current_Natural, + character => 0); + + elsif Insert then + -- "Cursor" is after the current character but we should + -- insert before it + return Backward; + + else + return + (line => Current_Natural, + character => Natural (Cursor.First_UTF16_Offset)); + end if; + end Get_Position; + + ----------------------- + -- Prepare_Last_Span -- + ----------------------- + + procedure Prepare_Last_Span (Insert : Boolean) is + begin + if not Span_Set then + -- it is the first portion of a changed block so store + -- last position of the changes + Span_Set := True; + Changed_Block_Span.an_end := Get_Position (Insert); + end if; + end Prepare_Last_Span; + + -------------------- + -- Prepare_Change -- + -------------------- + + procedure Prepare_Change + (Insert : Boolean; + Char : VSS.Characters.Virtual_Character) is + begin + Prepare_Last_Span (Insert); + -- accumulating new text for the changed block + Changed_Block_Text.Prepend (Char); + end Prepare_Change; + + ------------------------- + -- Add_Prepared_Change -- + ------------------------- + + procedure Add_Prepared_Change is + begin + if not Span_Set then + -- No information for Text_Edit + return; + end if; + + Changed_Block_Span.start := Get_Position (False); + + Edit.Prepend + (LSP.Structures.TextEdit' + (a_range => Changed_Block_Span, + newText => Changed_Block_Text)); + + -- clearing + Changed_Block_Text.Clear; + + Changed_Block_Span := ((0, 0), (0, 0)); + Span_Set := False; + end Add_Prepared_Change; + + begin + -- prepare LCS + + -- default values for line 0 + for Index in 0 .. Old_Length loop + LCS (Index, 0) := -5 * Index; + end loop; + + -- default values for the first column + for Index in 0 .. New_Length loop + LCS (0, Index) := -5 * Index; + end loop; + + -- calculate LCS + for Row in 1 .. Old_Length loop + New_Char.Set_At_First (New_Text); + for Column in 1 .. New_Length loop + Match := LCS (Row - 1, Column - 1) + + (if Old_Char.Element = New_Char.Element + then 10 -- +10 is the 'weight' for equal lines + else -1); -- and -1 for the different + + Delete := LCS (Row - 1, Column) - 5; + Insert := LCS (Row, Column - 1) - 5; + + LCS (Row, Column) := Integer'Max (Match, Insert); + LCS (Row, Column) := Integer'Max (LCS (Row, Column), Delete); + + Dummy := New_Char.Forward; + end loop; + Dummy := Old_Char.Forward; + end loop; + + -- iterate over LCS and create Text_Edit + + Old_Char.Set_At_Last (Old_Text); + New_Char.Set_At_Last (New_Text); + Old_Index := Old_Length; + New_Index := New_Length; + + while Old_Index > 0 + and then New_Index > 0 + loop + if LCS (Old_Index, New_Index) = + LCS (Old_Index - 1, New_Index - 1) + + (if Old_Char.Element = New_Char.Element + then 10 + else -1) + then + -- both has elements + if Old_Char.Element = New_Char.Element then + -- elements are equal, add prepared Text_Edit + Add_Prepared_Change; + else + -- elements are different, change old one by new + Prepare_Change (False, New_Char.Element); + end if; + + -- move old element cursors backward + Backward; + + New_Index := New_Index - 1; + Dummy := New_Char.Backward; + + elsif LCS (Old_Index, New_Index) = + LCS (Old_Index - 1, New_Index) - 5 + then + -- element has been deleted, move old cursor backward + Prepare_Last_Span (False); + Backward; + + elsif LCS (Old_Index, New_Index) = + LCS (Old_Index, New_Index - 1) - 5 + then + -- element has been inserted + Prepare_Change (True, New_Char.Element); + + New_Index := New_Index - 1; + Dummy := New_Char.Backward; + end if; + end loop; + + while Old_Index > 0 loop + -- deleted + Prepare_Last_Span (False); + Backward; + end loop; + + while New_Index > 0 loop + -- inserted + Prepare_Change (True, New_Char.Element); + + New_Index := New_Index - 1; + Dummy := New_Char.Backward; + end loop; + + Add_Prepared_Change; + Free (LCS); + + exception + when others => + Free (LCS); + raise; + end; + end Diff_Symbols; + + ---------------- + -- Identifier -- + ---------------- + + function Identifier + (Self : Text_Document'Class) + return LSP.Structures.OptionalVersionedTextDocumentIdentifier is + begin + return (uri => Self.URI, + version => + (Is_Null => False, + Value => Self.Version)); + end Identifier; + + --------------------- + -- Line_Terminator -- + --------------------- + + function Line_Terminator + (Self : Text_Document'Class) return VSS.Strings.Virtual_String + is + use type VSS.Strings.Virtual_String; + + begin + return + (if Self.Line_Terminator.Is_Empty then + -- Document has no line terminator yet, return LF as most used + -- + -- Should it be platform specific? CRLF for Windows, CR for Mac? + + 1 * VSS.Characters.Latin.Line_Feed + + else + Self.Line_Terminator); + end Line_Terminator; + + ---------------------- + -- Range_To_Markers -- + ---------------------- + + procedure Range_To_Markers + (Self : Text_Document'Class; + Span : LSP.Structures.A_Range; + From : out VSS.Strings.Markers.Character_Marker; + To : out VSS.Strings.Markers.Character_Marker) + is + use type VSS.Unicode.UTF16_Code_Unit_Offset; + + J1 : VSS.Strings.Character_Iterators.Character_Iterator := + Self.Text.At_Character (Self.Line_Marker (Span.start.line)); + U1 : constant VSS.Unicode.UTF16_Code_Unit_Offset := + J1.First_UTF16_Offset; + + J2 : VSS.Strings.Character_Iterators.Character_Iterator := + Self.Text.At_Character (Self.Line_Marker (Span.an_end.line)); + U2 : constant VSS.Unicode.UTF16_Code_Unit_Offset := + J2.First_UTF16_Offset; + + Dummy : Boolean; + + begin + while Span.start.character /= Integer (J1.First_UTF16_Offset - U1) + and then J1.Forward + loop + null; + end loop; + + From := J1.Marker; + + while Span.an_end.character /= Integer (J2.First_UTF16_Offset - U2) + and then J2.Forward + loop + null; + end loop; + + Dummy := J2.Backward; + To := J2.Marker; + end Range_To_Markers; + + ----------------------- + -- Recompute_Indexes -- + ----------------------- + + procedure Recompute_Indexes (Self : in out Text_Document'Class) is + use type VSS.Strings.Character_Count; + + begin + Self.Line_Marker.Clear; + + -- To avoid too many reallocations during the initial filling + -- of the index vector, pre-allocate it. Give a generous + -- pre-allocation assuming that there is a line break every + -- 20 characters on average (this file has one line break + -- every 33 characters). + Self.Line_Marker.Reserve_Capacity + (Ada.Containers.Count_Type (Self.Text.Character_Length / 20)); + + declare + J : VSS.Strings.Line_Iterators.Line_Iterator := + Self.Text.At_First_Line + (Terminators => LSP_New_Line_Function_Set, + Keep_Terminator => True); + Last_Line_Terminated : Boolean := False; + + begin + if J.Has_Element then + -- Update Line_Terminator of the document + + Self.Line_Terminator := Self.Text.Slice + (J.Terminator_First_Marker, J.Terminator_Last_Marker); + + loop + Self.Line_Marker.Append (J.First_Marker); + Last_Line_Terminated := J.Has_Line_Terminator; + + exit when not J.Forward; + end loop; + + else + Last_Line_Terminated := True; + -- Force to add one line for an empty document. + end if; + + -- Append marker at the end of the text when the last line has line + -- terminator sequence or text is empty. It allows to avoid checks + -- for corner cases. + + if Last_Line_Terminated then + Self.Line_Marker.Append (J.First_Marker); + end if; + end; + end Recompute_Indexes; + + ----------------------- + -- Recompute_Markers -- + ----------------------- + + procedure Recompute_Markers + (Self : in out Text_Document'Class; + Low_Line : Natural; + Start_Marker : VSS.Strings.Markers.Character_Marker; + End_Marker : VSS.Strings.Markers.Character_Marker) + is + use type VSS.Strings.Character_Count; + + M : VSS.Strings.Markers.Character_Marker; + J : VSS.Strings.Line_Iterators.Line_Iterator := + Self.Text.At_Line + (Position => Start_Marker, + Terminators => LSP_New_Line_Function_Set, + Keep_Terminator => True); + Line : Natural := Low_Line; + + begin + if J.Has_Element then + loop + M := J.First_Marker; + + exit + when End_Marker.Is_Valid + and then M.Character_Index = End_Marker.Character_Index; + + Self.Line_Marker.Insert (Line, M); + Line := Line + 1; + + exit when not J.Forward; + end loop; + + if not End_Marker.Is_Valid then + Self.Line_Marker.Append (J.First_Marker); + end if; + end if; + end Recompute_Markers; + + ----------- + -- Slice -- + ----------- + + function Slice + (Self : Text_Document'Class; + A_Range : LSP.Structures.A_Range) return VSS.Strings.Virtual_String + is + First_Marker : VSS.Strings.Markers.Character_Marker; + Last_Marker : VSS.Strings.Markers.Character_Marker; + + begin + Self.Range_To_Markers (A_Range, First_Marker, Last_Marker); + + return Self.Text.Slice (First_Marker, Last_Marker); + end Slice; + +end LSP.Text_Documents; diff --git a/source/server/lsp-text_documents.ads b/source/server/lsp-text_documents.ads new file mode 100644 index 000000000..2a0dca809 --- /dev/null +++ b/source/server/lsp-text_documents.ads @@ -0,0 +1,140 @@ +------------------------------------------------------------------------------ +-- Language Server Protocol -- +-- -- +-- Copyright (C) 2023, AdaCore -- +-- -- +-- This is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 3, or (at your option) any later ver- -- +-- sion. This software is distributed in the hope that it will be useful, -- +-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- -- +-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -- +-- License for more details. You should have received a copy of the GNU -- +-- General Public License distributed with this software; see file -- +-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy -- +-- of the license. -- +------------------------------------------------------------------------------ + +-- This package provides an text document abstraction. It provides capability +-- to apply and generate text edits. + +private with Ada.Containers.Vectors; + +with VSS.Strings; +private with VSS.Strings.Markers; + +with LSP.Structures; + +package LSP.Text_Documents is + + LSP_New_Line_Function_Set : constant VSS.Strings.Line_Terminator_Set := + (VSS.Strings.CR | VSS.Strings.CRLF | VSS.Strings.LF => True, + others => False); + -- LSP allows to use three kinds of line terminators: CR, CR+LF and LF. + + Empty_Range : LSP.Structures.A_Range := ((1, 1), (0, 0)); + + type Text_Position is record + Line : VSS.Strings.Line_Index; + Column : VSS.Strings.Line_Index'Base; + end record; + + type Text_Slice is record + First : Text_Position; + Last : Text_Position; + end record; + + type Text_Document is abstract tagged limited private; + + function URI (Self : Text_Document'Class) return LSP.Structures.DocumentUri; + -- Return the URI associated with Self + + function Identifier + (Self : Text_Document'Class) + return LSP.Structures.OptionalVersionedTextDocumentIdentifier; + + function Text + (Self : Text_Document'Class) return VSS.Strings.Virtual_String; + + function Slice + (Self : Text_Document'Class; + A_Range : LSP.Structures.A_Range) return VSS.Strings.Virtual_String; + -- Return the text in the specified range. + + function Line_Terminator + (Self : Text_Document'Class) return VSS.Strings.Virtual_String; + -- Return line terminator for the document + + procedure Apply_Changes + (Self : in out Text_Document'Class; + Version : Integer; + Vector : LSP.Structures.TextDocumentContentChangeEvent_Vector); + -- Modify document according to event vector provided by LSP client. + + procedure Diff + (Self : Text_Document'Class; + New_Text : VSS.Strings.Virtual_String; + Old_Span : LSP.Structures.A_Range := Empty_Range; + New_Span : LSP.Structures.A_Range := Empty_Range; + Edit : out LSP.Structures.TextEdit_Vector); + -- Create a diff between document Text and New_Text and return Text_Edit + -- based on Needleman-Wunsch algorithm. + -- Old_Span and New_Span are used when we need to compare certain + -- old/new lines instead of whole buffers. + + procedure Diff_Symbols + (Self : Text_Document'Class; + Span : LSP.Structures.A_Range; + New_Text : VSS.Strings.Virtual_String; + Edit : in out LSP.Structures.TextEdit_Vector); + -- Create a diff between document Text inside Span and New_Chunk and + -- return Text_Edit. Tests individual symbols instead of lines + -- as above. Do not use it for large text slices because it + -- creates an N^M map for symbols. + + package Constructors is + + procedure Initialize + (Self : in out Text_Document'Class; + URI : LSP.Structures.DocumentUri; + Text : VSS.Strings.Virtual_String); + + end Constructors; + +private + + package Line_Marker_Vectors is new Ada.Containers.Vectors + (Index_Type => Natural, + Element_Type => VSS.Strings.Markers.Character_Marker, + "=" => VSS.Strings.Markers."="); + + type Text_Document is abstract tagged limited record + URI : LSP.Structures.DocumentUri; + -- URI of the document + + Version : Integer := 1; + -- Document version + + Text : VSS.Strings.Virtual_String; + -- The text of the document + + Line_Terminator : VSS.Strings.Virtual_String; + -- Line terminator for the text, if known, "" otherwise + + Line_Marker : Line_Marker_Vectors.Vector; + -- Within text, an array associating a line number (starting at 0) to + -- the marker of the first character of that line in Text. + -- This serves as cache to be able to modify text ranges in Text + -- given in line/column coordinates without having to scan the whole + -- text from the beginning. + end record; + + function Text + (Self : Text_Document'Class) return VSS.Strings.Virtual_String is + (Self.Text); + + function URI + (Self : Text_Document'Class) return LSP.Structures.DocumentUri is + (Self.URI); + +end LSP.Text_Documents;