public static ReferenceAnnotation GetMethodInvocationInfo(MethodDescriptor callerDescriptor, AnalysisCallNode callNode)
        {
            var result = new ReferenceAnnotation()
            {
                declarationId = CodeGraphHelper.GetSymbolId(callNode.AdditionalInfo.StaticMethodDescriptor),
                symbolId      = CodeGraphHelper.GetSymbolId(callerDescriptor, callNode.InMethodPosition),
                declFile      = callNode.AdditionalInfo.StaticMethodDeclarationPath,
                symbolType    = SymbolType.Method,
                label         = callNode.Name,
                hover         = callNode.AdditionalInfo.DisplayString,
                refType       = "ref",
                range         = callNode.LocationDescriptor.Range
            };

            return(result);
        }
        public static ReferenceAnnotation GetMethodInvocationInfo(IMethodSymbol caller, IMethodSymbol callee, int invocationIndex, FileLinePositionSpan span)
        {
            var result = new ReferenceAnnotation()
            {
                declarationId = CodeGraphHelper.GetSymbolId(callee),
                symbolId      = CodeGraphHelper.GetSymbolId(caller, invocationIndex),
                declFile      = callee.Locations.First().GetMappedLineSpan().Path,
                symbolType    = SymbolType.Method,
                label         = callee.Name,
                hover         = callee.ToDisplayString(),
                refType       = "ref",
                range         = CodeGraphHelper.GetRange(span)
            };

            return(result);
        }
示例#3
0
        private static void ProcessReferenceAnnotation(ReferenceAnnotation reference)
        {
            ProcessAnnotation(reference);

            reference.declFile = FixFilePath(reference.declFile);
        }