jiebi/CodeConvo huggingface dataset:
Code change:
Type: <bBug</bnotebook an image from the workspace into a markdown cell Bug this inserts the full uri, such as It should insert the relative path instead VS Code version: Code - Insiders 1.71.0-insider (Universal) (, 2022-08-10T05:18:38.020Z) OS version: Darwin x64 21.6.0 Modes: Sandboxed: Yes <details<summarySystem Info</summary </details<!-- generated by issue reporter --

Related discussion:
text: return snippet; } <ins> function getParentDocumentUri(document: vscode.TextDocument): vscode.Uri { if (document.uri.scheme === Schemes.notebookCell) { for (const notebook of vscode.workspace.notebookDocuments) { for (const cell of notebook.getCells()) { if (cell.document === document) { return notebook.uri; } } } } return document.uri; } </ins>
Code change:
Testing As mentioned in the title it should be in this modal: <img width="405" alt="image" src="https://user-"
Thanks

Related discussion:
text: const actions: string[] = [ localize('saveWithConflict', "Save with Conflicts"), <del> localize('discard', "Don't save"), </del> <ins> localize('discard', "Don't Save"), </ins> localize('cancel', "Cancel"), ];
Code change:
Testing When my cursor isn't inside of a conflict, this command does nothing. Should it only be visible in the quickpick when it does something? Or should there be an error message when you try to run it but it doesn't do anything? Same with the "Toggle Current Conflict from Right". <img width="549" alt="image" src="https://user-"
I fear if we hide it when there is nothing to toggle, users won't discover that there is a (keybindable) command for this functionality. How did you find this command? Was your cursor in a conflicting region?
It wasn't in a conflicting region at the time
Let's show an error message if this command does not do anything.
If I run the toggle command in an invalid region, I get a notification, which is good. But, if I then toggle a valid region after, the notification still stays on the screen for a while. Can the notification be hidden when the user toggles a valid region?
Can notifications be removed? I thought that is not possible. Also, I think this use-case is quite rare. The notification is just to teach that you should be in a conflict.

