How to use the vscode-languageserver-protocol.NotificationType function in vscode-languageserver-protocol

To help you get started, we’ve selected a few vscode-languageserver-protocol 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 ckipp01 / coc-metals / src / protocol.ts View on Github external
import {
  ExecuteCommandParams,
  NotificationType,
  RequestType
} from "vscode-languageserver-protocol";

export namespace ExecuteClientCommand {
  export const type = new NotificationType(
    "metals/executeClientCommand"
  );
}

// TODO not implimented
export namespace MetalsStatus {
  export const type = new NotificationType(
    "metals/status"
  );
}

// TODO not implimented
export namespace MetalsSlowTask {
  export const type = new RequestType<
    MetalsSlowTaskParams,
    MetalsSlowTaskResult,
    void,
    void
  >("metals/slowTask");
}

export interface MetalsSlowTaskParams {
  message: string;
github ckipp01 / coc-metals / src / protocol.ts View on Github external
import {
  ExecuteCommandParams,
  NotificationType,
  RequestType
} from "vscode-languageserver-protocol";

export namespace ExecuteClientCommand {
  export const type = new NotificationType(
    "metals/executeClientCommand"
  );
}

// TODO not implimented
export namespace MetalsStatus {
  export const type = new NotificationType(
    "metals/status"
  );
}

// TODO not implimented
export namespace MetalsSlowTask {
  export const type = new RequestType<
    MetalsSlowTaskParams,
    MetalsSlowTaskResult,
github neoclide / coc.nvim / src / extensions / eslint / index.ts View on Github external
interface NoESLintLibraryParams {
  source: TextDocumentIdentifier
}

interface NoESLintLibraryResult { }

namespace NoESLintLibraryRequest {
  export const type = new RequestType<
    NoESLintLibraryParams,
    NoESLintLibraryResult,
    void,
    void
    >('eslint/noLibrary')
}

const exitCalled = new NotificationType<[number, string], void>('eslint/exitCalled')

async function createDefaultConfiguration(): Promise {
  let { root } = workspace
  let configFiles = [
    '.eslintrc.js',
    '.eslintrc.yaml',
    '.eslintrc.yml',
    '.eslintrc',
    '.eslintrc.json'
  ]
  for (let configFile of configFiles) {
    if (fs.existsSync(path.join(root, configFile))) {
      workspace.openResource(Uri.file(root).toString()).catch(_e => {
        // noop
      })
      return
github marlonfan / coc-phpls / src / index.ts View on Github external
NotificationType,
    RequestType,
    Disposable,
    Definition
} from "vscode-languageserver-protocol";

import { CancellationToken } from "vscode-jsonrpc";
import { ProvideImplementationSignature } from 'coc.nvim/lib/language-client/implementation';
import { Location } from 'vscode-languageserver-types';
import { isArray } from 'util';

const LanguageID = 'php';

const VERSION = '1.2.3';
const INDEXING_STARTED_NOTIFICATION = new NotificationType('indexingStarted');
const INDEXING_ENDED_NOTIFICATION = new NotificationType('indexingEnded');
const INDEX_WORKSPACE_REQUEST = new RequestType('indexWorkspace');
const CANCEL_INDEXING_REQUEST = new RequestType('cancelIndexing');

let languageClient: LanguageClient;
let extensionContext: ExtensionContext;
let clientDisposable:Disposable;
let file: string;
let licenceKey: string;

export async function activate(context: ExtensionContext): Promise {
    extensionContext = context;

    let c = workspace.getConfiguration();
    const config = c.get("phpls") as any;
    const intelephenseConfig = c.get("intelephense") as any;
    const enable = config.enable;
github marlonfan / coc-phpls / src / index.ts View on Github external
CompletionList,
    NotificationType,
    RequestType,
    Disposable,
    Definition
} from "vscode-languageserver-protocol";

import { CancellationToken } from "vscode-jsonrpc";
import { ProvideImplementationSignature } from 'coc.nvim/lib/language-client/implementation';
import { Location } from 'vscode-languageserver-types';
import { isArray } from 'util';

const LanguageID = 'php';

const VERSION = '1.2.3';
const INDEXING_STARTED_NOTIFICATION = new NotificationType('indexingStarted');
const INDEXING_ENDED_NOTIFICATION = new NotificationType('indexingEnded');
const INDEX_WORKSPACE_REQUEST = new RequestType('indexWorkspace');
const CANCEL_INDEXING_REQUEST = new RequestType('cancelIndexing');

let languageClient: LanguageClient;
let extensionContext: ExtensionContext;
let clientDisposable:Disposable;
let file: string;
let licenceKey: string;

export async function activate(context: ExtensionContext): Promise {
    extensionContext = context;

    let c = workspace.getConfiguration();
    const config = c.get("phpls") as any;
    const intelephenseConfig = c.get("intelephense") as any;
github neoclide / coc-rls / src / index.ts View on Github external
public async progressCounter() {
    if (!this.lc) {
      return
    }

    const runningProgress: Set = new Set()
    const asPercent = (fraction: number): string => `${Math.round(fraction * 100)}%`
    await this.lc.onReady()
    stopSpinner('RLS')

    this.lc.onNotification(new NotificationType('window/progress'), (progress: any) => {
      if (progress.done) {
        runningProgress.delete(progress.id)
      } else {
        runningProgress.add(progress.id)
      }
      if (runningProgress.size) {
        let status = ''
        if (typeof progress.percentage === 'number') {
          status = asPercent(progress.percentage)
        } else if (progress.message) {
          status = progress.message
        } else if (progress.title) {
          status = `[${progress.title.toLowerCase()}]`
        }
        startSpinner('RLS', status)
      } else {
github neoclide / coc-yaml / src / index.ts View on Github external
import { Uri, ExtensionContext, extensions, LanguageClient, LanguageClientOptions, ServerOptions, services, TransportKind, workspace } from 'coc.nvim'
import fs from 'fs'
import path from 'path'
import { NotificationType } from 'vscode-languageserver-protocol'
import { CUSTOM_CONTENT_REQUEST, CUSTOM_SCHEMA_REQUEST, schemaContributor } from './schema-contributor'

export interface ISchemaAssociations {
  [pattern: string]: string[]
}

namespace SchemaAssociationNotification {
  export const type: NotificationType = new NotificationType('json/schemaAssociations')
}

namespace DynamicCustomSchemaRequestRegistration {
  export const type: NotificationType<{}, {}> = new NotificationType('yaml/registerCustomSchemaRequest')
}

export async function activate(context: ExtensionContext): Promise {
  let { subscriptions } = context
  const config = workspace.getConfiguration('yaml')
  let file = context.asAbsolutePath(path.join('node_modules', 'yaml-language-server', 'out', 'server', 'src', 'server.js'))
  if (!fs.existsSync(file)) {
    file = context.asAbsolutePath(path.join('..', 'yaml-language-server', 'out', 'server', 'src', 'server.js'))
  }
  if (!fs.existsSync(file)) {
    workspace.showMessage(`Can't resolve yaml-language-server`, 'error')
    return
  }

  let serverOptions: ServerOptions = {
    module: file,
github neoclide / coc-yaml / src / index.ts View on Github external
import { Uri, ExtensionContext, extensions, LanguageClient, LanguageClientOptions, ServerOptions, services, TransportKind, workspace } from 'coc.nvim'
import fs from 'fs'
import path from 'path'
import { NotificationType } from 'vscode-languageserver-protocol'
import { CUSTOM_CONTENT_REQUEST, CUSTOM_SCHEMA_REQUEST, schemaContributor } from './schema-contributor'

export interface ISchemaAssociations {
  [pattern: string]: string[]
}

namespace SchemaAssociationNotification {
  export const type: NotificationType = new NotificationType('json/schemaAssociations')
}

namespace DynamicCustomSchemaRequestRegistration {
  export const type: NotificationType<{}, {}> = new NotificationType('yaml/registerCustomSchemaRequest')
}

export async function activate(context: ExtensionContext): Promise {
  let { subscriptions } = context
  const config = workspace.getConfiguration('yaml')
  let file = context.asAbsolutePath(path.join('node_modules', 'yaml-language-server', 'out', 'server', 'src', 'server.js'))
  if (!fs.existsSync(file)) {
    file = context.asAbsolutePath(path.join('..', 'yaml-language-server', 'out', 'server', 'src', 'server.js'))
  }
  if (!fs.existsSync(file)) {
    workspace.showMessage(`Can't resolve yaml-language-server`, 'error')
    return