Skip to content

1.2.1

Compare
Choose a tag to compare
@mikoskinen mikoskinen released this 30 Dec 11:17
· 22 commits to master since this release

New features:

Add support for tagging plugins in Roslyn catalog

It's now possible to tag Roslyn based catalogs. This feature was previously available in all the other catalogs and now also Roslyn catalog supports it.

Examples:

    [Fact]
    public async Task CanTagCode()
    {
        // Arrange
        var code = @"public class MyClass
               {
                   public void RunThings()
                   {
                       var y = 0;
                       var a = 1;
       
                       a = y + 10;
                   
                       Debug.WriteLine(y + a);
                   }
               }";

        var catalog = new RoslynPluginCatalog(code, new RoslynPluginCatalogOptions() { Tags = new List<string>() { "CustomTag" } });

        await catalog.Initialize();
        var plugin = catalog.Single();

        Assert.Equal("CustomTag", plugin.Tag);
    }

    [Fact]
    public async Task CanTagScript()
    {
        // Arrange
        var code = "Debug.WriteLine(\"Hello world!\");";

        var catalog = new RoslynPluginCatalog(code, new RoslynPluginCatalogOptions() { Tags = new List<string>() { "CustomTag" } });

        await catalog.Initialize();

        var plugin = catalog.Single();

        Assert.Equal("CustomTag", plugin.Tag);
    }