Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// Push the disposable to the context's subscriptions so that the
// client can be deactivated on extension deactivation
context.subscriptions.push(
client.start(),
commands.registerCommand('graphqlForVSCode.showOutputChannel', () => {
client.outputChannel.show(true);
}),
statusBarItem,
);
client.onReady().then(() => {
initializeStatusBar(context, client);
});
}
const serverInitialized = new NotificationType(
commonNotifications.serverInitialized,
);
const serverExited = new NotificationType(commonNotifications.serverExited);
function initializeStatusBar(context, client) {
extensionStatus = Status.init;
client.onNotification(serverInitialized, params => {
extensionStatus = Status.ok;
serverRunning = true;
updateStatusBar(window.activeTextEditor);
});
client.onNotification(serverExited, params => {
extensionStatus = Status.error;
serverRunning = false;
updateStatusBar(window.activeTextEditor);
});
ownerUri: string;
}
// ------------------------------- < Query Batch Start Notification > ------------------------------------
export namespace QueryExecuteBatchStartNotification {
export const type = new NotificationType('query/batchStart');
}
// ------------------------------- < Query Batch Complete Notification > ------------------------------------
export namespace QueryExecuteBatchCompleteNotification {
export const type = new NotificationType('query/batchComplete');
}
// Query ResultSet Complete Notification -----------------------------------------------------------
export namespace QueryExecuteResultSetCompleteNotification {
export const type = new NotificationType('query/resultSetComplete');
}
export class QueryExecuteResultSetCompleteNotificationParams {
resultSetSummary: ResultSetSummary;
ownerUri: string;
}
// ------------------------------- < Query Message Notification > ------------------------------------
export namespace QueryExecuteMessageNotification {
export const type = new NotificationType('query/message');
}
export class QueryExecuteMessageParams {
message: IResultMessage;
ownerUri: string;
}
export const type = new NotificationType('query/batchComplete');
}
// Query ResultSet Complete Notification -----------------------------------------------------------
export namespace QueryExecuteResultSetCompleteNotification {
export const type = new NotificationType('query/resultSetComplete');
}
export class QueryExecuteResultSetCompleteNotificationParams {
resultSetSummary: ResultSetSummary;
ownerUri: string;
}
// ------------------------------- < Query Message Notification > ------------------------------------
export namespace QueryExecuteMessageNotification {
export const type = new NotificationType('query/message');
}
export class QueryExecuteMessageParams {
message: IResultMessage;
ownerUri: string;
}
// ------------------------------- < Query Execution Request > ------------------------------------
export namespace QueryExecuteRequest {
export const type = new RequestType('query/executeDocumentSelection');
}
export namespace QueryExecuteStatementRequest {
export const type = new RequestType('query/executedocumentstatement');
}
uri: string;
state: CheckStatus;
}
export namespace CheckStatusNotification {
export const notificationType: NotificationType = new NotificationType('checkstyle/status');
}
export enum ServerStatus {
downloading,
running,
stopped
}
export namespace ServerStatusNotification {
export const notificationType: NotificationType = new NotificationType('checkstyle/serverstatus');
}
export interface IServerStatusParams {
readonly status: ServerStatus;
}
export interface IVersionCheckParams {
readonly uri: string;
readonly result: VersionCheckResult;
}
export enum VersionCheckResult {
found,
invalid,
exception
}
readonly status: ServerStatus;
}
export interface IVersionCheckParams {
readonly uri: string;
readonly result: VersionCheckResult;
}
export enum VersionCheckResult {
found,
invalid,
exception
}
export namespace VersionCheckNotification {
export const notificationType: NotificationType = new NotificationType('checkstyle/versioncheck');
}
export namespace DownloadStartNotification {
export const notificationType: NotificationType = new NotificationType('checkstyle/downloadstart');
}
export enum DownloadStatus {
downloading,
finished,
error
}
export namespace DownloadStatusNotification {
export const notificationType: NotificationType = new NotificationType('checkstyle/downloadstatus');
}
client.onReady().then(() => {
client.onNotification(new NotificationType('java/colors'), cacheSemanticColors);
context.subscriptions.push(window.onDidChangeVisibleTextEditors(applySemanticColors));
workspace.onDidCloseTextDocument(forgetSemanticColors);
});
complete: boolean;
}
export interface ActionableMessage {
severity: MessageType;
message: string;
data?: any;
commands?: Command[];
}
export namespace StatusNotification {
export const type = new NotificationType('language/status');
}
export namespace ProgressReportNotification {
export const type = new NotificationType('language/progressReport');
}
export namespace ClassFileContentsRequest {
export const type = new RequestType ('java/classFileContents');
}
export namespace ProjectConfigurationUpdateRequest {
export const type = new NotificationType ('java/projectConfigurationUpdate');
}
export namespace ActionableNotification {
export const type = new NotificationType('language/actionableNotification');
}
export namespace CompileWorkspaceRequest {
export const type = new RequestType('java/buildWorkspace');
import { ExtensionContext, window, commands, workspace, Disposable, languages, IndentAction, env, Uri, ConfigurationTarget, InputBoxOptions } from 'vscode';
import {
LanguageClient, LanguageClientOptions, ServerOptions,
TransportKind,
NotificationType,
RequestType,
RevealOutputChannelOn
} from 'vscode-languageclient';
import { createMiddleware, IntelephenseMiddleware } from './middleware';
import * as fs from 'fs-extra';
const PHP_LANGUAGE_ID = 'php';
const VERSION = '1.3.6';
const INDEXING_STARTED_NOTIFICATION = new NotificationType('indexingStarted');
const INDEXING_ENDED_NOTIFICATION = new NotificationType('indexingEnded');
const CANCEL_INDEXING_REQUEST = new RequestType('cancelIndexing');
const INDEX_WORKSPACE_CMD_NAME = 'intelephense.index.workspace';
const CANCEL_INDEXING_CMD_NAME = 'intelephense.cancel.indexing';
const ENTER_KEY_CMD_NAME = 'intelephense.enter.key';
const LICENCE_MEMENTO_KEY = 'intelephense.licence.key';
let languageClient: LanguageClient;
let extensionContext: ExtensionContext;
let middleware:IntelephenseMiddleware;
let clientDisposable:Disposable;
export async function activate(context: ExtensionContext) {
await moveKeyToGlobalMemento(context);
languages.setLanguageConfiguration('php', {
import * as semver from 'semver';
import { ExtensionContext, window, commands, workspace, Disposable, languages, IndentAction, env, Uri, ConfigurationTarget, InputBoxOptions } from 'vscode';
import {
LanguageClient, LanguageClientOptions, ServerOptions,
TransportKind,
NotificationType,
RequestType,
RevealOutputChannelOn
} from 'vscode-languageclient';
import { createMiddleware, IntelephenseMiddleware } from './middleware';
import * as fs from 'fs-extra';
const PHP_LANGUAGE_ID = 'php';
const VERSION = '1.3.6';
const INDEXING_STARTED_NOTIFICATION = new NotificationType('indexingStarted');
const INDEXING_ENDED_NOTIFICATION = new NotificationType('indexingEnded');
const CANCEL_INDEXING_REQUEST = new RequestType('cancelIndexing');
const INDEX_WORKSPACE_CMD_NAME = 'intelephense.index.workspace';
const CANCEL_INDEXING_CMD_NAME = 'intelephense.cancel.indexing';
const ENTER_KEY_CMD_NAME = 'intelephense.enter.key';
const LICENCE_MEMENTO_KEY = 'intelephense.licence.key';
let languageClient: LanguageClient;
let extensionContext: ExtensionContext;
let middleware:IntelephenseMiddleware;
let clientDisposable:Disposable;
export async function activate(context: ExtensionContext) {
await moveKeyToGlobalMemento(context);
startChar: number,
endLine: number,
endChar: number,
message: string,
severity: number
}
export interface StatusParams {
state: Status,
message: string,
uri: string,
suggestions: Suggestion[]
}
export namespace StatusNotification {
export const type = new NotificationType('deepscan/status');
}