How to use the monaco-languageclient.MonacoLanguages 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 ballerina-platform / ballerina-lang / composer / modules / web / src / plugins / ballerina / plugin.js View on Github external
clientOptions: {
                                // use a language id as a document selector
                                documentSelector: ['ballerina-lang'],
                                // disable the default error handler
                                errorHandler: {
                                    error: () => ErrorAction.Continue,
                                    closed: () => CloseAction.DoNotRestart,
                                },
                            },
                            services: {
                                commands: {
                                    registerCommand: (...args) => {
                                        this.lsCommands.push({ ...args });
                                    },
                                },
                                languages: new MonacoLanguages(p2m, m2p),
                                workspace: new MonacoWorkspace(p2m, m2p),
                                window: new ConsoleWindow(),
                            },
                            // create a language client connection from the JSON RPC connection on demand
                            connectionProvider: {
                                get: (errorHandler, closeHandler) => {
                                    return Promise.resolve(createConnection(connection, errorHandler, closeHandler));
                                },
                            },
                        });
                        const disposable = languageClient.start();
                        connection.onClose(() => disposable.dispose());
                        resolve(this.langServerConnection);
                    },
                });
github Coding / WebIDE-Frontend / app / components / MonacoEditor / Editors / createHelper.js View on Github external
export function createMonacoServices (editor, options) {
  const m2p = new MonacoToProtocolConverter()
  const p2m = new ProtocolToMonacoConverter()
  return {
    commands: new MonacoCommands(editor),
    languages: new MonacoLanguages(p2m, m2p),
    workspace: new MonacoWorkspace(p2m, m2p, options.rootUri),
    window: new ConsoleWindow()
  }
}