0

I"m not too familiar with Visual Studio Extention development, and the documentation on migrating an existing vs extension to vs2015 seems fairly non-existent, or just unhelpful to underline type usages.

Never-the-less, I've cloned Mads Kristensen's JSON intellisense git project so that I can modify it to support VS2015.


I'm having an issue with a class method reference in the latest (version 14)Microsoft.Web.Editor.dll assembly. Microsoft.Web.Editor.ComponentLocatorWithOrdering<T>.ImportMany(). It seems to have been removed from the assembly, and I am unable to determine what the proper approach/implementation is in the latest assembly.

  ...
    private readonly ItemHandlerRegistry<IJSONSmartTagProvider> _smartTagProviders;

    private void RegisterSmartTagProviders()
    {
        // using Microsoft.Web.Editor;
        IEnumerable<Lazy<IJSONSmartTagProvider>> providers = ComponentLocatorWithOrdering<IJSONSmartTagProvider>.ImportMany();

        foreach (Lazy<IJSONSmartTagProvider> provider in providers)
        {
            _smartTagProviders.RegisterHandler(provider.Value.ItemType, provider.Value);
        }
    }
  ...

The best reference I have for the v12 assembly, type, and method is from whatdll.com. It doesn't describe it; Nor does it provide any material in regards to it in the context of migration (which is ultimately what I'm posting this question for).

Additional considers

The IJSONSmartTagProvder type is a custom type that seems to encapsulate SmartTag, which is depreciated (or deprecated).. The newer (recommended) type is SuggestedAction (which seems to be an interface to a concept/compontent referred to as Lightbulb), but even if I were to convert the code/custom types to utilize the newer type, I wouldn't necessarily know how to utilize it in the latest Microsoft.Web.Editor assembly in a similiar manner to how Mads is using his types in the above snippet. (also, the only implementing class I've seen of ISuggestedAction is in Rosyln).

Community
  • 1
  • 1
Brett Caswell
  • 732
  • 1
  • 4
  • 16
  • hmm.. can someone wtih 1500 rep add `lightbulb` as a tag to this question.. – Brett Caswell Oct 13 '15 at 14:02
  • Check how https://github.com/madskristensen/WebEssentials2015/blob/master/EditorExtensions/CSS/SmartTags/CssSmartTagger.cs#L86 works – SLaks Oct 13 '15 at 14:19
  • actually.. from the Roslyn source reference I posted in the question above, I see `Microsoft.CodeAnalysis.Editor.Tagging` reference as being similar to what Mad's `JSONSmartTagger` class (which is the class this method is part of) is doing... – Brett Caswell Oct 13 '15 at 14:20
  • thanks @SLaks, I'll look into it.. – Brett Caswell Oct 13 '15 at 14:21
  • Also, the better way to do this is to MEF-`[Import]` the `IEnumerable>` from a MEF-exported class. – SLaks Oct 13 '15 at 14:26

0 Answers0