Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
listenTo(lang: string) {
const langUrl = this.createUrl(lang);
const langWebSocket = this.createWebSocket(langUrl);
const langService = createMonacoServices(this.editorControl.editor.getValue());
this.log.info(`Connecting to ${lang} server`);
listen({
webSocket: langWebSocket,
onConnection: connection => {
// create and start the language client
const languageClient = this.createLanguageClient(lang, connection, langService);
const disposable = languageClient.start();
connection.onClose(() => disposable.dispose());
connection.onDispose(() => disposable.dispose());
this.languageService.addConnection(lang, connection);
}
});
}