|
| 1 | +------------------------------------------------------------------------------ |
| 2 | +-- Language Server Protocol -- |
| 3 | +-- -- |
| 4 | +-- Copyright (C) 2022-2023, AdaCore -- |
| 5 | +-- -- |
| 6 | +-- This is free software; you can redistribute it and/or modify it under -- |
| 7 | +-- terms of the GNU General Public License as published by the Free Soft- -- |
| 8 | +-- ware Foundation; either version 3, or (at your option) any later ver- -- |
| 9 | +-- sion. This software is distributed in the hope that it will be useful, -- |
| 10 | +-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- -- |
| 11 | +-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -- |
| 12 | +-- License for more details. You should have received a copy of the GNU -- |
| 13 | +-- General Public License distributed with this software; see file -- |
| 14 | +-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy -- |
| 15 | +-- of the license. -- |
| 16 | +------------------------------------------------------------------------------ |
| 17 | + |
| 18 | +with GNATCOLL.Traces; |
| 19 | + |
| 20 | +with VSS.Characters; |
| 21 | +with VSS.Strings; |
| 22 | +with VSS.Text_Streams; |
| 23 | + |
| 24 | +package LSP.GNATCOLL_Trace_Streams is |
| 25 | + |
| 26 | + type Output_Text_Stream is limited |
| 27 | + new VSS.Text_Streams.Output_Text_Stream with private; |
| 28 | + -- Implementation of the text stream interface over GNATCOLL.Traces |
| 29 | + |
| 30 | + procedure Initialize |
| 31 | + (Self : in out Output_Text_Stream'Class; |
| 32 | + Trace : GNATCOLL.Traces.Trace_Handle); |
| 33 | + -- Server_Trace - main trace for the LSP. |
| 34 | + |
| 35 | +private |
| 36 | + |
| 37 | + type Output_Text_Stream is limited |
| 38 | + new VSS.Text_Streams.Output_Text_Stream with |
| 39 | + record |
| 40 | + Incomplete : VSS.Strings.Virtual_String; |
| 41 | + Trace : GNATCOLL.Traces.Trace_Handle; |
| 42 | + end record; |
| 43 | + |
| 44 | + overriding procedure Put |
| 45 | + (Self : in out Output_Text_Stream; |
| 46 | + Item : VSS.Characters.Virtual_Character; |
| 47 | + Success : in out Boolean); |
| 48 | + |
| 49 | + overriding procedure Put |
| 50 | + (Self : in out Output_Text_Stream; |
| 51 | + Item : VSS.Strings.Virtual_String; |
| 52 | + Success : in out Boolean); |
| 53 | + |
| 54 | + overriding procedure Put_Line |
| 55 | + (Self : in out Output_Text_Stream; |
| 56 | + Item : VSS.Strings.Virtual_String; |
| 57 | + Success : in out Boolean); |
| 58 | + |
| 59 | + overriding procedure New_Line |
| 60 | + (Self : in out Output_Text_Stream; |
| 61 | + Success : in out Boolean); |
| 62 | + |
| 63 | + overriding function Has_Error (Self : Output_Text_Stream) return Boolean is |
| 64 | + (False); |
| 65 | + |
| 66 | + overriding function Error_Message |
| 67 | + (Self : Output_Text_Stream) return VSS.Strings.Virtual_String |
| 68 | + is (VSS.Strings.Empty_Virtual_String); |
| 69 | + |
| 70 | +end LSP.GNATCOLL_Trace_Streams; |
0 commit comments