jiebi/CodeConvo huggingface dataset:
} Registry.as<IWorkbenchContributionsRegistry>(WorkbenchExtensions.Workbench).registerWorkbenchContribution(VariableCompletions, LifecyclePhase.Eventually); <del> function getAgentCompletionDetails(agent: IChatAgentData, otherAgents: IChatAgentData[], chatAgentNameService: IChatAgentNameService): { label: string; isDupe: boolean } { const isAllowed = chatAgentNameService.getAgentNameRestriction(agent); const agentLabel = `${chatAgentLeader}${isAllowed ? agent.name : getFullyQualifiedId(agent)}`; const isDupe = isAllowed && !!otherAgents.find(other => other.name === agent.name && other.id !== agent.id); return { label: agentLabel, isDupe }; } </del>
return this.getAgents().filter(a => a.name === name); } <ins> agentHasDupeName(id: string): boolean { const agent = this.getAgent(id); if (!agent) { return false; } return this.getAgentsByName(agent.name) .filter(a => a.extensionId.value !== agent.extensionId.value).length > 0; } </ins> async invokeAgent(id: string, request: IChatAgentRequest, progress: (part: IChatProgress) => void, history: IChatAgentHistoryEntry[], token: CancellationToken): Promise<IChatAgentResult> { const data = this._agents.get(id); if (!data?.impl) {
getAgentByFullyQualifiedId(id: string): IChatAgentData | undefined { throw new Error('Method not implemented.'); } registerAgentCompletionProvider(id: string, provider: (query: string, token: CancellationToken) => Promise<IChatAgentCompletionItem[]>): IDisposable { throw new Error('Method not implemented.'); } getAgentCompletionItems(id: string, query: string, token: CancellationToken): Promise<IChatAgentCompletionItem[]> { throw new Error('Method not implemented.'); } <ins> agentHasDupeName(id: string): boolean { throw new Error('Method not implemented.'); } </ins> } class TestSpeechService implements ISpeechService {
*  Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ <del> import { Emitter } from 'vs/base/common/event'; </del> import { Barrier } from 'vs/base/common/async'; <ins> import { Emitter } from 'vs/base/common/event'; </ins> import { Disposable } from 'vs/base/common/lifecycle'; <del> import { ILifecycleService, WillShutdownEvent, StartupKind, LifecyclePhase, LifecyclePhaseToString, ShutdownReason, BeforeShutdownErrorEvent, InternalBeforeShutdownEvent } from 'vs/workbench/services/lifecycle/common/lifecycle'; import { ILogService } from 'vs/platform/log/common/log'; </del> import { mark } from 'vs/base/common/performance'; <ins> import { ILogService } from 'vs/platform/log/common/log'; </ins> import { IStorageService, StorageScope, StorageTarget, WillSaveStateReason } from 'vs/platform/storage/common/storage'; <ins> import { BeforeShutdownErrorEvent, ILifecycleService, InternalBeforeShutdownEvent, LifecyclePhase, LifecyclePhaseToString, ShutdownReason, StartupKind, WillShutdownEvent } from 'vs/workbench/services/lifecycle/common/lifecycle'; </ins> export abstract class AbstractLifecycleService extends Disposable implements ILifecycleService {
import { AbstractLifecycleService } from 'vs/workbench/services/lifecycle/common/lifecycleService'; import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { INativeHostService } from 'vs/platform/native/common/native'; <del> import { Promises, disposableTimeout, raceCancellation } from 'vs/base/common/async'; </del> <ins> import { Promises, disposableTimeout, raceCancellation, timeout } from 'vs/base/common/async'; </ins> import { toErrorMessage } from 'vs/base/common/errorMessage'; import { CancellationTokenSource } from 'vs/base/common/cancellation'; <ins> import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService'; </ins> export class NativeLifecycleService extends AbstractLifecycleService { private static readonly BEFORE_SHUTDOWN_WARNING_DELAY = 5000; private static readonly WILL_SHUTDOWN_WARNING_DELAY = 800; <ins> private static readonly MAX_GRACEFUL_REMOTE_DISCONNECT_TIME = 3000; </ins> constructor( @INativeHostService private readonly nativeHostService: INativeHostService, @IStorageService storageService: IStorageService, <del> @ILogService logService: ILogService </del> <ins> @ILogService logService: ILogService, @IRemoteAgentService private readonly remoteAgentService: IRemoteAgentService, </ins> ) { super(logService, storageService);
}); } <ins> private async handleRemoteAgentDisconnect(): Promise<void> { const longRunningWarning = disposableTimeout(() => { this.logService.warn(`[lifecycle] the remote agent is taking a long time to disconnect, waiting...`); }, NativeLifecycleService.BEFORE_SHUTDOWN_WARNING_DELAY); await Promise.race([ this.remoteAgentService.endConnection(), timeout(NativeLifecycleService.MAX_GRACEFUL_REMOTE_DISCONNECT_TIME), ]); longRunningWarning.dispose(); } </ins> protected async handleBeforeShutdown(reason: ShutdownReason): Promise<boolean> { const logService = this.logService;
@IProductService productService: IProductService, @IRemoteAuthorityResolverService remoteAuthorityResolverService: IRemoteAuthorityResolverService, @ISignService signService: ISignService, <del> @ILogService logService: ILogService </del> <ins> @ILogService logService: ILogService, </ins> ) { super(remoteSocketFactoryService, userDataProfileService, environmentService, productService, remoteAuthorityResolverService, signService, logService); }
*  Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ <ins> import { Emitter } from 'vs/base/common/event'; </ins> import { Disposable } from 'vs/base/common/lifecycle'; <del> import { IChannel, IServerChannel, getDelayedChannel, IPCLogger } from 'vs/base/parts/ipc/common/ipc'; </del> <ins> import { getDelayedChannel, IChannel, IPCLogger, IServerChannel } from 'vs/base/parts/ipc/common/ipc'; </ins> import { Client } from 'vs/base/parts/ipc/common/ipc.net'; <del> import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; </del> <ins> import { IDiagnosticInfo, IDiagnosticInfoOptions } from 'vs/platform/diagnostics/common/diagnostics'; import { ILogService } from 'vs/platform/log/common/log'; import { IProductService } from 'vs/platform/product/common/productService'; </ins> import { connectRemoteAgentManagement, IConnectionOptions, ManagementPersistentConnection, PersistentConnectionEvent } from 'vs/platform/remote/common/remoteAgentConnection'; <del> import { IExtensionHostExitInfo, IRemoteAgentConnection, IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService'; </del> <ins> import { IRemoteAgentEnvironment, RemoteAgentConnectionContext } from 'vs/platform/remote/common/remoteAgentEnvironment'; </ins> import { IRemoteAuthorityResolverService } from 'vs/platform/remote/common/remoteAuthorityResolver'; <del> import { RemoteAgentConnectionContext, IRemoteAgentEnvironment } from 'vs/platform/remote/common/remoteAgentEnvironment'; import { RemoteExtensionEnvironmentChannelClient } from 'vs/workbench/services/remote/common/remoteAgentEnvironmentChannel'; import { IDiagnosticInfoOptions, IDiagnosticInfo } from 'vs/platform/diagnostics/common/diagnostics'; import { Emitter } from 'vs/base/common/event'; </del> <ins> import { IRemoteSocketFactoryService } from 'vs/platform/remote/common/remoteSocketFactoryService'; </ins> import { ISignService } from 'vs/platform/sign/common/sign'; <del> import { ILogService } from 'vs/platform/log/common/log'; </del> import { ITelemetryData, TelemetryLevel } from 'vs/platform/telemetry/common/telemetry'; <del> import { IProductService } from 'vs/platform/product/common/productService'; </del> <ins> import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; import { RemoteExtensionEnvironmentChannelClient } from 'vs/workbench/services/remote/common/remoteAgentEnvironmentChannel'; import { IExtensionHostExitInfo, IRemoteAgentConnection, IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService'; </ins> import { IUserDataProfileService } from 'vs/workbench/services/userDataProfile/common/userDataProfile'; <del> import { IRemoteSocketFactoryService } from 'vs/platform/remote/common/remoteSocketFactoryService'; </del> export abstract class AbstractRemoteAgentService extends Disposable implements IRemoteAgentService {
@IProductService productService: IProductService, @IRemoteAuthorityResolverService private readonly _remoteAuthorityResolverService: IRemoteAuthorityResolverService, @ISignService signService: ISignService, <del> @ILogService logService: ILogService </del> <ins> @ILogService logService: ILogService, </ins> ) { super(); if (this._environmentService.remoteAuthority) {
let platform: crate::update_service::Platform = PreReqChecker::new().verify().await?; if !args.without_connection_token { <del> // Ensure there's a defined connection token, since if multiple server versions // are excuted, they will need to have a single shared token. let token_path = ctx.paths.root().join("serve-web-token"); let token = mint_connection_token(&token_path, args.connection_token.clone()) .map_err(CodeError::CouldNotCreateConnectionTokenFile)?; args.connection_token = Some(token); args.connection_token_file = Some(token_path.to_string_lossy().to_string()); </del> <ins> if let Some(p) = args.connection_token_file.as_deref() { let token = fs::read_to_string(PathBuf::from(p)) .map_err(CodeError::CouldNotReadConnectionTokenFile)?; args.connection_token = Some(token.trim().to_string()); } else { // Ensure there's a defined connection token, since if multiple server versions // are executed, they will need to have a single shared token. let token_path = ctx.paths.root().join("serve-web-token"); let token = mint_connection_token(&token_path, args.connection_token.clone()) .map_err(CodeError::CouldNotCreateConnectionTokenFile)?; args.connection_token = Some(token); args.connection_token_file = Some(token_path.to_string_lossy().to_string()); } </ins> } let cm = ConnectionManager::new(&ctx, platform, args.clone());
// todo: can be specialized when update service is moved to CodeErrors #[error("Could not check for update: {0}")] UpdateCheckFailed(String), <ins> #[error("Could not read connection token file: {0}")] CouldNotReadConnectionTokenFile(std::io::Error), </ins> #[error("Could not write connection token file: {0}")] CouldNotCreateConnectionTokenFile(std::io::Error), #[error("A tunnel with the name {0} exists and is in-use. Please pick a different name or stop the existing tunnel.")]
type: 'boolean', description: localize('argv.disableLcdText', 'Disables LCD font antialiasing.') }, <ins> 'proxy-bypass-list': { type: 'string', description: localize('argv.proxyBypassList', 'Bypass any specified proxy for the given semi-colon-separated list of hosts. Example value "<local>;*.microsoft.com;*foo.com;1.2.3.4:5678", will use the proxy server for all hosts except for local addresses (localhost, 127.0.0.1 etc.), microsoft.com subdomains, hosts that contain the suffix foo.com and anything at 1.2.3.4:5678') }, </ins> 'disable-hardware-acceleration': { type: 'boolean', description: localize('argv.disableHardwareAcceleration', 'Disables hardware acceleration. ONLY change this option if you encounter graphic issues.')
app.commandLine.appendSwitch(argvKey); } } else if (argvValue) { <del> if (argvKey === 'force-color-profile') { // Color profile app.commandLine.appendSwitch(argvKey, argvValue); } else if (argvKey === 'password-store') { </del> <ins> if (argvKey === 'password-store') { </ins> // Password store // TODO@TylerLeonhardt: Remove this migration in 3 months let migratedArgvValue = argvValue;
color: var(--vscode-textLink-foreground); } <ins> .settings-editor > .settings-body .settings-tree-container .setting-item-contents .setting-item-markdown a, .settings-editor > .settings-body .settings-tree-container .setting-item-contents .edit-in-settings-button { text-decoration: var(--text-link-decoration); } </ins> .settings-editor > .settings-body .settings-tree-container .setting-item-contents .setting-item-markdown a:focus, .settings-editor > .settings-body .settings-tree-container .setting-item-contents .edit-in-settings-button:focus { outline: 1px solid -webkit-focus-ring-color;
return new HoverAction(parent, actionOptions, keybindingLabel); } <ins> public readonly actionLabel: string; public readonly actionKeybindingLabel: string | null; </ins> private readonly actionContainer: HTMLElement; private readonly action: HTMLElement; private constructor(parent: HTMLElement, actionOptions: { label: string; iconClass?: string; run: (target: HTMLElement) => void; commandId: string }, keybindingLabel: string | null) { super(); <ins> this.actionLabel = actionOptions.label; this.actionKeybindingLabel = keybindingLabel; </ins> this.actionContainer = dom.append(parent, $('div.action-container')); this.actionContainer.setAttribute('tabindex', '0');
import { localize } from 'vs/nls'; import { InlayHintsHover } from 'vs/editor/contrib/inlayHints/browser/inlayHintsHover'; import { BugIndicatingError } from 'vs/base/common/errors'; <ins> import { HoverAction } from 'vs/base/browser/ui/hover/hoverWidget'; </ins> export class RenderedContentHover extends Disposable {
return ''; } if (renderedPart.type === 'statusBar') { <del> return localize('hoverAccessibilityStatusBar', "This is a hover status bar."); </del> <ins> const statusBarDescription = [localize('hoverAccessibilityStatusBar', "This is a hover status bar.")]; for (const action of renderedPart.actions) { const keybinding = action.actionKeybindingLabel; if (keybinding) { statusBarDescription.push(localize('hoverAccessibilityStatusBarActionWithKeybinding', "It has an action with label {0} and keybinding {1}.", action.actionLabel, keybinding)); } else { statusBarDescription.push(localize('hoverAccessibilityStatusBarActionWithoutKeybinding', "It has an action with label {0}.", action.actionLabel)); } } return statusBarDescription.join('n'); </ins> } return renderedPart.participant.getAccessibleContent(renderedPart.hoverPart); }
const keybinding = this._keybindingService.lookupKeybinding(actionOptions.commandId); const keybindingLabel = keybinding ? keybinding.getLabel() : null; this._hasContent = true; <del> return this._register(HoverAction.render(this.actionsElement, actionOptions, keybindingLabel)); </del> <ins> const action = this._register(HoverAction.render(this.actionsElement, actionOptions, keybindingLabel)); this.actions.push(action); return action; </ins> } public append(element: HTMLElement): HTMLElement {
} extensionsToInstall.push({ extension: gallery, <del> options: { ...installOptions, installGivenVersion: !!version, isApplicationScoped: installedExtension?.isApplicationScoped }, </del> <ins> options: { ...installOptions, installGivenVersion: !!version, isApplicationScoped: installOptions.isApplicationScoped || installedExtension?.isApplicationScoped }, </ins> }); }));
}); } <ins> private registerNewWindowWithProfileAction(): IDisposable { return registerAction2(class NewWindowWithProfileAction extends Action2 { constructor() { super({ id: `workbench.profiles.actions.newWindowWithProfile`, title: localize2('newWindowWithProfile', "New Window with Profile..."), category: PROFILES_CATEGORY, precondition: HAS_PROFILES_CONTEXT, f1: true, }); } async run(accessor: ServicesAccessor) { const quickInputService = accessor.get(IQuickInputService); const userDataProfilesService = accessor.get(IUserDataProfilesService); const hostService = accessor.get(IHostService); const pick = await quickInputService.pick( userDataProfilesService.profiles.map(profile => ({ label: profile.name, profile })), { title: localize('new window with profile', "New Window with Profile"), placeHolder: localize('pick profile', "Select Profile"), canPickMany: false }); if (pick) { return hostService.openWindow({ remoteAuthority: null, forceProfile: pick.profile.name }); } } }); } </ins> private registerNewWindowAction(profile: IUserDataProfile): IDisposable { const disposables = new DisposableStore();
installed.forEach(ext => this.progressByEvent(`extensionInstalled:${ext.identifier.id.toLowerCase()}`)); }); <del> this._register(this.extensionManagementService.onDidInstallExtensions(async (result) => { const hadLastFoucs = await this.hostService.hadLastFocus(); </del> <ins> this._register(this.extensionManagementService.onDidInstallExtensions((result) => { </ins> for (const e of result) { const skipWalkthrough = e?.context?.[EXTENSION_INSTALL_SKIP_WALKTHROUGH_CONTEXT] || e?.context?.[EXTENSION_INSTALL_DEP_PACK_CONTEXT]; // If the window had last focus and the install didn't specify to skip the walkthrough // Then add it to the sessionInstallExtensions to be opened <del> if (hadLastFoucs && !skipWalkthrough) { </del> <ins> if (!skipWalkthrough) { </ins> this.sessionInstalledExtensions.add(e.identifier.id.toLowerCase()); } this.progressByEvent(`extensionInstalled:${e.identifier.id.toLowerCase()}`);
this.storageService.store(walkthroughMetadataConfigurationKey, JSON.stringify([...this.metadata.entries()]), StorageScope.PROFILE, StorageTarget.USER); <del> if (sectionToOpen && this.configurationService.getValue<string>('workbench.welcomePage.walkthroughs.openOnInstall')) { </del> <ins> const hadLastFoucs = await this.hostService.hadLastFocus(); if (hadLastFoucs && sectionToOpen && this.configurationService.getValue<string>('workbench.welcomePage.walkthroughs.openOnInstall')) { </ins> type GettingStartedAutoOpenClassification = { owner: 'lramos15'; comment: 'When a walkthrthrough is opened upon extension installation';
if (this._store.isDisposed) { return; } <del> this._currentTitle = ptyProcess.process; </del> <ins> // HACK: The node-pty API can return undefined somehow https://github.com/microsoft/vscode/issues/222323 this._currentTitle = (ptyProcess.process ?? ''); </ins> this._onDidChangeProperty.fire({ type: ProcessPropertyType.Title, value: this._currentTitle }); // If fig is installed it may change the title of the process const sanitizedTitle = this.currentTitle.replace(/ (figterm)$/g, '');
{ id: 'workspaceTrust', title: localize('gettingStarted.workspaceTrust.title', "Safely browse and edit code"), <del> description: localize('gettingStarted.workspaceTrust.description.interpolated', "{0} lets you decide whether your project folders should **allow or restrict** automatic code execution __(required for extensions, debugging, etc)__.nOpening a file/folder will prompt to grant trust. You can always {1} later.", Button(localize('workspaceTrust', "Workspace Trust"), 'https://github.com/microsoft/vscode-docs/blob/workspaceTrust/docs/editor/workspace-trust.md'), Button(localize('enableTrust', "enable trust"), 'command:toSide:workbench.action.manageTrustedDomain')), </del> <ins> description: localize('gettingStarted.workspaceTrust.description.interpolated', "{0} lets you decide whether your project folders should **allow or restrict** automatic code execution __(required for extensions, debugging, etc)__.nOpening a file/folder will prompt to grant trust. You can always {1} later.", Button(localize('workspaceTrust', "Workspace Trust"), 'https://code.visualstudio.com/docs/editor/workspace-trust'), Button(localize('enableTrust', "enable trust"), 'command:toSide:workbench.action.manageTrustedDomain')), </ins> when: 'workspacePlatform != 'webworker' && !isWorkspaceTrusted && workspaceFolderCount == 0', media: { type: 'svg', altText: 'Workspace Trust editor in Restricted mode and a primary button for switching to Trusted mode.', path: 'workspaceTrust.svg'
content.push(`a:hover, .workbenchCommand:hover { color: ${styles.textLinkActiveForeground}; }`); } <del> if (styles.sliderBackgroundColor) { content.push(`::-webkit-scrollbar-thumb { background-color: ${styles.sliderBackgroundColor}; }`); } </del> if (styles.sliderActiveColor) { <del> content.push(`::-webkit-scrollbar-thumb:active { background-color: ${styles.sliderActiveColor}; }`); </del> <ins> content.push(`.issue-reporter-body::-webkit-scrollbar-thumb:active { background-color: ${styles.sliderActiveColor}; }`); </ins> } if (styles.sliderHoverColor) { <del> content.push(`::--webkit-scrollbar-thumb:hover { background-color: ${styles.sliderHoverColor}; }`); </del> <ins> content.push(`.issue-reporter-body::-webkit-scrollbar-thumb { background-color: ${styles.sliderHoverColor}; }`); content.push(`.issue-reporter-body::--webkit-scrollbar-thumb:hover { background-color: ${styles.sliderHoverColor}; }`); </ins> } if (styles.buttonBackground) {
this._element.textContent = content; } <del> set className(className: string) { if (this.disposed || className === this._className) { </del> <ins> set classNames(classNames: string[]) { if (this.disposed || equals(classNames, this._classNames)) { </ins> return; } <del> this._className = className; this._element.className = className; </del> <ins> this._classNames = classNames; this._element.classList.value = ''; this._element.classList.add(...classNames); </ins> } set empty(empty: boolean) {
existingIconNode.remove(); } <del> this.domNode.className = labelClasses.join(' '); </del> <ins> this.domNode.classNames = labelClasses; </ins> this.domNode.element.setAttribute('aria-label', ariaLabel); <del> this.labelContainer.className = containerClasses.join(' '); </del> <ins> this.labelContainer.classList.value = ''; this.labelContainer.classList.add(...containerClasses); </ins> this.setupHover(options?.descriptionTitle ? this.labelContainer : this.element, options?.title); this.nameNode.setLabel(label, options);
} function cssEscape(str: string): string { <del> return str.replace(/[x11x12x14x15x40]/g, '/'); // HTML class names can not contain certain whitespace characters, use / instead, which doesn't exist in file names. </del> <ins> return str.replace(/[s]/g, '/'); // HTML class names can not contain certain whitespace characters (https://dom.spec.whatwg.org/#interface-domtokenlist), use / instead, which doesn't exist in file names. </ins> }
} function escapeCSS(str: string) { <del> str = str.replace(/[x11x12x14x15x40]/g, '/'); // HTML class names can not contain certain whitespace characters, use / instead, which doesn't exist in file names. </del> <ins> str = str.replace(/[s]/g, '/'); // HTML class names can not contain certain whitespace characters (https://dom.spec.whatwg.org/#interface-domtokenlist), use / instead, which doesn't exist in file names. </ins> return mainWindow.CSS.escape(str); }
return new UriList(uris.map(uri => ({ uri, str: uri.toString(true) }))); } <del> private async createUriListSnippet(uriList: UriList): Promise<{ readonly snippet: vscode.SnippetString; readonly label: string } | undefined> { </del> <ins> private async createUriListSnippet(docUri: vscode.Uri, uriList: UriList): Promise<{ readonly snippet: vscode.SnippetString; readonly label: string } | undefined> { </ins> if (!uriList.entries.length) { return; }
const snippet = new vscode.SnippetString(); for (let i = 0; i < uriList.entries.length; i++) { const uri = uriList.entries[i]; <del> const relativePath = getRelativePath(uri.uri); </del> <ins> const relativePath = getRelativePath(getDocumentDir(docUri), uri.uri); </ins> const urlText = relativePath ?? uri.str; snippet.appendText(`url(${urlText})`);