When opening the context menu (ie. using the right mouse button), the context menu doesn't "belong" to the item that just was clicked but to the item that is currently selected. A right click should select the item one has clicked on.
See attached screenshot: I wanted to rename the file "doctext.php" but "Rename Selected File..." was disabled. It took me a while to figure out that the context menu "belongs" to the currently selected item (which is the directory "markups" in this case).
Just to be on the safe side, I checked how Finder handles this. As you can see on the screenshot, the Finder context menu belongs to the clicked file (and not to the selected).