Skip to content

feat(vscode): sync IDE context into the TUI#18583

Open
ravshansbox wants to merge 2 commits intoanomalyco:devfrom
ravshansbox:feat/vscode-ide-context-sync
Open

feat(vscode): sync IDE context into the TUI#18583
ravshansbox wants to merge 2 commits intoanomalyco:devfrom
ravshansbox:feat/vscode-ide-context-sync

Conversation

@ravshansbox
Copy link
Copy Markdown
Contributor

@ravshansbox ravshansbox commented Mar 22, 2026

Issue for this PR

Closes #3096
Closes #3472

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

This adds an IDE-context sync path between the VS Code extension and the TUI. The extension now sends the active file plus open inactive files, keeps them synced by default, and the TUI shows the active file with a compact inactive-file count above the prompt.

It also restores the filepath insert command and renames the VS Code setting from includeOpenFiles to includeInactiveFiles, which matches the actual behavior better.

How did you verify your code works?

  • built packages/opencode
  • ran bun run compile in sdks/vscode
  • tested the VS Code flow locally: opening opencode sends the active file and inactive open files, switching focus no longer drops the active file, and the prompt bar renders the IDE context safely

Screenshots / recordings

Not included.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions
Copy link
Copy Markdown
Contributor

Hey! Your PR title vscode: sync IDE context into the TUI doesn't follow conventional commit format.

Please update it to start with one of:

  • feat: or feat(scope): new feature
  • fix: or fix(scope): bug fix
  • docs: or docs(scope): documentation changes
  • chore: or chore(scope): maintenance tasks
  • refactor: or refactor(scope): code refactoring
  • test: or test(scope): adding or updating tests

Where scope is the package name (e.g., app, desktop, opencode).

See CONTRIBUTING.md for details.

@github-actions github-actions bot added the needs:compliance This means the issue will auto-close after 2 hours. label Mar 22, 2026
@ravshansbox ravshansbox changed the title vscode: sync IDE context into the TUI feat(vscode): sync IDE context into the TUI Mar 22, 2026
@github-actions github-actions bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Mar 22, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

Keep the active editor and inactive open tabs in sync with the prompt bar so VS Code context stays visible without manual re-attaching.
@ravshansbox ravshansbox force-pushed the feat/vscode-ide-context-sync branch from 97b9152 to ccd0e58 Compare March 22, 2026 03:15
@ravshansbox
Copy link
Copy Markdown
Contributor Author

hi, @rekram1-node @fwang can you guys take a look as you will have time please?

@RespectMathias
Copy link
Copy Markdown

Wouldn't this be better as a plugin? Considering this feature is for a single IDE and could break based on vscode changes. This might be good if there was a standard, but I can't see why it should be added directly to OpenCode if there isn't.

Just my opinion tho, SRP and all that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Context awareness Show current open file and selected line info in cli

2 participants