Codanna understands project configuration files and uses them to resolve imports correctly.
Reads tsconfig.json to resolve path aliases.
# .codanna/settings.toml
[languages.typescript]
enabled = true
config_files = [
"tsconfig.json",
"packages/web/tsconfig.json" # For monorepos
]When your TypeScript code imports @app/utils, Codanna uses your tsconfig.json path mappings to resolve it to the actual file location (src/app/utils). This works across modules in monorepos.
Process:
- Codanna reads your project config files (
tsconfig.json) - Extracts path aliases, baseUrl, and other resolution rules
- Stores them in
.codanna/index/resolvers/ - Uses these rules during indexing to resolve imports accurately
Given this tsconfig.json:
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@app/*": ["src/app/*"],
"@utils/*": ["src/utils/*"],
"~/components/*": ["components/*"]
}
}
}Codanna will resolve:
@app/main→src/app/main@utils/config→src/utils/config~/components/Button→components/Button
For monorepos with multiple tsconfig.json files:
[languages.typescript]
config_files = [
"tsconfig.json",
"packages/web/tsconfig.json",
"packages/api/tsconfig.json"
]Each config's path mappings are applied to files within its scope.
Project-specific import resolution using pyproject.toml:
- Package discovery
- Namespace packages
- Editable installs
Module resolution using go.mod:
- Module path resolution
- Replace directives
- Local module references
Language-specific import resolution as needed.
- Accurate Import Resolution - Follows your project's rules
- Cross-Module Navigation - Works in monorepos
- Path Alias Support - Handles
@app/*,~/utils/*patterns - No Manual Configuration - Reads existing project config
Check that config files are listed:
codanna config | grep config_filesVerify paths in your tsconfig.json are correct.
Ensure all relevant tsconfig.json files are listed in settings.toml.
After modifying path aliases, re-index:
codanna index . --force --progress- Configuration - Complete configuration guide
- First Index - Creating your first index