Fix crash in LSP servers when initializationOptions are not provided

This commit is contained in:
Cameron Little
2020-09-30 08:52:38 +02:00
parent 0c50e1db17
commit 7cf15b2d31
3 changed files with 7 additions and 7 deletions

View File

@@ -137,7 +137,7 @@ export function startServer(connection: Connection, runtime: RuntimeEnvironment)
} : undefined,
hoverProvider: true,
documentSymbolProvider: true,
documentRangeFormattingProvider: params.initializationOptions.provideFormatter === true,
documentRangeFormattingProvider: params.initializationOptions?.provideFormatter === true,
colorProvider: {},
foldingRangeProvider: true,
selectionRangeProvider: true,