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 1
1
-- ----------------------------------------------------------------------------
2
2
-- Language Server Protocol --
3
3
-- --
4
- -- Copyright (C) 2022-2023 , AdaCore --
4
+ -- Copyright (C) 2022-2024 , AdaCore --
5
5
-- --
6
6
-- This is free software; you can redistribute it and/or modify it under --
7
7
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -23,6 +23,7 @@ with LSP.Ada_Documents;
23
23
with LSP.Enumerations ;
24
24
with VSS.Strings.Character_Iterators ;
25
25
with VSS.Strings.Conversions ;
26
+ with VSS.Transformers.Caseless ;
26
27
with VSS.Unicode ;
27
28
28
29
pragma Warnings (Off, " is not referenced" );
@@ -265,7 +266,7 @@ package body LSP.Ada_Completions.Generic_Assoc is
265
266
or else
266
267
Name.Starts_With
267
268
(Completion_Prefix,
268
- VSS.Strings.Identifier_Caseless )
269
+ VSS.Transformers.Caseless.To_Identifier_Caseless )
269
270
then
270
271
-- Snippet Format: "Name => "
271
272
Item.label := Name;
Original file line number Diff line number Diff line change 1
1
-- ----------------------------------------------------------------------------
2
2
-- Language Server Protocol --
3
3
-- --
4
- -- Copyright (C) 2018-2021 , AdaCore --
4
+ -- Copyright (C) 2018-2024 , AdaCore --
5
5
-- --
6
6
-- This is free software; you can redistribute it and/or modify it under --
7
7
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -19,6 +19,7 @@ with Ada.Strings.Wide_Wide_Unbounded;
19
19
with Libadalang.Common ;
20
20
21
21
with VSS.Strings ;
22
+ with VSS.Transformers.Caseless ;
22
23
23
24
with LSP.Ada_Completions.Filters ;
24
25
with LSP.Enumerations ;
@@ -72,7 +73,7 @@ package body LSP.Ada_Completions.Keywords is
72
73
73
74
begin
74
75
if Label.Starts_With
75
- (Prefix, VSS.Strings.Identifier_Caseless )
76
+ (Prefix, VSS.Transformers.Caseless.To_Identifier_Caseless )
76
77
then
77
78
Item.label := Label;
78
79
Item.insertTextFormat := (True, LSP.Enumerations.PlainText);
Original file line number Diff line number Diff line change 1
1
-- ----------------------------------------------------------------------------
2
2
-- Language Server Protocol --
3
3
-- --
4
- -- Copyright (C) 2018-2021 , AdaCore --
4
+ -- Copyright (C) 2018-2024 , AdaCore --
5
5
-- --
6
6
-- This is free software; you can redistribute it and/or modify it under --
7
7
-- terms of the GNU General Public License as published by the Free Soft- --
18
18
with Langkit_Support.Errors ;
19
19
20
20
with VSS.Strings ;
21
+ with VSS.Transformers.Caseless ;
21
22
22
23
with LSP.Ada_Completions.Filters ;
23
24
@@ -185,7 +186,8 @@ package body LSP.Ada_Completions.Names is
185
186
elsif Dotted_Node.Kind in
186
187
Libadalang.Common.Ada_Dotted_Name_Range
187
188
or else Name.Starts_With
188
- (Prefix, VSS.Strings.Identifier_Caseless)
189
+ (Prefix,
190
+ VSS.Transformers.Caseless.To_Identifier_Caseless)
189
191
then
190
192
Completion_Count := Completion_Count + 1 ;
191
193
Original file line number Diff line number Diff line change 1
1
-- ----------------------------------------------------------------------------
2
2
-- Language Server Protocol --
3
3
-- --
4
- -- Copyright (C) 2020-2021 , AdaCore --
4
+ -- Copyright (C) 2020-2024 , AdaCore --
5
5
-- --
6
6
-- This is free software; you can redistribute it and/or modify it under --
7
7
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -25,6 +25,7 @@ with GNATCOLL.VFS; use GNATCOLL.VFS;
25
25
with GNATCOLL.Utils ;
26
26
27
27
with VSS.Strings.Conversions ;
28
+ with VSS.Transformers.Caseless ;
28
29
29
30
with LSP.Enumerations ;
30
31
with LSP.Predefined_Completion.Ada2012 ;
@@ -201,7 +202,7 @@ package body LSP.Predefined_Completion is
201
202
begin
202
203
for Item of Items loop
203
204
if Item.label.Starts_With
204
- (Prefix, VSS.Strings.Identifier_Caseless )
205
+ (Prefix, VSS.Transformers.Caseless.To_Identifier_Caseless )
205
206
then
206
207
Result.Append (Item);
207
208
end if ;
Original file line number Diff line number Diff line change 1
1
-- ----------------------------------------------------------------------------
2
2
-- Language Server Protocol --
3
3
-- --
4
- -- Copyright (C) 2021-2023 , AdaCore --
4
+ -- Copyright (C) 2021-2024 , AdaCore --
5
5
-- --
6
6
-- This is free software; you can redistribute it and/or modify it under --
7
7
-- terms of the GNU General Public License as published by the Free Soft- --
15
15
-- of the license. --
16
16
-- ----------------------------------------------------------------------------
17
17
18
+ with VSS.Transformers.Caseless ; use VSS.Transformers.Caseless;
19
+
18
20
package body LSP.Search.Start_Word is
19
21
20
22
-- ---------
@@ -54,15 +56,15 @@ package body LSP.Search.Start_Word is
54
56
overriding function Match
55
57
(Self : Start_Word_Search;
56
58
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
63
60
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 ;
66
68
end Match ;
67
69
68
70
end LSP.Search.Start_Word ;
You can’t perform that action at this time.
0 commit comments