Skip to content

Commit 02fef66

Browse files
author
automatic-merge
committedOct 4, 2023
Merge remote branch 'origin/master' into edge
·
v25.0.024.0.1
2 parents 50b05c5 + 8d7644f commit 02fef66

File tree

6 files changed

+35
-2
lines changed

6 files changed

+35
-2
lines changed
 

‎Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ ifneq ($(COVERAGE),)
116116
# are not overriden by new ones don't get in our way.
117117
rm -rf .obj/*/gnatcov-instr
118118
$(COVERAGE_INSTR) -XVERSION=$(VERSION) -XBUILD_DATE=$(BUILD_DATE) \
119-
-Pgnat/lsp_server.gpr --projects lsp_server --projects lsp
119+
-Pgnat/lsp_server.gpr --projects lsp_server --projects lsp_3_17
120120
$(COVERAGE_INSTR) -Pgnat/tester.gpr --projects lsp
121121
$(COVERAGE_INSTR) -Pgnat/codec_test.gpr --projects lsp
122122
endif

‎source/ada/lsp-ada_client_capabilities.adb

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,24 @@ package body LSP.Ada_Client_Capabilities is
6363
else False);
6464
end Code_ActionLiteralSupport;
6565

66+
-------------------------------
67+
-- Completion_SnippetSupport --
68+
-------------------------------
69+
70+
function Completion_SnippetSupport
71+
(Self : Client_Capability'Class) return Boolean
72+
is
73+
use LSP.Structures.Unwrap;
74+
75+
Result : constant LSP.Structures.Boolean_Optional :=
76+
snippetSupport
77+
(completionItem
78+
(completion
79+
(Self.Value.capabilities.textDocument)));
80+
begin
81+
return (if Result.Is_Set then Result.Value else False);
82+
end Completion_SnippetSupport;
83+
6684
-----------------------------------------------
6785
-- didChangeWatchedFiles_dynamicRegistration --
6886
-----------------------------------------------

‎source/ada/lsp-ada_client_capabilities.ads

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ package LSP.Ada_Client_Capabilities is
7575
(Self : Client_Capability'Class) return Boolean;
7676
-- Returns textDocument.documentSymbol.hierarchicalDocumentSymbolSupport
7777

78+
function Completion_SnippetSupport
79+
(Self : Client_Capability'Class) return Boolean;
80+
-- Returns textDocument.completion.completionItem.snippetSupport
81+
7882
function didChangeWatchedFiles_dynamicRegistration
7983
(Self : Client_Capability'Class) return Boolean;
8084
-- Returns capabilities.workspace.didChangeWatchedFiles.dynamicRegistration

‎source/ada/lsp-ada_configurations.adb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,15 @@ package body LSP.Ada_Configurations is
103103
Index : Positive := From;
104104
Variables_Names : VSS.String_Vectors.Virtual_String_Vector;
105105
Variables_Values : VSS.String_Vectors.Virtual_String_Vector;
106+
Follow_Symlinks : constant Boolean := Self.Follow_Symlinks;
106107

107108
procedure Parse_Variables (From : Positive);
108109
procedure Swap_Variables (Left, Right : Positive);
109110

110111
procedure Set
111112
(Target : in out VSS.Strings.Virtual_String;
112113
Value : VSS.Strings.Virtual_String);
114+
-- If Target /= Value then assign Target and set Reload to Trues
113115

114116
---------------------
115117
-- Parse_Variables --
@@ -146,6 +148,7 @@ package body LSP.Ada_Configurations is
146148
begin
147149
if Target /= Value then
148150
Target := Value;
151+
Reload := True;
149152
end if;
150153
end Set;
151154

@@ -248,6 +251,7 @@ package body LSP.Ada_Configurations is
248251
and then JSON (Index).Kind = Boolean_Value
249252
then
250253
Self.Follow_Symlinks := JSON (Index).Boolean_Value;
254+
Reload := Reload or else Follow_Symlinks /= Self.Follow_Symlinks;
251255

252256
elsif Name = "documentationStyle"
253257
and then JSON (Index).Kind = String_Value

‎source/ada/lsp-ada_handlers.adb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1633,7 +1633,9 @@ package body LSP.Ada_Handlers is
16331633
LSP.Ada_Completions.Attributes.Attributes_Completion_Provider;
16341634

16351635
P5 : aliased LSP.Ada_Completions.Names.Name_Completion_Provider
1636-
(Self.Configuration.Use_Completion_Snippets);
1636+
(Self.Configuration.Use_Completion_Snippets
1637+
and then Self.Client.Completion_SnippetSupport);
1638+
16371639
P6 : aliased LSP.Ada_Handlers.Invisibles.Invisible_Completion_Provider
16381640
(Self'Access, Context);
16391641
P7 : aliased

‎source/lsp_3.17/lsp-structures-unwrap.ads

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ package LSP.Structures.Unwrap is
4444
return resolveSupport_OfWorkspaceSymbolClientCapabilities_Optional is
4545
(if X.Is_Set then X.Value.resolveSupport else (Is_Set => False));
4646

47+
function snippetSupport
48+
(X : completionItem_OfCompletionClientCapabilities_Optional)
49+
return Boolean_Optional is
50+
(if X.Is_Set then X.Value.snippetSupport else (Is_Set => False));
51+
4752
function properties
4853
(X : resolveSupport_OfWorkspaceSymbolClientCapabilities_Optional)
4954
return LSP.Structures.Virtual_String_Vector is

0 commit comments

Comments
 (0)
Please sign in to comment.