"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const vscode = require("vscode");
const vscode_1 = require("vscode");
const path = require('path');
const index_1 = require("../config/index");
const id = `${index_1.default.publisher}.${index_1.default.name}`;
exports.default = {
    get extensionId() {
        return `${index_1.default.publisher}.${index_1.default.name}`;
    },
    get extension() {
        // @ts-ignore
        return vscode_1.extensions.getExtension(this.extensionId);
    },
    diagnostic: vscode.languages.createDiagnosticCollection(id),
    activeTextEditor: vscode.TextEdit,
    setActiveTextEditor(activeTextEditor) {
        var _a;
        if ((_a = activeTextEditor === null || activeTextEditor === void 0 ? void 0 : activeTextEditor.document) === null || _a === void 0 ? void 0 : _a.fileName) {
            this.activeTextEditor = activeTextEditor;
        }
    },
    getActiveEditor() {
        if (this.activeTextEditor) {
            return this.activeTextEditor;
        }
        else {
            vscode.window.showInformationMessage('请选择一个文件');
            throw new Error('请选择一个文件');
        }
    },
    getCurrentFilePath() {
        const activeTextEditor = this.getActiveEditor();
        return activeTextEditor.document.fileName;
    }
};
//# sourceMappingURL=index.js.map