void FindFull(string program, string location, string expectedExpression, ExpressionContext expectedContext) { int pos = program.IndexOf(location); if (pos < 0) { Assert.Fail("location not found in program"); } ExpressionResult er = ef.FindFullExpression(program, pos); Assert.AreEqual(expectedExpression, er.Expression); if (expectedContext != null) { Assert.AreEqual(expectedContext, er.Context); } }
/// <summary> /// Finds an expression around the current offset. /// </summary> public ExpressionResult FindFullExpression(int offset) { return(ExpressionFinder.FindFullExpression(TextContent, offset)); }