eca icon indicating copy to clipboard operation
eca copied to clipboard

Improve @file form, remove surrounding chars

Open zikajk opened this issue 1 year ago • 2 comments

Adding @file.clj to the user-prompt or system-message adds something like this: <file partial=true path="/Users/user/project/file.clj">...\n(defn smth [a] a)\n...</file>

I tried to send a prompt like

Is this a good code <file partial=true path="/Users/user/project/file.clj">...\n(defn smth [a] a)\n...</file>

which simulates something like:

Is this a good code @file.cljc (10-10)

And LLM decides to read the file. Once I remove /n ..., then it reviews just the inserted code without trying to read the file.

I guess that partial=true is a good enough indicator, but we may also want to add line range, so smth like seems best: <file partial=true line-range=10-10 path="/Users/user/project/file.clj">(defn smth [a] a)</file>

I am not sure about the line-range in system-prompt thought which is something mentioned in the #163 . But I would remove ...\n from both.

To upvote this issue, give it a thumbs up. See this list for the most upvoted issues.

zikajk avatar Oct 22 '25 15:10 zikajk

<file partial=true line-range=10-10 path="/Users/user/project/file.clj">(defn smth [a] a)</file>

That looks great to me

ericdallo avatar Oct 22 '25 15:10 ericdallo

https://github.com/editor-code-assistant/eca/pull/182

zikajk avatar Oct 29 '25 13:10 zikajk