Related discussion:
text: const inputModel = await input.resolve(); const model = inputModel.model; <del> const viewModel = new MergeEditorViewModel(model, this.input1View, this.input2View, this.inputResultView, this.baseView, this.showNonConflictingChanges, this.configurationService); </del> <ins> const viewModel = this.instantiationService.createInstance( MergeEditorViewModel, model, this.input1View, this.input2View, this.inputResultView, this.baseView, this.showNonConflictingChanges, ); </ins> model.telemetry.reportMergeEditorOpened({
Code change:
Testing When my cursor isn't inside of a conflict, this command does nothing. Should it only be visible in the quickpick when it does something? Or should there be an error message when you try to run it but it doesn't do anything? Same with the "Toggle Current Conflict from Right". <img width="549" alt="image" src="https://user-"
I fear if we hide it when there is nothing to toggle, users won't discover that there is a (keybindable) command for this functionality. How did you find this command? Was your cursor in a conflicting region?
It wasn't in a conflicting region at the time
Let's show an error message if this command does not do anything.
If I run the toggle command in an invalid region, I get a notification, which is good. But, if I then toggle a valid region after, the notification still stays on the screen for a while. Can the notification be hidden when the user toggles a valid region?
Can notifications be removed? I thought that is not possible. Also, I think this use-case is quite rare. The notification is just to teach that you should be in a conflict.

Related discussion:
text: import { derived, derivedObservableWithWritableCache, IObservable, IReader, ITransaction, observableFromEvent, observableValue, transaction } from 'vs/base/common/observable'; import { Range } from 'vs/editor/common/core/range'; import { ScrollType } from 'vs/editor/common/editorCommon'; <ins> import { localize } from 'vs/nls'; </ins> import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; <ins> import { INotificationService } from 'vs/platform/notification/common/notification'; </ins> import { LineRange } from 'vs/workbench/contrib/mergeEditor/browser/model/lineRange'; import { MergeEditorModel } from 'vs/workbench/contrib/mergeEditor/browser/model/mergeEditorModel'; import { ModifiedBaseRange, ModifiedBaseRangeState } from 'vs/workbench/contrib/mergeEditor/browser/model/modifiedBaseRange';
Code change:
Testing When my cursor isn't inside of a conflict, this command does nothing. Should it only be visible in the quickpick when it does something? Or should there be an error message when you try to run it but it doesn't do anything? Same with the "Toggle Current Conflict from Right". <img width="549" alt="image" src="https://user-"
I fear if we hide it when there is nothing to toggle, users won't discover that there is a (keybindable) command for this functionality. How did you find this command? Was your cursor in a conflicting region?
It wasn't in a conflicting region at the time
Let's show an error message if this command does not do anything.
If I run the toggle command in an invalid region, I get a notification, which is good. But, if I then toggle a valid region after, the notification still stays on the screen for a while. Can the notification be hidden when the user toggles a valid region?
Can notifications be removed? I thought that is not possible. Also, I think this use-case is quite rare. The notification is just to teach that you should be in a conflict.

Related discussion:
text: public readonly resultCodeEditorView: ResultCodeEditorView, public readonly baseCodeEditorView: IObservable<BaseCodeEditorView | undefined>, public readonly showNonConflictingChanges: IObservable<boolean>, <del> @IConfigurationService public readonly configurationService: IConfigurationService, </del> <ins> @IConfigurationService private readonly configurationService: IConfigurationService, @INotificationService private readonly notificationService: INotificationService </ins> ) { super();
Code change:
Testing When my cursor isn't inside of a conflict, this command does nothing. Should it only be visible in the quickpick when it does something? Or should there be an error message when you try to run it but it doesn't do anything? Same with the "Toggle Current Conflict from Right". <img width="549" alt="image" src="https://user-"
I fear if we hide it when there is nothing to toggle, users won't discover that there is a (keybindable) command for this functionality. How did you find this command? Was your cursor in a conflicting region?
It wasn't in a conflicting region at the time
Let's show an error message if this command does not do anything.
If I run the toggle command in an invalid region, I get a notification, which is good. But, if I then toggle a valid region after, the notification still stays on the screen for a while. Can the notification be hidden when the user toggles a valid region?
Can notifications be removed? I thought that is not possible. Also, I think this use-case is quite rare. The notification is just to teach that you should be in a conflict.

Related discussion:
text: public toggleActiveConflict(inputNumber: 1 | 2): void { const activeModifiedBaseRange = this.activeModifiedBaseRange.get(); if (!activeModifiedBaseRange) { <ins> this.notificationService.error(localize('noConflictMessage', "There is currently no conflict focused that can be toggled.")); </ins> return; } transaction(tx => {
Code change:
<img width="603" alt="image" src="https://user-"
!

Related discussion:
text: } .extension-list-item > .details > .footer > .monaco-action-bar > .actions-container .action-label:not(.icon) { <del> border-radius: 0; </del> <ins> border-radius: 2px; </ins> } .extension-list-item > .details > .footer > .monaco-action-bar > .actions-container .extension-action.label {
Code change:
Refs: I do not understand this condition: How does that make sure a method exists? The only check for this that is valid currently is , the is just a detail of the file system and not a capability.
This looks like an actual typo to me or missing code review, not sure the consequences, as it could lead to errors when wrongly asserting, so maybe moving to August for investigation.
TLDR I misunderstood how the declared capabilities relate to the actual declared methods and the meaning of . For context, this change came in through and the intention of this change was to support the scenario where an has declared but not : since is optional in the interface and the capability requires both and to be implemented: I made this change because when implementing a with but not , this would result in throwing here: I see how it's possible that a which has check does not have a method implemented. Additionally I see that we have other examples of how to handle the requirement of a readonly filesystem which implements both and , e.g.: I am reverting Apologies for the incorrect code change and thank you for pointing this out.

Related discussion:
text: return provider; } <del> private async withReadProvider(resource: URI): Promise<IFileSystemProviderWithFileReadWriteCapability | IFileSystemProviderWithOpenReadWriteCloseCapability | IFileSystemProviderWithFileReadStreamCapability | IFileSystemProviderWithFileReadCapability> { </del> <ins> private async withReadProvider(resource: URI): Promise<IFileSystemProviderWithFileReadWriteCapability | IFileSystemProviderWithOpenReadWriteCloseCapability | IFileSystemProviderWithFileReadStreamCapability> { </ins> const provider = await this.withProvider(resource); <del> if (hasOpenReadWriteCloseCapability(provider) || hasReadWriteCapability(provider) || hasFileReadStreamCapability(provider) || hasFileReadCapability(provider)) { </del> <ins> if (hasOpenReadWriteCloseCapability(provider) || hasReadWriteCapability(provider) || hasFileReadStreamCapability(provider)) { </ins> return provider; } <del> throw new Error(`Filesystem provider for scheme '${resource.scheme}' neither has FileReadWrite, FileReadStream, FileOpenReadWriteClose nor Readonly capability which is needed for the read operation.`); </del> <ins> throw new Error(`Filesystem provider for scheme '${resource.scheme}' neither has FileReadWrite, FileReadStream nor FileOpenReadWriteClose capability which is needed for the read operation.`); </ins> } private async withWriteProvider(resource: URI): Promise<IFileSystemProviderWithFileReadWriteCapability | IFileSystemProviderWithOpenReadWriteCloseCapability> {
Code change:
Refs: I do not understand this condition: How does that make sure a method exists? The only check for this that is valid currently is , the is just a detail of the file system and not a capability.
This looks like an actual typo to me or missing code review, not sure the consequences, as it could lead to errors when wrongly asserting, so maybe moving to August for investigation.
TLDR I misunderstood how the declared capabilities relate to the actual declared methods and the meaning of . For context, this change came in through and the intention of this change was to support the scenario where an has declared but not : since is optional in the interface and the capability requires both and to be implemented: I made this change because when implementing a with but not , this would result in throwing here: I see how it's possible that a which has check does not have a method implemented. Additionally I see that we have other examples of how to handle the requirement of a readonly filesystem which implements both and , e.g.: I am reverting Apologies for the incorrect code change and thank you for pointing this out.

Related discussion:
text: return this.doReadFile(provider, resource, options, token); } <del> private async doReadFileAtomic(provider: IFileSystemProviderWithFileReadWriteCapability | IFileSystemProviderWithOpenReadWriteCloseCapability | IFileSystemProviderWithFileReadStreamCapability | IFileSystemProviderWithFileReadCapability, resource: URI, options?: IReadFileOptions, token?: CancellationToken): Promise<IFileContent> { </del> <ins> private async doReadFileAtomic(provider: IFileSystemProviderWithFileReadWriteCapability | IFileSystemProviderWithOpenReadWriteCloseCapability | IFileSystemProviderWithFileReadStreamCapability, resource: URI, options?: IReadFileOptions, token?: CancellationToken): Promise<IFileContent> { </ins> return new Promise<IFileContent>((resolve, reject) => { this.writeQueue.queueFor(resource, this.getExtUri(provider).providerExtUri).queue(async () => { try {
Code change:
Refs: I do not understand this condition: How does that make sure a method exists? The only check for this that is valid currently is , the is just a detail of the file system and not a capability.
This looks like an actual typo to me or missing code review, not sure the consequences, as it could lead to errors when wrongly asserting, so maybe moving to August for investigation.
TLDR I misunderstood how the declared capabilities relate to the actual declared methods and the meaning of . For context, this change came in through and the intention of this change was to support the scenario where an has declared but not : since is optional in the interface and the capability requires both and to be implemented: I made this change because when implementing a with but not , this would result in throwing here: I see how it's possible that a which has check does not have a method implemented. Additionally I see that we have other examples of how to handle the requirement of a readonly filesystem which implements both and , e.g.: I am reverting Apologies for the incorrect code change and thank you for pointing this out.

Related discussion:
text: }); } <del> private async doReadFile(provider: IFileSystemProviderWithFileReadWriteCapability | IFileSystemProviderWithOpenReadWriteCloseCapability | IFileSystemProviderWithFileReadStreamCapability | IFileSystemProviderWithFileReadCapability, resource: URI, options?: IReadFileOptions, token?: CancellationToken): Promise<IFileContent> { </del> <ins> private async doReadFile(provider: IFileSystemProviderWithFileReadWriteCapability | IFileSystemProviderWithOpenReadWriteCloseCapability | IFileSystemProviderWithFileReadStreamCapability, resource: URI, options?: IReadFileOptions, token?: CancellationToken): Promise<IFileContent> { </ins> const stream = await this.doReadFileStream(provider, resource, { ...options, // optimization: since we know that the caller does not
Code change:
Refs: I do not understand this condition: How does that make sure a method exists? The only check for this that is valid currently is , the is just a detail of the file system and not a capability.
This looks like an actual typo to me or missing code review, not sure the consequences, as it could lead to errors when wrongly asserting, so maybe moving to August for investigation.
TLDR I misunderstood how the declared capabilities relate to the actual declared methods and the meaning of . For context, this change came in through and the intention of this change was to support the scenario where an has declared but not : since is optional in the interface and the capability requires both and to be implemented: I made this change because when implementing a with but not , this would result in throwing here: I see how it's possible that a which has check does not have a method implemented. Additionally I see that we have other examples of how to handle the requirement of a readonly filesystem which implements both and , e.g.: I am reverting Apologies for the incorrect code change and thank you for pointing this out.

Related discussion:
text: return this.doReadFileStream(provider, resource, options, token); } <del> private async doReadFileStream(provider: IFileSystemProviderWithFileReadWriteCapability | IFileSystemProviderWithOpenReadWriteCloseCapability | IFileSystemProviderWithFileReadStreamCapability | IFileSystemProviderWithFileReadCapability, resource: URI, options?: IReadFileOptions & IReadFileStreamOptions & { preferUnbuffered?: boolean }, token?: CancellationToken): Promise<IFileStreamContent> { </del> <ins> private async doReadFileStream(provider: IFileSystemProviderWithFileReadWriteCapability | IFileSystemProviderWithOpenReadWriteCloseCapability | IFileSystemProviderWithFileReadStreamCapability, resource: URI, options?: IReadFileOptions & IReadFileStreamOptions & { preferUnbuffered?: boolean }, token?: CancellationToken): Promise<IFileStreamContent> { </ins> // install a cancellation token that gets cancelled // when any error occurs. this allows us to resolve
Code change:
Refs: I do not understand this condition: How does that make sure a method exists? The only check for this that is valid currently is , the is just a detail of the file system and not a capability.
This looks like an actual typo to me or missing code review, not sure the consequences, as it could lead to errors when wrongly asserting, so maybe moving to August for investigation.
TLDR I misunderstood how the declared capabilities relate to the actual declared methods and the meaning of . For context, this change came in through and the intention of this change was to support the scenario where an has declared but not : since is optional in the interface and the capability requires both and to be implemented: I made this change because when implementing a with but not , this would result in throwing here: I see how it's possible that a which has check does not have a method implemented. Additionally I see that we have other examples of how to handle the requirement of a readonly filesystem which implements both and , e.g.: I am reverting Apologies for the incorrect code change and thank you for pointing this out.

Related discussion:
text: return stream; } <del> private readFileUnbuffered(provider: IFileSystemProviderWithFileReadWriteCapability | IFileSystemProviderWithFileAtomicReadCapability | IFileSystemProviderWithFileReadCapability, resource: URI, options?: IReadFileOptions & IReadFileStreamOptions): VSBufferReadableStream { </del> <ins> private readFileUnbuffered(provider: IFileSystemProviderWithFileReadWriteCapability | IFileSystemProviderWithFileAtomicReadCapability, resource: URI, options?: IReadFileOptions & IReadFileStreamOptions): VSBufferReadableStream { </ins> const stream = newWriteableStream<VSBuffer>(data => VSBuffer.concat(data)); // Read the file into the stream async but do not wait for
Code change:
Refs: I do not understand this condition: How does that make sure a method exists? The only check for this that is valid currently is , the is just a detail of the file system and not a capability.
This looks like an actual typo to me or missing code review, not sure the consequences, as it could lead to errors when wrongly asserting, so maybe moving to August for investigation.
TLDR I misunderstood how the declared capabilities relate to the actual declared methods and the meaning of . For context, this change came in through and the intention of this change was to support the scenario where an has declared but not : since is optional in the interface and the capability requires both and to be implemented: I made this change because when implementing a with but not , this would result in throwing here: I see how it's possible that a which has check does not have a method implemented. Additionally I see that we have other examples of how to handle the requirement of a readonly filesystem which implements both and , e.g.: I am reverting Apologies for the incorrect code change and thank you for pointing this out.

Related discussion:
text: return !!(provider.capabilities & FileSystemProviderCapabilities.FileReadStream); } <del> export interface IFileSystemProviderWithFileReadCapability extends IFileSystemProvider { readFile(resource: URI): Promise<Uint8Array>; } export function hasFileReadCapability(provider: IFileSystemProvider): provider is IFileSystemProviderWithFileReadCapability { return !!(provider.capabilities & FileSystemProviderCapabilities.Readonly); } </del> export interface IFileSystemProviderWithFileAtomicReadCapability extends IFileSystemProvider { readFile(resource: URI, opts?: IFileAtomicReadOptions): Promise<Uint8Array>; }
Code change:
Refs: I do not understand this condition: How does that make sure a method exists? The only check for this that is valid currently is , the is just a detail of the file system and not a capability.
This looks like an actual typo to me or missing code review, not sure the consequences, as it could lead to errors when wrongly asserting, so maybe moving to August for investigation.
TLDR I misunderstood how the declared capabilities relate to the actual declared methods and the meaning of . For context, this change came in through and the intention of this change was to support the scenario where an has declared but not : since is optional in the interface and the capability requires both and to be implemented: I made this change because when implementing a with but not , this would result in throwing here: I see how it's possible that a which has check does not have a method implemented. Additionally I see that we have other examples of how to handle the requirement of a readonly filesystem which implements both and , e.g.: I am reverting Apologies for the incorrect code change and thank you for pointing this out.

Related discussion:
text: import { Disposable, IDisposable } from 'vs/base/common/lifecycle'; import { Event } from 'vs/base/common/event'; import { URI } from 'vs/base/common/uri'; <del> import { FilePermission, FileSystemProviderCapabilities, FileSystemProviderErrorCode, FileType, IFileDeleteOptions, IFileOverwriteOptions, IFileSystemProviderWithFileReadCapability, IStat, IWatchOptions } from 'vs/platform/files/common/files'; </del> <ins> import { FilePermission, FileSystemProviderCapabilities, FileSystemProviderErrorCode, FileType, IFileDeleteOptions, IFileOverwriteOptions, IFileSystemProviderWithFileReadWriteCapability, IStat, IWatchOptions } from 'vs/platform/files/common/files'; </ins> import { ChangeType, decodeEditSessionFileContent, EDIT_SESSIONS_SCHEME, IEditSessionsStorageService } from 'vs/workbench/contrib/editSessions/common/editSessions'; <ins> import { NotSupportedError } from 'vs/base/common/errors'; </ins> <del> export class EditSessionsFileSystemProvider implements IFileSystemProviderWithFileReadCapability { </del> <ins> export class EditSessionsFileSystemProvider implements IFileSystemProviderWithFileReadWriteCapability { </ins> static readonly SCHEMA = EDIT_SESSIONS_SCHEME;