jiebi/CodeConvo huggingface dataset:
} override async run(): Promise<void> { <del> if (!this.extension) { </del> <ins> if (!this.extension?.local) { </ins> return; } <del> if (this.server) { this.extensionsWorkbenchService.open(this.extension); alert(localize('installExtensionStart', "Installing extension {0} started. An editor is now open with more details on this extension", this.extension.displayName)); if (this.extension.gallery) { await this.server.extensionManagementService.installFromGallery(this.extension.gallery, { installPreReleaseVersion: this.extension.local?.preRelease }); } else { const vsix = await this.extension.server!.extensionManagementService.zip(this.extension.local!); await this.server.extensionManagementService.install(vsix); } </del> <ins> if (!this.extension?.server) { return; } if (!this.server) { return; } this.extensionsWorkbenchService.open(this.extension); alert(localize('installExtensionStart', "Installing extension {0} started. An editor is now open with more details on this extension", this.extension.displayName)); const gallery = this.extension.gallery ?? (this.extensionGalleryService.isEnabled() && (await this.extensionGalleryService.getExtensions([this.extension.identifier], CancellationToken.None))[0]); if (gallery) { await this.server.extensionManagementService.installFromGallery(gallery, { installPreReleaseVersion: this.extension.local.preRelease }); return; } const targetPlatform = await this.server.extensionManagementService.getTargetPlatform(); if (!isTargetPlatformCompatible(this.extension.local.targetPlatform, [this.extension.local.targetPlatform], targetPlatform)) { throw new Error(localize('incompatible', "Can't install '{0}' extension because it is not compatible.", this.extension.identifier.id)); </ins> } <ins> const vsix = await this.extension.server.extensionManagementService.zip(this.extension.local); await this.server.extensionManagementService.install(vsix); </ins> } protected abstract getInstallLabel(): string;
@IExtensionsWorkbenchService extensionsWorkbenchService: IExtensionsWorkbenchService, @IExtensionManagementServerService extensionManagementServerService: IExtensionManagementServerService, @IExtensionManifestPropertiesService extensionManifestPropertiesService: IExtensionManifestPropertiesService, <ins> @IExtensionGalleryService extensionGalleryService: IExtensionGalleryService, </ins> ) { <del> super(`extensions.remoteinstall`, extensionManagementServerService.remoteExtensionManagementServer, canInstallAnyWhere, extensionsWorkbenchService, extensionManagementServerService, extensionManifestPropertiesService); </del> <ins> super(`extensions.remoteinstall`, extensionManagementServerService.remoteExtensionManagementServer, canInstallAnyWhere, extensionsWorkbenchService, extensionManagementServerService, extensionManifestPropertiesService, extensionGalleryService); </ins> } protected getInstallLabel(): string {
@IExtensionsWorkbenchService extensionsWorkbenchService: IExtensionsWorkbenchService, @IExtensionManagementServerService extensionManagementServerService: IExtensionManagementServerService, @IExtensionManifestPropertiesService extensionManifestPropertiesService: IExtensionManifestPropertiesService, <ins> @IExtensionGalleryService extensionGalleryService: IExtensionGalleryService, </ins> ) { <del> super(`extensions.localinstall`, extensionManagementServerService.localExtensionManagementServer, false, extensionsWorkbenchService, extensionManagementServerService, extensionManifestPropertiesService); </del> <ins> super(`extensions.localinstall`, extensionManagementServerService.localExtensionManagementServer, false, extensionsWorkbenchService, extensionManagementServerService, extensionManifestPropertiesService, extensionGalleryService); </ins> } protected getInstallLabel(): string {
@IExtensionsWorkbenchService extensionsWorkbenchService: IExtensionsWorkbenchService, @IExtensionManagementServerService extensionManagementServerService: IExtensionManagementServerService, @IExtensionManifestPropertiesService extensionManifestPropertiesService: IExtensionManifestPropertiesService, <ins> @IExtensionGalleryService extensionGalleryService: IExtensionGalleryService, </ins> ) { <del> super(`extensions.webInstall`, extensionManagementServerService.webExtensionManagementServer, false, extensionsWorkbenchService, extensionManagementServerService, extensionManifestPropertiesService); </del> <ins> super(`extensions.webInstall`, extensionManagementServerService.webExtensionManagementServer, false, extensionsWorkbenchService, extensionManagementServerService, extensionManifestPropertiesService, extensionGalleryService); </ins> } protected getInstallLabel(): string {
renderElement(node: ITreeNode<Call, FuzzyScore>, _index: number, template: CallRenderingTemplate): void { const { element, filterData } = node; const deprecated = element.item.tags?.includes(SymbolTag.Deprecated); <ins> template.icon.className = ''; </ins> template.icon.classList.add('inline', ...CSSIcon.asClassNameArray(SymbolKinds.toIcon(element.item.kind))); template.label.setLabel( element.item.name,
comment: ['The task command line or label'] }, 'Executing task: {0}', commandLine), { excludeLeadingNewLine: true }) + taskShellIntegrationOutputSequence; } <ins> } else { shellLaunchConfig.initialText = taskShellIntegrationStartSequence + taskShellIntegrationOutputSequence; </ins> } } else { const commandExecutable = (task.command.runtime !== RuntimeType.CustomExecution) ? CommandString.value(command) : undefined;
comment: ['The task command line or label'] }, 'Executing task: {0}', `${shellLaunchConfig.executable} ${getArgsToEcho(shellLaunchConfig.args)}`), { excludeLeadingNewLine: true }) + taskShellIntegrationOutputSequence; } <ins> } else { shellLaunchConfig.initialText = taskShellIntegrationStartSequence + taskShellIntegrationOutputSequence; </ins> } }
/** * A string including ANSI escape sequences that will be written to the terminal emulator <del> * _before_ the terminal process has launched, a trailing n is added at the end of the string. * This allows for example the terminal instance to display a styled message as the first line * of the terminal. Use x1b over 033 or e for the escape control character. </del> <ins> * _before_ the terminal process has launched, when a string is specified, a trailing n is * added at the end. This allows for example the terminal instance to display a styled message * as the first line of the terminal. Use x1b over 033 or e for the escape control character. </ins> */ <del> initialText?: string; </del> <ins> initialText?: string | { text: string; trailingNewLine: boolean }; </ins> /** * Custom PTY/pseudoterminal process to use.
executableEnv, options }; <del> const persistentProcess = new PersistentTerminalProcess(id, process, workspaceId, workspaceName, shouldPersist, cols, rows, processLaunchOptions, unicodeVersion, this._reconnectConstants, this._logService, isReviving ? shellLaunchConfig.initialText : undefined, rawReviveBuffer, shellLaunchConfig.icon, shellLaunchConfig.color, shellLaunchConfig.name, shellLaunchConfig.fixedDimensions); </del> <ins> const persistentProcess = new PersistentTerminalProcess(id, process, workspaceId, workspaceName, shouldPersist, cols, rows, processLaunchOptions, unicodeVersion, this._reconnectConstants, this._logService, isReviving && typeof shellLaunchConfig.initialText === 'string' ? shellLaunchConfig.initialText : undefined, rawReviveBuffer, shellLaunchConfig.icon, shellLaunchConfig.color, shellLaunchConfig.name, shellLaunchConfig.fixedDimensions); </ins> process.onDidChangeProperty(property => this._onDidChangeProperty.fire({ id, property })); process.onProcessExit(event => { persistentProcess.dispose();
}, 'Executing task: {0}', commandLine), { excludeLeadingNewLine: true }) + this.taskShellIntegrationOutputSequence; } } else { <del> shellLaunchConfig.initialText = this.taskShellIntegrationStartSequence + this.taskShellIntegrationOutputSequence; </del> <ins> shellLaunchConfig.initialText = { text: this.taskShellIntegrationStartSequence + this.taskShellIntegrationOutputSequence, trailingNewLine: false }; </ins> } } else { const commandExecutable = (task.command.runtime !== RuntimeType.CustomExecution) ? CommandString.value(command) : undefined;
}, 'Executing task: {0}', `${shellLaunchConfig.executable} ${getArgsToEcho(shellLaunchConfig.args)}`), { excludeLeadingNewLine: true }) + this.taskShellIntegrationOutputSequence; } } else { <del> shellLaunchConfig.initialText = this.taskShellIntegrationStartSequence + this.taskShellIntegrationOutputSequence; </del> <ins> shellLaunchConfig.initialText = { text: this.taskShellIntegrationStartSequence + this.taskShellIntegrationOutputSequence, trailingNewLine: false }; </ins> } }
// Write initial text, deferring onLineFeed listener when applicable to avoid firing // onLineData events containing initialText if (this._shellLaunchConfig.initialText) { <del> this.xterm.raw.writeln(this._shellLaunchConfig.initialText, () => { </del> <ins> this._writeInitialText(this.xterm, () => { </ins> lineDataEventAddon.onLineData(e => this._onLineData.fire(e)); }); } else {
} } <ins> private _writeInitialText(xterm: XtermTerminal, callback?: () => void): void { if (!this._shellLaunchConfig.initialText) { callback?.(); return; } const text = typeof this._shellLaunchConfig.initialText === 'string' ? this._shellLaunchConfig.initialText : this._shellLaunchConfig.initialText?.text; if (typeof this._shellLaunchConfig.initialText === 'string') { xterm.raw.writeln(text, callback); } else { if (this._shellLaunchConfig.initialText.trailingNewLine) { xterm.raw.writeln(text, callback); } else { xterm.raw.write(text, callback); } } } </ins> async reuseTerminal(shell: IShellLaunchConfig, reset: boolean = false): Promise<void> { // Unsubscribe any key listener we may have. this._pressAnyKeyToCloseListener?.dispose(); this._pressAnyKeyToCloseListener = undefined; <del> if (this.xterm) { </del> <ins> const xterm = this.xterm; if (xterm) { </ins> if (!reset) { // Ensure new processes' output starts at start of new line <del> await new Promise<void>(r => this.xterm!.raw.write('nx1b[G', r)); </del> <ins> await new Promise<void>(r => xterm.raw.write('nx1b[G', r)); </ins> } // Print initialText if specified if (shell.initialText) { <del> await new Promise<void>(r => this.xterm!.raw.writeln(shell.initialText!, r)); </del> <ins> await new Promise<void>(r => this._writeInitialText(xterm, r)); </ins> } // Clean up waitOnExit state if (this._isExiting && this._shellLaunchConfig.waitOnExit) { <del> this.xterm.raw.options.disableStdin = false; </del> <ins> xterm.raw.options.disableStdin = false; </ins> this._isExiting = false; } if (reset) { <del> this.xterm.clearDecorations(); </del> <ins> xterm.clearDecorations(); </ins> } }
private async smartCommit( repository: Repository, getCommitMessage: () => Promise<string | undefined>, <del> opts?: CommitOptions </del> <ins> opts: CommitOptions </ins> ): Promise<boolean> { const config = workspace.getConfiguration('git', Uri.file(repository.root)); let promptToSaveFilesBeforeCommit = config.get<'always' | 'staged' | 'never'>('promptToSaveFilesBeforeCommit');
} } <del> if (!opts) { opts = { all: noStagedChanges }; } else if (!opts.all && noStagedChanges && !opts.empty) { opts = { ...opts, all: true }; } </del> // no changes, and the user has not configured to commit all in this case <del> if (!noUnstagedChanges && noStagedChanges && !enableSmartCommit && !opts.empty) { </del> <ins> if (!noUnstagedChanges && noStagedChanges && !enableSmartCommit && !opts.empty && !opts.all) { </ins> const suggestSmartCommit = config.get<boolean>('suggestSmartCommit') === true; if (!suggestSmartCommit) {
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { ITerminalCommand, TerminalCapability } from 'vs/platform/terminal/common/capabilities/capabilities'; import { TerminalCapabilityStoreMultiplexer } from 'vs/platform/terminal/common/capabilities/terminalCapabilityStore'; <del> import { IProcessDataEvent, IProcessPropertyMap, IShellLaunchConfig, ITerminalDimensionsOverride, ITerminalLaunchError, ProcessPropertyType, TerminalIcon, TerminalLocation, TerminalSettingId, TerminalShellType, TitleEventSource, WindowsShellType } from 'vs/platform/terminal/common/terminal'; </del> <ins> import { IProcessDataEvent, IProcessPropertyMap, IShellLaunchConfig, ITerminalDimensionsOverride, ITerminalLaunchError, PosixShellType, ProcessPropertyType, TerminalIcon, TerminalLocation, TerminalSettingId, TerminalShellType, TitleEventSource, WindowsShellType } from 'vs/platform/terminal/common/terminal'; </ins> import { escapeNonWindowsPath } from 'vs/platform/terminal/common/terminalEnvironment'; import { activeContrastBorder, scrollbarSliderActiveBackground, scrollbarSliderBackground, scrollbarSliderHoverBackground } from 'vs/platform/theme/common/colorRegistry'; import { IColorTheme, ICssStyleCollector, IThemeService, registerThemingParticipant, ThemeIcon } from 'vs/platform/theme/common/themeService';
} get disableShellIntegrationReporting(): boolean { if (this._disableShellIntegrationReporting === undefined) { <del> this._disableShellIntegrationReporting = this.shellLaunchConfig.isFeatureTerminal || this.shellLaunchConfig.hideFromUser || this.shellLaunchConfig.executable === undefined; </del> <ins> this._disableShellIntegrationReporting = (this.shellLaunchConfig.hideFromUser || this.shellLaunchConfig.executable === undefined || this.shellType === undefined) || !shellIntegrationSupportedShellTypes.includes(this.shellType); </ins> } return this._disableShellIntegrationReporting; }
"terminal.ansiBrightMagenta": "#6c71c4", "terminal.ansiBrightCyan": "#93a1a1", "terminal.ansiBrightWhite": "#fdf6e3", <ins> // Set terminal background explicitly, otherwise selection becomes invisible when the // terminal is in the side bar "terminal.background": "#FDF6E3", </ins> // Interactive Playground "walkThrough.embeddedEditorBackground": "#00000014" },
DataTransfers.RESOURCES, ]); <del> export function addExternalEditorsDropData(dataTransfer: VSDataTransfer, dragEvent: DragEvent) { if (dragEvent.dataTransfer && !dataTransfer.has(Mimes.uriList)) { </del> <ins> export function addExternalEditorsDropData(dataTransfer: VSDataTransfer, dragEvent: DragEvent, overwriteUriList = false) { if (dragEvent.dataTransfer && (overwriteUriList || !dataTransfer.has(Mimes.uriList))) { </ins> const editorData = extractEditorsDropData(dragEvent) .filter(input => input.resource) .map(input => input.resource!.toString());
return notebook.cellAt(notebook.cellCount - 1); } <del> async function addCellAndRun(code: string, notebook: vscode.NotebookDocument) { </del> <ins> async function addCellAndRun(code: string, notebook: vscode.NotebookDocument, i: number) { </ins> const cell = await addCell(code, notebook); <del> await vscode.commands.executeCommand('notebook.execute'); </del> <ins> await vscode.commands.executeCommand('notebook.cell.execute', { start: i, end: i + 1 }); </ins> assert.strictEqual(cell.outputs.length, 1, 'execute failed'); return cell; }
export interface IOutputChannelModel extends IDisposable { readonly onDispose: Event<void>; append(output: string): void; <del> update(mode: OutputChannelUpdateMode, till?: number): void; </del> <ins> update(mode: OutputChannelUpdateMode, till: number | undefined, immediate: boolean): void; </ins> loadModel(): Promise<ITextModel>; clear(): void; replace(value: string): void;
} clear(): void { <del> this.update(OutputChannelUpdateMode.Clear, this.endOffset); </del> <ins> this.update(OutputChannelUpdateMode.Clear, this.endOffset, true); </ins> } <del> update(mode: OutputChannelUpdateMode, till?: number): void { </del> <ins> update(mode: OutputChannelUpdateMode, till: number | undefined, immediate: boolean): void { </ins> const loadModelPromise: Promise<any> = this.loadModelPromise ? this.loadModelPromise : Promise.resolve(); <del> loadModelPromise.then(() => this.doUpdate(mode, till)); </del> <ins> loadModelPromise.then(() => this.doUpdate(mode, till, immediate)); </ins> } loadModel(): Promise<ITextModel> {
return this.model; } <del> private doUpdate(mode: OutputChannelUpdateMode, till?: number): void { </del> <ins> private doUpdate(mode: OutputChannelUpdateMode, till: number | undefined, immediate: boolean): void { </ins> if (mode === OutputChannelUpdateMode.Clear || mode === OutputChannelUpdateMode.Replace) { this.startOffset = this.endOffset = isNumber(till) ? till : this.endOffset; this.cancelModelUpdate();
this.doUpdateModel(model, [EditOperation.delete(model.getFullModelRange())], VSBuffer.fromString('')); } <del> private async appendContent(model: ITextModel, token: CancellationToken): Promise<void> { </del> <ins> private async appendContent(model: ITextModel, immediate: boolean, token: CancellationToken): Promise<void> { </ins> this.appendThrottler.trigger(async () => { /* Abort if operation is cancelled */ if (token.isCancellationRequested) {
const lastLineMaxColumn = model.getLineMaxColumn(lastLine); const edits = [EditOperation.insert(new Position(lastLine, lastLineMaxColumn), contentToAppend.toString())]; this.doUpdateModel(model, edits, contentToAppend); <del> }); </del> <ins> }, immediate ? 0 : undefined); </ins> } private async replaceContent(model: ITextModel, token: CancellationToken): Promise<void> {
if (!this.modelUpdateInProgress) { if (isNumber(size) && this.endOffset > size) { // Reset - Content is removed <del> this.update(OutputChannelUpdateMode.Clear, 0); </del> <ins> this.update(OutputChannelUpdateMode.Clear, 0, true); </ins> } } <del> this.update(OutputChannelUpdateMode.Append); </del> <ins> this.update(OutputChannelUpdateMode.Append, undefined, false /* Not needed to update immediately. Wait to collect more changes and update. */); </ins> } }
override append(message: string): void { this.write(message); <del> this.update(OutputChannelUpdateMode.Append); </del> <ins> this.update(OutputChannelUpdateMode.Append, undefined, this.isVisible()); </ins> } override replace(message: string): void { const till = this._offset; this.write(message); <del> this.update(OutputChannelUpdateMode.Replace, till); </del> <ins> this.update(OutputChannelUpdateMode.Replace, till, true); </ins> } private write(content: string): void {
this.outputChannelModel.then(outputChannelModel => outputChannelModel.append(output)); } <del> update(mode: OutputChannelUpdateMode, till?: number): void { this.outputChannelModel.then(outputChannelModel => outputChannelModel.update(mode, till)); </del> <ins> update(mode: OutputChannelUpdateMode, till: number | undefined, immediate: boolean): void { this.outputChannelModel.then(outputChannelModel => outputChannelModel.update(mode, till, immediate)); </ins> } loadModel(): Promise<ITextModel> {
folders.push({ workingChanges, name: name ?? '' }); } <ins> if (!hasEdits) { this.logService.info('Edit Sessions: Skipping storing edit session as there are no edits to store.'); if (fromStoreCommand) { this.notificationService.info(localize('no edits to store', 'Skipped storing edit session as there are no edits to store.')); } return undefined; } </ins> const data: EditSession = { folders, version: 1 }; try {
let instantiationService: TestInstantiationService; let sessionSyncContribution: SessionSyncContribution; let fileService: FileService; <ins> let sandbox: sinon.SinonSandbox; </ins> const disposables = new DisposableStore(); <del> setup(() => { </del> <ins> suiteSetup(() => { sandbox = sinon.createSandbox(); </ins> instantiationService = new TestInstantiationService(); // Set up filesystem
}; // Stub sync service to return edit session data <del> const sandbox = sinon.createSandbox(); </del> const readStub = sandbox.stub().returns({ editSession, ref: '0' }); instantiationService.stub(ISessionSyncWorkbenchService, 'read', readStub); <del> // Stub repositories instantiationService.stub(ISCMService, '_repositories', new Map()); </del> // Create root folder await fileService.createFolder(folderUri);
// Verify edit session was correctly applied assert.equal((await fileService.readFile(fileUri)).value.toString(), fileContents); }); <ins> test('Edit session not stored if there are no edits', async function () { const writeStub = sandbox.stub(); instantiationService.stub(ISessionSyncWorkbenchService, 'write', writeStub); // Create root folder await fileService.createFolder(folderUri); await sessionSyncContribution.storeEditSession(true); // Verify that we did not attempt to write the edit session assert.equal(writeStub.called, false); }); </ins> });
} extension.contributes?.walkthroughs?.forEach(section => { <del> const categoryID = extension.identifier.value + '#walkthrough#' + section.id; </del> <ins> const categoryID = extension.identifier.value + '#' + section.id; </ins> section.steps.forEach(step => { const fullyQualifiedID = extension.identifier.value + '#' + section.id + '#' + step.id; this.steps.delete(fullyQualifiedID);
* @returns whether the provided parameter is of type `Buffer` or Uint8Array dervived type */ export function isTypedArray(obj: unknown): obj is Object { <ins> const TypedArray = Object.getPrototypeOf(Uint8Array); </ins> return typeof obj === 'object' <del> && (obj instanceof Uint8Array || obj instanceof Uint16Array || obj instanceof Uint32Array || obj instanceof Float32Array || obj instanceof Float64Array || obj instanceof Int8Array || obj instanceof Int16Array || obj instanceof Int32Array || obj instanceof BigInt64Array || obj instanceof BigUint64Array || obj instanceof Uint8ClampedArray); </del> <ins> && obj instanceof TypedArray; </ins> } /**
import { IIdentityProvider } from 'vs/base/browser/ui/list/list'; import { ObjectTree } from 'vs/base/browser/ui/tree/objectTree'; import { ITreeElement } from 'vs/base/browser/ui/tree/tree'; <del> import { IActionableTestTreeElement, TestExplorerTreeElement, TestItemTreeElement } from 'vs/workbench/contrib/testing/browser/explorerProjections/index'; </del> <ins> import { IActionableTestTreeElement, TestExplorerTreeElement, TestItemTreeElement, TestTreeErrorMessage } from 'vs/workbench/contrib/testing/browser/explorerProjections/index'; </ins> <del> export const testIdentityProvider: IIdentityProvider<TestItemTreeElement> = { </del> <ins> export const testIdentityProvider: IIdentityProvider<TestExplorerTreeElement> = { </ins> getId(element) { <del> return element.treeId + '0' + element.test.expand; </del> <ins> return element.treeId + '0' + (element instanceof TestTreeErrorMessage ? 'error' : element.test.expand); </ins> } };
constructor() { super({ id: CONFIGURE_TRUST_COMMAND_ID, <del> title: { original: 'Configure Workspace Trust', value: localize('configureWorkspaceTrust', "Configure Workspace Trust") }, </del> <ins> title: { original: 'Configure Workspace Trust Settings', value: localize('configureWorkspaceTrustSettings', "Configure Workspace Trust Settings") }, </ins> precondition: ContextKeyExpr.and(WorkspaceTrustContext.IsEnabled, ContextKeyExpr.equals(`config.${WORKSPACE_TRUST_ENABLED}`, true)), category: WORKSPACES_CATEGORY, f1: true
this.os = OS; this.userHome = pathService.defaultUriScheme === Schemas.file ? this.pathService.userHome({ preferLocal: true }) : undefined; <del> const memento = this.storedFormattersMemento = new Memento('cachedResourceLabelFormatters', storageService); </del> <ins> const memento = this.storedFormattersMemento = new Memento('cachedResourceLabelFormatters2', storageService); </ins> this.storedFormatters = memento.getMemento(StorageScope.PROFILE, StorageTarget.MACHINE); <del> this.formatters = this.storedFormatters?.formatters || []; </del> <ins> this.formatters = this.storedFormatters?.formatters?.slice() || []; </ins> // Remote environment is potentially long running this.resolveRemoteEnvironment();
test('label caching', () => { <del> const m = new Memento('cachedResourceLabelFormatters', storageService).getMemento(StorageScope.PROFILE, StorageTarget.MACHINE); </del> <ins> const m = new Memento('cachedResourceLabelFormatters2', storageService).getMemento(StorageScope.PROFILE, StorageTarget.MACHINE); </ins> const makeFormatter = (scheme: string): ResourceLabelFormatter => ({ formatting: { label: `${path} (${scheme})`, separator: '/' }, scheme }); assert.deepStrictEqual(m, {});