jiebi/CodeConvo huggingface dataset:
Code change:
Type: <bBug</bThe experimental "user profiles" feature uses absolute paths which break when using a (which is done by creating a "data/" folder in VSC's root directory). These paths seem to be stored in "data/user-", at least in part. This makes VSC forget any extensions installed on the default profile as well as any other profiles. It also prevents VSC from finding the settings for any non-default profiles: When trying to edit the settings for a non-default profile, a new "" file is created where VSC expects the file to be. It displays an error message instead if the expected path is invalid (ex. portable installation's drive letter changed). Steps to Reproduce: a portable (.zip) version of VSCode and extract to a folder. an empty "data/" folder inside that folder. VSC and install any extension with the default profile. a second profile. Change some of its settings and install any extension. VSC and move the VSC folder to another location. VSC again. VS Code version: Code - Insiders 1.74.0-insider (, 2022-11-03T18:43:35.409Z) OS version: WindowsNT x64 10.0. Modes: Sandboxed: Yes <details<summarySystem Info</summary </detailsExtensions: none<details<summaryA/B Experiments</summary</details<!-- generated by issue reporter --

Related discussion:
text: import { ILogService } from 'vs/platform/log/common/log'; import { IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile'; import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; <ins> import { isObject, isString } from 'vs/base/common/types'; import { Schemas } from 'vs/base/common/network'; </ins> interface IStoredProfileExtension { identifier: IExtensionIdentifier; <del> location: UriComponents; </del> <ins> location: UriComponents | string; </ins> version: string; metadata?: Metadata; }
Code change:
Type: <bBug</bThe experimental "user profiles" feature uses absolute paths which break when using a (which is done by creating a "data/" folder in VSC's root directory). These paths seem to be stored in "data/user-", at least in part. This makes VSC forget any extensions installed on the default profile as well as any other profiles. It also prevents VSC from finding the settings for any non-default profiles: When trying to edit the settings for a non-default profile, a new "" file is created where VSC expects the file to be. It displays an error message instead if the expected path is invalid (ex. portable installation's drive letter changed). Steps to Reproduce: a portable (.zip) version of VSCode and extract to a folder. an empty "data/" folder inside that folder. VSC and install any extension with the default profile. a second profile. Change some of its settings and install any extension. VSC and move the VSC folder to another location. VSC again. VS Code version: Code - Insiders 1.74.0-insider (, 2022-11-03T18:43:35.409Z) OS version: WindowsNT x64 10.0. Modes: Sandboxed: Yes <details<summarySystem Info</summary </detailsExtensions: none<details<summaryA/B Experiments</summary</details<!-- generated by issue reporter --

Related discussion:
text: if (!Array.isArray(storedProfileExtensions)) { throw new Error(`Invalid extensions content in ${file.toString()}`); } <ins> // TODO @sandy081: Remove this migration after couple of releases let migrate = false; </ins> for (const e of storedProfileExtensions) { if (!isStoredProfileExtension(e)) { throw new Error(`Invalid extensions content in ${file.toString()}`); } <ins> let location: URI; if (isString(e.location)) { location = this.resolveExtensionLocation(file, e.location); } else { location = URI.revive(e.location); const relativePath = this.toRelativePath(file, location); if (relativePath) { migrate = true; e.location = relativePath; } } </ins> extensions.push({ identifier: e.identifier, <del> location: URI.revive(e.location), </del> <ins> location, </ins> version: e.version, metadata: e.metadata, }); } <ins> if (migrate) { await this.fileService.writeFile(file, VSBuffer.fromString(JSON.stringify(storedProfileExtensions))); } </ins> } // Update
Code change:
Type: <bBug</bThe experimental "user profiles" feature uses absolute paths which break when using a (which is done by creating a "data/" folder in VSC's root directory). These paths seem to be stored in "data/user-", at least in part. This makes VSC forget any extensions installed on the default profile as well as any other profiles. It also prevents VSC from finding the settings for any non-default profiles: When trying to edit the settings for a non-default profile, a new "" file is created where VSC expects the file to be. It displays an error message instead if the expected path is invalid (ex. portable installation's drive letter changed). Steps to Reproduce: a portable (.zip) version of VSCode and extract to a folder. an empty "data/" folder inside that folder. VSC and install any extension with the default profile. a second profile. Change some of its settings and install any extension. VSC and move the VSC folder to another location. VSC again. VS Code version: Code - Insiders 1.74.0-insider (, 2022-11-03T18:43:35.409Z) OS version: WindowsNT x64 10.0. Modes: Sandboxed: Yes <details<summarySystem Info</summary </detailsExtensions: none<details<summaryA/B Experiments</summary</details<!-- generated by issue reporter --

Related discussion:
text: const storedProfileExtensions: IStoredProfileExtension[] = extensions.map(e => ({ identifier: e.identifier, version: e.version, <del> location: e.location.toJSON(), </del> <ins> location: this.toRelativePath(file, e.location) ?? e.location.toJSON(), </ins> metadata: e.metadata })); await this.fileService.writeFile(file, VSBuffer.fromString(JSON.stringify(storedProfileExtensions)));
Code change:
Type: <bBug</bThe experimental "user profiles" feature uses absolute paths which break when using a (which is done by creating a "data/" folder in VSC's root directory). These paths seem to be stored in "data/user-", at least in part. This makes VSC forget any extensions installed on the default profile as well as any other profiles. It also prevents VSC from finding the settings for any non-default profiles: When trying to edit the settings for a non-default profile, a new "" file is created where VSC expects the file to be. It displays an error message instead if the expected path is invalid (ex. portable installation's drive letter changed). Steps to Reproduce: a portable (.zip) version of VSCode and extract to a folder. an empty "data/" folder inside that folder. VSC and install any extension with the default profile. a second profile. Change some of its settings and install any extension. VSC and move the VSC folder to another location. VSC again. VS Code version: Code - Insiders 1.74.0-insider (, 2022-11-03T18:43:35.409Z) OS version: WindowsNT x64 10.0. Modes: Sandboxed: Yes <details<summarySystem Info</summary </detailsExtensions: none<details<summaryA/B Experiments</summary</details<!-- generated by issue reporter --

Related discussion:
text: }); } <ins> private toRelativePath(extensionsProfileLocation: URI, extensionLocation: URI): string | undefined { // Extension Profile location scheme is always vscode-userdata and Extension location scheme is always file // Hence we need to convert the Extension Profile location scheme to file to resolve the relative path const parent = this.uriIdentityService.extUri.dirname(extensionsProfileLocation).with({ scheme: Schemas.file }); if (this.uriIdentityService.extUri.isEqualOrParent(extensionLocation, parent)) { return this.uriIdentityService.extUri.relativePath(parent, extensionLocation); } return undefined; } private resolveExtensionLocation(extensionsProfileLocation: URI, path: string): URI { // Extension Profile location scheme is always vscode-userdata and Extension location scheme is always file // Hence we need to convert the Extension Profile location scheme to file to resolve extension location return this.uriIdentityService.extUri.joinPath(this.uriIdentityService.extUri.dirname(extensionsProfileLocation), path).with({ scheme: Schemas.file }); } </ins> private _migrationPromise: Promise<IStoredProfileExtension[] | undefined> | undefined; private async migrateFromOldDefaultProfileExtensionsLocation(): Promise<IStoredProfileExtension[] | undefined> { if (!this._migrationPromise) {
Code change:
Type: <bBug</bThe experimental "user profiles" feature uses absolute paths which break when using a (which is done by creating a "data/" folder in VSC's root directory). These paths seem to be stored in "data/user-", at least in part. This makes VSC forget any extensions installed on the default profile as well as any other profiles. It also prevents VSC from finding the settings for any non-default profiles: When trying to edit the settings for a non-default profile, a new "" file is created where VSC expects the file to be. It displays an error message instead if the expected path is invalid (ex. portable installation's drive letter changed). Steps to Reproduce: a portable (.zip) version of VSCode and extract to a folder. an empty "data/" folder inside that folder. VSC and install any extension with the default profile. a second profile. Change some of its settings and install any extension. VSC and move the VSC folder to another location. VSC again. VS Code version: Code - Insiders 1.74.0-insider (, 2022-11-03T18:43:35.409Z) OS version: WindowsNT x64 10.0. Modes: Sandboxed: Yes <details<summarySystem Info</summary </detailsExtensions: none<details<summaryA/B Experiments</summary</details<!-- generated by issue reporter --

Related discussion:
text: } function isStoredProfileExtension(candidate: any): candidate is IStoredProfileExtension { <del> return typeof candidate === 'object' </del> <ins> return isObject(candidate) </ins> && isIExtensionIdentifier(candidate.identifier) <del> && isUriComponents(candidate.location) && candidate.version && typeof candidate.version === 'string'; </del> <ins> && (isUriComponents(candidate.location) || isString(candidate.location)) && candidate.version && isString(candidate.version); </ins> } function isUriComponents(thing: unknown): thing is UriComponents { if (!thing) { return false; } <del> return typeof (<any>thing).path === 'string' && typeof (<any>thing).scheme === 'string'; </del> <ins> return isString((<any>thing).path) && isString((<any>thing).scheme); </ins> }
Code change:
This is a follow-up from and describes the problem that save participants causing a save operation
reproduced when undoing some fixes (applying the fix below)
fyi

