Skip to content

Compare with Clipboard#37841

Merged
bpasero merged 6 commits intomicrosoft:masterfrom
maxfurman:compare-with-clipboard
Nov 10, 2017
Merged

Compare with Clipboard#37841
bpasero merged 6 commits intomicrosoft:masterfrom
maxfurman:compare-with-clipboard

Conversation

@maxfurman
Copy link
Contributor

Resolves #7278
Open the clipboard contents side-by-side with the currently open buffer
Also I found a typo in one of the tslint error messages.

@bpasero bpasero self-assigned this Nov 9, 2017
Copy link
Member

@bpasero bpasero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good start, some minor things.

import { IModeService } from 'vs/editor/common/services/modeService';


export class ClipboardContentProvider implements ITextModelContentProvider {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we inline this into the CompareWithClipboardAction, I do not think it deserves its own top level thing.

const provider = instantiationService.createInstance(ClipboardContentProvider);
// this.toDispose.push(provider);

const registrationDisposal = textModelService.registerTextModelContentProvider(CompareWithClipboardAction.SCHEME, provider);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we move the registration into the run method and dispose it after the run has finished? This makes sure we are not keeping the clipboard content provider around for any longer than for the invocation of the action.

);


if (resource && resource.scheme === 'file') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You do not need to check for resource.scheme === 'file' again, the previous call makes sure of that.

@bpasero bpasero added this to the On Deck milestone Nov 9, 2017
@bpasero bpasero merged commit a0031de into microsoft:master Nov 10, 2017
@bpasero
Copy link
Member

bpasero commented Nov 10, 2017

@maxfurman thanks!

@bpasero bpasero modified the milestones: On Deck, November 2017 Nov 10, 2017
@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow to compare project file with clipboard

2 participants