mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-02-12 11:08:34 -05:00
Compare commits
11 Commits
v4.0.0-alp
...
v4.0.0-bet
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
068b34b781 | ||
|
|
5328e56230 | ||
|
|
0fb718804e | ||
|
|
516bcf7eef | ||
|
|
f9bbc9af0a | ||
|
|
9cc96d4041 | ||
|
|
41785f6872 | ||
|
|
f72ea0005c | ||
|
|
b3f0d19e48 | ||
|
|
60702ff314 | ||
|
|
b72d22032c |
@@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file.
|
|||||||
|
|
||||||
The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).
|
The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||||
|
|
||||||
## [4.0.0-alpha.2] - 2017-06-05
|
## [4.0.0-beta] - 2017-06-06
|
||||||
### Added
|
### Added
|
||||||
- Adds all-new, beautiful, highly customizable and themeable, file blame annotations
|
- Adds all-new, beautiful, highly customizable and themeable, file blame annotations
|
||||||
- Can now fully customize the [layout and content](https://github.com/eamodio/vscode-gitlens/blob/develop/README.md#file-blame-annotation-settings), as well as the [theme](https://github.com/eamodio/vscode-gitlens/blob/develop/README.md#theme-settings)
|
- Can now fully customize the [layout and content](https://github.com/eamodio/vscode-gitlens/blob/develop/README.md#file-blame-annotation-settings), as well as the [theme](https://github.com/eamodio/vscode-gitlens/blob/develop/README.md#theme-settings)
|
||||||
@@ -24,6 +24,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
|
|||||||
|
|
||||||
### Changed
|
### 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)`
|
- (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)`
|
||||||
|
- Changes the positioning of the Git code lens to try to be at the end of any other code lens on the same line
|
||||||
- Changes the position of the `Open File in Remote` command (`gitlens.openFileInRemote`) in the context menus - now in the `navigation` group
|
- Changes the position of the `Open File in Remote` command (`gitlens.openFileInRemote`) in the context menus - now in the `navigation` group
|
||||||
- Changes the `Toggle Git Code Lens` command (`gitlens.toggleCodeLens`) to always toggle the Git code lens on and off
|
- Changes the `Toggle Git Code Lens` command (`gitlens.toggleCodeLens`) to always toggle the Git code lens on and off
|
||||||
|
|
||||||
@@ -32,6 +33,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
|
|||||||
- Removes `Toggle Blame Annotations` command (`gitlens.toggleBlame`) - replaced by the `Toggle File Blame Annotations` command (`gitlens.toggleFileBlame`)
|
- Removes `Toggle Blame Annotations` command (`gitlens.toggleBlame`) - replaced by the `Toggle File Blame Annotations` command (`gitlens.toggleFileBlame`)
|
||||||
- Removes `Show Blame Annotations` command (`gitlens.showBlame`) - replaced by the `Show File Blame Annotations` command (`gitlens.showFileBlame`)
|
- Removes `Show Blame Annotations` command (`gitlens.showBlame`) - replaced by the `Show File Blame Annotations` command (`gitlens.showFileBlame`)
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Fixes [#81](https://github.com/eamodio/vscode-gitlens/issues/81) - Current line annotation feels too sticky
|
||||||
|
|
||||||
## [3.6.0] - 2017-06-02
|
## [3.6.0] - 2017-06-02
|
||||||
### Added
|
### Added
|
||||||
- Adds diff information (the line's previous version) into the active line hover
|
- Adds diff information (the line's previous version) into the active line hover
|
||||||
|
|||||||
45
README.md
45
README.md
@@ -11,26 +11,34 @@ GitLens provides an unobtrusive blame annotation at the end of the current line,
|
|||||||
|
|
||||||
## Previews
|
## Previews
|
||||||
#### Featuring code lens, file blame annotations, and navigation and exploration via quick pick menus
|
#### Featuring code lens, file blame annotations, and navigation and exploration via quick pick menus
|
||||||

|

|
||||||
|
|
||||||
#### Featuring current line blame annotation and hovers, status bar commit details, quick pick menus, compare with previous, and more
|
#### Featuring current line blame annotation and hovers, status bar commit details, quick pick menus, compare with previous, and more
|
||||||

|

|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
#### Git Blame Annotations
|
#### Git Blame Annotations
|
||||||
|
|
||||||
- Adds an unobtrusive, highly [customizable](#line-blame-annotation-settings) and [themeable](#theme-settings), **Git blame annotation** to the end of the current line ([optional](#line-blame-annotation-settings), on by default)
|
- Adds an unobtrusive, highly [customizable](#line-blame-annotation-settings) and [themeable](#theme-settings), **Git blame annotation** to the end of the current line ([optional](#line-blame-annotation-settings), on by default)
|
||||||
|
|
||||||
|

|
||||||
- Contains the author, date, and message of the line's most recent commit, by [default](#line-blame-annotation-settings)
|
- Contains the author, date, and message of the line's most recent commit, by [default](#line-blame-annotation-settings)
|
||||||
- Also adds a `details` hover annotation to the current line annotation which provides more commit details ([optional](#line-blame-annotation-settings), on by default)
|
- Also adds a `details` hover annotation to the current line annotation which provides more commit details ([optional](#line-blame-annotation-settings), on by default)
|
||||||
- Also adds a `changes` (diff) hover annotation to the current line annotation which provides **instant** access to the line's previous version ([optional](#line-blame-annotation-settings), on by default)
|
- Also adds a `changes` (diff) hover annotation to the current line annotation which provides **instant** access to the line's previous version ([optional](#line-blame-annotation-settings), on by default)
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
- Adds on-demand, beautiful, highly [customizable](#file-blame-annotation-settings) and [themeable](#theme-settings), **Git blame annotations** of the whole file
|
- Adds on-demand, beautiful, highly [customizable](#file-blame-annotation-settings) and [themeable](#theme-settings), **Git blame annotations** of the whole file
|
||||||
|
|
||||||
|

|
||||||
- Choose between `gutter` (default) and `hover` [annotation styles](#file-blame-annotation-settings)
|
- Choose between `gutter` (default) and `hover` [annotation styles](#file-blame-annotation-settings)
|
||||||
- Contains the commit message and date, by [default](#file-blame-annotation-settings)
|
- Contains the commit message and date, by [default](#file-blame-annotation-settings)
|
||||||
- Also adds a `details` hover annotation to the line's annotation which provides more commit details ([optional](#file-blame-annotation-settings), on by default)
|
- Also adds a `details` hover annotation to the line's annotation which provides more commit details ([optional](#file-blame-annotation-settings), on by default)
|
||||||
|
|
||||||
- Adds [customizable](#status-bar-settings) **blame information** about the current line to the **status bar** ([optional](#status-bar-settings), on by default)
|
- Adds [customizable](#status-bar-settings) **blame information** about the current line to the **status bar** ([optional](#status-bar-settings), on by default)
|
||||||
|
|
||||||
|

|
||||||
- Contains the commit author and date, by [default](#status-bar-settings)
|
- Contains the commit author and date, by [default](#status-bar-settings)
|
||||||
- Clicking the status bar item will, by [default](#status-bar-settings), show a **commit details quick pick menu** with commands for comparing, navigating and exploring commits, and more
|
- Clicking the status bar item will, by [default](#status-bar-settings), show a **commit details quick pick menu** with commands for comparing, navigating and exploring commits, and more
|
||||||
- Provides [customizable](#status-bar-settings) click behavior — choose between one of the following
|
- Provides [customizable](#status-bar-settings) click behavior — choose between one of the following
|
||||||
@@ -52,6 +60,8 @@ GitLens provides an unobtrusive blame annotation at the end of the current line,
|
|||||||
#### Git Code Lens
|
#### Git Code Lens
|
||||||
|
|
||||||
- Adds **code lens** to the top of the file and on code blocks ([optional](#code-lens-settings), on by default)
|
- Adds **code lens** to the top of the file and on code blocks ([optional](#code-lens-settings), on by default)
|
||||||
|
|
||||||
|

|
||||||
- **Recent Change** — author and date of the most recent commit for the file or code block
|
- **Recent Change** — author and date of the most recent commit for the file or code block
|
||||||
- Clicking the code lens will, by [default](#code-lens-settings), show a **commit file details quick pick menu** with commands for comparing, navigating and exploring commits, and more
|
- Clicking the code lens will, by [default](#code-lens-settings), show a **commit file details quick pick menu** with commands for comparing, navigating and exploring commits, and more
|
||||||
- **Authors** — number of authors of the file or code block and the most prominent author (if there is more than one)
|
- **Authors** — number of authors of the file or code block and the most prominent author (if there is more than one)
|
||||||
@@ -211,14 +221,14 @@ GitLens is highly customizable and provides many configuration settings to allow
|
|||||||
|
|
||||||
|Name | Description
|
|Name | Description
|
||||||
|-----|------------
|
|-----|------------
|
||||||
|`gitlens.blame.file.annotationType`|Specifies the type of blame annotations that will be shown for the current file. `gutter` - adds an annotation to the beginning of each line. `hover` - shows annotations when hovering over each line
|
|`gitlens.blame.file.annotationType`|Specifies the type of blame annotations that will be shown for the current file<br />`gutter` - adds an annotation to the beginning of each line<br />`hover` - shows annotations when hovering over each line
|
||||||
|`gitlens.blame.file.lineHighlight.enabled`|Specifies whether or not to highlight lines associated with the current line
|
|`gitlens.blame.file.lineHighlight.enabled`|Specifies whether or not to highlight lines associated with the current line
|
||||||
|`gitlens.blame.file.lineHighlight.locations`|Specifies where the associated line highlights will be shown. `gutter` - adds a gutter glyph. `line` - adds a full-line highlight background color. `overviewRuler` - adds a decoration to the overviewRuler (scroll bar)
|
|`gitlens.blame.file.lineHighlight.locations`|Specifies where the associated line highlights will be shown<br />`gutter` - adds a gutter glyph<br />`line` - adds a full-line highlight background color<br />`overviewRuler` - adds a decoration to the overviewRuler (scroll bar)
|
||||||
|`gitlens.annotations.file.gutter.format`|Specifies the format of the gutter blame annotations. Available tokens: `${id}` - commit id, `${author}` - commit author, `${message}` - commit message, `${ago}` - relative commit date (e.g. 1 day ago), `${date}` - formatted commit date (format specified by `gitlens.annotations.file.dateFormat`), `${authorAgo}` - commit author, relative commit date
|
|`gitlens.annotations.file.gutter.format`|Specifies the format of the gutter blame annotations<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.annotations.file.gutter.dateFormat`)<br />`${authorAgo}` - commit author, relative commit date<br />See https://github.com/eamodio/vscode-gitlens/wiki/Advanced-Formatting for advanced formatting
|
||||||
|`gitlens.annotations.file.gutter.dateFormat`|Specifies how to format absolute dates (using the `${date}` token) in gutter blame annotations. See https://momentjs.com/docs/#/displaying/format/ for valid formats
|
|`gitlens.annotations.file.gutter.dateFormat`|Specifies how to format absolute dates (using the `${date}` token) in gutter blame annotations<br />See https://momentjs.com/docs/#/displaying/format/ for valid formats
|
||||||
|`gitlens.annotations.file.gutter.compact`|Specifies whether or not to compact (deduplicate) matching adjacent gutter blame annotations
|
|`gitlens.annotations.file.gutter.compact`|Specifies whether or not to compact (deduplicate) matching adjacent gutter blame annotations
|
||||||
|`gitlens.annotations.file.gutter.heatmap.enabled`|Specifies whether or not to provide a heatmap indicator in the gutter blame annotations
|
|`gitlens.annotations.file.gutter.heatmap.enabled`|Specifies whether or not to provide a heatmap indicator in the gutter blame annotations
|
||||||
|`gitlens.annotations.file.gutter.heatmap.location`|Specifies where the heatmap indicators will be shown in the gutter blame annotations. `left` - adds a heatmap indicator on the left edge of the gutter blame annotations. `right` - adds a heatmap indicator on the right edge of the gutter blame annotations
|
|`gitlens.annotations.file.gutter.heatmap.location`|Specifies where the heatmap indicators will be shown in the gutter blame annotations<br />`left` - adds a heatmap indicator on the left edge of the gutter blame annotations<br />`right` - adds a heatmap indicator on the right edge of the gutter blame annotations
|
||||||
|`gitlens.annotations.file.gutter.hover.details`|Specifies whether or not to provide a commit details hover annotation over the gutter blame annotations
|
|`gitlens.annotations.file.gutter.hover.details`|Specifies whether or not to provide a commit details hover annotation over the gutter blame annotations
|
||||||
|`gitlens.annotations.file.gutter.hover.wholeLine`|Specifies whether or not to trigger hover annotations over the whole line
|
|`gitlens.annotations.file.gutter.hover.wholeLine`|Specifies whether or not to trigger hover annotations over the whole line
|
||||||
|`gitlens.annotations.file.hover.heatmap.enabled`|Specifies whether or not to provide heatmap indicators on the left edge of each line
|
|`gitlens.annotations.file.hover.heatmap.enabled`|Specifies whether or not to provide heatmap indicators on the left edge of each line
|
||||||
@@ -229,9 +239,9 @@ GitLens is highly customizable and provides many configuration settings to allow
|
|||||||
|Name | Description
|
|Name | Description
|
||||||
|-----|------------
|
|-----|------------
|
||||||
|`gitlens.blame.line.enabled`|Specifies whether or not to provide a blame annotation for the current line
|
|`gitlens.blame.line.enabled`|Specifies whether or not to provide a blame annotation for the current line
|
||||||
|`gitlens.blame.line.annotationType`|Specifies the type of blame annotations that will be shown for the current line. `trailing` - adds an annotation to the end of the current line. `hover` - shows annotations when hovering over the current line
|
|`gitlens.blame.line.annotationType`|Specifies the type of blame annotations that will be shown for the current line<br />`trailing` - adds an annotation to the end of the current line<br />`hover` - shows annotations when hovering over the current line
|
||||||
|`gitlens.annotations.line.trailing.format`|Specifies the format of the trailing blame annotations. Available tokens: `${id}` - commit id, `${author}` - commit author, `${message}` - commit message, `${ago}` - relative commit date (e.g. 1 day ago), `${date}` - formatted commit date (format specified by `gitlens.annotations.currentLine.dateFormat`), `${authorAgo}` - commit author, relative commit date
|
|`gitlens.annotations.line.trailing.format`|Specifies the format of the trailing blame annotations<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.annotations.line.trailing.dateFormat`)<br />`${authorAgo}` - commit author, relative commit date<br />See https://github.com/eamodio/vscode-gitlens/wiki/Advanced-Formatting for advanced formatting
|
||||||
|`gitlens.annotations.line.trailing.dateFormat`|Specifies how to format absolute dates (using the `${date}` token) in trailing blame annotations. See https://momentjs.com/docs/#/displaying/format/ for valid formats
|
|`gitlens.annotations.line.trailing.dateFormat`|Specifies how to format absolute dates (using the `${date}` token) in trailing blame annotations<br />See https://momentjs.com/docs/#/displaying/format/ for valid formats
|
||||||
|`gitlens.annotations.line.trailing.hover.details`|Specifies whether or not to provide a commit details hover annotation over the trailing blame annotations
|
|`gitlens.annotations.line.trailing.hover.details`|Specifies whether or not to provide a commit details hover annotation over the trailing blame annotations
|
||||||
|`gitlens.annotations.line.trailing.hover.changes`|Specifies whether or not to provide a changes (diff) hover annotation over the trailing blame annotations
|
|`gitlens.annotations.line.trailing.hover.changes`|Specifies whether or not to provide a changes (diff) hover annotation over the trailing blame annotations
|
||||||
|`gitlens.annotations.line.trailing.hover.wholeLine`|Specifies whether or not to trigger hover annotations over the whole line
|
|`gitlens.annotations.line.trailing.hover.wholeLine`|Specifies whether or not to trigger hover annotations over the whole line
|
||||||
@@ -244,10 +254,10 @@ GitLens is highly customizable and provides many configuration settings to allow
|
|||||||
|-----|------------
|
|-----|------------
|
||||||
|`gitlens.codeLens.enabled`|Specifies whether or not to provide any Git code lens
|
|`gitlens.codeLens.enabled`|Specifies whether or not to provide any Git code lens
|
||||||
|`gitlens.codeLens.recentChange.enabled`|Specifies whether or not to show a `recent change` code lens showing the author and date of the most recent commit for the file or code block
|
|`gitlens.codeLens.recentChange.enabled`|Specifies whether or not to show a `recent change` code lens showing the author and date of the most recent commit for the file or code block
|
||||||
|`gitlens.codeLens.recentChange.command`|Specifies the command to be executed when the `recent change` code lens is clicked. `gitlens.toggleFileBlame` - toggles file blame annotations. `gitlens.showBlameHistory` - opens the blame history explorer. `gitlens.showFileHistory` - opens the file history explorer. `gitlens.diffWithPrevious` - compares the current committed file with the previous commit. `gitlens.showQuickCommitDetails` - shows a commit details quick pick. `gitlens.showQuickCommitFileDetails` - shows a commit file details quick pick. `gitlens.showQuickFileHistory` - shows a file history quick pick. `gitlens.showQuickRepoHistory` - shows a branch history quick pick
|
|`gitlens.codeLens.recentChange.command`|Specifies the command to be executed when the `recent change` code lens is clicked<br />`gitlens.toggleFileBlame` - toggles file blame annotations<br />`gitlens.showBlameHistory` - opens the blame history explorer<br />`gitlens.showFileHistory` - opens the file history explorer<br />`gitlens.diffWithPrevious` - compares the current committed file with the previous commit<br />`gitlens.showQuickCommitDetails` - shows a commit details quick pick<br />`gitlens.showQuickCommitFileDetails` - shows a commit file details quick pick<br />`gitlens.showQuickFileHistory` - shows a file history quick pick<br />`gitlens.showQuickRepoHistory` - shows a branch history quick pick
|
||||||
|`gitlens.codeLens.authors.enabled`|Specifies whether or not to show an `authors` code lens showing number of authors of the file or code block and the most prominent author (if there is more than one)
|
|`gitlens.codeLens.authors.enabled`|Specifies whether or not to show an `authors` code lens showing number of authors of the file or code block and the most prominent author (if there is more than one)
|
||||||
|`gitlens.codeLens.authors.command`|Specifies the command to be executed when the `authors` code lens is clicked. `gitlens.toggleFileBlame` - toggles file blame annotations. `gitlens.showBlameHistory` - opens the blame history explorer. `gitlens.showFileHistory` - opens the file history explorer. `gitlens.diffWithPrevious` - compares the current committed file with the previous commit. `gitlens.showQuickCommitDetails` - shows a commit details quick pick. `gitlens.showQuickCommitFileDetails` - shows a commit file details quick pick. `gitlens.showQuickFileHistory` - shows a file history quick pick. `gitlens.showQuickRepoHistory` - shows a branch history quick pick
|
|`gitlens.codeLens.authors.command`|Specifies the command to be executed when the `authors` code lens is clicked<br />`gitlens.toggleFileBlame` - toggles file blame annotations<br />`gitlens.showBlameHistory` - opens the blame history explorer<br />`gitlens.showFileHistory` - opens the file history explorer<br />`gitlens.diffWithPrevious` - compares the current committed file with the previous commit<br />`gitlens.showQuickCommitDetails` - shows a commit details quick pick<br />`gitlens.showQuickCommitFileDetails` - shows a commit file details quick pick<br />`gitlens.showQuickFileHistory` - shows a file history quick pick<br />`gitlens.showQuickRepoHistory` - shows a branch history quick pick
|
||||||
|`gitlens.codeLens.locations`|Specifies where Git code lens will be shown in the document. `document` - adds code lens at the top of the document. `containers` - adds code lens at the start of container-like symbols (modules, classes, interfaces, etc). `blocks` - adds code lens at the start of block-like symbols (functions, methods, properties, etc) lines. `custom` - adds code lens at the start of symbols contained in `gitlens.codeLens.locationCustomSymbols`
|
|`gitlens.codeLens.locations`|Specifies where Git code lens will be shown in the document<br />`document` - adds code lens at the top of the document<br />`containers` - adds code lens at the start of container-like symbols (modules, classes, interfaces, etc)<br />`blocks` - adds code lens at the start of block-like symbols (functions, methods, properties, etc) lines<br />`custom` - adds code lens at the start of symbols contained in `gitlens.codeLens.locationCustomSymbols`
|
||||||
|`gitlens.codeLens.customLocationSymbols`|Specifies the set of document symbols where Git code lens will be shown in the document
|
|`gitlens.codeLens.customLocationSymbols`|Specifies the set of document symbols where Git code lens will be shown in the document
|
||||||
|`gitlens.codeLens.perLanguageLocations`|Specifies where Git code lens will be shown in the document for the specified languages
|
|`gitlens.codeLens.perLanguageLocations`|Specifies where Git code lens will be shown in the document for the specified languages
|
||||||
|
|
||||||
@@ -256,11 +266,10 @@ GitLens is highly customizable and provides many configuration settings to allow
|
|||||||
|Name | Description
|
|Name | Description
|
||||||
|-----|------------
|
|-----|------------
|
||||||
|`gitlens.statusBar.enabled`|Specifies whether or not to provide blame information on the status bar
|
|`gitlens.statusBar.enabled`|Specifies whether or not to provide blame information on the status bar
|
||||||
|`gitlens.statusBar.alignment`|Specifies the blame alignment in the status bar. `left` - align to the left, `right` - align to the right
|
|`gitlens.statusBar.alignment`|Specifies the blame alignment in the status bar<br />`left` - align to the left, `right` - align to the right
|
||||||
|`gitlens.statusBar.format`|Specifies the format of the blame information on the status bar. Available tokens: `${id}` - commit id, `${author}` - commit author, `${message}` - commit message, `${ago}` - relative commit date (e.g. 1 day ago), `${date}` - formatted commit date (format specified by `gitlens.statusBar.dateFormat`)
|
|`gitlens.statusBar.command`|Specifies the command to be executed when the blame status bar item is clicked<br />`gitlens.toggleFileBlame` - toggles file blame annotations<br />`gitlens.showBlameHistory` - opens the blame history explorer<br />`gitlens.showFileHistory` - opens the file history explorer<br />`gitlens.diffWithPrevious` - compares the current line commit with the previous<br />`gitlens.diffWithWorking` - compares the current line commit with the working tree<br />`gitlens.toggleCodeLens` - toggles Git code lens<br />`gitlens.showQuickCommitDetails` - shows a commit details quick pick<br />`gitlens.showQuickCommitFileDetails` - shows a commit file details quick pick<br />`gitlens.showQuickFileHistory` - shows a file history quick pick<br />`gitlens.showQuickRepoHistory` - shows a branch history quick pick
|
||||||
|`gitlens.statusBar.command`|Specifies the command to be executed when the blame status bar item is clicked. `gitlens.toggleFileBlame` - toggles file blame annotations. `gitlens.showBlameHistory` - opens the blame history explorer. `gitlens.showFileHistory` - opens the file history explorer. `gitlens.diffWithPrevious` - compares the current line commit with the previous. `gitlens.diffWithWorking` - compares the current line commit with the working tree. `gitlens.toggleCodeLens` - toggles Git code lens. `gitlens.showQuickCommitDetails` - shows a commit details quick pick. `gitlens.showQuickCommitFileDetails` - shows a commit file details quick pick. `gitlens.showQuickFileHistory` - shows a file history quick pick. `gitlens.showQuickRepoHistory` - shows a branch history quick pick
|
|`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.format`|Specifies the format of the status bar blame information. Available tokens: `${id}` - commit id, `${author}` - commit author, `${message}` - commit message, `${ago}` - relative commit date (e.g. 1 day ago), `${date}` - formatted commit date (format specified by `gitlens.statusBar.dateFormat`), `${authorAgo}` - commit author, relative commit date
|
|`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
|
||||||
|`gitlens.statusBar.dateFormat`|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
|
|
||||||
|
|
||||||
### Theme Settings
|
### Theme Settings
|
||||||
|
|
||||||
|
|||||||
BIN
images/screenshot-code-lens.png
Normal file
BIN
images/screenshot-code-lens.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.6 KiB |
BIN
images/screenshot-file-blame-annotations.png
Normal file
BIN
images/screenshot-file-blame-annotations.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
BIN
images/screenshot-line-blame-annotation.png
Normal file
BIN
images/screenshot-line-blame-annotation.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.8 KiB |
BIN
images/screenshot-line-blame-annotations.png
Normal file
BIN
images/screenshot-line-blame-annotations.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 25 KiB |
BIN
images/screenshot-status-bar.png
Normal file
BIN
images/screenshot-status-bar.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.6 KiB |
14
package-lock.json
generated
14
package-lock.json
generated
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "gitlens",
|
"name": "gitlens",
|
||||||
"version": "4.0.0-alpha.2",
|
"version": "4.0.0-beta",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/applicationinsights": {
|
"@types/applicationinsights": {
|
||||||
@@ -28,9 +28,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"@types/node": {
|
"@types/node": {
|
||||||
"version": "7.0.27",
|
"version": "7.0.28",
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-7.0.27.tgz",
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-7.0.28.tgz",
|
||||||
"integrity": "sha512-2QMiuVOEye2yKmMwE1V96C9HSShmT0WSm6dv2WjacvePEjQNNJGAerTO5hdYhj5lpdK5MW+FVxmyzDhr4omIdw==",
|
"integrity": "sha512-9rLhvgupMpC7Yh24yB8zj+4L6SZ9BYUwqknEC8+R7gqCg3KL65UHg7yu9X6J8mSmmtVr1Hbey564yZ3C9nXqtQ==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"@types/tmp": {
|
"@types/tmp": {
|
||||||
@@ -1784,9 +1784,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"tslint": {
|
"tslint": {
|
||||||
"version": "5.4.2",
|
"version": "5.4.3",
|
||||||
"resolved": "https://registry.npmjs.org/tslint/-/tslint-5.4.2.tgz",
|
"resolved": "https://registry.npmjs.org/tslint/-/tslint-5.4.3.tgz",
|
||||||
"integrity": "sha1-YJtmQMwEJPSjlamt9ow3VWPFScc=",
|
"integrity": "sha1-dhyEArgONHt3M6BDkKdXslNYBGc=",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"tsutils": {
|
"tsutils": {
|
||||||
|
|||||||
196
package.json
196
package.json
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "gitlens",
|
"name": "gitlens",
|
||||||
"version": "4.0.0-alpha.2",
|
"version": "4.0.0-beta",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Eric Amodio",
|
"name": "Eric Amodio",
|
||||||
"email": "eamodio@gmail.com"
|
"email": "eamodio@gmail.com"
|
||||||
@@ -76,12 +76,12 @@
|
|||||||
"gitlens.annotations.file.gutter.format": {
|
"gitlens.annotations.file.gutter.format": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"default": "${message|40?} ${ago|14-}",
|
"default": "${message|40?} ${ago|14-}",
|
||||||
"description": "Specifies the format of the gutter blame annotations. Available tokens: `${id}` - commit id, `${author}` - commit author, `${message}` - commit message, `${ago}` - relative commit date (e.g. 1 day ago), `${date}` - formatted commit date (format specified by `gitlens.annotations.file.dateFormat`), `${authorAgo}` - commit author, relative commit date"
|
"description": "Specifies the format of the gutter blame annotations\nAvailable tokens\n ${id} - commit id\n ${author} - commit author\n ${message} - commit message\n ${ago} - relative commit date (e.g. 1 day ago)\n ${date} - formatted commit date (format specified by `gitlens.annotations.file.gutter.dateFormat`)\n ${authorAgo} - commit author, relative commit date\nSee https://github.com/eamodio/vscode-gitlens/wiki/Advanced-Formatting for advanced formatting"
|
||||||
},
|
},
|
||||||
"gitlens.annotations.file.gutter.dateFormat": {
|
"gitlens.annotations.file.gutter.dateFormat": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"default": null,
|
"default": null,
|
||||||
"description": "Specifies how to format absolute dates (using the `${date}` token) in gutter blame annotations. See https://momentjs.com/docs/#/displaying/format/ for valid formats"
|
"description": "Specifies how to format absolute dates (using the `${date}` token) in gutter blame annotations\nSee https://momentjs.com/docs/#/displaying/format/ for valid formats"
|
||||||
},
|
},
|
||||||
"gitlens.annotations.file.gutter.compact": {
|
"gitlens.annotations.file.gutter.compact": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
@@ -100,7 +100,7 @@
|
|||||||
"left",
|
"left",
|
||||||
"right"
|
"right"
|
||||||
],
|
],
|
||||||
"description": "Specifies where the heatmap indicators will be shown in the gutter blame annotations. `left` - adds a heatmap indicator on the left edge of the gutter blame annotations. `right` - adds a heatmap indicator on the right edge of the gutter blame annotations"
|
"description": "Specifies where the heatmap indicators will be shown in the gutter blame annotations\n `left` - adds a heatmap indicator on the left edge of the gutter blame annotations\n `right` - adds a heatmap indicator on the right edge of the gutter blame annotations"
|
||||||
},
|
},
|
||||||
"gitlens.annotations.file.gutter.hover.details": {
|
"gitlens.annotations.file.gutter.hover.details": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
@@ -135,12 +135,12 @@
|
|||||||
"gitlens.annotations.line.trailing.format": {
|
"gitlens.annotations.line.trailing.format": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"default": "${authorAgo} \u2022 ${message}",
|
"default": "${authorAgo} \u2022 ${message}",
|
||||||
"description": "Specifies the format of the trailing blame annotations. Available tokens: `${id}` - commit id, `${author}` - commit author, `${message}` - commit message, `${ago}` - relative commit date (e.g. 1 day ago), `${date}` - formatted commit date (format specified by `gitlens.annotations.currentLine.dateFormat`), `${authorAgo}` - commit author, relative commit date"
|
"description": "Specifies the format of the trailing blame annotations\nAvailable tokens\n ${id} - commit id\n ${author} - commit author\n ${message} - commit message\n ${ago} - relative commit date (e.g. 1 day ago)\n ${date} - formatted commit date (format specified by `gitlens.annotations.line.trailing.dateFormat`)\n ${authorAgo} - commit author, relative commit date\nSee https://github.com/eamodio/vscode-gitlens/wiki/Advanced-Formatting for advanced formatting"
|
||||||
},
|
},
|
||||||
"gitlens.annotations.line.trailing.dateFormat": {
|
"gitlens.annotations.line.trailing.dateFormat": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"default": null,
|
"default": null,
|
||||||
"description": "Specifies how to format absolute dates (using the `${date}` token) in trailing blame annotations. See https://momentjs.com/docs/#/displaying/format/ for valid formats"
|
"description": "Specifies how to format absolute dates (using the `${date}` token) in trailing blame annotations\nSee https://momentjs.com/docs/#/displaying/format/ for valid formats"
|
||||||
},
|
},
|
||||||
"gitlens.annotations.line.trailing.hover.details": {
|
"gitlens.annotations.line.trailing.hover.details": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
@@ -164,7 +164,7 @@
|
|||||||
"gutter",
|
"gutter",
|
||||||
"hover"
|
"hover"
|
||||||
],
|
],
|
||||||
"description": "Specifies the type of blame annotations that will be shown for the current file. `gutter` - adds an annotation to the beginning of each line. `hover` - shows annotations when hovering over each line"
|
"description": "Specifies the type of blame annotations that will be shown for the current file\n `gutter` - adds an annotation to the beginning of each line\n `hover` - shows annotations when hovering over each line"
|
||||||
},
|
},
|
||||||
"gitlens.blame.file.lineHighlight.enabled": {
|
"gitlens.blame.file.lineHighlight.enabled": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
@@ -189,7 +189,7 @@
|
|||||||
"minItems": 1,
|
"minItems": 1,
|
||||||
"maxItems": 3,
|
"maxItems": 3,
|
||||||
"uniqueItems": true,
|
"uniqueItems": true,
|
||||||
"description": "Specifies where the associated line highlights will be shown. `gutter` - adds a gutter glyph. `line` - adds a full-line highlight background color. `overviewRuler` - adds a decoration to the overviewRuler (scroll bar)"
|
"description": "Specifies where the associated line highlights will be shown\n `gutter` - adds a gutter glyph\n `line` - adds a full-line highlight background color\n `overviewRuler` - adds a decoration to the overviewRuler (scroll bar)"
|
||||||
},
|
},
|
||||||
"gitlens.blame.line.enabled": {
|
"gitlens.blame.line.enabled": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
@@ -203,7 +203,7 @@
|
|||||||
"trailing",
|
"trailing",
|
||||||
"hover"
|
"hover"
|
||||||
],
|
],
|
||||||
"description": "Specifies the type of blame annotations that will be shown for the current line. `trailing` - adds an annotation to the end of the current line. `hover` - shows annotations when hovering over the current line"
|
"description": "Specifies the type of blame annotations that will be shown for the current line\n `trailing` - adds an annotation to the end of the current line\n `hover` - shows annotations when hovering over the current line"
|
||||||
},
|
},
|
||||||
"gitlens.codeLens.enabled": {
|
"gitlens.codeLens.enabled": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
@@ -228,7 +228,7 @@
|
|||||||
"gitlens.showQuickFileHistory",
|
"gitlens.showQuickFileHistory",
|
||||||
"gitlens.showQuickRepoHistory"
|
"gitlens.showQuickRepoHistory"
|
||||||
],
|
],
|
||||||
"description": "Specifies the command to be executed when the `recent change` code lens is clicked. `gitlens.toggleFileBlame` - toggles file blame annotations. `gitlens.showBlameHistory` - opens the blame history explorer. `gitlens.showFileHistory` - opens the file history explorer. `gitlens.diffWithPrevious` - compares the current committed file with the previous commit. `gitlens.showQuickCommitDetails` - shows a commit details quick pick. `gitlens.showQuickCommitFileDetails` - shows a commit file details quick pick. `gitlens.showQuickFileHistory` - shows a file history quick pick. `gitlens.showQuickRepoHistory` - shows a branch history quick pick"
|
"description": "Specifies the command to be executed when the `recent change` code lens is clicked\n `gitlens.toggleFileBlame` - toggles file blame annotations\n `gitlens.showBlameHistory` - opens the blame history explorer\n `gitlens.showFileHistory` - opens the file history explorer\n `gitlens.diffWithPrevious` - compares the current committed file with the previous commit\n `gitlens.showQuickCommitDetails` - shows a commit details quick pick\n `gitlens.showQuickCommitFileDetails` - shows a commit file details quick pick\n `gitlens.showQuickFileHistory` - shows a file history quick pick\n `gitlens.showQuickRepoHistory` - shows a branch history quick pick"
|
||||||
},
|
},
|
||||||
"gitlens.codeLens.authors.enabled": {
|
"gitlens.codeLens.authors.enabled": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
@@ -248,7 +248,7 @@
|
|||||||
"gitlens.showQuickFileHistory",
|
"gitlens.showQuickFileHistory",
|
||||||
"gitlens.showQuickRepoHistory"
|
"gitlens.showQuickRepoHistory"
|
||||||
],
|
],
|
||||||
"description": "Specifies the command to be executed when the `authors` code lens is clicked. `gitlens.toggleFileBlame` - toggles file blame annotations. `gitlens.showBlameHistory` - opens the blame history explorer. `gitlens.showFileHistory` - opens the file history explorer. `gitlens.diffWithPrevious` - compares the current committed file with the previous commit. `gitlens.showQuickCommitDetails` - shows a commit details quick pick. `gitlens.showQuickCommitFileDetails` - shows a commit file details quick pick. `gitlens.showQuickFileHistory` - shows a file history quick pick. `gitlens.showQuickRepoHistory` - shows a branch history quick pick"
|
"description": "Specifies the command to be executed when the `authors` code lens is clicked\n `gitlens.toggleFileBlame` - toggles file blame annotations\n `gitlens.showBlameHistory` - opens the blame history explorer\n `gitlens.showFileHistory` - opens the file history explorer\n `gitlens.diffWithPrevious` - compares the current committed file with the previous commit\n `gitlens.showQuickCommitDetails` - shows a commit details quick pick\n `gitlens.showQuickCommitFileDetails` - shows a commit file details quick pick\n `gitlens.showQuickFileHistory` - shows a file history quick pick\n `gitlens.showQuickRepoHistory` - shows a branch history quick pick"
|
||||||
},
|
},
|
||||||
"gitlens.codeLens.locations": {
|
"gitlens.codeLens.locations": {
|
||||||
"type": "array",
|
"type": "array",
|
||||||
@@ -268,7 +268,7 @@
|
|||||||
"minItems": 1,
|
"minItems": 1,
|
||||||
"maxItems": 4,
|
"maxItems": 4,
|
||||||
"uniqueItems": true,
|
"uniqueItems": true,
|
||||||
"description": "Specifies where Git code lens will be shown in the document. `document` - adds code lens at the top of the document. `containers` - adds code lens at the start of container-like symbols (modules, classes, interfaces, etc). `blocks` - adds code lens at the start of block-like symbols (functions, methods, properties, etc) lines. `custom` - adds code lens at the start of symbols contained in `gitlens.codeLens.locationCustomSymbols`"
|
"description": "Specifies where Git code lens will be shown in the document\n `document` - adds code lens at the top of the document\n `containers` - adds code lens at the start of container-like symbols (modules, classes, interfaces, etc)\n `blocks` - adds code lens at the start of block-like symbols (functions, methods, properties, etc) lines\n `custom` - adds code lens at the start of symbols contained in `gitlens.codeLens.locationCustomSymbols`"
|
||||||
},
|
},
|
||||||
"gitlens.codeLens.customLocationSymbols": {
|
"gitlens.codeLens.customLocationSymbols": {
|
||||||
"type": "array",
|
"type": "array",
|
||||||
@@ -276,7 +276,7 @@
|
|||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"uniqueItems": true,
|
"uniqueItems": true,
|
||||||
"description": "Specifies the set of document symbols where Git code lens will be shown in the document. Must be a member of `SymbolKind`"
|
"description": "Specifies the set of document symbols where Git code lens will be shown in the document\nMust be a member of `SymbolKind`"
|
||||||
},
|
},
|
||||||
"gitlens.codeLens.perLanguageLocations": {
|
"gitlens.codeLens.perLanguageLocations": {
|
||||||
"type": "array",
|
"type": "array",
|
||||||
@@ -347,7 +347,7 @@
|
|||||||
"minItems": 1,
|
"minItems": 1,
|
||||||
"maxItems": 4,
|
"maxItems": 4,
|
||||||
"uniqueItems": true,
|
"uniqueItems": true,
|
||||||
"description": "Specifies where Git code lens will be shown in the document for the specified language. `document` - adds code lens at the top of the document. `containers` - adds code lens at the start of container-like symbols (modules, classes, interfaces, etc). `blocks` - adds code lens at the start of block-like symbols (functions, methods, properties, etc) lines. `custom` - adds code lens at the start of symbols contained in `customSymbols`"
|
"description": "Specifies where Git code lens will be shown in the document for the specified language\n `document` - adds code lens at the top of the document\n `containers` - adds code lens at the start of container-like symbols (modules, classes, interfaces, etc)\n `blocks` - adds code lens at the start of block-like symbols (functions, methods, properties, etc) lines\n `custom` - adds code lens at the start of symbols contained in `customSymbols`"
|
||||||
},
|
},
|
||||||
"customSymbols": {
|
"customSymbols": {
|
||||||
"type": "array",
|
"type": "array",
|
||||||
@@ -355,7 +355,7 @@
|
|||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"uniqueItems": true,
|
"uniqueItems": true,
|
||||||
"description": "Specifies the set of document symbols where Git code lens will be shown in the document for the specified language. Must be a member of `SymbolKind`"
|
"description": "Specifies the set of document symbols where Git code lens will be shown in the document for the specified language\nMust be a member of `SymbolKind`"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -379,7 +379,7 @@
|
|||||||
"left",
|
"left",
|
||||||
"right"
|
"right"
|
||||||
],
|
],
|
||||||
"description": "Specifies the blame alignment in the status bar. `left` - align to the left, `right` - align to the right"
|
"description": "Specifies the blame alignment in the status bar\n `left` - align to the left\n `right` - align to the right"
|
||||||
},
|
},
|
||||||
"gitlens.statusBar.command": {
|
"gitlens.statusBar.command": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
@@ -396,12 +396,12 @@
|
|||||||
"gitlens.showQuickFileHistory",
|
"gitlens.showQuickFileHistory",
|
||||||
"gitlens.showQuickRepoHistory"
|
"gitlens.showQuickRepoHistory"
|
||||||
],
|
],
|
||||||
"description": "Specifies the command to be executed when the blame status bar item is clicked. `gitlens.toggleFileBlame` - toggles file blame annotations. `gitlens.showBlameHistory` - opens the blame history explorer. `gitlens.showFileHistory` - opens the file history explorer. `gitlens.diffWithPrevious` - compares the current line commit with the previous. `gitlens.diffWithWorking` - compares the current line commit with the working tree. `gitlens.toggleCodeLens` - toggles Git code lens. `gitlens.showQuickCommitDetails` - shows a commit details quick pick. `gitlens.showQuickCommitFileDetails` - shows a commit file details quick pick. `gitlens.showQuickFileHistory` - shows a file history quick pick. `gitlens.showQuickRepoHistory` - shows a branch history quick pick"
|
"description": "Specifies the command to be executed when the blame status bar item is clicked\n `gitlens.toggleFileBlame` - toggles file blame annotations\n `gitlens.showBlameHistory` - opens the blame history explorer\n `gitlens.showFileHistory` - opens the file history explorer\n `gitlens.diffWithPrevious` - compares the current line commit with the previous\n `gitlens.diffWithWorking` - compares the current line commit with the working tree\n `gitlens.toggleCodeLens` - toggles Git code lens\n `gitlens.showQuickCommitDetails` - shows a commit details quick pick\n `gitlens.showQuickCommitFileDetails` - shows a commit file details quick pick\n `gitlens.showQuickFileHistory` - shows a file history quick pick\n `gitlens.showQuickRepoHistory` - shows a branch history quick pick"
|
||||||
},
|
},
|
||||||
"gitlens.statusBar.format": {
|
"gitlens.statusBar.format": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"default": "${authorAgo}",
|
"default": "${authorAgo}",
|
||||||
"description": "Specifies the format of the status bar blame information. Available tokens: `${id}` - commit id, `${author}` - commit author, `${message}` - commit message, `${ago}` - relative commit date (e.g. 1 day ago), `${date}` - formatted commit date (format specified by `gitlens.statusBar.dateFormat`), `${authorAgo}` - commit author, relative commit date"
|
"description": "Specifies the format of the status bar blame information\nAvailable tokens\n ${id} - commit id\n ${author} - commit author\n ${message} - commit message\n ${ago} - relative commit date (e.g. 1 day ago)\n ${date} - formatted commit date (format specified by `gitlens.statusBar.dateFormat`)\n ${authorAgo} - commit author, relative commit date\nSee https://github.com/eamodio/vscode-gitlens/wiki/Advanced-Formatting for advanced formatting"
|
||||||
},
|
},
|
||||||
"gitlens.statusBar.dateFormat": {
|
"gitlens.statusBar.dateFormat": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
@@ -516,14 +516,10 @@
|
|||||||
"gitlens.advanced.menus": {
|
"gitlens.advanced.menus": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"default": {
|
"default": {
|
||||||
"explorerContext": {
|
|
||||||
"fileDiff": true,
|
|
||||||
"history": true,
|
|
||||||
"remote": true
|
|
||||||
},
|
|
||||||
"editorContext": {
|
"editorContext": {
|
||||||
"blame": true,
|
"blame": true,
|
||||||
"copy": true,
|
"copy": true,
|
||||||
|
"details": true,
|
||||||
"fileDiff": true,
|
"fileDiff": true,
|
||||||
"history": true,
|
"history": true,
|
||||||
"lineDiff": true,
|
"lineDiff": true,
|
||||||
@@ -533,6 +529,7 @@
|
|||||||
"blame": true,
|
"blame": true,
|
||||||
"fileDiff": true,
|
"fileDiff": true,
|
||||||
"history": true,
|
"history": true,
|
||||||
|
"remote": true,
|
||||||
"status": true
|
"status": true
|
||||||
},
|
},
|
||||||
"editorTitleContext": {
|
"editorTitleContext": {
|
||||||
@@ -540,37 +537,21 @@
|
|||||||
"fileDiff": true,
|
"fileDiff": true,
|
||||||
"history": true,
|
"history": true,
|
||||||
"remote": true
|
"remote": true
|
||||||
|
},
|
||||||
|
"explorerContext": {
|
||||||
|
"fileDiff": true,
|
||||||
|
"history": true,
|
||||||
|
"remote": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"description": "Specifies which commands will be added to which menus",
|
"description": "Specifies which commands will be added to which menus",
|
||||||
"properties": {
|
"properties": {
|
||||||
"explorerContext": {
|
|
||||||
"type": "object",
|
|
||||||
"default": {
|
|
||||||
"fileDiff": true,
|
|
||||||
"history": true,
|
|
||||||
"remote": true
|
|
||||||
},
|
|
||||||
"properties": {
|
|
||||||
"fileDiff": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": true
|
|
||||||
},
|
|
||||||
"history": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": true
|
|
||||||
},
|
|
||||||
"remote": {
|
|
||||||
"type": "boolean",
|
|
||||||
"default": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"editorContext": {
|
"editorContext": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"default": {
|
"default": {
|
||||||
"blame": true,
|
"blame": true,
|
||||||
"copy": true,
|
"copy": true,
|
||||||
|
"details": true,
|
||||||
"fileDiff": true,
|
"fileDiff": true,
|
||||||
"history": true,
|
"history": true,
|
||||||
"lineDiff": true,
|
"lineDiff": true,
|
||||||
@@ -613,6 +594,7 @@
|
|||||||
"blame": true,
|
"blame": true,
|
||||||
"fileDiff": true,
|
"fileDiff": true,
|
||||||
"history": true,
|
"history": true,
|
||||||
|
"remote": true,
|
||||||
"status": true
|
"status": true
|
||||||
},
|
},
|
||||||
"properties": {
|
"properties": {
|
||||||
@@ -628,6 +610,10 @@
|
|||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
|
"remote": {
|
||||||
|
"type": "boolean",
|
||||||
|
"default": true
|
||||||
|
},
|
||||||
"status": {
|
"status": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"default": true
|
"default": true
|
||||||
@@ -660,6 +646,28 @@
|
|||||||
"default": true
|
"default": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"explorerContext": {
|
||||||
|
"type": "object",
|
||||||
|
"default": {
|
||||||
|
"fileDiff": true,
|
||||||
|
"history": true,
|
||||||
|
"remote": true
|
||||||
|
},
|
||||||
|
"properties": {
|
||||||
|
"fileDiff": {
|
||||||
|
"type": "boolean",
|
||||||
|
"default": true
|
||||||
|
},
|
||||||
|
"history": {
|
||||||
|
"type": "boolean",
|
||||||
|
"default": true
|
||||||
|
},
|
||||||
|
"remote": {
|
||||||
|
"type": "boolean",
|
||||||
|
"default": true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -977,26 +985,56 @@
|
|||||||
"when": "gitlens:enabled"
|
"when": "gitlens:enabled"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"explorer/context": [
|
"editor/context": [
|
||||||
{
|
{
|
||||||
"command": "gitlens.openFileInRemote",
|
"command": "gitlens.openFileInRemote",
|
||||||
"when": "gitlens:enabled && config.gitlens.advanced.menus.explorerContext.remote",
|
"when": "editorTextFocus && gitlens:isTracked && gitlens:hasRemotes && config.gitlens.advanced.menus.editorContext.remote",
|
||||||
"group": "navigation@100"
|
"group": "navigation@100"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"command": "gitlens.diffWithPrevious",
|
"command": "gitlens.diffLineWithPrevious",
|
||||||
"when": "gitlens:enabled && config.gitlens.advanced.menus.explorerContext.fileDiff",
|
"when": "editorTextFocus && gitlens:isBlameable && config.gitlens.advanced.menus.editorContext.lineDiff",
|
||||||
"group": "1_gitlens@1"
|
"group": "1_gitlens@1"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"command": "gitlens.diffWithWorking",
|
"command": "gitlens.diffLineWithWorking",
|
||||||
"when": "gitlens:enabled && config.gitlens.advanced.menus.explorerContext.fileDiff",
|
"when": "editorTextFocus && gitlens:isBlameable && config.gitlens.advanced.menus.editorContext.lineDiff",
|
||||||
"group": "1_gitlens@2"
|
"group": "1_gitlens@2"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"command": "gitlens.showQuickFileHistory",
|
"command": "gitlens.showQuickCommitFileDetails",
|
||||||
"when": "gitlens:enabled && config.gitlens.advanced.menus.explorerContext.history",
|
"when": "editorTextFocus && gitlens:isBlameable && config.gitlens.advanced.menus.editorContext.details",
|
||||||
|
"group": "1_gitlens@3"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command": "gitlens.diffWithPrevious",
|
||||||
|
"when": "editorTextFocus && gitlens:isTracked && config.gitlens.advanced.menus.editorContext.fileDiff",
|
||||||
"group": "1_gitlens_1@1"
|
"group": "1_gitlens_1@1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command": "gitlens.diffWithWorking",
|
||||||
|
"when": "editorTextFocus && gitlens:isTracked && config.gitlens.advanced.menus.editorContext.fileDiff",
|
||||||
|
"group": "1_gitlens_1@2"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command": "gitlens.showQuickFileHistory",
|
||||||
|
"when": "gitlens:isTracked && config.gitlens.advanced.menus.editorContext.history",
|
||||||
|
"group": "3_gitlens@1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command": "gitlens.toggleFileBlame",
|
||||||
|
"when": "editorTextFocus && gitlens:isBlameable && config.gitlens.advanced.menus.editorContext.blame",
|
||||||
|
"group": "3_gitlens@2"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command": "gitlens.copyShaToClipboard",
|
||||||
|
"when": "editorTextFocus && gitlens:isBlameable && config.gitlens.advanced.menus.editorContext.copy",
|
||||||
|
"group": "9_gitlens@1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command": "gitlens.copyMessageToClipboard",
|
||||||
|
"when": "editorTextFocus && gitlens:isBlameable && config.gitlens.advanced.menus.editorContext.copy",
|
||||||
|
"group": "9_gitlens@2"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"editor/title": [
|
"editor/title": [
|
||||||
@@ -1068,56 +1106,26 @@
|
|||||||
"group": "1_gitlens_2@2"
|
"group": "1_gitlens_2@2"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"editor/context": [
|
"explorer/context": [
|
||||||
{
|
{
|
||||||
"command": "gitlens.openFileInRemote",
|
"command": "gitlens.openFileInRemote",
|
||||||
"when": "editorTextFocus && gitlens:isTracked && gitlens:hasRemotes && config.gitlens.advanced.menus.editorContext.remote",
|
"when": "gitlens:enabled && config.gitlens.advanced.menus.explorerContext.remote",
|
||||||
"group": "navigation@100"
|
"group": "navigation@100"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"command": "gitlens.diffLineWithPrevious",
|
"command": "gitlens.diffWithPrevious",
|
||||||
"when": "editorTextFocus && gitlens:isBlameable && config.gitlens.advanced.menus.editorContext.lineDiff",
|
"when": "gitlens:enabled && config.gitlens.advanced.menus.explorerContext.fileDiff",
|
||||||
"group": "1_gitlens@1"
|
"group": "1_gitlens@1"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"command": "gitlens.diffLineWithWorking",
|
"command": "gitlens.diffWithWorking",
|
||||||
"when": "editorTextFocus && gitlens:isBlameable && config.gitlens.advanced.menus.editorContext.lineDiff",
|
"when": "gitlens:enabled && config.gitlens.advanced.menus.explorerContext.fileDiff",
|
||||||
"group": "1_gitlens@2"
|
"group": "1_gitlens@2"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"command": "gitlens.showQuickCommitFileDetails",
|
|
||||||
"when": "editorTextFocus && gitlens:isBlameable && config.gitlens.advanced.menus.editorContext.details",
|
|
||||||
"group": "1_gitlens@3"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"command": "gitlens.diffWithPrevious",
|
|
||||||
"when": "editorTextFocus && gitlens:isTracked && config.gitlens.advanced.menus.editorContext.fileDiff",
|
|
||||||
"group": "1_gitlens_1@1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"command": "gitlens.diffWithWorking",
|
|
||||||
"when": "editorTextFocus && gitlens:isTracked && config.gitlens.advanced.menus.editorContext.fileDiff",
|
|
||||||
"group": "1_gitlens_1@2"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"command": "gitlens.showQuickFileHistory",
|
"command": "gitlens.showQuickFileHistory",
|
||||||
"when": "gitlens:isTracked && config.gitlens.advanced.menus.editorContext.history",
|
"when": "gitlens:enabled && config.gitlens.advanced.menus.explorerContext.history",
|
||||||
"group": "3_gitlens@1"
|
"group": "1_gitlens_1@1"
|
||||||
},
|
|
||||||
{
|
|
||||||
"command": "gitlens.toggleFileBlame",
|
|
||||||
"when": "editorTextFocus && gitlens:isBlameable && config.gitlens.advanced.menus.editorContext.blame",
|
|
||||||
"group": "3_gitlens@2"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"command": "gitlens.copyShaToClipboard",
|
|
||||||
"when": "editorTextFocus && gitlens:isBlameable && config.gitlens.advanced.menus.editorContext.copy",
|
|
||||||
"group": "9_gitlens@1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"command": "gitlens.copyMessageToClipboard",
|
|
||||||
"when": "editorTextFocus && gitlens:isBlameable && config.gitlens.advanced.menus.editorContext.copy",
|
|
||||||
"group": "9_gitlens@2"
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -1234,7 +1242,7 @@
|
|||||||
"postinstall": "node ./node_modules/vscode/bin/install",
|
"postinstall": "node ./node_modules/vscode/bin/install",
|
||||||
"pub": "git clean -xdf && vsce publish",
|
"pub": "git clean -xdf && vsce publish",
|
||||||
"reset": "git clean -xdf && npm install",
|
"reset": "git clean -xdf && npm install",
|
||||||
"vscode:prepublish": "npm install && npm run compile"
|
"vscode:prepublish": "npm install --no-save && npm run compile"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"applicationinsights": "0.20.1",
|
"applicationinsights": "0.20.1",
|
||||||
@@ -1254,10 +1262,10 @@
|
|||||||
"@types/copy-paste": "1.1.30",
|
"@types/copy-paste": "1.1.30",
|
||||||
"@types/iconv-lite": "0.0.1",
|
"@types/iconv-lite": "0.0.1",
|
||||||
"@types/mocha": "2.2.41",
|
"@types/mocha": "2.2.41",
|
||||||
"@types/node": "7.0.27",
|
"@types/node": "7.0.28",
|
||||||
"@types/tmp": "0.0.33",
|
"@types/tmp": "0.0.33",
|
||||||
"mocha": "3.4.2",
|
"mocha": "3.4.2",
|
||||||
"tslint": "5.4.2",
|
"tslint": "5.4.3",
|
||||||
"typescript": "2.3.4",
|
"typescript": "2.3.4",
|
||||||
"vscode": "1.1.0"
|
"vscode": "1.1.0"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,8 @@ import { WhitespaceController } from './whitespaceController';
|
|||||||
|
|
||||||
export const Decorations = {
|
export const Decorations = {
|
||||||
annotation: window.createTextEditorDecorationType({
|
annotation: window.createTextEditorDecorationType({
|
||||||
isWholeLine: true
|
isWholeLine: true,
|
||||||
|
textDecoration: 'none'
|
||||||
} as DecorationRenderOptions),
|
} as DecorationRenderOptions),
|
||||||
highlight: undefined as TextEditorDecorationType | undefined
|
highlight: undefined as TextEditorDecorationType | undefined
|
||||||
};
|
};
|
||||||
@@ -233,6 +234,7 @@ export class AnnotationController extends Disposable {
|
|||||||
for (const [key, p] of this._annotationProviders) {
|
for (const [key, p] of this._annotationProviders) {
|
||||||
if (!TextDocumentComparer.equals(p.document, e.document)) continue;
|
if (!TextDocumentComparer.equals(p.document, e.document)) continue;
|
||||||
|
|
||||||
|
// TODO: Rework this once https://github.com/Microsoft/vscode/issues/27231 is released in v1.13
|
||||||
// We have to defer because isDirty is not reliable inside this event
|
// We have to defer because isDirty is not reliable inside this event
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
// If the document is dirty all is fine, just kick out since the GitContextTracker will handle it
|
// If the document is dirty all is fine, just kick out since the GitContextTracker will handle it
|
||||||
|
|||||||
@@ -77,8 +77,7 @@ export class Annotations {
|
|||||||
before: {
|
before: {
|
||||||
...renderOptions.before,
|
...renderOptions.before,
|
||||||
...{
|
...{
|
||||||
contentText: content,
|
contentText: content
|
||||||
margin: '0 26px 0 0'
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
dark: {
|
dark: {
|
||||||
@@ -113,7 +112,9 @@ export class Annotations {
|
|||||||
before: {
|
before: {
|
||||||
borderStyle: borderStyle,
|
borderStyle: borderStyle,
|
||||||
borderWidth: borderWidth,
|
borderWidth: borderWidth,
|
||||||
height: cfgFileTheme.separateLines ? 'calc(100% - 1px)' : '100%'
|
height: cfgFileTheme.separateLines ? 'calc(100% - 1px)' : '100%',
|
||||||
|
margin: '0 26px 0 0',
|
||||||
|
textDecoration: 'none'
|
||||||
},
|
},
|
||||||
dark: {
|
dark: {
|
||||||
backgroundColor: cfgFileTheme.dark.backgroundColor || undefined,
|
backgroundColor: cfgFileTheme.dark.backgroundColor || undefined,
|
||||||
@@ -123,7 +124,7 @@ export class Annotations {
|
|||||||
backgroundColor: cfgFileTheme.light.backgroundColor || undefined,
|
backgroundColor: cfgFileTheme.light.backgroundColor || undefined,
|
||||||
color: cfgFileTheme.light.foregroundColor || themeDefaults.annotations.file.gutter.light.foregroundColor
|
color: cfgFileTheme.light.foregroundColor || themeDefaults.annotations.file.gutter.light.foregroundColor
|
||||||
} as DecorationInstanceRenderOptions
|
} as DecorationInstanceRenderOptions
|
||||||
};
|
} as IRenderOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
static hover(commit: GitCommit, renderOptions: IRenderOptions, heatmap: boolean): DecorationOptions {
|
static hover(commit: GitCommit, renderOptions: IRenderOptions, heatmap: boolean): DecorationOptions {
|
||||||
@@ -142,7 +143,8 @@ export class Annotations {
|
|||||||
borderWidth: '0 0 0 2px',
|
borderWidth: '0 0 0 2px',
|
||||||
contentText: '\u200B',
|
contentText: '\u200B',
|
||||||
height: cfgTheme.annotations.file.hover.separateLines ? 'calc(100% - 1px)' : '100%',
|
height: cfgTheme.annotations.file.hover.separateLines ? 'calc(100% - 1px)' : '100%',
|
||||||
margin: '0 26px 0 0'
|
margin: '0 26px 0 0',
|
||||||
|
textDecoration: 'none'
|
||||||
}
|
}
|
||||||
} as IRenderOptions;
|
} as IRenderOptions;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,437 +1,441 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
import { Functions, Objects } from './system';
|
import { Functions, Objects } from './system';
|
||||||
import { DecorationOptions, DecorationRenderOptions, Disposable, ExtensionContext, Range, StatusBarAlignment, StatusBarItem, TextEditor, TextEditorDecorationType, TextEditorSelectionChangeEvent, window, workspace } from 'vscode';
|
import { DecorationOptions, DecorationRenderOptions, Disposable, ExtensionContext, Range, StatusBarAlignment, StatusBarItem, TextEditor, TextEditorDecorationType, TextEditorSelectionChangeEvent, window, workspace } from 'vscode';
|
||||||
import { AnnotationController } from './annotations/annotationController';
|
import { AnnotationController } from './annotations/annotationController';
|
||||||
import { Annotations, endOfLineIndex } from './annotations/annotations';
|
import { Annotations, endOfLineIndex } from './annotations/annotations';
|
||||||
import { Commands } from './commands';
|
import { Commands } from './commands';
|
||||||
import { TextEditorComparer } from './comparers';
|
import { TextEditorComparer } from './comparers';
|
||||||
import { FileAnnotationType, IConfig, LineAnnotationType, StatusBarCommand } from './configuration';
|
import { FileAnnotationType, IConfig, LineAnnotationType, StatusBarCommand } from './configuration';
|
||||||
import { DocumentSchemes, ExtensionKey } from './constants';
|
import { DocumentSchemes, ExtensionKey } from './constants';
|
||||||
import { BlameabilityChangeEvent, CommitFormatter, GitCommit, GitContextTracker, GitService, GitUri, IGitCommitLine } from './gitService';
|
import { BlameabilityChangeEvent, CommitFormatter, GitCommit, GitContextTracker, GitService, GitUri, IGitCommitLine } from './gitService';
|
||||||
|
|
||||||
const annotationDecoration: TextEditorDecorationType = window.createTextEditorDecorationType({
|
const annotationDecoration: TextEditorDecorationType = window.createTextEditorDecorationType({
|
||||||
after: {
|
after: {
|
||||||
margin: '0 0 0 4em'
|
margin: '0 0 0 3em',
|
||||||
}
|
textDecoration: 'none'
|
||||||
} as DecorationRenderOptions);
|
}
|
||||||
|
} as DecorationRenderOptions);
|
||||||
export class CurrentLineController extends Disposable {
|
|
||||||
|
export class CurrentLineController extends Disposable {
|
||||||
private _activeEditorLineDisposable: Disposable | undefined;
|
|
||||||
private _blameable: boolean;
|
private _activeEditorLineDisposable: Disposable | undefined;
|
||||||
private _config: IConfig;
|
private _blameable: boolean;
|
||||||
private _currentLine: number = -1;
|
private _config: IConfig;
|
||||||
private _disposable: Disposable;
|
private _currentLine: number = -1;
|
||||||
private _editor: TextEditor | undefined;
|
private _disposable: Disposable;
|
||||||
private _statusBarItem: StatusBarItem | undefined;
|
private _editor: TextEditor | undefined;
|
||||||
private _updateBlameDebounced: (line: number, editor: TextEditor) => Promise<void>;
|
private _isAnnotating: boolean = false;
|
||||||
private _uri: GitUri;
|
private _statusBarItem: StatusBarItem | undefined;
|
||||||
|
private _updateBlameDebounced: (line: number, editor: TextEditor) => Promise<void>;
|
||||||
constructor(context: ExtensionContext, private git: GitService, private gitContextTracker: GitContextTracker, private annotationController: AnnotationController) {
|
private _uri: GitUri;
|
||||||
super(() => this.dispose());
|
|
||||||
|
constructor(context: ExtensionContext, private git: GitService, private gitContextTracker: GitContextTracker, private annotationController: AnnotationController) {
|
||||||
this._updateBlameDebounced = Functions.debounce(this._updateBlame, 250);
|
super(() => this.dispose());
|
||||||
|
|
||||||
this._onConfigurationChanged();
|
this._updateBlameDebounced = Functions.debounce(this._updateBlame, 250);
|
||||||
|
|
||||||
const subscriptions: Disposable[] = [];
|
this._onConfigurationChanged();
|
||||||
|
|
||||||
subscriptions.push(workspace.onDidChangeConfiguration(this._onConfigurationChanged, this));
|
const subscriptions: Disposable[] = [];
|
||||||
subscriptions.push(git.onDidChangeGitCache(this._onGitCacheChanged, this));
|
|
||||||
subscriptions.push(annotationController.onDidToggleAnnotations(this._onAnnotationsToggled, this));
|
subscriptions.push(workspace.onDidChangeConfiguration(this._onConfigurationChanged, this));
|
||||||
|
subscriptions.push(git.onDidChangeGitCache(this._onGitCacheChanged, this));
|
||||||
this._disposable = Disposable.from(...subscriptions);
|
subscriptions.push(annotationController.onDidToggleAnnotations(this._onAnnotationsToggled, this));
|
||||||
}
|
|
||||||
|
this._disposable = Disposable.from(...subscriptions);
|
||||||
dispose() {
|
}
|
||||||
this._editor && this._editor.setDecorations(annotationDecoration, []);
|
|
||||||
|
dispose() {
|
||||||
this._activeEditorLineDisposable && this._activeEditorLineDisposable.dispose();
|
this._clearAnnotations(this._editor, true);
|
||||||
this._statusBarItem && this._statusBarItem.dispose();
|
|
||||||
this._disposable && this._disposable.dispose();
|
this._activeEditorLineDisposable && this._activeEditorLineDisposable.dispose();
|
||||||
}
|
this._statusBarItem && this._statusBarItem.dispose();
|
||||||
|
this._disposable && this._disposable.dispose();
|
||||||
private _onConfigurationChanged() {
|
}
|
||||||
const cfg = workspace.getConfiguration().get<IConfig>(ExtensionKey)!;
|
|
||||||
|
private _onConfigurationChanged() {
|
||||||
let changed = false;
|
const cfg = workspace.getConfiguration().get<IConfig>(ExtensionKey)!;
|
||||||
|
|
||||||
if (!Objects.areEquivalent(cfg.blame.line, this._config && this._config.blame.line) ||
|
let changed = false;
|
||||||
!Objects.areEquivalent(cfg.annotations.line.trailing, this._config && this._config.annotations.line.trailing) ||
|
|
||||||
!Objects.areEquivalent(cfg.annotations.line.hover, this._config && this._config.annotations.line.hover) ||
|
if (!Objects.areEquivalent(cfg.blame.line, this._config && this._config.blame.line) ||
|
||||||
!Objects.areEquivalent(cfg.theme.annotations.line.trailing, this._config && this._config.theme.annotations.line.trailing)) {
|
!Objects.areEquivalent(cfg.annotations.line.trailing, this._config && this._config.annotations.line.trailing) ||
|
||||||
changed = true;
|
!Objects.areEquivalent(cfg.annotations.line.hover, this._config && this._config.annotations.line.hover) ||
|
||||||
if (this._editor) {
|
!Objects.areEquivalent(cfg.theme.annotations.line.trailing, this._config && this._config.theme.annotations.line.trailing)) {
|
||||||
this._editor.setDecorations(annotationDecoration, []);
|
changed = true;
|
||||||
}
|
this._clearAnnotations(this._editor);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Objects.areEquivalent(cfg.statusBar, this._config && this._config.statusBar)) {
|
if (!Objects.areEquivalent(cfg.statusBar, this._config && this._config.statusBar)) {
|
||||||
changed = true;
|
changed = true;
|
||||||
if (cfg.statusBar.enabled) {
|
if (cfg.statusBar.enabled) {
|
||||||
const alignment = cfg.statusBar.alignment !== 'left' ? StatusBarAlignment.Right : StatusBarAlignment.Left;
|
const alignment = cfg.statusBar.alignment !== 'left' ? StatusBarAlignment.Right : StatusBarAlignment.Left;
|
||||||
if (this._statusBarItem !== undefined && this._statusBarItem.alignment !== alignment) {
|
if (this._statusBarItem !== undefined && this._statusBarItem.alignment !== alignment) {
|
||||||
this._statusBarItem.dispose();
|
this._statusBarItem.dispose();
|
||||||
this._statusBarItem = undefined;
|
this._statusBarItem = undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
this._statusBarItem = this._statusBarItem || window.createStatusBarItem(alignment, alignment === StatusBarAlignment.Right ? 1000 : 0);
|
this._statusBarItem = this._statusBarItem || window.createStatusBarItem(alignment, alignment === StatusBarAlignment.Right ? 1000 : 0);
|
||||||
this._statusBarItem.command = cfg.statusBar.command;
|
this._statusBarItem.command = cfg.statusBar.command;
|
||||||
}
|
}
|
||||||
else if (!cfg.statusBar.enabled && this._statusBarItem) {
|
else if (!cfg.statusBar.enabled && this._statusBarItem) {
|
||||||
this._statusBarItem.dispose();
|
this._statusBarItem.dispose();
|
||||||
this._statusBarItem = undefined;
|
this._statusBarItem = undefined;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this._config = cfg;
|
this._config = cfg;
|
||||||
|
|
||||||
if (!changed) return;
|
if (!changed) return;
|
||||||
|
|
||||||
const trackCurrentLine = cfg.statusBar.enabled || cfg.blame.line.enabled;
|
const trackCurrentLine = cfg.statusBar.enabled || cfg.blame.line.enabled;
|
||||||
if (trackCurrentLine && !this._activeEditorLineDisposable) {
|
if (trackCurrentLine && !this._activeEditorLineDisposable) {
|
||||||
const subscriptions: Disposable[] = [];
|
const subscriptions: Disposable[] = [];
|
||||||
|
|
||||||
subscriptions.push(window.onDidChangeActiveTextEditor(this._onActiveTextEditorChanged, this));
|
subscriptions.push(window.onDidChangeActiveTextEditor(this._onActiveTextEditorChanged, this));
|
||||||
subscriptions.push(window.onDidChangeTextEditorSelection(this._onTextEditorSelectionChanged, this));
|
subscriptions.push(window.onDidChangeTextEditorSelection(this._onTextEditorSelectionChanged, this));
|
||||||
subscriptions.push(this.gitContextTracker.onDidBlameabilityChange(this._onBlameabilityChanged, this));
|
subscriptions.push(this.gitContextTracker.onDidBlameabilityChange(this._onBlameabilityChanged, this));
|
||||||
|
|
||||||
this._activeEditorLineDisposable = Disposable.from(...subscriptions);
|
this._activeEditorLineDisposable = Disposable.from(...subscriptions);
|
||||||
}
|
}
|
||||||
else if (!trackCurrentLine && this._activeEditorLineDisposable) {
|
else if (!trackCurrentLine && this._activeEditorLineDisposable) {
|
||||||
this._activeEditorLineDisposable.dispose();
|
this._activeEditorLineDisposable.dispose();
|
||||||
this._activeEditorLineDisposable = undefined;
|
this._activeEditorLineDisposable = undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
this._onActiveTextEditorChanged(window.activeTextEditor);
|
this._onActiveTextEditorChanged(window.activeTextEditor);
|
||||||
}
|
}
|
||||||
|
|
||||||
private isEditorBlameable(editor: TextEditor | undefined): boolean {
|
private isEditorBlameable(editor: TextEditor | undefined): boolean {
|
||||||
if (editor === undefined || editor.document === undefined) return false;
|
if (editor === undefined || editor.document === undefined) return false;
|
||||||
|
|
||||||
if (!this.git.isTrackable(editor.document.uri)) return false;
|
if (!this.git.isTrackable(editor.document.uri)) return false;
|
||||||
if (editor.document.isUntitled && editor.document.uri.scheme === DocumentSchemes.File) return false;
|
if (editor.document.isUntitled && editor.document.uri.scheme === DocumentSchemes.File) return false;
|
||||||
|
|
||||||
return this.git.isEditorBlameable(editor);
|
return this.git.isEditorBlameable(editor);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async _onActiveTextEditorChanged(editor: TextEditor | undefined) {
|
private async _onActiveTextEditorChanged(editor: TextEditor | undefined) {
|
||||||
this._currentLine = -1;
|
this._currentLine = -1;
|
||||||
|
this._clearAnnotations(this._editor);
|
||||||
const previousEditor = this._editor;
|
|
||||||
previousEditor && previousEditor.setDecorations(annotationDecoration, []);
|
if (editor === undefined || !this.isEditorBlameable(editor)) {
|
||||||
|
this.clear(editor);
|
||||||
if (editor === undefined || !this.isEditorBlameable(editor)) {
|
this._editor = undefined;
|
||||||
this.clear(editor);
|
|
||||||
|
return;
|
||||||
this._editor = undefined;
|
}
|
||||||
|
|
||||||
return;
|
this._blameable = editor !== undefined && editor.document !== undefined && !editor.document.isDirty;
|
||||||
}
|
this._editor = editor;
|
||||||
|
this._uri = await GitUri.fromUri(editor.document.uri, this.git);
|
||||||
this._blameable = editor !== undefined && editor.document !== undefined && !editor.document.isDirty;
|
|
||||||
this._editor = editor;
|
const maxLines = this._config.advanced.caching.maxLines;
|
||||||
this._uri = await GitUri.fromUri(editor.document.uri, this.git);
|
// If caching is on and the file is small enough -- kick off a blame for the whole file
|
||||||
|
if (this._config.advanced.caching.enabled && (maxLines <= 0 || editor.document.lineCount <= maxLines)) {
|
||||||
const maxLines = this._config.advanced.caching.maxLines;
|
this.git.getBlameForFile(this._uri);
|
||||||
// If caching is on and the file is small enough -- kick off a blame for the whole file
|
}
|
||||||
if (this._config.advanced.caching.enabled && (maxLines <= 0 || editor.document.lineCount <= maxLines)) {
|
|
||||||
this.git.getBlameForFile(this._uri);
|
this._updateBlameDebounced(editor.selection.active.line, editor);
|
||||||
}
|
}
|
||||||
|
|
||||||
this._updateBlameDebounced(editor.selection.active.line, editor);
|
private _onBlameabilityChanged(e: BlameabilityChangeEvent) {
|
||||||
}
|
this._blameable = e.blameable;
|
||||||
|
if (!e.blameable || !this._editor) {
|
||||||
private _onBlameabilityChanged(e: BlameabilityChangeEvent) {
|
this.clear(e.editor);
|
||||||
this._blameable = e.blameable;
|
return;
|
||||||
if (!e.blameable || !this._editor) {
|
}
|
||||||
this.clear(e.editor);
|
|
||||||
return;
|
// Make sure this is for the editor we are tracking
|
||||||
}
|
if (!TextEditorComparer.equals(this._editor, e.editor)) return;
|
||||||
|
|
||||||
// Make sure this is for the editor we are tracking
|
this._updateBlameDebounced(this._editor.selection.active.line, this._editor);
|
||||||
if (!TextEditorComparer.equals(this._editor, e.editor)) return;
|
}
|
||||||
|
|
||||||
this._updateBlameDebounced(this._editor.selection.active.line, this._editor);
|
private _onAnnotationsToggled() {
|
||||||
}
|
this._onActiveTextEditorChanged(window.activeTextEditor);
|
||||||
|
}
|
||||||
private _onAnnotationsToggled() {
|
|
||||||
this._onActiveTextEditorChanged(window.activeTextEditor);
|
private _onGitCacheChanged() {
|
||||||
}
|
this._onActiveTextEditorChanged(window.activeTextEditor);
|
||||||
|
}
|
||||||
private _onGitCacheChanged() {
|
|
||||||
this._onActiveTextEditorChanged(window.activeTextEditor);
|
private async _onTextEditorSelectionChanged(e: TextEditorSelectionChangeEvent): Promise<void> {
|
||||||
}
|
// Make sure this is for the editor we are tracking
|
||||||
|
if (!this._blameable || !TextEditorComparer.equals(this._editor, e.textEditor)) return;
|
||||||
private async _onTextEditorSelectionChanged(e: TextEditorSelectionChangeEvent): Promise<void> {
|
|
||||||
// Make sure this is for the editor we are tracking
|
const line = e.selections[0].active.line;
|
||||||
if (!this._blameable || !TextEditorComparer.equals(this._editor, e.textEditor)) return;
|
if (line === this._currentLine) return;
|
||||||
|
|
||||||
const line = e.selections[0].active.line;
|
this._currentLine = line;
|
||||||
if (line === this._currentLine) return;
|
|
||||||
this._currentLine = line;
|
if (!this._uri && e.textEditor !== undefined) {
|
||||||
|
this._uri = await GitUri.fromUri(e.textEditor.document.uri, this.git);
|
||||||
if (!this._uri && e.textEditor) {
|
}
|
||||||
this._uri = await GitUri.fromUri(e.textEditor.document.uri, this.git);
|
|
||||||
}
|
this._clearAnnotations(e.textEditor);
|
||||||
|
this._updateBlameDebounced(line, e.textEditor);
|
||||||
this._updateBlameDebounced(line, e.textEditor);
|
}
|
||||||
}
|
|
||||||
|
private async _updateBlame(line: number, editor: TextEditor) {
|
||||||
private async _updateBlame(line: number, editor: TextEditor) {
|
line = line - this._uri.offset;
|
||||||
line = line - this._uri.offset;
|
|
||||||
|
let commit: GitCommit | undefined = undefined;
|
||||||
let commit: GitCommit | undefined = undefined;
|
let commitLine: IGitCommitLine | undefined = undefined;
|
||||||
let commitLine: IGitCommitLine | undefined = undefined;
|
// Since blame information isn't valid when there are unsaved changes -- don't show any status
|
||||||
// Since blame information isn't valid when there are unsaved changes -- don't show any status
|
if (this._blameable && line >= 0) {
|
||||||
if (this._blameable && line >= 0) {
|
const blameLine = await this.git.getBlameForLine(this._uri, line);
|
||||||
const blameLine = await this.git.getBlameForLine(this._uri, line);
|
commitLine = blameLine === undefined ? undefined : blameLine.line;
|
||||||
commitLine = blameLine === undefined ? undefined : blameLine.line;
|
commit = blameLine === undefined ? undefined : blameLine.commit;
|
||||||
commit = blameLine === undefined ? undefined : blameLine.commit;
|
}
|
||||||
}
|
|
||||||
|
if (commit !== undefined && commitLine !== undefined) {
|
||||||
if (commit !== undefined && commitLine !== undefined) {
|
this.show(commit, commitLine, editor);
|
||||||
this.show(commit, commitLine, editor);
|
}
|
||||||
}
|
else {
|
||||||
else {
|
this.clear(editor);
|
||||||
this.clear(editor);
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
async clear(editor: TextEditor | undefined) {
|
||||||
async clear(editor: TextEditor | undefined, previousEditor?: TextEditor) {
|
this._clearAnnotations(editor, true);
|
||||||
this._clearAnnotations(editor, previousEditor);
|
this._statusBarItem && this._statusBarItem.hide();
|
||||||
this._statusBarItem && this._statusBarItem.hide();
|
}
|
||||||
}
|
|
||||||
|
private async _clearAnnotations(editor: TextEditor | undefined, force: boolean = false) {
|
||||||
private async _clearAnnotations(editor: TextEditor | undefined, previousEditor?: TextEditor) {
|
if (editor === undefined || (!this._isAnnotating && !force)) return;
|
||||||
editor && editor.setDecorations(annotationDecoration, []);
|
|
||||||
// I have no idea why the decorators sometimes don't get removed, but if they don't try again with a tiny delay
|
editor.setDecorations(annotationDecoration, []);
|
||||||
if (editor !== undefined) {
|
this._isAnnotating = false;
|
||||||
await Functions.wait(1);
|
|
||||||
editor.setDecorations(annotationDecoration, []);
|
if (!force) return;
|
||||||
}
|
|
||||||
}
|
// I have no idea why the decorators sometimes don't get removed, but if they don't try again with a tiny delay
|
||||||
|
await Functions.wait(1);
|
||||||
async show(commit: GitCommit, blameLine: IGitCommitLine, editor: TextEditor) {
|
editor.setDecorations(annotationDecoration, []);
|
||||||
// I have no idea why I need this protection -- but it happens
|
}
|
||||||
if (editor.document === undefined) return;
|
|
||||||
|
async show(commit: GitCommit, blameLine: IGitCommitLine, editor: TextEditor) {
|
||||||
this._updateStatusBar(commit);
|
// I have no idea why I need this protection -- but it happens
|
||||||
await this._updateAnnotations(commit, blameLine, editor);
|
if (editor.document === undefined) return;
|
||||||
}
|
|
||||||
|
this._updateStatusBar(commit);
|
||||||
async showAnnotations(editor: TextEditor, type: LineAnnotationType) {
|
await this._updateAnnotations(commit, blameLine, editor);
|
||||||
if (editor === undefined) return;
|
}
|
||||||
|
|
||||||
const cfg = this._config.blame.line;
|
async showAnnotations(editor: TextEditor, type: LineAnnotationType) {
|
||||||
if (!cfg.enabled || cfg.annotationType !== type) {
|
if (editor === undefined) return;
|
||||||
cfg.enabled = true;
|
|
||||||
cfg.annotationType = type;
|
const cfg = this._config.blame.line;
|
||||||
|
if (!cfg.enabled || cfg.annotationType !== type) {
|
||||||
await this._clearAnnotations(editor);
|
cfg.enabled = true;
|
||||||
await this._updateBlame(editor.selection.active.line, editor);
|
cfg.annotationType = type;
|
||||||
}
|
|
||||||
}
|
await this._clearAnnotations(editor);
|
||||||
|
await this._updateBlame(editor.selection.active.line, editor);
|
||||||
async toggleAnnotations(editor: TextEditor, type: LineAnnotationType) {
|
}
|
||||||
if (editor === undefined) return;
|
}
|
||||||
|
|
||||||
const cfg = this._config.blame.line;
|
async toggleAnnotations(editor: TextEditor, type: LineAnnotationType) {
|
||||||
cfg.enabled = !cfg.enabled;
|
if (editor === undefined) return;
|
||||||
cfg.annotationType = type;
|
|
||||||
|
const cfg = this._config.blame.line;
|
||||||
await this._clearAnnotations(editor);
|
cfg.enabled = !cfg.enabled;
|
||||||
await this._updateBlame(editor.selection.active.line, editor);
|
cfg.annotationType = type;
|
||||||
}
|
|
||||||
|
await this._clearAnnotations(editor);
|
||||||
private async _updateAnnotations(commit: GitCommit, blameLine: IGitCommitLine, editor: TextEditor) {
|
await this._updateBlame(editor.selection.active.line, editor);
|
||||||
const cfg = this._config.blame.line;
|
}
|
||||||
if (!cfg.enabled) return;
|
|
||||||
|
private async _updateAnnotations(commit: GitCommit, blameLine: IGitCommitLine, editor: TextEditor) {
|
||||||
const line = blameLine.line + this._uri.offset;
|
const cfg = this._config.blame.line;
|
||||||
|
if (!cfg.enabled) return;
|
||||||
const decorationOptions: DecorationOptions[] = [];
|
|
||||||
|
const line = blameLine.line + this._uri.offset;
|
||||||
let showChanges = false;
|
|
||||||
let showChangesStartIndex = 0;
|
const decorationOptions: DecorationOptions[] = [];
|
||||||
let showChangesInStartingWhitespace = false;
|
|
||||||
|
let showChanges = false;
|
||||||
let showDetails = false;
|
let showChangesStartIndex = 0;
|
||||||
let showDetailsStartIndex = 0;
|
let showChangesInStartingWhitespace = false;
|
||||||
let showDetailsInStartingWhitespace = false;
|
|
||||||
|
let showDetails = false;
|
||||||
switch (cfg.annotationType) {
|
let showDetailsStartIndex = 0;
|
||||||
case LineAnnotationType.Trailing: {
|
let showDetailsInStartingWhitespace = false;
|
||||||
const cfgAnnotations = this._config.annotations.line.trailing;
|
|
||||||
|
switch (cfg.annotationType) {
|
||||||
showChanges = cfgAnnotations.hover.changes;
|
case LineAnnotationType.Trailing: {
|
||||||
showDetails = cfgAnnotations.hover.details;
|
const cfgAnnotations = this._config.annotations.line.trailing;
|
||||||
|
|
||||||
if (cfgAnnotations.hover.wholeLine) {
|
showChanges = cfgAnnotations.hover.changes;
|
||||||
showChangesStartIndex = 0;
|
showDetails = cfgAnnotations.hover.details;
|
||||||
showChangesInStartingWhitespace = false;
|
|
||||||
|
if (cfgAnnotations.hover.wholeLine) {
|
||||||
showDetailsStartIndex = 0;
|
showChangesStartIndex = 0;
|
||||||
showDetailsInStartingWhitespace = false;
|
showChangesInStartingWhitespace = false;
|
||||||
}
|
|
||||||
else {
|
showDetailsStartIndex = 0;
|
||||||
showChangesStartIndex = endOfLineIndex;
|
showDetailsInStartingWhitespace = false;
|
||||||
showChangesInStartingWhitespace = true;
|
}
|
||||||
|
else {
|
||||||
showDetailsStartIndex = endOfLineIndex;
|
showChangesStartIndex = endOfLineIndex;
|
||||||
showDetailsInStartingWhitespace = true;
|
showChangesInStartingWhitespace = true;
|
||||||
}
|
|
||||||
|
showDetailsStartIndex = endOfLineIndex;
|
||||||
const decoration = Annotations.trailing(commit, cfgAnnotations.format, cfgAnnotations.dateFormat, this._config.theme);
|
showDetailsInStartingWhitespace = true;
|
||||||
decoration.range = editor.document.validateRange(new Range(line, endOfLineIndex, line, endOfLineIndex));
|
}
|
||||||
decorationOptions.push(decoration);
|
|
||||||
|
const decoration = Annotations.trailing(commit, cfgAnnotations.format, cfgAnnotations.dateFormat, this._config.theme);
|
||||||
break;
|
decoration.range = editor.document.validateRange(new Range(line, endOfLineIndex, line, endOfLineIndex));
|
||||||
}
|
decorationOptions.push(decoration);
|
||||||
case LineAnnotationType.Hover: {
|
|
||||||
const cfgAnnotations = this._config.annotations.line.hover;
|
break;
|
||||||
|
}
|
||||||
showChanges = cfgAnnotations.changes;
|
case LineAnnotationType.Hover: {
|
||||||
showChangesStartIndex = 0;
|
const cfgAnnotations = this._config.annotations.line.hover;
|
||||||
showChangesInStartingWhitespace = false;
|
|
||||||
|
showChanges = cfgAnnotations.changes;
|
||||||
showDetails = cfgAnnotations.details;
|
showChangesStartIndex = 0;
|
||||||
showDetailsStartIndex = 0;
|
showChangesInStartingWhitespace = false;
|
||||||
showDetailsInStartingWhitespace = false;
|
|
||||||
|
showDetails = cfgAnnotations.details;
|
||||||
break;
|
showDetailsStartIndex = 0;
|
||||||
}
|
showDetailsInStartingWhitespace = false;
|
||||||
}
|
|
||||||
|
break;
|
||||||
if (showDetails || showChanges) {
|
}
|
||||||
const annotationType = this.annotationController.getAnnotationType(editor);
|
}
|
||||||
|
|
||||||
const firstNonWhitespace = editor.document.lineAt(line).firstNonWhitespaceCharacterIndex;
|
if (showDetails || showChanges) {
|
||||||
|
const annotationType = this.annotationController.getAnnotationType(editor);
|
||||||
switch (annotationType) {
|
|
||||||
case FileAnnotationType.Gutter: {
|
const firstNonWhitespace = editor.document.lineAt(line).firstNonWhitespaceCharacterIndex;
|
||||||
const cfgHover = this._config.annotations.file.gutter.hover;
|
|
||||||
if (cfgHover.details) {
|
switch (annotationType) {
|
||||||
showDetailsInStartingWhitespace = false;
|
case FileAnnotationType.Gutter: {
|
||||||
if (cfgHover.wholeLine) {
|
const cfgHover = this._config.annotations.file.gutter.hover;
|
||||||
// Avoid double annotations if we are showing the whole-file hover blame annotations
|
if (cfgHover.details) {
|
||||||
showDetails = false;
|
showDetailsInStartingWhitespace = false;
|
||||||
}
|
if (cfgHover.wholeLine) {
|
||||||
else {
|
// Avoid double annotations if we are showing the whole-file hover blame annotations
|
||||||
if (showDetailsStartIndex === 0) {
|
showDetails = false;
|
||||||
showDetailsStartIndex = firstNonWhitespace === 0 ? 1 : firstNonWhitespace;
|
}
|
||||||
}
|
else {
|
||||||
if (showChangesStartIndex === 0) {
|
if (showDetailsStartIndex === 0) {
|
||||||
showChangesInStartingWhitespace = true;
|
showDetailsStartIndex = firstNonWhitespace === 0 ? 1 : firstNonWhitespace;
|
||||||
showChangesStartIndex = firstNonWhitespace === 0 ? 1 : firstNonWhitespace;
|
}
|
||||||
}
|
if (showChangesStartIndex === 0) {
|
||||||
}
|
showChangesInStartingWhitespace = true;
|
||||||
}
|
showChangesStartIndex = firstNonWhitespace === 0 ? 1 : firstNonWhitespace;
|
||||||
|
}
|
||||||
break;
|
}
|
||||||
}
|
}
|
||||||
case FileAnnotationType.Hover: {
|
|
||||||
const cfgHover = this._config.annotations.file.hover;
|
break;
|
||||||
showDetailsInStartingWhitespace = false;
|
}
|
||||||
if (cfgHover.wholeLine) {
|
case FileAnnotationType.Hover: {
|
||||||
// Avoid double annotations if we are showing the whole-file hover blame annotations
|
const cfgHover = this._config.annotations.file.hover;
|
||||||
showDetails = false;
|
showDetailsInStartingWhitespace = false;
|
||||||
showChangesStartIndex = 0;
|
if (cfgHover.wholeLine) {
|
||||||
}
|
// Avoid double annotations if we are showing the whole-file hover blame annotations
|
||||||
else {
|
showDetails = false;
|
||||||
if (showDetailsStartIndex === 0) {
|
showChangesStartIndex = 0;
|
||||||
showDetailsStartIndex = firstNonWhitespace === 0 ? 1 : firstNonWhitespace;
|
}
|
||||||
}
|
else {
|
||||||
if (showChangesStartIndex === 0) {
|
if (showDetailsStartIndex === 0) {
|
||||||
showChangesInStartingWhitespace = true;
|
showDetailsStartIndex = firstNonWhitespace === 0 ? 1 : firstNonWhitespace;
|
||||||
showChangesStartIndex = firstNonWhitespace === 0 ? 1 : firstNonWhitespace;
|
}
|
||||||
}
|
if (showChangesStartIndex === 0) {
|
||||||
}
|
showChangesInStartingWhitespace = true;
|
||||||
|
showChangesStartIndex = firstNonWhitespace === 0 ? 1 : firstNonWhitespace;
|
||||||
break;
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
break;
|
||||||
if (showDetails) {
|
}
|
||||||
// Get the full commit message -- since blame only returns the summary
|
}
|
||||||
let logCommit: GitCommit | undefined = undefined;
|
|
||||||
if (!commit.isUncommitted) {
|
if (showDetails) {
|
||||||
logCommit = await this.git.getLogCommit(this._uri.repoPath, this._uri.fsPath, commit.sha);
|
// Get the full commit message -- since blame only returns the summary
|
||||||
}
|
let logCommit: GitCommit | undefined = undefined;
|
||||||
|
if (!commit.isUncommitted) {
|
||||||
// I have no idea why I need this protection -- but it happens
|
logCommit = await this.git.getLogCommit(this._uri.repoPath, this._uri.fsPath, commit.sha);
|
||||||
if (editor.document === undefined) return;
|
}
|
||||||
|
|
||||||
const decoration = Annotations.detailsHover(logCommit || commit);
|
// I have no idea why I need this protection -- but it happens
|
||||||
decoration.range = editor.document.validateRange(new Range(line, showDetailsStartIndex, line, endOfLineIndex));
|
if (editor.document === undefined) return;
|
||||||
decorationOptions.push(decoration);
|
|
||||||
|
const decoration = Annotations.detailsHover(logCommit || commit);
|
||||||
if (showDetailsInStartingWhitespace && showDetailsStartIndex !== 0) {
|
decoration.range = editor.document.validateRange(new Range(line, showDetailsStartIndex, line, endOfLineIndex));
|
||||||
decorationOptions.push(Annotations.withRange(decoration, 0, firstNonWhitespace));
|
decorationOptions.push(decoration);
|
||||||
}
|
|
||||||
}
|
if (showDetailsInStartingWhitespace && showDetailsStartIndex !== 0) {
|
||||||
|
decorationOptions.push(Annotations.withRange(decoration, 0, firstNonWhitespace));
|
||||||
if (showChanges) {
|
}
|
||||||
const decoration = await Annotations.changesHover(commit, line, this._uri, this.git);
|
}
|
||||||
|
|
||||||
// I have no idea why I need this protection -- but it happens
|
if (showChanges) {
|
||||||
if (editor.document === undefined) return;
|
const decoration = await Annotations.changesHover(commit, line, this._uri, this.git);
|
||||||
|
|
||||||
decoration.range = editor.document.validateRange(new Range(line, showChangesStartIndex, line, endOfLineIndex));
|
// I have no idea why I need this protection -- but it happens
|
||||||
decorationOptions.push(decoration);
|
if (editor.document === undefined) return;
|
||||||
|
|
||||||
if (showChangesInStartingWhitespace && showChangesStartIndex !== 0) {
|
decoration.range = editor.document.validateRange(new Range(line, showChangesStartIndex, line, endOfLineIndex));
|
||||||
decorationOptions.push(Annotations.withRange(decoration, 0, firstNonWhitespace));
|
decorationOptions.push(decoration);
|
||||||
}
|
|
||||||
}
|
if (showChangesInStartingWhitespace && showChangesStartIndex !== 0) {
|
||||||
}
|
decorationOptions.push(Annotations.withRange(decoration, 0, firstNonWhitespace));
|
||||||
|
}
|
||||||
if (decorationOptions.length) {
|
}
|
||||||
editor.setDecorations(annotationDecoration, decorationOptions);
|
}
|
||||||
}
|
|
||||||
}
|
if (decorationOptions.length) {
|
||||||
|
editor.setDecorations(annotationDecoration, decorationOptions);
|
||||||
private _updateStatusBar(commit: GitCommit) {
|
this._isAnnotating = true;
|
||||||
const cfg = this._config.statusBar;
|
}
|
||||||
if (!cfg.enabled || this._statusBarItem === undefined) return;
|
}
|
||||||
|
|
||||||
this._statusBarItem.text = `$(git-commit) ${CommitFormatter.fromTemplate(cfg.format, commit, cfg.dateFormat)}`;
|
private _updateStatusBar(commit: GitCommit) {
|
||||||
|
const cfg = this._config.statusBar;
|
||||||
switch (cfg.command) {
|
if (!cfg.enabled || this._statusBarItem === undefined) return;
|
||||||
case StatusBarCommand.BlameAnnotate:
|
|
||||||
this._statusBarItem.tooltip = 'Toggle Blame Annotations';
|
this._statusBarItem.text = `$(git-commit) ${CommitFormatter.fromTemplate(cfg.format, commit, cfg.dateFormat)}`;
|
||||||
break;
|
|
||||||
case StatusBarCommand.ShowBlameHistory:
|
switch (cfg.command) {
|
||||||
this._statusBarItem.tooltip = 'Open Blame History Explorer';
|
case StatusBarCommand.BlameAnnotate:
|
||||||
break;
|
this._statusBarItem.tooltip = 'Toggle Blame Annotations';
|
||||||
case StatusBarCommand.ShowFileHistory:
|
break;
|
||||||
this._statusBarItem.tooltip = 'Open File History Explorer';
|
case StatusBarCommand.ShowBlameHistory:
|
||||||
break;
|
this._statusBarItem.tooltip = 'Open Blame History Explorer';
|
||||||
case StatusBarCommand.DiffWithPrevious:
|
break;
|
||||||
this._statusBarItem.command = Commands.DiffLineWithPrevious;
|
case StatusBarCommand.ShowFileHistory:
|
||||||
this._statusBarItem.tooltip = 'Compare Line Commit with Previous';
|
this._statusBarItem.tooltip = 'Open File History Explorer';
|
||||||
break;
|
break;
|
||||||
case StatusBarCommand.DiffWithWorking:
|
case StatusBarCommand.DiffWithPrevious:
|
||||||
this._statusBarItem.command = Commands.DiffLineWithWorking;
|
this._statusBarItem.command = Commands.DiffLineWithPrevious;
|
||||||
this._statusBarItem.tooltip = 'Compare Line Commit with Working Tree';
|
this._statusBarItem.tooltip = 'Compare Line Commit with Previous';
|
||||||
break;
|
break;
|
||||||
case StatusBarCommand.ToggleCodeLens:
|
case StatusBarCommand.DiffWithWorking:
|
||||||
this._statusBarItem.tooltip = 'Toggle Git CodeLens';
|
this._statusBarItem.command = Commands.DiffLineWithWorking;
|
||||||
break;
|
this._statusBarItem.tooltip = 'Compare Line Commit with Working Tree';
|
||||||
case StatusBarCommand.ShowQuickCommitDetails:
|
break;
|
||||||
this._statusBarItem.tooltip = 'Show Commit Details';
|
case StatusBarCommand.ToggleCodeLens:
|
||||||
break;
|
this._statusBarItem.tooltip = 'Toggle Git CodeLens';
|
||||||
case StatusBarCommand.ShowQuickCommitFileDetails:
|
break;
|
||||||
this._statusBarItem.tooltip = 'Show Line Commit Details';
|
case StatusBarCommand.ShowQuickCommitDetails:
|
||||||
break;
|
this._statusBarItem.tooltip = 'Show Commit Details';
|
||||||
case StatusBarCommand.ShowQuickFileHistory:
|
break;
|
||||||
this._statusBarItem.tooltip = 'Show File History';
|
case StatusBarCommand.ShowQuickCommitFileDetails:
|
||||||
break;
|
this._statusBarItem.tooltip = 'Show Line Commit Details';
|
||||||
case StatusBarCommand.ShowQuickCurrentBranchHistory:
|
break;
|
||||||
this._statusBarItem.tooltip = 'Show Branch History';
|
case StatusBarCommand.ShowQuickFileHistory:
|
||||||
break;
|
this._statusBarItem.tooltip = 'Show File History';
|
||||||
}
|
break;
|
||||||
|
case StatusBarCommand.ShowQuickCurrentBranchHistory:
|
||||||
this._statusBarItem.show();
|
this._statusBarItem.tooltip = 'Show Branch History';
|
||||||
}
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
this._statusBarItem.show();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
131
src/extension.ts
131
src/extension.ts
@@ -16,7 +16,7 @@ import { ShowQuickRepoStatusCommand, ShowQuickStashListCommand } from './command
|
|||||||
import { StashApplyCommand, StashDeleteCommand, StashSaveCommand } from './commands';
|
import { StashApplyCommand, StashDeleteCommand, StashSaveCommand } from './commands';
|
||||||
import { ToggleCodeLensCommand } from './commands';
|
import { ToggleCodeLensCommand } from './commands';
|
||||||
import { Keyboard } from './commands';
|
import { Keyboard } from './commands';
|
||||||
import { IConfig } from './configuration';
|
import { BlameLineHighlightLocations, CodeLensLocations, IConfig, LineAnnotationType } from './configuration';
|
||||||
import { ApplicationInsightsKey, BuiltInCommands, ExtensionKey, QualifiedExtensionId, WorkspaceState } from './constants';
|
import { ApplicationInsightsKey, BuiltInCommands, ExtensionKey, QualifiedExtensionId, WorkspaceState } from './constants';
|
||||||
import { CurrentLineController } from './currentLineController';
|
import { CurrentLineController } from './currentLineController';
|
||||||
import { GitContentProvider } from './gitContentProvider';
|
import { GitContentProvider } from './gitContentProvider';
|
||||||
@@ -61,9 +61,12 @@ export async function activate(context: ExtensionContext) {
|
|||||||
telemetryContext['git.version'] = gitVersion;
|
telemetryContext['git.version'] = gitVersion;
|
||||||
Telemetry.setContext(telemetryContext);
|
Telemetry.setContext(telemetryContext);
|
||||||
|
|
||||||
|
await migrateSettings(context);
|
||||||
notifyOnUnsupportedGitVersion(context, gitVersion);
|
notifyOnUnsupportedGitVersion(context, gitVersion);
|
||||||
notifyOnNewGitLensVersion(context, gitlensVersion);
|
notifyOnNewGitLensVersion(context, gitlensVersion);
|
||||||
|
|
||||||
|
await context.globalState.update(WorkspaceState.GitLensVersion, gitlensVersion);
|
||||||
|
|
||||||
const git = new GitService(context, repoPath);
|
const git = new GitService(context, repoPath);
|
||||||
context.subscriptions.push(git);
|
context.subscriptions.push(git);
|
||||||
|
|
||||||
@@ -124,6 +127,130 @@ export async function activate(context: ExtensionContext) {
|
|||||||
// this method is called when your extension is deactivated
|
// this method is called when your extension is deactivated
|
||||||
export function deactivate() { }
|
export function deactivate() { }
|
||||||
|
|
||||||
|
async function migrateSettings(context: ExtensionContext) {
|
||||||
|
const previousVersion = context.globalState.get<string>(WorkspaceState.GitLensVersion);
|
||||||
|
if (previousVersion === undefined) return;
|
||||||
|
|
||||||
|
const [major] = previousVersion.split('.');
|
||||||
|
if (parseInt(major, 10) >= 4) return;
|
||||||
|
|
||||||
|
try {
|
||||||
|
const cfg = workspace.getConfiguration(ExtensionKey);
|
||||||
|
const prevCfg = workspace.getConfiguration().get<any>(ExtensionKey)!;
|
||||||
|
|
||||||
|
if (prevCfg.blame !== undefined && prevCfg.blame.annotation !== undefined) {
|
||||||
|
switch (prevCfg.blame.annotation.activeLine) {
|
||||||
|
case 'off':
|
||||||
|
await cfg.update('blame.line.enabled', false, true);
|
||||||
|
break;
|
||||||
|
case 'hover':
|
||||||
|
await cfg.update('blame.line.annotationType', LineAnnotationType.Hover, true);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (prevCfg.blame.annotation.activeLineDarkColor != null) {
|
||||||
|
await cfg.update('theme.annotations.line.trailing.dark.foregroundColor', prevCfg.blame.annotation.activeLineDarkColor, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (prevCfg.blame.annotation.activeLineLightColor != null) {
|
||||||
|
await cfg.update('theme.annotations.line.trailing.light.foregroundColor', prevCfg.blame.annotation.activeLineLightColor, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (prevCfg.blame.annotation.highlight) {
|
||||||
|
case 'none':
|
||||||
|
await cfg.update('blame.file.lineHighlight.enabled', false);
|
||||||
|
break;
|
||||||
|
case 'gutter':
|
||||||
|
await cfg.update('blame.file.lineHighlight.locations', [BlameLineHighlightLocations.Gutter, BlameLineHighlightLocations.OverviewRuler], true);
|
||||||
|
break;
|
||||||
|
case 'line':
|
||||||
|
await cfg.update('blame.file.lineHighlight.locations', [BlameLineHighlightLocations.Line, BlameLineHighlightLocations.OverviewRuler], true);
|
||||||
|
break;
|
||||||
|
case 'both':
|
||||||
|
}
|
||||||
|
|
||||||
|
if (prevCfg.blame.annotation.dateFormat != null) {
|
||||||
|
await cfg.update('annotations.file.gutter.dateFormat', prevCfg.blame.annotation.dateFormat, true);
|
||||||
|
await cfg.update('annotations.line.trailing.dateFormat', prevCfg.blame.annotation.dateFormat, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (prevCfg.codeLens !== undefined) {
|
||||||
|
switch (prevCfg.codeLens.visibility) {
|
||||||
|
case 'ondemand':
|
||||||
|
case 'off':
|
||||||
|
await cfg.update('codeLens.enabled', false);
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (prevCfg.codeLens.location) {
|
||||||
|
case 'all':
|
||||||
|
await cfg.update('codeLens.locations', [CodeLensLocations.Document, CodeLensLocations.Containers, CodeLensLocations.Blocks], true);
|
||||||
|
break;
|
||||||
|
case 'document+containers':
|
||||||
|
await cfg.update('codeLens.locations', [CodeLensLocations.Document, CodeLensLocations.Containers], true);
|
||||||
|
break;
|
||||||
|
case 'document':
|
||||||
|
await cfg.update('codeLens.locations', [CodeLensLocations.Document], true);
|
||||||
|
break;
|
||||||
|
case 'custom':
|
||||||
|
await cfg.update('codeLens.locations', [CodeLensLocations.Custom], true);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (prevCfg.codeLens.locationCustomSymbols != null) {
|
||||||
|
await cfg.update('codeLens.customLocationSymbols', prevCfg.codeLens.locationCustomSymbols, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((prevCfg.menus && prevCfg.menus.diff && prevCfg.menus.diff.enabled) === false) {
|
||||||
|
await cfg.update('advanced.menus', {
|
||||||
|
editorContext: {
|
||||||
|
blame: true,
|
||||||
|
copy: true,
|
||||||
|
details: true,
|
||||||
|
fileDiff: false,
|
||||||
|
history: true,
|
||||||
|
lineDiff: false,
|
||||||
|
remote: true
|
||||||
|
},
|
||||||
|
editorTitle: {
|
||||||
|
blame: true,
|
||||||
|
fileDiff: false,
|
||||||
|
history: true,
|
||||||
|
remote: true,
|
||||||
|
status: true
|
||||||
|
},
|
||||||
|
editorTitleContext: {
|
||||||
|
blame: true,
|
||||||
|
fileDiff: false,
|
||||||
|
history: true,
|
||||||
|
remote: true
|
||||||
|
},
|
||||||
|
explorerContext: {
|
||||||
|
fileDiff: false,
|
||||||
|
history: true,
|
||||||
|
remote: true
|
||||||
|
}
|
||||||
|
}, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (prevCfg.statusBar && prevCfg.statusBar.date) {
|
||||||
|
case 'off':
|
||||||
|
await cfg.update('statusBar.format', '${author}', true);
|
||||||
|
break;
|
||||||
|
case 'absolute':
|
||||||
|
await cfg.update('statusBar.format', '${author}, ${date}', true);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (ex) {
|
||||||
|
Logger.error(ex, 'migrateSettings');
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
await window.showInformationMessage(`GitLens v4 adds many new settings and removes a few old ones, so please review your settings to ensure they are configured properly.`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async function notifyOnNewGitLensVersion(context: ExtensionContext, version: string) {
|
async function notifyOnNewGitLensVersion(context: ExtensionContext, version: string) {
|
||||||
if (context.globalState.get(WorkspaceState.SuppressUpdateNotice, false)) return;
|
if (context.globalState.get(WorkspaceState.SuppressUpdateNotice, false)) return;
|
||||||
|
|
||||||
@@ -143,8 +270,6 @@ async function notifyOnNewGitLensVersion(context: ExtensionContext, version: str
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
await context.globalState.update(WorkspaceState.GitLensVersion, version);
|
|
||||||
|
|
||||||
if (previousVersion) {
|
if (previousVersion) {
|
||||||
const [major, minor] = version.split('.');
|
const [major, minor] = version.split('.');
|
||||||
const [prevMajor, prevMinor] = previousVersion.split('.');
|
const [prevMajor, prevMinor] = previousVersion.split('.');
|
||||||
|
|||||||
@@ -75,6 +75,7 @@ export class GitContextTracker extends Disposable {
|
|||||||
// this._unsubscribeToDocumentChanges();
|
// this._unsubscribeToDocumentChanges();
|
||||||
// this.updateBlameability(false);
|
// this.updateBlameability(false);
|
||||||
|
|
||||||
|
// TODO: Rework this once https://github.com/Microsoft/vscode/issues/27231 is released in v1.13
|
||||||
// We have to defer because isDirty is not reliable inside this event
|
// We have to defer because isDirty is not reliable inside this event
|
||||||
setTimeout(() => this._updateBlameability(!e.document.isDirty), 1);
|
setTimeout(() => this._updateBlameability(!e.document.isDirty), 1);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
import { Functions, Iterables, Strings } from './system';
|
import { Functions, Iterables } from './system';
|
||||||
import { CancellationToken, CodeLens, CodeLensProvider, Command, commands, DocumentSelector, Event, EventEmitter, ExtensionContext, Position, Range, SymbolInformation, SymbolKind, TextDocument, Uri, workspace } from 'vscode';
|
import { CancellationToken, CodeLens, CodeLensProvider, Command, commands, DocumentSelector, Event, EventEmitter, ExtensionContext, Position, Range, SymbolInformation, SymbolKind, TextDocument, Uri, workspace } from 'vscode';
|
||||||
import { Commands, DiffWithPreviousCommandArgs, ShowBlameHistoryCommandArgs, ShowFileHistoryCommandArgs, ShowQuickCommitDetailsCommandArgs, ShowQuickCommitFileDetailsCommandArgs, ShowQuickFileHistoryCommandArgs } from './commands';
|
import { Commands, DiffWithPreviousCommandArgs, ShowBlameHistoryCommandArgs, ShowFileHistoryCommandArgs, ShowQuickCommitDetailsCommandArgs, ShowQuickCommitFileDetailsCommandArgs, ShowQuickFileHistoryCommandArgs } from './commands';
|
||||||
import { BuiltInCommands, DocumentSchemes, ExtensionKey } from './constants';
|
import { BuiltInCommands, DocumentSchemes, ExtensionKey } from './constants';
|
||||||
@@ -184,17 +184,8 @@ export class GitCodeLensProvider implements CodeLensProvider {
|
|||||||
// Make sure there is only 1 lens per line
|
// Make sure there is only 1 lens per line
|
||||||
if (lenses.length && lenses[lenses.length - 1].range.start.line === line.lineNumber) return;
|
if (lenses.length && lenses[lenses.length - 1].range.start.line === line.lineNumber) return;
|
||||||
|
|
||||||
let startChar = -1;
|
// Anchor the code lens to the end of the line -- so they are somewhat consistenly placed
|
||||||
try {
|
let startChar = line.range.end.character - 1;
|
||||||
startChar = line.text.search(`\\b${Strings.escapeRegExp(symbol.name)}\\b`);
|
|
||||||
}
|
|
||||||
catch (ex) { }
|
|
||||||
if (startChar === -1) {
|
|
||||||
startChar = line.firstNonWhitespaceCharacterIndex;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
startChar += Math.floor(symbol.name.length / 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
let blameForRangeFn: (() => IGitBlameLines | undefined) | undefined = undefined;
|
let blameForRangeFn: (() => IGitBlameLines | undefined) | undefined = undefined;
|
||||||
if (this._documentIsDirty || this._config.codeLens.recentChange.enabled) {
|
if (this._documentIsDirty || this._config.codeLens.recentChange.enabled) {
|
||||||
|
|||||||
@@ -214,6 +214,7 @@ export class GitService extends Disposable {
|
|||||||
if (!this.UseCaching) return;
|
if (!this.UseCaching) return;
|
||||||
if (e.document.uri.scheme !== DocumentSchemes.File) return;
|
if (e.document.uri.scheme !== DocumentSchemes.File) return;
|
||||||
|
|
||||||
|
// TODO: Rework this once https://github.com/Microsoft/vscode/issues/27231 is released in v1.13
|
||||||
// We have to defer because isDirty is not reliable inside this event
|
// We have to defer because isDirty is not reliable inside this event
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
// If the document is dirty all is fine, we'll just wait for the save before clearing our cache
|
// If the document is dirty all is fine, we'll just wait for the save before clearing our cache
|
||||||
|
|||||||
Reference in New Issue
Block a user