Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(sidebar): support file context when buffer is outside the cwd #974

Closed
wants to merge 27 commits into from

Conversation

brewinski
Copy link
Contributor

When you open a file that is outside of the current project directory/working directory, the file context for the current buffer is incorrect.

When opening a random file for example by running :e ../../some-random-source-file.rs the path would resolve to some-random-source-file.ts rather than the absolute path and the file context would be unable to read it.

Before:
image

After:
image

lua/avante/file_selector.lua Outdated Show resolved Hide resolved
@aarnphm aarnphm changed the title feat (sidebar) support file context when buffer is outside the cwd feat(sidebar): support file context when buffer is outside the cwd Jan 9, 2025
@brewinski brewinski force-pushed the feat/file-outside-cwd branch 3 times, most recently from bfea879 to 5ea172d Compare January 10, 2025 00:32
kernitus and others added 25 commits January 10, 2025 10:35
…e#988)

Neovim allows quickfix list to be populated in a variety of ways: grep,
lsp symbol references etc. Being able to add files in the quickfix
window to the LLM chat context allows for interesting workflows. For
example, one could search for a symbol using the LSP integration,
populate the quickfix with that list and then pass those along as
context in Avante using @quickfix mention in the sidebar.

If there are no files in the quickfix list or the items do not have a
file, nothing is added to the context.
* fix: wait for github copilot token to refresh before calling completion

* feat: timer to refresh copilot token to prevent 401
Before this change, since `max_completion_tokens` was not set for `o` series models, the completion request will time out sometimes. This makes sure it converts the `max_tokens` parameter to `max_completion_tokens` for `o` series models.

I tested this change with `gpt-4o-mini`, `o1-mini` and `o3-mini`, and they all still work as expected.
* Add multi select

* Remove comment
@brewinski brewinski force-pushed the feat/file-outside-cwd branch 2 times, most recently from bce8c72 to 4f46cc5 Compare January 10, 2025 00:41
@brewinski brewinski closed this Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.