import DiffPresenter from '../diff-presenter' ; import SelectionInfoRegistry from '../selection-info-registry' ; import { TextKey } from '../const' ; import { Command } from './command' ; import TextEditor from '../adaptors/text-editor' ; export default class CompareSelectionWithText1Command implements Command { constructor ( private readonly diffPresenter , private readonly selectionInfoRegistry ) { } async execute ( editor ) { const textInfo = { text : editor . selectedText , fileName : editor . fileName , lineRanges : editor . selectedLineRanges } ; this . selectionInfoRegistry . set ( TextKey . REGISTER2 , textInfo ) ; await 'HACK' ; await this . diffPresenter . takeDiff ( TextKey . REGISTER1 , TextKey . REGISTER2 ) ; } }