Under my web browser, I have an addon named: Link Text and Location Copier (https://evilnickname.github.io/link-text-location-copier/)
With this add on, I can copy the link with many kinds of format, such as: wikipedia link format, or makdown link format or phpBB link format.
I think we can have a similar function, when you copy a piece of the code in the editor, we can got the result like:
In the source file: xxxx/yyyy.cpp
code tag begin
The code content.
code tag end
Any ideas? Or maybe we already have this feature?