How to use the vscode-jsonrpc.RequestType1 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 getTargets when request is sent', async (done) => {
    expect(await client.sendRequest(new rpc.RequestType1('getTargets'), file))
      .toEqual(['file://foo/bar.pdf'])

    expect(cache.getTargets).toHaveBeenCalledWith(file)

    done()
  })
github yitzchak / dicy / packages / server / spec / Server_spec.ts View on Github external
it('calls clear when request is sent', async (done) => {
    await client.sendRequest(new rpc.RequestType1('clear'), file)

    expect(cache.clear).toHaveBeenCalledWith(file)

    done()
  })
github theia-ide / sprotty / client / src / jsonrpc / protocol.ts View on Github external
request(action: Action, token?: CancellationToken): Thenable {
        token = token || CancellationToken.None;
        const requestType = new RequestType1(action.kind)
        return this.connection.sendRequest(requestType, action, token);
    }
github redhat-developer / vscode-rsp-ui / src / protocol.ts View on Github external
}

export namespace ServerAddedNotification {
    export const type = new NotificationType('client/serverAdded');
}

export namespace ServerRemovedNotification {
    export const type = new NotificationType('client/serverRemoved');
}

export namespace GetDiscoveryPathsRequest {
    export const type = new RequestType0, void, void>('server/getDiscoveryPaths');
}

export namespace FindServerBeansRequest {
    export const type = new RequestType1, void, void>('server/findServerBeans');
}

export namespace CreateServerRequest {
    export const type = new RequestType1('server/createServer');
}

export namespace GetRequiredAttributesRequest {
    export const type = new RequestType1('server/getRequiredAttributes');
}

export namespace GetOptionalAttributesRequest {
    export const type = new RequestType1('server/getOptionalAttributes');
}

export namespace GetServerHandlersRequest {
    export const type = new RequestType0, void, void>('server/getServerHandles');
github yitzchak / dicy / packages / client / src / Client.ts View on Github external
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')
  /** @internal */
  private setProjectOptionsRequest = new rpc.RequestType3('setProjectOptions')
  /** @internal */
  private setUserOptionsRequest = new rpc.RequestType3('setUserOptions')

  constructor (autoStart: boolean = false) {
    super()
    this.autoStart = autoStart
github redhat-developer / vscode-rsp-ui / src / protocol.ts View on Github external
}

export namespace GetServerHandlersRequest {
    export const type = new RequestType0, void, void>('server/getServerHandles');
}

export namespace DeleteServerNotification {
    export const type = new NotificationType('server/deleteServer');
}

export namespace StartServerAsyncRequest {
    export const type = new RequestType1('server/startServerAsync');
}

export namespace StopServerAsyncRequest {
    export const type = new RequestType1('server/stopServerAsync');
}

export namespace ServerStateChangeNotification {
    export const type = new NotificationType('client/serverStateChanged');
}

export namespace ServerProcessOutputAppendedNotification {
    export const type = new NotificationType('client/serverProcessOutputAppended');
}
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')
  /** @internal */
  private setProjectOptionsRequest = new rpc.RequestType3('setProjectOptions')
github yitzchak / dicy / packages / client / src / Client.ts View on Github external
return this.cache.setProjectOptions(this.file, options, merge)
  }
}

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')
github redhat-developer / vscode-rsp-ui / src / protocol.ts View on Github external
}

export namespace ServerRemovedNotification {
    export const type = new NotificationType('client/serverRemoved');
}

export namespace GetDiscoveryPathsRequest {
    export const type = new RequestType0, void, void>('server/getDiscoveryPaths');
}

export namespace FindServerBeansRequest {
    export const type = new RequestType1, void, void>('server/findServerBeans');
}

export namespace CreateServerRequest {
    export const type = new RequestType1('server/createServer');
}

export namespace GetRequiredAttributesRequest {
    export const type = new RequestType1('server/getRequiredAttributes');
}

export namespace GetOptionalAttributesRequest {
    export const type = new RequestType1('server/getOptionalAttributes');
}

export namespace GetServerHandlersRequest {
    export const type = new RequestType0, void, void>('server/getServerHandles');
}

export namespace DeleteServerNotification {
    export const type = new NotificationType('server/deleteServer');