Exemplo n.º 1
0
        public JadeClassifierProvider(IClassificationTypeRegistryService registryService,   
            ITextBufferFactoryService bufferFact,
            IContentTypeRegistryService contentTypeService,
            [ImportMany(typeof(ITaggerProvider))]Lazy<ITaggerProvider, TaggerProviderMetadata>[] taggerProviders,
            [ImportMany(typeof(IClassifierProvider))]Lazy<IClassifierProvider, IClassifierProviderMetadata>[] classifierProviders) {
            ClassificationRegistryService = registryService;
            BufferFactoryService = bufferFact;
            JsContentType = contentTypeService.GetContentType(NodejsConstants.JavaScript);
            CssContentType = contentTypeService.GetContentType(NodejsConstants.CSS);

            var jsTagger = taggerProviders.Where(
                provider =>
                    provider.Metadata.ContentTypes.Contains(NodejsConstants.JavaScript) &&
                    provider.Metadata.TagTypes.Any(tagType => tagType.IsSubclassOf(typeof(ClassificationTag)))
            ).FirstOrDefault();
            if (JsTaggerProvider != null) {
                JsTaggerProvider = jsTagger.Value;
            }

            var cssTagger = classifierProviders.Where(
                provider => provider.Metadata.ContentTypes.Any(x => x.Equals("css", StringComparison.OrdinalIgnoreCase))
            ).FirstOrDefault();
            if (cssTagger != null) {
                CssClassifierProvider = cssTagger.Value;
            }
        }
        public JadeClassifierProvider(IClassificationTypeRegistryService registryService,
                                      ITextBufferFactoryService bufferFact,
                                      IContentTypeRegistryService contentTypeService,
                                      [ImportMany(typeof(ITaggerProvider))] Lazy <ITaggerProvider, TaggerProviderMetadata>[] taggerProviders,
                                      [ImportMany(typeof(IClassifierProvider))] Lazy <IClassifierProvider, IClassifierProviderMetadata>[] classifierProviders)
        {
            this.ClassificationRegistryService = registryService;
            this.BufferFactoryService          = bufferFact;
            this.JsContentType  = contentTypeService.GetContentType(NodejsConstants.JavaScript);
            this.CssContentType = contentTypeService.GetContentType(NodejsConstants.CSS);

            var jsTagger = taggerProviders.Where(
                provider =>
                provider.Metadata.ContentTypes.Contains(NodejsConstants.JavaScript) &&
                provider.Metadata.TagTypes.Any(tagType => tagType.IsSubclassOf(typeof(ClassificationTag)))
                ).FirstOrDefault();

            if (this.JsTaggerProvider != null)
            {
                this.JsTaggerProvider = jsTagger.Value;
            }

            var cssTagger = classifierProviders.Where(
                provider => provider.Metadata.ContentTypes.Any(x => x.Equals("css", StringComparison.OrdinalIgnoreCase))
                ).FirstOrDefault();

            if (cssTagger != null)
            {
                this.CssClassifierProvider = cssTagger.Value;
            }
        }
 public EpochQuickInfoSource(EpochQuickInfoSourceProvider provider, ITextBuffer subjectBuffer, IVsDebugger debugger, IVsEditorAdaptersFactoryService adapter, ITextBufferFactoryService bufferfactory, IContentTypeRegistryService contentTypes, IClassifierProvider classifierprovider, IGlyphService glyphService)
 {
     m_provider           = provider;
     m_subjectBuffer      = subjectBuffer;
     m_debugger           = debugger;
     m_adapter            = adapter;
     m_parsedProject      = subjectBuffer.Properties.GetProperty <Parser.Project>(typeof(Parser.Project));
     m_bufferFactory      = bufferfactory;
     m_contentTypes       = contentTypes;
     m_classifierProvider = classifierprovider;
     m_glyphService       = glyphService;
 }