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
+20 -3
View File
@@ -21,13 +21,29 @@ test("search routing narrows files before requesting matching line numbers", ()
assert.match(section, /Use read with offset\/limit only for the exact matching region/);
});
test("ctx_execute_file routing warns about its project-root boundary", () => {
const section = buildToolRoutingSection(["ctx_execute_file"]);
test("context routing analyzes large files without a full read", () => {
const section = buildToolRoutingSection(["ctx_execute", "ctx_execute_file"]);
assert.match(section, /Prefer ctx_execute_file over read when deriving an answer from a large file/);
assert.match(section, /ctx_execute_file is confined to the current project root/);
assert.match(section, /host permission approval does not bypass this Context Mode boundary/);
});
test("hashline routing uses small reads and fresh anchors for edits", () => {
const section = buildToolRoutingSection(["read", "edit"]);
assert.match(section, /smallest useful offset\/limit range/);
assert.match(section, /obtain fresh LINE#HASH anchors with a small read/);
assert.match(section, /Reuse fresh anchors returned by successful edits/);
});
test("LSP routing covers navigation and post-edit diagnostics", () => {
const section = buildToolRoutingSection(["lsp_definition", "lsp_references", "lsp_diagnostics"]);
assert.match(section, /Use LSP for symbol definitions, references/);
assert.match(section, /post-edit diagnostics/);
});
test("routing includes only guidance for active optional tools", () => {
const section = buildToolRoutingSection(["read"]);
@@ -35,7 +51,8 @@ test("routing includes only guidance for active optional tools", () => {
assert.doesNotMatch(section, /For literal search/);
assert.doesNotMatch(section, /Use Context Mode/);
assert.doesNotMatch(section, /ctx_execute_file is confined/);
assert.match(section, /Use read directly/);
assert.doesNotMatch(section, /fresh LINE#HASH anchors/);
assert.match(section, /Use read only when exact source is needed/);
});
test("routing is appended once", () => {