Reputation: 9368
I need to include the name of the file that the snippet is being inserted to the output. I looked into Code Snippet Functions (http://msdn.microsoft.com/en-us/library/ms242312%28v=vs.80%29.aspx) and the selections are limited.
Is there any way to insert the name of the file that the snippet is being inserted into to the snippet output?
Upvotes: 5
Views: 4781
Reputation: 116
You can add ${1:${TM_FILENAME_BASE}}
tag in json snippet file to get file name and add it to output of snippet.
Upvotes: 8
Reputation: 2444
It does not seem possible to do with snippets, but it is possible with Item Templates. See this post for more information.
Upvotes: 2
Reputation: 841
Maybe this could help: File Header code snippet or this one: Code Snippet Functions. In short using Declariations->Literals and Code snippet functions should resolve your problem.
Upvotes: 1