diff --git a/package-lock.json b/package-lock.json index df68a6697229..2aa9e6a53610 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,7 +13,7 @@ "@types/chai-as-promised": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/@types/chai-as-promised/-/chai-as-promised-7.1.0.tgz", - "integrity": "sha512-MFiW54UOSt+f2bRw8J7LgQeIvE/9b4oGvwU7XW30S9QGAiHGnU/fmiOprsyMkdmH2rl8xSPc0/yrQw8juXU6bQ==", + "integrity": "sha1-AQsEzeeOrPtucr/ds+WP4jwueLk=", "dev": true, "requires": { "@types/chai": "4.0.6" @@ -22,7 +22,7 @@ "@types/commander": { "version": "2.12.2", "resolved": "https://registry.npmjs.org/@types/commander/-/commander-2.12.2.tgz", - "integrity": "sha512-0QEFiR8ljcHp9bAbWxecjVRuAMr16ivPiGOw6KFQBVrVd0RQIcM3xKdRisH2EDWgVWujiYtHwhSkSUoAAGzH7Q==", + "integrity": "sha1-GDBBojhC1CgUePpdI8XKeOb9CK4=", "dev": true, "requires": { "commander": "2.3.0" @@ -31,7 +31,7 @@ "@types/fs-extra": { "version": "4.0.5", "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-4.0.5.tgz", - "integrity": "sha512-tIG0GpHum5IFb8Qze/cSv0w/0gNzHB+MUDftTQaxenx46z50g51/MPkNLssLz9+uZLzCDd35bT9qtWOTXZ21Gw==", + "integrity": "sha1-iqYDPA6HxlOwmmcRaGkWhktI7J4=", "dev": true, "requires": { "@types/node": "6.0.92" @@ -40,7 +40,7 @@ "@types/get-port": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/@types/get-port/-/get-port-3.2.0.tgz", - "integrity": "sha512-TiNg8R1kjDde5Pub9F9vCwZA/BNW9HeXP5b9j7Qucqncy/McfPZ6xze/EyBdXS5FhMIGN6Fx3vg75l5KHy3V1Q==", + "integrity": "sha1-+eChFEPMITNkcBherj37pEldKbw=", "dev": true }, "@types/iconv-lite": { @@ -55,37 +55,37 @@ "@types/lodash": { "version": "4.14.87", "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.87.tgz", - "integrity": "sha512-AqRC+aEF4N0LuNHtcjKtvF9OTfqZI0iaBoe3dA6m/W+/YZJBZjBmW/QIZ8fBeXC6cnytSY9tBoFBqZ9uSCeVsw==", + "integrity": "sha1-Vfkhg7BIwsZEAq/kcvgzP04xmms=", "dev": true }, "@types/mocha": { "version": "2.2.44", "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-2.2.44.tgz", - "integrity": "sha512-k2tWTQU8G4+iSMvqKi0Q9IIsWAp/n8xzdZS4Q4YVIltApoMA00wFBFdlJnmoaK1/z7B0Cy0yPe6GgXteSmdUNw==", + "integrity": "sha1-HUp5jlPzUhL9WtTQQFBiAXHNW14=", "dev": true }, "@types/node": { "version": "6.0.92", "resolved": "https://registry.npmjs.org/@types/node/-/node-6.0.92.tgz", - "integrity": "sha512-awEYSSTn7dauwVCYSx2CJaPTu0Z1Ht2oR1b2AD3CYao6ZRb+opb6EL43fzmD7eMFgMHzTBWSUzlWSD+S8xN0Nw==", + "integrity": "sha1-5/chrigncuEroleZaMANnM5CLF0=", "dev": true }, "@types/semver": { "version": "5.4.0", "resolved": "https://registry.npmjs.org/@types/semver/-/semver-5.4.0.tgz", - "integrity": "sha512-PBHCvO98hNec9A491vBbh0ZNDOVxccwKL1u2pm6fs9oDgm7SEnw0lEHqHfjsYryDxnE3zaf7LvERWEXjOp1hig==", + "integrity": "sha1-82WFNa9/H1AqzW2n2vQF/+sffuQ=", "dev": true }, "@types/sinon": { "version": "2.3.7", "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-2.3.7.tgz", - "integrity": "sha512-w+LjztaZbgZWgt/y/VMP5BUAWLtSyoIJhXyW279hehLPyubDoBNwvhcj3WaSptcekuKYeTCVxrq60rdLc6ImJA==", + "integrity": "sha1-6Swv7TKX6uB4140doDKyZ4i0r4Y=", "dev": true }, "@types/uuid": { "version": "3.4.3", "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-3.4.3.tgz", - "integrity": "sha512-5fRLCYhLtDb3hMWqQyH10qtF+Ud2JnNCXTCZ+9ktNdCcgslcuXkDTkFcJNk++MT29yDntDnlF1+jD+uVGumsbw==", + "integrity": "sha1-EhrOJl9Vac5A9PbQ/3ijOMcyp1Q=", "dev": true, "requires": { "@types/node": "6.0.92" @@ -100,7 +100,7 @@ "@types/xml2js": { "version": "0.4.2", "resolved": "https://registry.npmjs.org/@types/xml2js/-/xml2js-0.4.2.tgz", - "integrity": "sha512-8aKUBSj3oGcnuiBmDLm3BIk09RYg01mz9HlQ2u4aS17oJ25DxjQrEUVGFSBVNOfM45pQW4OjcBPplq6r/exJdA==", + "integrity": "sha1-pLhLOHn/1HEJU/2Syr/emopOhFY=", "dev": true, "requires": { "@types/node": "6.0.92" @@ -133,7 +133,7 @@ "anymatch": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.2.tgz", - "integrity": "sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA==", + "integrity": "sha1-VT3Lj5HjyImEXf26NMd3IbkLnXo=", "dev": true, "requires": { "micromatch": "2.3.11", @@ -163,7 +163,7 @@ "arr-flatten": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", - "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", + "integrity": "sha1-NgSLv/TntH4TZkQxbJlmnqWukfE=", "dev": true }, "array-differ": { @@ -187,7 +187,7 @@ "array-slice": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/array-slice/-/array-slice-1.1.0.tgz", - "integrity": "sha512-B1qMD3RBP7O8o0H2KbrXDyB0IccejMF15+87Lvlor12ONPRHP6gTjXMNkt/d3ZuOGbAe66hFmaCfECI24Ufp6w==", + "integrity": "sha1-42jqFfibxwaff/uJrsOmx9SsItQ=", "dev": true }, "array-union": { @@ -392,7 +392,7 @@ "chai-as-promised": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/chai-as-promised/-/chai-as-promised-7.1.1.tgz", - "integrity": "sha512-azL6xMoi+uxu6z4rhWQ1jbdUhOMhis2PvscD/xjLqNMkv3BPPp2JyyuTHOrf9BOosGpNQ11v6BKv/g57RXbiaA==", + "integrity": "sha1-CGRdgl3rhpbuYXJdv1kMAS6wDKA=", "dev": true, "requires": { "check-error": "1.0.2" @@ -425,7 +425,6 @@ "requires": { "anymatch": "1.3.2", "async-each": "1.0.1", - "fsevents": "1.1.3", "glob-parent": "2.0.0", "inherits": "2.0.3", "is-binary-path": "1.0.1", @@ -437,7 +436,7 @@ "ci-info": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-1.1.2.tgz", - "integrity": "sha512-uTGIPNx/nSpBdsF6xnseRXLLtfr9VLqkz8ZqHXr3Y7b6SftyRxBGjwMtJj1OhNbmlc1wZzLNAlAcvyIiE8a6ZA==", + "integrity": "sha1-A1YSWdtI0EdMi9yQ9bR7Botrv7Q=", "dev": true }, "clone": { @@ -478,7 +477,7 @@ "color-convert": { "version": "1.9.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.1.tgz", - "integrity": "sha512-mjGanIiwQJskCC18rPR6OmrZ6fm2Lc7PeGFYwCmy5J34wC6F1PzdGL6xeMfmgicfYcNLGuVFA3WzXtIDCQSZxQ==", + "integrity": "sha1-wSYRB66y8pTr/+ye2eytUppgl+0=", "dev": true, "requires": { "color-name": "1.1.3" @@ -514,7 +513,7 @@ "commandpost": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/commandpost/-/commandpost-1.2.1.tgz", - "integrity": "sha512-V1wzc+DTFsO96te2W/U+fKNRSOWtOwXhkkZH2WRLLbucrY+YrDNsRr4vtfSf83MUZVF3E6B4nwT30fqaTpzipQ==", + "integrity": "sha1-LpxMdQi53HBK/vqpHKuS7mBUzGg=", "dev": true }, "concat-map": { @@ -614,7 +613,7 @@ "deep-eql": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", - "integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==", + "integrity": "sha1-38lARACtHI/gI+faHfHBR8S0RN8=", "dev": true, "requires": { "type-detect": "4.0.5" @@ -697,7 +696,7 @@ "duplexify": { "version": "3.5.1", "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.5.1.tgz", - "integrity": "sha512-j5goxHTwVED1Fpe5hh3q9R93Kip0Bg2KVAt4f8CEYM3UEwYcPSvWbXaUQOzdX/HtiNomipv+gU7ASQPDbV7pGQ==", + "integrity": "sha1-ThUWvmiDi8kKSZlPCzmm5ZYL780=", "dev": true, "requires": { "end-of-stream": "1.4.0", @@ -733,7 +732,7 @@ "readable-stream": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.3.tgz", - "integrity": "sha512-m+qzzcn7KUxEmd1gMbchF+Y2eIUbieUaxkWtptyHywrX0rE8QEYqPC07Vuy4Wm32/xE16NcdBctb8S0Xe/5IeQ==", + "integrity": "sha1-No8lEtefnUb9/HE0mueHi7weuVw=", "dev": true, "requires": { "core-util-is": "1.0.2", @@ -748,7 +747,7 @@ "string_decoder": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", - "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "integrity": "sha1-D8Z9fBQYJd6UKC3VNr7GubzoYKs=", "dev": true, "requires": { "safe-buffer": "5.1.1" @@ -769,7 +768,7 @@ "editorconfig": { "version": "0.15.0", "resolved": "https://registry.npmjs.org/editorconfig/-/editorconfig-0.15.0.tgz", - "integrity": "sha512-j7JBoj/bpNzvoTQylfRZSc85MlLNKWQiq5y6gwKhmqD2h1eZ+tH4AXbkhEJD468gjDna/XMx2YtSkCxBRX9OGg==", + "integrity": "sha1-tt1KC2ueds5I4Ga9wVOBrruIBP0=", "dev": true, "requires": { "@types/commander": "2.12.2", @@ -783,13 +782,13 @@ "commander": { "version": "2.12.2", "resolved": "https://registry.npmjs.org/commander/-/commander-2.12.2.tgz", - "integrity": "sha512-BFnaq5ZOGcDN7FlrtBT4xxkgIToalIIxwjxLWVJ8bGTpe1LroqMiqQXdA7ygc7CRvaYS+9zfPGFnJqFSayx+AA==", + "integrity": "sha1-D1lGxCftnsDZGka7ne9T5UZQ5VU=", "dev": true }, "lru-cache": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.1.tgz", - "integrity": "sha512-q4spe4KTfsAS1SUHLO0wz8Qiyf1+vMIAgpRYioFYDMNqKfHQbg+AVDH3i4fvpl71/P1L0dBl+fQi+P37UYf0ew==", + "integrity": "sha1-Yi4y6CSItJJ5EUpPns9F581rulU=", "dev": true, "requires": { "pseudomap": "1.0.2", @@ -1083,910 +1082,6 @@ "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true }, - "fsevents": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.1.3.tgz", - "integrity": "sha512-WIr7iDkdmdbxu/Gh6eKEZJL6KPE74/5MEsf2whTOFNxbIoIixogroLdKYqB6FDav4Wavh/lZdzzd3b2KxIXC5Q==", - "dev": true, - "optional": true, - "requires": { - "nan": "2.8.0", - "node-pre-gyp": "0.6.39" - }, - "dependencies": { - "abbrev": { - "version": "1.1.0", - "bundled": true, - "dev": true, - "optional": true - }, - "ajv": { - "version": "4.11.8", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "co": "4.6.0", - "json-stable-stringify": "1.0.1" - } - }, - "ansi-regex": { - "version": "2.1.1", - "bundled": true, - "dev": true - }, - "aproba": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "are-we-there-yet": { - "version": "1.1.4", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "delegates": "1.0.0", - "readable-stream": "2.2.9" - } - }, - "asn1": { - "version": "0.2.3", - "bundled": true, - "dev": true, - "optional": true - }, - "assert-plus": { - "version": "0.2.0", - "bundled": true, - "dev": true, - "optional": true - }, - "asynckit": { - "version": "0.4.0", - "bundled": true, - "dev": true, - "optional": true - }, - "aws-sign2": { - "version": "0.6.0", - "bundled": true, - "dev": true, - "optional": true - }, - "aws4": { - "version": "1.6.0", - "bundled": true, - "dev": true, - "optional": true - }, - "balanced-match": { - "version": "0.4.2", - "bundled": true, - "dev": true - }, - "bcrypt-pbkdf": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "tweetnacl": "0.14.5" - } - }, - "block-stream": { - "version": "0.0.9", - "bundled": true, - "dev": true, - "requires": { - "inherits": "2.0.3" - } - }, - "boom": { - "version": "2.10.1", - "bundled": true, - "dev": true, - "requires": { - "hoek": "2.16.3" - } - }, - "brace-expansion": { - "version": "1.1.7", - "bundled": true, - "dev": true, - "requires": { - "balanced-match": "0.4.2", - "concat-map": "0.0.1" - } - }, - "buffer-shims": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "caseless": { - "version": "0.12.0", - "bundled": true, - "dev": true, - "optional": true - }, - "co": { - "version": "4.6.0", - "bundled": true, - "dev": true, - "optional": true - }, - "code-point-at": { - "version": "1.1.0", - "bundled": true, - "dev": true - }, - "combined-stream": { - "version": "1.0.5", - "bundled": true, - "dev": true, - "requires": { - "delayed-stream": "1.0.0" - } - }, - "concat-map": { - "version": "0.0.1", - "bundled": true, - "dev": true - }, - "console-control-strings": { - "version": "1.1.0", - "bundled": true, - "dev": true - }, - "core-util-is": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "cryptiles": { - "version": "2.0.5", - "bundled": true, - "dev": true, - "requires": { - "boom": "2.10.1" - } - }, - "dashdash": { - "version": "1.14.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "assert-plus": "1.0.0" - }, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - } - } - }, - "debug": { - "version": "2.6.8", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "ms": "2.0.0" - } - }, - "deep-extend": { - "version": "0.4.2", - "bundled": true, - "dev": true, - "optional": true - }, - "delayed-stream": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "delegates": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "detect-libc": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "ecc-jsbn": { - "version": "0.1.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "jsbn": "0.1.1" - } - }, - "extend": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "extsprintf": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "forever-agent": { - "version": "0.6.1", - "bundled": true, - "dev": true, - "optional": true - }, - "form-data": { - "version": "2.1.4", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "asynckit": "0.4.0", - "combined-stream": "1.0.5", - "mime-types": "2.1.15" - } - }, - "fs.realpath": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "fstream": { - "version": "1.0.11", - "bundled": true, - "dev": true, - "requires": { - "graceful-fs": "4.1.11", - "inherits": "2.0.3", - "mkdirp": "0.5.1", - "rimraf": "2.6.1" - } - }, - "fstream-ignore": { - "version": "1.0.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "fstream": "1.0.11", - "inherits": "2.0.3", - "minimatch": "3.0.4" - } - }, - "gauge": { - "version": "2.7.4", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "aproba": "1.1.1", - "console-control-strings": "1.1.0", - "has-unicode": "2.0.1", - "object-assign": "4.1.1", - "signal-exit": "3.0.2", - "string-width": "1.0.2", - "strip-ansi": "3.0.1", - "wide-align": "1.1.2" - } - }, - "getpass": { - "version": "0.1.7", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "assert-plus": "1.0.0" - }, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - } - } - }, - "glob": { - "version": "7.1.2", - "bundled": true, - "dev": true, - "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" - } - }, - "graceful-fs": { - "version": "4.1.11", - "bundled": true, - "dev": true - }, - "har-schema": { - "version": "1.0.5", - "bundled": true, - "dev": true, - "optional": true - }, - "har-validator": { - "version": "4.2.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "ajv": "4.11.8", - "har-schema": "1.0.5" - } - }, - "has-unicode": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "hawk": { - "version": "3.1.3", - "bundled": true, - "dev": true, - "requires": { - "boom": "2.10.1", - "cryptiles": "2.0.5", - "hoek": "2.16.3", - "sntp": "1.0.9" - } - }, - "hoek": { - "version": "2.16.3", - "bundled": true, - "dev": true - }, - "http-signature": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "assert-plus": "0.2.0", - "jsprim": "1.4.0", - "sshpk": "1.13.0" - } - }, - "inflight": { - "version": "1.0.6", - "bundled": true, - "dev": true, - "requires": { - "once": "1.4.0", - "wrappy": "1.0.2" - } - }, - "inherits": { - "version": "2.0.3", - "bundled": true, - "dev": true - }, - "ini": { - "version": "1.3.4", - "bundled": true, - "dev": true, - "optional": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "number-is-nan": "1.0.1" - } - }, - "is-typedarray": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "isarray": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "isstream": { - "version": "0.1.2", - "bundled": true, - "dev": true, - "optional": true - }, - "jodid25519": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "jsbn": "0.1.1" - } - }, - "jsbn": { - "version": "0.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "json-schema": { - "version": "0.2.3", - "bundled": true, - "dev": true, - "optional": true - }, - "json-stable-stringify": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "jsonify": "0.0.0" - } - }, - "json-stringify-safe": { - "version": "5.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "jsonify": { - "version": "0.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "jsprim": { - "version": "1.4.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "assert-plus": "1.0.0", - "extsprintf": "1.0.2", - "json-schema": "0.2.3", - "verror": "1.3.6" - }, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - } - } - }, - "mime-db": { - "version": "1.27.0", - "bundled": true, - "dev": true - }, - "mime-types": { - "version": "2.1.15", - "bundled": true, - "dev": true, - "requires": { - "mime-db": "1.27.0" - } - }, - "minimatch": { - "version": "3.0.4", - "bundled": true, - "dev": true, - "requires": { - "brace-expansion": "1.1.7" - } - }, - "minimist": { - "version": "0.0.8", - "bundled": true, - "dev": true - }, - "mkdirp": { - "version": "0.5.1", - "bundled": true, - "dev": true, - "requires": { - "minimist": "0.0.8" - } - }, - "ms": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "node-pre-gyp": { - "version": "0.6.39", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "detect-libc": "1.0.2", - "hawk": "3.1.3", - "mkdirp": "0.5.1", - "nopt": "4.0.1", - "npmlog": "4.1.0", - "rc": "1.2.1", - "request": "2.81.0", - "rimraf": "2.6.1", - "semver": "5.3.0", - "tar": "2.2.1", - "tar-pack": "3.4.0" - } - }, - "nopt": { - "version": "4.0.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "abbrev": "1.1.0", - "osenv": "0.1.4" - } - }, - "npmlog": { - "version": "4.1.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "are-we-there-yet": "1.1.4", - "console-control-strings": "1.1.0", - "gauge": "2.7.4", - "set-blocking": "2.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "oauth-sign": { - "version": "0.8.2", - "bundled": true, - "dev": true, - "optional": true - }, - "object-assign": { - "version": "4.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "once": { - "version": "1.4.0", - "bundled": true, - "dev": true, - "requires": { - "wrappy": "1.0.2" - } - }, - "os-homedir": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "os-tmpdir": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "osenv": { - "version": "0.1.4", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "os-homedir": "1.0.2", - "os-tmpdir": "1.0.2" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "performance-now": { - "version": "0.2.0", - "bundled": true, - "dev": true, - "optional": true - }, - "process-nextick-args": { - "version": "1.0.7", - "bundled": true, - "dev": true - }, - "punycode": { - "version": "1.4.1", - "bundled": true, - "dev": true, - "optional": true - }, - "qs": { - "version": "6.4.0", - "bundled": true, - "dev": true, - "optional": true - }, - "rc": { - "version": "1.2.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "deep-extend": "0.4.2", - "ini": "1.3.4", - "minimist": "1.2.0", - "strip-json-comments": "2.0.1" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "bundled": true, - "dev": true, - "optional": true - } - } - }, - "readable-stream": { - "version": "2.2.9", - "bundled": true, - "dev": true, - "requires": { - "buffer-shims": "1.0.0", - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "1.0.0", - "process-nextick-args": "1.0.7", - "string_decoder": "1.0.1", - "util-deprecate": "1.0.2" - } - }, - "request": { - "version": "2.81.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "aws-sign2": "0.6.0", - "aws4": "1.6.0", - "caseless": "0.12.0", - "combined-stream": "1.0.5", - "extend": "3.0.1", - "forever-agent": "0.6.1", - "form-data": "2.1.4", - "har-validator": "4.2.1", - "hawk": "3.1.3", - "http-signature": "1.1.1", - "is-typedarray": "1.0.0", - "isstream": "0.1.2", - "json-stringify-safe": "5.0.1", - "mime-types": "2.1.15", - "oauth-sign": "0.8.2", - "performance-now": "0.2.0", - "qs": "6.4.0", - "safe-buffer": "5.0.1", - "stringstream": "0.0.5", - "tough-cookie": "2.3.2", - "tunnel-agent": "0.6.0", - "uuid": "3.0.1" - } - }, - "rimraf": { - "version": "2.6.1", - "bundled": true, - "dev": true, - "requires": { - "glob": "7.1.2" - } - }, - "safe-buffer": { - "version": "5.0.1", - "bundled": true, - "dev": true - }, - "semver": { - "version": "5.3.0", - "bundled": true, - "dev": true, - "optional": true - }, - "set-blocking": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "signal-exit": { - "version": "3.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "sntp": { - "version": "1.0.9", - "bundled": true, - "dev": true, - "requires": { - "hoek": "2.16.3" - } - }, - "sshpk": { - "version": "1.13.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "asn1": "0.2.3", - "assert-plus": "1.0.0", - "bcrypt-pbkdf": "1.0.1", - "dashdash": "1.14.1", - "ecc-jsbn": "0.1.1", - "getpass": "0.1.7", - "jodid25519": "1.0.2", - "jsbn": "0.1.1", - "tweetnacl": "0.14.5" - }, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - } - } - }, - "string-width": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "requires": { - "code-point-at": "1.1.0", - "is-fullwidth-code-point": "1.0.0", - "strip-ansi": "3.0.1" - } - }, - "string_decoder": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "requires": { - "safe-buffer": "5.0.1" - } - }, - "stringstream": { - "version": "0.0.5", - "bundled": true, - "dev": true, - "optional": true - }, - "strip-ansi": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "requires": { - "ansi-regex": "2.1.1" - } - }, - "strip-json-comments": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "tar": { - "version": "2.2.1", - "bundled": true, - "dev": true, - "requires": { - "block-stream": "0.0.9", - "fstream": "1.0.11", - "inherits": "2.0.3" - } - }, - "tar-pack": { - "version": "3.4.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "debug": "2.6.8", - "fstream": "1.0.11", - "fstream-ignore": "1.0.5", - "once": "1.4.0", - "readable-stream": "2.2.9", - "rimraf": "2.6.1", - "tar": "2.2.1", - "uid-number": "0.0.6" - } - }, - "tough-cookie": { - "version": "2.3.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "punycode": "1.4.1" - } - }, - "tunnel-agent": { - "version": "0.6.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "safe-buffer": "5.0.1" - } - }, - "tweetnacl": { - "version": "0.14.5", - "bundled": true, - "dev": true, - "optional": true - }, - "uid-number": { - "version": "0.0.6", - "bundled": true, - "dev": true, - "optional": true - }, - "util-deprecate": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "uuid": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "verror": { - "version": "1.3.6", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "extsprintf": "1.0.2" - } - }, - "wide-align": { - "version": "1.1.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "string-width": "1.0.2" - } - }, - "wrappy": { - "version": "1.0.2", - "bundled": true, - "dev": true - } - } - }, "fstream": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.11.tgz", @@ -2317,7 +1412,7 @@ "gulp-filter": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/gulp-filter/-/gulp-filter-5.0.1.tgz", - "integrity": "sha512-5olRzAhFdXB2klCu1lnazP65aO9YdA/5WfC9VdInIc8PrUeDIoZfaA3Edb0yUBGhVdHv4eHKL9Fg5tUoEJ9z5A==", + "integrity": "sha1-XYf2YuMX5YOe92UOYg5skAj/ktA=", "dev": true, "requires": { "gulp-util": "3.0.8", @@ -2817,7 +1912,7 @@ "readable-stream": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.3.tgz", - "integrity": "sha512-m+qzzcn7KUxEmd1gMbchF+Y2eIUbieUaxkWtptyHywrX0rE8QEYqPC07Vuy4Wm32/xE16NcdBctb8S0Xe/5IeQ==", + "integrity": "sha1-No8lEtefnUb9/HE0mueHi7weuVw=", "dev": true, "requires": { "core-util-is": "1.0.2", @@ -2832,7 +1927,7 @@ "string_decoder": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", - "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "integrity": "sha1-D8Z9fBQYJd6UKC3VNr7GubzoYKs=", "dev": true, "requires": { "safe-buffer": "5.1.1" @@ -2908,7 +2003,7 @@ "gulp-typescript": { "version": "3.2.3", "resolved": "https://registry.npmjs.org/gulp-typescript/-/gulp-typescript-3.2.3.tgz", - "integrity": "sha512-Np2sJXgtDUwIAoMtlJ9uXsVmpu1FWXlKZw164hLuo56uJa7qo5W2KZ0yAYiYH/HUsaz5L0O2toMOcLIokpFCPg==", + "integrity": "sha1-MtUquXuXxM4HDAQZ2wjqOvUU1yA=", "dev": true, "requires": { "gulp-util": "3.0.8", @@ -3032,7 +2127,7 @@ "readable-stream": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.3.tgz", - "integrity": "sha512-m+qzzcn7KUxEmd1gMbchF+Y2eIUbieUaxkWtptyHywrX0rE8QEYqPC07Vuy4Wm32/xE16NcdBctb8S0Xe/5IeQ==", + "integrity": "sha1-No8lEtefnUb9/HE0mueHi7weuVw=", "dev": true, "requires": { "core-util-is": "1.0.2", @@ -3047,7 +2142,7 @@ "string_decoder": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", - "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "integrity": "sha1-D8Z9fBQYJd6UKC3VNr7GubzoYKs=", "dev": true, "requires": { "safe-buffer": "5.1.1" @@ -3301,7 +2396,7 @@ "queue": { "version": "4.4.2", "resolved": "https://registry.npmjs.org/queue/-/queue-4.4.2.tgz", - "integrity": "sha512-fSMRXbwhMwipcDZ08enW2vl+YDmAmhcNcr43sCJL8DIg+CFOsoRLG23ctxA+fwNk1w55SePSiS7oqQQSgQoVJQ==", + "integrity": "sha1-Wpcz2ai4vRs26TS8nFWribKOKcc=", "dev": true, "requires": { "inherits": "2.0.3" @@ -3310,7 +2405,7 @@ "readable-stream": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.3.tgz", - "integrity": "sha512-m+qzzcn7KUxEmd1gMbchF+Y2eIUbieUaxkWtptyHywrX0rE8QEYqPC07Vuy4Wm32/xE16NcdBctb8S0Xe/5IeQ==", + "integrity": "sha1-No8lEtefnUb9/HE0mueHi7weuVw=", "dev": true, "requires": { "core-util-is": "1.0.2", @@ -3331,7 +2426,7 @@ "string_decoder": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", - "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "integrity": "sha1-D8Z9fBQYJd6UKC3VNr7GubzoYKs=", "dev": true, "requires": { "safe-buffer": "5.1.1" @@ -3496,7 +2591,7 @@ "readable-stream": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.3.tgz", - "integrity": "sha512-m+qzzcn7KUxEmd1gMbchF+Y2eIUbieUaxkWtptyHywrX0rE8QEYqPC07Vuy4Wm32/xE16NcdBctb8S0Xe/5IeQ==", + "integrity": "sha1-No8lEtefnUb9/HE0mueHi7weuVw=", "dev": true, "requires": { "core-util-is": "1.0.2", @@ -3511,7 +2606,7 @@ "string_decoder": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", - "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "integrity": "sha1-D8Z9fBQYJd6UKC3VNr7GubzoYKs=", "dev": true, "requires": { "safe-buffer": "5.1.1" @@ -3560,7 +2655,7 @@ "commander": { "version": "2.12.2", "resolved": "https://registry.npmjs.org/commander/-/commander-2.12.2.tgz", - "integrity": "sha512-BFnaq5ZOGcDN7FlrtBT4xxkgIToalIIxwjxLWVJ8bGTpe1LroqMiqQXdA7ygc7CRvaYS+9zfPGFnJqFSayx+AA==", + "integrity": "sha1-D1lGxCftnsDZGka7ne9T5UZQ5VU=", "dev": true } } @@ -3642,7 +2737,7 @@ "husky": { "version": "0.14.3", "resolved": "https://registry.npmjs.org/husky/-/husky-0.14.3.tgz", - "integrity": "sha512-e21wivqHpstpoiWA/Yi8eFti8E+sQDSS53cpJsPptPs295QTOQR0ZwnHo2TXy1XOpZFD9rPOd3NpmqTK6uMLJA==", + "integrity": "sha1-xp7XTi0neXaaF7qDmbVM4LY8EsM=", "dev": true, "requires": { "is-ci": "1.0.10", @@ -3667,7 +2762,7 @@ "iconv-lite": { "version": "0.4.19", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz", - "integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ==" + "integrity": "sha1-90aPYBNfXl2tM5nAqBvpoWA6CCs=" }, "indent-string": { "version": "2.1.0", @@ -3697,7 +2792,7 @@ "ini": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", - "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", + "integrity": "sha1-7uJfVtscnsYIXgwid4CD9Zar+Sc=", "dev": true }, "interpret": { @@ -3709,7 +2804,7 @@ "inversify": { "version": "4.5.2", "resolved": "https://registry.npmjs.org/inversify/-/inversify-4.5.2.tgz", - "integrity": "sha512-nyXPqxMVdJDCbeq+eWSq5wEYvm6jlBNkBS+rMAXdxlEibAIXuzXXNgvETsP0MVcsWc4bAwUMhqr6X/5sUzNrFw==" + "integrity": "sha1-8keP0UDzmINrLh/ug583WI8eaps=" }, "is": { "version": "3.2.1", @@ -3745,7 +2840,7 @@ "is-buffer": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "integrity": "sha1-76ouqdqg16suoTqXsritUf776L4=", "dev": true }, "is-builtin-module": { @@ -3814,7 +2909,7 @@ "is-my-json-valid": { "version": "2.16.1", "resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.16.1.tgz", - "integrity": "sha512-ochPsqWS1WXj8ZnMIV0vnNXooaMhp7cyL4FMSIPKTtnV0Ha/T19G2b9kkhcNsabV9bxYkze7/aLZJb/bYuFduQ==", + "integrity": "sha1-WoRnd+LCYg0eaRBOXToDsfYIjxE=", "dev": true, "requires": { "generate-function": "2.0.0", @@ -3841,7 +2936,7 @@ "is-plain-object": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "integrity": "sha1-LBY7P6+xtgbZ0Xko8FwqHDjgdnc=", "dev": true, "requires": { "isobject": "3.0.1" @@ -4087,7 +3182,7 @@ "readable-stream": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.3.tgz", - "integrity": "sha512-m+qzzcn7KUxEmd1gMbchF+Y2eIUbieUaxkWtptyHywrX0rE8QEYqPC07Vuy4Wm32/xE16NcdBctb8S0Xe/5IeQ==", + "integrity": "sha1-No8lEtefnUb9/HE0mueHi7weuVw=", "dev": true, "requires": { "core-util-is": "1.0.2", @@ -4102,7 +3197,7 @@ "string_decoder": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", - "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "integrity": "sha1-D8Z9fBQYJd6UKC3VNr7GubzoYKs=", "dev": true, "requires": { "safe-buffer": "5.1.1" @@ -4586,7 +3681,7 @@ "readable-stream": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.3.tgz", - "integrity": "sha512-m+qzzcn7KUxEmd1gMbchF+Y2eIUbieUaxkWtptyHywrX0rE8QEYqPC07Vuy4Wm32/xE16NcdBctb8S0Xe/5IeQ==", + "integrity": "sha1-No8lEtefnUb9/HE0mueHi7weuVw=", "dev": true, "requires": { "core-util-is": "1.0.2", @@ -4601,7 +3696,7 @@ "string_decoder": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", - "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "integrity": "sha1-D8Z9fBQYJd6UKC3VNr7GubzoYKs=", "dev": true, "requires": { "safe-buffer": "5.1.1" @@ -4648,7 +3743,7 @@ "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "integrity": "sha1-UWbihkV/AzBgZL5Ul+jbsMPTIIM=", "requires": { "brace-expansion": "1.1.8" } @@ -4758,14 +3853,7 @@ "named-js-regexp": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/named-js-regexp/-/named-js-regexp-1.3.3.tgz", - "integrity": "sha512-zIUAXzGQOp16VR0Ct89SDstU62hzAPBluNUrUrsdD7MNSRbm/vyqGhEnp+4hnsMjmX3C2wh1cbIEP0joKMFLxw==" - }, - "nan": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.8.0.tgz", - "integrity": "sha1-7XFfP+neArV6XmJS2QqWZ14fCFo=", - "dev": true, - "optional": true + "integrity": "sha1-ousWVcdMuCITpPyCd337Z7iV2Mg=" }, "native-promise-only": { "version": "0.8.1", @@ -5122,7 +4210,7 @@ "randomatic": { "version": "1.1.7", "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-1.1.7.tgz", - "integrity": "sha512-D5JUjPyJbaJDkuAazpVnSfVkLlpeO3wDlPROTMLGKG1zMFNFRgrciKo1ltz/AzNTkqE0HzDx655QOL51N06how==", + "integrity": "sha1-x6vpzIuHwLqodrGf3oP9RkeX44w=", "dev": true, "requires": { "is-number": "3.0.0", @@ -5214,7 +4302,7 @@ "readable-stream": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.3.tgz", - "integrity": "sha512-m+qzzcn7KUxEmd1gMbchF+Y2eIUbieUaxkWtptyHywrX0rE8QEYqPC07Vuy4Wm32/xE16NcdBctb8S0Xe/5IeQ==", + "integrity": "sha1-No8lEtefnUb9/HE0mueHi7weuVw=", "dev": true, "requires": { "core-util-is": "1.0.2", @@ -5229,7 +4317,7 @@ "string_decoder": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", - "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "integrity": "sha1-D8Z9fBQYJd6UKC3VNr7GubzoYKs=", "dev": true, "requires": { "safe-buffer": "5.1.1" @@ -5264,7 +4352,7 @@ "regex-cache": { "version": "0.4.4", "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", - "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", + "integrity": "sha1-db3FiioUls7EihKDW8VMjVYjNt0=", "dev": true, "requires": { "is-equal-shallow": "0.1.3" @@ -5315,7 +4403,7 @@ "request": { "version": "2.83.0", "resolved": "https://registry.npmjs.org/request/-/request-2.83.0.tgz", - "integrity": "sha512-lR3gD69osqm6EYLk9wB/G1W/laGWjzH90t1vEa2xuxHD5KUrSzp9pUSfTm+YC5Nxt2T8nMPEvKlhbQayU7bgFw==", + "integrity": "sha1-ygtl2gLtYpNYh4COb1EDgQNOM1Y=", "dev": true, "requires": { "aws-sign2": "0.7.0", @@ -5381,7 +4469,7 @@ "boom": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/boom/-/boom-5.2.0.tgz", - "integrity": "sha512-Z5BTk6ZRe4tXXQlkqftmsAUANpXmuwlsF5Oov8ThoMbQRzdGTA1ngYRW160GexgOgjsFOKJz0LYhoNi+2AMBUw==", + "integrity": "sha1-XdnabuOl8wIHdDYpDLcX0/SlTgI=", "dev": true, "requires": { "hoek": "4.2.0" @@ -5413,7 +4501,7 @@ "hawk": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/hawk/-/hawk-6.0.2.tgz", - "integrity": "sha512-miowhl2+U7Qle4vdLqDdPt9m09K6yZhkLDTWGoUiUzrQCn+mHHSmfJgAyGaLRZbPmTqfFFjRV1QWCW0VWUJBbQ==", + "integrity": "sha1-r02RTrBl+bXOTZ0RwcshJu7MMDg=", "dev": true, "requires": { "boom": "4.3.1", @@ -5425,7 +4513,7 @@ "hoek": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/hoek/-/hoek-4.2.0.tgz", - "integrity": "sha512-v0XCLxICi9nPfYrS9RL8HbYnXi9obYAeLbSP00BmnZwCK9+Ih9WOjoZ8YoHCoav2csqn4FOz4Orldsy2dmDwmQ==", + "integrity": "sha1-ctnQdU9/4lyi0BrY+PmpRJqJUm0=", "dev": true }, "http-signature": { @@ -5442,13 +4530,13 @@ "qs": { "version": "6.5.1", "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.1.tgz", - "integrity": "sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A==", + "integrity": "sha1-NJzfbu+J7EXBLX1es/wMhwNDptg=", "dev": true }, "sntp": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/sntp/-/sntp-2.1.0.tgz", - "integrity": "sha512-FL1b58BDrqS3A11lJ0zEdnJ3UOKqVxawAkF3k7F0CVN7VQ34aZrV+G8BZ1WC9ZL7NyrwsW0oviwsWDgRuVYtJg==", + "integrity": "sha1-LGzsFP7cIiJznK+bXD2F0cxaLMg=", "dev": true, "requires": { "hoek": "4.2.0" @@ -5474,7 +4562,7 @@ "resolve": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.5.0.tgz", - "integrity": "sha512-hgoSGrc3pjzAPHNBg+KnFcK2HwlHTs/YrAGUr6qgTVUZmXv1UEXXl0bZNBKMA9fud6lRYFdPGz0xXxycPzmmiw==", + "integrity": "sha1-HwmsznlsmnYlefMbLBzEw83fnzY=", "dev": true, "requires": { "path-parse": "1.0.5" @@ -5499,7 +4587,7 @@ "rimraf": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", - "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", + "integrity": "sha1-LtgVDSShbqhlHm1u8PR8QVjOejY=", "dev": true, "requires": { "glob": "7.1.2" @@ -5508,7 +4596,7 @@ "glob": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "integrity": "sha1-wZyd+aAocC1nhhI4SmVSQExjbRU=", "dev": true, "requires": { "fs.realpath": "1.0.0", @@ -5524,7 +4612,7 @@ "rxjs": { "version": "5.5.3", "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-5.5.3.tgz", - "integrity": "sha512-VWockSz7xmDveeZ7wv8RvdipGGZ1NmL/m4jnpvN9BH4x1fW/TPoD23yXh+qDkbWSlajXVVfLIbGmyxa94Ls84w==", + "integrity": "sha1-tiIn50uE9Od730QOULXuAaG8fc0=", "requires": { "symbol-observable": "1.1.0" } @@ -5532,24 +4620,24 @@ "safe-buffer": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", - "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==", + "integrity": "sha1-iTMSr2myEj3vcfV4iQAWce6yyFM=", "dev": true }, "samsam": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/samsam/-/samsam-1.3.0.tgz", - "integrity": "sha512-1HwIYD/8UlOtFS3QO3w7ey+SdSDFE4HRNLZoZRYVQefrOY3l17epswImeB1ijgJFQJodIaHcwkp3r/myBjFVbg==", + "integrity": "sha1-jR2TUOJWItow3j5EumkrUiGrfFA=", "dev": true }, "sax": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", - "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" + "integrity": "sha1-KBYjTiN4vdxOU1T6tcqold9xANk=" }, "semver": { "version": "5.4.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", - "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==" + "integrity": "sha1-4FnAnYVx8FQII3M0M1BdOi8AsY4=" }, "sequencify": { "version": "0.0.7", @@ -5578,7 +4666,7 @@ "sinon": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/sinon/-/sinon-2.4.1.tgz", - "integrity": "sha512-vFTrO9Wt0ECffDYIPSP/E5bBugt0UjcBQOfQUMh66xzkyPEnhl/vM2LRZi2ajuTdkH07sA6DzrM6KvdvGIH8xw==", + "integrity": "sha1-Ah/WS1TLd9nS+w1Dze3652KcOjY=", "dev": true, "requires": { "diff": "3.4.0", @@ -5594,7 +4682,7 @@ "diff": { "version": "3.4.0", "resolved": "https://registry.npmjs.org/diff/-/diff-3.4.0.tgz", - "integrity": "sha512-QpVuMTEoJMF7cKzi6bvWhRulU1fZqZnvyVQgNhPaxxuTYwyjn/j1v9falseQ/uXWwPnO56RBfwtg4h/EQXmucA==", + "integrity": "sha1-sdhVB9rzlkgo3lSzfQ1zumfdpWw=", "dev": true } } @@ -5623,7 +4711,7 @@ "source-map-support": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.0.tgz", - "integrity": "sha512-vUoN3I7fHQe0R/SJLKRdKYuEdRGogsviXFkHHo17AWaTGv17VLnxw+CFXvqy+y4ORZ3doWLQcxRYfwKrsd/H7Q==", + "integrity": "sha1-IBinrSvfj68mkeX92rJr7VorrKs=", "dev": true, "requires": { "source-map": "0.6.1" @@ -5632,7 +4720,7 @@ "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "integrity": "sha1-dHIq8y6WFOnCh6jQu95IteLxomM=", "dev": true } } @@ -5727,7 +4815,7 @@ "streamfilter": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/streamfilter/-/streamfilter-1.0.6.tgz", - "integrity": "sha512-JM3zxd/lvOuo+EZJlZNYdQucfybA+Jr6jRtZwWlMAq1dAV0LIjZrqSNBBK62qCtflJ8rL/+cAnxy69CPhkTJNA==", + "integrity": "sha1-jQhxfKwHewg0yCYH0Pqbx3en/Lw=", "dev": true, "requires": { "readable-stream": "2.3.3" @@ -5742,7 +4830,7 @@ "readable-stream": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.3.tgz", - "integrity": "sha512-m+qzzcn7KUxEmd1gMbchF+Y2eIUbieUaxkWtptyHywrX0rE8QEYqPC07Vuy4Wm32/xE16NcdBctb8S0Xe/5IeQ==", + "integrity": "sha1-No8lEtefnUb9/HE0mueHi7weuVw=", "dev": true, "requires": { "core-util-is": "1.0.2", @@ -5757,7 +4845,7 @@ "string_decoder": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", - "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "integrity": "sha1-D8Z9fBQYJd6UKC3VNr7GubzoYKs=", "dev": true, "requires": { "safe-buffer": "5.1.1" @@ -5830,7 +4918,7 @@ "readable-stream": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.3.tgz", - "integrity": "sha512-m+qzzcn7KUxEmd1gMbchF+Y2eIUbieUaxkWtptyHywrX0rE8QEYqPC07Vuy4Wm32/xE16NcdBctb8S0Xe/5IeQ==", + "integrity": "sha1-No8lEtefnUb9/HE0mueHi7weuVw=", "dev": true, "requires": { "core-util-is": "1.0.2", @@ -5845,7 +4933,7 @@ "string_decoder": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", - "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "integrity": "sha1-D8Z9fBQYJd6UKC3VNr7GubzoYKs=", "dev": true, "requires": { "safe-buffer": "5.1.1" @@ -5880,7 +4968,7 @@ "symbol-observable": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.1.0.tgz", - "integrity": "sha512-dQoid9tqQ+uotGhuTKEY11X4xhyYePVnqGSoSm3OGKh2E8LZ6RPULp1uXTctk33IeERlrRJYoVSBglsL05F5Uw==" + "integrity": "sha1-XGj9jVQRXZ37cqhHIFSSIujbmzI=" }, "tar": { "version": "2.2.1", @@ -5924,7 +5012,7 @@ "readable-stream": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.3.tgz", - "integrity": "sha512-m+qzzcn7KUxEmd1gMbchF+Y2eIUbieUaxkWtptyHywrX0rE8QEYqPC07Vuy4Wm32/xE16NcdBctb8S0Xe/5IeQ==", + "integrity": "sha1-No8lEtefnUb9/HE0mueHi7weuVw=", "dev": true, "requires": { "core-util-is": "1.0.2", @@ -5939,7 +5027,7 @@ "string_decoder": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", - "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "integrity": "sha1-D8Z9fBQYJd6UKC3VNr7GubzoYKs=", "dev": true, "requires": { "safe-buffer": "5.1.1" @@ -6007,7 +5095,7 @@ "tree-kill": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.0.tgz", - "integrity": "sha512-DlX6dR0lOIRDFxI0mjL9IYg6OTncLm/Zt+JiBhE5OlFcAR8yc9S7FFXU9so0oda47frdM/JFsk7UjNt9vscKcg==" + "integrity": "sha1-WEZ4Yje0I5AU8F2xVrZDIS1MbzY=" }, "trim-newlines": { "version": "1.0.0", @@ -6018,7 +5106,7 @@ "tslib": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.8.0.tgz", - "integrity": "sha512-ymKWWZJST0/CkgduC2qkzjMOWr4bouhuURNXCn/inEX0L57BnRG6FhX76o7FOnsjHazCjfU2LKeSrlS2sIKQJg==", + "integrity": "sha1-3GBOutZLy/aW1hPabJVKoOfqHrY=", "dev": true }, "tslint": { @@ -6043,7 +5131,7 @@ "ansi-styles": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "integrity": "sha1-wVm41b4PnlpvNG2rlPFs4CIWG4g=", "dev": true, "requires": { "color-convert": "1.9.1" @@ -6052,7 +5140,7 @@ "chalk": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "integrity": "sha1-tepI78nBeT3MybR2fJORTT8tUro=", "dev": true, "requires": { "ansi-styles": "3.2.0", @@ -6063,19 +5151,19 @@ "commander": { "version": "2.12.2", "resolved": "https://registry.npmjs.org/commander/-/commander-2.12.2.tgz", - "integrity": "sha512-BFnaq5ZOGcDN7FlrtBT4xxkgIToalIIxwjxLWVJ8bGTpe1LroqMiqQXdA7ygc7CRvaYS+9zfPGFnJqFSayx+AA==", + "integrity": "sha1-D1lGxCftnsDZGka7ne9T5UZQ5VU=", "dev": true }, "diff": { "version": "3.4.0", "resolved": "https://registry.npmjs.org/diff/-/diff-3.4.0.tgz", - "integrity": "sha512-QpVuMTEoJMF7cKzi6bvWhRulU1fZqZnvyVQgNhPaxxuTYwyjn/j1v9falseQ/uXWwPnO56RBfwtg4h/EQXmucA==", + "integrity": "sha1-sdhVB9rzlkgo3lSzfQ1zumfdpWw=", "dev": true }, "glob": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "integrity": "sha1-wZyd+aAocC1nhhI4SmVSQExjbRU=", "dev": true, "requires": { "fs.realpath": "1.0.0", @@ -6136,7 +5224,7 @@ "tsutils": { "version": "2.13.0", "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.13.0.tgz", - "integrity": "sha512-FuWzNJbMsp3gcZMbI3b5DomhW4Ia41vMxjN63nKWI0t7f+I3UmHfRl0TrXJTwI2LUduDG+eR1Mksp3pvtlyCFQ==", + "integrity": "sha1-D1K2qrvEIW5yeWtm2wKMbPFz4UQ=", "dev": true, "requires": { "tslib": "1.8.0" @@ -6158,7 +5246,7 @@ "type-detect": { "version": "4.0.5", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.5.tgz", - "integrity": "sha512-N9IvkQslUGYGC24RkJk1ba99foK6TkwC2FHAEBlQFBP0RxQZS8ZpJuAZcwiY/w9ZJHFQb1aOXBI60OdxhTrwEQ==", + "integrity": "sha1-1w5byB223io4G8rKDG4MvcdjXeI=", "dev": true }, "typescript": { @@ -6175,7 +5263,7 @@ "typescript-formatter": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/typescript-formatter/-/typescript-formatter-6.1.0.tgz", - "integrity": "sha512-o2TJSBDSdua8yl8gXNJonM4jr4f7ZuLhsbG7zMG80iJluhE8MWI0R/mPzA3in3omwAJwkcbkc5Xxm74io/J7WA==", + "integrity": "sha1-RCWsK6uKrqmgQlHAePR6t6AgLxM=", "dev": true, "requires": { "commandpost": "1.2.1", @@ -6212,7 +5300,7 @@ "url-parse": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.2.0.tgz", - "integrity": "sha512-DT1XbYAfmQP65M/mE6OALxmXzZ/z1+e5zk2TcSKe/KiYbNGZxgtttzC0mR/sjopbpOXcbniq7eIKmocJnUWlEw==", + "integrity": "sha1-OhnoqqbQI93SfcxEy0/I9/7COYY=", "dev": true, "requires": { "querystringify": "1.0.0", @@ -6234,7 +5322,7 @@ "uuid": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.1.0.tgz", - "integrity": "sha512-DIWtzUkw04M4k3bf1IcpS2tngXEL26YUD2M0tMDUpnUrz2hgzUBlD55a4FjdLGPvfHxS6uluGWvaVEqgBcVa+g==", + "integrity": "sha1-PdPT55Crwk17DToDT/q6vijrvAQ=", "dev": true }, "v8flags": { @@ -6446,7 +5534,7 @@ "vscode": { "version": "1.1.9", "resolved": "https://registry.npmjs.org/vscode/-/vscode-1.1.9.tgz", - "integrity": "sha512-xhSh410NntYViiBYIPimAwF0U6NZgORtqQenlpTI/qKBGwHMtZSCJcL3/JIhfCw43HBXqPg59kA947OT3UvZKQ==", + "integrity": "sha1-F87oj+YozQtTzNZ9PGeDyGY3sHQ=", "dev": true, "requires": { "glob": "7.1.2", @@ -6468,13 +5556,13 @@ "commander": { "version": "2.11.0", "resolved": "https://registry.npmjs.org/commander/-/commander-2.11.0.tgz", - "integrity": "sha512-b0553uYA5YAEGgyYIGYROzKQ7X5RAqedkfjiZxwi0kL1g3bOaBNNZfYkzt/CL0umgD5wc9Jec2FbB98CjkMRvQ==", + "integrity": "sha1-FXFS/R56bI2YpbcVzzdt+SgARWM=", "dev": true }, "debug": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "integrity": "sha1-W7WgZyYotkFJVmuhaBnmFRjGcmE=", "dev": true, "requires": { "ms": "2.0.0" @@ -6483,13 +5571,13 @@ "diff": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/diff/-/diff-3.3.1.tgz", - "integrity": "sha512-MKPHZDMB0o6yHyDryUOScqZibp914ksXwAMYMTHj6KO8UeKsRYNJD3oNCKjTqZon+V488P7N/HzXF8t7ZR95ww==", + "integrity": "sha1-qoVnpu7QPFMfyJ0/cRzQ5SWd7HU=", "dev": true }, "glob": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "integrity": "sha1-wZyd+aAocC1nhhI4SmVSQExjbRU=", "dev": true, "requires": { "fs.realpath": "1.0.0", @@ -6503,13 +5591,13 @@ "growl": { "version": "1.10.3", "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.3.tgz", - "integrity": "sha512-hKlsbA5Vu3xsh1Cg3J7jSmX/WaW6A5oBeqzM88oNbCRQFz+zUaXm6yxS4RVytp1scBoJzSYl4YAEOQIt6O8V1Q==", + "integrity": "sha1-GSa6kM8+3+KttJJ/WIC8IsZseQ8=", "dev": true }, "mocha": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/mocha/-/mocha-4.0.1.tgz", - "integrity": "sha512-evDmhkoA+cBNiQQQdSKZa2b9+W2mpLoj50367lhy+Klnx9OV8XlCIhigUnn1gaTFLQCa0kdNhEGDr0hCXOQFDw==", + "integrity": "sha1-Cu5alc9ppGGIIPXlH6MXFxF9rxs=", "dev": true, "requires": { "browser-stdout": "1.3.0", @@ -6533,7 +5621,7 @@ "supports-color": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz", - "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==", + "integrity": "sha1-iD992rwWUUKyphQn8zUt7RldGj4=", "dev": true, "requires": { "has-flag": "2.0.0" @@ -6614,7 +5702,7 @@ "which": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz", - "integrity": "sha512-xcJpopdamTuY5duC/KnTTNBraPK54YwpenP4lzxU8H91GudWpFv38u0CKjclE1Wi2EH2EDz5LRcHcKbCIzqGyg==", + "integrity": "sha1-/wS9/AEO5UfXgL7DjhrBwnd9JTo=", "dev": true, "requires": { "isexe": "2.0.0" @@ -6634,7 +5722,7 @@ "xml2js": { "version": "0.4.19", "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.19.tgz", - "integrity": "sha512-esZnJZJOiJR9wWKMyuvSE1y6Dq5LCuJanqhxslH2bxM6duahNZ+HMpCLhBQGZkbX6xRf8x1Y2eJlgt2q3qo49Q==", + "integrity": "sha1-aGwg8hMgnpSr8NG88e+qKRx4J6c=", "requires": { "sax": "1.2.4", "xmlbuilder": "9.0.4" diff --git a/pythonFiles/completion.py b/pythonFiles/completion.py index 8c7cd09410dc..f072349d0999 100644 --- a/pythonFiles/completion.py +++ b/pythonFiles/completion.py @@ -208,16 +208,6 @@ def _serialize_completions(self, script, identifier=None, prefix=''): _completion['snippet'] = '%s=$1$0' % name _completion['text'] = name _completion['displayText'] = name - if self.show_doc_strings: - try: - _completion['description'] = signature.docstring() - _completion['raw_docstring'] = signature.docstring(raw=True) - except Exception: - _completion['description'] = '' - _completion['raw_docstring'] = '' - else: - _completion['description'] = self._generate_signature( - signature) _completions.append(_completion) try: @@ -227,22 +217,11 @@ def _serialize_completions(self, script, identifier=None, prefix=''): except : completions = [] for completion in completions: - if self.show_doc_strings: - try: - description = completion.docstring() - except Exception: - description = '' - else: - description = self._generate_signature(completion) - try: - rawDocstring = completion.docstring(raw=True) _completion = { 'text': completion.name, 'type': self._get_definition_type(completion), 'raw_type': completion.type, - 'description': description, - 'raw_docstring': rawDocstring, 'rightLabel': self._additional_info(completion) } except Exception: @@ -252,11 +231,7 @@ def _serialize_completions(self, script, identifier=None, prefix=''): if c['text'] == _completion['text']: c['type'] = _completion['type'] c['raw_type'] = _completion['raw_type'] - if len(c['description']) == 0 and len(c['raw_docstring']) == 0: - c['description'] = _completion['description'] - c['raw_docstring'] = _completion['description'] - - + if any([c['text'].split('=')[0] == _completion['text'] for c in _completions]): # ignore function arguments we already have diff --git a/src/client/common/configSettings.ts b/src/client/common/configSettings.ts index 33347d2c1774..bb1ad2d8445a 100644 --- a/src/client/common/configSettings.ts +++ b/src/client/common/configSettings.ts @@ -124,7 +124,7 @@ export interface ITerminalSettings { launchArgs: string[]; } -function isTestExecution(): boolean { +export function isTestExecution(): boolean { // tslint:disable-next-line:interface-name no-string-literal return process.env['VSC_PYTHON_CI_TEST'] === '1'; } diff --git a/src/client/jedi/parsers/CompletionParser.ts b/src/client/jedi/parsers/CompletionParser.ts deleted file mode 100644 index eedc47842730..000000000000 --- a/src/client/jedi/parsers/CompletionParser.ts +++ /dev/null @@ -1,27 +0,0 @@ -import * as proxy from '../../providers/jediProxy'; -import { extractSignatureAndDocumentation } from '../../providers/jediHelpers'; -import { PythonSettings } from '../../common/configSettings'; -import { CompletionItem, SymbolKind, SnippetString, Uri } from 'vscode'; - -export class CompletionParser { - public static parse(data: proxy.ICompletionResult, resource: Uri): CompletionItem[] { - if (!data || data.items.length === 0) { - return []; - } - return data.items.map(item => { - const sigAndDocs = extractSignatureAndDocumentation(item); - let completionItem = new CompletionItem(item.text); - completionItem.kind = item.type; - completionItem.documentation = sigAndDocs[1].length === 0 ? item.description : sigAndDocs[1]; - completionItem.detail = sigAndDocs[0].split(/\r?\n/).join(''); - if (PythonSettings.getInstance(resource).autoComplete.addBrackets === true && - (item.kind === SymbolKind.Function || item.kind === SymbolKind.Method)) { - completionItem.insertText = new SnippetString(item.text).appendText("(").appendTabstop().appendText(")"); - } - - // ensure the built in memebers are at the bottom - completionItem.sortText = (completionItem.label.startsWith('__') ? 'z' : (completionItem.label.startsWith('_') ? 'y' : '__')) + completionItem.label; - return completionItem; - }); - } -} \ No newline at end of file diff --git a/src/client/jedi/parsers/HoverParser.ts b/src/client/jedi/parsers/HoverParser.ts deleted file mode 100644 index 86bbf680fdef..000000000000 --- a/src/client/jedi/parsers/HoverParser.ts +++ /dev/null @@ -1,71 +0,0 @@ -import { Hover, SymbolKind } from 'vscode'; -import * as proxy from '../../providers/jediProxy'; -import { highlightCode } from '../../providers/jediHelpers'; -import { EOL } from 'os'; -export class HoverParser { - public static parse(data: proxy.IHoverResult, currentWord: string): Hover { - if (!data || !Array.isArray(data.items) || data.items.length === 0) { - return new Hover([]); - } - - let results = []; - let capturedInfo: string[] = []; - data.items.forEach(item => { - let { signature } = item; - switch (item.kind) { - case SymbolKind.Constructor: - case SymbolKind.Function: - case SymbolKind.Method: { - signature = 'def ' + signature; - break; - } - case SymbolKind.Class: { - signature = 'class ' + signature; - break; - } - default: { - signature = typeof item.text === 'string' && item.text.length > 0 ? item.text : currentWord; - } - } - if (item.docstring) { - let lines = item.docstring.split(/\r?\n/); - // If the docstring starts with the signature, then remove those lines from the docstring - if (lines.length > 0 && item.signature.indexOf(lines[0]) === 0) { - lines.shift(); - let endIndex = lines.findIndex(line => item.signature.endsWith(line)); - if (endIndex >= 0) { - lines = lines.filter((line, index) => index > endIndex); - } - } - if (lines.length > 0 && item.signature.startsWith(currentWord) && lines[0].startsWith(currentWord) && lines[0].endsWith(')')) { - lines.shift(); - } - let descriptionWithHighlightedCode = highlightCode(lines.join(EOL)); - let hoverInfo = ['```python', signature, '```', descriptionWithHighlightedCode].join(EOL); - let key = signature + lines.join(''); - // Sometimes we have duplicate documentation, one with a period at the end - if (capturedInfo.indexOf(key) >= 0 || capturedInfo.indexOf(key + '.') >= 0) { - return; - } - capturedInfo.push(key); - capturedInfo.push(key + '.'); - results.push(hoverInfo); - return; - } - if (item.description) { - let descriptionWithHighlightedCode = highlightCode(item.description); - let hoverInfo = '```python' + EOL + signature + EOL + '```' + EOL + descriptionWithHighlightedCode; - let lines = item.description.split(EOL); - let key = signature + lines.join(''); - // Sometimes we have duplicate documentation, one with a period at the end - if (capturedInfo.indexOf(key) >= 0 || capturedInfo.indexOf(key + '.') >= 0) { - return; - } - capturedInfo.push(key); - capturedInfo.push(key + '.'); - results.push(hoverInfo); - } - }); - return new Hover(results); - } -} \ No newline at end of file diff --git a/src/client/languageServices/jediProxyFactory.ts b/src/client/languageServices/jediProxyFactory.ts index 9af0b012d648..ea1745b59b3c 100644 --- a/src/client/languageServices/jediProxyFactory.ts +++ b/src/client/languageServices/jediProxyFactory.ts @@ -1,5 +1,5 @@ import { Disposable, Uri, workspace } from 'vscode'; -import { JediProxy, JediProxyHandler, ICommandResult } from '../providers/jediProxy'; +import { ICommandResult, JediProxy, JediProxyHandler } from '../providers/jediProxy'; export class JediFactory implements Disposable { private disposables: Disposable[]; @@ -20,8 +20,7 @@ export class JediFactory implements Disposable { if (!workspacePath) { if (Array.isArray(workspace.workspaceFolders) && workspace.workspaceFolders.length > 0) { workspacePath = workspace.workspaceFolders[0].uri.fsPath; - } - else { + } else { workspacePath = __dirname; } } diff --git a/src/client/providers/completionProvider.ts b/src/client/providers/completionProvider.ts index b6d62c340dd7..7f02343f60d6 100644 --- a/src/client/providers/completionProvider.ts +++ b/src/client/providers/completionProvider.ts @@ -1,76 +1,39 @@ 'use strict'; import * as vscode from 'vscode'; -import { Position, ProviderResult, SnippetString, Uri } from 'vscode'; -import { PythonSettings } from '../common/configSettings'; -import { Tokenizer } from '../language/tokenizer'; -import { TokenType } from '../language/types'; +import { isTestExecution } from '../common/configSettings'; import { JediFactory } from '../languageServices/jediProxyFactory'; import { captureTelemetry } from '../telemetry'; import { COMPLETION } from '../telemetry/constants'; -import { extractSignatureAndDocumentation } from './jediHelpers'; -import * as proxy from './jediProxy'; +import { CompletionSource } from './completionSource'; export class PythonCompletionItemProvider implements vscode.CompletionItemProvider { + private completionSource: CompletionSource; - public constructor(private jediFactory: JediFactory) { } - private static parseData(data: proxy.ICompletionResult, resource: Uri): vscode.CompletionItem[] { - if (data && data.items.length > 0) { - return data.items.map(item => { - const sigAndDocs = extractSignatureAndDocumentation(item); - const completionItem = new vscode.CompletionItem(item.text); - completionItem.kind = item.type; - completionItem.documentation = sigAndDocs[1].length === 0 ? item.description : sigAndDocs[1]; - completionItem.detail = sigAndDocs[0].split(/\r?\n/).join(''); - if (PythonSettings.getInstance(resource).autoComplete.addBrackets === true && - (item.kind === vscode.SymbolKind.Function || item.kind === vscode.SymbolKind.Method)) { - completionItem.insertText = new SnippetString(item.text).appendText('(').appendTabstop().appendText(')'); - } - - // ensure the built in memebers are at the bottom - completionItem.sortText = (completionItem.label.startsWith('__') ? 'z' : (completionItem.label.startsWith('_') ? 'y' : '__')) + completionItem.label; - return completionItem; - }); - } - return []; + constructor(jediFactory: JediFactory) { + this.completionSource = new CompletionSource(jediFactory); } + @captureTelemetry(COMPLETION) - public provideCompletionItems(document: vscode.TextDocument, position: vscode.Position, token: vscode.CancellationToken): ProviderResult { - if (position.character <= 0) { - return Promise.resolve([]); - } - const filename = document.fileName; - const lineText = document.lineAt(position.line).text; - if (lineText.match(/^\s*\/\//)) { - return Promise.resolve([]); + public async provideCompletionItems(document: vscode.TextDocument, position: vscode.Position, token: vscode.CancellationToken): + Promise { + const items = await this.completionSource.getVsCodeCompletionItems(document, position, token); + if (isTestExecution()) { + for (let i = 0; i < Math.min(3, items.length); i += 1) { + items[i] = await this.resolveCompletionItem(items[i], token); + } } - // Suppress completion inside string and comments - if (this.isPositionInsideStringOrComment(document, position)) { - return Promise.resolve([]); - } - const type = proxy.CommandType.Completions; - const columnIndex = position.character; - - const source = document.getText(); - const cmd: proxy.ICommand = { - command: type, - fileName: filename, - columnIndex: columnIndex, - lineIndex: position.line, - source: source - }; - - return this.jediFactory.getJediProxyHandler(document.uri).sendCommand(cmd, token).then(data => { - return PythonCompletionItemProvider.parseData(data, document.uri); - }); + return items; } - private isPositionInsideStringOrComment(document: vscode.TextDocument, position: vscode.Position): boolean { - const tokenizeTo = position.translate(1, 0); - const text = document.getText(new vscode.Range(new Position(0, 0), tokenizeTo)); - const t = new Tokenizer(); - const tokens = t.Tokenize(text); - const index = tokens.getItemContaining(document.offsetAt(position)); - return index >= 0 && (tokens[index].TokenType === TokenType.String || tokens[index].TokenType === TokenType.Comment); + public async resolveCompletionItem(item: vscode.CompletionItem, token: vscode.CancellationToken): Promise { + if (!item.documentation) { + const itemInfos = await this.completionSource.getDocumentation(item, token); + if (itemInfos && itemInfos.length > 0) { + item.detail = itemInfos[0].detail; + item.documentation = itemInfos[0].documentation; + } + } + return item; } } diff --git a/src/client/providers/completionSource.ts b/src/client/providers/completionSource.ts new file mode 100644 index 000000000000..58a0a48ae835 --- /dev/null +++ b/src/client/providers/completionSource.ts @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +'use strict'; + +import * as vscode from 'vscode'; +import { PythonSettings } from '../common/configSettings'; +import { Tokenizer } from '../language/tokenizer'; +import { TokenType } from '../language/types'; +import { JediFactory } from '../languageServices/jediProxyFactory'; +import { ItemInfoSource, LanguageItemInfo } from './itemInfoSource'; +import * as proxy from './jediProxy'; + +class DocumentPosition { + constructor(public document: vscode.TextDocument, public position: vscode.Position) { } + + public static fromObject(item: object): DocumentPosition { + // tslint:disable-next-line:no-any + return (item as any)._documentPosition as DocumentPosition; + } + + public attachTo(item: object): void { + // tslint:disable-next-line:no-any + (item as any)._documentPosition = this; + } +} + +export class CompletionSource { + private jediFactory: JediFactory; + private itemInfoSource: ItemInfoSource; + + constructor(jediFactory: JediFactory) { + this.jediFactory = jediFactory; + this.itemInfoSource = new ItemInfoSource(jediFactory); + } + + public async getVsCodeCompletionItems(document: vscode.TextDocument, position: vscode.Position, token: vscode.CancellationToken) + : Promise { + const result = await this.getCompletionResult(document, position, token); + if (result === undefined) { + return Promise.resolve([]); + } + return this.toVsCodeCompletions(new DocumentPosition(document, position), result, document.uri); + } + + public async getDocumentation(completionItem: vscode.CompletionItem, token: vscode.CancellationToken): Promise { + const documentPosition = DocumentPosition.fromObject(completionItem); + if (documentPosition === undefined) { + return; + } + + // Supply hover source with simulated document text where item in question was 'already typed'. + const document = documentPosition.document; + const position = documentPosition.position; + const itemText = completionItem.insertText ? completionItem.insertText : completionItem.label; + const wordRange = document.getWordRangeAtPosition(position); + + const leadingRange = wordRange !== undefined + ? new vscode.Range(new vscode.Position(0, 0), wordRange.start) + : new vscode.Range(new vscode.Position(0, 0), position); + + const itemString = `${itemText}`; + const sourceText = `${document.getText(leadingRange)}${itemString}`; + const range = new vscode.Range(leadingRange.end, leadingRange.end.translate(0, itemString.length)); + + return await this.itemInfoSource.getItemInfoFromText(document.uri, document.fileName, range, sourceText, token); + } + + private async getCompletionResult(document: vscode.TextDocument, position: vscode.Position, token: vscode.CancellationToken) + : Promise { + if (position.character <= 0) { + return undefined; + } + const filename = document.fileName; + const lineText = document.lineAt(position.line).text; + if (lineText.match(/^\s*\/\//)) { + return undefined; + } + // Suppress completion inside string and comments. + if (this.isPositionInsideStringOrComment(document, position)) { + return undefined; + } + const type = proxy.CommandType.Completions; + const columnIndex = position.character; + + const source = document.getText(); + const cmd: proxy.ICommand = { + command: type, + fileName: filename, + columnIndex: columnIndex, + lineIndex: position.line, + source: source + }; + + return await this.jediFactory.getJediProxyHandler(document.uri).sendCommand(cmd, token); + } + + private toVsCodeCompletions(documentPosition: DocumentPosition, data: proxy.ICompletionResult, resource: vscode.Uri): vscode.CompletionItem[] { + return data && data.items.length > 0 ? data.items.map(item => this.toVsCodeCompletion(documentPosition, item, resource)) : []; + } + + private toVsCodeCompletion(documentPosition: DocumentPosition, item: proxy.IAutoCompleteItem, resource: vscode.Uri): vscode.CompletionItem { + const completionItem = new vscode.CompletionItem(item.text); + completionItem.kind = item.type; + if (PythonSettings.getInstance(resource).autoComplete.addBrackets === true && + (item.kind === vscode.SymbolKind.Function || item.kind === vscode.SymbolKind.Method)) { + completionItem.insertText = new vscode.SnippetString(item.text).appendText('(').appendTabstop().appendText(')'); + } + // Ensure the built in members are at the bottom. + completionItem.sortText = (completionItem.label.startsWith('__') ? 'z' : (completionItem.label.startsWith('_') ? 'y' : '__')) + completionItem.label; + documentPosition.attachTo(completionItem); + return completionItem; + } + + private isPositionInsideStringOrComment(document: vscode.TextDocument, position: vscode.Position): boolean { + const tokenizeTo = position.translate(1, 0); + const text = document.getText(new vscode.Range(new vscode.Position(0, 0), tokenizeTo)); + const t = new Tokenizer(); + const tokens = t.Tokenize(text); + const index = tokens.getItemContaining(document.offsetAt(position)); + return index >= 0 && (tokens[index].TokenType === TokenType.String || tokens[index].TokenType === TokenType.Comment); + } +} diff --git a/src/client/providers/hoverProvider.ts b/src/client/providers/hoverProvider.ts index 8c50b336fcfa..745300986189 100644 --- a/src/client/providers/hoverProvider.ts +++ b/src/client/providers/hoverProvider.ts @@ -1,107 +1,24 @@ 'use strict'; -import { EOL } from 'os'; import * as vscode from 'vscode'; import { JediFactory } from '../languageServices/jediProxyFactory'; import { captureTelemetry } from '../telemetry'; import { HOVER_DEFINITION } from '../telemetry/constants'; -import { highlightCode } from './jediHelpers'; -import * as proxy from './jediProxy'; +import { ItemInfoSource } from './itemInfoSource'; export class PythonHoverProvider implements vscode.HoverProvider { - public constructor(private jediFactory: JediFactory) { } - private static parseData(data: proxy.IHoverResult, currentWord: string): vscode.Hover { - const results = []; - const capturedInfo: string[] = []; - data.items.forEach(item => { - let { signature } = item; - switch (item.kind) { - case vscode.SymbolKind.Constructor: - case vscode.SymbolKind.Function: - case vscode.SymbolKind.Method: { - signature = `def ${signature}`; - break; - } - case vscode.SymbolKind.Class: { - signature = `class ${signature}`; - break; - } - default: { - signature = typeof item.text === 'string' && item.text.length > 0 ? item.text : currentWord; - } - } - if (item.docstring) { - let lines = item.docstring.split(/\r?\n/); - // If the docstring starts with the signature, then remove those lines from the docstring. - if (lines.length > 0 && item.signature.indexOf(lines[0]) === 0) { - lines.shift(); - const endIndex = lines.findIndex(line => item.signature.endsWith(line)); - if (endIndex >= 0) { - lines = lines.filter((line, index) => index > endIndex); - } - } - if (lines.length > 0 && item.signature.startsWith(currentWord) && lines[0].startsWith(currentWord) && lines[0].endsWith(')')) { - lines.shift(); - } - const descriptionWithHighlightedCode = highlightCode(lines.join(EOL)); - const hoverInfo = ['```python', signature, '```', descriptionWithHighlightedCode].join(EOL); - const key = signature + lines.join(''); - // Sometimes we have duplicate documentation, one with a period at the end. - if (capturedInfo.indexOf(key) >= 0 || capturedInfo.indexOf(`${key}.`) >= 0) { - return; - } - capturedInfo.push(key); - capturedInfo.push(`${key}.`); - results.push(hoverInfo); - return; - } - if (item.description) { - const descriptionWithHighlightedCode = highlightCode(item.description); - // tslint:disable-next-line:prefer-template - const hoverInfo = '```python' + EOL + signature + EOL + '```' + EOL + descriptionWithHighlightedCode; - const lines = item.description.split(EOL); - const key = signature + lines.join(''); - // Sometimes we have duplicate documentation, one with a period at the end. - if (capturedInfo.indexOf(key) >= 0 || capturedInfo.indexOf(`${key}.`) >= 0) { - return; - } - capturedInfo.push(key); - capturedInfo.push(`${key}.`); - results.push(hoverInfo); - } - }); - return new vscode.Hover(results); - } - @captureTelemetry(HOVER_DEFINITION) - public async provideHover(document: vscode.TextDocument, position: vscode.Position, token: vscode.CancellationToken): Promise { - const filename = document.fileName; - if (document.lineAt(position.line).text.match(/^\s*\/\//)) { - return null; - } - if (position.character <= 0) { - return null; - } + private itemInfoSource: ItemInfoSource; - const range = document.getWordRangeAtPosition(position); - if (!range || range.isEmpty) { - return null; - } - const word = document.getText(range); - const cmd: proxy.ICommand = { - command: proxy.CommandType.Hover, - fileName: filename, - columnIndex: range.end.character, - lineIndex: position.line - }; - if (document.isDirty) { - cmd.source = document.getText(); - } + constructor(jediFactory: JediFactory) { + this.itemInfoSource = new ItemInfoSource(jediFactory); + } - const data = await this.jediFactory.getJediProxyHandler(document.uri).sendCommand(cmd, token); - if (!data || !data.items.length) { - return; + @captureTelemetry(HOVER_DEFINITION) + public async provideHover(document: vscode.TextDocument, position: vscode.Position, token: vscode.CancellationToken) + : Promise { + const itemInfos = await this.itemInfoSource.getItemInfoFromDocument(document, position, token); + if (itemInfos) { + return new vscode.Hover(itemInfos.map(item => item.tooltip)); + } } - - return PythonHoverProvider.parseData(data, word); - } } diff --git a/src/client/providers/itemInfoSource.ts b/src/client/providers/itemInfoSource.ts new file mode 100644 index 000000000000..9dc906e23580 --- /dev/null +++ b/src/client/providers/itemInfoSource.ts @@ -0,0 +1,229 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +'use strict'; + +import { EOL } from 'os'; +import * as vscode from 'vscode'; +import { JediFactory } from '../languageServices/jediProxyFactory'; +import * as proxy from './jediProxy'; +import { IHoverItem } from './jediProxy'; + +export class LanguageItemInfo { + constructor( + public tooltip: vscode.MarkdownString, + public detail: string, + public documentation: vscode.MarkdownString) { } +} + +export class ItemInfoSource { + constructor(private jediFactory: JediFactory) { } + + public async getItemInfoFromText(documentUri: vscode.Uri, fileName: string, range: vscode.Range, sourceText: string, token: vscode.CancellationToken) + : Promise { + const result = await this.getHoverResultFromTextRange(documentUri, fileName, range, sourceText, token); + if (!result || !result.items.length) { + return; + } + return this.getItemInfoFromHoverResult(result, ''); + } + + public async getItemInfoFromDocument(document: vscode.TextDocument, position: vscode.Position, token: vscode.CancellationToken) + : Promise { + const range = document.getWordRangeAtPosition(position); + if (!range || range.isEmpty) { + return; + } + const result = await this.getHoverResultFromDocument(document, position, token); + if (!result || !result.items.length) { + return; + } + const word = document.getText(range); + return this.getItemInfoFromHoverResult(result, word); + } + + private async getHoverResultFromDocument(document: vscode.TextDocument, position: vscode.Position, token: vscode.CancellationToken) + : Promise { + if (position.character <= 0 || document.lineAt(position.line).text.match(/^\s*\/\//)) { + return; + } + const range = document.getWordRangeAtPosition(position); + if (!range || range.isEmpty) { + return; + } + return await this.getHoverResultFromDocumentRange(document, range, token); + } + + private async getHoverResultFromDocumentRange(document: vscode.TextDocument, range: vscode.Range, token: vscode.CancellationToken) + : Promise { + const cmd: proxy.ICommand = { + command: proxy.CommandType.Hover, + fileName: document.fileName, + columnIndex: range.end.character, + lineIndex: range.end.line + }; + if (document.isDirty) { + cmd.source = document.getText(); + } + return await this.jediFactory.getJediProxyHandler(document.uri).sendCommand(cmd, token); + } + + private async getHoverResultFromTextRange(documentUri: vscode.Uri, fileName: string, range: vscode.Range, sourceText: string, token: vscode.CancellationToken) + : Promise { + const cmd: proxy.ICommand = { + command: proxy.CommandType.Hover, + fileName: fileName, + columnIndex: range.end.character, + lineIndex: range.end.line, + source: sourceText + }; + return await this.jediFactory.getJediProxyHandler(documentUri).sendCommand(cmd, token); + } + + private getItemInfoFromHoverResult(data: proxy.IHoverResult, currentWord: string): LanguageItemInfo[] { + const infos: LanguageItemInfo[] = []; + const capturedInfo: string[] = []; + + data.items.forEach(item => { + let { signature } = item; + switch (item.kind) { + case vscode.SymbolKind.Constructor: + case vscode.SymbolKind.Function: + case vscode.SymbolKind.Method: { + signature = `def ${signature}`; + break; + } + case vscode.SymbolKind.Class: { + signature = `class ${signature}`; + break; + } + default: { + signature = typeof item.text === 'string' && item.text.length > 0 ? item.text : currentWord; + } + } + if (item.docstring) { + let lines = item.docstring.split(/\r?\n/); + const dnd = this.getDetailAndDescription(item, lines); + + // If the docstring starts with the signature, then remove those lines from the docstring. + if (lines.length > 0 && item.signature.indexOf(lines[0]) === 0) { + lines.shift(); + const endIndex = lines.findIndex(line => item.signature.endsWith(line)); + if (endIndex >= 0) { + lines = lines.filter((line, index) => index > endIndex); + } + } + if (lines.length > 0 && item.signature.startsWith(currentWord) && lines[0].startsWith(currentWord) && lines[0].endsWith(')')) { + lines.shift(); + } + + const descriptionWithHighlightedCode = this.highlightCode(dnd[1]); + const tooltip = new vscode.MarkdownString(['y```python', signature, '```', descriptionWithHighlightedCode].join(EOL)); + infos.push(new LanguageItemInfo(tooltip, dnd[0], new vscode.MarkdownString(dnd[1]))); + + const key = signature + lines.join(''); + // Sometimes we have duplicate documentation, one with a period at the end. + if (capturedInfo.indexOf(key) >= 0 || capturedInfo.indexOf(`${key}.`) >= 0) { + return; + } + capturedInfo.push(key); + capturedInfo.push(`${key}.`); + return; + } + + if (item.description) { + const descriptionWithHighlightedCode = this.highlightCode(item.description); + // tslint:disable-next-line:prefer-template + const tooltip = new vscode.MarkdownString('```python' + `${EOL}${signature}${EOL}` + '```' + `${EOL}${descriptionWithHighlightedCode}`); + + const lines = item.description.split(EOL); + const dd = this.getDetailAndDescription(item, lines); + infos.push(new LanguageItemInfo(tooltip, dd[0], new vscode.MarkdownString(dd[1]))); + + const key = signature + lines.join(''); + // Sometimes we have duplicate documentation, one with a period at the end. + if (capturedInfo.indexOf(key) >= 0 || capturedInfo.indexOf(`${key}.`) >= 0) { + return; + } + + capturedInfo.push(key); + capturedInfo.push(`${key}.`); + return; + } + }); + return infos; + } + + private getDetailAndDescription(item: IHoverItem, lines: string[]): [string, string] { + let detail: string; + let description: string; + + if (item.signature && item.signature.length > 0) { + detail = lines.length > 0 ? lines[0] : ''; + description = lines.filter((line, index) => index > 0).join(EOL).trim(); + } else { + detail = item.description; + description = lines.join(EOL).trim(); + } + return [detail, description]; + } + + private highlightCode(docstring: string): string { + /********** + * + * Magic. Do not touch. [What is the best comment in source code](https://stackoverflow.com/a/185106) + * + * This method uses several regexs to 'translate' reStructruedText syntax (Python doc syntax) to Markdown syntax. + * + * Let's just keep it unchanged unless a better solution becomes possible. + * + **********/ + // Add 2 line break before and after docstring (used to match a blank line) + docstring = EOL + EOL + docstring.trim() + EOL + EOL; + // Section title -> heading level 2 + docstring = docstring.replace(/(.+\r?\n)[-=]+\r?\n/g, `## $1${EOL}`); + // Directives: '.. directive::' -> '**directive**' + docstring = docstring.replace(/\.\. (.*)::/g, '**$1**'); + // Pattern of 'var : description' + const paramLinePattern = '[\\*\\w_]+ ?:[^:\r\n]+'; + // Add new line after and before param line + docstring = docstring.replace(new RegExp(`(${EOL + paramLinePattern})`, 'g'), `$1${EOL}`); + docstring = docstring.replace(new RegExp(`(${EOL + paramLinePattern + EOL})`, 'g'), `${EOL}$1`); + // 'var : description' -> '`var` description' + docstring = docstring.replace(/\r?\n([\*\w]+) ?: ?([^:\r\n]+\r?\n)/g, `${EOL}\`$1\` $2`); + // Doctest blocks: begin with `>>>` and end with blank line + // tslint:disable-next-line:prefer-template + docstring = docstring.replace(/(>>>[\w\W]+?\r?\n)\r?\n/g, `${'```python' + EOL}$1${'```' + EOL + EOL}`); + // Literal blocks: begin with `::` (literal blocks are indented or quoted; for simplicity, we end literal blocks with blank line) + // tslint:disable-next-line:prefer-template + docstring = docstring.replace(/(\r?\n[^\.]*)::\r?\n\r?\n([\w\W]+?\r?\n)\r?\n/g, `$1${EOL + '```' + EOL}$2${'```' + EOL + EOL}`); + // Remove indentation in Field lists and Literal blocks + let inCodeBlock = false; + let codeIndentation = 0; + const lines = docstring.split(/\r?\n/); + for (let i = 0; i < lines.length; i += 1) { + const line = lines[i]; + if (line.startsWith('```')) { + inCodeBlock = !inCodeBlock; + if (inCodeBlock) { + const match = lines[i + 1].match(/^ */); + codeIndentation = match && match.length > 0 ? match[0].length : 0; + } + continue; + } + if (!inCodeBlock) { + lines[i] = line.replace(/^ {4,8}/, ''); + // Field lists: ':field:' -> '**field**' + lines[i] = lines[i].replace(/:(.+?):/g, '**$1** '); + } else { + if (codeIndentation !== 0) { + lines[i] = line.substring(codeIndentation); + } + } + } + docstring = lines.join(EOL); + // Grid Tables + docstring = docstring.replace(/\r?\n[\+-]+\r?\n/g, EOL); + docstring = docstring.replace(/\r?\n[\+=]+\r?\n/g, s => s.replace(/\+/g, '|').replace(/=/g, '-')); + return docstring.trim(); + } +} diff --git a/src/client/providers/jediHelpers.ts b/src/client/providers/jediHelpers.ts deleted file mode 100644 index 9ff87f966b84..000000000000 --- a/src/client/providers/jediHelpers.ts +++ /dev/null @@ -1,106 +0,0 @@ -import * as proxy from './jediProxy'; -import { EOL } from 'os'; -import * as vscode from 'vscode'; - -export function extractSignatureAndDocumentation(definition: proxy.IAutoCompleteItem, highlightCode: boolean = false): [string, string] { - // Somtimes the signature of the function, class (whatever) is broken into multiple lines - // Here's an example - // ```python - // def __init__(self, group=None, target=None, name=None, - // args=(), kwargs=None, verbose=None): - // """This constructor should always be called with keyword arguments. Arguments are: - - // *group* should be None; reserved for future extension when a ThreadGroup - // class is implemented. - /// """ - /// ``` - const txt = definition.description || definition.text; - const rawDocString = typeof definition.raw_docstring === 'string' ? definition.raw_docstring.trim() : ''; - const firstLineOfRawDocString = rawDocString.length > 0 ? rawDocString.split(/\r?\n/)[0] : ''; - let lines = txt.split(/\r?\n/); - const startIndexOfDocString = firstLineOfRawDocString === '' ? -1 : lines.findIndex(line => line.indexOf(firstLineOfRawDocString) === 0); - - let signatureLines = startIndexOfDocString === -1 ? [lines.shift()] : lines.splice(0, startIndexOfDocString); - let signature = signatureLines.filter(line => line.trim().length > 0).join(EOL); - - switch (definition.type) { - case vscode.CompletionItemKind.Constructor: - case vscode.CompletionItemKind.Function: - case vscode.CompletionItemKind.Method: { - signature = 'def ' + signature; - break; - } - case vscode.CompletionItemKind.Class: { - signature = 'class ' + signature; - break; - } - } - - // check if we have any sample code in the documentation - if (highlightCode) { - lines = lines.map(line => { - if (line.trim().startsWith('>>> ')) { - return '```python\n' + line.substring(4).trim() + '\n```'; - } - return line; - }); - } - return [signature, lines.join(EOL).trim().replace(/^\s+|\s+$/g, '').trim()]; -} - -export function highlightCode(docstring: string): string { - /********** - * - * Magic. Do not touch. [What is the best comment in source code](https://stackoverflow.com/a/185106) - * - * This method uses several regexs to 'translate' reStructruedText syntax (Python doc syntax) to Markdown syntax. - * - * Let's just keep it unchanged unless a better solution becomes possible. - * - **********/ - // Add 2 line break before and after docstring (used to match a blank line) - docstring = EOL + EOL + docstring.trim() + EOL + EOL; - // Section title -> heading level 2 - docstring = docstring.replace(/(.+\r?\n)[-=]+\r?\n/g, '## $1' + EOL); - // Directives: '.. directive::' -> '**directive**' - docstring = docstring.replace(/\.\. (.*)::/g, '**$1**'); - // Pattern of 'var : description' - let paramLinePattern = '[\\*\\w_]+ ?:[^:\r\n]+'; - // Add new line after and before param line - docstring = docstring.replace(new RegExp(`(${EOL + paramLinePattern})`, 'g'), `$1${EOL}`); - docstring = docstring.replace(new RegExp(`(${EOL + paramLinePattern + EOL})`, 'g'), `${EOL}$1`); - // 'var : description' -> '`var` description' - docstring = docstring.replace(/\r?\n([\*\w]+) ?: ?([^:\r\n]+\r?\n)/g, `${EOL}\`$1\` $2`); - // Doctest blocks: begin with `>>>` and end with blank line - docstring = docstring.replace(/(>>>[\w\W]+?\r?\n)\r?\n/g, `${'```python' + EOL}$1${'```' + EOL + EOL}`); - // Literal blocks: begin with `::` (literal blocks are indented or quoted; for simplicity, we end literal blocks with blank line) - docstring = docstring.replace(/(\r?\n[^\.]*)::\r?\n\r?\n([\w\W]+?\r?\n)\r?\n/g, `$1${EOL + '```' + EOL}$2${'```' + EOL + EOL}`); - // Remove indentation in Field lists and Literal blocks - let inCodeBlock = false; - let codeIndentation = 0; - let lines = docstring.split(/\r?\n/); - for (let i = 0; i < lines.length; i++) { - let line = lines[i]; - if (line.startsWith('```')) { - inCodeBlock = !inCodeBlock; - if (inCodeBlock) { - codeIndentation = lines[i + 1].match(/^ */)[0].length; - } - continue; - } - if (!inCodeBlock) { - lines[i] = line.replace(/^ {4,8}/, ''); - // Field lists: ':field:' -> '**field**' - lines[i] = lines[i].replace(/:(.+?):/g, '**$1** '); - } else { - if (codeIndentation !== 0) { - lines[i] = line.substring(codeIndentation); - } - } - } - docstring = lines.join(EOL); - // Grid Tables - docstring = docstring.replace(/\r?\n[\+-]+\r?\n/g, EOL); - docstring = docstring.replace(/\r?\n[\+=]+\r?\n/g, s => s.replace(/\+/g, '|').replace(/=/g, '-')); - return docstring.trim(); -} diff --git a/src/client/providers/jediProxy.ts b/src/client/providers/jediProxy.ts index e6bd06a4ffa6..a5916c6a9b15 100644 --- a/src/client/providers/jediProxy.ts +++ b/src/client/providers/jediProxy.ts @@ -1,15 +1,14 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. 'use strict'; import * as child_process from 'child_process'; import * as path from 'path'; import * as vscode from 'vscode'; -import { IPythonSettings, PythonSettings } from '../common/configSettings'; +import { PythonSettings } from '../common/configSettings'; import { mergeEnvVariables } from '../common/envFileParser'; import { createDeferred, Deferred } from '../common/helpers'; import { execPythonFile, getCustomEnvVarsSync, validatePath } from '../common/utils'; -import { getCustomEnvVars } from '../common/utils'; -import * as telemetryHelper from '../telemetry'; -import * as settings from './../common/configSettings'; import * as logger from './../common/logger'; const IS_WINDOWS = /^win/.test(process.platform); @@ -88,20 +87,22 @@ pythonVSCodeSymbolMappings.set('list', vscode.SymbolKind.Array); function getMappedVSCodeType(pythonType: string): vscode.CompletionItemKind { if (pythonVSCodeTypeMappings.has(pythonType)) { - return pythonVSCodeTypeMappings.get(pythonType); - } - else { - return vscode.CompletionItemKind.Keyword; + const value = pythonVSCodeTypeMappings.get(pythonType); + if (value) { + return value; + } } + return vscode.CompletionItemKind.Keyword; } function getMappedVSCodeSymbol(pythonType: string): vscode.SymbolKind { if (pythonVSCodeSymbolMappings.has(pythonType)) { - return pythonVSCodeSymbolMappings.get(pythonType); - } - else { - return vscode.SymbolKind.Variable; + const value = pythonVSCodeSymbolMappings.get(pythonType); + if (value) { + return value; + } } + return vscode.SymbolKind.Variable; } export enum CommandType { @@ -113,7 +114,7 @@ export enum CommandType { Symbols } -var commandNames = new Map(); +const commandNames = new Map(); commandNames.set(CommandType.Arguments, 'arguments'); commandNames.set(CommandType.Completions, 'completions'); commandNames.set(CommandType.Definitions, 'definitions'); @@ -122,35 +123,77 @@ commandNames.set(CommandType.Usages, 'usages'); commandNames.set(CommandType.Symbols, 'names'); export class JediProxy implements vscode.Disposable { - private proc: child_process.ChildProcess; + private proc: child_process.ChildProcess | null; private pythonSettings: PythonSettings; + private cmdId: number = 0; + private pythonProcessCWD = ''; + private lastKnownPythonInterpreter: string; + private previousData = ''; + private commands = new Map>(); + private commandQueue: number[] = []; + private spawnRetryAttempts = 0; + private lastKnownPythonPath: string; + private additionalAutoCopletePaths: string[] = []; + private workspacePath: string; - public constructor(private extensionRootDir: string, private workspacePath: string) { + public constructor(extensionRootDir: string, workspacePath: string) { + this.workspacePath = workspacePath; this.pythonSettings = PythonSettings.getInstance(vscode.Uri.file(workspacePath)); - this.lastKnownPythonInterpreter = this.pythonSettings.pythonPath + this.lastKnownPythonInterpreter = this.pythonSettings.pythonPath; this.pythonSettings.on('change', this.onPythonSettingsChanged.bind(this)); vscode.workspace.onDidChangeConfiguration(this.onConfigChanged.bind(this)); this.onConfigChanged(); this.initialize(extensionRootDir); } + + private static getProperty(o: object, name: string): T { + return o[name]; + } + public dispose() { this.killProcess(); } - private cmdId: number = 0; public getNextCommandId(): number { - return this.cmdId++; + const result = this.cmdId; + this.cmdId += 1; + return result; + } + + public sendCommand(cmd: ICommand): Promise { + if (!this.proc) { + return Promise.reject(new Error('Python proc not initialized')); + } + const executionCmd = >cmd; + const payload = this.createPayload(executionCmd); + executionCmd.deferred = createDeferred(); + // if (typeof executionCmd.telemetryEvent === 'string') { + // executionCmd.delays = new telemetryHelper.Delays(); + // } + try { + this.proc.stdin.write(`${JSON.stringify(payload)}\n`); + this.commands.set(executionCmd.id, executionCmd); + this.commandQueue.push(executionCmd.id); + } catch (ex) { + console.error(ex); + //If 'This socket is closed.' that means process didn't start at all (at least not properly). + if (ex.message === 'This socket is closed.') { + this.killProcess(); + } else { + this.handleError('sendCommand', ex.message); + } + return Promise.reject(ex); + } + return executionCmd.deferred.promise; } // keep track of the directory so we can re-spawn the process. - private pythonProcessCWD = ''; private initialize(dir: string) { this.pythonProcessCWD = dir; this.spawnProcess(path.join(dir, 'pythonFiles')); } // Check if settings changes. - private lastKnownPythonInterpreter: string; private onPythonSettingsChanged() { if (this.lastKnownPythonInterpreter === this.pythonSettings.pythonPath) { return; @@ -163,33 +206,32 @@ export class JediProxy implements vscode.Disposable { private clearPendingRequests() { this.commandQueue = []; this.commands.forEach(item => { - item.deferred.resolve(); + if (item.deferred !== undefined) { + item.deferred.resolve(); + } }); this.commands.clear(); } - private previousData = ''; - private commands = new Map>(); - private commandQueue: number[] = []; private killProcess() { try { if (this.proc) { this.proc.kill(); } - } - catch (ex) { } + // tslint:disable-next-line:no-empty + } catch (ex) { } this.proc = null; } private handleError(source: string, errorMessage: string) { - logger.error(source + ' jediProxy', `Error (${source}) ${errorMessage}`); + logger.error(`${source} jediProxy`, `Error (${source}) ${errorMessage}`); } - private spawnRetryAttempts = 0; + // tslint:disable-next-line:max-func-body-length private spawnProcess(dir: string) { try { - let environmentVariables: Object & { [key: string]: string } = { 'PYTHONUNBUFFERED': '1' }; - let customEnvironmentVars = getCustomEnvVarsSync(vscode.Uri.file(dir)); + let environmentVariables: Object & { [key: string]: string } = { PYTHONUNBUFFERED: '1' }; + const customEnvironmentVars = getCustomEnvVarsSync(vscode.Uri.file(dir)); if (customEnvironmentVars) { environmentVariables = mergeEnvVariables(environmentVariables, customEnvironmentVars); } @@ -201,27 +243,24 @@ export class JediProxy implements vscode.Disposable { this.pythonSettings.devOptions.some(item => item.toUpperCase().trim() === 'USERELEASEAUTOCOMP')) { // Use standard version of jedi library. args.push('std'); - } - else { + } else { // Use preview version of jedi library. args.push('preview'); } - } - else { + } else { args.push('custom'); args.push(this.pythonSettings.jediPath); } if (Array.isArray(this.pythonSettings.autoComplete.preloadModules) && this.pythonSettings.autoComplete.preloadModules.length > 0) { - var modules = this.pythonSettings.autoComplete.preloadModules.filter(m => m.trim().length > 0).join(','); + const modules = this.pythonSettings.autoComplete.preloadModules.filter(m => m.trim().length > 0).join(','); args.push(modules); } this.proc = child_process.spawn(this.pythonSettings.pythonPath, args, { cwd: dir, env: environmentVariables }); - } - catch (ex) { + } catch (ex) { return this.handleError('spawnProcess', ex.message); } this.proc.stderr.setEncoding('utf8'); @@ -229,27 +268,28 @@ export class JediProxy implements vscode.Disposable { this.handleError('stderr', data); }); this.proc.on('end', (end) => { - logger.error('spawnProcess.end', 'End - ' + end); + logger.error('spawnProcess.end', `End - ${end}`); }); this.proc.on('error', error => { - this.handleError('error', error + ''); - this.spawnRetryAttempts++; + this.handleError('error', `${error}`); + this.spawnRetryAttempts += 1; if (this.spawnRetryAttempts < 10 && error && error.message && error.message.indexOf('This socket has been ended by the other party') >= 0) { this.spawnProcess(dir); } }); this.proc.stdout.setEncoding('utf8'); + // tslint:disable-next-line:max-func-body-length this.proc.stdout.on('data', (data: string) => { // Possible there was an exception in parsing the data returned, // so append the data then parse it. - var dataStr = this.previousData = this.previousData + data + ''; - var responses: any[]; + const dataStr = this.previousData = `${this.previousData}${data}`; + // tslint:disable-next-line:no-any + let responses: any[]; try { responses = dataStr.split(/\r?\n/g).filter(line => line.length > 0).map(resp => JSON.parse(resp)); this.previousData = ''; - } - catch (ex) { + } catch (ex) { // Possible we've only received part of the data, hence don't clear previousData. // Don't log errors when we haven't received the entire response. if (ex.message.indexOf('Unexpected end of input') === -1 && @@ -266,206 +306,199 @@ export class JediProxy implements vscode.Disposable { // I think this needs to be removed, because this is misspelt, it is argments, 'U' is missing, // And that case is handled further down // case CommandType.Arguments: { - // Rewrite this mess to use stratergy.. - if (response['argments']) { - var index = this.commandQueue.indexOf(cmd.id); - this.commandQueue.splice(index, 1); + + const responseId = JediProxy.getProperty(response, 'id'); + const cmd = >this.commands.get(responseId); + if (cmd === null) { return; } - var responseId = response['id']; - var cmd = >this.commands.get(responseId); - if (typeof cmd === 'object' && cmd !== null) { - this.commands.delete(responseId); - var index = this.commandQueue.indexOf(cmd.id); - this.commandQueue.splice(index, 1); - - if (cmd.delay && typeof cmd.telemetryEvent === 'string') { - // cmd.delays.stop(); - // telemetryHelper.sendTelemetryEvent(cmd.telemetryEvent, null, cmd.delays.toMeasures()); - } + if (JediProxy.getProperty(response, 'arguments')) { + this.commandQueue.splice(this.commandQueue.indexOf(cmd.id), 1); + return; + } - // Check if this command has expired. - if (cmd.token.isCancellationRequested) { - cmd.deferred.resolve(); - return; - } + this.commands.delete(responseId); + const index = this.commandQueue.indexOf(cmd.id); + if (index) { + this.commandQueue.splice(index, 1); + } - switch (cmd.command) { - case CommandType.Completions: { - let results = response['results']; - results = Array.isArray(results) ? results : []; - results.forEach(item => { - const originalType = item.type; - item.type = getMappedVSCodeType(originalType); - item.kind = getMappedVSCodeSymbol(originalType); - item.rawType = getMappedVSCodeType(originalType); - }); - - let completionResult: ICompletionResult = { - items: results, - requestId: cmd.id - }; - cmd.deferred.resolve(completionResult); - break; - } - case CommandType.Definitions: { - let defs = response['results']; - let defResult: IDefinitionResult = { - requestId: cmd.id, - definitions: [] - }; - if (defs.length > 0) { - defResult.definitions = defs.map(def => { - const originalType = def.type as string; - return { - fileName: def.fileName, - text: def.text, - rawType: originalType, - type: getMappedVSCodeType(originalType), - kind: getMappedVSCodeSymbol(originalType), - container: def.container, - range: { - startLine: def.range.start_line, - startColumn: def.range.start_column, - endLine: def.range.end_line, - endColumn: def.range.end_column - } - }; - }); - } - - cmd.deferred.resolve(defResult); - break; - } - case CommandType.Hover: { - let defs = response['results']; - var defResult: IHoverResult = { - requestId: cmd.id, - items: defs.map(def => { - return { - kind: getMappedVSCodeSymbol(def.type), - description: def.description, - signature: def.signature, - docstring: def.docstring, - text: def.text - }; - }) - }; - - cmd.deferred.resolve(defResult); - break; - } - case CommandType.Symbols: { - let defs = response['results']; - defs = Array.isArray(defs) ? defs : []; - var defResults: ISymbolResult = { - requestId: cmd.id, - definitions: [] - }; - defResults.definitions = defs.map(def => { - const originalType = def.type as string; - return { - fileName: def.fileName, - text: def.text, - rawType: originalType, - type: getMappedVSCodeType(originalType), - kind: getMappedVSCodeSymbol(originalType), - container: def.container, - range: { - startLine: def.range.start_line, - startColumn: def.range.start_column, - endLine: def.range.end_line, - endColumn: def.range.end_column - } - }; - }); - - cmd.deferred.resolve(defResults); - break; - } - case CommandType.Usages: { - let defs = response['results']; - defs = Array.isArray(defs) ? defs : []; - var refResult: IReferenceResult = { - requestId: cmd.id, - references: defs.map(item => { - return { - columnIndex: item.column, - fileName: item.fileName, - lineIndex: item.line - 1, - moduleName: item.moduleName, - name: item.name - }; - } - ) - }; - - cmd.deferred.resolve(refResult); - break; - } - case CommandType.Arguments: { - let defs = response['results']; - cmd.deferred.resolve({ - requestId: cmd.id, - definitions: defs - }); - break; - } - } + // Check if this command has expired. + if (cmd.token.isCancellationRequested) { + this.safeResolve(cmd, undefined); + return; } - //Ok, check if too many pending requets. - if (this.commandQueue.length > 10) { - var items = this.commandQueue.splice(0, this.commandQueue.length - 10); - items.forEach(id => { - if (this.commands.has(id)) { - const cmd = this.commands.get(id); - try { - cmd.deferred.resolve(null); - } - catch (ex) { - } - this.commands.delete(id); - } - }); + switch (cmd.command) { + case CommandType.Completions: + this.onCompletion(cmd, response); + break; + case CommandType.Definitions: + this.onDefinition(cmd, response); + break; + case CommandType.Hover: + this.onHover(cmd, response); + break; + case CommandType.Symbols: + this.onSymbols(cmd, response); + break; + case CommandType.Usages: + this.onUsages(cmd, response); + break; + case CommandType.Arguments: + this.onArguments(cmd, response); + break; + default: + break; } + // Check if too many pending requets. + this.checkQueueLength(); }); }); } - public sendCommand(cmd: ICommand): Promise { - if (!this.proc) { - return Promise.reject(new Error('Python proc not initialized')); - } - var executionCmd = >cmd; - var payload = this.createPayload(executionCmd); - executionCmd.deferred = createDeferred(); - // if (typeof executionCmd.telemetryEvent === 'string') { - // executionCmd.delays = new telemetryHelper.Delays(); - // } - try { - this.proc.stdin.write(JSON.stringify(payload) + '\n'); - this.commands.set(executionCmd.id, executionCmd); - this.commandQueue.push(executionCmd.id); + private onCompletion(command: IExecutionCommand, response: object): void { + let results = JediProxy.getProperty(response, 'results'); + results = Array.isArray(results) ? results : []; + results.forEach(item => { + // tslint:disable-next-line:no-any + const originalType = item.type; + item.type = getMappedVSCodeType(originalType); + item.kind = getMappedVSCodeSymbol(originalType); + item.rawType = getMappedVSCodeType(originalType); + }); + const completionResult: ICompletionResult = { + items: results, + requestId: command.id + }; + this.safeResolve(command, completionResult); + } + + private onDefinition(command: IExecutionCommand, response: object): void { + // tslint:disable-next-line:no-any + const defs = JediProxy.getProperty(response, 'results'); + const defResult: IDefinitionResult = { + requestId: command.id, + definitions: [] + }; + if (defs.length > 0) { + defResult.definitions = defs.map(def => { + const originalType = def.type as string; + return { + fileName: def.fileName, + text: def.text, + rawType: originalType, + type: getMappedVSCodeType(originalType), + kind: getMappedVSCodeSymbol(originalType), + container: def.container, + range: { + startLine: def.range.start_line, + startColumn: def.range.start_column, + endLine: def.range.end_line, + endColumn: def.range.end_column + } + }; + }); } - catch (ex) { - console.error(ex); - //If 'This socket is closed.' that means process didn't start at all (at least not properly). - if (ex.message === 'This socket is closed.') { + this.safeResolve(command, defResult); + } - this.killProcess(); - } - else { - this.handleError('sendCommand', ex.message); - } - return Promise.reject(ex); + private onHover(command: IExecutionCommand, response: object): void { + // tslint:disable-next-line:no-any + const defs = JediProxy.getProperty(response, 'results'); + const defResult: IHoverResult = { + requestId: command.id, + items: defs.map(def => { + return { + kind: getMappedVSCodeSymbol(def.type), + description: def.description, + signature: def.signature, + docstring: def.docstring, + text: def.text + }; + }) + }; + this.safeResolve(command, defResult); + } + + private onSymbols(command: IExecutionCommand, response: object): void { + // tslint:disable-next-line:no-any + let defs = JediProxy.getProperty(response, 'results'); + defs = Array.isArray(defs) ? defs : []; + const defResults: ISymbolResult = { + requestId: command.id, + definitions: [] + }; + defResults.definitions = defs.map(def => { + const originalType = def.type as string; + return { + fileName: def.fileName, + text: def.text, + rawType: originalType, + type: getMappedVSCodeType(originalType), + kind: getMappedVSCodeSymbol(originalType), + container: def.container, + range: { + startLine: def.range.start_line, + startColumn: def.range.start_column, + endLine: def.range.end_line, + endColumn: def.range.end_column + } + }; + }); + this.safeResolve(command, defResults); + } + + private onUsages(command: IExecutionCommand, response: object): void { + // tslint:disable-next-line:no-any + let defs = JediProxy.getProperty(response, 'results'); + defs = Array.isArray(defs) ? defs : []; + const refResult: IReferenceResult = { + requestId: command.id, + references: defs.map(item => { + return { + columnIndex: item.column, + fileName: item.fileName, + lineIndex: item.line - 1, + moduleName: item.moduleName, + name: item.name + }; + }) + }; + this.safeResolve(command, refResult); + } + + private onArguments(command: IExecutionCommand, response: object): void { + // tslint:disable-next-line:no-any + const defs = JediProxy.getProperty(response, 'results'); + this.safeResolve(command, { + requestId: command.id, + definitions: defs + }); + } + + private checkQueueLength(): void { + if (this.commandQueue.length > 10) { + const items = this.commandQueue.splice(0, this.commandQueue.length - 10); + items.forEach(id => { + if (this.commands.has(id)) { + const cmd1 = this.commands.get(id); + try { + this.safeResolve(cmd1, undefined); + // tslint:disable-next-line:no-empty + } catch (ex) { + } finally { + this.commands.delete(id); + } + } + }); } - return executionCmd.deferred.promise; } + // tslint:disable-next-line:no-any private createPayload(cmd: IExecutionCommand): any { - var payload = { + const payload = { id: cmd.id, prefix: '', lookup: commandNames.get(cmd.command), @@ -484,19 +517,18 @@ export class JediProxy implements vscode.Disposable { return payload; } - private lastKnownPythonPath: string = null; - private additionalAutoCopletePaths: string[] = []; private getPathFromPythonCommand(args: string[]): Promise { return execPythonFile(this.workspacePath, this.pythonSettings.pythonPath, args, this.workspacePath).then(stdout => { if (stdout.length === 0) { return ''; } - let lines = stdout.split(/\r?\n/g).filter(line => line.length > 0); + const lines = stdout.split(/\r?\n/g).filter(line => line.length > 0); return validatePath(lines[0]); }).catch(() => { return ''; }); } + private onConfigChanged() { // We're only interested in changes to the python path. if (this.lastKnownPythonPath === this.pythonSettings.pythonPath) { @@ -504,7 +536,7 @@ export class JediProxy implements vscode.Disposable { } this.lastKnownPythonPath = this.pythonSettings.pythonPath; - let filePaths = [ + const filePaths = [ // Sysprefix. this.getPathFromPythonCommand(['-c', 'import sys;print(sys.prefix)']), // exeucutable path. @@ -512,20 +544,20 @@ export class JediProxy implements vscode.Disposable { // Python specific site packages. this.getPathFromPythonCommand(['-c', 'from distutils.sysconfig import get_python_lib; print(get_python_lib())']), // Python global site packages, as a fallback in case user hasn't installed them in custom environment. - this.getPathFromPythonCommand(['-m', 'site', '--user-site']), + this.getPathFromPythonCommand(['-m', 'site', '--user-site']) ]; - let PYTHONPATH: string = process.env['PYTHONPATH']; + let PYTHONPATH: string = JediProxy.getProperty(process.env, 'PYTHONPATH'); if (typeof PYTHONPATH !== 'string') { PYTHONPATH = ''; } - let customEnvironmentVars = getCustomEnvVarsSync(vscode.Uri.file(this.pythonProcessCWD)); - if (customEnvironmentVars && customEnvironmentVars['PYTHONPATH']) { - let PYTHONPATHFromEnvFile = customEnvironmentVars['PYTHONPATH'] as string; + const customEnvironmentVars = getCustomEnvVarsSync(vscode.Uri.file(this.pythonProcessCWD)); + if (customEnvironmentVars && JediProxy.getProperty(customEnvironmentVars, 'PYTHONPATH')) { + let PYTHONPATHFromEnvFile = JediProxy.getProperty(customEnvironmentVars, 'PYTHONPATH'); if (!path.isAbsolute(PYTHONPATHFromEnvFile) && this.workspacePath === 'string') { PYTHONPATHFromEnvFile = path.resolve(this.workspacePath, PYTHONPATHFromEnvFile); } - PYTHONPATH += (PYTHONPATH.length > 0 ? + path.delimiter : '') + PYTHONPATHFromEnvFile; + PYTHONPATH += `${(PYTHONPATH.length > 0 ? + path.delimiter : '')}${PYTHONPATHFromEnvFile}`; } if (typeof PYTHONPATH === 'string' && PYTHONPATH.length > 0) { filePaths.push(Promise.resolve(PYTHONPATH.trim())); @@ -549,7 +581,7 @@ export class JediProxy implements vscode.Disposable { private getConfig() { // Add support for paths relative to workspace. - let extraPaths = this.pythonSettings.autoComplete.extraPaths.map(extraPath => { + const extraPaths = this.pythonSettings.autoComplete.extraPaths.map(extraPath => { if (path.isAbsolute(extraPath)) { return extraPath; } @@ -564,7 +596,7 @@ export class JediProxy implements vscode.Disposable { extraPaths.unshift(this.workspacePath); } - let distinctExtraPaths = extraPaths.concat(this.additionalAutoCopletePaths) + const distinctExtraPaths = extraPaths.concat(this.additionalAutoCopletePaths) .filter(value => value.length > 0) .filter((value, index, self) => self.indexOf(value) === index); @@ -576,7 +608,17 @@ export class JediProxy implements vscode.Disposable { fuzzyMatcher: true }; } + + private safeResolve( + command: IExecutionCommand | undefined | null, + result: ICommandResult | PromiseLike | undefined): void { + if (command && command.deferred) { + command.deferred.resolve(result); + } + } } + +// tslint:disable-next-line:no-unused-variable export interface ICommand { telemetryEvent?: string; command: CommandType; @@ -587,7 +629,7 @@ export interface ICommand { } interface IExecutionCommand extends ICommand { - id?: number; + id: number; deferred?: Deferred; token: vscode.CancellationToken; delay?: number; @@ -650,7 +692,7 @@ export interface IAutoCompleteItem { raw_docstring: string; rightLabel: string; } -interface IDefinitionRange { +export interface IDefinitionRange { startLine: number; startColumn: number; endLine: number; @@ -681,19 +723,25 @@ export class JediProxyHandler implements vscode.Dispos return this.jediProxy; } - public constructor(private jediProxy: JediProxy = null) { + public constructor(private jediProxy: JediProxy) { this.commandCancellationTokenSources = new Map(); } + public dispose() { - this.jediProxy.dispose(); + if (this.jediProxy) { + this.jediProxy.dispose(); + } } - public sendCommand(cmd: ICommand, token?: vscode.CancellationToken): Promise { - var executionCmd = >cmd; + + public sendCommand(cmd: ICommand, token?: vscode.CancellationToken): Promise { + const executionCmd = >cmd; executionCmd.id = executionCmd.id || this.jediProxy.getNextCommandId(); if (this.commandCancellationTokenSources.has(cmd.command)) { - const cancellation = this.commandCancellationTokenSources.get(cmd.command); - cancellation.cancel(); + const ct = this.commandCancellationTokenSources.get(cmd.command); + if (ct) { + ct.cancel(); + } } const cancellation = new vscode.CancellationTokenSource(); @@ -707,10 +755,12 @@ export class JediProxyHandler implements vscode.Dispos }); } - public sendCommandNonCancellableCommand(cmd: ICommand, token?: vscode.CancellationToken): Promise { - var executionCmd = >cmd; + public sendCommandNonCancellableCommand(cmd: ICommand, token?: vscode.CancellationToken): Promise { + const executionCmd = >cmd; executionCmd.id = executionCmd.id || this.jediProxy.getNextCommandId(); - executionCmd.token = token; + if (token) { + executionCmd.token = token; + } return this.jediProxy.sendCommand(executionCmd) .catch(reason => { diff --git a/src/test/autocomplete/base.test.ts b/src/test/autocomplete/base.test.ts index 1873f86f0776..e9efcfa8e15e 100644 --- a/src/test/autocomplete/base.test.ts +++ b/src/test/autocomplete/base.test.ts @@ -118,8 +118,11 @@ suite('Autocomplete', () => { await vscode.window.showTextDocument(textDocument); const position = new vscode.Position(10, 9); const list = await vscode.commands.executeCommand('vscode.executeCompletionItemProvider', textDocument.uri, position); - assert.notEqual(list.items.filter(item => item.label === 'sleep').length, 0, 'sleep not found'); - assert.notEqual(list.items.filter(item => item.documentation.toString().startsWith('Delay execution for a given number of seconds. The argument may be')).length, 0, 'Documentation incorrect'); + + const items = list.items.filter(item => item.label === 'sleep'); + assert.notEqual(items.length, 0, 'sleep not found'); + + checkDocumentation(items[0], 'Delay execution for a given number of seconds. The argument may be'); }); test('For custom class', done => { @@ -151,9 +154,11 @@ suite('Autocomplete', () => { const position = new vscode.Position(25, 4); return vscode.commands.executeCommand('vscode.executeCompletionItemProvider', textDocument.uri, position); }).then(list => { - assert.equal(list.items.filter(item => item.label === 'bar').length, 1, 'bar not found'); - const documentation = `说明 - keep this line, it works${EOL}delete following line, it works${EOL}如果存在需要等待审批或正在执行的任务,将不刷新页面`; - assert.equal(list.items.filter(item => item.label === 'bar')[0].documentation, documentation, 'unicode documentation is incorrect'); + const items = list.items.filter(item => item.label === 'bar'); + assert.equal(items.length, 1, 'bar not found'); + + const expected = `说明 - keep this line, it works${EOL}delete following line, it works${EOL}如果存在需要等待审批或正在执行的任务,将不刷新页面`; + checkDocumentation(items[0], expected); }).then(done, done); }); @@ -169,12 +174,15 @@ suite('Autocomplete', () => { const position = new vscode.Position(1, 5); return vscode.commands.executeCommand('vscode.executeCompletionItemProvider', textDocument.uri, position); }).then(list => { - assert.equal(list.items.filter(item => item.label === 'Foo').length, 1, 'Foo not found'); - assert.equal(list.items.filter(item => item.label === 'Foo')[0].documentation, '说明', 'Foo unicode documentation is incorrect'); + let items = list.items.filter(item => item.label === 'Foo'); + assert.equal(items.length, 1, 'Foo not found'); + checkDocumentation(items[0], '说明'); - assert.equal(list.items.filter(item => item.label === 'showMessage').length, 1, 'showMessage not found'); - const documentation = `Кюм ут жэмпэр пошжим льаборэж, коммюны янтэрэсщэт нам ед, декта игнота ныморэ жят эи. ${EOL}Шэа декам экшырки эи, эи зыд эррэм докэндё, векж факэтэ пэрчыквюэрёж ку.`; - assert.equal(list.items.filter(item => item.label === 'showMessage')[0].documentation, documentation, 'showMessage unicode documentation is incorrect'); + items = list.items.filter(item => item.label === 'showMessage'); + assert.equal(items.length, 1, 'showMessage not found'); + + const expected = `Кюм ут жэмпэр пошжим льаборэж, коммюны янтэрэсщэт нам ед, декта игнота ныморэ жят эи. ${EOL}Шэа декам экшырки эи, эи зыд эррэм докэндё, векж факэтэ пэрчыквюэрёж ку.`; + checkDocumentation(items[0], expected); }).then(done, done); }); @@ -205,3 +213,13 @@ suite('Autocomplete', () => { } }); }); + +// tslint:disable-next-line:no-any +function checkDocumentation(item: vscode.CompletionItem, expectedContains: string): void { + const documentation = item.documentation as vscode.MarkdownString; + assert.notEqual(documentation, null, 'Documentation is not MarkdownString'); + + const inDoc = documentation.value.indexOf(expectedContains) >= 0; + const inDetails = item.detail.indexOf(expectedContains) >= 0; + assert.equal(inDoc !== inDetails, true, 'Documentation incorrect'); +} diff --git a/src/test/index.ts b/src/test/index.ts index 4d3b12a351ca..eebaa9b59c8d 100644 --- a/src/test/index.ts +++ b/src/test/index.ts @@ -12,7 +12,8 @@ const options: MochaSetupOptions & { retries: number } = { ui: 'tdd', useColors: true, timeout: 25000, - retries: 3 + retries: 3, + grep: 'Autocomplete' }; testRunner.configure(options); module.exports = testRunner;