How to use the vscode-languageclient.TransportKind.stdio 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 alanz / vscode-hie-server / src / extension.ts View on Github external
const runArgs: string[] = [];
  let debugArgs: string[] = [];
  if (logLevel === 'verbose') {
    debugArgs = ['-d', '--vomit'];
  } else if (logLevel === 'messages') {
    debugArgs = ['-d'];
  }
  if (logFile !== '') {
    debugArgs = debugArgs.concat(['-l', logFile]);
  }

  // If the extension is launched in debug mode then the debug server options are used,
  // otherwise the run options are used.
  const serverOptions: ServerOptions = {
    run: { command: serverPath, transport: TransportKind.stdio, args: runArgs },
    debug: { command: serverPath, transport: TransportKind.stdio, args: debugArgs }
  };

  // Set a unique name per workspace folder (useful for multi-root workspaces).
  const langName = 'Haskell HIE (' + folder.name + ')';
  const outputChannel: OutputChannel = window.createOutputChannel(langName);
  const clientOptions: LanguageClientOptions = {
    // Use the document selector to only notify the LSP on files inside the folder
    // path for the specific workspace.
    documentSelector: [
      { scheme: 'file', language: 'haskell', pattern: `${folder.uri.fsPath}/**/*` },
      { scheme: 'file', language: 'literate haskell', pattern: `${folder.uri.fsPath}/**/*` }
    ],
    synchronize: {
      // Synchronize the setting section 'languageServerHaskell' to the server.
      configurationSection: 'languageServerHaskell',
github elm-tooling / elm-vscode-language-client-haskell / src / extension.ts View on Github external
function startClient(dir: string) {
    if (clients.has(dir)) {
        // Client was already started for this directory
        return;
    }

    let serverPath = 'elm-language-server';
    let debugArgs = [
            '--server-log-file', 'c:/dev/elm-lsp-log.txt',
            '--session-log-file', 'c:/dev/elm-lsp-log-session.txt'
        ];
    // If the extension is launched in debug mode then the debug server options are used
    // Otherwise the run options are used
    let serverOptions: ServerOptions = {
        run: { command: serverPath, args: debugArgs, transport: TransportKind.stdio },
        debug: { command: serverPath, args: debugArgs, transport: TransportKind.stdio }
    };

    // Options to control the language client
    let clientOptions: LanguageClientOptions = {
        // Register the server for Elm documents in the directory
        documentSelector: [
            {
                scheme: 'file', pattern: join(dir, "**", "*.elm")
            }
        ],
        // Notify the server about file changes to 'elm.json'
        synchronize: {
            fileEvents: workspace.createFileSystemWatcher(join(dir, 'elm.json'))
        }
    };
github microsoft / azuredatastudio-postgresql / src / main.ts View on Github external
let logFileLocation = path.join(Utils.getDefaultLogLocation(), Constants.providerId);

		serverArgs.push('--log-dir=' + logFileLocation);
		serverArgs.push(logFileLocation);

		// Enable diagnostic logging in the service if it is configured
		let logDebugInfo = config["logDebugInfo"];
		if (logDebugInfo) {
			serverArgs.push('--enable-logging');
		}
	}

	serverArgs.push('provider=' + Constants.providerId);
	// run the service host
	return  {  command: serverCommand, args: serverArgs, transport: TransportKind.stdio  };
}
github dbaumgarten / yodk / vscode-yolol / src / extension.ts View on Github external
args = args.concat(["--debug", "--logfile", getLogfilePath("language-server-log.txt")])
	}

	if (!areHotkeysEnabled()){
		args = args.concat(["--hotkeys=false"])
	}

	let serverOptions: ServerOptions = {
		run: {
			command: serverModule,
			transport: TransportKind.stdio,
			args: args,
		},
		debug: {
			command: serverModule,
			transport: TransportKind.stdio,
			args: args,
		}
	};

	// Options to control the language client
	let clientOptions: LanguageClientOptions = {
		// Register the server for plain text documents
		documentSelector: [{ scheme: 'file', language: 'yolol' }, { scheme: 'file', language: 'nolol' }],
		synchronize: {
			// Notify the server about file changes to '.yolol files contained in the workspace
			fileEvents: workspace.createFileSystemWatcher('**/.yolol'),
			configurationSection: ['yolol','nolol'],
		}
	};

	// Create the language client and start the client.
