Skip to content

Commit

Permalink
Merge remote branch 'origin/master' into edge
Browse files Browse the repository at this point in the history
  • Loading branch information
automatic-merge committed Oct 4, 2023
2 parents 50b05c5 + 8d7644f commit 02fef66
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ ifneq ($(COVERAGE),)
# are not overriden by new ones don't get in our way.
rm -rf .obj/*/gnatcov-instr
$(COVERAGE_INSTR) -XVERSION=$(VERSION) -XBUILD_DATE=$(BUILD_DATE) \
-Pgnat/lsp_server.gpr --projects lsp_server --projects lsp
-Pgnat/lsp_server.gpr --projects lsp_server --projects lsp_3_17
$(COVERAGE_INSTR) -Pgnat/tester.gpr --projects lsp
$(COVERAGE_INSTR) -Pgnat/codec_test.gpr --projects lsp
endif
Expand Down
18 changes: 18 additions & 0 deletions source/ada/lsp-ada_client_capabilities.adb
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,24 @@ package body LSP.Ada_Client_Capabilities is
else False);
end Code_ActionLiteralSupport;

-------------------------------
-- Completion_SnippetSupport --
-------------------------------

function Completion_SnippetSupport
(Self : Client_Capability'Class) return Boolean
is
use LSP.Structures.Unwrap;

Result : constant LSP.Structures.Boolean_Optional :=
snippetSupport
(completionItem
(completion
(Self.Value.capabilities.textDocument)));
begin
return (if Result.Is_Set then Result.Value else False);
end Completion_SnippetSupport;

-----------------------------------------------
-- didChangeWatchedFiles_dynamicRegistration --
-----------------------------------------------
Expand Down
4 changes: 4 additions & 0 deletions source/ada/lsp-ada_client_capabilities.ads
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ package LSP.Ada_Client_Capabilities is
(Self : Client_Capability'Class) return Boolean;
-- Returns textDocument.documentSymbol.hierarchicalDocumentSymbolSupport

function Completion_SnippetSupport
(Self : Client_Capability'Class) return Boolean;
-- Returns textDocument.completion.completionItem.snippetSupport

function didChangeWatchedFiles_dynamicRegistration
(Self : Client_Capability'Class) return Boolean;
-- Returns capabilities.workspace.didChangeWatchedFiles.dynamicRegistration
Expand Down
4 changes: 4 additions & 0 deletions source/ada/lsp-ada_configurations.adb
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,15 @@ package body LSP.Ada_Configurations is
Index : Positive := From;
Variables_Names : VSS.String_Vectors.Virtual_String_Vector;
Variables_Values : VSS.String_Vectors.Virtual_String_Vector;
Follow_Symlinks : constant Boolean := Self.Follow_Symlinks;

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

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

---------------------
-- Parse_Variables --
Expand Down Expand Up @@ -146,6 +148,7 @@ package body LSP.Ada_Configurations is
begin
if Target /= Value then
Target := Value;
Reload := True;
end if;
end Set;

Expand Down Expand Up @@ -248,6 +251,7 @@ package body LSP.Ada_Configurations is
and then JSON (Index).Kind = Boolean_Value
then
Self.Follow_Symlinks := JSON (Index).Boolean_Value;
Reload := Reload or else Follow_Symlinks /= Self.Follow_Symlinks;

elsif Name = "documentationStyle"
and then JSON (Index).Kind = String_Value
Expand Down
4 changes: 3 additions & 1 deletion source/ada/lsp-ada_handlers.adb
Original file line number Diff line number Diff line change
Expand Up @@ -1633,7 +1633,9 @@ package body LSP.Ada_Handlers is
LSP.Ada_Completions.Attributes.Attributes_Completion_Provider;

P5 : aliased LSP.Ada_Completions.Names.Name_Completion_Provider
(Self.Configuration.Use_Completion_Snippets);
(Self.Configuration.Use_Completion_Snippets
and then Self.Client.Completion_SnippetSupport);

P6 : aliased LSP.Ada_Handlers.Invisibles.Invisible_Completion_Provider
(Self'Access, Context);
P7 : aliased
Expand Down
5 changes: 5 additions & 0 deletions source/lsp_3.17/lsp-structures-unwrap.ads
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ package LSP.Structures.Unwrap is
return resolveSupport_OfWorkspaceSymbolClientCapabilities_Optional is
(if X.Is_Set then X.Value.resolveSupport else (Is_Set => False));

function snippetSupport
(X : completionItem_OfCompletionClientCapabilities_Optional)
return Boolean_Optional is
(if X.Is_Set then X.Value.snippetSupport else (Is_Set => False));

function properties
(X : resolveSupport_OfWorkspaceSymbolClientCapabilities_Optional)
return LSP.Structures.Virtual_String_Vector is
Expand Down

0 comments on commit 02fef66

Please sign in to comment.