diff --git a/build/js-transpiled/main.js b/build/js-transpiled/main.js index df01deca..82d5dc6b 100644 --- a/build/js-transpiled/main.js +++ b/build/js-transpiled/main.js @@ -14,7 +14,7 @@ var _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2); var main = function () { var _ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee() { - var pathsToLook, baseConfig, extendedConfig, extendedConfig2, finalConfig, fileContents; + var pathsToLook, baseConfig, extendedConfig, extendedConfig2, finalConfig, bufferContents; return _regenerator2.default.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { @@ -79,38 +79,38 @@ var main = function () { _context.t0 = constants.EDITOR_TEXT_TEMP_FILE_CONTENTS; case 31: - fileContents = _context.t0; + bufferContents = _context.t0; if ((0, _fileUtils.isCSS)()) { stdio.info('Attempting to prettify what seems to be a CSS file.'); stdio.endDiagnostics(); stdio.beginPrettifiedCode(); - stdio.out(beautify.css(fileContents, finalConfig.css)); + stdio.out(beautify.css(bufferContents, finalConfig.css)); stdio.endPrettifiedCode(); - } else if ((0, _fileUtils.isHTML)(fileContents)) { + } else if ((0, _fileUtils.isHTML)(bufferContents)) { stdio.info('Attempting to prettify what seems to be a HTML file.'); stdio.endDiagnostics(); stdio.beginPrettifiedCode(); - stdio.out(beautify.html(fileContents, finalConfig.html)); + stdio.out(beautify.html(bufferContents, finalConfig.html)); stdio.endPrettifiedCode(); - } else if ((0, _fileUtils.isJSON)()) { + } else if ((0, _fileUtils.isJSON)(bufferContents)) { stdio.info('Attempting to prettify what seems to be a JSON file.'); stdio.endDiagnostics(); stdio.beginPrettifiedCode(); - stdio.out(beautify.js(fileContents, finalConfig.json)); + stdio.out(beautify.js(bufferContents, finalConfig.json)); stdio.endPrettifiedCode(); - } else if ((0, _fileUtils.isJS)(fileContents)) { + } else if ((0, _fileUtils.isJS)(bufferContents)) { stdio.info('Attempting to prettify what seems to be a JS file.'); stdio.endDiagnostics(); stdio.beginPrettifiedCode(); - stdio.out(beautify.js(fileContents, finalConfig.js)); + stdio.out(beautify.js(bufferContents, finalConfig.js)); stdio.endPrettifiedCode(); } else { stdio.info('Unsupported file type'); stdio.endDiagnostics(); stdio.beginPrettifiedCode(); - stdio.out(fileContents); + stdio.out(bufferContents); stdio.endPrettifiedCode(); } @@ -168,4 +168,4 @@ process.on('unhandledRejection', function (err) { }); main(); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm1haW4uanMiXSwibmFtZXMiOlsic3RkaW8iLCJiZWdpbkRpYWdub3N0aWNzIiwiaW5mbyIsImNvbnN0YW50cyIsIlVTSU5HX0VESVRPUl9URVhUX1RFTVBfRklMRSIsIkdMT0JBTF9GSUxFX1JVTEVTX0pTT04iLCJSRVNQRUNUX0VESVRPUkNPTkZJR19GSUxFUyIsIkVESVRPUl9GSUxFX1NZTlRBWCIsIkVESVRPUl9JTkRFTlRfU0laRSIsIkVESVRPUl9JTkRFTlRfV0lUSF9UQUJTIiwiRURJVE9SX1RFWFRfVEVNUF9GSUxFX1BBVEgiLCJFRElUT1JfVEVYVF9URU1QX0ZJTEVfQ09OVEVOVFMiLCJPUklHSU5BTF9GSUxFX1BBVEgiLCJDT05GSUdfRVhUUkFfTE9PS1VQX1BBVEhTIiwicGF0aHNUb0xvb2siLCJwdXRpbHMiLCJnZXRQb3RlbnRpYWxDb25maWdEaXJzIiwiY3V0aWxzIiwicGFyc2VEZWZhdWx0SnNiZWF1dGlmeUNvbmZpZyIsImJhc2VDb25maWciLCJleHRlbmRKc2JlYXV0aWZ5Q29uZmlnRnJvbUZvbGRlcnMiLCJleHRlbmRlZENvbmZpZyIsImV4dGVuZEpzYmVhdXRpZnlDb25maWdGcm9tRWRpdG9yQ29uZmlnSW5Gb2xkZXJzIiwiZXh0ZW5kZWRDb25maWcyIiwiZmluYWxDb25maWciLCJmaW5hbGl6ZUpzYmVhdXRpZnlDb25maWciLCJyZWFkRmlsZSIsImVuY29kaW5nIiwiZmlsZUNvbnR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hdXRpZnkuanMoYnVmZmVyQ29udGVudHMsIGZpbmFsQ29uZmlnLmpzb24pKTtcbiAgICBzdGRpby5lbmRQcmV0dGlmaWVkQ29kZSgpO1xuICB9IGVsc2UgaWYgKGlzSlMoYnVmZmVyQ29udGVudHMpKSB7XG4gICAgc3RkaW8uaW5mbygnQXR0ZW1wdGluZyB0byBwcmV0dGlmeSB3aGF0IHNlZW1zIHRvIGJlIGEgSlMgZmlsZS4nKTtcbiAgICBzdGRpby5lbmREaWFnbm9zdGljcygpO1xuICAgIHN0ZGlvLmJlZ2luUHJldHRpZmllZENvZGUoKTtcbiAgICBzdGRpby5vdXQoYmVhdXRpZnkuanMoYnVmZmVyQ29udGVudHMsIGZpbmFsQ29uZmlnLmpzKSk7XG4gICAgc3RkaW8uZW5kUHJldHRpZmllZENvZGUoKTtcbiAgfSBlbHNlIHtcbiAgICBzdGRpby5pbmZvKCdVbnN1cHBvcnRlZCBmaWxlIHR5cGUnKTtcbiAgICBzdGRpby5lbmREaWFnbm9zdGljcygpO1xuICAgIHN0ZGlvLmJlZ2luUHJldHRpZmllZENvZGUoKTtcbiAgICBzdGRpby5vdXQoYnVmZmVyQ29udGVudHMpO1xuICAgIHN0ZGlvLmVuZFByZXR0aWZpZWRDb2RlKCk7XG4gIH1cbn1cblxubWFpbigpO1xuIl0sInNvdXJjZVJvb3QiOiIvc291cmNlLyJ9 diff --git a/build/js-transpiled/utils/fileUtils.js b/build/js-transpiled/utils/fileUtils.js index d7480cf4..b7340c55 100644 --- a/build/js-transpiled/utils/fileUtils.js +++ b/build/js-transpiled/utils/fileUtils.js @@ -29,7 +29,7 @@ var GLOBAL_FILE_RULES = (0, _jsonUtils.parseJSON5)(_constants.GLOBAL_FILE_RULES_ // Checks if a file path is allowed by regexing the file name and expecting // it not to match certain expressions. -var isDisallowedFilePattern = function isDisallowedFilePattern(fileType, filePath) { +var hasDisallowedFilePathPattern = function hasDisallowedFilePathPattern(fileType, filePath) { var _iteratorNormalCompletion = true; var _didIteratorError = false; var _iteratorError = undefined; @@ -127,69 +127,82 @@ var hasAllowedFileSyntax = function hasAllowedFileSyntax(expectedType, fileSynta }; var isCSS = exports.isCSS = function isCSS() { - // If file unsaved, there's no good way to determine whether or not it's - // CSS based on the file contents, so just bail. - if (_constants.ORIGINAL_FILE_PATH === '?') { - return false; + var isSavedFile = _constants.ORIGINAL_FILE_PATH !== '?'; + var useEditorFileSyntaxForDeterminingFileType = _constants.EDITOR_FILE_SYNTAX !== '?'; + + var isAllowedExtension = hasAllowedFileExtension('css', _constants.ORIGINAL_FILE_PATH); + var isAllowedSyntax = hasAllowedFileSyntax('css', _constants.EDITOR_FILE_SYNTAX); + var isDisallowedFilePattern = hasDisallowedFilePathPattern('css', _constants.ORIGINAL_FILE_PATH); + + if (!isSavedFile) { + return useEditorFileSyntaxForDeterminingFileType ? isAllowedSyntax : false; } - if (isDisallowedFilePattern('css', _constants.ORIGINAL_FILE_PATH)) { + + if (isDisallowedFilePattern) { return false; } - var allowedExtension = hasAllowedFileExtension('css', _constants.ORIGINAL_FILE_PATH); - if (_constants.EDITOR_FILE_SYNTAX === '?') { - return allowedExtension; - } - var allowedSyntax = hasAllowedFileSyntax('css', _constants.EDITOR_FILE_SYNTAX); - return allowedSyntax || allowedExtension; + + return useEditorFileSyntaxForDeterminingFileType ? isAllowedSyntax || isAllowedExtension : isAllowedExtension; }; var isHTML = exports.isHTML = function isHTML(bufferContents) { - // If file unsaved, check if first non-whitespace character is < - if (_constants.ORIGINAL_FILE_PATH === '?') { - return bufferContents.match(/^\s*