Currently I read in the documentation Prompting agents | Cursor Docs that I can add easily parts of a code file to the context. However, when trying this with Cursor V 2.4.31 via @Code <file-name>, nothing is happening like providing which parts of a file are available.
It only provides me the possibilty to include the whole file. Also I don’t see anything from the available command that something like @Code does exist.
Did I miss anything or is this feature not available yet?
You didn’t miss anything: in Cursor 2.0 (and many 2.x builds), the autocomplete/symbol reference flow for @Code/@Definitions was removed as part of the context menu changes, so it’s normal that you can’t select “parts” of a file and only get the entire attachment.
Workarounds: Attach the entire file using Files & Folders (e.g., @types.ts or the file containing the function/class) and explicitly specify the symbol you want to change in the message.
If you only want a snippet, select the code in the editor and use “Add to Chat” (Ctrl/⌘ Shift + L) to send only that selection as context.
WSL might not be the root cause; your description matches the known change in Cursor 2.x menu behavior.
Thank you for the information. Hence the issue was only that the documentation was not updated at this moment yet. However this has been aligned now. Hence I will close this question.
There is still another thread going on. Not sure it was intended for specifically @code and is still in the docs, for reference, @deanrie last message about it in the other thread was:
The callout says @definitions was removed in v2.0, but the docs still say we can reference “code symbols”. However, that verifiably doesn’t work for anyone.
Cursor team: If the “code symbols” reference is still in the docs for people still using v1.7 or earlier, can you clearly mark it as such? And if that isn’t the case, can you please bring back the feature, or at least document that it’s broken? The current documentation is confusing for me as a user because it clearly advertises a feature that the cursor team says was removed intentionally. Is the feature broken but supposed to be present, or was it incorrectly left in the docs? I can’t tell just from reading.
Hey @scupit, that’s a valid point. The docs for agent prompting still mention code symbols, even though the @Code and @Definitions feature was removed in v2.0. That’s confusing for users, I agree.
For now, the workarounds are the same:
Use @Files to attach the whole file, then describe the symbol you need in text
Select the code in the editor and press Cmd/Ctrl+Shift+L to add only the selected snippet to the chat