Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: wmjordan/Codist
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v4.3
Choose a base ref
...
head repository: wmjordan/Codist
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref

Commits on Dec 11, 2018

  1. Copy the full SHA
    ac5d2b0 View commit details

Commits on Dec 12, 2018

  1. Copy the full SHA
    1ae4366 View commit details
  2. Copy the full SHA
    14bf718 View commit details
  3. Copy the full SHA
    92e3502 View commit details

Commits on Dec 14, 2018

  1. Copy the full SHA
    3284c32 View commit details
  2. Copy the full SHA
    40dc041 View commit details
  3. Copy the full SHA
    6d06d79 View commit details

Commits on Dec 15, 2018

  1. Copy the full SHA
    1fd9224 View commit details

Commits on Dec 16, 2018

  1. Copy the full SHA
    e0d0254 View commit details
  2. Copy the full SHA
    e19ceb2 View commit details
  3. Copy the full SHA
    234cd9b View commit details

Commits on Dec 17, 2018

  1. ! Navigated to symbol declaration identifier instead of the start of …

    …node span when items in Navi Bar was clicked
    wmjordan committed Dec 17, 2018
    Copy the full SHA
    248d9e0 View commit details
  2. ! Code clean up

    wmjordan committed Dec 17, 2018
    Copy the full SHA
    596866c View commit details
  3. Copy the full SHA
    1999278 View commit details
  4. Copy the full SHA
    050415a View commit details
  5. Copy the full SHA
    cbc9f63 View commit details

Commits on Dec 18, 2018

  1. Copy the full SHA
    25d192b View commit details
  2. Copy the full SHA
    57de934 View commit details
  3. Copy the full SHA
    cb3acff View commit details
  4. - Fixed a crash in Navi Bar #64

    wmjordan committed Dec 18, 2018
    Copy the full SHA
    f1d011f View commit details

Commits on Dec 20, 2018

  1. Copy the full SHA
    f2f1e25 View commit details
  2. ! Code refactoring

    wmjordan committed Dec 20, 2018
    Copy the full SHA
    e99c890 View commit details
  3. Copy the full SHA
    9c68d90 View commit details
  4. Copy the full SHA
    80053ac View commit details
  5. Copy the full SHA
    538c5b6 View commit details
  6. Copy the full SHA
    b156948 View commit details

Commits on Dec 21, 2018

  1. Copy the full SHA
    69c6107 View commit details
  2. ! Added notice in syntax highlight options page due to #14 (Syntax hi…

    …ghlight theme could not be correctly applied after VS theme was changed)
    wmjordan committed Dec 21, 2018
    Copy the full SHA
    afb4c87 View commit details
  3. ! Removed all italic related styles in preset files due to poor textu…

    …al rendition of italic fonts on Windows
    wmjordan committed Dec 21, 2018
    Copy the full SHA
    de7e96d View commit details
  4. Version 4.4:

    ! Redesigned Navi Bar
    + Showed property initialization and expression on Navi Bar menu
    + Added command Ctrl+` to access Search Declaration menu in the Navi Bar
    + Added Smart Bar and open path feature for interactive, output, debugger output, debugger immediate, find results windows
    + Added Find Symbol Named ... command to C# Smart Bar
    + Added Smart Bar buttons for C/C++ code file type
    - Fixed the conflict between syntax highlight and break point highlight
    ! Optimized the display of Syntax Highlight options page
    - Fixed a crash on opening file
    ! Optimized default syntax highlight themes
    wmjordan committed Dec 21, 2018
    Copy the full SHA
    c660485 View commit details

Commits on Dec 22, 2018

  1. Copy the full SHA
    fdebbfb View commit details
  2. Copy the full SHA
    38a70b1 View commit details
  3. Copy the full SHA
    2206814 View commit details

Commits on Dec 23, 2018

  1. Copy the full SHA
    7ef967b View commit details

Commits on Dec 24, 2018

  1. + Added project info page

    wmjordan committed Dec 24, 2018
    Copy the full SHA
    7fdd2cf View commit details

Commits on Dec 26, 2018

  1. Copy the full SHA
    f7926ea View commit details

Commits on Dec 29, 2018

  1. Copy the full SHA
    8156270 View commit details
  2. - Fixed incorrect association of Smart Bar options page and Syntax Hi…

    …ghlight feature option
    wmjordan committed Dec 29, 2018
    Copy the full SHA
    46d1a79 View commit details
  3. Copy the full SHA
    f2aed1b View commit details
  4. + Option to show #region name on Navigation Bar

    + Added command for regional directives on Smart Bar
    wmjordan committed Dec 29, 2018
    Copy the full SHA
    293b968 View commit details
  5. Copy the full SHA
    5b2248f View commit details
  6. Copy the full SHA
    4de6c26 View commit details
  7. + Displayed type parameter XML Doc

    - Fixed display <returns> and <remarks> options not working in Smart Bar
    wmjordan committed Dec 29, 2018
    Copy the full SHA
    f0b0e91 View commit details
  8. ! Code clean up

    wmjordan committed Dec 29, 2018
    Copy the full SHA
    b385d51 View commit details

Commits on Jan 1, 2019

  1. ! Redesigned Super Quick Info

    + Made text in Super Quick Info selectable (right click to copy)
    - Fixed potential crash in Quick Info introduced in previous version
    wmjordan committed Jan 1, 2019
    Copy the full SHA
    61b7e0b View commit details

Commits on Jan 2, 2019

  1. Copy the full SHA
    cdd6c38 View commit details
  2. Copy the full SHA
    af1efa6 View commit details

Commits on Jan 3, 2019

  1. ! Simplified code

    wmjordan committed Jan 3, 2019
    Copy the full SHA
    bdb0f87 View commit details
  2. ! Updated theme files

    wmjordan committed Jan 3, 2019
    Copy the full SHA
    042b35f View commit details
  3. Copy the full SHA
    2a65b0b View commit details
Showing 450 changed files with 78,578 additions and 19,552 deletions.
19 changes: 17 additions & 2 deletions Codist.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27130.2020
# Visual Studio Version 17
VisualStudioVersion = 17.5.33402.96
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Codist", "Codist\Codist.csproj", "{357D8F0C-57B1-4981-949D-204FEE0EC424}"
EndProject
@@ -14,25 +14,40 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Misc", "Misc", "{CA2E0B7E-1
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestProject", "TestProject\TestProject.csproj", "{A271AA17-5C0A-44DF-BBC7-BC54CDB5FCC3}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestProject2", "TestProject2\TestProject2.csproj", "{F83EC41E-0478-411F-96B9-F2B86D76A69F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
ReleaseLogged|Any CPU = ReleaseLogged|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{357D8F0C-57B1-4981-949D-204FEE0EC424}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{357D8F0C-57B1-4981-949D-204FEE0EC424}.Debug|Any CPU.Build.0 = Debug|Any CPU
{357D8F0C-57B1-4981-949D-204FEE0EC424}.Release|Any CPU.ActiveCfg = Release|Any CPU
{357D8F0C-57B1-4981-949D-204FEE0EC424}.Release|Any CPU.Build.0 = Release|Any CPU
{357D8F0C-57B1-4981-949D-204FEE0EC424}.ReleaseLogged|Any CPU.ActiveCfg = ReleaseLogged|arm64
{357D8F0C-57B1-4981-949D-204FEE0EC424}.ReleaseLogged|Any CPU.Build.0 = ReleaseLogged|arm64
{A271AA17-5C0A-44DF-BBC7-BC54CDB5FCC3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A271AA17-5C0A-44DF-BBC7-BC54CDB5FCC3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A271AA17-5C0A-44DF-BBC7-BC54CDB5FCC3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A271AA17-5C0A-44DF-BBC7-BC54CDB5FCC3}.Release|Any CPU.Build.0 = Release|Any CPU
{A271AA17-5C0A-44DF-BBC7-BC54CDB5FCC3}.ReleaseLogged|Any CPU.ActiveCfg = Release|Any CPU
{A271AA17-5C0A-44DF-BBC7-BC54CDB5FCC3}.ReleaseLogged|Any CPU.Build.0 = Release|Any CPU
{F83EC41E-0478-411F-96B9-F2B86D76A69F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F83EC41E-0478-411F-96B9-F2B86D76A69F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F83EC41E-0478-411F-96B9-F2B86D76A69F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F83EC41E-0478-411F-96B9-F2B86D76A69F}.Release|Any CPU.Build.0 = Release|Any CPU
{F83EC41E-0478-411F-96B9-F2B86D76A69F}.ReleaseLogged|Any CPU.ActiveCfg = Release|Any CPU
{F83EC41E-0478-411F-96B9-F2B86D76A69F}.ReleaseLogged|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
RESX_CodeReferences = {"Items":[{"Expression":"\\W($File.$Key)\\W","Extensions":".cs,.xaml,.cshtml","IsCaseSensitive":true,"SingleLineComment":"\/\/"},{"Expression":"\\W($File.$Key)\\W","Extensions":".vbhtml","IsCaseSensitive":false,"SingleLineComment":null},{"Expression":"ResourceManager.GetString\\(\"($Key)\"\\)","Extensions":".cs","IsCaseSensitive":true,"SingleLineComment":"\/\/"},{"Expression":"typeof\\((\\w+\\.)*($File)\\).+\"($Key)\"|\"($Key)\".+typeof\\((\\w+\\.)*($File)\\)","Extensions":".cs","IsCaseSensitive":true,"SingleLineComment":"\/\/"},{"Expression":"\\W($Key)\\W","Extensions":".vb","IsCaseSensitive":false,"SingleLineComment":"'"},{"Expression":"\\W($File::$Key)\\W","Extensions":".cpp,.c,.hxx,.h","IsCaseSensitive":true,"SingleLineComment":"\/\/"},{"Expression":"&lt;%\\$\\s+Resources:\\s*($File)\\s*,\\s*($Key)\\s*%&gt;","Extensions":".aspx,.ascx,.master","IsCaseSensitive":true,"SingleLineComment":null},{"Expression":"StringResourceKey\\.($Key)","Extensions":".cs","IsCaseSensitive":true,"SingleLineComment":"\/\/"},{"Expression":"\\.($Key)","Extensions":".ts,.html","IsCaseSensitive":true,"SingleLineComment":"\/\/"},{"Expression":"R.($Key)","Extensions":".cs","IsCaseSensitive":true,"SingleLineComment":null}]}
RESX_Rules = {"EnabledRules":["StringFormat","WhiteSpaceLead","WhiteSpaceTail","PunctuationLead"]}
SolutionGuid = {5B810302-E594-4759-A542-A9B80A8ED85A}
EndGlobalSection
EndGlobal
Binary file removed Codist/AppHelpers.Ext.dll
Binary file not shown.
174 changes: 174 additions & 0 deletions Codist/AutoBuildVersion/BuildConfigSetting.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
using System;
using System.Diagnostics.CodeAnalysis;
using CLR;
using EnvDTE;
using Microsoft.VisualStudio;
using Microsoft.VisualStudio.Shell;
using Newtonsoft.Json;

namespace Codist.AutoBuildVersion
{
public sealed class BuildConfigSetting
{
const string ProjectAssemblyVersionName = "AssemblyVersion";
const string ProjectFileVersionName = "AssemblyFileVersion";
const string SdkProjectFileVersionName = "FileVersion";
const string SdkCopyrightName = "Copyright";

public VersionSetting AssemblyVersion { get; set; }
public VersionSetting AssemblyFileVersion { get; set; }
public bool UpdateLastYearNumberInCopyright { get; set; }

[JsonIgnore]
public bool ShouldRewrite => ShouldSerializeAssemblyVersion() || ShouldSerializeAssemblyFileVersion() || UpdateLastYearNumberInCopyright;

public bool ShouldSerializeAssemblyVersion() {
return AssemblyVersion?.ShouldRewrite == true;
}
public bool ShouldSerializeAssemblyFileVersion() {
return AssemblyFileVersion?.ShouldRewrite == true;
}

public void RewriteVersion(Project project) {
var f = RewriteFlags.None
.SetFlags(RewriteFlags.AssemblyVersion, AssemblyVersion?.ShouldRewrite == true)
.SetFlags(RewriteFlags.AssemblyFileVersion, AssemblyFileVersion?.ShouldRewrite == true)
.SetFlags(RewriteFlags.CopyrightYear, UpdateLastYearNumberInCopyright);
RewriteSdkProjectFile(project, ref f);
//var r = RewriteSdkProjectFile(project, ref f)
// || RewriteAssemblyInfoFile(project, project.FindItem("Properties", "AssemblyInfo.cs"), ref f);
}

public static bool TryGetAssemblyAttributeValues(Project project, out string[] version, out string[] fileVersion, out string copyright) {
ThreadHelper.ThrowIfNotOnUIThread();
version = AttributePattern.GetMatchedVersion(project, ProjectAssemblyVersionName);
fileVersion = AttributePattern.GetMatchedVersion(project, ProjectFileVersionName)
?? AttributePattern.GetMatchedVersion(project, SdkProjectFileVersionName);
copyright = AttributePattern.GetProperty(project, SdkCopyrightName);
return version != null || fileVersion != null || copyright != null;
}

bool RewriteSdkProjectFile(Project project, ref RewriteFlags f) {
ThreadHelper.ThrowIfNotOnUIThread();
var rf = RewriteFlags.None;
if (f.MatchFlags(RewriteFlags.AssemblyVersion) && RewriteVersion(project, AssemblyVersion, ProjectAssemblyVersionName)) {
rf = rf.SetFlags(RewriteFlags.AssemblyVersion, true);
}
if (f.MatchFlags(RewriteFlags.AssemblyFileVersion) && (RewriteVersion(project, AssemblyFileVersion, SdkProjectFileVersionName) || RewriteVersion(project, AssemblyFileVersion, ProjectFileVersionName))) {
rf = rf.SetFlags(RewriteFlags.AssemblyFileVersion, true);
}
if (f.MatchFlags(RewriteFlags.CopyrightYear) && RewriteCopyrightYear(project, SdkCopyrightName)) {
rf = rf.SetFlags(RewriteFlags.CopyrightYear, true);
}
f = f.SetFlags(rf, false);
var r = rf != RewriteFlags.None;
if (r) {
project.Save();
}
return r;
}

[SuppressMessage("Usage", Suppression.VSTHRD010, Justification = Suppression.CheckedInCaller)]
bool RewriteVersion(Project project, VersionSetting setting, string versionName) {
Property ver;
if (setting is null) {
return false;
}
try {
if ((ver = project.Properties.Item(versionName)) == null) {
return false;
}
}
catch (ArgumentException) {
return false;
}
var t = ver.Value.ToString();
if (Version.TryParse(t, out var v)) {
var n = setting.Rewrite(v.Major.ToText(), v.Minor.ToText(), v.Build.ToText(), v.Revision.ToText());
if (n != t) {
ver.Value = n;
WriteBuildOutput($"{project.Name} {versionName} => {n}");
}
return true;
}
return false;
}

[SuppressMessage("Usage", Suppression.VSTHRD010, Justification = Suppression.CheckedInCaller)]
bool RewriteCopyrightYear(Project project, string propertyName) {
Property property;
try {
if ((property = project.Properties.Item(propertyName)) == null) {
return false;
}
}
catch (ArgumentException) {
return false;
}
var t = property.Value.ToString();
int i = t.Length;
while ((i = t.LastIndexOf("20", i, StringComparison.Ordinal)) >= 0) {
if (i + 4 <= t.Length && IsDigit(t[i + 2]) && IsDigit(t[i + 3])
&& (i == 0 || IsDigit(t[i - 1]) == false)
&& (i + 5 > t.Length || IsDigit(t[i + 4]) == false)) {
var n = DateTime.Now.Year.ToText();
if (String.CompareOrdinal(t, i, n, 0, 4) != 0) {
property.Value = t = t.Substring(0, i) + n + t.Substring(i + 4);
WriteBuildOutput($"{project.Name} {propertyName} => {t}");
return true;
}
return false;
}
}
return false;
}

static bool IsDigit(char c) {
return c >= '0' && c <= '9';
}

[SuppressMessage("Usage", Suppression.VSTHRD010, Justification = Suppression.CheckedInCaller)]
void WriteBuildOutput(string text) {
CodistPackage.Instance?.GetOutputPane(VSConstants.OutputWindowPaneGuid.BuildOutputPane_guid, "Build")?.OutputString(nameof(Codist) + ": " + text + Environment.NewLine);
}

[Flags]
enum RewriteFlags
{
None,
AssemblyVersion = 1,
AssemblyFileVersion = 1 << 1,
CopyrightYear = 1 << 2
}

static class AttributePattern
{
public static string[] GetMatchedVersion(Version v) {
return new[] { v.Major.ToText(), v.Minor.ToText(), v.Build.ToText(), v.Revision.ToText() };
}

[SuppressMessage("Usage", Suppression.VSTHRD010, Justification = Suppression.CheckedInCaller)]
public static string[] GetMatchedVersion(Project project, string propertyName) {
try {
var ver = project.Properties.Item(propertyName);
return ver != null && Version.TryParse(ver.Value.ToString(), out var v)
? GetMatchedVersion(v)
: null;
}
catch (ArgumentException) {
return null;
}
}

[SuppressMessage("Usage", Suppression.VSTHRD010, Justification = Suppression.CheckedInCaller)]
public static string GetProperty(Project project, string propertyName) {
try {
return project.Properties.Item(propertyName)?.Value is string s ? s : null;
}
catch (ArgumentException) {
return null;
}
}
}
}
}
73 changes: 73 additions & 0 deletions Codist/AutoBuildVersion/BuildSetting.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using EnvDTE;
using Newtonsoft.Json;

namespace Codist.AutoBuildVersion
{
/// <summary>
/// Contains settings to automate assembly versioning after successful build.
/// </summary>
public sealed class BuildSetting : Dictionary<string, BuildConfigSetting>
{
public BuildSetting() : base(StringComparer.OrdinalIgnoreCase) {
}

public static string GetConfigPath(Project project) {
Microsoft.VisualStudio.Shell.ThreadHelper.ThrowIfNotOnUIThread();
return Path.Combine(Path.GetDirectoryName(project.FullName), "obj", project.Name + ".autoversion.json");
}
public static BuildSetting Load(Project project) {
return Load(GetConfigPath(project));
}
public static BuildSetting Load(string configPath) {
try {
return File.Exists(configPath)
? JsonConvert.DeserializeObject<BuildSetting>(File.ReadAllText(configPath), new JsonSerializerSettings {
DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate,
NullValueHandling = NullValueHandling.Ignore,
Error = (sender, args) => {
args.ErrorContext.Handled = true; // ignore json error
}
})
: null;
}
catch (Exception ex) {
$"Error loading {nameof(BuildSetting)} from {configPath}".Log();
ex.Log();
return null;
}
}

public void RewriteVersion(Project project, string buildConfig) {
var i = buildConfig.IndexOf('|');
if (i != -1) {
buildConfig = buildConfig.Substring(0, i);
}
var setting = Merge("<Any>", buildConfig);
if (setting?.ShouldRewrite == true) {
setting.RewriteVersion(project);
}
}

/// <summary>Merge two <see cref="BuildConfigSetting"/>s named <paramref name="baseConfig"/> and <paramref name="specificConfig"/>. The latter one has higher precedence.</summary>
/// <param name="baseConfig">The base configuration name.</param>
/// <param name="specificConfig">The specific configuration name.</param>
/// <returns>The merged configuration. If neither <paramref name="baseConfig"/> or <paramref name="specificConfig"/> exists, returns <see langword="null"/>.</returns>
public BuildConfigSetting Merge(string baseConfig, string specificConfig) {
TryGetValue(specificConfig, out var s);
if (TryGetValue(baseConfig, out var b)) {
return s != null
? new BuildConfigSetting {
AssemblyVersion = s.AssemblyVersion?.ShouldRewrite == true ? s.AssemblyVersion : b.AssemblyVersion,
AssemblyFileVersion = s.AssemblyFileVersion?.ShouldRewrite == true ? s.AssemblyFileVersion : b.AssemblyFileVersion,
UpdateLastYearNumberInCopyright = s.UpdateLastYearNumberInCopyright || b.UpdateLastYearNumberInCopyright
}
: b;
}
return s;
}
}
}
Loading