Skip to content

Support line ranges in @file references #7673

Description

@dangooddd

What do you want to change?

Currently file reference does not supports line ranges. So the only option is to include file entirely.
For example, mention in github style:

@file#L122-L145

Why?

I am building neovim Pi plugin for personal usage, one of the features converts visual range in neovim to file range and sends to Pi prompt, so agent knows where I am asking. Currently I mention that in prompt without @, so model needs to call read tool first.

How? (optional)

If file reference is text file, parse @file#L{x}-L{y} after file path. That is one possibility to do so, we can support other formats like @file:{x}-{y}

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