Support context: editor current position
To upvote this issue, give it a thumbs up. See this list for the most upvoted issues.
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.
@editor-code-assistant/maintainers any thoughts?
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.
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.
@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
@cursorcontext, 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)
@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.
Great work!