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
Feat: Support basic Symbol navigation inside AI coding session (#258)
* Linkify symbols near file links and add navigation
* Add helm-gtags fallback for symbol navigation
* Add Dired support to context files and tests
* Revert "Add Dired support to context files and tests"
This reverts commit b205107.
* Support explaining multiple marked files in Dired
* Linkify Java CamelCase and Python snake_case
* Refactor symbol detection and relax file checks
* Tighten Java CamelCase detection and tests
* Update ai-code-session-link.el
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Add per-pass caching and optimize linkification
* Improve nearby symbol scanning for file links
* Use fixed 512-char 8-line symbol window
* Add clickable session links, image, and tests
* update HISTORY
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy file name to clipboardExpand all lines: README.org
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -118,7 +118,7 @@ Enable installation of packages from MELPA by adding an entry to package-archive
118
118
- `yasnippet`: For snippet support in the prompt file. A library of snippets is included.
119
119
- (emacs built-in) abbrev + skeleton is also a good way to expand prompt. [[./etc/prompt_expand_with_abbrev_skeleton.el][example abbrev to solve / iterate leetcode problem with tdd (need to set ai-code-auto-test-type with tdd)]], [[./examples/leetcode][example problem resolved]]
120
120
- `projectile`: For project root initialization.
121
-
- `helm-gtags`: For tags creation.
121
+
- `helm-gtags`: For tags creation and symbol navigation fallback from clickable session symbols.
122
122
- `python-pytest`: For running python tests in the TDD workflow.
123
123
- `jest`: For running JavaScript / TypeScript tests in the TDD workflow.
124
124
@@ -127,7 +127,8 @@ Enable installation of packages from MELPA by adding an entry to package-archive
127
127
- *Transient-Driven Hub (`C-c a`)*: One keystroke opens a contextual transient menu that groups every capability (CLI control, code actions, agile workflows, utilities) so you never need to memorize scattered keybindings.
128
128
- If the default wide layout does not fit your frame well, set `ai-code-menu-layout` to `two-columns` for a narrower menu with the same commands.
129
129
- *AI CLI Session Management*: Start (`a`), resume (`R`), or jump back into (`z`) the active AI CLI buffer, instantly swap backends (`s`), upgrade them (`u`), install backend skills (`S`), edit backend configs (`g`), open backend agent file (`G`), and run prompts against the current file (`|`). It supports multiple sessions per project. The `S` entry is especially useful for installing shared skill packs such as [[https://github.com/obra/superpowers][obra/superpowers]].
130
-
- *Clickable Session Links*: In AI session buffers, supported in-repo file references and `http` / `https` URLs are underlined and clickable. File links such as `src/foo.el:42`, `src/foo.el:42:7`, `src/foo.el:L42-L60`, or `src/foo.el#L42-L60` jump directly to the right location, while web links open in your browser. Set `ai-code-session-link-enabled` to `nil` if you want to disable this link rendering.
130
+
- *Clickable Session Links*: In AI session buffers, supported in-repo file references, nearby code symbols, and `http` / `https` URLs are underlined and clickable. File links such as `src/foo.el:42`, `src/foo.el:42:7`, `src/foo.el:L42-L60`, or `src/foo.el#L42-L60` jump directly to the right location, nearby symbols such as `setq-local`, `ai-code-session-link-enabled`, or `UserService.processRequest()` trigger code navigation in the associated file, and web links open in your browser. Symbol navigation first tries `xref`, then `helm-gtags` when available, and finally falls back to searching in the opened file buffer. Set `ai-code-session-link-enabled` to `nil` if you want to disable this link rendering.
131
+
[[./clickable_link_ai_session.png]]
131
132
- *Context-Aware Code Actions*: The menu exposes dedicated entries for changing code (`c`), implementing TODOs (`i`), asking questions (`q`), explaining code (`x`), sending free-form commands (`<SPC>`), and refreshing AI context (`@`). Each command automatically captures the surrounding function, region, or clipboard contents (via `C-u`) to keep prompts precise.
132
133
- *Agile Development Workflows*: Use the refactoring navigator (`r`), the guided TDD cycle (`t`), and the pull/review diff helper (`v`) to keep AI-assisted work aligned with agile best practices. Prompt authoring is first-class through quick access to the prompt file (`p`), build/test helper (`b`), and AI-assisted shell/file execution (`!`). In prompt files, send the current block with `C-c C-c`.
133
134
- *Productivity & Debugging Utilities*: Initialize project navigation assets (`.`), investigate exceptions (`e`), auto-fix Flycheck issues in scope (`f`), copy or open file paths formatted for prompts (`k`, `o`), generate MCP inspector commands (`m`), capture session notes straight into Org (`n`), and toggle desktop notifications (`N`) to get alerted when AI responses are ready in background sessions.
(format"Please explain the %s at path @%s.\n\nProvide a clear explanation of what this %s contains, its purpose, and its role in the project structure.%s"
285
+
"directory"
286
+
"file"))
287
+
(initial-prompt (cond
288
+
(has-marked-files
289
+
(format"Please explain the selected files or directories.\n\nProvide a clear explanation of what these files or directories contain, their purpose, and their role in the project structure.%s"
290
+
(or files-context-string "")))
291
+
((car git-relative-paths)
292
+
(format"Please explain the %s at path @%s.\n\nProvide a clear explanation of what this %s contains, its purpose, and its role in the project structure.%s"
280
293
file-type
281
-
git-relative-path
294
+
(cargit-relative-paths)
282
295
file-type
283
-
(or files-context-string ""))
284
-
"No file or directory found at cursor point."))
285
-
(final-prompt (if git-relative-path
286
-
(ai-code-read-string "Prompt: " initial-prompt)
287
-
initial-prompt)))
296
+
(or files-context-string "")))
297
+
(t"No file or directory found at cursor point.")))
0 commit comments