<commit_before>
// import * as server from 'vscode-languageserver';


export interface TsLintAutoFix {
	tsLintCode: string;
	tsLintMessage: string;
	autoFixMessage: string;
	// runCodeAction(document: server.TextDocument, diagnostic: server.Diagnostic): any;
	// fix(codeBefore: string, diagnostic: server.Diagnostic): any;
	fix(codeBefore: string): string;
}
export let tsLintAutoFixes: TsLintAutoFix[] = [];

let autoFix: TsLintAutoFix;
autoFix = {
	tsLintCode: "one-line",
	tsLintMessage: "missing whitespace",
	autoFixMessage: "Add a whitespace",
	// runCodeAction: function (document: server.TextDocument, diagnostic: server.Diagnostic): any {
	// fix: function (codeBefore: string, diagnostic: server.Diagnostic): any {
	fix: function (codeBefore: string): string {
		console.log("tsLint helper missing whitespace");
		// server.TextDocuments .create()
		// let codeBefore = document.getText(diagnostic.range);
		let codeAfter = " " + codeBefore;
		// let edit = new server.WorkspaceEdit() WorkspaceEdit();
		// edit.replace(document.uri, diagnostic.range, codeAfter);
		console.log("Before:>", codeBefore, "< after:>", codeAfter, "<");
		// return server.workspace.applyEdit(edit);
		return codeAfter;
	}
};
this.tsLintAutoFixes.push(autoFix);

autoFix = {
	tsLintCode: "one-line",
	tsLintMessage: "missing semicolon",
	autoFixMessage: "Add semicolon",
	// runCodeAction: function (document: server.TextDocument, diagnostic: server.Diagnostic): any {
	// fix: function (codeBefore: string, diagnostic: server.Diagnostic): any {
	fix: function (codeBefore: string): string {
		console.log("tsLint helper missing semicolon");
		// let codeBefore = document.getText(diagnostic.range);
		let codeAfter = codeBefore + ";";
		// let edit = new server.WorkspaceEdit();
		// edit.replace(document.uri, diagnostic.range, codeAfter);
		// console.log("Before:>", codeBefore, "< after:>", codeAfter, "<");
		// return server.workspace.applyEdit(edit);

		return codeAfter;
	}
};
this.tsLintAutoFixes.push(autoFix);

autoFix = {
	tsLintCode: "quotemark",
	tsLintMessage: "' should be \"",
	autoFixMessage: "Replace ' by \" ",
	// runCodeAction: function (document: server.TextDocument, diagnostic: server.Diagnostic): any {
	// fix: function (codeBefore: string, diagnostic: server.Diagnostic): any {
	fix: function (codeBefore: string): string {
		console.log("tsLint helper replace ' by \"");
		// let codeBefore = document.getText(diagnostic.range);
		let codeAfter = "\"" + codeBefore.slice(1, codeBefore.length - 1) + "\"";
		// let edit = new server.WorkspaceEdit();
		// edit.replace(document.uri, diagnostic.range, codeAfter);
		// console.log("Before:>", codeBefore, "< after:>", codeAfter, "<");
		// return server.workspace.applyEdit(edit);
		return codeAfter;
	}
};
this.tsLintAutoFixes.push(autoFix);

autoFix = {
	tsLintCode: "no-trailing-whitespace",
	tsLintMessage: "trailing whitespace",
	autoFixMessage: "Trim whitespace",
	// runCodeAction: function (document: server.TextDocument, diagnostic: server.Diagnostic): any {
	// fix: function (codeBefore: string, diagnostic: server.Diagnostic): any {
	fix: function (codeBefore: string): string {
		console.log("tsLint helper trim whitespace");
		// let codeBefore = document.getText(diagnostic.range);
		let codeAfter = "";
		// let edit = new server.WorkspaceEdit();
		// edit.replace(document.uri, diagnostic.range, codeAfter);
		// console.log("Before:>", codeBefore, "< after:>", codeAfter, "<");
		// return server.workspace.applyEdit(edit);
		return codeAfter;
	}
};
this.tsLintAutoFixes.push(autoFix);<commit_msg>debugging error due to console.log who is async and  bring prob in the communication between client/server<commit_after>
// import * as server from 'vscode-languageserver';


