1818with VSS.Strings ;
1919
2020with LSP.Predefined_Completion ;
21+ with LSP.Ada_Completions.Filters ;
2122
2223package body LSP.Ada_Completions.Aspects is
2324
@@ -34,28 +35,29 @@ package body LSP.Ada_Completions.Aspects is
3435 Names : in out Ada_Completions.Completion_Maps.Map;
3536 Result : in out LSP.Messages.CompletionList)
3637 is
37- pragma Unreferenced (Filter);
3838 pragma Unreferenced (Names);
3939
4040 Parent : constant Libadalang.Analysis.Ada_Node :=
4141 (if Node.Is_Null then Node else Node.Parent);
4242 begin
43- if not Parent.Is_Null and then
44- Parent.Kind in Libadalang.Common.Ada_Aspect_Assoc_Range
45- then
46- declare
47- Prefix : constant VSS.Strings.Virtual_String :=
48- VSS.Strings.To_Virtual_String (Node.Text);
49-
50- begin
43+ if Filter.Is_Aspect then
44+ if not Parent.Is_Null and then
45+ Parent.Kind in Libadalang.Common.Ada_Aspect_Assoc_Range
46+ then
47+ declare
48+ Prefix : constant VSS.Strings.Virtual_String :=
49+ VSS.Strings.To_Virtual_String (Node.Text);
50+
51+ begin
52+ LSP.Predefined_Completion.Get_Aspects
53+ (Prefix => Prefix,
54+ Result => Result.items);
55+ end ;
56+ elsif Node.Kind in Libadalang.Common.Ada_Aspect_Spec_Range then
5157 LSP.Predefined_Completion.Get_Aspects
52- (Prefix => Prefix ,
58+ (Prefix => VSS.Strings.Empty_Virtual_String ,
5359 Result => Result.items);
54- end ;
55- elsif Node.Kind in Libadalang.Common.Ada_Aspect_Spec_Range then
56- LSP.Predefined_Completion.Get_Aspects
57- (Prefix => VSS.Strings.Empty_Virtual_String,
58- Result => Result.items);
60+ end if ;
5961 end if ;
6062 end Propose_Completion ;
6163
0 commit comments