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

@@ -67,7 +67,7 @@ export function startServer(connection: Connection, runtime: RuntimeEnvironment)
}
}
requestService = getRequestService(params.initializationOptions.handledSchemas || ['file'], connection, runtime);
requestService = getRequestService(params.initializationOptions?.handledSchemas || ['file'], connection, runtime);
function getClientCapability<T>(name: string, def: T) {
const keys = name.split('.');