From 22834ab4ed85066b9f4769a59de60cb8a7692238 Mon Sep 17 00:00:00 2001 From: CS <45906942+CsCherrYY@users.noreply.github.com> Date: Fri, 24 Jul 2020 15:23:36 +0800 Subject: [PATCH 01/18] Update project monikers --- cmd/package-lock.json | 1667 ++++++----------- .../core/internal/indexer/EdgeBuilder.java | 4 + .../core/internal/indexer/VertexBuilder.java | 5 + .../lsif/core/internal/protocol/Edge.java | 1 + .../lsif/core/internal/protocol/Moniker.java | 22 + .../lsif/core/internal/protocol/Vertex.java | 1 + .../core/internal/visitors/LsifVisitor.java | 141 +- .../core/internal/visitors/SymbolData.java | 13 + 8 files changed, 773 insertions(+), 1081 deletions(-) create mode 100644 com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/Moniker.java diff --git a/cmd/package-lock.json b/cmd/package-lock.json index 1c0d537..3c43502 100644 --- a/cmd/package-lock.json +++ b/cmd/package-lock.json @@ -6,8 +6,8 @@ "dependencies": { "ansi-colors": { "version": "1.1.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/ansi-colors/-/ansi-colors-1.1.0.tgz", - "integrity": "sha1-Y3S03V1HGP884npnGjscrQdxMqk=", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-1.1.0.tgz", + "integrity": "sha512-SFKX67auSNoVR38N3L+nvsPjOE0bybKTYbkf5tRvushrAPQ9V75huw0ZxBkKVeRU9kqH3d6HA4xTckbwZ4ixmA==", "dev": true, "requires": { "ansi-wrap": "^0.1.0" @@ -15,7 +15,7 @@ }, "ansi-gray": { "version": "0.1.1", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/ansi-gray/-/ansi-gray-0.1.1.tgz", + "resolved": "https://registry.npmjs.org/ansi-gray/-/ansi-gray-0.1.1.tgz", "integrity": "sha1-KWLPVOyXksSFEKPetSRDaGHvclE=", "dev": true, "requires": { @@ -24,29 +24,40 @@ }, "ansi-regex": { "version": "2.1.1", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/ansi-regex/-/ansi-regex-2.1.1.tgz", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", "dev": true }, "ansi-wrap": { "version": "0.1.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/ansi-wrap/-/ansi-wrap-0.1.0.tgz", + "resolved": "https://registry.npmjs.org/ansi-wrap/-/ansi-wrap-0.1.0.tgz", "integrity": "sha1-qCJQ3bABXponyoLoLqYDu/pF768=", "dev": true }, "anymatch": { "version": "2.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/anymatch/-/anymatch-2.0.0.tgz", - "integrity": "sha1-vLJLTzeTTZqnrBe0ra+J58du8us=", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", + "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", "dev": true, "requires": { "micromatch": "^3.1.4", "normalize-path": "^2.1.1" + }, + "dependencies": { + "normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, + "requires": { + "remove-trailing-separator": "^1.0.1" + } + } } }, "append-buffer": { "version": "1.0.2", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/append-buffer/-/append-buffer-1.0.2.tgz", + "resolved": "https://registry.npmjs.org/append-buffer/-/append-buffer-1.0.2.tgz", "integrity": "sha1-2CIM9GYIFSXv6lBhTz3mUU36WPE=", "dev": true, "requires": { @@ -55,19 +66,19 @@ }, "archy": { "version": "1.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/archy/-/archy-1.0.0.tgz", + "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=", "dev": true }, "arr-diff": { "version": "4.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/arr-diff/-/arr-diff-4.0.0.tgz", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", "dev": true }, "arr-filter": { "version": "1.1.2", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/arr-filter/-/arr-filter-1.1.2.tgz", + "resolved": "https://registry.npmjs.org/arr-filter/-/arr-filter-1.1.2.tgz", "integrity": "sha1-Q/3d0JHo7xGqTEXZzcGOLf8XEe4=", "dev": true, "requires": { @@ -76,13 +87,13 @@ }, "arr-flatten": { "version": "1.1.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/arr-flatten/-/arr-flatten-1.1.0.tgz", - "integrity": "sha1-NgSLv/TntH4TZkQxbJlmnqWukfE=", + "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", "dev": true }, "arr-map": { "version": "2.0.2", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/arr-map/-/arr-map-2.0.2.tgz", + "resolved": "https://registry.npmjs.org/arr-map/-/arr-map-2.0.2.tgz", "integrity": "sha1-Onc0X/wc814qkYJWAfnljy4kysQ=", "dev": true, "requires": { @@ -91,19 +102,19 @@ }, "arr-union": { "version": "3.1.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/arr-union/-/arr-union-3.1.0.tgz", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", "dev": true }, "array-each": { "version": "1.0.1", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/array-each/-/array-each-1.0.1.tgz", + "resolved": "https://registry.npmjs.org/array-each/-/array-each-1.0.1.tgz", "integrity": "sha1-p5SvDAWrF1KEbudTofIRoFugxE8=", "dev": true }, "array-initial": { "version": "1.1.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/array-initial/-/array-initial-1.1.0.tgz", + "resolved": "https://registry.npmjs.org/array-initial/-/array-initial-1.1.0.tgz", "integrity": "sha1-L6dLJnOTccOUe9enrcc74zSz15U=", "dev": true, "requires": { @@ -113,16 +124,16 @@ "dependencies": { "is-number": { "version": "4.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/is-number/-/is-number-4.0.0.tgz", - "integrity": "sha1-ACbjf1RU1z41bf5lZGmYZ8an8P8=", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", + "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", "dev": true } } }, "array-last": { "version": "1.3.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/array-last/-/array-last-1.3.0.tgz", - "integrity": "sha1-eqdwc/7FZd2rJJP1+IGF9ASp0zY=", + "resolved": "https://registry.npmjs.org/array-last/-/array-last-1.3.0.tgz", + "integrity": "sha512-eOCut5rXlI6aCOS7Z7kCplKRKyiFQ6dHFBem4PwlwKeNFk2/XxTrhRh5T9PyaEWGy/NHTZWbY+nsZlNFJu9rYg==", "dev": true, "requires": { "is-number": "^4.0.0" @@ -130,22 +141,22 @@ "dependencies": { "is-number": { "version": "4.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/is-number/-/is-number-4.0.0.tgz", - "integrity": "sha1-ACbjf1RU1z41bf5lZGmYZ8an8P8=", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", + "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", "dev": true } } }, "array-slice": { "version": "1.1.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/array-slice/-/array-slice-1.1.0.tgz", - "integrity": "sha1-42jqFfibxwaff/uJrsOmx9SsItQ=", + "resolved": "https://registry.npmjs.org/array-slice/-/array-slice-1.1.0.tgz", + "integrity": "sha512-B1qMD3RBP7O8o0H2KbrXDyB0IccejMF15+87Lvlor12ONPRHP6gTjXMNkt/d3ZuOGbAe66hFmaCfECI24Ufp6w==", "dev": true }, "array-sort": { "version": "1.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/array-sort/-/array-sort-1.0.0.tgz", - "integrity": "sha1-5MBTVkU/VvU1EqfR1hI/LFTAqIo=", + "resolved": "https://registry.npmjs.org/array-sort/-/array-sort-1.0.0.tgz", + "integrity": "sha512-ihLeJkonmdiAsD7vpgN3CRcx2J2S0TiYW+IS/5zHBI7mKUq3ySvBdzzBfD236ubDBQFiiyG3SWCPc+msQ9KoYg==", "dev": true, "requires": { "default-compare": "^1.0.0", @@ -155,45 +166,45 @@ "dependencies": { "kind-of": { "version": "5.1.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha1-cpyR4thXt6QZofmqZWhcTDP1hF0=", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", "dev": true } } }, "array-unique": { "version": "0.3.2", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/array-unique/-/array-unique-0.3.2.tgz", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", "dev": true }, "assign-symbols": { "version": "1.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/assign-symbols/-/assign-symbols-1.0.0.tgz", + "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", "dev": true }, "async-done": { - "version": "1.3.1", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/async-done/-/async-done-1.3.1.tgz", - "integrity": "sha1-FLe3Nme4ZMjwK1slP8nG7dt3fz4=", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/async-done/-/async-done-1.3.2.tgz", + "integrity": "sha512-uYkTP8dw2og1tu1nmza1n1CMW0qb8gWWlwqMmLb7MhBVs4BXrFziT6HXUd+/RlRA/i4H9AkofYloUbs1fwMqlw==", "dev": true, "requires": { "end-of-stream": "^1.1.0", "once": "^1.3.2", - "process-nextick-args": "^1.0.7", + "process-nextick-args": "^2.0.0", "stream-exhaust": "^1.0.1" } }, "async-each": { - "version": "1.0.2", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/async-each/-/async-each-1.0.2.tgz", - "integrity": "sha1-i4p8oqZY+Sfp8wfW0aQvQZnw9zU=", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz", + "integrity": "sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==", "dev": true }, "async-settle": { "version": "1.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/async-settle/-/async-settle-1.0.0.tgz", + "resolved": "https://registry.npmjs.org/async-settle/-/async-settle-1.0.0.tgz", "integrity": "sha1-HQqRS7Aldb7IqPOnTlCA9yssDGs=", "dev": true, "requires": { @@ -202,13 +213,13 @@ }, "atob": { "version": "2.1.2", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/atob/-/atob-2.1.2.tgz", - "integrity": "sha1-bZUX654DDSQ2ZmZR6GvZ9vE1M8k=", + "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", + "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", "dev": true }, "bach": { "version": "1.2.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/bach/-/bach-1.2.0.tgz", + "resolved": "https://registry.npmjs.org/bach/-/bach-1.2.0.tgz", "integrity": "sha1-Szzpa/JxNPeaG0FKUcFONMO9mIA=", "dev": true, "requires": { @@ -231,8 +242,8 @@ }, "base": { "version": "0.11.2", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/base/-/base-0.11.2.tgz", - "integrity": "sha1-e95c7RRbbVUakNuH+DxVi060io8=", + "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", + "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", "dev": true, "requires": { "cache-base": "^1.0.1", @@ -246,7 +257,7 @@ "dependencies": { "define-property": { "version": "1.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/define-property/-/define-property-1.0.0.tgz", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", "dev": true, "requires": { @@ -255,8 +266,8 @@ }, "is-accessor-descriptor": { "version": "1.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha1-FpwvbT3x+ZJhgHI2XJsOofaHhlY=", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", "dev": true, "requires": { "kind-of": "^6.0.0" @@ -264,8 +275,8 @@ }, "is-data-descriptor": { "version": "1.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha1-2Eh2Mh0Oet0DmQQGq7u9NrqSaMc=", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", "dev": true, "requires": { "kind-of": "^6.0.0" @@ -273,8 +284,8 @@ }, "is-descriptor": { "version": "1.0.2", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha1-OxWXRqZmBLBPjIFSS6NlxfFNhuw=", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", "dev": true, "requires": { "is-accessor-descriptor": "^1.0.0", @@ -285,11 +296,21 @@ } }, "binary-extensions": { - "version": "1.13.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/binary-extensions/-/binary-extensions-1.13.0.tgz", - "integrity": "sha1-lSPgATBqMkRLkHQj8d4hZCIvarE=", + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz", + "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==", "dev": true }, + "bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "dev": true, + "optional": true, + "requires": { + "file-uri-to-path": "1.0.0" + } + }, "brace-expansion": { "version": "1.1.11", "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -302,8 +323,8 @@ }, "braces": { "version": "2.3.2", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/braces/-/braces-2.3.2.tgz", - "integrity": "sha1-WXn9PxTNUxVl5fot8av/8d+u5yk=", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", "dev": true, "requires": { "arr-flatten": "^1.1.0", @@ -320,7 +341,7 @@ "dependencies": { "extend-shallow": { "version": "2.0.1", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/extend-shallow/-/extend-shallow-2.0.1.tgz", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { @@ -331,20 +352,20 @@ }, "buffer-equal": { "version": "1.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/buffer-equal/-/buffer-equal-1.0.0.tgz", + "resolved": "https://registry.npmjs.org/buffer-equal/-/buffer-equal-1.0.0.tgz", "integrity": "sha1-WWFrSYME1Var1GaWayLu2j7KX74=", "dev": true }, "buffer-from": { "version": "1.1.1", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha1-MnE7wCj3XAL9txDXx7zsHyxgcO8=", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", "dev": true }, "cache-base": { "version": "1.0.1", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/cache-base/-/cache-base-1.0.1.tgz", - "integrity": "sha1-Cn9GQWgxyLZi7jb+TnxZ129marI=", + "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", + "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", "dev": true, "requires": { "collection-visit": "^1.0.0", @@ -360,14 +381,14 @@ }, "camelcase": { "version": "3.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/camelcase/-/camelcase-3.0.0.tgz", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=", "dev": true }, "chokidar": { - "version": "2.1.2", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/chokidar/-/chokidar-2.1.2.tgz", - "integrity": "sha1-nCPqQLAWOEOeBROGTTYq6sxa0Fg=", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz", + "integrity": "sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg==", "dev": true, "requires": { "anymatch": "^2.0.0", @@ -381,21 +402,13 @@ "normalize-path": "^3.0.0", "path-is-absolute": "^1.0.0", "readdirp": "^2.2.1", - "upath": "^1.1.0" - }, - "dependencies": { - "normalize-path": { - "version": "3.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha1-Dc1p/yOhybEf0JeDFmRKA4ghamU=", - "dev": true - } + "upath": "^1.1.1" } }, "class-utils": { "version": "0.3.6", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/class-utils/-/class-utils-0.3.6.tgz", - "integrity": "sha1-+TNprouafOAv1B+q0MqDAzGQxGM=", + "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", + "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", "dev": true, "requires": { "arr-union": "^3.1.0", @@ -406,7 +419,7 @@ "dependencies": { "define-property": { "version": "0.2.5", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/define-property/-/define-property-0.2.5.tgz", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", "dev": true, "requires": { @@ -417,7 +430,7 @@ }, "cliui": { "version": "3.2.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/cliui/-/cliui-3.2.0.tgz", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", "dev": true, "requires": { @@ -428,50 +441,42 @@ }, "clone": { "version": "2.1.2", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/clone/-/clone-2.1.2.tgz", + "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=", "dev": true }, "clone-buffer": { "version": "1.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/clone-buffer/-/clone-buffer-1.0.0.tgz", + "resolved": "https://registry.npmjs.org/clone-buffer/-/clone-buffer-1.0.0.tgz", "integrity": "sha1-4+JbIHrE5wGvch4staFnksrD3Fg=", "dev": true }, "clone-stats": { "version": "1.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/clone-stats/-/clone-stats-1.0.0.tgz", + "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-1.0.0.tgz", "integrity": "sha1-s3gt/4u1R04Yuba/D9/ngvh3doA=", "dev": true }, "cloneable-readable": { - "version": "1.1.2", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/cloneable-readable/-/cloneable-readable-1.1.2.tgz", - "integrity": "sha1-1ZHe5Kj4vBXaQ86X3O66E9Q+KmU=", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/cloneable-readable/-/cloneable-readable-1.1.3.tgz", + "integrity": "sha512-2EF8zTQOxYq70Y4XKtorQupqF0m49MBz2/yf5Bj+MHjvpG3Hy7sImifnqD6UA+TKYxeSV+u6qqQPawN5UvnpKQ==", "dev": true, "requires": { "inherits": "^2.0.1", "process-nextick-args": "^2.0.0", "readable-stream": "^2.3.5" - }, - "dependencies": { - "process-nextick-args": { - "version": "2.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/process-nextick-args/-/process-nextick-args-2.0.0.tgz", - "integrity": "sha1-o31zL0JxtKsa0HDTVQjoKQeI/6o=", - "dev": true - } } }, "code-point-at": { "version": "1.1.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/code-point-at/-/code-point-at-1.1.0.tgz", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", "dev": true }, "collection-map": { "version": "1.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/collection-map/-/collection-map-1.0.0.tgz", + "resolved": "https://registry.npmjs.org/collection-map/-/collection-map-1.0.0.tgz", "integrity": "sha1-rqDwb40mx4DCt1SUOFVEsiVa8Yw=", "dev": true, "requires": { @@ -482,7 +487,7 @@ }, "collection-visit": { "version": "1.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/collection-visit/-/collection-visit-1.0.0.tgz", + "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", "dev": true, "requires": { @@ -492,14 +497,14 @@ }, "color-support": { "version": "1.1.3", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/color-support/-/color-support-1.1.3.tgz", - "integrity": "sha1-k4NDeaHMmgxh+C9S8NBDIiUb1aI=", + "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", + "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", "dev": true }, "component-emitter": { - "version": "1.2.1", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/component-emitter/-/component-emitter-1.2.1.tgz", - "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", + "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", "dev": true }, "concat-map": { @@ -510,8 +515,8 @@ }, "concat-stream": { "version": "1.6.2", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/concat-stream/-/concat-stream-1.6.2.tgz", - "integrity": "sha1-kEvfGUzTEi/Gdcd/xKw9T/D9GjQ=", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", "dev": true, "requires": { "buffer-from": "^1.0.0", @@ -521,9 +526,9 @@ } }, "convert-source-map": { - "version": "1.6.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/convert-source-map/-/convert-source-map-1.6.0.tgz", - "integrity": "sha1-UbU3qMQ+DwTewZk7/83VBOdYrCA=", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", + "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", "dev": true, "requires": { "safe-buffer": "~5.1.1" @@ -531,14 +536,14 @@ }, "copy-descriptor": { "version": "0.1.1", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/copy-descriptor/-/copy-descriptor-0.1.1.tgz", + "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", "dev": true }, "copy-props": { "version": "2.0.4", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/copy-props/-/copy-props-2.0.4.tgz", - "integrity": "sha1-k7scrfr9MdpbuKnUtB9HHsOnLf4=", + "resolved": "https://registry.npmjs.org/copy-props/-/copy-props-2.0.4.tgz", + "integrity": "sha512-7cjuUME+p+S3HZlbllgsn2CDwS+5eCCX16qBgNC4jgSTf49qR1VKy/Zhl400m0IQXl/bPGEVqncgUUMjrr4s8A==", "dev": true, "requires": { "each-props": "^1.3.0", @@ -547,23 +552,24 @@ }, "core-util-is": { "version": "1.0.2", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/core-util-is/-/core-util-is-1.0.2.tgz", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", "dev": true }, "d": { - "version": "1.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/d/-/d-1.0.0.tgz", - "integrity": "sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", + "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==", "dev": true, "requires": { - "es5-ext": "^0.10.9" + "es5-ext": "^0.10.50", + "type": "^1.0.1" } }, "debug": { "version": "2.6.9", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/debug/-/debug-2.6.9.tgz", - "integrity": "sha1-XRKFFd8TT/Mn6QpMk/Tgd6U2NB8=", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, "requires": { "ms": "2.0.0" @@ -571,20 +577,20 @@ }, "decamelize": { "version": "1.2.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/decamelize/-/decamelize-1.2.0.tgz", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", "dev": true }, "decode-uri-component": { "version": "0.2.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/decode-uri-component/-/decode-uri-component-0.2.0.tgz", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", "dev": true }, "default-compare": { "version": "1.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/default-compare/-/default-compare-1.0.0.tgz", - "integrity": "sha1-y2ETGESthNhHiPto/QFoHKd4Gi8=", + "resolved": "https://registry.npmjs.org/default-compare/-/default-compare-1.0.0.tgz", + "integrity": "sha512-QWfXlM0EkAbqOCbD/6HjdwT19j7WCkMyiRhWilc4H9/5h/RzTF9gv5LYh1+CmDV5d1rki6KAWLtQale0xt20eQ==", "dev": true, "requires": { "kind-of": "^5.0.2" @@ -592,22 +598,22 @@ "dependencies": { "kind-of": { "version": "5.1.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha1-cpyR4thXt6QZofmqZWhcTDP1hF0=", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", "dev": true } } }, "default-resolution": { "version": "2.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/default-resolution/-/default-resolution-2.0.0.tgz", + "resolved": "https://registry.npmjs.org/default-resolution/-/default-resolution-2.0.0.tgz", "integrity": "sha1-vLgrqnKtebQmp2cy8aga1t8m1oQ=", "dev": true }, "define-properties": { "version": "1.1.3", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/define-properties/-/define-properties-1.1.3.tgz", - "integrity": "sha1-z4jabL7ib+bbcJT2HYcMvYTO6fE=", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", "dev": true, "requires": { "object-keys": "^1.0.12" @@ -615,8 +621,8 @@ }, "define-property": { "version": "2.0.2", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/define-property/-/define-property-2.0.2.tgz", - "integrity": "sha1-1Flono1lS6d+AqgX+HENcCyxbp0=", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", + "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", "dev": true, "requires": { "is-descriptor": "^1.0.2", @@ -625,8 +631,8 @@ "dependencies": { "is-accessor-descriptor": { "version": "1.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha1-FpwvbT3x+ZJhgHI2XJsOofaHhlY=", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", "dev": true, "requires": { "kind-of": "^6.0.0" @@ -634,8 +640,8 @@ }, "is-data-descriptor": { "version": "1.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha1-2Eh2Mh0Oet0DmQQGq7u9NrqSaMc=", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", "dev": true, "requires": { "kind-of": "^6.0.0" @@ -643,8 +649,8 @@ }, "is-descriptor": { "version": "1.0.2", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha1-OxWXRqZmBLBPjIFSS6NlxfFNhuw=", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", "dev": true, "requires": { "is-accessor-descriptor": "^1.0.0", @@ -656,14 +662,14 @@ }, "detect-file": { "version": "1.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/detect-file/-/detect-file-1.0.0.tgz", + "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz", "integrity": "sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc=", "dev": true }, "duplexify": { "version": "3.7.1", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/duplexify/-/duplexify-3.7.1.tgz", - "integrity": "sha1-Kk31MX9sz9kfhtb9JdjYoQO4gwk=", + "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz", + "integrity": "sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==", "dev": true, "requires": { "end-of-stream": "^1.0.0", @@ -674,8 +680,8 @@ }, "each-props": { "version": "1.3.2", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/each-props/-/each-props-1.3.2.tgz", - "integrity": "sha1-6kWkFNFt1c+kGbGoFyDVygaJIzM=", + "resolved": "https://registry.npmjs.org/each-props/-/each-props-1.3.2.tgz", + "integrity": "sha512-vV0Hem3zAGkJAyU7JSjixeU66rwdynTAa1vofCrSA5fEln+m67Az9CcnkVD776/fsN/UjIWmBDoNRS6t6G9RfA==", "dev": true, "requires": { "is-plain-object": "^2.0.1", @@ -683,9 +689,9 @@ } }, "end-of-stream": { - "version": "1.4.1", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/end-of-stream/-/end-of-stream-1.4.1.tgz", - "integrity": "sha1-7SljTRm6ukY7bOa4CjchPqtx7EM=", + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", "dev": true, "requires": { "once": "^1.4.0" @@ -693,27 +699,27 @@ }, "error-ex": { "version": "1.3.2", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha1-tKxAZIEH/c3PriQvQovqihTU8b8=", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", "dev": true, "requires": { "is-arrayish": "^0.2.1" } }, "es5-ext": { - "version": "0.10.49", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/es5-ext/-/es5-ext-0.10.49.tgz", - "integrity": "sha1-BZojnehiyUSU/sKPgVDJdwKMbF4=", + "version": "0.10.53", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.53.tgz", + "integrity": "sha512-Xs2Stw6NiNHWypzRTY1MtaG/uJlwCk8kH81920ma8mvN8Xq1gsfhZvpkImLQArw8AHnv8MT2I45J3c0R8slE+Q==", "dev": true, "requires": { "es6-iterator": "~2.0.3", - "es6-symbol": "~3.1.1", - "next-tick": "^1.0.0" + "es6-symbol": "~3.1.3", + "next-tick": "~1.0.0" } }, "es6-iterator": { "version": "2.0.3", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/es6-iterator/-/es6-iterator-2.0.3.tgz", + "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=", "dev": true, "requires": { @@ -723,30 +729,30 @@ } }, "es6-symbol": { - "version": "3.1.1", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/es6-symbol/-/es6-symbol-3.1.1.tgz", - "integrity": "sha1-vwDvT9q2uhtG7Le2KbTH7VcVzHc=", + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz", + "integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==", "dev": true, "requires": { - "d": "1", - "es5-ext": "~0.10.14" + "d": "^1.0.1", + "ext": "^1.1.2" } }, "es6-weak-map": { - "version": "2.0.2", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/es6-weak-map/-/es6-weak-map-2.0.2.tgz", - "integrity": "sha1-XjqzIlH/0VOKH45f+hNXdy+S2W8=", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.3.tgz", + "integrity": "sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA==", "dev": true, "requires": { "d": "1", - "es5-ext": "^0.10.14", - "es6-iterator": "^2.0.1", + "es5-ext": "^0.10.46", + "es6-iterator": "^2.0.3", "es6-symbol": "^3.1.1" } }, "expand-brackets": { "version": "2.1.4", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/expand-brackets/-/expand-brackets-2.1.4.tgz", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", "dev": true, "requires": { @@ -761,7 +767,7 @@ "dependencies": { "define-property": { "version": "0.2.5", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/define-property/-/define-property-0.2.5.tgz", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", "dev": true, "requires": { @@ -770,7 +776,7 @@ }, "extend-shallow": { "version": "2.0.1", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/extend-shallow/-/extend-shallow-2.0.1.tgz", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { @@ -781,22 +787,39 @@ }, "expand-tilde": { "version": "2.0.2", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/expand-tilde/-/expand-tilde-2.0.2.tgz", + "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz", "integrity": "sha1-l+gBqgUt8CRU3kawK/YhZCzchQI=", "dev": true, "requires": { "homedir-polyfill": "^1.0.1" } }, + "ext": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/ext/-/ext-1.4.0.tgz", + "integrity": "sha512-Key5NIsUxdqKg3vIsdw9dSuXpPCQ297y6wBjL30edxwPgt2E44WcWBZey/ZvUc6sERLTxKdyCu4gZFmUbk1Q7A==", + "dev": true, + "requires": { + "type": "^2.0.0" + }, + "dependencies": { + "type": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/type/-/type-2.0.0.tgz", + "integrity": "sha512-KBt58xCHry4Cejnc2ISQAF7QY+ORngsWfxezO68+12hKV6lQY8P/psIkcbjeHWn7MqcgciWJyCCevFMJdIXpow==", + "dev": true + } + } + }, "extend": { "version": "3.0.2", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/extend/-/extend-3.0.2.tgz", - "integrity": "sha1-+LETa0Bx+9jrFAr/hYsQGewpFfo=", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", "dev": true }, "extend-shallow": { "version": "3.0.2", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/extend-shallow/-/extend-shallow-3.0.2.tgz", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", "dev": true, "requires": { @@ -806,8 +829,8 @@ "dependencies": { "is-extendable": { "version": "1.0.1", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha1-p0cPnkJnM9gb2B4RVSZOOjUHyrQ=", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", "dev": true, "requires": { "is-plain-object": "^2.0.4" @@ -817,8 +840,8 @@ }, "extglob": { "version": "2.0.4", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/extglob/-/extglob-2.0.4.tgz", - "integrity": "sha1-rQD+TcYSqSMuhxhxHcXLWrAoVUM=", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", "dev": true, "requires": { "array-unique": "^0.3.2", @@ -833,7 +856,7 @@ "dependencies": { "define-property": { "version": "1.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/define-property/-/define-property-1.0.0.tgz", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", "dev": true, "requires": { @@ -842,7 +865,7 @@ }, "extend-shallow": { "version": "2.0.1", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/extend-shallow/-/extend-shallow-2.0.1.tgz", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { @@ -851,8 +874,8 @@ }, "is-accessor-descriptor": { "version": "1.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha1-FpwvbT3x+ZJhgHI2XJsOofaHhlY=", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", "dev": true, "requires": { "kind-of": "^6.0.0" @@ -860,8 +883,8 @@ }, "is-data-descriptor": { "version": "1.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha1-2Eh2Mh0Oet0DmQQGq7u9NrqSaMc=", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", "dev": true, "requires": { "kind-of": "^6.0.0" @@ -869,8 +892,8 @@ }, "is-descriptor": { "version": "1.0.2", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha1-OxWXRqZmBLBPjIFSS6NlxfFNhuw=", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", "dev": true, "requires": { "is-accessor-descriptor": "^1.0.0", @@ -882,8 +905,8 @@ }, "fancy-log": { "version": "1.3.3", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/fancy-log/-/fancy-log-1.3.3.tgz", - "integrity": "sha1-28GRVPVYaQFQojlToK29A1vkX8c=", + "resolved": "https://registry.npmjs.org/fancy-log/-/fancy-log-1.3.3.tgz", + "integrity": "sha512-k9oEhlyc0FrVh25qYuSELjr8oxsCoc4/LEZfg2iJJrfEk/tZL9bCoJE47gqAvI2m/AUjluCS4+3I0eTx8n3AEw==", "dev": true, "requires": { "ansi-gray": "^0.1.1", @@ -892,9 +915,16 @@ "time-stamp": "^1.0.0" } }, + "file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", + "dev": true, + "optional": true + }, "fill-range": { "version": "4.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/fill-range/-/fill-range-4.0.0.tgz", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", "dev": true, "requires": { @@ -906,7 +936,7 @@ "dependencies": { "extend-shallow": { "version": "2.0.1", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/extend-shallow/-/extend-shallow-2.0.1.tgz", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { @@ -917,7 +947,7 @@ }, "find-up": { "version": "1.1.2", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/find-up/-/find-up-1.1.2.tgz", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", "dev": true, "requires": { @@ -926,32 +956,21 @@ } }, "findup-sync": { - "version": "2.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/findup-sync/-/findup-sync-2.0.0.tgz", - "integrity": "sha1-kyaxSIwi0aYIhlCoaQGy2akKLLw=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-3.0.0.tgz", + "integrity": "sha512-YbffarhcicEhOrm4CtrwdKBdCuz576RLdhJDsIfvNtxUuhdRet1qZcsMjqbePtAseKdAnDyM/IyXbu7PRPRLYg==", "dev": true, "requires": { "detect-file": "^1.0.0", - "is-glob": "^3.1.0", + "is-glob": "^4.0.0", "micromatch": "^3.0.4", "resolve-dir": "^1.0.1" - }, - "dependencies": { - "is-glob": { - "version": "3.1.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/is-glob/-/is-glob-3.1.0.tgz", - "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", - "dev": true, - "requires": { - "is-extglob": "^2.1.0" - } - } } }, "fined": { - "version": "1.1.1", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/fined/-/fined-1.1.1.tgz", - "integrity": "sha1-ldiP8ykSPdGmlQ/fzTIfdGJx4B8=", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/fined/-/fined-1.2.0.tgz", + "integrity": "sha512-ZYDqPLGxDkDhDZBjZBb+oD1+j0rA4E0pXY50eplAAOPg2N/gUBSSk5IM1/QhPfyVo19lJ+CvXpqfvk+b2p/8Ng==", "dev": true, "requires": { "expand-tilde": "^2.0.2", @@ -963,14 +982,14 @@ }, "flagged-respawn": { "version": "1.0.1", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/flagged-respawn/-/flagged-respawn-1.0.1.tgz", - "integrity": "sha1-595vEnnd2cqarIpZcdYYYGs6q0E=", + "resolved": "https://registry.npmjs.org/flagged-respawn/-/flagged-respawn-1.0.1.tgz", + "integrity": "sha512-lNaHNVymajmk0OJMBn8fVUAU1BtDeKIqKoVhk4xAALB57aALg6b4W0MfJ/cUE0g9YBXy5XhSlPIpYIJ7HaY/3Q==", "dev": true }, "flush-write-stream": { "version": "1.1.1", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/flush-write-stream/-/flush-write-stream-1.1.1.tgz", - "integrity": "sha1-jdfYc6G6vCB9lOrQwuDkQnbr8ug=", + "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.1.1.tgz", + "integrity": "sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w==", "dev": true, "requires": { "inherits": "^2.0.3", @@ -979,13 +998,13 @@ }, "for-in": { "version": "1.0.2", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/for-in/-/for-in-1.0.2.tgz", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", "dev": true }, "for-own": { "version": "1.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/for-own/-/for-own-1.0.0.tgz", + "resolved": "https://registry.npmjs.org/for-own/-/for-own-1.0.0.tgz", "integrity": "sha1-xjMy9BXO3EsE2/5wz4NklMU8tEs=", "dev": true, "requires": { @@ -994,7 +1013,7 @@ }, "fragment-cache": { "version": "0.2.1", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/fragment-cache/-/fragment-cache-0.2.1.tgz", + "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", "dev": true, "requires": { @@ -1003,7 +1022,7 @@ }, "fs-mkdirp-stream": { "version": "1.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/fs-mkdirp-stream/-/fs-mkdirp-stream-1.0.0.tgz", + "resolved": "https://registry.npmjs.org/fs-mkdirp-stream/-/fs-mkdirp-stream-1.0.0.tgz", "integrity": "sha1-C3gV/DIBxqaeFNuYzgmMFpNSWes=", "dev": true, "requires": { @@ -1018,568 +1037,31 @@ "dev": true }, "fsevents": { - "version": "1.2.7", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/fsevents/-/fsevents-1.2.7.tgz", - "integrity": "sha1-SFG2ZKN4PlIAOzxm6w7uEHSTOqQ=", + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", + "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", "dev": true, "optional": true, "requires": { - "nan": "^2.9.2", - "node-pre-gyp": "^0.10.0" - }, - "dependencies": { - "abbrev": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "ansi-regex": { - "version": "2.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "aproba": { - "version": "1.2.0", - "bundled": true, - "dev": true, - "optional": true - }, - "are-we-there-yet": { - "version": "1.1.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "delegates": "^1.0.0", - "readable-stream": "^2.0.6" - } - }, - "balanced-match": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "brace-expansion": { - "version": "1.1.11", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "chownr": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "code-point-at": { - "version": "1.1.0", - "bundled": true, - "dev": true, - "optional": true - }, - "concat-map": { - "version": "0.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "console-control-strings": { - "version": "1.1.0", - "bundled": true, - "dev": true, - "optional": true - }, - "core-util-is": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "debug": { - "version": "2.6.9", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "ms": "2.0.0" - } - }, - "deep-extend": { - "version": "0.6.0", - "bundled": true, - "dev": true, - "optional": true - }, - "delegates": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "detect-libc": { - "version": "1.0.3", - "bundled": true, - "dev": true, - "optional": true - }, - "fs-minipass": { - "version": "1.2.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minipass": "^2.2.1" - } - }, - "fs.realpath": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "gauge": { - "version": "2.7.4", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "aproba": "^1.0.3", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.0", - "object-assign": "^4.1.0", - "signal-exit": "^3.0.0", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wide-align": "^1.1.0" - } - }, - "glob": { - "version": "7.1.3", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "has-unicode": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "iconv-lite": { - "version": "0.4.24", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "safer-buffer": ">= 2.1.2 < 3" - } - }, - "ignore-walk": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minimatch": "^3.0.4" - } - }, - "inflight": { - "version": "1.0.6", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.3", - "bundled": true, - "dev": true, - "optional": true - }, - "ini": { - "version": "1.3.5", - "bundled": true, - "dev": true, - "optional": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "isarray": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "minimatch": { - "version": "3.0.4", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "0.0.8", - "bundled": true, - "dev": true, - "optional": true - }, - "minipass": { - "version": "2.3.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "safe-buffer": "^5.1.2", - "yallist": "^3.0.0" - } - }, - "minizlib": { - "version": "1.2.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minipass": "^2.2.1" - } - }, - "mkdirp": { - "version": "0.5.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minimist": "0.0.8" - } - }, - "ms": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "needle": { - "version": "2.2.4", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "debug": "^2.1.2", - "iconv-lite": "^0.4.4", - "sax": "^1.2.4" - } - }, - "node-pre-gyp": { - "version": "0.10.3", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "detect-libc": "^1.0.2", - "mkdirp": "^0.5.1", - "needle": "^2.2.1", - "nopt": "^4.0.1", - "npm-packlist": "^1.1.6", - "npmlog": "^4.0.2", - "rc": "^1.2.7", - "rimraf": "^2.6.1", - "semver": "^5.3.0", - "tar": "^4" - } - }, - "nopt": { - "version": "4.0.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "abbrev": "1", - "osenv": "^0.1.4" - } - }, - "npm-bundled": { - "version": "1.0.5", - "bundled": true, - "dev": true, - "optional": true - }, - "npm-packlist": { - "version": "1.2.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "ignore-walk": "^3.0.1", - "npm-bundled": "^1.0.1" - } - }, - "npmlog": { - "version": "4.1.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "are-we-there-yet": "~1.1.2", - "console-control-strings": "~1.1.0", - "gauge": "~2.7.3", - "set-blocking": "~2.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "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, - "optional": true, - "requires": { - "wrappy": "1" - } - }, - "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.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "os-homedir": "^1.0.0", - "os-tmpdir": "^1.0.0" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "process-nextick-args": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "rc": { - "version": "1.2.8", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "deep-extend": "^0.6.0", - "ini": "~1.3.0", - "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.3.6", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "rimraf": { - "version": "2.6.3", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "glob": "^7.1.3" - } - }, - "safe-buffer": { - "version": "5.1.2", - "bundled": true, - "dev": true, - "optional": true - }, - "safer-buffer": { - "version": "2.1.2", - "bundled": true, - "dev": true, - "optional": true - }, - "sax": { - "version": "1.2.4", - "bundled": true, - "dev": true, - "optional": true - }, - "semver": { - "version": "5.6.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 - }, - "string-width": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "string_decoder": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "strip-json-comments": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "tar": { - "version": "4.4.8", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "chownr": "^1.1.1", - "fs-minipass": "^1.2.5", - "minipass": "^2.3.4", - "minizlib": "^1.1.1", - "mkdirp": "^0.5.0", - "safe-buffer": "^5.1.2", - "yallist": "^3.0.2" - } - }, - "util-deprecate": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "wide-align": { - "version": "1.1.3", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "string-width": "^1.0.2 || 2" - } - }, - "wrappy": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "yallist": { - "version": "3.0.3", - "bundled": true, - "dev": true, - "optional": true - } + "bindings": "^1.5.0", + "nan": "^2.12.1" } }, "function-bind": { "version": "1.1.1", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha1-pWiZ0+o8m6uHS7l3O3xe3pL0iV0=", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", "dev": true }, "get-caller-file": { "version": "1.0.3", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/get-caller-file/-/get-caller-file-1.0.3.tgz", - "integrity": "sha1-+Xj6TJDR3+f/LWvtoqUV5xO9z0o=", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", + "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", "dev": true }, "get-value": { "version": "2.0.6", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/get-value/-/get-value-2.0.6.tgz", + "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", "dev": true }, @@ -1599,7 +1081,7 @@ }, "glob-parent": { "version": "3.1.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/glob-parent/-/glob-parent-3.1.0.tgz", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", "dev": true, "requires": { @@ -1609,7 +1091,7 @@ "dependencies": { "is-glob": { "version": "3.1.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/is-glob/-/is-glob-3.1.0.tgz", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", "dev": true, "requires": { @@ -1620,7 +1102,7 @@ }, "glob-stream": { "version": "6.1.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/glob-stream/-/glob-stream-6.1.0.tgz", + "resolved": "https://registry.npmjs.org/glob-stream/-/glob-stream-6.1.0.tgz", "integrity": "sha1-cEXJlBOz65SIjYOrRtC0BMx73eQ=", "dev": true, "requires": { @@ -1637,9 +1119,9 @@ } }, "glob-watcher": { - "version": "5.0.3", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/glob-watcher/-/glob-watcher-5.0.3.tgz", - "integrity": "sha1-iKir8cTRMeuTkomUvEpZPC5d1iY=", + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/glob-watcher/-/glob-watcher-5.0.5.tgz", + "integrity": "sha512-zOZgGGEHPklZNjZQaZ9f41i7F2YwE+tS5ZHrDhbBCk3stwahn5vQxnFmBJZHoYdusR6R1bLSXeGUy/BhctwKzw==", "dev": true, "requires": { "anymatch": "^2.0.0", @@ -1647,13 +1129,14 @@ "chokidar": "^2.0.0", "is-negated-glob": "^1.0.0", "just-debounce": "^1.0.0", + "normalize-path": "^3.0.0", "object.defaults": "^1.1.0" } }, "global-modules": { "version": "1.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/global-modules/-/global-modules-1.0.0.tgz", - "integrity": "sha1-bXcPDrUjrHgWTXK15xqIdyZcw+o=", + "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz", + "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==", "dev": true, "requires": { "global-prefix": "^1.0.1", @@ -1663,7 +1146,7 @@ }, "global-prefix": { "version": "1.0.2", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/global-prefix/-/global-prefix-1.0.2.tgz", + "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz", "integrity": "sha1-2/dDxsFJklk8ZVVoy2btMsASLr4=", "dev": true, "requires": { @@ -1676,35 +1159,35 @@ }, "glogg": { "version": "1.0.2", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/glogg/-/glogg-1.0.2.tgz", - "integrity": "sha1-LX3XAr7aIus7/634gGltpthGMT8=", + "resolved": "https://registry.npmjs.org/glogg/-/glogg-1.0.2.tgz", + "integrity": "sha512-5mwUoSuBk44Y4EshyiqcH95ZntbDdTQqA3QYSrxmzj28Ai0vXBGMH1ApSANH14j2sIRtqCEyg6PfsuP7ElOEDA==", "dev": true, "requires": { "sparkles": "^1.0.0" } }, "graceful-fs": { - "version": "4.1.15", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/graceful-fs/-/graceful-fs-4.1.15.tgz", - "integrity": "sha1-/7cD4QZuig7qpMi4C6klPu77+wA=", + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", + "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", "dev": true }, "gulp": { - "version": "4.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/gulp/-/gulp-4.0.0.tgz", - "integrity": "sha1-lXZsYB2t5Kd+0+eyttwDiBtZY2Y=", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/gulp/-/gulp-4.0.2.tgz", + "integrity": "sha512-dvEs27SCZt2ibF29xYgmnwwCYZxdxhQ/+LFWlbAW8y7jt68L/65402Lz3+CKy0Ov4rOs+NERmDq7YlZaDqUIfA==", "dev": true, "requires": { - "glob-watcher": "^5.0.0", - "gulp-cli": "^2.0.0", - "undertaker": "^1.0.0", + "glob-watcher": "^5.0.3", + "gulp-cli": "^2.2.0", + "undertaker": "^1.2.1", "vinyl-fs": "^3.0.0" }, "dependencies": { "gulp-cli": { - "version": "2.0.1", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/gulp-cli/-/gulp-cli-2.0.1.tgz", - "integrity": "sha1-eEfiIMs2YvK+im1XK/FOF75amUs=", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/gulp-cli/-/gulp-cli-2.3.0.tgz", + "integrity": "sha512-zzGBl5fHo0EKSXsHzjspp3y5CONegCm8ErO5Qh0UzFzk2y4tMvzLWhoDokADbarfZRL2pGpRp7yt6gfJX4ph7A==", "dev": true, "requires": { "ansi-colors": "^1.0.1", @@ -1715,15 +1198,15 @@ "copy-props": "^2.0.1", "fancy-log": "^1.3.2", "gulplog": "^1.0.0", - "interpret": "^1.1.0", + "interpret": "^1.4.0", "isobject": "^3.0.1", - "liftoff": "^2.5.0", + "liftoff": "^3.1.0", "matchdep": "^2.0.0", "mute-stdout": "^1.0.0", "pretty-hrtime": "^1.0.0", "replace-homedir": "^1.0.0", "semver-greatest-satisfied-range": "^1.1.0", - "v8flags": "^3.0.1", + "v8flags": "^3.2.0", "yargs": "^7.1.0" } } @@ -1731,7 +1214,7 @@ }, "gulplog": { "version": "1.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/gulplog/-/gulplog-1.0.0.tgz", + "resolved": "https://registry.npmjs.org/gulplog/-/gulplog-1.0.0.tgz", "integrity": "sha1-4oxNRdBey77YGDY86PnFkmIp/+U=", "dev": true, "requires": { @@ -1739,14 +1222,14 @@ } }, "has-symbols": { - "version": "1.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/has-symbols/-/has-symbols-1.0.0.tgz", - "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", "dev": true }, "has-value": { "version": "1.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/has-value/-/has-value-1.0.0.tgz", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", "dev": true, "requires": { @@ -1757,7 +1240,7 @@ }, "has-values": { "version": "1.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/has-values/-/has-values-1.0.0.tgz", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", "dev": true, "requires": { @@ -1767,7 +1250,7 @@ "dependencies": { "kind-of": { "version": "4.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/kind-of/-/kind-of-4.0.0.tgz", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", "dev": true, "requires": { @@ -1778,17 +1261,17 @@ }, "homedir-polyfill": { "version": "1.0.3", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", - "integrity": "sha1-dDKYzvTlrz4ZQWH7rcwhUdOgWOg=", + "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", + "integrity": "sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==", "dev": true, "requires": { "parse-passwd": "^1.0.0" } }, "hosted-git-info": { - "version": "2.7.1", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/hosted-git-info/-/hosted-git-info-2.7.1.tgz", - "integrity": "sha1-l/I2l3vW4SVAiTD/bePuxigewEc=", + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", + "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", "dev": true }, "inflight": { @@ -1809,26 +1292,26 @@ }, "ini": { "version": "1.3.5", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/ini/-/ini-1.3.5.tgz", - "integrity": "sha1-7uJfVtscnsYIXgwid4CD9Zar+Sc=", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", + "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", "dev": true }, "interpret": { - "version": "1.2.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/interpret/-/interpret-1.2.0.tgz", - "integrity": "sha1-1QYaYiS+WOgIOYX1AU2EQ1lXYpY=", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", + "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", "dev": true }, "invert-kv": { "version": "1.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/invert-kv/-/invert-kv-1.0.0.tgz", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", "dev": true }, "is-absolute": { "version": "1.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/is-absolute/-/is-absolute-1.0.0.tgz", - "integrity": "sha1-OV4a6EsR8mrReV5zwXN45IowFXY=", + "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz", + "integrity": "sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==", "dev": true, "requires": { "is-relative": "^1.0.0", @@ -1837,7 +1320,7 @@ }, "is-accessor-descriptor": { "version": "0.1.6", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", "dev": true, "requires": { @@ -1846,7 +1329,7 @@ "dependencies": { "kind-of": { "version": "3.2.2", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/kind-of/-/kind-of-3.2.2.tgz", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "dev": true, "requires": { @@ -1857,13 +1340,13 @@ }, "is-arrayish": { "version": "0.2.1", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/is-arrayish/-/is-arrayish-0.2.1.tgz", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", "dev": true }, "is-binary-path": { "version": "1.0.1", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/is-binary-path/-/is-binary-path-1.0.1.tgz", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", "dev": true, "requires": { @@ -1872,13 +1355,13 @@ }, "is-buffer": { "version": "1.1.6", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha1-76ouqdqg16suoTqXsritUf776L4=", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", "dev": true }, "is-data-descriptor": { "version": "0.1.4", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", "dev": true, "requires": { @@ -1887,7 +1370,7 @@ "dependencies": { "kind-of": { "version": "3.2.2", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/kind-of/-/kind-of-3.2.2.tgz", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "dev": true, "requires": { @@ -1898,8 +1381,8 @@ }, "is-descriptor": { "version": "0.1.6", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha1-Nm2CQN3kh8pRgjsaufB6EKeCUco=", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", "dev": true, "requires": { "is-accessor-descriptor": "^0.1.6", @@ -1909,27 +1392,27 @@ "dependencies": { "kind-of": { "version": "5.1.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha1-cpyR4thXt6QZofmqZWhcTDP1hF0=", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", "dev": true } } }, "is-extendable": { "version": "0.1.1", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/is-extendable/-/is-extendable-0.1.1.tgz", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", "dev": true }, "is-extglob": { "version": "2.1.1", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/is-extglob/-/is-extglob-2.1.1.tgz", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", "dev": true }, "is-fullwidth-code-point": { "version": "1.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", "dev": true, "requires": { @@ -1937,9 +1420,9 @@ } }, "is-glob": { - "version": "4.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/is-glob/-/is-glob-4.0.0.tgz", - "integrity": "sha1-lSHHaEXMJhCoUgPd8ICpWML/q8A=", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", "dev": true, "requires": { "is-extglob": "^2.1.1" @@ -1947,13 +1430,13 @@ }, "is-negated-glob": { "version": "1.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/is-negated-glob/-/is-negated-glob-1.0.0.tgz", + "resolved": "https://registry.npmjs.org/is-negated-glob/-/is-negated-glob-1.0.0.tgz", "integrity": "sha1-aRC8pdqMleeEtXUbl2z1oQ/uNtI=", "dev": true }, "is-number": { "version": "3.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/is-number/-/is-number-3.0.0.tgz", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", "dev": true, "requires": { @@ -1962,7 +1445,7 @@ "dependencies": { "kind-of": { "version": "3.2.2", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/kind-of/-/kind-of-3.2.2.tgz", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "dev": true, "requires": { @@ -1973,8 +1456,8 @@ }, "is-plain-object": { "version": "2.0.4", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha1-LBY7P6+xtgbZ0Xko8FwqHDjgdnc=", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", "dev": true, "requires": { "isobject": "^3.0.1" @@ -1982,8 +1465,8 @@ }, "is-relative": { "version": "1.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/is-relative/-/is-relative-1.0.0.tgz", - "integrity": "sha1-obtpNc6MXboei5dUubLcwCDiJg0=", + "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz", + "integrity": "sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==", "dev": true, "requires": { "is-unc-path": "^1.0.0" @@ -1991,8 +1474,8 @@ }, "is-unc-path": { "version": "1.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/is-unc-path/-/is-unc-path-1.0.0.tgz", - "integrity": "sha1-1zHoiY7QkKEsNSrS6u1Qla0yLJ0=", + "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz", + "integrity": "sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==", "dev": true, "requires": { "unc-path-regex": "^0.1.2" @@ -2000,61 +1483,61 @@ }, "is-utf8": { "version": "0.2.1", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/is-utf8/-/is-utf8-0.2.1.tgz", + "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", "dev": true }, "is-valid-glob": { "version": "1.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/is-valid-glob/-/is-valid-glob-1.0.0.tgz", + "resolved": "https://registry.npmjs.org/is-valid-glob/-/is-valid-glob-1.0.0.tgz", "integrity": "sha1-Kb8+/3Ab4tTTFdusw5vDn+j2Aao=", "dev": true }, "is-windows": { "version": "1.0.2", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/is-windows/-/is-windows-1.0.2.tgz", - "integrity": "sha1-0YUOuXkezRjmGCzhKjDzlmNLsZ0=", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", "dev": true }, "isarray": { "version": "1.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/isarray/-/isarray-1.0.0.tgz", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", "dev": true }, "isexe": { "version": "2.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/isexe/-/isexe-2.0.0.tgz", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", "dev": true }, "isobject": { "version": "3.0.1", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/isobject/-/isobject-3.0.1.tgz", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", "dev": true }, "json-stable-stringify-without-jsonify": { "version": "1.0.1", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", "dev": true }, "just-debounce": { "version": "1.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/just-debounce/-/just-debounce-1.0.0.tgz", + "resolved": "https://registry.npmjs.org/just-debounce/-/just-debounce-1.0.0.tgz", "integrity": "sha1-h/zPrv/AtozRnVX2cilD+SnqNeo=", "dev": true }, "kind-of": { - "version": "6.0.2", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha1-ARRrNqYhjmTljzqNZt5df8b20FE=", + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", "dev": true }, "last-run": { "version": "1.1.1", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/last-run/-/last-run-1.1.1.tgz", + "resolved": "https://registry.npmjs.org/last-run/-/last-run-1.1.1.tgz", "integrity": "sha1-RblpQsF7HHnHchmCWbqUO+v4yls=", "dev": true, "requires": { @@ -2064,7 +1547,7 @@ }, "lazystream": { "version": "1.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/lazystream/-/lazystream-1.0.0.tgz", + "resolved": "https://registry.npmjs.org/lazystream/-/lazystream-1.0.0.tgz", "integrity": "sha1-9plf4PggOS9hOWvolGJAe7dxaOQ=", "dev": true, "requires": { @@ -2073,7 +1556,7 @@ }, "lcid": { "version": "1.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/lcid/-/lcid-1.0.0.tgz", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", "dev": true, "requires": { @@ -2082,7 +1565,7 @@ }, "lead": { "version": "1.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/lead/-/lead-1.0.0.tgz", + "resolved": "https://registry.npmjs.org/lead/-/lead-1.0.0.tgz", "integrity": "sha1-bxT5mje+Op3XhPVJVpDlkDRm7kI=", "dev": true, "requires": { @@ -2090,13 +1573,13 @@ } }, "liftoff": { - "version": "2.5.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/liftoff/-/liftoff-2.5.0.tgz", - "integrity": "sha1-IAkpG7Mc6oYbvxCnwVooyvdcMew=", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/liftoff/-/liftoff-3.1.0.tgz", + "integrity": "sha512-DlIPlJUkCV0Ips2zf2pJP0unEoT1kwYhiiPUGF3s/jtxTCjziNLoiVVh+jqWOWeFi6mmwQ5fNxvAUyPad4Dfog==", "dev": true, "requires": { "extend": "^3.0.0", - "findup-sync": "^2.0.0", + "findup-sync": "^3.0.0", "fined": "^1.0.1", "flagged-respawn": "^1.0.0", "is-plain-object": "^2.0.4", @@ -2107,7 +1590,7 @@ }, "load-json-file": { "version": "1.1.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/load-json-file/-/load-json-file-1.1.0.tgz", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", "dev": true, "requires": { @@ -2120,8 +1603,8 @@ }, "make-iterator": { "version": "1.0.1", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/make-iterator/-/make-iterator-1.0.1.tgz", - "integrity": "sha1-KbM/MSqo9UfEpeSQ9Wr87JkTOtY=", + "resolved": "https://registry.npmjs.org/make-iterator/-/make-iterator-1.0.1.tgz", + "integrity": "sha512-pxiuXh0iVEq7VM7KMIhs5gxsfxCux2URptUQaXo4iZZJxBAzTPOLE2BumO5dbfVYq/hBJFBR/a1mFDmOx5AGmw==", "dev": true, "requires": { "kind-of": "^6.0.2" @@ -2129,13 +1612,13 @@ }, "map-cache": { "version": "0.2.2", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/map-cache/-/map-cache-0.2.2.tgz", + "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", "dev": true }, "map-visit": { "version": "1.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/map-visit/-/map-visit-1.0.0.tgz", + "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", "dev": true, "requires": { @@ -2144,7 +1627,7 @@ }, "matchdep": { "version": "2.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/matchdep/-/matchdep-2.0.0.tgz", + "resolved": "https://registry.npmjs.org/matchdep/-/matchdep-2.0.0.tgz", "integrity": "sha1-xvNINKDY28OzfCfui7yyfHd1WC4=", "dev": true, "requires": { @@ -2152,12 +1635,35 @@ "micromatch": "^3.0.4", "resolve": "^1.4.0", "stack-trace": "0.0.10" + }, + "dependencies": { + "findup-sync": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-2.0.0.tgz", + "integrity": "sha1-kyaxSIwi0aYIhlCoaQGy2akKLLw=", + "dev": true, + "requires": { + "detect-file": "^1.0.0", + "is-glob": "^3.1.0", + "micromatch": "^3.0.4", + "resolve-dir": "^1.0.1" + } + }, + "is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "dev": true, + "requires": { + "is-extglob": "^2.1.0" + } + } } }, "micromatch": { "version": "3.1.10", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha1-cIWbyVyYQJUvNZoGij/En57PrCM=", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", "dev": true, "requires": { "arr-diff": "^4.0.0", @@ -2207,27 +1713,27 @@ }, "ms": { "version": "2.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/ms/-/ms-2.0.0.tgz", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true }, "mute-stdout": { "version": "1.0.1", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/mute-stdout/-/mute-stdout-1.0.1.tgz", - "integrity": "sha1-rLAwDrTeI6fd7sAU4+lgRLNHIzE=", + "resolved": "https://registry.npmjs.org/mute-stdout/-/mute-stdout-1.0.1.tgz", + "integrity": "sha512-kDcwXR4PS7caBpuRYYBUz9iVixUk3anO3f5OYFiIPwK/20vCzKCHyKoulbiDY1S53zD2bxUpxN/IJ+TnXjfvxg==", "dev": true }, "nan": { - "version": "2.13.1", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/nan/-/nan-2.13.1.tgz", - "integrity": "sha1-oVvuN5C94kfo848dRG7c2usF8t0=", + "version": "2.14.1", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.1.tgz", + "integrity": "sha512-isWHgVjnFjh2x2yuJ/tj3JbwoHu3UC2dX5G/88Cm24yB6YopVgxvBObDY7n5xW6ExmFhJpSEQqFPvq9zaXc8Jw==", "dev": true, "optional": true }, "nanomatch": { "version": "1.2.13", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/nanomatch/-/nanomatch-1.2.13.tgz", - "integrity": "sha1-uHqKpPwN6P5r6IiVs4mD/yZb0Rk=", + "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", + "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", "dev": true, "requires": { "arr-diff": "^4.0.0", @@ -2245,14 +1751,14 @@ }, "next-tick": { "version": "1.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/next-tick/-/next-tick-1.0.0.tgz", + "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz", "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=", "dev": true }, "normalize-package-data": { "version": "2.5.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/normalize-package-data/-/normalize-package-data-2.5.0.tgz", - "integrity": "sha1-5m2xg4sgDB38IzIl0SyzZSDiNKg=", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", "dev": true, "requires": { "hosted-git-info": "^2.1.4", @@ -2262,18 +1768,15 @@ } }, "normalize-path": { - "version": "2.1.1", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", - "dev": true, - "requires": { - "remove-trailing-separator": "^1.0.1" - } + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true }, "now-and-later": { - "version": "2.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/now-and-later/-/now-and-later-2.0.0.tgz", - "integrity": "sha1-vGHLtFbXnLMiB85HygUTb/Ln1u4=", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/now-and-later/-/now-and-later-2.0.1.tgz", + "integrity": "sha512-KGvQ0cB70AQfg107Xvs/Fbu+dGmZoTRJp2TaPwcwQm3/7PteUyN2BCgk8KBMPGBUXZdVwyWS8fDCGFygBm19UQ==", "dev": true, "requires": { "once": "^1.3.2" @@ -2281,13 +1784,13 @@ }, "number-is-nan": { "version": "1.0.1", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/number-is-nan/-/number-is-nan-1.0.1.tgz", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", "dev": true }, "object-copy": { "version": "0.1.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/object-copy/-/object-copy-0.1.0.tgz", + "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", "dev": true, "requires": { @@ -2298,7 +1801,7 @@ "dependencies": { "define-property": { "version": "0.2.5", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/define-property/-/define-property-0.2.5.tgz", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", "dev": true, "requires": { @@ -2307,7 +1810,7 @@ }, "kind-of": { "version": "3.2.2", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/kind-of/-/kind-of-3.2.2.tgz", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "dev": true, "requires": { @@ -2317,14 +1820,14 @@ } }, "object-keys": { - "version": "1.1.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/object-keys/-/object-keys-1.1.0.tgz", - "integrity": "sha1-Eb0iNI3S4JagRasG9shbzDQPoDI=", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", "dev": true }, "object-visit": { "version": "1.0.1", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/object-visit/-/object-visit-1.0.1.tgz", + "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", "dev": true, "requires": { @@ -2333,8 +1836,8 @@ }, "object.assign": { "version": "4.1.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/object.assign/-/object.assign-4.1.0.tgz", - "integrity": "sha1-lovxEA15Vrs8oIbwBvhGs7xACNo=", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", + "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", "dev": true, "requires": { "define-properties": "^1.1.2", @@ -2345,7 +1848,7 @@ }, "object.defaults": { "version": "1.1.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/object.defaults/-/object.defaults-1.1.0.tgz", + "resolved": "https://registry.npmjs.org/object.defaults/-/object.defaults-1.1.0.tgz", "integrity": "sha1-On+GgzS0B96gbaFtiNXNKeQ1/s8=", "dev": true, "requires": { @@ -2357,7 +1860,7 @@ }, "object.map": { "version": "1.0.1", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/object.map/-/object.map-1.0.1.tgz", + "resolved": "https://registry.npmjs.org/object.map/-/object.map-1.0.1.tgz", "integrity": "sha1-z4Plncj8wK1fQlDh94s7gb2AHTc=", "dev": true, "requires": { @@ -2367,7 +1870,7 @@ }, "object.pick": { "version": "1.3.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/object.pick/-/object.pick-1.3.0.tgz", + "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", "dev": true, "requires": { @@ -2376,7 +1879,7 @@ }, "object.reduce": { "version": "1.0.1", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/object.reduce/-/object.reduce-1.0.1.tgz", + "resolved": "https://registry.npmjs.org/object.reduce/-/object.reduce-1.0.1.tgz", "integrity": "sha1-b+NI8qx/oPlcpiEiZZkJaCW7A60=", "dev": true, "requires": { @@ -2395,7 +1898,7 @@ }, "ordered-read-streams": { "version": "1.0.1", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/ordered-read-streams/-/ordered-read-streams-1.0.1.tgz", + "resolved": "https://registry.npmjs.org/ordered-read-streams/-/ordered-read-streams-1.0.1.tgz", "integrity": "sha1-d8DLN8QVJdZBZtmQ/61+xqDhNj4=", "dev": true, "requires": { @@ -2404,7 +1907,7 @@ }, "os-locale": { "version": "1.4.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/os-locale/-/os-locale-1.4.0.tgz", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", "dev": true, "requires": { @@ -2413,7 +1916,7 @@ }, "parse-filepath": { "version": "1.0.2", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/parse-filepath/-/parse-filepath-1.0.2.tgz", + "resolved": "https://registry.npmjs.org/parse-filepath/-/parse-filepath-1.0.2.tgz", "integrity": "sha1-pjISf1Oq89FYdvWHLz/6x2PWyJE=", "dev": true, "requires": { @@ -2424,7 +1927,7 @@ }, "parse-json": { "version": "2.2.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/parse-json/-/parse-json-2.2.0.tgz", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", "dev": true, "requires": { @@ -2433,31 +1936,31 @@ }, "parse-node-version": { "version": "1.0.1", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/parse-node-version/-/parse-node-version-1.0.1.tgz", - "integrity": "sha1-4rXb7eAOf6m8NjYH9TMn6LBzGJs=", + "resolved": "https://registry.npmjs.org/parse-node-version/-/parse-node-version-1.0.1.tgz", + "integrity": "sha512-3YHlOa/JgH6Mnpr05jP9eDG254US9ek25LyIxZlDItp2iJtwyaXQb57lBYLdT3MowkUFYEV2XXNAYIPlESvJlA==", "dev": true }, "parse-passwd": { "version": "1.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/parse-passwd/-/parse-passwd-1.0.0.tgz", + "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=", "dev": true }, "pascalcase": { "version": "0.1.1", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/pascalcase/-/pascalcase-0.1.1.tgz", + "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", "dev": true }, "path-dirname": { "version": "1.0.2", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/path-dirname/-/path-dirname-1.0.2.tgz", + "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=", "dev": true }, "path-exists": { "version": "2.1.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/path-exists/-/path-exists-2.1.0.tgz", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", "dev": true, "requires": { @@ -2472,13 +1975,13 @@ }, "path-parse": { "version": "1.0.6", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha1-1i27VnlAXXLEc37FhgDp3c8G0kw=", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", "dev": true }, "path-root": { "version": "0.1.1", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/path-root/-/path-root-0.1.1.tgz", + "resolved": "https://registry.npmjs.org/path-root/-/path-root-0.1.1.tgz", "integrity": "sha1-mkpoFMrBwM1zNgqV8yCDyOpHRbc=", "dev": true, "requires": { @@ -2487,13 +1990,13 @@ }, "path-root-regex": { "version": "0.1.2", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/path-root-regex/-/path-root-regex-0.1.2.tgz", + "resolved": "https://registry.npmjs.org/path-root-regex/-/path-root-regex-0.1.2.tgz", "integrity": "sha1-v8zcjfWxLcUsi0PsONGNcsBLqW0=", "dev": true }, "path-type": { "version": "1.1.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/path-type/-/path-type-1.1.0.tgz", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", "dev": true, "requires": { @@ -2504,19 +2007,19 @@ }, "pify": { "version": "2.3.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/pify/-/pify-2.3.0.tgz", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", "dev": true }, "pinkie": { "version": "2.0.4", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/pinkie/-/pinkie-2.0.4.tgz", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", "dev": true }, "pinkie-promise": { "version": "2.0.1", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", "dev": true, "requires": { @@ -2525,26 +2028,26 @@ }, "posix-character-classes": { "version": "0.1.1", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/posix-character-classes/-/posix-character-classes-0.1.1.tgz", + "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", "dev": true }, "pretty-hrtime": { "version": "1.0.3", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz", + "resolved": "https://registry.npmjs.org/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz", "integrity": "sha1-t+PqQkNaTJsnWdmeDyAesZWALuE=", "dev": true }, "process-nextick-args": { - "version": "1.0.7", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/process-nextick-args/-/process-nextick-args-1.0.7.tgz", - "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", "dev": true }, "pump": { "version": "2.0.1", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/pump/-/pump-2.0.1.tgz", - "integrity": "sha1-Ejma3W5M91Jtlzy8i1zi4pCLOQk=", + "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", + "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", "dev": true, "requires": { "end-of-stream": "^1.1.0", @@ -2553,8 +2056,8 @@ }, "pumpify": { "version": "1.5.1", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/pumpify/-/pumpify-1.5.1.tgz", - "integrity": "sha1-NlE74karJ1cLGjdKXOJ4v9dDcM4=", + "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.5.1.tgz", + "integrity": "sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==", "dev": true, "requires": { "duplexify": "^3.6.0", @@ -2564,7 +2067,7 @@ }, "read-pkg": { "version": "1.1.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/read-pkg/-/read-pkg-1.1.0.tgz", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", "dev": true, "requires": { @@ -2575,7 +2078,7 @@ }, "read-pkg-up": { "version": "1.0.1", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/read-pkg-up/-/read-pkg-up-1.0.1.tgz", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", "dev": true, "requires": { @@ -2584,9 +2087,9 @@ } }, "readable-stream": { - "version": "2.3.6", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha1-sRwn2IuP8fvgcGQ8+UsMea4bCq8=", + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", "dev": true, "requires": { "core-util-is": "~1.0.0", @@ -2596,20 +2099,12 @@ "safe-buffer": "~5.1.1", "string_decoder": "~1.1.1", "util-deprecate": "~1.0.1" - }, - "dependencies": { - "process-nextick-args": { - "version": "2.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/process-nextick-args/-/process-nextick-args-2.0.0.tgz", - "integrity": "sha1-o31zL0JxtKsa0HDTVQjoKQeI/6o=", - "dev": true - } } }, "readdirp": { "version": "2.2.1", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/readdirp/-/readdirp-2.2.1.tgz", - "integrity": "sha1-DodiKjMlqjPokihcr4tOhGUppSU=", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", + "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", "dev": true, "requires": { "graceful-fs": "^4.1.11", @@ -2619,7 +2114,7 @@ }, "rechoir": { "version": "0.6.2", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/rechoir/-/rechoir-0.6.2.tgz", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", "dev": true, "requires": { @@ -2628,8 +2123,8 @@ }, "regex-not": { "version": "1.0.2", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/regex-not/-/regex-not-1.0.2.tgz", - "integrity": "sha1-H07OJ+ALC2XgJHpoEOaoXYOldSw=", + "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", + "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", "dev": true, "requires": { "extend-shallow": "^3.0.2", @@ -2638,8 +2133,8 @@ }, "remove-bom-buffer": { "version": "3.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/remove-bom-buffer/-/remove-bom-buffer-3.0.0.tgz", - "integrity": "sha1-wr8eN3Ug0yT2I4kuM8EMrCwlK1M=", + "resolved": "https://registry.npmjs.org/remove-bom-buffer/-/remove-bom-buffer-3.0.0.tgz", + "integrity": "sha512-8v2rWhaakv18qcvNeli2mZ/TMTL2nEyAKRvzo1WtnZBl15SHyEhrCu2/xKlJyUFKHiHgfXIyuY6g2dObJJycXQ==", "dev": true, "requires": { "is-buffer": "^1.1.5", @@ -2648,7 +2143,7 @@ }, "remove-bom-stream": { "version": "1.2.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/remove-bom-stream/-/remove-bom-stream-1.2.0.tgz", + "resolved": "https://registry.npmjs.org/remove-bom-stream/-/remove-bom-stream-1.2.0.tgz", "integrity": "sha1-BfGlk/FuQuH7kOv1nejlaVJflSM=", "dev": true, "requires": { @@ -2659,31 +2154,31 @@ }, "remove-trailing-separator": { "version": "1.1.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", "dev": true }, "repeat-element": { "version": "1.1.3", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/repeat-element/-/repeat-element-1.1.3.tgz", - "integrity": "sha1-eC4NglwMWjuzlzH4Tv7mt0Lmsc4=", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", + "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==", "dev": true }, "repeat-string": { "version": "1.6.1", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/repeat-string/-/repeat-string-1.6.1.tgz", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", "dev": true }, "replace-ext": { - "version": "1.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/replace-ext/-/replace-ext-1.0.0.tgz", - "integrity": "sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.1.tgz", + "integrity": "sha512-yD5BHCe7quCgBph4rMQ+0KkIRKwWCrHDOX1p1Gp6HwjPM5kVoCdKGNhN7ydqqsX6lJEnQDKZ/tFMiEdQ1dvPEw==", "dev": true }, "replace-homedir": { "version": "1.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/replace-homedir/-/replace-homedir-1.0.0.tgz", + "resolved": "https://registry.npmjs.org/replace-homedir/-/replace-homedir-1.0.0.tgz", "integrity": "sha1-6H9tUTuSjd6AgmDBK+f+xv9ueYw=", "dev": true, "requires": { @@ -2694,20 +2189,20 @@ }, "require-directory": { "version": "2.1.1", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/require-directory/-/require-directory-2.1.1.tgz", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", "dev": true }, "require-main-filename": { "version": "1.0.1", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/require-main-filename/-/require-main-filename-1.0.1.tgz", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", "dev": true }, "resolve": { - "version": "1.10.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/resolve/-/resolve-1.10.0.tgz", - "integrity": "sha1-O9qur0XMB/N1ZW39LlTtCBCxAbo=", + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", + "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", "dev": true, "requires": { "path-parse": "^1.0.6" @@ -2715,7 +2210,7 @@ }, "resolve-dir": { "version": "1.0.1", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/resolve-dir/-/resolve-dir-1.0.1.tgz", + "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz", "integrity": "sha1-eaQGRMNivoLybv/nOcm7U4IEb0M=", "dev": true, "requires": { @@ -2725,7 +2220,7 @@ }, "resolve-options": { "version": "1.1.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/resolve-options/-/resolve-options-1.1.0.tgz", + "resolved": "https://registry.npmjs.org/resolve-options/-/resolve-options-1.1.0.tgz", "integrity": "sha1-MrueOcBtZzONyTeMDW1gdFZq0TE=", "dev": true, "requires": { @@ -2734,14 +2229,14 @@ }, "resolve-url": { "version": "0.2.1", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/resolve-url/-/resolve-url-0.2.1.tgz", + "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", "dev": true }, "ret": { "version": "0.1.15", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/ret/-/ret-0.1.15.tgz", - "integrity": "sha1-uKSCXVvbH8P29Twrwz+BOIaBx7w=", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", "dev": true }, "rimraf": { @@ -2755,13 +2250,13 @@ }, "safe-buffer": { "version": "5.1.2", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha1-mR7GnSluAxN0fVm9/St0XDX4go0=", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true }, "safe-regex": { "version": "1.1.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/safe-regex/-/safe-regex-1.1.0.tgz", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", "dev": true, "requires": { @@ -2769,14 +2264,14 @@ } }, "semver": { - "version": "5.6.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/semver/-/semver-5.6.0.tgz", - "integrity": "sha1-fnQlb7qknHWqfHogXMInmcrIAAQ=", + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", "dev": true }, "semver-greatest-satisfied-range": { "version": "1.1.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/semver-greatest-satisfied-range/-/semver-greatest-satisfied-range-1.1.0.tgz", + "resolved": "https://registry.npmjs.org/semver-greatest-satisfied-range/-/semver-greatest-satisfied-range-1.1.0.tgz", "integrity": "sha1-E+jCZYq5aRywzXEJMkAoDTb3els=", "dev": true, "requires": { @@ -2785,7 +2280,7 @@ }, "set-blocking": { "version": "2.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/set-blocking/-/set-blocking-2.0.0.tgz", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", "dev": true }, @@ -2803,7 +2298,7 @@ "dependencies": { "extend-shallow": { "version": "2.0.1", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/extend-shallow/-/extend-shallow-2.0.1.tgz", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { @@ -2814,8 +2309,8 @@ }, "snapdragon": { "version": "0.8.2", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/snapdragon/-/snapdragon-0.8.2.tgz", - "integrity": "sha1-ZJIufFZbDhQgS6GqfWlkJ40lGC0=", + "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", + "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", "dev": true, "requires": { "base": "^0.11.1", @@ -2830,7 +2325,7 @@ "dependencies": { "define-property": { "version": "0.2.5", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/define-property/-/define-property-0.2.5.tgz", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", "dev": true, "requires": { @@ -2839,7 +2334,7 @@ }, "extend-shallow": { "version": "2.0.1", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/extend-shallow/-/extend-shallow-2.0.1.tgz", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { @@ -2850,8 +2345,8 @@ }, "snapdragon-node": { "version": "2.1.1", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/snapdragon-node/-/snapdragon-node-2.1.1.tgz", - "integrity": "sha1-bBdfhv8UvbByRWPo88GwIaKGhTs=", + "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", + "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", "dev": true, "requires": { "define-property": "^1.0.0", @@ -2861,7 +2356,7 @@ "dependencies": { "define-property": { "version": "1.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/define-property/-/define-property-1.0.0.tgz", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", "dev": true, "requires": { @@ -2870,8 +2365,8 @@ }, "is-accessor-descriptor": { "version": "1.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha1-FpwvbT3x+ZJhgHI2XJsOofaHhlY=", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", "dev": true, "requires": { "kind-of": "^6.0.0" @@ -2879,8 +2374,8 @@ }, "is-data-descriptor": { "version": "1.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha1-2Eh2Mh0Oet0DmQQGq7u9NrqSaMc=", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", "dev": true, "requires": { "kind-of": "^6.0.0" @@ -2888,8 +2383,8 @@ }, "is-descriptor": { "version": "1.0.2", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha1-OxWXRqZmBLBPjIFSS6NlxfFNhuw=", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", "dev": true, "requires": { "is-accessor-descriptor": "^1.0.0", @@ -2901,8 +2396,8 @@ }, "snapdragon-util": { "version": "3.0.1", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/snapdragon-util/-/snapdragon-util-3.0.1.tgz", - "integrity": "sha1-+VZHlIbyrNeXAGk/b3uAXkWrVuI=", + "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", + "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", "dev": true, "requires": { "kind-of": "^3.2.0" @@ -2910,7 +2405,7 @@ "dependencies": { "kind-of": { "version": "3.2.2", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/kind-of/-/kind-of-3.2.2.tgz", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "dev": true, "requires": { @@ -2921,17 +2416,17 @@ }, "source-map": { "version": "0.5.7", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/source-map/-/source-map-0.5.7.tgz", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", "dev": true }, "source-map-resolve": { - "version": "0.5.2", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/source-map-resolve/-/source-map-resolve-0.5.2.tgz", - "integrity": "sha1-cuLMNAlVQ+Q7LGKyxMENSpBU8lk=", + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz", + "integrity": "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==", "dev": true, "requires": { - "atob": "^2.1.1", + "atob": "^2.1.2", "decode-uri-component": "^0.2.0", "resolve-url": "^0.2.1", "source-map-url": "^0.4.0", @@ -2940,20 +2435,20 @@ }, "source-map-url": { "version": "0.4.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/source-map-url/-/source-map-url-0.4.0.tgz", + "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", "dev": true }, "sparkles": { "version": "1.0.1", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/sparkles/-/sparkles-1.0.1.tgz", - "integrity": "sha1-AI22XtzmxQ7sDF4ijhlFBh3QQ3w=", + "resolved": "https://registry.npmjs.org/sparkles/-/sparkles-1.0.1.tgz", + "integrity": "sha512-dSO0DDYUahUt/0/pD/Is3VIm5TGJjludZ0HVymmhYF6eNA53PVLhnUk0znSYbH8IYBuJdCE+1luR22jNLMaQdw==", "dev": true }, "spdx-correct": { - "version": "3.1.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/spdx-correct/-/spdx-correct-3.1.0.tgz", - "integrity": "sha1-+4PlBERSaPFUsHTiGMh8ADzTHfQ=", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", + "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", "dev": true, "requires": { "spdx-expression-parse": "^3.0.0", @@ -2961,15 +2456,15 @@ } }, "spdx-exceptions": { - "version": "2.2.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz", - "integrity": "sha1-LqRQrudPKom/uUUZwH/Nb0EyKXc=", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", + "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", "dev": true }, "spdx-expression-parse": { - "version": "3.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", - "integrity": "sha1-meEZt6XaAOBUkcn6M4t5BII7QdA=", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", "dev": true, "requires": { "spdx-exceptions": "^2.1.0", @@ -2977,15 +2472,15 @@ } }, "spdx-license-ids": { - "version": "3.0.3", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/spdx-license-ids/-/spdx-license-ids-3.0.3.tgz", - "integrity": "sha1-gcDOjyFHR1YUi7tfO/wPNr8V124=", + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz", + "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==", "dev": true }, "split-string": { "version": "3.1.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/split-string/-/split-string-3.1.0.tgz", - "integrity": "sha1-fLCd2jqGWFcFxks5pkZgOGguj+I=", + "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", + "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", "dev": true, "requires": { "extend-shallow": "^3.0.0" @@ -2993,13 +2488,13 @@ }, "stack-trace": { "version": "0.0.10", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/stack-trace/-/stack-trace-0.0.10.tgz", + "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", "integrity": "sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA=", "dev": true }, "static-extend": { "version": "0.1.2", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/static-extend/-/static-extend-0.1.2.tgz", + "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", "dev": true, "requires": { @@ -3009,7 +2504,7 @@ "dependencies": { "define-property": { "version": "0.2.5", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/define-property/-/define-property-0.2.5.tgz", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", "dev": true, "requires": { @@ -3020,19 +2515,19 @@ }, "stream-exhaust": { "version": "1.0.2", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/stream-exhaust/-/stream-exhaust-1.0.2.tgz", - "integrity": "sha1-rNrI2lnvK8HheiwMz2wyDRIOVV0=", + "resolved": "https://registry.npmjs.org/stream-exhaust/-/stream-exhaust-1.0.2.tgz", + "integrity": "sha512-b/qaq/GlBK5xaq1yrK9/zFcyRSTNxmcZwFLGSTG0mXgZl/4Z6GgiyYOXOvY7N3eEvFRAG1bkDRz5EPGSvPYQlw==", "dev": true }, "stream-shift": { - "version": "1.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/stream-shift/-/stream-shift-1.0.0.tgz", - "integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz", + "integrity": "sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==", "dev": true }, "string-width": { "version": "1.0.2", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/string-width/-/string-width-1.0.2.tgz", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "dev": true, "requires": { @@ -3043,8 +2538,8 @@ }, "string_decoder": { "version": "1.1.1", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha1-nPFhG6YmhdcDCunkujQUnDrwP8g=", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, "requires": { "safe-buffer": "~5.1.0" @@ -3052,7 +2547,7 @@ }, "strip-ansi": { "version": "3.0.1", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/strip-ansi/-/strip-ansi-3.0.1.tgz", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, "requires": { @@ -3061,7 +2556,7 @@ }, "strip-bom": { "version": "2.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/strip-bom/-/strip-bom-2.0.0.tgz", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", "dev": true, "requires": { @@ -3070,7 +2565,7 @@ }, "sver-compat": { "version": "1.5.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/sver-compat/-/sver-compat-1.5.0.tgz", + "resolved": "https://registry.npmjs.org/sver-compat/-/sver-compat-1.5.0.tgz", "integrity": "sha1-PPh9/rTQe0o/FIJ7wYaz/QxkXNg=", "dev": true, "requires": { @@ -3080,8 +2575,8 @@ }, "through2": { "version": "2.0.5", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/through2/-/through2-2.0.5.tgz", - "integrity": "sha1-AcHjnrMdB8t9A6lqcIIyYLIxMs0=", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", "dev": true, "requires": { "readable-stream": "~2.3.6", @@ -3090,8 +2585,8 @@ }, "through2-filter": { "version": "3.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/through2-filter/-/through2-filter-3.0.0.tgz", - "integrity": "sha1-cA54bfI2fCyIzYqlvkz5weeDElQ=", + "resolved": "https://registry.npmjs.org/through2-filter/-/through2-filter-3.0.0.tgz", + "integrity": "sha512-jaRjI2WxN3W1V8/FMZ9HKIBXixtiqs3SQSX4/YGIiP3gL6djW48VoZq9tDqeCWs3MT8YY5wb/zli8VW8snY1CA==", "dev": true, "requires": { "through2": "~2.0.0", @@ -3100,13 +2595,13 @@ }, "time-stamp": { "version": "1.1.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/time-stamp/-/time-stamp-1.1.0.tgz", + "resolved": "https://registry.npmjs.org/time-stamp/-/time-stamp-1.1.0.tgz", "integrity": "sha1-dkpaEa9QVhkhsTPztE5hhofg9cM=", "dev": true }, "to-absolute-glob": { "version": "2.0.2", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/to-absolute-glob/-/to-absolute-glob-2.0.2.tgz", + "resolved": "https://registry.npmjs.org/to-absolute-glob/-/to-absolute-glob-2.0.2.tgz", "integrity": "sha1-GGX0PZ50sIItufFFt4z/fQ98hJs=", "dev": true, "requires": { @@ -3116,7 +2611,7 @@ }, "to-object-path": { "version": "0.3.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/to-object-path/-/to-object-path-0.3.0.tgz", + "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", "dev": true, "requires": { @@ -3125,7 +2620,7 @@ "dependencies": { "kind-of": { "version": "3.2.2", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/kind-of/-/kind-of-3.2.2.tgz", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "dev": true, "requires": { @@ -3136,8 +2631,8 @@ }, "to-regex": { "version": "3.0.2", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/to-regex/-/to-regex-3.0.2.tgz", - "integrity": "sha1-E8/dmzNlUvMLUfM6iuG0Knp1mc4=", + "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", + "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", "dev": true, "requires": { "define-property": "^2.0.2", @@ -3148,7 +2643,7 @@ }, "to-regex-range": { "version": "2.1.1", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/to-regex-range/-/to-regex-range-2.1.1.tgz", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", "dev": true, "requires": { @@ -3158,29 +2653,35 @@ }, "to-through": { "version": "2.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/to-through/-/to-through-2.0.0.tgz", + "resolved": "https://registry.npmjs.org/to-through/-/to-through-2.0.0.tgz", "integrity": "sha1-/JKtq6ByZHvAtn1rA2ZKoZUJOvY=", "dev": true, "requires": { "through2": "^2.0.3" } }, + "type": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz", + "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==", + "dev": true + }, "typedarray": { "version": "0.0.6", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/typedarray/-/typedarray-0.0.6.tgz", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", "dev": true }, "unc-path-regex": { "version": "0.1.2", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/unc-path-regex/-/unc-path-regex-0.1.2.tgz", + "resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz", "integrity": "sha1-5z3T17DXxe2G+6xrCufYxqadUPo=", "dev": true }, "undertaker": { - "version": "1.2.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/undertaker/-/undertaker-1.2.0.tgz", - "integrity": "sha1-M52kZGJS0ILcN45wgGcpl1DhG0k=", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/undertaker/-/undertaker-1.2.1.tgz", + "integrity": "sha512-71WxIzDkgYk9ZS+spIB8iZXchFhAdEo2YU8xYqBYJ39DIUIqziK78ftm26eecoIY49X0J2MLhG4hr18Yp6/CMA==", "dev": true, "requires": { "arr-flatten": "^1.0.1", @@ -3196,7 +2697,7 @@ }, "undertaker-registry": { "version": "1.0.1", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/undertaker-registry/-/undertaker-registry-1.0.1.tgz", + "resolved": "https://registry.npmjs.org/undertaker-registry/-/undertaker-registry-1.0.1.tgz", "integrity": "sha1-XkvaMI5KiirlhPm5pDWaSZglzFA=", "dev": true }, @@ -3214,8 +2715,8 @@ }, "unique-stream": { "version": "2.3.1", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/unique-stream/-/unique-stream-2.3.1.tgz", - "integrity": "sha1-xl0RDppK35psWUiygFPZqNBMvqw=", + "resolved": "https://registry.npmjs.org/unique-stream/-/unique-stream-2.3.1.tgz", + "integrity": "sha512-2nY4TnBE70yoxHkDli7DMazpWiP7xMdCYqU2nBRO0UB+ZpEkGsSija7MvmvnZFUeC+mrgiUfcHSr3LmRFIg4+A==", "dev": true, "requires": { "json-stable-stringify-without-jsonify": "^1.0.1", @@ -3224,7 +2725,7 @@ }, "unset-value": { "version": "1.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/unset-value/-/unset-value-1.0.0.tgz", + "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", "dev": true, "requires": { @@ -3234,7 +2735,7 @@ "dependencies": { "has-value": { "version": "0.3.1", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/has-value/-/has-value-0.3.1.tgz", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", "dev": true, "requires": { @@ -3245,7 +2746,7 @@ "dependencies": { "isobject": { "version": "2.1.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/isobject/-/isobject-2.1.0.tgz", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", "dev": true, "requires": { @@ -3256,40 +2757,40 @@ }, "has-values": { "version": "0.1.4", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/has-values/-/has-values-0.1.4.tgz", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", "dev": true } } }, "upath": { - "version": "1.1.2", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/upath/-/upath-1.1.2.tgz", - "integrity": "sha1-PbZYYA7a7sy+bbXmhNZ+6MKs0Gg=", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/upath/-/upath-1.2.0.tgz", + "integrity": "sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==", "dev": true }, "urix": { "version": "0.1.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/urix/-/urix-0.1.0.tgz", + "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", "dev": true }, "use": { "version": "3.1.1", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/use/-/use-3.1.1.tgz", - "integrity": "sha1-1QyMrHmhn7wg8pEfVuuXP04QBw8=", + "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", + "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", "dev": true }, "util-deprecate": { "version": "1.0.2", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/util-deprecate/-/util-deprecate-1.0.2.tgz", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", "dev": true }, "v8flags": { - "version": "3.1.2", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/v8flags/-/v8flags-3.1.2.tgz", - "integrity": "sha1-/FzQwidCgYHmwpspkuT48dpeDJ8=", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-3.2.0.tgz", + "integrity": "sha512-mH8etigqMfiGWdeXpaaqGfs6BndypxusHHcv2qSHyZkGEznCd/qAXCWWRzeowtL54147cktFOC4P5y+kl8d8Jg==", "dev": true, "requires": { "homedir-polyfill": "^1.0.1" @@ -3297,8 +2798,8 @@ }, "validate-npm-package-license": { "version": "3.0.4", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", - "integrity": "sha1-/JH2uce6FchX9MssXe/uw51PQQo=", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", "dev": true, "requires": { "spdx-correct": "^3.0.0", @@ -3307,14 +2808,14 @@ }, "value-or-function": { "version": "3.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/value-or-function/-/value-or-function-3.0.0.tgz", + "resolved": "https://registry.npmjs.org/value-or-function/-/value-or-function-3.0.0.tgz", "integrity": "sha1-HCQ6ULWVwb5Up1S/7OhWO5/42BM=", "dev": true }, "vinyl": { "version": "2.2.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/vinyl/-/vinyl-2.2.0.tgz", - "integrity": "sha1-2FsH2pbkWNJbL/4Z/s6fLKoT7YY=", + "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.2.0.tgz", + "integrity": "sha512-MBH+yP0kC/GQ5GwBqrTPTzEfiiLjta7hTtvQtbxBgTeSXsmKQRQecjibMbxIXzVT3Y9KJK+drOz1/k+vsu8Nkg==", "dev": true, "requires": { "clone": "^2.1.1", @@ -3327,8 +2828,8 @@ }, "vinyl-fs": { "version": "3.0.3", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/vinyl-fs/-/vinyl-fs-3.0.3.tgz", - "integrity": "sha1-yFhJQF9nQo/qu71cXb3WT0fTG8c=", + "resolved": "https://registry.npmjs.org/vinyl-fs/-/vinyl-fs-3.0.3.tgz", + "integrity": "sha512-vIu34EkyNyJxmP0jscNzWBSygh7VWhqun6RmqVfXePrOwi9lhvRs//dOaGOTRUQr4tx7/zd26Tk5WeSVZitgng==", "dev": true, "requires": { "fs-mkdirp-stream": "^1.0.0", @@ -3352,7 +2853,7 @@ }, "vinyl-sourcemap": { "version": "1.1.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/vinyl-sourcemap/-/vinyl-sourcemap-1.1.0.tgz", + "resolved": "https://registry.npmjs.org/vinyl-sourcemap/-/vinyl-sourcemap-1.1.0.tgz", "integrity": "sha1-kqgAWTo4cDqM2xHYswCtS+Y7PhY=", "dev": true, "requires": { @@ -3363,6 +2864,17 @@ "now-and-later": "^2.0.0", "remove-bom-buffer": "^3.0.0", "vinyl": "^2.0.0" + }, + "dependencies": { + "normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, + "requires": { + "remove-trailing-separator": "^1.0.1" + } + } } }, "vsts-npm-auth": { @@ -3373,8 +2885,8 @@ }, "which": { "version": "1.3.1", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/which/-/which-1.3.1.tgz", - "integrity": "sha1-pFBD1U9YBTFtqNYvn1CRjT2nCwo=", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", "dev": true, "requires": { "isexe": "^2.0.0" @@ -3382,13 +2894,13 @@ }, "which-module": { "version": "1.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/which-module/-/which-module-1.0.0.tgz", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz", "integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8=", "dev": true }, "wrap-ansi": { "version": "2.1.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", "dev": true, "requires": { @@ -3403,21 +2915,21 @@ "dev": true }, "xtend": { - "version": "4.0.1", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/xtend/-/xtend-4.0.1.tgz", - "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", "dev": true }, "y18n": { "version": "3.2.1", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/y18n/-/y18n-3.2.1.tgz", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=", "dev": true }, "yargs": { - "version": "7.1.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/yargs/-/yargs-7.1.0.tgz", - "integrity": "sha1-a6MY6xaWFyf10oT46gA+jWFU0Mg=", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-7.1.1.tgz", + "integrity": "sha512-huO4Fr1f9PmiJJdll5kwoS2e4GqzGSsMT3PPMpOwoVkOK8ckqAewMTZyA6LXVQWflleb/Z8oPBEvNsMft0XE+g==", "dev": true, "requires": { "camelcase": "^3.0.0", @@ -3432,16 +2944,17 @@ "string-width": "^1.0.2", "which-module": "^1.0.0", "y18n": "^3.2.1", - "yargs-parser": "^5.0.0" + "yargs-parser": "5.0.0-security.0" } }, "yargs-parser": { - "version": "5.0.0", - "resolved": "https://devdiv.pkgs.visualstudio.com/_packaging/CloudKernel/npm/registry/yargs-parser/-/yargs-parser-5.0.0.tgz", - "integrity": "sha1-J17PDX/+Bcd+ZOfIbkzZS/DhIoo=", + "version": "5.0.0-security.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-5.0.0-security.0.tgz", + "integrity": "sha512-T69y4Ps64LNesYxeYGYPvfoMTt/7y1XtfpIslUeK4um+9Hu7hlGoRtaDLvdXb7+/tfq4opVa2HRY5xGip022rQ==", "dev": true, "requires": { - "camelcase": "^3.0.0" + "camelcase": "^3.0.0", + "object.assign": "^4.1.0" } } } diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/EdgeBuilder.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/EdgeBuilder.java index b12d974..6e0b4b0 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/EdgeBuilder.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/EdgeBuilder.java @@ -62,6 +62,10 @@ public Edge next(Vertex from, Vertex to) { return new Edge(generator.next(), Edge.NEXT, from.getId(), to.getId()); } + public Edge moniker(Vertex from, Vertex to) { + return new Edge(generator.next(), Edge.MONIKER, from.getId(), to.getId()); + } + public Edge diagnostic(Vertex from, Vertex to) { return new Edge(generator.next(), Edge.T_DIAGNOSTIC, from.getId(), to.getId()); } diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/VertexBuilder.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/VertexBuilder.java index ed9ec6a..20c33d0 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/VertexBuilder.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/VertexBuilder.java @@ -21,6 +21,7 @@ import com.microsoft.java.lsif.core.internal.protocol.HoverResult; import com.microsoft.java.lsif.core.internal.protocol.ImplementationResult; import com.microsoft.java.lsif.core.internal.protocol.MetaData; +import com.microsoft.java.lsif.core.internal.protocol.Moniker; import com.microsoft.java.lsif.core.internal.protocol.Project; import com.microsoft.java.lsif.core.internal.protocol.Range; import com.microsoft.java.lsif.core.internal.protocol.ReferenceResult; @@ -90,4 +91,8 @@ public DocumentSymbolResult documentSymbolResult(List symbols) { public DiagnosticResult diagnosticResult(List diagnostics) { return new DiagnosticResult(generator.next(), diagnostics); } + + public Moniker moniker(String kind, String identifier) { + return new Moniker(generator.next(), kind, identifier); + } } diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/Edge.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/Edge.java index e0291c2..f2070e9 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/Edge.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/Edge.java @@ -39,6 +39,7 @@ public class Edge extends Element { public final static String T_IMPLEMENTATION = "textDocument/implementation"; + public final static String MONIKER = "moniker"; private String outV; private String inV; diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/Moniker.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/Moniker.java new file mode 100644 index 0000000..6ad7feb --- /dev/null +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/Moniker.java @@ -0,0 +1,22 @@ +/* -------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * ------------------------------------------------------------------------------------------ */ + +package com.microsoft.java.lsif.core.internal.protocol; + +public class Moniker extends Vertex { + + private String scheme = "jdt"; + + private String kind; + + private String identifier; + + public Moniker(String id, String kind, String identifier) { + super(id, Vertex.MONIKER); + this.kind = kind; + this.identifier = identifier; + this.scheme = "jdt"; + } +} diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/Vertex.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/Vertex.java index 911846c..20386f9 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/Vertex.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/Vertex.java @@ -45,6 +45,7 @@ public class Vertex extends Element { public static final String IMPLEMENTATIONRESULT = "implementationResult"; + public static final String MONIKER = "moniker"; public Vertex(String id, String label) { super(id, Element.VERTEX, label); } diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/LsifVisitor.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/LsifVisitor.java index 38b28aa..5057017 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/LsifVisitor.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/LsifVisitor.java @@ -6,13 +6,35 @@ package com.microsoft.java.lsif.core.internal.visitors; import org.apache.commons.codec.digest.DigestUtils; +import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.jdt.core.IClassFile; +import org.eclipse.jdt.core.IClasspathAttribute; +import org.eclipse.jdt.core.IClasspathEntry; +import org.eclipse.jdt.core.ICompilationUnit; import org.eclipse.jdt.core.IJavaElement; +import org.eclipse.jdt.core.IJavaProject; +import org.eclipse.jdt.core.JavaModelException; import org.eclipse.jdt.core.dom.ASTNode; +import org.eclipse.jdt.core.dom.EnumConstantDeclaration; +import org.eclipse.jdt.core.dom.EnumDeclaration; +import org.eclipse.jdt.core.dom.FieldDeclaration; import org.eclipse.jdt.core.dom.MethodDeclaration; +import org.eclipse.jdt.core.dom.Modifier; import org.eclipse.jdt.core.dom.SimpleName; import org.eclipse.jdt.core.dom.SimpleType; +import org.eclipse.jdt.core.dom.SingleVariableDeclaration; import org.eclipse.jdt.core.dom.TypeDeclaration; +import org.eclipse.jdt.core.dom.VariableDeclarationFragment; +import org.eclipse.jdt.core.dom.VariableDeclarationStatement; +import org.eclipse.jdt.internal.core.BinaryType; +import org.eclipse.jdt.internal.core.LocalVariable; +import org.eclipse.jdt.internal.core.ResolvedBinaryField; +import org.eclipse.jdt.internal.core.ResolvedBinaryMethod; +import org.eclipse.jdt.internal.core.ResolvedBinaryType; +import org.eclipse.jdt.internal.core.SourceField; +import org.eclipse.jdt.internal.core.SourceMethod; +import org.eclipse.jdt.internal.core.SourceType; import org.eclipse.jdt.ls.core.internal.JDTUtils; import org.eclipse.jdt.ls.core.internal.preferences.PreferenceManager; import org.eclipse.lsp4j.Hover; @@ -36,17 +58,69 @@ public LsifVisitor(LsifService lsif, IndexerContext context) { @Override public boolean visit(SimpleName node) { - resolve(node.getStartPosition(), node.getLength(), isTypeOrMethodDeclaration(node)); + resolve(node.getStartPosition(), node.getLength(), isTypeOrMethodDeclaration(node), true, ""); return false; } + @Override + public boolean visit(SingleVariableDeclaration node) { + String monikerKind = (node.getModifiers() & Modifier.PUBLIC) > 0 ? "export" : "local"; + resolve(node.getName().getStartPosition(), node.getName().getLength(), false, true, monikerKind); + return true; + } + + @Override + public boolean visit(EnumDeclaration node) { + String monikerKind = (node.getModifiers() & Modifier.PUBLIC) > 0 ? "export" : "local"; + resolve(node.getName().getStartPosition(), node.getName().getLength(), false, true, monikerKind); + return true; + } + + @Override + public boolean visit(EnumConstantDeclaration node) { + String monikerKind = "export"; // all the enum values are public static final + resolve(node.getName().getStartPosition(), node.getName().getLength(), false, true, monikerKind); + return true; + } + + @Override + public boolean visit(TypeDeclaration node) { + String monikerKind = (node.getModifiers() & Modifier.PUBLIC) > 0 ? "export" : "local"; + resolve(node.getName().getStartPosition(), node.getName().getLength(), false, true, monikerKind); + return true; + } + + @Override + public boolean visit(MethodDeclaration node) { + String monikerKind = (node.getModifiers() & Modifier.PUBLIC) > 0 ? "export" : "local"; + resolve(node.getName().getStartPosition(), node.getName().getLength(), false, true, monikerKind); + return true; + } + + @Override + public boolean visit(VariableDeclarationFragment node) { + ASTNode parent = node.getParent(); + if (parent instanceof VariableDeclarationStatement) { + String monikerKind = (((VariableDeclarationStatement) parent).getModifiers() & Modifier.PUBLIC) > 0 + ? "export" + : "local"; + resolve(node.getName().getStartPosition(), node.getName().getLength(), false, true, monikerKind); + } else if (parent instanceof FieldDeclaration) { + String monikerKind = (((FieldDeclaration) parent).getModifiers() & Modifier.PUBLIC) > 0 ? "export" + : "local"; + resolve(node.getName().getStartPosition(), node.getName().getLength(), false, true, monikerKind); + } + return true; + } + @Override public boolean visit(SimpleType node) { - resolve(node.getStartPosition(), node.getLength(), isTypeOrMethodDeclaration(node)); + resolve(node.getStartPosition(), node.getLength(), isTypeOrMethodDeclaration(node), true, ""); return false; } - private void resolve(int startPosition, int length, boolean needResolveImpl) { + private void resolve(int startPosition, int length, boolean needResolveImpl, boolean hasMoniker, + String monikerKind) { try { org.eclipse.lsp4j.Range sourceLspRange = JDTUtils.toRange(this.getContext().getCompilationUnit().getTypeRoot(), startPosition, length); @@ -58,11 +132,12 @@ private void resolve(int startPosition, int length, boolean needResolveImpl) { return; } + LsifService lsif = this.getLsif(); Document docVertex = this.getContext().getDocVertex(); Project projVertex = this.getContext().getProjVertex(); Range sourceRange = Repository.getInstance().enlistRange(lsif, docVertex, sourceLspRange); - + // emit range Location definitionLocation = JdtlsUtils.getElementLocation(element); if (definitionLocation == null) { // no target location, only resolve hover. @@ -74,8 +149,26 @@ private void resolve(int startPosition, int length, boolean needResolveImpl) { ResultSet resultSet = VisitorUtils.ensureResultSet(lsif, sourceRange); VisitorUtils.emitHoverResult(hover, lsif, resultSet); + // emit hover + return; + } + + IJavaProject javaproject = element.getJavaProject(); + ICompilationUnit compilationUnit = (ICompilationUnit) element.getAncestor(IJavaElement.COMPILATION_UNIT); + IClassFile cf = (IClassFile) element.getAncestor(IJavaElement.CLASS_FILE); + if (compilationUnit == null && cf == null) { return; } + if (compilationUnit == null) { + IPath path = cf.getPath(); + IClasspathEntry entry = javaproject.getClasspathEntryFor(path); + IClasspathAttribute[] attrs = entry.getExtraAttributes(); + int test = 1; + } else { + IPath path0 = javaproject.getProject().getFullPath(); + IClasspathEntry entry = javaproject.getClasspathEntryFor(path0.append("/src/main/java/App.java")); + int test = 1; + } String id = createSymbolKey(definitionLocation); Document definitionDocument = Repository.getInstance().enlistDocument(lsif, definitionLocation.getUri(), @@ -84,7 +177,23 @@ private void resolve(int startPosition, int length, boolean needResolveImpl) { /* Ensure resultSet */ symbolData.ensureResultSet(lsif, sourceRange); + if (hasMoniker) { + String identifier = ""; + try { + identifier = this.getMonikerIdentifier(element); + } catch (JavaModelException e) { + } + /* Generate Moniker */ + if (monikerKind.equals("export")) { + symbolData.generateMoniker(lsif, sourceRange, "export", identifier); + } else if (monikerKind.equals("local")) { + symbolData.generateMoniker(lsif, sourceRange, "local", identifier); + } else if (definitionLocation.getUri().startsWith("jdt")) { + symbolData.generateMoniker(lsif, sourceRange, "import", identifier); + } + return; + } /* Resolve definition */ symbolData.resolveDefinition(lsif, definitionLocation); @@ -106,6 +215,30 @@ private void resolve(int startPosition, int length, boolean needResolveImpl) { } } + private String getMonikerIdentifier(IJavaElement element) throws JavaModelException { + String identifier = element.getElementName(); + if (element instanceof SourceType) { + return ((SourceType) element).getFullyQualifiedName(); + } else if (element instanceof BinaryType) { + return ((BinaryType) element).getFullyQualifiedName(); + } else if (element instanceof SourceField) { + return getMonikerIdentifier(element.getParent()) + "/" + identifier; + } else if (element instanceof SourceMethod) { + return getMonikerIdentifier(element.getParent()) + "/" + + identifier + ":" + ((SourceMethod) element).getSignature(); + } else if (element instanceof LocalVariable) { + return getMonikerIdentifier(element.getParent()) + "/" + identifier; + } else if (element instanceof ResolvedBinaryType) { + return ((ResolvedBinaryType) element).getFullyQualifiedName(); + } else if (element instanceof ResolvedBinaryMethod) { + return getMonikerIdentifier(element.getParent()) + "/" + + identifier + ":" + ((ResolvedBinaryMethod) element).getSignature(); + } else if (element instanceof ResolvedBinaryField) { + return getMonikerIdentifier(element.getParent()) + "/" + identifier; + } + return identifier; + } + private String createSymbolKey(Location definitionLocation) { String rawKeyString = definitionLocation.toString(); return DigestUtils.md5Hex(rawKeyString); diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/SymbolData.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/SymbolData.java index 7d1ed15..d76cceb 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/SymbolData.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/SymbolData.java @@ -18,6 +18,7 @@ import com.microsoft.java.lsif.core.internal.protocol.Document; import com.microsoft.java.lsif.core.internal.protocol.ImplementationResult; import com.microsoft.java.lsif.core.internal.protocol.ItemEdge; +import com.microsoft.java.lsif.core.internal.protocol.Moniker; import com.microsoft.java.lsif.core.internal.protocol.Project; import com.microsoft.java.lsif.core.internal.protocol.Range; import com.microsoft.java.lsif.core.internal.protocol.ReferenceResult; @@ -30,6 +31,7 @@ public class SymbolData { private Document document; private ResultSet resultSet; private ReferenceResult referenceResult; + private Moniker moniker; private boolean definitionResolved; private boolean typeDefinitionResolved; private boolean implementationResolved; @@ -49,6 +51,17 @@ synchronized public void ensureResultSet(LsifService lsif, Range sourceRange) { LsifEmitter.getInstance().emit(lsif.getEdgeBuilder().next(sourceRange, this.resultSet)); } + synchronized public void generateMoniker(LsifService lsif, Range sourceRange, String kind, + String identifier) { + if (this.resultSet == null || this.moniker != null) { + return; + } + Moniker moniker = lsif.getVertexBuilder().moniker(kind, identifier); + LsifEmitter.getInstance().emit(moniker); + this.moniker = moniker; + LsifEmitter.getInstance().emit(lsif.getEdgeBuilder().moniker(this.resultSet, this.moniker)); + } + synchronized public void resolveDefinition(LsifService lsif, Location definitionLocation) { if (this.definitionResolved) { return; From e5c2ea0636db9129d7e327a8eb5fd6f9f15cf747 Mon Sep 17 00:00:00 2001 From: CS <45906942+CsCherrYY@users.noreply.github.com> Date: Fri, 24 Jul 2020 16:36:18 +0800 Subject: [PATCH 02/18] Update scheme moniker --- .../core/internal/indexer/Repository.java | 22 ++++++++++ .../core/internal/indexer/VertexBuilder.java | 4 +- .../lsif/core/internal/protocol/Moniker.java | 11 +++-- .../core/internal/protocol/PackageData.java | 44 +++++++++++++++++++ .../internal/protocol/PackageInformation.java | 37 ++++++++++++++++ .../lsif/core/internal/protocol/Vertex.java | 3 ++ .../core/internal/visitors/LsifVisitor.java | 36 ++++++++++----- .../core/internal/visitors/SymbolData.java | 11 ++--- 8 files changed, 147 insertions(+), 21 deletions(-) create mode 100644 com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/PackageData.java create mode 100644 com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/PackageInformation.java diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Repository.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Repository.java index a23f6cb..0d22e26 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Repository.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Repository.java @@ -13,6 +13,7 @@ import com.microsoft.java.lsif.core.internal.emitter.LsifEmitter; import com.microsoft.java.lsif.core.internal.protocol.Document; import com.microsoft.java.lsif.core.internal.protocol.Event; +import com.microsoft.java.lsif.core.internal.protocol.PackageData; import com.microsoft.java.lsif.core.internal.protocol.Project; import com.microsoft.java.lsif.core.internal.protocol.Range; import com.microsoft.java.lsif.core.internal.visitors.SymbolData; @@ -37,6 +38,10 @@ public class Repository { // Value: Document object private Map beginededDocumentMap = new ConcurrentHashMap<>(); + // Key: groupId + artifactId + version + // Value: PackageData + private Map packageDataMap = new ConcurrentHashMap<>(); + private Repository() { } @@ -90,6 +95,15 @@ public synchronized SymbolData enlistSymbolData(String id, Document docVertex, P return symbolData; } + public synchronized PackageData enlistPackageData(String id, String groupId, String artifactId, String version) { + PackageData packageData = findPackageDataById(id); + if (packageData == null) { + packageData = new PackageData(groupId, artifactId, version); + addPackageData(id, packageData); + } + return packageData; + } + public void addToBeginededDocuments(Document doc) { this.beginededDocumentMap.put(doc.getUri(), doc); } @@ -131,4 +145,12 @@ private Range findRange(String uri, org.eclipse.lsp4j.Range lspRange) { private SymbolData findSymbolDataById(String id) { return this.symbolDataMap.getOrDefault(id, null); } + + private PackageData findPackageDataById(String id) { + return this.packageDataMap.getOrDefault(id, null); + } + + private void addPackageData(String id, PackageData packageData) { + this.packageDataMap.put(id, packageData); + } } diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/VertexBuilder.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/VertexBuilder.java index 20c33d0..0763d46 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/VertexBuilder.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/VertexBuilder.java @@ -92,7 +92,7 @@ public DiagnosticResult diagnosticResult(List diagnostics) { return new DiagnosticResult(generator.next(), diagnostics); } - public Moniker moniker(String kind, String identifier) { - return new Moniker(generator.next(), kind, identifier); + public Moniker moniker(String kind, String scheme, String identifier, String unique) { + return new Moniker(generator.next(), kind, scheme, identifier, unique); } } diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/Moniker.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/Moniker.java index 6ad7feb..2e8672e 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/Moniker.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/Moniker.java @@ -7,16 +7,19 @@ public class Moniker extends Vertex { - private String scheme = "jdt"; - private String kind; + private String scheme; + private String identifier; - public Moniker(String id, String kind, String identifier) { + private String unique; + + public Moniker(String id, String kind, String scheme, String identifier, String unique) { super(id, Vertex.MONIKER); this.kind = kind; this.identifier = identifier; - this.scheme = "jdt"; + this.scheme = scheme; + this.unique = unique; } } diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/PackageData.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/PackageData.java new file mode 100644 index 0000000..6fafa6f --- /dev/null +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/PackageData.java @@ -0,0 +1,44 @@ +/* -------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * ------------------------------------------------------------------------------------------ */ + + +package com.microsoft.java.lsif.core.internal.protocol; + +public class PackageData { + + private String groupId; + + private String artifactId; + + private String version; + + private PackageInformation packageInformation; + + public PackageData(String groupId, String artifactId, String version) { + this.groupId = groupId; + this.artifactId = artifactId; + this.version = version; + } + + public String getGroupId() { + return this.groupId; + } + + public String getArtifactId() { + return this.artifactId; + } + + public String getVersion() { + return this.version; + } + + public void setPackageInformation(PackageInformation packageInformation) { + this.packageInformation = packageInformation; + } + + public PackageInformation getPackageInformation() { + return this.packageInformation; + } +} diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/PackageInformation.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/PackageInformation.java new file mode 100644 index 0000000..d1e565a --- /dev/null +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/PackageInformation.java @@ -0,0 +1,37 @@ +/* -------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * ------------------------------------------------------------------------------------------ */ + +package com.microsoft.java.lsif.core.internal.protocol; + +public class PackageInformation extends Vertex { + + private String name; + + private String manager; + + private String version; + + private Repo repository; + + public PackageInformation(String id, String name, String manager, String version, String type, String url) { + super(id, Vertex.MONIKER); + this.name = name; + this.manager = manager; + this.version = version; + this.repository = new Repo(type, url); + } + + public class Repo { + + private String type; + + private String url; + + Repo(String type, String url) { + this.type = type; + this.url = url; + } + } +} diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/Vertex.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/Vertex.java index 20386f9..3a18071 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/Vertex.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/Vertex.java @@ -46,6 +46,9 @@ public class Vertex extends Element { public static final String IMPLEMENTATIONRESULT = "implementationResult"; public static final String MONIKER = "moniker"; + + public static final String PACKAGEINFORMATION = "packageInfomation"; + public Vertex(String id, String label) { super(id, Element.VERTEX, label); } diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/LsifVisitor.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/LsifVisitor.java index 5057017..23b4dd8 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/LsifVisitor.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/LsifVisitor.java @@ -156,19 +156,35 @@ private void resolve(int startPosition, int length, boolean needResolveImpl, boo IJavaProject javaproject = element.getJavaProject(); ICompilationUnit compilationUnit = (ICompilationUnit) element.getAncestor(IJavaElement.COMPILATION_UNIT); IClassFile cf = (IClassFile) element.getAncestor(IJavaElement.CLASS_FILE); - if (compilationUnit == null && cf == null) { - return; - } - if (compilationUnit == null) { + boolean isFromMaven = false; + int mavenCount = 0; + String groupId; + String artifactId; + String version; + if (compilationUnit == null && cf != null) { IPath path = cf.getPath(); IClasspathEntry entry = javaproject.getClasspathEntryFor(path); IClasspathAttribute[] attrs = entry.getExtraAttributes(); - int test = 1; - } else { - IPath path0 = javaproject.getProject().getFullPath(); - IClasspathEntry entry = javaproject.getClasspathEntryFor(path0.append("/src/main/java/App.java")); - int test = 1; - } + for (IClasspathAttribute attr : attrs) { + if (attr.getName().equals("maven.pomderived")) { + if (attr.getValue().equals("true")) { + mavenCount++; + } + } else if (attr.getName().equals("maven.groupId")) { + groupId = attr.getValue(); + } else if (attr.getName().equals("maven.artifactId")) { + artifactId = attr.getValue(); + } else if (attr.getName().equals("maven.version")) { + version = attr.getValue(); + } + } + if (mavenCount == 2) { + isFromMaven = true; + } + } /* + * else { IPath path = compilationUnit.getPath(); IClasspathEntry entry = + * javaproject.getClasspathEntryFor(path); int test = 1; } + */ String id = createSymbolKey(definitionLocation); Document definitionDocument = Repository.getInstance().enlistDocument(lsif, definitionLocation.getUri(), diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/SymbolData.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/SymbolData.java index d76cceb..83fdd5b 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/SymbolData.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/SymbolData.java @@ -31,7 +31,8 @@ public class SymbolData { private Document document; private ResultSet resultSet; private ReferenceResult referenceResult; - private Moniker moniker; + private Moniker projectMoniker; + private Moniker schemeMoniker; private boolean definitionResolved; private boolean typeDefinitionResolved; private boolean implementationResolved; @@ -53,13 +54,13 @@ synchronized public void ensureResultSet(LsifService lsif, Range sourceRange) { synchronized public void generateMoniker(LsifService lsif, Range sourceRange, String kind, String identifier) { - if (this.resultSet == null || this.moniker != null) { + if (this.resultSet == null || this.projectMoniker != null) { return; } - Moniker moniker = lsif.getVertexBuilder().moniker(kind, identifier); + Moniker moniker = lsif.getVertexBuilder().moniker(kind, "jdt", identifier, "project"); LsifEmitter.getInstance().emit(moniker); - this.moniker = moniker; - LsifEmitter.getInstance().emit(lsif.getEdgeBuilder().moniker(this.resultSet, this.moniker)); + this.projectMoniker = moniker; + LsifEmitter.getInstance().emit(lsif.getEdgeBuilder().moniker(this.resultSet, this.projectMoniker)); } synchronized public void resolveDefinition(LsifService lsif, Location definitionLocation) { From d057f843a8e31202155a7b64c5864a863e788520 Mon Sep 17 00:00:00 2001 From: CS <45906942+CsCherrYY@users.noreply.github.com> Date: Mon, 27 Jul 2020 01:17:18 +0800 Subject: [PATCH 03/18] Update packageInformation --- .../core/internal/indexer/EdgeBuilder.java | 8 ++ .../lsif/core/internal/indexer/Indexer.java | 73 +++++++++++++++- .../core/internal/indexer/Repository.java | 84 +++++++++++++++---- .../core/internal/indexer/VertexBuilder.java | 9 ++ .../internal/indexer/WorkspaceHandler.java | 8 +- .../lsif/core/internal/protocol/Edge.java | 5 ++ .../core/internal/protocol/PackageData.java | 44 ---------- .../internal/protocol/PackageInformation.java | 12 ++- .../lsif/core/internal/protocol/Vertex.java | 2 +- .../core/internal/visitors/LsifVisitor.java | 35 +++++--- .../core/internal/visitors/SymbolData.java | 64 ++++++++++++-- 11 files changed, 263 insertions(+), 81 deletions(-) delete mode 100644 com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/PackageData.java diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/EdgeBuilder.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/EdgeBuilder.java index 6e0b4b0..ab45535 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/EdgeBuilder.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/EdgeBuilder.java @@ -66,6 +66,14 @@ public Edge moniker(Vertex from, Vertex to) { return new Edge(generator.next(), Edge.MONIKER, from.getId(), to.getId()); } + public Edge attach(Vertex from, Vertex to) { + return new Edge(generator.next(), Edge.ATTACH, from.getId(), to.getId()); + } + + public Edge packageInformation(Vertex from, Vertex to) { + return new Edge(generator.next(), Edge.PACKAGEINFORMATION, from.getId(), to.getId()); + } + public Edge diagnostic(Vertex from, Vertex to) { return new Edge(generator.next(), Edge.T_DIAGNOSTIC, from.getId(), to.getId()); } diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Indexer.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Indexer.java index 82cbfa8..5f20c22 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Indexer.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Indexer.java @@ -5,18 +5,25 @@ package com.microsoft.java.lsif.core.internal.indexer; +import java.io.File; +import java.util.Collection; +import java.util.Collections; import java.util.HashMap; +import java.util.LinkedHashSet; import java.util.LinkedList; import java.util.List; import java.util.Map; +import java.util.Set; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; +import org.apache.maven.model.Model; import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.core.runtime.OperationCanceledException; import org.eclipse.jdt.core.IClasspathEntry; import org.eclipse.jdt.core.ICompilationUnit; import org.eclipse.jdt.core.IJavaElement; @@ -30,10 +37,15 @@ import org.eclipse.jdt.ls.core.internal.JavaLanguageServerPlugin; import org.eclipse.jdt.ls.core.internal.ResourceUtils; import org.eclipse.lsp4j.ClientCapabilities; +import org.eclipse.m2e.core.MavenPlugin; +import org.eclipse.m2e.core.embedder.MavenModelManager; +import org.eclipse.m2e.core.project.LocalProjectScanner; +import org.eclipse.m2e.core.project.MavenProjectInfo; import com.microsoft.java.lsif.core.internal.emitter.LsifEmitter; import com.microsoft.java.lsif.core.internal.protocol.Document; import com.microsoft.java.lsif.core.internal.protocol.Event; +import com.microsoft.java.lsif.core.internal.protocol.PackageInformation; import com.microsoft.java.lsif.core.internal.protocol.Project; import com.microsoft.java.lsif.core.internal.visitors.DiagnosticVisitor; import com.microsoft.java.lsif.core.internal.visitors.DocumentVisitor; @@ -64,19 +76,20 @@ public void generateLsif() throws JavaModelException { LsifEmitter.getInstance().start(); LsifEmitter.getInstance().emit(lsif.getVertexBuilder().metaData(ResourceUtils.fixURI(path.toFile().toURI()))); - handler.importProject(path, monitor); + String buildTool = handler.importProject(path, monitor); BuildWorkspaceStatus buildStatus = handler.buildProject(monitor); if (buildStatus != BuildWorkspaceStatus.SUCCEED) { return; } - buildIndex(path, monitor, lsif); + buildIndex(path, monitor, lsif, buildTool); handler.removeProject(monitor); LsifEmitter.getInstance().end(); } - private void buildIndex(IPath path, IProgressMonitor monitor, LsifService lsif) throws JavaModelException { + private void buildIndex(IPath path, IProgressMonitor monitor, LsifService lsif, String buildTool) + throws JavaModelException { IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects(); @@ -87,6 +100,22 @@ private void buildIndex(IPath path, IProgressMonitor monitor, LsifService lsif) return; } IJavaProject javaProject = JavaCore.create(proj); + if (buildTool.equals("maven")) { + Set infoSet = collectMavenProjectInfo(monitor, path); + infoSet.forEach(mavenProjectInfo -> { + Model model = mavenProjectInfo.getModel(); + String groupId = model.getGroupId(); + String artifactId = model.getArtifactId(); + String version = model.getVersion(); + String url = model.getUrl(); + PackageInformation packageInformation = Repository.getInstance() + .enlistExportPackageInformation(lsif, javaProject.getPath() + .toString(), + groupId + "/" + artifactId, "maven", version, url); + LsifEmitter.getInstance().emit(packageInformation); + }); + } + if (!javaProject.exists()) { continue; } @@ -161,4 +190,40 @@ private void dumpParallely(List sourceList, ExecutorService th return 0; })).blockingSubscribe(); } -} \ No newline at end of file + + private Set collectMavenProjectInfo(IProgressMonitor monitor, + IPath path) + throws OperationCanceledException { + MavenModelManager modelManager = MavenPlugin.getMavenModelManager(); + return getMavenProjects(path.toFile(), modelManager, monitor); + } + + private Set getMavenProjects(File directory, MavenModelManager modelManager, + IProgressMonitor monitor) throws OperationCanceledException { + if (directory == null) { + return Collections.emptySet(); + } + try { + LocalProjectScanner scanner = new LocalProjectScanner(directory.getParentFile(), directory.toString(), + false, modelManager); + scanner.run(monitor); + return collectProjects(scanner.getProjects()); + } catch (InterruptedException e) { + throw new OperationCanceledException(); + } + } + + private Set collectProjects(Collection projects) { + return new LinkedHashSet() { + private static final long serialVersionUID = 1L; + + public Set collectProjects(Collection projects) { + for (MavenProjectInfo projectInfo : projects) { + add(projectInfo); + collectProjects(projectInfo.getProjects()); + } + return this; + } + }.collectProjects(projects); + } +} diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Repository.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Repository.java index 0d22e26..38e999c 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Repository.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Repository.java @@ -13,7 +13,7 @@ import com.microsoft.java.lsif.core.internal.emitter.LsifEmitter; import com.microsoft.java.lsif.core.internal.protocol.Document; import com.microsoft.java.lsif.core.internal.protocol.Event; -import com.microsoft.java.lsif.core.internal.protocol.PackageData; +import com.microsoft.java.lsif.core.internal.protocol.PackageInformation; import com.microsoft.java.lsif.core.internal.protocol.Project; import com.microsoft.java.lsif.core.internal.protocol.Range; import com.microsoft.java.lsif.core.internal.visitors.SymbolData; @@ -38,9 +38,17 @@ public class Repository { // Value: Document object private Map beginededDocumentMap = new ConcurrentHashMap<>(); - // Key: groupId + artifactId + version - // Value: PackageData - private Map packageDataMap = new ConcurrentHashMap<>(); + // Key: groupId + artifactId + // Value: PackageInformation + private Map importPackageInformationMap = new ConcurrentHashMap<>(); + + // Key: IJavaProject.getPath() + // Value: PackageInformation + private Map exportPackageInformationMap = new ConcurrentHashMap<>(); + + // Key: groupId + artifactId + // Value: isEmitted or not + private Map packageInformationEmittedMap = new ConcurrentHashMap<>(); private Repository() { } @@ -95,13 +103,45 @@ public synchronized SymbolData enlistSymbolData(String id, Document docVertex, P return symbolData; } - public synchronized PackageData enlistPackageData(String id, String groupId, String artifactId, String version) { - PackageData packageData = findPackageDataById(id); - if (packageData == null) { - packageData = new PackageData(groupId, artifactId, version); - addPackageData(id, packageData); + public synchronized PackageInformation enlistImportPackageInformation(LsifService lsif, String id, + String name, String manager, String version) { + PackageInformation packageInformation = findImportPackageInformationById(id); + if (packageInformation == null) { + if (manager.equals("maven")) { + packageInformation = lsif.getVertexBuilder().packageInformation(name, manager, version, "https", + "https://mvnrepository.com/artifact/" + name + "/" + version); + } else if (manager.equals("jdk")) { + packageInformation = lsif.getVertexBuilder().packageInformation(name, manager); + } else { + return packageInformation; + } + addImportPackageInformation(id, packageInformation); + } + return packageInformation; + } + + public synchronized PackageInformation enlistExportPackageInformation(LsifService lsif, String id, String name, + String manager, String version, String url) { + PackageInformation packageInformation = findExportPackageInformationById(id); + if (packageInformation == null) { + if (manager.equals("maven")) { + packageInformation = lsif.getVertexBuilder().packageInformation(name, manager, version, "https", url); + } else { + return packageInformation; + } + addExportPackageInformation(id, packageInformation); + } + return packageInformation; + } + + public synchronized boolean enlistPackageInformationEmitted(String id) { + Boolean result = findPackageInformationEmittedById(id); + if (result == null) { + addPackageInformationEmitted(id); + return false; + } else { + return true; } - return packageData; } public void addToBeginededDocuments(Document doc) { @@ -146,11 +186,27 @@ private SymbolData findSymbolDataById(String id) { return this.symbolDataMap.getOrDefault(id, null); } - private PackageData findPackageDataById(String id) { - return this.packageDataMap.getOrDefault(id, null); + private PackageInformation findImportPackageInformationById(String id) { + return this.importPackageInformationMap.getOrDefault(id, null); + } + + private void addImportPackageInformation(String id, PackageInformation packageInformation) { + this.importPackageInformationMap.put(id, packageInformation); + } + + private PackageInformation findExportPackageInformationById(String id) { + return this.exportPackageInformationMap.getOrDefault(id, null); + } + + private void addExportPackageInformation(String id, PackageInformation packageInformation) { + this.exportPackageInformationMap.put(id, packageInformation); + } + + private Boolean findPackageInformationEmittedById(String id) { + return this.packageInformationEmittedMap.getOrDefault(id, null); } - private void addPackageData(String id, PackageData packageData) { - this.packageDataMap.put(id, packageData); + private void addPackageInformationEmitted(String id) { + this.packageInformationEmittedMap.put(id, new Boolean(true)); } } diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/VertexBuilder.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/VertexBuilder.java index 0763d46..7cebbd2 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/VertexBuilder.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/VertexBuilder.java @@ -22,6 +22,7 @@ import com.microsoft.java.lsif.core.internal.protocol.ImplementationResult; import com.microsoft.java.lsif.core.internal.protocol.MetaData; import com.microsoft.java.lsif.core.internal.protocol.Moniker; +import com.microsoft.java.lsif.core.internal.protocol.PackageInformation; import com.microsoft.java.lsif.core.internal.protocol.Project; import com.microsoft.java.lsif.core.internal.protocol.Range; import com.microsoft.java.lsif.core.internal.protocol.ReferenceResult; @@ -95,4 +96,12 @@ public DiagnosticResult diagnosticResult(List diagnostics) { public Moniker moniker(String kind, String scheme, String identifier, String unique) { return new Moniker(generator.next(), kind, scheme, identifier, unique); } + + public PackageInformation packageInformation(String name, String manager, String version, String type, String url) { + return new PackageInformation(generator.next(), name, manager, version, type, url); + } + + public PackageInformation packageInformation(String name, String manager) { + return new PackageInformation(generator.next(), name, manager); + } } diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/WorkspaceHandler.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/WorkspaceHandler.java index 989823f..9fbf8e4 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/WorkspaceHandler.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/WorkspaceHandler.java @@ -30,6 +30,7 @@ import org.eclipse.jdt.ls.core.internal.JavaLanguageServerPlugin; import org.eclipse.jdt.ls.core.internal.ResourceUtils; import org.eclipse.jdt.ls.core.internal.managers.GradleBuildSupport; +import org.eclipse.jdt.ls.core.internal.managers.MavenProjectImporter; import com.microsoft.java.lsif.core.internal.LanguageServerIndexerPlugin; @@ -61,18 +62,23 @@ public IPath initialize() { return getProjectPathIfValid(projectDir); } - public void importProject(IPath path, IProgressMonitor monitor) { + public String importProject(IPath path, IProgressMonitor monitor) { + String buildTool = "invisible"; SubMonitor subMonitor = SubMonitor.convert(monitor, 100); File rootFolder = path.toFile(); IProjectImporter importer; try { importer = getImporter(rootFolder, subMonitor.split(30)); + if (importer instanceof MavenProjectImporter) { + buildTool = "maven"; + } if (importer != null) { importer.importToWorkspace(subMonitor.split(70)); } } catch (OperationCanceledException | CoreException e) { e.printStackTrace(); } + return buildTool; } public BuildWorkspaceStatus buildProject(IProgressMonitor monitor) { diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/Edge.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/Edge.java index f2070e9..342ba6a 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/Edge.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/Edge.java @@ -40,6 +40,11 @@ public class Edge extends Element { public final static String T_IMPLEMENTATION = "textDocument/implementation"; public final static String MONIKER = "moniker"; + + public final static String ATTACH = "attach"; + + public final static String PACKAGEINFORMATION = "packageInformation"; + private String outV; private String inV; diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/PackageData.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/PackageData.java deleted file mode 100644 index 6fafa6f..0000000 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/PackageData.java +++ /dev/null @@ -1,44 +0,0 @@ -/* -------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * ------------------------------------------------------------------------------------------ */ - - -package com.microsoft.java.lsif.core.internal.protocol; - -public class PackageData { - - private String groupId; - - private String artifactId; - - private String version; - - private PackageInformation packageInformation; - - public PackageData(String groupId, String artifactId, String version) { - this.groupId = groupId; - this.artifactId = artifactId; - this.version = version; - } - - public String getGroupId() { - return this.groupId; - } - - public String getArtifactId() { - return this.artifactId; - } - - public String getVersion() { - return this.version; - } - - public void setPackageInformation(PackageInformation packageInformation) { - this.packageInformation = packageInformation; - } - - public PackageInformation getPackageInformation() { - return this.packageInformation; - } -} diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/PackageInformation.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/PackageInformation.java index d1e565a..2f6f360 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/PackageInformation.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/PackageInformation.java @@ -16,13 +16,19 @@ public class PackageInformation extends Vertex { private Repo repository; public PackageInformation(String id, String name, String manager, String version, String type, String url) { - super(id, Vertex.MONIKER); + super(id, Vertex.PACKAGEINFORMATION); this.name = name; this.manager = manager; this.version = version; this.repository = new Repo(type, url); } + public PackageInformation(String id, String name, String manager) { + super(id, Vertex.PACKAGEINFORMATION); + this.name = name; + this.manager = manager; + } + public class Repo { private String type; @@ -34,4 +40,8 @@ public class Repo { this.url = url; } } + + public String getName() { + return this.name; + } } diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/Vertex.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/Vertex.java index 3a18071..a01d347 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/Vertex.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/Vertex.java @@ -47,7 +47,7 @@ public class Vertex extends Element { public static final String MONIKER = "moniker"; - public static final String PACKAGEINFORMATION = "packageInfomation"; + public static final String PACKAGEINFORMATION = "packageInformation"; public Vertex(String id, String label) { super(id, Element.VERTEX, label); diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/LsifVisitor.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/LsifVisitor.java index 23b4dd8..f9870d1 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/LsifVisitor.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/LsifVisitor.java @@ -28,6 +28,7 @@ import org.eclipse.jdt.core.dom.VariableDeclarationFragment; import org.eclipse.jdt.core.dom.VariableDeclarationStatement; import org.eclipse.jdt.internal.core.BinaryType; +import org.eclipse.jdt.internal.core.ClassFile; import org.eclipse.jdt.internal.core.LocalVariable; import org.eclipse.jdt.internal.core.ResolvedBinaryField; import org.eclipse.jdt.internal.core.ResolvedBinaryMethod; @@ -157,10 +158,11 @@ private void resolve(int startPosition, int length, boolean needResolveImpl, boo ICompilationUnit compilationUnit = (ICompilationUnit) element.getAncestor(IJavaElement.COMPILATION_UNIT); IClassFile cf = (IClassFile) element.getAncestor(IJavaElement.CLASS_FILE); boolean isFromMaven = false; + boolean isFromJdk = false; int mavenCount = 0; - String groupId; - String artifactId; - String version; + String groupId = ""; + String artifactId = ""; + String version = ""; if (compilationUnit == null && cf != null) { IPath path = cf.getPath(); IClasspathEntry entry = javaproject.getClasspathEntryFor(path); @@ -180,11 +182,22 @@ private void resolve(int startPosition, int length, boolean needResolveImpl, boo } if (mavenCount == 2) { isFromMaven = true; + } else if (mavenCount == 1) { + isFromJdk = true; } - } /* - * else { IPath path = compilationUnit.getPath(); IClasspathEntry entry = - * javaproject.getClasspathEntryFor(path); int test = 1; } - */ + } + + String schemeMonikerName = ""; + String manager = (monikerKind.equals("export") || isFromMaven) ? "maven" : isFromJdk ? "jdk" : ""; + if (isFromMaven) { + schemeMonikerName = groupId + "/" + artifactId; + } else if (isFromJdk) { + if (cf instanceof ClassFile) { + schemeMonikerName = cf.getParent().getElementName() + "." + ((ClassFile) cf).getName(); + } else { + schemeMonikerName = cf.getParent().getElementName() + "." + cf.getElementName(); + } + } String id = createSymbolKey(definitionLocation); Document definitionDocument = Repository.getInstance().enlistDocument(lsif, definitionLocation.getUri(), @@ -200,13 +213,15 @@ private void resolve(int startPosition, int length, boolean needResolveImpl, boo } catch (JavaModelException e) { } + /* Generate Moniker */ if (monikerKind.equals("export")) { - symbolData.generateMoniker(lsif, sourceRange, "export", identifier); + symbolData.generateMonikerExport(lsif, sourceRange, identifier, manager, javaproject); } else if (monikerKind.equals("local")) { - symbolData.generateMoniker(lsif, sourceRange, "local", identifier); + symbolData.generateMonikerLocal(lsif, sourceRange, identifier); } else if (definitionLocation.getUri().startsWith("jdt")) { - symbolData.generateMoniker(lsif, sourceRange, "import", identifier); + symbolData.generateMonikerImport(lsif, sourceRange, identifier, schemeMonikerName, manager, + version); } return; } diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/SymbolData.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/SymbolData.java index 83fdd5b..84a7cc2 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/SymbolData.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/SymbolData.java @@ -8,6 +8,8 @@ import java.util.List; import java.util.stream.Collectors; +import org.apache.commons.codec.digest.DigestUtils; +import org.eclipse.jdt.core.IJavaProject; import org.eclipse.lsp4j.Hover; import org.eclipse.lsp4j.Location; @@ -19,6 +21,7 @@ import com.microsoft.java.lsif.core.internal.protocol.ImplementationResult; import com.microsoft.java.lsif.core.internal.protocol.ItemEdge; import com.microsoft.java.lsif.core.internal.protocol.Moniker; +import com.microsoft.java.lsif.core.internal.protocol.PackageInformation; import com.microsoft.java.lsif.core.internal.protocol.Project; import com.microsoft.java.lsif.core.internal.protocol.Range; import com.microsoft.java.lsif.core.internal.protocol.ReferenceResult; @@ -52,15 +55,60 @@ synchronized public void ensureResultSet(LsifService lsif, Range sourceRange) { LsifEmitter.getInstance().emit(lsif.getEdgeBuilder().next(sourceRange, this.resultSet)); } - synchronized public void generateMoniker(LsifService lsif, Range sourceRange, String kind, - String identifier) { - if (this.resultSet == null || this.projectMoniker != null) { + synchronized public void generateMonikerImport(LsifService lsif, Range sourceRange, + String identifier, String schemeMonikerName, String manager, String version) { + if (this.resultSet == null || this.projectMoniker != null || this.schemeMoniker != null) { return; } - Moniker moniker = lsif.getVertexBuilder().moniker(kind, "jdt", identifier, "project"); - LsifEmitter.getInstance().emit(moniker); - this.projectMoniker = moniker; + Moniker projectMoniker = lsif.getVertexBuilder().moniker("import", "jdt", identifier, "project"); + LsifEmitter.getInstance().emit(projectMoniker); + this.projectMoniker = projectMoniker; LsifEmitter.getInstance().emit(lsif.getEdgeBuilder().moniker(this.resultSet, this.projectMoniker)); + PackageInformation packageInformation = Repository.getInstance().enlistImportPackageInformation(lsif, + createMonikerKey(schemeMonikerName), schemeMonikerName, manager, version); + if (!Repository.getInstance().enlistPackageInformationEmitted(schemeMonikerName)) { + LsifEmitter.getInstance().emit(packageInformation); + } + Moniker schemeMoniker = manager.equals("maven") + ? lsif.getVertexBuilder().moniker("import", manager, + packageInformation.getName() + "/" + identifier, "scheme") + : lsif.getVertexBuilder().moniker("import", manager, identifier, "scheme"); + LsifEmitter.getInstance().emit(schemeMoniker); + this.schemeMoniker = schemeMoniker; + LsifEmitter.getInstance() + .emit(lsif.getEdgeBuilder().packageInformation(this.schemeMoniker, packageInformation)); + LsifEmitter.getInstance().emit(lsif.getEdgeBuilder().attach(this.schemeMoniker, this.projectMoniker)); + } + + synchronized public void generateMonikerLocal(LsifService lsif, Range sourceRange, String identifier) { + if (this.resultSet == null || this.projectMoniker != null || this.schemeMoniker != null) { + return; + } + Moniker projectMoniker = lsif.getVertexBuilder().moniker("local", "jdt", identifier, "project"); + LsifEmitter.getInstance().emit(projectMoniker); + this.projectMoniker = projectMoniker; + LsifEmitter.getInstance().emit(lsif.getEdgeBuilder().moniker(this.resultSet, this.projectMoniker)); + } + + synchronized public void generateMonikerExport(LsifService lsif, Range sourceRange, + String identifier, String manager, IJavaProject javaproject) { + if (this.resultSet == null || this.projectMoniker != null || this.schemeMoniker != null) { + return; + } + Moniker projectMoniker = lsif.getVertexBuilder().moniker("export", "jdt", identifier, "project"); + LsifEmitter.getInstance().emit(projectMoniker); + this.projectMoniker = projectMoniker; + LsifEmitter.getInstance().emit(lsif.getEdgeBuilder().moniker(this.resultSet, this.projectMoniker)); + PackageInformation packageInformation = Repository.getInstance().enlistExportPackageInformation(lsif, + javaproject.getPath().toString(), "", manager, "", ""); + Moniker schemeMoniker = lsif.getVertexBuilder().moniker("export", manager, + packageInformation.getName() + "/" + identifier, + "scheme"); + LsifEmitter.getInstance().emit(schemeMoniker); + this.schemeMoniker = schemeMoniker; + LsifEmitter.getInstance() + .emit(lsif.getEdgeBuilder().packageInformation(this.schemeMoniker, packageInformation)); + LsifEmitter.getInstance().emit(lsif.getEdgeBuilder().attach(this.schemeMoniker, this.projectMoniker)); } synchronized public void resolveDefinition(LsifService lsif, Location definitionLocation) { @@ -148,4 +196,8 @@ synchronized public void resolveHover(LsifService lsif, Document docVertex, } this.hoverResolved = true; } + + private String createMonikerKey(String name) { + return DigestUtils.md5Hex(name); + } } From d961799c950fdf7991192f80ba246944e00c56f1 Mon Sep 17 00:00:00 2001 From: CS <45906942+CsCherrYY@users.noreply.github.com> Date: Mon, 27 Jul 2020 01:36:59 +0800 Subject: [PATCH 04/18] Update Indexer.java --- .../com/microsoft/java/lsif/core/internal/indexer/Indexer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Indexer.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Indexer.java index 5f20c22..540f6a9 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Indexer.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Indexer.java @@ -107,7 +107,7 @@ private void buildIndex(IPath path, IProgressMonitor monitor, LsifService lsif, String groupId = model.getGroupId(); String artifactId = model.getArtifactId(); String version = model.getVersion(); - String url = model.getUrl(); + String url = (model.getUrl() == null) ? "" : model.getUrl(); PackageInformation packageInformation = Repository.getInstance() .enlistExportPackageInformation(lsif, javaProject.getPath() .toString(), From eee7af79e007442116f9ea980ccfbc6b67754082 Mon Sep 17 00:00:00 2001 From: CS <45906942+CsCherrYY@users.noreply.github.com> Date: Mon, 27 Jul 2020 10:22:34 +0800 Subject: [PATCH 05/18] Fix format --- .../lsif/core/internal/indexer/Indexer.java | 3 +- .../core/internal/indexer/Repository.java | 2 +- .../core/internal/visitors/LsifVisitor.java | 15 ++-------- .../core/internal/visitors/SymbolData.java | 30 ++++++++----------- 4 files changed, 16 insertions(+), 34 deletions(-) diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Indexer.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Indexer.java index 540f6a9..5f98ab6 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Indexer.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Indexer.java @@ -191,8 +191,7 @@ private void dumpParallely(List sourceList, ExecutorService th })).blockingSubscribe(); } - private Set collectMavenProjectInfo(IProgressMonitor monitor, - IPath path) + private Set collectMavenProjectInfo(IProgressMonitor monitor, IPath path) throws OperationCanceledException { MavenModelManager modelManager = MavenPlugin.getMavenModelManager(); return getMavenProjects(path.toFile(), modelManager, monitor); diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Repository.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Repository.java index 38e999c..7ae75b3 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Repository.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Repository.java @@ -207,6 +207,6 @@ private Boolean findPackageInformationEmittedById(String id) { } private void addPackageInformationEmitted(String id) { - this.packageInformationEmittedMap.put(id, new Boolean(true)); + this.packageInformationEmittedMap.put(id, Boolean.valueOf(true)); } } diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/LsifVisitor.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/LsifVisitor.java index f9870d1..074a532 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/LsifVisitor.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/LsifVisitor.java @@ -102,13 +102,10 @@ public boolean visit(MethodDeclaration node) { public boolean visit(VariableDeclarationFragment node) { ASTNode parent = node.getParent(); if (parent instanceof VariableDeclarationStatement) { - String monikerKind = (((VariableDeclarationStatement) parent).getModifiers() & Modifier.PUBLIC) > 0 - ? "export" - : "local"; + String monikerKind = (((VariableDeclarationStatement) parent).getModifiers() & Modifier.PUBLIC) > 0 ? "export" : "local"; resolve(node.getName().getStartPosition(), node.getName().getLength(), false, true, monikerKind); } else if (parent instanceof FieldDeclaration) { - String monikerKind = (((FieldDeclaration) parent).getModifiers() & Modifier.PUBLIC) > 0 ? "export" - : "local"; + String monikerKind = (((FieldDeclaration) parent).getModifiers() & Modifier.PUBLIC) > 0 ? "export" : "local"; resolve(node.getName().getStartPosition(), node.getName().getLength(), false, true, monikerKind); } return true; @@ -132,8 +129,6 @@ private void resolve(int startPosition, int length, boolean needResolveImpl, boo if (element == null) { return; } - - LsifService lsif = this.getLsif(); Document docVertex = this.getContext().getDocVertex(); Project projVertex = this.getContext().getProjVertex(); @@ -147,13 +142,11 @@ private void resolve(int startPosition, int length, boolean needResolveImpl, boo if (VisitorUtils.isEmptyHover(hover)) { return; } - ResultSet resultSet = VisitorUtils.ensureResultSet(lsif, sourceRange); VisitorUtils.emitHoverResult(hover, lsif, resultSet); // emit hover return; } - IJavaProject javaproject = element.getJavaProject(); ICompilationUnit compilationUnit = (ICompilationUnit) element.getAncestor(IJavaElement.COMPILATION_UNIT); IClassFile cf = (IClassFile) element.getAncestor(IJavaElement.CLASS_FILE); @@ -186,7 +179,6 @@ private void resolve(int startPosition, int length, boolean needResolveImpl, boo isFromJdk = true; } } - String schemeMonikerName = ""; String manager = (monikerKind.equals("export") || isFromMaven) ? "maven" : isFromJdk ? "jdk" : ""; if (isFromMaven) { @@ -198,12 +190,10 @@ private void resolve(int startPosition, int length, boolean needResolveImpl, boo schemeMonikerName = cf.getParent().getElementName() + "." + cf.getElementName(); } } - String id = createSymbolKey(definitionLocation); Document definitionDocument = Repository.getInstance().enlistDocument(lsif, definitionLocation.getUri(), projVertex); SymbolData symbolData = Repository.getInstance().enlistSymbolData(id, definitionDocument, projVertex); - /* Ensure resultSet */ symbolData.ensureResultSet(lsif, sourceRange); if (hasMoniker) { @@ -213,7 +203,6 @@ private void resolve(int startPosition, int length, boolean needResolveImpl, boo } catch (JavaModelException e) { } - /* Generate Moniker */ if (monikerKind.equals("export")) { symbolData.generateMonikerExport(lsif, sourceRange, identifier, manager, javaproject); diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/SymbolData.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/SymbolData.java index 84a7cc2..ac38695 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/SymbolData.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/SymbolData.java @@ -67,17 +67,15 @@ synchronized public void generateMonikerImport(LsifService lsif, Range sourceRan PackageInformation packageInformation = Repository.getInstance().enlistImportPackageInformation(lsif, createMonikerKey(schemeMonikerName), schemeMonikerName, manager, version); if (!Repository.getInstance().enlistPackageInformationEmitted(schemeMonikerName)) { - LsifEmitter.getInstance().emit(packageInformation); - } - Moniker schemeMoniker = manager.equals("maven") - ? lsif.getVertexBuilder().moniker("import", manager, - packageInformation.getName() + "/" + identifier, "scheme") - : lsif.getVertexBuilder().moniker("import", manager, identifier, "scheme"); - LsifEmitter.getInstance().emit(schemeMoniker); - this.schemeMoniker = schemeMoniker; - LsifEmitter.getInstance() - .emit(lsif.getEdgeBuilder().packageInformation(this.schemeMoniker, packageInformation)); - LsifEmitter.getInstance().emit(lsif.getEdgeBuilder().attach(this.schemeMoniker, this.projectMoniker)); + LsifEmitter.getInstance().emit(packageInformation); + } + Moniker schemeMoniker = manager.equals("maven") + ? lsif.getVertexBuilder().moniker("import", manager, packageInformation.getName() + "/" + identifier, "scheme") + : lsif.getVertexBuilder().moniker("import", manager, identifier, "scheme"); + LsifEmitter.getInstance().emit(schemeMoniker); + this.schemeMoniker = schemeMoniker; + LsifEmitter.getInstance().emit(lsif.getEdgeBuilder().packageInformation(this.schemeMoniker, packageInformation)); + LsifEmitter.getInstance().emit(lsif.getEdgeBuilder().attach(this.schemeMoniker, this.projectMoniker)); } synchronized public void generateMonikerLocal(LsifService lsif, Range sourceRange, String identifier) { @@ -99,15 +97,11 @@ synchronized public void generateMonikerExport(LsifService lsif, Range sourceRan LsifEmitter.getInstance().emit(projectMoniker); this.projectMoniker = projectMoniker; LsifEmitter.getInstance().emit(lsif.getEdgeBuilder().moniker(this.resultSet, this.projectMoniker)); - PackageInformation packageInformation = Repository.getInstance().enlistExportPackageInformation(lsif, - javaproject.getPath().toString(), "", manager, "", ""); - Moniker schemeMoniker = lsif.getVertexBuilder().moniker("export", manager, - packageInformation.getName() + "/" + identifier, - "scheme"); + PackageInformation packageInformation = Repository.getInstance().enlistExportPackageInformation(lsif, javaproject.getPath().toString(), "", manager, "", ""); + Moniker schemeMoniker = lsif.getVertexBuilder().moniker("export", manager, packageInformation.getName() + "/" + identifier, "scheme"); LsifEmitter.getInstance().emit(schemeMoniker); this.schemeMoniker = schemeMoniker; - LsifEmitter.getInstance() - .emit(lsif.getEdgeBuilder().packageInformation(this.schemeMoniker, packageInformation)); + LsifEmitter.getInstance().emit(lsif.getEdgeBuilder().packageInformation(this.schemeMoniker, packageInformation)); LsifEmitter.getInstance().emit(lsif.getEdgeBuilder().attach(this.schemeMoniker, this.projectMoniker)); } From 92bd2282fda9a77fb64a0b203dccfb1bb1cfd8f3 Mon Sep 17 00:00:00 2001 From: CS <45906942+CsCherrYY@users.noreply.github.com> Date: Tue, 11 Aug 2020 13:08:38 +0800 Subject: [PATCH 06/18] Update scheme monikers --- .vscode/launch.json | 16 ++ .../lsif/core/internal/indexer/Indexer.java | 106 ++++++++--- .../core/internal/indexer/Repository.java | 18 +- .../core/internal/indexer/VertexBuilder.java | 11 +- .../internal/indexer/WorkspaceHandler.java | 8 +- .../lsif/core/internal/protocol/Moniker.java | 36 +++- .../internal/protocol/PackageInformation.java | 28 ++- .../core/internal/visitors/LsifVisitor.java | 165 ++++++++++++------ .../core/internal/visitors/SymbolData.java | 44 +++-- .../core/internal/visitors/VisitorUtils.java | 10 ++ 10 files changed, 315 insertions(+), 127 deletions(-) create mode 100644 .vscode/launch.json diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..6cca53c --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,16 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "java", + "name": "Debug (Attach)", + "request": "attach", + "hostName": "localhost", + "projectName": "com.microsoft.java.lsif.core", + "port": 6006 + } + ] +} \ No newline at end of file diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Indexer.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Indexer.java index 5f98ab6..0093970 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Indexer.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Indexer.java @@ -18,8 +18,12 @@ import java.util.concurrent.Executors; import org.apache.maven.model.Model; +import org.apache.maven.model.Scm; +import org.eclipse.buildship.core.GradleBuild; +import org.eclipse.buildship.core.GradleCore; import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.NullProgressMonitor; @@ -34,19 +38,27 @@ import org.eclipse.jdt.core.JavaModelException; import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jdt.ls.core.internal.BuildWorkspaceStatus; +import org.eclipse.jdt.ls.core.internal.IProjectImporter; import org.eclipse.jdt.ls.core.internal.JavaLanguageServerPlugin; import org.eclipse.jdt.ls.core.internal.ResourceUtils; +import org.eclipse.jdt.ls.core.internal.managers.EclipseProjectImporter; +import org.eclipse.jdt.ls.core.internal.managers.GradleProjectImporter; +import org.eclipse.jdt.ls.core.internal.managers.MavenProjectImporter; import org.eclipse.lsp4j.ClientCapabilities; import org.eclipse.m2e.core.MavenPlugin; import org.eclipse.m2e.core.embedder.MavenModelManager; import org.eclipse.m2e.core.project.LocalProjectScanner; import org.eclipse.m2e.core.project.MavenProjectInfo; +import org.gradle.tooling.model.GradleModuleVersion; +import org.gradle.tooling.model.gradle.GradlePublication; +import org.gradle.tooling.model.gradle.ProjectPublications; import com.microsoft.java.lsif.core.internal.emitter.LsifEmitter; import com.microsoft.java.lsif.core.internal.protocol.Document; import com.microsoft.java.lsif.core.internal.protocol.Event; import com.microsoft.java.lsif.core.internal.protocol.PackageInformation; import com.microsoft.java.lsif.core.internal.protocol.Project; +import com.microsoft.java.lsif.core.internal.protocol.PackageInformation.PackageManager; import com.microsoft.java.lsif.core.internal.visitors.DiagnosticVisitor; import com.microsoft.java.lsif.core.internal.visitors.DocumentVisitor; import com.microsoft.java.lsif.core.internal.visitors.LsifVisitor; @@ -59,6 +71,10 @@ public class Indexer { private WorkspaceHandler handler; + public enum ProjectBuildTool { + MAVEN, GRADLE, ECLIPSE, INVISIBLE; + } + public Indexer() { String repoPath = System.getProperty("repo.path"); if (repoPath == null) { @@ -76,20 +92,19 @@ public void generateLsif() throws JavaModelException { LsifEmitter.getInstance().start(); LsifEmitter.getInstance().emit(lsif.getVertexBuilder().metaData(ResourceUtils.fixURI(path.toFile().toURI()))); - String buildTool = handler.importProject(path, monitor); + handler.importProject(path, monitor); BuildWorkspaceStatus buildStatus = handler.buildProject(monitor); if (buildStatus != BuildWorkspaceStatus.SUCCEED) { return; } - buildIndex(path, monitor, lsif, buildTool); + buildIndex(path, monitor, lsif); handler.removeProject(monitor); LsifEmitter.getInstance().end(); } - private void buildIndex(IPath path, IProgressMonitor monitor, LsifService lsif, String buildTool) - throws JavaModelException { + private void buildIndex(IPath path, IProgressMonitor monitor, LsifService lsif) throws JavaModelException { IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects(); @@ -100,35 +115,78 @@ private void buildIndex(IPath path, IProgressMonitor monitor, LsifService lsif, return; } IJavaProject javaProject = JavaCore.create(proj); - if (buildTool.equals("maven")) { + if (!javaProject.exists()) { + continue; + } + ProjectBuildTool builder = null; + try { + IPath folderPath = proj.getLocation(); + if (folderPath == null) { + continue; + } + IProjectImporter importer = this.handler.getImporter(folderPath.toFile(), monitor); + if (importer instanceof MavenProjectImporter) { + builder = ProjectBuildTool.MAVEN; + } else if (importer instanceof GradleProjectImporter) { + builder = ProjectBuildTool.GRADLE; + } else if (importer instanceof EclipseProjectImporter) { + builder = ProjectBuildTool.ECLIPSE; + } else { + builder = ProjectBuildTool.INVISIBLE; + } + } catch (CoreException e) { + e.printStackTrace(); + } + boolean isPublish = false; + if (builder == ProjectBuildTool.MAVEN) { Set infoSet = collectMavenProjectInfo(monitor, path); - infoSet.forEach(mavenProjectInfo -> { + for (MavenProjectInfo mavenProjectInfo : infoSet) { Model model = mavenProjectInfo.getModel(); String groupId = model.getGroupId(); String artifactId = model.getArtifactId(); String version = model.getVersion(); - String url = (model.getUrl() == null) ? "" : model.getUrl(); - PackageInformation packageInformation = Repository.getInstance() - .enlistExportPackageInformation(lsif, javaProject.getPath() - .toString(), - groupId + "/" + artifactId, "maven", version, url); - LsifEmitter.getInstance().emit(packageInformation); - }); - } - - if (!javaProject.exists()) { - continue; + Scm scm = model.getScm(); + String url = ""; + if (scm != null) { + url = scm.getUrl(); + } + if (!groupId.equals("") && !artifactId.equals("") && !version.equals("")) { + isPublish = true; + PackageInformation packageInformation = Repository.getInstance().enlistExportPackageInformation( + lsif, javaProject.getPath().toString(), groupId + "/" + artifactId, PackageManager.MAVEN, version, url); + LsifEmitter.getInstance().emit(packageInformation); + } + } + } else if (builder == ProjectBuildTool.GRADLE) { + if (proj.isOpen()) { + GradleBuild build = GradleCore.getWorkspace().getBuild(proj).get(); + ProjectPublications model; + try { + model = build.withConnection(connection -> connection.getModel(ProjectPublications.class), monitor); + List publications = model.getPublications().getAll(); + if (publications.size() > 0) { + GradleModuleVersion gradleModuleVersion = publications.get(0).getId(); + String groupId = gradleModuleVersion.getGroup(); + String artifactId = gradleModuleVersion.getName(); + String version = gradleModuleVersion.getVersion(); + isPublish = true; + PackageInformation packageInformation = Repository.getInstance().enlistExportPackageInformation( + lsif, javaProject.getPath().toString(), groupId + "/" + artifactId, PackageManager.GRADLE, version, "url"); + LsifEmitter.getInstance().emit(packageInformation); + } + } catch (Exception e) { + e.printStackTrace(); + } + } } - Project projVertex = lsif.getVertexBuilder().project(); LsifEmitter.getInstance().emit(projVertex); - LsifEmitter.getInstance() - .emit(lsif.getVertexBuilder().event(Event.EventScope.Project, Event.EventKind.BEGIN, - projVertex.getId())); + LsifEmitter.getInstance().emit( + lsif.getVertexBuilder().event(Event.EventScope.Project, Event.EventKind.BEGIN, projVertex.getId())); List sourceList = getAllSourceFiles(javaProject); - dumpParallely(sourceList, threadPool, projVertex, lsif, monitor); + dumpParallely(sourceList, threadPool, projVertex, lsif, builder, isPublish, monitor); VisitorUtils.endAllDocument(lsif); LsifEmitter.getInstance().emit( @@ -169,7 +227,7 @@ private List getAllSourceFiles(IJavaProject javaProject) throw } private void dumpParallely(List sourceList, ExecutorService threadPool, Project projVertex, - LsifService lsif, IProgressMonitor monitor) { + LsifService lsif, ProjectBuildTool builder, boolean isPublish, IProgressMonitor monitor) { Observable.fromIterable(sourceList) .flatMap(item -> Observable.just(item).observeOn(Schedulers.from(threadPool)).map(sourceFile -> { CompilationUnit cu = ASTUtil.createAST(sourceFile, monitor); @@ -179,7 +237,7 @@ private void dumpParallely(List sourceList, ExecutorService th } IndexerContext context = new IndexerContext(docVertex, cu, projVertex); - LsifVisitor lsifVisitor = new LsifVisitor(lsif, context); + LsifVisitor lsifVisitor = new LsifVisitor(lsif, context, builder, isPublish); cu.accept(lsifVisitor); DiagnosticVisitor diagnosticVisitor = new DiagnosticVisitor(lsif, context); diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Repository.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Repository.java index 7ae75b3..82c637e 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Repository.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Repository.java @@ -16,6 +16,7 @@ import com.microsoft.java.lsif.core.internal.protocol.PackageInformation; import com.microsoft.java.lsif.core.internal.protocol.Project; import com.microsoft.java.lsif.core.internal.protocol.Range; +import com.microsoft.java.lsif.core.internal.protocol.PackageInformation.PackageManager; import com.microsoft.java.lsif.core.internal.visitors.SymbolData; public class Repository { @@ -104,14 +105,13 @@ public synchronized SymbolData enlistSymbolData(String id, Document docVertex, P } public synchronized PackageInformation enlistImportPackageInformation(LsifService lsif, String id, - String name, String manager, String version) { + String name, PackageManager manager, String version, String url) { PackageInformation packageInformation = findImportPackageInformationById(id); if (packageInformation == null) { - if (manager.equals("maven")) { - packageInformation = lsif.getVertexBuilder().packageInformation(name, manager, version, "https", - "https://mvnrepository.com/artifact/" + name + "/" + version); - } else if (manager.equals("jdk")) { - packageInformation = lsif.getVertexBuilder().packageInformation(name, manager); + if (manager == PackageManager.MAVEN || manager == PackageManager.GRADLE) { + packageInformation = lsif.getVertexBuilder().packageInformation(name, manager, version, "git", url); + } else if (manager == PackageManager.JDK) { + packageInformation = lsif.getVertexBuilder().packageInformation(name, manager, version); } else { return packageInformation; } @@ -121,11 +121,11 @@ public synchronized PackageInformation enlistImportPackageInformation(LsifServic } public synchronized PackageInformation enlistExportPackageInformation(LsifService lsif, String id, String name, - String manager, String version, String url) { + PackageManager manager, String version, String url) { PackageInformation packageInformation = findExportPackageInformationById(id); if (packageInformation == null) { - if (manager.equals("maven")) { - packageInformation = lsif.getVertexBuilder().packageInformation(name, manager, version, "https", url); + if (manager == PackageManager.MAVEN || manager == PackageManager.GRADLE) { + packageInformation = lsif.getVertexBuilder().packageInformation(name, manager, version, "git", url); } else { return packageInformation; } diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/VertexBuilder.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/VertexBuilder.java index 7cebbd2..ac80b7e 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/VertexBuilder.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/VertexBuilder.java @@ -22,6 +22,9 @@ import com.microsoft.java.lsif.core.internal.protocol.ImplementationResult; import com.microsoft.java.lsif.core.internal.protocol.MetaData; import com.microsoft.java.lsif.core.internal.protocol.Moniker; +import com.microsoft.java.lsif.core.internal.protocol.Moniker.MonikerKind; +import com.microsoft.java.lsif.core.internal.protocol.Moniker.MonikerUnique; +import com.microsoft.java.lsif.core.internal.protocol.PackageInformation.PackageManager; import com.microsoft.java.lsif.core.internal.protocol.PackageInformation; import com.microsoft.java.lsif.core.internal.protocol.Project; import com.microsoft.java.lsif.core.internal.protocol.Range; @@ -93,15 +96,15 @@ public DiagnosticResult diagnosticResult(List diagnostics) { return new DiagnosticResult(generator.next(), diagnostics); } - public Moniker moniker(String kind, String scheme, String identifier, String unique) { + public Moniker moniker(MonikerKind kind, String scheme, String identifier, MonikerUnique unique) { return new Moniker(generator.next(), kind, scheme, identifier, unique); } - public PackageInformation packageInformation(String name, String manager, String version, String type, String url) { + public PackageInformation packageInformation(String name, PackageManager manager, String version, String type, String url) { return new PackageInformation(generator.next(), name, manager, version, type, url); } - public PackageInformation packageInformation(String name, String manager) { - return new PackageInformation(generator.next(), name, manager); + public PackageInformation packageInformation(String name, PackageManager manager, String version) { + return new PackageInformation(generator.next(), name, manager, version); } } diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/WorkspaceHandler.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/WorkspaceHandler.java index 9fbf8e4..989823f 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/WorkspaceHandler.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/WorkspaceHandler.java @@ -30,7 +30,6 @@ import org.eclipse.jdt.ls.core.internal.JavaLanguageServerPlugin; import org.eclipse.jdt.ls.core.internal.ResourceUtils; import org.eclipse.jdt.ls.core.internal.managers.GradleBuildSupport; -import org.eclipse.jdt.ls.core.internal.managers.MavenProjectImporter; import com.microsoft.java.lsif.core.internal.LanguageServerIndexerPlugin; @@ -62,23 +61,18 @@ public IPath initialize() { return getProjectPathIfValid(projectDir); } - public String importProject(IPath path, IProgressMonitor monitor) { - String buildTool = "invisible"; + public void importProject(IPath path, IProgressMonitor monitor) { SubMonitor subMonitor = SubMonitor.convert(monitor, 100); File rootFolder = path.toFile(); IProjectImporter importer; try { importer = getImporter(rootFolder, subMonitor.split(30)); - if (importer instanceof MavenProjectImporter) { - buildTool = "maven"; - } if (importer != null) { importer.importToWorkspace(subMonitor.split(70)); } } catch (OperationCanceledException | CoreException e) { e.printStackTrace(); } - return buildTool; } public BuildWorkspaceStatus buildProject(IProgressMonitor monitor) { diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/Moniker.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/Moniker.java index 2e8672e..122ac3f 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/Moniker.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/Moniker.java @@ -7,6 +7,36 @@ public class Moniker extends Vertex { + public enum MonikerKind { + EXPORT("export"), IMPORT("import"), LOCAL("local"); + + private final String kind; + + private MonikerKind(String kind) { + this.kind = kind; + } + + @Override + public String toString() { + return this.kind; + } + } + + public enum MonikerUnique { + PROJECT("project"), SCHEME("scheme"); + + private final String unique; + + private MonikerUnique(String unique) { + this.unique = unique; + } + + @Override + public String toString() { + return this.unique; + } + } + private String kind; private String scheme; @@ -15,11 +45,11 @@ public class Moniker extends Vertex { private String unique; - public Moniker(String id, String kind, String scheme, String identifier, String unique) { + public Moniker(String id, MonikerKind kind, String scheme, String identifier, MonikerUnique unique) { super(id, Vertex.MONIKER); - this.kind = kind; + this.kind = kind.toString(); this.identifier = identifier; this.scheme = scheme; - this.unique = unique; + this.unique = unique.toString(); } } diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/PackageInformation.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/PackageInformation.java index 2f6f360..b657cd6 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/PackageInformation.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/PackageInformation.java @@ -7,6 +7,21 @@ public class PackageInformation extends Vertex { + public enum PackageManager { + MAVEN("maven"), GRADLE("gradle"), JDK("jdk"); + + private final String manager; + + private PackageManager(String manager) { + this.manager = manager; + } + + @Override + public String toString() { + return this.manager; + } + } + private String name; private String manager; @@ -15,18 +30,21 @@ public class PackageInformation extends Vertex { private Repo repository; - public PackageInformation(String id, String name, String manager, String version, String type, String url) { + public PackageInformation(String id, String name, PackageManager manager, String version, String type, String url) { super(id, Vertex.PACKAGEINFORMATION); this.name = name; - this.manager = manager; + this.manager = manager.toString(); this.version = version; - this.repository = new Repo(type, url); + if (!url.equals("")) { + this.repository = new Repo(type, url); + } } - public PackageInformation(String id, String name, String manager) { + public PackageInformation(String id, String name, PackageManager manager, String version) { super(id, Vertex.PACKAGEINFORMATION); this.name = name; - this.manager = manager; + this.manager = manager.toString(); + this.version = version; } public class Repo { diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/LsifVisitor.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/LsifVisitor.java index 074a532..f41a1f7 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/LsifVisitor.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/LsifVisitor.java @@ -5,15 +5,18 @@ package com.microsoft.java.lsif.core.internal.visitors; -import org.apache.commons.codec.digest.DigestUtils; +import org.apache.maven.model.Model; +import org.apache.maven.model.Scm; +import org.apache.maven.model.io.xpp3.MavenXpp3Reader; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.jdt.core.IClassFile; -import org.eclipse.jdt.core.IClasspathAttribute; -import org.eclipse.jdt.core.IClasspathEntry; import org.eclipse.jdt.core.ICompilationUnit; import org.eclipse.jdt.core.IJavaElement; +import org.eclipse.jdt.core.IJavaModel; import org.eclipse.jdt.core.IJavaProject; +import org.eclipse.jdt.core.IModuleDescription; +import org.eclipse.jdt.core.IPackageFragmentRoot; import org.eclipse.jdt.core.JavaModelException; import org.eclipse.jdt.core.dom.ASTNode; import org.eclipse.jdt.core.dom.EnumConstantDeclaration; @@ -27,8 +30,13 @@ import org.eclipse.jdt.core.dom.TypeDeclaration; import org.eclipse.jdt.core.dom.VariableDeclarationFragment; import org.eclipse.jdt.core.dom.VariableDeclarationStatement; +import org.eclipse.jdt.internal.compiler.classfmt.ModuleInfo; +import org.eclipse.jdt.internal.compiler.env.IModule; +import org.eclipse.jdt.internal.core.BinaryModule; import org.eclipse.jdt.internal.core.BinaryType; import org.eclipse.jdt.internal.core.ClassFile; +import org.eclipse.jdt.internal.core.JarPackageFragmentRoot; +import org.eclipse.jdt.internal.core.JrtPackageFragmentRoot; import org.eclipse.jdt.internal.core.LocalVariable; import org.eclipse.jdt.internal.core.ResolvedBinaryField; import org.eclipse.jdt.internal.core.ResolvedBinaryMethod; @@ -41,59 +49,75 @@ import org.eclipse.lsp4j.Hover; import org.eclipse.lsp4j.Location; +import java.io.File; +import java.io.FileReader; +import java.util.ArrayList; +import java.util.List; +import java.util.jar.Attributes; +import java.util.jar.Manifest; + import com.microsoft.java.lsif.core.internal.JdtlsUtils; import com.microsoft.java.lsif.core.internal.LanguageServerIndexerPlugin; import com.microsoft.java.lsif.core.internal.indexer.IndexerContext; import com.microsoft.java.lsif.core.internal.indexer.LsifService; import com.microsoft.java.lsif.core.internal.indexer.Repository; +import com.microsoft.java.lsif.core.internal.indexer.Indexer.ProjectBuildTool; import com.microsoft.java.lsif.core.internal.protocol.Document; import com.microsoft.java.lsif.core.internal.protocol.Project; import com.microsoft.java.lsif.core.internal.protocol.Range; import com.microsoft.java.lsif.core.internal.protocol.ResultSet; +import com.microsoft.java.lsif.core.internal.protocol.Moniker.MonikerKind; +import com.microsoft.java.lsif.core.internal.protocol.PackageInformation.PackageManager; public class LsifVisitor extends ProtocolVisitor { - public LsifVisitor(LsifService lsif, IndexerContext context) { + private ProjectBuildTool builder; + + private boolean isPublish; + + public LsifVisitor(LsifService lsif, IndexerContext context, ProjectBuildTool builder, boolean isPublish) { super(lsif, context); + this.builder = builder; + this.isPublish = isPublish; } @Override public boolean visit(SimpleName node) { - resolve(node.getStartPosition(), node.getLength(), isTypeOrMethodDeclaration(node), true, ""); + resolve(node.getStartPosition(), node.getLength(), isTypeOrMethodDeclaration(node), true, MonikerKind.IMPORT); return false; } @Override public boolean visit(SingleVariableDeclaration node) { - String monikerKind = (node.getModifiers() & Modifier.PUBLIC) > 0 ? "export" : "local"; + MonikerKind monikerKind = (node.getModifiers() & Modifier.PUBLIC) > 0 ? MonikerKind.EXPORT : MonikerKind.LOCAL; resolve(node.getName().getStartPosition(), node.getName().getLength(), false, true, monikerKind); return true; } @Override public boolean visit(EnumDeclaration node) { - String monikerKind = (node.getModifiers() & Modifier.PUBLIC) > 0 ? "export" : "local"; + MonikerKind monikerKind = (node.getModifiers() & Modifier.PUBLIC) > 0 ? MonikerKind.EXPORT : MonikerKind.LOCAL; resolve(node.getName().getStartPosition(), node.getName().getLength(), false, true, monikerKind); return true; } @Override public boolean visit(EnumConstantDeclaration node) { - String monikerKind = "export"; // all the enum values are public static final + MonikerKind monikerKind = MonikerKind.EXPORT; // All the enum values are modified by `public static final` resolve(node.getName().getStartPosition(), node.getName().getLength(), false, true, monikerKind); return true; } @Override public boolean visit(TypeDeclaration node) { - String monikerKind = (node.getModifiers() & Modifier.PUBLIC) > 0 ? "export" : "local"; + MonikerKind monikerKind = (node.getModifiers() & Modifier.PUBLIC) > 0 ? MonikerKind.EXPORT : MonikerKind.LOCAL; resolve(node.getName().getStartPosition(), node.getName().getLength(), false, true, monikerKind); return true; } @Override public boolean visit(MethodDeclaration node) { - String monikerKind = (node.getModifiers() & Modifier.PUBLIC) > 0 ? "export" : "local"; + MonikerKind monikerKind = (node.getModifiers() & Modifier.PUBLIC) > 0 ? MonikerKind.EXPORT : MonikerKind.LOCAL; resolve(node.getName().getStartPosition(), node.getName().getLength(), false, true, monikerKind); return true; } @@ -102,10 +126,10 @@ public boolean visit(MethodDeclaration node) { public boolean visit(VariableDeclarationFragment node) { ASTNode parent = node.getParent(); if (parent instanceof VariableDeclarationStatement) { - String monikerKind = (((VariableDeclarationStatement) parent).getModifiers() & Modifier.PUBLIC) > 0 ? "export" : "local"; + MonikerKind monikerKind = (((VariableDeclarationStatement) parent).getModifiers() & Modifier.PUBLIC) > 0 ? MonikerKind.EXPORT : MonikerKind.LOCAL; resolve(node.getName().getStartPosition(), node.getName().getLength(), false, true, monikerKind); } else if (parent instanceof FieldDeclaration) { - String monikerKind = (((FieldDeclaration) parent).getModifiers() & Modifier.PUBLIC) > 0 ? "export" : "local"; + MonikerKind monikerKind = (((FieldDeclaration) parent).getModifiers() & Modifier.PUBLIC) > 0 ? MonikerKind.EXPORT : MonikerKind.LOCAL; resolve(node.getName().getStartPosition(), node.getName().getLength(), false, true, monikerKind); } return true; @@ -113,12 +137,11 @@ public boolean visit(VariableDeclarationFragment node) { @Override public boolean visit(SimpleType node) { - resolve(node.getStartPosition(), node.getLength(), isTypeOrMethodDeclaration(node), true, ""); + resolve(node.getStartPosition(), node.getLength(), isTypeOrMethodDeclaration(node), true, MonikerKind.IMPORT); return false; } - private void resolve(int startPosition, int length, boolean needResolveImpl, boolean hasMoniker, - String monikerKind) { + private void resolve(int startPosition, int length, boolean needResolveImpl, boolean hasMoniker, MonikerKind monikerKind) { try { org.eclipse.lsp4j.Range sourceLspRange = JDTUtils.toRange(this.getContext().getCompilationUnit().getTypeRoot(), startPosition, length); @@ -129,11 +152,12 @@ private void resolve(int startPosition, int length, boolean needResolveImpl, boo if (element == null) { return; } + LsifService lsif = this.getLsif(); Document docVertex = this.getContext().getDocVertex(); Project projVertex = this.getContext().getProjVertex(); Range sourceRange = Repository.getInstance().enlistRange(lsif, docVertex, sourceLspRange); - // emit range + Location definitionLocation = JdtlsUtils.getElementLocation(element); if (definitionLocation == null) { // no target location, only resolve hover. @@ -144,55 +168,77 @@ private void resolve(int startPosition, int length, boolean needResolveImpl, boo } ResultSet resultSet = VisitorUtils.ensureResultSet(lsif, sourceRange); VisitorUtils.emitHoverResult(hover, lsif, resultSet); - // emit hover return; } + + // Import Monikers IJavaProject javaproject = element.getJavaProject(); ICompilationUnit compilationUnit = (ICompilationUnit) element.getAncestor(IJavaElement.COMPILATION_UNIT); IClassFile cf = (IClassFile) element.getAncestor(IJavaElement.CLASS_FILE); - boolean isFromMaven = false; - boolean isFromJdk = false; - int mavenCount = 0; + PackageManager manager = null; String groupId = ""; String artifactId = ""; String version = ""; + String url = ""; if (compilationUnit == null && cf != null) { IPath path = cf.getPath(); - IClasspathEntry entry = javaproject.getClasspathEntryFor(path); - IClasspathAttribute[] attrs = entry.getExtraAttributes(); - for (IClasspathAttribute attr : attrs) { - if (attr.getName().equals("maven.pomderived")) { - if (attr.getValue().equals("true")) { - mavenCount++; + IPackageFragmentRoot root = javaproject.findPackageFragmentRoot(path); + if (root instanceof JrtPackageFragmentRoot) { + Manifest manifest = ((JrtPackageFragmentRoot)root).getManifest(); + Attributes attributes = manifest.getMainAttributes(); + String ver = attributes.getValue("Implementation-Version"); + if (ver != null) { + version = ver; + } + IModuleDescription moduleDescription = ((JrtPackageFragmentRoot)root).getModuleDescription(); + if (moduleDescription instanceof BinaryModule) { + groupId = ((BinaryModule)moduleDescription).getElementName(); + } + manager = PackageManager.JDK; + } else if (root instanceof JarPackageFragmentRoot) { + List fileList = new ArrayList<>(); + if (builder == ProjectBuildTool.MAVEN) { + findPomFile(path.removeLastSegments(1).toFile(), fileList); + } else if (builder == ProjectBuildTool.GRADLE) { + findPomFile(path.removeLastSegments(2).toFile(), fileList); + } + if (fileList.size() > 0) { + manager = (builder == ProjectBuildTool.MAVEN) ? PackageManager.MAVEN : PackageManager.GRADLE; + File file = fileList.get(0); + MavenXpp3Reader reader = new MavenXpp3Reader(); + Model model = reader.read(new FileReader(file.getAbsolutePath())); + groupId = model.getGroupId(); + artifactId = model.getArtifactId(); + version = model.getVersion(); + Scm scm = model.getScm(); + if (scm != null) { + url = scm.getUrl(); } - } else if (attr.getName().equals("maven.groupId")) { - groupId = attr.getValue(); - } else if (attr.getName().equals("maven.artifactId")) { - artifactId = attr.getValue(); - } else if (attr.getName().equals("maven.version")) { - version = attr.getValue(); } } - if (mavenCount == 2) { - isFromMaven = true; - } else if (mavenCount == 1) { - isFromJdk = true; - } } - String schemeMonikerName = ""; - String manager = (monikerKind.equals("export") || isFromMaven) ? "maven" : isFromJdk ? "jdk" : ""; - if (isFromMaven) { - schemeMonikerName = groupId + "/" + artifactId; - } else if (isFromJdk) { + String schemeId = ""; + if (manager == PackageManager.MAVEN || manager == PackageManager.GRADLE) { + schemeId = groupId + "/" + artifactId; + } else if (manager == PackageManager.JDK) { if (cf instanceof ClassFile) { - schemeMonikerName = cf.getParent().getElementName() + "." + ((ClassFile) cf).getName(); + schemeId = cf.getParent().getElementName() + "." + ((ClassFile) cf).getName(); } else { - schemeMonikerName = cf.getParent().getElementName() + "." + cf.getElementName(); + schemeId = cf.getParent().getElementName() + "." + cf.getElementName(); } } - String id = createSymbolKey(definitionLocation); - Document definitionDocument = Repository.getInstance().enlistDocument(lsif, definitionLocation.getUri(), - projVertex); + + // Export Monikers + if (monikerKind == MonikerKind.EXPORT && this.isPublish) { + if (builder == ProjectBuildTool.MAVEN) { + manager = PackageManager.MAVEN; + } else if (builder == ProjectBuildTool.GRADLE) { + manager = PackageManager.GRADLE; + } + } + + String id = VisitorUtils.createSymbolKey(definitionLocation); + Document definitionDocument = Repository.getInstance().enlistDocument(lsif, definitionLocation.getUri(), projVertex); SymbolData symbolData = Repository.getInstance().enlistSymbolData(id, definitionDocument, projVertex); /* Ensure resultSet */ symbolData.ensureResultSet(lsif, sourceRange); @@ -201,16 +247,15 @@ private void resolve(int startPosition, int length, boolean needResolveImpl, boo try { identifier = this.getMonikerIdentifier(element); } catch (JavaModelException e) { - + // Do nothing } /* Generate Moniker */ - if (monikerKind.equals("export")) { + if (monikerKind == MonikerKind.EXPORT) { symbolData.generateMonikerExport(lsif, sourceRange, identifier, manager, javaproject); - } else if (monikerKind.equals("local")) { + } else if (monikerKind == MonikerKind.LOCAL) { symbolData.generateMonikerLocal(lsif, sourceRange, identifier); } else if (definitionLocation.getUri().startsWith("jdt")) { - symbolData.generateMonikerImport(lsif, sourceRange, identifier, schemeMonikerName, manager, - version); + symbolData.generateMonikerImport(lsif, sourceRange, identifier, schemeId, manager, version, url); } return; } @@ -259,12 +304,18 @@ private String getMonikerIdentifier(IJavaElement element) throws JavaModelExcept return identifier; } - private String createSymbolKey(Location definitionLocation) { - String rawKeyString = definitionLocation.toString(); - return DigestUtils.md5Hex(rawKeyString); - } - private boolean isTypeOrMethodDeclaration(ASTNode node) { return node.getParent() instanceof TypeDeclaration || node.getParent() instanceof MethodDeclaration; } + + private static void findPomFile(File file, List fileList) { + File[] files = file.listFiles(); + for (File subfile: files) { + if (subfile.isDirectory()) { + findPomFile(subfile, fileList); + } else if (subfile.getName().endsWith(".pom")){ + fileList.add(subfile); + } + } + } } diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/SymbolData.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/SymbolData.java index ac38695..46870a5 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/SymbolData.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/SymbolData.java @@ -8,7 +8,6 @@ import java.util.List; import java.util.stream.Collectors; -import org.apache.commons.codec.digest.DigestUtils; import org.eclipse.jdt.core.IJavaProject; import org.eclipse.lsp4j.Hover; import org.eclipse.lsp4j.Location; @@ -21,6 +20,9 @@ import com.microsoft.java.lsif.core.internal.protocol.ImplementationResult; import com.microsoft.java.lsif.core.internal.protocol.ItemEdge; import com.microsoft.java.lsif.core.internal.protocol.Moniker; +import com.microsoft.java.lsif.core.internal.protocol.Moniker.MonikerKind; +import com.microsoft.java.lsif.core.internal.protocol.Moniker.MonikerUnique; +import com.microsoft.java.lsif.core.internal.protocol.PackageInformation.PackageManager; import com.microsoft.java.lsif.core.internal.protocol.PackageInformation; import com.microsoft.java.lsif.core.internal.protocol.Project; import com.microsoft.java.lsif.core.internal.protocol.Range; @@ -55,23 +57,27 @@ synchronized public void ensureResultSet(LsifService lsif, Range sourceRange) { LsifEmitter.getInstance().emit(lsif.getEdgeBuilder().next(sourceRange, this.resultSet)); } - synchronized public void generateMonikerImport(LsifService lsif, Range sourceRange, - String identifier, String schemeMonikerName, String manager, String version) { + synchronized public void generateMonikerImport(LsifService lsif, Range sourceRange, String identifier, String schemeId, PackageManager manager, String version, String url) { if (this.resultSet == null || this.projectMoniker != null || this.schemeMoniker != null) { return; } - Moniker projectMoniker = lsif.getVertexBuilder().moniker("import", "jdt", identifier, "project"); + Moniker projectMoniker = lsif.getVertexBuilder().moniker(MonikerKind.IMPORT, "jdt", identifier, MonikerUnique.PROJECT); LsifEmitter.getInstance().emit(projectMoniker); this.projectMoniker = projectMoniker; LsifEmitter.getInstance().emit(lsif.getEdgeBuilder().moniker(this.resultSet, this.projectMoniker)); - PackageInformation packageInformation = Repository.getInstance().enlistImportPackageInformation(lsif, - createMonikerKey(schemeMonikerName), schemeMonikerName, manager, version); - if (!Repository.getInstance().enlistPackageInformationEmitted(schemeMonikerName)) { + if (manager == null) { + return; + } + PackageInformation packageInformation = Repository.getInstance().enlistImportPackageInformation(lsif, schemeId, schemeId, manager, version, url); + if (packageInformation == null) { + return; + } + if (!Repository.getInstance().enlistPackageInformationEmitted(schemeId)) { LsifEmitter.getInstance().emit(packageInformation); } - Moniker schemeMoniker = manager.equals("maven") - ? lsif.getVertexBuilder().moniker("import", manager, packageInformation.getName() + "/" + identifier, "scheme") - : lsif.getVertexBuilder().moniker("import", manager, identifier, "scheme"); + Moniker schemeMoniker = (manager == PackageManager.JDK) + ? lsif.getVertexBuilder().moniker(MonikerKind.IMPORT, manager.toString(), identifier, MonikerUnique.SCHEME) + : lsif.getVertexBuilder().moniker(MonikerKind.IMPORT, manager.toString(), packageInformation.getName() + "/" + identifier, MonikerUnique.SCHEME); LsifEmitter.getInstance().emit(schemeMoniker); this.schemeMoniker = schemeMoniker; LsifEmitter.getInstance().emit(lsif.getEdgeBuilder().packageInformation(this.schemeMoniker, packageInformation)); @@ -82,23 +88,28 @@ synchronized public void generateMonikerLocal(LsifService lsif, Range sourceRang if (this.resultSet == null || this.projectMoniker != null || this.schemeMoniker != null) { return; } - Moniker projectMoniker = lsif.getVertexBuilder().moniker("local", "jdt", identifier, "project"); + Moniker projectMoniker = lsif.getVertexBuilder().moniker(MonikerKind.LOCAL, "jdt", identifier, MonikerUnique.PROJECT); LsifEmitter.getInstance().emit(projectMoniker); this.projectMoniker = projectMoniker; LsifEmitter.getInstance().emit(lsif.getEdgeBuilder().moniker(this.resultSet, this.projectMoniker)); } - synchronized public void generateMonikerExport(LsifService lsif, Range sourceRange, - String identifier, String manager, IJavaProject javaproject) { + synchronized public void generateMonikerExport(LsifService lsif, Range sourceRange, String identifier, PackageManager manager, IJavaProject javaproject) { if (this.resultSet == null || this.projectMoniker != null || this.schemeMoniker != null) { return; } - Moniker projectMoniker = lsif.getVertexBuilder().moniker("export", "jdt", identifier, "project"); + Moniker projectMoniker = lsif.getVertexBuilder().moniker(MonikerKind.EXPORT, "jdt", identifier, MonikerUnique.PROJECT); LsifEmitter.getInstance().emit(projectMoniker); this.projectMoniker = projectMoniker; LsifEmitter.getInstance().emit(lsif.getEdgeBuilder().moniker(this.resultSet, this.projectMoniker)); + if (manager == null) { + return; + } PackageInformation packageInformation = Repository.getInstance().enlistExportPackageInformation(lsif, javaproject.getPath().toString(), "", manager, "", ""); - Moniker schemeMoniker = lsif.getVertexBuilder().moniker("export", manager, packageInformation.getName() + "/" + identifier, "scheme"); + if (packageInformation == null) { + return; + } + Moniker schemeMoniker = lsif.getVertexBuilder().moniker(MonikerKind.EXPORT, manager.toString(), packageInformation.getName() + "/" + identifier, MonikerUnique.SCHEME); LsifEmitter.getInstance().emit(schemeMoniker); this.schemeMoniker = schemeMoniker; LsifEmitter.getInstance().emit(lsif.getEdgeBuilder().packageInformation(this.schemeMoniker, packageInformation)); @@ -191,7 +202,4 @@ synchronized public void resolveHover(LsifService lsif, Document docVertex, this.hoverResolved = true; } - private String createMonikerKey(String name) { - return DigestUtils.md5Hex(name); - } } diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/VisitorUtils.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/VisitorUtils.java index 193a001..00af115 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/VisitorUtils.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/VisitorUtils.java @@ -9,6 +9,7 @@ import java.util.List; import java.util.stream.Collectors; +import org.apache.commons.codec.digest.DigestUtils; import org.apache.commons.lang3.StringUtils; import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.jdt.ls.core.internal.JavaLanguageServerPlugin; @@ -164,4 +165,13 @@ public static void endAllDocument(LsifService lsif) { endDocument(lsif, doc); } } + + public static String createSymbolKey(Location definitionLocation) { + String rawKeyString = definitionLocation.toString(); + return DigestUtils.md5Hex(rawKeyString); + } + + public static String createSymbolKey(String key) { + return DigestUtils.md5Hex(key); + } } From a35f2b8936a5e24ddca201e917870e03877af011 Mon Sep 17 00:00:00 2001 From: CS <45906942+CsCherrYY@users.noreply.github.com> Date: Thu, 13 Aug 2020 13:22:05 +0800 Subject: [PATCH 07/18] Fix gradle packageInformation bug --- .../microsoft/java/lsif/core/internal/indexer/Repository.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Repository.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Repository.java index 82c637e..78736d5 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Repository.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Repository.java @@ -124,8 +124,10 @@ public synchronized PackageInformation enlistExportPackageInformation(LsifServic PackageManager manager, String version, String url) { PackageInformation packageInformation = findExportPackageInformationById(id); if (packageInformation == null) { - if (manager == PackageManager.MAVEN || manager == PackageManager.GRADLE) { + if (manager == PackageManager.MAVEN) { packageInformation = lsif.getVertexBuilder().packageInformation(name, manager, version, "git", url); + } else if (manager == PackageManager.GRADLE) { + packageInformation = lsif.getVertexBuilder().packageInformation(name, manager, version); } else { return packageInformation; } From cf14866cd9e02c0d598153b04e0c2a99f8ef5996 Mon Sep 17 00:00:00 2001 From: CS <45906942+CsCherrYY@users.noreply.github.com> Date: Thu, 13 Aug 2020 15:24:18 +0800 Subject: [PATCH 08/18] Remove test codes --- .../core/internal/visitors/LsifVisitor.java | 85 ++++++++++--------- 1 file changed, 44 insertions(+), 41 deletions(-) diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/LsifVisitor.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/LsifVisitor.java index f41a1f7..8cf38af 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/LsifVisitor.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/LsifVisitor.java @@ -83,42 +83,42 @@ public LsifVisitor(LsifService lsif, IndexerContext context, ProjectBuildTool bu @Override public boolean visit(SimpleName node) { - resolve(node.getStartPosition(), node.getLength(), isTypeOrMethodDeclaration(node), true, MonikerKind.IMPORT); + resolve(node.getStartPosition(), node.getLength(), isTypeOrMethodDeclaration(node), MonikerKind.IMPORT); return false; } @Override public boolean visit(SingleVariableDeclaration node) { MonikerKind monikerKind = (node.getModifiers() & Modifier.PUBLIC) > 0 ? MonikerKind.EXPORT : MonikerKind.LOCAL; - resolve(node.getName().getStartPosition(), node.getName().getLength(), false, true, monikerKind); + resolve(node.getName().getStartPosition(), node.getName().getLength(), false, monikerKind); return true; } @Override public boolean visit(EnumDeclaration node) { MonikerKind monikerKind = (node.getModifiers() & Modifier.PUBLIC) > 0 ? MonikerKind.EXPORT : MonikerKind.LOCAL; - resolve(node.getName().getStartPosition(), node.getName().getLength(), false, true, monikerKind); + resolve(node.getName().getStartPosition(), node.getName().getLength(), false, monikerKind); return true; } @Override public boolean visit(EnumConstantDeclaration node) { MonikerKind monikerKind = MonikerKind.EXPORT; // All the enum values are modified by `public static final` - resolve(node.getName().getStartPosition(), node.getName().getLength(), false, true, monikerKind); + resolve(node.getName().getStartPosition(), node.getName().getLength(), false, monikerKind); return true; } @Override public boolean visit(TypeDeclaration node) { MonikerKind monikerKind = (node.getModifiers() & Modifier.PUBLIC) > 0 ? MonikerKind.EXPORT : MonikerKind.LOCAL; - resolve(node.getName().getStartPosition(), node.getName().getLength(), false, true, monikerKind); + resolve(node.getName().getStartPosition(), node.getName().getLength(), false, monikerKind); return true; } @Override public boolean visit(MethodDeclaration node) { MonikerKind monikerKind = (node.getModifiers() & Modifier.PUBLIC) > 0 ? MonikerKind.EXPORT : MonikerKind.LOCAL; - resolve(node.getName().getStartPosition(), node.getName().getLength(), false, true, monikerKind); + resolve(node.getName().getStartPosition(), node.getName().getLength(), false, monikerKind); return true; } @@ -126,29 +126,33 @@ public boolean visit(MethodDeclaration node) { public boolean visit(VariableDeclarationFragment node) { ASTNode parent = node.getParent(); if (parent instanceof VariableDeclarationStatement) { - MonikerKind monikerKind = (((VariableDeclarationStatement) parent).getModifiers() & Modifier.PUBLIC) > 0 ? MonikerKind.EXPORT : MonikerKind.LOCAL; - resolve(node.getName().getStartPosition(), node.getName().getLength(), false, true, monikerKind); + MonikerKind monikerKind = (((VariableDeclarationStatement) parent).getModifiers() & Modifier.PUBLIC) > 0 + ? MonikerKind.EXPORT + : MonikerKind.LOCAL; + resolve(node.getName().getStartPosition(), node.getName().getLength(), false, monikerKind); } else if (parent instanceof FieldDeclaration) { - MonikerKind monikerKind = (((FieldDeclaration) parent).getModifiers() & Modifier.PUBLIC) > 0 ? MonikerKind.EXPORT : MonikerKind.LOCAL; - resolve(node.getName().getStartPosition(), node.getName().getLength(), false, true, monikerKind); + MonikerKind monikerKind = (((FieldDeclaration) parent).getModifiers() & Modifier.PUBLIC) > 0 + ? MonikerKind.EXPORT + : MonikerKind.LOCAL; + resolve(node.getName().getStartPosition(), node.getName().getLength(), false, monikerKind); } return true; } @Override public boolean visit(SimpleType node) { - resolve(node.getStartPosition(), node.getLength(), isTypeOrMethodDeclaration(node), true, MonikerKind.IMPORT); + resolve(node.getStartPosition(), node.getLength(), isTypeOrMethodDeclaration(node), MonikerKind.IMPORT); return false; } - private void resolve(int startPosition, int length, boolean needResolveImpl, boolean hasMoniker, MonikerKind monikerKind) { + private void resolve(int startPosition, int length, boolean needResolveImpl, MonikerKind monikerKind) { try { - org.eclipse.lsp4j.Range sourceLspRange = JDTUtils.toRange(this.getContext().getCompilationUnit().getTypeRoot(), - startPosition, length); + org.eclipse.lsp4j.Range sourceLspRange = JDTUtils + .toRange(this.getContext().getCompilationUnit().getTypeRoot(), startPosition, length); IJavaElement element = JDTUtils.findElementAtSelection(this.getContext().getCompilationUnit().getTypeRoot(), - sourceLspRange.getStart().getLine(), sourceLspRange.getStart().getCharacter(), new PreferenceManager(), - new NullProgressMonitor()); + sourceLspRange.getStart().getLine(), sourceLspRange.getStart().getCharacter(), + new PreferenceManager(), new NullProgressMonitor()); if (element == null) { return; } @@ -184,15 +188,15 @@ private void resolve(int startPosition, int length, boolean needResolveImpl, boo IPath path = cf.getPath(); IPackageFragmentRoot root = javaproject.findPackageFragmentRoot(path); if (root instanceof JrtPackageFragmentRoot) { - Manifest manifest = ((JrtPackageFragmentRoot)root).getManifest(); + Manifest manifest = ((JrtPackageFragmentRoot) root).getManifest(); Attributes attributes = manifest.getMainAttributes(); String ver = attributes.getValue("Implementation-Version"); if (ver != null) { version = ver; } - IModuleDescription moduleDescription = ((JrtPackageFragmentRoot)root).getModuleDescription(); + IModuleDescription moduleDescription = ((JrtPackageFragmentRoot) root).getModuleDescription(); if (moduleDescription instanceof BinaryModule) { - groupId = ((BinaryModule)moduleDescription).getElementName(); + groupId = ((BinaryModule) moduleDescription).getElementName(); } manager = PackageManager.JDK; } else if (root instanceof JarPackageFragmentRoot) { @@ -238,27 +242,26 @@ private void resolve(int startPosition, int length, boolean needResolveImpl, boo } String id = VisitorUtils.createSymbolKey(definitionLocation); - Document definitionDocument = Repository.getInstance().enlistDocument(lsif, definitionLocation.getUri(), projVertex); + Document definitionDocument = Repository.getInstance().enlistDocument(lsif, definitionLocation.getUri(), + projVertex); SymbolData symbolData = Repository.getInstance().enlistSymbolData(id, definitionDocument, projVertex); /* Ensure resultSet */ symbolData.ensureResultSet(lsif, sourceRange); - if (hasMoniker) { - String identifier = ""; - try { - identifier = this.getMonikerIdentifier(element); - } catch (JavaModelException e) { - // Do nothing - } + String identifier = ""; + try { + identifier = this.getMonikerIdentifier(element); + } catch (JavaModelException e) { + // Do nothing + } /* Generate Moniker */ - if (monikerKind == MonikerKind.EXPORT) { - symbolData.generateMonikerExport(lsif, sourceRange, identifier, manager, javaproject); - } else if (monikerKind == MonikerKind.LOCAL) { - symbolData.generateMonikerLocal(lsif, sourceRange, identifier); - } else if (definitionLocation.getUri().startsWith("jdt")) { - symbolData.generateMonikerImport(lsif, sourceRange, identifier, schemeId, manager, version, url); - } - return; + if (monikerKind == MonikerKind.EXPORT) { + symbolData.generateMonikerExport(lsif, sourceRange, identifier, manager, javaproject); + } else if (monikerKind == MonikerKind.LOCAL) { + symbolData.generateMonikerLocal(lsif, sourceRange, identifier); + } else if (definitionLocation.getUri().startsWith("jdt")) { + symbolData.generateMonikerImport(lsif, sourceRange, identifier, schemeId, manager, version, url); } + /* Resolve definition */ symbolData.resolveDefinition(lsif, definitionLocation); @@ -289,15 +292,15 @@ private String getMonikerIdentifier(IJavaElement element) throws JavaModelExcept } else if (element instanceof SourceField) { return getMonikerIdentifier(element.getParent()) + "/" + identifier; } else if (element instanceof SourceMethod) { - return getMonikerIdentifier(element.getParent()) + "/" - + identifier + ":" + ((SourceMethod) element).getSignature(); + return getMonikerIdentifier(element.getParent()) + "/" + identifier + ":" + + ((SourceMethod) element).getSignature(); } else if (element instanceof LocalVariable) { return getMonikerIdentifier(element.getParent()) + "/" + identifier; } else if (element instanceof ResolvedBinaryType) { return ((ResolvedBinaryType) element).getFullyQualifiedName(); } else if (element instanceof ResolvedBinaryMethod) { - return getMonikerIdentifier(element.getParent()) + "/" - + identifier + ":" + ((ResolvedBinaryMethod) element).getSignature(); + return getMonikerIdentifier(element.getParent()) + "/" + identifier + ":" + + ((ResolvedBinaryMethod) element).getSignature(); } else if (element instanceof ResolvedBinaryField) { return getMonikerIdentifier(element.getParent()) + "/" + identifier; } @@ -310,10 +313,10 @@ private boolean isTypeOrMethodDeclaration(ASTNode node) { private static void findPomFile(File file, List fileList) { File[] files = file.listFiles(); - for (File subfile: files) { + for (File subfile : files) { if (subfile.isDirectory()) { findPomFile(subfile, fileList); - } else if (subfile.getName().endsWith(".pom")){ + } else if (subfile.getName().endsWith(".pom")) { fileList.add(subfile); } } From de62e4d52e70d3eeb6031ec4659973e467d2ca9e Mon Sep 17 00:00:00 2001 From: CS <45906942+CsCherrYY@users.noreply.github.com> Date: Wed, 19 Aug 2020 15:37:22 +0800 Subject: [PATCH 09/18] Apply changes 1. Merge PackageInformation Maps in Repository 2. Use `org.apache.maven.scm.provider.ScmUrlUtils` to resolve scm 3. Support Both Java8- and Java9+ 4. Rename `project` moniker to `group` moniker 5. Rewrite some codes --- com.microsoft.java.lsif.core/.classpath | 1 + .../.settings/org.eclipse.jdt.core.prefs | 28 +++- .../META-INF/MANIFEST.MF | 1 + com.microsoft.java.lsif.core/pom.xml | 5 + .../lsif/core/internal/indexer/Indexer.java | 40 ++--- .../core/internal/indexer/Repository.java | 86 +++------- .../lsif/core/internal/protocol/Moniker.java | 2 +- .../core/internal/visitors/LsifVisitor.java | 157 ++++++++++-------- .../core/internal/visitors/SymbolData.java | 51 +++--- pom.xml | 2 +- 10 files changed, 182 insertions(+), 191 deletions(-) diff --git a/com.microsoft.java.lsif.core/.classpath b/com.microsoft.java.lsif.core/.classpath index d37652d..290134b 100644 --- a/com.microsoft.java.lsif.core/.classpath +++ b/com.microsoft.java.lsif.core/.classpath @@ -4,6 +4,7 @@ + diff --git a/com.microsoft.java.lsif.core/.settings/org.eclipse.jdt.core.prefs b/com.microsoft.java.lsif.core/.settings/org.eclipse.jdt.core.prefs index 6e43a32..9828c94 100644 --- a/com.microsoft.java.lsif.core/.settings/org.eclipse.jdt.core.prefs +++ b/com.microsoft.java.lsif.core/.settings/org.eclipse.jdt.core.prefs @@ -116,6 +116,7 @@ org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647 org.eclipse.jdt.core.formatter.align_type_members_on_columns=false org.eclipse.jdt.core.formatter.align_variable_declarations_on_columns=false org.eclipse.jdt.core.formatter.align_with_spaces=false +org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 @@ -123,21 +124,24 @@ org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_c org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 org.eclipse.jdt.core.formatter.alignment_for_assignment=0 -org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_bitwise_operator=16 org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 org.eclipse.jdt.core.formatter.alignment_for_compact_loops=16 org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 org.eclipse.jdt.core.formatter.alignment_for_enum_constants=16 org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header=0 +org.eclipse.jdt.core.formatter.alignment_for_logical_operator=16 org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 org.eclipse.jdt.core.formatter.alignment_for_module_statements=16 org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 +org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator=16 org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references=0 org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_string_concatenation=16 org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 @@ -222,11 +226,12 @@ org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_ini org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_additive_operator=insert org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_bitwise_operator=insert org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=do not insert org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert @@ -257,6 +262,8 @@ org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_after_logical_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator=insert org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert @@ -281,13 +288,17 @@ org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_relational_operator=insert org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert +org.eclipse.jdt.core.formatter.insert_space_after_shift_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation=insert org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_additive_operator=insert org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_bitwise_operator=insert org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert @@ -335,6 +346,8 @@ org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do no org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_before_logical_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_multiplicative_operator=insert org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert @@ -371,9 +384,12 @@ org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not inser org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_relational_operator=insert org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_shift_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation=insert org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert @@ -423,9 +439,13 @@ org.eclipse.jdt.core.formatter.tabulation.char=tab org.eclipse.jdt.core.formatter.tabulation.size=4 org.eclipse.jdt.core.formatter.use_on_off_tags=true org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false +org.eclipse.jdt.core.formatter.wrap_before_additive_operator=true org.eclipse.jdt.core.formatter.wrap_before_assignment_operator=false -org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true +org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator=true org.eclipse.jdt.core.formatter.wrap_before_conditional_operator=true +org.eclipse.jdt.core.formatter.wrap_before_logical_operator=true +org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator=true org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true +org.eclipse.jdt.core.formatter.wrap_before_string_concatenation=true org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true org.eclipse.jdt.core.javaFormatter=org.eclipse.jdt.core.defaultJavaFormatter diff --git a/com.microsoft.java.lsif.core/META-INF/MANIFEST.MF b/com.microsoft.java.lsif.core/META-INF/MANIFEST.MF index adbc07d..4852171 100644 --- a/com.microsoft.java.lsif.core/META-INF/MANIFEST.MF +++ b/com.microsoft.java.lsif.core/META-INF/MANIFEST.MF @@ -32,6 +32,7 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="3.12.0", Export-Package: com.microsoft.java.lsif.core.internal Bundle-ClassPath: lib/rxjava-2.2.8.jar, lib/reactive-streams-1.0.0.jar, + lib/maven-scm-api-1.11.2.jar, . Bundle-Vendor: %Bundle-Vendor Automatic-Module-Name: org.eclipse.jdt.ls.core diff --git a/com.microsoft.java.lsif.core/pom.xml b/com.microsoft.java.lsif.core/pom.xml index b4c83c5..9ea4727 100644 --- a/com.microsoft.java.lsif.core/pom.xml +++ b/com.microsoft.java.lsif.core/pom.xml @@ -33,6 +33,11 @@ reactive-streams 1.0.0 + + org.apache.maven.scm + maven-scm-api + 1.11.2 + diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Indexer.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Indexer.java index 0093970..afb71b6 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Indexer.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Indexer.java @@ -19,6 +19,7 @@ import org.apache.maven.model.Model; import org.apache.maven.model.Scm; +import org.apache.maven.scm.provider.ScmUrlUtils; import org.eclipse.buildship.core.GradleBuild; import org.eclipse.buildship.core.GradleCore; import org.eclipse.core.resources.IProject; @@ -56,7 +57,6 @@ import com.microsoft.java.lsif.core.internal.emitter.LsifEmitter; import com.microsoft.java.lsif.core.internal.protocol.Document; import com.microsoft.java.lsif.core.internal.protocol.Event; -import com.microsoft.java.lsif.core.internal.protocol.PackageInformation; import com.microsoft.java.lsif.core.internal.protocol.Project; import com.microsoft.java.lsif.core.internal.protocol.PackageInformation.PackageManager; import com.microsoft.java.lsif.core.internal.visitors.DiagnosticVisitor; @@ -147,36 +147,32 @@ private void buildIndex(IPath path, IProgressMonitor monitor, LsifService lsif) String version = model.getVersion(); Scm scm = model.getScm(); String url = ""; + String type = ""; if (scm != null) { url = scm.getUrl(); + type = ScmUrlUtils.getProvider(scm.getConnection()); } if (!groupId.equals("") && !artifactId.equals("") && !version.equals("")) { isPublish = true; - PackageInformation packageInformation = Repository.getInstance().enlistExportPackageInformation( - lsif, javaProject.getPath().toString(), groupId + "/" + artifactId, PackageManager.MAVEN, version, url); - LsifEmitter.getInstance().emit(packageInformation); + Repository.getInstance().enlistPackageInformation(lsif, javaProject.getPath().toString(), groupId + "/" + artifactId, PackageManager.MAVEN, version, type, url); } } } else if (builder == ProjectBuildTool.GRADLE) { - if (proj.isOpen()) { - GradleBuild build = GradleCore.getWorkspace().getBuild(proj).get(); - ProjectPublications model; - try { - model = build.withConnection(connection -> connection.getModel(ProjectPublications.class), monitor); - List publications = model.getPublications().getAll(); - if (publications.size() > 0) { - GradleModuleVersion gradleModuleVersion = publications.get(0).getId(); - String groupId = gradleModuleVersion.getGroup(); - String artifactId = gradleModuleVersion.getName(); - String version = gradleModuleVersion.getVersion(); - isPublish = true; - PackageInformation packageInformation = Repository.getInstance().enlistExportPackageInformation( - lsif, javaProject.getPath().toString(), groupId + "/" + artifactId, PackageManager.GRADLE, version, "url"); - LsifEmitter.getInstance().emit(packageInformation); - } - } catch (Exception e) { - e.printStackTrace(); + GradleBuild build = GradleCore.getWorkspace().getBuild(proj).get(); + ProjectPublications model; + try { + model = build.withConnection(connection -> connection.getModel(ProjectPublications.class), monitor); + List publications = model.getPublications().getAll(); + if (publications.size() > 0) { + GradleModuleVersion gradleModuleVersion = publications.get(0).getId(); + String groupId = gradleModuleVersion.getGroup(); + String artifactId = gradleModuleVersion.getName(); + String version = gradleModuleVersion.getVersion(); + isPublish = true; + Repository.getInstance().enlistPackageInformation(lsif, javaProject.getPath().toString(), groupId + "/" + artifactId, PackageManager.GRADLE, version); } + } catch (Exception e) { + e.printStackTrace(); } } Project projVertex = lsif.getVertexBuilder().project(); diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Repository.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Repository.java index 78736d5..4186ff3 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Repository.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Repository.java @@ -41,15 +41,7 @@ public class Repository { // Key: groupId + artifactId // Value: PackageInformation - private Map importPackageInformationMap = new ConcurrentHashMap<>(); - - // Key: IJavaProject.getPath() - // Value: PackageInformation - private Map exportPackageInformationMap = new ConcurrentHashMap<>(); - - // Key: groupId + artifactId - // Value: isEmitted or not - private Map packageInformationEmittedMap = new ConcurrentHashMap<>(); + private Map packageInformationMap = new ConcurrentHashMap<>(); private Repository() { } @@ -70,17 +62,15 @@ public synchronized Document enlistDocument(LsifService service, String uri, Pro addDocument(targetDocument); LsifEmitter.getInstance().emit(targetDocument); addToBeginededDocuments(targetDocument); - LsifEmitter.getInstance() - .emit(service.getVertexBuilder().event(Event.EventScope.DOCUMENT, Event.EventKind.BEGIN, - targetDocument.getId())); + LsifEmitter.getInstance().emit(service.getVertexBuilder().event(Event.EventScope.DOCUMENT, + Event.EventKind.BEGIN, targetDocument.getId())); LsifEmitter.getInstance().emit(service.getEdgeBuilder().contains(projVertex, targetDocument)); } return targetDocument; } - public synchronized Range enlistRange(LsifService service, Document docVertex, - org.eclipse.lsp4j.Range lspRange) { + public synchronized Range enlistRange(LsifService service, Document docVertex, org.eclipse.lsp4j.Range lspRange) { Range range = findRange(docVertex.getUri(), lspRange); if (range == null) { range = service.getVertexBuilder().range(lspRange); @@ -104,48 +94,31 @@ public synchronized SymbolData enlistSymbolData(String id, Document docVertex, P return symbolData; } - public synchronized PackageInformation enlistImportPackageInformation(LsifService lsif, String id, - String name, PackageManager manager, String version, String url) { - PackageInformation packageInformation = findImportPackageInformationById(id); + public synchronized PackageInformation enlistPackageInformation(LsifService lsif, String id, String name, + PackageManager manager, String version, String type, String url) { + PackageInformation packageInformation = findPackageInformationById(id); if (packageInformation == null) { - if (manager == PackageManager.MAVEN || manager == PackageManager.GRADLE) { - packageInformation = lsif.getVertexBuilder().packageInformation(name, manager, version, "git", url); - } else if (manager == PackageManager.JDK) { - packageInformation = lsif.getVertexBuilder().packageInformation(name, manager, version); - } else { - return packageInformation; + if (name.equals("")) { + return null; } - addImportPackageInformation(id, packageInformation); + packageInformation = lsif.getVertexBuilder().packageInformation(name, manager, version, type, url); + addPackageInformation(id, packageInformation); + LsifEmitter.getInstance().emit(packageInformation); } return packageInformation; } - public synchronized PackageInformation enlistExportPackageInformation(LsifService lsif, String id, String name, - PackageManager manager, String version, String url) { - PackageInformation packageInformation = findExportPackageInformationById(id); + public synchronized PackageInformation enlistPackageInformation(LsifService lsif, String id, String name, + PackageManager manager, String version) { + PackageInformation packageInformation = findPackageInformationById(id); if (packageInformation == null) { - if (manager == PackageManager.MAVEN) { - packageInformation = lsif.getVertexBuilder().packageInformation(name, manager, version, "git", url); - } else if (manager == PackageManager.GRADLE) { - packageInformation = lsif.getVertexBuilder().packageInformation(name, manager, version); - } else { - return packageInformation; - } - addExportPackageInformation(id, packageInformation); + packageInformation = lsif.getVertexBuilder().packageInformation(name, manager, version); + addPackageInformation(id, packageInformation); + LsifEmitter.getInstance().emit(packageInformation); } return packageInformation; } - public synchronized boolean enlistPackageInformationEmitted(String id) { - Boolean result = findPackageInformationEmittedById(id); - if (result == null) { - addPackageInformationEmitted(id); - return false; - } else { - return true; - } - } - public void addToBeginededDocuments(Document doc) { this.beginededDocumentMap.put(doc.getUri(), doc); } @@ -188,27 +161,12 @@ private SymbolData findSymbolDataById(String id) { return this.symbolDataMap.getOrDefault(id, null); } - private PackageInformation findImportPackageInformationById(String id) { - return this.importPackageInformationMap.getOrDefault(id, null); + private PackageInformation findPackageInformationById(String id) { + return this.packageInformationMap.getOrDefault(id, null); } - private void addImportPackageInformation(String id, PackageInformation packageInformation) { - this.importPackageInformationMap.put(id, packageInformation); + private void addPackageInformation(String id, PackageInformation packageInformation) { + this.packageInformationMap.put(id, packageInformation); } - private PackageInformation findExportPackageInformationById(String id) { - return this.exportPackageInformationMap.getOrDefault(id, null); - } - - private void addExportPackageInformation(String id, PackageInformation packageInformation) { - this.exportPackageInformationMap.put(id, packageInformation); - } - - private Boolean findPackageInformationEmittedById(String id) { - return this.packageInformationEmittedMap.getOrDefault(id, null); - } - - private void addPackageInformationEmitted(String id) { - this.packageInformationEmittedMap.put(id, Boolean.valueOf(true)); - } } diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/Moniker.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/Moniker.java index 122ac3f..1287fec 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/Moniker.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/Moniker.java @@ -23,7 +23,7 @@ public String toString() { } public enum MonikerUnique { - PROJECT("project"), SCHEME("scheme"); + GROUP("group"), SCHEME("scheme"); private final String unique; diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/LsifVisitor.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/LsifVisitor.java index 8cf38af..1395833 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/LsifVisitor.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/LsifVisitor.java @@ -5,20 +5,34 @@ package com.microsoft.java.lsif.core.internal.visitors; +import java.io.File; +import java.io.FileReader; +import java.util.ArrayList; +import java.util.List; +import java.util.jar.Attributes; +import java.util.jar.Manifest; + import org.apache.maven.model.Model; +import org.apache.maven.model.Parent; import org.apache.maven.model.Scm; import org.apache.maven.model.io.xpp3.MavenXpp3Reader; +import org.apache.maven.scm.provider.ScmUrlUtils; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.jdt.core.IClassFile; +import org.eclipse.jdt.core.IClasspathEntry; import org.eclipse.jdt.core.ICompilationUnit; +import org.eclipse.jdt.core.IField; import org.eclipse.jdt.core.IJavaElement; -import org.eclipse.jdt.core.IJavaModel; import org.eclipse.jdt.core.IJavaProject; +import org.eclipse.jdt.core.ILocalVariable; +import org.eclipse.jdt.core.IMethod; import org.eclipse.jdt.core.IModuleDescription; import org.eclipse.jdt.core.IPackageFragmentRoot; +import org.eclipse.jdt.core.IType; import org.eclipse.jdt.core.JavaModelException; import org.eclipse.jdt.core.dom.ASTNode; +import org.eclipse.jdt.core.dom.BodyDeclaration; import org.eclipse.jdt.core.dom.EnumConstantDeclaration; import org.eclipse.jdt.core.dom.EnumDeclaration; import org.eclipse.jdt.core.dom.FieldDeclaration; @@ -30,44 +44,25 @@ import org.eclipse.jdt.core.dom.TypeDeclaration; import org.eclipse.jdt.core.dom.VariableDeclarationFragment; import org.eclipse.jdt.core.dom.VariableDeclarationStatement; -import org.eclipse.jdt.internal.compiler.classfmt.ModuleInfo; -import org.eclipse.jdt.internal.compiler.env.IModule; -import org.eclipse.jdt.internal.core.BinaryModule; -import org.eclipse.jdt.internal.core.BinaryType; -import org.eclipse.jdt.internal.core.ClassFile; import org.eclipse.jdt.internal.core.JarPackageFragmentRoot; import org.eclipse.jdt.internal.core.JrtPackageFragmentRoot; -import org.eclipse.jdt.internal.core.LocalVariable; -import org.eclipse.jdt.internal.core.ResolvedBinaryField; -import org.eclipse.jdt.internal.core.ResolvedBinaryMethod; -import org.eclipse.jdt.internal.core.ResolvedBinaryType; -import org.eclipse.jdt.internal.core.SourceField; -import org.eclipse.jdt.internal.core.SourceMethod; -import org.eclipse.jdt.internal.core.SourceType; import org.eclipse.jdt.ls.core.internal.JDTUtils; import org.eclipse.jdt.ls.core.internal.preferences.PreferenceManager; import org.eclipse.lsp4j.Hover; import org.eclipse.lsp4j.Location; -import java.io.File; -import java.io.FileReader; -import java.util.ArrayList; -import java.util.List; -import java.util.jar.Attributes; -import java.util.jar.Manifest; - import com.microsoft.java.lsif.core.internal.JdtlsUtils; import com.microsoft.java.lsif.core.internal.LanguageServerIndexerPlugin; +import com.microsoft.java.lsif.core.internal.indexer.Indexer.ProjectBuildTool; import com.microsoft.java.lsif.core.internal.indexer.IndexerContext; import com.microsoft.java.lsif.core.internal.indexer.LsifService; import com.microsoft.java.lsif.core.internal.indexer.Repository; -import com.microsoft.java.lsif.core.internal.indexer.Indexer.ProjectBuildTool; import com.microsoft.java.lsif.core.internal.protocol.Document; +import com.microsoft.java.lsif.core.internal.protocol.Moniker.MonikerKind; +import com.microsoft.java.lsif.core.internal.protocol.PackageInformation.PackageManager; import com.microsoft.java.lsif.core.internal.protocol.Project; import com.microsoft.java.lsif.core.internal.protocol.Range; import com.microsoft.java.lsif.core.internal.protocol.ResultSet; -import com.microsoft.java.lsif.core.internal.protocol.Moniker.MonikerKind; -import com.microsoft.java.lsif.core.internal.protocol.PackageInformation.PackageManager; public class LsifVisitor extends ProtocolVisitor { @@ -89,14 +84,14 @@ public boolean visit(SimpleName node) { @Override public boolean visit(SingleVariableDeclaration node) { - MonikerKind monikerKind = (node.getModifiers() & Modifier.PUBLIC) > 0 ? MonikerKind.EXPORT : MonikerKind.LOCAL; + MonikerKind monikerKind = getMonikerKind(node); resolve(node.getName().getStartPosition(), node.getName().getLength(), false, monikerKind); return true; } @Override public boolean visit(EnumDeclaration node) { - MonikerKind monikerKind = (node.getModifiers() & Modifier.PUBLIC) > 0 ? MonikerKind.EXPORT : MonikerKind.LOCAL; + MonikerKind monikerKind = getMonikerKind(node); resolve(node.getName().getStartPosition(), node.getName().getLength(), false, monikerKind); return true; } @@ -110,14 +105,14 @@ public boolean visit(EnumConstantDeclaration node) { @Override public boolean visit(TypeDeclaration node) { - MonikerKind monikerKind = (node.getModifiers() & Modifier.PUBLIC) > 0 ? MonikerKind.EXPORT : MonikerKind.LOCAL; + MonikerKind monikerKind = getMonikerKind(node); resolve(node.getName().getStartPosition(), node.getName().getLength(), false, monikerKind); return true; } @Override public boolean visit(MethodDeclaration node) { - MonikerKind monikerKind = (node.getModifiers() & Modifier.PUBLIC) > 0 ? MonikerKind.EXPORT : MonikerKind.LOCAL; + MonikerKind monikerKind = getMonikerKind(node); resolve(node.getName().getStartPosition(), node.getName().getLength(), false, monikerKind); return true; } @@ -126,14 +121,10 @@ public boolean visit(MethodDeclaration node) { public boolean visit(VariableDeclarationFragment node) { ASTNode parent = node.getParent(); if (parent instanceof VariableDeclarationStatement) { - MonikerKind monikerKind = (((VariableDeclarationStatement) parent).getModifiers() & Modifier.PUBLIC) > 0 - ? MonikerKind.EXPORT - : MonikerKind.LOCAL; + MonikerKind monikerKind = getMonikerKind((VariableDeclarationStatement)parent); resolve(node.getName().getStartPosition(), node.getName().getLength(), false, monikerKind); } else if (parent instanceof FieldDeclaration) { - MonikerKind monikerKind = (((FieldDeclaration) parent).getModifiers() & Modifier.PUBLIC) > 0 - ? MonikerKind.EXPORT - : MonikerKind.LOCAL; + MonikerKind monikerKind = getMonikerKind((FieldDeclaration)parent); resolve(node.getName().getStartPosition(), node.getName().getLength(), false, monikerKind); } return true; @@ -183,23 +174,34 @@ private void resolve(int startPosition, int length, boolean needResolveImpl, Mon String groupId = ""; String artifactId = ""; String version = ""; + String type = ""; String url = ""; if (compilationUnit == null && cf != null) { IPath path = cf.getPath(); IPackageFragmentRoot root = javaproject.findPackageFragmentRoot(path); - if (root instanceof JrtPackageFragmentRoot) { - Manifest manifest = ((JrtPackageFragmentRoot) root).getManifest(); - Attributes attributes = manifest.getMainAttributes(); - String ver = attributes.getValue("Implementation-Version"); - if (ver != null) { - version = ver; + IClasspathEntry container = root.getRawClasspathEntry(); + IPath containerPath = container.getPath(); + String pathName = containerPath.toString(); + if (pathName.startsWith("org.eclipse.jdt.launching.JRE_CONTAINER")) { + // JDK Library + manager = PackageManager.JDK; + Manifest manifest = new Manifest(); + if (root instanceof JrtPackageFragmentRoot) { + // For JDK 9+ + manifest = ((JrtPackageFragmentRoot) root).getManifest(); + IModuleDescription moduleDescription = ((JrtPackageFragmentRoot) root).getAutomaticModuleDescription(); + groupId = moduleDescription.getElementName(); + } else if (root instanceof JarPackageFragmentRoot) { + // For JDK 8- + manifest = ((JarPackageFragmentRoot) root).getManifest(); + IModuleDescription moduleDescription = ((JarPackageFragmentRoot) root).getAutomaticModuleDescription(); + groupId = moduleDescription.getElementName(); } - IModuleDescription moduleDescription = ((JrtPackageFragmentRoot) root).getModuleDescription(); - if (moduleDescription instanceof BinaryModule) { - groupId = ((BinaryModule) moduleDescription).getElementName(); + if (manifest != null) { + Attributes attributes = manifest.getMainAttributes(); + version = attributes.getValue("Implementation-Version"); } - manager = PackageManager.JDK; - } else if (root instanceof JarPackageFragmentRoot) { + } else { List fileList = new ArrayList<>(); if (builder == ProjectBuildTool.MAVEN) { findPomFile(path.removeLastSegments(1).toFile(), fileList); @@ -214,9 +216,22 @@ private void resolve(int startPosition, int length, boolean needResolveImpl, Mon groupId = model.getGroupId(); artifactId = model.getArtifactId(); version = model.getVersion(); + Parent parent = model.getParent(); + if (parent != null) { + if (groupId == null) { + groupId = parent.getGroupId(); + } + if (artifactId == null) { + artifactId = parent.getArtifactId(); + } + if (version == null) { + version = parent.getVersion(); + } + } Scm scm = model.getScm(); if (scm != null) { url = scm.getUrl(); + type = ScmUrlUtils.getProvider(scm.getConnection()); } } } @@ -225,11 +240,7 @@ private void resolve(int startPosition, int length, boolean needResolveImpl, Mon if (manager == PackageManager.MAVEN || manager == PackageManager.GRADLE) { schemeId = groupId + "/" + artifactId; } else if (manager == PackageManager.JDK) { - if (cf instanceof ClassFile) { - schemeId = cf.getParent().getElementName() + "." + ((ClassFile) cf).getName(); - } else { - schemeId = cf.getParent().getElementName() + "." + cf.getElementName(); - } + schemeId = groupId; } // Export Monikers @@ -254,12 +265,14 @@ private void resolve(int startPosition, int length, boolean needResolveImpl, Mon // Do nothing } /* Generate Moniker */ - if (monikerKind == MonikerKind.EXPORT) { - symbolData.generateMonikerExport(lsif, sourceRange, identifier, manager, javaproject); - } else if (monikerKind == MonikerKind.LOCAL) { - symbolData.generateMonikerLocal(lsif, sourceRange, identifier); - } else if (definitionLocation.getUri().startsWith("jdt")) { - symbolData.generateMonikerImport(lsif, sourceRange, identifier, schemeId, manager, version, url); + if (identifier != null && groupId != null && artifactId != null && version != null) { + if (monikerKind == MonikerKind.EXPORT) { + symbolData.generateMonikerExport(lsif, sourceRange, identifier, manager, javaproject); + } else if (monikerKind == MonikerKind.LOCAL) { + symbolData.generateMonikerLocal(lsif, sourceRange, identifier); + } else if (definitionLocation.getUri().startsWith("jdt")) { + symbolData.generateMonikerImport(lsif, sourceRange, identifier, schemeId, manager, version, type, url); + } } /* Resolve definition */ @@ -285,28 +298,28 @@ private void resolve(int startPosition, int length, boolean needResolveImpl, Mon private String getMonikerIdentifier(IJavaElement element) throws JavaModelException { String identifier = element.getElementName(); - if (element instanceof SourceType) { - return ((SourceType) element).getFullyQualifiedName(); - } else if (element instanceof BinaryType) { - return ((BinaryType) element).getFullyQualifiedName(); - } else if (element instanceof SourceField) { - return getMonikerIdentifier(element.getParent()) + "/" + identifier; - } else if (element instanceof SourceMethod) { - return getMonikerIdentifier(element.getParent()) + "/" + identifier + ":" - + ((SourceMethod) element).getSignature(); - } else if (element instanceof LocalVariable) { - return getMonikerIdentifier(element.getParent()) + "/" + identifier; - } else if (element instanceof ResolvedBinaryType) { - return ((ResolvedBinaryType) element).getFullyQualifiedName(); - } else if (element instanceof ResolvedBinaryMethod) { - return getMonikerIdentifier(element.getParent()) + "/" + identifier + ":" - + ((ResolvedBinaryMethod) element).getSignature(); - } else if (element instanceof ResolvedBinaryField) { + if (element instanceof IType) { + return ((IType)element).getFullyQualifiedName(); + } else if (element instanceof IField || element instanceof ILocalVariable) { return getMonikerIdentifier(element.getParent()) + "/" + identifier; + } else if (element instanceof IMethod) { + return getMonikerIdentifier(element.getParent()) + "/" + identifier + ":" + ((IMethod) element).getSignature(); } return identifier; } + private MonikerKind getMonikerKind(BodyDeclaration node) { + return (node.getModifiers() & Modifier.PUBLIC) > 0 ? MonikerKind.EXPORT : MonikerKind.LOCAL; + } + + private MonikerKind getMonikerKind(SingleVariableDeclaration node) { + return (node.getModifiers() & Modifier.PUBLIC) > 0 ? MonikerKind.EXPORT : MonikerKind.LOCAL; + } + + private MonikerKind getMonikerKind(VariableDeclarationStatement node) { + return (node.getModifiers() & Modifier.PUBLIC) > 0 ? MonikerKind.EXPORT : MonikerKind.LOCAL; + } + private boolean isTypeOrMethodDeclaration(ASTNode node) { return node.getParent() instanceof TypeDeclaration || node.getParent() instanceof MethodDeclaration; } diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/SymbolData.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/SymbolData.java index 46870a5..23ecd6b 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/SymbolData.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/SymbolData.java @@ -36,7 +36,7 @@ public class SymbolData { private Document document; private ResultSet resultSet; private ReferenceResult referenceResult; - private Moniker projectMoniker; + private Moniker groupMoniker; private Moniker schemeMoniker; private boolean definitionResolved; private boolean typeDefinitionResolved; @@ -57,55 +57,52 @@ synchronized public void ensureResultSet(LsifService lsif, Range sourceRange) { LsifEmitter.getInstance().emit(lsif.getEdgeBuilder().next(sourceRange, this.resultSet)); } - synchronized public void generateMonikerImport(LsifService lsif, Range sourceRange, String identifier, String schemeId, PackageManager manager, String version, String url) { - if (this.resultSet == null || this.projectMoniker != null || this.schemeMoniker != null) { + synchronized public void generateMonikerImport(LsifService lsif, Range sourceRange, String identifier, String schemeId, PackageManager manager, String version, String type, String url) { + if (this.resultSet == null || this.groupMoniker != null || this.schemeMoniker != null) { return; } - Moniker projectMoniker = lsif.getVertexBuilder().moniker(MonikerKind.IMPORT, "jdt", identifier, MonikerUnique.PROJECT); - LsifEmitter.getInstance().emit(projectMoniker); - this.projectMoniker = projectMoniker; - LsifEmitter.getInstance().emit(lsif.getEdgeBuilder().moniker(this.resultSet, this.projectMoniker)); + Moniker groupMoniker = lsif.getVertexBuilder().moniker(MonikerKind.IMPORT, "jdt", identifier, MonikerUnique.GROUP); + LsifEmitter.getInstance().emit(groupMoniker); + this.groupMoniker = groupMoniker; + LsifEmitter.getInstance().emit(lsif.getEdgeBuilder().moniker(this.resultSet, this.groupMoniker)); if (manager == null) { return; } - PackageInformation packageInformation = Repository.getInstance().enlistImportPackageInformation(lsif, schemeId, schemeId, manager, version, url); + PackageInformation packageInformation = (manager == PackageManager.JDK) + ? Repository.getInstance().enlistPackageInformation(lsif, schemeId, schemeId, manager, version) + : Repository.getInstance().enlistPackageInformation(lsif, schemeId, schemeId, manager, version, type, url); if (packageInformation == null) { return; } - if (!Repository.getInstance().enlistPackageInformationEmitted(schemeId)) { - LsifEmitter.getInstance().emit(packageInformation); - } - Moniker schemeMoniker = (manager == PackageManager.JDK) - ? lsif.getVertexBuilder().moniker(MonikerKind.IMPORT, manager.toString(), identifier, MonikerUnique.SCHEME) - : lsif.getVertexBuilder().moniker(MonikerKind.IMPORT, manager.toString(), packageInformation.getName() + "/" + identifier, MonikerUnique.SCHEME); + Moniker schemeMoniker = lsif.getVertexBuilder().moniker(MonikerKind.IMPORT, manager.toString(), packageInformation.getName() + "/" + identifier, MonikerUnique.SCHEME); LsifEmitter.getInstance().emit(schemeMoniker); this.schemeMoniker = schemeMoniker; LsifEmitter.getInstance().emit(lsif.getEdgeBuilder().packageInformation(this.schemeMoniker, packageInformation)); - LsifEmitter.getInstance().emit(lsif.getEdgeBuilder().attach(this.schemeMoniker, this.projectMoniker)); + LsifEmitter.getInstance().emit(lsif.getEdgeBuilder().attach(this.schemeMoniker, this.groupMoniker)); } synchronized public void generateMonikerLocal(LsifService lsif, Range sourceRange, String identifier) { - if (this.resultSet == null || this.projectMoniker != null || this.schemeMoniker != null) { + if (this.resultSet == null || this.groupMoniker != null || this.schemeMoniker != null) { return; } - Moniker projectMoniker = lsif.getVertexBuilder().moniker(MonikerKind.LOCAL, "jdt", identifier, MonikerUnique.PROJECT); - LsifEmitter.getInstance().emit(projectMoniker); - this.projectMoniker = projectMoniker; - LsifEmitter.getInstance().emit(lsif.getEdgeBuilder().moniker(this.resultSet, this.projectMoniker)); + Moniker groupMoniker = lsif.getVertexBuilder().moniker(MonikerKind.LOCAL, "jdt", identifier, MonikerUnique.GROUP); + LsifEmitter.getInstance().emit(groupMoniker); + this.groupMoniker = groupMoniker; + LsifEmitter.getInstance().emit(lsif.getEdgeBuilder().moniker(this.resultSet, this.groupMoniker)); } synchronized public void generateMonikerExport(LsifService lsif, Range sourceRange, String identifier, PackageManager manager, IJavaProject javaproject) { - if (this.resultSet == null || this.projectMoniker != null || this.schemeMoniker != null) { + if (this.resultSet == null || this.groupMoniker != null || this.schemeMoniker != null) { return; } - Moniker projectMoniker = lsif.getVertexBuilder().moniker(MonikerKind.EXPORT, "jdt", identifier, MonikerUnique.PROJECT); - LsifEmitter.getInstance().emit(projectMoniker); - this.projectMoniker = projectMoniker; - LsifEmitter.getInstance().emit(lsif.getEdgeBuilder().moniker(this.resultSet, this.projectMoniker)); + Moniker groupMoniker = lsif.getVertexBuilder().moniker(MonikerKind.EXPORT, "jdt", identifier, MonikerUnique.GROUP); + LsifEmitter.getInstance().emit(groupMoniker); + this.groupMoniker = groupMoniker; + LsifEmitter.getInstance().emit(lsif.getEdgeBuilder().moniker(this.resultSet, this.groupMoniker)); if (manager == null) { return; } - PackageInformation packageInformation = Repository.getInstance().enlistExportPackageInformation(lsif, javaproject.getPath().toString(), "", manager, "", ""); + PackageInformation packageInformation = Repository.getInstance().enlistPackageInformation(lsif, javaproject.getPath().toString(), "", manager, "", "", ""); if (packageInformation == null) { return; } @@ -113,7 +110,7 @@ synchronized public void generateMonikerExport(LsifService lsif, Range sourceRan LsifEmitter.getInstance().emit(schemeMoniker); this.schemeMoniker = schemeMoniker; LsifEmitter.getInstance().emit(lsif.getEdgeBuilder().packageInformation(this.schemeMoniker, packageInformation)); - LsifEmitter.getInstance().emit(lsif.getEdgeBuilder().attach(this.schemeMoniker, this.projectMoniker)); + LsifEmitter.getInstance().emit(lsif.getEdgeBuilder().attach(this.schemeMoniker, this.groupMoniker)); } synchronized public void resolveDefinition(LsifService lsif, Location definitionLocation) { diff --git a/pom.xml b/pom.xml index 07a67a9..06a641f 100644 --- a/pom.xml +++ b/pom.xml @@ -64,7 +64,7 @@ false ${basedir}/lib/ - true From 726779c8429950c24d41868259937ea272c26d87 Mon Sep 17 00:00:00 2001 From: CS <45906942+CsCherrYY@users.noreply.github.com> Date: Fri, 21 Aug 2020 16:58:36 +0800 Subject: [PATCH 10/18] Apply changes 1. handle together for different JDK distributions 2. Use `IMaven.readProject` to get effective pom information --- .../lsif/core/internal/indexer/Indexer.java | 56 +++++---- .../internal/indexer/ProjectBuildTool.java | 10 ++ .../core/internal/indexer/Repository.java | 43 +++++-- .../core/internal/indexer/VertexBuilder.java | 4 - .../internal/protocol/PackageInformation.java | 9 +- .../core/internal/visitors/LsifVisitor.java | 115 ++++++++---------- 6 files changed, 125 insertions(+), 112 deletions(-) create mode 100644 com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/ProjectBuildTool.java diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Indexer.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Indexer.java index afb71b6..244a377 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Indexer.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Indexer.java @@ -13,12 +13,14 @@ import java.util.LinkedList; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import org.apache.maven.model.Model; import org.apache.maven.model.Scm; +import org.apache.maven.project.MavenProject; import org.apache.maven.scm.provider.ScmUrlUtils; import org.eclipse.buildship.core.GradleBuild; import org.eclipse.buildship.core.GradleCore; @@ -42,7 +44,6 @@ import org.eclipse.jdt.ls.core.internal.IProjectImporter; import org.eclipse.jdt.ls.core.internal.JavaLanguageServerPlugin; import org.eclipse.jdt.ls.core.internal.ResourceUtils; -import org.eclipse.jdt.ls.core.internal.managers.EclipseProjectImporter; import org.eclipse.jdt.ls.core.internal.managers.GradleProjectImporter; import org.eclipse.jdt.ls.core.internal.managers.MavenProjectImporter; import org.eclipse.lsp4j.ClientCapabilities; @@ -71,10 +72,6 @@ public class Indexer { private WorkspaceHandler handler; - public enum ProjectBuildTool { - MAVEN, GRADLE, ECLIPSE, INVISIBLE; - } - public Indexer() { String repoPath = System.getProperty("repo.path"); if (repoPath == null) { @@ -129,10 +126,8 @@ private void buildIndex(IPath path, IProgressMonitor monitor, LsifService lsif) builder = ProjectBuildTool.MAVEN; } else if (importer instanceof GradleProjectImporter) { builder = ProjectBuildTool.GRADLE; - } else if (importer instanceof EclipseProjectImporter) { - builder = ProjectBuildTool.ECLIPSE; } else { - builder = ProjectBuildTool.INVISIBLE; + break; } } catch (CoreException e) { e.printStackTrace(); @@ -141,20 +136,25 @@ private void buildIndex(IPath path, IProgressMonitor monitor, LsifService lsif) if (builder == ProjectBuildTool.MAVEN) { Set infoSet = collectMavenProjectInfo(monitor, path); for (MavenProjectInfo mavenProjectInfo : infoSet) { - Model model = mavenProjectInfo.getModel(); - String groupId = model.getGroupId(); - String artifactId = model.getArtifactId(); - String version = model.getVersion(); - Scm scm = model.getScm(); - String url = ""; - String type = ""; - if (scm != null) { - url = scm.getUrl(); - type = ScmUrlUtils.getProvider(scm.getConnection()); - } - if (!groupId.equals("") && !artifactId.equals("") && !version.equals("")) { - isPublish = true; - Repository.getInstance().enlistPackageInformation(lsif, javaProject.getPath().toString(), groupId + "/" + artifactId, PackageManager.MAVEN, version, type, url); + MavenProject mavenProject = Repository.getInstance().enlistMavenProject(lsif, mavenProjectInfo.getPomFile()); + if (mavenProject != null) { + Model model = mavenProject.getModel(); + String groupId = model.getGroupId(); + String artifactId = model.getArtifactId(); + String version = model.getVersion(); + Scm scm = model.getScm(); + String url = null; + String type = null; + if (scm != null) { + url = scm.getUrl(); + type = ScmUrlUtils.getProvider(scm.getConnection()); + } + if (!Objects.equals(groupId, "") && !Objects.equals(artifactId, "") + && !Objects.equals(version, "")) { + isPublish = true; + Repository.getInstance().enlistPackageInformation(lsif, javaProject.getPath().toString(), + groupId + "/" + artifactId, PackageManager.MAVEN, version, type, url); + } } } } else if (builder == ProjectBuildTool.GRADLE) { @@ -168,8 +168,12 @@ private void buildIndex(IPath path, IProgressMonitor monitor, LsifService lsif) String groupId = gradleModuleVersion.getGroup(); String artifactId = gradleModuleVersion.getName(); String version = gradleModuleVersion.getVersion(); - isPublish = true; - Repository.getInstance().enlistPackageInformation(lsif, javaProject.getPath().toString(), groupId + "/" + artifactId, PackageManager.GRADLE, version); + if (!Objects.equals(groupId, "") && !Objects.equals(artifactId, "") + && !Objects.equals(version, "")) { + isPublish = true; + Repository.getInstance().enlistPackageInformation(lsif, javaProject.getPath().toString(), + groupId + "/" + artifactId, PackageManager.GRADLE, version); + } } } catch (Exception e) { e.printStackTrace(); @@ -182,7 +186,7 @@ private void buildIndex(IPath path, IProgressMonitor monitor, LsifService lsif) List sourceList = getAllSourceFiles(javaProject); - dumpParallely(sourceList, threadPool, projVertex, lsif, builder, isPublish, monitor); + dumpParallelly(sourceList, threadPool, projVertex, lsif, builder, isPublish, monitor); VisitorUtils.endAllDocument(lsif); LsifEmitter.getInstance().emit( @@ -222,7 +226,7 @@ private List getAllSourceFiles(IJavaProject javaProject) throw return res; } - private void dumpParallely(List sourceList, ExecutorService threadPool, Project projVertex, + private void dumpParallelly(List sourceList, ExecutorService threadPool, Project projVertex, LsifService lsif, ProjectBuildTool builder, boolean isPublish, IProgressMonitor monitor) { Observable.fromIterable(sourceList) .flatMap(item -> Observable.just(item).observeOn(Schedulers.from(threadPool)).map(sourceFile -> { diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/ProjectBuildTool.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/ProjectBuildTool.java new file mode 100644 index 0000000..48d90a2 --- /dev/null +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/ProjectBuildTool.java @@ -0,0 +1,10 @@ +/* -------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * ------------------------------------------------------------------------------------------ */ + +package com.microsoft.java.lsif.core.internal.indexer; + +public enum ProjectBuildTool { + MAVEN, GRADLE; +} diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Repository.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Repository.java index 4186ff3..603e744 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Repository.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Repository.java @@ -5,8 +5,10 @@ package com.microsoft.java.lsif.core.internal.indexer; +import java.io.File; import java.util.ArrayList; import java.util.Map; +import java.util.Objects; import java.util.concurrent.ConcurrentHashMap; import com.microsoft.java.lsif.core.internal.LsifUtils; @@ -19,6 +21,12 @@ import com.microsoft.java.lsif.core.internal.protocol.PackageInformation.PackageManager; import com.microsoft.java.lsif.core.internal.visitors.SymbolData; +import org.apache.maven.project.MavenProject; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.m2e.core.MavenPlugin; +import org.eclipse.m2e.core.embedder.IMaven; + public class Repository { // Key: document URI @@ -43,6 +51,10 @@ public class Repository { // Value: PackageInformation private Map packageInformationMap = new ConcurrentHashMap<>(); + // Key: pomFile path + // Value: PackageInformation + private Map mavenProjectMap = new ConcurrentHashMap<>(); + private Repository() { } @@ -98,7 +110,7 @@ public synchronized PackageInformation enlistPackageInformation(LsifService lsif PackageManager manager, String version, String type, String url) { PackageInformation packageInformation = findPackageInformationById(id); if (packageInformation == null) { - if (name.equals("")) { + if (Objects.equals(name, "")) { return null; } packageInformation = lsif.getVertexBuilder().packageInformation(name, manager, version, type, url); @@ -110,13 +122,22 @@ public synchronized PackageInformation enlistPackageInformation(LsifService lsif public synchronized PackageInformation enlistPackageInformation(LsifService lsif, String id, String name, PackageManager manager, String version) { - PackageInformation packageInformation = findPackageInformationById(id); - if (packageInformation == null) { - packageInformation = lsif.getVertexBuilder().packageInformation(name, manager, version); - addPackageInformation(id, packageInformation); - LsifEmitter.getInstance().emit(packageInformation); + return enlistPackageInformation(lsif, id, name, manager, version, null, null); + } + + public synchronized MavenProject enlistMavenProject(LsifService lsif, File pomFile) { + MavenProject mavenProject = findMavenProjectByPath(pomFile.getAbsolutePath()); + if (mavenProject == null) { + IMaven maven = MavenPlugin.getMaven(); + NullProgressMonitor monitor = new NullProgressMonitor(); + try { + mavenProject = maven.readProject(pomFile, monitor); + addMavenProject(pomFile.getAbsolutePath(), mavenProject); + } catch (CoreException ce) { + ce.printStackTrace(); + } } - return packageInformation; + return mavenProject; } public void addToBeginededDocuments(Document doc) { @@ -169,4 +190,12 @@ private void addPackageInformation(String id, PackageInformation packageInformat this.packageInformationMap.put(id, packageInformation); } + private MavenProject findMavenProjectByPath(String path) { + return this.mavenProjectMap.getOrDefault(path, null); + } + + private void addMavenProject(String id, MavenProject mavenProject) { + this.mavenProjectMap.put(id, mavenProject); + } + } diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/VertexBuilder.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/VertexBuilder.java index ac80b7e..fbb3766 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/VertexBuilder.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/VertexBuilder.java @@ -103,8 +103,4 @@ public Moniker moniker(MonikerKind kind, String scheme, String identifier, Monik public PackageInformation packageInformation(String name, PackageManager manager, String version, String type, String url) { return new PackageInformation(generator.next(), name, manager, version, type, url); } - - public PackageInformation packageInformation(String name, PackageManager manager, String version) { - return new PackageInformation(generator.next(), name, manager, version); - } } diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/PackageInformation.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/PackageInformation.java index b657cd6..39c77a5 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/PackageInformation.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/PackageInformation.java @@ -35,18 +35,11 @@ public PackageInformation(String id, String name, PackageManager manager, String this.name = name; this.manager = manager.toString(); this.version = version; - if (!url.equals("")) { + if (type != null && type != "" && url != null && url != "") { this.repository = new Repo(type, url); } } - public PackageInformation(String id, String name, PackageManager manager, String version) { - super(id, Vertex.PACKAGEINFORMATION); - this.name = name; - this.manager = manager.toString(); - this.version = version; - } - public class Repo { private String type; diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/LsifVisitor.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/LsifVisitor.java index 1395833..57f5556 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/LsifVisitor.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/LsifVisitor.java @@ -6,22 +6,17 @@ package com.microsoft.java.lsif.core.internal.visitors; import java.io.File; -import java.io.FileReader; -import java.util.ArrayList; -import java.util.List; import java.util.jar.Attributes; import java.util.jar.Manifest; import org.apache.maven.model.Model; -import org.apache.maven.model.Parent; import org.apache.maven.model.Scm; -import org.apache.maven.model.io.xpp3.MavenXpp3Reader; +import org.apache.maven.project.MavenProject; import org.apache.maven.scm.provider.ScmUrlUtils; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.jdt.core.IClassFile; import org.eclipse.jdt.core.IClasspathEntry; -import org.eclipse.jdt.core.ICompilationUnit; import org.eclipse.jdt.core.IField; import org.eclipse.jdt.core.IJavaElement; import org.eclipse.jdt.core.IJavaProject; @@ -45,7 +40,8 @@ import org.eclipse.jdt.core.dom.VariableDeclarationFragment; import org.eclipse.jdt.core.dom.VariableDeclarationStatement; import org.eclipse.jdt.internal.core.JarPackageFragmentRoot; -import org.eclipse.jdt.internal.core.JrtPackageFragmentRoot; +import org.eclipse.jdt.internal.core.PackageFragmentRoot; +import org.eclipse.jdt.launching.JavaRuntime; import org.eclipse.jdt.ls.core.internal.JDTUtils; import org.eclipse.jdt.ls.core.internal.preferences.PreferenceManager; import org.eclipse.lsp4j.Hover; @@ -53,9 +49,9 @@ import com.microsoft.java.lsif.core.internal.JdtlsUtils; import com.microsoft.java.lsif.core.internal.LanguageServerIndexerPlugin; -import com.microsoft.java.lsif.core.internal.indexer.Indexer.ProjectBuildTool; import com.microsoft.java.lsif.core.internal.indexer.IndexerContext; import com.microsoft.java.lsif.core.internal.indexer.LsifService; +import com.microsoft.java.lsif.core.internal.indexer.ProjectBuildTool; import com.microsoft.java.lsif.core.internal.indexer.Repository; import com.microsoft.java.lsif.core.internal.protocol.Document; import com.microsoft.java.lsif.core.internal.protocol.Moniker.MonikerKind; @@ -121,10 +117,10 @@ public boolean visit(MethodDeclaration node) { public boolean visit(VariableDeclarationFragment node) { ASTNode parent = node.getParent(); if (parent instanceof VariableDeclarationStatement) { - MonikerKind monikerKind = getMonikerKind((VariableDeclarationStatement)parent); + MonikerKind monikerKind = getMonikerKind((VariableDeclarationStatement) parent); resolve(node.getName().getStartPosition(), node.getName().getLength(), false, monikerKind); } else if (parent instanceof FieldDeclaration) { - MonikerKind monikerKind = getMonikerKind((FieldDeclaration)parent); + MonikerKind monikerKind = getMonikerKind((FieldDeclaration) parent); resolve(node.getName().getStartPosition(), node.getName().getLength(), false, monikerKind); } return true; @@ -168,80 +164,61 @@ private void resolve(int startPosition, int length, boolean needResolveImpl, Mon // Import Monikers IJavaProject javaproject = element.getJavaProject(); - ICompilationUnit compilationUnit = (ICompilationUnit) element.getAncestor(IJavaElement.COMPILATION_UNIT); IClassFile cf = (IClassFile) element.getAncestor(IJavaElement.CLASS_FILE); PackageManager manager = null; - String groupId = ""; - String artifactId = ""; + String schemeId = ""; String version = ""; String type = ""; String url = ""; - if (compilationUnit == null && cf != null) { + if (cf != null) { IPath path = cf.getPath(); IPackageFragmentRoot root = javaproject.findPackageFragmentRoot(path); IClasspathEntry container = root.getRawClasspathEntry(); IPath containerPath = container.getPath(); String pathName = containerPath.toString(); - if (pathName.startsWith("org.eclipse.jdt.launching.JRE_CONTAINER")) { + if (pathName.startsWith(JavaRuntime.JRE_CONTAINER)) { // JDK Library manager = PackageManager.JDK; Manifest manifest = new Manifest(); - if (root instanceof JrtPackageFragmentRoot) { - // For JDK 9+ - manifest = ((JrtPackageFragmentRoot) root).getManifest(); - IModuleDescription moduleDescription = ((JrtPackageFragmentRoot) root).getAutomaticModuleDescription(); - groupId = moduleDescription.getElementName(); - } else if (root instanceof JarPackageFragmentRoot) { - // For JDK 8- + if (root instanceof JarPackageFragmentRoot) { manifest = ((JarPackageFragmentRoot) root).getManifest(); - IModuleDescription moduleDescription = ((JarPackageFragmentRoot) root).getAutomaticModuleDescription(); - groupId = moduleDescription.getElementName(); + if (manifest != null) { + Attributes attributes = manifest.getMainAttributes(); + version = attributes.getValue("Implementation-Version"); + } } - if (manifest != null) { - Attributes attributes = manifest.getMainAttributes(); - version = attributes.getValue("Implementation-Version"); + PackageFragmentRoot packageFragmentRoot = (PackageFragmentRoot) cf.getAncestor(IJavaElement.PACKAGE_FRAGMENT_ROOT); + if (packageFragmentRoot != null) { + IModuleDescription moduleDescription = packageFragmentRoot.getAutomaticModuleDescription(); + schemeId = moduleDescription.getElementName(); } } else { - List fileList = new ArrayList<>(); + File pomFile = null; if (builder == ProjectBuildTool.MAVEN) { - findPomFile(path.removeLastSegments(1).toFile(), fileList); + pomFile = findPomFile(path.removeLastSegments(1).toFile()); } else if (builder == ProjectBuildTool.GRADLE) { - findPomFile(path.removeLastSegments(2).toFile(), fileList); + pomFile = findPomFile(path.removeLastSegments(2).toFile()); } - if (fileList.size() > 0) { + if (pomFile != null) { manager = (builder == ProjectBuildTool.MAVEN) ? PackageManager.MAVEN : PackageManager.GRADLE; - File file = fileList.get(0); - MavenXpp3Reader reader = new MavenXpp3Reader(); - Model model = reader.read(new FileReader(file.getAbsolutePath())); - groupId = model.getGroupId(); - artifactId = model.getArtifactId(); - version = model.getVersion(); - Parent parent = model.getParent(); - if (parent != null) { - if (groupId == null) { - groupId = parent.getGroupId(); + MavenProject mavenProject = Repository.getInstance().enlistMavenProject(lsif, pomFile); + if (mavenProject != null) { + Model model = mavenProject.getModel(); + String groupId = model.getGroupId(); + String artifactId = model.getArtifactId(); + if (groupId != null && artifactId != null) { + schemeId = groupId + "/" + artifactId; } - if (artifactId == null) { - artifactId = parent.getArtifactId(); + version = model.getVersion(); + Scm scm = model.getScm(); + if (scm != null) { + url = scm.getUrl(); + type = ScmUrlUtils.getProvider(scm.getConnection()); } - if (version == null) { - version = parent.getVersion(); - } - } - Scm scm = model.getScm(); - if (scm != null) { - url = scm.getUrl(); - type = ScmUrlUtils.getProvider(scm.getConnection()); } } } } - String schemeId = ""; - if (manager == PackageManager.MAVEN || manager == PackageManager.GRADLE) { - schemeId = groupId + "/" + artifactId; - } else if (manager == PackageManager.JDK) { - schemeId = groupId; - } // Export Monikers if (monikerKind == MonikerKind.EXPORT && this.isPublish) { @@ -265,7 +242,7 @@ private void resolve(int startPosition, int length, boolean needResolveImpl, Mon // Do nothing } /* Generate Moniker */ - if (identifier != null && groupId != null && artifactId != null && version != null) { + if (identifier != null && schemeId != null && version != null) { if (monikerKind == MonikerKind.EXPORT) { symbolData.generateMonikerExport(lsif, sourceRange, identifier, manager, javaproject); } else if (monikerKind == MonikerKind.LOCAL) { @@ -299,11 +276,12 @@ private void resolve(int startPosition, int length, boolean needResolveImpl, Mon private String getMonikerIdentifier(IJavaElement element) throws JavaModelException { String identifier = element.getElementName(); if (element instanceof IType) { - return ((IType)element).getFullyQualifiedName(); + return ((IType) element).getFullyQualifiedName(); } else if (element instanceof IField || element instanceof ILocalVariable) { return getMonikerIdentifier(element.getParent()) + "/" + identifier; } else if (element instanceof IMethod) { - return getMonikerIdentifier(element.getParent()) + "/" + identifier + ":" + ((IMethod) element).getSignature(); + return getMonikerIdentifier(element.getParent()) + "/" + identifier + ":" + + ((IMethod) element).getSignature(); } return identifier; } @@ -324,14 +302,17 @@ private boolean isTypeOrMethodDeclaration(ASTNode node) { return node.getParent() instanceof TypeDeclaration || node.getParent() instanceof MethodDeclaration; } - private static void findPomFile(File file, List fileList) { - File[] files = file.listFiles(); - for (File subfile : files) { - if (subfile.isDirectory()) { - findPomFile(subfile, fileList); - } else if (subfile.getName().endsWith(".pom")) { - fileList.add(subfile); + private static File findPomFile(File folder) { + for (File file : folder.listFiles()) { + if (file.getName().endsWith(".pom")) { + return file; + } else if (file.isDirectory()) { + File subFile = findPomFile(file); + if (subFile != null) { + return subFile; + } } } + return null; } } From 00b55ac27557337b407948c26d3bd4c4a4833c58 Mon Sep 17 00:00:00 2001 From: CS <45906942+CsCherrYY@users.noreply.github.com> Date: Tue, 25 Aug 2020 14:32:23 +0800 Subject: [PATCH 11/18] Apply changes 1. Remove useless `ProjectBuildTool` and unified all the manager to `maven` 2. Rewrite logic of finding pom and export monikers of maven project. 3. other fix --- .../lsif/core/internal/indexer/Indexer.java | 117 +++------- .../internal/indexer/ProjectBuildTool.java | 10 - .../core/internal/indexer/Repository.java | 21 +- .../internal/protocol/PackageInformation.java | 4 +- .../core/internal/visitors/LsifVisitor.java | 206 ++++++++++-------- .../core/internal/visitors/SymbolData.java | 6 +- 6 files changed, 168 insertions(+), 196 deletions(-) delete mode 100644 com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/ProjectBuildTool.java diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Indexer.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Indexer.java index 244a377..f3b4e77 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Indexer.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Indexer.java @@ -6,15 +6,10 @@ package com.microsoft.java.lsif.core.internal.indexer; import java.io.File; -import java.util.Collection; -import java.util.Collections; import java.util.HashMap; -import java.util.LinkedHashSet; import java.util.LinkedList; import java.util.List; import java.util.Map; -import java.util.Objects; -import java.util.Set; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; @@ -22,6 +17,7 @@ import org.apache.maven.model.Scm; import org.apache.maven.project.MavenProject; import org.apache.maven.scm.provider.ScmUrlUtils; +import org.apache.maven.shared.utils.StringUtils; import org.eclipse.buildship.core.GradleBuild; import org.eclipse.buildship.core.GradleCore; import org.eclipse.core.resources.IProject; @@ -30,7 +26,6 @@ import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.OperationCanceledException; import org.eclipse.jdt.core.IClasspathEntry; import org.eclipse.jdt.core.ICompilationUnit; import org.eclipse.jdt.core.IJavaElement; @@ -47,10 +42,6 @@ import org.eclipse.jdt.ls.core.internal.managers.GradleProjectImporter; import org.eclipse.jdt.ls.core.internal.managers.MavenProjectImporter; import org.eclipse.lsp4j.ClientCapabilities; -import org.eclipse.m2e.core.MavenPlugin; -import org.eclipse.m2e.core.embedder.MavenModelManager; -import org.eclipse.m2e.core.project.LocalProjectScanner; -import org.eclipse.m2e.core.project.MavenProjectInfo; import org.gradle.tooling.model.GradleModuleVersion; import org.gradle.tooling.model.gradle.GradlePublication; import org.gradle.tooling.model.gradle.ProjectPublications; @@ -115,7 +106,7 @@ private void buildIndex(IPath path, IProgressMonitor monitor, LsifService lsif) if (!javaProject.exists()) { continue; } - ProjectBuildTool builder = null; + boolean isPublish = false; try { IPath folderPath = proj.getLocation(); if (folderPath == null) { @@ -123,20 +114,8 @@ private void buildIndex(IPath path, IProgressMonitor monitor, LsifService lsif) } IProjectImporter importer = this.handler.getImporter(folderPath.toFile(), monitor); if (importer instanceof MavenProjectImporter) { - builder = ProjectBuildTool.MAVEN; - } else if (importer instanceof GradleProjectImporter) { - builder = ProjectBuildTool.GRADLE; - } else { - break; - } - } catch (CoreException e) { - e.printStackTrace(); - } - boolean isPublish = false; - if (builder == ProjectBuildTool.MAVEN) { - Set infoSet = collectMavenProjectInfo(monitor, path); - for (MavenProjectInfo mavenProjectInfo : infoSet) { - MavenProject mavenProject = Repository.getInstance().enlistMavenProject(lsif, mavenProjectInfo.getPomFile()); + File pomfile = LsifVisitor.findPom(proj.getLocation(), 0); + MavenProject mavenProject = Repository.getInstance().enlistMavenProject(lsif, pomfile); if (mavenProject != null) { Model model = mavenProject.getModel(); String groupId = model.getGroupId(); @@ -149,35 +128,41 @@ private void buildIndex(IPath path, IProgressMonitor monitor, LsifService lsif) url = scm.getUrl(); type = ScmUrlUtils.getProvider(scm.getConnection()); } - if (!Objects.equals(groupId, "") && !Objects.equals(artifactId, "") - && !Objects.equals(version, "")) { + if (StringUtils.isNotEmpty(groupId) && StringUtils.isNotEmpty(artifactId) + && StringUtils.isNotEmpty(version)) { isPublish = true; Repository.getInstance().enlistPackageInformation(lsif, javaProject.getPath().toString(), groupId + "/" + artifactId, PackageManager.MAVEN, version, type, url); } } - } - } else if (builder == ProjectBuildTool.GRADLE) { - GradleBuild build = GradleCore.getWorkspace().getBuild(proj).get(); - ProjectPublications model; - try { - model = build.withConnection(connection -> connection.getModel(ProjectPublications.class), monitor); - List publications = model.getPublications().getAll(); - if (publications.size() > 0) { - GradleModuleVersion gradleModuleVersion = publications.get(0).getId(); - String groupId = gradleModuleVersion.getGroup(); - String artifactId = gradleModuleVersion.getName(); - String version = gradleModuleVersion.getVersion(); - if (!Objects.equals(groupId, "") && !Objects.equals(artifactId, "") - && !Objects.equals(version, "")) { - isPublish = true; - Repository.getInstance().enlistPackageInformation(lsif, javaProject.getPath().toString(), - groupId + "/" + artifactId, PackageManager.GRADLE, version); + } else if (importer instanceof GradleProjectImporter) { + GradleBuild build = GradleCore.getWorkspace().getBuild(proj).get(); + ProjectPublications model; + try { + model = build.withConnection(connection -> connection.getModel(ProjectPublications.class), + monitor); + List publications = model.getPublications().getAll(); + if (publications.size() > 0) { + GradleModuleVersion gradleModuleVersion = publications.get(0).getId(); + String groupId = gradleModuleVersion.getGroup(); + String artifactId = gradleModuleVersion.getName(); + String version = gradleModuleVersion.getVersion(); + if (StringUtils.isNotEmpty(groupId) && StringUtils.isNotEmpty(artifactId) + && StringUtils.isNotEmpty(version)) { + isPublish = true; + Repository.getInstance().enlistPackageInformation(lsif, + javaProject.getPath().toString(), groupId + "/" + artifactId, + PackageManager.GRADLE, version); + } } + } catch (Exception e) { + JavaLanguageServerPlugin.logException(e.getMessage(), e); } - } catch (Exception e) { - e.printStackTrace(); + } else { + break; } + } catch (CoreException e) { + // Do nothing } Project projVertex = lsif.getVertexBuilder().project(); LsifEmitter.getInstance().emit(projVertex); @@ -186,7 +171,7 @@ private void buildIndex(IPath path, IProgressMonitor monitor, LsifService lsif) List sourceList = getAllSourceFiles(javaProject); - dumpParallelly(sourceList, threadPool, projVertex, lsif, builder, isPublish, monitor); + dumpParallelly(sourceList, threadPool, projVertex, lsif, isPublish, monitor); VisitorUtils.endAllDocument(lsif); LsifEmitter.getInstance().emit( @@ -227,7 +212,7 @@ private List getAllSourceFiles(IJavaProject javaProject) throw } private void dumpParallelly(List sourceList, ExecutorService threadPool, Project projVertex, - LsifService lsif, ProjectBuildTool builder, boolean isPublish, IProgressMonitor monitor) { + LsifService lsif, boolean isPublish, IProgressMonitor monitor) { Observable.fromIterable(sourceList) .flatMap(item -> Observable.just(item).observeOn(Schedulers.from(threadPool)).map(sourceFile -> { CompilationUnit cu = ASTUtil.createAST(sourceFile, monitor); @@ -237,7 +222,7 @@ private void dumpParallelly(List sourceList, ExecutorService t } IndexerContext context = new IndexerContext(docVertex, cu, projVertex); - LsifVisitor lsifVisitor = new LsifVisitor(lsif, context, builder, isPublish); + LsifVisitor lsifVisitor = new LsifVisitor(lsif, context, isPublish); cu.accept(lsifVisitor); DiagnosticVisitor diagnosticVisitor = new DiagnosticVisitor(lsif, context); @@ -249,38 +234,4 @@ private void dumpParallelly(List sourceList, ExecutorService t })).blockingSubscribe(); } - private Set collectMavenProjectInfo(IProgressMonitor monitor, IPath path) - throws OperationCanceledException { - MavenModelManager modelManager = MavenPlugin.getMavenModelManager(); - return getMavenProjects(path.toFile(), modelManager, monitor); - } - - private Set getMavenProjects(File directory, MavenModelManager modelManager, - IProgressMonitor monitor) throws OperationCanceledException { - if (directory == null) { - return Collections.emptySet(); - } - try { - LocalProjectScanner scanner = new LocalProjectScanner(directory.getParentFile(), directory.toString(), - false, modelManager); - scanner.run(monitor); - return collectProjects(scanner.getProjects()); - } catch (InterruptedException e) { - throw new OperationCanceledException(); - } - } - - private Set collectProjects(Collection projects) { - return new LinkedHashSet() { - private static final long serialVersionUID = 1L; - - public Set collectProjects(Collection projects) { - for (MavenProjectInfo projectInfo : projects) { - add(projectInfo); - collectProjects(projectInfo.getProjects()); - } - return this; - } - }.collectProjects(projects); - } } diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/ProjectBuildTool.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/ProjectBuildTool.java deleted file mode 100644 index 48d90a2..0000000 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/ProjectBuildTool.java +++ /dev/null @@ -1,10 +0,0 @@ -/* -------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * ------------------------------------------------------------------------------------------ */ - -package com.microsoft.java.lsif.core.internal.indexer; - -public enum ProjectBuildTool { - MAVEN, GRADLE; -} diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Repository.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Repository.java index 603e744..d35773c 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Repository.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Repository.java @@ -8,7 +8,6 @@ import java.io.File; import java.util.ArrayList; import java.util.Map; -import java.util.Objects; import java.util.concurrent.ConcurrentHashMap; import com.microsoft.java.lsif.core.internal.LsifUtils; @@ -19,11 +18,15 @@ import com.microsoft.java.lsif.core.internal.protocol.Project; import com.microsoft.java.lsif.core.internal.protocol.Range; import com.microsoft.java.lsif.core.internal.protocol.PackageInformation.PackageManager; +import com.microsoft.java.lsif.core.internal.visitors.LsifVisitor; import com.microsoft.java.lsif.core.internal.visitors.SymbolData; import org.apache.maven.project.MavenProject; +import org.apache.maven.shared.utils.StringUtils; import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.jdt.ls.core.internal.JavaLanguageServerPlugin; import org.eclipse.m2e.core.MavenPlugin; import org.eclipse.m2e.core.embedder.IMaven; @@ -110,7 +113,7 @@ public synchronized PackageInformation enlistPackageInformation(LsifService lsif PackageManager manager, String version, String type, String url) { PackageInformation packageInformation = findPackageInformationById(id); if (packageInformation == null) { - if (Objects.equals(name, "")) { + if (StringUtils.isEmpty(name)) { return null; } packageInformation = lsif.getVertexBuilder().packageInformation(name, manager, version, type, url); @@ -129,17 +132,25 @@ public synchronized MavenProject enlistMavenProject(LsifService lsif, File pomFi MavenProject mavenProject = findMavenProjectByPath(pomFile.getAbsolutePath()); if (mavenProject == null) { IMaven maven = MavenPlugin.getMaven(); - NullProgressMonitor monitor = new NullProgressMonitor(); try { - mavenProject = maven.readProject(pomFile, monitor); + mavenProject = maven.readProject(pomFile, new NullProgressMonitor()); addMavenProject(pomFile.getAbsolutePath(), mavenProject); } catch (CoreException ce) { - ce.printStackTrace(); + JavaLanguageServerPlugin.logException(ce.getMessage(), ce); } } return mavenProject; } + public synchronized MavenProject enlistMavenProject(LsifService lsif, IPath path) { + // For Maven, use findPom(path, 1). For Gradle, use findPom(path, 2). + File pomFile = LsifVisitor.findPom(path, 2); + if (pomFile == null) { + return null; + } + return enlistMavenProject(lsif, pomFile); + } + public void addToBeginededDocuments(Document doc) { this.beginededDocumentMap.put(doc.getUri(), doc); } diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/PackageInformation.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/PackageInformation.java index 39c77a5..b43275f 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/PackageInformation.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/PackageInformation.java @@ -5,6 +5,8 @@ package com.microsoft.java.lsif.core.internal.protocol; +import org.apache.commons.lang3.StringUtils; + public class PackageInformation extends Vertex { public enum PackageManager { @@ -35,7 +37,7 @@ public PackageInformation(String id, String name, PackageManager manager, String this.name = name; this.manager = manager.toString(); this.version = version; - if (type != null && type != "" && url != null && url != "") { + if (StringUtils.isNotEmpty(type) && StringUtils.isNotEmpty(url)) { this.repository = new Repo(type, url); } } diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/LsifVisitor.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/LsifVisitor.java index 57f5556..d1a6f57 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/LsifVisitor.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/LsifVisitor.java @@ -6,6 +6,10 @@ package com.microsoft.java.lsif.core.internal.visitors; import java.io.File; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; import java.util.jar.Attributes; import java.util.jar.Manifest; @@ -13,6 +17,7 @@ import org.apache.maven.model.Scm; import org.apache.maven.project.MavenProject; import org.apache.maven.scm.provider.ScmUrlUtils; +import org.apache.maven.shared.utils.StringUtils; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.jdt.core.IClassFile; @@ -51,7 +56,6 @@ import com.microsoft.java.lsif.core.internal.LanguageServerIndexerPlugin; import com.microsoft.java.lsif.core.internal.indexer.IndexerContext; import com.microsoft.java.lsif.core.internal.indexer.LsifService; -import com.microsoft.java.lsif.core.internal.indexer.ProjectBuildTool; import com.microsoft.java.lsif.core.internal.indexer.Repository; import com.microsoft.java.lsif.core.internal.protocol.Document; import com.microsoft.java.lsif.core.internal.protocol.Moniker.MonikerKind; @@ -62,13 +66,10 @@ public class LsifVisitor extends ProtocolVisitor { - private ProjectBuildTool builder; - private boolean isPublish; - public LsifVisitor(LsifService lsif, IndexerContext context, ProjectBuildTool builder, boolean isPublish) { + public LsifVisitor(LsifService lsif, IndexerContext context, boolean isPublish) { super(lsif, context); - this.builder = builder; this.isPublish = isPublish; } @@ -162,95 +163,14 @@ private void resolve(int startPosition, int length, boolean needResolveImpl, Mon return; } - // Import Monikers - IJavaProject javaproject = element.getJavaProject(); - IClassFile cf = (IClassFile) element.getAncestor(IJavaElement.CLASS_FILE); - PackageManager manager = null; - String schemeId = ""; - String version = ""; - String type = ""; - String url = ""; - if (cf != null) { - IPath path = cf.getPath(); - IPackageFragmentRoot root = javaproject.findPackageFragmentRoot(path); - IClasspathEntry container = root.getRawClasspathEntry(); - IPath containerPath = container.getPath(); - String pathName = containerPath.toString(); - if (pathName.startsWith(JavaRuntime.JRE_CONTAINER)) { - // JDK Library - manager = PackageManager.JDK; - Manifest manifest = new Manifest(); - if (root instanceof JarPackageFragmentRoot) { - manifest = ((JarPackageFragmentRoot) root).getManifest(); - if (manifest != null) { - Attributes attributes = manifest.getMainAttributes(); - version = attributes.getValue("Implementation-Version"); - } - } - PackageFragmentRoot packageFragmentRoot = (PackageFragmentRoot) cf.getAncestor(IJavaElement.PACKAGE_FRAGMENT_ROOT); - if (packageFragmentRoot != null) { - IModuleDescription moduleDescription = packageFragmentRoot.getAutomaticModuleDescription(); - schemeId = moduleDescription.getElementName(); - } - } else { - File pomFile = null; - if (builder == ProjectBuildTool.MAVEN) { - pomFile = findPomFile(path.removeLastSegments(1).toFile()); - } else if (builder == ProjectBuildTool.GRADLE) { - pomFile = findPomFile(path.removeLastSegments(2).toFile()); - } - if (pomFile != null) { - manager = (builder == ProjectBuildTool.MAVEN) ? PackageManager.MAVEN : PackageManager.GRADLE; - MavenProject mavenProject = Repository.getInstance().enlistMavenProject(lsif, pomFile); - if (mavenProject != null) { - Model model = mavenProject.getModel(); - String groupId = model.getGroupId(); - String artifactId = model.getArtifactId(); - if (groupId != null && artifactId != null) { - schemeId = groupId + "/" + artifactId; - } - version = model.getVersion(); - Scm scm = model.getScm(); - if (scm != null) { - url = scm.getUrl(); - type = ScmUrlUtils.getProvider(scm.getConnection()); - } - } - } - } - } - - // Export Monikers - if (monikerKind == MonikerKind.EXPORT && this.isPublish) { - if (builder == ProjectBuildTool.MAVEN) { - manager = PackageManager.MAVEN; - } else if (builder == ProjectBuildTool.GRADLE) { - manager = PackageManager.GRADLE; - } - } - String id = VisitorUtils.createSymbolKey(definitionLocation); Document definitionDocument = Repository.getInstance().enlistDocument(lsif, definitionLocation.getUri(), projVertex); SymbolData symbolData = Repository.getInstance().enlistSymbolData(id, definitionDocument, projVertex); /* Ensure resultSet */ symbolData.ensureResultSet(lsif, sourceRange); - String identifier = ""; - try { - identifier = this.getMonikerIdentifier(element); - } catch (JavaModelException e) { - // Do nothing - } - /* Generate Moniker */ - if (identifier != null && schemeId != null && version != null) { - if (monikerKind == MonikerKind.EXPORT) { - symbolData.generateMonikerExport(lsif, sourceRange, identifier, manager, javaproject); - } else if (monikerKind == MonikerKind.LOCAL) { - symbolData.generateMonikerLocal(lsif, sourceRange, identifier); - } else if (definitionLocation.getUri().startsWith("jdt")) { - symbolData.generateMonikerImport(lsif, sourceRange, identifier, schemeId, manager, version, type, url); - } - } + + resolveMoniker(element, monikerKind, symbolData, definitionLocation, sourceRange); /* Resolve definition */ symbolData.resolveDefinition(lsif, definitionLocation); @@ -273,6 +193,83 @@ private void resolve(int startPosition, int length, boolean needResolveImpl, Mon } } + private void resolveMoniker(IJavaElement element, MonikerKind monikerKind, SymbolData symbolData, Location definitionLocation, Range sourceRange) throws JavaModelException { + LsifService lsif = this.getLsif(); + // Import Monikers + IJavaProject javaProject = element.getJavaProject(); + IClassFile cf = (IClassFile) element.getAncestor(IJavaElement.CLASS_FILE); + PackageManager manager = null; + String packageName = ""; + String version = ""; + String type = ""; + String url = ""; + if (cf != null) { + IPath path = cf.getPath(); + IPackageFragmentRoot root = javaProject.findPackageFragmentRoot(path); + IClasspathEntry container = root.getRawClasspathEntry(); + IPath containerPath = container.getPath(); + String pathName = containerPath.toString(); + if (pathName.startsWith(JavaRuntime.JRE_CONTAINER)) { + // JDK Library + manager = PackageManager.JDK; + Manifest manifest = new Manifest(); + if (root instanceof JarPackageFragmentRoot) { + manifest = ((JarPackageFragmentRoot) root).getManifest(); + if (manifest != null) { + Attributes attributes = manifest.getMainAttributes(); + version = attributes.getValue("Implementation-Version"); + } + } + PackageFragmentRoot packageFragmentRoot = (PackageFragmentRoot) cf + .getAncestor(IJavaElement.PACKAGE_FRAGMENT_ROOT); + if (packageFragmentRoot != null) { + IModuleDescription moduleDescription = packageFragmentRoot.getAutomaticModuleDescription(); + packageName = moduleDescription.getElementName(); + } + } else { + manager = PackageManager.MAVEN; + MavenProject mavenProject = Repository.getInstance().enlistMavenProject(lsif, path); + if (mavenProject != null) { + Model model = mavenProject.getModel(); + String groupId = model.getGroupId(); + String artifactId = model.getArtifactId(); + if (StringUtils.isNotEmpty(groupId) && StringUtils.isNotEmpty(artifactId)) { + packageName = groupId + "/" + artifactId; + } + version = model.getVersion(); + Scm scm = model.getScm(); + if (scm != null) { + url = scm.getUrl(); + type = ScmUrlUtils.getProvider(scm.getConnection()); + } + } + } + } + + // Export Monikers + if (monikerKind == MonikerKind.EXPORT && this.isPublish) { + manager = PackageManager.MAVEN; + } + + String identifier = ""; + try { + identifier = this.getMonikerIdentifier(element); + } catch (JavaModelException e) { + // Do nothing + } + /* Generate Moniker */ + if (StringUtils.isNotEmpty(identifier) && StringUtils.isNotEmpty(packageName) + && StringUtils.isNotEmpty(version)) { + if (monikerKind == MonikerKind.EXPORT) { + symbolData.generateMonikerExport(lsif, sourceRange, identifier, manager, javaProject); + } else if (monikerKind == MonikerKind.LOCAL) { + symbolData.generateMonikerLocal(lsif, sourceRange, identifier); + } else if (definitionLocation.getUri().startsWith("jdt")) { + symbolData.generateMonikerImport(lsif, sourceRange, identifier, packageName, manager, version, type, url); + } + } + } + private String getMonikerIdentifier(IJavaElement element) throws JavaModelException { String identifier = element.getElementName(); if (element instanceof IType) { @@ -302,15 +299,36 @@ private boolean isTypeOrMethodDeclaration(ASTNode node) { return node.getParent() instanceof TypeDeclaration || node.getParent() instanceof MethodDeclaration; } - private static File findPomFile(File folder) { + public static File findPom(IPath jarPath, int length) { + int current = 0; + Set exclude = new HashSet<>(); + while (current <= length) { + File pomFile = findPomFromFolder(jarPath.removeLastSegments(current).toFile(), exclude); + if (pomFile != null) { + return pomFile; + } + current++; + } + return null; + } + + public static File findPomFromFolder(File folder, Set exclude) { + if (!folder.isDirectory() || exclude.contains(folder)) { + return null; + } + exclude.add(folder); + List subFolders = new ArrayList<>(); for (File file : folder.listFiles()) { - if (file.getName().endsWith(".pom")) { + if (file.getName().endsWith(".pom") || StringUtils.equals(file.getName(), "pom.xml")) { return file; } else if (file.isDirectory()) { - File subFile = findPomFile(file); - if (subFile != null) { - return subFile; - } + subFolders.add(file); + } + } + for (File subFolder : subFolders) { + File pomFile = findPomFromFolder(subFolder, exclude); + if (pomFile != null) { + return pomFile; } } return null; diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/SymbolData.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/SymbolData.java index 23ecd6b..8171d9e 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/SymbolData.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/SymbolData.java @@ -57,7 +57,7 @@ synchronized public void ensureResultSet(LsifService lsif, Range sourceRange) { LsifEmitter.getInstance().emit(lsif.getEdgeBuilder().next(sourceRange, this.resultSet)); } - synchronized public void generateMonikerImport(LsifService lsif, Range sourceRange, String identifier, String schemeId, PackageManager manager, String version, String type, String url) { + synchronized public void generateMonikerImport(LsifService lsif, Range sourceRange, String identifier, String packageName, PackageManager manager, String version, String type, String url) { if (this.resultSet == null || this.groupMoniker != null || this.schemeMoniker != null) { return; } @@ -69,8 +69,8 @@ synchronized public void generateMonikerImport(LsifService lsif, Range sourceRan return; } PackageInformation packageInformation = (manager == PackageManager.JDK) - ? Repository.getInstance().enlistPackageInformation(lsif, schemeId, schemeId, manager, version) - : Repository.getInstance().enlistPackageInformation(lsif, schemeId, schemeId, manager, version, type, url); + ? Repository.getInstance().enlistPackageInformation(lsif, packageName, packageName, manager, version) + : Repository.getInstance().enlistPackageInformation(lsif, packageName, packageName, manager, version, type, url); if (packageInformation == null) { return; } From 61e466d720f954e60905a4b37f38760252b630a5 Mon Sep 17 00:00:00 2001 From: CS <45906942+CsCherrYY@users.noreply.github.com> Date: Thu, 27 Aug 2020 17:48:17 +0800 Subject: [PATCH 12/18] Apply changes 1. Use binding to get modifiers 2. Resolve visibility of enum 3. clean and enhance codes --- .../lsif/core/internal/indexer/ASTUtil.java | 2 + .../lsif/core/internal/indexer/Indexer.java | 111 ++++++------ .../core/internal/indexer/Repository.java | 9 +- .../internal/protocol/PackageInformation.java | 2 +- .../core/internal/visitors/LsifVisitor.java | 170 ++++-------------- .../core/internal/visitors/SymbolData.java | 4 +- .../core/internal/visitors/VisitorUtils.java | 40 +++++ 7 files changed, 138 insertions(+), 200 deletions(-) diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/ASTUtil.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/ASTUtil.java index ba5d9db..06d8291 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/ASTUtil.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/ASTUtil.java @@ -45,6 +45,8 @@ public static CompilationUnit createAST(final ITypeRoot input, final IProgressMo if (root[0] == null) { final ASTParser parser = newASTParser(); parser.setSource(input); + parser.setResolveBindings(true); + parser.setBindingsRecovery(true); root[0] = (CompilationUnit) parser.createAST(progressMonitor); } // mark as unmodifiable diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Indexer.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Indexer.java index f3b4e77..d4e524a 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Indexer.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Indexer.java @@ -22,7 +22,6 @@ import org.eclipse.buildship.core.GradleCore; import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.NullProgressMonitor; @@ -108,62 +107,11 @@ private void buildIndex(IPath path, IProgressMonitor monitor, LsifService lsif) } boolean isPublish = false; try { - IPath folderPath = proj.getLocation(); - if (folderPath == null) { - continue; - } - IProjectImporter importer = this.handler.getImporter(folderPath.toFile(), monitor); - if (importer instanceof MavenProjectImporter) { - File pomfile = LsifVisitor.findPom(proj.getLocation(), 0); - MavenProject mavenProject = Repository.getInstance().enlistMavenProject(lsif, pomfile); - if (mavenProject != null) { - Model model = mavenProject.getModel(); - String groupId = model.getGroupId(); - String artifactId = model.getArtifactId(); - String version = model.getVersion(); - Scm scm = model.getScm(); - String url = null; - String type = null; - if (scm != null) { - url = scm.getUrl(); - type = ScmUrlUtils.getProvider(scm.getConnection()); - } - if (StringUtils.isNotEmpty(groupId) && StringUtils.isNotEmpty(artifactId) - && StringUtils.isNotEmpty(version)) { - isPublish = true; - Repository.getInstance().enlistPackageInformation(lsif, javaProject.getPath().toString(), - groupId + "/" + artifactId, PackageManager.MAVEN, version, type, url); - } - } - } else if (importer instanceof GradleProjectImporter) { - GradleBuild build = GradleCore.getWorkspace().getBuild(proj).get(); - ProjectPublications model; - try { - model = build.withConnection(connection -> connection.getModel(ProjectPublications.class), - monitor); - List publications = model.getPublications().getAll(); - if (publications.size() > 0) { - GradleModuleVersion gradleModuleVersion = publications.get(0).getId(); - String groupId = gradleModuleVersion.getGroup(); - String artifactId = gradleModuleVersion.getName(); - String version = gradleModuleVersion.getVersion(); - if (StringUtils.isNotEmpty(groupId) && StringUtils.isNotEmpty(artifactId) - && StringUtils.isNotEmpty(version)) { - isPublish = true; - Repository.getInstance().enlistPackageInformation(lsif, - javaProject.getPath().toString(), groupId + "/" + artifactId, - PackageManager.GRADLE, version); - } - } - } catch (Exception e) { - JavaLanguageServerPlugin.logException(e.getMessage(), e); - } - } else { - break; - } - } catch (CoreException e) { - // Do nothing + isPublish = generateExportPackageInformation(proj, monitor, lsif, javaProject); + } catch (Exception e) { + JavaLanguageServerPlugin.logException(e.getMessage(), e); } + Project projVertex = lsif.getVertexBuilder().project(); LsifEmitter.getInstance().emit(projVertex); LsifEmitter.getInstance().emit( @@ -211,6 +159,57 @@ private List getAllSourceFiles(IJavaProject javaProject) throw return res; } + private boolean generateExportPackageInformation(IProject proj, IProgressMonitor monitor, LsifService lsif, + IJavaProject javaProject) throws Exception { + boolean isPublish = false; + IPath folderPath = proj.getLocation(); + if (folderPath == null) { + return false; + } + IProjectImporter importer = this.handler.getImporter(folderPath.toFile(), monitor); + if (importer instanceof MavenProjectImporter) { + File pomfile = VisitorUtils.findPom(proj.getLocation(), 0); + MavenProject mavenProject = Repository.getInstance().enlistMavenProject(lsif, pomfile); + if (mavenProject != null) { + Model model = mavenProject.getModel(); + String groupId = model.getGroupId(); + String artifactId = model.getArtifactId(); + String version = model.getVersion(); + Scm scm = model.getScm(); + String url = null; + String type = null; + if (scm != null) { + url = scm.getUrl(); + type = ScmUrlUtils.getProvider(scm.getConnection()); + } + if (StringUtils.isNotEmpty(groupId) && StringUtils.isNotEmpty(artifactId) + && StringUtils.isNotEmpty(version)) { + isPublish = true; + Repository.getInstance().enlistPackageInformation(lsif, javaProject.getPath().toString(), + groupId + "/" + artifactId, PackageManager.MAVEN, version, type, url); + } + } + } else if (importer instanceof GradleProjectImporter) { + GradleBuild build = GradleCore.getWorkspace().getBuild(proj).get(); + ProjectPublications model = build + .withConnection(connection -> connection.getModel(ProjectPublications.class), monitor); + List publications = model.getPublications().getAll(); + if (publications.size() > 0) { + GradleModuleVersion gradleModuleVersion = publications.get(0).getId(); + String groupId = gradleModuleVersion.getGroup(); + String artifactId = gradleModuleVersion.getName(); + String version = gradleModuleVersion.getVersion(); + if (StringUtils.isNotEmpty(groupId) && StringUtils.isNotEmpty(artifactId) + && StringUtils.isNotEmpty(version)) { + isPublish = true; + Repository.getInstance().enlistPackageInformation(lsif, javaProject.getPath().toString(), + groupId + "/" + artifactId, PackageManager.MAVEN, version, null, null); + } + } + } + return isPublish; + } + private void dumpParallelly(List sourceList, ExecutorService threadPool, Project projVertex, LsifService lsif, boolean isPublish, IProgressMonitor monitor) { Observable.fromIterable(sourceList) diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Repository.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Repository.java index d35773c..ef5822c 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Repository.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Repository.java @@ -18,8 +18,8 @@ import com.microsoft.java.lsif.core.internal.protocol.Project; import com.microsoft.java.lsif.core.internal.protocol.Range; import com.microsoft.java.lsif.core.internal.protocol.PackageInformation.PackageManager; -import com.microsoft.java.lsif.core.internal.visitors.LsifVisitor; import com.microsoft.java.lsif.core.internal.visitors.SymbolData; +import com.microsoft.java.lsif.core.internal.visitors.VisitorUtils; import org.apache.maven.project.MavenProject; import org.apache.maven.shared.utils.StringUtils; @@ -123,11 +123,6 @@ public synchronized PackageInformation enlistPackageInformation(LsifService lsif return packageInformation; } - public synchronized PackageInformation enlistPackageInformation(LsifService lsif, String id, String name, - PackageManager manager, String version) { - return enlistPackageInformation(lsif, id, name, manager, version, null, null); - } - public synchronized MavenProject enlistMavenProject(LsifService lsif, File pomFile) { MavenProject mavenProject = findMavenProjectByPath(pomFile.getAbsolutePath()); if (mavenProject == null) { @@ -144,7 +139,7 @@ public synchronized MavenProject enlistMavenProject(LsifService lsif, File pomFi public synchronized MavenProject enlistMavenProject(LsifService lsif, IPath path) { // For Maven, use findPom(path, 1). For Gradle, use findPom(path, 2). - File pomFile = LsifVisitor.findPom(path, 2); + File pomFile = VisitorUtils.findPom(path, 2); if (pomFile == null) { return null; } diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/PackageInformation.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/PackageInformation.java index b43275f..52533e9 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/PackageInformation.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/PackageInformation.java @@ -10,7 +10,7 @@ public class PackageInformation extends Vertex { public enum PackageManager { - MAVEN("maven"), GRADLE("gradle"), JDK("jdk"); + MAVEN("maven"), JDK("jdk"); private final String manager; diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/LsifVisitor.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/LsifVisitor.java index d1a6f57..ccfc91c 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/LsifVisitor.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/LsifVisitor.java @@ -5,11 +5,6 @@ package com.microsoft.java.lsif.core.internal.visitors; -import java.io.File; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Set; import java.util.jar.Attributes; import java.util.jar.Manifest; @@ -32,18 +27,13 @@ import org.eclipse.jdt.core.IType; import org.eclipse.jdt.core.JavaModelException; import org.eclipse.jdt.core.dom.ASTNode; -import org.eclipse.jdt.core.dom.BodyDeclaration; import org.eclipse.jdt.core.dom.EnumConstantDeclaration; -import org.eclipse.jdt.core.dom.EnumDeclaration; -import org.eclipse.jdt.core.dom.FieldDeclaration; +import org.eclipse.jdt.core.dom.IBinding; import org.eclipse.jdt.core.dom.MethodDeclaration; import org.eclipse.jdt.core.dom.Modifier; import org.eclipse.jdt.core.dom.SimpleName; import org.eclipse.jdt.core.dom.SimpleType; -import org.eclipse.jdt.core.dom.SingleVariableDeclaration; import org.eclipse.jdt.core.dom.TypeDeclaration; -import org.eclipse.jdt.core.dom.VariableDeclarationFragment; -import org.eclipse.jdt.core.dom.VariableDeclarationStatement; import org.eclipse.jdt.internal.core.JarPackageFragmentRoot; import org.eclipse.jdt.internal.core.PackageFragmentRoot; import org.eclipse.jdt.launching.JavaRuntime; @@ -75,56 +65,14 @@ public LsifVisitor(LsifService lsif, IndexerContext context, boolean isPublish) @Override public boolean visit(SimpleName node) { - resolve(node.getStartPosition(), node.getLength(), isTypeOrMethodDeclaration(node), MonikerKind.IMPORT); - return false; - } - - @Override - public boolean visit(SingleVariableDeclaration node) { - MonikerKind monikerKind = getMonikerKind(node); - resolve(node.getName().getStartPosition(), node.getName().getLength(), false, monikerKind); - return true; - } - - @Override - public boolean visit(EnumDeclaration node) { - MonikerKind monikerKind = getMonikerKind(node); - resolve(node.getName().getStartPosition(), node.getName().getLength(), false, monikerKind); - return true; - } - - @Override - public boolean visit(EnumConstantDeclaration node) { - MonikerKind monikerKind = MonikerKind.EXPORT; // All the enum values are modified by `public static final` - resolve(node.getName().getStartPosition(), node.getName().getLength(), false, monikerKind); - return true; - } - - @Override - public boolean visit(TypeDeclaration node) { - MonikerKind monikerKind = getMonikerKind(node); - resolve(node.getName().getStartPosition(), node.getName().getLength(), false, monikerKind); - return true; - } - - @Override - public boolean visit(MethodDeclaration node) { - MonikerKind monikerKind = getMonikerKind(node); - resolve(node.getName().getStartPosition(), node.getName().getLength(), false, monikerKind); - return true; - } - - @Override - public boolean visit(VariableDeclarationFragment node) { - ASTNode parent = node.getParent(); - if (parent instanceof VariableDeclarationStatement) { - MonikerKind monikerKind = getMonikerKind((VariableDeclarationStatement) parent); - resolve(node.getName().getStartPosition(), node.getName().getLength(), false, monikerKind); - } else if (parent instanceof FieldDeclaration) { - MonikerKind monikerKind = getMonikerKind((FieldDeclaration) parent); - resolve(node.getName().getStartPosition(), node.getName().getLength(), false, monikerKind); + IBinding binding = node.resolveBinding(); + if (binding != null) { + ASTNode parent = node.getParent(); + int modifier = (parent instanceof EnumConstantDeclaration) ? ((EnumConstantDeclaration) parent).getModifiers() : binding.getModifiers(); + MonikerKind monikerKind = Modifier.isPublic(modifier) ? MonikerKind.EXPORT : MonikerKind.LOCAL; + resolve(node.getStartPosition(), node.getLength(), isTypeOrMethodDeclaration(node), monikerKind); } - return true; + return false; } @Override @@ -193,9 +141,10 @@ private void resolve(int startPosition, int length, boolean needResolveImpl, Mon } } - private void resolveMoniker(IJavaElement element, MonikerKind monikerKind, SymbolData symbolData, Location definitionLocation, Range sourceRange) throws JavaModelException { + private void resolveMoniker(IJavaElement element, MonikerKind monikerKind, SymbolData symbolData, + Location definitionLocation, Range sourceRange) throws JavaModelException { LsifService lsif = this.getLsif(); - // Import Monikers + IJavaProject javaProject = element.getJavaProject(); IClassFile cf = (IClassFile) element.getAncestor(IJavaElement.CLASS_FILE); PackageManager manager = null; @@ -203,7 +152,13 @@ private void resolveMoniker(IJavaElement element, MonikerKind monikerKind, Symbo String version = ""; String type = ""; String url = ""; - if (cf != null) { + + // Export Monikers + if (cf == null) { + if (monikerKind == MonikerKind.EXPORT && this.isPublish) { + manager = PackageManager.MAVEN; + } + } else { IPath path = cf.getPath(); IPackageFragmentRoot root = javaProject.findPackageFragmentRoot(path); IClasspathEntry container = root.getRawClasspathEntry(); @@ -246,91 +201,40 @@ private void resolveMoniker(IJavaElement element, MonikerKind monikerKind, Symbo } } - // Export Monikers - if (monikerKind == MonikerKind.EXPORT && this.isPublish) { - manager = PackageManager.MAVEN; - } - - String identifier = ""; - try { - identifier = this.getMonikerIdentifier(element); - } catch (JavaModelException e) { - // Do nothing - } + String identifier = this.getMonikerIdentifier(element); /* Generate Moniker */ - if (StringUtils.isNotEmpty(identifier) && StringUtils.isNotEmpty(packageName) - && StringUtils.isNotEmpty(version)) { - if (monikerKind == MonikerKind.EXPORT) { + if (StringUtils.isNotEmpty(identifier)) { + if (definitionLocation.getUri().startsWith("jdt")) { + if (StringUtils.isNotEmpty(packageName) && StringUtils.isNotEmpty(version)) { + symbolData.generateMonikerImport(lsif, sourceRange, identifier, packageName, manager, version, type, url); + } + } else if (monikerKind == MonikerKind.EXPORT) { symbolData.generateMonikerExport(lsif, sourceRange, identifier, manager, javaProject); } else if (monikerKind == MonikerKind.LOCAL) { symbolData.generateMonikerLocal(lsif, sourceRange, identifier); - } else if (definitionLocation.getUri().startsWith("jdt")) { - symbolData.generateMonikerImport(lsif, sourceRange, identifier, packageName, manager, version, type, url); } } } - private String getMonikerIdentifier(IJavaElement element) throws JavaModelException { + private String getMonikerIdentifier(IJavaElement element) { String identifier = element.getElementName(); - if (element instanceof IType) { - return ((IType) element).getFullyQualifiedName(); - } else if (element instanceof IField || element instanceof ILocalVariable) { - return getMonikerIdentifier(element.getParent()) + "/" + identifier; - } else if (element instanceof IMethod) { - return getMonikerIdentifier(element.getParent()) + "/" + identifier + ":" - + ((IMethod) element).getSignature(); + try { + if (element instanceof IType) { + return ((IType) element).getFullyQualifiedName(); + } else if (element instanceof IField || element instanceof ILocalVariable) { + return getMonikerIdentifier(element.getParent()) + "/" + identifier; + } else if (element instanceof IMethod) { + return getMonikerIdentifier(element.getParent()) + "/" + identifier + ":" + + ((IMethod) element).getSignature(); + } + } catch (JavaModelException e) { + return ""; } return identifier; } - private MonikerKind getMonikerKind(BodyDeclaration node) { - return (node.getModifiers() & Modifier.PUBLIC) > 0 ? MonikerKind.EXPORT : MonikerKind.LOCAL; - } - - private MonikerKind getMonikerKind(SingleVariableDeclaration node) { - return (node.getModifiers() & Modifier.PUBLIC) > 0 ? MonikerKind.EXPORT : MonikerKind.LOCAL; - } - - private MonikerKind getMonikerKind(VariableDeclarationStatement node) { - return (node.getModifiers() & Modifier.PUBLIC) > 0 ? MonikerKind.EXPORT : MonikerKind.LOCAL; - } - private boolean isTypeOrMethodDeclaration(ASTNode node) { return node.getParent() instanceof TypeDeclaration || node.getParent() instanceof MethodDeclaration; } - public static File findPom(IPath jarPath, int length) { - int current = 0; - Set exclude = new HashSet<>(); - while (current <= length) { - File pomFile = findPomFromFolder(jarPath.removeLastSegments(current).toFile(), exclude); - if (pomFile != null) { - return pomFile; - } - current++; - } - return null; - } - - public static File findPomFromFolder(File folder, Set exclude) { - if (!folder.isDirectory() || exclude.contains(folder)) { - return null; - } - exclude.add(folder); - List subFolders = new ArrayList<>(); - for (File file : folder.listFiles()) { - if (file.getName().endsWith(".pom") || StringUtils.equals(file.getName(), "pom.xml")) { - return file; - } else if (file.isDirectory()) { - subFolders.add(file); - } - } - for (File subFolder : subFolders) { - File pomFile = findPomFromFolder(subFolder, exclude); - if (pomFile != null) { - return pomFile; - } - } - return null; - } } diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/SymbolData.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/SymbolData.java index 8171d9e..7017bde 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/SymbolData.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/SymbolData.java @@ -68,9 +68,7 @@ synchronized public void generateMonikerImport(LsifService lsif, Range sourceRan if (manager == null) { return; } - PackageInformation packageInformation = (manager == PackageManager.JDK) - ? Repository.getInstance().enlistPackageInformation(lsif, packageName, packageName, manager, version) - : Repository.getInstance().enlistPackageInformation(lsif, packageName, packageName, manager, version, type, url); + PackageInformation packageInformation = Repository.getInstance().enlistPackageInformation(lsif, packageName, packageName, manager, version, type, url); if (packageInformation == null) { return; } diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/VisitorUtils.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/VisitorUtils.java index 00af115..9e7b0e6 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/VisitorUtils.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/VisitorUtils.java @@ -5,12 +5,17 @@ package com.microsoft.java.lsif.core.internal.visitors; +import java.io.File; +import java.util.ArrayList; import java.util.Collections; +import java.util.HashSet; import java.util.List; +import java.util.Set; import java.util.stream.Collectors; import org.apache.commons.codec.digest.DigestUtils; import org.apache.commons.lang3.StringUtils; +import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.jdt.ls.core.internal.JavaLanguageServerPlugin; import org.eclipse.jdt.ls.core.internal.handlers.HoverHandler; @@ -174,4 +179,39 @@ public static String createSymbolKey(Location definitionLocation) { public static String createSymbolKey(String key) { return DigestUtils.md5Hex(key); } + + public static File findPom(IPath jarPath, int length) { + int current = 0; + Set exclude = new HashSet<>(); + while (current <= length) { + File pomFile = findPomFromFolder(jarPath.removeLastSegments(current).toFile(), exclude); + if (pomFile != null) { + return pomFile; + } + current++; + } + return null; + } + + public static File findPomFromFolder(File folder, Set exclude) { + if (!folder.isDirectory() || exclude.contains(folder)) { + return null; + } + exclude.add(folder); + List subFolders = new ArrayList<>(); + for (File file : folder.listFiles()) { + if (file.getName().endsWith(".pom") || StringUtils.equals(file.getName(), "pom.xml")) { + return file; + } else if (file.isDirectory()) { + subFolders.add(file); + } + } + for (File subFolder : subFolders) { + File pomFile = findPomFromFolder(subFolder, exclude); + if (pomFile != null) { + return pomFile; + } + } + return null; + } } From 85c66866b2cf284d95559532af35e8df5890012f Mon Sep 17 00:00:00 2001 From: CS <45906942+CsCherrYY@users.noreply.github.com> Date: Mon, 31 Aug 2020 16:44:23 +0800 Subject: [PATCH 13/18] Apply comments 1. Remove bindingsRecovery 2. Divides read and write in packageinformation 3. Fix Enum modifier bug 4. Fix an NPE bug when the connection of a scm is null --- .../lsif/core/internal/indexer/ASTUtil.java | 1 - .../core/internal/indexer/Repository.java | 4 +-- .../core/internal/visitors/LsifVisitor.java | 26 +++++++++++++++---- .../core/internal/visitors/SymbolData.java | 2 +- 4 files changed, 24 insertions(+), 9 deletions(-) diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/ASTUtil.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/ASTUtil.java index 06d8291..6a71898 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/ASTUtil.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/ASTUtil.java @@ -46,7 +46,6 @@ public static CompilationUnit createAST(final ITypeRoot input, final IProgressMo final ASTParser parser = newASTParser(); parser.setSource(input); parser.setResolveBindings(true); - parser.setBindingsRecovery(true); root[0] = (CompilationUnit) parser.createAST(progressMonitor); } // mark as unmodifiable diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Repository.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Repository.java index ef5822c..a93947d 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Repository.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Repository.java @@ -138,7 +138,7 @@ public synchronized MavenProject enlistMavenProject(LsifService lsif, File pomFi } public synchronized MavenProject enlistMavenProject(LsifService lsif, IPath path) { - // For Maven, use findPom(path, 1). For Gradle, use findPom(path, 2). + // For Maven dependency, use findPom(path, 1). For Gradle dependency, use findPom(path, 2). File pomFile = VisitorUtils.findPom(path, 2); if (pomFile == null) { return null; @@ -188,7 +188,7 @@ private SymbolData findSymbolDataById(String id) { return this.symbolDataMap.getOrDefault(id, null); } - private PackageInformation findPackageInformationById(String id) { + public PackageInformation findPackageInformationById(String id) { return this.packageInformationMap.getOrDefault(id, null); } diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/LsifVisitor.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/LsifVisitor.java index ccfc91c..037e914 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/LsifVisitor.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/LsifVisitor.java @@ -28,9 +28,12 @@ import org.eclipse.jdt.core.JavaModelException; import org.eclipse.jdt.core.dom.ASTNode; import org.eclipse.jdt.core.dom.EnumConstantDeclaration; +import org.eclipse.jdt.core.dom.EnumDeclaration; import org.eclipse.jdt.core.dom.IBinding; import org.eclipse.jdt.core.dom.MethodDeclaration; import org.eclipse.jdt.core.dom.Modifier; +import org.eclipse.jdt.core.dom.NameQualifiedType; +import org.eclipse.jdt.core.dom.QualifiedType; import org.eclipse.jdt.core.dom.SimpleName; import org.eclipse.jdt.core.dom.SimpleType; import org.eclipse.jdt.core.dom.TypeDeclaration; @@ -68,7 +71,13 @@ public boolean visit(SimpleName node) { IBinding binding = node.resolveBinding(); if (binding != null) { ASTNode parent = node.getParent(); - int modifier = (parent instanceof EnumConstantDeclaration) ? ((EnumConstantDeclaration) parent).getModifiers() : binding.getModifiers(); + int modifier = binding.getModifiers(); + if (parent instanceof EnumConstantDeclaration) { + ASTNode enumDeclaration = parent.getParent(); + if (enumDeclaration instanceof EnumDeclaration) { + modifier = ((EnumDeclaration) enumDeclaration).getModifiers(); + } + } MonikerKind monikerKind = Modifier.isPublic(modifier) ? MonikerKind.EXPORT : MonikerKind.LOCAL; resolve(node.getStartPosition(), node.getLength(), isTypeOrMethodDeclaration(node), monikerKind); } @@ -77,7 +86,12 @@ public boolean visit(SimpleName node) { @Override public boolean visit(SimpleType node) { - resolve(node.getStartPosition(), node.getLength(), isTypeOrMethodDeclaration(node), MonikerKind.IMPORT); + IBinding binding = node.resolveBinding(); + if (binding != null) { + int modifier = binding.getModifiers(); + MonikerKind monikerKind = Modifier.isPublic(modifier) ? MonikerKind.EXPORT : MonikerKind.LOCAL; + resolve(node.getStartPosition(), node.getLength(), isTypeOrMethodDeclaration(node), monikerKind); + } return false; } @@ -167,9 +181,8 @@ private void resolveMoniker(IJavaElement element, MonikerKind monikerKind, Symbo if (pathName.startsWith(JavaRuntime.JRE_CONTAINER)) { // JDK Library manager = PackageManager.JDK; - Manifest manifest = new Manifest(); if (root instanceof JarPackageFragmentRoot) { - manifest = ((JarPackageFragmentRoot) root).getManifest(); + Manifest manifest = ((JarPackageFragmentRoot) root).getManifest(); if (manifest != null) { Attributes attributes = manifest.getMainAttributes(); version = attributes.getValue("Implementation-Version"); @@ -195,7 +208,10 @@ private void resolveMoniker(IJavaElement element, MonikerKind monikerKind, Symbo Scm scm = model.getScm(); if (scm != null) { url = scm.getUrl(); - type = ScmUrlUtils.getProvider(scm.getConnection()); + String connect = scm.getConnection(); + if (StringUtils.isNotEmpty(connect)) { + type = ScmUrlUtils.getProvider(connect); + } } } } diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/SymbolData.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/SymbolData.java index 7017bde..cc8aa10 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/SymbolData.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/SymbolData.java @@ -100,7 +100,7 @@ synchronized public void generateMonikerExport(LsifService lsif, Range sourceRan if (manager == null) { return; } - PackageInformation packageInformation = Repository.getInstance().enlistPackageInformation(lsif, javaproject.getPath().toString(), "", manager, "", "", ""); + PackageInformation packageInformation = Repository.getInstance().findPackageInformationById(javaproject.getPath().toString()); if (packageInformation == null) { return; } From 57b1db56c7692ecc8a97a469919d9b2440f6d402 Mon Sep 17 00:00:00 2001 From: CS <45906942+CsCherrYY@users.noreply.github.com> Date: Tue, 1 Sep 2020 09:49:44 +0800 Subject: [PATCH 14/18] Apply changes 1. Adjust assignment of monikerKind 2. Resolve comments --- .../lsif/core/internal/indexer/Indexer.java | 25 ++- .../core/internal/visitors/LsifVisitor.java | 174 ++++++++++-------- .../core/internal/visitors/SymbolData.java | 4 +- 3 files changed, 120 insertions(+), 83 deletions(-) diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Indexer.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Indexer.java index d4e524a..fa84290 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Indexer.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Indexer.java @@ -105,10 +105,12 @@ private void buildIndex(IPath path, IProgressMonitor monitor, LsifService lsif) if (!javaProject.exists()) { continue; } - boolean isPublish = false; + boolean hasPackageInformation = false; try { - isPublish = generateExportPackageInformation(proj, monitor, lsif, javaProject); + hasPackageInformation = generateExportPackageInformation(proj, monitor, lsif, javaProject); } catch (Exception e) { + // OperationCanceledException, CoreException from WorkspaceHandler.getImporter + // GradleConnectionException, IllegalStateException from ProjectConnection.getModel JavaLanguageServerPlugin.logException(e.getMessage(), e); } @@ -119,7 +121,7 @@ private void buildIndex(IPath path, IProgressMonitor monitor, LsifService lsif) List sourceList = getAllSourceFiles(javaProject); - dumpParallelly(sourceList, threadPool, projVertex, lsif, isPublish, monitor); + dumpParallelly(sourceList, threadPool, projVertex, lsif, hasPackageInformation, monitor); VisitorUtils.endAllDocument(lsif); LsifEmitter.getInstance().emit( @@ -159,9 +161,18 @@ private List getAllSourceFiles(IJavaProject javaProject) throw return res; } + /** + * Generate and emit the package information of the given project and + * return if the project is published. + * + * @param proj the project + * @param monitor the IProgressMonitor + * @param lsif the lsif instance + * @param javaProject the javaProject of proj + * @return true if the given project is published + */ private boolean generateExportPackageInformation(IProject proj, IProgressMonitor monitor, LsifService lsif, IJavaProject javaProject) throws Exception { - boolean isPublish = false; IPath folderPath = proj.getLocation(); if (folderPath == null) { return false; @@ -184,9 +195,9 @@ private boolean generateExportPackageInformation(IProject proj, IProgressMonitor } if (StringUtils.isNotEmpty(groupId) && StringUtils.isNotEmpty(artifactId) && StringUtils.isNotEmpty(version)) { - isPublish = true; Repository.getInstance().enlistPackageInformation(lsif, javaProject.getPath().toString(), groupId + "/" + artifactId, PackageManager.MAVEN, version, type, url); + return true; } } } else if (importer instanceof GradleProjectImporter) { @@ -201,13 +212,13 @@ private boolean generateExportPackageInformation(IProject proj, IProgressMonitor String version = gradleModuleVersion.getVersion(); if (StringUtils.isNotEmpty(groupId) && StringUtils.isNotEmpty(artifactId) && StringUtils.isNotEmpty(version)) { - isPublish = true; Repository.getInstance().enlistPackageInformation(lsif, javaProject.getPath().toString(), groupId + "/" + artifactId, PackageManager.MAVEN, version, null, null); + return true; } } } - return isPublish; + return false; } private void dumpParallelly(List sourceList, ExecutorService threadPool, Project projVertex, diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/LsifVisitor.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/LsifVisitor.java index 037e914..dd38275 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/LsifVisitor.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/LsifVisitor.java @@ -32,8 +32,6 @@ import org.eclipse.jdt.core.dom.IBinding; import org.eclipse.jdt.core.dom.MethodDeclaration; import org.eclipse.jdt.core.dom.Modifier; -import org.eclipse.jdt.core.dom.NameQualifiedType; -import org.eclipse.jdt.core.dom.QualifiedType; import org.eclipse.jdt.core.dom.SimpleName; import org.eclipse.jdt.core.dom.SimpleType; import org.eclipse.jdt.core.dom.TypeDeclaration; @@ -41,12 +39,12 @@ import org.eclipse.jdt.internal.core.PackageFragmentRoot; import org.eclipse.jdt.launching.JavaRuntime; import org.eclipse.jdt.ls.core.internal.JDTUtils; +import org.eclipse.jdt.ls.core.internal.JavaLanguageServerPlugin; import org.eclipse.jdt.ls.core.internal.preferences.PreferenceManager; import org.eclipse.lsp4j.Hover; import org.eclipse.lsp4j.Location; import com.microsoft.java.lsif.core.internal.JdtlsUtils; -import com.microsoft.java.lsif.core.internal.LanguageServerIndexerPlugin; import com.microsoft.java.lsif.core.internal.indexer.IndexerContext; import com.microsoft.java.lsif.core.internal.indexer.LsifService; import com.microsoft.java.lsif.core.internal.indexer.Repository; @@ -59,108 +57,136 @@ public class LsifVisitor extends ProtocolVisitor { - private boolean isPublish; + private boolean hasPackageInformation; - public LsifVisitor(LsifService lsif, IndexerContext context, boolean isPublish) { + public LsifVisitor(LsifService lsif, IndexerContext context, boolean hasPackageInformation) { super(lsif, context); - this.isPublish = isPublish; + this.hasPackageInformation = hasPackageInformation; } @Override public boolean visit(SimpleName node) { - IBinding binding = node.resolveBinding(); - if (binding != null) { - ASTNode parent = node.getParent(); - int modifier = binding.getModifiers(); - if (parent instanceof EnumConstantDeclaration) { - ASTNode enumDeclaration = parent.getParent(); - if (enumDeclaration instanceof EnumDeclaration) { - modifier = ((EnumDeclaration) enumDeclaration).getModifiers(); + org.eclipse.lsp4j.Range sourceLspRange = new org.eclipse.lsp4j.Range(); + IJavaElement element = null; + try { + sourceLspRange = JDTUtils.toRange(this.getContext().getCompilationUnit().getTypeRoot(), + node.getStartPosition(), node.getLength()); + element = JDTUtils.findElementAtSelection(this.getContext().getCompilationUnit().getTypeRoot(), + sourceLspRange.getStart().getLine(), sourceLspRange.getStart().getCharacter(), + new PreferenceManager(), new NullProgressMonitor()); + } catch (JavaModelException e) { + JavaLanguageServerPlugin.logException(e.getMessage(), e); + } + if (element == null) { + return false; + } + IClassFile cf = (IClassFile) element.getAncestor(IJavaElement.CLASS_FILE); + if (cf != null) { + resolve(isTypeOrMethodDeclaration(node), MonikerKind.IMPORT, element, sourceLspRange, cf); + } else { + IBinding binding = node.resolveBinding(); + if (binding != null) { + ASTNode parent = node.getParent(); + int modifier = binding.getModifiers(); + if (parent instanceof EnumConstantDeclaration) { + ASTNode enumDeclaration = parent.getParent(); + if (enumDeclaration instanceof EnumDeclaration) { + modifier = ((EnumDeclaration) enumDeclaration).getModifiers(); + } } + MonikerKind monikerKind = Modifier.isPublic(modifier) ? MonikerKind.EXPORT : MonikerKind.LOCAL; + resolve(isTypeOrMethodDeclaration(node), monikerKind, element, sourceLspRange, cf); } - MonikerKind monikerKind = Modifier.isPublic(modifier) ? MonikerKind.EXPORT : MonikerKind.LOCAL; - resolve(node.getStartPosition(), node.getLength(), isTypeOrMethodDeclaration(node), monikerKind); } return false; } @Override public boolean visit(SimpleType node) { - IBinding binding = node.resolveBinding(); - if (binding != null) { - int modifier = binding.getModifiers(); - MonikerKind monikerKind = Modifier.isPublic(modifier) ? MonikerKind.EXPORT : MonikerKind.LOCAL; - resolve(node.getStartPosition(), node.getLength(), isTypeOrMethodDeclaration(node), monikerKind); - } - return false; - } - - private void resolve(int startPosition, int length, boolean needResolveImpl, MonikerKind monikerKind) { + org.eclipse.lsp4j.Range sourceLspRange = new org.eclipse.lsp4j.Range(); + IJavaElement element = null; try { - org.eclipse.lsp4j.Range sourceLspRange = JDTUtils - .toRange(this.getContext().getCompilationUnit().getTypeRoot(), startPosition, length); - - IJavaElement element = JDTUtils.findElementAtSelection(this.getContext().getCompilationUnit().getTypeRoot(), + sourceLspRange = JDTUtils.toRange(this.getContext().getCompilationUnit().getTypeRoot(), + node.getStartPosition(), node.getLength()); + element = JDTUtils.findElementAtSelection(this.getContext().getCompilationUnit().getTypeRoot(), sourceLspRange.getStart().getLine(), sourceLspRange.getStart().getCharacter(), new PreferenceManager(), new NullProgressMonitor()); - if (element == null) { - return; + } catch (JavaModelException e) { + JavaLanguageServerPlugin.logException(e.getMessage(), e); + } + if (element == null) { + return false; + } + IClassFile cf = (IClassFile) element.getAncestor(IJavaElement.CLASS_FILE); + if (cf != null) { + resolve(isTypeOrMethodDeclaration(node), MonikerKind.IMPORT, element, sourceLspRange, cf); + } else { + IBinding binding = node.resolveBinding(); + if (binding != null) { + int modifier = binding.getModifiers(); + MonikerKind monikerKind = Modifier.isPublic(modifier) ? MonikerKind.EXPORT : MonikerKind.LOCAL; + resolve(isTypeOrMethodDeclaration(node), monikerKind, element, sourceLspRange, cf); } + } + return false; + } - LsifService lsif = this.getLsif(); - Document docVertex = this.getContext().getDocVertex(); - Project projVertex = this.getContext().getProjVertex(); - Range sourceRange = Repository.getInstance().enlistRange(lsif, docVertex, sourceLspRange); + private void resolve(boolean needResolveImpl, MonikerKind monikerKind, IJavaElement element, + org.eclipse.lsp4j.Range sourceLspRange, IClassFile cf) { + LsifService lsif = this.getLsif(); + Document docVertex = this.getContext().getDocVertex(); + Project projVertex = this.getContext().getProjVertex(); + Range sourceRange = Repository.getInstance().enlistRange(lsif, docVertex, sourceLspRange); - Location definitionLocation = JdtlsUtils.getElementLocation(element); - if (definitionLocation == null) { - // no target location, only resolve hover. - Hover hover = VisitorUtils.resolveHoverInformation(docVertex, sourceRange.getStart().getLine(), - sourceRange.getStart().getCharacter()); - if (VisitorUtils.isEmptyHover(hover)) { - return; - } - ResultSet resultSet = VisitorUtils.ensureResultSet(lsif, sourceRange); - VisitorUtils.emitHoverResult(hover, lsif, resultSet); + Location definitionLocation = JdtlsUtils.getElementLocation(element); + if (definitionLocation == null) { + // no target location, only resolve hover. + Hover hover = VisitorUtils.resolveHoverInformation(docVertex, sourceRange.getStart().getLine(), + sourceRange.getStart().getCharacter()); + if (VisitorUtils.isEmptyHover(hover)) { return; } + ResultSet resultSet = VisitorUtils.ensureResultSet(lsif, sourceRange); + VisitorUtils.emitHoverResult(hover, lsif, resultSet); + return; + } - String id = VisitorUtils.createSymbolKey(definitionLocation); - Document definitionDocument = Repository.getInstance().enlistDocument(lsif, definitionLocation.getUri(), - projVertex); - SymbolData symbolData = Repository.getInstance().enlistSymbolData(id, definitionDocument, projVertex); - /* Ensure resultSet */ - symbolData.ensureResultSet(lsif, sourceRange); + String id = VisitorUtils.createSymbolKey(definitionLocation); + Document definitionDocument = Repository.getInstance().enlistDocument(lsif, definitionLocation.getUri(), + projVertex); + SymbolData symbolData = Repository.getInstance().enlistSymbolData(id, definitionDocument, projVertex); + /* Ensure resultSet */ + symbolData.ensureResultSet(lsif, sourceRange); - resolveMoniker(element, monikerKind, symbolData, definitionLocation, sourceRange); + try { + resolveMoniker(element, monikerKind, symbolData, definitionLocation, sourceRange, cf); + } catch (JavaModelException e) { + JavaLanguageServerPlugin.logException(e.getMessage(), e); + } - /* Resolve definition */ - symbolData.resolveDefinition(lsif, definitionLocation); + /* Resolve definition */ + symbolData.resolveDefinition(lsif, definitionLocation); - /* Resolve typeDefinition */ - symbolData.resolveTypeDefinition(lsif, docVertex, sourceLspRange); + /* Resolve typeDefinition */ + symbolData.resolveTypeDefinition(lsif, docVertex, sourceLspRange); - /* Resolve implementation */ - if (needResolveImpl) { - symbolData.resolveImplementation(lsif, docVertex, sourceLspRange); - } + /* Resolve implementation */ + if (needResolveImpl) { + symbolData.resolveImplementation(lsif, docVertex, sourceLspRange); + } - /* Resolve reference */ - symbolData.resolveReference(lsif, docVertex, definitionLocation, sourceRange); + /* Resolve reference */ + symbolData.resolveReference(lsif, docVertex, definitionLocation, sourceRange); - /* Resolve hover */ - symbolData.resolveHover(lsif, docVertex, sourceLspRange); - } catch (Throwable ex) { - LanguageServerIndexerPlugin.logException("Exception when dumping definition information ", ex); - } + /* Resolve hover */ + symbolData.resolveHover(lsif, docVertex, sourceLspRange); } private void resolveMoniker(IJavaElement element, MonikerKind monikerKind, SymbolData symbolData, - Location definitionLocation, Range sourceRange) throws JavaModelException { + Location definitionLocation, Range sourceRange, IClassFile cf) throws JavaModelException { LsifService lsif = this.getLsif(); IJavaProject javaProject = element.getJavaProject(); - IClassFile cf = (IClassFile) element.getAncestor(IJavaElement.CLASS_FILE); PackageManager manager = null; String packageName = ""; String version = ""; @@ -169,7 +195,7 @@ private void resolveMoniker(IJavaElement element, MonikerKind monikerKind, Symbo // Export Monikers if (cf == null) { - if (monikerKind == MonikerKind.EXPORT && this.isPublish) { + if (monikerKind == MonikerKind.EXPORT && this.hasPackageInformation) { manager = PackageManager.MAVEN; } } else { @@ -220,10 +246,8 @@ private void resolveMoniker(IJavaElement element, MonikerKind monikerKind, Symbo String identifier = this.getMonikerIdentifier(element); /* Generate Moniker */ if (StringUtils.isNotEmpty(identifier)) { - if (definitionLocation.getUri().startsWith("jdt")) { - if (StringUtils.isNotEmpty(packageName) && StringUtils.isNotEmpty(version)) { - symbolData.generateMonikerImport(lsif, sourceRange, identifier, packageName, manager, version, type, url); - } + if (monikerKind == MonikerKind.IMPORT) { + symbolData.generateMonikerImport(lsif, sourceRange, identifier, packageName, manager, version, type, url); } else if (monikerKind == MonikerKind.EXPORT) { symbolData.generateMonikerExport(lsif, sourceRange, identifier, manager, javaProject); } else if (monikerKind == MonikerKind.LOCAL) { diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/SymbolData.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/SymbolData.java index cc8aa10..4021de3 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/SymbolData.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/SymbolData.java @@ -8,6 +8,8 @@ import java.util.List; import java.util.stream.Collectors; +import org.apache.maven.shared.utils.StringUtils; + import org.eclipse.jdt.core.IJavaProject; import org.eclipse.lsp4j.Hover; import org.eclipse.lsp4j.Location; @@ -65,7 +67,7 @@ synchronized public void generateMonikerImport(LsifService lsif, Range sourceRan LsifEmitter.getInstance().emit(groupMoniker); this.groupMoniker = groupMoniker; LsifEmitter.getInstance().emit(lsif.getEdgeBuilder().moniker(this.resultSet, this.groupMoniker)); - if (manager == null) { + if (manager == null || StringUtils.isEmpty(packageName) || StringUtils.isEmpty(version)) { return; } PackageInformation packageInformation = Repository.getInstance().enlistPackageInformation(lsif, packageName, packageName, manager, version, type, url); From 1dece7ca8adc1f4048b088d88d6f722f0a23ff92 Mon Sep 17 00:00:00 2001 From: schenqce Date: Tue, 1 Sep 2020 15:45:18 +0800 Subject: [PATCH 15/18] Apply changes 1. Extract a method to initialize manager 2. Extract a method to resolve a SimpleName/SimpleType 3. apply other comments --- .../lsif/core/internal/indexer/Indexer.java | 17 +-- .../core/internal/visitors/LsifVisitor.java | 129 +++++++++--------- 2 files changed, 76 insertions(+), 70 deletions(-) diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Indexer.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Indexer.java index fa84290..c7d878c 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Indexer.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Indexer.java @@ -110,7 +110,8 @@ private void buildIndex(IPath path, IProgressMonitor monitor, LsifService lsif) hasPackageInformation = generateExportPackageInformation(proj, monitor, lsif, javaProject); } catch (Exception e) { // OperationCanceledException, CoreException from WorkspaceHandler.getImporter - // GradleConnectionException, IllegalStateException from ProjectConnection.getModel + // GradleConnectionException, IllegalStateException from + // ProjectConnection.getModel JavaLanguageServerPlugin.logException(e.getMessage(), e); } @@ -162,14 +163,14 @@ private List getAllSourceFiles(IJavaProject javaProject) throw } /** - * Generate and emit the package information of the given project and - * return if the project is published. + * Generate and emit the package information of the given project and return if + * the project is published. * - * @param proj the project - * @param monitor the IProgressMonitor - * @param lsif the lsif instance - * @param javaProject the javaProject of proj - * @return true if the given project is published + * @param proj the project + * @param monitor the IProgressMonitor + * @param lsif the lsif instance + * @param javaProject the javaProject of proj + * @return true if the given project is published */ private boolean generateExportPackageInformation(IProject proj, IProgressMonitor monitor, LsifService lsif, IJavaProject javaProject) throws Exception { diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/LsifVisitor.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/LsifVisitor.java index dd38275..e74d82f 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/LsifVisitor.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/LsifVisitor.java @@ -66,43 +66,15 @@ public LsifVisitor(LsifService lsif, IndexerContext context, boolean hasPackageI @Override public boolean visit(SimpleName node) { - org.eclipse.lsp4j.Range sourceLspRange = new org.eclipse.lsp4j.Range(); - IJavaElement element = null; - try { - sourceLspRange = JDTUtils.toRange(this.getContext().getCompilationUnit().getTypeRoot(), - node.getStartPosition(), node.getLength()); - element = JDTUtils.findElementAtSelection(this.getContext().getCompilationUnit().getTypeRoot(), - sourceLspRange.getStart().getLine(), sourceLspRange.getStart().getCharacter(), - new PreferenceManager(), new NullProgressMonitor()); - } catch (JavaModelException e) { - JavaLanguageServerPlugin.logException(e.getMessage(), e); - } - if (element == null) { - return false; - } - IClassFile cf = (IClassFile) element.getAncestor(IJavaElement.CLASS_FILE); - if (cf != null) { - resolve(isTypeOrMethodDeclaration(node), MonikerKind.IMPORT, element, sourceLspRange, cf); - } else { - IBinding binding = node.resolveBinding(); - if (binding != null) { - ASTNode parent = node.getParent(); - int modifier = binding.getModifiers(); - if (parent instanceof EnumConstantDeclaration) { - ASTNode enumDeclaration = parent.getParent(); - if (enumDeclaration instanceof EnumDeclaration) { - modifier = ((EnumDeclaration) enumDeclaration).getModifiers(); - } - } - MonikerKind monikerKind = Modifier.isPublic(modifier) ? MonikerKind.EXPORT : MonikerKind.LOCAL; - resolve(isTypeOrMethodDeclaration(node), monikerKind, element, sourceLspRange, cf); - } - } - return false; + return visitNode(node); } @Override public boolean visit(SimpleType node) { + return visitNode(node); + } + + private boolean visitNode(ASTNode node) { org.eclipse.lsp4j.Range sourceLspRange = new org.eclipse.lsp4j.Range(); IJavaElement element = null; try { @@ -121,12 +93,25 @@ public boolean visit(SimpleType node) { if (cf != null) { resolve(isTypeOrMethodDeclaration(node), MonikerKind.IMPORT, element, sourceLspRange, cf); } else { - IBinding binding = node.resolveBinding(); - if (binding != null) { - int modifier = binding.getModifiers(); - MonikerKind monikerKind = Modifier.isPublic(modifier) ? MonikerKind.EXPORT : MonikerKind.LOCAL; - resolve(isTypeOrMethodDeclaration(node), monikerKind, element, sourceLspRange, cf); + IBinding binding; + if (node instanceof SimpleName) { + binding = ((SimpleName) node).resolveBinding(); + } else { + binding = ((SimpleType) node).resolveBinding(); } + if (binding == null) { + return false; + } + ASTNode parent = node.getParent(); + int modifier = binding.getModifiers(); + if (node instanceof SimpleName && parent instanceof EnumConstantDeclaration) { + ASTNode enumDeclaration = parent.getParent(); + if (enumDeclaration instanceof EnumDeclaration) { + modifier = ((EnumDeclaration) enumDeclaration).getModifiers(); + } + } + MonikerKind monikerKind = Modifier.isPublic(modifier) ? MonikerKind.EXPORT : MonikerKind.LOCAL; + resolve(isTypeOrMethodDeclaration(node), monikerKind, element, sourceLspRange, cf); } return false; } @@ -187,26 +172,17 @@ private void resolveMoniker(IJavaElement element, MonikerKind monikerKind, Symbo LsifService lsif = this.getLsif(); IJavaProject javaProject = element.getJavaProject(); - PackageManager manager = null; + PackageManager manager = resolveManager(cf, monikerKind, javaProject); String packageName = ""; String version = ""; String type = ""; String url = ""; - // Export Monikers - if (cf == null) { - if (monikerKind == MonikerKind.EXPORT && this.hasPackageInformation) { - manager = PackageManager.MAVEN; - } - } else { + // Import Monikers + if (cf != null) { IPath path = cf.getPath(); - IPackageFragmentRoot root = javaProject.findPackageFragmentRoot(path); - IClasspathEntry container = root.getRawClasspathEntry(); - IPath containerPath = container.getPath(); - String pathName = containerPath.toString(); - if (pathName.startsWith(JavaRuntime.JRE_CONTAINER)) { - // JDK Library - manager = PackageManager.JDK; + if (manager == PackageManager.JDK) { + IPackageFragmentRoot root = javaProject.findPackageFragmentRoot(path); if (root instanceof JarPackageFragmentRoot) { Manifest manifest = ((JarPackageFragmentRoot) root).getManifest(); if (manifest != null) { @@ -220,8 +196,7 @@ private void resolveMoniker(IJavaElement element, MonikerKind monikerKind, Symbo IModuleDescription moduleDescription = packageFragmentRoot.getAutomaticModuleDescription(); packageName = moduleDescription.getElementName(); } - } else { - manager = PackageManager.MAVEN; + } else if (manager == PackageManager.MAVEN && cf != null) { MavenProject mavenProject = Repository.getInstance().enlistMavenProject(lsif, path); if (mavenProject != null) { Model model = mavenProject.getModel(); @@ -243,28 +218,58 @@ private void resolveMoniker(IJavaElement element, MonikerKind monikerKind, Symbo } } - String identifier = this.getMonikerIdentifier(element); + String identifier = this.getJDTMonikerIdentifier(element); + if (StringUtils.isEmpty(identifier)) { + return; + } + /* Generate Moniker */ - if (StringUtils.isNotEmpty(identifier)) { - if (monikerKind == MonikerKind.IMPORT) { + switch (monikerKind) { + case IMPORT: symbolData.generateMonikerImport(lsif, sourceRange, identifier, packageName, manager, version, type, url); - } else if (monikerKind == MonikerKind.EXPORT) { + break; + case EXPORT: symbolData.generateMonikerExport(lsif, sourceRange, identifier, manager, javaProject); - } else if (monikerKind == MonikerKind.LOCAL) { + break; + case LOCAL: symbolData.generateMonikerLocal(lsif, sourceRange, identifier); + break; + default: + } + } + + private PackageManager resolveManager(IClassFile cf, MonikerKind monikerKind, IJavaProject javaProject) { + if (cf != null) { + try { + IPath path = cf.getPath(); + IPackageFragmentRoot root = javaProject.findPackageFragmentRoot(path); + IClasspathEntry container = root.getRawClasspathEntry(); + IPath containerPath = container.getPath(); + String pathName = containerPath.toString(); + if (pathName.startsWith(JavaRuntime.JRE_CONTAINER)) { + return PackageManager.JDK; + } else { + return PackageManager.MAVEN; + } + } catch (JavaModelException e) { + JavaLanguageServerPlugin.logException(e.getMessage(), e); + return null; } + } else if (monikerKind == MonikerKind.EXPORT && this.hasPackageInformation) { + return PackageManager.MAVEN; } + return null; } - private String getMonikerIdentifier(IJavaElement element) { + private String getJDTMonikerIdentifier(IJavaElement element) { String identifier = element.getElementName(); try { if (element instanceof IType) { return ((IType) element).getFullyQualifiedName(); } else if (element instanceof IField || element instanceof ILocalVariable) { - return getMonikerIdentifier(element.getParent()) + "/" + identifier; + return getJDTMonikerIdentifier(element.getParent()) + "/" + identifier; } else if (element instanceof IMethod) { - return getMonikerIdentifier(element.getParent()) + "/" + identifier + ":" + return getJDTMonikerIdentifier(element.getParent()) + "/" + identifier + ":" + ((IMethod) element).getSignature(); } } catch (JavaModelException e) { From baa070e6263c6bcea55d6295213ff315e1a8f07b Mon Sep 17 00:00:00 2001 From: schenqce Date: Tue, 1 Sep 2020 18:11:02 +0800 Subject: [PATCH 16/18] Update LsifVisitor.java Rewrite resolve logics --- .../core/internal/visitors/LsifVisitor.java | 162 +++++++++--------- 1 file changed, 81 insertions(+), 81 deletions(-) diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/LsifVisitor.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/LsifVisitor.java index e74d82f..989b29b 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/LsifVisitor.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/LsifVisitor.java @@ -66,112 +66,111 @@ public LsifVisitor(LsifService lsif, IndexerContext context, boolean hasPackageI @Override public boolean visit(SimpleName node) { - return visitNode(node); + IBinding binding = node.resolveBinding(); + if (binding == null) { + return false; + } + int modifier = binding.getModifiers(); + ASTNode parent = node.getParent(); + if (parent instanceof EnumConstantDeclaration) { + ASTNode enumDeclaration = parent.getParent(); + if (enumDeclaration instanceof EnumDeclaration) { + modifier = ((EnumDeclaration) enumDeclaration).getModifiers(); + } + } + resolve(node.getStartPosition(), node.getLength(), isTypeOrMethodDeclaration(node), modifier); + return false; } @Override public boolean visit(SimpleType node) { - return visitNode(node); + IBinding binding = node.resolveBinding(); + if (binding == null) { + return false; + } + int modifier = binding.getModifiers(); + resolve(node.getStartPosition(), node.getLength(), isTypeOrMethodDeclaration(node), modifier); + return false; } - private boolean visitNode(ASTNode node) { - org.eclipse.lsp4j.Range sourceLspRange = new org.eclipse.lsp4j.Range(); - IJavaElement element = null; + private void resolve(int startPosition, int length, boolean needResolveImpl, int modifier) { try { - sourceLspRange = JDTUtils.toRange(this.getContext().getCompilationUnit().getTypeRoot(), - node.getStartPosition(), node.getLength()); - element = JDTUtils.findElementAtSelection(this.getContext().getCompilationUnit().getTypeRoot(), + org.eclipse.lsp4j.Range sourceLspRange = JDTUtils + .toRange(this.getContext().getCompilationUnit().getTypeRoot(), startPosition, length); + IJavaElement element = JDTUtils.findElementAtSelection(this.getContext().getCompilationUnit().getTypeRoot(), sourceLspRange.getStart().getLine(), sourceLspRange.getStart().getCharacter(), new PreferenceManager(), new NullProgressMonitor()); - } catch (JavaModelException e) { - JavaLanguageServerPlugin.logException(e.getMessage(), e); - } - if (element == null) { - return false; - } - IClassFile cf = (IClassFile) element.getAncestor(IJavaElement.CLASS_FILE); - if (cf != null) { - resolve(isTypeOrMethodDeclaration(node), MonikerKind.IMPORT, element, sourceLspRange, cf); - } else { - IBinding binding; - if (node instanceof SimpleName) { - binding = ((SimpleName) node).resolveBinding(); - } else { - binding = ((SimpleType) node).resolveBinding(); - } - if (binding == null) { - return false; + if (element == null) { + return; } - ASTNode parent = node.getParent(); - int modifier = binding.getModifiers(); - if (node instanceof SimpleName && parent instanceof EnumConstantDeclaration) { - ASTNode enumDeclaration = parent.getParent(); - if (enumDeclaration instanceof EnumDeclaration) { - modifier = ((EnumDeclaration) enumDeclaration).getModifiers(); + LsifService lsif = this.getLsif(); + Document docVertex = this.getContext().getDocVertex(); + Project projVertex = this.getContext().getProjVertex(); + Range sourceRange = Repository.getInstance().enlistRange(lsif, docVertex, sourceLspRange); + + Location definitionLocation = JdtlsUtils.getElementLocation(element); + if (definitionLocation == null) { + // no target location, only resolve hover. + Hover hover = VisitorUtils.resolveHoverInformation(docVertex, sourceRange.getStart().getLine(), + sourceRange.getStart().getCharacter()); + if (VisitorUtils.isEmptyHover(hover)) { + return; } + ResultSet resultSet = VisitorUtils.ensureResultSet(lsif, sourceRange); + VisitorUtils.emitHoverResult(hover, lsif, resultSet); + return; } - MonikerKind monikerKind = Modifier.isPublic(modifier) ? MonikerKind.EXPORT : MonikerKind.LOCAL; - resolve(isTypeOrMethodDeclaration(node), monikerKind, element, sourceLspRange, cf); - } - return false; - } - private void resolve(boolean needResolveImpl, MonikerKind monikerKind, IJavaElement element, - org.eclipse.lsp4j.Range sourceLspRange, IClassFile cf) { - LsifService lsif = this.getLsif(); - Document docVertex = this.getContext().getDocVertex(); - Project projVertex = this.getContext().getProjVertex(); - Range sourceRange = Repository.getInstance().enlistRange(lsif, docVertex, sourceLspRange); + String id = VisitorUtils.createSymbolKey(definitionLocation); + Document definitionDocument = Repository.getInstance().enlistDocument(lsif, definitionLocation.getUri(), + projVertex); + SymbolData symbolData = Repository.getInstance().enlistSymbolData(id, definitionDocument, projVertex); + /* Ensure resultSet */ + symbolData.ensureResultSet(lsif, sourceRange); - Location definitionLocation = JdtlsUtils.getElementLocation(element); - if (definitionLocation == null) { - // no target location, only resolve hover. - Hover hover = VisitorUtils.resolveHoverInformation(docVertex, sourceRange.getStart().getLine(), - sourceRange.getStart().getCharacter()); - if (VisitorUtils.isEmptyHover(hover)) { - return; - } - ResultSet resultSet = VisitorUtils.ensureResultSet(lsif, sourceRange); - VisitorUtils.emitHoverResult(hover, lsif, resultSet); - return; - } + resolveMoniker(element, modifier, symbolData, definitionLocation, sourceRange); - String id = VisitorUtils.createSymbolKey(definitionLocation); - Document definitionDocument = Repository.getInstance().enlistDocument(lsif, definitionLocation.getUri(), - projVertex); - SymbolData symbolData = Repository.getInstance().enlistSymbolData(id, definitionDocument, projVertex); - /* Ensure resultSet */ - symbolData.ensureResultSet(lsif, sourceRange); + /* Resolve definition */ + symbolData.resolveDefinition(lsif, definitionLocation); - try { - resolveMoniker(element, monikerKind, symbolData, definitionLocation, sourceRange, cf); - } catch (JavaModelException e) { - JavaLanguageServerPlugin.logException(e.getMessage(), e); - } + /* Resolve typeDefinition */ + symbolData.resolveTypeDefinition(lsif, docVertex, sourceLspRange); - /* Resolve definition */ - symbolData.resolveDefinition(lsif, definitionLocation); + /* Resolve implementation */ + if (needResolveImpl) { + symbolData.resolveImplementation(lsif, docVertex, sourceLspRange); + } - /* Resolve typeDefinition */ - symbolData.resolveTypeDefinition(lsif, docVertex, sourceLspRange); + /* Resolve reference */ + symbolData.resolveReference(lsif, docVertex, definitionLocation, sourceRange); - /* Resolve implementation */ - if (needResolveImpl) { - symbolData.resolveImplementation(lsif, docVertex, sourceLspRange); + /* Resolve hover */ + symbolData.resolveHover(lsif, docVertex, sourceLspRange); + } catch (Exception e) { + JavaLanguageServerPlugin.logException(e.getMessage(), e); } - /* Resolve reference */ - symbolData.resolveReference(lsif, docVertex, definitionLocation, sourceRange); + } - /* Resolve hover */ - symbolData.resolveHover(lsif, docVertex, sourceLspRange); + private MonikerKind resolveMonikerKind(IClassFile cf, int modifier) { + if (cf != null) { + return MonikerKind.IMPORT; + } else { + if (Modifier.isPublic(modifier)) { + return MonikerKind.EXPORT; + } else { + return MonikerKind.LOCAL; + } + } } - private void resolveMoniker(IJavaElement element, MonikerKind monikerKind, SymbolData symbolData, - Location definitionLocation, Range sourceRange, IClassFile cf) throws JavaModelException { - LsifService lsif = this.getLsif(); + private void resolveMoniker(IJavaElement element, int modifier, SymbolData symbolData, + Location definitionLocation, Range sourceRange) throws JavaModelException { + LsifService lsif = this.getLsif(); IJavaProject javaProject = element.getJavaProject(); + IClassFile cf = (IClassFile) element.getAncestor(IJavaElement.CLASS_FILE); + MonikerKind monikerKind = resolveMonikerKind(cf, modifier); PackageManager manager = resolveManager(cf, monikerKind, javaProject); String packageName = ""; String version = ""; @@ -226,7 +225,8 @@ private void resolveMoniker(IJavaElement element, MonikerKind monikerKind, Symbo /* Generate Moniker */ switch (monikerKind) { case IMPORT: - symbolData.generateMonikerImport(lsif, sourceRange, identifier, packageName, manager, version, type, url); + symbolData.generateMonikerImport(lsif, sourceRange, identifier, packageName, manager, version, type, + url); break; case EXPORT: symbolData.generateMonikerExport(lsif, sourceRange, identifier, manager, javaProject); From cfed442fc4f0b320e409a9df3b10bd6d0eecf376 Mon Sep 17 00:00:00 2001 From: schenqce Date: Wed, 2 Sep 2020 15:23:05 +0800 Subject: [PATCH 17/18] Apply changes 1. Move `resolveMoniker` to SymbolData.java 2. NULL check once have gotten values --- .../lsif/core/internal/indexer/Indexer.java | 83 ++++--- .../core/internal/indexer/Repository.java | 22 +- .../protocol/ImportPackageMetaData.java | 21 ++ .../internal/protocol/PackageInformation.java | 2 + .../core/internal/visitors/LsifVisitor.java | 154 +------------ .../core/internal/visitors/SymbolData.java | 206 ++++++++++++++++-- 6 files changed, 270 insertions(+), 218 deletions(-) create mode 100644 com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/ImportPackageMetaData.java diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Indexer.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Indexer.java index c7d878c..b35b7f9 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Indexer.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Indexer.java @@ -48,8 +48,8 @@ import com.microsoft.java.lsif.core.internal.emitter.LsifEmitter; import com.microsoft.java.lsif.core.internal.protocol.Document; import com.microsoft.java.lsif.core.internal.protocol.Event; -import com.microsoft.java.lsif.core.internal.protocol.Project; import com.microsoft.java.lsif.core.internal.protocol.PackageInformation.PackageManager; +import com.microsoft.java.lsif.core.internal.protocol.Project; import com.microsoft.java.lsif.core.internal.visitors.DiagnosticVisitor; import com.microsoft.java.lsif.core.internal.visitors.DocumentVisitor; import com.microsoft.java.lsif.core.internal.visitors.LsifVisitor; @@ -181,49 +181,70 @@ private boolean generateExportPackageInformation(IProject proj, IProgressMonitor IProjectImporter importer = this.handler.getImporter(folderPath.toFile(), monitor); if (importer instanceof MavenProjectImporter) { File pomfile = VisitorUtils.findPom(proj.getLocation(), 0); + if (pomfile == null) { + return false; + } MavenProject mavenProject = Repository.getInstance().enlistMavenProject(lsif, pomfile); - if (mavenProject != null) { - Model model = mavenProject.getModel(); - String groupId = model.getGroupId(); - String artifactId = model.getArtifactId(); - String version = model.getVersion(); - Scm scm = model.getScm(); - String url = null; - String type = null; - if (scm != null) { - url = scm.getUrl(); - type = ScmUrlUtils.getProvider(scm.getConnection()); - } - if (StringUtils.isNotEmpty(groupId) && StringUtils.isNotEmpty(artifactId) - && StringUtils.isNotEmpty(version)) { - Repository.getInstance().enlistPackageInformation(lsif, javaProject.getPath().toString(), - groupId + "/" + artifactId, PackageManager.MAVEN, version, type, url); - return true; + if (mavenProject == null) { + return false; + } + Model model = mavenProject.getModel(); + String groupId = model.getGroupId(); + if (groupId == null) { + return false; + } + String artifactId = model.getArtifactId(); + if (artifactId == null) { + return false; + } + String version = model.getVersion(); + if (version == null) { + return false; + } + Scm scm = model.getScm(); + String url = null; + String type = null; + // scm is optional + if (scm != null) { + url = scm.getUrl(); + String connect = scm.getConnection(); + if (connect != null) { + type = ScmUrlUtils.getProvider(connect); } } + Repository.getInstance().enlistPackageInformation(lsif, javaProject.getPath().toString(), + groupId + "/" + artifactId, PackageManager.MAVEN, version, type, url); + return true; } else if (importer instanceof GradleProjectImporter) { GradleBuild build = GradleCore.getWorkspace().getBuild(proj).get(); ProjectPublications model = build .withConnection(connection -> connection.getModel(ProjectPublications.class), monitor); List publications = model.getPublications().getAll(); - if (publications.size() > 0) { - GradleModuleVersion gradleModuleVersion = publications.get(0).getId(); - String groupId = gradleModuleVersion.getGroup(); - String artifactId = gradleModuleVersion.getName(); - String version = gradleModuleVersion.getVersion(); - if (StringUtils.isNotEmpty(groupId) && StringUtils.isNotEmpty(artifactId) - && StringUtils.isNotEmpty(version)) { - Repository.getInstance().enlistPackageInformation(lsif, javaProject.getPath().toString(), - groupId + "/" + artifactId, PackageManager.MAVEN, version, null, null); - return true; - } + if (publications.size() == 0) { + return false; + } + GradleModuleVersion gradleModuleVersion = publications.get(0).getId(); + String groupId = gradleModuleVersion.getGroup(); + if (StringUtils.isEmpty(groupId)) { + return false; + } + String artifactId = gradleModuleVersion.getName(); + if (StringUtils.isEmpty(artifactId)) { + return false; + } + String version = gradleModuleVersion.getVersion(); + if (StringUtils.isEmpty(version)) { + return false; } + Repository.getInstance().enlistPackageInformation(lsif, javaProject.getPath().toString(), + groupId + "/" + artifactId, PackageManager.MAVEN, version, null, null); + return true; } return false; } private void dumpParallelly(List sourceList, ExecutorService threadPool, Project projVertex, - LsifService lsif, boolean isPublish, IProgressMonitor monitor) { + LsifService lsif, boolean hasPackageInformation, IProgressMonitor monitor) { Observable.fromIterable(sourceList) .flatMap(item -> Observable.just(item).observeOn(Schedulers.from(threadPool)).map(sourceFile -> { CompilationUnit cu = ASTUtil.createAST(sourceFile, monitor); @@ -233,7 +254,7 @@ private void dumpParallelly(List sourceList, ExecutorService t } IndexerContext context = new IndexerContext(docVertex, cu, projVertex); - LsifVisitor lsifVisitor = new LsifVisitor(lsif, context, isPublish); + LsifVisitor lsifVisitor = new LsifVisitor(lsif, context, hasPackageInformation); cu.accept(lsifVisitor); DiagnosticVisitor diagnosticVisitor = new DiagnosticVisitor(lsif, context); diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Repository.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Repository.java index a93947d..4a85b05 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Repository.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/indexer/Repository.java @@ -10,26 +10,25 @@ import java.util.Map; import java.util.concurrent.ConcurrentHashMap; +import org.apache.maven.project.MavenProject; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.jdt.ls.core.internal.JavaLanguageServerPlugin; +import org.eclipse.m2e.core.MavenPlugin; +import org.eclipse.m2e.core.embedder.IMaven; + import com.microsoft.java.lsif.core.internal.LsifUtils; import com.microsoft.java.lsif.core.internal.emitter.LsifEmitter; import com.microsoft.java.lsif.core.internal.protocol.Document; import com.microsoft.java.lsif.core.internal.protocol.Event; import com.microsoft.java.lsif.core.internal.protocol.PackageInformation; +import com.microsoft.java.lsif.core.internal.protocol.PackageInformation.PackageManager; import com.microsoft.java.lsif.core.internal.protocol.Project; import com.microsoft.java.lsif.core.internal.protocol.Range; -import com.microsoft.java.lsif.core.internal.protocol.PackageInformation.PackageManager; import com.microsoft.java.lsif.core.internal.visitors.SymbolData; import com.microsoft.java.lsif.core.internal.visitors.VisitorUtils; -import org.apache.maven.project.MavenProject; -import org.apache.maven.shared.utils.StringUtils; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.jdt.ls.core.internal.JavaLanguageServerPlugin; -import org.eclipse.m2e.core.MavenPlugin; -import org.eclipse.m2e.core.embedder.IMaven; - public class Repository { // Key: document URI @@ -113,9 +112,6 @@ public synchronized PackageInformation enlistPackageInformation(LsifService lsif PackageManager manager, String version, String type, String url) { PackageInformation packageInformation = findPackageInformationById(id); if (packageInformation == null) { - if (StringUtils.isEmpty(name)) { - return null; - } packageInformation = lsif.getVertexBuilder().packageInformation(name, manager, version, type, url); addPackageInformation(id, packageInformation); LsifEmitter.getInstance().emit(packageInformation); diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/ImportPackageMetaData.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/ImportPackageMetaData.java new file mode 100644 index 0000000..f4f4781 --- /dev/null +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/ImportPackageMetaData.java @@ -0,0 +1,21 @@ +/* -------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * ------------------------------------------------------------------------------------------ */ + +package com.microsoft.java.lsif.core.internal.protocol; + +public class ImportPackageMetaData { + + public String packageName; + public String version; + public String type; + public String url; + + public ImportPackageMetaData() { + this.packageName = ""; + this.version = ""; + this.type = ""; + this.url = ""; + } +} diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/PackageInformation.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/PackageInformation.java index 52533e9..0338656 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/PackageInformation.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/protocol/PackageInformation.java @@ -10,6 +10,8 @@ public class PackageInformation extends Vertex { public enum PackageManager { + // Both Gradle and Maven projects will publish with a pom file. + // So Manager has only two kinds, "jdk" and "maven". "maven" is likely "pom". MAVEN("maven"), JDK("jdk"); private final String manager; diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/LsifVisitor.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/LsifVisitor.java index 989b29b..6f2b580 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/LsifVisitor.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/LsifVisitor.java @@ -5,39 +5,16 @@ package com.microsoft.java.lsif.core.internal.visitors; -import java.util.jar.Attributes; -import java.util.jar.Manifest; - -import org.apache.maven.model.Model; -import org.apache.maven.model.Scm; -import org.apache.maven.project.MavenProject; -import org.apache.maven.scm.provider.ScmUrlUtils; -import org.apache.maven.shared.utils.StringUtils; -import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.jdt.core.IClassFile; -import org.eclipse.jdt.core.IClasspathEntry; -import org.eclipse.jdt.core.IField; import org.eclipse.jdt.core.IJavaElement; -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jdt.core.ILocalVariable; -import org.eclipse.jdt.core.IMethod; -import org.eclipse.jdt.core.IModuleDescription; -import org.eclipse.jdt.core.IPackageFragmentRoot; -import org.eclipse.jdt.core.IType; -import org.eclipse.jdt.core.JavaModelException; import org.eclipse.jdt.core.dom.ASTNode; import org.eclipse.jdt.core.dom.EnumConstantDeclaration; import org.eclipse.jdt.core.dom.EnumDeclaration; import org.eclipse.jdt.core.dom.IBinding; import org.eclipse.jdt.core.dom.MethodDeclaration; -import org.eclipse.jdt.core.dom.Modifier; import org.eclipse.jdt.core.dom.SimpleName; import org.eclipse.jdt.core.dom.SimpleType; import org.eclipse.jdt.core.dom.TypeDeclaration; -import org.eclipse.jdt.internal.core.JarPackageFragmentRoot; -import org.eclipse.jdt.internal.core.PackageFragmentRoot; -import org.eclipse.jdt.launching.JavaRuntime; import org.eclipse.jdt.ls.core.internal.JDTUtils; import org.eclipse.jdt.ls.core.internal.JavaLanguageServerPlugin; import org.eclipse.jdt.ls.core.internal.preferences.PreferenceManager; @@ -49,8 +26,6 @@ import com.microsoft.java.lsif.core.internal.indexer.LsifService; import com.microsoft.java.lsif.core.internal.indexer.Repository; import com.microsoft.java.lsif.core.internal.protocol.Document; -import com.microsoft.java.lsif.core.internal.protocol.Moniker.MonikerKind; -import com.microsoft.java.lsif.core.internal.protocol.PackageInformation.PackageManager; import com.microsoft.java.lsif.core.internal.protocol.Project; import com.microsoft.java.lsif.core.internal.protocol.Range; import com.microsoft.java.lsif.core.internal.protocol.ResultSet; @@ -128,7 +103,8 @@ private void resolve(int startPosition, int length, boolean needResolveImpl, int /* Ensure resultSet */ symbolData.ensureResultSet(lsif, sourceRange); - resolveMoniker(element, modifier, symbolData, definitionLocation, sourceRange); + /* Resolve moniker */ + symbolData.resolveMoniker(lsif, element, modifier, hasPackageInformation); /* Resolve definition */ symbolData.resolveDefinition(lsif, definitionLocation); @@ -152,132 +128,6 @@ private void resolve(int startPosition, int length, boolean needResolveImpl, int } - private MonikerKind resolveMonikerKind(IClassFile cf, int modifier) { - if (cf != null) { - return MonikerKind.IMPORT; - } else { - if (Modifier.isPublic(modifier)) { - return MonikerKind.EXPORT; - } else { - return MonikerKind.LOCAL; - } - } - } - - private void resolveMoniker(IJavaElement element, int modifier, SymbolData symbolData, - Location definitionLocation, Range sourceRange) throws JavaModelException { - - LsifService lsif = this.getLsif(); - IJavaProject javaProject = element.getJavaProject(); - IClassFile cf = (IClassFile) element.getAncestor(IJavaElement.CLASS_FILE); - MonikerKind monikerKind = resolveMonikerKind(cf, modifier); - PackageManager manager = resolveManager(cf, monikerKind, javaProject); - String packageName = ""; - String version = ""; - String type = ""; - String url = ""; - - // Import Monikers - if (cf != null) { - IPath path = cf.getPath(); - if (manager == PackageManager.JDK) { - IPackageFragmentRoot root = javaProject.findPackageFragmentRoot(path); - if (root instanceof JarPackageFragmentRoot) { - Manifest manifest = ((JarPackageFragmentRoot) root).getManifest(); - if (manifest != null) { - Attributes attributes = manifest.getMainAttributes(); - version = attributes.getValue("Implementation-Version"); - } - } - PackageFragmentRoot packageFragmentRoot = (PackageFragmentRoot) cf - .getAncestor(IJavaElement.PACKAGE_FRAGMENT_ROOT); - if (packageFragmentRoot != null) { - IModuleDescription moduleDescription = packageFragmentRoot.getAutomaticModuleDescription(); - packageName = moduleDescription.getElementName(); - } - } else if (manager == PackageManager.MAVEN && cf != null) { - MavenProject mavenProject = Repository.getInstance().enlistMavenProject(lsif, path); - if (mavenProject != null) { - Model model = mavenProject.getModel(); - String groupId = model.getGroupId(); - String artifactId = model.getArtifactId(); - if (StringUtils.isNotEmpty(groupId) && StringUtils.isNotEmpty(artifactId)) { - packageName = groupId + "/" + artifactId; - } - version = model.getVersion(); - Scm scm = model.getScm(); - if (scm != null) { - url = scm.getUrl(); - String connect = scm.getConnection(); - if (StringUtils.isNotEmpty(connect)) { - type = ScmUrlUtils.getProvider(connect); - } - } - } - } - } - - String identifier = this.getJDTMonikerIdentifier(element); - if (StringUtils.isEmpty(identifier)) { - return; - } - - /* Generate Moniker */ - switch (monikerKind) { - case IMPORT: - symbolData.generateMonikerImport(lsif, sourceRange, identifier, packageName, manager, version, type, - url); - break; - case EXPORT: - symbolData.generateMonikerExport(lsif, sourceRange, identifier, manager, javaProject); - break; - case LOCAL: - symbolData.generateMonikerLocal(lsif, sourceRange, identifier); - break; - default: - } - } - - private PackageManager resolveManager(IClassFile cf, MonikerKind monikerKind, IJavaProject javaProject) { - if (cf != null) { - try { - IPath path = cf.getPath(); - IPackageFragmentRoot root = javaProject.findPackageFragmentRoot(path); - IClasspathEntry container = root.getRawClasspathEntry(); - IPath containerPath = container.getPath(); - String pathName = containerPath.toString(); - if (pathName.startsWith(JavaRuntime.JRE_CONTAINER)) { - return PackageManager.JDK; - } else { - return PackageManager.MAVEN; - } - } catch (JavaModelException e) { - JavaLanguageServerPlugin.logException(e.getMessage(), e); - return null; - } - } else if (monikerKind == MonikerKind.EXPORT && this.hasPackageInformation) { - return PackageManager.MAVEN; - } - return null; - } - - private String getJDTMonikerIdentifier(IJavaElement element) { - String identifier = element.getElementName(); - try { - if (element instanceof IType) { - return ((IType) element).getFullyQualifiedName(); - } else if (element instanceof IField || element instanceof ILocalVariable) { - return getJDTMonikerIdentifier(element.getParent()) + "/" + identifier; - } else if (element instanceof IMethod) { - return getJDTMonikerIdentifier(element.getParent()) + "/" + identifier + ":" - + ((IMethod) element).getSignature(); - } - } catch (JavaModelException e) { - return ""; - } - return identifier; - } - private boolean isTypeOrMethodDeclaration(ASTNode node) { return node.getParent() instanceof TypeDeclaration || node.getParent() instanceof MethodDeclaration; } diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/SymbolData.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/SymbolData.java index 4021de3..ab4f76e 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/SymbolData.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/SymbolData.java @@ -6,11 +6,32 @@ package com.microsoft.java.lsif.core.internal.visitors; import java.util.List; +import java.util.jar.Attributes; +import java.util.jar.Manifest; import java.util.stream.Collectors; +import org.apache.maven.model.Model; +import org.apache.maven.model.Scm; +import org.apache.maven.project.MavenProject; +import org.apache.maven.scm.provider.ScmUrlUtils; import org.apache.maven.shared.utils.StringUtils; - +import org.eclipse.core.runtime.IPath; +import org.eclipse.jdt.core.IClassFile; +import org.eclipse.jdt.core.IClasspathEntry; +import org.eclipse.jdt.core.IField; +import org.eclipse.jdt.core.IJavaElement; import org.eclipse.jdt.core.IJavaProject; +import org.eclipse.jdt.core.ILocalVariable; +import org.eclipse.jdt.core.IMethod; +import org.eclipse.jdt.core.IModuleDescription; +import org.eclipse.jdt.core.IPackageFragmentRoot; +import org.eclipse.jdt.core.IType; +import org.eclipse.jdt.core.JavaModelException; +import org.eclipse.jdt.core.dom.Modifier; +import org.eclipse.jdt.internal.core.JarPackageFragmentRoot; +import org.eclipse.jdt.internal.core.PackageFragmentRoot; +import org.eclipse.jdt.launching.JavaRuntime; +import org.eclipse.jdt.ls.core.internal.JavaLanguageServerPlugin; import org.eclipse.lsp4j.Hover; import org.eclipse.lsp4j.Location; @@ -20,12 +41,13 @@ import com.microsoft.java.lsif.core.internal.protocol.DefinitionResult; import com.microsoft.java.lsif.core.internal.protocol.Document; import com.microsoft.java.lsif.core.internal.protocol.ImplementationResult; +import com.microsoft.java.lsif.core.internal.protocol.ImportPackageMetaData; import com.microsoft.java.lsif.core.internal.protocol.ItemEdge; import com.microsoft.java.lsif.core.internal.protocol.Moniker; import com.microsoft.java.lsif.core.internal.protocol.Moniker.MonikerKind; import com.microsoft.java.lsif.core.internal.protocol.Moniker.MonikerUnique; -import com.microsoft.java.lsif.core.internal.protocol.PackageInformation.PackageManager; import com.microsoft.java.lsif.core.internal.protocol.PackageInformation; +import com.microsoft.java.lsif.core.internal.protocol.PackageInformation.PackageManager; import com.microsoft.java.lsif.core.internal.protocol.Project; import com.microsoft.java.lsif.core.internal.protocol.Range; import com.microsoft.java.lsif.core.internal.protocol.ReferenceResult; @@ -59,56 +81,55 @@ synchronized public void ensureResultSet(LsifService lsif, Range sourceRange) { LsifEmitter.getInstance().emit(lsif.getEdgeBuilder().next(sourceRange, this.resultSet)); } - synchronized public void generateMonikerImport(LsifService lsif, Range sourceRange, String identifier, String packageName, PackageManager manager, String version, String type, String url) { + synchronized public void generateImportMoniker(LsifService lsif, String identifier, PackageManager manager, + String packageName, String version, String type, String url) { if (this.resultSet == null || this.groupMoniker != null || this.schemeMoniker != null) { return; } - Moniker groupMoniker = lsif.getVertexBuilder().moniker(MonikerKind.IMPORT, "jdt", identifier, MonikerUnique.GROUP); - LsifEmitter.getInstance().emit(groupMoniker); - this.groupMoniker = groupMoniker; + this.groupMoniker = lsif.getVertexBuilder().moniker(MonikerKind.IMPORT, "jdt", identifier, MonikerUnique.GROUP); + LsifEmitter.getInstance().emit(this.groupMoniker); LsifEmitter.getInstance().emit(lsif.getEdgeBuilder().moniker(this.resultSet, this.groupMoniker)); - if (manager == null || StringUtils.isEmpty(packageName) || StringUtils.isEmpty(version)) { + if (manager == null) { return; } PackageInformation packageInformation = Repository.getInstance().enlistPackageInformation(lsif, packageName, packageName, manager, version, type, url); if (packageInformation == null) { return; } - Moniker schemeMoniker = lsif.getVertexBuilder().moniker(MonikerKind.IMPORT, manager.toString(), packageInformation.getName() + "/" + identifier, MonikerUnique.SCHEME); - LsifEmitter.getInstance().emit(schemeMoniker); - this.schemeMoniker = schemeMoniker; + this.schemeMoniker = lsif.getVertexBuilder().moniker(MonikerKind.IMPORT, manager.toString(), + packageInformation.getName() + "/" + identifier, MonikerUnique.SCHEME); + LsifEmitter.getInstance().emit(this.schemeMoniker); LsifEmitter.getInstance().emit(lsif.getEdgeBuilder().packageInformation(this.schemeMoniker, packageInformation)); LsifEmitter.getInstance().emit(lsif.getEdgeBuilder().attach(this.schemeMoniker, this.groupMoniker)); } - synchronized public void generateMonikerLocal(LsifService lsif, Range sourceRange, String identifier) { + synchronized public void generateLocalMoniker(LsifService lsif, String identifier) { if (this.resultSet == null || this.groupMoniker != null || this.schemeMoniker != null) { return; } - Moniker groupMoniker = lsif.getVertexBuilder().moniker(MonikerKind.LOCAL, "jdt", identifier, MonikerUnique.GROUP); - LsifEmitter.getInstance().emit(groupMoniker); - this.groupMoniker = groupMoniker; + this.groupMoniker = lsif.getVertexBuilder().moniker(MonikerKind.LOCAL, "jdt", identifier, MonikerUnique.GROUP); + LsifEmitter.getInstance().emit(this.groupMoniker); LsifEmitter.getInstance().emit(lsif.getEdgeBuilder().moniker(this.resultSet, this.groupMoniker)); } - synchronized public void generateMonikerExport(LsifService lsif, Range sourceRange, String identifier, PackageManager manager, IJavaProject javaproject) { + synchronized public void generateExportMoniker(LsifService lsif, String identifier, PackageManager manager, + String projectPath) { if (this.resultSet == null || this.groupMoniker != null || this.schemeMoniker != null) { return; } - Moniker groupMoniker = lsif.getVertexBuilder().moniker(MonikerKind.EXPORT, "jdt", identifier, MonikerUnique.GROUP); - LsifEmitter.getInstance().emit(groupMoniker); - this.groupMoniker = groupMoniker; + this.groupMoniker = lsif.getVertexBuilder().moniker(MonikerKind.EXPORT, "jdt", identifier, MonikerUnique.GROUP); + LsifEmitter.getInstance().emit(this.groupMoniker); LsifEmitter.getInstance().emit(lsif.getEdgeBuilder().moniker(this.resultSet, this.groupMoniker)); if (manager == null) { return; } - PackageInformation packageInformation = Repository.getInstance().findPackageInformationById(javaproject.getPath().toString()); + PackageInformation packageInformation = Repository.getInstance().findPackageInformationById(projectPath); if (packageInformation == null) { return; } - Moniker schemeMoniker = lsif.getVertexBuilder().moniker(MonikerKind.EXPORT, manager.toString(), packageInformation.getName() + "/" + identifier, MonikerUnique.SCHEME); - LsifEmitter.getInstance().emit(schemeMoniker); - this.schemeMoniker = schemeMoniker; + this.schemeMoniker = lsif.getVertexBuilder().moniker(MonikerKind.EXPORT, manager.toString(), + packageInformation.getName() + "/" + identifier, MonikerUnique.SCHEME); + LsifEmitter.getInstance().emit(this.schemeMoniker); LsifEmitter.getInstance().emit(lsif.getEdgeBuilder().packageInformation(this.schemeMoniker, packageInformation)); LsifEmitter.getInstance().emit(lsif.getEdgeBuilder().attach(this.schemeMoniker, this.groupMoniker)); } @@ -199,4 +220,145 @@ synchronized public void resolveHover(LsifService lsif, Document docVertex, this.hoverResolved = true; } + public void resolveMoniker(LsifService lsif, IJavaElement element, int modifier, + boolean hasPackageInformation) throws JavaModelException { + + IJavaProject javaProject = element.getJavaProject(); + IClassFile cf = (IClassFile) element.getAncestor(IJavaElement.CLASS_FILE); + MonikerKind monikerKind = resolveMonikerKind(cf, modifier); + PackageManager manager = resolveManager(cf, monikerKind, javaProject, hasPackageInformation); + String identifier = this.getJDTMonikerIdentifier(element); + if (StringUtils.isEmpty(identifier)) { + return; + } + + switch (monikerKind) { + case IMPORT: + ImportPackageMetaData metaData = generateImportMonikerData(lsif, cf, manager, javaProject); + if (metaData == null) { + return; + } + generateImportMoniker(lsif, identifier, manager, metaData.packageName, metaData.version, metaData.type, + metaData.url); + break; + case EXPORT: + generateExportMoniker(lsif, identifier, manager, javaProject.getPath().toString()); + break; + case LOCAL: + generateLocalMoniker(lsif, identifier); + break; + default: + } + } + + private MonikerKind resolveMonikerKind(IClassFile cf, int modifier) { + if (cf != null) { + return MonikerKind.IMPORT; + } else { + if (Modifier.isPublic(modifier)) { + return MonikerKind.EXPORT; + } else { + return MonikerKind.LOCAL; + } + } + } + + private PackageManager resolveManager(IClassFile cf, MonikerKind monikerKind, IJavaProject javaProject, + boolean hasPackageInformation) { + if (cf != null) { + try { + IPath path = cf.getPath(); + IPackageFragmentRoot root = javaProject.findPackageFragmentRoot(path); + IClasspathEntry container = root.getRawClasspathEntry(); + IPath containerPath = container.getPath(); + String pathName = containerPath.toString(); + if (pathName.startsWith(JavaRuntime.JRE_CONTAINER)) { + return PackageManager.JDK; + } else { + return PackageManager.MAVEN; + } + } catch (JavaModelException e) { + JavaLanguageServerPlugin.logException(e.getMessage(), e); + } + } else if (monikerKind == MonikerKind.EXPORT && hasPackageInformation) { + return PackageManager.MAVEN; + } + return null; + } + + private String getJDTMonikerIdentifier(IJavaElement element) { + String identifier = element.getElementName(); + try { + if (element instanceof IType) { + return ((IType) element).getFullyQualifiedName(); + } else if (element instanceof IField || element instanceof ILocalVariable) { + return getJDTMonikerIdentifier(element.getParent()) + "/" + identifier; + } else if (element instanceof IMethod) { + return getJDTMonikerIdentifier(element.getParent()) + "/" + identifier + ":" + + ((IMethod) element).getSignature(); + } + } catch (JavaModelException e) { + return ""; + } + return identifier; + } + + private ImportPackageMetaData generateImportMonikerData(LsifService lsif, IClassFile cf, PackageManager manager, + IJavaProject javaProject) throws JavaModelException { + ImportPackageMetaData importPackageMetaData = new ImportPackageMetaData(); + if (cf != null) { + IPath path = cf.getPath(); + if (manager == PackageManager.JDK) { + IPackageFragmentRoot root = javaProject.findPackageFragmentRoot(path); + if (root instanceof JarPackageFragmentRoot) { + Manifest manifest = ((JarPackageFragmentRoot) root).getManifest(); + if (manifest == null) { + return null; + } + Attributes attributes = manifest.getMainAttributes(); + importPackageMetaData.version = attributes.getValue("Implementation-Version"); + if (StringUtils.isEmpty(importPackageMetaData.version)) { + return null; + } + } + PackageFragmentRoot packageFragmentRoot = (PackageFragmentRoot) cf + .getAncestor(IJavaElement.PACKAGE_FRAGMENT_ROOT); + if (packageFragmentRoot == null) { + return null; + } + IModuleDescription moduleDescription = packageFragmentRoot.getAutomaticModuleDescription(); + importPackageMetaData.packageName = moduleDescription.getElementName(); + } else if (manager == PackageManager.MAVEN) { + MavenProject mavenProject = Repository.getInstance().enlistMavenProject(lsif, path); + if (mavenProject == null) { + return null; + } + Model model = mavenProject.getModel(); + String groupId = model.getGroupId(); + if (StringUtils.isEmpty(groupId)) { + return null; + } + String artifactId = model.getArtifactId(); + if (StringUtils.isEmpty(artifactId)) { + return null; + } + importPackageMetaData.packageName = groupId + "/" + artifactId; + importPackageMetaData.version = model.getVersion(); + if (StringUtils.isEmpty(importPackageMetaData.version)) { + return null; + } + Scm scm = model.getScm(); + // scm is optional + if (scm != null) { + importPackageMetaData.url = scm.getUrl(); + String connect = scm.getConnection(); + if (StringUtils.isNotEmpty(connect)) { + importPackageMetaData.type = ScmUrlUtils.getProvider(connect); + } + } + } + } + return importPackageMetaData; + } + } From 41b55208956f801489ff6d6a7b56d9e095b71dde Mon Sep 17 00:00:00 2001 From: schenqce Date: Wed, 2 Sep 2020 16:19:44 +0800 Subject: [PATCH 18/18] Make `resolveMoniker` synchronized --- .../lsif/core/internal/visitors/SymbolData.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/SymbolData.java b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/SymbolData.java index ab4f76e..550d118 100644 --- a/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/SymbolData.java +++ b/com.microsoft.java.lsif.core/src/com/microsoft/java/lsif/core/internal/visitors/SymbolData.java @@ -66,6 +66,7 @@ public class SymbolData { private boolean typeDefinitionResolved; private boolean implementationResolved; private boolean hoverResolved; + private boolean monikerResolved; public SymbolData(Project project, Document document) { this.project = project; @@ -83,7 +84,7 @@ synchronized public void ensureResultSet(LsifService lsif, Range sourceRange) { synchronized public void generateImportMoniker(LsifService lsif, String identifier, PackageManager manager, String packageName, String version, String type, String url) { - if (this.resultSet == null || this.groupMoniker != null || this.schemeMoniker != null) { + if (this.resultSet == null) { return; } this.groupMoniker = lsif.getVertexBuilder().moniker(MonikerKind.IMPORT, "jdt", identifier, MonikerUnique.GROUP); @@ -104,7 +105,7 @@ synchronized public void generateImportMoniker(LsifService lsif, String identifi } synchronized public void generateLocalMoniker(LsifService lsif, String identifier) { - if (this.resultSet == null || this.groupMoniker != null || this.schemeMoniker != null) { + if (this.resultSet == null) { return; } this.groupMoniker = lsif.getVertexBuilder().moniker(MonikerKind.LOCAL, "jdt", identifier, MonikerUnique.GROUP); @@ -114,7 +115,7 @@ synchronized public void generateLocalMoniker(LsifService lsif, String identifie synchronized public void generateExportMoniker(LsifService lsif, String identifier, PackageManager manager, String projectPath) { - if (this.resultSet == null || this.groupMoniker != null || this.schemeMoniker != null) { + if (this.resultSet == null) { return; } this.groupMoniker = lsif.getVertexBuilder().moniker(MonikerKind.EXPORT, "jdt", identifier, MonikerUnique.GROUP); @@ -220,8 +221,11 @@ synchronized public void resolveHover(LsifService lsif, Document docVertex, this.hoverResolved = true; } - public void resolveMoniker(LsifService lsif, IJavaElement element, int modifier, + synchronized public void resolveMoniker(LsifService lsif, IJavaElement element, int modifier, boolean hasPackageInformation) throws JavaModelException { + if (this.monikerResolved) { + return; + } IJavaProject javaProject = element.getJavaProject(); IClassFile cf = (IClassFile) element.getAncestor(IJavaElement.CLASS_FILE); @@ -249,6 +253,8 @@ public void resolveMoniker(LsifService lsif, IJavaElement element, int modifier, break; default: } + + this.monikerResolved = true; } private MonikerKind resolveMonikerKind(IClassFile cf, int modifier) {