cursor-codebase-indexing

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Cursor 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

操作步骤

  1. Open your project in Cursor
  2. Navigate to Settings > Cursor > Codebase Indexing
  3. Enable "Index this workspace"
  4. Create
    .cursorignore
    file at project root
  5. Add exclusion patterns for large/irrelevant directories
  6. Wait for indexing to complete (check status bar)
  7. Test with
    @codebase
    queries in chat
  1. 在Cursor中打开你的项目
  2. 导航至“设置 > Cursor > 代码库索引”
  3. 启用“索引此工作区”
  4. 在项目根目录创建
    .cursorignore
    文件
  5. 添加大型/无关目录的排除规则
  6. 等待索引完成(可查看状态栏)
  7. 在聊天中使用
    @codebase
    查询进行测试

Output

输出结果

  • Indexed codebase enabling
    @codebase
    queries
  • Semantic code search functionality
  • Improved AI context awareness
  • Searchable symbol table and definitions
  • 已索引的代码库,支持
    @codebase
    查询
  • 语义代码搜索功能
  • 提升的AI上下文感知能力
  • 可搜索的符号表和定义

Error Handling

错误处理

See
{baseDir}/references/errors.md
for comprehensive error handling.
请查看
{baseDir}/references/errors.md
获取全面的错误处理指南。

Examples

示例

See
{baseDir}/references/examples.md
for detailed examples.
请查看
{baseDir}/references/examples.md
获取详细示例。

Resources

资源