justTextHighlightResult method

HighlightResult justTextHighlightResult(
  1. String code
)

returns a valid highlight result, without actually doing any actual work, auto highlight starts with this and it's possible for small snippets that auto-detection may not find a better match

Implementation

HighlightResult justTextHighlightResult(String code) {
  final HighlightResult result = HighlightResult(
    code: code,
    illegal: false,
    relevance: 0,
    emitter: _TokenTreeEmitter(),
    top: Mode(
      disableAutodetect: true,
      name: 'Plain text',
      contains: []
    )
  );
  result._emitter.addText(code);
  return result;
}