diff --git a/build/index.js b/build/index.js index eec8e46c92a..7d1f6332063 100644 --- a/build/index.js +++ b/build/index.js @@ -284,11 +284,13 @@ src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$' // Coercion. // Extract anything that could conceivably be a part of a valid semver var COERCE = R++ -src[COERCE] = '(?:^|[^\\d])' + +src[COERCE] = '(^|[^\\d])' + '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' + '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + '(?:$|[^\\d])' +var COERCERTL = R++ +re[COERCERTL] = new RegExp(src[COERCE], 'g') // Tilde ranges. // Meaning is "reasonably at or greater than" @@ -1288,10 +1290,14 @@ function replaceXRange (comp, options) { gtlt = '' } + // if we're including prereleases in the match, then we need + // to fix this to -0, the lowest possible prerelease value + pr = options.includePrerelease ? '-0' : '' + if (xM) { if (gtlt === '>' || gtlt === '<') { // nothing is allowed - ret = '<0.0.0' + ret = '<0.0.0-0' } else { // nothing is forbidden ret = '*' @@ -1328,11 +1334,12 @@ function replaceXRange (comp, options) { } } - ret = gtlt + M + '.' + m + '.' + p + ret = gtlt + M + '.' + m + '.' + p + pr } else if (xm) { - ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0' + ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr } else if (xp) { - ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0' + ret = '>=' + M + '.' + m + '.0' + pr + + ' <' + M + '.' + (+m + 1) + '.0' + pr } debug('xRange return', ret) @@ -1660,19 +1667,49 @@ function coerce (version, options) { return version } + if (typeof version === 'number') { + version = String(version) + } + if (typeof version !== 'string') { return null } - var match = version.match(re[COERCE]) + options = options || {} + + var match = null + if (!options.rtl) { + match = version.match(re[COERCE]) + } else { + // Find the right-most coercible string that does not share + // a terminus with a more left-ward coercible string. + // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4' + // + // Walk through the string checking with a /g regexp + // Manually set the index so as to pick up overlapping matches. + // Stop when we get a match that ends at the string end, since no + // coercible string can be more right-ward without the same terminus. + var next + while ((next = re[COERCERTL].exec(version)) && + (!match || match.index + match[0].length !== version.length) + ) { + if (!match || + next.index + next[0].length !== match.index + match[0].length) { + match = next + } + re[COERCERTL].lastIndex = next.index + next[1].length + next[2].length + } + // leave it in a clean state + re[COERCERTL].lastIndex = -1 + } - if (match == null) { + if (match === null) { return null } - return parse(match[1] + - '.' + (match[2] || '0') + - '.' + (match[3] || '0'), options) + return parse(match[2] + + '.' + (match[3] || '0') + + '.' + (match[4] || '0'), options) } @@ -1753,7 +1790,7 @@ exports.default = (opts, requestApi = true) => { clientReady = true; if (isTest) nvim.command(`let g:coc_node_channel_id = ${channelId}`, true); - let json = __webpack_require__(391); + let json = __webpack_require__(397); let { major, minor, patch } = semver_1.default.parse(json.version); nvim.setClientInfo('coc', { major, minor, patch }, 'remote', {}, {}); let entered = await nvim.getVvar('vim_did_enter'); @@ -8359,6 +8396,7 @@ module.exports = { const dateFormat = __webpack_require__(75); const os = __webpack_require__(55); const util = __webpack_require__(40); +const path = __webpack_require__(56); const eol = os.EOL || '\n'; @@ -8575,8 +8613,17 @@ function patternLayout(pattern, tokens) { return null; } - function fileName(loggingEvent) { - return loggingEvent.fileName || ''; + function fileName(loggingEvent, specifier) { + let filename = loggingEvent.fileName || ''; + if (specifier) { + const fileDepth = parseInt(specifier, 10); + const fileList = filename.split(path.sep); + if (fileList.length > fileDepth) { + filename = fileList.slice(-fileDepth).join(path.sep); + } + } + + return filename; } function lineNumber(loggingEvent) { @@ -36975,7 +37022,7 @@ const categories = __webpack_require__(142); const configuration = __webpack_require__(73); const stackReg = /at (?:(.+)\s+\()?(?:(.+?):(\d+)(?::(\d+))?|([^)]+))\)?/; -function parseCallStack(data, skipIdx = 4) { +function defaultParseCallStack(data, skipIdx = 4) { const stacklines = data.stack.split('\n').slice(skipIdx); const lineMatch = stackReg.exec(stacklines[0]); if (lineMatch && lineMatch.length === 6) { @@ -37009,6 +37056,7 @@ class Logger { } this.category = name; this.context = {}; + this.parseCallStack = defaultParseCallStack; debug(`Logger created (${this.category}, ${this.level})`); } @@ -37046,7 +37094,7 @@ class Logger { level, data, this.context, - (this.useCallStack) && parseCallStack(new Error()) + (this.useCallStack) && this.parseCallStack(new Error()) ); clustering.send(loggingEvent); } @@ -37062,6 +37110,10 @@ class Logger { clearContext() { this.context = {}; } + + setParseCallStackFunction(parseFunction) { + this.parseCallStack = parseFunction; + } } function addLevelMethods(target) { @@ -42686,18 +42738,6 @@ function _referenceResolution(scheme, path) { var _empty = ''; var _slash = '/'; var _regexp = /^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/; -function _isQueryStringScheme(scheme) { - if (!scheme) { - return false; - } - switch (scheme.toLowerCase()) { - case 'http': - case 'https': - case 'ftp': - return true; - } - return false; -} /** * Uniform Resource Identifier (URI) http://tools.ietf.org/html/rfc3986. * This class is a simple parser which creates the basic component parts @@ -42844,9 +42884,9 @@ var URI = (function () { if (_strict === void 0) { _strict = false; } var match = _regexp.exec(value); if (!match) { - return new _URI(_empty, _empty, _empty, _empty, _empty, _strict); + return new _URI(_empty, _empty, _empty, _empty, _empty); } - return new _URI(match[2] || _empty, decodeURIComponentFast(match[4] || _empty, false, false), decodeURIComponentFast(match[5] || _empty, true, false), decodeURIComponentFast(match[7] || _empty, false, _isQueryStringScheme(match[2])), decodeURIComponentFast(match[9] || _empty, false, false), _strict); + return new _URI(match[2] || _empty, decodeURIComponent(match[4] || _empty), decodeURIComponent(match[5] || _empty), decodeURIComponent(match[7] || _empty), decodeURIComponent(match[9] || _empty), _strict); }; /** * Creates a new URI from a file system path, e.g. `c:\my\files`, @@ -42873,7 +42913,7 @@ var URI = (function () { var authority = _empty; // normalize to fwd-slashes on windows, // on other systems bwd-slashes are valid - // filename character, e.g. /f\oo/ba\r.txt + // filename character, eg /f\oo/ba\r.txt if (isWindows) { path = path.replace(/\\/g, _slash); } @@ -42996,65 +43036,6 @@ var _URI = (function (_super) { }; return _URI; }(URI)); -function isHex(value, pos) { - if (pos >= value.length) { - return false; - } - var code = value.charCodeAt(pos); - return (code >= 48 /* Digit0 */ && code <= 57 /* Digit9 */) // 0-9 - || (code >= 97 /* a */ && code <= 102 /* f */) //a-f - || (code >= 65 /* A */ && code <= 70 /* F */); //A-F -} -function decodeURIComponentFast(uriComponent, isPath, isQueryString) { - var res; - var nativeDecodePos = -1; - for (var pos = 0; pos < uriComponent.length; pos++) { - var code = uriComponent.charCodeAt(pos); - // decoding needed - if (code === 37 /* PercentSign */ && isHex(uriComponent, pos + 1) && isHex(uriComponent, pos + 2)) { - var chA = uriComponent.charCodeAt(pos + 1); - var chB = uriComponent.charCodeAt(pos + 2); - // when in a path -> check and accept %2f and %2F (fwd slash) - // when in a query string -> check and accept %3D, %26, and %3B (equals, ampersand, semi-colon) - if ((isPath && chA === 50 /* Digit2 */ && (chB === 70 /* F */ || chB === 102 /* f */)) - || - (isQueryString && ((chA === 50 /* Digit2 */ && chB === 54 /* Digit6 */) // %26 - || - (chA === 51 /* Digit3 */ && (chB === 66 /* B */ || chB === 98 /* b */ || chB === 68 /* D */ || chB === 100 /* d */)) // %3D, %3D - ))) { - if (nativeDecodePos !== -1) { - res += decodeURIComponent(uriComponent.substring(nativeDecodePos, pos)); - nativeDecodePos = -1; - } - if (res !== undefined) { - res += uriComponent.substr(pos, 3); - } - pos += 2; - continue; - } - if (res === undefined) { - res = uriComponent.substring(0, pos); - } - if (nativeDecodePos === -1) { - nativeDecodePos = pos; - } - pos += 2; - } - else { - if (nativeDecodePos !== -1) { - res += decodeURIComponent(uriComponent.substring(nativeDecodePos, pos)); - nativeDecodePos = -1; - } - if (res !== undefined) { - res += String.fromCharCode(code); - } - } - } - if (nativeDecodePos !== -1) { - res += decodeURIComponent(uriComponent.substr(nativeDecodePos)); - } - return res !== undefined ? res : uriComponent; -} // reserved characters: https://tools.ietf.org/html/rfc3986#section-2.2 var encodeTable = (_a = {}, _a[58 /* Colon */] = '%3A', @@ -43077,7 +43058,7 @@ var encodeTable = (_a = {}, _a[61 /* Equals */] = '%3D', _a[32 /* Space */] = '%20', _a); -function encodeURIComponentFast(uriComponent, isPath, isQueryString) { +function encodeURIComponentFast(uriComponent, allowSlash) { var res = undefined; var nativeEncodePos = -1; for (var pos = 0; pos < uriComponent.length; pos++) { @@ -43090,9 +43071,7 @@ function encodeURIComponentFast(uriComponent, isPath, isQueryString) { || code === 46 /* Period */ || code === 95 /* Underline */ || code === 126 /* Tilde */ - || (isPath && code === 47 /* Slash */) // path => allow slash AS-IS - || (isQueryString && (code === 61 /* Equals */ || code === 38 /* Ampersand */ || code === 59 /* Semicolon */)) // query string => allow &=; - ) { + || (allowSlash && code === 47 /* Slash */)) { // check if we are delaying native encode if (nativeEncodePos !== -1) { res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos)); @@ -43103,19 +43082,6 @@ function encodeURIComponentFast(uriComponent, isPath, isQueryString) { res += uriComponent.charAt(pos); } } - else if (code === 37 /* PercentSign */ && isHex(uriComponent, pos + 1) && isHex(uriComponent, pos + 2)) { - // at percentage encoded value - // check if we are delaying native encode - if (nativeEncodePos !== -1) { - res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos)); - nativeEncodePos = -1; - } - // check if we write into a new string (by default we try to return the param) - if (res !== undefined) { - res += uriComponent.substr(pos, 3); - } - pos += 2; - } else { // encoding needed, we need to allocate a new string if (res === undefined) { @@ -43210,24 +43176,24 @@ function _asFormatted(uri, skipEncoding) { authority = authority.substr(idx + 1); idx = userinfo.indexOf(':'); if (idx === -1) { - res += encoder(userinfo, false, false); + res += encoder(userinfo, false); } else { // :@ - res += encoder(userinfo.substr(0, idx), false, false); + res += encoder(userinfo.substr(0, idx), false); res += ':'; - res += encoder(userinfo.substr(idx + 1), false, false); + res += encoder(userinfo.substr(idx + 1), false); } res += '@'; } authority = authority.toLowerCase(); idx = authority.indexOf(':'); if (idx === -1) { - res += encoder(authority, false, false); + res += encoder(authority, false); } else { // : - res += encoder(authority.substr(0, idx), false, false); + res += encoder(authority.substr(0, idx), false); res += authority.substr(idx); } } @@ -43246,15 +43212,15 @@ function _asFormatted(uri, skipEncoding) { } } // encode the rest of the path - res += encoder(path, true, false); + res += encoder(path, true); } if (query) { res += '?'; - res += encoder(query, false, _isQueryStringScheme(scheme)); + res += encoder(query, false); } if (fragment) { res += '#'; - res += !skipEncoding ? encodeURIComponentFast(fragment, false, false) : fragment; + res += !skipEncoding ? encodeURIComponentFast(fragment, false) : fragment; } return res; } @@ -54059,13 +54025,13 @@ const commands_1 = tslib_1.__importDefault(__webpack_require__(229)); const completion_1 = tslib_1.__importDefault(__webpack_require__(233)); const manager_1 = tslib_1.__importDefault(__webpack_require__(255)); const extensions_1 = tslib_1.__importDefault(__webpack_require__(235)); -const handler_1 = tslib_1.__importDefault(__webpack_require__(384)); +const handler_1 = tslib_1.__importDefault(__webpack_require__(390)); const manager_2 = tslib_1.__importDefault(__webpack_require__(345)); const services_1 = tslib_1.__importDefault(__webpack_require__(332)); const manager_3 = tslib_1.__importDefault(__webpack_require__(230)); const sources_1 = tslib_1.__importDefault(__webpack_require__(234)); const types_1 = __webpack_require__(186); -const clean_1 = tslib_1.__importDefault(__webpack_require__(390)); +const clean_1 = tslib_1.__importDefault(__webpack_require__(396)); const workspace_1 = tslib_1.__importDefault(__webpack_require__(184)); const logger = __webpack_require__(183)('plugin'); class Plugin extends events_1.EventEmitter { @@ -54297,7 +54263,7 @@ class Plugin extends events_1.EventEmitter { return false; } get version() { - return workspace_1.default.version + ( true ? '-' + "483a89cb6a" : undefined); + return workspace_1.default.version + ( true ? '-' + "6da3d043a1" : undefined); } async showInfo() { if (!this.infoChannel) { @@ -54767,7 +54733,7 @@ const workspace_1 = tslib_1.__importDefault(__webpack_require__(184)); const Snippets = tslib_1.__importStar(__webpack_require__(231)); const parser_1 = __webpack_require__(231); const session_1 = __webpack_require__(232); -const variableResolve_1 = __webpack_require__(383); +const variableResolve_1 = __webpack_require__(389); const logger = __webpack_require__(183)('snippets-manager'); class SnippetManager { constructor() { @@ -55954,8 +55920,8 @@ const util_1 = __webpack_require__(171); const position_1 = __webpack_require__(210); const string_1 = __webpack_require__(207); const workspace_1 = tslib_1.__importDefault(__webpack_require__(184)); -const snippet_1 = __webpack_require__(382); -const variableResolve_1 = __webpack_require__(383); +const snippet_1 = __webpack_require__(388); +const variableResolve_1 = __webpack_require__(389); const logger = __webpack_require__(183)('snippets-session'); class SnippetSession { constructor(nvim, bufnr) { @@ -56266,8 +56232,8 @@ const sources_1 = tslib_1.__importDefault(__webpack_require__(234)); const util_1 = __webpack_require__(171); const string_1 = __webpack_require__(207); const workspace_1 = tslib_1.__importDefault(__webpack_require__(184)); -const complete_1 = tslib_1.__importDefault(__webpack_require__(379)); -const floating_1 = tslib_1.__importDefault(__webpack_require__(381)); +const complete_1 = tslib_1.__importDefault(__webpack_require__(385)); +const floating_1 = tslib_1.__importDefault(__webpack_require__(387)); const logger = __webpack_require__(183)('completion'); const completeItemKeys = ['abbr', 'menu', 'info', 'kind', 'icase', 'dup', 'empty', 'user_data']; class Completion { @@ -56867,8 +56833,8 @@ const util_1 = tslib_1.__importDefault(__webpack_require__(40)); const vscode_languageserver_protocol_1 = __webpack_require__(146); const events_1 = tslib_1.__importDefault(__webpack_require__(145)); const extensions_1 = tslib_1.__importDefault(__webpack_require__(235)); -const source_1 = tslib_1.__importDefault(__webpack_require__(374)); -const source_vim_1 = tslib_1.__importDefault(__webpack_require__(375)); +const source_1 = tslib_1.__importDefault(__webpack_require__(380)); +const source_vim_1 = tslib_1.__importDefault(__webpack_require__(381)); const types_1 = __webpack_require__(186); const util_2 = __webpack_require__(171); const fs_2 = __webpack_require__(197); @@ -56886,9 +56852,9 @@ class Sources { } async createNativeSources() { try { - this.disposables.push((__webpack_require__(376)).regist(this.sourceMap)); - this.disposables.push((__webpack_require__(377)).regist(this.sourceMap)); - this.disposables.push((__webpack_require__(378)).regist(this.sourceMap)); + this.disposables.push((__webpack_require__(382)).regist(this.sourceMap)); + this.disposables.push((__webpack_require__(383)).regist(this.sourceMap)); + this.disposables.push((__webpack_require__(384)).regist(this.sourceMap)); } catch (e) { console.error('Create source error:' + e.message); // tslint:disable-line @@ -66210,12 +66176,11 @@ function download(url, options) { protocol: url.startsWith('https') ? 'https:' : 'http:', agent, headers: { - 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64)', - 'Accept-Encoding': 'gzip' + 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64)' } }, options); return new Promise((resolve, reject) => { - const req = mod.request(opts, res => { + const req = mod.request(opts, (res) => { if (res.statusCode != 200) { reject(new Error(`Invalid response from ${url}: ${res.statusCode}`)); return; @@ -66230,9 +66195,9 @@ function download(url, options) { }); } } - res.pipe(tar_1.default.x({ strip: 1, C: dest })); - res.on('end', () => { - setTimeout(resolve, 50); + let stream = res.pipe(tar_1.default.x({ strip: 1, C: dest })); + stream.on('finish', () => { + setTimeout(resolve, 100); }); }); req.on('error', reject); @@ -80371,6 +80336,7 @@ const fs_1 = tslib_1.__importDefault(__webpack_require__(54)); const mkdirp_1 = tslib_1.__importDefault(__webpack_require__(182)); const path_1 = tslib_1.__importDefault(__webpack_require__(56)); const rimraf_1 = tslib_1.__importDefault(__webpack_require__(236)); +const mv_1 = tslib_1.__importDefault(__webpack_require__(374)); const semver_1 = tslib_1.__importDefault(__webpack_require__(1)); const util_1 = __webpack_require__(40); const util_2 = __webpack_require__(171); @@ -80443,7 +80409,7 @@ class ExtensionManager { let args = ['install', '--ignore-scripts', '--no-lockfile', '--no-bin-links', '--production']; const child = child_process_1.spawn(npm, args, { cwd: tmpFolder }); child.on('error', reject); - child.once('exit', resolve); + child.on('exit', resolve); }); await p; } @@ -80460,7 +80426,7 @@ class ExtensionManager { onMessage(`Moving to new folder.`); let folder = path_1.default.join(this.root, 'node_modules', info.name); await this.removeFolder(folder); - await util_1.promisify(fs_1.default.rename)(tmpFolder, folder); + await util_1.promisify(mv_1.default)(tmpFolder, folder, { mkdirp: true }); } async install(npm, def) { this.checkFolder(); @@ -80559,345 +80525,2531 @@ function safeRun(cmd, opts = {}, timeout) { /* 374 */ /***/ (function(module, exports, __webpack_require__) { -"use strict"; +var fs = __webpack_require__(54); +var ncp = __webpack_require__(375).ncp; +var path = __webpack_require__(56); +var rimraf = __webpack_require__(376); +var mkdirp = __webpack_require__(182); -Object.defineProperty(exports, "__esModule", { value: true }); -const tslib_1 = __webpack_require__(3); -const types_1 = __webpack_require__(186); -const string_1 = __webpack_require__(207); -const workspace_1 = tslib_1.__importDefault(__webpack_require__(184)); -const logger = __webpack_require__(183)('model-source'); -class Source { - constructor(option) { - this._disabled = false; - this.nvim = workspace_1.default.nvim; - // readonly properties - this.name = option.name; - this.filepath = option.filepath || ''; - this.sourceType = option.sourceType || types_1.SourceType.Native; - this.isSnippet = !!option.isSnippet; - this.defaults = option; - } - get priority() { - return this.getConfig('priority', 1); - } - get triggerOnly() { - let triggerOnly = this.defaults['triggerOnly']; - if (typeof triggerOnly == 'boolean') - return triggerOnly; - if (!this.triggerCharacters && !this.triggerPatterns) - return false; - return Array.isArray(this.triggerPatterns) && this.triggerPatterns.length != 0; - } - get triggerCharacters() { - return this.getConfig('triggerCharacters', null); - } - // exists opitonnal function names for remote source - get optionalFns() { - return this.defaults['optionalFns'] || []; - } - get triggerPatterns() { - let patterns = this.getConfig('triggerPatterns', null); - if (!patterns || patterns.length == 0) - return null; - return patterns.map(s => { - return (typeof s === 'string') ? new RegExp(s + '$') : s; - }); - } - get shortcut() { - let shortcut = this.getConfig('shortcut', ''); - return shortcut ? shortcut : this.name.slice(0, 3); - } - get enable() { - if (this._disabled) - return false; - return this.getConfig('enable', true); - } - get filetypes() { - return this.getConfig('filetypes', null); - } - get disableSyntaxes() { - return this.getConfig('disableSyntaxes', []); - } - getConfig(key, defaultValue) { - let config = workspace_1.default.getConfiguration(`coc.source.${this.name}`); - defaultValue = this.defaults.hasOwnProperty(key) ? this.defaults[key] : defaultValue; - return config.get(key, defaultValue); - } - toggle() { - this._disabled = !this._disabled; - } - get firstMatch() { - return this.getConfig('firstMatch', true); - } - get menu() { - let { shortcut } = this; - return shortcut ? `[${shortcut}]` : ''; - } - /** - * Filter words that too short or doesn't match input - */ - filterWords(words, opt) { - let { firstMatch } = this; - let res = []; - let { input } = opt; - let cword = opt.word; - if (!input.length) - return []; - let cFirst = input[0]; - for (let word of words) { - if (!word || word.length < 3) - continue; - if (firstMatch && cFirst != word[0]) - continue; - if (!firstMatch && cFirst.toLowerCase() != word[0].toLowerCase()) - continue; - if (word == cword || word == input) - continue; - res.push(word); - } - return res; - } - /** - * fix start column for new valid characters - * - * @protected - * @param {CompleteOption} opt - * @param {string[]} valids - valid charscters - * @returns {number} - */ - fixStartcol(opt, valids) { - let { col, input, line, bufnr } = opt; - let start = string_1.byteSlice(line, 0, col); - let document = workspace_1.default.getDocument(bufnr); - if (!document) - return col; - let { chars } = document; - for (let i = start.length - 1; i >= 0; i--) { - let c = start[i]; - if (!chars.isKeywordChar(c) && valids.indexOf(c) === -1) { - break; - } - input = `${c}${input}`; - col = col - 1; - } - opt.col = col; - opt.input = input; - return col; - } - async shouldComplete(opt) { - let { disableSyntaxes } = this; - let synname = opt.synname.toLowerCase(); - if (disableSyntaxes && disableSyntaxes.length && disableSyntaxes.findIndex(s => synname.indexOf(s.toLowerCase()) != -1) !== -1) { - return false; +module.exports = mv; + +function mv(source, dest, options, cb){ + if (typeof options === 'function') { + cb = options; + options = {}; + } + var shouldMkdirp = !!options.mkdirp; + var clobber = options.clobber !== false; + var limit = options.limit || 16; + + if (shouldMkdirp) { + mkdirs(); + } else { + doRename(); + } + + function mkdirs() { + mkdirp(path.dirname(dest), function(err) { + if (err) return cb(err); + doRename(); + }); + } + + function doRename() { + if (clobber) { + fs.rename(source, dest, function(err) { + if (!err) return cb(); + if (err.code !== 'EXDEV') return cb(err); + moveFileAcrossDevice(source, dest, clobber, limit, cb); + }); + } else { + fs.link(source, dest, function(err) { + if (err) { + if (err.code === 'EXDEV') { + moveFileAcrossDevice(source, dest, clobber, limit, cb); + return; + } + if (err.code === 'EISDIR' || err.code === 'EPERM') { + moveDirAcrossDevice(source, dest, clobber, limit, cb); + return; + } + cb(err); + return; } - let fn = this.defaults['shouldComplete']; - if (fn) - return await Promise.resolve(fn.call(this, opt)); - return true; - } - async refresh() { - let fn = this.defaults['refresh']; - if (fn) - await Promise.resolve(fn.call(this)); - } - async onCompleteDone(item, opt) { - let fn = this.defaults['onCompleteDone']; - if (fn) - await Promise.resolve(fn.call(this, item, opt)); + fs.unlink(source, cb); + }); } - async doComplete(opt, token) { - let fn = this.defaults['doComplete']; - if (fn) - return await Promise.resolve(fn.call(this, opt, token)); - return null; + } +} + +function moveFileAcrossDevice(source, dest, clobber, limit, cb) { + var outFlags = clobber ? 'w' : 'wx'; + var ins = fs.createReadStream(source); + var outs = fs.createWriteStream(dest, {flags: outFlags}); + ins.on('error', function(err){ + ins.destroy(); + outs.destroy(); + outs.removeListener('close', onClose); + if (err.code === 'EISDIR' || err.code === 'EPERM') { + moveDirAcrossDevice(source, dest, clobber, limit, cb); + } else { + cb(err); } + }); + outs.on('error', function(err){ + ins.destroy(); + outs.destroy(); + outs.removeListener('close', onClose); + cb(err); + }); + outs.once('close', onClose); + ins.pipe(outs); + function onClose(){ + fs.unlink(source, cb); + } +} + +function moveDirAcrossDevice(source, dest, clobber, limit, cb) { + var options = { + stopOnErr: true, + clobber: false, + limit: limit, + }; + if (clobber) { + rimraf(dest, { disableGlob: true }, function(err) { + if (err) return cb(err); + startNcp(); + }); + } else { + startNcp(); + } + function startNcp() { + ncp(source, dest, options, function(errList) { + if (errList) return cb(errList[0]); + rimraf(source, { disableGlob: true }, cb); + }); + } } -exports.default = Source; -//# sourceMappingURL=source.js.map + /***/ }), /* 375 */ /***/ (function(module, exports, __webpack_require__) { -"use strict"; +var fs = __webpack_require__(54), + path = __webpack_require__(56); -Object.defineProperty(exports, "__esModule", { value: true }); -const tslib_1 = __webpack_require__(3); -const fuzzy_1 = __webpack_require__(350); -const string_1 = __webpack_require__(207); -const workspace_1 = tslib_1.__importDefault(__webpack_require__(184)); -const source_1 = tslib_1.__importDefault(__webpack_require__(374)); -const logger = __webpack_require__(183)('model-source-vim'); -class VimSource extends source_1.default { - async callOptinalFunc(fname, args) { - let exists = this.optionalFns.indexOf(fname) !== -1; - if (!exists) - return null; - let name = `coc#source#${this.name}#${fname}`; - let res; - try { - res = await this.nvim.call(name, args); +module.exports = ncp; +ncp.ncp = ncp; + +function ncp (source, dest, options, callback) { + var cback = callback; + + if (!callback) { + cback = options; + options = {}; + } + + var basePath = process.cwd(), + currentPath = path.resolve(basePath, source), + targetPath = path.resolve(basePath, dest), + filter = options.filter, + rename = options.rename, + transform = options.transform, + clobber = options.clobber !== false, + modified = options.modified, + dereference = options.dereference, + errs = null, + started = 0, + finished = 0, + running = 0, + limit = options.limit || ncp.limit || 16; + + limit = (limit < 1) ? 1 : (limit > 512) ? 512 : limit; + + startCopy(currentPath); + + function startCopy(source) { + started++; + if (filter) { + if (filter instanceof RegExp) { + if (!filter.test(source)) { + return cb(true); } - catch (e) { - workspace_1.default.showMessage(`Vim error from source ${this.name}: ${e.message}`, 'error'); - return null; + } + else if (typeof filter === 'function') { + if (!filter(source)) { + return cb(true); } - return res; + } } - async shouldComplete(opt) { - let shouldRun = await super.shouldComplete(opt); - if (!shouldRun) - return false; - if (this.optionalFns.indexOf('should_complete') === -1) - return true; - let res = await this.callOptinalFunc('should_complete', [opt]); - return !!res; + return getStats(source); + } + + function getStats(source) { + var stat = dereference ? fs.stat : fs.lstat; + if (running >= limit) { + return setImmediate(function () { + getStats(source); + }); } - async refresh() { - await this.callOptinalFunc('refresh', []); + running++; + stat(source, function (err, stats) { + var item = {}; + if (err) { + return onError(err); + } + + // We need to get the mode from the stats object and preserve it. + item.name = source; + item.mode = stats.mode; + item.mtime = stats.mtime; //modified time + item.atime = stats.atime; //access time + + if (stats.isDirectory()) { + return onDir(item); + } + else if (stats.isFile()) { + return onFile(item); + } + else if (stats.isSymbolicLink()) { + // Symlinks don't really need to know about the mode. + return onLink(source); + } + }); + } + + function onFile(file) { + var target = file.name.replace(currentPath, targetPath); + if(rename) { + target = rename(target); } - async onCompleteDone(item, opt) { - await super.onCompleteDone(item, opt); - if (this.optionalFns.indexOf('on_complete') === -1) - return; - this.callOptinalFunc('on_complete', [item]); // tslint:disable-line + isWritable(target, function (writable) { + if (writable) { + return copyFile(file, target); + } + if(clobber) { + rmFile(target, function () { + copyFile(file, target); + }); + } + if (modified) { + var stat = dereference ? fs.stat : fs.lstat; + stat(target, function(err, stats) { + //if souce modified time greater to target modified time copy file + if (file.mtime.getTime()>stats.mtime.getTime()) + copyFile(file, target); + else return cb(); + }); + } + else { + return cb(); + } + }); + } + + function copyFile(file, target) { + var readStream = fs.createReadStream(file.name), + writeStream = fs.createWriteStream(target, { mode: file.mode }); + + readStream.on('error', onError); + writeStream.on('error', onError); + + if(transform) { + transform(readStream, writeStream, file); + } else { + writeStream.on('open', function() { + readStream.pipe(writeStream); + }); } - onEnter(bufnr) { - if (this.optionalFns.indexOf('on_enter') === -1) - return; - let doc = workspace_1.default.getDocument(bufnr); - if (!doc) - return; - let { filetypes } = this; - if (filetypes && filetypes.indexOf(doc.filetype) == -1) - return; - this.callOptinalFunc('on_enter', [{ - bufnr, - uri: doc.uri, - languageId: doc.filetype - }]); // tslint:disable-line + writeStream.once('finish', function() { + if (modified) { + //target file modified date sync. + fs.utimesSync(target, file.atime, file.mtime); + cb(); + } + else cb(); + }); + } + + function rmFile(file, done) { + fs.unlink(file, function (err) { + if (err) { + return onError(err); + } + return done(); + }); + } + + function onDir(dir) { + var target = dir.name.replace(currentPath, targetPath); + isWritable(target, function (writable) { + if (writable) { + return mkDir(dir, target); + } + copyDir(dir.name); + }); + } + + function mkDir(dir, target) { + fs.mkdir(target, dir.mode, function (err) { + if (err) { + return onError(err); + } + copyDir(dir.name); + }); + } + + function copyDir(dir) { + fs.readdir(dir, function (err, items) { + if (err) { + return onError(err); + } + items.forEach(function (item) { + startCopy(path.join(dir, item)); + }); + return cb(); + }); + } + + function onLink(link) { + var target = link.replace(currentPath, targetPath); + fs.readlink(link, function (err, resolvedPath) { + if (err) { + return onError(err); + } + checkLink(resolvedPath, target); + }); + } + + function checkLink(resolvedPath, target) { + if (dereference) { + resolvedPath = path.resolve(basePath, resolvedPath); } - async doComplete(opt, token) { - let { col, input, line, colnr } = opt; - let startcol = await this.callOptinalFunc('get_startcol', [opt]); - if (token.isCancellationRequested) - return; - if (startcol) { - if (startcol < 0) - return null; - startcol = Number(startcol); - // invalid startcol - if (isNaN(startcol) || startcol < 0) - startcol = col; - if (startcol !== col) { - input = string_1.byteSlice(line, startcol, colnr - 1); - opt = Object.assign({}, opt, { - col: startcol, - changed: col - startcol, - input - }); - } + isWritable(target, function (writable) { + if (writable) { + return makeLink(resolvedPath, target); + } + fs.readlink(target, function (err, targetDest) { + if (err) { + return onError(err); } - let items = await this.nvim.callAsync('coc#util#do_complete', [this.name, opt]); - if (!items || items.length == 0 || token.isCancellationRequested) - return null; - if (this.firstMatch && input.length) { - let ch = input[0]; - items = items.filter(item => { - let cfirst = item.filterText ? item.filterText[0] : item.word[0]; - return fuzzy_1.fuzzyChar(ch, cfirst); - }); + if (dereference) { + targetDest = path.resolve(basePath, targetDest); } - for (let item of items) { - let menu = item.menu ? item.menu + ' ' : ''; - item.menu = `${menu}${this.menu}`; - item.isSnippet = this.isSnippet; - delete item.user_data; + if (targetDest === resolvedPath) { + return cb(); } - let res = { items }; - res.startcol = startcol; - return res; + return rmFile(target, function () { + makeLink(resolvedPath, target); + }); + }); + }); + } + + function makeLink(linkPath, target) { + fs.symlink(linkPath, target, function (err) { + if (err) { + return onError(err); + } + return cb(); + }); + } + + function isWritable(path, done) { + fs.lstat(path, function (err) { + if (err) { + if (err.code === 'ENOENT') return done(true); + return done(false); + } + return done(false); + }); + } + + function onError(err) { + if (options.stopOnError) { + return cback(err); + } + else if (!errs && options.errs) { + errs = fs.createWriteStream(options.errs); + } + else if (!errs) { + errs = []; } + if (typeof errs.write === 'undefined') { + errs.push(err); + } + else { + errs.write(err.stack + '\n\n'); + } + return cb(); + } + + function cb(skipped) { + if (!skipped) running--; + finished++; + if ((started === finished) && (running === 0)) { + if (cback !== undefined ) { + return errs ? cback(errs) : cback(null); + } + } + } } -exports.default = VimSource; -//# sourceMappingURL=source-vim.js.map + + + /***/ }), /* 376 */ /***/ (function(module, exports, __webpack_require__) { -"use strict"; +module.exports = rimraf +rimraf.sync = rimrafSync -Object.defineProperty(exports, "__esModule", { value: true }); -const tslib_1 = __webpack_require__(3); -const vscode_languageserver_protocol_1 = __webpack_require__(146); -const source_1 = tslib_1.__importDefault(__webpack_require__(374)); -const workspace_1 = tslib_1.__importDefault(__webpack_require__(184)); -const logger = __webpack_require__(183)('source-around'); -class Around extends source_1.default { - constructor() { - super({ - name: 'around', - filepath: __filename - }); - } - async doComplete(opt) { - let { bufnr, input } = opt; - if (input.length === 0) - return null; - let document = workspace_1.default.getDocument(bufnr); - if (!document) - return null; - let words = document.words; - let moreWords = document.getMoreWords(); - words.push(...moreWords); - words = this.filterWords(words, opt); - return { - items: words.map(word => { - return { - word, - menu: this.menu - }; - }) - }; - } -} -exports.default = Around; -function regist(sourceMap) { - sourceMap.set('around', new Around()); - return vscode_languageserver_protocol_1.Disposable.create(() => { - sourceMap.delete('around'); - }); +var assert = __webpack_require__(107) +var path = __webpack_require__(56) +var fs = __webpack_require__(54) +var glob = __webpack_require__(377) + +var globOpts = { + nosort: true, + nocomment: true, + nonegate: true, + silent: true } -exports.regist = regist; -//# sourceMappingURL=around.js.map -/***/ }), -/* 377 */ -/***/ (function(module, exports, __webpack_require__) { +// for EMFILE handling +var timeout = 0 -"use strict"; +var isWindows = (process.platform === "win32") -Object.defineProperty(exports, "__esModule", { value: true }); -const tslib_1 = __webpack_require__(3); -const vscode_languageserver_protocol_1 = __webpack_require__(146); -const source_1 = tslib_1.__importDefault(__webpack_require__(374)); -const workspace_1 = tslib_1.__importDefault(__webpack_require__(184)); -const logger = __webpack_require__(183)('source-buffer'); -class Buffer extends source_1.default { - constructor() { - super({ - name: 'buffer', - filepath: __filename - }); - } - get ignoreGitignore() { - return this.getConfig('ignoreGitignore', true); - } - getWords(bufnr) { - let { ignoreGitignore } = this; - let words = []; +function defaults (options) { + var methods = [ + 'unlink', + 'chmod', + 'stat', + 'lstat', + 'rmdir', + 'readdir' + ] + methods.forEach(function(m) { + options[m] = options[m] || fs[m] + m = m + 'Sync' + options[m] = options[m] || fs[m] + }) + + options.maxBusyTries = options.maxBusyTries || 3 + options.emfileWait = options.emfileWait || 1000 + options.disableGlob = options.disableGlob || false +} + +function rimraf (p, options, cb) { + if (typeof options === 'function') { + cb = options + options = {} + } + + assert(p, 'rimraf: missing path') + assert.equal(typeof p, 'string', 'rimraf: path should be a string') + assert(options, 'rimraf: missing options') + assert.equal(typeof options, 'object', 'rimraf: options should be object') + assert.equal(typeof cb, 'function', 'rimraf: callback function required') + + defaults(options) + + var busyTries = 0 + var errState = null + var n = 0 + + if (options.disableGlob || !glob.hasMagic(p)) + return afterGlob(null, [p]) + + fs.lstat(p, function (er, stat) { + if (!er) + return afterGlob(null, [p]) + + glob(p, globOpts, afterGlob) + }) + + function next (er) { + errState = errState || er + if (--n === 0) + cb(errState) + } + + function afterGlob (er, results) { + if (er) + return cb(er) + + n = results.length + if (n === 0) + return cb() + + results.forEach(function (p) { + rimraf_(p, options, function CB (er) { + if (er) { + if (isWindows && (er.code === "EBUSY" || er.code === "ENOTEMPTY" || er.code === "EPERM") && + busyTries < options.maxBusyTries) { + busyTries ++ + var time = busyTries * 100 + // try again, with the same exact callback as this one. + return setTimeout(function () { + rimraf_(p, options, CB) + }, time) + } + + // this one won't happen if graceful-fs is used. + if (er.code === "EMFILE" && timeout < options.emfileWait) { + return setTimeout(function () { + rimraf_(p, options, CB) + }, timeout ++) + } + + // already gone + if (er.code === "ENOENT") er = null + } + + timeout = 0 + next(er) + }) + }) + } +} + +// Two possible strategies. +// 1. Assume it's a file. unlink it, then do the dir stuff on EPERM or EISDIR +// 2. Assume it's a directory. readdir, then do the file stuff on ENOTDIR +// +// Both result in an extra syscall when you guess wrong. However, there +// are likely far more normal files in the world than directories. This +// is based on the assumption that a the average number of files per +// directory is >= 1. +// +// If anyone ever complains about this, then I guess the strategy could +// be made configurable somehow. But until then, YAGNI. +function rimraf_ (p, options, cb) { + assert(p) + assert(options) + assert(typeof cb === 'function') + + // sunos lets the root user unlink directories, which is... weird. + // so we have to lstat here and make sure it's not a dir. + options.lstat(p, function (er, st) { + if (er && er.code === "ENOENT") + return cb(null) + + if (st && st.isDirectory()) + return rmdir(p, options, er, cb) + + options.unlink(p, function (er) { + if (er) { + if (er.code === "ENOENT") + return cb(null) + if (er.code === "EPERM") + return (isWindows) + ? fixWinEPERM(p, options, er, cb) + : rmdir(p, options, er, cb) + if (er.code === "EISDIR") + return rmdir(p, options, er, cb) + } + return cb(er) + }) + }) +} + +function fixWinEPERM (p, options, er, cb) { + assert(p) + assert(options) + assert(typeof cb === 'function') + if (er) + assert(er instanceof Error) + + options.chmod(p, 666, function (er2) { + if (er2) + cb(er2.code === "ENOENT" ? null : er) + else + options.stat(p, function(er3, stats) { + if (er3) + cb(er3.code === "ENOENT" ? null : er) + else if (stats.isDirectory()) + rmdir(p, options, er, cb) + else + options.unlink(p, cb) + }) + }) +} + +function fixWinEPERMSync (p, options, er) { + assert(p) + assert(options) + if (er) + assert(er instanceof Error) + + try { + options.chmodSync(p, 666) + } catch (er2) { + if (er2.code === "ENOENT") + return + else + throw er + } + + try { + var stats = options.statSync(p) + } catch (er3) { + if (er3.code === "ENOENT") + return + else + throw er + } + + if (stats.isDirectory()) + rmdirSync(p, options, er) + else + options.unlinkSync(p) +} + +function rmdir (p, options, originalEr, cb) { + assert(p) + assert(options) + if (originalEr) + assert(originalEr instanceof Error) + assert(typeof cb === 'function') + + // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS) + // if we guessed wrong, and it's not a directory, then + // raise the original error. + options.rmdir(p, function (er) { + if (er && (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM")) + rmkids(p, options, cb) + else if (er && er.code === "ENOTDIR") + cb(originalEr) + else + cb(er) + }) +} + +function rmkids(p, options, cb) { + assert(p) + assert(options) + assert(typeof cb === 'function') + + options.readdir(p, function (er, files) { + if (er) + return cb(er) + var n = files.length + if (n === 0) + return options.rmdir(p, cb) + var errState + files.forEach(function (f) { + rimraf(path.join(p, f), options, function (er) { + if (errState) + return + if (er) + return cb(errState = er) + if (--n === 0) + options.rmdir(p, cb) + }) + }) + }) +} + +// this looks simpler, and is strictly *faster*, but will +// tie up the JavaScript thread and fail on excessively +// deep directory trees. +function rimrafSync (p, options) { + options = options || {} + defaults(options) + + assert(p, 'rimraf: missing path') + assert.equal(typeof p, 'string', 'rimraf: path should be a string') + assert(options, 'rimraf: missing options') + assert.equal(typeof options, 'object', 'rimraf: options should be object') + + var results + + if (options.disableGlob || !glob.hasMagic(p)) { + results = [p] + } else { + try { + fs.lstatSync(p) + results = [p] + } catch (er) { + results = glob.sync(p, globOpts) + } + } + + if (!results.length) + return + + for (var i = 0; i < results.length; i++) { + var p = results[i] + + try { + var st = options.lstatSync(p) + } catch (er) { + if (er.code === "ENOENT") + return + } + + try { + // sunos lets the root user unlink directories, which is... weird. + if (st && st.isDirectory()) + rmdirSync(p, options, null) + else + options.unlinkSync(p) + } catch (er) { + if (er.code === "ENOENT") + return + if (er.code === "EPERM") + return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er) + if (er.code !== "EISDIR") + throw er + rmdirSync(p, options, er) + } + } +} + +function rmdirSync (p, options, originalEr) { + assert(p) + assert(options) + if (originalEr) + assert(originalEr instanceof Error) + + try { + options.rmdirSync(p) + } catch (er) { + if (er.code === "ENOENT") + return + if (er.code === "ENOTDIR") + throw originalEr + if (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM") + rmkidsSync(p, options) + } +} + +function rmkidsSync (p, options) { + assert(p) + assert(options) + options.readdirSync(p).forEach(function (f) { + rimrafSync(path.join(p, f), options) + }) + options.rmdirSync(p, options) +} + + +/***/ }), +/* 377 */ +/***/ (function(module, exports, __webpack_require__) { + +// Approach: +// +// 1. Get the minimatch set +// 2. For each pattern in the set, PROCESS(pattern, false) +// 3. Store matches per-set, then uniq them +// +// PROCESS(pattern, inGlobStar) +// Get the first [n] items from pattern that are all strings +// Join these together. This is PREFIX. +// If there is no more remaining, then stat(PREFIX) and +// add to matches if it succeeds. END. +// +// If inGlobStar and PREFIX is symlink and points to dir +// set ENTRIES = [] +// else readdir(PREFIX) as ENTRIES +// If fail, END +// +// with ENTRIES +// If pattern[n] is GLOBSTAR +// // handle the case where the globstar match is empty +// // by pruning it out, and testing the resulting pattern +// PROCESS(pattern[0..n] + pattern[n+1 .. $], false) +// // handle other cases. +// for ENTRY in ENTRIES (not dotfiles) +// // attach globstar + tail onto the entry +// // Mark that this entry is a globstar match +// PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true) +// +// else // not globstar +// for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot) +// Test ENTRY against pattern[n] +// If fails, continue +// If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $]) +// +// Caveat: +// Cache all stats and readdirs results to minimize syscall. Since all +// we ever care about is existence and directory-ness, we can just keep +// `true` for files, and [children,...] for directories, or `false` for +// things that don't exist. + +module.exports = glob + +var fs = __webpack_require__(54) +var minimatch = __webpack_require__(198) +var Minimatch = minimatch.Minimatch +var inherits = __webpack_require__(240) +var EE = __webpack_require__(49).EventEmitter +var path = __webpack_require__(56) +var assert = __webpack_require__(107) +var isAbsolute = __webpack_require__(242) +var globSync = __webpack_require__(378) +var common = __webpack_require__(379) +var alphasort = common.alphasort +var alphasorti = common.alphasorti +var setopts = common.setopts +var ownProp = common.ownProp +var inflight = __webpack_require__(245) +var util = __webpack_require__(40) +var childrenIgnored = common.childrenIgnored +var isIgnored = common.isIgnored + +var once = __webpack_require__(247) + +function glob (pattern, options, cb) { + if (typeof options === 'function') cb = options, options = {} + if (!options) options = {} + + if (options.sync) { + if (cb) + throw new TypeError('callback provided to sync glob') + return globSync(pattern, options) + } + + return new Glob(pattern, options, cb) +} + +glob.sync = globSync +var GlobSync = glob.GlobSync = globSync.GlobSync + +// old api surface +glob.glob = glob + +function extend (origin, add) { + if (add === null || typeof add !== 'object') { + return origin + } + + var keys = Object.keys(add) + var i = keys.length + while (i--) { + origin[keys[i]] = add[keys[i]] + } + return origin +} + +glob.hasMagic = function (pattern, options_) { + var options = extend({}, options_) + options.noprocess = true + + var g = new Glob(pattern, options) + var set = g.minimatch.set + if (set.length > 1) + return true + + for (var j = 0; j < set[0].length; j++) { + if (typeof set[0][j] !== 'string') + return true + } + + return false +} + +glob.Glob = Glob +inherits(Glob, EE) +function Glob (pattern, options, cb) { + if (typeof options === 'function') { + cb = options + options = null + } + + if (options && options.sync) { + if (cb) + throw new TypeError('callback provided to sync glob') + return new GlobSync(pattern, options) + } + + if (!(this instanceof Glob)) + return new Glob(pattern, options, cb) + + setopts(this, pattern, options) + this._didRealPath = false + + // process each pattern in the minimatch set + var n = this.minimatch.set.length + + // The matches are stored as {: true,...} so that + // duplicates are automagically pruned. + // Later, we do an Object.keys() on these. + // Keep them as a list so we can fill in when nonull is set. + this.matches = new Array(n) + + if (typeof cb === 'function') { + cb = once(cb) + this.on('error', cb) + this.on('end', function (matches) { + cb(null, matches) + }) + } + + var self = this + var n = this.minimatch.set.length + this._processing = 0 + this.matches = new Array(n) + + this._emitQueue = [] + this._processQueue = [] + this.paused = false + + if (this.noprocess) + return this + + if (n === 0) + return done() + + for (var i = 0; i < n; i ++) { + this._process(this.minimatch.set[i], i, false, done) + } + + function done () { + --self._processing + if (self._processing <= 0) + self._finish() + } +} + +Glob.prototype._finish = function () { + assert(this instanceof Glob) + if (this.aborted) + return + + if (this.realpath && !this._didRealpath) + return this._realpath() + + common.finish(this) + this.emit('end', this.found) +} + +Glob.prototype._realpath = function () { + if (this._didRealpath) + return + + this._didRealpath = true + + var n = this.matches.length + if (n === 0) + return this._finish() + + var self = this + for (var i = 0; i < this.matches.length; i++) + this._realpathSet(i, next) + + function next () { + if (--n === 0) + self._finish() + } +} + +Glob.prototype._realpathSet = function (index, cb) { + var matchset = this.matches[index] + if (!matchset) + return cb() + + var found = Object.keys(matchset) + var self = this + var n = found.length + + if (n === 0) + return cb() + + var set = this.matches[index] = Object.create(null) + found.forEach(function (p, i) { + // If there's a problem with the stat, then it means that + // one or more of the links in the realpath couldn't be + // resolved. just return the abs value in that case. + p = self._makeAbs(p) + fs.realpath(p, self.realpathCache, function (er, real) { + if (!er) + set[real] = true + else if (er.syscall === 'stat') + set[p] = true + else + self.emit('error', er) // srsly wtf right here + + if (--n === 0) { + self.matches[index] = set + cb() + } + }) + }) +} + +Glob.prototype._mark = function (p) { + return common.mark(this, p) +} + +Glob.prototype._makeAbs = function (f) { + return common.makeAbs(this, f) +} + +Glob.prototype.abort = function () { + this.aborted = true + this.emit('abort') +} + +Glob.prototype.pause = function () { + if (!this.paused) { + this.paused = true + this.emit('pause') + } +} + +Glob.prototype.resume = function () { + if (this.paused) { + this.emit('resume') + this.paused = false + if (this._emitQueue.length) { + var eq = this._emitQueue.slice(0) + this._emitQueue.length = 0 + for (var i = 0; i < eq.length; i ++) { + var e = eq[i] + this._emitMatch(e[0], e[1]) + } + } + if (this._processQueue.length) { + var pq = this._processQueue.slice(0) + this._processQueue.length = 0 + for (var i = 0; i < pq.length; i ++) { + var p = pq[i] + this._processing-- + this._process(p[0], p[1], p[2], p[3]) + } + } + } +} + +Glob.prototype._process = function (pattern, index, inGlobStar, cb) { + assert(this instanceof Glob) + assert(typeof cb === 'function') + + if (this.aborted) + return + + this._processing++ + if (this.paused) { + this._processQueue.push([pattern, index, inGlobStar, cb]) + return + } + + //console.error('PROCESS %d', this._processing, pattern) + + // Get the first [n] parts of pattern that are all strings. + var n = 0 + while (typeof pattern[n] === 'string') { + n ++ + } + // now n is the index of the first one that is *not* a string. + + // see if there's anything else + var prefix + switch (n) { + // if not, then this is rather simple + case pattern.length: + this._processSimple(pattern.join('/'), index, cb) + return + + case 0: + // pattern *starts* with some non-trivial item. + // going to readdir(cwd), but not include the prefix in matches. + prefix = null + break + + default: + // pattern has some string bits in the front. + // whatever it starts with, whether that's 'absolute' like /foo/bar, + // or 'relative' like '../baz' + prefix = pattern.slice(0, n).join('/') + break + } + + var remain = pattern.slice(n) + + // get the list of entries. + var read + if (prefix === null) + read = '.' + else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { + if (!prefix || !isAbsolute(prefix)) + prefix = '/' + prefix + read = prefix + } else + read = prefix + + var abs = this._makeAbs(read) + + //if ignored, skip _processing + if (childrenIgnored(this, read)) + return cb() + + var isGlobStar = remain[0] === minimatch.GLOBSTAR + if (isGlobStar) + this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb) + else + this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb) +} + +Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) { + var self = this + this._readdir(abs, inGlobStar, function (er, entries) { + return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb) + }) +} + +Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { + + // if the abs isn't a dir, then nothing can match! + if (!entries) + return cb() + + // It will only match dot entries if it starts with a dot, or if + // dot is set. Stuff like @(.foo|.bar) isn't allowed. + var pn = remain[0] + var negate = !!this.minimatch.negate + var rawGlob = pn._glob + var dotOk = this.dot || rawGlob.charAt(0) === '.' + + var matchedEntries = [] + for (var i = 0; i < entries.length; i++) { + var e = entries[i] + if (e.charAt(0) !== '.' || dotOk) { + var m + if (negate && !prefix) { + m = !e.match(pn) + } else { + m = e.match(pn) + } + if (m) + matchedEntries.push(e) + } + } + + //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries) + + var len = matchedEntries.length + // If there are no matched entries, then nothing matches. + if (len === 0) + return cb() + + // if this is the last remaining pattern bit, then no need for + // an additional stat *unless* the user has specified mark or + // stat explicitly. We know they exist, since readdir returned + // them. + + if (remain.length === 1 && !this.mark && !this.stat) { + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + if (prefix) { + if (prefix !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + + if (e.charAt(0) === '/' && !this.nomount) { + e = path.join(this.root, e) + } + this._emitMatch(index, e) + } + // This was the last one, and no stats were needed + return cb() + } + + // now test all matched entries as stand-ins for that part + // of the pattern. + remain.shift() + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + var newPattern + if (prefix) { + if (prefix !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + this._process([e].concat(remain), index, inGlobStar, cb) + } + cb() +} + +Glob.prototype._emitMatch = function (index, e) { + if (this.aborted) + return + + if (this.matches[index][e]) + return + + if (isIgnored(this, e)) + return + + if (this.paused) { + this._emitQueue.push([index, e]) + return + } + + var abs = this._makeAbs(e) + + if (this.nodir) { + var c = this.cache[abs] + if (c === 'DIR' || Array.isArray(c)) + return + } + + if (this.mark) + e = this._mark(e) + + this.matches[index][e] = true + + var st = this.statCache[abs] + if (st) + this.emit('stat', e, st) + + this.emit('match', e) +} + +Glob.prototype._readdirInGlobStar = function (abs, cb) { + if (this.aborted) + return + + // follow all symlinked directories forever + // just proceed as if this is a non-globstar situation + if (this.follow) + return this._readdir(abs, false, cb) + + var lstatkey = 'lstat\0' + abs + var self = this + var lstatcb = inflight(lstatkey, lstatcb_) + + if (lstatcb) + fs.lstat(abs, lstatcb) + + function lstatcb_ (er, lstat) { + if (er) + return cb() + + var isSym = lstat.isSymbolicLink() + self.symlinks[abs] = isSym + + // If it's not a symlink or a dir, then it's definitely a regular file. + // don't bother doing a readdir in that case. + if (!isSym && !lstat.isDirectory()) { + self.cache[abs] = 'FILE' + cb() + } else + self._readdir(abs, false, cb) + } +} + +Glob.prototype._readdir = function (abs, inGlobStar, cb) { + if (this.aborted) + return + + cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb) + if (!cb) + return + + //console.error('RD %j %j', +inGlobStar, abs) + if (inGlobStar && !ownProp(this.symlinks, abs)) + return this._readdirInGlobStar(abs, cb) + + if (ownProp(this.cache, abs)) { + var c = this.cache[abs] + if (!c || c === 'FILE') + return cb() + + if (Array.isArray(c)) + return cb(null, c) + } + + var self = this + fs.readdir(abs, readdirCb(this, abs, cb)) +} + +function readdirCb (self, abs, cb) { + return function (er, entries) { + if (er) + self._readdirError(abs, er, cb) + else + self._readdirEntries(abs, entries, cb) + } +} + +Glob.prototype._readdirEntries = function (abs, entries, cb) { + if (this.aborted) + return + + // if we haven't asked to stat everything, then just + // assume that everything in there exists, so we can avoid + // having to stat it a second time. + if (!this.mark && !this.stat) { + for (var i = 0; i < entries.length; i ++) { + var e = entries[i] + if (abs === '/') + e = abs + e + else + e = abs + '/' + e + this.cache[e] = true + } + } + + this.cache[abs] = entries + return cb(null, entries) +} + +Glob.prototype._readdirError = function (f, er, cb) { + if (this.aborted) + return + + // handle errors, and cache the information + switch (er.code) { + case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 + case 'ENOTDIR': // totally normal. means it *does* exist. + this.cache[this._makeAbs(f)] = 'FILE' + break + + case 'ENOENT': // not terribly unusual + case 'ELOOP': + case 'ENAMETOOLONG': + case 'UNKNOWN': + this.cache[this._makeAbs(f)] = false + break + + default: // some unusual error. Treat as failure. + this.cache[this._makeAbs(f)] = false + if (this.strict) { + this.emit('error', er) + // If the error is handled, then we abort + // if not, we threw out of here + this.abort() + } + if (!this.silent) + console.error('glob error', er) + break + } + + return cb() +} + +Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) { + var self = this + this._readdir(abs, inGlobStar, function (er, entries) { + self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb) + }) +} + + +Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { + //console.error('pgs2', prefix, remain[0], entries) + + // no entries means not a dir, so it can never have matches + // foo.txt/** doesn't match foo.txt + if (!entries) + return cb() + + // test without the globstar, and with every child both below + // and replacing the globstar. + var remainWithoutGlobStar = remain.slice(1) + var gspref = prefix ? [ prefix ] : [] + var noGlobStar = gspref.concat(remainWithoutGlobStar) + + // the noGlobStar pattern exits the inGlobStar state + this._process(noGlobStar, index, false, cb) + + var isSym = this.symlinks[abs] + var len = entries.length + + // If it's a symlink, and we're in a globstar, then stop + if (isSym && inGlobStar) + return cb() + + for (var i = 0; i < len; i++) { + var e = entries[i] + if (e.charAt(0) === '.' && !this.dot) + continue + + // these two cases enter the inGlobStar state + var instead = gspref.concat(entries[i], remainWithoutGlobStar) + this._process(instead, index, true, cb) + + var below = gspref.concat(entries[i], remain) + this._process(below, index, true, cb) + } + + cb() +} + +Glob.prototype._processSimple = function (prefix, index, cb) { + // XXX review this. Shouldn't it be doing the mounting etc + // before doing stat? kinda weird? + var self = this + this._stat(prefix, function (er, exists) { + self._processSimple2(prefix, index, er, exists, cb) + }) +} +Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) { + + //console.error('ps2', prefix, exists) + + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + // If it doesn't exist, then just mark the lack of results + if (!exists) + return cb() + + if (prefix && isAbsolute(prefix) && !this.nomount) { + var trail = /[\/\\]$/.test(prefix) + if (prefix.charAt(0) === '/') { + prefix = path.join(this.root, prefix) + } else { + prefix = path.resolve(this.root, prefix) + if (trail) + prefix += '/' + } + } + + if (process.platform === 'win32') + prefix = prefix.replace(/\\/g, '/') + + // Mark this as a match + this._emitMatch(index, prefix) + cb() +} + +// Returns either 'DIR', 'FILE', or false +Glob.prototype._stat = function (f, cb) { + var abs = this._makeAbs(f) + var needDir = f.slice(-1) === '/' + + if (f.length > this.maxLength) + return cb() + + if (!this.stat && ownProp(this.cache, abs)) { + var c = this.cache[abs] + + if (Array.isArray(c)) + c = 'DIR' + + // It exists, but maybe not how we need it + if (!needDir || c === 'DIR') + return cb(null, c) + + if (needDir && c === 'FILE') + return cb() + + // otherwise we have to stat, because maybe c=true + // if we know it exists, but not what it is. + } + + var exists + var stat = this.statCache[abs] + if (stat !== undefined) { + if (stat === false) + return cb(null, stat) + else { + var type = stat.isDirectory() ? 'DIR' : 'FILE' + if (needDir && type === 'FILE') + return cb() + else + return cb(null, type, stat) + } + } + + var self = this + var statcb = inflight('stat\0' + abs, lstatcb_) + if (statcb) + fs.lstat(abs, statcb) + + function lstatcb_ (er, lstat) { + if (lstat && lstat.isSymbolicLink()) { + // If it's a symlink, then treat it as the target, unless + // the target does not exist, then treat it as a file. + return fs.stat(abs, function (er, stat) { + if (er) + self._stat2(f, abs, null, lstat, cb) + else + self._stat2(f, abs, er, stat, cb) + }) + } else { + self._stat2(f, abs, er, lstat, cb) + } + } +} + +Glob.prototype._stat2 = function (f, abs, er, stat, cb) { + if (er) { + this.statCache[abs] = false + return cb() + } + + var needDir = f.slice(-1) === '/' + this.statCache[abs] = stat + + if (abs.slice(-1) === '/' && !stat.isDirectory()) + return cb(null, false, stat) + + var c = stat.isDirectory() ? 'DIR' : 'FILE' + this.cache[abs] = this.cache[abs] || c + + if (needDir && c !== 'DIR') + return cb() + + return cb(null, c, stat) +} + + +/***/ }), +/* 378 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = globSync +globSync.GlobSync = GlobSync + +var fs = __webpack_require__(54) +var minimatch = __webpack_require__(198) +var Minimatch = minimatch.Minimatch +var Glob = __webpack_require__(377).Glob +var util = __webpack_require__(40) +var path = __webpack_require__(56) +var assert = __webpack_require__(107) +var isAbsolute = __webpack_require__(242) +var common = __webpack_require__(379) +var alphasort = common.alphasort +var alphasorti = common.alphasorti +var setopts = common.setopts +var ownProp = common.ownProp +var childrenIgnored = common.childrenIgnored + +function globSync (pattern, options) { + if (typeof options === 'function' || arguments.length === 3) + throw new TypeError('callback provided to sync glob\n'+ + 'See: https://github.com/isaacs/node-glob/issues/167') + + return new GlobSync(pattern, options).found +} + +function GlobSync (pattern, options) { + if (!pattern) + throw new Error('must provide pattern') + + if (typeof options === 'function' || arguments.length === 3) + throw new TypeError('callback provided to sync glob\n'+ + 'See: https://github.com/isaacs/node-glob/issues/167') + + if (!(this instanceof GlobSync)) + return new GlobSync(pattern, options) + + setopts(this, pattern, options) + + if (this.noprocess) + return this + + var n = this.minimatch.set.length + this.matches = new Array(n) + for (var i = 0; i < n; i ++) { + this._process(this.minimatch.set[i], i, false) + } + this._finish() +} + +GlobSync.prototype._finish = function () { + assert(this instanceof GlobSync) + if (this.realpath) { + var self = this + this.matches.forEach(function (matchset, index) { + var set = self.matches[index] = Object.create(null) + for (var p in matchset) { + try { + p = self._makeAbs(p) + var real = fs.realpathSync(p, self.realpathCache) + set[real] = true + } catch (er) { + if (er.syscall === 'stat') + set[self._makeAbs(p)] = true + else + throw er + } + } + }) + } + common.finish(this) +} + + +GlobSync.prototype._process = function (pattern, index, inGlobStar) { + assert(this instanceof GlobSync) + + // Get the first [n] parts of pattern that are all strings. + var n = 0 + while (typeof pattern[n] === 'string') { + n ++ + } + // now n is the index of the first one that is *not* a string. + + // See if there's anything else + var prefix + switch (n) { + // if not, then this is rather simple + case pattern.length: + this._processSimple(pattern.join('/'), index) + return + + case 0: + // pattern *starts* with some non-trivial item. + // going to readdir(cwd), but not include the prefix in matches. + prefix = null + break + + default: + // pattern has some string bits in the front. + // whatever it starts with, whether that's 'absolute' like /foo/bar, + // or 'relative' like '../baz' + prefix = pattern.slice(0, n).join('/') + break + } + + var remain = pattern.slice(n) + + // get the list of entries. + var read + if (prefix === null) + read = '.' + else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { + if (!prefix || !isAbsolute(prefix)) + prefix = '/' + prefix + read = prefix + } else + read = prefix + + var abs = this._makeAbs(read) + + //if ignored, skip processing + if (childrenIgnored(this, read)) + return + + var isGlobStar = remain[0] === minimatch.GLOBSTAR + if (isGlobStar) + this._processGlobStar(prefix, read, abs, remain, index, inGlobStar) + else + this._processReaddir(prefix, read, abs, remain, index, inGlobStar) +} + + +GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) { + var entries = this._readdir(abs, inGlobStar) + + // if the abs isn't a dir, then nothing can match! + if (!entries) + return + + // It will only match dot entries if it starts with a dot, or if + // dot is set. Stuff like @(.foo|.bar) isn't allowed. + var pn = remain[0] + var negate = !!this.minimatch.negate + var rawGlob = pn._glob + var dotOk = this.dot || rawGlob.charAt(0) === '.' + + var matchedEntries = [] + for (var i = 0; i < entries.length; i++) { + var e = entries[i] + if (e.charAt(0) !== '.' || dotOk) { + var m + if (negate && !prefix) { + m = !e.match(pn) + } else { + m = e.match(pn) + } + if (m) + matchedEntries.push(e) + } + } + + var len = matchedEntries.length + // If there are no matched entries, then nothing matches. + if (len === 0) + return + + // if this is the last remaining pattern bit, then no need for + // an additional stat *unless* the user has specified mark or + // stat explicitly. We know they exist, since readdir returned + // them. + + if (remain.length === 1 && !this.mark && !this.stat) { + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + if (prefix) { + if (prefix.slice(-1) !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + + if (e.charAt(0) === '/' && !this.nomount) { + e = path.join(this.root, e) + } + this.matches[index][e] = true + } + // This was the last one, and no stats were needed + return + } + + // now test all matched entries as stand-ins for that part + // of the pattern. + remain.shift() + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + var newPattern + if (prefix) + newPattern = [prefix, e] + else + newPattern = [e] + this._process(newPattern.concat(remain), index, inGlobStar) + } +} + + +GlobSync.prototype._emitMatch = function (index, e) { + var abs = this._makeAbs(e) + if (this.mark) + e = this._mark(e) + + if (this.matches[index][e]) + return + + if (this.nodir) { + var c = this.cache[this._makeAbs(e)] + if (c === 'DIR' || Array.isArray(c)) + return + } + + this.matches[index][e] = true + if (this.stat) + this._stat(e) +} + + +GlobSync.prototype._readdirInGlobStar = function (abs) { + // follow all symlinked directories forever + // just proceed as if this is a non-globstar situation + if (this.follow) + return this._readdir(abs, false) + + var entries + var lstat + var stat + try { + lstat = fs.lstatSync(abs) + } catch (er) { + // lstat failed, doesn't exist + return null + } + + var isSym = lstat.isSymbolicLink() + this.symlinks[abs] = isSym + + // If it's not a symlink or a dir, then it's definitely a regular file. + // don't bother doing a readdir in that case. + if (!isSym && !lstat.isDirectory()) + this.cache[abs] = 'FILE' + else + entries = this._readdir(abs, false) + + return entries +} + +GlobSync.prototype._readdir = function (abs, inGlobStar) { + var entries + + if (inGlobStar && !ownProp(this.symlinks, abs)) + return this._readdirInGlobStar(abs) + + if (ownProp(this.cache, abs)) { + var c = this.cache[abs] + if (!c || c === 'FILE') + return null + + if (Array.isArray(c)) + return c + } + + try { + return this._readdirEntries(abs, fs.readdirSync(abs)) + } catch (er) { + this._readdirError(abs, er) + return null + } +} + +GlobSync.prototype._readdirEntries = function (abs, entries) { + // if we haven't asked to stat everything, then just + // assume that everything in there exists, so we can avoid + // having to stat it a second time. + if (!this.mark && !this.stat) { + for (var i = 0; i < entries.length; i ++) { + var e = entries[i] + if (abs === '/') + e = abs + e + else + e = abs + '/' + e + this.cache[e] = true + } + } + + this.cache[abs] = entries + + // mark and cache dir-ness + return entries +} + +GlobSync.prototype._readdirError = function (f, er) { + // handle errors, and cache the information + switch (er.code) { + case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 + case 'ENOTDIR': // totally normal. means it *does* exist. + this.cache[this._makeAbs(f)] = 'FILE' + break + + case 'ENOENT': // not terribly unusual + case 'ELOOP': + case 'ENAMETOOLONG': + case 'UNKNOWN': + this.cache[this._makeAbs(f)] = false + break + + default: // some unusual error. Treat as failure. + this.cache[this._makeAbs(f)] = false + if (this.strict) + throw er + if (!this.silent) + console.error('glob error', er) + break + } +} + +GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) { + + var entries = this._readdir(abs, inGlobStar) + + // no entries means not a dir, so it can never have matches + // foo.txt/** doesn't match foo.txt + if (!entries) + return + + // test without the globstar, and with every child both below + // and replacing the globstar. + var remainWithoutGlobStar = remain.slice(1) + var gspref = prefix ? [ prefix ] : [] + var noGlobStar = gspref.concat(remainWithoutGlobStar) + + // the noGlobStar pattern exits the inGlobStar state + this._process(noGlobStar, index, false) + + var len = entries.length + var isSym = this.symlinks[abs] + + // If it's a symlink, and we're in a globstar, then stop + if (isSym && inGlobStar) + return + + for (var i = 0; i < len; i++) { + var e = entries[i] + if (e.charAt(0) === '.' && !this.dot) + continue + + // these two cases enter the inGlobStar state + var instead = gspref.concat(entries[i], remainWithoutGlobStar) + this._process(instead, index, true) + + var below = gspref.concat(entries[i], remain) + this._process(below, index, true) + } +} + +GlobSync.prototype._processSimple = function (prefix, index) { + // XXX review this. Shouldn't it be doing the mounting etc + // before doing stat? kinda weird? + var exists = this._stat(prefix) + + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + // If it doesn't exist, then just mark the lack of results + if (!exists) + return + + if (prefix && isAbsolute(prefix) && !this.nomount) { + var trail = /[\/\\]$/.test(prefix) + if (prefix.charAt(0) === '/') { + prefix = path.join(this.root, prefix) + } else { + prefix = path.resolve(this.root, prefix) + if (trail) + prefix += '/' + } + } + + if (process.platform === 'win32') + prefix = prefix.replace(/\\/g, '/') + + // Mark this as a match + this.matches[index][prefix] = true +} + +// Returns either 'DIR', 'FILE', or false +GlobSync.prototype._stat = function (f) { + var abs = this._makeAbs(f) + var needDir = f.slice(-1) === '/' + + if (f.length > this.maxLength) + return false + + if (!this.stat && ownProp(this.cache, abs)) { + var c = this.cache[abs] + + if (Array.isArray(c)) + c = 'DIR' + + // It exists, but maybe not how we need it + if (!needDir || c === 'DIR') + return c + + if (needDir && c === 'FILE') + return false + + // otherwise we have to stat, because maybe c=true + // if we know it exists, but not what it is. + } + + var exists + var stat = this.statCache[abs] + if (!stat) { + var lstat + try { + lstat = fs.lstatSync(abs) + } catch (er) { + return false + } + + if (lstat.isSymbolicLink()) { + try { + stat = fs.statSync(abs) + } catch (er) { + stat = lstat + } + } else { + stat = lstat + } + } + + this.statCache[abs] = stat + + var c = stat.isDirectory() ? 'DIR' : 'FILE' + this.cache[abs] = this.cache[abs] || c + + if (needDir && c !== 'DIR') + return false + + return c +} + +GlobSync.prototype._mark = function (p) { + return common.mark(this, p) +} + +GlobSync.prototype._makeAbs = function (f) { + return common.makeAbs(this, f) +} + + +/***/ }), +/* 379 */ +/***/ (function(module, exports, __webpack_require__) { + +exports.alphasort = alphasort +exports.alphasorti = alphasorti +exports.setopts = setopts +exports.ownProp = ownProp +exports.makeAbs = makeAbs +exports.finish = finish +exports.mark = mark +exports.isIgnored = isIgnored +exports.childrenIgnored = childrenIgnored + +function ownProp (obj, field) { + return Object.prototype.hasOwnProperty.call(obj, field) +} + +var path = __webpack_require__(56) +var minimatch = __webpack_require__(198) +var isAbsolute = __webpack_require__(242) +var Minimatch = minimatch.Minimatch + +function alphasorti (a, b) { + return a.toLowerCase().localeCompare(b.toLowerCase()) +} + +function alphasort (a, b) { + return a.localeCompare(b) +} + +function setupIgnores (self, options) { + self.ignore = options.ignore || [] + + if (!Array.isArray(self.ignore)) + self.ignore = [self.ignore] + + if (self.ignore.length) { + self.ignore = self.ignore.map(ignoreMap) + } +} + +// ignore patterns are always in dot:true mode. +function ignoreMap (pattern) { + var gmatcher = null + if (pattern.slice(-3) === '/**') { + var gpattern = pattern.replace(/(\/\*\*)+$/, '') + gmatcher = new Minimatch(gpattern, { dot: true }) + } + + return { + matcher: new Minimatch(pattern, { dot: true }), + gmatcher: gmatcher + } +} + +function setopts (self, pattern, options) { + if (!options) + options = {} + + // base-matching: just use globstar for that. + if (options.matchBase && -1 === pattern.indexOf("/")) { + if (options.noglobstar) { + throw new Error("base matching requires globstar") + } + pattern = "**/" + pattern + } + + self.silent = !!options.silent + self.pattern = pattern + self.strict = options.strict !== false + self.realpath = !!options.realpath + self.realpathCache = options.realpathCache || Object.create(null) + self.follow = !!options.follow + self.dot = !!options.dot + self.mark = !!options.mark + self.nodir = !!options.nodir + if (self.nodir) + self.mark = true + self.sync = !!options.sync + self.nounique = !!options.nounique + self.nonull = !!options.nonull + self.nosort = !!options.nosort + self.nocase = !!options.nocase + self.stat = !!options.stat + self.noprocess = !!options.noprocess + + self.maxLength = options.maxLength || Infinity + self.cache = options.cache || Object.create(null) + self.statCache = options.statCache || Object.create(null) + self.symlinks = options.symlinks || Object.create(null) + + setupIgnores(self, options) + + self.changedCwd = false + var cwd = process.cwd() + if (!ownProp(options, "cwd")) + self.cwd = cwd + else { + self.cwd = options.cwd + self.changedCwd = path.resolve(options.cwd) !== cwd + } + + self.root = options.root || path.resolve(self.cwd, "/") + self.root = path.resolve(self.root) + if (process.platform === "win32") + self.root = self.root.replace(/\\/g, "/") + + self.nomount = !!options.nomount + + // disable comments and negation in Minimatch. + // Note that they are not supported in Glob itself anyway. + options.nonegate = true + options.nocomment = true + + self.minimatch = new Minimatch(pattern, options) + self.options = self.minimatch.options +} + +function finish (self) { + var nou = self.nounique + var all = nou ? [] : Object.create(null) + + for (var i = 0, l = self.matches.length; i < l; i ++) { + var matches = self.matches[i] + if (!matches || Object.keys(matches).length === 0) { + if (self.nonull) { + // do like the shell, and spit out the literal glob + var literal = self.minimatch.globSet[i] + if (nou) + all.push(literal) + else + all[literal] = true + } + } else { + // had matches + var m = Object.keys(matches) + if (nou) + all.push.apply(all, m) + else + m.forEach(function (m) { + all[m] = true + }) + } + } + + if (!nou) + all = Object.keys(all) + + if (!self.nosort) + all = all.sort(self.nocase ? alphasorti : alphasort) + + // at *some* point we statted all of these + if (self.mark) { + for (var i = 0; i < all.length; i++) { + all[i] = self._mark(all[i]) + } + if (self.nodir) { + all = all.filter(function (e) { + return !(/\/$/.test(e)) + }) + } + } + + if (self.ignore.length) + all = all.filter(function(m) { + return !isIgnored(self, m) + }) + + self.found = all +} + +function mark (self, p) { + var abs = makeAbs(self, p) + var c = self.cache[abs] + var m = p + if (c) { + var isDir = c === 'DIR' || Array.isArray(c) + var slash = p.slice(-1) === '/' + + if (isDir && !slash) + m += '/' + else if (!isDir && slash) + m = m.slice(0, -1) + + if (m !== p) { + var mabs = makeAbs(self, m) + self.statCache[mabs] = self.statCache[abs] + self.cache[mabs] = self.cache[abs] + } + } + + return m +} + +// lotta situps... +function makeAbs (self, f) { + var abs = f + if (f.charAt(0) === '/') { + abs = path.join(self.root, f) + } else if (isAbsolute(f) || f === '') { + abs = f + } else if (self.changedCwd) { + abs = path.resolve(self.cwd, f) + } else { + abs = path.resolve(f) + } + return abs +} + + +// Return true, if pattern ends with globstar '**', for the accompanying parent directory. +// Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents +function isIgnored (self, path) { + if (!self.ignore.length) + return false + + return self.ignore.some(function(item) { + return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path)) + }) +} + +function childrenIgnored (self, path) { + if (!self.ignore.length) + return false + + return self.ignore.some(function(item) { + return !!(item.gmatcher && item.gmatcher.match(path)) + }) +} + + +/***/ }), +/* 380 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = __webpack_require__(3); +const types_1 = __webpack_require__(186); +const string_1 = __webpack_require__(207); +const workspace_1 = tslib_1.__importDefault(__webpack_require__(184)); +const logger = __webpack_require__(183)('model-source'); +class Source { + constructor(option) { + this._disabled = false; + this.nvim = workspace_1.default.nvim; + // readonly properties + this.name = option.name; + this.filepath = option.filepath || ''; + this.sourceType = option.sourceType || types_1.SourceType.Native; + this.isSnippet = !!option.isSnippet; + this.defaults = option; + } + get priority() { + return this.getConfig('priority', 1); + } + get triggerOnly() { + let triggerOnly = this.defaults['triggerOnly']; + if (typeof triggerOnly == 'boolean') + return triggerOnly; + if (!this.triggerCharacters && !this.triggerPatterns) + return false; + return Array.isArray(this.triggerPatterns) && this.triggerPatterns.length != 0; + } + get triggerCharacters() { + return this.getConfig('triggerCharacters', null); + } + // exists opitonnal function names for remote source + get optionalFns() { + return this.defaults['optionalFns'] || []; + } + get triggerPatterns() { + let patterns = this.getConfig('triggerPatterns', null); + if (!patterns || patterns.length == 0) + return null; + return patterns.map(s => { + return (typeof s === 'string') ? new RegExp(s + '$') : s; + }); + } + get shortcut() { + let shortcut = this.getConfig('shortcut', ''); + return shortcut ? shortcut : this.name.slice(0, 3); + } + get enable() { + if (this._disabled) + return false; + return this.getConfig('enable', true); + } + get filetypes() { + return this.getConfig('filetypes', null); + } + get disableSyntaxes() { + return this.getConfig('disableSyntaxes', []); + } + getConfig(key, defaultValue) { + let config = workspace_1.default.getConfiguration(`coc.source.${this.name}`); + defaultValue = this.defaults.hasOwnProperty(key) ? this.defaults[key] : defaultValue; + return config.get(key, defaultValue); + } + toggle() { + this._disabled = !this._disabled; + } + get firstMatch() { + return this.getConfig('firstMatch', true); + } + get menu() { + let { shortcut } = this; + return shortcut ? `[${shortcut}]` : ''; + } + /** + * Filter words that too short or doesn't match input + */ + filterWords(words, opt) { + let { firstMatch } = this; + let res = []; + let { input } = opt; + let cword = opt.word; + if (!input.length) + return []; + let cFirst = input[0]; + for (let word of words) { + if (!word || word.length < 3) + continue; + if (firstMatch && cFirst != word[0]) + continue; + if (!firstMatch && cFirst.toLowerCase() != word[0].toLowerCase()) + continue; + if (word == cword || word == input) + continue; + res.push(word); + } + return res; + } + /** + * fix start column for new valid characters + * + * @protected + * @param {CompleteOption} opt + * @param {string[]} valids - valid charscters + * @returns {number} + */ + fixStartcol(opt, valids) { + let { col, input, line, bufnr } = opt; + let start = string_1.byteSlice(line, 0, col); + let document = workspace_1.default.getDocument(bufnr); + if (!document) + return col; + let { chars } = document; + for (let i = start.length - 1; i >= 0; i--) { + let c = start[i]; + if (!chars.isKeywordChar(c) && valids.indexOf(c) === -1) { + break; + } + input = `${c}${input}`; + col = col - 1; + } + opt.col = col; + opt.input = input; + return col; + } + async shouldComplete(opt) { + let { disableSyntaxes } = this; + let synname = opt.synname.toLowerCase(); + if (disableSyntaxes && disableSyntaxes.length && disableSyntaxes.findIndex(s => synname.indexOf(s.toLowerCase()) != -1) !== -1) { + return false; + } + let fn = this.defaults['shouldComplete']; + if (fn) + return await Promise.resolve(fn.call(this, opt)); + return true; + } + async refresh() { + let fn = this.defaults['refresh']; + if (fn) + await Promise.resolve(fn.call(this)); + } + async onCompleteDone(item, opt) { + let fn = this.defaults['onCompleteDone']; + if (fn) + await Promise.resolve(fn.call(this, item, opt)); + } + async doComplete(opt, token) { + let fn = this.defaults['doComplete']; + if (fn) + return await Promise.resolve(fn.call(this, opt, token)); + return null; + } +} +exports.default = Source; +//# sourceMappingURL=source.js.map + +/***/ }), +/* 381 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = __webpack_require__(3); +const fuzzy_1 = __webpack_require__(350); +const string_1 = __webpack_require__(207); +const workspace_1 = tslib_1.__importDefault(__webpack_require__(184)); +const source_1 = tslib_1.__importDefault(__webpack_require__(380)); +const logger = __webpack_require__(183)('model-source-vim'); +class VimSource extends source_1.default { + async callOptinalFunc(fname, args) { + let exists = this.optionalFns.indexOf(fname) !== -1; + if (!exists) + return null; + let name = `coc#source#${this.name}#${fname}`; + let res; + try { + res = await this.nvim.call(name, args); + } + catch (e) { + workspace_1.default.showMessage(`Vim error from source ${this.name}: ${e.message}`, 'error'); + return null; + } + return res; + } + async shouldComplete(opt) { + let shouldRun = await super.shouldComplete(opt); + if (!shouldRun) + return false; + if (this.optionalFns.indexOf('should_complete') === -1) + return true; + let res = await this.callOptinalFunc('should_complete', [opt]); + return !!res; + } + async refresh() { + await this.callOptinalFunc('refresh', []); + } + async onCompleteDone(item, opt) { + await super.onCompleteDone(item, opt); + if (this.optionalFns.indexOf('on_complete') === -1) + return; + this.callOptinalFunc('on_complete', [item]); // tslint:disable-line + } + onEnter(bufnr) { + if (this.optionalFns.indexOf('on_enter') === -1) + return; + let doc = workspace_1.default.getDocument(bufnr); + if (!doc) + return; + let { filetypes } = this; + if (filetypes && filetypes.indexOf(doc.filetype) == -1) + return; + this.callOptinalFunc('on_enter', [{ + bufnr, + uri: doc.uri, + languageId: doc.filetype + }]); // tslint:disable-line + } + async doComplete(opt, token) { + let { col, input, line, colnr } = opt; + let startcol = await this.callOptinalFunc('get_startcol', [opt]); + if (token.isCancellationRequested) + return; + if (startcol) { + if (startcol < 0) + return null; + startcol = Number(startcol); + // invalid startcol + if (isNaN(startcol) || startcol < 0) + startcol = col; + if (startcol !== col) { + input = string_1.byteSlice(line, startcol, colnr - 1); + opt = Object.assign({}, opt, { + col: startcol, + changed: col - startcol, + input + }); + } + } + let items = await this.nvim.callAsync('coc#util#do_complete', [this.name, opt]); + if (!items || items.length == 0 || token.isCancellationRequested) + return null; + if (this.firstMatch && input.length) { + let ch = input[0]; + items = items.filter(item => { + let cfirst = item.filterText ? item.filterText[0] : item.word[0]; + return fuzzy_1.fuzzyChar(ch, cfirst); + }); + } + for (let item of items) { + let menu = item.menu ? item.menu + ' ' : ''; + item.menu = `${menu}${this.menu}`; + item.isSnippet = this.isSnippet; + delete item.user_data; + } + let res = { items }; + res.startcol = startcol; + return res; + } +} +exports.default = VimSource; +//# sourceMappingURL=source-vim.js.map + +/***/ }), +/* 382 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = __webpack_require__(3); +const vscode_languageserver_protocol_1 = __webpack_require__(146); +const source_1 = tslib_1.__importDefault(__webpack_require__(380)); +const workspace_1 = tslib_1.__importDefault(__webpack_require__(184)); +const logger = __webpack_require__(183)('source-around'); +class Around extends source_1.default { + constructor() { + super({ + name: 'around', + filepath: __filename + }); + } + async doComplete(opt) { + let { bufnr, input } = opt; + if (input.length === 0) + return null; + let document = workspace_1.default.getDocument(bufnr); + if (!document) + return null; + let words = document.words; + let moreWords = document.getMoreWords(); + words.push(...moreWords); + words = this.filterWords(words, opt); + return { + items: words.map(word => { + return { + word, + menu: this.menu + }; + }) + }; + } +} +exports.default = Around; +function regist(sourceMap) { + sourceMap.set('around', new Around()); + return vscode_languageserver_protocol_1.Disposable.create(() => { + sourceMap.delete('around'); + }); +} +exports.regist = regist; +//# sourceMappingURL=around.js.map + +/***/ }), +/* 383 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = __webpack_require__(3); +const vscode_languageserver_protocol_1 = __webpack_require__(146); +const source_1 = tslib_1.__importDefault(__webpack_require__(380)); +const workspace_1 = tslib_1.__importDefault(__webpack_require__(184)); +const logger = __webpack_require__(183)('source-buffer'); +class Buffer extends source_1.default { + constructor() { + super({ + name: 'buffer', + filepath: __filename + }); + } + get ignoreGitignore() { + return this.getConfig('ignoreGitignore', true); + } + getWords(bufnr) { + let { ignoreGitignore } = this; + let words = []; workspace_1.default.documents.forEach(document => { if (document.bufnr == bufnr) return; @@ -80938,7 +83090,7 @@ exports.regist = regist; //# sourceMappingURL=buffer.js.map /***/ }), -/* 378 */ +/* 384 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -80951,7 +83103,7 @@ const os_1 = tslib_1.__importDefault(__webpack_require__(55)); const path_1 = tslib_1.__importDefault(__webpack_require__(56)); const util_1 = tslib_1.__importDefault(__webpack_require__(40)); const vscode_languageserver_protocol_1 = __webpack_require__(146); -const source_1 = tslib_1.__importDefault(__webpack_require__(374)); +const source_1 = tslib_1.__importDefault(__webpack_require__(380)); const fs_2 = __webpack_require__(197); const string_1 = __webpack_require__(207); const logger = __webpack_require__(183)('source-file'); @@ -81084,7 +83236,7 @@ exports.regist = regist; //# sourceMappingURL=file.js.map /***/ }), -/* 379 */ +/* 385 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -81093,7 +83245,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); const vscode_languageserver_protocol_1 = __webpack_require__(146); const fuzzy_1 = __webpack_require__(350); const string_1 = __webpack_require__(207); -const match_1 = __webpack_require__(380); +const match_1 = __webpack_require__(386); const logger = __webpack_require__(183)('completion-complete'); // first time completion const FIRST_TIMEOUT = 500; @@ -81460,7 +83612,7 @@ exports.default = Complete; //# sourceMappingURL=complete.js.map /***/ }), -/* 380 */ +/* 386 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -81606,7 +83758,7 @@ function nextScore(codes, index, inputCodes, allowFuzzy = true) { //# sourceMappingURL=match.js.map /***/ }), -/* 381 */ +/* 387 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -81819,7 +83971,7 @@ exports.default = Floating; //# sourceMappingURL=floating.js.map /***/ }), -/* 382 */ +/* 388 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -82002,7 +84154,7 @@ exports.CocSnippet = CocSnippet; //# sourceMappingURL=snippet.js.map /***/ }), -/* 383 */ +/* 389 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -82069,7 +84221,7 @@ exports.SnippetVariableResolver = SnippetVariableResolver; //# sourceMappingURL=variableResolve.js.map /***/ }), -/* 384 */ +/* 390 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -82091,10 +84243,10 @@ const object_1 = __webpack_require__(187); const position_1 = __webpack_require__(210); const string_1 = __webpack_require__(207); const workspace_1 = tslib_1.__importDefault(__webpack_require__(184)); -const codelens_1 = tslib_1.__importDefault(__webpack_require__(385)); -const colors_1 = tslib_1.__importDefault(__webpack_require__(386)); -const refactor_1 = tslib_1.__importDefault(__webpack_require__(388)); -const documentHighlight_1 = tslib_1.__importDefault(__webpack_require__(389)); +const codelens_1 = tslib_1.__importDefault(__webpack_require__(391)); +const colors_1 = tslib_1.__importDefault(__webpack_require__(392)); +const refactor_1 = tslib_1.__importDefault(__webpack_require__(394)); +const documentHighlight_1 = tslib_1.__importDefault(__webpack_require__(395)); const debounce = __webpack_require__(173); const logger = __webpack_require__(183)('Handler'); const pairs = new Map([ @@ -83280,7 +85432,7 @@ function isDocumentSymbols(a) { //# sourceMappingURL=index.js.map /***/ }), -/* 385 */ +/* 391 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -83544,7 +85696,7 @@ exports.default = CodeLensManager; //# sourceMappingURL=codelens.js.map /***/ }), -/* 386 */ +/* 392 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -83558,7 +85710,7 @@ const languages_1 = tslib_1.__importDefault(__webpack_require__(254)); const util_1 = __webpack_require__(171); const object_1 = __webpack_require__(187); const workspace_1 = tslib_1.__importDefault(__webpack_require__(184)); -const highlighter_1 = tslib_1.__importStar(__webpack_require__(387)); +const highlighter_1 = tslib_1.__importStar(__webpack_require__(393)); const logger = __webpack_require__(183)('colors'); class Colors { constructor(nvim) { @@ -83749,7 +85901,7 @@ exports.default = Colors; //# sourceMappingURL=colors.js.map /***/ }), -/* 387 */ +/* 393 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -83897,7 +86049,7 @@ function isDark(color) { //# sourceMappingURL=highlighter.js.map /***/ }), -/* 388 */ +/* 394 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -84129,7 +86281,7 @@ function adjustRange(range, offset) { //# sourceMappingURL=refactor.js.map /***/ }), -/* 389 */ +/* 395 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -84230,7 +86382,7 @@ exports.default = DocumentHighlighter; //# sourceMappingURL=documentHighlight.js.map /***/ }), -/* 390 */ +/* 396 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -84277,10 +86429,10 @@ exports.default = default_1; //# sourceMappingURL=clean.js.map /***/ }), -/* 391 */ +/* 397 */ /***/ (function(module) { -module.exports = {"name":"coc.nvim","version":"0.0.72","description":"LSP based intellisense engine for neovim & vim8.","main":"./lib/index.js","bin":"./bin/server.js","scripts":{"clean":"rimraf lib build","lint":"tslint -c tslint.json -p .","build":"tsc -p tsconfig.json","watch":"tsc -p tsconfig.json --watch true --sourceMap","test":"node --trace-warnings node_modules/.bin/jest --runInBand --detectOpenHandles --forceExit","test-build":"node --trace-warnings node_modules/.bin/jest --runInBand --coverage --forceExit","prepare":"npm-run-all clean build"},"repository":{"type":"git","url":"git+https://github.com/neoclide/coc.nvim.git"},"keywords":["complete","neovim"],"author":"Qiming Zhao ","license":"MIT","bugs":{"url":"https://github.com/neoclide/coc.nvim/issues"},"homepage":"https://github.com/neoclide/coc.nvim#readme","jest":{"globals":{"__TEST__":true},"watchman":false,"clearMocks":true,"globalSetup":"./jest.js","testEnvironment":"node","moduleFileExtensions":["ts","tsx","json","js"],"transform":{"^.+\\.tsx?$":"ts-jest"},"testRegex":"src/__tests__/.*\\.(test|spec)\\.ts$","coverageDirectory":"./coverage/"},"devDependencies":{"@chemzqm/tslint-config":"^1.0.18","@types/debounce":"^3.0.0","@types/fb-watchman":"^2.0.0","@types/glob":"^7.1.1","@types/jest":"^24.0.15","@types/minimatch":"^3.0.3","@types/mkdirp":"^0.5.2","@types/node":"^12.0.10","@types/semver":"^6.0.1","@types/tunnel":"^0.0.1","@types/uuid":"^3.4.4","@types/which":"^1.3.1","colors":"^1.3.3","jest":"24.8.0","npm-run-all":"^4.1.5","ts-jest":"^24.0.2","tslint":"^5.18.0","typescript":"3.5.2","vscode-languageserver":"5.3.0-next.8"},"dependencies":{"@chemzqm/neovim":"5.1.7","bser":"^2.1.0","debounce":"^1.2.0","fast-diff":"^1.2.0","fb-watchman":"^2.0.0","follow-redirects":"^1.7.0","glob":"^7.1.4","isuri":"^2.0.3","jsonc-parser":"^2.1.0","log4js":"^4.4.0","minimatch":"^3.0.4","mkdirp":"^0.5.1","rimraf":"^2.6.3","semver":"^6.1.2","tar":"^4.4.10","tslib":"^1.10.0","tunnel":"^0.0.6","uuid":"^3.3.2","vscode-languageserver-protocol":"3.15.0-next.6","vscode-languageserver-types":"3.15.0-next.2","vscode-uri":"^2.0.2","which":"^1.3.1"}}; +module.exports = {"name":"coc.nvim","version":"0.0.72","description":"LSP based intellisense engine for neovim & vim8.","main":"./lib/index.js","bin":"./bin/server.js","scripts":{"clean":"rimraf lib build","lint":"tslint -c tslint.json -p .","build":"tsc -p tsconfig.json","watch":"tsc -p tsconfig.json --watch true --sourceMap","test":"node --trace-warnings node_modules/.bin/jest --runInBand --detectOpenHandles --forceExit","test-build":"node --trace-warnings node_modules/.bin/jest --runInBand --coverage --forceExit","prepare":"npm-run-all clean build"},"repository":{"type":"git","url":"git+https://github.com/neoclide/coc.nvim.git"},"keywords":["complete","neovim"],"author":"Qiming Zhao ","license":"MIT","bugs":{"url":"https://github.com/neoclide/coc.nvim/issues"},"homepage":"https://github.com/neoclide/coc.nvim#readme","jest":{"globals":{"__TEST__":true},"watchman":false,"clearMocks":true,"globalSetup":"./jest.js","testEnvironment":"node","moduleFileExtensions":["ts","tsx","json","js"],"transform":{"^.+\\.tsx?$":"ts-jest"},"testRegex":"src/__tests__/.*\\.(test|spec)\\.ts$","coverageDirectory":"./coverage/"},"devDependencies":{"@chemzqm/tslint-config":"^1.0.18","@types/debounce":"^3.0.0","@types/fb-watchman":"^2.0.0","@types/glob":"^7.1.1","@types/jest":"^24.0.15","@types/minimatch":"^3.0.3","@types/mkdirp":"^0.5.2","@types/node":"^12.6.2","@types/semver":"^6.0.1","@types/tar":"^4.0.3","@types/tunnel":"^0.0.1","@types/uuid":"^3.4.5","@types/which":"^1.3.1","colors":"^1.3.3","jest":"24.8.0","npm-run-all":"^4.1.5","ts-jest":"^24.0.2","tslint":"^5.18.0","typescript":"3.5.3","vscode-languageserver":"5.3.0-next.8"},"dependencies":{"@chemzqm/neovim":"5.1.7","bser":"^2.1.0","debounce":"^1.2.0","fast-diff":"^1.2.0","fb-watchman":"^2.0.0","follow-redirects":"^1.7.0","glob":"^7.1.4","isuri":"^2.0.3","jsonc-parser":"^2.1.0","log4js":"^4.5.0","minimatch":"^3.0.4","mkdirp":"^0.5.1","mv":"^2.1.1","rimraf":"^2.6.3","semver":"^6.2.0","tar":"^4.4.10","tslib":"^1.10.0","tunnel":"^0.0.6","uuid":"^3.3.2","vscode-languageserver-protocol":"3.15.0-next.6","vscode-languageserver-types":"3.15.0-next.2","vscode-uri":"^2.0.3","which":"^1.3.1"}}; /***/ }) /******/ ]); \ No newline at end of file diff --git a/package.json b/package.json index 27d64c71b4d..2288450f93e 100644 --- a/package.json +++ b/package.json @@ -55,17 +55,18 @@ "@types/jest": "^24.0.15", "@types/minimatch": "^3.0.3", "@types/mkdirp": "^0.5.2", - "@types/node": "^12.0.10", + "@types/node": "^12.6.2", "@types/semver": "^6.0.1", + "@types/tar": "^4.0.3", "@types/tunnel": "^0.0.1", - "@types/uuid": "^3.4.4", + "@types/uuid": "^3.4.5", "@types/which": "^1.3.1", "colors": "^1.3.3", "jest": "24.8.0", "npm-run-all": "^4.1.5", "ts-jest": "^24.0.2", "tslint": "^5.18.0", - "typescript": "3.5.2", + "typescript": "3.5.3", "vscode-languageserver": "5.3.0-next.8" }, "dependencies": { @@ -78,18 +79,19 @@ "glob": "^7.1.4", "isuri": "^2.0.3", "jsonc-parser": "^2.1.0", - "log4js": "^4.4.0", + "log4js": "^4.5.0", "minimatch": "^3.0.4", "mkdirp": "^0.5.1", + "mv": "^2.1.1", "rimraf": "^2.6.3", - "semver": "^6.1.2", + "semver": "^6.2.0", "tar": "^4.4.10", "tslib": "^1.10.0", "tunnel": "^0.0.6", "uuid": "^3.3.2", "vscode-languageserver-protocol": "3.15.0-next.6", "vscode-languageserver-types": "3.15.0-next.2", - "vscode-uri": "^2.0.2", + "vscode-uri": "^2.0.3", "which": "^1.3.1" } }