Bug 10494 - No docs or hints on available snippet functions
Summary: No docs or hints on available snippet functions
Status: CONFIRMED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Text Editor ()
Version: 4.0
Hardware: PC Mac OS
: Normal enhancement
Target Milestone: ---
Assignee: Mike Krüger
URL:
Depends on:
Blocks:
 
Reported: 2013-02-20 22:28 UTC by Mikayla Hutchinson [MSFT]
Modified: 2017-07-21 00:26 UTC (History)
4 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report for Bug 10494 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
CONFIRMED

Description Mikayla Hutchinson [MSFT] 2013-02-20 22:28:56 UTC
From http://forums.xamarin.com/discussion/1455/snippets:

"I can't see the docs on what functions are available within the 'add code template' ui. For example the 'ctor' template uses a function 'GetCurrentClassName' to find the current class. I'd like to get the current namespace, but my searching for this method name or general help hasn't turned up anything yet."
Comment 1 Mike Krüger 2013-02-21 02:01:50 UTC
hm, this is more or less an internal hack - not really comprehensive (or working in all cases).

We need to do a clean design to the snippet system - maybe exposing some nrefactory functions there or even allowing template definitions in C# AST syntax. (We hadn't the tools at the time the code template system was written)

Atm I wouldn't recommend using any functions for now and just sticking to text templates.
Comment 2 Mark Foley 2013-02-21 17:32:33 UTC
Yes that would be good.  Even implementing something like Razor support would be pretty powerful for generating flexible pieces of code.
Comment 3 Jon Goldberger [MSFT] 2017-07-21 00:26:33 UTC
Thanks so much for taking the time to submit this report! I can confirm using the latest Visual Studio 2017 for Mac Preview version 7.1 I am able to reproduce this issue. Marking this report as CONFIRMED.