diff --git a/package-lock.json b/package-lock.json index c3d1c7863..c7385b919 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,6 +19,7 @@ "highlight.js": "^11.7.0", "inly": "4.0.8", "luxon": "^3.2.1", + "minimatch": "^10.0.1", "node-fetch": "^2.7.0", "node-html-parser": "^6.1.5", "path-exists": "4.0.0", @@ -33,7 +34,6 @@ "@cyclonedx/bom": "^4.1.0", "@types/chai": "^4.3.9", "@types/follow-redirects": "^1.14.4", - "@types/glob": "8.0.0", "@types/lodash": "^4.14.194", "@types/luxon": "^3.2.0", "@types/mocha": "10.0.0", @@ -671,6 +671,17 @@ "node-pre-gyp": "bin/node-pre-gyp" } }, + "node_modules/@mapbox/node-pre-gyp/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "optional": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, "node_modules/@mapbox/node-pre-gyp/node_modules/chownr": { "version": "2.0.0", "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/chownr/-/chownr-2.0.0.tgz", @@ -722,6 +733,19 @@ "semver": "bin/semver.js" } }, + "node_modules/@mapbox/node-pre-gyp/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "optional": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, "node_modules/@mapbox/node-pre-gyp/node_modules/minipass": { "version": "5.0.0", "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/minipass/-/minipass-5.0.0.tgz", @@ -961,16 +985,6 @@ "@types/node": "*" } }, - "node_modules/@types/glob": { - "version": "8.0.0", - "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/@types/glob/-/glob-8.0.0.tgz", - "integrity": "sha512-l6NQsDDyQUVeoTynNpC9uRvCUint/gSUXQA2euwmTuWGvPY5LSDUu6tkCtJB2SvGQlJQzLaKqcGZP4//7EDveA==", - "dev": true, - "dependencies": { - "@types/minimatch": "*", - "@types/node": "*" - } - }, "node_modules/@types/json-schema": { "version": "7.0.15", "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/@types/json-schema/-/json-schema-7.0.15.tgz", @@ -989,12 +1003,6 @@ "integrity": "sha512-TifLZlFudklWlMBfhubvgqTXRzLDI5pCbGa4P8a3wPyUQSW+1xQ5eDsreP9DWHX3tjq1ke96uYG/nwundroWcA==", "dev": true }, - "node_modules/@types/minimatch": { - "version": "5.1.2", - "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/@types/minimatch/-/minimatch-5.1.2.tgz", - "integrity": "sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==", - "dev": true - }, "node_modules/@types/mocha": { "version": "10.0.0", "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/@types/mocha/-/mocha-10.0.0.tgz", @@ -1065,6 +1073,16 @@ "keytar": "^7.7.0" } }, + "node_modules/@vscode/vsce/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, "node_modules/@vscode/vsce/node_modules/commander": { "version": "6.2.1", "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/commander/-/commander-6.2.1.tgz", @@ -1091,6 +1109,18 @@ "node": "*" } }, + "node_modules/@vscode/vsce/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, "node_modules/@vscode/webview-ui-toolkit": { "version": "1.0.0", "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/@vscode/webview-ui-toolkit/-/webview-ui-toolkit-1.0.0.tgz", @@ -1657,6 +1687,15 @@ "node": ">=8.0.0" } }, + "node_modules/bizzy/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, "node_modules/bizzy/node_modules/glob": { "version": "7.2.3", "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/glob/-/glob-7.2.3.tgz", @@ -1673,6 +1712,17 @@ "node": "*" } }, + "node_modules/bizzy/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, "node_modules/bl": { "version": "4.1.0", "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/bl/-/bl-4.1.0.tgz", @@ -1708,12 +1758,11 @@ "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==" }, "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "version": "2.0.1", + "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "balanced-match": "^1.0.0" } }, "node_modules/braces": { @@ -2252,6 +2301,16 @@ "node": ">=0.10.0" } }, + "node_modules/del/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, "node_modules/del/node_modules/glob": { "version": "7.2.3", "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/glob/-/glob-7.2.3.tgz", @@ -2286,6 +2345,18 @@ "node": ">=0.10.0" } }, + "node_modules/del/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, "node_modules/delayed-stream": { "version": "1.0.0", "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/delayed-stream/-/delayed-stream-1.0.0.tgz", @@ -2915,15 +2986,6 @@ "dev": true, "license": "BSD-2-Clause" }, - "node_modules/glob/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0" - } - }, "node_modules/glob/node_modules/minimatch": { "version": "5.1.6", "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/minimatch/-/minimatch-5.1.6.tgz", @@ -3210,6 +3272,15 @@ "node": ">=10.0.0" } }, + "node_modules/inly/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, "node_modules/inly/node_modules/glob": { "version": "7.2.3", "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/glob/-/glob-7.2.3.tgz", @@ -3226,6 +3297,17 @@ "node": "*" } }, + "node_modules/inly/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, "node_modules/inly/node_modules/readable-stream": { "version": "3.6.2", "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/readable-stream/-/readable-stream-3.6.2.tgz", @@ -3540,6 +3622,15 @@ "node": ">=10.0.0" } }, + "node_modules/jaguar/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, "node_modules/jaguar/node_modules/glob": { "version": "7.2.3", "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/glob/-/glob-7.2.3.tgz", @@ -3556,6 +3647,17 @@ "node": "*" } }, + "node_modules/jaguar/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, "node_modules/jest-sonar-reporter": { "version": "2.0.0", "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/jest-sonar-reporter/-/jest-sonar-reporter-2.0.0.tgz", @@ -4023,14 +4125,17 @@ "dev": true }, "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "version": "10.0.1", + "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/minimatch/-/minimatch-10.0.1.tgz", + "integrity": "sha512-ethXTt3SGGR+95gudmqJ1eNhRO7eGEGIgYA9vnPatK4/etz2MEVDno5GMCibdMTuBMyElzIlgxMna3K94XDIDQ==", "dependencies": { - "brace-expansion": "^1.1.7" + "brace-expansion": "^2.0.1" }, "engines": { - "node": "*" + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/minimist": { @@ -4058,14 +4163,6 @@ "node": ">= 18" } }, - "node_modules/minizlib/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dependencies": { - "balanced-match": "^1.0.0" - } - }, "node_modules/minizlib/node_modules/glob": { "version": "10.4.1", "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/glob/-/glob-10.4.1.tgz", @@ -4185,15 +4282,6 @@ "mocha": ">=3.1.2" } }, - "node_modules/mocha/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0" - } - }, "node_modules/mocha/node_modules/escape-string-regexp": { "version": "4.0.0", "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", @@ -4494,6 +4582,15 @@ "node": ">=10" } }, + "node_modules/onezip/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, "node_modules/onezip/node_modules/glob": { "version": "7.2.3", "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/glob/-/glob-7.2.3.tgz", @@ -4510,6 +4607,17 @@ "node": "*" } }, + "node_modules/onezip/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, "node_modules/openpgp": { "version": "5.11.1", "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/openpgp/-/openpgp-5.11.1.tgz", @@ -5165,6 +5273,16 @@ "rimraf": "bin.js" } }, + "node_modules/rimraf/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, "node_modules/rimraf/node_modules/glob": { "version": "7.2.3", "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/glob/-/glob-7.2.3.tgz", @@ -5182,6 +5300,18 @@ "node": "*" } }, + "node_modules/rimraf/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/run-parallel/-/run-parallel-1.2.0.tgz", @@ -5836,6 +5966,16 @@ "node": ">=8.17.0" } }, + "node_modules/tmp/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, "node_modules/tmp/node_modules/glob": { "version": "7.2.3", "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/glob/-/glob-7.2.3.tgz", @@ -5853,6 +5993,18 @@ "node": "*" } }, + "node_modules/tmp/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, "node_modules/tmp/node_modules/rimraf": { "version": "3.0.2", "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/rimraf/-/rimraf-3.0.2.tgz", @@ -6187,14 +6339,6 @@ "vscode": "^1.67.0" } }, - "node_modules/vscode-languageclient/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dependencies": { - "balanced-match": "^1.0.0" - } - }, "node_modules/vscode-languageclient/node_modules/minimatch": { "version": "5.1.6", "resolved": "https://repox.jfrog.io/artifactory/api/npm/npm/minimatch/-/minimatch-5.1.6.tgz", diff --git a/package.json b/package.json index 267a62ef8..7f9ab0df2 100644 --- a/package.json +++ b/package.json @@ -877,6 +877,7 @@ "highlight.js": "^11.7.0", "inly": "4.0.8", "luxon": "^3.2.1", + "minimatch": "^10.0.1", "node-fetch": "^2.7.0", "node-html-parser": "^6.1.5", "path-exists": "4.0.0", @@ -891,7 +892,6 @@ "@cyclonedx/bom": "^4.1.0", "@types/chai": "^4.3.9", "@types/follow-redirects": "^1.14.4", - "@types/glob": "8.0.0", "@types/lodash": "^4.14.194", "@types/luxon": "^3.2.0", "@types/mocha": "10.0.0", diff --git a/src/fileSystem/fileSystemServiceImpl.ts b/src/fileSystem/fileSystemServiceImpl.ts index 63533a8eb..3752ac871 100644 --- a/src/fileSystem/fileSystemServiceImpl.ts +++ b/src/fileSystem/fileSystemServiceImpl.ts @@ -12,6 +12,7 @@ import { Uri } from 'vscode'; import { logToSonarLintOutput } from '../util/logging'; import { FileSystemService } from './fileSystemService'; import { FileSystemSubscriber } from './fileSystemSubscriber'; +import { minimatch } from 'minimatch'; export class FileSystemServiceImpl implements FileSystemService { private static _instance: FileSystemServiceImpl; @@ -44,7 +45,7 @@ export class FileSystemServiceImpl implements FileSystemService { this.listeners.forEach(listener => listener.onFile(configScopeUri.toString(), name, fullFileUri)); } // .sonarlint folder is already handled separately, skipping it in recursive crawl - if (type === vscode.FileType.Directory && name !== '.sonarlint') { + if (type === vscode.FileType.Directory && name !== '.sonarlint' && !(await this.isFolderExcluded(fullFileUri))) { await this.listFilesRecursively(configScopeUri, fullFileUri); } } @@ -62,4 +63,21 @@ export class FileSystemServiceImpl implements FileSystemService { async didAddWorkspaceFolder(folder: vscode.WorkspaceFolder) { this.crawlDirectory(folder.uri); } + + async isFolderExcluded(folderUri: vscode.Uri): Promise { + const filesExclude = vscode.workspace.getConfiguration('files').get<{ [key: string]: boolean }>('exclude'); + const searchExclude = vscode.workspace.getConfiguration('search').get<{ [key: string]: boolean }>('exclude'); + + const isExcluded = (excludeConfig: { [key: string]: boolean } | undefined): boolean => { + if (!excludeConfig) { + return false; + } + return Object.keys(excludeConfig).some(pattern => { + const glob = new vscode.RelativePattern(vscode.workspace.workspaceFolders[0], pattern); + return excludeConfig[pattern] && minimatch(vscode.workspace.asRelativePath(folderUri), glob.pattern); + }); + }; + + return isExcluded(filesExclude) || isExcluded(searchExclude); +} }