@Code
@Code
@Code @Code Modified September 7, 2024 @Code @Code To reference specific sections of code, you can use the @Code symbol. 要引用代码的特定部分,您可以使用 @Code 符号。 Code Preview 代码预览 Similar to the @Files symbol, Cursor will show a preview of the code’s content so you can verify that the code you’re referencing is the correct one. 与 @Files 符号类似,Cursor 将显示代码内容的预览,以便您可以验证您引用的代码是否正确。 From the Editor 编者的话 Another way to add code snippets as context is to select the code you want to reference, and click on either “Add to Chat” (Ctrl/⌘ Shift L) or “Add to Edit” (Ctrl/⌘ Shift K). 将代码片段添加为上下文的另一种方法是选择要引用的代码,然后单击“添加到聊天”(Ctrl/⌘ Shift L)或“添加到编辑”(Ctrl/⌘ Shift K)。 These will add the selected code snippet to either the Chat input box or the currently active Cmd K prompt bar. 这些操作会将所选代码片段添加到 Chat 输入框或当前活动的 Cmd K 提示栏。 To add a selected code to a new chat, you can press Ctrl/⌘ L. 要将所选代码添加到新聊天中,您可以按 Ctrl/⌘ L。 @Files @Files @Code @Code To reference specific sections of code, you can use the @Code symbol. 要引用代码的特定部分,您可以使用 @Code 符号。 Code Preview 代码预览 Similar to the @Files symbol, Cursor will show a preview of the code’s content so you can verify that the code you’re referencing is the correct one. 与 @Files 符号类似,Cursor 将显示代码内容的预览,以便您可以验证您引用的代码是否正确。 @Files @Files From the Editor 编者的话 Another way to add code snippets as context is to select the code you want to reference, and click on either “Add to Chat” (Ctrl/⌘ Shift L) or “Add to Edit” (Ctrl/⌘ Shift K). 将代码片段添加为上下文的另一种方法是选择要引用的代码,然后单击“添加到聊天”(Ctrl/⌘ Shift L)或“添加到编辑”(Ctrl/⌘ Shift K)。 These will add the selected code snippet to either the Chat input box or the currently active Cmd K prompt bar. 这些操作会将所选代码片段添加到 Chat 输入框或当前活动的 Cmd K 提示栏。 To add a selected code to a new chat, you can press Ctrl/⌘ L. 要将所选代码添加到新聊天中,您可以按 Ctrl/⌘ L。