<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 * as vscode from 'vscode';
import DocumentTracker from './documentTracker';
import CodeLensProvider from './codelensProvider';
import CommandHandler from './commandHandler';
import ContentProvider from './contentProvider';
import Decorator from './mergeDecorator';
import * as interfaces from './interfaces';

const ConfigurationSectionName = 'git';

export default class ServiceWrapper implements vscode.Disposable {

	private services: vscode.Disposable[] = [];

	constructor(private context: vscode.ExtensionContext) {
	}

	begin() {

		let configuration = this.createExtensionConfiguration();
		const documentTracker = new DocumentTracker();

		this.services.push(
			documentTracker,
			new CommandHandler(this.context, documentTracker),
			new CodeLensProvider(this.context, documentTracker),
			new ContentProvider(this.context),
			new Decorator(this.context, documentTracker),
		);

		this.services.forEach((service: any) => {
			if (service.begin && service.begin instanceof Function) {
				service.begin(configuration);
			}
		});

		vscode.workspace.onDidChangeConfiguration(() => {
			this.services.forEach((service: any) => {
				if (service.configurationUpdated && service.configurationUpdated instanceof Function) {
					service.configurationUpdated(this.createExtensionConfiguration());
				}
			});
		});
	}

	createExtensionConfiguration(): interfaces.IExtensionConfiguration {
		const workspaceConfiguration = vscode.workspace.getConfiguration(ConfigurationSectionName);
		const isEnabled: boolean = workspaceConfiguration.get('enableEditorMerge', true);

		return {
			enableCodeLens: isEnabled,
			enableDecorations: isEnabled,
			enableEditorOverview: isEnabled
		};
	}

	dispose() {
		this.services.forEach(disposable => disposable.dispose());
		this.services = [];
	}
}
<commit_msg>Update setting section name<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 * as vscode from 'vscode';
import DocumentTracker from './documentTracker';
import CodeLensProvider from './codelensProvider';
import CommandHandler from './commandHandler';
import ContentProvider from './contentProvider';
import Decorator from './mergeDecorator';
import * as interfaces from './interfaces';

const ConfigurationSectionName = 'merge-conflict';
const FeatureEnabledProperty = 'enableEditorMerge';
const AlwaysEnableDecorations = true; // If true, merge-conflict.enableEditorMerge is ignored

export default class ServiceWrapper implements vscode.Disposable {

	private services: vscode.Disposable[] = [];

	constructor(private context: vscode.ExtensionContext) {
	}

	begin() {

		let configuration = this.createExtensionConfiguration();
		const documentTracker = new DocumentTracker();

		this.services.push(
			documentTracker,
			new CommandHandler(this.context, documentTracker),
			new CodeLensProvider(this.context, documentTracker),
			new ContentProvider(this.context),
			new Decorator(this.context, documentTracker),
		);

		this.services.forEach((service: any) => {
			if (service.begin && service.begin instanceof Function) {
				service.begin(configuration);
			}
		});

		vscode.workspace.onDidChangeConfiguration(() => {
			this.services.forEach((service: any) => {
				if (service.configurationUpdated && service.configurationUpdated instanceof Function) {
					service.configurationUpdated(this.createExtensionConfiguration());
				}
			});
		});
	}

	createExtensionConfiguration(): interfaces.IExtensionConfiguration {
		const workspaceConfiguration = vscode.workspace.getConfiguration(ConfigurationSectionName);
		const isEnabled: boolean = workspaceConfiguration.get(FeatureEnabledProperty, true);

		return {
			enableCodeLens: isEnabled,
			enableDecorations: AlwaysEnableDecorations || isEnabled,
			enableEditorOverview: isEnabled
		};
	}

	dispose() {
		this.services.forEach(disposable => disposable.dispose());
		this.services = [];
	}
}

{'fraction_non_alphanumeric': 0.18058294981371906, 'fraction_numerical': 0.0, 'mean_word_length': 3.359121298949379, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '6332803', 'n_tokens_mistral': 1212, 'n_tokens_neox': 1077, 'n_words': 267}