github elm-tooling / elm-vscode-language-client-haskell / src / extension.ts View on Github external
function startClient(dir: string) {
    if (clients.has(dir)) {
        // Client was already started for this directory
        return;
    }

    let serverPath = 'elm-language-server';
    let debugArgs = [
            '--server-log-file', 'c:/dev/elm-lsp-log.txt',
            '--session-log-file', 'c:/dev/elm-lsp-log-session.txt'
        ];
    // If the extension is launched in debug mode then the debug server options are used
    // Otherwise the run options are used
    let serverOptions: ServerOptions = {
        run: { command: serverPath, args: debugArgs, transport: TransportKind.stdio },
        debug: { command: serverPath, args: debugArgs, transport: TransportKind.stdio }
    };

    // Options to control the language client
    let clientOptions: LanguageClientOptions = {
        // Register the server for Elm documents in the directory
        documentSelector: [
            {
                scheme: 'file', pattern: join(dir, "**", "*.elm")
            }
        ],
        // Notify the server about file changes to 'elm.json'
        synchronize: {
            fileEvents: workspace.createFileSystemWatcher(join(dir, 'elm.json'))
        }
    };
github slonoed / jsref / vscode-extension / extension.ts View on Github external
export function activate(context: ExtensionContext) {
  let serverModule = path.join(__dirname, './node_modules/@slonoed/jsref/src/bin.js')
  let debugOptions = {execArgv: ['--nolazy', '--inspect=6009']}

  let serverOptions: ServerOptions = {
    run: {module: serverModule, transport: TransportKind.stdio, args: ['--stdio']},
    debug: {
      module: serverModule,
      args: ['--stdio', '--debug'],
      transport: TransportKind.stdio,
      options: debugOptions,
    },
  }

  let clientOptions: LanguageClientOptions = {
    documentSelector: languages.map(language => ({scheme: 'file', language})),
  }

  client = new LanguageClient(
    'slonoed_jsref',
    'JavaScript refactoring language server',
    serverOptions,
    clientOptions
  )

  client.start()
github thiagoabreu / vala-code / src / client.ts View on Github external
};

        let serverOptions: ServerOptions = {
            run: {
                command: serverModule,
                transport: TransportKind.stdio
            },
            debug: {
                command: serverModule,
                options: {
                    env: {
                        G_MESSAGES_DEBUG: 'all',
                        JSONRPC_DEBUG: 1
                    }
                },
                transport: TransportKind.stdio
            }
        };

        this.ls = new LanguageClient('Vala Language Server', serverOptions, clientOptions)

        this.ls.start()
    }
github slonoed / jsref / dev / vscode-client / extension.js View on Github external
module.exports.activate = function activate(context) {
  let serverModule = path.join(__dirname, '../../bin/jsref.js')
  let debugOptions = {execArgv: ['--nolazy', '--inspect=6009']}

  let serverOptions = {
    run: {
      module: serverModule,
      transport: TransportKind.stdio,
      args: ['--stdio', '--debug', '--lspi'],
    },
    debug: {
      module: serverModule,
      args: ['--stdio', '--debug', '--lspi'],
      transport: TransportKind.stdio,
      options: debugOptions,
    },
  }

  let clientOptions = {
    documentSelector: languages.map(language => ({scheme: 'file', language})),
    synchronize: {},
  }

  client = new LanguageClient('jsrefdev', 'jsref dev extension', serverOptions, clientOptions)
github erlang-ls / vscode / client / src / client.ts View on Github external
synchronize: {
            fileEvents: [
                workspace.createFileSystemWatcher('**/rebar.config'),
                workspace.createFileSystemWatcher('**/rebar.lock')
            ]
        }
    };

    let serverPath = context.asAbsolutePath(
        path.join('erlang_ls', '_build', 'default', 'bin', 'erlang_ls')
    );

    let serverOptions: ServerOptions = {
        command: serverPath,
        args: [ "--transport", "stdio" ],
        transport: TransportKind.stdio
    };

    client = new LanguageClient(
        'erlang_ls',
        'Erlang LS',
        serverOptions,
        clientOptions
    );

    client.start();
}