예제 #1
0
        public bool TryGetSourceLocation(MethodGroup methodGroup, out SourceLocation sourceLocation)
        {
            if (types == null)
                types = CacheTypes(assemblyPath);

            sourceLocation = null;

            var className = methodGroup.Class;
            var methodName = methodGroup.Method;

            SequencePoint sequencePoint;

            if (TryGetSequencePoint(className, methodName, out sequencePoint))
                sourceLocation = new SourceLocation(sequencePoint.Document.Url, sequencePoint.StartLine);

            return sourceLocation != null;
        }
예제 #2
0
        public bool TryGetSourceLocation(MethodGroup methodGroup, out SourceLocation sourceLocation)
        {
            if (types == null)
                types = CacheTypes(assemblyPath);

            var className = methodGroup.Class;
            var methodName = methodGroup.Method;

            sourceLocation = GetMethods(className)
                .Where(m => m.Name == methodName)
                .Select(FirstOrDefaultSequencePoint)
                .Where(x => x != null)
                .OrderBy(x => x.StartLine)
                .Select(x => new SourceLocation(x.Document.Url, x.StartLine))
                .FirstOrDefault();

            return sourceLocation != null;
        }