Skip to content

Commit

Permalink
- added many colorizings in tooltip documentations
Browse files Browse the repository at this point in the history
- fixed some elements that should not reach the tooltip
  • Loading branch information
DimitarCC committed Aug 24, 2023
1 parent d37e657 commit 49f6eda
Show file tree
Hide file tree
Showing 10 changed files with 1,498 additions and 1,261 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ public static void AppendAccessorName(this CSharpColorizer colorizer, string? ac
public static void AppendElementKind(this CSharpColorizer colorizer, IDeclaredElement? element)
=> colorizer.AppendText(element.GetElementKindString(false, false, false, false, false), null);

public static void AppendParameterName(this CSharpColorizer colorizer, string? parameterName)
=> colorizer.AppendText(parameterName, colorizer.HighlighterIdProvider.Parameter);

public static void AppendCandidates(this CSharpColorizer colorizer, IReference? reference) {
if (reference is null)
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ namespace GammaJul.ReSharper.EnhancedTooltip.Presentation {

public sealed class ExceptionContent {

public string Exception { get; }
public RichText? Exception { get; }

public RichText? Description { get; set; }

public ExceptionContent(string exception) {
public ExceptionContent(RichText? exception) {
Exception = exception;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,21 @@

namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings {

[SolutionComponent]
public sealed class HighlightingEnhancerManager {

private readonly Dictionary<Type, IHighlightingEnhancer> _highlightingEnhancers;

public RichText? TryEnhance(IHighlighting? highlighting, IContextBoundSettingsStore settings) {
if (highlighting is null || !_highlightingEnhancers.TryGetValue(highlighting.GetType(), out IHighlightingEnhancer highlightingEnhancer))
return null;

return highlightingEnhancer.TryEnhance(highlighting, settings);
}

public HighlightingEnhancerManager(IEnumerable<IHighlightingEnhancer> highlightingEnhancers) {
_highlightingEnhancers = highlightingEnhancers.ToDictionary(he => he.HighlightingType);
}

}
[SolutionComponent]
public sealed class HighlightingEnhancerManager {
private readonly Dictionary<Type, IHighlightingEnhancer> _HighlightingEnhancers;
public RichText? TryEnhance(IHighlighting? highlighting, IContextBoundSettingsStore settings) {
if (highlighting is null || !this._HighlightingEnhancers.TryGetValue(highlighting.GetType(), out IHighlightingEnhancer highlightingEnhancer)) {
return null;
}

return highlightingEnhancer.TryEnhance(highlighting, settings);
}

public HighlightingEnhancerManager(IEnumerable<IHighlightingEnhancer> highlightingEnhancers) {
this._HighlightingEnhancers = highlightingEnhancers.ToDictionary(he => he.HighlightingType);
}

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ namespace GammaJul.ReSharper.EnhancedTooltip.Presentation {

public sealed class ParamContent {

public string Name { get; }
public RichText Name { get; }

public RichText? Description { get; set; }

public ParamContent(string name) {
public ParamContent(RichText name) {
Name = name;
}

Expand Down
Loading

0 comments on commit 49f6eda

Please sign in to comment.