当前位置: 首页>>代码示例>>C#>>正文


C# SymbolKind类代码示例

本文整理汇总了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;
 }
开发者ID:Samana,项目名称:HlslTools,代码行数:7,代码来源:Symbol.cs

示例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;
		}
开发者ID:ShuntaoChen,项目名称:SaltarelleCompiler,代码行数:7,代码来源:InlineCodeToken.cs

示例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;
 }
开发者ID:osmedile,项目名称:TypeCobol,代码行数:16,代码来源:SymbolInformation.cs

示例4: Symbol

 public Symbol(string symType, string symName,
     SymbolKind symKind, string declaringClassName)
 {
     Type = symType;
     Name = symName;
     Kind = symKind;
     DeclaringClassName = declaringClassName;
 }
开发者ID:selagroup,项目名称:diagnostics-courses,代码行数:8,代码来源:SymbolTable.cs

示例5: GetClass

        private string GetClass(SymbolKind kind)
        {
            if (kind == SymbolKind.TypeParameter)
            {
                return " t";
            }

            return "";
        }
开发者ID:rgmills,项目名称:SourceBrowser,代码行数:9,代码来源:DocumentGenerator.HighlightReferences.cs

示例6: Declaration

        public Declaration(Position position, string name, SymbolKind kind, AST.Type type)
            : base(position)
        {
            _name = name;

            _kind = kind;

            _type = type;
            _type.Parent = this;
        }
开发者ID:bencz,项目名称:Beryl,代码行数:10,代码来源:Declaration.cs

示例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();
     }
 }
开发者ID:modulexcite,项目名称:pattern-matching-csharp,代码行数:11,代码来源:ErrorFormatting.cs

示例8: SymbolMetadata

        public SymbolMetadata(
			string id, 
			string fullName, 
			string[] filePathsOfDeclarations, 
			SymbolKind symbolKind)
        {
            Id = id;
            FullName = fullName;
            DeclarationFilesPaths = filePathsOfDeclarations;
            SymbolKind = symbolKind;
        }
开发者ID:pgrefviau,项目名称:SourceMaster,代码行数:11,代码来源:SymbolMetadata.cs

示例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);
			}
		}
开发者ID:Paccc,项目名称:SharpDevelop,代码行数:17,代码来源:TypeParameterReference.cs

示例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;
		}
开发者ID:Paccc,项目名称:SharpDevelop,代码行数:14,代码来源:DefaultMemberReference.cs

示例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;
        }
开发者ID:Samana,项目名称:HlslTools,代码行数:14,代码来源:InvocableSymbol.cs

示例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++);
                        }
                    }
                }
            }
开发者ID:jkotas,项目名称:roslyn,代码行数:50,代码来源:SymbolKey.BodyLevelSymbolKey.cs

示例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;
		}
开发者ID:sphynx79,项目名称:dotfiles,代码行数:15,代码来源:DefaultResolvedTypeParameter.cs

示例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 " ";
        }
开发者ID:sphynx79,项目名称:dotfiles,代码行数:16,代码来源:MyCompletionCategory.cs

示例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");
        }
开发者ID:petterek,项目名称:RefactoringEssentials,代码行数:16,代码来源:LocalVariableHidesMemberAnalyzer.cs


注:本文中的SymbolKind类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。