<commit_before>/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/

import { Emitter } from 'vs/base/common/event';
import { IDisposable, toDisposable } from 'vs/base/common/lifecycle';
import { ITerminalCommandSelector, ITerminalQuickFixProvider } from 'vs/platform/terminal/common/terminal';
import { ITerminalQuickFixProviderSelector, ITerminalQuickFixService } from 'vs/workbench/contrib/terminal/common/terminal';

export class TerminalQuickFixService implements ITerminalQuickFixService {
	private readonly _onDidRegisterProvider = new Emitter<ITerminalQuickFixProviderSelector>();
	readonly onDidRegisterProvider = this._onDidRegisterProvider.event;
	private readonly _onDidUnregisterProvider = new Emitter<string>();
	readonly onDidUnregisterProvider = this._onDidUnregisterProvider.event;
	_serviceBrand: undefined;
	_providers: Map<string, ITerminalQuickFixProvider> = new Map();
	_selectors: Map<string, ITerminalCommandSelector> = new Map();
	get providers(): Map<string, ITerminalQuickFixProvider> { return this._providers; }
	get selectors(): Map<string, ITerminalCommandSelector> { return this._selectors; }

	registerCommandSelector(selector: ITerminalCommandSelector): void {
		this.selectors.set(selector.id, selector);
	}

	registerQuickFixProvider(id: string, provider: ITerminalQuickFixProvider): IDisposable {
		this._providers.set(id, provider);
		const selector = this._selectors.get(id);
		if (!selector) {
			throw new Error(`No registered selector for ID: ${id}`);
		}
		this._onDidRegisterProvider.fire({ selector, provider });
		return toDisposable(() => {
			this._onDidUnregisterProvider.fire(selector.id);
			this._providers.delete(id);
		});
	}
}
<commit_msg>remove getter<commit_after>/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/

import { Emitter } from 'vs/base/common/event';
import { IDisposable, toDisposable } from 'vs/base/common/lifecycle';
import { ITerminalCommandSelector, ITerminalQuickFixProvider } from 'vs/platform/terminal/common/terminal';
import { ITerminalQuickFixProviderSelector, ITerminalQuickFixService } from 'vs/workbench/contrib/terminal/common/terminal';

export class TerminalQuickFixService implements ITerminalQuickFixService {
	private readonly _onDidRegisterProvider = new Emitter<ITerminalQuickFixProviderSelector>();
	readonly onDidRegisterProvider = this._onDidRegisterProvider.event;
	private readonly _onDidUnregisterProvider = new Emitter<string>();
	readonly onDidUnregisterProvider = this._onDidUnregisterProvider.event;
	_serviceBrand: undefined;
	_providers: Map<string, ITerminalQuickFixProvider> = new Map();
	_selectors: Map<string, ITerminalCommandSelector> = new Map();
	get providers(): Map<string, ITerminalQuickFixProvider> { return this._providers; }

	registerCommandSelector(selector: ITerminalCommandSelector): void {
		this._selectors.set(selector.id, selector);
	}

	registerQuickFixProvider(id: string, provider: ITerminalQuickFixProvider): IDisposable {
		this._providers.set(id, provider);
		const selector = this._selectors.get(id);
		if (!selector) {
			throw new Error(`No registered selector for ID: ${id}`);
		}
		this._onDidRegisterProvider.fire({ selector, provider });
		return toDisposable(() => {
			this._onDidUnregisterProvider.fire(selector.id);
			this._providers.delete(id);
		});
	}
}

{'fraction_non_alphanumeric': 0.18969495001281722, 'fraction_numerical': 0.0, 'mean_word_length': 3.623222748815166, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 16, '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': '4045365', 'n_tokens_mistral': 1057, 'n_tokens_neox': 998, 'n_words': 231}