Skip to content

Commit f2bea26

Browse files
Merge branch 'topic/eng/ide/ada_language_server#1398' into 'master'
Add '.' in GPR language server's triggerCharacters See merge request eng/ide/ada_language_server!1642
2 parents 23d8f16 + 40f66b7 commit f2bea26

File tree

14 files changed

+5483
-6992
lines changed

14 files changed

+5483
-6992
lines changed

source/gpr/lsp-gpr_completions.adb

+5-1
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ package body LSP.GPR_Completions is
6666
Response : in out LSP.Structures.Completion_Result);
6767
-- Handle completion when cursor after "package" keyword or after a project
6868
-- reference.
69+
-- If Unexisting_Only is returned, only the packages that have not been
70+
-- defined in the given project file will be returned. Otherwise, only
71+
-- the package that have been defined will be returned.
6972

7073
procedure Fill_Type_Completion_Response
7174
(File : LSP.GPR_Files.File_Access;
@@ -242,8 +245,9 @@ package body LSP.GPR_Completions is
242245
for Id of PRP.All_Packages loop
243246
declare
244247
Item : LSP.Structures.CompletionItem;
248+
Exists_In_File : constant Boolean := File.In_Packages (Id);
245249
begin
246-
if (not File.In_Packages (Id) or else not Unexisting_Only)
250+
if (Unexisting_Only xor Exists_In_File)
247251
and then PRP.Is_Allowed_In (Id, Kind)
248252
and then VSS.Strings.Starts_With
249253
(To_Lower (VSS.Strings.To_Virtual_String

source/gpr/lsp-gpr_handlers.adb

+1-1
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ package body LSP.GPR_Handlers is
381381
Capabilities.declarationProvider := LSP.Constants.True;
382382
Capabilities.completionProvider :=
383383
(Is_Set => True,
384-
Value => (triggerCharacters => [" "],
384+
Value => (triggerCharacters => [" ", "."],
385385
resolveProvider => LSP.Constants.True,
386386
others => <>));
387387

0 commit comments

Comments
 (0)