Skip to content

Ability to auto-select files to add to context by using @reference in create prompt window #175

Closed

Description

@azidancorp

I'd like to be able to construct a prompt by referencing files using an @reference to relevant files (ideally with tab-complete by string matching to an indexed tree of the workspace filenames). I believe Cline/Roo have a nice implementation of this to look at.

Example prompt:
Please reference @settings.py for style/layout inspiration, and the documentation @rio.Text.txt @rio.TextInput.txt @rio.Column.txt @rio.Dropdown.txt etc, and make a page for user @search.py (currently a placeholder) that is based on the fields present in @profile_extractor.py#L29-82 as well as @example_data.json

The above will automatically select the settings and search files from codebase, and also attach the relevant component documentation files I have locally as well.

Activity

  1. robertpiosik commented on Apr 29, 2025

    @robertpiosik
    Collaborator

    Hi, nice idea, thanks! How should @profile_extractor.py#L29-82 look like in a message?

  2. azidancorp commented on Apr 29, 2025

    @azidancorp
    Author

    Probably exactly verbatim, with the relevant codesnippet backticked with line reference.
    But for practical usage, I've only applied it by selecting the relevant lines in the code file viewer, and "adding to context" with keyboard shortcut - never typed in the chatbox.

  3. robertpiosik commented on Apr 30, 2025

    @robertpiosik
    Collaborator

    Hi @azidancorp, you can reference files from context menu:

    Image

    Please let me know how you find it 🤓

  4. azidancorp commented on Apr 30, 2025

    @azidancorp
    Author

    Couldnt find it at first, seems like Windsurf hasn't detected extension update - but tried now in VSCode. Wonder if thats related to any other issues I have..anyways

    It works! However my main intent behind @referencing in prompt-window is to avoid traversing through the filetree manually/with the cursor - otherwise I could just check the include box as I am currently. Example of Roo prompt window here:

    Image

    Was always a python programmer, wish I knew JS beyond basic vibecoding, otherwise I'd love to try making PRs..alas I'm stuck to raising issues (for now).

    Heres my attempt at finding relevant Roo scripts (yup, using gemini coder to help) - would really love this feature but I think this is as far as I know how to help! I think you already might already be halfway there if already tracking workspace files

    https://pastebin.com/2JkRNBfW

    Glad to see the rapid development!

  5. robertpiosik commented on Apr 30, 2025

    @robertpiosik
    Collaborator

    I'm trying to find the best solution to fit in the general vibe of working with Gemini Coder. It is a little bit different from other tools as it resolves around file tree and prompt sections:

    <files>
    [context files]
    </files>
    [instructions]
    

    Referencing regular context files in instructions would not play nicely as we don't include them inline with text but above in a dedicated section. It would also quickly expand the chat box to unusable sizes.

    Suggested workflow is to use command "Go to file...", then you can write file name, hit space, enter some part of directory. This does not work this nicely in Roo. In there you hit space and you're out of the file selection tool. Once you have file opened, it is included in context and you can reference it in instructions if you want to direct LLM to something specifically:

    Image

    Let me know if it makes sense.

  6. locked and limited conversation to collaborators on May 1, 2025
  7. converted this issue into a discussion #190 on May 1, 2025
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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions