Beispiel #1
0
        public static void AddChangesToBounds(
            PreprocessedTextLocationMap map,
            List <PreprocessingTextChange> changes,
            PreprocessedData data,
            PreprocessedTextType type)
        {
            if (data == null)
            {
                return;
            }

            foreach (var change in changes)
            {
                if (change.RemoveCharsCount == 0)
                {
                    continue;
                }

                var start = change.Index;
                var end   = change.Index + change.RemoveCharsCount - 1;

                if (map != null)
                {
                    start = map.GetOriginalPosition(start, PositionRounding.Up);
                    end   = map.GetOriginalPosition(end, PositionRounding.Down);
                }

                data.PreprocessedTextBounds.Add(
                    new PreprocessedTextBound(
                        type, start, end));
            }
        }
        public static void AddChangesToBounds(
            PreprocessedTextLocationMap map,
            List<PreprocessingTextChange> changes,
            PreprocessedData data,
            PreprocessedTextType type)
        {
            if (data == null)
            {
                return;
            }

            foreach (var change in changes)
            {
                if (change.RemoveCharsCount == 0)
                {
                    continue;
                }

                var start = change.Index;
                var end = change.Index + change.RemoveCharsCount - 1;

                if(map != null)
                {
                    start = map.GetOriginalPosition(start, PositionRounding.Up);
                    end = map.GetOriginalPosition(end, PositionRounding.Down);
                }

                data.PreprocessedTextBounds.Add(
                    new PreprocessedTextBound(
                        type, start, end));
            }
        }
Beispiel #3
0
        public PreprocessedTextBound(PreprocessedTextType type, int start, int end)
        {
            Interval bound;

            bound.Start = start;
            bound.End   = end;

            Bound = bound;
            Type  = type;
        }
        public PreprocessedTextBound(PreprocessedTextType type, int start, int end)
        {
            Interval bound;

            bound.Start = start;
            bound.End = end;

            Bound = bound;
            Type = type;
        }
Beispiel #5
0
 string GetClassificationStringForPreprocessedText(PreprocessedTextType type)
 {
     switch (type)
     {
         case PreprocessedTextType.Comment:
             return "markdown.htmlcomment";
         case PreprocessedTextType.FilteredOut:
             return null;
         case PreprocessedTextType.Metadata:
             return "markdown.metadata";
         case PreprocessedTextType.Reference:
             return "markdown.url.definition";
         default:
             return null;
     }
 }
Beispiel #6
0
        string GetClassificationStringForPreprocessedText(PreprocessedTextType type)
        {
            switch (type)
            {
            case PreprocessedTextType.Comment:
                return("markdown.htmlcomment");

            case PreprocessedTextType.FilteredOut:
                return(null);

            case PreprocessedTextType.Metadata:
                return("markdown.metadata");

            case PreprocessedTextType.Reference:
                return("markdown.url.definition");

            default:
                return(null);
            }
        }
Beispiel #7
0
 public PreprocessedTextBound(PreprocessedTextType type, Interval bound)
 {
     Bound = bound;
     Type  = type;
 }
 public PreprocessedTextBound(PreprocessedTextType type, Interval bound)
 {
     Bound = bound;
     Type = type;
 }