mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-01-25 18:02:01 -05:00
Adds customizable code lens strings
This commit is contained in:
@@ -21,6 +21,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
|
||||
- Adds `Show File Blame Annotations` command (`gitlens.showFileBlame`) - shows the file blame annotations
|
||||
- Adds `Open File in Remote` command (`gitlens.openFileInRemote`) to the `editor/title` context menu
|
||||
- Adds `Open Repo in Remote` command (`gitlens.openRepoInRemote`) to the `editor/title` context menu
|
||||
- Adds `gitlens.strings.*` settings to allow for the customization of certain strings displayed
|
||||
- Adds `gitlens.theme.*` settings to allow for the theming of certain elements
|
||||
|
||||
### Changed
|
||||
- (BREAKING) Almost all of the GitLens settings have either been renamed, removed, or otherwise changed - see the [README](https://github.com/eamodio/vscode-gitlens/blob/develop/README.md#extension-settings)`
|
||||
|
||||
@@ -271,6 +271,14 @@ GitLens is highly customizable and provides many configuration settings to allow
|
||||
|`gitlens.statusBar.format`|Specifies the format of the blame information on the status bar<br />Available tokens<br />`${id}` - commit id<br />`${author}` - commit author<br />`${message}` - commit message<br />`${ago}` - relative commit date (e.g. 1 day ago)<br />`${date}` - formatted commit date (format specified by `gitlens.statusBar.dateFormat`)<br />See https://github.com/eamodio/vscode-gitlens/wiki/Advanced-Formatting for advanced formatting
|
||||
|`gitlens.statusBar.dateFormat`|Specifies the date format of absolute dates shown in the blame information on the status bar<br />See https://momentjs.com/docs/#/displaying/format/ for valid formats
|
||||
|
||||
### Strings Settings
|
||||
|
||||
|Name | Description
|
||||
|-----|------------
|
||||
|`gitlens.strings.codeLens.unsavedChanges.recentChangeAndAuthors`|Specifies the string to be shown in place of both the `recent change` and `authors` code lens when there are unsaved changes
|
||||
|`gitlens.strings.codeLens.unsavedChanges.recentChangeOnly`|Specifies the string to be shown in place of the `recent change` code lens when there are unsaved changes
|
||||
|`gitlens.strings.codeLens.unsavedChanges.authorsOnly`|Specifies the string to be shown in place of the `authors` code lens when there are unsaved changes
|
||||
|
||||
### Theme Settings
|
||||
|
||||
|Name | Description
|
||||
|
||||
15
package.json
15
package.json
@@ -408,6 +408,21 @@
|
||||
"default": null,
|
||||
"description": "Specifies the date format of absolute dates shown in the blame information on the status bar. See https://momentjs.com/docs/#/displaying/format/ for valid formats"
|
||||
},
|
||||
"gitlens.strings.codeLens.unsavedChanges.recentChangeAndAuthors": {
|
||||
"type": "string",
|
||||
"default": "Cannot determine recent change or authors (unsaved changes)",
|
||||
"description": "Specifies the string to be shown in place of both the `recent change` and `authors` code lens when there are unsaved changes"
|
||||
},
|
||||
"gitlens.strings.codeLens.unsavedChanges.recentChangeOnly": {
|
||||
"type": "string",
|
||||
"default": "Cannot determine recent change (unsaved changes)",
|
||||
"description": "Specifies the string to be shown in place of the `recent change` code lens when there are unsaved changes"
|
||||
},
|
||||
"gitlens.strings.codeLens.unsavedChanges.authorsOnly": {
|
||||
"type": "string",
|
||||
"default": "Cannot determine authors (unsaved changes)",
|
||||
"description": "Specifies the string to be shown in place of the `authors` code lens when there are unsaved changes"
|
||||
},
|
||||
"gitlens.theme.annotations.file.gutter.separateLines": {
|
||||
"type": "boolean",
|
||||
"default": true,
|
||||
|
||||
@@ -284,6 +284,16 @@ export interface IConfig {
|
||||
dateFormat: string;
|
||||
};
|
||||
|
||||
strings: {
|
||||
codeLens: {
|
||||
unsavedChanges: {
|
||||
recentChangeAndAuthors: string;
|
||||
recentChangeOnly: string;
|
||||
authorsOnly: string;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
theme: IThemeConfig;
|
||||
|
||||
debug: boolean;
|
||||
|
||||
@@ -237,13 +237,13 @@ export class GitCodeLensProvider implements CodeLensProvider {
|
||||
let title: string;
|
||||
if (this._documentIsDirty) {
|
||||
if (this._config.codeLens.recentChange.enabled && this._config.codeLens.authors.enabled) {
|
||||
title = 'Cannot determine recent change or authors (unsaved changes)';
|
||||
title = this._config.strings.codeLens.unsavedChanges.recentChangeAndAuthors;
|
||||
}
|
||||
else if (this._config.codeLens.recentChange.enabled) {
|
||||
title = 'Cannot determine recent change (unsaved changes)';
|
||||
title = this._config.strings.codeLens.unsavedChanges.recentChangeOnly;
|
||||
}
|
||||
else {
|
||||
title = 'Cannot determine authors (unsaved changes)';
|
||||
title = this._config.strings.codeLens.unsavedChanges.authorsOnly;
|
||||
}
|
||||
|
||||
lens.command = { title: title } as Command;
|
||||
|
||||
Reference in New Issue
Block a user