jiebi/CodeConvo huggingface dataset:
content.push('- ' + this._descriptionForCommand(TerminalCommandId.RunRecentCommand, runRecentCommand, runRecentCommandNoKb) + 'n- ' + this._descriptionForCommand(TerminalCommandId.GoToRecentDirectory, goToRecent, goToRecentNoKb)); } content.push(this._descriptionForCommand(TerminalCommandId.OpenDetectedLink, openDetectedLink, openDetectedLinkNoKb)); <ins> content.push(this._descriptionForCommand(TerminalCommandId.NewWithProfile, newWithProfile, newWithProfileNoKb)); content.push(accessibilitySettings); </ins> content.push(readMoreLink, dismiss); const element = renderElementAsMarkdown(this._markdownRenderer, this._openerService, content.join('nn'), this._register(new DisposableStore())); const anchorElements = element.querySelectorAll('a');
} function scrollableArrayOfString(id: string, buffer: string[], container: HTMLElement, trustHtml: boolean) { <del> container.classList.add('scrollable'); </del> <ins> const scrollableDiv = document.createElement('div'); scrollableDiv.classList.add('scrollable'); </ins> if (buffer.length > 5000) { container.appendChild(generateViewMoreElement(id, false)); } <del> const div = document.createElement('div'); container.appendChild(div); div.appendChild(handleANSIOutput(buffer.slice(0, 5000).join('n'), trustHtml)); </del> <ins> container.appendChild(scrollableDiv); scrollableDiv.appendChild(handleANSIOutput(buffer.slice(0, 5000).join('n'), trustHtml)); </ins> } export function insertOutput(id: string, outputs: string[], linesLimit: number, scrollable: boolean, container: HTMLElement, trustHtml: boolean) {
} }; <del> function scrollWillGoToParent(event: WheelEvent) { </del> <ins> let scrollTimeout: any /* NodeJS.Timeout */ | undefined; let scrolledElement: Element | undefined; function flagRecentlyScrolled(node: Element) { scrolledElement = node; node.setAttribute('recentlyScrolled', 'true'); clearTimeout(scrollTimeout); scrollTimeout = setTimeout(() => { scrolledElement?.removeAttribute('recentlyScrolled'); }, 300); } function eventTargetShouldHandleScroll(event: WheelEvent) { </ins> for (let node = event.target as Node | null; node; node = node.parentNode) { if (!(node instanceof Element) || node.id === 'container' || node.classList.contains('cell_container') || node.classList.contains('markup') || node.classList.contains('output_container')) { return false; } <ins> if (node.hasAttribute('recentlyScrolled') && scrolledElement === node) { flagRecentlyScrolled(node); return true; } </ins> // scroll up if (event.deltaY < 0 && node.scrollTop > 0) { // there is still some content to scroll <ins> flagRecentlyScrolled(node); </ins> return true; }
} const handleWheel = (event: WheelEvent & { wheelDeltaX?: number; wheelDeltaY?: number; wheelDelta?: number }) => { <del> if (event.defaultPrevented || scrollWillGoToParent(event)) { </del> <ins> if (event.defaultPrevented || eventTargetShouldHandleScroll(event)) { </ins> return; } postNotebookMessage<webviewMessages.IWheelMessage>('did-scroll-wheel', {
} if (node.hasAttribute('recentlyScrolled')) { <del> if (lastTimeScrolled && Date.now() - lastTimeScrolled > 300) { </del> <ins> if (lastTimeScrolled && Date.now() - lastTimeScrolled > 400) { </ins> // it has been a while since we actually scrolled <del> // if scroll velocity increases, it's likely a new scroll event if (!!previousDelta && deltaY < 0 && deltaY < previousDelta - 2) { </del> <ins> // if scroll velocity increases significantly, it's likely a new scroll event if (!!previousDelta && deltaY < 0 && deltaY < previousDelta - 8) { </ins> clearTimeout(scrollTimeout); scrolledElement?.removeAttribute('recentlyScrolled'); return false; <del> } else if (!!previousDelta && deltaY > 0 && deltaY > previousDelta + 2) { </del> <ins> } else if (!!previousDelta && deltaY > 0 && deltaY > previousDelta + 8) { </ins> clearTimeout(scrollTimeout); scrolledElement?.removeAttribute('recentlyScrolled'); return false;
private _tabFocusTerminal: boolean = false; private _tabFocusEditor: boolean = false; <del> private readonly _onDidChangeTabFocus = new Emitter<boolean>(); public readonly onDidChangeTabFocus: Event<boolean> = this._onDidChangeTabFocus.event; </del> <ins> private readonly _onDidChangeTabFocus = new Emitter<void>(); public readonly onDidChangeTabFocus: Event<void> = this._onDidChangeTabFocus.event; </ins> public getTabFocusMode(context: TabFocusContext): boolean { return context === TabFocusContext.Terminal ? this._tabFocusTerminal : this._tabFocusEditor; } public setTabFocusMode(tabFocusMode: boolean, context: TabFocusContext): void { <del> if ((context === TabFocusContext.Terminal && this._tabFocusTerminal === tabFocusMode) || (context === TabFocusContext.Editor && this._tabFocusEditor === tabFocusMode)) { return; } </del> if (context === TabFocusContext.Terminal) { this._tabFocusTerminal = tabFocusMode; } else { this._tabFocusEditor = tabFocusMode; } <del> this._onDidChangeTabFocus.fire(this._tabFocusTerminal); </del> <ins> this._onDidChangeTabFocus.fire(); </ins> } }
private readonly languageElement = this._register(new MutableDisposable<IStatusbarEntryAccessor>()); private readonly metadataElement = this._register(new MutableDisposable<IStatusbarEntryAccessor>()); private readonly currentProblemStatus: ShowCurrentMarkerInStatusbarContribution = this._register(this.instantiationService.createInstance(ShowCurrentMarkerInStatusbarContribution)); <ins> private _previousViewContext: 'terminal' | 'editor' | undefined; </ins> private readonly state = new State(); private readonly activeEditorListeners = this._register(new DisposableStore()); private readonly delayedRender = this._register(new MutableDisposable());
this._register(this.textFileService.untitled.onDidChangeEncoding(model => this.onResourceEncodingChange(model.resource))); this._register(this.textFileService.files.onDidChangeEncoding(model => this.onResourceEncodingChange((model.resource)))); this._register(Event.runAndSubscribe(TabFocus.onDidChangeTabFocus, () => this.onTabFocusModeChange())); <ins> const viewKey = new Set<string>(); viewKey.add('focusedView'); this._register(this.contextKeyService.onDidChangeContext((c) => { if (c.affectsSome(viewKey)) { const terminalFocus = this.contextKeyService.getContextKeyValue('focusedView') === 'terminal'; const context = terminalFocus ? 'terminal' : 'editor'; if (this._previousViewContext === context) { return; } this._previousViewContext = context; this.onTabFocusModeChange(); } })); </ins> } private registerCommands(): void {
import { Schemas } from 'vs/base/common/network'; import { TabFocus, TabFocusContext } from 'vs/editor/browser/config/tabFocus'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; <del> import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; </del> import { ILabelService } from 'vs/platform/label/common/label'; import { TerminalSettingId } from 'vs/platform/terminal/common/terminal'; import { IWorkbenchContribution } from 'vs/workbench/common/contributions';
@ITerminalService terminalService: ITerminalService, @ITerminalEditorService terminalEditorService: ITerminalEditorService, @ITerminalGroupService terminalGroupService: ITerminalGroupService, <del> @IConfigurationService configurationService: IConfigurationService, @IContextKeyService contextKeyService: IContextKeyService </del> <ins> @IConfigurationService configurationService: IConfigurationService </ins> ) { super();
} }); <del> const viewKey = new Set<string>(); viewKey.add('focusedView'); </del> TabFocus.setTabFocusMode(configurationService.getValue('editor.tabFocusMode'), TabFocusContext.Editor); TabFocus.setTabFocusMode(configurationService.getValue(TerminalSettingId.TabFocusMode), TabFocusContext.Terminal); <del> this._register(contextKeyService.onDidChangeContext((c) => { if (c.affectsSome(viewKey)) { if (contextKeyService.getContextKeyValue('focusedView') === 'terminal') { TabFocus.setTabFocusMode(configurationService.getValue(TerminalSettingId.TabFocusMode), TabFocusContext.Terminal); } else { TabFocus.setTabFocusMode(configurationService.getValue('editor.tabFocusMode'), TabFocusContext.Editor); } } })); </del> } }
switch (changeType) { case ChangeType.Add: audioCueService.playAudioCue(AudioCue.diffLineInserted, true); <ins> break; </ins> case ChangeType.Delete: audioCueService.playAudioCue(AudioCue.diffLineDeleted, true); <ins> break; </ins> case ChangeType.Modify: audioCueService.playAudioCue(AudioCue.diffLineModified, true); <ins> break; </ins> } }
function areLanguageDiagnosticSettingsEqual(currentSettings: LanguageDiagnosticSettings, newSettings: LanguageDiagnosticSettings): boolean { return currentSettings.validate === newSettings.validate <del> && currentSettings.enableSuggestions && currentSettings.enableSuggestions; </del> <ins> && currentSettings.enableSuggestions === newSettings.enableSuggestions; </ins> } class DiagnosticSettings {
import { CancellationToken } from 'vs/base/common/cancellation'; import { FuzzyScore } from 'vs/base/common/filters'; import { Iterable } from 'vs/base/common/iterator'; <del> import { RefCountedDisposable } from 'vs/base/common/lifecycle'; </del> <ins> import { Disposable, RefCountedDisposable } from 'vs/base/common/lifecycle'; </ins> import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService'; import { EditorOption } from 'vs/editor/common/config/editorOptions';
@IClipboardService private readonly _clipboardService: IClipboardService, @ISuggestMemoryService private readonly _suggestMemoryService: ISuggestMemoryService, @ICodeEditorService private readonly _editorService: ICodeEditorService, <del> ) { } </del> <ins> ) { super(); this._store.add(_languageFeatureService.inlineCompletionsProvider.register('*', this)); } </ins> async provideInlineCompletions(model: ITextModel, position: Position, context: InlineCompletionContext, token: CancellationToken): Promise<InlineCompletionResults | undefined> {
test('Aggressive inline completions when typing within line #146948', async function () { <del> const completions: SuggestInlineCompletions = insta.createInstance(SuggestInlineCompletions); </del> <ins> const completions: SuggestInlineCompletions = disposables.add(insta.createInstance(SuggestInlineCompletions)); </ins> { // (1,3), end of word -> suggestions
}); test('Snippets show in inline suggestions even though they are turned off #175190', async function () { <del> const completions: SuggestInlineCompletions = insta.createInstance(SuggestInlineCompletions); </del> <ins> const completions: SuggestInlineCompletions = disposables.add(insta.createInstance(SuggestInlineCompletions)); </ins> { // unfiltered
export const editorErrorBorder = registerColor('editorError.border', { dark: null, light: null, hcDark: Color.fromHex('#E47777').transparent(0.8), hcLight: '#B5200D' }, nls.localize('errorBorder', 'Border color of error boxes in the editor.')); export const editorWarningBackground = registerColor('editorWarning.background', { dark: null, light: null, hcDark: null, hcLight: null }, nls.localize('editorWarning.background', 'Background color of warning text in the editor. The color must not be opaque so as not to hide underlying decorations.'), true); <del> export const editorWarningForeground = registerColor('editorWarning.foreground', { dark: '#CCA700', light: '#BF8803', hcDark: '#FFD37', hcLight: '#895503' }, nls.localize('editorWarning.foreground', 'Foreground color of warning squigglies in the editor.')); </del> <ins> export const editorWarningForeground = registerColor('editorWarning.foreground', { dark: '#CCA700', light: '#BF8803', hcDark: '#FFD370', hcLight: '#895503' }, nls.localize('editorWarning.foreground', 'Foreground color of warning squigglies in the editor.')); </ins> export const editorWarningBorder = registerColor('editorWarning.border', { dark: null, light: null, hcDark: Color.fromHex('#FFCC00').transparent(0.8), hcLight: '#' }, nls.localize('warningBorder', 'Border color of warning boxes in the editor.')); export const editorInfoBackground = registerColor('editorInfo.background', { dark: null, light: null, hcDark: null, hcLight: null }, nls.localize('editorInfo.background', 'Background color of info text in the editor. The color must not be opaque so as not to hide underlying decorations.'), true);
try { const userDataProfilesExportState = disposables.add(this.instantiationService.createInstance(UserDataProfileExportState, this.userDataProfileService.currentProfile)); const barrier = new Barrier(); <del> const exportAction = new BarrierAction(barrier, new Action('export', localize('export', "Export"), undefined, true, () => { </del> <ins> const exportAction = new BarrierAction(barrier, new Action('export', localize('export', "Export"), undefined, true, async () => { </ins> exportAction.enabled = false; <del> return this.doExportProfile(userDataProfilesExportState); })); const closeAction = new BarrierAction(barrier, new Action('close', localize('close', "Close"))); </del> <ins> try { await this.doExportProfile(userDataProfilesExportState); } catch (error) { this.notificationService.error(error); throw error; } }), this.notificationService); const closeAction = new BarrierAction(barrier, new Action('close', localize('close', "Close")), this.notificationService); </ins> await this.showProfilePreviewView(EXPORT_PROFILE_PREVIEW_VIEW, userDataProfilesExportState.profile.name, exportAction, closeAction, true, userDataProfilesExportState); disposables.add(this.userDataProfileService.onDidChangeCurrentProfile(e => barrier.open())); await barrier.wait();
: importAction; const secondaryAction = isWeb ? importAction <del> : new BarrierAction(barrier, new Action('close', localize('close', "Close"))); </del> <ins> : new BarrierAction(barrier, new Action('close', localize('close', "Close")), this.notificationService); </ins> const view = await this.showProfilePreviewView(IMPORT_PROFILE_PREVIEW_VIEW, importedProfile.name, primaryAction, secondaryAction, false, userDataProfileImportState); const message = new MarkdownString();
if (userDataProfileImportState.isEmpty()) { await importAction.run(); } else { <del> await this.showProfilePreviewView(IMPORT_PROFILE_PREVIEW_VIEW, profileTemplate.name, importAction, new BarrierAction(barrier, new Action('cancel', localize('cancel', "Cancel"))), false, userDataProfileImportState); </del> <ins> await this.showProfilePreviewView(IMPORT_PROFILE_PREVIEW_VIEW, profileTemplate.name, importAction, new BarrierAction(barrier, new Action('cancel', localize('cancel', "Cancel")), this.notificationService), false, userDataProfileImportState); </ins> } await barrier.wait(); await this.hideProfilePreviewView(IMPORT_PROFILE_PREVIEW_VIEW);
} class BarrierAction extends Action { <del> constructor(barrier: Barrier, action: Action) { </del> <ins> constructor(barrier: Barrier, action: Action, notificationService: INotificationService) { </ins> super(action.id, action.label, action.class, action.enabled, async () => { <del> await action.run(); </del> <ins> try { await action.run(); } catch (error) { notificationService.error(error); throw error; } </ins> barrier.open(); }); }
}; let machineId: Promise<string>; <del> export async function getMachineId(): Promise<string> { </del> <ins> export async function getMachineId(errorLogger: (error: any) => void): Promise<string> { </ins> if (!machineId) { machineId = (async () => { <del> const id = await getMacMachineId(); </del> <ins> const id = await getMacMachineId(errorLogger); </ins> return id || uuid.generateUuid(); // fallback, generate a UUID })();
return machineId; } <del> async function getMacMachineId(): Promise<string | undefined> { </del> <ins> async function getMacMachineId(errorLogger: (error: any) => void): Promise<string | undefined> { </ins> try { const crypto = await import('crypto'); const macAddress = getMac(); return crypto.createHash('sha256').update(macAddress, 'utf8').digest('hex'); } catch (err) { <del> errors.onUnexpectedError(err); </del> <ins> errorLogger(err); </ins> return undefined; } }
*  Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ <ins> import { ILogService } from 'vs/platform/log/common/log'; </ins> import { IStateService } from 'vs/platform/state/node/state'; import { machineIdKey } from 'vs/platform/telemetry/common/telemetry'; import { resolveMachineId as resolveNodeMachineId } from 'vs/platform/telemetry/node/telemetryUtils'; <del> export async function resolveMachineId(stateService: IStateService) { </del> <ins> export async function resolveMachineId(stateService: IStateService, logService: ILogService) { </ins> // Call the node layers implementation to avoid code duplication <del> const machineId = await resolveNodeMachineId(stateService); </del> <ins> const machineId = await resolveNodeMachineId(stateService, logService); </ins> stateService.setItem(machineIdKey, machineId); return machineId; }
import { isMacintosh } from 'vs/base/common/platform'; import { getMachineId } from 'vs/base/node/id'; <ins> import { ILogService } from 'vs/platform/log/common/log'; </ins> import { IStateReadService } from 'vs/platform/state/node/state'; import { machineIdKey } from 'vs/platform/telemetry/common/telemetry'; <del> export async function resolveMachineId(stateService: IStateReadService) { </del> <ins> export async function resolveMachineId(stateService: IStateReadService, logService: ILogService) { </ins> // We cache the machineId for faster lookups // and resolve it only once initially if not cached or we need to replace the macOS iBridge device let machineId = stateService.getItem<string>(machineIdKey); if (typeof machineId !== 'string' || (isMacintosh && machineId === '6c9d2bc8f91b89624add29c0abeae7fb42bf539fa1cdb2e3e57cd668fa9bcead')) { <del> machineId = await getMachineId(); </del> <ins> machineId = await getMachineId(logService.error.bind(logService)); </ins> } return machineId;
"config.decorations.enabled": "Controls whether Git contributes colors and badges to the Explorer and the Open Editors view.", "config.enableStatusBarSync": "Controls whether the Git Sync command appears in the status bar.", "config.followTagsWhenSync": "Push all annotated tags when running the sync command.", <ins> "config.replaceTagsWhenPull": "Automatically replace the local tags with the remote tags in case of a conflict when running the pull command.", </ins> "config.promptToSaveFilesBeforeStash": "Controls whether Git should check for unsaved files before stashing changes.", "config.promptToSaveFilesBeforeStash.always": "Check for any unsaved files.", "config.promptToSaveFilesBeforeStash.staged": "Check only for unsaved staged files.",
throw new Error(`Unable to extract tag names from error message: ${raw}`); } <del> // 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); </del> <ins> const config = workspace.getConfiguration('git', Uri.file(this.repository.root)); const replaceTagsWhenPull = config.get<boolean>('replaceTagsWhenPull', false) === true; if (!replaceTagsWhenPull) { // Notification const replaceLocalTags = l10n.t('Replace Local Tag(s)'); const replaceLocalTagsAlways = l10n.t('Always 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, replaceLocalTagsAlways); if (choice !== replaceLocalTags && choice !== replaceLocalTagsAlways) { return false; } </ins> <del> if (choice !== replaceLocalTags) { return false; </del> <ins> if (choice === replaceLocalTagsAlways) { await config.update('replaceTagsWhenPull', true, true); } </ins> } // Force fetch tags
import { IExtension, ExtensionState, IExtensionsWorkbenchService, VIEWLET_ID, IExtensionsViewPaneContainer, IExtensionContainer, TOGGLE_IGNORE_EXTENSION_ACTION_ID, SELECT_INSTALL_VSIX_EXTENSION_COMMAND_ID, THEME_ACTIONS_GROUP, INSTALL_ACTIONS_GROUP } from 'vs/workbench/contrib/extensions/common/extensions'; import { ExtensionsConfigurationInitialContent } from 'vs/workbench/contrib/extensions/common/extensionsFileTemplate'; import { IGalleryExtension, IExtensionGalleryService, ILocalExtension, InstallOptions, InstallOperation, TargetPlatformToString, ExtensionManagementErrorCode } from 'vs/platform/extensionManagement/common/extensionManagement'; <del> import { IWorkbenchExtensionEnablementService, EnablementState, IExtensionManagementServerService, IExtensionManagementServer, IWorkbenchExtensionManagementService } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; </del> <ins> import { IWorkbenchExtensionEnablementService, EnablementState, IExtensionManagementServerService, IExtensionManagementServer } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; </ins> import { ExtensionRecommendationReason, IExtensionIgnoredRecommendationsService, IExtensionRecommendationsService } from 'vs/workbench/services/extensionRecommendations/common/extensionRecommendations'; import { areSameExtensions, getExtensionId } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; import { ExtensionType, ExtensionIdentifier, IExtensionDescription, IExtensionManifest, isLanguagePackExtension, getWorkspaceSupportTypeMessage, TargetPlatform } from 'vs/platform/extensions/common/extensions';
import { IActionViewItemOptions, ActionViewItem } from 'vs/base/browser/ui/actionbar/actionViewItems'; import { EXTENSIONS_CONFIG, IExtensionsConfigContent } from 'vs/workbench/services/extensionRecommendations/common/workspaceExtensionsConfig'; import { getErrorMessage, isCancellationError } from 'vs/base/common/errors'; <del> import { IUserDataSyncEnablementService, SyncResource } from 'vs/platform/userDataSync/common/userDataSync'; </del> <ins> import { IUserDataSyncEnablementService } from 'vs/platform/userDataSync/common/userDataSync'; </ins> import { ActionWithDropdownActionViewItem, IActionWithDropdownActionViewItemOptions } from 'vs/base/browser/ui/dropdown/dropdownActionViewItem'; import { IContextMenuProvider } from 'vs/base/browser/contextmenu'; import { ILogService } from 'vs/platform/log/common/log';
buttons: [{ label: localize('install anyway', "Install Anyway"), run: () => { <del> const installAction = this.installOptions?.isMachineScoped ? this.instantiationService.createInstance(InstallAction, { donotVerifySignature: true }) : this.instantiationService.createInstance(InstallAndSyncAction, { donotVerifySignature: true }); </del> <ins> const installAction = this.instantiationService.createInstance(InstallAction, { donotVerifySignature: true }); </ins> installAction.extension = this.extension; return installAction.run(); }
promptChoices.push({ label: localize('install release version', "Install Release Version"), run: () => { <del> const installAction = this.installOptions?.isMachineScoped ? this.instantiationService.createInstance(InstallAction, { installPreReleaseVersion: !!this.installOptions.installPreReleaseVersion }) : this.instantiationService.createInstance(InstallAndSyncAction, { installPreReleaseVersion: !!this.installOptions?.installPreReleaseVersion }); </del> <ins> const installAction = this.instantiationService.createInstance(InstallAction, { installPreReleaseVersion: !!this.installOptions?.installPreReleaseVersion }); </ins> installAction.extension = this.extension; return installAction.run(); }
} private readonly updateThrottler = new Throttler(); <ins> public readonly options: InstallOptions; </ins> constructor( <del> id: string, readonly options: InstallOptions, cssClass: string, </del> <ins> options: InstallOptions, </ins> @IExtensionsWorkbenchService private readonly extensionsWorkbenchService: IExtensionsWorkbenchService, @IInstantiationService private readonly instantiationService: IInstantiationService, @IExtensionService private readonly runtimeExtensionService: IExtensionService,