/// <summary>
 /// Returns a WhyBulb for the given highlighting.
 /// </summary>
 /// <param name="highlighting">Highlighting to process.</param>
 /// <param name="highlightingRange">Hihglighting range - not used here.</param>
 /// <returns></returns>
 public ICollection<IDisableHighlightingAction> Actions(IHighlighting highlighting, DocumentRange highlightingRange)
 {
     var cSharpHighlighting = highlighting as CSharpHighlightingBase;
     return (cSharpHighlighting == null)
                ? EmptyArray<IDisableHighlightingAction>.Instance
                : new IDisableHighlightingAction[] { new WhyBulb(highlighting.ErrorStripeToolTip, highlighting.GetType().Name) };
 }
Exemple #2
0
        public RichText TryEnhance([CanBeNull] IHighlighting highlighting, [NotNull] IContextBoundSettingsStore settings)
        {
            if (highlighting == null || !_highlightingEnhancers.TryGetValue(highlighting.GetType(), out IHighlightingEnhancer highlightingEnhancer))
            {
                return(null);
            }

            return(highlightingEnhancer.TryEnhance(highlighting, settings));
        }
Exemple #3
0
        private static PsiLanguageType TryGetIdentifierLanguage([NotNull] IHighlighting highlighting)
        {
            var attribute = highlighting.GetType().GetCustomAttribute <DaemonTooltipProviderAttribute>();

            if (attribute == null || attribute.Type == null)
            {
                return(null);
            }

            for (Type type = attribute.Type; type != typeof(object) && type != null; type = type.BaseType)
            {
                if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(IdentifierTooltipProvider <>))
                {
                    Type langType = type.GetGenericArguments()[0];
                    return(Languages.Instance.All.FirstOrDefault(lang => lang.GetType() == langType));
                }
            }
            return(null);
        }
Exemple #4
0
 protected override bool HighlightingPredicate(IHighlighting highlighting, IPsiSourceFile sourceFile)
 {
     return(highlighting.GetType().Namespace.Contains("TestCop"));
 }
 protected override bool HighlightingPredicate(IHighlighting highlighting, IPsiSourceFile sourceFile)
 {
     // TODO: highlighting is CodeFoldingHighlighting
     return(highlighting.GetType().Name == "CodeFoldingHighlighting");
 }
 protected override bool HighlightingPredicate(IHighlighting highlighting, IPsiSourceFile sourceFile)
 {
     // TODO: highlighting is ReSharperSyntaxHighlighting
     return(highlighting.GetType().Name == "ReSharperSyntaxHighlighting");
 }
 protected override bool HighlightingPredicate(IHighlighting highlighting, IPsiSourceFile sourceFile, IContextBoundSettingsStore settingsStore)
 {
     return highlighting.GetType().FullName.Contains("TestCop");
 }