本文整理汇总了C#中Microsoft.CodeAnalysis.CSharp.Binder.LookupSymbolsSimpleName方法的典型用法代码示例。如果您正苦于以下问题:C# Binder.LookupSymbolsSimpleName方法的具体用法?C# Binder.LookupSymbolsSimpleName怎么用?C# Binder.LookupSymbolsSimpleName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.CodeAnalysis.CSharp.Binder
的用法示例。
在下文中一共展示了Binder.LookupSymbolsSimpleName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AppendSymbolsWithNameAndArity
private void AppendSymbolsWithNameAndArity(
ArrayBuilder<Symbol> results,
string name,
int arity,
Binder binder,
NamespaceOrTypeSymbol container,
LookupOptions options)
{
Debug.Assert(results != null);
// Don't need to de-dup since AllMethodsOnArityZero can't be set at this point (not exposed in CommonLookupOptions).
Debug.Assert((options & LookupOptions.AllMethodsOnArityZero) == 0);
var lookupResult = LookupResult.GetInstance();
HashSet<DiagnosticInfo> useSiteDiagnostics = null;
binder.LookupSymbolsSimpleName(
lookupResult,
container,
name,
arity,
basesBeingResolved: null,
options: options & ~LookupOptions.IncludeExtensionMethods,
diagnose: false,
useSiteDiagnostics: ref useSiteDiagnostics);
if (lookupResult.IsMultiViable)
{
if (lookupResult.Symbols.Any(t => t.Kind == SymbolKind.NamedType || t.Kind == SymbolKind.Namespace || t.Kind == SymbolKind.ErrorType))
{
// binder.ResultSymbol is defined only for type/namespace lookups
bool wasError;
var diagnostics = DiagnosticBag.GetInstance(); // client code never expects a null diagnostic bag.
Symbol singleSymbol = binder.ResultSymbol(lookupResult, name, arity, this.Root, diagnostics, true, out wasError, container, options);
diagnostics.Free();
if (!wasError)
{
results.Add(singleSymbol);
}
else
{
results.AddRange(lookupResult.Symbols);
}
}
else
{
results.AddRange(lookupResult.Symbols);
}
}
lookupResult.Free();
}