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


C# ISymbol.GetSymbolKey方法代码示例

本文整理汇总了C#中ISymbol.GetSymbolKey方法的典型用法代码示例。如果您正苦于以下问题:C# ISymbol.GetSymbolKey方法的具体用法?C# ISymbol.GetSymbolKey怎么用?C# ISymbol.GetSymbolKey使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ISymbol的用法示例。


在下文中一共展示了ISymbol.GetSymbolKey方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AbstractCallFinder

 protected AbstractCallFinder(ISymbol symbol, Project project, IAsynchronousOperationListener asyncListener, CallHierarchyProvider provider)
 {
     _asyncListener = asyncListener;
     _symbol = symbol.GetSymbolKey();
     this.SymbolName = symbol.Name;
     _project = project;
     this.Provider = provider;
 }
开发者ID:Rickinio,项目名称:roslyn,代码行数:8,代码来源:AbstractCallFinder.cs

示例2: MetadataDefinitionTreeItem

 public MetadataDefinitionTreeItem(Workspace workspace, ISymbol definition, ProjectId referencingProjectId, ushort glyphIndex)
     : base(glyphIndex)
 {
     _workspace = workspace;
     _referencingProjectId = referencingProjectId;
     _symbolKey = definition.GetSymbolKey();
     _assemblyName = definition.ContainingAssembly.ToDisplayString(SymbolDisplayFormat.MinimallyQualifiedFormat);
     _symbolDefinition = definition.ToDisplayString(definitionDisplayFormat);
     this.DisplayText = $"[{_assemblyName}] {_symbolDefinition}";
 }
开发者ID:ehsansajjad465,项目名称:roslyn,代码行数:10,代码来源:MetadataDefinitionTreeItem.cs

示例3: MetadataDefinitionItem

 public MetadataDefinitionItem(
     ImmutableArray<string> tags,
     ImmutableArray<TaggedText> displayParts,
     bool displayIfNoReferences,
     Solution solution, ISymbol definition)
     : base(tags, displayParts,
           GetOriginationParts(definition),
           ImmutableArray<DocumentLocation>.Empty,
           displayIfNoReferences)
 {
     _workspace = solution.Workspace;
     _symbolKey = definition.GetSymbolKey();
     _symbolAssemblyIdentity = definition.ContainingAssembly?.Identity;
 }
开发者ID:Rickinio,项目名称:roslyn,代码行数:14,代码来源:DefinitionItem.SymbolDefinitionItem.cs

示例4: CallHierarchyItem

 public CallHierarchyItem(ISymbol symbol, ProjectId projectId, IEnumerable<AbstractCallFinder> finders, Func<ImageSource> glyphCreator, CallHierarchyProvider provider, IEnumerable<Location> callsites, Workspace workspace)
 {
     _symbolId = symbol.GetSymbolKey();
     _projectId = projectId;
     _finders = finders;
     _containingTypeName = symbol.ContainingType.ToDisplayString(ContainingTypeFormat);
     _containingNamespaceName = symbol.ContainingNamespace.ToDisplayString(ContainingNamespaceFormat);
     _glyphCreator = glyphCreator;
     _name = symbol.ToDisplayString(MemberNameFormat);
     _provider = provider;
     _callsites = callsites.Select(l => new CallHierarchyDetail(l, workspace));
     _sortText = symbol.ToDisplayString();
     _workspace = workspace;
 }
开发者ID:GloryChou,项目名称:roslyn,代码行数:14,代码来源:CallHierarchyItem.cs

示例5: SymbolListItem

        protected SymbolListItem(ProjectId projectId, ISymbol symbol, string displayText, string fullNameText, string searchText, bool isHidden)
            : base(projectId, symbol.GetStandardGlyphGroup(), symbol.GetStandardGlyphItem(), isHidden)
        {
            _symbolKey = symbol.GetSymbolKey();
            _accessibility = symbol.DeclaredAccessibility;
            _displayText = displayText;
            _fullNameText = fullNameText;
            _searchText = searchText;

            _supportsGoToDefinition = symbol.Kind != SymbolKind.Namespace
                ? symbol.Locations.Any(l => l.IsInSource)
                : false;

            _supportsFindAllReferences = symbol.Kind != SymbolKind.Namespace;
        }
开发者ID:CAPCHIK,项目名称:roslyn,代码行数:15,代码来源:SymbolListItem.cs

