Example #1
0
 public CompletionItem(ExpressionInfo info, string token, Range replaceRange, string script, Action<string, int, int> insertionCallback)
 {
     this.info = info;
     this.token = token;
     this.replaceRange = replaceRange;
     this.script = script;
     this.insertionCallback = insertionCallback;
 }
Example #2
0
        public static string Replace(this string str, Range range, string replacement)
        {
            var builder = new StringBuilder(str.Length - range.NumberOfElements + replacement.Length);

            builder.Append(str.Substring(0, range.Start));
            builder.Append(replacement);
            builder.Append(str.Substring(range.Start + range.NumberOfElements));

            return builder.ToString();
        }
Example #3
0
 public CodeCompletionResult(IEnumerable<ExpressionInfo> expressionInfos, Token activeToken, Range replaceRange)
 {
     ExpressionInfos = expressionInfos;
     ActiveToken = activeToken;
     ReplaceRange = replaceRange;
 }
Example #4
0
 public TokenResult(IEnumerable<Token> tokens, Range lastToken)
 {
     this.Tokens = tokens;
     this.LastTokenRange = lastToken;
 }