feat: add hashline editing and TypeScript LSP

This commit is contained in:
云服务部-叶林立
2026-08-19 10:24:03 +08:00
parent 3d431a353d
commit bf8bb42a09
14 changed files with 438 additions and 36 deletions
+30
View File
@@ -0,0 +1,30 @@
import assert from "node:assert/strict";
import { mkdtemp, readFile, rm, writeFile } from "node:fs/promises";
import { tmpdir } from "node:os";
import { join } from "node:path";
import test from "node:test";
import { deployBundleHashlineConfig } from "../extensions/hashline-config.ts";
const EXPECTED_CONFIG = {
hashLength: 2,
grep: false,
replaceText: false,
};
test("hashline config deployment enforces bundle defaults", async () => {
const agentDir = await mkdtemp(join(tmpdir(), "my-pi-hashline-"));
const targetPath = join(agentDir, "hashline.json");
try {
await writeFile(targetPath, '{"grep":true}\n', "utf8");
deployBundleHashlineConfig(agentDir);
assert.deepEqual(JSON.parse(await readFile(targetPath, "utf8")), EXPECTED_CONFIG);
const first = await readFile(targetPath, "utf8");
deployBundleHashlineConfig(agentDir);
assert.equal(await readFile(targetPath, "utf8"), first);
} finally {
await rm(agentDir, { recursive: true, force: true });
}
});