Skip to content

extract stash explorer#94

Merged
eamodio merged 2 commits intogitkraken:feature-explorerfrom
rebornix:ExtractStashExplorer
Jun 14, 2017
Merged

extract stash explorer#94
eamodio merged 2 commits intogitkraken:feature-explorerfrom
rebornix:ExtractStashExplorer

Conversation

@rebornix
Copy link
Contributor

Move stash explorer out of Gitlens explorer.


export * from './gitExplorerNodes';

export class GitStashExplorer implements TreeDataProvider<ExplorerNode> {
Copy link
Member

Choose a reason for hiding this comment

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

Let's just call it StashExplorer -- I know my naming has git everywhere, but I'm going to try to move away from it eventually ;)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Addressed.

? new GitUri(editor.document.uri, { repoPath: git.repoPath, fileName: editor.document.uri.fsPath })
: new GitUri(Uri.file(git.repoPath), { repoPath: git.repoPath, fileName: git.repoPath });

this._node = new StashNode(uri, this.context, this.git);
Copy link
Member

Choose a reason for hiding this comment

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

What do you think of keeping this in a node or just nuking the node and dropping the logic in the explorer? I keep going back and forth -- eh keeping it in the node is nice for possible reuse later in another view or whatnot

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The first time I saw the code, I found that it's not intuitive enough. For example, let's say we have this Stash Explorer, the tree node can only be StashNode or FileChangeNode so a union type StashNode | FileChangeNode is good enough. That's also how I implemented it.

But for your case, if the hierarchy can be more than 2, your solution is definitely smarter. The leaf node is always FileChangeNode in Commits, Stashes, Pull Request so I'll say let's go with this way, putting things into the node and reuse them with ease.

@eamodio eamodio force-pushed the feature-explorer branch from eae909f to f61afe5 Compare June 14, 2017 02:36
@rebornix rebornix force-pushed the ExtractStashExplorer branch from 6429d27 to 65dc12f Compare June 14, 2017 03:05
@eamodio eamodio merged commit 57874ed into gitkraken:feature-explorer Jun 14, 2017
billsedison added a commit to noside911/vscode-gitlens that referenced this pull request Jan 4, 2019
Commits can be searched by short or full hashes
billsedison added a commit to noside911/vscode-gitlens that referenced this pull request Jan 4, 2019
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.

2 participants