Related discussion:
text: private versionId = 0; private bufferSavedVersionId: number | undefined; private ignoreDirtyOnModelContentChange = false; <ins> private ignoreSaveFromSaveParticipants = false; </ins> private static readonly UNDO_REDO_SAVE_PARTICIPANTS_AUTO_SAVE_THROTTLE_THRESHOLD = 500; private lastModelContentChangeFromUndoRedo: number | undefined = undefined;
Code change:
This is a follow-up from and describes the problem that save participants causing a save operation
reproduced when undoing some fixes (applying the fix below)
fyi

Related discussion:
text: let versionId = this.versionId; this.trace(`doSave(${versionId}) - enter with versionId ${versionId}`); <ins> // Return early if saved from within save participant to break recursion // // Scenario: a save participant triggers a save() on the model if (this.ignoreSaveFromSaveParticipants) { this.trace(`doSave(${versionId}) - exit - refusing to save() recursively from save participant`); return; } </ins> // Lookup any running pending save for this versionId and return it if found // // Scenario: user invoked the save action multiple times quickly for the same contents
Code change:
This is a follow-up from and describes the problem that save participants causing a save operation
reproduced when undoing some fixes (applying the fix below)
fyi

Related discussion:
text: // Run save participants unless save was cancelled meanwhile if (!saveCancellation.token.isCancellationRequested) { <del> await this.textFileService.files.runSaveParticipants(this, { reason: options.reason ?? SaveReason.EXPLICIT }, saveCancellation.token); </del> <ins> this.ignoreSaveFromSaveParticipants = true; try { await this.textFileService.files.runSaveParticipants(this, { reason: options.reason ?? SaveReason.EXPLICIT }, saveCancellation.token); } finally { this.ignoreSaveFromSaveParticipants = false; } </ins> } } catch (error) { this.logService.error(`[text file model] runSaveParticipants(${versionId}) - resulted in an error: ${error.toString()}`, this.resource.toString());
Code change:
This is a follow-up from and describes the problem that save participants causing a save operation
reproduced when undoing some fixes (applying the fix below)
fyi

