Prerequisites
Is your feature request related to a problem? Please describe.
Absolute paths are reliable, but kinda long and noisy.
Not urgent but if opencode ever fixes interpreting file references in appended prompts, I think this is a prerequisite to leverage that again. It doesn't seem to support @<absolute_path> even typing directly in the TUI.
Context.server would likely benefit future needs too.
Describe the solution you'd like
Format the path relative to the target server's CWD.
Context.lua needs to be aware of the server it's formatting for. Probably add a server field and receive it in Context.new. May require some reordering of server retrieval + context creation to have it available, but I think it's viable given the current code paths.
- In
Context.format: manually modify absolute_path to be relative to server.cwd. vim.fn.fnamemodify only supports formatting relative to Neovim's CWD, so we need to DIY. Hopefully a simple regex?
Describe alternatives you've considered
No alternative afaik
Additional context
#270
Prerequisites
Is your feature request related to a problem? Please describe.
Absolute paths are reliable, but kinda long and noisy.
Not urgent but if
opencodeever fixes interpreting file references in appended prompts, I think this is a prerequisite to leverage that again. It doesn't seem to support@<absolute_path>even typing directly in the TUI.Context.serverwould likely benefit future needs too.Describe the solution you'd like
Format the path relative to the target server's CWD.
Context.luaneeds to be aware of the server it's formatting for. Probably add aserverfield and receive it inContext.new. May require some reordering of server retrieval + context creation to have it available, but I think it's viable given the current code paths.Context.format: manually modifyabsolute_pathto be relative toserver.cwd.vim.fn.fnamemodifyonly supports formatting relative to Neovim's CWD, so we need to DIY. Hopefully a simple regex?Describe alternatives you've considered
No alternative afaik
Additional context
#270