jiebi/CodeConvo huggingface dataset:
@ITaskService private readonly _taskService: ITaskService, @IConfigurationService private readonly _configurationService: IConfigurationService, @IWorkspaceTrustManagementService private readonly _workspaceTrustManagementService: IWorkspaceTrustManagementService, <del> @ILogService private readonly _logService: ILogService) { </del> <ins> @ILogService private readonly _logService: ILogService, @IStorageService private readonly _storageService: IStorageService, @IOpenerService private readonly _openerService: IOpenerService, @INotificationService private readonly _notificationService: INotificationService) { </ins> super(); this._tryRunTasks(); }
await Event.toPromise(Event.once(this._taskService.onDidChangeTaskSystemInfo)); } <del> this._logService.trace('RunAutomaticTasks: Checking if automatic tasks should run.'); const isFolderAutomaticAllowed = this._configurationService.getValue(ALLOW_AUTOMATIC_TASKS) !== 'off'; await this._workspaceTrustManagementService.workspaceTrustInitialized; const isWorkspaceTrusted = this._workspaceTrustManagementService.isWorkspaceTrusted(); // Only run if allowed. Prompting for permission occurs when a user first tries to run a task. if (isFolderAutomaticAllowed && isWorkspaceTrusted) { this._taskService.getWorkspaceTasks(TaskRunSource.FolderOpen).then(workspaceTaskResult => { const { tasks } = RunAutomaticTasks._findAutoTasks(this._taskService, workspaceTaskResult); this._logService.trace(`RunAutomaticTasks: Found ${tasks.length} automatic tasks tasks`); if (tasks.length > 0) { RunAutomaticTasks._runTasks(this._taskService, tasks); } }); } </del> <ins> const workspaceTasks = await this._taskService.getWorkspaceTasks(TaskRunSource.FolderOpen); this._logService.trace(`RunAutomaticTasks: Found ${workspaceTasks.size} automatic tasks`); await RunAutomaticTasks.runWithPermission(this._taskService, this._storageService, this._notificationService, this._workspaceTrustManagementService, this._openerService, this._configurationService, workspaceTasks); </ins> } private static _runTasks(taskService: ITaskService, tasks: Array<Task | Promise<Task | undefined>>) {
return { tasks, taskNames, locations }; } <del> public static async promptForPermission(taskService: ITaskService, storageService: IStorageService, notificationService: INotificationService, workspaceTrustManagementService: IWorkspaceTrustManagementService, </del> <ins> public static async runWithPermission(taskService: ITaskService, storageService: IStorageService, notificationService: INotificationService, workspaceTrustManagementService: IWorkspaceTrustManagementService, </ins> openerService: IOpenerService, configurationService: IConfigurationService, workspaceTaskResult: Map<string, IWorkspaceFolderTaskResult>) { const isWorkspaceTrusted = workspaceTrustManagementService.isWorkspaceTrusted; <del> if (!isWorkspaceTrusted) { </del> <ins> if (!isWorkspaceTrusted || configurationService.getValue(ALLOW_AUTOMATIC_TASKS) === 'off') { </ins> return; } <del> if (configurationService.getValue(ALLOW_AUTOMATIC_TASKS) === 'off') { </del> <ins> const hasShownPromptForAutomaticTasks = storageService.getBoolean(HAS_PROMPTED_FOR_AUTOMATIC_TASKS, StorageScope.WORKSPACE, false); const { tasks, taskNames, locations } = RunAutomaticTasks._findAutoTasks(taskService, workspaceTaskResult); if (taskNames.length === 0) { </ins> return; } <del> const hasShownPromptForAutomaticTasks = storageService.getBoolean(HAS_PROMPTED_FOR_AUTOMATIC_TASKS, StorageScope.WORKSPACE, undefined); const { tasks, taskNames, locations } = RunAutomaticTasks._findAutoTasks(taskService, workspaceTaskResult); if (taskNames.length > 0) { if (configurationService.getValue(ALLOW_AUTOMATIC_TASKS) === 'on') { RunAutomaticTasks._runTasks(taskService, tasks); } else if (!hasShownPromptForAutomaticTasks) { // We have automatic tasks, prompt to allow. this._showPrompt(notificationService, storageService, openerService, configurationService, taskNames, locations).then(allow => { if (allow) { RunAutomaticTasks._runTasks(taskService, tasks); } }); } </del> <ins> if (configurationService.getValue(ALLOW_AUTOMATIC_TASKS) === 'on') { RunAutomaticTasks._runTasks(taskService, tasks); } else if (configurationService.getValue(ALLOW_AUTOMATIC_TASKS) === 'auto' && !hasShownPromptForAutomaticTasks) { // by default, only prompt once per folder // otherwise, this can be configured via the setting this._showPrompt(notificationService, storageService, openerService, configurationService, taskNames, locations).then(allow => { if (allow) { storageService.store(HAS_PROMPTED_FOR_AUTOMATIC_TASKS, true, StorageScope.WORKSPACE, StorageTarget.USER); RunAutomaticTasks._runTasks(taskService, tasks); } }); </ins> } }
type: 'string', enum: ['on', 'auto', 'off'], enumDescriptions: [ <del> nls.localize('ttask.allowAutomaticTasks.on', "Always"), </del> <ins> nls.localize('task.allowAutomaticTasks.on', "Always"), </ins> nls.localize('task.allowAutomaticTasks.auto', "Prompt for permission for each folder"), nls.localize('task.allowAutomaticTasks.off', "Never"), ], <del> description: nls.localize('task.allowAutomaticTasks', "Enable automatic tasks in the folder."), </del> <ins> description: nls.localize('task.allowAutomaticTasks', "Enable automatic tasks in the folder - note that tasks won't run in an untrusted workspace."), </ins> default: 'auto', restricted: true },
display: block; } <ins> .timeline-tree-view .monaco-list .monaco-list-row .custom-view-tree-node-item > .custom-view-tree-node-item-icon, </ins> .customview-tree .monaco-list .monaco-list-row .custom-view-tree-node-item > .custom-view-tree-node-item-resourceLabel > .custom-view-tree-node-item-icon { background-size: 16px; background-position: left center;
constructor(controllerId: string, controllerLabel: string, editors: ExtHostDocumentsAndEditors) { super({ controllerId, <del> getDocumentVersion: (uri: URI) => editors.getDocument(uri)?.version, </del> <ins> getDocumentVersion: uri => uri && editors.getDocument(uri)?.version, </ins> getApiFor: getPrivateApiFor as (impl: TestItemImpl) => ITestItemApi<TestItemImpl>, getChildren: (item) => item.children as ITestChildrenLike<TestItemImpl>, root: new TestItemRootImpl(controllerId, controllerLabel),
super({ id: 'editor.createFoldingRangeFromSelection', label: nls.localize('createManualFoldRange.label', "Create Manual Folding Range from Selection"), <del> alias: 'Create Folding Range from Selection', </del> <ins> alias: 'Create Manual Folding Range from Selection', </ins> precondition: CONTEXT_FOLDING_ENABLED, kbOpts: { kbExpr: EditorContextKeys.editorTextFocus,
private readonly _onDidChangeExpansionState = this._register(new Emitter<boolean>()); readonly onDidChangeExpansionState: Event<boolean> = this._onDidChangeExpansionState.event; <ins> get ariaHeaderLabel(): string { return this._ariaHeaderLabel; } set ariaHeaderLabel(newLabel: string) { this._ariaHeaderLabel = newLabel; this.header.setAttribute('aria-label', this.ariaHeaderLabel); } </ins> get draggableElement(): HTMLElement { return this.header; }
super(); this._expanded = typeof options.expanded === 'undefined' ? true : !!options.expanded; this._orientation = typeof options.orientation === 'undefined' ? Orientation.VERTICAL : options.orientation; <del> this.ariaHeaderLabel = localize('viewSection', "{0} Section", options.title); </del> <ins> this._ariaHeaderLabel = localize('viewSection', "{0} Section", options.title); </ins> this._minimumBodySize = typeof options.minimumBodySize === 'number' ? options.minimumBodySize : this._orientation === Orientation.HORIZONTAL ? 200 : 120; this._maximumBodySize = typeof options.maximumBodySize === 'number' ? options.maximumBodySize : Number.POSITIVE_INFINITY;
const title = workspace.folders.map(folder => folder.name).join(); titleElement.textContent = this.name; titleElement.title = title; <del> titleElement.setAttribute('aria-label', nls.localize('explorerSection', "Explorer Section: {0}", this.name)); </del> <ins> this.ariaHeaderLabel = nls.localize('explorerSection', "Explorer Section: {0}", this.name); titleElement.setAttribute('aria-label', this.ariaHeaderLabel); </ins> }; this._register(this.contextService.onDidChangeWorkspaceName(setHeader));
NoPathFound = 'NoPathFound', UnknownPath = 'UnknownPath', EmptyCommitMessage = 'EmptyCommitMessage', <del> BranchFastForwardRejected = 'BranchFastForwardRejected' </del> <ins> BranchFastForwardRejected = 'BranchFastForwardRejected', TagConflict = 'TagConflict' </ins> }
} } <ins> async fetchTags(options: { remote: string; tags: string[]; force?: boolean }): Promise<void> { const args = ['fetch']; const spawnOptions: SpawnOptions = { env: { 'GIT_HTTP_USER_AGENT': this.git.userAgent } }; args.push(options.remote); for (const tag of options.tags) { args.push(`refs/tags/${tag}:refs/tags/${tag}`); } if (options.force) { args.push('--force'); } await this.exec(args, spawnOptions); } </ins> async pull(rebase?: boolean, remote?: string, branch?: string, options: PullOptions = {}): Promise<void> { const args = ['pull'];
err.gitErrorCode = GitErrorCodes.CantLockRef; } else if (/cannot rebase onto multiple branches/i.test(err.stderr || '')) { err.gitErrorCode = GitErrorCodes.CantRebaseMultipleBranches; <ins> } else if (/! [rejected].*(would clobber existing tag)/m.test(err.stderr || '')) { err.gitErrorCode = GitErrorCodes.TagConflict; </ins> } throw err;
import { Branch, Change, ForcePushMode, GitErrorCodes, LogOptions, Ref, RefType, Remote, Status, CommitOptions, BranchQuery, FetchOptions } from './api/git'; import { AutoFetcher } from './autofetch'; import { debounce, memoize, throttle } from './decorators'; <del> import { Commit, GitError, Repository as BaseRepository, Stash, Submodule, LogFileOptions } from './git'; </del> <ins> import { Commit, GitError, Repository as BaseRepository, Stash, Submodule, LogFileOptions, PullOptions } from './git'; </ins> import { StatusBarCommands } from './statusbar'; import { toGitUri } from './uri'; import { anyEvent, combinedDisposable, debounceEvent, dispose, EmptyDisposable, eventToPromise, filterEvent, find, IDisposable, isDescendant, onceEvent, pathEquals, relativePath } from './util';
} if (await this.checkIfMaybeRebased(this.HEAD?.name)) { <del> await this.repository.pull(rebase, remote, branch, { unshallow, tags }); </del> <ins> this._pullAndHandleTagConflict(rebase, remote, branch, { unshallow, tags }); </ins> } }); }); } <ins> private async _pullAndHandleTagConflict(rebase?: boolean, remote?: string, branch?: string, options: PullOptions = {}): Promise<void> { try { await this.repository.pull(rebase, remote, branch, options); } catch (err) { if (err.gitErrorCode !== GitErrorCodes.TagConflict) { throw err; } // Handle tag(s) conflict if (await this.handleTagConflict(remote, err.stderr)) { await this.repository.pull(rebase, remote, branch, options); } } } </ins> @throttle async push(head: Branch, forcePushMode?: ForcePushMode): Promise<void> { let remote: string | undefined;
return config.get<boolean>('optimisticUpdate') === true; } <ins> private async handleTagConflict(remote: string | undefined, raw: string): Promise<boolean> { // Ensure there is a remote remote = remote ?? this.HEAD?.upstream?.remote; if (!remote) { throw new Error('Unable to resolve tag conflict due to missing remote.'); } // Extract tag names from message const tags: string[] = []; for (const match of raw.matchAll(/^ ! [rejected]s+([^s]+)s+->s+([^s]+)s+(would clobber existing tag)$/gm)) { if (match.length === 3) { tags.push(match[1]); } } if (tags.length === 0) { throw new Error(`Unable to extract tag names from error message: ${raw}`); } // Notification const replaceLocalTags = l10n.t('Replace Local Tag(s)'); const message = l10n.t('Unable to pull from remote repository due to conflicting tag(s): {0}. Would you like to resolve the conflict by replacing the local tag(s)?', tags.join(', ')); const choice = await window.showErrorMessage(message, { modal: true }, replaceLocalTags); if (choice !== replaceLocalTags) { return false; } // Force fetch tags await this.repository.fetchTags({ remote, tags, force: true }); return true; } </ins> public isBranchProtected(name: string = this.HEAD?.name ?? ''): boolean { return this.isBranchProtectedMatcher ? this.isBranchProtectedMatcher(name) : false; }
description: nls.localize('vscode.extension.contributes.terminal', 'Contributes terminal functionality.'), type: 'object', properties: { <del> types: { type: 'array', description: nls.localize('vscode.extension.contributes.terminal.types', "Defines additional terminal types that the user can create."), items: { type: 'object', required: ['command', 'title'], properties: { command: { description: nls.localize('vscode.extension.contributes.terminal.types.command', "Command to execute when the user creates this type of terminal."), type: 'string', }, title: { description: nls.localize('vscode.extension.contributes.terminal.types.title', "Title for this type of terminal."), type: 'string', }, icon: { description: nls.localize('vscode.extension.contributes.terminal.types.icon', "A codicon, URI, or light and dark URIs to associate with this terminal type."), anyOf: [{ type: 'string', }, { type: 'object', properties: { light: { description: nls.localize('vscode.extension.contributes.terminal.types.icon.light', 'Icon path when a light theme is used'), type: 'string' }, dark: { description: nls.localize('vscode.extension.contributes.terminal.types.icon.dark', 'Icon path when a dark theme is used'), type: 'string' } } }] }, }, }, }, </del> profiles: { type: 'array', description: nls.localize('vscode.extension.contributes.terminal.profiles', "Defines additional terminal profiles that the user can create."),
await timeout(0); const instance = this.activeInstance; if (instance) { <ins> // HACK: Ensure the panel is still visible at this point as there may have been // a request since it was opened to show a different panel if (pane && !pane.isVisible()) { await this._viewsService.openView(TERMINAL_VIEW_ID, focus); } </ins> await instance.focusWhenReady(true); // HACK: as a workaround for https://github.com/microsoft/vscode/issues/134692, // this will trigger a forced refresh of the viewport to sync the viewport and scroll bar.
if (pane && !pane.isVisible()) { await this._viewsService.openView(TERMINAL_VIEW_ID, focus); } <del> await instance.focusWhenReady(true); </del> <ins> // Do not await the focus as setVisible must be called immediately to ensure // something else didn't steal focus instance.focusWhenReady(true); </ins> // HACK: as a workaround for https://github.com/microsoft/vscode/issues/134692, // this will trigger a forced refresh of the viewport to sync the viewport and scroll bar. // This can likely be removed after https://github.com/xtermjs/xterm.js/issues/291 is
import { Disposable, DisposableStore, IDisposable, toDisposable } from 'vs/base/common/lifecycle'; import { ResourceMap } from 'vs/base/common/map'; import { Schemas } from 'vs/base/common/network'; <del> import { isEqual } from 'vs/base/common/resources'; </del> <ins> import { basename, isEqual } from 'vs/base/common/resources'; </ins> import { isDefined } from 'vs/base/common/types'; import { URI } from 'vs/base/common/uri'; import { IAccessibilityService } from 'vs/platform/accessibility/common/accessibility';
import { NotebookOutputRendererInfo, NotebookStaticPreloadInfo as NotebookStaticPreloadInfo } from 'vs/workbench/contrib/notebook/common/notebookOutputRenderer'; import { NotebookEditorDescriptor, NotebookProviderInfo } from 'vs/workbench/contrib/notebook/common/notebookProvider'; import { INotebookSerializer, INotebookService, SimpleNotebookProviderInfo } from 'vs/workbench/contrib/notebook/common/notebookService'; <del> import { DiffEditorInputFactoryFunction, EditorInputFactoryFunction, EditorInputFactoryObject, IEditorResolverService, IEditorType, RegisteredEditorInfo, RegisteredEditorPriority, UntitledEditorInputFactoryFunction } from 'vs/workbench/services/editor/common/editorResolverService'; </del> <ins> import { DiffEditorInputFactoryFunction, EditorInputFactoryFunction, EditorInputFactoryObject, IEditorResolverService, IEditorType, RegisteredEditorInfo, RegisteredEditorPriority, UntitledEditorInputFactoryFunction, type MergeEditorInputFactoryFunction } from 'vs/workbench/services/editor/common/editorResolverService'; </ins> import { IExtensionService, isProposedApiEnabled } from 'vs/workbench/services/extensions/common/extensions'; import { IExtensionPointUser } from 'vs/workbench/services/extensions/common/extensionsRegistry'; import { InstallRecommendedExtensionAction } from 'vs/workbench/contrib/extensions/browser/extensionsActions'; import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; import { INotebookDocument, INotebookDocumentService } from 'vs/workbench/services/notebook/common/notebookDocumentService'; <ins> import { MergeEditorInput } from 'vs/workbench/contrib/mergeEditor/browser/mergeEditorInput'; import type { EditorInputWithOptions, IResourceMergeEditorInput } from 'vs/workbench/common/editor'; </ins> export class NotebookProviderInfoStore extends Disposable {
const notebookDiffEditorInputFactory: DiffEditorInputFactoryFunction = ({ modified, original, label, description }) => { return { editor: NotebookDiffEditorInput.create(this._instantiationService, modified.resource!, label, description, original.resource!, notebookProviderInfo.id) }; }; <ins> const mergeEditorInputFactory: MergeEditorInputFactoryFunction = (mergeEditor: IResourceMergeEditorInput): EditorInputWithOptions => { return { editor: this._instantiationService.createInstance( MergeEditorInput, mergeEditor.base.resource, { uri: mergeEditor.input1.resource, title: mergeEditor.input1.label ?? basename(mergeEditor.input1.resource), description: mergeEditor.input1.description ?? '', detail: mergeEditor.input1.detail }, { uri: mergeEditor.input2.resource, title: mergeEditor.input2.label ?? basename(mergeEditor.input2.resource), description: mergeEditor.input2.description ?? '', detail: mergeEditor.input2.detail }, mergeEditor.result.resource ) }; }; </ins> const notebookFactoryObject: EditorInputFactoryObject = { createEditorInput: notebookEditorInputFactory, createDiffEditorInput: notebookDiffEditorInputFactory, createUntitledEditorInput: notebookUntitledEditorFactory, <ins> createMergeEditorInput: mergeEditorInputFactory </ins> }; const notebookCellFactoryObject: EditorInputFactoryObject = { createEditorInput: notebookEditorInputFactory,
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { EditSessionsDataViews } from 'vs/workbench/contrib/editSessions/browser/editSessionsViews'; import { EditSessionsFileSystemProvider } from 'vs/workbench/contrib/editSessions/browser/editSessionsFileSystemProvider'; <del> import { isNative } from 'vs/base/common/platform'; </del> <ins> import { isNative, isWeb } from 'vs/base/common/platform'; </ins> import { VirtualWorkspaceContext, WorkspaceFolderCountContext } from 'vs/workbench/common/contextkeys'; import { CancellationToken, CancellationTokenSource } from 'vs/base/common/cancellation'; import { equals } from 'vs/base/common/objects';
} private async autoStoreEditSession() { <del> if (this.configurationService.getValue('workbench.experimental.cloudChanges.autoStore') === 'onShutdown') { </del> <ins> if (this.configurationService.getValue('workbench.experimental.cloudChanges.autoStore') === 'onShutdown' && !isWeb) { </ins> const cancellationTokenSource = new CancellationTokenSource(); await this.progressService.withProgress({ location: ProgressLocation.Window,
'type': 'string', 'tags': ['experimental', 'usesOnlineServices'], 'default': 'off', <del> 'markdownDescription': localize('autoStoreWorkingChangesDescription', "Controls whether to automatically store available working changes in the cloud for the current workspace."), </del> <ins> 'markdownDescription': localize('autoStoreWorkingChangesDescription', "Controls whether to automatically store available working changes in the cloud for the current workspace. This setting has no effect in the web."), </ins> }, 'workbench.cloudChanges.autoResume': { enum: ['onReload', 'off'],
this.shouldShowViewsContext = EDIT_SESSIONS_SHOW_VIEW.bindTo(this.contextKeyService); this._register(this.fileService.registerProvider(EditSessionsFileSystemProvider.SCHEMA, new EditSessionsFileSystemProvider(this.editSessionsStorageService))); <del> this.lifecycleService.onWillShutdown((e) => e.join(this.autoStoreEditSession(), { id: 'autoStoreWorkingChanges', label: localize('autoStoreWorkingChanges', 'Storing current working changes...') })); </del> <ins> this.lifecycleService.onWillShutdown((e) => { if (this.configurationService.getValue('workbench.experimental.cloudChanges.autoStore') === 'onShutdown' && !isWeb) { e.join(this.autoStoreEditSession(), { id: 'autoStoreWorkingChanges', label: localize('autoStoreWorkingChanges', 'Storing current working changes...') }); } }); </ins> this._register(this.editSessionsStorageService.onDidSignIn(() => this.updateAccountsMenuBadge())); this._register(this.editSessionsStorageService.onDidSignOut(() => this.updateAccountsMenuBadge())); }
} private async autoStoreEditSession() { <del> if (this.configurationService.getValue('workbench.experimental.cloudChanges.autoStore') === 'onShutdown' && !isWeb) { const cancellationTokenSource = new CancellationTokenSource(); await this.progressService.withProgress({ location: ProgressLocation.Window, type: 'syncing', title: localize('store working changes', 'Storing working changes...') }, async () => this.storeEditSession(false, cancellationTokenSource.token), () => { cancellationTokenSource.cancel(); cancellationTokenSource.dispose(); }); } </del> <ins> const cancellationTokenSource = new CancellationTokenSource(); await this.progressService.withProgress({ location: ProgressLocation.Window, type: 'syncing', title: localize('store working changes', 'Storing working changes...') }, async () => this.storeEditSession(false, cancellationTokenSource.token), () => { cancellationTokenSource.cancel(); cancellationTokenSource.dispose(); }); </ins> } private registerViews() {
return ResolvedStatus.NONE; } <del> // If it's the currently active editor we shouldn't do anything const activeEditor = group.activeEditor; const isActive = activeEditor ? activeEditor.matches(untypedEditor) : false; if (activeEditor && isActive) { return { editor: activeEditor, options, group }; } </del> const input = await this.doResolveEditor(untypedEditor, group, selectedEditor); if (conflictingDefault && input) { // Show the conflicting default dialog
import { EditorActivation, IResourceEditorInput } from 'vs/platform/editor/common/editor'; import { URI } from 'vs/base/common/uri'; import { Event } from 'vs/base/common/event'; <del> import { DEFAULT_EDITOR_ASSOCIATION, EditorCloseContext, EditorsOrder, IEditorCloseEvent, EditorInputWithOptions, IEditorPane, IResourceDiffEditorInput, isEditorInputWithOptions, IUntitledTextResourceEditorInput, IUntypedEditorInput, SideBySideEditor } from 'vs/workbench/common/editor'; </del> <ins> import { DEFAULT_EDITOR_ASSOCIATION, EditorCloseContext, EditorsOrder, IEditorCloseEvent, EditorInputWithOptions, IEditorPane, IResourceDiffEditorInput, isEditorInputWithOptions, IUntitledTextResourceEditorInput, IUntypedEditorInput, SideBySideEditor, isEditorInput } from 'vs/workbench/common/editor'; </ins> import { workbenchInstantiationService, TestServiceAccessor, registerTestEditor, TestFileEditorInput, ITestInstantiationService, registerTestResourceEditor, registerTestSideBySideEditor, createEditorPart, registerTestFileEditor, TestTextFileEditor, TestSingletonFileEditorInput } from 'vs/workbench/test/browser/workbenchTestServices'; import { EditorService } from 'vs/workbench/services/editor/browser/editorService'; import { IEditorGroup, IEditorGroupsService, GroupDirection, GroupsArrangement } from 'vs/workbench/services/editor/common/editorGroupsService';