Skip to content

Commit

Permalink
Version 7.2
Browse files Browse the repository at this point in the history
  • Loading branch information
wmjordan committed Mar 17, 2023
1 parent 40222cb commit 8107eb5
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 20 deletions.
2 changes: 1 addition & 1 deletion Codist/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace Codist
{
sealed class Config
{
internal const string CurrentVersion = "7.1.0";
internal const string CurrentVersion = "7.2.0";
const string ThemePrefix = "res:";
const int DefaultIconSize = 20;
internal const string LightTheme = ThemePrefix + "Light",
Expand Down
8 changes: 3 additions & 5 deletions Codist/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ public static class EditorProperties
public const string CodeSymbolReference = PredefinedClassificationTypeNames.SymbolReference;
public const string CodeUrl = "url";
public const string CodeFormalLanguage = PredefinedClassificationTypeNames.FormalLanguage;
#region Format names introduced in VS 2019
public const string CodeOverloadedOperator = "operator - overloaded";
public const string CodeStringEscapeCharacter = "string - escape character";
public const string CodeKeywordControl = "keyword - control";
Expand All @@ -120,7 +119,6 @@ public static class EditorProperties
public const string CodeStaticSymbol = "static symbol";
public const string CodeLabelName = "label name";
public const string CodeNavigableSymbol = "navigableSymbol";
#endregion

public const string XmlDocAttributeName = "xml doc comment - attribute name";
public const string XmlDocAttributeQuotes = "xml doc comment - attribute quotes";
Expand All @@ -131,9 +129,9 @@ public static class EditorProperties
public const string XmlDocEntity = "xml doc comment - entity reference";
public const string XmlDocTag = "xml doc comment - name";

public const string MarkupAttribute = "markup attribute";
public const string MarkupAttributeValue = "markup attribute value";
public const string MarkupNode = "markup node";
public const string MarkupAttribute = PredefinedClassificationTypeNames.MarkupAttribute;
public const string MarkupAttributeValue = PredefinedClassificationTypeNames.MarkupAttributeValue;
public const string MarkupNode = PredefinedClassificationTypeNames.MarkupNode;

public const string CSharpLocalVariableName = "C#: Local variable";
public const string CSharpParameterName = "C#: Parameter";
Expand Down
23 changes: 23 additions & 0 deletions Codist/Helpers/CodeAnalysisHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -346,11 +346,17 @@ public static bool IsTopmostIf(this IfStatementSyntax ifs) {
return ifs?.Parent.IsKind(SyntaxKind.ElseClause) != true;
}

/// <summary>
/// Returns whether a <see cref="SyntaxNode"/> spans multiple lines.
/// </summary>
public static bool IsMultiLine(this SyntaxNode node, bool includeTrivia) {
var lines = node.SyntaxTree.GetText().Lines;
var span = includeTrivia ? node.FullSpan : node.Span;
return lines.GetLineFromPosition(span.Start).SpanIncludingLineBreak.Contains(span.End) == false;
}
/// <summary>
/// Returns whether a <see cref="SyntaxTriviaList"/> spans multiple lines.
/// </summary>
public static bool IsMultiline(this SyntaxTriviaList triviaList) {
foreach (var item in triviaList) {
if (item.IsKind(SyntaxKind.EndOfLineTrivia)) {
Expand All @@ -368,6 +374,23 @@ public static bool IsAssignedToSameTarget(this StatementSyntax statement, Statem
&& a.OperatorToken.IsKind(ea.OperatorToken.Kind())
&& SyntaxFactory.AreEquivalent(a.Left, ea.Left);
}

public static SyntaxTriviaList GetNonDirectiveLeadingTrivia(this SyntaxNode node) {
return node.HasLeadingTrivia == false
? default
: node.GetLeadingTrivia().GetNonDirectiveTrivia();
}

public static SyntaxTriviaList GetNonDirectiveTrivia(this SyntaxTriviaList list) {
int i;
for (i = list.Count - 1; i >= 0; i--) {
if (list[i].IsDirective == false) {
continue;
}
break;
}
return i == 0 ? list : new SyntaxTriviaList(list.Skip(i));
}
#endregion

#region Node icon
Expand Down
6 changes: 3 additions & 3 deletions Codist/Helpers/TextEditorHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -962,12 +962,12 @@ public static void CopySelectionWithoutIndentation(this ITextView view) {
) {
goto BUILTIN_COPY;
}
var selection = view.FirstSelectionSpan();

ITextSnapshot snapshot = view.TextBuffer.CurrentSnapshot;
ITextSnapshotLine startLine, endLine;
var snapshot = view.TextBuffer.CurrentSnapshot;
var selection = view.FirstSelectionSpan();
var startOfSelection = selection.Start.Position;
var endOfSelection = selection.End.Position;
ITextSnapshotLine startLine, endLine;
if (((startLine = snapshot.GetLineFromPosition(startOfSelection)) == null)
|| (endLine = snapshot.GetLineFromPosition(endOfSelection)) == startLine) {
goto BUILTIN_COPY;
Expand Down
4 changes: 2 additions & 2 deletions Codist/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
[assembly: AssemblyCopyright("Copyright WMJ, 2023")]
[assembly: AssemblyTrademark(nameof(Codist))]
[assembly: ComVisible(false)]
[assembly: AssemblyVersion("7.1.0.0")]
[assembly: AssemblyFileVersion(Codist.Config.CurrentVersion + ".8100")]
[assembly: AssemblyVersion("7.2.0.0")]
[assembly: AssemblyFileVersion(Codist.Config.CurrentVersion + ".8300")]
[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
4 changes: 3 additions & 1 deletion Codist/Taggers/TaggerFactories.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,16 @@ public ITagger<T> CreateTagger<T>(ITextBuffer buffer) where T : ITag {
[TagType(typeof(IClassificationTag))]
sealed class CSharpTaggerProvider : IViewTaggerProvider
{
readonly Dictionary<ITextView, CSharpTagger> _Taggers = new Dictionary<ITextView, CSharpTagger>();
static readonly string[] __TaggableRoles = new[] { PredefinedTextViewRoles.Document, PredefinedTextViewRoles.EmbeddedPeekTextView };

readonly Dictionary<ITextView, CSharpTagger> _Taggers = new Dictionary<ITextView, CSharpTagger>();

// note: cache the latest used tagger to improve performance
// In C# code editor, even displaying the Quick Info will call the CreateTagger method,
// thus we cache the last accessed tagger, identified by ITextView and ITextBuffer,
// in CSharpTaggerProvider and CSharpTagger respectively, to avoid dictionary lookup
CSharpTagger _LastTagger;

// for debug info
int _taggerCount;

Expand Down
4 changes: 2 additions & 2 deletions Codist/source.extension.vsixmanifest
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?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="7.1.0.8139" Language="en-US" Publisher="WMJ" />
<Identity Id="Codist.WMJ.c7b93d20-621f-4b21-9d28-d51157ef0b94" Version="7.2.0.8376" Language="en-US" Publisher="WMJ" />
<DisplayName>Codist</DisplayName>
<Description xml:space="preserve">A C# programmer's productivity booster which enhances syntax highlighting, quick info (tooltip), navigation bar, scrollbar, display quality, automatically updated version numbers, and brings smart tool bar to code editor.</Description>
<Description xml:space="preserve">A C# programmer's productivity booster which enhances syntax highlighting, quick info (tooltip), navigation bar, scrollbar, display quality, automatically updated version numbers, and brings smart tool bar with advanced editing commands, code analasis and refactoring to code editor.</Description>
<MoreInfo>https://github.com/wmjordan/Codist</MoreInfo>
<License>license.txt</License>
<ReleaseNotes>https://github.com/wmjordan/Codist/releases</ReleaseNotes>
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ Here's a brief but not complete demonstration of *Codist*'s enhancement to Visua
Check out this list to see what _Codist_ can do for you.

* [Advanced Syntax Highlight](#advanced-c-syntax-highlight) ANY LANGUAGES, and [*Comment Tagger*](#comment-tagger-and-styles) highlights `to-do` style comments
![](doc/feature-brief-syntax-highlight.png)
![](doc/feature-brief-syntax-highlight.png)
* [Super Quick Info](#super-quick-info) with extended XML Doc, symbol tool-tips, selectable contents, appearance customization, etc.
![Feature Brief Super Quick Info](doc/feature-brief-super-quick-info.png)
![Feature Brief Super Quick Info](doc/feature-brief-super-quick-info.png)
* [Navigation Bar](#navigation-bar) with a drag-and-drop and filter enabled member list
![Feature Brief Navigation Bar](doc/feature-brief-navigation-bar.png)
![Feature Brief Navigation Bar](doc/feature-brief-navigation-bar.png)
* [Smart Bar](#smart-bar) with common edit commands, C# code refactoring and symbol reference analyzers
![Feature Brief Smart Bar](doc/feature-brief-smart-bar.png)
![Feature Brief Smart Bar](doc/feature-brief-smart-bar.png)
* [Scrollbar Marker](#scrollbar-marker) draws a powerful mini code map
![Feature Brief Scrollbar Marker](doc/feature-brief-scrollbar-marker.png)
![Feature Brief Scrollbar Marker](doc/feature-brief-scrollbar-marker.png)
* [Auto Changing Version Numbers](#auto-changing-version-numbers)
* [Display Enhancements](#display-enhancements)
* [Jump List Shortcuts](#jump-list-shortcuts)
Expand Down Expand Up @@ -555,7 +555,7 @@ I have learned a lot from the following extension projects (sorted by the time w
* ReviewBoard: code.google.com/p/reviewboardvsx
* [Tweaks](https://github.com/madskristensen/Tweakster): VS tweaks
* [VsStatus](https://github.com/madskristensen/VsStatus): hacking the status bar
* [Roslynator](https://github.com/JosefPihrt/Roslynator): hundreds of code refactorings and analyses
* [Roslynator](https://github.com/JosefPihrt/Roslynator): hundreds of code refactorings and analyzers
* [ShowTheShortcut](https://github.com/madskristensen/ShowTheShortcut): discovering identifiers of executed commands
* [Copy Nice](https://marketplace.visualstudio.com/items?itemName=MadsKristensen.CopyNice): copying text without indentation

Expand Down

0 comments on commit 8107eb5

Please sign in to comment.