public override void Filter()
        {
            var filteredCompletions = (FilteredObservableCollection <Completion>) this.Completions;
            var pattern             = ApplicableTo.GetText(_snapshot);

            filteredCompletions.Filter(c => StringPatternMatching.MatchPattern(c.InsertionText, pattern));
        }
Beispiel #2
0
        /// <summary>
        /// Reads only the latest additional text that has been appended to the file
        /// </summary>
        private void ReadNewTextFromFile()
        {
            IStringPatternMatching patternMatch = new StringPatternMatching();

            // our stream position will be the point where it last read up to
            // we only want to read from that position onwards to the latest end of the document
            this._loading = true;
            this.CountLinesInFile();
            this.StartLine = this.CalculateStartLine();
            this._loading  = false;
            this.RaiseFileChangedEvent();
        }
        public override IReadOnlyList <Span> GetHighlightedSpansInDisplayText(string displayText)
        {
            var spans = StringPatternMatching.MatchPatternSpans(displayText, _filterText);

            return(spans.Select(s => new Span(s.StartPos, s.Length)).ToImmutableArray());
        }