Exemplo n.º 1
0
 protected override ITaggerEventSource CreateEventSource(ITextView?textView, ITextBuffer subjectBuffer)
 {
     Contract.ThrowIfNull(textView);
     // Because we use frozen-partial documents for semantic classification, we may end up with incomplete
     // semantics (esp. during solution load).  Because of this, we also register to hear when the full
     // compilation is available so that reclassify and bring ourselves up to date.
     // Note: Also generate tags when FeatureOnOffOptions.InheritanceMarginCombinedWithIndicatorMargin is changed,
     // because we want to refresh the glyphs in indicator margin.
     return(new CompilationAvailableTaggerEventSource(
                subjectBuffer,
                AsyncListener,
                TaggerEventSources.OnWorkspaceChanged(subjectBuffer, AsyncListener),
                TaggerEventSources.OnViewSpanChanged(ThreadingContext, textView),
                TaggerEventSources.OnDocumentActiveContextChanged(subjectBuffer),
                TaggerEventSources.OnGlobalOptionChanged(GlobalOptions, FeatureOnOffOptions.ShowInheritanceMargin),
                TaggerEventSources.OnGlobalOptionChanged(GlobalOptions, FeatureOnOffOptions.InheritanceMarginCombinedWithIndicatorMargin)));
 }
        protected sealed override ITaggerEventSource CreateEventSource(ITextView?textView, ITextBuffer subjectBuffer)
        {
            this.ThreadingContext.ThrowIfNotOnUIThread();
            Contract.ThrowIfNull(textView);

            // Note: we don't listen for OnTextChanged.  They'll get reported by the ViewSpan changing and also the
            // SemanticChange notification.
            //
            // Note: because we use frozen-partial documents for semantic classification, we may end up with incomplete
            // semantics (esp. during solution load).  Because of this, we also register to hear when the full
            // compilation is available so that reclassify and bring ourselves up to date.
            return(new CompilationAvailableTaggerEventSource(
                       subjectBuffer,
                       AsyncListener,
                       TaggerEventSources.OnViewSpanChanged(ThreadingContext, textView),
                       TaggerEventSources.OnWorkspaceChanged(subjectBuffer, AsyncListener),
                       TaggerEventSources.OnDocumentActiveContextChanged(subjectBuffer),
                       TaggerEventSources.OnGlobalOptionChanged(_globalOptions, ClassificationOptionsStorage.ClassifyReassignedVariables)));
        }
Exemplo n.º 3
0
            private ITaggerEventSource CreateEventSource()
            {
                var eventSource = _dataSource.CreateEventSource(_textView, _subjectBuffer);

                // If there are any options specified for this tagger, then also hook up event
                // notifications for when those options change.
                var optionChangedEventSources =
                    _dataSource.Options.Concat <IOption>(_dataSource.PerLanguageOptions)
                    .Select(globalOption => TaggerEventSources.OnGlobalOptionChanged(_dataSource.GlobalOptions, globalOption)).ToList();

                if (optionChangedEventSources.Count == 0)
                {
                    // No options specified for this tagger.  So just keep the event source as is.
                    return(eventSource);
                }

                optionChangedEventSources.Add(eventSource);
                return(TaggerEventSources.Compose(optionChangedEventSources));
            }
 protected override ITaggerEventSource CreateEventSource(ITextView?textView, ITextBuffer subjectBuffer)
 {
     Contract.ThrowIfNull(textView);
     return(TaggerEventSources.Compose(
                TaggerEventSources.OnViewSpanChanged(this.ThreadingContext, textView),
                TaggerEventSources.OnWorkspaceChanged(subjectBuffer, _listener),
                TaggerEventSources.OnGlobalOptionChanged(GlobalOptions, InlineHintsGlobalStateOption.DisplayAllOverride),
                TaggerEventSources.OnGlobalOptionChanged(GlobalOptions, InlineHintsOptionsStorage.EnabledForParameters),
                TaggerEventSources.OnGlobalOptionChanged(GlobalOptions, InlineHintsOptionsStorage.ForLiteralParameters),
                TaggerEventSources.OnGlobalOptionChanged(GlobalOptions, InlineHintsOptionsStorage.ForIndexerParameters),
                TaggerEventSources.OnGlobalOptionChanged(GlobalOptions, InlineHintsOptionsStorage.ForObjectCreationParameters),
                TaggerEventSources.OnGlobalOptionChanged(GlobalOptions, InlineHintsOptionsStorage.ForOtherParameters),
                TaggerEventSources.OnGlobalOptionChanged(GlobalOptions, InlineHintsOptionsStorage.SuppressForParametersThatMatchMethodIntent),
                TaggerEventSources.OnGlobalOptionChanged(GlobalOptions, InlineHintsOptionsStorage.SuppressForParametersThatDifferOnlyBySuffix),
                TaggerEventSources.OnGlobalOptionChanged(GlobalOptions, InlineHintsOptionsStorage.SuppressForParametersThatMatchArgumentName),
                TaggerEventSources.OnGlobalOptionChanged(GlobalOptions, InlineHintsOptionsStorage.EnabledForTypes),
                TaggerEventSources.OnGlobalOptionChanged(GlobalOptions, InlineHintsOptionsStorage.ForImplicitVariableTypes),
                TaggerEventSources.OnGlobalOptionChanged(GlobalOptions, InlineHintsOptionsStorage.ForLambdaParameterTypes),
                TaggerEventSources.OnGlobalOptionChanged(GlobalOptions, InlineHintsOptionsStorage.ForImplicitObjectCreation)));
 }
 // Need to override this from AbstractDiagnosticsTaggerProvider because the location option needs to be added
 // to the TaggerEventSource, otherwise it does not get updated until there is a change in the editor.
 protected override ITaggerEventSource CreateEventSource(ITextView?textView, ITextBuffer subjectBuffer)
 {
     return(TaggerEventSources.Compose(
                base.CreateEventSource(textView, subjectBuffer),
                TaggerEventSources.OnGlobalOptionChanged(GlobalOptions, InlineDiagnosticsOptions.Location)));
 }