|
|
@ -2,6 +2,7 @@ |
|
|
|
import { Iterables } from '../system'; |
|
|
|
import { ExtensionContext, TreeItem, TreeItemCollapsibleState } from 'vscode'; |
|
|
|
import { BranchHistoryNode } from './branchHistoryNode'; |
|
|
|
import { GlyphChars } from '../constants'; |
|
|
|
import { ExplorerNode, ResourceType } from './explorerNode'; |
|
|
|
import { GitRemote, GitService, GitUri } from '../gitService'; |
|
|
|
|
|
|
@ -22,7 +23,26 @@ export class RemoteNode extends ExplorerNode { |
|
|
|
} |
|
|
|
|
|
|
|
getTreeItem(): TreeItem { |
|
|
|
const item = new TreeItem(this.remote.name, TreeItemCollapsibleState.Collapsed); |
|
|
|
const fetch = this.remote.types.includes('push'); |
|
|
|
const push = this.remote.types.includes('push'); |
|
|
|
|
|
|
|
let separator; |
|
|
|
if (fetch && push) { |
|
|
|
separator = GlyphChars.ArrowLeftRight; |
|
|
|
} |
|
|
|
else if (fetch) { |
|
|
|
separator = GlyphChars.ArrowLeft; |
|
|
|
} |
|
|
|
else if (push) { |
|
|
|
separator = GlyphChars.ArrowRight; |
|
|
|
} |
|
|
|
else { |
|
|
|
separator = GlyphChars.Dash; |
|
|
|
} |
|
|
|
|
|
|
|
const label = `${this.remote.name} ${GlyphChars.Space}${separator}${GlyphChars.Space} ${(this.remote.provider !== undefined) ? this.remote.provider.name : this.remote.domain} ${GlyphChars.Space}${GlyphChars.Dot}${GlyphChars.Space} ${this.remote.path}`; |
|
|
|
|
|
|
|
const item = new TreeItem(label, TreeItemCollapsibleState.Collapsed); |
|
|
|
item.contextValue = this.resourceType; |
|
|
|
|
|
|
|
// item.iconPath = {
|
|
|
|