Related discussion:
text: private readonly saveSequentializer = new TaskSequentializer(); <ins> private ignoreSaveFromSaveParticipants = false; </ins> async save(options: IStoredFileWorkingCopySaveOptions = Object.create(null)): Promise<boolean> { if (!this.isResolved()) { return false;
Code change:
This is a follow-up from and describes the problem that save participants causing a save operation
reproduced when undoing some fixes (applying the fix below)
fyi

Related discussion:
text: let versionId = this.versionId; this.trace(`doSave(${versionId}) - enter with versionId ${versionId}`); <ins> // Return early if saved from within save participant to break recursion // // Scenario: a save participant triggers a save() on the working copy if (this.ignoreSaveFromSaveParticipants) { this.trace(`doSave(${versionId}) - exit - refusing to save() recursively from save participant`); return; } </ins> // Lookup any running pending save for this versionId and return it if found // // Scenario: user invoked the save action multiple times quickly for the same contents
Code change:
This is a follow-up from and describes the problem that save participants causing a save operation
reproduced when undoing some fixes (applying the fix below)
fyi

Related discussion:
text: // Run save participants unless save was cancelled meanwhile if (!saveCancellation.token.isCancellationRequested) { <del> await this.workingCopyFileService.runSaveParticipants(this, { reason: options.reason ?? SaveReason.EXPLICIT }, saveCancellation.token); </del> <ins> this.ignoreSaveFromSaveParticipants = true; try { await this.workingCopyFileService.runSaveParticipants(this, { reason: options.reason ?? SaveReason.EXPLICIT }, saveCancellation.token); } finally { this.ignoreSaveFromSaveParticipants = false; } </ins> } } catch (error) { this.logService.error(`[stored file working copy] runSaveParticipants(${versionId}) - resulted in an error: ${error.toString()}`, this.resource.toString(), this.typeId);
Code change:
This is a follow-up from and describes the problem that save participants causing a save operation
reproduced when undoing some fixes (applying the fix below)
fyi

Related discussion:
text: import { basename } from 'vs/base/common/resources'; import { FileChangesEvent, FileChangeType, FileOperationError, FileOperationResult, NotModifiedSinceFileOperationError } from 'vs/platform/files/common/files'; import { SaveReason, SaveSourceRegistry } from 'vs/workbench/common/editor'; <del> import { Promises } from 'vs/base/common/async'; </del> <ins> import { Promises, timeout } from 'vs/base/common/async'; </ins> import { consumeReadable, consumeStream, isReadableStream } from 'vs/base/common/stream'; import { runWithFakedTimers } from 'vs/base/test/common/timeTravelScheduler';
Code change:
This is a follow-up from and describes the problem that save participants causing a save operation
reproduced when undoing some fixes (applying the fix below)
fyi

Related discussion:
text: assert.strictEqual(participationCounter, 1); }); <ins> test('Save Participant, calling save from within is unsupported but does not explode (sync save)', async function () { await workingCopy.resolve(); await testSaveFromSaveParticipant(workingCopy, false); }); test('Save Participant, calling save from within is unsupported but does not explode (async save)', async function () { await workingCopy.resolve(); await testSaveFromSaveParticipant(workingCopy, true); }); async function testSaveFromSaveParticipant(workingCopy: StoredFileWorkingCopy<TestStoredFileWorkingCopyModel>, async: boolean): Promise<void> { assert.strictEqual(accessor.workingCopyFileService.hasSaveParticipants, false); const disposable = accessor.workingCopyFileService.addSaveParticipant({ participate: async () => { if (async) { await timeout(10); } await workingCopy.save({ force: true }); } }); assert.strictEqual(accessor.workingCopyFileService.hasSaveParticipants, true); await workingCopy.save({ force: true }); disposable.dispose(); } </ins> test('revert', async () => { await workingCopy.resolve(); workingCopy.model?.updateContents('hello revert');
Code change:
Currently when there is one suggested kernel and that's the one users are using in current document, its presentation in kernel picker is weird <img width="601" alt="image" src="https://user-"This can be simplified as a single "Selected" group at the very top <img width="601" alt="image" src="https://user-"

Related discussion:
text: const notebook = editor.textModel; const scopedContextKeyService = editor.scopedContextKeyService; <del> const matchResult = notebookKernelService.getMatchingKernel(notebook); </del> <ins> const matchResult = this._notebookKernelService.getMatchingKernel(notebook); </ins> const { selected, all } = matchResult; if (selected && controllerId && selected.id === controllerId && ExtensionIdentifier.equals(selected.extension, extensionId)) {
Code change:
Currently when there is one suggested kernel and that's the one users are using in current document, its presentation in kernel picker is weird <img width="601" alt="image" src="https://user-"This can be simplified as a single "Selected" group at the very top <img width="601" alt="image" src="https://user-"

Related discussion:
text: extensionRecommendataionPromise?.cancel(); const currentActiveItems = quickPick.activeItems; <del> const matchResult = notebookKernelService.getMatchingKernel(notebook); const quickPickItems = this._getKernelPickerQuickPickItems(notebook, matchResult, notebookKernelService, scopedContextKeyService); </del> <ins> const matchResult = this._notebookKernelService.getMatchingKernel(notebook); const quickPickItems = this._getKernelPickerQuickPickItems(notebook, matchResult, this._notebookKernelService, scopedContextKeyService); </ins> quickPick.keepScrollPosition = true; // recalcuate active items
Code change:
Currently when there is one suggested kernel and that's the one users are using in current document, its presentation in kernel picker is weird <img width="601" alt="image" src="https://user-"This can be simplified as a single "Selected" group at the very top <img width="601" alt="image" src="https://user-"

Related discussion:
text: if (pick) { if (isKernelPick(pick)) { newKernel = pick.kernel; <del> notebookKernelService.selectKernelForNotebook(newKernel, notebook); </del> <ins> this._notebookKernelService.selectKernelForNotebook(newKernel, notebook); </ins> return true; } // actions if (pick.id === 'install') { await this._showKernelExtension( <del> paneCompositeService, extensionWorkbenchService, extensionHostService, </del> <ins> this._paneCompositePartService, this._extensionWorkbenchService, this._extensionService, </ins> notebook.viewType ); // suggestedExtension must be defined for this option to be shown, but still check to make TS happy } else if (isInstallExtensionPick(pick)) { await this._showKernelExtension( <del> paneCompositeService, extensionWorkbenchService, extensionHostService, </del> <ins> this._paneCompositePartService, this._extensionWorkbenchService, this._extensionService, </ins> notebook.viewType, pick.extensionId, <del> productService.quality !== 'stable' </del> <ins> this._productService.quality !== 'stable' </ins> ); } else if (isSourcePick(pick)) { // selected explicilty, it should trigger the execution?
Code change:
Currently when there is one suggested kernel and that's the one users are using in current document, its presentation in kernel picker is weird <img width="601" alt="image" src="https://user-"This can be simplified as a single "Selected" group at the very top <img width="601" alt="image" src="https://user-"

Related discussion:
text: return false; } <ins> private _getEditorFromContext(context?: KernelQuickPickContext): INotebookEditor | undefined { let editor: INotebookEditor | undefined; if (context !== undefined && 'notebookEditorId' in context) { const editorId = context.notebookEditorId; const matchingEditor = this._editorService.visibleEditorPanes.find((editorPane) => { const notebookEditor = getNotebookEditorFromEditorPane(editorPane); return notebookEditor?.getId() === editorId; }); editor = getNotebookEditorFromEditorPane(matchingEditor); } else if (context !== undefined && 'notebookEditor' in context) { editor = context?.notebookEditor; } else { editor = getNotebookEditorFromEditorPane(this._editorService.activeEditorPane); } return editor; } </ins> private _getKernelPickerQuickPickItems( notebookTextModel: NotebookTextModel, matchResult: INotebookKernelMatchResult,
Code change:
Currently when there is one suggested kernel and that's the one users are using in current document, its presentation in kernel picker is weird <img width="601" alt="image" src="https://user-"This can be simplified as a single "Selected" group at the very top <img width="601" alt="image" src="https://user-"

Related discussion:
text: ): QuickPickInput<KernelQuickPickItem>[] { const { selected, all, suggestions, hidden } = matchResult; <del> function toQuickPick(kernel: INotebookKernel) { const res = <KernelPick>{ kernel, picked: kernel.id === selected?.id, label: kernel.label, description: kernel.description, detail: kernel.detail }; if (kernel.id === selected?.id) { if (!res.description) { res.description = localize('current1', "Currently Selected"); } else { res.description = localize('current2', "{0} - Currently Selected", res.description); } } return res; } </del> const quickPickItems: QuickPickInput<KernelQuickPickItem>[] = []; if (all.length) { // Always display suggested kernels on the top. <del> if (suggestions.length) { quickPickItems.push({ type: 'separator', label: localize('suggestedKernels', "Suggested") }); quickPickItems.push(...suggestions.map(toQuickPick)); } </del> <ins> this._fillInSuggestions(quickPickItems, suggestions, selected); </ins> // Next display all of the kernels not marked as hidden grouped by categories or extensions. // If we don't have a kind, always display those at the bottom. <del> const picks = all.filter(item => (!suggestions.includes(item) && !hidden.includes(item))).map(toQuickPick); </del> <ins> const picks = all.filter(item => (!suggestions.includes(item) && !hidden.includes(item))).map(kernel => this._toQuickPick(kernel, selected)); </ins> const kernelsPerCategory = groupBy(picks, (a, b) => compareIgnoreCase(a.kernel.kind || 'z', b.kernel.kind || 'z')); kernelsPerCategory.forEach(items => { quickPickItems.push({