opencode icon indicating copy to clipboard operation
opencode copied to clipboard

Context awareness

Open ravshansbox opened this issue 1 month ago • 14 comments

Description

Opencode vscode extension page says that it features context awareness, but when I select lines from vscode and ask about them inside agent I see that agent does not "know" what is selected. Does it really support this feature? If it does how it should be used? Maybe needs some documentation updates

OpenCode version

0.15.18

Steps to reproduce

  1. Open vscode
  2. Install opencode extension
  3. Open opencode from the shortcut inside the ide
  4. Open any file and select some text
  5. Try to refer to it inside opencode prompt

Screenshot and/or share link

No response

Operating System

macOS 26.0.1

Terminal

VSCode terminal

ravshansbox avatar Oct 27 '25 11:10 ravshansbox

This issue might be a duplicate of existing issues. Please check:

  • #3393: vscode extension: Some extension keyboard shortcuts don't work (windows) - This issue also relates to VSCode extension functionality not working as expected, though it focuses on keyboard shortcuts rather than context awareness

Feel free to ignore if none of these address your specific case about context awareness and text selection.

github-actions[bot] avatar Oct 27 '25 11:10 github-actions[bot]

Ah I think you need to do cmd + option + k to send the selected text to the prompt box

rekram1-node avatar Oct 27 '25 15:10 rekram1-node

Can we make it automatic (explicit opt-in through settings maybe)? How about sending current open file(s)?

ravshansbox avatar Oct 28 '25 07:10 ravshansbox

All popular agents (except zed) already do this by default without any config

ravshansbox avatar Oct 28 '25 07:10 ravshansbox

Yeah that should be fine, @fwang may have an opinion on it he was the one who built it

rekram1-node avatar Oct 28 '25 15:10 rekram1-node

Ah I think you need to do cmd + option + k to send the selected text to the prompt box

This only works if I select and open opencode, if opencode is already open and I press these keybindings nothing happens really

ravshansbox avatar Oct 29 '25 16:10 ravshansbox

Is this supposed to work, or is it just that the documentation is wrong?

Context Awareness: Automatically share your current selection or tab with OpenCode.

deepfriedmind avatar Nov 13 '25 01:11 deepfriedmind

I think there is a case it isn't working we will fix

rekram1-node avatar Nov 13 '25 16:11 rekram1-node

I wasn't following the repo lately, any updates on this?

ravshansbox avatar Dec 03 '25 08:12 ravshansbox

Vscode extension hasn't gotten enough love lately, but someone is workign on some updates

rekram1-node avatar Dec 03 '25 16:12 rekram1-node

Is it possible to also have this cmd+shift+k command to send the filepath to opencode opened in an external terminal? Like claude does

cezarderevlean avatar Dec 17 '25 16:12 cezarderevlean

Vscode extension hasn't gotten enough love lately, but someone is workign on some updates

@rekram1-node Could you share when this issue is expected to be resolved?

junmediatek avatar Dec 18 '25 09:12 junmediatek

I can see there is a beta version of the extension with a different package name, tried it but did not notice anything new

ravshansbox avatar Dec 18 '25 10:12 ravshansbox

Folks, this is a real blocker, any updates on this or even any plans?

ravshansbox avatar Dec 18 '25 18:12 ravshansbox

There are plans to make it better still a WIP but it's going to be pretty overhauled

rekram1-node avatar Dec 19 '25 06:12 rekram1-node