@sourcegraph/cody-web 0.3.7 → 0.4.0
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/git-log-BchCiyCn.js +53 -0
- package/dist/{index-DHA0d9ot.js → index-aTZsYjdl.js} +1 -1
- package/dist/index.js +652 -649
- package/dist/lib/agent/shims/child_process.d.ts +1 -0
- package/dist/lib/agent/shims/child_process.d.ts.map +1 -1
- package/dist/lib/agent/shims/os.d.ts +2 -0
- package/dist/lib/agent/shims/os.d.ts.map +1 -1
- package/dist/lib/components/CodyWebPanel.d.ts.map +1 -1
- package/dist/lib/components/CodyWebPanelProvider.d.ts +0 -7
- package/dist/lib/components/CodyWebPanelProvider.d.ts.map +1 -1
- package/dist/shell-D4ktELw-.js +46 -0
- package/dist/style.css +128 -10
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/dist/util-Dj34XCrE.js +0 -24
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { w as wrapInActiveSpan, p as path, U as Uri, C as ContextItemSource, s as spawn } from "./agent.worker-BBGBLXHf.js";
|
|
2
|
+
async function getContextFileFromGitLog(file, options) {
|
|
3
|
+
return wrapInActiveSpan("commands.context.git-log", async (span) => {
|
|
4
|
+
const cwd = path.dirname(file.fsPath);
|
|
5
|
+
const args = ["log", `-L:${options.funcname}:${file.fsPath}`, `--max-count=${options.maxCount}`];
|
|
6
|
+
const result = await spawnAsync("git", args, { cwd });
|
|
7
|
+
if (result.code !== 0) {
|
|
8
|
+
if (result.stderr.includes("no match")) {
|
|
9
|
+
return [];
|
|
10
|
+
}
|
|
11
|
+
throw new Error(`git log failed with exit code ${result.code}: ${result.stderr}`);
|
|
12
|
+
}
|
|
13
|
+
return [
|
|
14
|
+
{
|
|
15
|
+
type: "file",
|
|
16
|
+
content: result.stdout,
|
|
17
|
+
title: "Terminal Output",
|
|
18
|
+
uri: Uri.file("terminal-output"),
|
|
19
|
+
source: ContextItemSource.History
|
|
20
|
+
}
|
|
21
|
+
];
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
async function spawnAsync(command, args, opts) {
|
|
25
|
+
const childProcess = spawn();
|
|
26
|
+
let stdout = "";
|
|
27
|
+
let stderr = "";
|
|
28
|
+
childProcess.stdout.on("data", (data) => {
|
|
29
|
+
stdout += data.toString();
|
|
30
|
+
});
|
|
31
|
+
childProcess.stderr.on("data", (data) => {
|
|
32
|
+
stderr += data.toString();
|
|
33
|
+
});
|
|
34
|
+
let code = -1;
|
|
35
|
+
await new Promise((resolve, reject) => {
|
|
36
|
+
childProcess.on("close", (returnCode) => {
|
|
37
|
+
if (returnCode === null) {
|
|
38
|
+
reject(new Error("Process closed with null return code"));
|
|
39
|
+
} else {
|
|
40
|
+
code = returnCode;
|
|
41
|
+
resolve();
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
return {
|
|
46
|
+
stdout,
|
|
47
|
+
stderr,
|
|
48
|
+
code
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
export {
|
|
52
|
+
getContextFileFromGitLog
|
|
53
|
+
};
|
|
@@ -4,7 +4,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4
4
|
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
5
|
return value;
|
|
6
6
|
};
|
|
7
|
-
import { U as Uri, P as Position, R as Range,
|
|
7
|
+
import { U as Uri, P as Position, R as Range, b as window, D as DiagnosticSeverity, c as workspace, d as updateRangeMultipleChanges, f as commands, t as telemetryRecorder, g as executeEdit, h as ps, i as TERMINAL_EDIT_STATES, j as dedent, k as ThemeColor, m as languages, n as CodeLens, q as setTutorialUri, r as logSidebarClick, v as Disposable } from "./agent.worker-BBGBLXHf.js";
|
|
8
8
|
const EMOJI_SVG_TEMPLATE = `<svg width="32" height="32" xmlns="http://www.w3.org/2000/svg">
|
|
9
9
|
<text x="50%" y="50%" dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="24px">{emoji}</text>
|
|
10
10
|
</svg>`;
|