How to use the vscode-jsonrpc.RequestType0 function in vscode-jsonrpc

To help you get started, we’ve selected a few vscode-jsonrpc 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 yitzchak / dicy / packages / server / spec / Server_spec.ts View on Github external
it('calls clearAll when request is sent', async (done) => {
    await client.sendRequest(new rpc.RequestType0('clearAll'))

    expect(cache.clearAll).toHaveBeenCalledWith()

    done()
  })
github Yesterday17 / ZenScript / api / requests / HistoryEntryRequest.ts View on Github external
import { RequestType, RequestType0 } from 'vscode-jsonrpc';

export interface HistoryEntryItem {
  element: string;
  usage: number;
}

export const HistoryEntryGetRequestType: RequestType0<
  HistoryEntryItem[],
  any,
  any
> = new RequestType0('zenscript/getHistoryEntries');

export const HistoryEntryAddRequestType: RequestType<
  string,
  HistoryEntryItem[],
  any,
  any
> = new RequestType('zenscript/addHistoryEntry');
github eclipsesource / graphical-lsp / client / packages / theia-integration / src / common / protocol.ts View on Github external
export interface InitializeParameters {
    options?: any
}

export namespace ActionMessageNotification {
    export const type = new NotificationType('process');
}

export namespace InitializeRequest {
    export const type = new RequestType('initialize');
}

export namespace ShutdownRequest {
    export const type = new RequestType0('shutdown');
}

export namespace ExitNotification {
    export const type = new NotificationType0('exit');
}
github microsoft / vscode-languageserver-node / protocol / src / protocol.workspaceFolders.ts View on Github external
* The associated URI for this workspace folder.
	 */
	uri: string;

	/**
	 * The name of the workspace folder. Used to refer to this
	 * workspace folder in the user interface.
	 */
	name: string;
}

/**
 * The `workspace/workspaceFolders` is sent from the server to the client to fetch the open workspace folders.
 */
export namespace WorkspaceFoldersRequest {
	export const type = new RequestType0('workspace/workspaceFolders');
	export type HandlerSignature = RequestHandler0;
	export type MiddlewareSignature = (token: CancellationToken, next: HandlerSignature) => HandlerResult;
}

/**
 * The `workspace/didChangeWorkspaceFolders` notification is sent from the client to the server when the workspace
 * folder configuration changes.
 */
export namespace DidChangeWorkspaceFoldersNotification {
	export const type = new NotificationType('workspace/didChangeWorkspaceFolders');
	export type HandlerSignature = NotificationHandler;
	export type MiddlewareSignature = (params: DidChangeWorkspaceFoldersParams, next: HandlerSignature) => void;
}

/**
 * The parameters of a `workspace/didChangeWorkspaceFolders` notification.
github microsoft / vscode-languageserver-node / server / src / protocol.ts View on Github external
* is allowed to send requests from the server to the client.
 */
export namespace InitializedNotification {
	export const type = new NotificationType('initialized');
}

//---- Shutdown Method ----

/**
 * A shutdown request is sent from the client to the server.
 * It is sent once when the client descides to shutdown the
 * server. The only notification that is sent after a shudown request
 * is the exit event.
 */
export namespace ShutdownRequest {
	export const type = new RequestType0('shutdown');
}

//---- Exit Notification ----

/**
 * The exit event is sent from the client to the server to
 * ask the server to exit its process.
 */
export namespace ExitNotification {
	export const type = new NotificationType0('exit');
}

//---- Configuration notification ----

