Skip to content

armgit / Ix

Public Imported from GitHub
0

Understand any codebase instantly. System intelligence for codebases, built for humans and AI.

feat(cli): drop lang= from ix text llm rows

KageBinaryef3cbce7b519
diff --git a/ix-cli/src/cli/__tests__/llm-tier3.test.ts b/ix-cli/src/cli/__tests__/llm-tier3.test.ts
index 7874fc88..6f3b4006 100644
--- a/ix-cli/src/cli/__tests__/llm-tier3.test.ts
+++ b/ix-cli/src/cli/__tests__/llm-tier3.test.ts
@@ -22,13 +22,14 @@ describe("renderPatchesLlm", () => {
});
describe("renderTextResultsLlm", () => {
- it("emits match records with trimmed (quoted) snippet and language", () => {
+ it("emits match records with trimmed (quoted) snippet and no language field", () => {
const results: TextResult[] = [
{ path: "src/a.ts", line_start: 42, line_end: 42, snippet: " const x = 1 ", engine: "ripgrep", score: 1, language: "typescript" },
];
expect(renderTextResultsLlm(sliceRanked(results, 20))).toEqual([
"text shown=1 scanned=1",
- 'match path=src/a.ts line=42 lang=typescript snippet="const x = 1"',
+ // `lang=` repeated the path's extension on every row; json keeps it.
+ 'match path=src/a.ts line=42 snippet="const x = 1"',
]);
});
});
diff --git a/ix-cli/src/cli/format.ts b/ix-cli/src/cli/format.ts
index b517ea05..22f203e1 100644
--- a/ix-cli/src/cli/format.ts
+++ b/ix-cli/src/cli/format.ts
@@ -588,7 +588,12 @@ export interface TextResult {
symbol_hint?: string;
}
-/** Render lexical search hits as llm `match` records (one per line). */
+/**
+ * Render lexical search hits as llm `match` records (one per line).
+ *
+ * No `lang=`: the extension on `path` already says it, and on a 20-row answer
+ * the field was ~80 tokens of nothing. `--format json` keeps `language`.
+ */
export function renderTextResultsLlm(slice: Slice<TextResult>): string[] {
const lines = [llmLine("text", [
["shown", slice.shown],
@@ -605,7 +610,6 @@ export function renderTextResultsLlm(slice: Slice<TextResult>): string[] {
lines.push(llmLine("match", [
["path", relativePath(r.path) ?? r.path],
["line", r.line_start],
- ["lang", r.language],
["symbol", r.symbol_hint],
["snippet", r.snippet.trim()],
]));