How to use the vscode-languageclient.RequestType0 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 PowerShell / vscode-powershell / src / session.ts View on Github external
.then((selectedItem) => { selectedItem.callback(); });
    }
}

class SessionMenuItem implements vscode.QuickPickItem {
    public description: string;

    constructor(
        public readonly label: string,
        // tslint:disable-next-line:no-empty
        public readonly callback: () => void = () => {}) {
    }
}

export const PowerShellVersionRequestType =
    new RequestType0(
        "powerShell/getVersion");

export const RunspaceChangedEventType =
    new NotificationType(
        "powerShell/runspaceChanged");

export enum RunspaceType {
    Local,
    Process,
    Remote,
}

export interface IPowerShellVersionDetails {
    version: string;
    displayVersion: string;
    edition: string;
github ghdl / ghdl-language-server / vscode-client / extension.ts View on Github external
* Copyright (c) Microsoft Corporation. All rights reserved.
 * Licensed under the MIT License. See License.txt in the project root for license information.
 * ------------------------------------------------------------------------------------------ */

import * as vscode from 'vscode';

import {
	LanguageClient,
	LanguageClientOptions,
	ServerOptions
} from 'vscode-languageclient';
import * as vscodelc from 'vscode-languageclient';

namespace ExtraRequest {
	export const ShowAllFiles =
		new vscodelc.RequestType0('workspace/xShowAllFiles')
	export const GetAllEntities =
		new vscodelc.RequestType0<{name: string, library: string}[], void, void>('workspace/xGetAllEntities')
	export const GetEntityInterface =
		new vscodelc.RequestType<{name: string, library: string}, any, void, void>('workspace/xGetEntityInterface')
}

let client: LanguageClient;

class EntityItem implements vscode.QuickPickItem {
	label: string
	description: string
	library: string

	constructor(name : string, library: string) {
		this.label = name
		this.description = library + '.' + name
github lingua-pupuli / puppet-vscode / src / messages.ts View on Github external
import { RequestType0, RequestType } from 'vscode-languageclient';

export namespace PuppetVersionRequest {
  export const type = new RequestType0('puppet/getVersion');
}

export interface PuppetVersionDetails {
  puppetVersion: string;
  facterVersion: string;
  languageServerVersion: string;
  factsLoaded: boolean;
  functionsLoaded: boolean;
  typesLoaded: boolean;
  classesLoaded: boolean;
}

export interface PuppetResourceRequestParams {
  typename: string;
  title: string;
}
github PowerShell / vscode-powershell / src / features / GetCommands.ts View on Github external
import { IFeature } from "../feature";
import { Logger } from "../logging";

interface ICommand {
    name: string;
    moduleName: string;
    defaultParameterSet: string;
    parameterSets: object;
    parameters: object;
}

/**
 * RequestType sent over to PSES.
 * Expects: ICommand to be returned
 */
export const GetCommandRequestType = new RequestType0("powerShell/getCommand");

/**
 * A PowerShell Command listing feature. Implements a treeview control.
 */
export class GetCommandsFeature implements IFeature {
    private command: vscode.Disposable;
    private languageClient: LanguageClient;
    private commandsExplorerProvider: CommandsExplorerProvider;
    private commandsExplorerTreeView: vscode.TreeView;

    constructor(private log: Logger) {
        this.command = vscode.commands.registerCommand("PowerShell.RefreshCommandsExplorer",
            () => this.CommandExplorerRefresh());
        this.commandsExplorerProvider = new CommandsExplorerProvider();

        this.commandsExplorerTreeView = vscode.window.createTreeView("PowerShellCommands",
github ghdl / ghdl-language-server / vscode-client / extension.ts View on Github external
* ------------------------------------------------------------------------------------------ */

import * as vscode from 'vscode';

import {
	LanguageClient,
	LanguageClientOptions,
	ServerOptions
} from 'vscode-languageclient';
import * as vscodelc from 'vscode-languageclient';

namespace ExtraRequest {
	export const ShowAllFiles =
		new vscodelc.RequestType0('workspace/xShowAllFiles')
	export const GetAllEntities =
		new vscodelc.RequestType0<{name: string, library: string}[], void, void>('workspace/xGetAllEntities')
	export const GetEntityInterface =
		new vscodelc.RequestType<{name: string, library: string}, any, void, void>('workspace/xGetEntityInterface')
}

let client: LanguageClient;

class EntityItem implements vscode.QuickPickItem {
	label: string
	description: string
	library: string

	constructor(name : string, library: string) {
		this.label = name
		this.description = library + '.' + name
		this.library = library
	}