-
|
What's the best way to use codanna in a Rust workspace with dependent libraries? Let's use the following directory structure for example: When working on Both There seems to be a bug/issue when invoking codanna on a base directory that doesn't have an index while using a configuration file for a project that does (I'll file a separate issue for this): Any guidance on how to achieve this would be greatly appreciated. Thanks for this great project! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
|
Thanks for the great question! The best approach is to maintain a single codanna index at the workspace root rather than separate indexes for each library. Here are two ways to achieve what you want: Option 1: Selective Indexing with .codannaignore Create the codanna index at your workspace root and use cd workspace
codanna init
# Edit .codannaignore to exclude any folders you don't need
# This will show you what is going to be indexed
codanna index . --dry-run
codanna index . --progressThen you can query the single index from the project root: codanna mcp semantic_search_docs query:"how to use libA" limit:3Option 2: Index Specific Folders Currently, codanna doesn't support indexing multiple directories in one run, it's on the roadmap, though. You can index only the libraries you need from the workspace root: cd workspace
codanna init
codanna index libA --progress
codanna index libB --progress
# Don't index binC if you don't need it in the search resultsThis maintains a single index at The issue you encountered with |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for the reply! Based on your recommendation of indexing the workspace, how would I configure the MCP when working only on |
Beta Was this translation helpful? Give feedback.
I have shipped a new version today (v0.5.14) that provides more flexibility to work with the MCP from anywhere outside your workspace.
Make sure you install the new version:
This will install and replace your current version. Then check the version with
codanna --versionto verify the upgrade.Here's the best way to set up your workspace:
.codannafolders in libA and libB (if they exist).fastembed_cachefolder (we moved the model to a new location that allows sharing the same model across projects)codanna initto create a new config file and.fastembed_cachesymlink