From 174466516ebc0a2a53e440b64b32c37d43e78dea Mon Sep 17 00:00:00 2001 From: Riatre Foo Date: Fri, 14 Sep 2018 05:01:37 +0800 Subject: [PATCH] Allow force disabling snippet via client.snippetSupport --- src/config.h | 4 ++-- src/messages/initialize.cc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/config.h b/src/config.h index 2c5352c9..86a1d161 100644 --- a/src/config.h +++ b/src/config.h @@ -70,9 +70,9 @@ struct Config { struct ClientCapability { // TextDocumentClientCapabilities.documentSymbol.hierarchicalDocumentSymbolSupport - bool hierarchicalDocumentSymbolSupport = false; + bool hierarchicalDocumentSymbolSupport = true; // TextDocumentClientCapabilities.completion.completionItem.snippetSupport - bool snippetSupport = false; + bool snippetSupport = true; } client; struct CodeLens { diff --git a/src/messages/initialize.cc b/src/messages/initialize.cc index 5ba4caad..7b9a91f5 100644 --- a/src/messages/initialize.cc +++ b/src/messages/initialize.cc @@ -441,9 +441,9 @@ struct Handler_Initialize : BaseMessageHandler { // Client capabilities const auto &capabilities = params.capabilities; - g_config->client.snippetSupport = + g_config->client.snippetSupport &= capabilities.textDocument.completion.completionItem.snippetSupport; - g_config->client.hierarchicalDocumentSymbolSupport = + g_config->client.hierarchicalDocumentSymbolSupport &= capabilities.textDocument.documentSymbol.hierarchicalDocumentSymbolSupport; // Ensure there is a resource directory.