uilint 0.2.56 → 0.2.58
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/dist/index.js +34 -0
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -2169,6 +2169,40 @@ ${stack}` : ""
|
|
|
2169
2169
|
handleRuleConfigSet(ws, ruleId, severity, options, requestId);
|
|
2170
2170
|
break;
|
|
2171
2171
|
}
|
|
2172
|
+
case "source:fetch": {
|
|
2173
|
+
const { filePath, requestId } = message;
|
|
2174
|
+
const absolutePath = resolveRequestedFilePath(filePath);
|
|
2175
|
+
if (!existsSync5(absolutePath)) {
|
|
2176
|
+
sendMessage(ws, {
|
|
2177
|
+
type: "source:error",
|
|
2178
|
+
filePath,
|
|
2179
|
+
error: "File not found",
|
|
2180
|
+
requestId
|
|
2181
|
+
});
|
|
2182
|
+
break;
|
|
2183
|
+
}
|
|
2184
|
+
try {
|
|
2185
|
+
const content = readFileSync(absolutePath, "utf-8");
|
|
2186
|
+
const totalLines = content.split("\n").length;
|
|
2187
|
+
const relativePath = normalizeDataLocFilePath(absolutePath, serverAppRootForVision);
|
|
2188
|
+
sendMessage(ws, {
|
|
2189
|
+
type: "source:result",
|
|
2190
|
+
filePath,
|
|
2191
|
+
content,
|
|
2192
|
+
totalLines,
|
|
2193
|
+
relativePath,
|
|
2194
|
+
requestId
|
|
2195
|
+
});
|
|
2196
|
+
} catch (error) {
|
|
2197
|
+
sendMessage(ws, {
|
|
2198
|
+
type: "source:error",
|
|
2199
|
+
filePath,
|
|
2200
|
+
error: error instanceof Error ? error.message : "Failed to read file",
|
|
2201
|
+
requestId
|
|
2202
|
+
});
|
|
2203
|
+
}
|
|
2204
|
+
break;
|
|
2205
|
+
}
|
|
2172
2206
|
case "coverage:request": {
|
|
2173
2207
|
const { requestId } = message;
|
|
2174
2208
|
try {
|