feat: jump to symbols from assistant outputFeat/reference scoped symbol navigation#437
feat: jump to symbols from assistant outputFeat/reference scoped symbol navigation#437jensenojs wants to merge 8 commits into
Conversation
41d36e7 to
3be36d8
Compare
|
Design note for review: This is deliberately not a workspace symbol search. The feature only looks at files already referenced in the current conversation. Render path: Keypress path: The render highlight is only a hint. It does not store jump targets. This avoids stale extmarks becoming navigation authority. No LSP, no workspace-wide search, no persistent index, |
|
Because performance issues exposed some oversights in my vibe-coding process, I took some time to reflect and clean up the code, which is why it took a bit longer. However, we can see where the problems were from the previous comments. A simpler conceptual approach should look something like this:
The durable fact is the current conversation’s reference-file set. Session load rebuilds it from messages; message updates and file lifecycle events refresh it and dirty rendered assistant text parts. Render reads that file set plus current Tree-sitter definitions, then writes visual affordances and RenderState targets. Keypress does not rediscover refs from screen text; it only executes the current RenderState target, resolving symbol targets against that target’s candidate files at press time. So extmarks are no longer navigation authority. They are just the visual projection of RenderState targets. After this PR and the other one(#439) are merged, my first instinct when opening opencode might no longer be the TUI, there are (currently) no interaction methods in the TUI that opencode.nvim cannot easily handle; conversely, we can do many things that the TUI simply cannot. I think having some reasonable interactions in the output window is a good thing. When I have time later, I might tinker with the input window as well. Better delivery methods are all low-hanging fruit, and these can likely be showcased in the README. I doubt the other opencode.nvim plugin has this functionality, hhh. However, I may not be able to dedicate as much energy to this project in the next month or two as I am now. I will likely still assist with some bug fixes or PR reviews, as I need to spend some time preparing for my next job. But please trust that I have laid a solid foundation for your agent to take over this feature. The |
…ed-symbol-navigation
|
One direction I'm interested in for the future is automatic prompt injection/enhancement. My GPT has been too stupid lately, and manual fine-tuning is too exhausting. I want to create an automatic prompt injection/enhancement system to save my time for those high-quality conversations that I don't dare reply to lightly. If it could achieve over 80% accuracy compared to my usual prompt responses, that would be a very good thing. This job isn't very difficult; I've already started the refactoring over there, but there's still quite a bit of work to do lol |
|
I am not sure about updating the AGENTS. As it adds way more tokens than it's worth. Many you could transform this into a skill? |
Okay, I'll withdraw them all for now and consider adding them back later when they are worth formalizing as skills |
…ed-symbol-navigation # Conflicts: # lua/opencode/ui/message_actions.lua # lua/opencode/ui/renderer/buffer.lua



I really like this feature, lol
Summary
<CR>jump to symbol definitions when file/diff targets do not matchgflimited to file/diff targetsNotes
This uses Tree-sitter over the current conversation's Code References. It does not add LSP, workspace-wide symbol search, or a persistent symbol index.
Tests:
./run_tests.sh