Allow to diff 2 files in VS Code with command line arguments (fixes #3917)

This commit is contained in:
Benjamin Pasero
2016-03-10 11:36:03 +01:00
parent 0693e8ba31
commit b9c0230510
11 changed files with 119 additions and 45 deletions

View File

@@ -4,8 +4,11 @@
*--------------------------------------------------------------------------------------------*/
'use strict';
import nls = require('vs/nls');
import {TPromise} from 'vs/base/common/winjs.base';
import types = require('vs/base/common/types');
import URI from 'vs/base/common/uri';
import {getPathLabel, IWorkspaceProvider} from 'vs/base/common/labels';
import {isBinaryMime} from 'vs/base/common/mime';
import {EventType} from 'vs/base/common/events';
import {EditorModel, IFileEditorInput, EditorInput, IInputStatus, BaseDiffEditorInput} from 'vs/workbench/common/editor';
@@ -200,4 +203,11 @@ export class DiffEditorInput extends BaseDiffEditorInput {
super.dispose();
}
}
export function toDiffLabel(res1: URI, res2: URI, context: IWorkspaceProvider): string {
let leftName = getPathLabel(res1.fsPath, context);
let rightName = getPathLabel(res2.fsPath, context);
return nls.localize('compareLabels', "{0} ↔ {1}", leftName, rightName);
}