extract stash explorer#94
Conversation
src/views/gitStashExplorer.ts
Outdated
|
|
||
| export * from './gitExplorerNodes'; | ||
|
|
||
| export class GitStashExplorer implements TreeDataProvider<ExplorerNode> { |
There was a problem hiding this comment.
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 ;)
| ? 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); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
eae909f to
f61afe5
Compare
6429d27 to
65dc12f
Compare
Commits can be searched by short or full hashes
Move stash explorer out of Gitlens explorer.