public void TestWithinStatement_1() { var tree = GetTreeFromCode( @"using System; using System.Collections.Generic; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { var xx = true; var yy = new List<bool>(); yy.Add(xx?true:false); } } }" ); var terms = CSharpProximityExpressionsService.GetProximityExpressions( tree, 245, cancellationToken: default ); Assert.NotNull(terms); AssertEx.Equal(new[] { "yy", "xx" }, terms); }
public static IList <string> GetProximityExpressions( SyntaxTree syntaxTree, int absoluteIndex, CancellationToken cancellationToken ) => CSharpProximityExpressionsService.GetProximityExpressions( syntaxTree, absoluteIndex, cancellationToken );