Versions 153 to 318
Lines 20–27 at 318 (were 20–26 at 153)
2121
23−import { codeOfLines, holdsNoCode, isCommonName } from "./names.ts";
2425
Lines 122–149 at 318 (were 121–147 at 153)
124− const visible = view.lines(file);
125− const code = codeOfLines(visible.map((l) => l.text));
126− for (let i = 0; i < code.length; i++) {
127− // Only top-level declarations: what another file can import. Locals,
128− // parameters and methods are indented.
129− if (/^\s/.test(code[i]!)) continue;
130− const found = defineAt(code, i);
131− if (!found || (!keepCommon && (found.name.length < 3 || isCommonName(found.name)))) continue;
132− out.push({
133− name: found.name,
134− file,
135− start: i,
136− end: found.end,
137− lines: visible.slice(i, found.end).map((l) => l.id),
138− text: visible
139− .slice(i, found.end)
140− .map((l) => l.text)
141− .join("\n"),
142− });
143− }
144− return out;
146148
Lines 157–182 at 318 (were 155–179 at 153)
158− const visible = view.lines(file);
159− const code = codeOfLines(visible.map((l) => l.text));
160− for (const d of all) {
161− if (count.get(d.name)! < 2) continue;
162− const end = Math.max(d.end, wholeBlockEnd(code, d.start));
163− const whole: Definition = {
164− ...d,
165− end,
166− lines: visible.slice(d.start, end).map((l) => l.id),
167− text: visible
168− .slice(d.start, end)
169− .map((l) => l.text)
170− .join("\n"),
171− };
172− const list = out.get(d.name);
173− if (list) list.push(whole);
174− else out.set(d.name, [whole]);
175− }
176− return out;
178181
- MCP
- compare on this site's /mcp
- CLI
- abso diff 153 318 worker/project/definitions.ts --json
- JSON
- /christopher/abso-core/compare/153..318?file=worker%2Fproject%2Fdefinitions.ts&format=json