You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/codeatrium/cli/prime_cmd.py
+31Lines changed: 31 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -41,6 +41,37 @@
41
41
42
42
# Retrieve past conversations from work on a specific branch
43
43
loci context --branch "feature/foo" --json
44
+
```
45
+
46
+
### IDE selection as a deictic anchor
47
+
48
+
When the IDE injects an active editor selection (shown as `⧉ Selected N lines from <file>`), treat that selection as the referent of "this / これ / この〜" in the user's prompt. The selection resolves *which* symbol the memory lookup is about — it is NOT by itself a request to recall.
49
+
50
+
Recall from a selection ONLY when BOTH hold:
51
+
52
+
1. a selection is active, AND
53
+
2. either (a) the user asks about the past — recall / why / history / decisions ("この実装の時の会話を思い出して", "これ前にどう決めた?"), or (b) your own next action on the selected code (edit / refactor / debug) needs prior decisions or constraints.
54
+
55
+
Do NOT recall when the selection is present only because the user is about to edit it and asks nothing past-oriented.
56
+
57
+
Map the selection to a query:
58
+
59
+
- Selection IS a named function/class → look it up directly:
60
+
61
+
```bash
62
+
loci context --symbol "<name>" --json
63
+
```
64
+
65
+
- Selection is a fragment INSIDE one function/class — the `def`/`class` line is usually not in the selection, so resolve the enclosing symbol first (LSP `workspaceSymbol`/`hover`, or read `<file>` around the selection), then:
66
+
67
+
```bash
68
+
loci context --symbol "<enclosing-symbol>" --json
69
+
```
70
+
71
+
- Selection spans multiple symbols or belongs to none (module-level code, config, comments), OR the lookups above return no results → fall back to semantic search over your question:
0 commit comments