i have been following this: https://msdn.microsoft.com/en-us/library/ms165394.aspx?f=255&mspperror=-2147217396
i'm trying make code snippet speed coding (#procrastination)
<?xml version="1.0" encoding="utf-8"?> <codesnippets xmlns="http://schemas.microsoft.com/visualstudio/2005/codesnippet"> <codesnippet format="1.0.0"> <header> <title>class layout platformgameengine</title> </header> <snippet> <code language="c++"> <![cdata[ namespace platformgameengine { class _ { // methods public: _(); ~_(); private: // properties public: private: } } ]]> </code> </snippet> </codesnippet> </codesnippets>
1. why following code snippet not working?
the snippet files chosen not valid.
2. how can replace _ part ability tab through fields , fill them out?
found example visual studio snippet manager:
c:\program files (x86)\microsoft visual studio 12.0\vc\snippets\1033\visual c++
i can see class example had missing stuff:
<?xml version="1.0" encoding="utf-8"?> <codesnippets xmlns="http://schemas.microsoft.com/visualstudio/2005/codesnippet"> <codesnippet format="1.0.0"> <header> <title>class layout platformgameengine</title> <shortcut>gameengineclass</shortcut> </header> <snippet> <declarations> <literal> <id>name</id> <tooltip>class name</tooltip> <default>myclass</default> </literal> </declarations> <code language="cpp"> <![cdata[#pragma once // boiler plate includes // project specific includes // namespaces namespace platformgameengine { class $name$ { // methods public: $name$(); ~$name$(); private: // properties public: private: } }]]> </code> </snippet> </codesnippet> </codesnippets>
- removed spacing after cdata[...
- added shortcut node header
- added declarations id section allow typing in stuff
note:
- you have keep re-importing changes make individual snippet... if add entire folder, not have this.
- you can use
ctrl+k
,h
while continuing hold downctrl
use snippet. start typing shortcut , pops up - to remove code snippets, must remove entire folder , re add folder... #really?
- if definition not appearing... example:
$classname$::$classname
, try placing<default>myclass</default>
in... seems force work