代码库索引(Codebase Indexing) 每次打开新项目,首次对话时 Cursor 可能会显示“Codebase Not Indexed”(代码库未索引)。这是因为 Cursor 需要在处理第一个请求时,将代码库向量化,变成 AI 的“知识库”。这个过程就像我们在 Coze 或 Cherry Studio 中建知识库一样。 代码库未索引提示 索引完成后,AI
1. 引言 在现代智能代码编辑器中,代码库索引功能至关重要。其主要目标是让编辑器在用户提问或请求代码建议时,能够快速检索并提供与整个项目相关的上下文信息。Cursor 作为一款集成了 AI 技术的编辑器,不仅继承了 VS Code 的基本功能,还通过对代码库内容进行预处理、嵌入计算和高效检索,使得语言模型可以获得更准确、丰...
然后会再对这k个indexing对应的原始文本再重排序(reranker),这时候是直接用原始文本用一个模型直接去...
开启codebase indexing,这能让 Cursor 更好地理解整个仓库,也能让 Cursor 有机会学习存量单测代码的写法; 开启cursor yolo 模式(要求 0.43 以上版本),这是一个强大的 AI Agent,能自行调用各类工具(eslint/ts/vitest 等)判断生成代码的合法性; 图片 编写适当的 .cursorrules 文件; 模型切换为 claude; 打开目标...
Included in.cursorindexingignorebut not in.cursorignore XNotes remains in.cursorignore(files that need to move elsewhere to be used) Video Demo and Walkthrough- Subscribe for more Cursor tutorials! 💡Compatibility:Tested with Claude Sonnet 3.5, 3.7, 3.7 Thinking, o3-mini, and GPT-4o. ...
setup rules - Set up rule files and directory structure without analyzing the codebase analyze existing - Generate an analysis report of your codebase without creating specificationsSpecification Management Commandsspec create "Title" - Create a new specification file spec update "path/to/spec.md" -...
The installation screen allows you to choose Vim, Emacs, Atom, Sublime, Jetbrains, or VS Code keybindings, with VS Code as the default. You can also specify the language you wish to use (defaults to English), and disable Cursor’scodebase indexingif you choose. There are also a couple ...
We've made significant improvements to indexing performance of similar codebases within a team, greatly reducing the initial indexing time for subsequent copies of large repositories after one copy has been fully indexed. For example, the Cursor codebase now indexes in under a minute, previously ...
Get Started Welcome to Cursor Installation FAQ Editor Tab Chat Inline Edit (⌘K) Models & Pricing Keyboard Shortcuts Features Context Codebase Indexing Rules Managing Context @ Symbols Overview @Files @Folders @Code @Docs @Git @Web @Definitions ...
function query_codebase(vector_index, metadata_list, query_text, top_k=5): query_embedding = compute_embedding(query_text) # 利用向量索引检索最相似的 top_k 个嵌入 indices, distances = vector_index.search(query_embedding, top_k) results = [] ...