<commit_before>'use strict';
import * as vscode from 'vscode';
import {RequestController} from './controllers/RequestController';
import {ConnectionController} from './controllers/ConnectionController';
import {OutputChannelController} from './controllers/OutputChannelController';
import {MySQLUtil} from './utils/MySQLUtil';
import {ResultStore} from './utils/ResultStore';

export function activate(context: vscode.ExtensionContext) {
    let requestController = new RequestController();
    let connectionController = new ConnectionController();
    let outputChannelController = new OutputChannelController();
    
    context.subscriptions.push(requestController);
    context.subscriptions.push(connectionController);
    context.subscriptions.push(outputChannelController);
    context.subscriptions.push(vscode.commands.registerCommand('mysql-scratchpad.mysqlConnect', () => connectionController.inputConnectionAndConnect()));
    context.subscriptions.push(vscode.commands.registerCommand('mysql-scratchpad.mysqlDisconnect', ()=> connectionController.closeConnection()));
    context.subscriptions.push(vscode.commands.registerTextEditorCommand('mysql-scratchpad.executeCurrentLine', editor => requestController.executeStatementUnderCursor(editor)));
    context.subscriptions.push(vscode.commands.registerCommand('mysql-scratchpad.openScratchpad', () => connectionController.openScratchpad()));
    context.subscriptions.push(vscode.commands.registerTextEditorCommand('mysql-scratchpad.executeEntireFile', editor => requestController.executeEntireFile(editor)));
    context.subscriptions.push(vscode.commands.registerTextEditorCommand('mysql-scratchpad.executeSelectedText', editor => requestController.executeSelectedText(editor)));

    context.subscriptions.push(vscode.workspace.onDidCloseTextDocument(document => {
        if(document.uri.scheme === 'mysql-scratchpad'){
            ResultStore.remove(document.uri.toString());
        }
    }))
}

// this method is called when your extension is deactivated
export function deactivate() {
    ResultStore.clear();
}<commit_msg>turned off the removal of results from the cache when a document is closed<commit_after>'use strict';
import * as vscode from 'vscode';
import {RequestController} from './controllers/RequestController';
import {ConnectionController} from './controllers/ConnectionController';
import {OutputChannelController} from './controllers/OutputChannelController';
import {MySQLUtil} from './utils/MySQLUtil';
import {ResultStore} from './utils/ResultStore';

export function activate(context: vscode.ExtensionContext) {
    let requestController = new RequestController();
    let connectionController = new ConnectionController();
    let outputChannelController = new OutputChannelController();
    
    context.subscriptions.push(requestController);
    context.subscriptions.push(connectionController);
    context.subscriptions.push(outputChannelController);
    context.subscriptions.push(vscode.commands.registerCommand('mysql-scratchpad.mysqlConnect', () => connectionController.inputConnectionAndConnect()));
    context.subscriptions.push(vscode.commands.registerCommand('mysql-scratchpad.mysqlDisconnect', ()=> connectionController.closeConnection()));
    context.subscriptions.push(vscode.commands.registerTextEditorCommand('mysql-scratchpad.executeCurrentLine', editor => requestController.executeStatementUnderCursor(editor)));
    context.subscriptions.push(vscode.commands.registerCommand('mysql-scratchpad.openScratchpad', () => connectionController.openScratchpad()));
    context.subscriptions.push(vscode.commands.registerTextEditorCommand('mysql-scratchpad.executeEntireFile', editor => requestController.executeEntireFile(editor)));
    context.subscriptions.push(vscode.commands.registerTextEditorCommand('mysql-scratchpad.executeSelectedText', editor => requestController.executeSelectedText(editor)));
}

// this method is called when your extension is deactivated
export function deactivate() {
    ResultStore.clear();
}
{'fraction_non_alphanumeric': 0.11353495290034706, 'fraction_numerical': 0.0, 'mean_word_length': 7.03784860557769, 'pattern_counts': {'":': 0, '<': 3, '<?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': '7082992', 'n_tokens_mistral': 989, 'n_tokens_neox': 984, 'n_words': 165}