cursor-codebase-indexing
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCursor Codebase Indexing
Cursor代码库索引
Overview
概述
What is Codebase Indexing?
什么是代码库索引?
Codebase indexing creates a searchable representation of your code:
- Enables @codebase queries
- Powers semantic code search
- Improves AI context awareness
- Helps AI understand project structure代码库索引会为你的代码创建可搜索的表示形式:
- 支持@codebase查询
- 为语义代码搜索提供支持
- 提升AI上下文感知能力
- 帮助AI理解项目结构Prerequisites
前提条件
- Cursor IDE installed and authenticated
- Project workspace with source files
- Sufficient disk space for index storage
- Stable network connection for initial setup
- 已安装并验证Cursor IDE
- 包含源代码文件的项目工作区
- 有足够的磁盘空间用于存储索引
- 初始设置时需要稳定的网络连接
Instructions
操作步骤
- Open your project in Cursor
- Navigate to Settings > Cursor > Codebase Indexing
- Enable "Index this workspace"
- Create file at project root
.cursorignore - Add exclusion patterns for large/irrelevant directories
- Wait for indexing to complete (check status bar)
- Test with queries in chat
@codebase
- 在Cursor中打开你的项目
- 导航至“设置 > Cursor > 代码库索引”
- 启用“索引此工作区”
- 在项目根目录创建文件
.cursorignore - 添加大型/无关目录的排除规则
- 等待索引完成(可查看状态栏)
- 在聊天中使用查询进行测试
@codebase
Output
输出结果
- Indexed codebase enabling queries
@codebase - Semantic code search functionality
- Improved AI context awareness
- Searchable symbol table and definitions
- 已索引的代码库,支持查询
@codebase - 语义代码搜索功能
- 提升的AI上下文感知能力
- 可搜索的符号表和定义
Error Handling
错误处理
See for comprehensive error handling.
{baseDir}/references/errors.md请查看获取全面的错误处理指南。
{baseDir}/references/errors.mdExamples
示例
See for detailed examples.
{baseDir}/references/examples.md请查看获取详细示例。
{baseDir}/references/examples.md