Skip to content

Commit

Permalink
Prepare JetBrains.Annotations samples #16
Browse files Browse the repository at this point in the history
- added sample of [SourceTemplate]
  • Loading branch information
MarcinCelej committed Oct 13, 2016
1 parent 7816d24 commit aa72ca7
Showing 1 changed file with 35 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using JetBrains.Annotations;

namespace Synergy.Contracts.Samples.Annotations
{
public static class SourceTemplateAttributeSample
{
[SourceTemplate]
public static void forEach<T>(this IEnumerable<T> xs)
{
foreach (T x in xs)
{
//$ $END$
}
}

[SourceTemplate]
public static void newGuid(this object obj, [Macro(Expression = "guid()", Editable = -1)] string newguid)
{
Console.WriteLine("$newguid$");
}

private static void test()
{
var enumerable = new List<string>();

//enumerable.forEach
//enumerable.newGuid

string s = null;
//s.fi
}
}
}

0 comments on commit aa72ca7

Please sign in to comment.