Bladeren bron

Adds color to unpushed/unpulled changes & commits

main
Eric Amodio 4 jaren geleden
bovenliggende
commit
afa47fbc6e
9 gewijzigde bestanden met toevoegingen van 12143 en 20 verwijderingen
  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 Bestand weergeven

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

+ 28
- 2
package.json Bestand weergeven

@ -18,7 +18,7 @@
"url": "https://github.com/eamodio/vscode-gitlens.git"
},
"engines": {
"vscode": "^1.50.0"
"vscode": "^1.51.0"
},
"main": "./dist/gitlens",
"icon": "images/gitlens-icon.png",
@ -2479,6 +2479,33 @@
"light": "#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": [
@ -8119,7 +8146,6 @@
"@types/lodash-es": "4.17.3",
"@types/node": "12.12.70",
"@types/sortablejs": "1.10.6",
"@types/vscode": "1.50.0",
"@typescript-eslint/eslint-plugin": "4.6.1",
"@typescript-eslint/parser": "4.6.1",
"circular-dependency-plugin": "5.2.2",

+ 12100
- 0
src/@types/vscode.d.ts
Diff onderdrukt omdat het te groot bestand
Bestand weergeven


+ 2
- 1
src/annotations/blameAnnotationProvider.ts Bestand weergeven

@ -127,7 +127,8 @@ export abstract class BlameAnnotationProviderBase extends AnnotationProviderBase
this.hoverProviderDisposable = languages.registerHoverProvider(
{ 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 Bestand weergeven

@ -244,7 +244,8 @@ export class GutterChangesAnnotationProvider extends AnnotationProviderBase {
this.hoverProviderDisposable = languages.registerHoverProvider(
{ 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 Bestand weergeven

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

+ 2
- 2
src/views/nodes/commitFileNode.ts Bestand weergeven

@ -1,6 +1,6 @@
'use strict';
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 { GlyphChars } from '../../constants';
import { Container } from '../../container';
@ -88,7 +88,7 @@ export class CommitFileNode extends ViewRefFileNode {
if (this._options.displayAsCommit) {
if (!this.commit.isUncommitted && !(this.view instanceof StashesView) && this.view.config.avatars) {
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 });
}
}

+ 2
- 2
src/views/nodes/commitNode.ts Bestand weergeven

@ -1,6 +1,6 @@
'use strict';
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 { CommitFileNode } from './commitFileNode';
import { ViewFilesLayout } from '../../configuration';
@ -119,7 +119,7 @@ export class CommitNode extends ViewRefNode
messageTruncateAtNewLine: true,
});
item.iconPath = this.unpublished
? new ThemeIcon('arrow-up')
? new ThemeIcon('arrow-up', new ThemeColor('gitlens.viewCommitToPushIconColor'))
: !(this.view instanceof StashesView) && this.view.config.avatars
? await this.commit.getAvatarUri({ defaultStyle: Container.config.defaultGravatarsStyle })
: new ThemeIcon('git-commit');

+ 0
- 5
yarn.lock Bestand weergeven

@ -291,11 +291,6 @@
dependencies:
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@*":
version "2.0.0"
resolved "https://registry.yarnpkg.com/@types/webpack-sources/-/webpack-sources-2.0.0.tgz#08216ab9be2be2e1499beaebc4d469cec81e82a7"

Laden…
Annuleren
Opslaan