Skip to content

Commit

Permalink
Version 3.2:
Browse files Browse the repository at this point in the history
! Rearranged option pages for easier setup your syntax highlight settings
! Smart Bar was enabled by default
! Bug fixes and refactoring
  • Loading branch information
wmjordan committed Jun 16, 2018
1 parent f8911c9 commit 179891b
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 33 deletions.
21 changes: 10 additions & 11 deletions Codist/Classifiers/CSharpBlockTagger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using System.ComponentModel.Composition;
using System.Threading;
using System.Threading.Tasks;
using AppHelpers;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
Expand Down Expand Up @@ -158,18 +157,18 @@ static void ParseSyntaxNode(ITextSnapshot snapshot, SyntaxNode parentSyntaxNode,
}

foreach (var node in parentSyntaxNode.ChildNodes()) {
CodeMemberType type = MatchDeclaration(node);
if (type != CodeMemberType.Unknown) {
var name = ((node as BaseTypeDeclarationSyntax)?.Identifier ?? (node as MethodDeclarationSyntax)?.Identifier);
var child = new CodeBlock(parentCodeBlockNode, type, name?.Text, new SnapshotSpan(snapshot, node.SpanStart, node.Span.Length), level + 1);
if (type > CodeMemberType.Type) {
continue;
}
ParseSyntaxNode(snapshot, node, child, level + 1, token);
}
else {
var type = MatchDeclaration(node);
if (type == CodeMemberType.Unknown) {
ParseSyntaxNode(snapshot, node, parentCodeBlockNode, level, token);
continue;
}

var name = ((node as BaseTypeDeclarationSyntax)?.Identifier ?? (node as MethodDeclarationSyntax)?.Identifier);
var child = new CodeBlock(parentCodeBlockNode, type, name?.Text, new SnapshotSpan(snapshot, node.SpanStart, node.Span.Length), level + 1);
if (type > CodeMemberType.Type) {
continue;
}
ParseSyntaxNode(snapshot, node, child, level + 1, token);
}
}

Expand Down
34 changes: 14 additions & 20 deletions Codist/Classifiers/ICodeMemberTag.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,31 +15,25 @@ interface ICodeMemberTag : ITag

sealed class CodeBlock : ICodeMemberTag
{
readonly SnapshotSpan _Span;
readonly CodeBlock _Parent;
readonly List<CodeBlock> _Children = new List<CodeBlock>();
readonly CodeMemberType _MemberType;
readonly string _Name;
readonly int _Level;

public CodeBlock(CodeBlock parent, CodeMemberType type, string name, SnapshotSpan span, int level) {
_Parent = parent;
Parent = parent;
if (parent != null) {
parent._Children.Add(this);
parent.Children.Add(this);
}
_MemberType = type;
_Name = name;
_Span = span;
_Level = level;
Type = type;
Name = name;
Span = span;
Level = level;
}

public CodeBlock Parent => _Parent;
public IList<CodeBlock> Children => _Children;
public SnapshotSpan Span => _Span;
public CodeMemberType Type => _MemberType;
ICodeMemberTag ICodeMemberTag.Parent => _Parent;
public int Level => _Level;
public string Name => _Name;
public CodeBlock Parent { get; }
ICodeMemberTag ICodeMemberTag.Parent => Parent;
public IList<CodeBlock> Children { get; } = new List<CodeBlock>();
public SnapshotSpan Span { get; }
public CodeMemberType Type { get; }
public int Level { get; }

public string Name { get; }
}

enum CodeMemberType
Expand Down
2 changes: 1 addition & 1 deletion Codist/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: AssemblyVersion("3.0.0.0")]
[assembly: AssemblyFileVersion("3.1.0.1387")]
[assembly: AssemblyFileVersion("3.2.0.1392")]
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="3.1.0.1385" Language="en-US" Publisher="WMJ" />
<Identity Id="Codist.WMJ.c7b93d20-621f-4b21-9d28-d51157ef0b94" Version="3.2.0.1388" 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), Smart Bar, Code Structure Markers on scrollbar, comment tagger, and more.</Description>
<MoreInfo>https://github.com/wmjordan/Codist</MoreInfo>
Expand Down

0 comments on commit 179891b

Please sign in to comment.