Skip to content

Conversation

Davidyz
Copy link
Owner

@Davidyz Davidyz commented Aug 2, 2025

This PR provides a streamlined experience of indexing and querying the neovim runtime (including the lua source code/type stub and the help doc).

Specifically, this PR registers a new prompt that:

I'm also interested in turning this into a prompt builder so that you can easily do the same for an arbitrary local directory. Done. Users can now easily set up a custom prompt in the action palette that is similar to the built-in one.

Demonstration

The following will create a collection for the kitty documentation that comes with the Arch Linux package for the kitty terminal emulator:

require("codecompanion").setup({
  extensions = {
    vectorcode = {
      prompt_library = {
        ["Kitty Assistant"] = {
          project_root = "/usr/share/doc/kitty/",
          file_patterns = { "**/*.txt" },
        }
      }
    }
  }
})

And you'll see a new action in the :CodeCompanionActions menu:
image
Some default user prompts have been populated in the chat buffer:
image
You'd just need to type your question here, and the LLM will now use the tool to query from the correct database to answer your questions:
image

@Davidyz Davidyz added enhancement New feature or request feature labels Aug 2, 2025
Copy link

codecov bot commented Aug 2, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.72%. Comparing base (4580c45) to head (db9f17e).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #264   +/-   ##
=======================================
  Coverage   99.72%   99.72%           
=======================================
  Files          25       25           
  Lines        1837     1837           
=======================================
  Hits         1832     1832           
  Misses          5        5           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Davidyz Davidyz force-pushed the feat/nvim_help_workflow branch 2 times, most recently from d3aeb95 to 7c519ba Compare August 9, 2025 13:10
@Davidyz Davidyz force-pushed the feat/nvim_help_workflow branch 2 times, most recently from 27b1403 to e51cb24 Compare August 12, 2025 02:15
@Davidyz Davidyz force-pushed the feat/nvim_help_workflow branch from 1a6b396 to 3ba9296 Compare August 12, 2025 03:44
@Davidyz
Copy link
Owner Author

Davidyz commented Aug 12, 2025

Alternative for pre_hook (in case the PR's not accepted): hook into codecompanion's events for chat initialisation.

nvm. Just waiting for the pre_hook to be released now.

@Davidyz Davidyz force-pushed the feat/nvim_help_workflow branch from f92f9a2 to d6c0db3 Compare August 31, 2025 11:02
@Davidyz Davidyz marked this pull request as ready for review September 2, 2025 01:09
@Davidyz Davidyz changed the title Add VectorCode prompt library integration for Neovim help files Add prompt library builder for codecompanion.nvim extension Sep 3, 2025
@Davidyz Davidyz merged commit fafcd7a into main Sep 4, 2025
@Davidyz Davidyz deleted the feat/nvim_help_workflow branch September 4, 2025 01:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant