示例#1
0
        private static void AssertExpression(string content, string expected, int index = -1, PythonLanguageVersion version = PythonLanguageVersion.V35)
        {
            var buffer = new MockTextBuffer(content);

            if (index < 0)
            {
                index += content.Length + 1;
            }
            var span   = new SnapshotSpan(buffer.CurrentSnapshot, index, 0);
            var actual = PythonTextBufferInfo.GetExpressionAtPoint(span, version, GetExpressionOptions.Hover);

            Assert.AreEqual(expected, actual?.GetText(), content);
        }