Skip to content

feature: recursive workspace file completion in ask() via opencode_ask_cmp #346

Open

Description

@george-tk

Prerequisites

  • I searched the docs
  • I searched existing issues

Is your feature request related to a problem? Please describe.

When writing a prompt in ask(), users frequently want to reference other files in the workspace that aren't currently open in a buffer. Standard completion path providers (blink.cmp / cmp-path) only complete one directory level at a time (./lua/ -> plugins/ -> opencode.lua) and resolve relative to the current buffer rather than the workspace/server root.

Describe the solution you'd like

Extend opencode_ask_cmp (lua/opencode/ui/ask/cmp.lua) to optionally provide recursive workspace file completions (e.g. triggered on ./ or @ using rg --files / git ls-files or OpenCode's /find/file endpoint), inserting the workspace-relative path (matching Context.format's relative path output).

Describe alternatives you've considered

Configuring blink.cmp's path provider with a custom get_cwd, which still requires typing each directory level one by one instead of fuzzy-matching across the project tree.

Additional context

Happy to open a PR for this as well if you're interested!

Activity

  1. nickjvandyke commented on Nov 2, 2026

    @nickjvandyke
    Owner

    Good idea, and I noticed this too 😞 I really hoped we could re-use path providers. Alas!

    For OpenCode v1, I preferred to leverage the TUI input and its file completion rather than re-implement it here. But ask is probably going to change for OpenCode v2 because it doesn't support TUI appending. So ask will likely become an all-or-nothing feature. That is, either drop it in favor of other methods, or make it more powerful for entirely in-Neovim prompt-writing. Or some enhancement to the $EDITOR that OC can launch. #334

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions