jiebi/CodeConvo huggingface dataset:
import { TPromise } from 'vs/base/common/winjs.base'; import editor = require('vs/editor/common/editorCommon'); import aria = require('vs/base/browser/ui/aria/aria'); <ins> import { AIAdapter } from 'vs/base/node/aiAdapter'; </ins> import editorbrowser = require('vs/editor/browser/editorBrowser'); import { IKeybindingService, IKeybindingContextKey } from 'vs/platform/keybinding/common/keybindingService'; import {IMarkerService} from 'vs/platform/markers/common/markers';
this.toDispose.push(this.session.addListener2(debug.SessionEvents.OUTPUT, (event: DebugProtocol.OutputEvent) => { if (event.body && event.body.category === 'telemetry') { <del> this.telemetryService.publicLog(event.body.output, event.body.data); </del> <ins> const key = this.configurationManager.getAdapter().aiKey; // only log telemetry events from debug adapter if the adapter provided the telemetry key if (key) { if (!this.telemetryAdapter) { this.telemetryAdapter = new AIAdapter(key, this.session.getType()); } this.telemetryAdapter.log(event.body.output, event.body.data); } </ins> } else if (event.body && typeof event.body.output === 'string' && event.body.output.length > 0) { this.onOutput(event); }
"config.ignoreLegacyWarning": "Ignores the legacy Git warning", "config.ignoreLimitWarning": "Ignores the warning when there are too many changes in a repository", "config.defaultCloneDirectory": "The default location where to clone a git repository", <del> "config.enableSmartCommit": "Commit all changes when there are no staged changes." </del> <ins> "config.enableSmartCommit": "Commit all changes when there are no staged changes.", "config.enableCommitSigning": "Enables commit signing with GPG." </ins> }  No newline at end of file
): Promise<boolean> { const config = workspace.getConfiguration('git'); const enableSmartCommit = config.get<boolean>('enableSmartCommit') === true; <ins> const enableCommitSigning = config.get<boolean>('enableCommitSigning') === true; </ins> const noStagedChanges = this.model.indexGroup.resources.length === 0; const noUnstagedChanges = this.model.workingTreeGroup.resources.length === 0;
} } <del> async commit(message: string, opts: { all?: boolean, amend?: boolean, signoff?: boolean } = Object.create(null)): Promise<void> { </del> <ins> async commit(message: string, opts: { all?: boolean, amend?: boolean, signoff?: boolean, signCommit?: boolean } = Object.create(null)): Promise<void> { </ins> const args = ['commit', '--quiet', '--allow-empty-message', '--file', '-']; if (opts.all) {
return function () { var desktop = gulp.src('resources/linux/code.desktop', { base: '.' }) .pipe(replace('@@NAME_LONG@@', product.nameLong)) <ins> .pipe(replace('@@NAME_SHORT@@', product.nameShort)) </ins> .pipe(replace('@@NAME@@', product.applicationName)) .pipe(rename('BUILD/usr/share/applications/' + product.applicationName + '.desktop'));
Name=@@NAME_LONG@@ Comment=Code Editing. Redefined. GenericName=Text Editor <del> Exec=/usr/bin/@@NAME@@ %U </del> <ins> Exec=/usr/share/@@NAME@@/@@NAME@@ %U </ins> Icon=@@NAME@@ Type=Application StartupNotify=true <del> StartupWMClass=@@NAME@@ </del> <ins> StartupWMClass=@@NAME_SHORT@@ </ins> Categories=Utility;TextEditor;Development;IDE; MimeType=text/plain; Actions=new-window;
this.focusTerminal(); } })); <ins> this.toDispose.push(DOM.addDisposableListener(this.parentDomElement, 'keyup', (event: KeyboardEvent) => { // Keep terminal open on escape if (event.keyCode === 27) { event.stopPropagation(); } })); </ins> this.toDispose.push(this.themeService.onDidThemeChange((themeId) => { <del> this.setTerminalTheme(themeId); </del> <ins> this.setTerminalTheme(); })); this.toDispose.push(this.configurationService.onDidUpdateConfiguration((e) => { this.setTerminalFont(); </ins> })); this.terminal.open(this.terminalDomElement); this.parentDomElement.appendChild(terminalScrollbar.getDomNode()); <del> let config = this.configurationService.getConfiguration<ITerminalConfiguration>(); this.terminalDomElement.style.fontFamily = config.terminal.integrated.fontFamily; this.setTerminalTheme(this.themeService.getTheme()); </del> <ins> this.setTerminalFont(); this.setTerminalTheme(); </ins> resolve(void 0); }); } <del> private setTerminalTheme(themeId: string) { </del> <ins> private setTerminalTheme() { </ins> if (!this.terminal) { return; } <del> let baseThemeId = getBaseThemeId(themeId); </del> <ins> let baseThemeId = getBaseThemeId(this.themeService.getTheme()); </ins> this.terminal.colors = DEFAULT_ANSI_COLORS[baseThemeId]; this.terminal.refresh(0, this.terminal.rows); } <ins> private setTerminalFont() { let config = this.configurationService.getConfiguration<ITerminalConfiguration>(); this.terminalDomElement.style.fontFamily = config.terminal.integrated.fontFamily; } </ins> public focus(): void { this.focusTerminal(true); }
private static COMMIT_KEYBINDING = Platform.isMacintosh ? 'Cmd+Enter' : 'Ctrl+Enter'; private static NEED_MESSAGE = nls.localize('needMessage', "Please provide a commit message. You can always press **{0}** to commit changes. If there are any staged changes, only those will be committed; otherwise, all changes will.", ChangesView.COMMIT_KEYBINDING); private static NOTHING_TO_COMMIT = nls.localize('nothingToCommit', "Once there are some changes to commit, type in the commit message and either press **{0}** to commit changes. If there are any staged changes, only those will be committed; otherwise, all changes will.", ChangesView.COMMIT_KEYBINDING); <ins> private static LONG_COMMIT = nls.localize('longCommit', "Great commit summaries are 50 characters or less. Place extra information in next lines."); </ins> private instantiationService: IInstantiationService; private editorService: IWorkbenchEditorService;
placeholder: nls.localize('commitMessage', "Message (press {0} to commit)", ChangesView.COMMIT_KEYBINDING), validationOptions: { showMessage: true, <del> validation: (): InputBox.IMessage => null </del> <ins> validation: (value): InputBox.IMessage => { if (Strings.trim(value.split('n')[0]).length > 50) { return { content: ChangesView.LONG_COMMIT, type: InputBox.MessageType.WARNING }; } return null; } </ins> }, ariaLabel: nls.localize('commitMessageAriaLabel', "Git: Type commit message and press {0} to commit", ChangesView.COMMIT_KEYBINDING), flexibleHeight: true
import { Action, IAction } from 'vs/base/common/actions'; import { ActionItem, BaseActionItem, Separator } from 'vs/base/browser/ui/actionbar/actionbar'; import { Scope, IActionBarRegistry, Extensions as ActionBarExtensions, ActionBarContributor } from 'vs/workbench/browser/actions'; <del> import { GlobalNewUntitledFileAction, SaveFileAsAction, ShowOpenedFileInNewWindow, CopyPathAction, GlobalCopyPathAction, RevealInOSAction, GlobalRevealInOSAction, pasteIntoFocusedFilesExplorerViewItem, FocusOpenEditorsView, FocusFilesExplorer, GlobalCompareResourcesAction, GlobalNewFileAction, GlobalNewFolderAction, RevertFileAction, SaveFilesAction, SaveAllAction, SaveFileAction, MoveFileToTrashAction, TriggerRenameFileAction, PasteFileAction, CopyFileAction, SelectResourceForCompareAction, CompareResourcesAction, NewFolderAction, NewFileAction, OpenToSideAction, ShowActiveFileInExplorer, CollapseExplorerView, RefreshExplorerView, CompareWithSavedAction } from 'vs/workbench/parts/files/browser/fileActions'; </del> <ins> import { GlobalNewUntitledFileAction, SaveFileAsAction, ShowOpenedFileInNewWindow, CopyPathAction, GlobalCopyPathAction, RevealInOSAction, GlobalRevealInOSAction, pasteIntoFocusedFilesExplorerViewItem, FocusOpenEditorsView, FocusFilesExplorer, GlobalCompareResourcesAction, GlobalNewFileAction, GlobalNewFolderAction, RevertFileAction, SaveFilesAction, SaveAllAction, SaveFileAction, MoveFileToTrashAction, TriggerRenameFileAction, PasteFileAction, CopyFileAction, SelectResourceForCompareAction, CompareResourcesAction, NewFolderAction, NewFileAction, OpenToSideAction, ShowActiveFileInExplorer, CollapseExplorerView, RefreshExplorerView, CompareWithSavedAction, CompareWithClipboardAction } from 'vs/workbench/parts/files/browser/fileActions'; </ins> import { revertLocalChangesCommand, acceptLocalChangesCommand, CONFLICT_RESOLUTION_CONTEXT } from 'vs/workbench/parts/files/browser/saveErrorHandler'; import { SyncActionDescriptor, MenuId, MenuRegistry } from 'vs/platform/actions/common/actions'; import { IWorkbenchActionRegistry, Extensions as ActionExtensions } from 'vs/workbench/common/actions';
registry.registerWorkbenchAction(new SyncActionDescriptor(GlobalRevealInOSAction, GlobalRevealInOSAction.ID, GlobalRevealInOSAction.LABEL, { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyCode.KEY_R) }), 'File: Reveal Active File', category); registry.registerWorkbenchAction(new SyncActionDescriptor(ShowOpenedFileInNewWindow, ShowOpenedFileInNewWindow.ID, ShowOpenedFileInNewWindow.LABEL, { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyCode.KEY_O) }), 'File: Open Active File in New Window', category); registry.registerWorkbenchAction(new SyncActionDescriptor(CompareWithSavedAction, CompareWithSavedAction.ID, CompareWithSavedAction.LABEL, { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyCode.KEY_D) }), 'File: Compare Active File with Saved', category); <ins> registry.registerWorkbenchAction(new SyncActionDescriptor(CompareWithClipboardAction, CompareWithClipboardAction.ID, CompareWithClipboardAction.LABEL, { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyCode.KEY_C) }), 'File: Compare Active File with Clipboard', category); </ins> // Commands CommandsRegistry.registerCommand('_files.windowOpen', openWindowCommand);
import { IMessageService, IMessageWithAction, IConfirmation, Severity, CancelAction, IConfirmationResult } from 'vs/platform/message/common/message'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { getCodeEditor } from 'vs/editor/browser/services/codeEditorService'; <del> import { IEditorViewState } from 'vs/editor/common/editorCommon'; </del> <ins> import { IEditorViewState, IModel } from 'vs/editor/common/editorCommon'; </ins> import { IBackupFileService } from 'vs/workbench/services/backup/common/backup'; import { IWindowsService } from 'vs/platform/windows/common/windows'; import { withFocusedFilesExplorer, revealInOSCommand, revealInExplorerCommand, copyPathCommand } from 'vs/workbench/parts/files/browser/fileCommands'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; <del> import { ITextModelService } from 'vs/editor/common/services/resolverService'; </del> <ins> import { ITextModelService, ITextModelContentProvider } from 'vs/editor/common/services/resolverService'; </ins> import { IConfigurationService, ConfigurationTarget } from 'vs/platform/configuration/common/configuration'; import { once } from 'vs/base/common/event'; <ins> import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService'; import { IModeService } from 'vs/editor/common/services/modeService'; import { IModelService } from 'vs/editor/common/services/modelService'; </ins> export interface IEditableData { action: IAction;
} } <ins> export class CompareWithClipboardAction extends Action { public static ID = 'workbench.files.action.compareWithClipboard'; public static LABEL = nls.localize('compareWithClipboard', "Compare Active File with Clipboard"); private static SCHEME = 'clipboard'; private toDispose: IDisposable[]; constructor( id: string, label: string, @IWorkbenchEditorService private editorService: IWorkbenchEditorService, @IInstantiationService private instantiationService: IInstantiationService, @ITextModelService private textModelService: ITextModelService, ) { super(id, label); this.enabled = true; this.toDispose = []; } public run(): TPromise<any> { let resource: URI = toResource(this.editorService.getActiveEditorInput(), { supportSideBySide: true, filter: 'file' } ); const provider = this.instantiationService.createInstance(ClipboardContentProvider); const registrationDisposal = this.textModelService.registerTextModelContentProvider(CompareWithClipboardAction.SCHEME, provider); this.toDispose.push(registrationDisposal); if (resource) { const name = paths.basename(resource.fsPath); const editorLabel = nls.localize('clipboardComparisonLabel', "Clipboard ↔ {0}", name); return this.editorService.openEditor({ leftResource: URI.from({ scheme: CompareWithClipboardAction.SCHEME, path: resource.fsPath }), rightResource: resource, label: editorLabel }); } return TPromise.as(true); } public dispose(): void { super.dispose(); this.toDispose = dispose(this.toDispose); } } class ClipboardContentProvider implements ITextModelContentProvider { constructor( @IClipboardService private clipboardService: IClipboardService, @IModeService private modeService: IModeService, @IModelService private modelService: IModelService ) { } provideTextContent(resource: URI): TPromise<IModel> { const model = this.modelService.createModel(this.clipboardService.readText(), this.modeService.getOrCreateMode('text/plain'), resource); return TPromise.as(model); } } </ins> // Diagnostics support let diag: (...args: any[]) => void; if (!diag) {
getLineNumberAtVerticalOffset(verticalOffset: number): number; getVerticalOffsetForLineNumber(lineNumber: number): number; getWhitespaceAtVerticalOffset(verticalOffset:number): editorCommon.IViewWhitespaceViewportData; <del> shouldSuppressMouseDownOnViewZone(viewZoneId:number): boolean; </del> <ins> shouldSuppressMouseDownOnViewZone(viewZoneId: number): boolean; shouldSuppressMouseDownOnWidget(widgetId: string): boolean; </ins> /** * Decode an Editor.IPosition from a rendered dom node
let targetIsLineNumbers = (t.type === editorCommon.MouseTargetType.GUTTER_LINE_NUMBERS); let selectOnLineNumbers = this._context.configuration.editor.viewInfo.selectOnLineNumbers; let targetIsViewZone = (t.type === editorCommon.MouseTargetType.CONTENT_VIEW_ZONE || t.type === editorCommon.MouseTargetType.GUTTER_VIEW_ZONE); <ins> let targetIsWidget = (t.type === editorCommon.MouseTargetType.CONTENT_WIDGET); </ins> let shouldHandle = e.leftButton; if (platform.isMacintosh && e.ctrlKey) { shouldHandle = false; } <del> if (shouldHandle && (targetIsContent || (targetIsLineNumbers && selectOnLineNumbers))) { </del> <ins> var focus = () => { </ins> if (browser.isIE11orEarlier) { // IE does not want to focus when coming in from the browser's address bar if ((<any>e.browserEvent).fromElement) {
} else if (targetIsViewZone) { let viewZoneData = <editorBrowser.IViewZoneData>t.detail; if (this.viewHelper.shouldSuppressMouseDownOnViewZone(viewZoneData.viewZoneId)) { <ins> focus(); this._mouseDownOperation.start(t.type, e); </ins> e.preventDefault(); } <ins> } else if (targetIsWidget && this.viewHelper.shouldSuppressMouseDownOnWidget(<string>t.detail)) { focus(); e.preventDefault(); </ins> } this.viewController.emitMouseDown({
} return this.viewZones.shouldSuppressMouseDownOnViewZone(viewZoneId); }, <ins> shouldSuppressMouseDownOnWidget: (widgetId: string) => { if (this._isDisposed) { throw new Error('ViewImpl.pointerHandler.shouldSuppressMouseDownOnWidget: View is disposed'); } return this.contentWidgets.shouldSuppressMouseDownOnWidget(widgetId); }, </ins> getPositionFromDOMInfo: (spanNode: HTMLElement, offset: number) => { if (this._isDisposed) { throw new Error('ViewImpl.pointerHandler.getPositionFromDOMInfo: View is disposed');
} } <ins> public shouldSuppressMouseDownOnWidget(widgetId: string): boolean { if (this._widgets.hasOwnProperty(widgetId)) { let widgetData = this._widgets[widgetId]; return widgetData.widget.suppressMouseDown; } return false; } </ins> private _layoutBoxInViewport(position:Position, domNode:HTMLElement, ctx:IRenderingContext): IBoxLayoutResult { let visibleRange = ctx.visibleRangeForPosition(position);
// Escape codes // http://en.wikipedia.org/wiki/ANSI_escape_code const EL = /x1Bx5B[12]?K/g; // Erase in line <del> const LF = /xA/g; // line feed </del> const COLOR_START = /x1b[d+m/g; // Color const COLOR_END = /x1b[0?m/g; // Color export function removeAnsiEscapeCodes(str: string): string { if (str) { str = str.replace(EL, ''); <del> str = str.replace(LF, 'n'); </del> str = str.replace(COLOR_START, ''); str = str.replace(COLOR_END, ''); }
import { Context as SuggestContext } from 'vs/editor/contrib/suggest/browser/suggest'; import { AsyncIterableObject } from 'vs/base/common/async'; import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; <ins> import { ResizableHoverWidget } from 'vs/editor/contrib/hover/browser/resizableHoverWidget'; </ins> const $ = dom.$; export class ContentHoverController extends Disposable { private readonly _participants: IEditorHoverParticipant[]; <del> private readonly _widget = this._register(this._instantiationService.createInstance(ContentHoverWidget, this._editor)); </del> <ins> // INITIALLY: private readonly _widget = this._register(this._instantiationService.createInstance(ContentHoverWidget, this._editor)); private readonly _widget; </ins> private readonly _computer: ContentHoverComputer; private readonly _hoverOperation: HoverOperation<IHoverPart>;
public show(configFileName: string, largeRoots: string, onExecute: () => void) { this._currentHint = { message: largeRoots.length > 0 <del> ? localize('hintExclude', "For better performance exclude folders with many files, like: {0}", largeRoots) : localize('hintExclude.generic', "For better performance exclude folders with many files."), </del> <ins> ? localize('hintExclude', "To enable JavaScript/TypeScript IntelliSense, exclude folders with many files, like: {0}", largeRoots) : localize('hintExclude.generic', "To enable JavaScript/TypeScript IntelliSense, exclude large folders with source files that you do not work on."), </ins> options: [{ title: localize('open', "Configure Excludes"), execute: () => {
}; this._item.tooltip = this._currentHint.message; this._item.text = localize('large.label', "Configure Excludes"); <del> this._item.tooltip = localize('hintExclude.tooltip', "For better performance exclude folders with many files."); </del> <ins> this._item.tooltip = localize('hintExclude.tooltip', "To enable JavaScript/TypeScript IntelliSense, exclude large folders with source files that you do not work on."); </ins> this._item.color = '#A5DF3B'; this._item.show(); this._client.logTelemetry('js.hintProjectExcludes');
} else if (enterAction.indentAction === IndentAction.Indent) { // Indent once <del> executeCommand = TypeOperations.typeCommand(range, beforeText + 'n' + config.normalizeIndentation(indentation + 't' + enterAction.appendText), keepPosition); </del> <ins> executeCommand = TypeOperations.typeCommand(range, beforeText + 'n' + config.normalizeIndentation(indentation + enterAction.appendText), keepPosition); </ins> } else if (enterAction.indentAction === IndentAction.IndentOutdent) { // Ultra special let normalIndent = config.normalizeIndentation(indentation); <del> let increasedIndent = config.normalizeIndentation(indentation + 't' + enterAction.appendText); </del> <ins> let increasedIndent = config.normalizeIndentation(indentation + enterAction.appendText); </ins> let typeText = beforeText + 'n' + increasedIndent + 'n' + normalIndent;
if (!enterResult) { enterResult = { indentAction: IndentAction.None, appendText: '' }; } else { <ins> // Here we add `t` to appendText first because enterAction is leveraging appendText and removeText to change indentation. </ins> if (!enterResult.appendText) { <del> enterResult.appendText = ''; </del> <ins> if ( (enterResult.indentAction === IndentAction.Indent) || (enterResult.indentAction === IndentAction.IndentOutdent) ) { enterResult.appendText = 't'; } else { enterResult.appendText = ''; } </ins> } }
const pathSeparatorClause = '/'; const excludedPathCharactersClause = '[^0s!$`&*()[]+'":;]'; // '":; are allowed in paths but they are often separators so ignore them const escapedExcludedPathCharactersClause = '(s|!|$|`|&|*|(|)|+)'; <del> /** A regex that matches paths in the form /path, ~/path, ./path, ../path */ const UNIX_LIKE_LOCAL_LINK_REGEX = new RegExp('(' + pathPrefix + '?(' + pathSeparatorClause + '(' + excludedPathCharactersClause + '|' + escapedExcludedPathCharactersClause + ')+)+)'); const winPathPrefix = '([a-zA-Z]:|..?|~)'; </del> <ins> /** A regex that matches paths in the form /foo, ~/foo, ./foo, ../foo, foo/bar */ const UNIX_LIKE_LOCAL_LINK_REGEX = new RegExp('((' + pathPrefix + '|(' + excludedPathCharactersClause + '|' + escapedExcludedPathCharactersClause + ')+)?(' + pathSeparatorClause + '(' + excludedPathCharactersClause + '|' + escapedExcludedPathCharactersClause + ')+)+)'); const winDrivePrefix = '[a-zA-Z]:'; const winPathPrefix = '(' + winDrivePrefix + '|..?|~)'; </ins> const winPathSeparatorClause = '(|/)'; const winExcludedPathCharactersClause = '[^0<>?|/s!$`&*()[]+'":;]'; <del> /** A regex that matches paths in the form c:path, ~path, .path */ const WINDOWS_LOCAL_LINK_REGEX = new RegExp('(' + winPathPrefix + '?(' + winPathSeparatorClause + '(' + winExcludedPathCharactersClause + ')+)+)'); </del> <ins> /** A regex that matches paths in the form c:foo, ~foo, .foo, ..foo, foobar */ const WINDOWS_LOCAL_LINK_REGEX = new RegExp('((' + winPathPrefix + '|(' + winExcludedPathCharactersClause + ')+)?(' + winPathSeparatorClause + '(' + winExcludedPathCharactersClause + ')+)+)'); </ins> /** Higher than local link, lower than hypertext */ const CUSTOM_LINK_PRIORITY = -1; /** Lowest */
}); } <del> private _resolvePath(link: string): TPromise<string> { </del> <ins> protected _preprocessPath(link: string): string { </ins> if (this._platform === platform.Platform.Windows) { // Resolve ~ -> %HOMEDRIVE%%HOMEPATH% if (link.charAt(0) === '~') { if (!process.env.HOMEDRIVE || !process.env.HOMEPATH) { <del> return TPromise.as(void 0); </del> <ins> return null; </ins> } link = `${process.env.HOMEDRIVE}${process.env.HOMEPATH + link.substring(1)}`; } <del> } else { // Resolve workspace path . / .. -> <path>/. / <path/.. if (link.charAt(0) === '.') { if (!this._contextService.hasWorkspace) { </del> <ins> // Resolve relative paths (.a, ..a, ~a, ab) if (!link.match('^' + winDrivePrefix)) { if (!this._contextService.hasWorkspace()) { </ins> // Abort if no workspace is open <del> return TPromise.as(void 0); </del> <ins> return null; </ins> } link = path.join(this._contextService.getWorkspace().resource.fsPath, link); } } <del> // Resolve workspace path . / .. -> <path>/. / <path/.. if (link.charAt(0) === '.') { if (!this._contextService.hasWorkspace) { </del> <ins> // Resolve workspace path . | .. | <relative_path> -> <path>/. | <path>/.. | <path>/<relative_path> else if (link.charAt(0) !== '/' && link.charAt(0) !== '~') { if (!this._contextService.hasWorkspace()) { </ins> // Abort if no workspace is open <del> return TPromise.as(void 0); </del> <ins> return null; </ins> } link = path.join(this._contextService.getWorkspace().resource.fsPath, link); } <ins> return link; } private _resolvePath(link: string): TPromise<string> { link = this._preprocessPath(link); if (!link) { return TPromise.as(void 0); } </ins> // Open an editor if the path exists return pfs.fileExists(link).then(isFile => {
import * as assert from 'assert'; import { Platform } from 'vs/base/common/platform'; import { TerminalLinkHandler } from 'vs/workbench/parts/terminal/electron-browser/terminalLinkHandler'; <ins> import { IWorkspace, WorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import URI from 'vs/base/common/uri'; import * as path from 'path'; import * as sinon from 'sinon'; </ins> class TestTerminalLinkHandler extends TerminalLinkHandler { public get localLinkRegex(): RegExp { return this._localLinkRegex; } <ins> public preprocessPath(link: string): string { return this._preprocessPath(link); } </ins> } class TestXterm {
public setHypertextValidationCallback() { } } <ins> class TestURI extends URI { constructor(private _fakePath: string) { super(); }; get fsPath(): string { return this._fakePath; } } class TestWorkspace implements IWorkspace { resource: URI; constructor(basePath: string) { this.resource = new TestURI(basePath); } } </ins> suite('Workbench - TerminalLinkHandler', () => { suite('localLinkRegex', () => { test('Windows', () => {