@Files
@Files
@Files @Files Modified September 7, 2024 @Files @Files In AI input boxes such as in Cursor Chat and Cmd K, you can reference entire files by using @Files. Also, if you continue to type after @, you will see your file search results after the @Code strategy. 在 AI 输入框中(如 Cursor Chat 和 Cmd K),可以使用 @Files 引用整个文件。此外,如果您继续在 @ 后键入,您将在 @Code 策略之后看到您的文件搜索结果。 In order to make sure the file you’re referencing is the correct file, Cursor will show a preview of the file’s path. This is especially useful when you have multiple files with the same name in different folders. 为了确保您引用的文件是正确的文件,Cursor 将显示文件路径的预览。当您在不同的文件夹中有多个同名文件时,这尤其有用。 Chat Long File References 聊天长文件引用 In Cursor’s Chat, if the contents of a file is too long, Cursor will chunk the file into smaller chunks and rerank them based on relevance to the query. 在 Cursor 的聊天中,如果文件的内容太长,Cursor 会将文件分块为较小的块,并根据与查询的相关性对它们进行重新排序。 Cmd K Chunking Strategy Cmd K 分块策略 For Cmd K, Cursor uses the file references differently based on the content length as well. 对于 Cmd K,Cursor 也会根据内容长度以不同的方式使用文件引用。 • auto 自动 ◦ Automatically pick one of the three reading strategies based on the file size 根据文件大小自动选择三种读取策略之一 • full file 完整文件 ◦ The entire file is used as context. 整个文件将用作上下文。 • outline 大纲 ◦ Cursor parses the outline of the file and uses the information as context. Cursor 解析文件的轮廓,并将该信息用作上下文。 • chunks 块 ◦ Cursor chunks the file into smaller chunks and picks the most relevant one. Cursor 将文件分块为较小的块,并选择最相关的块。 Drag and Drop 拖放 You can drag and drop files from the primary sidebar into Chat or Cmd K to add them as context as well. 您可以将文件从主侧边栏拖放到 Chat 或 Cmd K 中,以将它们也添加为上下文。 @Code @Code @Files @Files In AI input boxes such as in Cursor Chat and Cmd K, you can reference entire files by using @Files. Also, if you continue to type after @, you will see your file search results after the @Code strategy. 在 AI 输入框中(如 Cursor Chat 和 Cmd K),可以使用 @Files 引用整个文件。此外,如果您继续在 @ 后键入,您将在 @Code 策略之后看到您的文件搜索结果。 @Code @Code In order to make sure the file you’re referencing is the correct file, Cursor will show a preview of the file’s path. This is especially useful when you have multiple files with the same name in different folders. 为了确保您引用的文件是正确的文件,Cursor 将显示文件路径的预览。当您在不同的文件夹中有多个同名文件时,这尤其有用。 Chat Long File References 聊天长文件引用 In Cursor’s Chat, if the contents of a file is too long, Cursor will chunk the file into smaller chunks and rerank them based on relevance to the query. 在 Cursor 的聊天中,如果文件的内容太长,Cursor 会将文件分块为较小的块,并根据与查询的相关性对它们进行重新排序。 Cmd K Chunking Strategy Cmd K 分块策略 For Cmd K, Cursor uses the file references differently based on the content length as well. 对于 Cmd K,Cursor 也会根据内容长度以不同的方式使用文件引用。 • auto 自动 ◦ Automatically pick one of the three reading strategies based on the file size 根据文件大小自动选择三种读取策略之一 ◦ Automatically pick one of the three reading strategies based on the file size 根据文件大小自动选择三种读取策略之一 • full file 完整文件 ◦ The entire file is used as context. 整个文件将用作上下文。 ◦ The entire file is used as context. 整个文件将用作上下文。 • outline 大纲 ◦ Cursor parses the outline of the file and uses the information as context. Cursor 解析文件的轮廓,并将该信息用作上下文。 ◦ Cursor parses the outline of the file and uses the information as context. Cursor 解析文件的轮廓,并将该信息用作上下文。 • chunks 块 ◦ Cursor chunks the file into smaller chunks and picks the most relevant one. Cursor 将文件分块为较小的块,并选择最相关的块。 ◦ Cursor chunks the file into smaller chunks and picks the most relevant one. Cursor 将文件分块为较小的块,并选择最相关的块。 Drag and Drop 拖放 You can drag and drop files from the primary sidebar into Chat or Cmd K to add them as context as well. 您可以将文件从主侧边栏拖放到 Chat 或 Cmd K 中,以将它们也添加为上下文。