<commit_before>/*---------------------------------------------------------
 * Copyright (C) Microsoft Corporation. All rights reserved.
 *--------------------------------------------------------*/
'use strict';

import { Response, RequestType, EventType } from './messages';

/**
 * The shutdown command is send from the client to the worker.
 * It is send once when the client descides to shutdown the 
 * worker. The only event that is send after a shudown request
 * is the exit event.
 */
export namespace ShutdownRequest {
	export let type: RequestType<ShutdownArguments, ShutdownResponse> = { command: 'shutdown' };
}

export interface ShutdownArguments {
}

export interface ShutdownResponse extends Response {
}

/**
 * The exit event is send from the client to the worker to 
 * ask the worker to exit its process.
 */
export namespace ExitEvent {
	export let type: EventType<ExitArguments> = { event: 'exit' }; 
}
export interface ExitArguments {
}

/**
 * The initialize command is send from the client to the worker.
 * It is send once as the first command after starting up the
 * worker.
 */
export interface Capabilities {
	validation?: boolean;
}

export namespace InitializeRequest {
	export let type: RequestType<InitializeArguments, InitializeResponse> = { command: 'initialize' };
}
export interface InitializeArguments {
	rootFolder: string;
	capabilities: Capabilities;
}

export interface InitializeResponse extends Response {
	body: { capabilities: Capabilities; }
}

/**
 * The configuration change event is send from the client to the worker
 * when the client's configuration has changed. The event contains
 * the changed configuration as defined by the language worker statically
 * in it's extension manifest.
 */
export namespace ConfigurationChangeEvent {
	export let type: EventType<ConfigurationChangeArguments> = { event: 'configurationChange' };
} 
export interface ConfigurationChangeArguments {
	settings: any;
}

export interface DocumentIdentifier {
	/**
	 * A URI identifying the resource in the client. 
	 */
	uri: string;
}

/**
 * The document event is send from the client to the worker to signal
 * newly opened, changed and closed documents. 
 */
export namespace DocumentOpenEvent {
	export let type: EventType<DocumentOpenArguments> = { event: 'document/open' };
}
export interface DocumentOpenArguments extends DocumentIdentifier {
	/**
	 * The content of the opened document.
	 */
	content: string;
}

export namespace DocumentChangeEvent {
	export let type: EventType<DocumentChangeArguments> = { event: 'document/change' };
}
export interface DocumentChangeArguments extends DocumentIdentifier {
	/**
	 * The new content of the document.
	 */
	content: string;
}

export namespace DocumentCloseEvent {
	export let type: EventType<DocumentCloseArguments> = { event: 'document/close' };
}
export interface DocumentCloseArguments extends DocumentIdentifier {
}


/**
 */
export namespace FileEvent {
	export let type: EventType<FileEventArguments> = { event: 'file/event' };
}
export interface FileEventArguments {
	filesAdded: string[];
	filesRemoved: string[];
	filesChanged: string[];
}

/**
 * Diagnostics events are send from the worker to clients to signal
 * results of validation runs
 */
export namespace DiagnosticEvent {
	export let type: EventType<DiagnosticEventArguments> = { event: 'document/diagnostics' };
}
export interface DiagnosticEventArguments {
	/**
	 * The URI for which diagnostic information is reported.
	 */
	uri: string;

	/**
	 * An array of diagnostic information items.
	 */
	diagnostics: Diagnostic[];	
}

/**
 * Location in document expressed as (one-based) line and character offset.<commit_msg>Add support to show a message<commit_after>/*---------------------------------------------------------
 * Copyright (C) Microsoft Corporation. All rights reserved.
 *--------------------------------------------------------*/
'use strict';

import { Response, RequestType, EventType } from './messages';

/**
 * The shutdown command is send from the client to the worker.
 * It is send once when the client descides to shutdown the 
 * worker. The only event that is send after a shudown request
 * is the exit event.
 */
export namespace ShutdownRequest {
	export let type: RequestType<ShutdownArguments, ShutdownResponse> = { command: 'shutdown' };
}

export interface ShutdownArguments {
}

export interface ShutdownResponse extends Response {
}

/**
 * The exit event is send from the client to the worker to 
 * ask the worker to exit its process.
 */
export namespace ExitEvent {
	export let type: EventType<ExitArguments> = { event: 'exit' }; 
}
export interface ExitArguments {
}

/**
 * The initialize command is send from the client to the worker.
 * It is send once as the first command after starting up the
 * worker.
 */
export interface Capabilities {
	validation?: boolean;
}

export namespace InitializeRequest {
	export let type: RequestType<InitializeArguments, InitializeResponse> = { command: 'initialize' };
}
export interface InitializeArguments {
	rootFolder: string;
	capabilities: Capabilities;
}

export interface InitializeResponse extends Response {
	body: { capabilities: Capabilities; }
}

/**
 * The configuration change event is send from the client to the worker
 * when the client's configuration has changed. The event contains
 * the changed configuration as defined by the language worker statically
 * in it's extension manifest.
 */
export namespace ConfigurationChangeEvent {
	export let type: EventType<ConfigurationChangeArguments> = { event: 'workspace/configurationChange' };
} 
export interface ConfigurationChangeArguments {
	settings: any;
}

/**
 * The show message event is send from a worker to a client to ask
 * the client to display a particular message in the user interface
 */
export namespace ShowMessageEvent {
	export let type: EventType<ShowMessageArguments> = { event: 'shell/showMessage' };
}
export interface ShowMessageArguments {
	message: string;
}

export interface DocumentIdentifier {
	/**
	 * A URI identifying the resource in the client. 
	 */
	uri: string;
}

/**
 * The document event is send from the client to the worker to signal
 * newly opened, changed and closed documents. 
 */
export namespace DocumentOpenEvent {
	export let type: EventType<DocumentOpenArguments> = { event: 'document/open' };
}
export interface DocumentOpenArguments extends DocumentIdentifier {
	/**
	 * The content of the opened document.
	 */
	content: string;
}

export namespace DocumentChangeEvent {
	export let type: EventType<DocumentChangeArguments> = { event: 'document/change' };
}
export interface DocumentChangeArguments extends DocumentIdentifier {
	/**
	 * The new content of the document.
	 */
	content: string;
}

export namespace DocumentCloseEvent {
	export let type: EventType<DocumentCloseArguments> = { event: 'document/close' };
}
export interface DocumentCloseArguments extends DocumentIdentifier {
}


/**
 */
export namespace FileEvent {
	export let type: EventType<FileEventArguments> = { event: 'file/event' };
}
export interface FileEventArguments {
	filesAdded: string[];
	filesRemoved: string[];
	filesChanged: string[];
}

/**
 * Diagnostics events are send from the worker to clients to signal
 * results of validation runs
 */
export namespace DiagnosticEvent {
	export let type: EventType<DiagnosticEventArguments> = { event: 'document/diagnostics' };
}
export interface DiagnosticEventArguments {
	/**
	 * The URI for which diagnostic information is reported.
	 */
	uri: string;

	/**
	 * An array of diagnostic information items.
	 */
	diagnostics: Diagnostic[];	
}
export interface DiagnosticEvent {
	body: DiagnosticEventArguments;
}

/**
 * Location in document expressed as (one-based) line and character offset.
{'fraction_non_alphanumeric': 0.11266700924974306, 'fraction_numerical': 0.0, 'mean_word_length': 3.908575031525851, 'pattern_counts': {'":': 0, '<': 22, '<?xml version=': 0, '>': 22, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1949245', 'n_tokens_mistral': 1934, 'n_tokens_neox': 1889, 'n_words': 784}