How to use the vscode-languageclient.TransportKind function in vscode-languageclient

To help you get started, we’ve selected a few vscode-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 Armitxes / VSCode_SQF / env / client / init.js View on Github external
exports.activate = (context) => {
    sqf_commands.registerCommands(context);
    vsc_core.languages.registerCompletionItemProvider('sqf', sqf_completion.provider);

    // Server Options
    let serverModule = context.asAbsolutePath('env/server/init.js');
    let debugOptions = { execArgv: ["--nolazy", "--debug=6009"] };

    let serverOptions = {
        run: { module: serverModule, transport: vsc_lang_client.TransportKind.ipc },
        debug: { module: serverModule, transport: vsc_lang_client.TransportKind.ipc, options: debugOptions }
    };


    // Client Options
    let clientOptions = {
        documentSelector: ['sqf'],
        synchronize: {
            configurationSection: 'sqf',
            fileEvents: vsc_core.workspace.createFileSystemWatcher('**/.clientrc')
        }
    };

    // Create the language client and start the client.
    let lc = new vsc_lang_client.LanguageClient('sqfLanguageServer', 'SQF Language Server', serverOptions, clientOptions);
    let disposable = lc.start();
github SardineFish / UnityShaderSupport / client / out / extension.js View on Github external
function activate(context) {
    console.log("Activated");
    let serverModule = context.asAbsolutePath(path.join("server", "out", "server.js"));
    let debugOption = { execArgv: ["--nolazy", "--inspect=6009"] };
    let serverOptions = {
        run: { module: serverModule, transport: vscode_languageclient_1.TransportKind.ipc },
        debug: {
            module: serverModule,
            transport: vscode_languageclient_1.TransportKind.ipc,
            options: debugOption
        }
    };
    let clientOption = {
        documentSelector: [{ scheme: "file", language: "shaderlab" }],
        synchronize: {
            fileEvents: vscode_1.workspace.createFileSystemWatcher("**/.clientrc")
        }
    };
    client = new vscode_languageclient_1.LanguageClient("ShaderLab Language Server", serverOptions, clientOption);
    client.start();
    console.log("Client started");
}
github vmware / vrealize-developer-tools / extension / src / client / lang / LanguageServices.ts View on Github external
private newLanguageClient(): client.LanguageClient {
        const config = vscode.workspace.getConfiguration("vrdev")
        const module = this.extensionContext.asAbsolutePath(path.join("language-server"))
        const executable = path.join(module, "out", "server", "langserver.js")
        this.logger.info(`Starting vRO language server on port 6014`)

        const serverOptions = {
            run: {
                module: executable,
                transport: client.TransportKind.ipc,
                args: ["--node-ipc"],
                options: { cwd: module }
            },
            debug: {
                module: executable,
                transport: client.TransportKind.ipc,
                args: ["--node-ipc"],
                options: { cwd: module, execArgv: ["--nolazy", "--inspect=6014"] }
            }
        }

        const clientOptions: client.LanguageClientOptions = {
            documentSelector: [
                {
                    language: "javascript",
                    scheme: "file"
                }
            ],
            errorHandler: new ErrorHandler(),
            initializationOptions: config,
            outputChannel: this.outputChannel,
            revealOutputChannelOn: client.RevealOutputChannelOn.Never,
github liwangqian / LuaCoderAssist / client / extension.js View on Github external
function activate(context) {
    let serverModule = context.asAbsolutePath(path.join('server', 'server-ipc.js'));
    let debugOptions = { execArgv: ["--nolazy", "--inspect=6004"] };
    let serverOptions = {
        run: { module: serverModule, transport: languageclient.TransportKind.ipc },
        debug: { module: serverModule, transport: languageclient.TransportKind.ipc, options: debugOptions }
    };

    let clientOptions = {
        documentSelector: { scheme: 'file', language: 'lua' },
        synchronize: {
            configurationSection: 'LuaCoderAssist',
            fileEvents: [vscode.workspace.createFileSystemWatcher('**/*.lua', false, true, false)]
        }
    };

    logger_1.Logger.configure();

    let connection = new languageclient.LanguageClient('LuaCoderAssist', serverOptions, clientOptions);
    context.subscriptions.push(connection.start());

    context.subscriptions.push(
github microsoft / azure-pipelines-vscode / src / extension.ts View on Github external
function getServerOptions(context: vscode.ExtensionContext): languageclient.ServerOptions {
    const languageServerPath = context.asAbsolutePath(path.join('node_modules', 'azure-pipelines-language-server', 'server.js'));

    return {
        run: { module: languageServerPath, transport: languageclient.TransportKind.ipc },
        debug: { module: languageServerPath, transport: languageclient.TransportKind.ipc, options: { execArgv: ["--nolazy", "--inspect=6009"] } }
    };
}
github reasonml-editor / vscode-reasonml / src / client / index.ts View on Github external
export async function launch(context: vscode.ExtensionContext): Promise {
  const reasonConfig = vscode.workspace.getConfiguration("reason");
  const module = context.asAbsolutePath(path.join("node_modules", "ocaml-language-server", "bin", "server"));
  const options = { execArgv: ["--nolazy", "--inspect=6009"] };
  const transport = client.TransportKind.ipc;
  const run = { module, transport };
  const debug = {
    module,
    options,
    transport,
  };
  const serverOptions = { run, debug };
  const languages = reasonConfig.get("server.languages", ["ocaml", "reason"]);
  const documentSelector = flatMap(languages, (language: string) => [
    { language, scheme: "file" },
    { language, scheme: "untitled" },
  ]);

  const clientOptions: client.LanguageClientOptions = {
    diagnosticCollectionName: "ocaml-language-server",
    documentSelector,
github liwangqian / LuaCoderAssist / client / extension.js View on Github external
function activate(context) {
    let serverModule = context.asAbsolutePath(path.join('server', 'server-ipc.js'));
    let debugOptions = { execArgv: ["--nolazy", "--inspect=6004"] };
    let serverOptions = {
        run: { module: serverModule, transport: languageclient.TransportKind.ipc },
        debug: { module: serverModule, transport: languageclient.TransportKind.ipc, options: debugOptions }
    };

    let clientOptions = {
        documentSelector: { scheme: 'file', language: 'lua' },
        synchronize: {
            configurationSection: 'LuaCoderAssist',
            fileEvents: [vscode.workspace.createFileSystemWatcher('**/*.lua', false, true, false)]
        }
    };

    logger_1.Logger.configure();

    let connection = new languageclient.LanguageClient('LuaCoderAssist', serverOptions, clientOptions);
    context.subscriptions.push(connection.start());
github APerricone / harbourCodeExtension / client / src / extension.js View on Github external
function activate(context) {
	vscode.languages.setLanguageConfiguration('harbour', {
		indentationRules: {
			increaseIndentPattern: /^\s*((?:(?:static|init|exit)\s+)?(?:proc(?:e(?:d(?:u(?:r(?:e)?)?)?)?)?|func(?:t(?:i(?:o(?:n)?)?)?)?)|class|method|if|else(?:if)?|for|if|try|case|otherwise|(?:do\s+)?while|switch|begin)\b/i,
			decreaseIndentPattern: /^\s*(end\s*([a-z]*)?|next|else|elseif|return)\b/i
		}
	});
	validation.activate(context);
	
	var serverModuleDbg = context.asAbsolutePath(path.join('..','server'));
	var serverModule = context.asAbsolutePath('server');
	var debugOptions = { execArgv: ["--nolazy", "--inspect-brk=21780"] };
	var serverOptions = {
		run : { module: serverModule, transport: client.TransportKind.ipc },
		debug: { module: serverModuleDbg, transport: client.TransportKind.ipc , options: debugOptions }
	} 
	var clientOptions = {
		documentSelector: ['harbour'],
		synchronize: {
			configurationSection: ['harbour','search','editor']
		}
	}
	var cl = new client.LanguageClient('HarbourServer', 'Harbour Server', serverOptions, clientOptions);
	context.subscriptions.push(cl.start());
	vscode.commands.registerCommand('harbour.getdbgcode', GetDbgCode);
	//vscode.languages.registerFoldingRangeProvider(['harbour'], new decorator.HBProvider());
	decorator.activate(context,cl);
	docCreator.activate(context,cl);
}
github APerricone / harbourCodeExtension / client / src / extension.js View on Github external
function activate(context) {
	vscode.languages.setLanguageConfiguration('harbour', {
		indentationRules: {
			increaseIndentPattern: /^\s*(proc(?:e(?:d(?:u(?:r(?:e)?)?)?)?)?|func(?:t(?:i(?:o(?:n)?)?)?)?|class|if|else|elseif|for|if|try|case|otherwise|while|switch)\b/i,
			decreaseIndentPattern: /^\s*(end[a-z]*|next|else|elseif|next)\b/i
		}
	});
	validation.activate(context);
	decorator.activate(context);

	var serverModuleDbg = context.asAbsolutePath(path.join('..','server'));
	var serverModule = context.asAbsolutePath('server');
	var debugOptions = { execArgv: ["--nolazy", "--debug-brk=21780"] };
	var serverOptions = {
		run : { module: serverModule, transport: client.TransportKind.ipc },
		debug: { module: serverModuleDbg, transport: client.TransportKind.ipc , options: debugOptions }
	} 

	var clientOptions = {
		documentSelector: ['harbour'],
		synchronize: {
			configurationSection: 'harbour'
		}
	}
	context.subscriptions.push(new client.LanguageClient('HarbourServer', 
		'Harbour Server', serverOptions, clientOptions).start());
}
github APerricone / harbourCodeExtension / client / src / extension.js View on Github external
function activate(context) {
	vscode.languages.setLanguageConfiguration('harbour', {
		indentationRules: {
			increaseIndentPattern: /^\s*(proc(?:e(?:d(?:u(?:r(?:e)?)?)?)?)?|func(?:t(?:i(?:o(?:n)?)?)?)?|class|if|else|elseif|for|if|try|case|otherwise|while|switch)\b/i,
			decreaseIndentPattern: /^\s*(end[a-z]*|next|else|elseif|next)\b/i
		}
	});
	validation.activate(context);
	decorator.activate(context);

	var serverModuleDbg = context.asAbsolutePath(path.join('..','server'));
	var serverModule = context.asAbsolutePath('server');
	var debugOptions = { execArgv: ["--nolazy", "--debug-brk=21780"] };
	var serverOptions = {
		run : { module: serverModule, transport: client.TransportKind.ipc },
		debug: { module: serverModuleDbg, transport: client.TransportKind.ipc , options: debugOptions }
	} 

	var clientOptions = {
		documentSelector: ['harbour'],
		synchronize: {
			configurationSection: 'harbour'
		}
	}
	context.subscriptions.push(new client.LanguageClient('HarbourServer', 
		'Harbour Server', serverOptions, clientOptions).start());
}