diff --git a/Makefile b/Makefile index b84d88f39..80b166ccd 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/source/ada/lsp-ada_client_capabilities.adb b/source/ada/lsp-ada_client_capabilities.adb index 8b84a726c..6d5fa2367 100644 --- a/source/ada/lsp-ada_client_capabilities.adb +++ b/source/ada/lsp-ada_client_capabilities.adb @@ -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 -- ----------------------------------------------- diff --git a/source/ada/lsp-ada_client_capabilities.ads b/source/ada/lsp-ada_client_capabilities.ads index f74d2256b..9d22b3f03 100644 --- a/source/ada/lsp-ada_client_capabilities.ads +++ b/source/ada/lsp-ada_client_capabilities.ads @@ -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 diff --git a/source/ada/lsp-ada_configurations.adb b/source/ada/lsp-ada_configurations.adb index 7fa640f30..9ca223949 100644 --- a/source/ada/lsp-ada_configurations.adb +++ b/source/ada/lsp-ada_configurations.adb @@ -103,6 +103,7 @@ 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); @@ -110,6 +111,7 @@ package body LSP.Ada_Configurations is 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 -- @@ -146,6 +148,7 @@ package body LSP.Ada_Configurations is begin if Target /= Value then Target := Value; + Reload := True; end if; end Set; @@ -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 diff --git a/source/ada/lsp-ada_handlers.adb b/source/ada/lsp-ada_handlers.adb index 5b99b61ff..244cb9542 100644 --- a/source/ada/lsp-ada_handlers.adb +++ b/source/ada/lsp-ada_handlers.adb @@ -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 diff --git a/source/lsp_3.17/lsp-structures-unwrap.ads b/source/lsp_3.17/lsp-structures-unwrap.ads index 3d766cac5..a01d83b87 100644 --- a/source/lsp_3.17/lsp-structures-unwrap.ads +++ b/source/lsp_3.17/lsp-structures-unwrap.ads @@ -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