Code Monkey home page Code Monkey logo

coco's Introduction

License VS14 VS15 VS16

CoCo

A Visual Studio 2015 (vs14), 2017 (vs15) and 2019 (vs16) extension that is analyzing source code to colorize and decorate appropriate syntax nodes to different colors and different styles. It makes easily to read and understand sources, to find sought entities and to navigate by code.

Features

Currently extension supports analyzing C#, VB.Net source codes. It's colorize and decorate a many semantic and language elements such as variables, methods, types, members, namespaces and many others. For more detailed list of supported items, please see Classifications.md.

Extension can apply the following decorations to analyzed elements:

  • Changing foreground and background
  • Changing font family
  • Changing font styles and stretches
  • Using bold font weight
  • Changing font rendering size
  • Using overline, underline, strikethrough and baseline font

supports the following analyze options of elements:

  • Disable element classification at all
  • Disable element classification in editor text
  • Disable element classification inside xml doc comments in editor text
  • Disable element classification in quick info tooltip

and can apply the chosen settings to:

  • Editor text
  • Quick info tooltip

Examples

The following screenshots show a different applying decorations and colors to the code:

How to use

In CoCo/General option page of the Visual Studio you can fully enable or disable editor and quick info classification:

In CoCo/Classifications you can manage all supported classifications.

In the Classifications tab you can set decorations and analyze options for classification item:

and in the Presets tab you can save your current settings from Classifications tab as preset and apply or delete existing presets:

You need to click OK button to confirm your changes on the all CoCo options pages. If you will not click the OK button extension will use the previous (or default) settings for all of pages. All settings are stored under %localappdata%\CoCo\.

Installation

Extension doesn't apply the one of default presets after the first installation on a system. Therefore, you need to set colors and decorations manually or apply existing presets as pointed out above. After updating extension to a new version it will use the stored settings files on your system if they exist otherwise you still need to apply some colors and decorations.

Presets

You can look at the screenshot below where code was colorized and decorate after applying the CoCo dark theme preset:

Click to expand screenshot

And you can look at the similar screenshot where code was colorized and decorate after applying another preset - CoCo light|blue theme:

Click to expand screenshot

Changelog

For more information on project's changelog, please see ReleaseNotes.md

Contributing

For more information on contributing to the project, please see CONTRIBUTING.md

License

CoCo is licensed under the MIT license

coco's People

Contributors

alexxn avatar georgealexandria avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

coco's Issues

Cleanup classification's names

Need to cleanup the display names of classifications:

CoCo vs15: "CoCo static method name" => "Static method"
CoCo vs14: "Static method name" => "Static method"
...

C# 8

  • Check that a new constructions in c# 8 are being supported or append supporting of them
  • Investigate constructions that can be classified as a new classifications

Supports disabling classification of item

Will be good to add possibility to prohibit classification of item, which will allow to choose classify items or not that are already classified in the Visual Studio, look at the issue #24.

Large number of NullReferenceExceptions in ActivityLog.xml when opening F# project first

When I open an F# project in Visual Studio 2017, I get an error dialog indicating that an exception has occurred, and to check the ActivityLog.xml file for details. The file contains several dozen of the following error:

