@@ -153,7 +153,7 @@ public class CheckTermsAnalyzer : DiagnosticAnalyzer
Converting a File to a Stream
-----------------------------
In cases where an additional file contains structured data (e.g., XML or JSON) the line-by-line access provided by the `SourceText` may not be desirable. This sample demonstrates how to convert a `SourceText` to a `Stream` for consumption by other libraries. The terms file is assumed to have the following format:
In cases where an additional file contains structured data (e.g., XML or JSON) the line-by-line access provided by the `SourceText` may not be desirable. One alternative is to convert a `SourceText` to a `string`, by calling `ToString()` on it. This sample demonstrates another alternative: converting a `SourceText` to a `Stream` for consumption by other libraries. The terms file is assumed to have the following format:
``` XML
<Terms>
...
...
@@ -207,10 +207,12 @@ public class CheckTermsXMLAnalyzer : DiagnosticAnalyzer
@@ -1007,8 +1024,19 @@ public async Task TestInTopLevelMethod()
publicasyncTaskTestLambdaReturnType()
{
awaitTestAsync(
@"using System ; class C < T , R > { private static Func < T , R > g = null ; private static Func < T , R > f = ( T ) => { return [|Foo < T , R >|] ( g ) ; } ; } ",
@"using System ; class C < T , R > { private static Func < T , R > g = null ; private static Func < T , R > f = ( T ) => { return Foo < T , R > ( g ) ; } ; private static R Foo < T1 , T2 > ( Func < T , R > g ) { throw new NotImplementedException ( ) ; } } ");
@"using System ;
class C < T , R >
{
private static Func < T , R > g = null ;
private static Func < T , R > f = ( T ) => { return [|Foo < T , R >|] ( g ) ; } ;
} ",
@"using System ;
class C < T , R >
{
private static Func < T , R > g = null ;
private static Func < T , R > f = ( T ) => { return Foo < T , R > ( g ) ; } ;
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
$@"Exception of type 'System.Exception' was thrown.
+ Microsoft.CodeAnalysis.CSharp.Scripting.Hosting.UnitTests.ObjectFormatterTests.ParametersFixture.Method(ref char, out System.DateTime){string.Format(ScriptingResources.AtFileLine,filePath,10155)}