import { TextSplittableAction } from './splittable-action.abstract';
import { CodeAnnotation } from '../annotations/code-annotation';
/**
 * Action to toggle code annotation
 */
export class CodeAnnotationAction extends TextSplittableAction {
  constructor(code) {
    super();
    this.isFlushable = true;
    this.code = code;
  }
  /**
   * Converts the action to an annotation
   *
   * @returns {CodeAnnotation} the annotation
   */
  toAnnotation() {
    return new CodeAnnotation(this.code);
  }
}
