eca icon indicating copy to clipboard operation
eca copied to clipboard

Support context: editor current position

Open ericdallo opened this issue 1 year ago • 6 comments

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

Original issue

Currently, there is no way to tell LLM where user if focusing (file + cursor position). One can add the current file and range, but that won't work if the user has multiple context files and wants to focus on a specific part of the contexts.

What we should add if user has multiple windows split? not clear yet

Maybe this should be auto added in clients too like repoMap.

ericdallo avatar Aug 30 '25 21:08 ericdallo

@editor-code-assistant/maintainers any thoughts?

ericdallo avatar Aug 30 '25 23:08 ericdallo

Sounds like a great solution. I would also add that when using eca-chat-send-prompt this will include the context at point or the marked region in the buffer that was visited when the command was executed.

bobrowadam avatar Aug 31 '25 10:08 bobrowadam

yeah, I will think about it a little bit more because this new context should be coupled to a file and point, I need to think in the UX for that.

ericdallo avatar Aug 31 '25 12:08 ericdallo

@editor-code-assistant/maintainers any input on what UX you expect of this? ECA currently track the opened file unless user changes the context manually, we could:

  • include a next @cursor context, but then the default would be have: @repoMap + @cursor + @/opened/file.foo (unless cursor already includes the opened file + position which sounds better)
  • change the opened file to include the range of the cursor, we already support that, but we would reduce the file context size to only that range which may not be ideal.

I'm leaning to the first one, making eca default: @repoMap + @cursor (cursor will include in the request the whole file opened + position)

ericdallo avatar Sep 10 '25 13:09 ericdallo

@bobrowadam Done! Now server supports a @cursor context that is included by default, this context includes both file path + cursor position/selection.

I already updated eca-emacs to support that, will work on eca-vscode and eca-intellij. @tomgeorge @joaopluigi @W3ND31 we should support that on eca-nvim as well.

Image

ericdallo avatar Sep 10 '25 16:09 ericdallo

Great work!

bobrowadam avatar Sep 10 '25 16:09 bobrowadam