private getManifest()

in src/BasePreviewManager.ts [82:105]


    private getManifest(): Promise<string> {

        let self = this;
        // if the active open window is .md type, then return the view with oldJSON"
        if (vscode.window.activeTextEditor && self.utilities.isActive(".md")) {
            // Prepare the packageData
            this.deserializeJSON(this.oldJSON);
            // Read the README file 
            return new Promise<string>((resolve, reject) => {
                resolve(self.getReadMe());
            }).then((promise) => {
                return promise;
            }).catch(() => {
                return Constants.ErrorMessages.GET_MANIFEST_ERROR;
            })
        }
        // Assume that the manifest file is open. Even if it is not opened , the following code just returns the oldPreview
        else if (vscode.window.activeTextEditor && this.isManifestOpen()) {
            return this.getManifestFromActiveEditor();
        }
        else {
            return this.returnOldPreview(Constants.ErrorMessages.NO_MANIFEST);
        }
    }