示例6: AddNodeForSymbolAsync

        public async Task<GraphNode> AddNodeForSymbolAsync(ISymbol symbol, Project contextProject, Document contextDocument)
        {
            // Figure out what the location for this node should be. We'll arbitrarily pick the
            // first one, unless we have a contextDocument to restrict it
            var preferredLocation = symbol.Locations.FirstOrDefault(l => l.SourceTree != null);

            if (contextDocument != null)
            {
                var syntaxTree = await contextDocument.GetSyntaxTreeAsync(_cancellationToken).ConfigureAwait(false);

                // If we have one in that tree, use it
                preferredLocation = symbol.Locations.FirstOrDefault(l => l.SourceTree == syntaxTree) ?? preferredLocation;
            }

            // We may need to look up source code within this solution
            if (preferredLocation == null && symbol.Locations.Any(loc => loc.IsInMetadata))
            {
                var newSymbol = await SymbolFinder.FindSourceDefinitionAsync(symbol, contextProject.Solution, _cancellationToken).ConfigureAwait(false);
                if (newSymbol != null)
                {
                    preferredLocation = newSymbol.Locations.Where(loc => loc.IsInSource).FirstOrDefault();
                }
            }

            using (_gate.DisposableWait())
            {
                GraphNode node = await GetOrCreateNodeAsync(_graph, symbol, _solution, _cancellationToken).ConfigureAwait(false);

                node[RoslynGraphProperties.SymbolId] = (SymbolKey?)symbol.GetSymbolKey();
                node[RoslynGraphProperties.ContextProjectId] = GetContextProjectId(contextProject, symbol);
                node[RoslynGraphProperties.ExplicitInterfaceImplementations] = symbol.ExplicitInterfaceImplementations().Select(s => s.GetSymbolKey()).ToList();
                node[RoslynGraphProperties.DeclaredAccessibility] = symbol.DeclaredAccessibility;
                node[RoslynGraphProperties.SymbolModifiers] = symbol.GetSymbolModifiers();
                node[RoslynGraphProperties.SymbolKind] = symbol.Kind;

                if (contextDocument != null)
                {
                    node[RoslynGraphProperties.ContextDocumentId] = contextDocument.Id;
                }

                if (preferredLocation != null)
                {
                    var lineSpan = preferredLocation.GetLineSpan();
                    var sourceLocation = new SourceLocation(
                        preferredLocation.SourceTree.FilePath,
                        new Position(lineSpan.StartLinePosition.Line, lineSpan.StartLinePosition.Character),
                        new Position(lineSpan.EndLinePosition.Line, lineSpan.EndLinePosition.Character));
                    node[CodeNodeProperties.SourceLocation] = sourceLocation;
                }

                // Keep track of this as a node we have added. Note this is a HashSet, so if the node was already added
                // we won't double-count.
                _createdNodes.Add(node);

                _nodeToSymbolMap[node] = symbol;
                _nodeToContextProjectMap[node] = contextProject;
                _nodeToContextDocumentMap[node] = contextDocument;

                return node;
            }
        }
开发者ID:Rickinio,项目名称:roslyn,代码行数:61,代码来源:GraphBuilder.cs

示例7: CreateItemForMember

        private NavigationBarItem CreateItemForMember(ISymbol member, int symbolIndex, SyntaxTree tree, CancellationToken cancellationToken)
        {
            var spans = GetSpansInDocument(member, tree, cancellationToken);

            return new NavigationBarSymbolItem(
                member.ToDisplayString(s_memberFormat),
                member.GetGlyph(),
                spans,
                member.GetSymbolKey(),
                symbolIndex,
                grayed: spans.Count == 0);
        }
开发者ID:vslsnap,项目名称:roslyn,代码行数:12,代码来源:CSharpNavigationBarItemService.cs

示例8: CreateItem

            private MemberInsertionCompletionItem CreateItem(
                ISymbol symbol, TextSpan textChangeSpan, ISymbolDisplayService symbolDisplayService,
                SemanticModel semanticModel, SyntaxToken startToken, DeclarationModifiers modifiers)
            {
                var position = startToken.SpanStart;

                var displayString = symbolDisplayService.ToMinimalDisplayString(semanticModel, position, symbol, _overrideNameFormat);

                return new MemberInsertionCompletionItem(_provider,
                    displayString,
                    textChangeSpan,
                    CommonCompletionUtilities.CreateDescriptionFactory(_document.Project.Solution.Workspace, semanticModel, position, symbol),
                    symbol.GetGlyph(),
                    modifiers,
                    _startLineNumber,
                    symbol.GetSymbolKey(),
                    startToken);
            }
开发者ID:SoumikMukherjeeDOTNET,项目名称:roslyn,代码行数:18,代码来源:AbstractOverrideCompletionProvider.ItemGetter.cs


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