"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const vscode = require("vscode");
const command_1 = require("../constants/command");
const ParserManager_1 = require("../model/ParserManager");
const index_1 = require("../utils/index");
const fs = require("fs");
const setCheckAllFilesCommand = (ctx) => {
    ctx.subscriptions.push(vscode.commands.registerCommand(command_1.Commands.CheckAllFiles, (commandParams) => {
        // 获取当前的
        const parserManager = ParserManager_1.default.getSingleInstance();
        const currentDir = index_1.default.getCurrentFilePath();
        vscode.window.showInputBox({
            prompt: '请输入要check的文件夹路径',
            value: currentDir,
            valueSelection: [currentDir.lastIndexOf('/'), currentDir.length]
        }).then((dir) => {
            if (fs.statSync(dir).isDirectory()) {
                parserManager.parseDir(dir);
            }
            else {
                parserManager.parseFile(dir).then((parser) => {
                    parser.logErrors();
                });
            }
        });
    }));
};
exports.default = setCheckAllFilesCommand;
//# sourceMappingURL=CheckAllFiles.js.map