Sha256: 4ec29bd5a9d76a675e5700c9b7d7da3f84446127953080790ff5e990ffd57cd5

Contents?: true

Size: 1.51 KB

Versions: 1

Compression:

Stored size: 1.51 KB

Contents

'use strict';

import * as path from 'path';

// The module 'vscode' contains the VS Code extensibility API
// Import the module and reference it with the alias vscode in your code below
import * as vscode from 'vscode';
import { LanguageClient, LanguageClientOptions, ServerOptions, TransportKind } from 'vscode-languageclient';
import { worker } from 'cluster';
import { workspace } from 'vscode';

// this method is called when your extension is activated
// your extension is activated the very first time the command is executed
export function activate(context: vscode.ExtensionContext) {
    // Use the console to output diagnostic information (console.log) and errors (console.error)
    // This line of code will only be executed once when your extension is activated
    console.log('Congratulations, your extension "yoda" is now active!');

    let execOptions = {
        command: path.resolve(__dirname, '../../../exe/yoda'),
        args: ['server'],
    }

    let serverOptions : ServerOptions = {
        run: execOptions,
        debug: execOptions,
    }

    let clientOptions : LanguageClientOptions = {
        documentSelector: [{ scheme: 'file', language: 'ruby' }],
        synchronize: {
            configurationSection: 'yoda',
            fileEvents: workspace.createFileSystemWatcher('**/.rb'),
        }
    }

    let disposable = new LanguageClient('yoda', 'Yoda Language Server', serverOptions, clientOptions).start();
}

// this method is called when your extension is deactivated
export function deactivate() {
}

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
yoda-language-server-0.4.0 client/vscode/src/extension.ts