The Microsoft link here lists three methods that we can use.
But how do we get the current namespace? I see there is a similar question, but the answer to that is using Macros, which doesnt solve this specific question.
The NameSpace() to do something like this:
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
.
.
</Header>
<Snippet>
<Declarations>
<Literal>
<ID>namespace</ID>
<Function>NameSpace()</Function>
</Literal>
</Declarations>
<Code Language="csharp">
<![CDATA[
$namespace$
]]>
</Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>
Found out that it can be done and it brings into picture the classes ExpansionProvider & ExpansionFunction
For the above snippet, I had to do something as such:
And the LanguageService tells the snippet file where to look for definition of the function:
This turned out to be more like a tutorial question hence I have provided the links above. Should be helpful. Worked for me :)