@@ -25,6 +25,7 @@ with VSS.Strings.Conversions;
2525with VSS.Strings.Cursors.Iterators.Characters ;
2626with VSS.Strings.Cursors.Markers ;
2727with VSS.Strings.Hash ;
28+ with VSS.Transformers.Casing ;
2829
2930with LSP.Ada_Configurations ;
3031with LSP.Ada_Contexts ;
@@ -198,7 +199,7 @@ package body LSP.Ada_Completions is
198199
199200 Encoding : Encoding_Maps.Map;
200201 -- Map of Snippet fake name to snippet:
201- -- {"Foo_1 " : "$1", "Foo_2 " : "${2: Integer}"}
202+ -- {"foobar_1 " : "$1", "foobar_2 " : "${2: Integer}"}
202203 -- $0 will not be replaced
203204
204205 procedure Set_PP_Switches
@@ -212,7 +213,7 @@ package body LSP.Ada_Completions is
212213 -- Recreate the snippet via the pseudo code
213214
214215 function Snippet_Placeholder (S : Virtual_String) return Virtual_String
215- is (" FooBar_ " & S);
216+ is (" foobar_ " & S);
216217 -- Generate a fake entity for a snippet (S is the index of the snippet)
217218 -- The length of the placeholder will affect where the strings is cut
218219 -- to avoid exceeding line length => 8/9 characters seems to be
@@ -369,7 +370,11 @@ package body LSP.Ada_Completions is
369370 Dummy := Pos.Backward;
370371 Append (Res, U.Slice (Iterator, Pos));
371372 end ;
372- Append (Res, Encoding (Match.Captured));
373+ Append
374+ (Res,
375+ Encoding
376+ (VSS.Transformers.Casing.To_Lowercase.Transform
377+ (Match.Captured)));
373378 Iterator.Set_At (Match.Last_Marker);
374379 Dummy := Iterator.Forward;
375380 end ;
@@ -393,7 +398,9 @@ package body LSP.Ada_Completions is
393398 is
394399 Placeholder_Regexp : constant VSS.Regular_Expressions.
395400 Regular_Expression := VSS.Regular_Expressions.To_Regular_Expression
396- (" FooBar_[0-9]+" );
401+ (" FooBar_[0-9]+" ,
402+ Options => [VSS.Regular_Expressions.Case_Insensitive => True,
403+ others => False]);
397404 begin
398405 return Placeholder_Regexp.Match (S, Start);
399406 end Find_Next_Placeholder ;
0 commit comments