Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add inline actions for file changes. #738

Merged
merged 5 commits into from Dec 11, 2018
Merged

Conversation

rebornix
Copy link
Member

@rebornix rebornix commented Dec 6, 2018

image

The only difference between file changes in PR tree view and SCM is the way we render File Change Type.

this._disposables.push(vscode.commands.registerCommand('review.openFile', (uri: vscode.Uri) => {
let params = fromReviewUri(uri);
this._disposables.push(vscode.commands.registerCommand('review.openFile', (value: GitFileChangeNode | vscode.Uri) => {
let params: ReviewUriParams;
Copy link
Contributor

Choose a reason for hiding this comment

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

What about files that have been deleted? In the SCM changes view, clicking the "Open File" button on such a change is a no-op, maybe we should do the same instead of having an error notification show up. Or show a warning notification that the file has been deleted

Copy link
Member Author

Choose a reason for hiding this comment

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

Modified the context for file change node to contain GitChangeType info and then we can filter deleted out.

return '';
}

priority(status: GitChangeType): number {
Copy link
Contributor

Choose a reason for hiding this comment

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

what does priority do? is this the priority of the decoration if there are other providers registered? why not assign the same priority to every change type?

@RMacfarlane
Copy link
Contributor

Looks good, just had one question on the decoration provider

@rebornix
Copy link
Member Author

@RMacfarlane good catch! Update the priority for all our decorations provider, now

  • file change types all have priority 1
  • comment decoration has priority 2

For decorations we add to Tree Item, the file change decoration is always placed on the right

image

@rebornix rebornix merged commit a52f39b into master Dec 11, 2018
@RMacfarlane RMacfarlane deleted the rebornix/inlineactions branch February 16, 2019 00:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants