Skip to content

Commit

Permalink
Version 4.3:
Browse files Browse the repository at this point in the history
+ Added support to VS 2019 Preview (#58)
+ Added project scope symbol search in Navigation Bar
- Fixed some configuration could not be saved
- Fixed broken inherit XML Doc in version 4.2
- Fixed missing members in symbol search results in Navigation Bar
! Focus on text box when item in Navigation Bar is clicked
! Tracked symbol location changes in Navigation Bar
! Tweaked the display of Navigation Bar
! Tweaked symbol icons for Navigation Bar and Smart Bar
! Better theme support for Navigation Bar
! Showed comment tagger on all supported document types
  • Loading branch information
wmjordan committed Dec 11, 2018
1 parent 2f9f0c4 commit 2804355
Show file tree
Hide file tree
Showing 12 changed files with 74 additions and 48 deletions.
2 changes: 1 addition & 1 deletion Codist/Classifiers/CSharpClassifier.cs
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ static void ClassifyPunctuation(TextSpan itemSpan, ITextSnapshot snapshot, List<
}
var s = snapshot.GetText(itemSpan.Start, itemSpan.Length)[0];
if (s == '{' || s == '}') {
var node = unitCompilation.FindNode(itemSpan, true, true);
var node = unitCompilation.FindNode(itemSpan, true, false);
if (node is BaseTypeDeclarationSyntax == false
&& node is ExpressionSyntax == false
&& node is NamespaceDeclarationSyntax == false
Expand Down
7 changes: 3 additions & 4 deletions Codist/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Threading;
using System.Windows.Media;
using Newtonsoft.Json;
using AppHelpers;
using Codist.Classifiers;
using Codist.SyntaxHighlight;
using Codist.Margins;
using AppHelpers;
using Codist.SyntaxHighlight;
using Newtonsoft.Json;

namespace Codist
{
Expand Down
32 changes: 29 additions & 3 deletions Codist/NaviBar/NaviBarFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace Codist.NaviBar
/// Overrides default navigator to editor.
/// </summary>
[Export(typeof(IWpfTextViewCreationListener))]
[ContentType(Constants.CodeTypes.CSharp)]
[ContentType(Constants.CodeTypes.Code)]
[TextViewRole(PredefinedTextViewRoles.Document)]
sealed partial class NaviBarFactory : IWpfTextViewCreationListener
{
Expand All @@ -30,8 +30,34 @@ sealed partial class NaviBarFactory : IWpfTextViewCreationListener

public void TextViewCreated(IWpfTextView textView) {
if (Config.Instance.Features.MatchFlags(Features.NaviBar)) {
textView.Properties.GetOrCreateSingletonProperty(() => new SemanticContext(textView));
new Overrider(textView);
if (textView.TextBuffer.ContentType.IsOfType(Constants.CodeTypes.CSharp)) {
textView.Properties.GetOrCreateSingletonProperty(() => new SemanticContext(textView));
new Overrider(textView);
}
#if DEBUG
else {
AssociateFileCodeModelOverrider();
}
#endif
}
}

static void AssociateFileCodeModelOverrider() {
Microsoft.VisualStudio.Shell.ThreadHelper.ThrowIfNotOnUIThread();
var model = CodistPackage.DTE2.ActiveDocument?.ProjectItem.FileCodeModel; // the active document can be null
if (model == null) {
return;
}
var codeElements = model.CodeElements;
foreach (EnvDTE80.CodeElement2 item in codeElements) {
System.Diagnostics.Debug.WriteLine(item.Name + "," + item.Kind + "," + item.StartPoint.Line + "," + item.StartPoint.LineCharOffset);
if (item.IsCodeType && item.Kind != EnvDTE.vsCMElement.vsCMElementDelegate) {
var ct = (item as EnvDTE.CodeType).Members;
for (int i = 1; i <= ct.Count; i++) {
var member = ct.Item(i);
System.Diagnostics.Debug.WriteLine(member.Name + "," + member.Kind + "," + member.StartPoint.Line + "," + member.StartPoint.LineCharOffset);
}
}
}
}

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("4.0.0.0")]
[assembly: AssemblyFileVersion("4.2.0.2963")]
[assembly: AssemblyFileVersion("4.3.0.3085")]
59 changes: 27 additions & 32 deletions Codist/source.extension.vsixmanifest
Original file line number Diff line number Diff line change
@@ -1,38 +1,33 @@
<?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="4.2.1.2972" Language="en-US" Publisher="WMJ" />
<DisplayName>Codist</DisplayName>
<Description xml:space="preserve">A coding experience and productivity enhancer for C# programmers with advanced syntax highlight, Super Quick Info (code tooltip), Smart Bar, code navigation bar, code structure on scrollbar markers, comment tagger, and more.</Description>
<MoreInfo>https://github.com/wmjordan/Codist</MoreInfo>
<License>license.txt</License>
<ReleaseNotes>https://github.com/wmjordan/Codist/releases</ReleaseNotes>
<Icon>icon.png</Icon>
<PreviewImage>preview.png</PreviewImage>
<Tags>coding, programming, productivity, syntax highlight, quick info, reference analysis, navigation, comment, tag, line number, scrollbar, C#, C, C++, html, line height</Tags>
</Metadata>
<Installation>
<InstallationTarget Version="[15.0,16.0)" Id="Microsoft.VisualStudio.Pro" />
<InstallationTarget Version="[15.0,16.0)" Id="Microsoft.VisualStudio.Community" />
<InstallationTarget Version="[15.0,16.0)" Id="Microsoft.VisualStudio.Enterprise" />
</Installation>
<Dependencies>
<Dependency Id="Microsoft.Framework.NDP" DisplayName="Microsoft .NET Framework" d:Source="Manual" Version="[4.5,)" />
<Dependency Id="Microsoft.VisualStudio.MPF.15.0" DisplayName="Visual Studio MPF 15.0" d:Source="Installed" Version="[15.0,16.0)" />
<Dependency d:Source="Installed" Id="Microsoft.VisualStudio.CodeAnalysis" DisplayName="CodeAnalysis" Version="[15.0,16.0)" d:InstallSource="Download" />
</Dependencies>
<Prerequisites>
<Prerequisite Id="Microsoft.VisualStudio.Component.CoreEditor" Version="[15.0,16.0)" DisplayName="Visual Studio core editor" />
<Prerequisite Id="Microsoft.VisualStudio.Component.Roslyn.LanguageServices" Version="[15.0,16.0)" DisplayName="C# and Visual Basic" />
<Prerequisite Id="Microsoft.VisualStudio.Component.Roslyn.Compiler" Version="[15.0,16.0)" DisplayName="C# and Visual Basic Roslyn Compiler" />
</Prerequisites>
<Assets>
<Asset Type="Microsoft.VisualStudio.MefComponent" d:Source="Project" d:ProjectName="%CurrentProject%" Path="|%CurrentProject%|" />
<Asset Type="Microsoft.VisualStudio.VsPackage" d:Source="Project" d:ProjectName="%CurrentProject%" Path="|%CurrentProject%;PkgdefProjectOutputGroup|" />
<Asset Type="Microsoft.VisualStudio.Analyzer" d:Source="Project" d:ProjectName="%CurrentProject%" Path="|%CurrentProject%|" />
</Assets>
<Metadata>
<Identity Id="Codist.WMJ.c7b93d20-621f-4b21-9d28-d51157ef0b94" Version="4.3.0.3085" Language="en-US" Publisher="WMJ" />
<DisplayName>Codist</DisplayName>
<Description xml:space="preserve">A productivity enhancer for C# programmers with advanced syntax highlight, Super Quick Info (code tooltip), Smart Bar (contextual toolbar), Navigation Bar, code structure markers on scrollbar, comment tagger, and more.</Description>
<MoreInfo>https://github.com/wmjordan/Codist</MoreInfo>
<License>license.txt</License>
<ReleaseNotes>https://github.com/wmjordan/Codist/releases</ReleaseNotes>
<Icon>icon.png</Icon>
<PreviewImage>preview.png</PreviewImage>
<Tags>coding, programming, productivity, syntax highlight, quick info, reference analysis, navigation, comment, tag, line number, scrollbar, C#, C, C++, html, line height</Tags>
</Metadata>
<Installation>
<InstallationTarget Version="[15.0,17.0)" Id="Microsoft.VisualStudio.Pro" />
<InstallationTarget Version="[15.0,17.0)" Id="Microsoft.VisualStudio.Community" />
<InstallationTarget Version="[15.0,17.0)" Id="Microsoft.VisualStudio.Enterprise" />
</Installation>
<Prerequisites>
<Prerequisite Id="Microsoft.VisualStudio.Component.CoreEditor" Version="[15.0,17.0)" DisplayName="Visual Studio core editor" />
<Prerequisite Id="Microsoft.VisualStudio.Component.Roslyn.LanguageServices" Version="[15.0,17.0)" DisplayName="C# and Visual Basic" />
<Prerequisite Id="Microsoft.VisualStudio.Component.Roslyn.Compiler" Version="[15.0,17.0)" DisplayName="C# and Visual Basic Roslyn Compiler" />
</Prerequisites>
<Assets>
<Asset Type="Microsoft.VisualStudio.MefComponent" d:Source="Project" d:ProjectName="%CurrentProject%" Path="|%CurrentProject%|" />
<Asset Type="Microsoft.VisualStudio.VsPackage" d:Source="Project" d:ProjectName="%CurrentProject%" Path="|%CurrentProject%;PkgdefProjectOutputGroup|" />
<Asset Type="Microsoft.VisualStudio.Analyzer" d:Source="Project" d:ProjectName="%CurrentProject%" Path="|%CurrentProject%|" />
</Assets>
</PackageManifest>
<!--
Please add the following element to PackageManifest\\Assets:
<Asset Type="Microsoft.VisualStudio.MefComponent" d:Source="Project" d:ProjectName="%CurrentProject%" Path="|%CurrentProject%|" />
-->
-->
20 changes: 13 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* Unnecessary code is marked strike-through.
* Keywords are categorized and highlighted with various styles (e.g. `abstract` and `sealed`, `return` and `throw`, etc.).
* Overriding methods (such as `ToString`) can be painted with gradient background color.
* Imported symbols (from external assemblies, e.g. `NotImplementedException`, `ToString`) can be marked with a different style (bold here)
* Imported symbols (from external assemblies, e.g. `NotImplementedException`, `ToString`) can be marked with a different style (bold here) from symbols in your code, which are also possible to be styled.
* All the above styles are customizable.

![Syntax highlight](doc/highlight1.png)
Expand All @@ -55,7 +55,7 @@

From version 4.0 on, it is possible to identify symbols which are defined in your source code and which are imported from external assemblies.

You can customize this in the *Symbol Marker* tab of in the *C#* section of *Syntax Highlight*.
You can customize them in the *Symbol Marker* tab of in the *C#* section of *Syntax Highlight*. Style _My Type and Member_ is used for symbols from your code, and _Referenced Type and Member_ is used for symbols imported from external assemblies.

![Symbolmarker Options 2](doc/symbolmarker-options-2.png)

Expand All @@ -70,6 +70,8 @@

![Comment syntax highlight](doc/comment-tagger-options.png)

To disable comment tagger, uncheck the check box of _Comment Tagger_ on the _Syntax Highlight_ option page.

* The syntax style of comments or C# XML Documentations could be changed too. You can make them semitrasparent to stand behind usual code lines by changing the *Opacity* or the *Font size* value of the corresponding syntax parts.

![Comment syntax XML Doc](doc/csharp-options-xmldoc.png)
Expand Down Expand Up @@ -178,7 +180,7 @@ It brings commonly used operations for the selection, such as editing operations

![Smart Bar](doc/smart-bar.png)

Buttons on the *Smart Bar* changes according to contexts.
Buttons on the *Smart Bar* changes according to your selection.

![Smart Bar](doc/smart-bar-2.png)

Expand All @@ -192,13 +194,13 @@ From version 3.9 on, you can change the behavior of the Smart Bar.

## Scrollbar Marker

The scrollbar can mark...
Scollbar Marker draws extra glyphs and shapes on the scrollbar for the following syntax elements:

* C# `class`/`struct`/`interface`/`enum` **declarations** (marked with a square and their names)
* C# symbol match marker (matches symbol under the caret, marked with an aqua square)
* C# instructions (`#if`, `#else`, `#region`, `#pragma`) (marked with a gray spot)
* **Line numbers** (marked with gray dashed lines and numbers)
* Special comments (marked with small squares)
* Special comments tagged by comment tagger (marked with small squares)

Please see screenshots in the above sections.

Expand All @@ -218,7 +220,7 @@ The scrollbar can mark...

Symbol markers will be cleared when the solution is unloaded.

The style of symbol markers can be customized in options page of the *Syntax highlight* feature.
The style of symbol markers can be customized in options page of the *Syntax highlight* feature. The default colors are listed below.

![Symbol marker Options](doc/symbolmarker-options.png)

Expand All @@ -234,6 +236,8 @@ The scrollbar can mark...

Clicking on the syntax node on the navigation bar will select the corresponding span in the editor. If you have enabled _Smart Bar_ as well, _Smart bar_ will appear offering operations that can be performed against the syntax node.

![Navigation Bar Menu](doc/navigation-bar-select.png)

Clicking on namespace or class definition syntax node will drop down a menu, showing members defined under it.

You can type in the text box nearby the funnel icon to filter members listed in the menu. The buttons to the right hand side of the text box can be used to further filter the results.
Expand All @@ -242,6 +246,8 @@ The scrollbar can mark...

Clicking on the "//" button at the left side of the navigation bar will pop up a text box. You can type some text in it and search for declarations defined in the active document code window.

From version 4.3 on, it is possible to expand the search scope to project-wide, by clicking the second button nearby the text box.

![Navigation Bar Search Declaration](doc/navigation-bar-search-declaration.png)

## Display Enhancements
Expand Down Expand Up @@ -302,4 +308,4 @@ Your vote and feedback on the [Visual Studio Extension Marketplace](https://mark

If you like _Codist_ and want to support the future development of it, you can [donate to the author](http://paypal.me/wmzuo).

The recommended amount of donation is `$19.99`, nevertheless, any other amount of donations are appreciated.
You can donate any amount of money as you like. The recommended amount of donation is `$19.99`.
Binary file modified doc/load-theme.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified doc/navigation-bar-overview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified doc/navigation-bar-search-declaration.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/navigation-bar-select.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified doc/smart-bar-symbol-analysis.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified doc/super-quick-info-8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2804355

Please sign in to comment.