jiebi/CodeConvo huggingface dataset:
async function openEditor(editor: EditorInputWithOptions | IUntypedEditorInput, group?: PreferredGroup): Promise<IEditorPane | undefined> { if (useOpenEditors) { <ins> // The type safety isn't super good here, so we assist with runtime checks // Open editors expects untyped or editor input with options, you cannot pass a typed editor input // without options if (!isEditorInputWithOptions(editor) && isEditorInput(editor)) { editor = { editor: editor, options: {} }; } </ins> const panes = await service.openEditors([editor], group); return panes[0]; }
assert.ok(typedEditor instanceof TestFileEditorInput); assert.strictEqual(typedEditor?.resource?.toString(), untypedEditorReplacement.resource.toString()); <del> assert.strictEqual(editorFactoryCalled, 2); </del> <ins> assert.strictEqual(editorFactoryCalled, 3); </ins> assert.strictEqual(untitledEditorFactoryCalled, 0); assert.strictEqual(diffEditorFactoryCalled, 0);
addNewLine?: boolean; } <ins> /** * A matcher that runs on a sub-section of a terminal command's output */ </ins> export interface ITerminalOutputMatcher { <ins> /** * A string or regex to match against the unwrapped line. */ </ins> lineMatcher: string | RegExp; <del> anchor?: 'top' | 'bottom'; offset?: number; length?: number; </del> <ins> /** * Which side of the output to anchor the {@link offset} and {@link length} against. */ anchor: 'top' | 'bottom'; /** * How far from either the top or the bottom of the butter to start matching against. */ offset: number; /** * The number of rows to match against, this should be as small as possible for performance * reasons. */ length: number; </ins> } export interface IXtermTerminal {
export function gitSimilarCommand(): ITerminalContextualActionOptions { return { commandLineMatcher: GitCommandLineRegex, <del> outputMatcher: { lineMatcher: GitSimilarOutputRegex, anchor: 'bottom' }, </del> <ins> outputMatcher: { lineMatcher: GitSimilarOutputRegex, anchor: 'bottom', offset: 0, length: 3 }, </ins> actionName: (matchResult: ContextualMatchResult) => matchResult.outputMatch ? `Run git ${matchResult.outputMatch[1]}` : ``, exitStatus: false, getActions: (matchResult: ContextualMatchResult, command: ITerminalCommand) => {
return { actionName: (matchResult: ContextualMatchResult) => matchResult.outputMatch ? `Free port ${matchResult.outputMatch[1]}` : '', commandLineMatcher: AnyCommandLineRegex, <del> outputMatcher: !isWindows ? { lineMatcher: FreePortOutputRegex, anchor: 'bottom' } : undefined, </del> <ins> // TODO: Support free port on Windows https://github.com/microsoft/vscode/issues/161775 outputMatcher: isWindows ? undefined : { lineMatcher: FreePortOutputRegex, anchor: 'bottom', offset: 0, length: 20 }, exitStatus: false, </ins> getActions: (matchResult: ContextualMatchResult, command: ITerminalCommand) => { const port = matchResult?.outputMatch?.[1]; if (!port) {
return { actionName: (matchResult: ContextualMatchResult) => matchResult.outputMatch ? `Git push ${matchResult.outputMatch[1]}` : '', commandLineMatcher: GitPushCommandLineRegex, <del> outputMatcher: { lineMatcher: GitPushOutputRegex, anchor: 'bottom' }, </del> <ins> outputMatcher: { lineMatcher: GitPushOutputRegex, anchor: 'bottom', offset: 0, length: 5 }, </ins> exitStatus: false, getActions: (matchResult: ContextualMatchResult, command: ITerminalCommand) => { const branch = matchResult?.outputMatch?.[1];
return { actionName: (matchResult: ContextualMatchResult) => matchResult.outputMatch ? `Create PR for ${matchResult.outputMatch[1]}` : '', commandLineMatcher: GitPushCommandLineRegex, <del> outputMatcher: { lineMatcher: GitCreatePrOutputRegex, anchor: 'bottom' }, </del> <ins> outputMatcher: { lineMatcher: GitCreatePrOutputRegex, anchor: 'bottom', offset: 0, length: 5 }, </ins> exitStatus: true, getActions: (matchResult: ContextualMatchResult, command?: ITerminalCommand) => { if (!command) {
"default": false, "description": "%config.rebaseWhenSync%" }, <del> "git.fetchBeforeCheckout": { </del> <ins> "git.pullBeforeCheckout": { </ins> "type": "boolean", "scope": "resource", "default": false, <del> "description": "%config.fetchBeforeCheckout%" </del> <ins> "description": "%config.pullBeforeCheckout%" </ins> }, "git.fetchOnPull": { "type": "boolean",
"config.rebaseWhenSync": "Force git to use rebase when running the sync command.", "config.confirmEmptyCommits": "Always confirm the creation of empty commits for the 'Git: Commit Empty' command.", "config.fetchOnPull": "When enabled, fetch all branches when pulling. Otherwise, fetch just the current one.", <del> "config.fetchBeforeCheckout": "Controls whether a branch that does not have outgoing commits is fast-forwarded before it is checked out.", </del> <ins> "config.pullBeforeCheckout": "Controls whether a branch that does not have outgoing commits is fast-forwarded before it is checked out.", </ins> "config.pullTags": "Fetch all tags when pulling.", "config.pruneOnFetch": "Prune when fetching.", "config.autoStash": "Stash any changes before pulling and restore them after successful pull.",
} const config = workspace.getConfiguration('git', Uri.file(this.repository.root)); <del> const fetchBeforeCheckout = config.get<boolean>('fetchBeforeCheckout', false) === true; </del> <ins> const pullBeforeCheckout = config.get<boolean>('pullBeforeCheckout', false) === true; </ins> <del> if (fetchBeforeCheckout) { </del> <ins> if (pullBeforeCheckout) { </ins> await this.repository.fastForwardBranch(this.ref.name!); }
import { sha1Hex } from 'vs/base/browser/hash'; import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; import { IActivityService, NumberBadge } from 'vs/workbench/services/activity/common/activity'; <ins> import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; </ins> registerSingleton(IEditSessionsLogService, EditSessionsLogService, InstantiationType.Delayed); registerSingleton(IEditSessionsStorageService, EditSessionsWorkbenchService, InstantiationType.Delayed);
// Run the store action to get back a ref let ref: string | undefined; if (shouldStoreEditSession) { <del> ref = await that.progressService.withProgress({ location: ProgressLocation.Notification, type: 'syncing', title: localize('store your edit session', 'Storing your edit session...') }, async () => that.storeEditSession(false)); </del> <ins> ref = await that.storeEditSession(false); </ins> } let uri = workspaceUri ?? await that.pickContinueEditSessionDestination();
} else if (ref !== undefined) { this.notificationService.warn(localize('no edit session content for ref', 'Could not resume edit session contents for ID {0}.', ref)); } <del> this.logService.info(ref !== undefined ? `Aborting resuming edit session as no edit session content is available to be applied from ref ${ref}.` : `Aborting resuming edit session as no edit session content is available to be applied`); </del> <ins> this.logService.info(`Aborting resuming edit session as no edit session content is available to be applied from ref ${ref}.`); </ins> return; } const editSession = data.editSession;
import { ITextModelService } from 'vs/editor/common/services/resolverService'; import { ILifecycleService } from 'vs/workbench/services/lifecycle/common/lifecycle'; import { IDialogService } from 'vs/platform/dialogs/common/dialogs'; <ins> import { IEditorService, ISaveAllEditorsOptions } from 'vs/workbench/services/editor/common/editorService'; </ins> const folderName = 'test-folder'; const folderUri = URI.file(`/${folderName}`);
instantiationService.stub(ITextModelService, new class extends mock<ITextModelService>() { override registerTextModelContentProvider = () => ({ dispose: () => { } }); }); <ins> instantiationService.stub(IEditorService, new class extends mock<IEditorService>() { override saveAll = async (_options: ISaveAllEditorsOptions) => true; }); </ins> editSessionsContribution = instantiationService.createInstance(EditSessionsContribution); });
if (!state.conflicting && !state.isInputIncluded(inputNumber)) { result.push( !state.isInputIncluded(inputNumber) <del> ? command(localize('accept', "$(pass) Accept {0}", inputData.title), async () => { </del> <ins> ? command(localize('accept', "Accept {0}", inputData.title), async () => { </ins> transaction((tx) => { model.setState( modifiedBaseRange,
const stateToggles: IContentWidgetAction[] = []; if (state.input1) { <del> result.push(command(localize('remove', "$(error) Remove {0}", model.input1.title), async () => { </del> <ins> result.push(command(localize('remove', "Remove {0}", model.input1.title), async () => { </ins> transaction((tx) => { model.setState( modifiedBaseRange,
if (viewModel.model.unhandledConflictsCount.get() > 0) { const confirmResult = await dialogService.confirm({ type: 'info', <del> message: localize('mergeEditor.acceptMerge.unhandledConflicts', "There are still unhandled conflicts. Are you sure you want to accept the merge?"), primaryButton: localize('mergeEditor.acceptMerge.unhandledConflicts.accept', "Complete merge with unhandled conflicts"), </del> <ins> message: localize('mergeEditor.acceptMerge.unhandledConflicts.message', "Do you want to complete the merge of {0}?", basename(inputModel.resultUri)), detail: localize('mergeEditor.acceptMerge.unhandledConflicts.detail', "The file contains unhandled conflicts."), primaryButton: localize('mergeEditor.acceptMerge.unhandledConflicts.accept', "Complete with Conflicts"), </ins> secondaryButton: localize('mergeEditor.acceptMerge.unhandledConflicts.cancel', "Cancel"), });
*  Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ <del> import { Promises } from 'vs/base/node/pfs'; </del> import * as cp from 'child_process'; <del> import * as stream from 'stream'; import * as nls from 'vs/nls'; </del> import * as net from 'net'; <del> import * as path from 'vs/base/common/path'; import * as strings from 'vs/base/common/strings'; </del> <ins> import * as stream from 'stream'; </ins> import * as objects from 'vs/base/common/objects'; <ins> import * as path from 'vs/base/common/path'; </ins> import * as platform from 'vs/base/common/platform'; <del> import { ExtensionsChannelId } from 'vs/platform/extensionManagement/common/extensionManagement'; import { IOutputService } from 'vs/workbench/services/output/common/output'; import { IDebugAdapterExecutable, IDebuggerContribution, IPlatformSpecificAdapterContribution, IDebugAdapterServer, IDebugAdapterNamedPipeServer } from 'vs/workbench/contrib/debug/common/debug'; </del> <ins> import * as strings from 'vs/base/common/strings'; import { Promises } from 'vs/base/node/pfs'; import * as nls from 'vs/nls'; </ins> import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'; <ins> import { IDebugAdapterExecutable, IDebugAdapterNamedPipeServer, IDebugAdapterServer, IDebuggerContribution, IPlatformSpecificAdapterContribution } from 'vs/workbench/contrib/debug/common/debug'; </ins> import { AbstractDebugAdapter } from '../common/abstractDebugAdapter'; /**
this._onError.fire(error); }); <del> const outputService = this.outputService; if (outputService) { const sanitize = (s: string) => s.toString().replace(/r?n$/mg, ''); // this.serverProcess.stdout.on('data', (data: string) => { // 	console.log('%c' + sanitize(data), 'background: #ddd; font-style: italic;'); // }); this.serverProcess.stderr!.on('data', (data: string) => { const channel = outputService.getChannel(ExtensionsChannelId); channel?.append(sanitize(data)); }); } else { this.serverProcess.stderr!.resume(); } </del> <ins> this.serverProcess.stderr!.resume(); </ins> // finally connect to the DA this.connect(this.serverProcess.stdout!, this.serverProcess.stdin!);
const fs = require('fs'); const cp = require('child_process'); const yarnVersion = cp.execSync('yarn -v', { encoding: 'utf8' }).trim(); <del> const parsedYarnVersion = /^(d+).(d+)./.exec(yarnVersion); </del> <ins> const parsedYarnVersion = /^(d+).(d+).(d+)/.exec(yarnVersion); </ins> const majorYarnVersion = parseInt(parsedYarnVersion[1]); const minorYarnVersion = parseInt(parsedYarnVersion[2]); <del> if (majorYarnVersion < 1 || minorYarnVersion < 10) { console.error('033[1;31m*** Please use yarn >=1.10.1.033[0;0m'); </del> <ins> const patchYarnVersion = parseInt(parsedYarnVersion[3]); if ( majorYarnVersion < 1 || majorYarnVersion === 1 && ( minorYarnVersion < 10 || (minorYarnVersion === 10 && patchYarnVersion < 1) ) || majorYarnVersion >= 2 ) { console.error('033[1;31m*** Please use yarn >=1.10.1 and <2.033[0;0m'); </ins> err = true; }
} } <del> const LINK_REGEX = /[([^]]+)](((?:https?://|command:|file:)[^)s]+)(?: ("|')([^3]+)(3))?)/gi; </del> <ins> const LINK_REGEX = /[([^]]+)](((?:https?://|command:|file:)[^)s]+)(?: (["'])(.+?)(3))?)/gi; </ins> export function parseLinkedText(text: string): LinkedText { const result: LinkedTextNode[] = [];
'...' ]); }); <ins> test('Should match non-greedily', () => { assert.deepStrictEqual(parseLinkedText('a [link text 1](http://link.href "title1") b [link text 2](http://link.href "title2") c').nodes, [ 'a ', { label: 'link text 1', href: 'http://link.href', title: 'title1' }, ' b ', { label: 'link text 2', href: 'http://link.href', title: 'title2' }, ' c', ]); }); </ins> });
this.instantiationService.createInstance(ReloadAction), this.instantiationService.createInstance(ExtensionStatusLabelAction), this.instantiationService.createInstance(ActionWithDropDownAction, 'extensions.updateActions', '', <del> [[this.instantiationService.createInstance(UpdateAction)], [this.instantiationService.createInstance(SkipUpdateAction)]]), </del> <ins> [[this.instantiationService.createInstance(UpdateAction, true)], [this.instantiationService.createInstance(SkipUpdateAction)]]), </ins> this.instantiationService.createInstance(SetColorThemeAction), this.instantiationService.createInstance(SetFileIconThemeAction), this.instantiationService.createInstance(SetProductIconThemeAction),
export class UpdateAction extends AbstractUpdateAction { constructor( <ins> private readonly verbose: boolean, </ins> @IExtensionsWorkbenchService override readonly extensionsWorkbenchService: IExtensionsWorkbenchService, @IInstantiationService protected readonly instantiationService: IInstantiationService, ) { super(`extensions.update`, localize('update', "Update"), extensionsWorkbenchService); } <ins> override update(): void { super.update(); if (this.extension) { this.label = this.verbose ? localize('update to', "Update to v{0}", this.extension.latestVersion) : localize('update', "Update"); } } </ins> override async run(): Promise<any> { if (!this.extension) { return;
actionbar.onDidRun(({ error }) => error && this.notificationService.error(error)); const extensionStatusIconAction = this.instantiationService.createInstance(ExtensionStatusAction); <del> const reloadAction = this.instantiationService.createInstance(ReloadAction); </del> const actions = [ this.instantiationService.createInstance(ExtensionStatusLabelAction), this.instantiationService.createInstance(MigrateDeprecatedExtensionAction, true), <del> reloadAction, </del> <ins> this.instantiationService.createInstance(ReloadAction), </ins> this.instantiationService.createInstance(ActionWithDropDownAction, 'extensions.updateActions', '', <del> [[this.instantiationService.createInstance(UpdateAction)], [this.instantiationService.createInstance(SkipUpdateAction)]]), </del> <ins> [[this.instantiationService.createInstance(UpdateAction, false)], [this.instantiationService.createInstance(SkipUpdateAction)]]), </ins> this.instantiationService.createInstance(InstallDropdownAction), this.instantiationService.createInstance(InstallingLabelAction), this.instantiationService.createInstance(SetLanguageAction),
this.instantiationService.createInstance(SwitchToPreReleaseVersionAction, true), this.instantiationService.createInstance(ManageExtensionAction) ]; <del> const extensionHoverWidget = this.instantiationService.createInstance(ExtensionHoverWidget, { target: root, position: this.options.hoverOptions.position }, extensionStatusIconAction, reloadAction); </del> <ins> const extensionHoverWidget = this.instantiationService.createInstance(ExtensionHoverWidget, { target: root, position: this.options.hoverOptions.position }, extensionStatusIconAction); </ins> const widgets = [ recommendationWidget,
import { EnablementState, IExtensionManagementServerService } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; import { IExtensionIgnoredRecommendationsService, IExtensionRecommendationsService } from 'vs/workbench/services/extensionRecommendations/common/extensionRecommendations'; import { ILabelService } from 'vs/platform/label/common/label'; <del> import { extensionButtonProminentBackground, ExtensionStatusAction, ReloadAction } from 'vs/workbench/contrib/extensions/browser/extensionsActions'; </del> <ins> import { extensionButtonProminentBackground, ExtensionStatusAction } from 'vs/workbench/contrib/extensions/browser/extensionsActions'; </ins> import { IThemeService, ThemeIcon, registerThemingParticipant } from 'vs/platform/theme/common/themeService'; import { EXTENSION_BADGE_REMOTE_BACKGROUND, EXTENSION_BADGE_REMOTE_FOREGROUND } from 'vs/workbench/common/theme'; import { Emitter, Event } from 'vs/base/common/event';
constructor( private readonly options: ExtensionHoverOptions, private readonly extensionStatusAction: ExtensionStatusAction, <del> private readonly reloadAction: ReloadAction, </del> @IExtensionsWorkbenchService private readonly extensionsWorkbenchService: IExtensionsWorkbenchService, @IHoverService private readonly hoverService: IHoverService, @IConfigurationService private readonly configurationService: IConfigurationService,
markdown.appendText(`n`); } <ins> if (this.extension.outdated) { markdown.appendMarkdown(localize('updateRequired', "Latest version:")); markdown.appendMarkdown(`&nbsp;<span style="background-color:#8080802B;">**&nbsp;_v${this.extension.latestVersion}_**&nbsp;</span>`); markdown.appendText(`n`); } </ins> const preReleaseMessage = ExtensionHoverWidget.getPreReleaseMessage(this.extension); const extensionRuntimeStatus = this.extensionsWorkbenchService.getExtensionStatus(this.extension); const extensionStatus = this.extensionStatusAction.status; <del> const reloadRequiredMessage = this.reloadAction.enabled ? this.reloadAction.tooltip : ''; </del> <ins> const reloadRequiredMessage = this.extension.reloadRequiredStatus; </ins> const recommendationMessage = this.getRecommendationMessage(this.extension); if (extensionRuntimeStatus || extensionStatus || reloadRequiredMessage || recommendationMessage || preReleaseMessage) {
"update-grammar": "node ../node_modules/vscode-grammar-updater/bin dotnet/csharp-tmLanguage grammars/csharp.tmLanguage ./syntaxes/csharp.tmLanguage.json" }, "contributes": { <ins> "configurationDefaults": { "[csharp]": { "editor.maxTokenizationLineLength": 2500 } }, </ins> "languages": [ { "id": "csharp",
}); this.body = append(this.element, $('.pane-body')); <del> this.renderBody(this.body); </del> <ins> // Only render the body if it will be visible // Otherwise, render it when the pane is expanded if (!this._bodyRendered && this.isExpanded()) { this.renderBody(this.body); this._bodyRendered = true; } </ins> if (!this.isExpanded()) { this.body.remove();
*  Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ <del> .monaco-workbench .merge-editor .code-view>.title { </del> <ins> .monaco-workbench .merge-editor .code-view > .header { </ins> padding: 0 10px; height: 30px; display: flex; align-content: center; <ins> overflow: hidden; </ins> } <del> .monaco-workbench .merge-editor .code-view>.title>SPAN { </del> <ins> .monaco-workbench .merge-editor .code-view > .header > span { </ins> align-self: center; text-overflow: ellipsis; overflow: hidden;
white-space: nowrap; } <del> .monaco-workbench .merge-editor .code-view>.title>SPAN.title { </del> <ins> .monaco-workbench .merge-editor .code-view > .header > span.title { </ins> flex-shrink: 0; } <del> .monaco-workbench .merge-editor .code-view>.title>SPAN.description { </del> <ins> .monaco-workbench .merge-editor .code-view > .header > span.description { flex-shrink: 0; </ins> display: flex; font-size: 12px; align-items: center; color: var(--vscode-descriptionForeground); } <del> .monaco-workbench .merge-editor .code-view>.title>SPAN.description .codicon { </del> <ins> .monaco-workbench .merge-editor .code-view > .header > span.description .codicon { </ins> font-size: 14px; color: var(--vscode-descriptionForeground); } <del> .monaco-workbench .merge-editor .code-view>.title>SPAN.detail { </del> <ins> .monaco-workbench .merge-editor .code-view > .header > span.detail { </ins> margin-left: auto; <del> flex-shrink: 0; </del> font-size: 12px; color: var(--vscode-descriptionForeground); } <ins> .monaco-workbench .merge-editor .code-view > .header > span.detail .codicon { font-size: 13px; } </ins> /* for input1|2 -> align details to the left  */ <del> .monaco-workbench .merge-editor .code-view.input>.title>SPAN.detail::before { </del> <ins> .monaco-workbench .merge-editor .code-view.input > .header > span.detail::before { </ins> content: '•'; opacity: .5; padding-right: 3px; } <del> .monaco-workbench .merge-editor .code-view.input>.title>SPAN.detail { </del> <ins> .monaco-workbench .merge-editor .code-view.input > .header > span.detail { </ins> margin-left: 0; } <del> .monaco-workbench .merge-editor .code-view.input>.title>SPAN.toolbar { </del> <ins> .monaco-workbench .merge-editor .code-view.input > .header > span.toolbar { flex-shrink: 0; </ins> margin-left: auto; } <del> .monaco-workbench .merge-editor .code-view>.title>SPAN.detail .codicon { font-size: 13px; } .monaco-workbench .merge-editor .code-view>.container { </del> <ins> .monaco-workbench .merge-editor .code-view > .container { </ins> display: flex; flex-direction: row; } <del> .monaco-workbench .merge-editor .code-view>.container>.gutter { </del> <ins> .monaco-workbench .merge-editor .code-view > .container > .gutter { </ins> width: 24px; position: relative; overflow: hidden;