public static SpanConstructor AsDirectiveToken(this SpanConstructor self, DirectiveTokenDescriptor descriptor) { return(self .With(new DirectiveTokenChunkGenerator(descriptor)) .With(new DirectiveTokenEditHandler((content) => SpanConstructor.TestTokenizer(content))) .Accepts(AcceptedCharactersInternal.NonWhiteSpace)); }
public static SpanConstructor AsCodeMarkup(this SpanConstructor self) { return(self .With(new ImplicitExpressionEditHandler( (content) => SpanConstructor.TestTokenizer(content), CSharpCodeParser.DefaultKeywords, acceptTrailingDot: true)) .With(new MarkupChunkGenerator()) .Accepts(AcceptedCharactersInternal.AnyExceptNewline)); }
internal virtual Block ConfigureAndAddSpanToBlock(BlockBuilder block, SpanConstructor span) { switch (block.Type) { case BlockKindInternal.Markup: span.With(new MarkupChunkGenerator()); break; case BlockKindInternal.Statement: span.With(new StatementChunkGenerator()); break; case BlockKindInternal.Expression: block.ChunkGenerator = new ExpressionChunkGenerator(); span.With(new ExpressionChunkGenerator()); break; } block.Children.Add(span); return(block.Build()); }
public static SpanConstructor AutoCompleteWith( this SpanConstructor self, string autoCompleteString, bool atEndOfSpan) { return(self.With(new AutoCompleteEditHandler( (content) => SpanConstructor.TestTokenizer(content), autoCompleteAtEndOfSpan: atEndOfSpan) { AutoCompleteString = autoCompleteString })); }
public SpanConstructor AsStatement() { return(_self.With(new StatementChunkGenerator())); }
public static SpanConstructor Accepts(this SpanConstructor self, AcceptedCharactersInternal accepted) { return(self.With(eh => eh.AcceptedCharacters = accepted)); }