SemanticModel.GetSpeculativeSymbolInfoCore Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Binds the node in the context of the specified location and get semantic information such as type, symbols and diagnostics. This method is used to get semantic information about an expression that did not actually appear in the source code.
protected:
abstract Microsoft::CodeAnalysis::SymbolInfo GetSpeculativeSymbolInfoCore(int position, Microsoft::CodeAnalysis::SyntaxNode ^ expression, Microsoft::CodeAnalysis::SpeculativeBindingOption bindingOption);
protected abstract Microsoft.CodeAnalysis.SymbolInfo GetSpeculativeSymbolInfoCore (int position, Microsoft.CodeAnalysis.SyntaxNode expression, Microsoft.CodeAnalysis.SpeculativeBindingOption bindingOption);
abstract member GetSpeculativeSymbolInfoCore : int * Microsoft.CodeAnalysis.SyntaxNode * Microsoft.CodeAnalysis.SpeculativeBindingOption -> Microsoft.CodeAnalysis.SymbolInfo
Protected MustOverride Function GetSpeculativeSymbolInfoCore (position As Integer, expression As SyntaxNode, bindingOption As SpeculativeBindingOption) As SymbolInfo
Parameters
- position
- Int32
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.
- expression
- SyntaxNode
A syntax node that represents a parsed expression. This syntax node need not and typically does not appear in the source code referred to SemanticModel instance.
- bindingOption
- SpeculativeBindingOption
Indicates whether to binding the expression as a full expressions, or as a type or namespace. If SpeculativeBindingOption.BindAsTypeOrNamespace is supplied, then expression should derive from TypeSyntax.
Returns
The semantic information for the topmost node of the expression.
Remarks
The passed in expression is interpreted as a stand-alone expression, as if it appeared by itself somewhere within the scope that encloses "position".
Applies to
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