How to use the monaco-languageclient/lib.createMonacoServices function in monaco-languageclient

To help you get started, we’ve selected a few monaco-languageclient examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github zowe / zlux-editor / webClient / src / app / editor / code-editor / monaco / monaco.component.ts View on Github external
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);
      }
    });
  }