I'm writing a code snippet to insert a copyright header. The basic snippet is no problem. I'd like to be able to automatically reference the name of the file which I'm inserting the snippet in the text that is being inserted.
Any ideas how to do this?开发者_StackOverflow中文版
You can use the ClassName function demonstrated here. (Second example). If you need to add it outside the class scope, you could use Snippet Designer which is a plugin to make snippet creation easier.
Beside creating a snippet, you might consider creating a Template and putting the file name as a parameter (see MSDN).
精彩评论