From 8fc85c02c10db86a5e32608e973ec5020783921b Mon Sep 17 00:00:00 2001 From: Nicholas Bollweg Date: Sun, 20 Oct 2019 20:36:38 -0400 Subject: [PATCH] back to really long existence checks --- src/server.ts | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/server.ts b/src/server.ts index 7a526268..6aa54e2d 100755 --- a/src/server.ts +++ b/src/server.ts @@ -349,11 +349,16 @@ connection.onInitialize((params: InitializeParams): InitializeResult => { } workspaceFolders = params.workspaceFolders || []; - if (capabilities.textDocument) { - const { documentSymbol, rangeFormatting } = capabilities.textDocument; - hierarchicalDocumentSymbolSupport = !!(documentSymbol && documentSymbol.hierarchicalDocumentSymbolSupport); - clientDynamicRegisterSupport = !!(rangeFormatting && rangeFormatting.dynamicRegistration); - } + hierarchicalDocumentSymbolSupport = !!( + capabilities.textDocument && + capabilities.textDocument.documentSymbol && + capabilities.textDocument.documentSymbol.hierarchicalDocumentSymbolSupport + ); + clientDynamicRegisterSupport = !!( + capabilities.textDocument && + capabilities.textDocument.rangeFormatting && + capabilities.textDocument.rangeFormatting.dynamicRegistration + ); return { capabilities: {