import NormalisationRuleStore from './normalisation-rule-store' ; import SelectionInfoRegistry from './selection-info-registry' ; import { makeUriString } from './utils/text-resource' ; import CommandAdaptor from './adaptors/command' ; import DiffTitleBuilder from './diff-title-builder' ; export default class DiffPresenter { private readonly diffTitleBuilder : DiffTitleBuilder ; constructor ( selectionInfoRegistry , normalisationRuleStore , private readonly commandAdaptor , private readonly getCurrentDate ) { this . getCurrentDate = getCurrentDate ; this . diffTitleBuilder = new DiffTitleBuilder ( normalisationRuleStore , selectionInfoRegistry ) ; this . commandAdaptor = commandAdaptor ; } takeDiff ( textKey1 , textKey2 ) { const getUri = ( textKey ) => makeUriString ( textKey , this . getCurrentDate ( ) ) ; const title = this . diffTitleBuilder . build ( textKey1 , textKey2 ) ; return this . commandAdaptor . executeCommand ( 'vscode.diff' , getUri ( textKey1 ) , getUri ( textKey2 ) , title ) ; } }