예제 #1
0
            public static SymbolKeyResolution Resolve(SymbolKeyReader reader)
            {
                var name             = reader.ReadString();
                var targetResolution = reader.ReadSymbolKey();
                var filePath         = reader.ReadString();

                var syntaxTree = reader.GetSyntaxTree(filePath);

                if (syntaxTree != null)
                {
                    var target = targetResolution.GetAnySymbol();
                    if (target != null)
                    {
                        var semanticModel = reader.Compilation.GetSemanticModel(syntaxTree);
                        var result        = Resolve(semanticModel, syntaxTree.GetRoot(reader.CancellationToken), name, target, reader.CancellationToken);
                        if (result.HasValue)
                        {
                            return(result.Value);
                        }
                    }
                }

                return(default);