coc-sonarlint 0.0.2 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +561 -503
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -49,10 +49,10 @@ var require_which = __commonJS({
|
|
|
49
49
|
module2.exports = which;
|
|
50
50
|
which.sync = whichSync;
|
|
51
51
|
var path3 = require("path");
|
|
52
|
-
var
|
|
52
|
+
var fs4;
|
|
53
53
|
var COLON = process.platform === "win32" ? ";" : ":";
|
|
54
54
|
var isExe;
|
|
55
|
-
var
|
|
55
|
+
var fs4 = require("fs");
|
|
56
56
|
if (process.platform == "win32") {
|
|
57
57
|
isExe = function isExe2() {
|
|
58
58
|
return true;
|
|
@@ -82,7 +82,7 @@ var require_which = __commonJS({
|
|
|
82
82
|
if (ii === ll)
|
|
83
83
|
return F(i + 1, l);
|
|
84
84
|
var ext = pathExt[ii];
|
|
85
|
-
|
|
85
|
+
fs4.stat(p + ext, function(er, stat) {
|
|
86
86
|
if (!er && stat && stat.isFile() && isExe(stat.mode, stat.uid, stat.gid)) {
|
|
87
87
|
return cb(null, p + ext);
|
|
88
88
|
}
|
|
@@ -107,7 +107,7 @@ var require_which = __commonJS({
|
|
|
107
107
|
var cur = p + pathExt[j];
|
|
108
108
|
var stat;
|
|
109
109
|
try {
|
|
110
|
-
stat =
|
|
110
|
+
stat = fs4.statSync(cur);
|
|
111
111
|
} catch (ex) {
|
|
112
112
|
}
|
|
113
113
|
if (stat && stat.isFile() && isExe(stat.mode, stat.uid, stat.gid))
|
|
@@ -761,7 +761,7 @@ var require_dist = __commonJS({
|
|
|
761
761
|
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
762
762
|
return mod && mod.__esModule ? mod : { "default": mod };
|
|
763
763
|
};
|
|
764
|
-
var
|
|
764
|
+
var fs4 = __importStar(require("fs"));
|
|
765
765
|
var path3 = __importStar(require("path"));
|
|
766
766
|
var cp2 = __importStar(require("child_process"));
|
|
767
767
|
var child_process_1 = require("child_process");
|
|
@@ -852,10 +852,10 @@ var require_dist = __commonJS({
|
|
|
852
852
|
console.error(ex);
|
|
853
853
|
}
|
|
854
854
|
}
|
|
855
|
-
proposed =
|
|
855
|
+
proposed = fs4.realpathSync(proposed);
|
|
856
856
|
proposed = path3.dirname(proposed);
|
|
857
857
|
var macUtility = path3.resolve(proposed, "java_home");
|
|
858
|
-
if (
|
|
858
|
+
if (fs4.existsSync(macUtility)) {
|
|
859
859
|
var buffer = void 0;
|
|
860
860
|
try {
|
|
861
861
|
buffer = cp2.execSync(macUtility, { cwd: proposed });
|
|
@@ -944,7 +944,7 @@ var require_dist = __commonJS({
|
|
|
944
944
|
});
|
|
945
945
|
}
|
|
946
946
|
function dirIsJavaHome(dir, javaFilename) {
|
|
947
|
-
return
|
|
947
|
+
return fs4.existsSync("" + dir) && fs4.statSync(dir).isDirectory() && fs4.existsSync(path3.resolve(dir, "bin", javaFilename));
|
|
948
948
|
}
|
|
949
949
|
module2.exports = findJavaHome2;
|
|
950
950
|
}
|
|
@@ -1010,56 +1010,56 @@ var require_polyfills = __commonJS({
|
|
|
1010
1010
|
}
|
|
1011
1011
|
var chdir;
|
|
1012
1012
|
module2.exports = patch;
|
|
1013
|
-
function patch(
|
|
1013
|
+
function patch(fs4) {
|
|
1014
1014
|
if (constants.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
|
|
1015
|
-
patchLchmod(
|
|
1016
|
-
}
|
|
1017
|
-
if (!
|
|
1018
|
-
patchLutimes(
|
|
1019
|
-
}
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
if (
|
|
1039
|
-
|
|
1015
|
+
patchLchmod(fs4);
|
|
1016
|
+
}
|
|
1017
|
+
if (!fs4.lutimes) {
|
|
1018
|
+
patchLutimes(fs4);
|
|
1019
|
+
}
|
|
1020
|
+
fs4.chown = chownFix(fs4.chown);
|
|
1021
|
+
fs4.fchown = chownFix(fs4.fchown);
|
|
1022
|
+
fs4.lchown = chownFix(fs4.lchown);
|
|
1023
|
+
fs4.chmod = chmodFix(fs4.chmod);
|
|
1024
|
+
fs4.fchmod = chmodFix(fs4.fchmod);
|
|
1025
|
+
fs4.lchmod = chmodFix(fs4.lchmod);
|
|
1026
|
+
fs4.chownSync = chownFixSync(fs4.chownSync);
|
|
1027
|
+
fs4.fchownSync = chownFixSync(fs4.fchownSync);
|
|
1028
|
+
fs4.lchownSync = chownFixSync(fs4.lchownSync);
|
|
1029
|
+
fs4.chmodSync = chmodFixSync(fs4.chmodSync);
|
|
1030
|
+
fs4.fchmodSync = chmodFixSync(fs4.fchmodSync);
|
|
1031
|
+
fs4.lchmodSync = chmodFixSync(fs4.lchmodSync);
|
|
1032
|
+
fs4.stat = statFix(fs4.stat);
|
|
1033
|
+
fs4.fstat = statFix(fs4.fstat);
|
|
1034
|
+
fs4.lstat = statFix(fs4.lstat);
|
|
1035
|
+
fs4.statSync = statFixSync(fs4.statSync);
|
|
1036
|
+
fs4.fstatSync = statFixSync(fs4.fstatSync);
|
|
1037
|
+
fs4.lstatSync = statFixSync(fs4.lstatSync);
|
|
1038
|
+
if (fs4.chmod && !fs4.lchmod) {
|
|
1039
|
+
fs4.lchmod = function(path3, mode, cb) {
|
|
1040
1040
|
if (cb)
|
|
1041
1041
|
process.nextTick(cb);
|
|
1042
1042
|
};
|
|
1043
|
-
|
|
1043
|
+
fs4.lchmodSync = function() {
|
|
1044
1044
|
};
|
|
1045
1045
|
}
|
|
1046
|
-
if (
|
|
1047
|
-
|
|
1046
|
+
if (fs4.chown && !fs4.lchown) {
|
|
1047
|
+
fs4.lchown = function(path3, uid, gid, cb) {
|
|
1048
1048
|
if (cb)
|
|
1049
1049
|
process.nextTick(cb);
|
|
1050
1050
|
};
|
|
1051
|
-
|
|
1051
|
+
fs4.lchownSync = function() {
|
|
1052
1052
|
};
|
|
1053
1053
|
}
|
|
1054
1054
|
if (platform === "win32") {
|
|
1055
|
-
|
|
1055
|
+
fs4.rename = typeof fs4.rename !== "function" ? fs4.rename : function(fs$rename) {
|
|
1056
1056
|
function rename(from, to, cb) {
|
|
1057
1057
|
var start = Date.now();
|
|
1058
1058
|
var backoff = 0;
|
|
1059
1059
|
fs$rename(from, to, function CB(er) {
|
|
1060
1060
|
if (er && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") && Date.now() - start < 6e4) {
|
|
1061
1061
|
setTimeout(function() {
|
|
1062
|
-
|
|
1062
|
+
fs4.stat(to, function(stater, st) {
|
|
1063
1063
|
if (stater && stater.code === "ENOENT")
|
|
1064
1064
|
fs$rename(from, to, CB);
|
|
1065
1065
|
else
|
|
@@ -1077,9 +1077,9 @@ var require_polyfills = __commonJS({
|
|
|
1077
1077
|
if (Object.setPrototypeOf)
|
|
1078
1078
|
Object.setPrototypeOf(rename, fs$rename);
|
|
1079
1079
|
return rename;
|
|
1080
|
-
}(
|
|
1080
|
+
}(fs4.rename);
|
|
1081
1081
|
}
|
|
1082
|
-
|
|
1082
|
+
fs4.read = typeof fs4.read !== "function" ? fs4.read : function(fs$read) {
|
|
1083
1083
|
function read(fd, buffer, offset, length, position, callback_) {
|
|
1084
1084
|
var callback;
|
|
1085
1085
|
if (callback_ && typeof callback_ === "function") {
|
|
@@ -1087,23 +1087,23 @@ var require_polyfills = __commonJS({
|
|
|
1087
1087
|
callback = function(er, _, __) {
|
|
1088
1088
|
if (er && er.code === "EAGAIN" && eagCounter < 10) {
|
|
1089
1089
|
eagCounter++;
|
|
1090
|
-
return fs$read.call(
|
|
1090
|
+
return fs$read.call(fs4, fd, buffer, offset, length, position, callback);
|
|
1091
1091
|
}
|
|
1092
1092
|
callback_.apply(this, arguments);
|
|
1093
1093
|
};
|
|
1094
1094
|
}
|
|
1095
|
-
return fs$read.call(
|
|
1095
|
+
return fs$read.call(fs4, fd, buffer, offset, length, position, callback);
|
|
1096
1096
|
}
|
|
1097
1097
|
if (Object.setPrototypeOf)
|
|
1098
1098
|
Object.setPrototypeOf(read, fs$read);
|
|
1099
1099
|
return read;
|
|
1100
|
-
}(
|
|
1101
|
-
|
|
1100
|
+
}(fs4.read);
|
|
1101
|
+
fs4.readSync = typeof fs4.readSync !== "function" ? fs4.readSync : function(fs$readSync) {
|
|
1102
1102
|
return function(fd, buffer, offset, length, position) {
|
|
1103
1103
|
var eagCounter = 0;
|
|
1104
1104
|
while (true) {
|
|
1105
1105
|
try {
|
|
1106
|
-
return fs$readSync.call(
|
|
1106
|
+
return fs$readSync.call(fs4, fd, buffer, offset, length, position);
|
|
1107
1107
|
} catch (er) {
|
|
1108
1108
|
if (er.code === "EAGAIN" && eagCounter < 10) {
|
|
1109
1109
|
eagCounter++;
|
|
@@ -1113,10 +1113,10 @@ var require_polyfills = __commonJS({
|
|
|
1113
1113
|
}
|
|
1114
1114
|
}
|
|
1115
1115
|
};
|
|
1116
|
-
}(
|
|
1117
|
-
function patchLchmod(
|
|
1118
|
-
|
|
1119
|
-
|
|
1116
|
+
}(fs4.readSync);
|
|
1117
|
+
function patchLchmod(fs5) {
|
|
1118
|
+
fs5.lchmod = function(path3, mode, callback) {
|
|
1119
|
+
fs5.open(
|
|
1120
1120
|
path3,
|
|
1121
1121
|
constants.O_WRONLY | constants.O_SYMLINK,
|
|
1122
1122
|
mode,
|
|
@@ -1126,8 +1126,8 @@ var require_polyfills = __commonJS({
|
|
|
1126
1126
|
callback(err);
|
|
1127
1127
|
return;
|
|
1128
1128
|
}
|
|
1129
|
-
|
|
1130
|
-
|
|
1129
|
+
fs5.fchmod(fd, mode, function(err2) {
|
|
1130
|
+
fs5.close(fd, function(err22) {
|
|
1131
1131
|
if (callback)
|
|
1132
1132
|
callback(err2 || err22);
|
|
1133
1133
|
});
|
|
@@ -1135,68 +1135,68 @@ var require_polyfills = __commonJS({
|
|
|
1135
1135
|
}
|
|
1136
1136
|
);
|
|
1137
1137
|
};
|
|
1138
|
-
|
|
1139
|
-
var fd =
|
|
1138
|
+
fs5.lchmodSync = function(path3, mode) {
|
|
1139
|
+
var fd = fs5.openSync(path3, constants.O_WRONLY | constants.O_SYMLINK, mode);
|
|
1140
1140
|
var threw = true;
|
|
1141
1141
|
var ret;
|
|
1142
1142
|
try {
|
|
1143
|
-
ret =
|
|
1143
|
+
ret = fs5.fchmodSync(fd, mode);
|
|
1144
1144
|
threw = false;
|
|
1145
1145
|
} finally {
|
|
1146
1146
|
if (threw) {
|
|
1147
1147
|
try {
|
|
1148
|
-
|
|
1148
|
+
fs5.closeSync(fd);
|
|
1149
1149
|
} catch (er) {
|
|
1150
1150
|
}
|
|
1151
1151
|
} else {
|
|
1152
|
-
|
|
1152
|
+
fs5.closeSync(fd);
|
|
1153
1153
|
}
|
|
1154
1154
|
}
|
|
1155
1155
|
return ret;
|
|
1156
1156
|
};
|
|
1157
1157
|
}
|
|
1158
|
-
function patchLutimes(
|
|
1159
|
-
if (constants.hasOwnProperty("O_SYMLINK") &&
|
|
1160
|
-
|
|
1161
|
-
|
|
1158
|
+
function patchLutimes(fs5) {
|
|
1159
|
+
if (constants.hasOwnProperty("O_SYMLINK") && fs5.futimes) {
|
|
1160
|
+
fs5.lutimes = function(path3, at, mt, cb) {
|
|
1161
|
+
fs5.open(path3, constants.O_SYMLINK, function(er, fd) {
|
|
1162
1162
|
if (er) {
|
|
1163
1163
|
if (cb)
|
|
1164
1164
|
cb(er);
|
|
1165
1165
|
return;
|
|
1166
1166
|
}
|
|
1167
|
-
|
|
1168
|
-
|
|
1167
|
+
fs5.futimes(fd, at, mt, function(er2) {
|
|
1168
|
+
fs5.close(fd, function(er22) {
|
|
1169
1169
|
if (cb)
|
|
1170
1170
|
cb(er2 || er22);
|
|
1171
1171
|
});
|
|
1172
1172
|
});
|
|
1173
1173
|
});
|
|
1174
1174
|
};
|
|
1175
|
-
|
|
1176
|
-
var fd =
|
|
1175
|
+
fs5.lutimesSync = function(path3, at, mt) {
|
|
1176
|
+
var fd = fs5.openSync(path3, constants.O_SYMLINK);
|
|
1177
1177
|
var ret;
|
|
1178
1178
|
var threw = true;
|
|
1179
1179
|
try {
|
|
1180
|
-
ret =
|
|
1180
|
+
ret = fs5.futimesSync(fd, at, mt);
|
|
1181
1181
|
threw = false;
|
|
1182
1182
|
} finally {
|
|
1183
1183
|
if (threw) {
|
|
1184
1184
|
try {
|
|
1185
|
-
|
|
1185
|
+
fs5.closeSync(fd);
|
|
1186
1186
|
} catch (er) {
|
|
1187
1187
|
}
|
|
1188
1188
|
} else {
|
|
1189
|
-
|
|
1189
|
+
fs5.closeSync(fd);
|
|
1190
1190
|
}
|
|
1191
1191
|
}
|
|
1192
1192
|
return ret;
|
|
1193
1193
|
};
|
|
1194
|
-
} else if (
|
|
1195
|
-
|
|
1194
|
+
} else if (fs5.futimes) {
|
|
1195
|
+
fs5.lutimes = function(_a, _b, _c, cb) {
|
|
1196
1196
|
if (cb)
|
|
1197
1197
|
process.nextTick(cb);
|
|
1198
1198
|
};
|
|
1199
|
-
|
|
1199
|
+
fs5.lutimesSync = function() {
|
|
1200
1200
|
};
|
|
1201
1201
|
}
|
|
1202
1202
|
}
|
|
@@ -1204,7 +1204,7 @@ var require_polyfills = __commonJS({
|
|
|
1204
1204
|
if (!orig)
|
|
1205
1205
|
return orig;
|
|
1206
1206
|
return function(target, mode, cb) {
|
|
1207
|
-
return orig.call(
|
|
1207
|
+
return orig.call(fs4, target, mode, function(er) {
|
|
1208
1208
|
if (chownErOk(er))
|
|
1209
1209
|
er = null;
|
|
1210
1210
|
if (cb)
|
|
@@ -1217,7 +1217,7 @@ var require_polyfills = __commonJS({
|
|
|
1217
1217
|
return orig;
|
|
1218
1218
|
return function(target, mode) {
|
|
1219
1219
|
try {
|
|
1220
|
-
return orig.call(
|
|
1220
|
+
return orig.call(fs4, target, mode);
|
|
1221
1221
|
} catch (er) {
|
|
1222
1222
|
if (!chownErOk(er))
|
|
1223
1223
|
throw er;
|
|
@@ -1228,7 +1228,7 @@ var require_polyfills = __commonJS({
|
|
|
1228
1228
|
if (!orig)
|
|
1229
1229
|
return orig;
|
|
1230
1230
|
return function(target, uid, gid, cb) {
|
|
1231
|
-
return orig.call(
|
|
1231
|
+
return orig.call(fs4, target, uid, gid, function(er) {
|
|
1232
1232
|
if (chownErOk(er))
|
|
1233
1233
|
er = null;
|
|
1234
1234
|
if (cb)
|
|
@@ -1241,7 +1241,7 @@ var require_polyfills = __commonJS({
|
|
|
1241
1241
|
return orig;
|
|
1242
1242
|
return function(target, uid, gid) {
|
|
1243
1243
|
try {
|
|
1244
|
-
return orig.call(
|
|
1244
|
+
return orig.call(fs4, target, uid, gid);
|
|
1245
1245
|
} catch (er) {
|
|
1246
1246
|
if (!chownErOk(er))
|
|
1247
1247
|
throw er;
|
|
@@ -1266,14 +1266,14 @@ var require_polyfills = __commonJS({
|
|
|
1266
1266
|
if (cb)
|
|
1267
1267
|
cb.apply(this, arguments);
|
|
1268
1268
|
}
|
|
1269
|
-
return options ? orig.call(
|
|
1269
|
+
return options ? orig.call(fs4, target, options, callback) : orig.call(fs4, target, callback);
|
|
1270
1270
|
};
|
|
1271
1271
|
}
|
|
1272
1272
|
function statFixSync(orig) {
|
|
1273
1273
|
if (!orig)
|
|
1274
1274
|
return orig;
|
|
1275
1275
|
return function(target, options) {
|
|
1276
|
-
var stats = options ? orig.call(
|
|
1276
|
+
var stats = options ? orig.call(fs4, target, options) : orig.call(fs4, target);
|
|
1277
1277
|
if (stats) {
|
|
1278
1278
|
if (stats.uid < 0)
|
|
1279
1279
|
stats.uid += 4294967296;
|
|
@@ -1304,7 +1304,7 @@ var require_legacy_streams = __commonJS({
|
|
|
1304
1304
|
"node_modules/graceful-fs/legacy-streams.js"(exports, module2) {
|
|
1305
1305
|
var Stream = require("stream").Stream;
|
|
1306
1306
|
module2.exports = legacy;
|
|
1307
|
-
function legacy(
|
|
1307
|
+
function legacy(fs4) {
|
|
1308
1308
|
return {
|
|
1309
1309
|
ReadStream,
|
|
1310
1310
|
WriteStream
|
|
@@ -1349,7 +1349,7 @@ var require_legacy_streams = __commonJS({
|
|
|
1349
1349
|
});
|
|
1350
1350
|
return;
|
|
1351
1351
|
}
|
|
1352
|
-
|
|
1352
|
+
fs4.open(this.path, this.flags, this.mode, function(err, fd) {
|
|
1353
1353
|
if (err) {
|
|
1354
1354
|
self.emit("error", err);
|
|
1355
1355
|
self.readable = false;
|
|
@@ -1389,7 +1389,7 @@ var require_legacy_streams = __commonJS({
|
|
|
1389
1389
|
this.busy = false;
|
|
1390
1390
|
this._queue = [];
|
|
1391
1391
|
if (this.fd === null) {
|
|
1392
|
-
this._open =
|
|
1392
|
+
this._open = fs4.open;
|
|
1393
1393
|
this._queue.push([this._open, this.path, this.flags, this.mode, void 0]);
|
|
1394
1394
|
this.flush();
|
|
1395
1395
|
}
|
|
@@ -1424,7 +1424,7 @@ var require_clone = __commonJS({
|
|
|
1424
1424
|
// node_modules/graceful-fs/graceful-fs.js
|
|
1425
1425
|
var require_graceful_fs = __commonJS({
|
|
1426
1426
|
"node_modules/graceful-fs/graceful-fs.js"(exports, module2) {
|
|
1427
|
-
var
|
|
1427
|
+
var fs4 = require("fs");
|
|
1428
1428
|
var polyfills = require_polyfills();
|
|
1429
1429
|
var legacy = require_legacy_streams();
|
|
1430
1430
|
var clone = require_clone();
|
|
@@ -1456,12 +1456,12 @@ var require_graceful_fs = __commonJS({
|
|
|
1456
1456
|
m = "GFS4: " + m.split(/\n/).join("\nGFS4: ");
|
|
1457
1457
|
console.error(m);
|
|
1458
1458
|
};
|
|
1459
|
-
if (!
|
|
1459
|
+
if (!fs4[gracefulQueue]) {
|
|
1460
1460
|
queue = global[gracefulQueue] || [];
|
|
1461
|
-
publishQueue(
|
|
1462
|
-
|
|
1461
|
+
publishQueue(fs4, queue);
|
|
1462
|
+
fs4.close = function(fs$close) {
|
|
1463
1463
|
function close(fd, cb) {
|
|
1464
|
-
return fs$close.call(
|
|
1464
|
+
return fs$close.call(fs4, fd, function(err) {
|
|
1465
1465
|
if (!err) {
|
|
1466
1466
|
resetQueue();
|
|
1467
1467
|
}
|
|
@@ -1473,40 +1473,40 @@ var require_graceful_fs = __commonJS({
|
|
|
1473
1473
|
value: fs$close
|
|
1474
1474
|
});
|
|
1475
1475
|
return close;
|
|
1476
|
-
}(
|
|
1477
|
-
|
|
1476
|
+
}(fs4.close);
|
|
1477
|
+
fs4.closeSync = function(fs$closeSync) {
|
|
1478
1478
|
function closeSync(fd) {
|
|
1479
|
-
fs$closeSync.apply(
|
|
1479
|
+
fs$closeSync.apply(fs4, arguments);
|
|
1480
1480
|
resetQueue();
|
|
1481
1481
|
}
|
|
1482
1482
|
Object.defineProperty(closeSync, previousSymbol, {
|
|
1483
1483
|
value: fs$closeSync
|
|
1484
1484
|
});
|
|
1485
1485
|
return closeSync;
|
|
1486
|
-
}(
|
|
1486
|
+
}(fs4.closeSync);
|
|
1487
1487
|
if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) {
|
|
1488
1488
|
process.on("exit", function() {
|
|
1489
|
-
debug(
|
|
1490
|
-
require("assert").equal(
|
|
1489
|
+
debug(fs4[gracefulQueue]);
|
|
1490
|
+
require("assert").equal(fs4[gracefulQueue].length, 0);
|
|
1491
1491
|
});
|
|
1492
1492
|
}
|
|
1493
1493
|
}
|
|
1494
1494
|
var queue;
|
|
1495
1495
|
if (!global[gracefulQueue]) {
|
|
1496
|
-
publishQueue(global,
|
|
1497
|
-
}
|
|
1498
|
-
module2.exports = patch(clone(
|
|
1499
|
-
if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !
|
|
1500
|
-
module2.exports = patch(
|
|
1501
|
-
|
|
1502
|
-
}
|
|
1503
|
-
function patch(
|
|
1504
|
-
polyfills(
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
var fs$readFile =
|
|
1509
|
-
|
|
1496
|
+
publishQueue(global, fs4[gracefulQueue]);
|
|
1497
|
+
}
|
|
1498
|
+
module2.exports = patch(clone(fs4));
|
|
1499
|
+
if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs4.__patched) {
|
|
1500
|
+
module2.exports = patch(fs4);
|
|
1501
|
+
fs4.__patched = true;
|
|
1502
|
+
}
|
|
1503
|
+
function patch(fs5) {
|
|
1504
|
+
polyfills(fs5);
|
|
1505
|
+
fs5.gracefulify = patch;
|
|
1506
|
+
fs5.createReadStream = createReadStream;
|
|
1507
|
+
fs5.createWriteStream = createWriteStream;
|
|
1508
|
+
var fs$readFile = fs5.readFile;
|
|
1509
|
+
fs5.readFile = readFile;
|
|
1510
1510
|
function readFile(path3, options, cb) {
|
|
1511
1511
|
if (typeof options === "function")
|
|
1512
1512
|
cb = options, options = null;
|
|
@@ -1522,8 +1522,8 @@ var require_graceful_fs = __commonJS({
|
|
|
1522
1522
|
});
|
|
1523
1523
|
}
|
|
1524
1524
|
}
|
|
1525
|
-
var fs$writeFile =
|
|
1526
|
-
|
|
1525
|
+
var fs$writeFile = fs5.writeFile;
|
|
1526
|
+
fs5.writeFile = writeFile;
|
|
1527
1527
|
function writeFile(path3, data, options, cb) {
|
|
1528
1528
|
if (typeof options === "function")
|
|
1529
1529
|
cb = options, options = null;
|
|
@@ -1539,9 +1539,9 @@ var require_graceful_fs = __commonJS({
|
|
|
1539
1539
|
});
|
|
1540
1540
|
}
|
|
1541
1541
|
}
|
|
1542
|
-
var fs$appendFile =
|
|
1542
|
+
var fs$appendFile = fs5.appendFile;
|
|
1543
1543
|
if (fs$appendFile)
|
|
1544
|
-
|
|
1544
|
+
fs5.appendFile = appendFile;
|
|
1545
1545
|
function appendFile(path3, data, options, cb) {
|
|
1546
1546
|
if (typeof options === "function")
|
|
1547
1547
|
cb = options, options = null;
|
|
@@ -1557,9 +1557,9 @@ var require_graceful_fs = __commonJS({
|
|
|
1557
1557
|
});
|
|
1558
1558
|
}
|
|
1559
1559
|
}
|
|
1560
|
-
var fs$copyFile =
|
|
1560
|
+
var fs$copyFile = fs5.copyFile;
|
|
1561
1561
|
if (fs$copyFile)
|
|
1562
|
-
|
|
1562
|
+
fs5.copyFile = copyFile;
|
|
1563
1563
|
function copyFile(src, dest, flags, cb) {
|
|
1564
1564
|
if (typeof flags === "function") {
|
|
1565
1565
|
cb = flags;
|
|
@@ -1577,8 +1577,8 @@ var require_graceful_fs = __commonJS({
|
|
|
1577
1577
|
});
|
|
1578
1578
|
}
|
|
1579
1579
|
}
|
|
1580
|
-
var fs$readdir =
|
|
1581
|
-
|
|
1580
|
+
var fs$readdir = fs5.readdir;
|
|
1581
|
+
fs5.readdir = readdir;
|
|
1582
1582
|
var noReaddirOptionVersions = /^v[0-5]\./;
|
|
1583
1583
|
function readdir(path3, options, cb) {
|
|
1584
1584
|
if (typeof options === "function")
|
|
@@ -1619,21 +1619,21 @@ var require_graceful_fs = __commonJS({
|
|
|
1619
1619
|
}
|
|
1620
1620
|
}
|
|
1621
1621
|
if (process.version.substr(0, 4) === "v0.8") {
|
|
1622
|
-
var legStreams = legacy(
|
|
1622
|
+
var legStreams = legacy(fs5);
|
|
1623
1623
|
ReadStream = legStreams.ReadStream;
|
|
1624
1624
|
WriteStream = legStreams.WriteStream;
|
|
1625
1625
|
}
|
|
1626
|
-
var fs$ReadStream =
|
|
1626
|
+
var fs$ReadStream = fs5.ReadStream;
|
|
1627
1627
|
if (fs$ReadStream) {
|
|
1628
1628
|
ReadStream.prototype = Object.create(fs$ReadStream.prototype);
|
|
1629
1629
|
ReadStream.prototype.open = ReadStream$open;
|
|
1630
1630
|
}
|
|
1631
|
-
var fs$WriteStream =
|
|
1631
|
+
var fs$WriteStream = fs5.WriteStream;
|
|
1632
1632
|
if (fs$WriteStream) {
|
|
1633
1633
|
WriteStream.prototype = Object.create(fs$WriteStream.prototype);
|
|
1634
1634
|
WriteStream.prototype.open = WriteStream$open;
|
|
1635
1635
|
}
|
|
1636
|
-
Object.defineProperty(
|
|
1636
|
+
Object.defineProperty(fs5, "ReadStream", {
|
|
1637
1637
|
get: function() {
|
|
1638
1638
|
return ReadStream;
|
|
1639
1639
|
},
|
|
@@ -1643,7 +1643,7 @@ var require_graceful_fs = __commonJS({
|
|
|
1643
1643
|
enumerable: true,
|
|
1644
1644
|
configurable: true
|
|
1645
1645
|
});
|
|
1646
|
-
Object.defineProperty(
|
|
1646
|
+
Object.defineProperty(fs5, "WriteStream", {
|
|
1647
1647
|
get: function() {
|
|
1648
1648
|
return WriteStream;
|
|
1649
1649
|
},
|
|
@@ -1654,7 +1654,7 @@ var require_graceful_fs = __commonJS({
|
|
|
1654
1654
|
configurable: true
|
|
1655
1655
|
});
|
|
1656
1656
|
var FileReadStream = ReadStream;
|
|
1657
|
-
Object.defineProperty(
|
|
1657
|
+
Object.defineProperty(fs5, "FileReadStream", {
|
|
1658
1658
|
get: function() {
|
|
1659
1659
|
return FileReadStream;
|
|
1660
1660
|
},
|
|
@@ -1665,7 +1665,7 @@ var require_graceful_fs = __commonJS({
|
|
|
1665
1665
|
configurable: true
|
|
1666
1666
|
});
|
|
1667
1667
|
var FileWriteStream = WriteStream;
|
|
1668
|
-
Object.defineProperty(
|
|
1668
|
+
Object.defineProperty(fs5, "FileWriteStream", {
|
|
1669
1669
|
get: function() {
|
|
1670
1670
|
return FileWriteStream;
|
|
1671
1671
|
},
|
|
@@ -1714,13 +1714,13 @@ var require_graceful_fs = __commonJS({
|
|
|
1714
1714
|
});
|
|
1715
1715
|
}
|
|
1716
1716
|
function createReadStream(path3, options) {
|
|
1717
|
-
return new
|
|
1717
|
+
return new fs5.ReadStream(path3, options);
|
|
1718
1718
|
}
|
|
1719
1719
|
function createWriteStream(path3, options) {
|
|
1720
|
-
return new
|
|
1720
|
+
return new fs5.WriteStream(path3, options);
|
|
1721
1721
|
}
|
|
1722
|
-
var fs$open =
|
|
1723
|
-
|
|
1722
|
+
var fs$open = fs5.open;
|
|
1723
|
+
fs5.open = open;
|
|
1724
1724
|
function open(path3, flags, mode, cb) {
|
|
1725
1725
|
if (typeof mode === "function")
|
|
1726
1726
|
cb = mode, mode = null;
|
|
@@ -1736,20 +1736,20 @@ var require_graceful_fs = __commonJS({
|
|
|
1736
1736
|
});
|
|
1737
1737
|
}
|
|
1738
1738
|
}
|
|
1739
|
-
return
|
|
1739
|
+
return fs5;
|
|
1740
1740
|
}
|
|
1741
1741
|
function enqueue(elem) {
|
|
1742
1742
|
debug("ENQUEUE", elem[0].name, elem[1]);
|
|
1743
|
-
|
|
1743
|
+
fs4[gracefulQueue].push(elem);
|
|
1744
1744
|
retry();
|
|
1745
1745
|
}
|
|
1746
1746
|
var retryTimer;
|
|
1747
1747
|
function resetQueue() {
|
|
1748
1748
|
var now = Date.now();
|
|
1749
|
-
for (var i = 0; i <
|
|
1750
|
-
if (
|
|
1751
|
-
|
|
1752
|
-
|
|
1749
|
+
for (var i = 0; i < fs4[gracefulQueue].length; ++i) {
|
|
1750
|
+
if (fs4[gracefulQueue][i].length > 2) {
|
|
1751
|
+
fs4[gracefulQueue][i][3] = now;
|
|
1752
|
+
fs4[gracefulQueue][i][4] = now;
|
|
1753
1753
|
}
|
|
1754
1754
|
}
|
|
1755
1755
|
retry();
|
|
@@ -1757,9 +1757,9 @@ var require_graceful_fs = __commonJS({
|
|
|
1757
1757
|
function retry() {
|
|
1758
1758
|
clearTimeout(retryTimer);
|
|
1759
1759
|
retryTimer = void 0;
|
|
1760
|
-
if (
|
|
1760
|
+
if (fs4[gracefulQueue].length === 0)
|
|
1761
1761
|
return;
|
|
1762
|
-
var elem =
|
|
1762
|
+
var elem = fs4[gracefulQueue].shift();
|
|
1763
1763
|
var fn = elem[0];
|
|
1764
1764
|
var args = elem[1];
|
|
1765
1765
|
var err = elem[2];
|
|
@@ -1781,7 +1781,7 @@ var require_graceful_fs = __commonJS({
|
|
|
1781
1781
|
debug("RETRY", fn.name, args);
|
|
1782
1782
|
fn.apply(null, args.concat([startTime]));
|
|
1783
1783
|
} else {
|
|
1784
|
-
|
|
1784
|
+
fs4[gracefulQueue].push(elem);
|
|
1785
1785
|
}
|
|
1786
1786
|
}
|
|
1787
1787
|
if (retryTimer === void 0) {
|
|
@@ -1796,7 +1796,7 @@ var require_fs = __commonJS({
|
|
|
1796
1796
|
"node_modules/fs-extra/lib/fs/index.js"(exports) {
|
|
1797
1797
|
"use strict";
|
|
1798
1798
|
var u = require_universalify().fromCallback;
|
|
1799
|
-
var
|
|
1799
|
+
var fs4 = require_graceful_fs();
|
|
1800
1800
|
var api = [
|
|
1801
1801
|
"access",
|
|
1802
1802
|
"appendFile",
|
|
@@ -1831,31 +1831,31 @@ var require_fs = __commonJS({
|
|
|
1831
1831
|
"utimes",
|
|
1832
1832
|
"writeFile"
|
|
1833
1833
|
].filter((key) => {
|
|
1834
|
-
return typeof
|
|
1834
|
+
return typeof fs4[key] === "function";
|
|
1835
1835
|
});
|
|
1836
|
-
Object.keys(
|
|
1836
|
+
Object.keys(fs4).forEach((key) => {
|
|
1837
1837
|
if (key === "promises") {
|
|
1838
1838
|
return;
|
|
1839
1839
|
}
|
|
1840
|
-
exports[key] =
|
|
1840
|
+
exports[key] = fs4[key];
|
|
1841
1841
|
});
|
|
1842
1842
|
api.forEach((method) => {
|
|
1843
|
-
exports[method] = u(
|
|
1843
|
+
exports[method] = u(fs4[method]);
|
|
1844
1844
|
});
|
|
1845
1845
|
exports.exists = function(filename, callback) {
|
|
1846
1846
|
if (typeof callback === "function") {
|
|
1847
|
-
return
|
|
1847
|
+
return fs4.exists(filename, callback);
|
|
1848
1848
|
}
|
|
1849
1849
|
return new Promise((resolve3) => {
|
|
1850
|
-
return
|
|
1850
|
+
return fs4.exists(filename, resolve3);
|
|
1851
1851
|
});
|
|
1852
1852
|
};
|
|
1853
1853
|
exports.read = function(fd, buffer, offset, length, position, callback) {
|
|
1854
1854
|
if (typeof callback === "function") {
|
|
1855
|
-
return
|
|
1855
|
+
return fs4.read(fd, buffer, offset, length, position, callback);
|
|
1856
1856
|
}
|
|
1857
1857
|
return new Promise((resolve3, reject) => {
|
|
1858
|
-
|
|
1858
|
+
fs4.read(fd, buffer, offset, length, position, (err, bytesRead, buffer2) => {
|
|
1859
1859
|
if (err)
|
|
1860
1860
|
return reject(err);
|
|
1861
1861
|
resolve3({ bytesRead, buffer: buffer2 });
|
|
@@ -1864,18 +1864,18 @@ var require_fs = __commonJS({
|
|
|
1864
1864
|
};
|
|
1865
1865
|
exports.write = function(fd, buffer, ...args) {
|
|
1866
1866
|
if (typeof args[args.length - 1] === "function") {
|
|
1867
|
-
return
|
|
1867
|
+
return fs4.write(fd, buffer, ...args);
|
|
1868
1868
|
}
|
|
1869
1869
|
return new Promise((resolve3, reject) => {
|
|
1870
|
-
|
|
1870
|
+
fs4.write(fd, buffer, ...args, (err, bytesWritten, buffer2) => {
|
|
1871
1871
|
if (err)
|
|
1872
1872
|
return reject(err);
|
|
1873
1873
|
resolve3({ bytesWritten, buffer: buffer2 });
|
|
1874
1874
|
});
|
|
1875
1875
|
});
|
|
1876
1876
|
};
|
|
1877
|
-
if (typeof
|
|
1878
|
-
exports.realpath.native = u(
|
|
1877
|
+
if (typeof fs4.realpath.native === "function") {
|
|
1878
|
+
exports.realpath.native = u(fs4.realpath.native);
|
|
1879
1879
|
}
|
|
1880
1880
|
}
|
|
1881
1881
|
});
|
|
@@ -1908,7 +1908,7 @@ var require_win32 = __commonJS({
|
|
|
1908
1908
|
var require_mkdirs = __commonJS({
|
|
1909
1909
|
"node_modules/fs-extra/lib/mkdirs/mkdirs.js"(exports, module2) {
|
|
1910
1910
|
"use strict";
|
|
1911
|
-
var
|
|
1911
|
+
var fs4 = require_graceful_fs();
|
|
1912
1912
|
var path3 = require("path");
|
|
1913
1913
|
var invalidWin32Path = require_win32().invalidWin32Path;
|
|
1914
1914
|
var o777 = parseInt("0777", 8);
|
|
@@ -1925,7 +1925,7 @@ var require_mkdirs = __commonJS({
|
|
|
1925
1925
|
return callback(errInval);
|
|
1926
1926
|
}
|
|
1927
1927
|
let mode = opts.mode;
|
|
1928
|
-
const xfs = opts.fs ||
|
|
1928
|
+
const xfs = opts.fs || fs4;
|
|
1929
1929
|
if (mode === void 0) {
|
|
1930
1930
|
mode = o777 & ~process.umask();
|
|
1931
1931
|
}
|
|
@@ -1969,7 +1969,7 @@ var require_mkdirs = __commonJS({
|
|
|
1969
1969
|
var require_mkdirs_sync = __commonJS({
|
|
1970
1970
|
"node_modules/fs-extra/lib/mkdirs/mkdirs-sync.js"(exports, module2) {
|
|
1971
1971
|
"use strict";
|
|
1972
|
-
var
|
|
1972
|
+
var fs4 = require_graceful_fs();
|
|
1973
1973
|
var path3 = require("path");
|
|
1974
1974
|
var invalidWin32Path = require_win32().invalidWin32Path;
|
|
1975
1975
|
var o777 = parseInt("0777", 8);
|
|
@@ -1978,7 +1978,7 @@ var require_mkdirs_sync = __commonJS({
|
|
|
1978
1978
|
opts = { mode: opts };
|
|
1979
1979
|
}
|
|
1980
1980
|
let mode = opts.mode;
|
|
1981
|
-
const xfs = opts.fs ||
|
|
1981
|
+
const xfs = opts.fs || fs4;
|
|
1982
1982
|
if (process.platform === "win32" && invalidWin32Path(p)) {
|
|
1983
1983
|
const errInval = new Error(p + " contains invalid WIN32 path characters.");
|
|
1984
1984
|
errInval.code = "EINVAL";
|
|
@@ -2038,36 +2038,36 @@ var require_mkdirs2 = __commonJS({
|
|
|
2038
2038
|
var require_utimes = __commonJS({
|
|
2039
2039
|
"node_modules/fs-extra/lib/util/utimes.js"(exports, module2) {
|
|
2040
2040
|
"use strict";
|
|
2041
|
-
var
|
|
2041
|
+
var fs4 = require_graceful_fs();
|
|
2042
2042
|
var os = require("os");
|
|
2043
2043
|
var path3 = require("path");
|
|
2044
2044
|
function hasMillisResSync() {
|
|
2045
2045
|
let tmpfile = path3.join("millis-test-sync" + Date.now().toString() + Math.random().toString().slice(2));
|
|
2046
2046
|
tmpfile = path3.join(os.tmpdir(), tmpfile);
|
|
2047
2047
|
const d = new Date(1435410243862);
|
|
2048
|
-
|
|
2049
|
-
const fd =
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
return
|
|
2048
|
+
fs4.writeFileSync(tmpfile, "https://github.com/jprichardson/node-fs-extra/pull/141");
|
|
2049
|
+
const fd = fs4.openSync(tmpfile, "r+");
|
|
2050
|
+
fs4.futimesSync(fd, d, d);
|
|
2051
|
+
fs4.closeSync(fd);
|
|
2052
|
+
return fs4.statSync(tmpfile).mtime > 1435410243e3;
|
|
2053
2053
|
}
|
|
2054
2054
|
function hasMillisRes(callback) {
|
|
2055
2055
|
let tmpfile = path3.join("millis-test" + Date.now().toString() + Math.random().toString().slice(2));
|
|
2056
2056
|
tmpfile = path3.join(os.tmpdir(), tmpfile);
|
|
2057
2057
|
const d = new Date(1435410243862);
|
|
2058
|
-
|
|
2058
|
+
fs4.writeFile(tmpfile, "https://github.com/jprichardson/node-fs-extra/pull/141", (err) => {
|
|
2059
2059
|
if (err)
|
|
2060
2060
|
return callback(err);
|
|
2061
|
-
|
|
2061
|
+
fs4.open(tmpfile, "r+", (err2, fd) => {
|
|
2062
2062
|
if (err2)
|
|
2063
2063
|
return callback(err2);
|
|
2064
|
-
|
|
2064
|
+
fs4.futimes(fd, d, d, (err3) => {
|
|
2065
2065
|
if (err3)
|
|
2066
2066
|
return callback(err3);
|
|
2067
|
-
|
|
2067
|
+
fs4.close(fd, (err4) => {
|
|
2068
2068
|
if (err4)
|
|
2069
2069
|
return callback(err4);
|
|
2070
|
-
|
|
2070
|
+
fs4.stat(tmpfile, (err5, stats) => {
|
|
2071
2071
|
if (err5)
|
|
2072
2072
|
return callback(err5);
|
|
2073
2073
|
callback(null, stats.mtime > 1435410243e3);
|
|
@@ -2087,11 +2087,11 @@ var require_utimes = __commonJS({
|
|
|
2087
2087
|
}
|
|
2088
2088
|
}
|
|
2089
2089
|
function utimesMillis(path4, atime, mtime, callback) {
|
|
2090
|
-
|
|
2090
|
+
fs4.open(path4, "r+", (err, fd) => {
|
|
2091
2091
|
if (err)
|
|
2092
2092
|
return callback(err);
|
|
2093
|
-
|
|
2094
|
-
|
|
2093
|
+
fs4.futimes(fd, atime, mtime, (futimesErr) => {
|
|
2094
|
+
fs4.close(fd, (closeErr) => {
|
|
2095
2095
|
if (callback)
|
|
2096
2096
|
callback(futimesErr || closeErr);
|
|
2097
2097
|
});
|
|
@@ -2099,9 +2099,9 @@ var require_utimes = __commonJS({
|
|
|
2099
2099
|
});
|
|
2100
2100
|
}
|
|
2101
2101
|
function utimesMillisSync(path4, atime, mtime) {
|
|
2102
|
-
const fd =
|
|
2103
|
-
|
|
2104
|
-
return
|
|
2102
|
+
const fd = fs4.openSync(path4, "r+");
|
|
2103
|
+
fs4.futimesSync(fd, atime, mtime);
|
|
2104
|
+
return fs4.closeSync(fd);
|
|
2105
2105
|
}
|
|
2106
2106
|
module2.exports = {
|
|
2107
2107
|
hasMillisRes,
|
|
@@ -2117,7 +2117,7 @@ var require_utimes = __commonJS({
|
|
|
2117
2117
|
var require_stat = __commonJS({
|
|
2118
2118
|
"node_modules/fs-extra/lib/util/stat.js"(exports, module2) {
|
|
2119
2119
|
"use strict";
|
|
2120
|
-
var
|
|
2120
|
+
var fs4 = require_graceful_fs();
|
|
2121
2121
|
var path3 = require("path");
|
|
2122
2122
|
var NODE_VERSION_MAJOR_WITH_BIGINT = 10;
|
|
2123
2123
|
var NODE_VERSION_MINOR_WITH_BIGINT = 5;
|
|
@@ -2142,10 +2142,10 @@ var require_stat = __commonJS({
|
|
|
2142
2142
|
}
|
|
2143
2143
|
function getStats(src, dest, cb) {
|
|
2144
2144
|
if (nodeSupportsBigInt()) {
|
|
2145
|
-
|
|
2145
|
+
fs4.stat(src, { bigint: true }, (err, srcStat) => {
|
|
2146
2146
|
if (err)
|
|
2147
2147
|
return cb(err);
|
|
2148
|
-
|
|
2148
|
+
fs4.stat(dest, { bigint: true }, (err2, destStat) => {
|
|
2149
2149
|
if (err2) {
|
|
2150
2150
|
if (err2.code === "ENOENT")
|
|
2151
2151
|
return cb(null, { srcStat, destStat: null });
|
|
@@ -2155,10 +2155,10 @@ var require_stat = __commonJS({
|
|
|
2155
2155
|
});
|
|
2156
2156
|
});
|
|
2157
2157
|
} else {
|
|
2158
|
-
|
|
2158
|
+
fs4.stat(src, (err, srcStat) => {
|
|
2159
2159
|
if (err)
|
|
2160
2160
|
return cb(err);
|
|
2161
|
-
|
|
2161
|
+
fs4.stat(dest, (err2, destStat) => {
|
|
2162
2162
|
if (err2) {
|
|
2163
2163
|
if (err2.code === "ENOENT")
|
|
2164
2164
|
return cb(null, { srcStat, destStat: null });
|
|
@@ -2172,15 +2172,15 @@ var require_stat = __commonJS({
|
|
|
2172
2172
|
function getStatsSync(src, dest) {
|
|
2173
2173
|
let srcStat, destStat;
|
|
2174
2174
|
if (nodeSupportsBigInt()) {
|
|
2175
|
-
srcStat =
|
|
2175
|
+
srcStat = fs4.statSync(src, { bigint: true });
|
|
2176
2176
|
} else {
|
|
2177
|
-
srcStat =
|
|
2177
|
+
srcStat = fs4.statSync(src);
|
|
2178
2178
|
}
|
|
2179
2179
|
try {
|
|
2180
2180
|
if (nodeSupportsBigInt()) {
|
|
2181
|
-
destStat =
|
|
2181
|
+
destStat = fs4.statSync(dest, { bigint: true });
|
|
2182
2182
|
} else {
|
|
2183
|
-
destStat =
|
|
2183
|
+
destStat = fs4.statSync(dest);
|
|
2184
2184
|
}
|
|
2185
2185
|
} catch (err) {
|
|
2186
2186
|
if (err.code === "ENOENT")
|
|
@@ -2219,7 +2219,7 @@ var require_stat = __commonJS({
|
|
|
2219
2219
|
if (destParent === srcParent || destParent === path3.parse(destParent).root)
|
|
2220
2220
|
return cb();
|
|
2221
2221
|
if (nodeSupportsBigInt()) {
|
|
2222
|
-
|
|
2222
|
+
fs4.stat(destParent, { bigint: true }, (err, destStat) => {
|
|
2223
2223
|
if (err) {
|
|
2224
2224
|
if (err.code === "ENOENT")
|
|
2225
2225
|
return cb();
|
|
@@ -2231,7 +2231,7 @@ var require_stat = __commonJS({
|
|
|
2231
2231
|
return checkParentPaths(src, srcStat, destParent, funcName, cb);
|
|
2232
2232
|
});
|
|
2233
2233
|
} else {
|
|
2234
|
-
|
|
2234
|
+
fs4.stat(destParent, (err, destStat) => {
|
|
2235
2235
|
if (err) {
|
|
2236
2236
|
if (err.code === "ENOENT")
|
|
2237
2237
|
return cb();
|
|
@@ -2252,9 +2252,9 @@ var require_stat = __commonJS({
|
|
|
2252
2252
|
let destStat;
|
|
2253
2253
|
try {
|
|
2254
2254
|
if (nodeSupportsBigInt()) {
|
|
2255
|
-
destStat =
|
|
2255
|
+
destStat = fs4.statSync(destParent, { bigint: true });
|
|
2256
2256
|
} else {
|
|
2257
|
-
destStat =
|
|
2257
|
+
destStat = fs4.statSync(destParent);
|
|
2258
2258
|
}
|
|
2259
2259
|
} catch (err) {
|
|
2260
2260
|
if (err.code === "ENOENT")
|
|
@@ -2305,7 +2305,7 @@ var require_buffer = __commonJS({
|
|
|
2305
2305
|
var require_copy_sync = __commonJS({
|
|
2306
2306
|
"node_modules/fs-extra/lib/copy-sync/copy-sync.js"(exports, module2) {
|
|
2307
2307
|
"use strict";
|
|
2308
|
-
var
|
|
2308
|
+
var fs4 = require_graceful_fs();
|
|
2309
2309
|
var path3 = require("path");
|
|
2310
2310
|
var mkdirpSync = require_mkdirs2().mkdirsSync;
|
|
2311
2311
|
var utimesSync = require_utimes().utimesMillisSync;
|
|
@@ -2330,7 +2330,7 @@ var require_copy_sync = __commonJS({
|
|
|
2330
2330
|
if (opts.filter && !opts.filter(src, dest))
|
|
2331
2331
|
return;
|
|
2332
2332
|
const destParent = path3.dirname(dest);
|
|
2333
|
-
if (!
|
|
2333
|
+
if (!fs4.existsSync(destParent))
|
|
2334
2334
|
mkdirpSync(destParent);
|
|
2335
2335
|
return startCopy(destStat, src, dest, opts);
|
|
2336
2336
|
}
|
|
@@ -2340,7 +2340,7 @@ var require_copy_sync = __commonJS({
|
|
|
2340
2340
|
return getStats(destStat, src, dest, opts);
|
|
2341
2341
|
}
|
|
2342
2342
|
function getStats(destStat, src, dest, opts) {
|
|
2343
|
-
const statSync2 = opts.dereference ?
|
|
2343
|
+
const statSync2 = opts.dereference ? fs4.statSync : fs4.lstatSync;
|
|
2344
2344
|
const srcStat = statSync2(src);
|
|
2345
2345
|
if (srcStat.isDirectory())
|
|
2346
2346
|
return onDir(srcStat, destStat, src, dest, opts);
|
|
@@ -2356,16 +2356,16 @@ var require_copy_sync = __commonJS({
|
|
|
2356
2356
|
}
|
|
2357
2357
|
function mayCopyFile(srcStat, src, dest, opts) {
|
|
2358
2358
|
if (opts.overwrite) {
|
|
2359
|
-
|
|
2359
|
+
fs4.unlinkSync(dest);
|
|
2360
2360
|
return copyFile(srcStat, src, dest, opts);
|
|
2361
2361
|
} else if (opts.errorOnExist) {
|
|
2362
2362
|
throw new Error(`'${dest}' already exists`);
|
|
2363
2363
|
}
|
|
2364
2364
|
}
|
|
2365
2365
|
function copyFile(srcStat, src, dest, opts) {
|
|
2366
|
-
if (typeof
|
|
2367
|
-
|
|
2368
|
-
|
|
2366
|
+
if (typeof fs4.copyFileSync === "function") {
|
|
2367
|
+
fs4.copyFileSync(src, dest);
|
|
2368
|
+
fs4.chmodSync(dest, srcStat.mode);
|
|
2369
2369
|
if (opts.preserveTimestamps) {
|
|
2370
2370
|
return utimesSync(dest, srcStat.atime, srcStat.mtime);
|
|
2371
2371
|
}
|
|
@@ -2376,18 +2376,18 @@ var require_copy_sync = __commonJS({
|
|
|
2376
2376
|
function copyFileFallback(srcStat, src, dest, opts) {
|
|
2377
2377
|
const BUF_LENGTH = 64 * 1024;
|
|
2378
2378
|
const _buff = require_buffer()(BUF_LENGTH);
|
|
2379
|
-
const fdr =
|
|
2380
|
-
const fdw =
|
|
2379
|
+
const fdr = fs4.openSync(src, "r");
|
|
2380
|
+
const fdw = fs4.openSync(dest, "w", srcStat.mode);
|
|
2381
2381
|
let pos = 0;
|
|
2382
2382
|
while (pos < srcStat.size) {
|
|
2383
|
-
const bytesRead =
|
|
2384
|
-
|
|
2383
|
+
const bytesRead = fs4.readSync(fdr, _buff, 0, BUF_LENGTH, pos);
|
|
2384
|
+
fs4.writeSync(fdw, _buff, 0, bytesRead);
|
|
2385
2385
|
pos += bytesRead;
|
|
2386
2386
|
}
|
|
2387
2387
|
if (opts.preserveTimestamps)
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2388
|
+
fs4.futimesSync(fdw, srcStat.atime, srcStat.mtime);
|
|
2389
|
+
fs4.closeSync(fdr);
|
|
2390
|
+
fs4.closeSync(fdw);
|
|
2391
2391
|
}
|
|
2392
2392
|
function onDir(srcStat, destStat, src, dest, opts) {
|
|
2393
2393
|
if (!destStat)
|
|
@@ -2398,12 +2398,12 @@ var require_copy_sync = __commonJS({
|
|
|
2398
2398
|
return copyDir(src, dest, opts);
|
|
2399
2399
|
}
|
|
2400
2400
|
function mkDirAndCopy(srcStat, src, dest, opts) {
|
|
2401
|
-
|
|
2401
|
+
fs4.mkdirSync(dest);
|
|
2402
2402
|
copyDir(src, dest, opts);
|
|
2403
|
-
return
|
|
2403
|
+
return fs4.chmodSync(dest, srcStat.mode);
|
|
2404
2404
|
}
|
|
2405
2405
|
function copyDir(src, dest, opts) {
|
|
2406
|
-
|
|
2406
|
+
fs4.readdirSync(src).forEach((item) => copyDirItem(item, src, dest, opts));
|
|
2407
2407
|
}
|
|
2408
2408
|
function copyDirItem(item, src, dest, opts) {
|
|
2409
2409
|
const srcItem = path3.join(src, item);
|
|
@@ -2412,19 +2412,19 @@ var require_copy_sync = __commonJS({
|
|
|
2412
2412
|
return startCopy(destStat, srcItem, destItem, opts);
|
|
2413
2413
|
}
|
|
2414
2414
|
function onLink(destStat, src, dest, opts) {
|
|
2415
|
-
let resolvedSrc =
|
|
2415
|
+
let resolvedSrc = fs4.readlinkSync(src);
|
|
2416
2416
|
if (opts.dereference) {
|
|
2417
2417
|
resolvedSrc = path3.resolve(process.cwd(), resolvedSrc);
|
|
2418
2418
|
}
|
|
2419
2419
|
if (!destStat) {
|
|
2420
|
-
return
|
|
2420
|
+
return fs4.symlinkSync(resolvedSrc, dest);
|
|
2421
2421
|
} else {
|
|
2422
2422
|
let resolvedDest;
|
|
2423
2423
|
try {
|
|
2424
|
-
resolvedDest =
|
|
2424
|
+
resolvedDest = fs4.readlinkSync(dest);
|
|
2425
2425
|
} catch (err) {
|
|
2426
2426
|
if (err.code === "EINVAL" || err.code === "UNKNOWN")
|
|
2427
|
-
return
|
|
2427
|
+
return fs4.symlinkSync(resolvedSrc, dest);
|
|
2428
2428
|
throw err;
|
|
2429
2429
|
}
|
|
2430
2430
|
if (opts.dereference) {
|
|
@@ -2433,15 +2433,15 @@ var require_copy_sync = __commonJS({
|
|
|
2433
2433
|
if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
|
|
2434
2434
|
throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`);
|
|
2435
2435
|
}
|
|
2436
|
-
if (
|
|
2436
|
+
if (fs4.statSync(dest).isDirectory() && stat.isSrcSubdir(resolvedDest, resolvedSrc)) {
|
|
2437
2437
|
throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`);
|
|
2438
2438
|
}
|
|
2439
2439
|
return copyLink(resolvedSrc, dest);
|
|
2440
2440
|
}
|
|
2441
2441
|
}
|
|
2442
2442
|
function copyLink(resolvedSrc, dest) {
|
|
2443
|
-
|
|
2444
|
-
return
|
|
2443
|
+
fs4.unlinkSync(dest);
|
|
2444
|
+
return fs4.symlinkSync(resolvedSrc, dest);
|
|
2445
2445
|
}
|
|
2446
2446
|
module2.exports = copySync;
|
|
2447
2447
|
}
|
|
@@ -2462,13 +2462,13 @@ var require_path_exists = __commonJS({
|
|
|
2462
2462
|
"node_modules/fs-extra/lib/path-exists/index.js"(exports, module2) {
|
|
2463
2463
|
"use strict";
|
|
2464
2464
|
var u = require_universalify().fromPromise;
|
|
2465
|
-
var
|
|
2465
|
+
var fs4 = require_fs();
|
|
2466
2466
|
function pathExists2(path3) {
|
|
2467
|
-
return
|
|
2467
|
+
return fs4.access(path3).then(() => true).catch(() => false);
|
|
2468
2468
|
}
|
|
2469
2469
|
module2.exports = {
|
|
2470
2470
|
pathExists: u(pathExists2),
|
|
2471
|
-
pathExistsSync:
|
|
2471
|
+
pathExistsSync: fs4.existsSync
|
|
2472
2472
|
};
|
|
2473
2473
|
}
|
|
2474
2474
|
});
|
|
@@ -2477,7 +2477,7 @@ var require_path_exists = __commonJS({
|
|
|
2477
2477
|
var require_copy = __commonJS({
|
|
2478
2478
|
"node_modules/fs-extra/lib/copy/copy.js"(exports, module2) {
|
|
2479
2479
|
"use strict";
|
|
2480
|
-
var
|
|
2480
|
+
var fs4 = require_graceful_fs();
|
|
2481
2481
|
var path3 = require("path");
|
|
2482
2482
|
var mkdirp = require_mkdirs2().mkdirs;
|
|
2483
2483
|
var pathExists2 = require_path_exists().pathExists;
|
|
@@ -2540,7 +2540,7 @@ var require_copy = __commonJS({
|
|
|
2540
2540
|
return getStats(destStat, src, dest, opts, cb);
|
|
2541
2541
|
}
|
|
2542
2542
|
function getStats(destStat, src, dest, opts, cb) {
|
|
2543
|
-
const stat2 = opts.dereference ?
|
|
2543
|
+
const stat2 = opts.dereference ? fs4.stat : fs4.lstat;
|
|
2544
2544
|
stat2(src, (err, srcStat) => {
|
|
2545
2545
|
if (err)
|
|
2546
2546
|
return cb(err);
|
|
@@ -2559,7 +2559,7 @@ var require_copy = __commonJS({
|
|
|
2559
2559
|
}
|
|
2560
2560
|
function mayCopyFile(srcStat, src, dest, opts, cb) {
|
|
2561
2561
|
if (opts.overwrite) {
|
|
2562
|
-
|
|
2562
|
+
fs4.unlink(dest, (err) => {
|
|
2563
2563
|
if (err)
|
|
2564
2564
|
return cb(err);
|
|
2565
2565
|
return copyFile(srcStat, src, dest, opts, cb);
|
|
@@ -2570,8 +2570,8 @@ var require_copy = __commonJS({
|
|
|
2570
2570
|
return cb();
|
|
2571
2571
|
}
|
|
2572
2572
|
function copyFile(srcStat, src, dest, opts, cb) {
|
|
2573
|
-
if (typeof
|
|
2574
|
-
return
|
|
2573
|
+
if (typeof fs4.copyFile === "function") {
|
|
2574
|
+
return fs4.copyFile(src, dest, (err) => {
|
|
2575
2575
|
if (err)
|
|
2576
2576
|
return cb(err);
|
|
2577
2577
|
return setDestModeAndTimestamps(srcStat, dest, opts, cb);
|
|
@@ -2580,14 +2580,14 @@ var require_copy = __commonJS({
|
|
|
2580
2580
|
return copyFileFallback(srcStat, src, dest, opts, cb);
|
|
2581
2581
|
}
|
|
2582
2582
|
function copyFileFallback(srcStat, src, dest, opts, cb) {
|
|
2583
|
-
const rs =
|
|
2583
|
+
const rs = fs4.createReadStream(src);
|
|
2584
2584
|
rs.on("error", (err) => cb(err)).once("open", () => {
|
|
2585
|
-
const ws =
|
|
2585
|
+
const ws = fs4.createWriteStream(dest, { mode: srcStat.mode });
|
|
2586
2586
|
ws.on("error", (err) => cb(err)).on("open", () => rs.pipe(ws)).once("close", () => setDestModeAndTimestamps(srcStat, dest, opts, cb));
|
|
2587
2587
|
});
|
|
2588
2588
|
}
|
|
2589
2589
|
function setDestModeAndTimestamps(srcStat, dest, opts, cb) {
|
|
2590
|
-
|
|
2590
|
+
fs4.chmod(dest, srcStat.mode, (err) => {
|
|
2591
2591
|
if (err)
|
|
2592
2592
|
return cb(err);
|
|
2593
2593
|
if (opts.preserveTimestamps) {
|
|
@@ -2605,18 +2605,18 @@ var require_copy = __commonJS({
|
|
|
2605
2605
|
return copyDir(src, dest, opts, cb);
|
|
2606
2606
|
}
|
|
2607
2607
|
function mkDirAndCopy(srcStat, src, dest, opts, cb) {
|
|
2608
|
-
|
|
2608
|
+
fs4.mkdir(dest, (err) => {
|
|
2609
2609
|
if (err)
|
|
2610
2610
|
return cb(err);
|
|
2611
2611
|
copyDir(src, dest, opts, (err2) => {
|
|
2612
2612
|
if (err2)
|
|
2613
2613
|
return cb(err2);
|
|
2614
|
-
return
|
|
2614
|
+
return fs4.chmod(dest, srcStat.mode, cb);
|
|
2615
2615
|
});
|
|
2616
2616
|
});
|
|
2617
2617
|
}
|
|
2618
2618
|
function copyDir(src, dest, opts, cb) {
|
|
2619
|
-
|
|
2619
|
+
fs4.readdir(src, (err, items) => {
|
|
2620
2620
|
if (err)
|
|
2621
2621
|
return cb(err);
|
|
2622
2622
|
return copyDirItems(items, src, dest, opts, cb);
|
|
@@ -2643,19 +2643,19 @@ var require_copy = __commonJS({
|
|
|
2643
2643
|
});
|
|
2644
2644
|
}
|
|
2645
2645
|
function onLink(destStat, src, dest, opts, cb) {
|
|
2646
|
-
|
|
2646
|
+
fs4.readlink(src, (err, resolvedSrc) => {
|
|
2647
2647
|
if (err)
|
|
2648
2648
|
return cb(err);
|
|
2649
2649
|
if (opts.dereference) {
|
|
2650
2650
|
resolvedSrc = path3.resolve(process.cwd(), resolvedSrc);
|
|
2651
2651
|
}
|
|
2652
2652
|
if (!destStat) {
|
|
2653
|
-
return
|
|
2653
|
+
return fs4.symlink(resolvedSrc, dest, cb);
|
|
2654
2654
|
} else {
|
|
2655
|
-
|
|
2655
|
+
fs4.readlink(dest, (err2, resolvedDest) => {
|
|
2656
2656
|
if (err2) {
|
|
2657
2657
|
if (err2.code === "EINVAL" || err2.code === "UNKNOWN")
|
|
2658
|
-
return
|
|
2658
|
+
return fs4.symlink(resolvedSrc, dest, cb);
|
|
2659
2659
|
return cb(err2);
|
|
2660
2660
|
}
|
|
2661
2661
|
if (opts.dereference) {
|
|
@@ -2673,10 +2673,10 @@ var require_copy = __commonJS({
|
|
|
2673
2673
|
});
|
|
2674
2674
|
}
|
|
2675
2675
|
function copyLink(resolvedSrc, dest, cb) {
|
|
2676
|
-
|
|
2676
|
+
fs4.unlink(dest, (err) => {
|
|
2677
2677
|
if (err)
|
|
2678
2678
|
return cb(err);
|
|
2679
|
-
return
|
|
2679
|
+
return fs4.symlink(resolvedSrc, dest, cb);
|
|
2680
2680
|
});
|
|
2681
2681
|
}
|
|
2682
2682
|
module2.exports = copy;
|
|
@@ -2698,7 +2698,7 @@ var require_copy2 = __commonJS({
|
|
|
2698
2698
|
var require_rimraf = __commonJS({
|
|
2699
2699
|
"node_modules/fs-extra/lib/remove/rimraf.js"(exports, module2) {
|
|
2700
2700
|
"use strict";
|
|
2701
|
-
var
|
|
2701
|
+
var fs4 = require_graceful_fs();
|
|
2702
2702
|
var path3 = require("path");
|
|
2703
2703
|
var assert = require("assert");
|
|
2704
2704
|
var isWindows2 = process.platform === "win32";
|
|
@@ -2712,9 +2712,9 @@ var require_rimraf = __commonJS({
|
|
|
2712
2712
|
"readdir"
|
|
2713
2713
|
];
|
|
2714
2714
|
methods.forEach((m) => {
|
|
2715
|
-
options[m] = options[m] ||
|
|
2715
|
+
options[m] = options[m] || fs4[m];
|
|
2716
2716
|
m = m + "Sync";
|
|
2717
|
-
options[m] = options[m] ||
|
|
2717
|
+
options[m] = options[m] || fs4[m];
|
|
2718
2718
|
});
|
|
2719
2719
|
options.maxBusyTries = options.maxBusyTries || 3;
|
|
2720
2720
|
}
|
|
@@ -2963,14 +2963,14 @@ var require_empty = __commonJS({
|
|
|
2963
2963
|
"node_modules/fs-extra/lib/empty/index.js"(exports, module2) {
|
|
2964
2964
|
"use strict";
|
|
2965
2965
|
var u = require_universalify().fromCallback;
|
|
2966
|
-
var
|
|
2966
|
+
var fs4 = require_graceful_fs();
|
|
2967
2967
|
var path3 = require("path");
|
|
2968
2968
|
var mkdir = require_mkdirs2();
|
|
2969
2969
|
var remove = require_remove();
|
|
2970
2970
|
var emptyDir = u(function emptyDir2(dir, callback) {
|
|
2971
2971
|
callback = callback || function() {
|
|
2972
2972
|
};
|
|
2973
|
-
|
|
2973
|
+
fs4.readdir(dir, (err, items) => {
|
|
2974
2974
|
if (err)
|
|
2975
2975
|
return mkdir.mkdirs(dir, callback);
|
|
2976
2976
|
items = items.map((item) => path3.join(dir, item));
|
|
@@ -2990,7 +2990,7 @@ var require_empty = __commonJS({
|
|
|
2990
2990
|
function emptyDirSync(dir) {
|
|
2991
2991
|
let items;
|
|
2992
2992
|
try {
|
|
2993
|
-
items =
|
|
2993
|
+
items = fs4.readdirSync(dir);
|
|
2994
2994
|
} catch (err) {
|
|
2995
2995
|
return mkdir.mkdirsSync(dir);
|
|
2996
2996
|
}
|
|
@@ -3014,18 +3014,18 @@ var require_file = __commonJS({
|
|
|
3014
3014
|
"use strict";
|
|
3015
3015
|
var u = require_universalify().fromCallback;
|
|
3016
3016
|
var path3 = require("path");
|
|
3017
|
-
var
|
|
3017
|
+
var fs4 = require_graceful_fs();
|
|
3018
3018
|
var mkdir = require_mkdirs2();
|
|
3019
3019
|
var pathExists2 = require_path_exists().pathExists;
|
|
3020
3020
|
function createFile(file, callback) {
|
|
3021
3021
|
function makeFile() {
|
|
3022
|
-
|
|
3022
|
+
fs4.writeFile(file, "", (err) => {
|
|
3023
3023
|
if (err)
|
|
3024
3024
|
return callback(err);
|
|
3025
3025
|
callback();
|
|
3026
3026
|
});
|
|
3027
3027
|
}
|
|
3028
|
-
|
|
3028
|
+
fs4.stat(file, (err, stats) => {
|
|
3029
3029
|
if (!err && stats.isFile())
|
|
3030
3030
|
return callback();
|
|
3031
3031
|
const dir = path3.dirname(file);
|
|
@@ -3045,16 +3045,16 @@ var require_file = __commonJS({
|
|
|
3045
3045
|
function createFileSync(file) {
|
|
3046
3046
|
let stats;
|
|
3047
3047
|
try {
|
|
3048
|
-
stats =
|
|
3048
|
+
stats = fs4.statSync(file);
|
|
3049
3049
|
} catch (e) {
|
|
3050
3050
|
}
|
|
3051
3051
|
if (stats && stats.isFile())
|
|
3052
3052
|
return;
|
|
3053
3053
|
const dir = path3.dirname(file);
|
|
3054
|
-
if (!
|
|
3054
|
+
if (!fs4.existsSync(dir)) {
|
|
3055
3055
|
mkdir.mkdirsSync(dir);
|
|
3056
3056
|
}
|
|
3057
|
-
|
|
3057
|
+
fs4.writeFileSync(file, "");
|
|
3058
3058
|
}
|
|
3059
3059
|
module2.exports = {
|
|
3060
3060
|
createFile: u(createFile),
|
|
@@ -3069,12 +3069,12 @@ var require_link = __commonJS({
|
|
|
3069
3069
|
"use strict";
|
|
3070
3070
|
var u = require_universalify().fromCallback;
|
|
3071
3071
|
var path3 = require("path");
|
|
3072
|
-
var
|
|
3072
|
+
var fs4 = require_graceful_fs();
|
|
3073
3073
|
var mkdir = require_mkdirs2();
|
|
3074
3074
|
var pathExists2 = require_path_exists().pathExists;
|
|
3075
3075
|
function createLink(srcpath, dstpath, callback) {
|
|
3076
3076
|
function makeLink(srcpath2, dstpath2) {
|
|
3077
|
-
|
|
3077
|
+
fs4.link(srcpath2, dstpath2, (err) => {
|
|
3078
3078
|
if (err)
|
|
3079
3079
|
return callback(err);
|
|
3080
3080
|
callback(null);
|
|
@@ -3085,7 +3085,7 @@ var require_link = __commonJS({
|
|
|
3085
3085
|
return callback(err);
|
|
3086
3086
|
if (destinationExists)
|
|
3087
3087
|
return callback(null);
|
|
3088
|
-
|
|
3088
|
+
fs4.lstat(srcpath, (err2) => {
|
|
3089
3089
|
if (err2) {
|
|
3090
3090
|
err2.message = err2.message.replace("lstat", "ensureLink");
|
|
3091
3091
|
return callback(err2);
|
|
@@ -3106,21 +3106,21 @@ var require_link = __commonJS({
|
|
|
3106
3106
|
});
|
|
3107
3107
|
}
|
|
3108
3108
|
function createLinkSync(srcpath, dstpath) {
|
|
3109
|
-
const destinationExists =
|
|
3109
|
+
const destinationExists = fs4.existsSync(dstpath);
|
|
3110
3110
|
if (destinationExists)
|
|
3111
3111
|
return void 0;
|
|
3112
3112
|
try {
|
|
3113
|
-
|
|
3113
|
+
fs4.lstatSync(srcpath);
|
|
3114
3114
|
} catch (err) {
|
|
3115
3115
|
err.message = err.message.replace("lstat", "ensureLink");
|
|
3116
3116
|
throw err;
|
|
3117
3117
|
}
|
|
3118
3118
|
const dir = path3.dirname(dstpath);
|
|
3119
|
-
const dirExists =
|
|
3119
|
+
const dirExists = fs4.existsSync(dir);
|
|
3120
3120
|
if (dirExists)
|
|
3121
|
-
return
|
|
3121
|
+
return fs4.linkSync(srcpath, dstpath);
|
|
3122
3122
|
mkdir.mkdirsSync(dir);
|
|
3123
|
-
return
|
|
3123
|
+
return fs4.linkSync(srcpath, dstpath);
|
|
3124
3124
|
}
|
|
3125
3125
|
module2.exports = {
|
|
3126
3126
|
createLink: u(createLink),
|
|
@@ -3134,11 +3134,11 @@ var require_symlink_paths = __commonJS({
|
|
|
3134
3134
|
"node_modules/fs-extra/lib/ensure/symlink-paths.js"(exports, module2) {
|
|
3135
3135
|
"use strict";
|
|
3136
3136
|
var path3 = require("path");
|
|
3137
|
-
var
|
|
3137
|
+
var fs4 = require_graceful_fs();
|
|
3138
3138
|
var pathExists2 = require_path_exists().pathExists;
|
|
3139
3139
|
function symlinkPaths(srcpath, dstpath, callback) {
|
|
3140
3140
|
if (path3.isAbsolute(srcpath)) {
|
|
3141
|
-
return
|
|
3141
|
+
return fs4.lstat(srcpath, (err) => {
|
|
3142
3142
|
if (err) {
|
|
3143
3143
|
err.message = err.message.replace("lstat", "ensureSymlink");
|
|
3144
3144
|
return callback(err);
|
|
@@ -3160,7 +3160,7 @@ var require_symlink_paths = __commonJS({
|
|
|
3160
3160
|
"toDst": srcpath
|
|
3161
3161
|
});
|
|
3162
3162
|
} else {
|
|
3163
|
-
return
|
|
3163
|
+
return fs4.lstat(srcpath, (err2) => {
|
|
3164
3164
|
if (err2) {
|
|
3165
3165
|
err2.message = err2.message.replace("lstat", "ensureSymlink");
|
|
3166
3166
|
return callback(err2);
|
|
@@ -3177,7 +3177,7 @@ var require_symlink_paths = __commonJS({
|
|
|
3177
3177
|
function symlinkPathsSync(srcpath, dstpath) {
|
|
3178
3178
|
let exists;
|
|
3179
3179
|
if (path3.isAbsolute(srcpath)) {
|
|
3180
|
-
exists =
|
|
3180
|
+
exists = fs4.existsSync(srcpath);
|
|
3181
3181
|
if (!exists)
|
|
3182
3182
|
throw new Error("absolute srcpath does not exist");
|
|
3183
3183
|
return {
|
|
@@ -3187,14 +3187,14 @@ var require_symlink_paths = __commonJS({
|
|
|
3187
3187
|
} else {
|
|
3188
3188
|
const dstdir = path3.dirname(dstpath);
|
|
3189
3189
|
const relativeToDst = path3.join(dstdir, srcpath);
|
|
3190
|
-
exists =
|
|
3190
|
+
exists = fs4.existsSync(relativeToDst);
|
|
3191
3191
|
if (exists) {
|
|
3192
3192
|
return {
|
|
3193
3193
|
"toCwd": relativeToDst,
|
|
3194
3194
|
"toDst": srcpath
|
|
3195
3195
|
};
|
|
3196
3196
|
} else {
|
|
3197
|
-
exists =
|
|
3197
|
+
exists = fs4.existsSync(srcpath);
|
|
3198
3198
|
if (!exists)
|
|
3199
3199
|
throw new Error("relative srcpath does not exist");
|
|
3200
3200
|
return {
|
|
@@ -3215,13 +3215,13 @@ var require_symlink_paths = __commonJS({
|
|
|
3215
3215
|
var require_symlink_type = __commonJS({
|
|
3216
3216
|
"node_modules/fs-extra/lib/ensure/symlink-type.js"(exports, module2) {
|
|
3217
3217
|
"use strict";
|
|
3218
|
-
var
|
|
3218
|
+
var fs4 = require_graceful_fs();
|
|
3219
3219
|
function symlinkType(srcpath, type, callback) {
|
|
3220
3220
|
callback = typeof type === "function" ? type : callback;
|
|
3221
3221
|
type = typeof type === "function" ? false : type;
|
|
3222
3222
|
if (type)
|
|
3223
3223
|
return callback(null, type);
|
|
3224
|
-
|
|
3224
|
+
fs4.lstat(srcpath, (err, stats) => {
|
|
3225
3225
|
if (err)
|
|
3226
3226
|
return callback(null, "file");
|
|
3227
3227
|
type = stats && stats.isDirectory() ? "dir" : "file";
|
|
@@ -3233,7 +3233,7 @@ var require_symlink_type = __commonJS({
|
|
|
3233
3233
|
if (type)
|
|
3234
3234
|
return type;
|
|
3235
3235
|
try {
|
|
3236
|
-
stats =
|
|
3236
|
+
stats = fs4.lstatSync(srcpath);
|
|
3237
3237
|
} catch (e) {
|
|
3238
3238
|
return "file";
|
|
3239
3239
|
}
|
|
@@ -3252,7 +3252,7 @@ var require_symlink = __commonJS({
|
|
|
3252
3252
|
"use strict";
|
|
3253
3253
|
var u = require_universalify().fromCallback;
|
|
3254
3254
|
var path3 = require("path");
|
|
3255
|
-
var
|
|
3255
|
+
var fs4 = require_graceful_fs();
|
|
3256
3256
|
var _mkdirs = require_mkdirs2();
|
|
3257
3257
|
var mkdirs = _mkdirs.mkdirs;
|
|
3258
3258
|
var mkdirsSync = _mkdirs.mkdirsSync;
|
|
@@ -3283,11 +3283,11 @@ var require_symlink = __commonJS({
|
|
|
3283
3283
|
if (err4)
|
|
3284
3284
|
return callback(err4);
|
|
3285
3285
|
if (dirExists)
|
|
3286
|
-
return
|
|
3286
|
+
return fs4.symlink(srcpath, dstpath, type2, callback);
|
|
3287
3287
|
mkdirs(dir, (err5) => {
|
|
3288
3288
|
if (err5)
|
|
3289
3289
|
return callback(err5);
|
|
3290
|
-
|
|
3290
|
+
fs4.symlink(srcpath, dstpath, type2, callback);
|
|
3291
3291
|
});
|
|
3292
3292
|
});
|
|
3293
3293
|
});
|
|
@@ -3295,18 +3295,18 @@ var require_symlink = __commonJS({
|
|
|
3295
3295
|
});
|
|
3296
3296
|
}
|
|
3297
3297
|
function createSymlinkSync(srcpath, dstpath, type) {
|
|
3298
|
-
const destinationExists =
|
|
3298
|
+
const destinationExists = fs4.existsSync(dstpath);
|
|
3299
3299
|
if (destinationExists)
|
|
3300
3300
|
return void 0;
|
|
3301
3301
|
const relative = symlinkPathsSync(srcpath, dstpath);
|
|
3302
3302
|
srcpath = relative.toDst;
|
|
3303
3303
|
type = symlinkTypeSync(relative.toCwd, type);
|
|
3304
3304
|
const dir = path3.dirname(dstpath);
|
|
3305
|
-
const exists =
|
|
3305
|
+
const exists = fs4.existsSync(dir);
|
|
3306
3306
|
if (exists)
|
|
3307
|
-
return
|
|
3307
|
+
return fs4.symlinkSync(srcpath, dstpath, type);
|
|
3308
3308
|
mkdirsSync(dir);
|
|
3309
|
-
return
|
|
3309
|
+
return fs4.symlinkSync(srcpath, dstpath, type);
|
|
3310
3310
|
}
|
|
3311
3311
|
module2.exports = {
|
|
3312
3312
|
createSymlink: u(createSymlink),
|
|
@@ -3357,12 +3357,12 @@ var require_jsonfile = __commonJS({
|
|
|
3357
3357
|
options = { encoding: options };
|
|
3358
3358
|
}
|
|
3359
3359
|
options = options || {};
|
|
3360
|
-
var
|
|
3360
|
+
var fs4 = options.fs || _fs;
|
|
3361
3361
|
var shouldThrow = true;
|
|
3362
3362
|
if ("throws" in options) {
|
|
3363
3363
|
shouldThrow = options.throws;
|
|
3364
3364
|
}
|
|
3365
|
-
|
|
3365
|
+
fs4.readFile(file, options, function(err, data) {
|
|
3366
3366
|
if (err)
|
|
3367
3367
|
return callback(err);
|
|
3368
3368
|
data = stripBom(data);
|
|
@@ -3385,13 +3385,13 @@ var require_jsonfile = __commonJS({
|
|
|
3385
3385
|
if (typeof options === "string") {
|
|
3386
3386
|
options = { encoding: options };
|
|
3387
3387
|
}
|
|
3388
|
-
var
|
|
3388
|
+
var fs4 = options.fs || _fs;
|
|
3389
3389
|
var shouldThrow = true;
|
|
3390
3390
|
if ("throws" in options) {
|
|
3391
3391
|
shouldThrow = options.throws;
|
|
3392
3392
|
}
|
|
3393
3393
|
try {
|
|
3394
|
-
var content =
|
|
3394
|
+
var content = fs4.readFileSync(file, options);
|
|
3395
3395
|
content = stripBom(content);
|
|
3396
3396
|
return JSON.parse(content, options.reviver);
|
|
3397
3397
|
} catch (err) {
|
|
@@ -3423,7 +3423,7 @@ var require_jsonfile = __commonJS({
|
|
|
3423
3423
|
options = {};
|
|
3424
3424
|
}
|
|
3425
3425
|
options = options || {};
|
|
3426
|
-
var
|
|
3426
|
+
var fs4 = options.fs || _fs;
|
|
3427
3427
|
var str = "";
|
|
3428
3428
|
try {
|
|
3429
3429
|
str = stringify(obj, options);
|
|
@@ -3432,13 +3432,13 @@ var require_jsonfile = __commonJS({
|
|
|
3432
3432
|
callback(err, null);
|
|
3433
3433
|
return;
|
|
3434
3434
|
}
|
|
3435
|
-
|
|
3435
|
+
fs4.writeFile(file, str, options, callback);
|
|
3436
3436
|
}
|
|
3437
3437
|
function writeFileSync(file, obj, options) {
|
|
3438
3438
|
options = options || {};
|
|
3439
|
-
var
|
|
3439
|
+
var fs4 = options.fs || _fs;
|
|
3440
3440
|
var str = stringify(obj, options);
|
|
3441
|
-
return
|
|
3441
|
+
return fs4.writeFileSync(file, str, options);
|
|
3442
3442
|
}
|
|
3443
3443
|
function stripBom(content) {
|
|
3444
3444
|
if (Buffer.isBuffer(content))
|
|
@@ -3505,13 +3505,13 @@ var require_output_json = __commonJS({
|
|
|
3505
3505
|
var require_output_json_sync = __commonJS({
|
|
3506
3506
|
"node_modules/fs-extra/lib/json/output-json-sync.js"(exports, module2) {
|
|
3507
3507
|
"use strict";
|
|
3508
|
-
var
|
|
3508
|
+
var fs4 = require_graceful_fs();
|
|
3509
3509
|
var path3 = require("path");
|
|
3510
3510
|
var mkdir = require_mkdirs2();
|
|
3511
3511
|
var jsonFile = require_jsonfile2();
|
|
3512
3512
|
function outputJsonSync(file, data, options) {
|
|
3513
3513
|
const dir = path3.dirname(file);
|
|
3514
|
-
if (!
|
|
3514
|
+
if (!fs4.existsSync(dir)) {
|
|
3515
3515
|
mkdir.mkdirsSync(dir);
|
|
3516
3516
|
}
|
|
3517
3517
|
jsonFile.writeJsonSync(file, data, options);
|
|
@@ -3542,7 +3542,7 @@ var require_json = __commonJS({
|
|
|
3542
3542
|
var require_move_sync = __commonJS({
|
|
3543
3543
|
"node_modules/fs-extra/lib/move-sync/move-sync.js"(exports, module2) {
|
|
3544
3544
|
"use strict";
|
|
3545
|
-
var
|
|
3545
|
+
var fs4 = require_graceful_fs();
|
|
3546
3546
|
var path3 = require("path");
|
|
3547
3547
|
var copySync = require_copy_sync2().copySync;
|
|
3548
3548
|
var removeSync = require_remove().removeSync;
|
|
@@ -3561,13 +3561,13 @@ var require_move_sync = __commonJS({
|
|
|
3561
3561
|
removeSync(dest);
|
|
3562
3562
|
return rename(src, dest, overwrite);
|
|
3563
3563
|
}
|
|
3564
|
-
if (
|
|
3564
|
+
if (fs4.existsSync(dest))
|
|
3565
3565
|
throw new Error("dest already exists.");
|
|
3566
3566
|
return rename(src, dest, overwrite);
|
|
3567
3567
|
}
|
|
3568
3568
|
function rename(src, dest, overwrite) {
|
|
3569
3569
|
try {
|
|
3570
|
-
|
|
3570
|
+
fs4.renameSync(src, dest);
|
|
3571
3571
|
} catch (err) {
|
|
3572
3572
|
if (err.code !== "EXDEV")
|
|
3573
3573
|
throw err;
|
|
@@ -3600,7 +3600,7 @@ var require_move_sync2 = __commonJS({
|
|
|
3600
3600
|
var require_move = __commonJS({
|
|
3601
3601
|
"node_modules/fs-extra/lib/move/move.js"(exports, module2) {
|
|
3602
3602
|
"use strict";
|
|
3603
|
-
var
|
|
3603
|
+
var fs4 = require_graceful_fs();
|
|
3604
3604
|
var path3 = require("path");
|
|
3605
3605
|
var copy = require_copy2().copy;
|
|
3606
3606
|
var remove = require_remove().remove;
|
|
@@ -3645,7 +3645,7 @@ var require_move = __commonJS({
|
|
|
3645
3645
|
});
|
|
3646
3646
|
}
|
|
3647
3647
|
function rename(src, dest, overwrite, cb) {
|
|
3648
|
-
|
|
3648
|
+
fs4.rename(src, dest, (err) => {
|
|
3649
3649
|
if (!err)
|
|
3650
3650
|
return cb();
|
|
3651
3651
|
if (err.code !== "EXDEV")
|
|
@@ -3684,7 +3684,7 @@ var require_output = __commonJS({
|
|
|
3684
3684
|
"node_modules/fs-extra/lib/output/index.js"(exports, module2) {
|
|
3685
3685
|
"use strict";
|
|
3686
3686
|
var u = require_universalify().fromCallback;
|
|
3687
|
-
var
|
|
3687
|
+
var fs4 = require_graceful_fs();
|
|
3688
3688
|
var path3 = require("path");
|
|
3689
3689
|
var mkdir = require_mkdirs2();
|
|
3690
3690
|
var pathExists2 = require_path_exists().pathExists;
|
|
@@ -3698,21 +3698,21 @@ var require_output = __commonJS({
|
|
|
3698
3698
|
if (err)
|
|
3699
3699
|
return callback(err);
|
|
3700
3700
|
if (itDoes)
|
|
3701
|
-
return
|
|
3701
|
+
return fs4.writeFile(file, data, encoding, callback);
|
|
3702
3702
|
mkdir.mkdirs(dir, (err2) => {
|
|
3703
3703
|
if (err2)
|
|
3704
3704
|
return callback(err2);
|
|
3705
|
-
|
|
3705
|
+
fs4.writeFile(file, data, encoding, callback);
|
|
3706
3706
|
});
|
|
3707
3707
|
});
|
|
3708
3708
|
}
|
|
3709
3709
|
function outputFileSync(file, ...args) {
|
|
3710
3710
|
const dir = path3.dirname(file);
|
|
3711
|
-
if (
|
|
3712
|
-
return
|
|
3711
|
+
if (fs4.existsSync(dir)) {
|
|
3712
|
+
return fs4.writeFileSync(file, ...args);
|
|
3713
3713
|
}
|
|
3714
3714
|
mkdir.mkdirsSync(dir);
|
|
3715
|
-
|
|
3715
|
+
fs4.writeFileSync(file, ...args);
|
|
3716
3716
|
}
|
|
3717
3717
|
module2.exports = {
|
|
3718
3718
|
outputFile: u(outputFile),
|
|
@@ -3740,11 +3740,11 @@ var require_lib = __commonJS({
|
|
|
3740
3740
|
require_path_exists(),
|
|
3741
3741
|
require_remove()
|
|
3742
3742
|
);
|
|
3743
|
-
var
|
|
3744
|
-
if (Object.getOwnPropertyDescriptor(
|
|
3743
|
+
var fs4 = require("fs");
|
|
3744
|
+
if (Object.getOwnPropertyDescriptor(fs4, "promises")) {
|
|
3745
3745
|
Object.defineProperty(module2.exports, "promises", {
|
|
3746
3746
|
get() {
|
|
3747
|
-
return
|
|
3747
|
+
return fs4.promises;
|
|
3748
3748
|
}
|
|
3749
3749
|
});
|
|
3750
3750
|
}
|
|
@@ -3755,9 +3755,9 @@ var require_lib = __commonJS({
|
|
|
3755
3755
|
var require_path_exists2 = __commonJS({
|
|
3756
3756
|
"node_modules/path-exists/index.js"(exports, module2) {
|
|
3757
3757
|
"use strict";
|
|
3758
|
-
var
|
|
3758
|
+
var fs4 = require("fs");
|
|
3759
3759
|
var { promisify } = require("util");
|
|
3760
|
-
var pAccess = promisify(
|
|
3760
|
+
var pAccess = promisify(fs4.access);
|
|
3761
3761
|
module2.exports = async (path3) => {
|
|
3762
3762
|
try {
|
|
3763
3763
|
await pAccess(path3);
|
|
@@ -3768,7 +3768,7 @@ var require_path_exists2 = __commonJS({
|
|
|
3768
3768
|
};
|
|
3769
3769
|
module2.exports.sync = (path3) => {
|
|
3770
3770
|
try {
|
|
3771
|
-
|
|
3771
|
+
fs4.accessSync(path3);
|
|
3772
3772
|
return true;
|
|
3773
3773
|
} catch (_) {
|
|
3774
3774
|
return false;
|
|
@@ -3789,7 +3789,7 @@ module.exports = __toCommonJS(src_exports);
|
|
|
3789
3789
|
var import_path = __toESM(require("path"));
|
|
3790
3790
|
|
|
3791
3791
|
// src/util/util.ts
|
|
3792
|
-
var
|
|
3792
|
+
var coc = __toESM(require("coc.nvim"));
|
|
3793
3793
|
var ANALYSIS_EXCLUDES = "sonarlint.analysisExcludesStandalone";
|
|
3794
3794
|
function startedInDebugMode(process2) {
|
|
3795
3795
|
const args = process2.execArgv;
|
|
@@ -3798,7 +3798,7 @@ function startedInDebugMode(process2) {
|
|
|
3798
3798
|
}
|
|
3799
3799
|
return false;
|
|
3800
3800
|
}
|
|
3801
|
-
var extension =
|
|
3801
|
+
var extension = coc.extensions.getExtensionById("SonarSource.sonarlint-vscode");
|
|
3802
3802
|
var packageJson = extension?.packageJSON;
|
|
3803
3803
|
var extensionPath;
|
|
3804
3804
|
var extensionContext;
|
|
@@ -3864,327 +3864,327 @@ function shouldAnalyseFile(fileUriStr) {
|
|
|
3864
3864
|
if (!isOpen) {
|
|
3865
3865
|
return { shouldBeAnalysed: false, reason: "Skipping analysis for the file preview: " };
|
|
3866
3866
|
}
|
|
3867
|
-
const fileUri =
|
|
3868
|
-
const workspaceFolderConfig =
|
|
3867
|
+
const fileUri = coc.Uri.parse(fileUriStr);
|
|
3868
|
+
const workspaceFolderConfig = coc.workspace.getConfiguration();
|
|
3869
3869
|
const excludes = workspaceFolderConfig.get(ANALYSIS_EXCLUDES);
|
|
3870
3870
|
const excludesArray = excludes?.split(",").map((it) => it.trim());
|
|
3871
|
-
const filteredFile = getFilesNotMatchedGlobPatterns([fileUri], excludesArray
|
|
3871
|
+
const filteredFile = getFilesNotMatchedGlobPatterns([fileUri], excludesArray ?? []);
|
|
3872
3872
|
return { shouldBeAnalysed: filteredFile.length === 1, reason: "Skipping analysis for the excluded file: " };
|
|
3873
3873
|
}
|
|
3874
3874
|
function filterOutFilesIgnoredForAnalysis(fileUris) {
|
|
3875
|
-
const workspaceFolderConfig =
|
|
3875
|
+
const workspaceFolderConfig = coc.workspace.getConfiguration();
|
|
3876
3876
|
const excludes = workspaceFolderConfig.get(ANALYSIS_EXCLUDES);
|
|
3877
3877
|
const excludesArray = excludes?.split(",").map((it) => it.trim());
|
|
3878
|
-
const filteredFiles = getFilesNotMatchedGlobPatterns(fileUris.map((it) =>
|
|
3878
|
+
const filteredFiles = getFilesNotMatchedGlobPatterns(fileUris.map((it) => coc.Uri.parse(it)), excludesArray ?? []).map((it) => it.toString());
|
|
3879
3879
|
return { fileUris: filteredFiles };
|
|
3880
3880
|
}
|
|
3881
3881
|
function isOpenInEditor(fileUri) {
|
|
3882
|
-
const url =
|
|
3882
|
+
const url = coc.Uri.parse(fileUri);
|
|
3883
3883
|
const codeFileUri = url.toString();
|
|
3884
|
-
return
|
|
3884
|
+
return coc.workspace.textDocuments.some((d) => d.uri.toString() === codeFileUri);
|
|
3885
3885
|
}
|
|
3886
3886
|
|
|
3887
3887
|
// src/lsp/protocol.ts
|
|
3888
|
-
var
|
|
3888
|
+
var coc2 = __toESM(require("coc.nvim"));
|
|
3889
3889
|
var ShowRuleDescriptionNotification;
|
|
3890
3890
|
((ShowRuleDescriptionNotification2) => {
|
|
3891
|
-
ShowRuleDescriptionNotification2.type = new
|
|
3891
|
+
ShowRuleDescriptionNotification2.type = new coc2.NotificationType(
|
|
3892
3892
|
"sonarlint/showRuleDescription"
|
|
3893
3893
|
);
|
|
3894
3894
|
})(ShowRuleDescriptionNotification || (ShowRuleDescriptionNotification = {}));
|
|
3895
3895
|
var SuggestBindingNotification;
|
|
3896
3896
|
((SuggestBindingNotification2) => {
|
|
3897
|
-
SuggestBindingNotification2.type = new
|
|
3897
|
+
SuggestBindingNotification2.type = new coc2.NotificationType(
|
|
3898
3898
|
"sonarlint/suggestBinding"
|
|
3899
3899
|
);
|
|
3900
3900
|
})(SuggestBindingNotification || (SuggestBindingNotification = {}));
|
|
3901
3901
|
var ListFilesInFolderRequest;
|
|
3902
3902
|
((ListFilesInFolderRequest2) => {
|
|
3903
|
-
ListFilesInFolderRequest2.type = new
|
|
3903
|
+
ListFilesInFolderRequest2.type = new coc2.RequestType("sonarlint/listFilesInFolder");
|
|
3904
3904
|
})(ListFilesInFolderRequest || (ListFilesInFolderRequest = {}));
|
|
3905
3905
|
var ShowHotspotRuleDescriptionNotification;
|
|
3906
3906
|
((ShowHotspotRuleDescriptionNotification2) => {
|
|
3907
|
-
ShowHotspotRuleDescriptionNotification2.type = new
|
|
3907
|
+
ShowHotspotRuleDescriptionNotification2.type = new coc2.NotificationType(
|
|
3908
3908
|
"sonarlint/showHotspotRuleDescription"
|
|
3909
3909
|
);
|
|
3910
3910
|
})(ShowHotspotRuleDescriptionNotification || (ShowHotspotRuleDescriptionNotification = {}));
|
|
3911
3911
|
var GetJavaConfigRequest;
|
|
3912
3912
|
((GetJavaConfigRequest2) => {
|
|
3913
|
-
GetJavaConfigRequest2.type = new
|
|
3913
|
+
GetJavaConfigRequest2.type = new coc2.RequestType(
|
|
3914
3914
|
"sonarlint/getJavaConfig"
|
|
3915
3915
|
);
|
|
3916
3916
|
})(GetJavaConfigRequest || (GetJavaConfigRequest = {}));
|
|
3917
3917
|
var ScmCheckRequest;
|
|
3918
3918
|
((ScmCheckRequest2) => {
|
|
3919
|
-
ScmCheckRequest2.type = new
|
|
3919
|
+
ScmCheckRequest2.type = new coc2.RequestType(
|
|
3920
3920
|
"sonarlint/isIgnoredByScm"
|
|
3921
3921
|
);
|
|
3922
3922
|
})(ScmCheckRequest || (ScmCheckRequest = {}));
|
|
3923
3923
|
var ShowNotificationForFirstSecretsIssueNotification;
|
|
3924
3924
|
((ShowNotificationForFirstSecretsIssueNotification2) => {
|
|
3925
|
-
ShowNotificationForFirstSecretsIssueNotification2.type = new
|
|
3925
|
+
ShowNotificationForFirstSecretsIssueNotification2.type = new coc2.NotificationType(
|
|
3926
3926
|
"sonarlint/showNotificationForFirstSecretsIssue"
|
|
3927
3927
|
);
|
|
3928
3928
|
})(ShowNotificationForFirstSecretsIssueNotification || (ShowNotificationForFirstSecretsIssueNotification = {}));
|
|
3929
3929
|
var ShowSonarLintOutputNotification;
|
|
3930
3930
|
((ShowSonarLintOutputNotification2) => {
|
|
3931
|
-
ShowSonarLintOutputNotification2.type = new
|
|
3931
|
+
ShowSonarLintOutputNotification2.type = new coc2.NotificationType("sonarlint/showSonarLintOutput");
|
|
3932
3932
|
})(ShowSonarLintOutputNotification || (ShowSonarLintOutputNotification = {}));
|
|
3933
3933
|
var OpenJavaHomeSettingsNotification;
|
|
3934
3934
|
((OpenJavaHomeSettingsNotification2) => {
|
|
3935
|
-
OpenJavaHomeSettingsNotification2.type = new
|
|
3935
|
+
OpenJavaHomeSettingsNotification2.type = new coc2.NotificationType(
|
|
3936
3936
|
"sonarlint/openJavaHomeSettings"
|
|
3937
3937
|
);
|
|
3938
3938
|
})(OpenJavaHomeSettingsNotification || (OpenJavaHomeSettingsNotification = {}));
|
|
3939
3939
|
var OpenPathToNodeSettingsNotification;
|
|
3940
3940
|
((OpenPathToNodeSettingsNotification2) => {
|
|
3941
|
-
OpenPathToNodeSettingsNotification2.type = new
|
|
3941
|
+
OpenPathToNodeSettingsNotification2.type = new coc2.NotificationType(
|
|
3942
3942
|
"sonarlint/openPathToNodeSettings"
|
|
3943
3943
|
);
|
|
3944
3944
|
})(OpenPathToNodeSettingsNotification || (OpenPathToNodeSettingsNotification = {}));
|
|
3945
3945
|
var BrowseToNotification;
|
|
3946
3946
|
((BrowseToNotification2) => {
|
|
3947
|
-
BrowseToNotification2.type = new
|
|
3947
|
+
BrowseToNotification2.type = new coc2.NotificationType("sonarlint/browseTo");
|
|
3948
3948
|
})(BrowseToNotification || (BrowseToNotification = {}));
|
|
3949
3949
|
var OpenConnectionSettingsNotification;
|
|
3950
3950
|
((OpenConnectionSettingsNotification2) => {
|
|
3951
|
-
OpenConnectionSettingsNotification2.type = new
|
|
3951
|
+
OpenConnectionSettingsNotification2.type = new coc2.NotificationType(
|
|
3952
3952
|
"sonarlint/openConnectionSettings"
|
|
3953
3953
|
);
|
|
3954
3954
|
})(OpenConnectionSettingsNotification || (OpenConnectionSettingsNotification = {}));
|
|
3955
3955
|
var ShowHotspotNotification;
|
|
3956
3956
|
((ShowHotspotNotification2) => {
|
|
3957
|
-
ShowHotspotNotification2.type = new
|
|
3957
|
+
ShowHotspotNotification2.type = new coc2.NotificationType(
|
|
3958
3958
|
"sonarlint/showHotspot"
|
|
3959
3959
|
);
|
|
3960
3960
|
})(ShowHotspotNotification || (ShowHotspotNotification = {}));
|
|
3961
3961
|
var ShowIssueNotification;
|
|
3962
3962
|
((ShowIssueNotification2) => {
|
|
3963
|
-
ShowIssueNotification2.type = new
|
|
3963
|
+
ShowIssueNotification2.type = new coc2.NotificationType("sonarlint/showIssue");
|
|
3964
3964
|
})(ShowIssueNotification || (ShowIssueNotification = {}));
|
|
3965
3965
|
var ShowIssueOrHotspotNotification;
|
|
3966
3966
|
((ShowIssueOrHotspotNotification2) => {
|
|
3967
|
-
ShowIssueOrHotspotNotification2.type = new
|
|
3967
|
+
ShowIssueOrHotspotNotification2.type = new coc2.NotificationType(
|
|
3968
3968
|
"sonarlint/showIssueOrHotspot"
|
|
3969
3969
|
);
|
|
3970
3970
|
})(ShowIssueOrHotspotNotification || (ShowIssueOrHotspotNotification = {}));
|
|
3971
3971
|
var SetReferenceBranchNameForFolderNotification;
|
|
3972
3972
|
((SetReferenceBranchNameForFolderNotification2) => {
|
|
3973
|
-
SetReferenceBranchNameForFolderNotification2.type = new
|
|
3973
|
+
SetReferenceBranchNameForFolderNotification2.type = new coc2.NotificationType(
|
|
3974
3974
|
"sonarlint/setReferenceBranchNameForFolder"
|
|
3975
3975
|
);
|
|
3976
3976
|
})(SetReferenceBranchNameForFolderNotification || (SetReferenceBranchNameForFolderNotification = {}));
|
|
3977
3977
|
var NeedCompilationDatabaseRequest;
|
|
3978
3978
|
((NeedCompilationDatabaseRequest2) => {
|
|
3979
|
-
NeedCompilationDatabaseRequest2.type = new
|
|
3979
|
+
NeedCompilationDatabaseRequest2.type = new coc2.NotificationType(
|
|
3980
3980
|
"sonarlint/needCompilationDatabase"
|
|
3981
3981
|
);
|
|
3982
3982
|
})(NeedCompilationDatabaseRequest || (NeedCompilationDatabaseRequest = {}));
|
|
3983
3983
|
var ShouldAnalyseFileCheck;
|
|
3984
3984
|
((ShouldAnalyseFileCheck2) => {
|
|
3985
|
-
ShouldAnalyseFileCheck2.type = new
|
|
3985
|
+
ShouldAnalyseFileCheck2.type = new coc2.RequestType("sonarlint/shouldAnalyseFile");
|
|
3986
3986
|
})(ShouldAnalyseFileCheck || (ShouldAnalyseFileCheck = {}));
|
|
3987
3987
|
var FilterOutExcludedFiles;
|
|
3988
3988
|
((FilterOutExcludedFiles2) => {
|
|
3989
|
-
FilterOutExcludedFiles2.type = new
|
|
3989
|
+
FilterOutExcludedFiles2.type = new coc2.RequestType(
|
|
3990
3990
|
"sonarlint/filterOutExcludedFiles"
|
|
3991
3991
|
);
|
|
3992
3992
|
})(FilterOutExcludedFiles || (FilterOutExcludedFiles = {}));
|
|
3993
3993
|
var ReportConnectionCheckResult;
|
|
3994
3994
|
((ReportConnectionCheckResult2) => {
|
|
3995
|
-
ReportConnectionCheckResult2.type = new
|
|
3995
|
+
ReportConnectionCheckResult2.type = new coc2.NotificationType(
|
|
3996
3996
|
"sonarlint/reportConnectionCheckResult"
|
|
3997
3997
|
);
|
|
3998
3998
|
})(ReportConnectionCheckResult || (ReportConnectionCheckResult = {}));
|
|
3999
3999
|
var CheckConnection;
|
|
4000
4000
|
((CheckConnection2) => {
|
|
4001
|
-
CheckConnection2.type = new
|
|
4001
|
+
CheckConnection2.type = new coc2.RequestType("sonarlint/checkConnection");
|
|
4002
4002
|
})(CheckConnection || (CheckConnection = {}));
|
|
4003
4003
|
var CheckLocalDetectionSupported;
|
|
4004
4004
|
((CheckLocalDetectionSupported2) => {
|
|
4005
|
-
CheckLocalDetectionSupported2.type = new
|
|
4005
|
+
CheckLocalDetectionSupported2.type = new coc2.RequestType("sonarlint/checkLocalDetectionSupported");
|
|
4006
4006
|
})(CheckLocalDetectionSupported || (CheckLocalDetectionSupported = {}));
|
|
4007
4007
|
var GetHotspotDetails;
|
|
4008
4008
|
((GetHotspotDetails2) => {
|
|
4009
|
-
GetHotspotDetails2.type = new
|
|
4009
|
+
GetHotspotDetails2.type = new coc2.RequestType("sonarlint/getHotspotDetails");
|
|
4010
4010
|
})(GetHotspotDetails || (GetHotspotDetails = {}));
|
|
4011
4011
|
var CanShowMissingRequirementNotification;
|
|
4012
4012
|
((CanShowMissingRequirementNotification2) => {
|
|
4013
|
-
CanShowMissingRequirementNotification2.type = new
|
|
4013
|
+
CanShowMissingRequirementNotification2.type = new coc2.RequestType(
|
|
4014
4014
|
"sonarlint/canShowMissingRequirementsNotification"
|
|
4015
4015
|
);
|
|
4016
4016
|
})(CanShowMissingRequirementNotification || (CanShowMissingRequirementNotification = {}));
|
|
4017
4017
|
var MaybeShowWiderLanguageSupportNotification;
|
|
4018
4018
|
((MaybeShowWiderLanguageSupportNotification2) => {
|
|
4019
|
-
MaybeShowWiderLanguageSupportNotification2.type = new
|
|
4019
|
+
MaybeShowWiderLanguageSupportNotification2.type = new coc2.NotificationType(
|
|
4020
4020
|
"sonarlint/maybeShowWiderLanguageSupportNotification"
|
|
4021
4021
|
);
|
|
4022
4022
|
})(MaybeShowWiderLanguageSupportNotification || (MaybeShowWiderLanguageSupportNotification = {}));
|
|
4023
4023
|
var DidClasspathUpdateNotification;
|
|
4024
4024
|
((DidClasspathUpdateNotification2) => {
|
|
4025
|
-
DidClasspathUpdateNotification2.type = new
|
|
4025
|
+
DidClasspathUpdateNotification2.type = new coc2.NotificationType(
|
|
4026
4026
|
"sonarlint/didClasspathUpdate"
|
|
4027
4027
|
);
|
|
4028
4028
|
})(DidClasspathUpdateNotification || (DidClasspathUpdateNotification = {}));
|
|
4029
4029
|
var DidJavaServerModeChangeNotification;
|
|
4030
4030
|
((DidJavaServerModeChangeNotification2) => {
|
|
4031
|
-
DidJavaServerModeChangeNotification2.type = new
|
|
4031
|
+
DidJavaServerModeChangeNotification2.type = new coc2.NotificationType(
|
|
4032
4032
|
"sonarlint/didJavaServerModeChange"
|
|
4033
4033
|
);
|
|
4034
4034
|
})(DidJavaServerModeChangeNotification || (DidJavaServerModeChangeNotification = {}));
|
|
4035
4035
|
var DidLocalBranchNameChangeNotification;
|
|
4036
4036
|
((DidLocalBranchNameChangeNotification2) => {
|
|
4037
|
-
DidLocalBranchNameChangeNotification2.type = new
|
|
4037
|
+
DidLocalBranchNameChangeNotification2.type = new coc2.NotificationType(
|
|
4038
4038
|
"sonarlint/didLocalBranchNameChange"
|
|
4039
4039
|
);
|
|
4040
4040
|
})(DidLocalBranchNameChangeNotification || (DidLocalBranchNameChangeNotification = {}));
|
|
4041
4041
|
var ListAllRulesRequest;
|
|
4042
4042
|
((ListAllRulesRequest2) => {
|
|
4043
|
-
ListAllRulesRequest2.type = new
|
|
4043
|
+
ListAllRulesRequest2.type = new coc2.RequestType0(
|
|
4044
4044
|
"sonarlint/listAllRules"
|
|
4045
4045
|
);
|
|
4046
4046
|
})(ListAllRulesRequest || (ListAllRulesRequest = {}));
|
|
4047
4047
|
var GetTokenForServer;
|
|
4048
4048
|
((GetTokenForServer2) => {
|
|
4049
|
-
GetTokenForServer2.type = new
|
|
4049
|
+
GetTokenForServer2.type = new coc2.RequestType(
|
|
4050
4050
|
"sonarlint/getTokenForServer"
|
|
4051
4051
|
);
|
|
4052
4052
|
})(GetTokenForServer || (GetTokenForServer = {}));
|
|
4053
4053
|
var OnTokenUpdate;
|
|
4054
4054
|
((OnTokenUpdate2) => {
|
|
4055
|
-
OnTokenUpdate2.type = new
|
|
4055
|
+
OnTokenUpdate2.type = new coc2.NotificationType(
|
|
4056
4056
|
"sonarlint/onTokenUpdate"
|
|
4057
4057
|
);
|
|
4058
4058
|
})(OnTokenUpdate || (OnTokenUpdate = {}));
|
|
4059
4059
|
var GetRemoteProjectsForConnection;
|
|
4060
4060
|
((GetRemoteProjectsForConnection2) => {
|
|
4061
|
-
GetRemoteProjectsForConnection2.type = new
|
|
4061
|
+
GetRemoteProjectsForConnection2.type = new coc2.RequestType("sonarlint/getRemoteProjectsForConnection");
|
|
4062
4062
|
})(GetRemoteProjectsForConnection || (GetRemoteProjectsForConnection = {}));
|
|
4063
4063
|
var GetRemoteProjectNames;
|
|
4064
4064
|
((GetRemoteProjectNames2) => {
|
|
4065
|
-
GetRemoteProjectNames2.type = new
|
|
4065
|
+
GetRemoteProjectNames2.type = new coc2.RequestType("sonarlint/getRemoteProjectNames");
|
|
4066
4066
|
})(GetRemoteProjectNames || (GetRemoteProjectNames = {}));
|
|
4067
4067
|
var GenerateToken;
|
|
4068
4068
|
((GenerateToken2) => {
|
|
4069
|
-
GenerateToken2.type = new
|
|
4069
|
+
GenerateToken2.type = new coc2.RequestType("sonarlint/generateToken");
|
|
4070
4070
|
})(GenerateToken || (GenerateToken = {}));
|
|
4071
4071
|
var PublishHotspotsForFile;
|
|
4072
4072
|
((PublishHotspotsForFile2) => {
|
|
4073
|
-
PublishHotspotsForFile2.type = new
|
|
4073
|
+
PublishHotspotsForFile2.type = new coc2.NotificationType(
|
|
4074
4074
|
"sonarlint/publishSecurityHotspots"
|
|
4075
4075
|
);
|
|
4076
4076
|
})(PublishHotspotsForFile || (PublishHotspotsForFile = {}));
|
|
4077
4077
|
var ShowHotspotLocations;
|
|
4078
4078
|
((ShowHotspotLocations2) => {
|
|
4079
|
-
ShowHotspotLocations2.type = new
|
|
4079
|
+
ShowHotspotLocations2.type = new coc2.RequestType("sonarlint/showHotspotLocations");
|
|
4080
4080
|
})(ShowHotspotLocations || (ShowHotspotLocations = {}));
|
|
4081
4081
|
var OpenHotspotOnServer;
|
|
4082
4082
|
((OpenHotspotOnServer2) => {
|
|
4083
|
-
OpenHotspotOnServer2.type = new
|
|
4083
|
+
OpenHotspotOnServer2.type = new coc2.NotificationType(
|
|
4084
4084
|
"sonarlint/openHotspotInBrowser"
|
|
4085
4085
|
);
|
|
4086
4086
|
})(OpenHotspotOnServer || (OpenHotspotOnServer = {}));
|
|
4087
4087
|
var HelpAndFeedbackLinkClicked;
|
|
4088
4088
|
((HelpAndFeedbackLinkClicked2) => {
|
|
4089
|
-
HelpAndFeedbackLinkClicked2.type = new
|
|
4089
|
+
HelpAndFeedbackLinkClicked2.type = new coc2.NotificationType(
|
|
4090
4090
|
"sonarlint/helpAndFeedbackLinkClicked"
|
|
4091
4091
|
);
|
|
4092
4092
|
})(HelpAndFeedbackLinkClicked || (HelpAndFeedbackLinkClicked = {}));
|
|
4093
4093
|
var ScanFolderForHotspots;
|
|
4094
4094
|
((ScanFolderForHotspots2) => {
|
|
4095
|
-
ScanFolderForHotspots2.type = new
|
|
4095
|
+
ScanFolderForHotspots2.type = new coc2.NotificationType(
|
|
4096
4096
|
"sonarlint/scanFolderForHotspots"
|
|
4097
4097
|
);
|
|
4098
4098
|
})(ScanFolderForHotspots || (ScanFolderForHotspots = {}));
|
|
4099
4099
|
var ForgetFolderHotspots;
|
|
4100
4100
|
((ForgetFolderHotspots2) => {
|
|
4101
|
-
ForgetFolderHotspots2.type = new
|
|
4101
|
+
ForgetFolderHotspots2.type = new coc2.NotificationType(
|
|
4102
4102
|
"sonarlint/forgetFolderHotspots"
|
|
4103
4103
|
);
|
|
4104
4104
|
})(ForgetFolderHotspots || (ForgetFolderHotspots = {}));
|
|
4105
4105
|
var GetFilePatternsForAnalysis;
|
|
4106
4106
|
((GetFilePatternsForAnalysis2) => {
|
|
4107
|
-
GetFilePatternsForAnalysis2.type = new
|
|
4107
|
+
GetFilePatternsForAnalysis2.type = new coc2.RequestType("sonarlint/listSupportedFilePatterns");
|
|
4108
4108
|
})(GetFilePatternsForAnalysis || (GetFilePatternsForAnalysis = {}));
|
|
4109
4109
|
var GetSuggestedBinding;
|
|
4110
4110
|
((GetSuggestedBinding2) => {
|
|
4111
|
-
GetSuggestedBinding2.type = new
|
|
4111
|
+
GetSuggestedBinding2.type = new coc2.RequestType("sonarlint/getBindingSuggestion");
|
|
4112
4112
|
})(GetSuggestedBinding || (GetSuggestedBinding = {}));
|
|
4113
4113
|
var GetSharedConnectedModeConfigFileContents;
|
|
4114
4114
|
((GetSharedConnectedModeConfigFileContents2) => {
|
|
4115
|
-
GetSharedConnectedModeConfigFileContents2.type = new
|
|
4115
|
+
GetSharedConnectedModeConfigFileContents2.type = new coc2.RequestType("sonarlint/getSharedConnectedModeFileContent");
|
|
4116
4116
|
})(GetSharedConnectedModeConfigFileContents || (GetSharedConnectedModeConfigFileContents = {}));
|
|
4117
4117
|
var ReopenResolvedLocalIssues;
|
|
4118
4118
|
((ReopenResolvedLocalIssues2) => {
|
|
4119
|
-
ReopenResolvedLocalIssues2.type = new
|
|
4119
|
+
ReopenResolvedLocalIssues2.type = new coc2.NotificationType(
|
|
4120
4120
|
"sonarlint/reopenResolvedLocalIssues"
|
|
4121
4121
|
);
|
|
4122
4122
|
})(ReopenResolvedLocalIssues || (ReopenResolvedLocalIssues = {}));
|
|
4123
4123
|
var CheckIssueStatusChangePermitted;
|
|
4124
4124
|
((CheckIssueStatusChangePermitted2) => {
|
|
4125
|
-
CheckIssueStatusChangePermitted2.type = new
|
|
4125
|
+
CheckIssueStatusChangePermitted2.type = new coc2.RequestType("sonarlint/checkIssueStatusChangePermitted");
|
|
4126
4126
|
})(CheckIssueStatusChangePermitted || (CheckIssueStatusChangePermitted = {}));
|
|
4127
4127
|
var SetIssueStatus;
|
|
4128
4128
|
((SetIssueStatus2) => {
|
|
4129
|
-
SetIssueStatus2.type = new
|
|
4129
|
+
SetIssueStatus2.type = new coc2.NotificationType(
|
|
4130
4130
|
"sonarlint/changeIssueStatus"
|
|
4131
4131
|
);
|
|
4132
4132
|
})(SetIssueStatus || (SetIssueStatus = {}));
|
|
4133
4133
|
var AssistCreatingConnection;
|
|
4134
4134
|
((AssistCreatingConnection2) => {
|
|
4135
|
-
AssistCreatingConnection2.type = new
|
|
4135
|
+
AssistCreatingConnection2.type = new coc2.RequestType("sonarlint/assistCreatingConnection");
|
|
4136
4136
|
})(AssistCreatingConnection || (AssistCreatingConnection = {}));
|
|
4137
4137
|
var AssistBinding;
|
|
4138
4138
|
((AssistBinding2) => {
|
|
4139
|
-
AssistBinding2.type = new
|
|
4139
|
+
AssistBinding2.type = new coc2.RequestType("sonarlint/assistBinding");
|
|
4140
4140
|
})(AssistBinding || (AssistBinding = {}));
|
|
4141
4141
|
var ShowHotspotDetails;
|
|
4142
4142
|
((ShowHotspotDetails2) => {
|
|
4143
|
-
ShowHotspotDetails2.type = new
|
|
4143
|
+
ShowHotspotDetails2.type = new coc2.NotificationType(
|
|
4144
4144
|
"sonarlint/showHotspotDetails"
|
|
4145
4145
|
);
|
|
4146
4146
|
})(ShowHotspotDetails || (ShowHotspotDetails = {}));
|
|
4147
4147
|
var GetAllowedHotspotStatuses;
|
|
4148
4148
|
((GetAllowedHotspotStatuses2) => {
|
|
4149
|
-
GetAllowedHotspotStatuses2.type = new
|
|
4149
|
+
GetAllowedHotspotStatuses2.type = new coc2.RequestType("sonarlint/getAllowedHotspotStatuses");
|
|
4150
4150
|
})(GetAllowedHotspotStatuses || (GetAllowedHotspotStatuses = {}));
|
|
4151
4151
|
var SetHotspotStatus;
|
|
4152
4152
|
((SetHotspotStatus2) => {
|
|
4153
|
-
SetHotspotStatus2.type = new
|
|
4153
|
+
SetHotspotStatus2.type = new coc2.NotificationType(
|
|
4154
4154
|
"sonarlint/changeHotspotStatus"
|
|
4155
4155
|
);
|
|
4156
4156
|
})(SetHotspotStatus || (SetHotspotStatus = {}));
|
|
4157
4157
|
var SslCertificateConfirmation;
|
|
4158
4158
|
((SslCertificateConfirmation2) => {
|
|
4159
|
-
SslCertificateConfirmation2.type = new
|
|
4159
|
+
SslCertificateConfirmation2.type = new coc2.RequestType("sonarlint/askSslCertificateConfirmation");
|
|
4160
4160
|
})(SslCertificateConfirmation || (SslCertificateConfirmation = {}));
|
|
4161
4161
|
var AnalyseOpenFileIgnoringExcludes;
|
|
4162
4162
|
((AnalyseOpenFileIgnoringExcludes2) => {
|
|
4163
|
-
AnalyseOpenFileIgnoringExcludes2.type = new
|
|
4163
|
+
AnalyseOpenFileIgnoringExcludes2.type = new coc2.NotificationType(
|
|
4164
4164
|
"sonarlint/analyseOpenFileIgnoringExcludes"
|
|
4165
4165
|
);
|
|
4166
4166
|
})(AnalyseOpenFileIgnoringExcludes || (AnalyseOpenFileIgnoringExcludes = {}));
|
|
4167
4167
|
var ShowSoonUnsupportedVersionMessage;
|
|
4168
4168
|
((ShowSoonUnsupportedVersionMessage2) => {
|
|
4169
|
-
ShowSoonUnsupportedVersionMessage2.type = new
|
|
4169
|
+
ShowSoonUnsupportedVersionMessage2.type = new coc2.NotificationType(
|
|
4170
4170
|
"sonarlint/showSoonUnsupportedVersionMessage"
|
|
4171
4171
|
);
|
|
4172
4172
|
})(ShowSoonUnsupportedVersionMessage || (ShowSoonUnsupportedVersionMessage = {}));
|
|
4173
4173
|
var SubmitNewCodeDefinition;
|
|
4174
4174
|
((SubmitNewCodeDefinition2) => {
|
|
4175
|
-
SubmitNewCodeDefinition2.type = new
|
|
4175
|
+
SubmitNewCodeDefinition2.type = new coc2.NotificationType(
|
|
4176
4176
|
"sonarlint/submitNewCodeDefinition"
|
|
4177
4177
|
);
|
|
4178
4178
|
})(SubmitNewCodeDefinition || (SubmitNewCodeDefinition = {}));
|
|
4179
4179
|
var SuggestConnection;
|
|
4180
4180
|
((SuggestConnection2) => {
|
|
4181
|
-
SuggestConnection2.type = new
|
|
4181
|
+
SuggestConnection2.type = new coc2.NotificationType(
|
|
4182
4182
|
"sonarlint/suggestConnection"
|
|
4183
4183
|
);
|
|
4184
4184
|
})(SuggestConnection || (SuggestConnection = {}));
|
|
4185
4185
|
var DidCreateBinding;
|
|
4186
4186
|
((DidCreateBinding2) => {
|
|
4187
|
-
DidCreateBinding2.type = new
|
|
4187
|
+
DidCreateBinding2.type = new coc2.NotificationType(
|
|
4188
4188
|
"sonarlint/didCreateBinding"
|
|
4189
4189
|
);
|
|
4190
4190
|
})(DidCreateBinding || (DidCreateBinding = {}));
|
|
@@ -4192,7 +4192,7 @@ var DidCreateBinding;
|
|
|
4192
4192
|
// src/index.ts
|
|
4193
4193
|
var ChildProcess = __toESM(require("child_process"));
|
|
4194
4194
|
var import_coc2 = require("coc.nvim");
|
|
4195
|
-
var
|
|
4195
|
+
var coc12 = __toESM(require("coc.nvim"));
|
|
4196
4196
|
|
|
4197
4197
|
// src/settings/settings.ts
|
|
4198
4198
|
var import_coc = require("coc.nvim");
|
|
@@ -4221,10 +4221,10 @@ function getCurrentConfiguration() {
|
|
|
4221
4221
|
}
|
|
4222
4222
|
|
|
4223
4223
|
// src/util/logging.ts
|
|
4224
|
-
var
|
|
4224
|
+
var coc3 = __toESM(require("coc.nvim"));
|
|
4225
4225
|
var sonarlintOutput;
|
|
4226
4226
|
function initLogOutput(context) {
|
|
4227
|
-
sonarlintOutput =
|
|
4227
|
+
sonarlintOutput = coc3.window.createOutputChannel("SonarLint");
|
|
4228
4228
|
context.subscriptions.push(sonarlintOutput);
|
|
4229
4229
|
}
|
|
4230
4230
|
function getLogOutput() {
|
|
@@ -4240,11 +4240,26 @@ function showLogOutput() {
|
|
|
4240
4240
|
}
|
|
4241
4241
|
|
|
4242
4242
|
// src/lsp/server.ts
|
|
4243
|
+
var fs = __toESM(require("fs"));
|
|
4243
4244
|
var Path = __toESM(require("path"));
|
|
4244
|
-
var
|
|
4245
|
+
var coc4 = __toESM(require("coc.nvim"));
|
|
4245
4246
|
var DEBUG = typeof v8debug === "object" || startedInDebugMode(process);
|
|
4246
4247
|
function languageServerCommand(context, requirements) {
|
|
4247
|
-
|
|
4248
|
+
let location = getSonarLintConfiguration().get("ls.directory");
|
|
4249
|
+
location = !location ? Path.resolve(__dirname, "../") : location;
|
|
4250
|
+
if (location) {
|
|
4251
|
+
location = coc4.workspace.expand(location);
|
|
4252
|
+
if (!fs.existsSync(location)) {
|
|
4253
|
+
logToSonarLintOutput(
|
|
4254
|
+
`Sonar can not start, invalid or non existent path was detected ${location}`
|
|
4255
|
+
);
|
|
4256
|
+
coc4.window.showWarningMessage(`Sonar binaries were not found, check SonarLint output`);
|
|
4257
|
+
return void 0;
|
|
4258
|
+
}
|
|
4259
|
+
} else {
|
|
4260
|
+
coc4.window.showWarningMessage(`Sonar binaries directory could not be resolved at all`);
|
|
4261
|
+
return void 0;
|
|
4262
|
+
}
|
|
4248
4263
|
const serverJar = Path.resolve(
|
|
4249
4264
|
location,
|
|
4250
4265
|
"server",
|
|
@@ -4289,7 +4304,7 @@ function languageServerCommand(context, requirements) {
|
|
|
4289
4304
|
return {
|
|
4290
4305
|
command: javaExecutablePath,
|
|
4291
4306
|
args: params,
|
|
4292
|
-
transport:
|
|
4307
|
+
transport: coc4.TransportKind.stdio
|
|
4293
4308
|
};
|
|
4294
4309
|
}
|
|
4295
4310
|
function parseVMargs(params, vmargsLine) {
|
|
@@ -4318,7 +4333,7 @@ var import_find_java_home = __toESM(require_dist());
|
|
|
4318
4333
|
var fse = __toESM(require_lib());
|
|
4319
4334
|
var path = __toESM(require("path"));
|
|
4320
4335
|
var import_path_exists = __toESM(require_path_exists2());
|
|
4321
|
-
var
|
|
4336
|
+
var coc5 = __toESM(require("coc.nvim"));
|
|
4322
4337
|
|
|
4323
4338
|
// src/util/commands.ts
|
|
4324
4339
|
var Commands;
|
|
@@ -4371,7 +4386,7 @@ var Commands;
|
|
|
4371
4386
|
|
|
4372
4387
|
// src/util/requirements.ts
|
|
4373
4388
|
var REQUIRED_JAVA_VERSION = 17;
|
|
4374
|
-
var isWindows = process.platform.
|
|
4389
|
+
var isWindows = process.platform.startsWith("win");
|
|
4375
4390
|
var JAVA_FILENAME = `java${isWindows ? ".exe" : ""}`;
|
|
4376
4391
|
var JAVA_HOME_CONFIG = "sonarlint.ls.javaHome";
|
|
4377
4392
|
async function resolveRequirements(context) {
|
|
@@ -4457,7 +4472,7 @@ function tryExplicitConfiguration() {
|
|
|
4457
4472
|
return { source, javaHome };
|
|
4458
4473
|
}
|
|
4459
4474
|
function readJavaConfig() {
|
|
4460
|
-
return
|
|
4475
|
+
return coc5.workspace.getConfiguration().get(JAVA_HOME_CONFIG, "java");
|
|
4461
4476
|
}
|
|
4462
4477
|
function checkJavaVersion(javaHome) {
|
|
4463
4478
|
return new Promise((resolve3, reject) => {
|
|
@@ -4510,7 +4525,7 @@ function openJREDownload(reject, cause) {
|
|
|
4510
4525
|
message: cause,
|
|
4511
4526
|
label: "Get the Java Runtime Environment",
|
|
4512
4527
|
command: Commands.OPEN_BROWSER,
|
|
4513
|
-
commandParam:
|
|
4528
|
+
commandParam: coc5.Uri.parse(jreUrl)
|
|
4514
4529
|
});
|
|
4515
4530
|
}
|
|
4516
4531
|
function invalidJavaHome(reject, cause) {
|
|
@@ -4529,12 +4544,12 @@ function invalidJavaHome(reject, cause) {
|
|
|
4529
4544
|
}
|
|
4530
4545
|
|
|
4531
4546
|
// src/lsp/client.ts
|
|
4532
|
-
var
|
|
4547
|
+
var coc7 = __toESM(require("coc.nvim"));
|
|
4533
4548
|
|
|
4534
4549
|
// src/util/uri.ts
|
|
4535
|
-
var
|
|
4550
|
+
var coc6 = __toESM(require("coc.nvim"));
|
|
4536
4551
|
function code2ProtocolConverter(value) {
|
|
4537
|
-
if (
|
|
4552
|
+
if (process.platform.startsWith("win32")) {
|
|
4538
4553
|
return value.toString().replace(/%3A/i, ":");
|
|
4539
4554
|
} else {
|
|
4540
4555
|
return value.toString();
|
|
@@ -4542,7 +4557,7 @@ function code2ProtocolConverter(value) {
|
|
|
4542
4557
|
}
|
|
4543
4558
|
|
|
4544
4559
|
// src/lsp/client.ts
|
|
4545
|
-
var SonarLintExtendedLanguageClient = class extends
|
|
4560
|
+
var SonarLintExtendedLanguageClient = class extends coc7.LanguageClient {
|
|
4546
4561
|
listAllRules() {
|
|
4547
4562
|
return this.sendRequest(ListAllRulesRequest.type);
|
|
4548
4563
|
}
|
|
@@ -4703,7 +4718,7 @@ var SonarLintExtendedLanguageClient = class extends coc6.LanguageClient {
|
|
|
4703
4718
|
};
|
|
4704
4719
|
|
|
4705
4720
|
// src/util/platform.ts
|
|
4706
|
-
var
|
|
4721
|
+
var fs2 = __toESM(require("fs"));
|
|
4707
4722
|
function getPlatform() {
|
|
4708
4723
|
const platform = process.platform;
|
|
4709
4724
|
if (platform === "linux" && isAlpineLinux()) {
|
|
@@ -4714,36 +4729,38 @@ function getPlatform() {
|
|
|
4714
4729
|
function isAlpineLinux() {
|
|
4715
4730
|
let fileContent;
|
|
4716
4731
|
try {
|
|
4717
|
-
fileContent =
|
|
4732
|
+
fileContent = fs2.readFileSync("/etc/os-release", "utf-8");
|
|
4718
4733
|
} catch (error1) {
|
|
4719
4734
|
try {
|
|
4720
|
-
fileContent =
|
|
4735
|
+
fileContent = fs2.readFileSync("/usr/lib/os-release", "utf-8");
|
|
4721
4736
|
} catch (error2) {
|
|
4722
4737
|
return false;
|
|
4723
4738
|
}
|
|
4724
4739
|
}
|
|
4725
|
-
return !!fileContent && (fileContent.match(/^ID=([^\u001b\r\n]*)/m)
|
|
4740
|
+
return !!fileContent && (fileContent.match(/^ID=([^\u001b\r\n]*)/m) ?? [])[1] === "alpine";
|
|
4726
4741
|
}
|
|
4727
4742
|
|
|
4728
4743
|
// src/rules/rules.ts
|
|
4729
|
-
var
|
|
4744
|
+
var coc8 = __toESM(require("coc.nvim"));
|
|
4730
4745
|
function isActive(rule) {
|
|
4731
4746
|
return rule.activeByDefault && rule.levelFromConfig !== "off" || rule.levelFromConfig === "on";
|
|
4732
4747
|
}
|
|
4733
4748
|
function actualLevel(rule) {
|
|
4734
4749
|
return isActive(rule) ? "on" : "off";
|
|
4735
4750
|
}
|
|
4736
|
-
var LanguageNode = class extends
|
|
4751
|
+
var LanguageNode = class extends coc8.TreeItem {
|
|
4737
4752
|
constructor(label, state) {
|
|
4738
|
-
super(label, state
|
|
4739
|
-
this.
|
|
4753
|
+
super(label, state);
|
|
4754
|
+
this.id = label.toLowerCase();
|
|
4755
|
+
this.tooltip = `Rules applicable for ${label} language`;
|
|
4740
4756
|
}
|
|
4741
4757
|
};
|
|
4742
|
-
var RuleNode = class extends
|
|
4743
|
-
constructor(rule) {
|
|
4758
|
+
var RuleNode = class extends coc8.TreeItem {
|
|
4759
|
+
constructor(rule, language) {
|
|
4744
4760
|
super(rule.name);
|
|
4745
4761
|
this.rule = rule;
|
|
4746
|
-
this.
|
|
4762
|
+
this.language = language;
|
|
4763
|
+
this.id = rule.key.toLowerCase();
|
|
4747
4764
|
this.tooltip = `Toggle rule ${rule.key} status`;
|
|
4748
4765
|
this.description = `${rule.key} - ${actualLevel(rule)}`;
|
|
4749
4766
|
this.command = {
|
|
@@ -4754,54 +4771,75 @@ var RuleNode = class extends coc7.TreeItem {
|
|
|
4754
4771
|
}
|
|
4755
4772
|
};
|
|
4756
4773
|
var AllRulesTreeDataProvider = class {
|
|
4757
|
-
constructor(allRulesProvider,
|
|
4774
|
+
constructor(allRulesProvider, allRootsStates) {
|
|
4758
4775
|
this.allRulesProvider = allRulesProvider;
|
|
4759
|
-
this.
|
|
4760
|
-
this._onDidChangeTreeData = new
|
|
4776
|
+
this.allRootsStates = allRootsStates;
|
|
4777
|
+
this._onDidChangeTreeData = new coc8.Emitter();
|
|
4761
4778
|
this.onDidChangeTreeData = this._onDidChangeTreeData.event;
|
|
4762
|
-
|
|
4763
|
-
|
|
4764
|
-
|
|
4779
|
+
this.allRoots = [];
|
|
4780
|
+
this.allChildren = /* @__PURE__ */ new Map();
|
|
4781
|
+
}
|
|
4782
|
+
async getTreeItem(node) {
|
|
4783
|
+
if (node instanceof RuleNode && node.id && this.allChildren.has(node.id)) {
|
|
4784
|
+
return this.allChildren.get(node.id)?.find((n) => n.id == node.id);
|
|
4785
|
+
} else if (node instanceof LanguageNode && this.allRoots.length > 0) {
|
|
4786
|
+
return this.allRoots?.find((n) => n.id == node.id);
|
|
4787
|
+
} else {
|
|
4788
|
+
return node;
|
|
4789
|
+
}
|
|
4765
4790
|
}
|
|
4766
4791
|
async getParent(node) {
|
|
4767
4792
|
if (node instanceof LanguageNode) {
|
|
4768
4793
|
return null;
|
|
4769
|
-
} else {
|
|
4770
|
-
|
|
4771
|
-
|
|
4772
|
-
|
|
4773
|
-
|
|
4774
|
-
)
|
|
4775
|
-
|
|
4794
|
+
} else if (node instanceof RuleNode) {
|
|
4795
|
+
if (this.allRoots.length == 0) {
|
|
4796
|
+
await this.getChildren();
|
|
4797
|
+
}
|
|
4798
|
+
if (node?.language !== void 0) {
|
|
4799
|
+
return this.allRoots.find((n) => n.id == node.language);
|
|
4800
|
+
} else {
|
|
4801
|
+
const response = await this.getAllRules();
|
|
4802
|
+
const nodeKey = node.rule.key.toLowerCase();
|
|
4803
|
+
const languageNode = Object.keys(response).filter((k) => response[k].findIndex(
|
|
4804
|
+
(r) => r.key.toLowerCase() === nodeKey
|
|
4805
|
+
) >= 0).map((l) => l.toLowerCase()).pop();
|
|
4806
|
+
return this.allRoots.find((n) => n.id == languageNode);
|
|
4807
|
+
}
|
|
4776
4808
|
}
|
|
4777
4809
|
}
|
|
4778
4810
|
async getChildren(node) {
|
|
4779
|
-
|
|
4780
|
-
|
|
4781
|
-
|
|
4782
|
-
|
|
4783
|
-
|
|
4784
|
-
|
|
4785
|
-
|
|
4786
|
-
|
|
4787
|
-
|
|
4788
|
-
|
|
4789
|
-
|
|
4790
|
-
|
|
4791
|
-
|
|
4792
|
-
|
|
4793
|
-
|
|
4794
|
-
|
|
4795
|
-
}
|
|
4796
|
-
|
|
4797
|
-
|
|
4798
|
-
|
|
4811
|
+
let result;
|
|
4812
|
+
if (this.allRoots.length == 0 || node?.id && !this.allChildren.has(node.id)) {
|
|
4813
|
+
const localRuleConfig = coc8.workspace.getConfiguration("sonarlint.rules");
|
|
4814
|
+
result = await this.getAllRules().then((response) => {
|
|
4815
|
+
if (node) {
|
|
4816
|
+
return response[node.label].sort(byName).map((rule) => {
|
|
4817
|
+
rule.levelFromConfig = localRuleConfig.get(rule.key, {})["level"];
|
|
4818
|
+
return rule;
|
|
4819
|
+
}).filter((r) => {
|
|
4820
|
+
if (this.levelFilter === "on") {
|
|
4821
|
+
return isActive(r);
|
|
4822
|
+
} else if (this.levelFilter === "off") {
|
|
4823
|
+
return !isActive(r);
|
|
4824
|
+
} else {
|
|
4825
|
+
return true;
|
|
4826
|
+
}
|
|
4827
|
+
}).map((rule) => new RuleNode(rule, node.id?.toLowerCase()));
|
|
4828
|
+
} else {
|
|
4829
|
+
return Object.keys(response).sort().map(
|
|
4830
|
+
(language) => new LanguageNode(language, this.allRootsStates.get(language.toLowerCase()) ?? coc8.TreeItemCollapsibleState.Collapsed)
|
|
4831
|
+
);
|
|
4832
|
+
}
|
|
4833
|
+
});
|
|
4834
|
+
if (node instanceof LanguageNode && node.id) {
|
|
4835
|
+
this.allChildren.set(node.id, result);
|
|
4799
4836
|
} else {
|
|
4800
|
-
|
|
4801
|
-
(language) => new LanguageNode(language, this.elementStatus.get(language))
|
|
4802
|
-
);
|
|
4837
|
+
this.allRoots = result;
|
|
4803
4838
|
}
|
|
4804
|
-
}
|
|
4839
|
+
} else {
|
|
4840
|
+
result = node instanceof LanguageNode && node.id ? this.allChildren.get(node.id) : this.allRoots;
|
|
4841
|
+
}
|
|
4842
|
+
return result;
|
|
4805
4843
|
}
|
|
4806
4844
|
async getAllRules() {
|
|
4807
4845
|
if (this.allRules === void 0) {
|
|
@@ -4810,6 +4848,11 @@ var AllRulesTreeDataProvider = class {
|
|
|
4810
4848
|
return this.allRules;
|
|
4811
4849
|
}
|
|
4812
4850
|
refresh() {
|
|
4851
|
+
let copy = { roots: this.allRoots, children: this.allChildren };
|
|
4852
|
+
delete copy.roots;
|
|
4853
|
+
delete copy.children;
|
|
4854
|
+
this.allRoots = [];
|
|
4855
|
+
this.allChildren = /* @__PURE__ */ new Map();
|
|
4813
4856
|
this._onDidChangeTreeData.fire(void 0);
|
|
4814
4857
|
}
|
|
4815
4858
|
filter(level) {
|
|
@@ -4817,7 +4860,9 @@ var AllRulesTreeDataProvider = class {
|
|
|
4817
4860
|
this.refresh();
|
|
4818
4861
|
}
|
|
4819
4862
|
register(element) {
|
|
4820
|
-
|
|
4863
|
+
if (element instanceof LanguageNode) {
|
|
4864
|
+
this.allRootsStates.set(element.id, element.collapsibleState);
|
|
4865
|
+
}
|
|
4821
4866
|
}
|
|
4822
4867
|
};
|
|
4823
4868
|
function byName(r1, r2) {
|
|
@@ -4827,45 +4872,54 @@ function toggleRule(level) {
|
|
|
4827
4872
|
return async (ruleKey) => {
|
|
4828
4873
|
const configuration = getSonarLintConfiguration();
|
|
4829
4874
|
let rules = configuration.get("rules") || {};
|
|
4875
|
+
rules = { ...rules };
|
|
4830
4876
|
if (typeof ruleKey === "string") {
|
|
4831
4877
|
if (!level) {
|
|
4832
4878
|
const current = rules[ruleKey] ? rules[ruleKey].level : void 0;
|
|
4833
4879
|
level = !current || current == "on" ? "off" : "on";
|
|
4834
4880
|
}
|
|
4835
|
-
|
|
4836
|
-
rules = Object.assign({ [ruleKey]: {
|
|
4837
|
-
if (
|
|
4838
|
-
const result = await
|
|
4881
|
+
let localLevel = !level ? rules[ruleKey] : level;
|
|
4882
|
+
rules = Object.assign({ [ruleKey]: { localLevel } }, rules);
|
|
4883
|
+
if (localLevel === "off") {
|
|
4884
|
+
const result = await coc8.window.showPrompt(
|
|
4839
4885
|
`Are you sure you want to disable rule ${ruleKey}? `
|
|
4840
4886
|
);
|
|
4841
4887
|
if (!result) {
|
|
4842
4888
|
return;
|
|
4843
4889
|
}
|
|
4844
4890
|
}
|
|
4845
|
-
|
|
4846
|
-
`Changed level of rule ${ruleKey} to ${
|
|
4891
|
+
coc8.window.showWarningMessage(
|
|
4892
|
+
`Changed level of rule ${ruleKey} to ${localLevel}`
|
|
4847
4893
|
);
|
|
4848
4894
|
return await configuration.update(
|
|
4849
4895
|
"rules",
|
|
4850
4896
|
rules,
|
|
4851
|
-
|
|
4897
|
+
coc8.ConfigurationTarget.Global
|
|
4852
4898
|
);
|
|
4853
4899
|
} else {
|
|
4854
4900
|
const { key, activeByDefault } = ruleKey;
|
|
4901
|
+
let localLevel = level;
|
|
4855
4902
|
if (!level) {
|
|
4856
4903
|
const current = rules[key] ? rules[key].level : void 0;
|
|
4857
|
-
|
|
4904
|
+
if (!current) {
|
|
4905
|
+
localLevel = activeByDefault === true ? "off" : "on";
|
|
4906
|
+
} else {
|
|
4907
|
+
localLevel = current === "on" ? "off" : "on";
|
|
4908
|
+
}
|
|
4858
4909
|
}
|
|
4859
|
-
if (
|
|
4860
|
-
|
|
4910
|
+
if (localLevel === "on" && !activeByDefault || localLevel === "off" && activeByDefault) {
|
|
4911
|
+
if (!rules[key]) {
|
|
4912
|
+
rules[key] = {};
|
|
4913
|
+
}
|
|
4914
|
+
rules[key].level = localLevel;
|
|
4861
4915
|
} else {
|
|
4862
|
-
rules
|
|
4916
|
+
delete rules[key];
|
|
4863
4917
|
}
|
|
4864
|
-
|
|
4918
|
+
coc8.window.showWarningMessage(`Changed level of rule ${key} to ${localLevel}`);
|
|
4865
4919
|
return await configuration.update(
|
|
4866
4920
|
"rules",
|
|
4867
4921
|
rules,
|
|
4868
|
-
|
|
4922
|
+
coc8.ConfigurationTarget.Global
|
|
4869
4923
|
);
|
|
4870
4924
|
}
|
|
4871
4925
|
};
|
|
@@ -4970,7 +5024,7 @@ var assertValidOperator = (op) => {
|
|
|
4970
5024
|
};
|
|
4971
5025
|
|
|
4972
5026
|
// src/java/java.ts
|
|
4973
|
-
var
|
|
5027
|
+
var coc9 = __toESM(require("coc.nvim"));
|
|
4974
5028
|
var classpathChangeListener;
|
|
4975
5029
|
var serverModeListener;
|
|
4976
5030
|
var javaApiTooLowAlreadyLogged = false;
|
|
@@ -4978,7 +5032,7 @@ var javaServerInLightWeightModeAlreadyLogged = false;
|
|
|
4978
5032
|
function installClasspathListener(languageClient2) {
|
|
4979
5033
|
const extension2 = getJavaExtension();
|
|
4980
5034
|
if (!extension2) {
|
|
4981
|
-
|
|
5035
|
+
coc9.window.showWarningMessage(`Unable to find any compliant java extension installed in the coc runtime`);
|
|
4982
5036
|
return;
|
|
4983
5037
|
}
|
|
4984
5038
|
if (extension2?.isActive) {
|
|
@@ -5041,7 +5095,7 @@ async function getJavaConfig(languageClient2, fileUri) {
|
|
|
5041
5095
|
const extension2 = getJavaExtension();
|
|
5042
5096
|
try {
|
|
5043
5097
|
if (!extension2) {
|
|
5044
|
-
|
|
5098
|
+
coc9.window.showWarningMessage(`Unable to find any compliant java extension installed in the coc runtime`);
|
|
5045
5099
|
return;
|
|
5046
5100
|
}
|
|
5047
5101
|
const extensionApi = await extension2?.activate();
|
|
@@ -5072,7 +5126,7 @@ async function getJavaConfig(languageClient2, fileUri) {
|
|
|
5072
5126
|
};
|
|
5073
5127
|
}
|
|
5074
5128
|
} catch (error) {
|
|
5075
|
-
|
|
5129
|
+
coc9.window.showErrorMessage(JSON.stringify(error));
|
|
5076
5130
|
}
|
|
5077
5131
|
}
|
|
5078
5132
|
function javaConfigDisabledInLightWeightMode() {
|
|
@@ -5085,15 +5139,15 @@ function javaConfigDisabledInLightWeightMode() {
|
|
|
5085
5139
|
return void 0;
|
|
5086
5140
|
}
|
|
5087
5141
|
function getJavaExtension() {
|
|
5088
|
-
const java =
|
|
5142
|
+
const java = coc9.extensions.getExtensionById("coc-java");
|
|
5089
5143
|
if (!java || java == null || java === void 0) {
|
|
5090
|
-
return
|
|
5144
|
+
return coc9.extensions.getExtensionById("coc-java-dev");
|
|
5091
5145
|
}
|
|
5092
5146
|
return java;
|
|
5093
5147
|
}
|
|
5094
5148
|
|
|
5095
5149
|
// src/rules/rulepanel.ts
|
|
5096
|
-
var
|
|
5150
|
+
var coc10 = __toESM(require("coc.nvim"));
|
|
5097
5151
|
function showRuleDescription(factory) {
|
|
5098
5152
|
return (params) => {
|
|
5099
5153
|
factory.show([
|
|
@@ -5146,7 +5200,7 @@ function computeHeading(tab, contextualDescription) {
|
|
|
5146
5200
|
}
|
|
5147
5201
|
function renderRuleParams(rule) {
|
|
5148
5202
|
if (rule.parameters && rule.parameters.length > 0) {
|
|
5149
|
-
const ruleParamsConfig =
|
|
5203
|
+
const ruleParamsConfig = coc10.workspace.getConfiguration(
|
|
5150
5204
|
`sonarlint.rules.${rule.key}.parameters`
|
|
5151
5205
|
);
|
|
5152
5206
|
return `Following parameter values can be set in the SonarLint:Rules user settings.
|
|
@@ -5171,8 +5225,8 @@ function renderRuleParam(param, config) {
|
|
|
5171
5225
|
}
|
|
5172
5226
|
|
|
5173
5227
|
// src/cfamily/cfamily.ts
|
|
5174
|
-
var
|
|
5175
|
-
var
|
|
5228
|
+
var coc11 = __toESM(require("coc.nvim"));
|
|
5229
|
+
var fs3 = __toESM(require("fs"));
|
|
5176
5230
|
var path2 = __toESM(require("path"));
|
|
5177
5231
|
|
|
5178
5232
|
// src/commons.ts
|
|
@@ -5191,33 +5245,33 @@ var FULL_PATH_TO_COMPILE_COMMANDS = `${SONARLINT_CATEGORY}.${PATH_TO_COMPILE_COM
|
|
|
5191
5245
|
var DO_NOT_ASK_ABOUT_COMPILE_COMMANDS_FLAG = "doNotAskAboutCompileCommands";
|
|
5192
5246
|
var remindMeLaterAboutCompileCommandsFlag = false;
|
|
5193
5247
|
function showMessageAndUpdateConfig(compilationDbPath) {
|
|
5194
|
-
|
|
5248
|
+
coc11.window.showInformationMessage(
|
|
5195
5249
|
`Analysis configured. Compilation database path is set to: ${compilationDbPath}`
|
|
5196
5250
|
);
|
|
5197
5251
|
const [pathForSettings, workspaceFolder] = tryRelativizeToWorkspaceFolder(compilationDbPath);
|
|
5198
5252
|
if (workspaceFolder !== void 0) {
|
|
5199
|
-
const config =
|
|
5253
|
+
const config = coc11.workspace.getConfiguration(
|
|
5200
5254
|
SONARLINT_CATEGORY,
|
|
5201
5255
|
workspaceFolder.uri
|
|
5202
5256
|
);
|
|
5203
5257
|
return config.update(
|
|
5204
5258
|
PATH_TO_COMPILE_COMMANDS,
|
|
5205
5259
|
pathForSettings,
|
|
5206
|
-
|
|
5260
|
+
coc11.ConfigurationTarget.WorkspaceFolder
|
|
5207
5261
|
);
|
|
5208
5262
|
}
|
|
5209
|
-
return
|
|
5263
|
+
return coc11.workspace.getConfiguration().update(
|
|
5210
5264
|
FULL_PATH_TO_COMPILE_COMMANDS,
|
|
5211
5265
|
pathForSettings,
|
|
5212
|
-
|
|
5266
|
+
coc11.ConfigurationTarget.Workspace
|
|
5213
5267
|
);
|
|
5214
5268
|
}
|
|
5215
5269
|
function tryRelativizeToWorkspaceFolder(filePath) {
|
|
5216
5270
|
if (!path2.isAbsolute(filePath)) {
|
|
5217
5271
|
return [filePath, void 0];
|
|
5218
5272
|
}
|
|
5219
|
-
for (const folder of
|
|
5220
|
-
const folderPath =
|
|
5273
|
+
for (const folder of coc11.workspace.workspaceFolders || []) {
|
|
5274
|
+
const folderPath = coc11.Uri.parse(folder.uri).fsPath;
|
|
5221
5275
|
if (filePath.startsWith(folderPath)) {
|
|
5222
5276
|
const pathWithVariable = `\${workspaceFolder}${filePath.replace(folderPath, "")}`;
|
|
5223
5277
|
return [pathWithVariable, folder];
|
|
@@ -5226,15 +5280,17 @@ function tryRelativizeToWorkspaceFolder(filePath) {
|
|
|
5226
5280
|
return [filePath, void 0];
|
|
5227
5281
|
}
|
|
5228
5282
|
async function configureCompilationDatabase() {
|
|
5229
|
-
const paths = (await
|
|
5283
|
+
const paths = (await coc11.workspace.findFiles(`**/compile_commands.json`)).filter((path3) => fs3.existsSync(path3.fsPath));
|
|
5230
5284
|
if (paths.length === 0) {
|
|
5231
|
-
|
|
5285
|
+
coc11.window.showWarningMessage(
|
|
5286
|
+
`No compilation databases were found in the workspace
|
|
5232
5287
|
|
|
5233
|
-
[How to generate compile commands](${SonarLintDocumentation.C_CPP_ANALYSIS})`
|
|
5234
|
-
|
|
5288
|
+
[How to generate compile commands](${SonarLintDocumentation.C_CPP_ANALYSIS})`
|
|
5289
|
+
);
|
|
5290
|
+
coc11.workspace.getConfiguration().update(
|
|
5235
5291
|
FULL_PATH_TO_COMPILE_COMMANDS,
|
|
5236
5292
|
void 0,
|
|
5237
|
-
|
|
5293
|
+
coc11.ConfigurationTarget.Workspace
|
|
5238
5294
|
);
|
|
5239
5295
|
} else {
|
|
5240
5296
|
await showCompilationDatabaseOptions(paths);
|
|
@@ -5249,7 +5305,7 @@ function notifyMissingCompileCommands(context) {
|
|
|
5249
5305
|
const configureCompileCommandsAction = "Configure compile commands";
|
|
5250
5306
|
const message = `SonarLint is unable to analyze C and C++ file(s) because there is no configured compilation
|
|
5251
5307
|
database.`;
|
|
5252
|
-
|
|
5308
|
+
coc11.window.showWarningMessage(
|
|
5253
5309
|
message,
|
|
5254
5310
|
configureCompileCommandsAction,
|
|
5255
5311
|
remindMeLaterAction
|
|
@@ -5281,7 +5337,7 @@ async function showCompilationDatabaseOptions(paths) {
|
|
|
5281
5337
|
index: i
|
|
5282
5338
|
}));
|
|
5283
5339
|
items.sort((i1, i2) => i1.label.localeCompare(i2.label));
|
|
5284
|
-
const selection = await
|
|
5340
|
+
const selection = await coc11.window.showQuickPick(items, {
|
|
5285
5341
|
placeholder: "Pick a compilation database"
|
|
5286
5342
|
});
|
|
5287
5343
|
if (selection) {
|
|
@@ -5307,17 +5363,21 @@ var allRulesView;
|
|
|
5307
5363
|
var floatDescriptionFactory;
|
|
5308
5364
|
async function runJavaServer(context) {
|
|
5309
5365
|
return resolveRequirements(context).catch((error) => {
|
|
5310
|
-
|
|
5366
|
+
coc12.window.showErrorMessage(error.message, error.label).then((selection) => {
|
|
5311
5367
|
if (error.label && error.label === selection && error.command) {
|
|
5312
|
-
|
|
5368
|
+
coc12.commands.executeCommand(error.command, error.commandParam);
|
|
5313
5369
|
}
|
|
5314
5370
|
});
|
|
5315
5371
|
throw error;
|
|
5316
5372
|
}).then((requirements) => {
|
|
5317
|
-
return new Promise((resolve3,
|
|
5373
|
+
return new Promise((resolve3, reject) => {
|
|
5318
5374
|
const { command, args } = languageServerCommand(context, requirements);
|
|
5375
|
+
if (!command) {
|
|
5376
|
+
reject(void 0);
|
|
5377
|
+
return;
|
|
5378
|
+
}
|
|
5319
5379
|
logToSonarLintOutput(`Executing ${command} ${args.join(" ")}`);
|
|
5320
|
-
import_coc2.window.showInformationMessage("Sonarlint is starting...");
|
|
5380
|
+
import_coc2.window.showInformationMessage("Sonarlint server is starting...");
|
|
5321
5381
|
const process2 = ChildProcess.spawn(command, args);
|
|
5322
5382
|
process2.stderr.on("data", function(data) {
|
|
5323
5383
|
logWithPrefix(data, "[stderr]");
|
|
@@ -5334,8 +5394,8 @@ async function activate(context) {
|
|
|
5334
5394
|
setExtensionContext(context);
|
|
5335
5395
|
initLogOutput(context);
|
|
5336
5396
|
const serverOptions = () => runJavaServer(context);
|
|
5337
|
-
const pythonWatcher =
|
|
5338
|
-
const sharedConnectedModeConfigurationWatcher =
|
|
5397
|
+
const pythonWatcher = coc12.workspace.createFileSystemWatcher("**/*.py");
|
|
5398
|
+
const sharedConnectedModeConfigurationWatcher = coc12.workspace.createFileSystemWatcher("**/.sonarlint/*.json");
|
|
5339
5399
|
context.subscriptions.push(pythonWatcher);
|
|
5340
5400
|
context.subscriptions.push(sharedConnectedModeConfigurationWatcher);
|
|
5341
5401
|
const clientOptions = {
|
|
@@ -5350,10 +5410,10 @@ async function activate(context) {
|
|
|
5350
5410
|
productKey: "vscode",
|
|
5351
5411
|
productName: "SonarLint coc",
|
|
5352
5412
|
productVersion: "1.0.0",
|
|
5353
|
-
showVerboseLogs:
|
|
5413
|
+
showVerboseLogs: coc12.workspace.getConfiguration().get("sonarlint.output.showVerboseLogs", false),
|
|
5354
5414
|
platform: getPlatform(),
|
|
5355
5415
|
architecture: process.arch,
|
|
5356
|
-
clientNodePath:
|
|
5416
|
+
clientNodePath: coc12.workspace.getConfiguration().get("sonarlint.pathToNodeExecutable")
|
|
5357
5417
|
};
|
|
5358
5418
|
},
|
|
5359
5419
|
outputChannel: getLogOutput(),
|
|
@@ -5377,14 +5437,14 @@ async function activate(context) {
|
|
|
5377
5437
|
});
|
|
5378
5438
|
context.subscriptions.push(floatDescriptionFactory);
|
|
5379
5439
|
installCustomRequestHandlers(context);
|
|
5380
|
-
|
|
5440
|
+
coc12.workspace.onDidChangeConfiguration(async (event) => {
|
|
5381
5441
|
if (event.affectsConfiguration("sonarlint.rules")) {
|
|
5382
5442
|
allRulesTreeDataProvider.refresh();
|
|
5383
5443
|
}
|
|
5384
5444
|
});
|
|
5385
5445
|
registerCommands(context);
|
|
5386
5446
|
context.subscriptions.push(
|
|
5387
|
-
|
|
5447
|
+
coc12.extensions.onDidActiveExtension(() => {
|
|
5388
5448
|
installClasspathListener(languageClient);
|
|
5389
5449
|
})
|
|
5390
5450
|
);
|
|
@@ -5392,55 +5452,53 @@ async function activate(context) {
|
|
|
5392
5452
|
}
|
|
5393
5453
|
function registerCommands(context) {
|
|
5394
5454
|
context.subscriptions.push(
|
|
5395
|
-
|
|
5455
|
+
coc12.commands.registerCommand(Commands.SHOW_ALL_LOCATIONS, showAllLocations)
|
|
5396
5456
|
);
|
|
5397
5457
|
context.subscriptions.push(
|
|
5398
|
-
|
|
5458
|
+
coc12.commands.registerCommand(Commands.CLEAR_LOCATIONS, clearLocations)
|
|
5399
5459
|
);
|
|
5400
5460
|
context.subscriptions.push(
|
|
5401
|
-
|
|
5461
|
+
coc12.commands.registerCommand(Commands.DEACTIVATE_RULE, toggleRule("off"))
|
|
5402
5462
|
);
|
|
5403
5463
|
context.subscriptions.push(
|
|
5404
|
-
|
|
5464
|
+
coc12.commands.registerCommand(Commands.ACTIVATE_RULE, toggleRule("on"))
|
|
5405
5465
|
);
|
|
5406
5466
|
context.subscriptions.push(
|
|
5407
|
-
|
|
5467
|
+
coc12.commands.registerCommand(Commands.TOGGLE_RULE, toggleRule())
|
|
5408
5468
|
);
|
|
5409
5469
|
context.subscriptions.push(
|
|
5410
|
-
|
|
5411
|
-
await prepareRulesTreeView("Displaying all rules");
|
|
5470
|
+
coc12.commands.registerCommand(Commands.SHOW_ALL_RULES, async () => {
|
|
5412
5471
|
allRulesTreeDataProvider.filter();
|
|
5472
|
+
await prepareRulesTreeView("Displaying all rules");
|
|
5413
5473
|
})
|
|
5414
5474
|
);
|
|
5415
5475
|
context.subscriptions.push(
|
|
5416
|
-
|
|
5417
|
-
await prepareRulesTreeView("Displaying active rules");
|
|
5476
|
+
coc12.commands.registerCommand(Commands.SHOW_ACTIVE_RULES, async () => {
|
|
5418
5477
|
allRulesTreeDataProvider.filter("on");
|
|
5478
|
+
await prepareRulesTreeView("Displaying active rules");
|
|
5419
5479
|
})
|
|
5420
5480
|
);
|
|
5421
5481
|
context.subscriptions.push(
|
|
5422
|
-
|
|
5423
|
-
await prepareRulesTreeView("Displaying inactive rules");
|
|
5482
|
+
coc12.commands.registerCommand(Commands.SHOW_INACTIVE_RULES, async () => {
|
|
5424
5483
|
allRulesTreeDataProvider.filter("off");
|
|
5484
|
+
await prepareRulesTreeView("Displaying inactive rules");
|
|
5425
5485
|
})
|
|
5426
5486
|
);
|
|
5427
5487
|
context.subscriptions.push(
|
|
5428
|
-
|
|
5488
|
+
coc12.commands.registerCommand(
|
|
5429
5489
|
Commands.OPEN_RULE_BY_KEY,
|
|
5430
5490
|
async (ruleKey) => {
|
|
5431
|
-
await
|
|
5432
|
-
|
|
5433
|
-
|
|
5434
|
-
|
|
5435
|
-
|
|
5436
|
-
|
|
5437
|
-
}
|
|
5438
|
-
);
|
|
5491
|
+
await prepareRulesTreeView(`Displaying rules for ${ruleKey}`);
|
|
5492
|
+
const type = ruleKey.indexOf(":") >= 0 ? new RuleNode({ key: ruleKey.toLowerCase() }) : new LanguageNode(ruleKey.toLowerCase(), coc12.TreeItemCollapsibleState.Collapsed);
|
|
5493
|
+
const node = await allRulesTreeDataProvider.getTreeItem(type);
|
|
5494
|
+
node.collapsibleState = coc12.TreeItemCollapsibleState.Expanded;
|
|
5495
|
+
allRulesTreeDataProvider.register(node);
|
|
5496
|
+
await allRulesView?.reveal(node, { select: true, focus: true, expand: true });
|
|
5439
5497
|
}
|
|
5440
5498
|
)
|
|
5441
5499
|
);
|
|
5442
5500
|
context.subscriptions.push(
|
|
5443
|
-
|
|
5501
|
+
coc12.commands.registerCommand(
|
|
5444
5502
|
Commands.SHOW_HOTSPOT_RULE_DESCRIPTION,
|
|
5445
5503
|
(hotspot) => languageClient.showHotspotRuleDescription(
|
|
5446
5504
|
hotspot.ruleKey,
|
|
@@ -5450,25 +5508,25 @@ function registerCommands(context) {
|
|
|
5450
5508
|
)
|
|
5451
5509
|
);
|
|
5452
5510
|
context.subscriptions.push(
|
|
5453
|
-
|
|
5454
|
-
const key = await
|
|
5455
|
-
await
|
|
5511
|
+
coc12.commands.registerCommand(Commands.FIND_RULE_BY_KEY, async () => {
|
|
5512
|
+
const key = await coc12.window.requestInput("Enter rule key", "");
|
|
5513
|
+
await coc12.commands.executeCommand(Commands.OPEN_RULE_BY_KEY, key);
|
|
5456
5514
|
})
|
|
5457
5515
|
);
|
|
5458
5516
|
context.subscriptions.push(
|
|
5459
|
-
|
|
5517
|
+
coc12.commands.registerCommand(
|
|
5460
5518
|
Commands.SHOW_SONARLINT_OUTPUT,
|
|
5461
5519
|
() => showLogOutput()
|
|
5462
5520
|
)
|
|
5463
5521
|
);
|
|
5464
5522
|
context.subscriptions.push(
|
|
5465
|
-
|
|
5523
|
+
coc12.commands.registerCommand(
|
|
5466
5524
|
Commands.CONFIGURE_COMPILATION_DATABASE,
|
|
5467
5525
|
configureCompilationDatabase
|
|
5468
5526
|
)
|
|
5469
5527
|
);
|
|
5470
5528
|
context.subscriptions.push(
|
|
5471
|
-
|
|
5529
|
+
coc12.commands.registerCommand(
|
|
5472
5530
|
Commands.ENABLE_VERBOSE_LOGS,
|
|
5473
5531
|
() => enableVerboseLogs()
|
|
5474
5532
|
)
|
|
@@ -5503,24 +5561,24 @@ function installCustomRequestHandlers(context) {
|
|
|
5503
5561
|
);
|
|
5504
5562
|
languageClient.onNotification(
|
|
5505
5563
|
ShowSonarLintOutputNotification.type,
|
|
5506
|
-
() => void
|
|
5564
|
+
() => void coc12.commands.executeCommand(Commands.SHOW_SONARLINT_OUTPUT)
|
|
5507
5565
|
);
|
|
5508
5566
|
languageClient.onNotification(
|
|
5509
5567
|
OpenJavaHomeSettingsNotification.type,
|
|
5510
|
-
() => void
|
|
5568
|
+
() => void coc12.commands.executeCommand(Commands.OPEN_SETTINGS, JAVA_HOME_CONFIG)
|
|
5511
5569
|
);
|
|
5512
5570
|
languageClient.onNotification(
|
|
5513
5571
|
OpenPathToNodeSettingsNotification.type,
|
|
5514
|
-
() => void
|
|
5572
|
+
() => void coc12.commands.executeCommand(
|
|
5515
5573
|
Commands.OPEN_SETTINGS,
|
|
5516
5574
|
"sonarlint.pathToNodeExecutable"
|
|
5517
5575
|
)
|
|
5518
5576
|
);
|
|
5519
5577
|
languageClient.onNotification(
|
|
5520
5578
|
BrowseToNotification.type,
|
|
5521
|
-
(browseTo) => void
|
|
5579
|
+
(browseTo) => void coc12.commands.executeCommand(
|
|
5522
5580
|
Commands.OPEN_BROWSER,
|
|
5523
|
-
|
|
5581
|
+
coc12.Uri.parse(browseTo)
|
|
5524
5582
|
)
|
|
5525
5583
|
);
|
|
5526
5584
|
languageClient.onNotification(
|
|
@@ -5546,18 +5604,18 @@ async function showAllLocations(issue) {
|
|
|
5546
5604
|
locations.push({ uri: loc.uri, range });
|
|
5547
5605
|
})
|
|
5548
5606
|
);
|
|
5549
|
-
const quickFixList = await
|
|
5550
|
-
await
|
|
5551
|
-
let openCommand = await
|
|
5607
|
+
const quickFixList = await coc12.workspace.getQuickfixList(locations);
|
|
5608
|
+
await coc12.nvim.call("setqflist", [quickFixList]);
|
|
5609
|
+
let openCommand = await coc12.nvim.getVar(
|
|
5552
5610
|
"coc_quickfix_open_command"
|
|
5553
5611
|
);
|
|
5554
|
-
|
|
5612
|
+
coc12.nvim.command(
|
|
5555
5613
|
typeof openCommand === "string" ? openCommand : "copen",
|
|
5556
5614
|
true
|
|
5557
5615
|
);
|
|
5558
5616
|
}
|
|
5559
5617
|
async function clearLocations() {
|
|
5560
|
-
await
|
|
5618
|
+
await coc12.nvim.call("setqflist", [[], "r"]);
|
|
5561
5619
|
}
|
|
5562
5620
|
function deactivate() {
|
|
5563
5621
|
if (!languageClient) {
|
|
@@ -5567,7 +5625,7 @@ function deactivate() {
|
|
|
5567
5625
|
}
|
|
5568
5626
|
async function prepareRulesTreeView(title) {
|
|
5569
5627
|
if (!allRulesView) {
|
|
5570
|
-
allRulesView =
|
|
5628
|
+
allRulesView = coc12.window.createTreeView(title, {
|
|
5571
5629
|
treeDataProvider: allRulesTreeDataProvider
|
|
5572
5630
|
});
|
|
5573
5631
|
allRulesView.onDidCollapseElement((n) => {
|