本文整理汇总了C#中SymbolKind类的典型用法代码示例。如果您正苦于以下问题:C# SymbolKind类的具体用法?C# SymbolKind怎么用?C# SymbolKind使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SymbolKind类属于命名空间,在下文中一共展示了SymbolKind类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Symbol
internal Symbol(SymbolKind kind, string name, string documentation, Symbol parent)
{
Kind = kind;
Name = name;
Documentation = documentation;
Parent = parent;
}
示例2: InlineCodeToken
public InlineCodeToken(TokenType type, string text = null, int index = -1, SymbolKind ownerType = default(SymbolKind), bool isExpandedParamArray = false) {
Type = type;
_text = text;
_index = index;
_ownerType = ownerType;
_isExpandedParamArray = isExpandedParamArray;
}
示例3: SymbolInformation
/// <summary>
/// Creates a new symbol information literal.
///
/// @param name The name of the symbol.
/// @param kind The kind of the symbol.
/// @param range The range of the location of the symbol.
/// @param uri The resource of the location of symbol, defaults to the current document.
/// @param containerName The name of the symbol containg the symbol.
/// </summary>
public SymbolInformation(string name, SymbolKind kind, Range range, string uri, string containerName)
{
this.name = name;
this.kind = kind;
this.location = new Location(uri, range);
this.containerName = containerName;
}
示例4: Symbol
public Symbol(string symType, string symName,
SymbolKind symKind, string declaringClassName)
{
Type = symType;
Name = symName;
Kind = symKind;
DeclaringClassName = declaringClassName;
}
示例5: GetClass
private string GetClass(SymbolKind kind)
{
if (kind == SymbolKind.TypeParameter)
{
return " t";
}
return "";
}
示例6: Declaration
public Declaration(Position position, string name, SymbolKind kind, AST.Type type)
: base(position)
{
_name = name;
_kind = kind;
_type = type;
_type.Parent = this;
}
示例7: GetErrorReportingName
public static object GetErrorReportingName(SymbolKind kind)
{
switch (kind)
{
case SymbolKind.Namespace:
return MessageID.IDS_SK_NAMESPACE.Localize();
default:
// TODO: what is the right way to get these strings?
return kind.ToString().ToLower();
}
}
示例8: SymbolMetadata
public SymbolMetadata(
string id,
string fullName,
string[] filePathsOfDeclarations,
SymbolKind symbolKind)
{
Id = id;
FullName = fullName;
DeclarationFilesPaths = filePathsOfDeclarations;
SymbolKind = symbolKind;
}
示例9: Create
/// <summary>
/// Creates a type parameter reference.
/// For common type parameter references, this method may return a shared instance.
/// </summary>
public static TypeParameterReference Create(SymbolKind ownerType, int index)
{
if (index >= 0 && index < 8 && (ownerType == SymbolKind.TypeDefinition || ownerType == SymbolKind.Method)) {
TypeParameterReference[] arr = (ownerType == SymbolKind.TypeDefinition) ? classTypeParameterReferences : methodTypeParameterReferences;
TypeParameterReference result = LazyInit.VolatileRead(ref arr[index]);
if (result == null) {
result = LazyInit.GetOrSet(ref arr[index], new TypeParameterReference(ownerType, index));
}
return result;
} else {
return new TypeParameterReference(ownerType, index);
}
}
示例10: DefaultMemberReference
public DefaultMemberReference(SymbolKind symbolKind, ITypeReference typeReference, string name, int typeParameterCount = 0, IList<ITypeReference> parameterTypes = null)
{
if (typeReference == null)
throw new ArgumentNullException("typeReference");
if (name == null)
throw new ArgumentNullException("name");
if (typeParameterCount != 0 && symbolKind != SymbolKind.Method)
throw new ArgumentException("Type parameter count > 0 is only supported for methods.");
this.symbolKind = symbolKind;
this.typeReference = typeReference;
this.name = name;
this.typeParameterCount = typeParameterCount;
this.parameterTypes = parameterTypes ?? EmptyList<ITypeReference>.Instance;
}
示例11: InvocableSymbol
internal InvocableSymbol(SymbolKind kind, string name, string documentation, Symbol parent, TypeSymbol returnType, Func<InvocableSymbol, IEnumerable<ParameterSymbol>> lazyParameters = null)
: base(kind, name, documentation, parent)
{
if (returnType == null)
throw new ArgumentNullException(nameof(returnType));
_parameters = new List<ParameterSymbol>();
if (lazyParameters != null)
foreach (var parameter in lazyParameters(this))
AddParameter(parameter);
ReturnType = returnType;
}
示例12: EnumerateSymbols
private static IEnumerable<ValueTuple<ISymbol, int>> EnumerateSymbols(
Compilation compilation, ISymbol containingSymbol,
SymbolKind kind, string localName,
CancellationToken cancellationToken)
{
int ordinal = 0;
foreach (var declaringLocation in containingSymbol.DeclaringSyntaxReferences)
{
// This operation can potentially fail. If containingSymbol came from
// a SpeculativeSemanticModel, containingSymbol.ContainingAssembly.Compilation
// may not have been rebuilt to reflect the trees used by the
// SpeculativeSemanticModel to produce containingSymbol. In that case,
// asking the ContainingAssembly's complation for a SemanticModel based
// on trees for containingSymbol with throw an ArgumentException.
// Unfortunately, the best way to avoid this (currently) is to see if
// we're asking for a model for a tree that's part of the compilation.
// (There's no way to get back to a SemanticModel from a symbol).
// TODO (rchande): It might be better to call compilation.GetSemanticModel
// and catch the ArgumentException. The compilation internally has a
// Dictionary<SyntaxTree, ...> that it uses to check if the SyntaxTree
// is applicable wheras the public interface requires us to enumerate
// the entire IEnumerable of trees in the Compilation.
if (!compilation.SyntaxTrees.Contains(declaringLocation.SyntaxTree))
{
continue;
}
var node = declaringLocation.GetSyntax(cancellationToken);
if (node.Language == LanguageNames.VisualBasic)
{
node = node.Parent;
}
var semanticModel = compilation.GetSemanticModel(node.SyntaxTree);
foreach (var token in node.DescendantNodes())
{
var symbol = semanticModel.GetDeclaredSymbol(token, cancellationToken);
if (symbol != null &&
symbol.Kind == kind &&
SymbolKey.Equals(compilation, symbol.Name, localName))
{
yield return ValueTuple.Create(symbol, ordinal++);
}
}
}
}
示例13: DefaultTypeParameter
public DefaultTypeParameter(
ICompilation compilation, SymbolKind ownerType,
int index, string name = null,
VarianceModifier variance = VarianceModifier.Invariant,
IList<IAttribute> attributes = null,
DomRegion region = default(DomRegion),
bool hasValueTypeConstraint = false, bool hasReferenceTypeConstraint = false, bool hasDefaultConstructorConstraint = false,
IList<IType> constraints = null)
: base(compilation, ownerType, index, name, variance, attributes, region)
{
this.hasValueTypeConstraint = hasValueTypeConstraint;
this.hasReferenceTypeConstraint = hasReferenceTypeConstraint;
this.hasDefaultConstructorConstraint = hasDefaultConstructorConstraint;
this.constraints = constraints ?? EmptyList<IType>.Instance;
}
示例14: GetVimKind
private string GetVimKind(SymbolKind entityType)
{
// v variable
//f function or method
//m member of a struct or class
switch(entityType)
{
case(SymbolKind.Method):
return "f";
case(SymbolKind.Field):
return "v";
case(SymbolKind.Property):
return "m";
}
return " ";
}
示例15: GetMemberType
static string GetMemberType(SymbolKind symbolKind)
{
switch (symbolKind)
{
case SymbolKind.Field:
return GettextCatalog.GetString("field");
case SymbolKind.Method:
return GettextCatalog.GetString("method");
case SymbolKind.Property:
return GettextCatalog.GetString("property");
case SymbolKind.Event:
return GettextCatalog.GetString("event");
}
return GettextCatalog.GetString("member");
}