/**
 * The configuration change notification is sent from the client to the server
github vmware / vrealize-developer-tools / language-server / src / public / remote / server.ts View on Github external
export const triggerWorkspaceCollection = new RequestType0("vrdev.server.collect.workspace")

export const triggerVroCollection = new RequestType("vrdev.server.collect.vro")

export const giveVroCollectionStatus = new RequestType0("vrdev.server.collect.vro.status")

export const giveAllActions = new RequestType0("vrdev.server.giveAllActions")

export const giveActionModules = new RequestType0("vrdev.server.giveActionModules")

export const giveActionsForModule = new RequestType(
    "vrdev.server.giveActionsForModule"
)

export const giveAllConfigElements = new RequestType0(
    "vrdev.server.giveAllConfigElements"
)

export const giveConfigCategories = new RequestType0(
    "vrdev.server.giveConfigCategories"
)

export const giveConfigsForCategory = new RequestType(
    "vrdev.server.giveConfigsForCategory"
)

export const giveEntitySource = new RequestType("vrdev.server.giveEntitySource")
github Armitxes / VSCode_SQF / node_modules / vscode-languageserver-protocol / lib / protocol.js View on Github external
(function (ShutdownRequest) {
    ShutdownRequest.type = new vscode_jsonrpc_1.RequestType0('shutdown');
})(ShutdownRequest = exports.ShutdownRequest || (exports.ShutdownRequest = {}));
//---- Exit Notification ----
github DonJayamanne / pythonVSCode / src / client / common / process / pythonDaemon.ts View on Github external
public async getInterpreterInformation(): Promise {
        try {
            this.throwIfRPCConnectionIsDead();
            type InterpreterInfoResponse = ErrorResponse & { versionInfo: PythonVersionInfo; sysPrefix: string; sysVersion: string; is64Bit: boolean };
            const request = new RequestType0('get_interpreter_information');
            const response = await this.sendRequestWithoutArgs(request);
            const versionValue = response.versionInfo.length === 4 ? `${response.versionInfo.slice(0, 3).join('.')}-${response.versionInfo[3]}` : response.versionInfo.join('.');
            return {
                architecture: response.is64Bit ? Architecture.x64 : Architecture.x86,
                path: this.pythonPath,
                version: parsePythonVersion(versionValue),
                sysVersion: response.sysVersion,
                sysPrefix: response.sysPrefix
            };
        } catch (ex) {
            traceWarning('Falling back to Python Execution Service due to failure in daemon', ex);
            return this.pythonExecutionService.getInterpreterInformation();
        }
    }
    public async getExecutablePath(): Promise {
github yitzchak / dicy / packages / server / src / Server.ts View on Github external
import {
  BuilderCacheInterface, Command, Message, OptionsSource, Uri
} from '@dicy/core'
import * as rpc from 'vscode-jsonrpc'

export default class Server {
  private cache: BuilderCacheInterface
  private connection: any

  private clearRequest = new rpc.RequestType1('clear')
  private clearAllRequest = new rpc.RequestType0('clearAll')
  private exitNotification = new rpc.NotificationType0('exit')
  private getTargetsRequest = new rpc.RequestType1('getTargets')
  private killRequest = new rpc.RequestType2('kill')
  private killAllRequest = new rpc.RequestType1('killAll')
  private logNotification = new rpc.NotificationType2('log')
  private runRequest = new rpc.RequestType2('run')
  private setDirectoryOptionsRequest = new rpc.RequestType3('setDirectoryOptions')
  private setInstanceOptionsRequest = new rpc.RequestType3('setInstanceOptions')
  private setProjectOptionsRequest = new rpc.RequestType3('setProjectOptions')
  private setUserOptionsRequest = new rpc.RequestType3('setUserOptions')

  constructor (transport: [rpc.MessageReader, rpc.MessageWriter], cache: BuilderCacheInterface) {
    this.cache = cache

    this.connection = rpc.createMessageConnection(transport[0], transport[1])
github yitzchak / dicy / packages / client / src / Client.ts View on Github external
}

export default class Client extends EventEmitter implements BuilderCacheInterface {
  /** @internal */
  private autoStart: boolean
  /** @internal */
  private connection: any
  /** @internal */
  private server: cp.ChildProcess
  /** @internal */
  private cachedBuilders: Map = new Map()

  /** @internal */
  private clearRequest = new rpc.RequestType1('clear')
  /** @internal */
  private clearAllRequest = new rpc.RequestType0('clearAll')
  /** @internal */
  private getTargetsRequest = new rpc.RequestType1('getTargets')
  /** @internal */
  private exitNotification = new rpc.NotificationType0('exit')
  /** @internal */
  private killRequest = new rpc.RequestType2('kill')
  /** @internal */
  private killAllRequest = new rpc.RequestType1('killAll')
  /** @internal */
  private logNotification = new rpc.NotificationType2('log')
  /** @internal */
  private runRequest = new rpc.RequestType2('run')
  /** @internal */
  private setDirectoryOptionsRequest = new rpc.RequestType3('setDirectoryOptions')
  /** @internal */
  private setInstanceOptionsRequest = new rpc.RequestType3('setInstanceOptions')