/// <summary> /// Binds the name in the context of the specified location and sees if it resolves to an /// alias name. If it does, return the AliasSymbol corresponding to it. Otherwise, return null. /// </summary> /// <param name="semanticModel"></param> /// <param name="position">A character position used to identify a declaration scope and /// accessibility. This character position must be within the FullSpan of the Root syntax /// node in this SemanticModel. /// </param> /// <param name="nameSyntax">A syntax node that represents a name. This syntax /// node need not and typically does not appear in the source code referred to by the /// SemanticModel instance.</param> /// <param name="bindingOption">Indicates whether to binding the name as a full expression, /// or as a type or namespace. If SpeculativeBindingOption.BindAsTypeOrNamespace is supplied, then /// expression should derive from TypeSyntax.</param> /// <remarks>The passed in name is interpreted as a stand-alone name, as if it /// appeared by itself somewhere within the scope that encloses "position".</remarks> public static IAliasSymbol?GetSpeculativeAliasInfo( this SemanticModel semanticModel, int position, SyntaxNode nameSyntax, SpeculativeBindingOption bindingOption ) { return(semanticModel.GetSpeculativeAliasInfo(position, nameSyntax, bindingOption)); }