From 8343f97a74c7db0c26fc502058bd24dde1625ea8 Mon Sep 17 00:00:00 2001 From: Anthony Leonardo Gracio Date: Thu, 19 Dec 2024 16:17:33 +0000 Subject: [PATCH] Fix accessibilty check failures on Mac OS Use proper named access types to avoid some accessibility checks emitted by the Mac OS compiler from Alire. Closes eng/ide/ada_language_server#1573 --- source/ada/lsp-ada_driver.adb | 4 ++-- source/ada/lsp-ada_handlers.adb | 6 +++--- source/ada/lsp-ada_handlers.ads | 8 ++++---- source/server/lsp-servers-fs_watch.ads | 4 ++-- source/server/lsp-servers.ads | 4 ++-- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/source/ada/lsp-ada_driver.adb b/source/ada/lsp-ada_driver.adb index 80ead592a..efea282fc 100644 --- a/source/ada/lsp-ada_driver.adb +++ b/source/ada/lsp-ada_driver.adb @@ -261,9 +261,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); + (Server'Unchecked_Access, Server'Access, Tracer'Unchecked_Access); GPR_Handler : aliased LSP.GPR_Handlers.Message_Handler - (Server'Access, Tracer'Unchecked_Access); + (Server'Unchecked_Access, Tracer'Unchecked_Access); -- Job handlers Ada_Did_Change_Handler : aliased diff --git a/source/ada/lsp-ada_handlers.adb b/source/ada/lsp-ada_handlers.adb index d4007b222..7ae2dfe8b 100644 --- a/source/ada/lsp-ada_handlers.adb +++ b/source/ada/lsp-ada_handlers.adb @@ -88,7 +88,6 @@ with LSP.Formatters.Texts; with LSP.Generic_Cancel_Check; with LSP.GNATCOLL_Tracers.Handle; with LSP.Search; -with LSP.Servers; with LSP.Servers.FS_Watch; with LSP.Structures.LSPAny_Vectors; with LSP.Utils; @@ -397,7 +396,7 @@ package body LSP.Ada_Handlers is ---------------- procedure Initialize - (Self : access Message_Handler'Class; + (Self : in out Message_Handler; Incremental_Text_Changes : Boolean; CLI_Config_File : GNATCOLL.VFS.Virtual_File := GNATCOLL.VFS.No_File) @@ -407,7 +406,8 @@ package body LSP.Ada_Handlers is Self.File_Monitor := new LSP.Servers.FS_Watch.FS_Watch_Monitor (Self.Server); Self.Diagnostic_Sources := - [new LSP.Ada_Handlers.Project_Diagnostics.Diagnostic_Source (Self)]; + [new LSP.Ada_Handlers.Project_Diagnostics.Diagnostic_Source + (Self'Unchecked_Access)]; Self.Load_Config_Files (CLI_Config_File); end Initialize; diff --git a/source/ada/lsp-ada_handlers.ads b/source/ada/lsp-ada_handlers.ads index 9732eba47..2c8325f40 100644 --- a/source/ada/lsp-ada_handlers.ads +++ b/source/ada/lsp-ada_handlers.ads @@ -51,7 +51,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.Servers; with LSP.Structures; with LSP.Tracers; with LSP.Unimplemented_Handlers; @@ -62,7 +62,7 @@ private with LAL_Refactor; package LSP.Ada_Handlers is type Message_Handler - (Server : not null access LSP.Servers.Server'Class; + (Server : not null LSP.Servers.Server_Access; -- Please avoid to use this discriminant! Sender : not null access LSP.Client_Message_Receivers .Client_Message_Receiver'Class; @@ -74,7 +74,7 @@ package LSP.Ada_Handlers is with private; procedure Initialize - (Self : access Message_Handler'Class; + (Self : in out Message_Handler; Incremental_Text_Changes : Boolean; CLI_Config_File : GNATCOLL.VFS.Virtual_File := GNATCOLL.VFS.No_File); @@ -168,7 +168,7 @@ private type Has_Been_Canceled_Function is access function return Boolean; type Message_Handler - (Server : not null access LSP.Servers.Server'Class; + (Server : not null LSP.Servers.Server_Access; -- Please avoid to use this discriminant! Sender : not null access LSP.Client_Message_Receivers .Client_Message_Receiver'Class; diff --git a/source/server/lsp-servers-fs_watch.ads b/source/server/lsp-servers-fs_watch.ads index 695671fb8..6487a83ca 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'Class) is + type FS_Watch_Monitor (Server : not null LSP.Servers.Server_Access) is limited new LSP.File_Monitors.File_Monitor with private; private @@ -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'Class) is + type FS_Watch_Monitor (Server : not null LSP.Servers.Server_Access) is limited new LSP.File_Monitors.File_Monitor with record Filesystem_Monitor_Task : Monitor_Task_Access; diff --git a/source/server/lsp-servers.ads b/source/server/lsp-servers.ads index 88cc9effe..5e33c23dc 100644 --- a/source/server/lsp-servers.ads +++ b/source/server/lsp-servers.ads @@ -50,8 +50,8 @@ 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; + type Server_Access is access all Server'Class with Storage_Size => 0; -- The representation of LSP server. -- Use methods of Client_Message_Receiver to send notifications, requests -- and responses to the LSP client.