System.NullReferenceException: Object reference not set to an instance of an object.
at CoCo.EditorClassifier.GetClassificationSpans(SnapshotSpan span)
at Microsoft.VisualStudio.Text.Classification.Implementation.ClassifierTagger.d__5.MoveNext()
at Microsoft.VisualStudio.Text.Tagging.Implementation.TagAggregator`1.d__39.MoveNext()

Possibly, the classification should not be happening on F# projects and a language filter is needed?

Add ability to export presets

I've recently reinstalled the VS and must manually reconfig my CoCo presets. As the theme options grow, there should be a way to export and import preset files.

After install, "CoCo format" item colors all default to grey

After installing the extension and restarting VS (2017), all of the "CoCo format" colors defined in Tools / Options / Environment / Fonts and Colors are set to "default". I'd suggest having them initially default to some set color scheme like in the example screen shots.

(An initial peek at the code didn't reveal any pre-set defaults, so I assume this isn't simply a bug, but by all means correct me if I'm wrong!)

Error in Building the solution from the source code

I downloaded the source code and I have tried to build it by using MVS 2017, but it gives me the following error:

The "GetDeploymentPathFromVisxManifest" task failed unexpectedly ...

Is anyone familiar with this error?

Coco V3.0.0 crashes on opening non-cs-files

I encounter regular crashes of Coco in Visual Studio 2017.
The error mainly occurs if i open files other then Cs-files (i.e. rdlc files, xml-files,....)

So here are the key data:
CoCo-Version 3.0.0
Visual Studio Version: Visual Studio 2017 Enterprise, V15.9.11

Error (logged in ActivityLog.xml):

System.AggregateException: One or more errors occurred. System.NullReferenceException: Object reference not set to an instance of an object. at CoCo.Analyser.VisualStudioExtensions.GetLanguage(ITextBuffer buffer) at CoCo.QuickInfo.QuickInfoSource..ctor(ITextBuffer textBuffer, IReadOnlyDictionary2 quickInfoOptions, ITextDocumentFactoryService documentFactoryService)
at CoCo.Providers.QuickInfoProvider.<>;c__DisplayClass4_0.b__0()
at Microsoft.VisualStudio.Utilities.PropertyCollection.GetOrCreateSingletonProperty[T](Object key, Func1 creator) at CoCo.Providers.QuickInfoProvider.TryCreateQuickInfoSource(ITextBuffer textBuffer) at Microsoft.VisualStudio.Language.Intellisense.Implementation.AsyncQuickInfoSession.CreateSources(JoinableTaskContext joinableTaskContext, IEnumerable1 orderedSourceProviders, ITextBuffer textBuffer, IList1 failures) --- End of inner exception stack trace --- at Microsoft.VisualStudio.Language.Intellisense.Implementation.AsyncQuickInfoSession.<UpdateAsync>d__32.MoveNext()&#x000D;&#x000A;--- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.Language.Intellisense.Implementation.AsyncQuickInfoPresentationSession.<UpdateAsync>d__5.MoveNext()&#x000D;&#x000A;---> (Inner Exception #0) System.NullReferenceException: Object reference not set to an instance of an object. at CoCo.Analyser.VisualStudioExtensions.GetLanguage(ITextBuffer buffer) at CoCo.QuickInfo.QuickInfoSource..ctor(ITextBuffer textBuffer, IReadOnlyDictionary2 quickInfoOptions, ITextDocumentFactoryService documentFactoryService)
at CoCo.Providers.QuickInfoProvider.<>c__DisplayClass4_0.b__0()
at Microsoft.VisualStudio.Utilities.PropertyCollection.GetOrCreateSingletonProperty[T](Object key, Func1 creator) at CoCo.Providers.QuickInfoProvider.TryCreateQuickInfoSource(ITextBuffer textBuffer) at Microsoft.VisualStudio.Language.Intellisense.Implementation.AsyncQuickInfoSession.CreateSources(JoinableTaskContext joinableTaskContext, IEnumerable1 orderedSourceProviders, ITextBuffer textBuffer, IList1 failures)

Supporting of "Classify as" option

Will be good to add possibility to classify item as on of others or just don't classify it.
This opens way to classify items or ignore them classifications that already classified in the Visual Studio, look at the issue #24.

Also, need to come up with a design which will marks items in the cycle with the current selection in the "Classify as" option or as another posibility just hide items in"Classify as" which build cycle with the current item.

CoCo FileNotFoundException during solution load

Visual Studio 2017 version 15.8.1
CoCo version 2.1.0

  <entry>
    <record>2488</record>
    <time>2018/08/27 12:42:50.769</time>
    <type>Error</type>
    <source>Microsoft.VisualStudio.ComponentModelHost.VsShellComponentModelHost</source>
    <description>Exception occurred while loading assembly CoCo, Version=2.1.0.0, Culture=neutral, PublicKeyToken=null: System.IO.FileNotFoundException: Could not load file or assembly &apos;CoCo, Version=2.1.0.0, Culture=neutral, PublicKeyToken=null&apos; or one of its dependencies. The system cannot find the file specified.&#x000D;&#x000A;File name: &apos;CoCo, Version=2.1.0.0, Culture=neutral, PublicKeyToken=null&apos;&#x000D;&#x000A;   at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark&amp; stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)&#x000D;&#x000A;   at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark&amp; stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)&#x000D;&#x000A;   at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark&amp; stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)&#x000D;&#x000A;   at System.Reflection.Assembly.Load(AssemblyName assemblyRef)&#x000D;&#x000A;   at Microsoft.VisualStudio.ExtensibilityHosting.FaultCatchingAssemblyLoader.&lt;&gt;c__DisplayClass17_0.&lt;LoadAssembly&gt;b__0(AssemblyName assemblyNameParam)&#x000D;&#x000A;&#x000D;&#x000A;WRN: Assembly binding logging is turned OFF.&#x000D;&#x000A;To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.&#x000D;&#x000A;Note: There is some performance penalty associated with assembly bind failure logging.&#x000D;&#x000A;To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].&#x000D;&#x000A;.;vs.platform.extensibilityhosting.assemblyloadexception.AssemblyFullName=CoCo, Version=2.1.0.0, Culture=neutral, PublicKeyToken=null;vs.platform.extensibilityhosting.assemblyloadexception.AssemblyPath=file:///C:/USERS/STEVEC/APPDATA/LOCAL/MICROSOFT/VISUALSTUDIO/15.0_2120162E/EXTENSIONS/AMWVN5H4.ZCH/CoCo.dll;vs.platform.extensibilityhosting.assemblyloadexception.FusionLogEntry=WRN: Assembly binding logging is turned OFF.&#x000D;&#x000A;To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.&#x000D;&#x000A;Note: There is some performance penalty associated with assembly bind failure logging.&#x000D;&#x000A;To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].&#x000D;&#x000A;;vs.platform.extensibilityhosting.assemblyloadexception.ExceptionType=System.IO.FileNotFoundException;vs.platform.extensibilityhosting.assemblyloadexception.ExceptionMessage=Could not load file or assembly &apos;CoCo, Version=2.1.0.0, Culture=neutral, PublicKeyToken=null&apos; or one of its dependencies. The system cannot find the file specified.;vs.platform.extensibilityhosting.assemblyloadexception.ExceptionStackTrace=   at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark&amp; stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)&#x000D;&#x000A;   at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark&amp; stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)&#x000D;&#x000A;   at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark&amp; stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)&#x000D;&#x000A;   at System.Reflection.Assembly.Load(AssemblyName assemblyRef)&#x000D;&#x000A;   at Microsoft.VisualStudio.ExtensibilityHosting.FaultCatchingAssemblyLoader.&lt;&gt;c__DisplayClass17_0.&lt;LoadAssembly&gt;b__0(AssemblyName assemblyNameParam)&#x000D;&#x000A;</description>
  </entry>
  <entry>
    <record>2489</record>
    <time>2018/08/27 12:42:50.771</time>
    <type>Error</type>
    <source>Microsoft.VisualStudio.ComponentModelHost.VsShellComponentModelHost</source>
    <description>A MEF Component threw an exception at runtime: System.IO.FileNotFoundException: Could not load file or assembly &apos;CoCo, Version=2.1.0.0, Culture=neutral, PublicKeyToken=null&apos; or one of its dependencies. The system cannot find the file specified.&#x000D;&#x000A;File name: &apos;CoCo, Version=2.1.0.0, Culture=neutral, PublicKeyToken=null&apos;&#x000D;&#x000A;   at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark&amp; stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)&#x000D;&#x000A;   at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark&amp; stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)&#x000D;&#x000A;   at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark&amp; stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)&#x000D;&#x000A;   at System.Reflection.Assembly.Load(AssemblyName assemblyRef)&#x000D;&#x000A;   at Microsoft.VisualStudio.ExtensibilityHosting.FaultCatchingAssemblyLoader.&lt;&gt;c__DisplayClass17_0.&lt;LoadAssembly&gt;b__0(AssemblyName assemblyNameParam)&#x000D;&#x000A;   at Microsoft.VisualStudio.ExtensibilityHosting.Utilities.SafeGetOrAdd[TKey,TValue](IDictionary`2 dictionary, TKey key, Object lockObj, Func`2 valueFactory)&#x000D;&#x000A;   at Microsoft.VisualStudio.ExtensibilityHosting.FaultCatchingAssemblyLoader.LoadAssembly(AssemblyName assemblyName)&#x000D;&#x000A;   at Microsoft.VisualStudio.Composition.Reflection.ResolverExtensions.TryUseFastReflection(TypeRef typeRef, Module&amp; manifest)&#x000D;&#x000A;   at Microsoft.VisualStudio.Composition.Reflection.ResolverExtensions.Resolve(MethodRef methodRef)&#x000D;&#x000A;   at Microsoft.VisualStudio.Composition.Reflection.MethodRef.Resolve()&#x000D;&#x000A;   at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.RuntimePartLifecycleTracker.CreateValue()&#x000D;&#x000A;   at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.Create()&#x000D;&#x000A;   at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveNext(PartLifecycleState nextState)&#x000D;&#x000A;   at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveToState(PartLifecycleState requiredState)&#x000D;&#x000A;   at Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.GetValueReadyToExpose()&#x000D;&#x000A;   at Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.&lt;&gt;c__DisplayClass15_0.&lt;GetExportedValueHelper&gt;b__0()&#x000D;&#x000A;&#x000D;&#x000A;WRN: Assembly binding logging is turned OFF.&#x000D;&#x000A;To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.&#x000D;&#x000A;Note: There is some performance penalty associated with assembly bind failure logging.&#x000D;&#x000A;To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].&#x000D;&#x000A;</description>
  </entry>

Enable for VS 2022

all sayed ;-)
It would be a great shame if this great tool stopped working in VS 2022.

Static properties doesn't show bold

I recently move from Visual Studio 2017 to 2019 and when i set the Properties to bold, only the instance properties shows bold; the static properties are not affected.

The same problem with the rest of decorators but the colors and the rendering size works fine.

Add tests to analyzing syntax nodes and semantic items

  • Base tests for identifier declarations
  • Base tests for identifier access
  • Tests for identifiers in a xml comments
  • Tests for vs14
  • Tests for identifiers that are not reachable
  • Tests for items classification in quick info

List of default colours

I understand not wanting to set colours by default but it's tricky to choose a colour scheme that works well. From your screen shots you have obviously spent some time doing this. Perhaps you might include a list of the values you have set for the various CoCo colour settings. We could still apply them manually bit would have your list as a guide. If your colour choices differ for the light and dark themes please supply a list of colours you chose for each.

Sharing Themes

Is it possible to share themes using CoCo, and if so, are you aware of any themes people have shared? (possible inclusion to readme)

Highlighting not working correctly for conditional code

When using conditional code, i.e. #if DEBUG ... #else ... #endif the code highlighting does not correctly follow changes in the conditional state, such as switching between Release and Debug profiles.

In the attached image, the top screenshot shows some code in a file that was opened while the Release profile was selected and the lower shows how it changed when the profile was changed to Debug. The code in the #else should have become all grey but did not. When it was changed back to Release the display reverted to the top screenshot.

Versions are Visual Studio 2019 16.3.1 and CoCo 3.2.1

coco

Method colors not consistant.

trying to get methods color'd yellow. Not all methods are working correctly, not sure if this is CoCo or something else. Both methods and extension methods are colored exactly the same.

I have attached my screenshot.
capture
capture2

Installation on VS instance breaks Dark Theme

Installed on Visual Studio 2017 on Windows 7, where I was using the default dark theme. The installation immediately applied a light color scheme to the Text Editor only, and I cannot undo this. Additionally, as I can't uninstall the extension, I don't know if an uninstall will reset my colors.

To Reproduce:
Install Extension on VS2017 which is set to use default dark theme.

Supporting of Visual Basic

After the issue #3 was solved CoCo has a good way to introduce supporting of a new languages and the first of them should be Visual Basic, because roslyn supports it, so adding Visual Basic will be somewhat easier.

Cannot uninstall as non-admin user

CoCo installed successfully as a non-admin user, however, uninstall as non-admin fails due to System.UnauthorizedAccessException. The specific registry key is \Software\Microsoft\VisualStudio[User_Dir]\ExtensionManager\PendingDeletions'.

To Reproduce:

  1. Log into non-admin account in Windows 7.
  2. Install package in Visual Studio from Extensions and Updates.
  3. Restart Visual Studio and uninstall from Extensions and Updates.

Colors not applied in VS 2017 15.7 preview 3 and 4

Starting with preview 3 of the 15.7 version of VS 2017 the colorization is no longer working.
It worked as expected in preview 2, but then in preview 3 not longer working. Preview 4 was just released and it has the same problem.

For testing I installed a few other similar extensions and they too seemed to have the same issue.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.