Skip to content

Commit

Permalink
Version 2.9.2:
Browse files Browse the repository at this point in the history
+ Super Quick Info showed a context menu for symbols with multiple declaration locations
+ Super Quick Info showed attribute annotation parameter information
+ Added highlight for abstract keywords
+ Styled rendering for <c> in XML Doc
! Code refactoring and fixes
  • Loading branch information
wmjordan committed May 25, 2018
1 parent 6511442 commit ac36f53
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions Codist/Helpers/UIHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,6 @@ public static TElement LimitSize<TElement>(this TElement element)
}
if (Config.Instance.QuickInfoMaxHeight > 0) {
element.MaxHeight = Config.Instance.QuickInfoMaxHeight;
//element.MouseLeftButtonUp += (s, args) => (s as TElement).MaxHeight = Double.PositiveInfinity;
}
if (Config.Instance.QuickInfoMaxWidth > 0) {
element.MaxWidth = Config.Instance.QuickInfoMaxWidth;
Expand Down Expand Up @@ -334,8 +333,9 @@ public static TParent GetVisualParent<TParent>(this DependencyObject obj)
public static DependencyObject GetLogicalParent(this DependencyObject obj) {
return LogicalTreeHelper.GetParent(obj);
}
public static ContextMenu CreateContextMenuForSourceLocations(ImmutableArray<SyntaxReference> refs) {
public static ContextMenu CreateContextMenuForSourceLocations(string symbolName, ImmutableArray<SyntaxReference> refs) {
var menu = new ContextMenu();
menu.Items.Add(new MenuItem { Header = symbolName + " is defined in " + refs.Length.ToString() + " places", IsEnabled = false });
foreach (var loc in refs) {
var pos = loc.SyntaxTree.GetLineSpan(loc.Span);
var item = new MenuItem { Header = System.IO.Path.GetFileName(loc.SyntaxTree.FilePath) + "(line: " + (pos.StartLinePosition.Line + 1).ToString() + ")", Tag = loc };
Expand Down Expand Up @@ -374,7 +374,7 @@ void GotoSymbol(object sender, MouseButtonEventArgs e) {
}
else {
if (ContextMenu == null) {
ContextMenu = CreateContextMenuForSourceLocations(_References);
ContextMenu = CreateContextMenuForSourceLocations(_Symbol.MetadataName, _References);
}
ContextMenu.IsOpen = true;
}
Expand Down
2 changes: 1 addition & 1 deletion Codist/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.9.0.0")]
[assembly: AssemblyFileVersion("2.9.1.1097")]
[assembly: AssemblyFileVersion("2.9.2.1103")]
12 changes: 6 additions & 6 deletions Codist/QuickInfo/CSharpQuickInfoSourceProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,10 @@ void OverrideDocumentation(SyntaxNode node, DefaultQuickInfoPanelWrapper qiWrapp
var docRenderer = new XmlDocRenderer(_SemanticModel.Compilation, _SymbolFormatter);
var info = new TextBlock { TextWrapping = TextWrapping.Wrap }
.AddText("Documentation from ")
.AddSymbolDisplayParts(baseMember.ContainingType.ToMinimalDisplayParts(_SemanticModel, node.SpanStart), _SymbolFormatter)
.AddSymbol(baseMember.ContainingType, null, _SymbolFormatter)
.AddText(".")
.AddSymbol(baseMember, null, _SymbolFormatter)
.AddText(": ");
.AddText(":\n");
docRenderer.Render(doc, info.Inlines);
if (Config.Instance.QuickInfoOptions.MatchFlags(QuickInfoOptions.ReturnsDoc)) {
RenderXmlReturnsDoc(baseMember, doc.Parent, info, docRenderer);
Expand Down Expand Up @@ -743,20 +743,20 @@ static void ShowAttributes(IList<object> qiContent, ImmutableArray<AttributeData
}
}

void ShowBaseType(IList<object> qiContent, ITypeSymbol typeSymbol, int position) {
static void ShowBaseType(IList<object> qiContent, ITypeSymbol typeSymbol, int position) {
var baseType = typeSymbol.BaseType;
if (baseType == null || baseType.IsCommonClass() != false) {
return;
}
var info = new TextBlock()
.AddText("Base type: ", true)
.AddSymbolDisplayParts(baseType.ToMinimalDisplayParts(_SemanticModel, position), _SymbolFormatter);
.AddSymbol(baseType, null, _SymbolFormatter.Class);
while (Config.Instance.QuickInfoOptions.MatchFlags(QuickInfoOptions.BaseTypeInheritence) && (baseType = baseType.BaseType) != null) {
if (baseType.IsAccessible() && baseType.IsCommonClass() == false) {
info.AddText(" - ").AddSymbol(baseType, false, _SymbolFormatter.Class);
info.AddText(" - ").AddSymbol(baseType, null, _SymbolFormatter.Class);
}
}
qiContent.Add(info);
qiContent.Add(info.LimitSize());
}

void ShowEnumInfo(IList<object> qiContent, SyntaxNode node, INamedTypeSymbol type, bool fromEnum) {
Expand Down
2 changes: 1 addition & 1 deletion Codist/QuickInfo/QuickInfoOverrider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public void ApplyClickAndGo(ISymbol symbol) {
description.MouseLeftButtonUp += (s, args) => {
var tb = (s as TextBlock);
if (tb.ContextMenu == null) {
tb.ContextMenu = UIHelper.CreateContextMenuForSourceLocations(locs);
tb.ContextMenu = UIHelper.CreateContextMenuForSourceLocations(symbol.MetadataName, locs);
}
tb.ContextMenu.IsOpen = true;
};
Expand Down
2 changes: 1 addition & 1 deletion Codist/source.extension.vsixmanifest
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
<Metadata>
<Identity Id="Codist.WMJ.c7b93d20-621f-4b21-9d28-d51157ef0b94" Version="2.9.1.1097" Language="en-US" Publisher="WMJ" />
<Identity Id="Codist.WMJ.c7b93d20-621f-4b21-9d28-d51157ef0b94" Version="2.9.2.1101" Language="en-US" Publisher="WMJ" />
<DisplayName>Codist</DisplayName>
<Description xml:space="preserve">A Roslyn-powered C# coding experience enhancer with advanced syntax highlight, Super Quick Info (code tooltip), scrollbar code structure marker, comment tagger, and more.</Description>
<MoreInfo>https://github.com/wmjordan/Codist</MoreInfo>
Expand Down

0 comments on commit ac36f53

Please sign in to comment.