<commit_before>"use strict";
import { Commands } from '../common/constants';
import * as vscode from "vscode";
import * as path from 'path';
import { IS_WINDOWS } from '../common/utils';

export function activateUpdateSparkLibraryProvider(): vscode.Disposable {
    console.log('Register command python.updateSparkLibrary');
    return vscode.commands.registerCommand(Commands.Update_SparkLibrary, updateSparkLibrary);
}

function updateSparkLibrary() {
    const pythonConfig = vscode.workspace.getConfiguration('python');
    const extraLibPath = 'autoComplete.extraPaths';
    let sparkHomePath = '${env.SPARK_HOME}';
    pythonConfig.update(extraLibPath, [path.join(sparkHomePath, 'python'),
    path.join(sparkHomePath, 'python/pyspark')]).then(() => {
        //Done
    }, reason => {
        vscode.window.showErrorMessage(`Failed to update ${extraLibPath}. Error: ${reason.message}`);
        console.error(reason);
    });
    if (IS_WINDOWS) {        
        const pysparkPath = 'pysparkPath';
        console.log('Overriding ' + pysparkPath);
        pythonConfig.update(pysparkPath, path.join(sparkHomePath, 'bin', 'spark-submit.cmd')).then(() => {
        //Done
        }, reason => {
            vscode.window.showErrorMessage(`Failed to update ${pysparkPath}. Error: ${reason.message}`);
            console.error(reason);
        });
    }
}<commit_msg>Adding user information message to set SPARK_HOME<commit_after>"use strict";
import { Commands } from '../common/constants';
import * as vscode from "vscode";
import * as path from 'path';
import { IS_WINDOWS } from '../common/utils';

export function activateUpdateSparkLibraryProvider(): vscode.Disposable {
    console.log('Register command python.updateSparkLibrary');
    return vscode.commands.registerCommand(Commands.Update_SparkLibrary, updateSparkLibrary);
}

function updateSparkLibrary() {
    const pythonConfig = vscode.workspace.getConfiguration('python');
    const extraLibPath = 'autoComplete.extraPaths';
    let sparkHomePath = '${env.SPARK_HOME}';
    pythonConfig.update(extraLibPath, [path.join(sparkHomePath, 'python'),
    path.join(sparkHomePath, 'python/pyspark')]).then(() => {
        //Done
    }, reason => {
        vscode.window.showErrorMessage(`Failed to update ${extraLibPath}. Error: ${reason.message}`);
        console.error(reason);
    });
    if (IS_WINDOWS) {        
        const pysparkPath = 'pysparkPath';
        console.log('Overriding ' + pysparkPath);
        pythonConfig.update(pysparkPath, path.join(sparkHomePath, 'bin', 'spark-submit.cmd')).then(() => {
        //Done
        }, reason => {
            vscode.window.showErrorMessage(`Failed to update ${pysparkPath}. Error: ${reason.message}`);
            console.error(reason);
        });
    }
    vscode.window.showInformationMessage(`Make sure you have SPARK_HOME environment variable set to the root path of the local spark installation!`);
}
{'fraction_non_alphanumeric': 0.13993174061433447, 'fraction_numerical': 0.0, 'mean_word_length': 3.6971153846153846, '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': '1784555', 'n_tokens_mistral': 859, 'n_tokens_neox': 855, 'n_words': 173}