File tree Expand file tree Collapse file tree 5 files changed +24
-17
lines changed
Expand file tree Collapse file tree 5 files changed +24
-17
lines changed Original file line number Diff line number Diff line change 11-- ----------------------------------------------------------------------------
22-- Language Server Protocol --
33-- --
4- -- Copyright (C) 2022-2023 , AdaCore --
4+ -- Copyright (C) 2022-2024 , AdaCore --
55-- --
66-- This is free software; you can redistribute it and/or modify it under --
77-- terms of the GNU General Public License as published by the Free Soft- --
@@ -23,6 +23,7 @@ with LSP.Ada_Documents;
2323with LSP.Enumerations ;
2424with VSS.Strings.Character_Iterators ;
2525with VSS.Strings.Conversions ;
26+ with VSS.Transformers.Caseless ;
2627with VSS.Unicode ;
2728
2829pragma Warnings (Off, " is not referenced" );
@@ -265,7 +266,7 @@ package body LSP.Ada_Completions.Generic_Assoc is
265266 or else
266267 Name.Starts_With
267268 (Completion_Prefix,
268- VSS.Strings.Identifier_Caseless )
269+ VSS.Transformers.Caseless.To_Identifier_Caseless )
269270 then
270271 -- Snippet Format: "Name => "
271272 Item.label := Name;
Original file line number Diff line number Diff line change 11-- ----------------------------------------------------------------------------
22-- Language Server Protocol --
33-- --
4- -- Copyright (C) 2018-2021 , AdaCore --
4+ -- Copyright (C) 2018-2024 , AdaCore --
55-- --
66-- This is free software; you can redistribute it and/or modify it under --
77-- terms of the GNU General Public License as published by the Free Soft- --
@@ -19,6 +19,7 @@ with Ada.Strings.Wide_Wide_Unbounded;
1919with Libadalang.Common ;
2020
2121with VSS.Strings ;
22+ with VSS.Transformers.Caseless ;
2223
2324with LSP.Ada_Completions.Filters ;
2425with LSP.Enumerations ;
@@ -72,7 +73,7 @@ package body LSP.Ada_Completions.Keywords is
7273
7374 begin
7475 if Label.Starts_With
75- (Prefix, VSS.Strings.Identifier_Caseless )
76+ (Prefix, VSS.Transformers.Caseless.To_Identifier_Caseless )
7677 then
7778 Item.label := Label;
7879 Item.insertTextFormat := (True, LSP.Enumerations.PlainText);
Original file line number Diff line number Diff line change 11-- ----------------------------------------------------------------------------
22-- Language Server Protocol --
33-- --
4- -- Copyright (C) 2018-2021 , AdaCore --
4+ -- Copyright (C) 2018-2024 , AdaCore --
55-- --
66-- This is free software; you can redistribute it and/or modify it under --
77-- terms of the GNU General Public License as published by the Free Soft- --
1818with Langkit_Support.Errors ;
1919
2020with VSS.Strings ;
21+ with VSS.Transformers.Caseless ;
2122
2223with LSP.Ada_Completions.Filters ;
2324
@@ -185,7 +186,8 @@ package body LSP.Ada_Completions.Names is
185186 elsif Dotted_Node.Kind in
186187 Libadalang.Common.Ada_Dotted_Name_Range
187188 or else Name.Starts_With
188- (Prefix, VSS.Strings.Identifier_Caseless)
189+ (Prefix,
190+ VSS.Transformers.Caseless.To_Identifier_Caseless)
189191 then
190192 Completion_Count := Completion_Count + 1 ;
191193
Original file line number Diff line number Diff line change 11-- ----------------------------------------------------------------------------
22-- Language Server Protocol --
33-- --
4- -- Copyright (C) 2020-2021 , AdaCore --
4+ -- Copyright (C) 2020-2024 , AdaCore --
55-- --
66-- This is free software; you can redistribute it and/or modify it under --
77-- terms of the GNU General Public License as published by the Free Soft- --
@@ -25,6 +25,7 @@ with GNATCOLL.VFS; use GNATCOLL.VFS;
2525with GNATCOLL.Utils ;
2626
2727with VSS.Strings.Conversions ;
28+ with VSS.Transformers.Caseless ;
2829
2930with LSP.Enumerations ;
3031with LSP.Predefined_Completion.Ada2012 ;
@@ -201,7 +202,7 @@ package body LSP.Predefined_Completion is
201202 begin
202203 for Item of Items loop
203204 if Item.label.Starts_With
204- (Prefix, VSS.Strings.Identifier_Caseless )
205+ (Prefix, VSS.Transformers.Caseless.To_Identifier_Caseless )
205206 then
206207 Result.Append (Item);
207208 end if ;
Original file line number Diff line number Diff line change 11-- ----------------------------------------------------------------------------
22-- Language Server Protocol --
33-- --
4- -- Copyright (C) 2021-2023 , AdaCore --
4+ -- Copyright (C) 2021-2024 , AdaCore --
55-- --
66-- This is free software; you can redistribute it and/or modify it under --
77-- terms of the GNU General Public License as published by the Free Soft- --
1515-- of the license. --
1616-- ----------------------------------------------------------------------------
1717
18+ with VSS.Transformers.Caseless ; use VSS.Transformers.Caseless;
19+
1820package body LSP.Search.Start_Word is
1921
2022 -- ---------
@@ -54,15 +56,15 @@ package body LSP.Search.Start_Word is
5456 overriding function Match
5557 (Self : Start_Word_Search;
5658 Text : VSS.Strings.Virtual_String)
57- return Boolean
58- is
59- Kind : constant array (Boolean) of VSS.Strings.Case_Sensitivity :=
60- [False => VSS.Strings.Identifier_Caseless,
61- True => VSS.Strings.Case_Sensitive];
62-
59+ return Boolean is
6360 begin
64- return Text.Starts_With (Self.Text, Kind (Self.Case_Sensitive))
65- xor Self.Negate;
61+ case Self.Case_Sensitive is
62+ when False =>
63+ return Text.Starts_With (Self.Text, To_Identifier_Caseless)
64+ xor Self.Negate;
65+ when True =>
66+ return Text.Starts_With (Self.Text) xor Self.Negate;
67+ end case ;
6668 end Match ;
6769
6870end LSP.Search.Start_Word ;
You can’t perform that action at this time.
0 commit comments