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

bug: @codebase not working #881

Open
john-persson-polestar opened this issue Nov 20, 2024 · 4 comments
Open

bug: @codebase not working #881

john-persson-polestar opened this issue Nov 20, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@john-persson-polestar
Copy link

john-persson-polestar commented Nov 20, 2024

Describe the bug

I'm trying to chat with the codebase using @codebase, however Avante seams to have no context of file other than the on in my current buffer.

I.e. when asking about files that are imported in the current buffer, they are not in the context of Avante.


Avante:
Would you like me to see the actual definition of FileName? Please share the context of Avante apps/products/app/routes/$locale.page-path/types/FileName.ts and I can provide more specific details.


and when I ask how to include them I will get the following answer:


Me: how do I share it with you?
Avante:
I can already see the code since you've shared it using the correct format with <filepath> and <code> tags. However, if you want me to see other files (like the SectionId type definition), you would need to share them in a similar way:

  1. First specify the filepath in <filepath> tags
  2. Then share the code content in <code> tags

For example, if you wanted to share the SectionId definition, you could share it like:

<filepath>apps/products/app/routes/$locale.page-path/types/FileName.ts</filepath>

<code>
// content of the SectionId file would go here
</code>

Would you like to share any additional files with me?


To reproduce

Ask a question to Avante with @codebase about files that are not part of the current buffer.

Expected behavior

For Avante to have the full project context when asking questions using @codebase.

Installation method

Use lazy.nvim:

{
  "yetone/avante.nvim",
  event = "VeryLazy",
  lazy = false,
  version = false, -- set this if you want to always pull the latest change
  opts = {
    -- add any opts here
  },
  -- if you want to build from source then do `make BUILD_FROM_SOURCE=true`
  build = "make",
  -- build = "powershell -ExecutionPolicy Bypass -File Build.ps1 -BuildFromSource false" -- for windows
  dependencies = {
    "nvim-treesitter/nvim-treesitter",
    "stevearc/dressing.nvim",
    "nvim-lua/plenary.nvim",
    "MunifTanjim/nui.nvim",
  },
}

Environment

NVIM v0.10.1
Build type: Release
LuaJIT 2.1.1725453128

Repro

vim.env.LAZY_STDPATH = ".repro"
load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()

require("lazy.minit").repro({
  spec = {
    -- add any other plugins here
  },
})
@john-persson-polestar john-persson-polestar added the bug Something isn't working label Nov 20, 2024
@john-persson-polestar
Copy link
Author

I can also add that I'm getting this error when asking a questions when there is no open buffer:

   Error  23:05:08 msg_show.emsg E5108: Error executing lua: ...ocal/share/nvim/lazy/avante.nvim/lua/avante/repo_map.lua:77: attempt to concatenate local 'file_ext' (a nil value)
stack traceback:
	...ocal/share/nvim/lazy/avante.nvim/lua/avante/repo_map.lua:77: in function 'get_repo_map'
	...local/share/nvim/lazy/avante.nvim/lua/avante/sidebar.lua:1409: in function 'handle_submit'
	...local/share/nvim/lazy/avante.nvim/lua/avante/sidebar.lua:1488: in function <...local/share/nvim/lazy/avante.nvim/lua/avante/sidebar.lua:1478>
   Error  23:05:10 msg_show.lua_error Error executing vim.schedule lua callback: ...ender-markdown.nvim/lua/render-markdown/core/context.lua:85: attempt to index local 'node' (a number value)
stack traceback:
	...ender-markdown.nvim/lua/render-markdown/core/context.lua:85: in function 'get_checkbox'
	...r-markdown.nvim/lua/render-markdown/render/list_item.lua:33: in function 'setup'
	...r-markdown.nvim/lua/render-markdown/handler/markdown.lua:80: in function 'callback'
	...ender-markdown.nvim/lua/render-markdown/core/context.lua:190: in function 'query'
	...r-markdown.nvim/lua/render-markdown/handler/markdown.lua:76: in function 'parse'
	...azy/render-markdown.nvim/lua/render-markdown/core/ui.lua:215: in function 'parse_tree'
	...azy/render-markdown.nvim/lua/render-markdown/core/ui.lua:185: in function 'parse_buffer'
	...azy/render-markdown.nvim/lua/render-markdown/core/ui.lua:122: in function 'run_update'
	...azy/render-markdown.nvim/lua/render-markdown/core/ui.lua:88: in function <...azy/render-markdown.nvim/lua/render-markdown/core/ui.lua:87>
   Error  23:05:10 msg_show.lua_error Error executing vim.schedule lua callback: ...ender-markdown.nvim/lua/render-markdown/core/context.lua:85: attempt to index local 'node' (a number value)
stack traceback:
	...ender-markdown.nvim/lua/render-markdown/core/context.lua:85: in function 'get_checkbox'
	...r-markdown.nvim/lua/render-markdown/render/list_item.lua:33: in function 'setup'
	...r-markdown.nvim/lua/render-markdown/handler/markdown.lua:80: in function 'callback'
	...ender-markdown.nvim/lua/render-markdown/core/context.lua:190: in function 'query'
	...r-markdown.nvim/lua/render-markdown/handler/markdown.lua:76: in function 'parse'
	...azy/render-markdown.nvim/lua/render-markdown/core/ui.lua:215: in function 'parse_tree'
	...azy/render-markdown.nvim/lua/render-markdown/core/ui.lua:185: in function 'parse_buffer'
	...azy/render-markdown.nvim/lua/render-markdown/core/ui.lua:122: in function 'run_update'
	...azy/render-markdown.nvim/lua/render-markdown/core/ui.lua:88: in function <...azy/render-markdown.nvim/lua/render-markdown/core/ui.lua:87>
   Error  23:05:20 msg_show.lua_error    Error executing vim.schedule lua callback: ...ender-markdown.nvim/lua/render-markdown/core/context.lua:85: attempt to index local 'node' (a number value)
stack traceback:
	...ender-markdown.nvim/lua/render-markdown/core/context.lua:85: in function 'get_checkbox'
	...r-markdown.nvim/lua/render-markdown/render/list_item.lua:33: in function 'setup'
	...r-markdown.nvim/lua/render-markdown/handler/markdown.lua:80: in function 'callback'
	...ender-markdown.nvim/lua/render-markdown/core/context.lua:190: in function 'query'
	...r-markdown.nvim/lua/render-markdown/handler/markdown.lua:76: in function 'parse'
	...azy/render-markdown.nvim/lua/render-markdown/core/ui.lua:215: in function 'parse_tree'
	...azy/render-markdown.nvim/lua/render-markdown/core/ui.lua:185: in function 'parse_buffer'
	...azy/render-markdown.nvim/lua/render-markdown/core/ui.lua:122: in function 'run_update'
	...azy/render-markdown.nvim/lua/render-markdown/core/ui.lua:88: in function <...azy/render-markdown.nvim/lua/render-markdown/core/ui.lua:87>

@yetone
Copy link
Owner

yetone commented Nov 21, 2024

@john-persson-polestar It seems that your Avante is not the latest version. Can you upgrade to the latest version and try again?

@john-persson-polestar
Copy link
Author

@yetone thank you for the quick response.
I'm on the latest version (SHA: 341ecd2).

@lukeberry99
Copy link

I'm getting the exact same issue, Avante has no context of any other files outside of my current buffer. Commit sha 934602b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants