/// <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) }; }
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)); }
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); }
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"); }