예제 #1
0
        private IdentifierTooltipContent TryPresentColorized(PresentableNode presentableNode, [NotNull] IContextBoundSettingsStore settings)
        {
            ITreeNode node = presentableNode.Node;

            if (node == null)
            {
                return(null);
            }

            HighlighterIdProvider highlighterIdProvider = _highlighterIdProviderFactory.CreateProvider(settings);

            RichText identifierText = _colorizerPresenter.TryPresent(
                node,
                PresenterOptions.ForIdentifierToolTip(settings, true),
                node.Language,
                highlighterIdProvider);

            if (identifierText == null || identifierText.IsEmpty)
            {
                return(null);
            }

            var identifierContent = new IdentifierTooltipContent(identifierText, node.GetDocumentRange().TextRange);

            if (settings.GetValue((IdentifierTooltipSettings s) => s.ShowIcon))
            {
                identifierContent.Icon = presentableNode.Icon;
            }

            return(identifierContent);
        }
예제 #2
0
 public PresentableInfo(PresentableNode presentableNode)
 {
     DeclaredElementInfo = null;
     PresentableNode     = presentableNode;
 }
예제 #3
0
 public PresentableInfo([CanBeNull] DeclaredElementInfo declaredElementInfo)
 {
     DeclaredElementInfo = declaredElementInfo;
     PresentableNode     = default;
 }