How to use the monaco-languageclient.BaseLanguageClient 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 Coding / WebIDE-Frontend / app / components / MonacoEditor / MonacoReact / createHelper.js View on Github external
export function createLanguageClient (connection, services) {
  return new BaseLanguageClient({
    name: 'Sample Language Client For Monaco',
    clientOptions: {
      // use a language id as a document selector
      documentSelector: ['java', 'class'],
      // disable the default error handler
      errorHandler: {
        error: () => ErrorAction.Continue,
        closed: () => CloseAction.DoNotRestart,
      },
    },
    services,
    // create a language client connection from the JSON RPC connection on demand
    connectionProvider: {
      get: (errorHandler, closeHandler) =>
        Promise.resolve(createConnection(connection, errorHandler, closeHandler)),
    },
github ballerina-attic / composer / modules / web / src / plugins / ballerina / views / source-editor.jsx View on Github external
.then((connection) => {
                // create and start the language client
                const languageClient = new BaseLanguageClient({
                    name: 'Ballerina Language Client',
                    clientOptions: {
                        // use a language id as a document selector
                        documentSelector: [BAL_LANGUAGE],
                        // disable the default error handler
                        errorHandler: {
                            error: () => ErrorAction.Continue,
                            closed: () => CloseAction.DoNotRestart,
                        },
                    },
                    services,
                    // create a language client connection from the JSON RPC connection on demand
                    connectionProvider: {
                        get: (errorHandler, closeHandler) => {
                            return Promise.resolve(createConnection(connection, errorHandler, closeHandler));
                        },
github ballerina-platform / ballerina-lang / composer / modules / web / src / plugins / ballerina / plugin.js View on Github external
onConnection: (connection) => {
                        this.langServerConnection = connection;
                        // create and start the language client
                        const languageClient = new BaseLanguageClient({
                            name: 'Ballerina Language Client',
                            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 });
                                    },
                                },
github crossminer / scava / crossflow / org.eclipse.scava.crossflow.web / lib / elkgraph / editor.js View on Github external
function createLanguageClient(messageConnection) {
    return new monaco_languageclient_1.BaseLanguageClient({
        name: 'ELK Graph Language Client',
        clientOptions: {
            documentSelector: ['elkt'],
            // Disable the default error handler
            errorHandler: {
                error: function () { return monaco_languageclient_1.ErrorAction.Continue; },
                closed: function () { return monaco_languageclient_1.CloseAction.DoNotRestart; }
            }
        },
        services: services,
        // Create a language client connection from the JSON RPC connection on demand
        connectionProvider: {
            get: function (errorHandler, closeHandler) {
                var connection = monaco_languageclient_1.createConnection(messageConnection, errorHandler, closeHandler);
                diagramServer.listen(connection);
                return Promise.resolve(connection);
github crossminer / scava / crossflow / org.eclipse.scava.crossflow.web / src / elkgraph / editor.ts View on Github external
function createLanguageClient(messageConnection: MessageConnection): BaseLanguageClient {
    return new BaseLanguageClient({
        name: 'ELK Graph Language Client',
        clientOptions: {
            documentSelector: ['elkt'],
            // Disable the default error handler
            errorHandler: {
                error: () => ErrorAction.Continue,
                closed: () => CloseAction.DoNotRestart
            }
        },
        services,
        // Create a language client connection from the JSON RPC connection on demand
        connectionProvider: {
            get: (errorHandler, closeHandler) => {
                const connection = createConnection(messageConnection, errorHandler, closeHandler)
                diagramServer.listen(connection)
                return Promise.resolve(connection)
github railsware / upterm / src / language-server / ShellLanguageServer.ts View on Github external
function createLanguageClient(connection: MessageConnection): BaseLanguageClient {
    return new BaseLanguageClient({
        name: "Sample Language Client",
        clientOptions: {
            // use a language id as a document selector
            documentSelector: ["json"],
            // disable the default error handler
            errorHandler: {
                error: () => ErrorAction.Continue,
                closed: () => CloseAction.DoNotRestart,
            },
        },
        services: monacoServices,
        // create a language client connection from the JSON RPC connection on demand
        connectionProvider: {
            get: (errorHandler, closeHandler) => {
                return Promise.resolve(createClientConnection(connection, errorHandler, closeHandler));
            },