Esempio n. 1
0
        protected void Create(params string[] lines)
        {
            _textBuffer = EditorHost.CreateTextBuffer(lines);

            _asyncTaggerSource    = new TestableAsyncTaggerSource(_textBuffer);
            _asyncTagger          = new AsyncTagger <string, TextMarkerTag>(_asyncTaggerSource);
            _asyncTaggerInterface = _asyncTagger;
        }
Esempio n. 2
0
 internal static void WaitForBackgroundToComplete <TData, TTag>(this AsyncTagger <TData, TTag> asyncTagger, TestableSynchronizationContext synchronizationContext)
     where TTag : ITag
 {
     while (asyncTagger.AsyncBackgroundRequestData.HasValue)
     {
         synchronizationContext.RunAll();
         Thread.Yield();
     }
 }
Esempio n. 3
0
            public AsyncTest()
            {
                _textBuffer = CreateTextBuffer();

                var classificationType = VimEditorHost.ClassificationTypeRegistryService.GetOrCreateClassificationType("classifier test");

                _source      = new TextAsyncTaggerSource <IClassificationTag>(new ClassificationTag(classificationType), _textBuffer);
                _asyncTagger = new AsyncTagger <Tuple <string, IClassificationTag>, IClassificationTag>(_source);
                _classifier  = new Classifier(_asyncTagger);
            }
Esempio n. 4
0
        private void Create(params string[] lines)
        {
            _textBuffer = CreateTextBuffer(lines);

            // Setup a sychronization context we can control
            _synchronizationContext = new TestableSynchronizationContext();
            _synchronizationContext.Install();

            _asyncTaggerSource    = new TestableAsyncTaggerSource(_textBuffer);
            _asyncTagger          = new AsyncTagger <string, TextMarkerTag>(_asyncTaggerSource);
            _asyncTaggerInterface = _asyncTagger;
        }
Esempio n. 5
0
        internal AsyncTaggerType.AsyncBackgroundRequest CreateAsyncBackgroundRequest(
            SnapshotSpan span,
            CancellationTokenSource cancellationTokenSource,
            Task task = null)
        {
            var channel = new AsyncTagger <string, TextMarkerTag> .Channel();

            channel.WriteNormal(SnapshotLineRange.CreateForSpan(span));

            task = task ?? new Task(() => { });
            return(new AsyncTaggerType.AsyncBackgroundRequest(
                       span.Snapshot,
                       channel,
                       task,
                       cancellationTokenSource));
        }
Esempio n. 6
0
 protected ChannelTest()
 {
     _channel = new AsyncTagger<string, TextMarkerTag>.Channel();
 }
Esempio n. 7
0
 protected override ITagger <TextMarkerTag> CreateTagger(ITextView textView)
 {
     _asyncTagger = CreateAsyncTagger(textView);
     return(_asyncTagger);
 }
Esempio n. 8
0
 protected ChannelTest()
 {
     _channel = new AsyncTagger <string, TextMarkerTag> .Channel();
 }