export interface TsLintAutoFix {
	tsLintCode: string;
	tsLintMessage: string;
	autoFixMessage: string;
	// runCodeAction(document: server.TextDocument, diagnostic: server.Diagnostic): any;
	// fix(codeBefore: string, diagnostic: server.Diagnostic): any;
	fix(codeBefore: string): string;
}
export let tsLintAutoFixes: TsLintAutoFix[] = [];

let autoFix: TsLintAutoFix;
autoFix = {
	tsLintCode: "one-line",
	tsLintMessage: "missing whitespace",
	autoFixMessage: "Add a whitespace",
	// runCodeAction: function (document: server.TextDocument, diagnostic: server.Diagnostic): any {
	// fix: function (codeBefore: string, diagnostic: server.Diagnostic): any {
	fix: function (codeBefore: string): string {
		// console.log("tsLint helper missing whitespace");
		// server.TextDocuments .create()
		// let codeBefore = document.getText(diagnostic.range);
		let codeAfter = " " + codeBefore;
		// let edit = new server.WorkspaceEdit() WorkspaceEdit();
		// edit.replace(document.uri, diagnostic.range, codeAfter);
		// console.log("Before:>", codeBefore, "< after:>", codeAfter, "<");
		// return server.workspace.applyEdit(edit);
		return codeAfter;
	}
};
this.tsLintAutoFixes.push(autoFix);

autoFix = {
	tsLintCode: "one-line",
	tsLintMessage: "missing semicolon",
	autoFixMessage: "Add semicolon",
	// runCodeAction: function (document: server.TextDocument, diagnostic: server.Diagnostic): any {
	// fix: function (codeBefore: string, diagnostic: server.Diagnostic): any {
	fix: function (codeBefore: string): string {
		// console.log("tsLint helper missing semicolon");
		// let codeBefore = document.getText(diagnostic.range);
		let codeAfter = codeBefore + ";";
		// let edit = new server.WorkspaceEdit();
		// edit.replace(document.uri, diagnostic.range, codeAfter);
		// console.log("Before:>", codeBefore, "< after:>", codeAfter, "<");
		// return server.workspace.applyEdit(edit);

		return codeAfter;
	}
};
this.tsLintAutoFixes.push(autoFix);

autoFix = {
	tsLintCode: "quotemark",
	tsLintMessage: "' should be \"",
	autoFixMessage: "Replace ' by \" ",
	// runCodeAction: function (document: server.TextDocument, diagnostic: server.Diagnostic): any {
	// fix: function (codeBefore: string, diagnostic: server.Diagnostic): any {
	fix: function (codeBefore: string): string {
		// console.log("tsLint helper replace ' by \"");
		// let codeBefore = document.getText(diagnostic.range);
		let codeAfter = "\"" + codeBefore.slice(1, codeBefore.length - 1) + "\"";
		// let edit = new server.WorkspaceEdit();
		// edit.replace(document.uri, diagnostic.range, codeAfter);
		// console.log("Before:>", codeBefore, "< after:>", codeAfter, "<");
		// return server.workspace.applyEdit(edit);
		return codeAfter;
	}
};
this.tsLintAutoFixes.push(autoFix);

autoFix = {
	tsLintCode: "no-trailing-whitespace",
	tsLintMessage: "trailing whitespace",
	autoFixMessage: "Trim whitespace",
	// runCodeAction: function (document: server.TextDocument, diagnostic: server.Diagnostic): any {
	// fix: function (codeBefore: string, diagnostic: server.Diagnostic): any {
	fix: function (codeBefore: string): string {
		// console.log("tsLint helper trim whitespace");
		// let codeBefore = document.getText(diagnostic.range);
		let codeAfter = "";
		// let edit = new server.WorkspaceEdit();
		// edit.replace(document.uri, diagnostic.range, codeAfter);
		// console.log("Before:>", codeBefore, "< after:>", codeAfter, "<");
		// return server.workspace.applyEdit(edit);
		return codeAfter;
	}
};
this.tsLintAutoFixes.push(autoFix);
{'fraction_non_alphanumeric': 0.15378266850068775, 'fraction_numerical': 0.0005502063273727648, 'mean_word_length': 4.85426731078905, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, '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': '3812252', 'n_tokens_mistral': 2331, 'n_tokens_neox': 2262, 'n_words': 526}