Skip to content

Commit

Permalink
! Removed "abstract" from modifiers of interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
wmjordan committed Mar 21, 2019
1 parent f8bbc1d commit 05f4a18
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Codist/Controls/ThemedText.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public ThemedTipParagraph(int iconId) : this(iconId, null) {
public ThemedTipParagraph(TextBlock content) : this(0, content) {
}
public Image Icon => Children[0] as Image;
public TextBlock Content { get; private set; }
public TextBlock Content { get; }
}
sealed class ThemedToolBarText : TextBlock
{
Expand Down
2 changes: 1 addition & 1 deletion Codist/Helpers/CodeAnalysisHelper.Symbol.cs
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ public static string GetAssemblyModuleName(this ISymbol symbol) {

#region Symbol information
public static string GetAbstractionModifier(this ISymbol symbol) {
if (symbol.IsAbstract) {
if (symbol.IsAbstract && (symbol.Kind != SymbolKind.NamedType || (symbol as INamedTypeSymbol).TypeKind != TypeKind.Interface)) {
return "abstract ";
}
else if (symbol.IsStatic) {
Expand Down
10 changes: 4 additions & 6 deletions Codist/QuickInfo/CSharpQuickInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,6 @@ void OverrideDocumentation(SyntaxNode node, IQuickInfoOverrider qiWrapper, ISymb
if (Config.Instance.QuickInfoOptions.MatchFlags(QuickInfoOptions.ExceptionDoc)
&& (symbol.Kind == SymbolKind.Method || symbol.Kind == SymbolKind.Property || symbol.Kind == SymbolKind.Event)
&& doc.Exceptions != null) {
var exceptions = doc.Exceptions;
var p = new ThemedTipParagraph(KnownImageIds.StatusInvalidOutline, new ThemedTipText("Exception:", true));
foreach (var ex in doc.Exceptions) {
var et = ex.Attribute("cref");
Expand Down Expand Up @@ -375,7 +374,7 @@ void ShowSymbolInfo(IList<object> qiContent, SyntaxNode node, ISymbol symbol) {
if (Config.Instance.QuickInfoOptions.MatchFlags(QuickInfoOptions.Attributes)) {
ShowAttributesInfo(qiContent, symbol.ContainingType);
}
ShowTypeInfo(qiContent, node.Parent, symbol.ContainingType as INamedTypeSymbol);
ShowTypeInfo(qiContent, node.Parent, symbol.ContainingType);
}
if (Config.Instance.QuickInfoOptions.MatchFlags(QuickInfoOptions.Color) && m.ContainingType.Name == "Color") {
var preview = ColorQuickInfo.PreviewColorMethodInvocation(_SemanticModel, node, symbol as IMethodSymbol);
Expand Down Expand Up @@ -688,7 +687,7 @@ static void ShowConstInfo(IList<object> qiContent, ISymbol symbol, object value)

static void ShowInterfaceImplementation<TSymbol>(IList<object> qiContent, TSymbol symbol, IEnumerable<TSymbol> explicitImplementations)
where TSymbol : class, ISymbol {
if (symbol.IsStatic || symbol.DeclaredAccessibility != Accessibility.Public && explicitImplementations.FirstOrDefault() == null) {
if (symbol.IsStatic || symbol.DeclaredAccessibility != Accessibility.Public && explicitImplementations.Any() == false) {
return;
}
var interfaces = symbol.ContainingType.AllInterfaces;
Expand Down Expand Up @@ -946,7 +945,7 @@ static void ShowEnumInfo(IList<object> qiContent, INamedTypeSymbol type, bool fr
.Append(max.ToString() + "(")
.Append(maxName.Name, _SymbolFormatter.Enum)
.Append(")");
if (type.GetAttributes().FirstOrDefault(a => a.AttributeClass.ToDisplayString() == "System.FlagsAttribute") != null) {
if (type.GetAttributes().Any(a => a.AttributeClass.ToDisplayString() == "System.FlagsAttribute")) {
var d = Convert.ToString(Convert.ToInt64(bits), 2);
content.AppendLine().Append("All flags: ", true)
.Append(d)
Expand Down Expand Up @@ -1173,11 +1172,10 @@ static string ToHexString(byte[] bytes) {
}

static StackPanel ShowNumericForms(string dec, byte[] bytes) {
var s = new StackPanel()
return new StackPanel()
.Add(new StackPanel().MakeHorizontal().AddReadOnlyTextBox(dec).Add(new ThemedTipText(" DEC", true)))
.Add(new StackPanel().MakeHorizontal().AddReadOnlyTextBox(ToHexString(bytes)).Add(new ThemedTipText(" HEX", true)))
.Add(new StackPanel().MakeHorizontal().AddReadOnlyTextBox(ToBinString(bytes)).Add(new ThemedTipText(" BIN", true)));
return s;
}

static TextBlock ToUIText(ISymbol symbol) {
Expand Down

0 comments on commit 05f4a18

Please sign in to comment.