Example #1
0
 public RwHtmlCompletionSource(RwHtmlCompletionSourceProvider sourceProvider, RwHtmlParser parser, 
     RwHtmlClassifier classifier, ITextBuffer textBuffer, VisualStudioWorkspace workspace, 
     IGlyphService glyphService, DTE2 dte, RedwoodConfigurationProvider configurationProvider,
     MetadataControlResolver metadataControlResolver)
 {
     this.sourceProvider = sourceProvider;
     this.textBuffer = textBuffer;
     this.classifier = classifier;
     this.parser = parser;
     this.workspace = workspace;
     this.glyphService = glyphService;
     this.dte = dte;
     this.configurationProvider = configurationProvider;
     this.MetadataControlResolver = metadataControlResolver;
 }
        public ICompletionSource TryCreateCompletionSource(ITextBuffer textBuffer)
        {
            return textBuffer.Properties.GetOrCreateSingletonProperty(() =>
            {
                var classifierProvider = new RwHtmlClassifierProvider()
                {
                    Registry = Registry
                };

                ConfigurationProvider = new RedwoodConfigurationProvider();
                MetadataControlResolver = new MetadataControlResolver();

                WatchWorkspaceChanges();

                Parser = new RwHtmlParser();
                Classifier = (RwHtmlClassifier)classifierProvider.GetClassifier(textBuffer);

                return new RwHtmlCompletionSource(this, Parser, Classifier, textBuffer,
                    Workspace, GlyphService, CompletionHelper.DTE, ConfigurationProvider, MetadataControlResolver);
            });
        }