Browse Source

Adds color to unpushed/unpulled changes & commits

main
Eric Amodio 4 years ago
parent
commit
afa47fbc6e
9 changed files with 12143 additions and 20 deletions
  1. +1
    -1
      .eslintignore
  2. +28
    -2
      package.json
  3. +12100
    -0
      src/@types/vscode.d.ts
  4. +2
    -1
      src/annotations/blameAnnotationProvider.ts
  5. +2
    -1
      src/annotations/gutterChangesAnnotationProvider.ts
  6. +6
    -6
      src/views/nodes/branchTrackingStatusNode.ts
  7. +2
    -2
      src/views/nodes/commitFileNode.ts
  8. +2
    -2
      src/views/nodes/commitNode.ts
  9. +0
    -5
      yarn.lock

+ 1
- 1
.eslintignore View File

@ -1,4 +1,4 @@
dist/* dist/*
@types/*
src/@types/*
emojis.json emojis.json
tsconfig.tsbuildinfo tsconfig.tsbuildinfo

+ 28
- 2
package.json View File

@ -18,7 +18,7 @@
"url": "https://github.com/eamodio/vscode-gitlens.git" "url": "https://github.com/eamodio/vscode-gitlens.git"
}, },
"engines": { "engines": {
"vscode": "^1.50.0"
"vscode": "^1.51.0"
}, },
"main": "./dist/gitlens", "main": "./dist/gitlens",
"icon": "images/gitlens-icon.png", "icon": "images/gitlens-icon.png",
@ -2479,6 +2479,33 @@
"light": "#00BCF299", "light": "#00BCF299",
"highContrast": "#00BCF299" "highContrast": "#00BCF299"
} }
},
{
"id": "gitlens.viewCommitToPushIconColor",
"description": "Specifies the icon color of un-pushed commits in the GitLens views",
"defaults": {
"dark": "#35B15E",
"light": "#35B15E",
"highContrast": "#35B15E"
}
},
{
"id": "gitlens.viewChangesToPushIconColor",
"description": "Specifies the icon color of the _Changes to push_ node in the GitLens views",
"defaults": {
"dark": "#35B15E",
"light": "#35B15E",
"highContrast": "#35B15E"
}
},
{
"id": "gitlens.viewChangesToPullIconColor",
"description": "Specifies the icon color of the _Changes to pull_ node in the GitLens views",
"defaults": {
"dark": "#B15E35",
"light": "#B15E35",
"highContrast": "#B15E35"
}
} }
], ],
"commands": [ "commands": [
@ -8119,7 +8146,6 @@
"@types/lodash-es": "4.17.3", "@types/lodash-es": "4.17.3",
"@types/node": "12.12.70", "@types/node": "12.12.70",
"@types/sortablejs": "1.10.6", "@types/sortablejs": "1.10.6",
"@types/vscode": "1.50.0",
"@typescript-eslint/eslint-plugin": "4.6.1", "@typescript-eslint/eslint-plugin": "4.6.1",
"@typescript-eslint/parser": "4.6.1", "@typescript-eslint/parser": "4.6.1",
"circular-dependency-plugin": "5.2.2", "circular-dependency-plugin": "5.2.2",

+ 12100
- 0
src/@types/vscode.d.ts
File diff suppressed because it is too large
View File


+ 2
- 1
src/annotations/blameAnnotationProvider.ts View File

@ -127,7 +127,8 @@ export abstract class BlameAnnotationProviderBase extends AnnotationProviderBase
this.hoverProviderDisposable = languages.registerHoverProvider( this.hoverProviderDisposable = languages.registerHoverProvider(
{ pattern: this.document.uri.fsPath }, { pattern: this.document.uri.fsPath },
{ {
provideHover: (document, position, token) => this.provideHover(providers, document, position, token),
provideHover: (document: TextDocument, position: Position, token: CancellationToken) =>
this.provideHover(providers, document, position, token),
}, },
); );
} }

+ 2
- 1
src/annotations/gutterChangesAnnotationProvider.ts View File

@ -244,7 +244,8 @@ export class GutterChangesAnnotationProvider extends AnnotationProviderBase {
this.hoverProviderDisposable = languages.registerHoverProvider( this.hoverProviderDisposable = languages.registerHoverProvider(
{ pattern: this.document.uri.fsPath }, { pattern: this.document.uri.fsPath },
{ {
provideHover: (document, position, token) => this.provideHover(document, position, token),
provideHover: (document: TextDocument, position: Position, token: CancellationToken) =>
this.provideHover(document, position, token),
}, },
); );
} }

+ 6
- 6
src/views/nodes/branchTrackingStatusNode.ts View File

@ -1,5 +1,5 @@
'use strict'; 'use strict';
import { ThemeIcon, TreeItem, TreeItemCollapsibleState, window } from 'vscode';
import { ThemeColor, ThemeIcon, TreeItem, TreeItemCollapsibleState, window } from 'vscode';
import { BranchNode } from './branchNode'; import { BranchNode } from './branchNode';
import { BranchTrackingStatusFilesNode } from './branchTrackingStatusFilesNode'; import { BranchTrackingStatusFilesNode } from './branchTrackingStatusFilesNode';
import { CommitNode } from './commitNode'; import { CommitNode } from './commitNode';
@ -141,7 +141,7 @@ export class BranchTrackingStatusNode extends ViewNode implement
contextValue = this.root contextValue = this.root
? ContextValues.StatusAheadOfUpstream ? ContextValues.StatusAheadOfUpstream
: ContextValues.BranchStatusAheadOfUpstream; : ContextValues.BranchStatusAheadOfUpstream;
icon = 'cloud-upload';
icon = new ThemeIcon('cloud-upload', new ThemeColor('gitlens.viewChangesToPushIconColor'));
break; break;
@ -156,7 +156,7 @@ export class BranchTrackingStatusNode extends ViewNode implement
contextValue = this.root contextValue = this.root
? ContextValues.StatusBehindUpstream ? ContextValues.StatusBehindUpstream
: ContextValues.BranchStatusBehindUpstream; : ContextValues.BranchStatusBehindUpstream;
icon = 'cloud-download';
icon = new ThemeIcon('cloud-download', new ThemeColor('gitlens.viewChangesToPullIconColor'));
break; break;
@ -167,7 +167,7 @@ export class BranchTrackingStatusNode extends ViewNode implement
collapsibleState = TreeItemCollapsibleState.None; collapsibleState = TreeItemCollapsibleState.None;
contextValue = this.root ? ContextValues.StatusSameAsUpstream : undefined; contextValue = this.root ? ContextValues.StatusSameAsUpstream : undefined;
icon = 'cloud';
icon = new ThemeIcon('cloud');
break; break;
@ -177,7 +177,7 @@ export class BranchTrackingStatusNode extends ViewNode implement
collapsibleState = TreeItemCollapsibleState.None; collapsibleState = TreeItemCollapsibleState.None;
contextValue = this.root ? ContextValues.StatusNoUpstream : undefined; contextValue = this.root ? ContextValues.StatusNoUpstream : undefined;
icon = 'cloud-upload';
icon = new ThemeIcon('cloud-upload', new ThemeColor('gitlens.viewChangesToPushIconColor'));
break; break;
} }
@ -189,7 +189,7 @@ export class BranchTrackingStatusNode extends ViewNode implement
if (lastFetched) { if (lastFetched) {
tooltip += `\nLast fetched ${Dates.getFormatter(new Date(lastFetched)).fromNow()}`; tooltip += `\nLast fetched ${Dates.getFormatter(new Date(lastFetched)).fromNow()}`;
} }
item.iconPath = new ThemeIcon(icon);
item.iconPath = icon;
item.tooltip = tooltip; item.tooltip = tooltip;
return item; return item;

+ 2
- 2
src/views/nodes/commitFileNode.ts View File

@ -1,6 +1,6 @@
'use strict'; 'use strict';
import * as paths from 'path'; import * as paths from 'path';
import { Command, Selection, ThemeIcon, TreeItem, TreeItemCollapsibleState } from 'vscode';
import { Command, Selection, ThemeColor, ThemeIcon, TreeItem, TreeItemCollapsibleState } from 'vscode';
import { Commands, DiffWithPreviousCommandArgs } from '../../commands'; import { Commands, DiffWithPreviousCommandArgs } from '../../commands';
import { GlyphChars } from '../../constants'; import { GlyphChars } from '../../constants';
import { Container } from '../../container'; import { Container } from '../../container';
@ -88,7 +88,7 @@ export class CommitFileNode extends ViewRefFileNode {
if (this._options.displayAsCommit) { if (this._options.displayAsCommit) {
if (!this.commit.isUncommitted && !(this.view instanceof StashesView) && this.view.config.avatars) { if (!this.commit.isUncommitted && !(this.view instanceof StashesView) && this.view.config.avatars) {
item.iconPath = this._options.unpublished item.iconPath = this._options.unpublished
? new ThemeIcon('arrow-up')
? new ThemeIcon('arrow-up', new ThemeColor('gitlens.viewCommitToPushIconColor'))
: await this.commit.getAvatarUri({ defaultStyle: Container.config.defaultGravatarsStyle }); : await this.commit.getAvatarUri({ defaultStyle: Container.config.defaultGravatarsStyle });
} }
} }

+ 2
- 2
src/views/nodes/commitNode.ts View File

@ -1,6 +1,6 @@
'use strict'; 'use strict';
import * as paths from 'path'; import * as paths from 'path';
import { Command, ThemeIcon, TreeItem, TreeItemCollapsibleState } from 'vscode';
import { Command, ThemeColor, ThemeIcon, TreeItem, TreeItemCollapsibleState } from 'vscode';
import { Commands, DiffWithPreviousCommandArgs } from '../../commands'; import { Commands, DiffWithPreviousCommandArgs } from '../../commands';
import { CommitFileNode } from './commitFileNode'; import { CommitFileNode } from './commitFileNode';
import { ViewFilesLayout } from '../../configuration'; import { ViewFilesLayout } from '../../configuration';
@ -119,7 +119,7 @@ export class CommitNode extends ViewRefNode
messageTruncateAtNewLine: true, messageTruncateAtNewLine: true,
}); });
item.iconPath = this.unpublished item.iconPath = this.unpublished
? new ThemeIcon('arrow-up')
? new ThemeIcon('arrow-up', new ThemeColor('gitlens.viewCommitToPushIconColor'))
: !(this.view instanceof StashesView) && this.view.config.avatars : !(this.view instanceof StashesView) && this.view.config.avatars
? await this.commit.getAvatarUri({ defaultStyle: Container.config.defaultGravatarsStyle }) ? await this.commit.getAvatarUri({ defaultStyle: Container.config.defaultGravatarsStyle })
: new ThemeIcon('git-commit'); : new ThemeIcon('git-commit');

+ 0
- 5
yarn.lock View File

@ -291,11 +291,6 @@
dependencies: dependencies:
source-map "^0.6.1" source-map "^0.6.1"
"@types/vscode@1.50.0":
version "1.50.0"
resolved "https://registry.yarnpkg.com/@types/vscode/-/vscode-1.50.0.tgz#9f409d9dce22ebc11e2fcdd28fabd1917a961bb7"
integrity sha512-QnIeyi4L2DiD9M2bAQKRzT/EQvc80qP9UL6JD5TiLlNRL1khIDg4ej4mDSRbtFrDAsRntFI1RhMvdomUThMsqg==
"@types/webpack-sources@*": "@types/webpack-sources@*":
version "2.0.0" version "2.0.0"
resolved "https://registry.yarnpkg.com/@types/webpack-sources/-/webpack-sources-2.0.0.tgz#08216ab9be2be2e1499beaebc4d469cec81e82a7" resolved "https://registry.yarnpkg.com/@types/webpack-sources/-/webpack-sources-2.0.0.tgz#08216ab9be2be2e1499beaebc4d469cec81e82a7"

Loading…
Cancel
Save