3 Commits

Author SHA1 Message Date
Eric Amodio
6b9fc3f9d2 Preps v4.0.0-alpha.2 2017-06-05 19:05:20 -04:00
Eric Amodio
5af70fd2bf Adds welcome message for first-time users 2017-06-05 19:04:29 -04:00
Eric Amodio
cecd3524b8 Major refactor/rework -- many new features and breaking changes
Adds all-new, beautiful, highly customizable and themeable, file blame annotations
Adds all-new configurability and themeability to the current line blame annotations
Adds all-new configurability to the status bar blame information
Adds all-new configurability over which commands are added to which menus via the `gitlens.advanced.menus` setting
Adds better configurability over where Git code lens will be shown -- both by default and per language
Adds an all-new `changes` (diff) hover annotation to the current line - provides instant access to the line's previous version
Adds `Toggle Line Blame Annotations` command (`gitlens.toggleLineBlame`) - toggles the current line blame annotations on and off
Adds `Show Line Blame Annotations` command (`gitlens.showLineBlame`) - shows the current line blame annotations
Adds `Toggle File Blame Annotations` command (`gitlens.toggleFileBlame`) - toggles the file blame annotations on and off
Adds `Show File Blame Annotations` command (`gitlens.showFileBlame`) - shows the file blame annotations
Adds `Open File in Remote` command (`gitlens.openFileInRemote`) to the `editor/title` context menu
Adds `Open Repo in Remote` command (`gitlens.openRepoInRemote`) to the `editor/title` context menu
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
Removes the on-demand `trailing` file blame annotations -- didn't work out and just ended up with a ton of visual noise
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`)
2017-06-05 19:04:18 -04:00
21 changed files with 609 additions and 811 deletions

View File

@@ -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-beta.2] - 2017-06-07 ## [4.0.0-alpha.2] - 2017-06-05
### 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)
@@ -21,13 +21,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
- Adds `Show File Blame Annotations` command (`gitlens.showFileBlame`) - shows the file blame annotations - Adds `Show File Blame Annotations` command (`gitlens.showFileBlame`) - shows the file blame annotations
- Adds `Open File in Remote` command (`gitlens.openFileInRemote`) to the `editor/title` context menu - Adds `Open File in Remote` command (`gitlens.openFileInRemote`) to the `editor/title` context menu
- Adds `Open Repo in Remote` command (`gitlens.openRepoInRemote`) to the `editor/title` context menu - Adds `Open Repo in Remote` command (`gitlens.openRepoInRemote`) to the `editor/title` context menu
- Adds `gitlens.strings.*` settings to allow for the customization of certain strings displayed
- Adds `gitlens.theme.*` settings to allow for the theming of certain elements
- Adds `gitlens.advanced.telemetry.enabled` settings to explicitly opt-in or out of telemetry, but still ultimately honors the `telemetry.enableTelemetry` setting
### 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
@@ -36,14 +32,6 @@ 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
- Fixes issues with the zone.js monkey patching done by application insights (telemetry) - disables all the monkey patching
## [3.6.1] - 2017-06-07
### Fixed
- Fixes issues with the zone.js monkey patching done by application insights (telemetry) - disables all the monkey patching
## [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

View File

@@ -11,34 +11,26 @@ 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
![GitLens preview 1](https://raw.githubusercontent.com/eamodio/vscode-git-codelens/develop/images/gitlens-preview1.gif) ![GitLens preview 1](https://raw.githubusercontent.com/eamodio/vscode-git-codelens/master/images/gitlens-preview1.gif)
#### 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
![GitLens preview 2](https://raw.githubusercontent.com/eamodio/vscode-git-codelens/develop/images/gitlens-preview2.gif) ![GitLens preview 2](https://raw.githubusercontent.com/eamodio/vscode-git-codelens/master/images/gitlens-preview2.gif)
## 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)
![Line Blame Annotation](https://raw.githubusercontent.com/eamodio/vscode-git-codelens/develop/images/screenshot-line-blame-annotation.png)
- 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)
![Line Blame Annotations](https://raw.githubusercontent.com/eamodio/vscode-git-codelens/develop/images/screenshot-line-blame-annotations.png)
- 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
![File Blame Annotation](https://raw.githubusercontent.com/eamodio/vscode-git-codelens/develop/images/screenshot-file-blame-annotations.png)
- 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)
![Status Bar Blame](https://raw.githubusercontent.com/eamodio/vscode-git-codelens/develop/images/screenshot-status-bar.png)
- 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
@@ -60,8 +52,6 @@ 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)
![Git Code Lens](https://raw.githubusercontent.com/eamodio/vscode-git-codelens/develop/images/screenshot-code-lens.png)
- **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)
@@ -221,14 +211,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<br />`gutter` - adds an annotation to the beginning of each line<br />`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. `gutter` - adds an annotation to the beginning of each line. `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<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.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.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.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.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.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.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<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.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.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
@@ -239,9 +229,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<br />`trailing` - adds an annotation to the end of the current line<br />`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. `trailing` - adds an annotation to the end of the current line. `hover` - shows annotations when hovering over the current line
|`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.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.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.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.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
@@ -254,10 +244,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<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.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.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<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.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.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.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.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
@@ -266,18 +256,11 @@ 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<br />`left` - align to the left, `right` - align to the right |`gitlens.statusBar.alignment`|Specifies the blame alignment in the status bar. `left` - align to the left, `right` - align to the right
|`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.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.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.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.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.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. See https://momentjs.com/docs/#/displaying/format/ for valid formats
### Strings Settings
|Name | Description
|-----|------------
|`gitlens.strings.codeLens.unsavedChanges.recentChangeAndAuthors`|Specifies the string to be shown in place of both the `recent change` and `authors` code lens when there are unsaved changes
|`gitlens.strings.codeLens.unsavedChanges.recentChangeOnly`|Specifies the string to be shown in place of the `recent change` code lens when there are unsaved changes
|`gitlens.strings.codeLens.unsavedChanges.authorsOnly`|Specifies the string to be shown in place of the `authors` code lens when there are unsaved changes
### Theme Settings ### Theme Settings
@@ -305,7 +288,6 @@ GitLens is highly customizable and provides many configuration settings to allow
|Name | Description |Name | Description
|-----|------------ |-----|------------
|`gitlens.advanced.toggleWhitespace.enabled`|Specifies whether or not to toggle whitespace off then showing blame annotations (*may* be required by certain fonts/themes) |`gitlens.advanced.toggleWhitespace.enabled`|Specifies whether or not to toggle whitespace off then showing blame annotations (*may* be required by certain fonts/themes)
|`gitlens.advanced.telemetry.enabled`|Specifies whether or not to enable GitLens telemetry (even if enabled still abides by the overall `telemetry.enableTelemetry` setting
|`gitlens.advanced.menus`|Specifies which commands will be added to which menus |`gitlens.advanced.menus`|Specifies which commands will be added to which menus
|`gitlens.advanced.caching.enabled`|Specifies whether git output will be cached |`gitlens.advanced.caching.enabled`|Specifies whether git output will be cached
|`gitlens.advanced.caching.maxLines`|Specifies the threshold for caching larger documents |`gitlens.advanced.caching.maxLines`|Specifies the threshold for caching larger documents

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

20
package-lock.json generated
View File

@@ -1,8 +1,14 @@
{ {
"name": "gitlens", "name": "gitlens",
"version": "4.0.0-beta.2", "version": "4.0.0-alpha.2",
"lockfileVersion": 1, "lockfileVersion": 1,
"dependencies": { "dependencies": {
"@types/applicationinsights": {
"version": "0.15.33",
"resolved": "https://registry.npmjs.org/@types/applicationinsights/-/applicationinsights-0.15.33.tgz",
"integrity": "sha1-yohXeRuaxSzlKplCXksJrRfrlwg=",
"dev": true
},
"@types/copy-paste": { "@types/copy-paste": {
"version": "1.1.30", "version": "1.1.30",
"resolved": "https://registry.npmjs.org/@types/copy-paste/-/copy-paste-1.1.30.tgz", "resolved": "https://registry.npmjs.org/@types/copy-paste/-/copy-paste-1.1.30.tgz",
@@ -22,9 +28,9 @@
"dev": true "dev": true
}, },
"@types/node": { "@types/node": {
"version": "7.0.28", "version": "7.0.27",
"resolved": "https://registry.npmjs.org/@types/node/-/node-7.0.28.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-7.0.27.tgz",
"integrity": "sha512-9rLhvgupMpC7Yh24yB8zj+4L6SZ9BYUwqknEC8+R7gqCg3KL65UHg7yu9X6J8mSmmtVr1Hbey564yZ3C9nXqtQ==", "integrity": "sha512-2QMiuVOEye2yKmMwE1V96C9HSShmT0WSm6dv2WjacvePEjQNNJGAerTO5hdYhj5lpdK5MW+FVxmyzDhr4omIdw==",
"dev": true "dev": true
}, },
"@types/tmp": { "@types/tmp": {
@@ -1778,9 +1784,9 @@
"dev": true "dev": true
}, },
"tslint": { "tslint": {
"version": "5.4.3", "version": "5.4.2",
"resolved": "https://registry.npmjs.org/tslint/-/tslint-5.4.3.tgz", "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.4.2.tgz",
"integrity": "sha1-dhyEArgONHt3M6BDkKdXslNYBGc=", "integrity": "sha1-YJtmQMwEJPSjlamt9ow3VWPFScc=",
"dev": true "dev": true
}, },
"tsutils": { "tsutils": {

View File

@@ -1,6 +1,6 @@
{ {
"name": "gitlens", "name": "gitlens",
"version": "4.0.0-beta.2", "version": "4.0.0-alpha.2",
"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\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" "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"
}, },
"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\nSee https://momentjs.com/docs/#/displaying/format/ for valid formats" "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"
}, },
"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\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" "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"
}, },
"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\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" "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"
}, },
"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\nSee https://momentjs.com/docs/#/displaying/format/ for valid formats" "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"
}, },
"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\n `gutter` - adds an annotation to the beginning of each line\n `hover` - shows annotations when hovering over each line" "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"
}, },
"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\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)" "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)"
}, },
"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\n `trailing` - adds an annotation to the end of the current line\n `hover` - shows annotations when hovering over the current line" "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"
}, },
"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\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" "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"
}, },
"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\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" "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"
}, },
"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\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`" "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`"
}, },
"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\nMust be a member of `SymbolKind`" "description": "Specifies the set of document symbols where Git code lens will be shown in the document. Must 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\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`" "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`"
}, },
"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\nMust 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. Must be a member of `SymbolKind`"
} }
} }
}, },
@@ -379,7 +379,7 @@
"left", "left",
"right" "right"
], ],
"description": "Specifies the blame alignment in the status bar\n `left` - align to the left\n `right` - align to the right" "description": "Specifies the blame alignment in the status bar. `left` - align to the left, `right` - align to the right"
}, },
"gitlens.statusBar.command": { "gitlens.statusBar.command": {
"type": "string", "type": "string",
@@ -396,33 +396,18 @@
"gitlens.showQuickFileHistory", "gitlens.showQuickFileHistory",
"gitlens.showQuickRepoHistory" "gitlens.showQuickRepoHistory"
], ],
"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" "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"
}, },
"gitlens.statusBar.format": { "gitlens.statusBar.format": {
"type": "string", "type": "string",
"default": "${authorAgo}", "default": "${authorAgo}",
"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" "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"
}, },
"gitlens.statusBar.dateFormat": { "gitlens.statusBar.dateFormat": {
"type": "string", "type": "string",
"default": null, "default": null,
"description": "Specifies the date format of absolute dates shown in the blame information on the status bar. See https://momentjs.com/docs/#/displaying/format/ for valid formats" "description": "Specifies the date format of absolute dates shown in the blame information on the status bar. See https://momentjs.com/docs/#/displaying/format/ for valid formats"
}, },
"gitlens.strings.codeLens.unsavedChanges.recentChangeAndAuthors": {
"type": "string",
"default": "Cannot determine recent change or authors (unsaved changes)",
"description": "Specifies the string to be shown in place of both the `recent change` and `authors` code lens when there are unsaved changes"
},
"gitlens.strings.codeLens.unsavedChanges.recentChangeOnly": {
"type": "string",
"default": "Cannot determine recent change (unsaved changes)",
"description": "Specifies the string to be shown in place of the `recent change` code lens when there are unsaved changes"
},
"gitlens.strings.codeLens.unsavedChanges.authorsOnly": {
"type": "string",
"default": "Cannot determine authors (unsaved changes)",
"description": "Specifies the string to be shown in place of the `authors` code lens when there are unsaved changes"
},
"gitlens.theme.annotations.file.gutter.separateLines": { "gitlens.theme.annotations.file.gutter.separateLines": {
"type": "boolean", "type": "boolean",
"default": true, "default": true,
@@ -531,10 +516,14 @@
"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,
@@ -544,7 +533,6 @@
"blame": true, "blame": true,
"fileDiff": true, "fileDiff": true,
"history": true, "history": true,
"remote": true,
"status": true "status": true
}, },
"editorTitleContext": { "editorTitleContext": {
@@ -552,21 +540,37 @@
"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,
@@ -609,7 +613,6 @@
"blame": true, "blame": true,
"fileDiff": true, "fileDiff": true,
"history": true, "history": true,
"remote": true,
"status": true "status": true
}, },
"properties": { "properties": {
@@ -625,10 +628,6 @@
"type": "boolean", "type": "boolean",
"default": true "default": true
}, },
"remote": {
"type": "boolean",
"default": true
},
"status": { "status": {
"type": "boolean", "type": "boolean",
"default": true "default": true
@@ -661,28 +660,6 @@
"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
}
}
} }
} }
}, },
@@ -691,11 +668,6 @@
"default": true, "default": true,
"description": "Specifies whether or not to close the QuickPick menu when focus is lost" "description": "Specifies whether or not to close the QuickPick menu when focus is lost"
}, },
"gitlens.advanced.telemetry.enabled": {
"type": "boolean",
"default": true,
"description": "Specifies whether or not to enable GitLens telemetry (even if enabled still abides by the overall `telemetry.enableTelemetry` setting"
},
"gitlens.advanced.toggleWhitespace.enabled": { "gitlens.advanced.toggleWhitespace.enabled": {
"type": "boolean", "type": "boolean",
"default": false, "default": false,
@@ -1005,56 +977,26 @@
"when": "gitlens:enabled" "when": "gitlens:enabled"
} }
], ],
"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"
} }
], ],
"editor/title": [ "editor/title": [
@@ -1126,26 +1068,56 @@
"group": "1_gitlens_2@2" "group": "1_gitlens_2@2"
} }
], ],
"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"
} }
] ]
}, },
@@ -1262,7 +1234,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 --no-save && npm run compile" "vscode:prepublish": "npm install && npm run compile"
}, },
"dependencies": { "dependencies": {
"applicationinsights": "0.20.1", "applicationinsights": "0.20.1",
@@ -1278,13 +1250,14 @@
"tmp": "0.0.31" "tmp": "0.0.31"
}, },
"devDependencies": { "devDependencies": {
"@types/applicationinsights": "0.15.33",
"@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.28", "@types/node": "7.0.27",
"@types/tmp": "0.0.33", "@types/tmp": "0.0.33",
"mocha": "3.4.2", "mocha": "3.4.2",
"tslint": "5.4.3", "tslint": "5.4.2",
"typescript": "2.3.4", "typescript": "2.3.4",
"vscode": "1.1.0" "vscode": "1.1.0"
} }

View File

@@ -16,9 +16,9 @@ interface AutoCollectConsole {
} }
interface AutoCollectExceptions { interface AutoCollectExceptions {
constructor(client: Client): AutoCollectExceptions; constructor(client:Client): AutoCollectExceptions;
isInitialized(): boolean; isInitialized(): boolean;
enable(isEnabled: boolean): void; enable(isEnabled:boolean): void;
} }
interface AutoCollectPerformance { interface AutoCollectPerformance {
@@ -348,7 +348,7 @@ interface Client {
* @param max the max sample for this set * @param max the max sample for this set
* @param stdDev the standard deviation of the set * @param stdDev the standard deviation of the set
*/ */
trackMetric(name: string, value: number, count?: number, min?: number, max?: number, stdDev?: number, properties?: { trackMetric(name: string, value: number, count?:number, min?: number, max?: number, stdDev?: number, properties?: {
[key: string]: string; [key: string]: string;
}): void; }): void;
@@ -374,8 +374,7 @@ interface Client {
* @param error An error that was returned for this request if it was unsuccessful. Defaults to null. * @param error An error that was returned for this request if it was unsuccessful. Defaults to null.
*/ */
trackRequestSync(request: any /*http.IncomingMessage */, response: any /*http.ServerResponse */, ellapsedMilliseconds?: number, properties?: { trackRequestSync(request: any /*http.IncomingMessage */, response: any /*http.ServerResponse */, ellapsedMilliseconds?: number, properties?: {
[key: string]: string; [key: string]: string;}, error?: any) : void;
}, error?: any): void;
/** /**
* Log information about a dependency of your app. Typically used to track the time database calls or outgoing http requests take from your server. * Log information about a dependency of your app. Typically used to track the time database calls or outgoing http requests take from your server.
@@ -504,11 +503,6 @@ interface ApplicationInsights {
* *
*/ */
setOfflineMode(value: boolean, resentIntervall?: number): ApplicationInsights; setOfflineMode(value: boolean, resentIntervall?: number): ApplicationInsights;
/**
*
*/
setAutoDependencyCorrelation(value: boolean): ApplicationInsights;
} }
declare module "applicationinsights" { declare module "applicationinsights" {

View File

@@ -12,8 +12,7 @@ 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
}; };
@@ -234,7 +233,6 @@ 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

View File

@@ -77,7 +77,8 @@ export class Annotations {
before: { before: {
...renderOptions.before, ...renderOptions.before,
...{ ...{
contentText: content contentText: content,
margin: '0 26px 0 0'
} }
}, },
dark: { dark: {
@@ -112,9 +113,7 @@ 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,
@@ -124,7 +123,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 {
@@ -143,8 +142,7 @@ 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;
} }

View File

@@ -98,9 +98,6 @@ export interface IAdvancedConfig {
quickPick: { quickPick: {
closeOnFocusOut: boolean; closeOnFocusOut: boolean;
}; };
telemetry: {
enabled: boolean;
};
toggleWhitespace: { toggleWhitespace: {
enabled: boolean; enabled: boolean;
}; };
@@ -287,16 +284,6 @@ export interface IConfig {
dateFormat: string; dateFormat: string;
}; };
strings: {
codeLens: {
unsavedChanges: {
recentChangeAndAuthors: string;
recentChangeOnly: string;
authorsOnly: string;
};
};
};
theme: IThemeConfig; theme: IThemeConfig;
debug: boolean; debug: boolean;

View File

@@ -1,441 +1,437 @@
'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 3em', margin: '0 0 0 4em'
textDecoration: 'none' }
} } as DecorationRenderOptions);
} as DecorationRenderOptions);
export class CurrentLineController extends Disposable {
export class CurrentLineController extends Disposable {
private _activeEditorLineDisposable: Disposable | undefined;
private _activeEditorLineDisposable: Disposable | undefined; private _blameable: boolean;
private _blameable: boolean; private _config: IConfig;
private _config: IConfig; private _currentLine: number = -1;
private _currentLine: number = -1; private _disposable: Disposable;
private _disposable: Disposable; private _editor: TextEditor | undefined;
private _editor: TextEditor | undefined; private _statusBarItem: StatusBarItem | undefined;
private _isAnnotating: boolean = false; private _updateBlameDebounced: (line: number, editor: TextEditor) => Promise<void>;
private _statusBarItem: StatusBarItem | undefined; private _uri: GitUri;
private _updateBlameDebounced: (line: number, editor: TextEditor) => Promise<void>;
private _uri: GitUri; constructor(context: ExtensionContext, private git: GitService, private gitContextTracker: GitContextTracker, private annotationController: AnnotationController) {
super(() => this.dispose());
constructor(context: ExtensionContext, private git: GitService, private gitContextTracker: GitContextTracker, private annotationController: AnnotationController) {
super(() => this.dispose()); this._updateBlameDebounced = Functions.debounce(this._updateBlame, 250);
this._updateBlameDebounced = Functions.debounce(this._updateBlame, 250); this._onConfigurationChanged();
this._onConfigurationChanged(); const subscriptions: Disposable[] = [];
const subscriptions: Disposable[] = []; subscriptions.push(workspace.onDidChangeConfiguration(this._onConfigurationChanged, this));
subscriptions.push(git.onDidChangeGitCache(this._onGitCacheChanged, this));
subscriptions.push(workspace.onDidChangeConfiguration(this._onConfigurationChanged, this)); subscriptions.push(annotationController.onDidToggleAnnotations(this._onAnnotationsToggled, this));
subscriptions.push(git.onDidChangeGitCache(this._onGitCacheChanged, this));
subscriptions.push(annotationController.onDidToggleAnnotations(this._onAnnotationsToggled, this)); this._disposable = Disposable.from(...subscriptions);
}
this._disposable = Disposable.from(...subscriptions);
} dispose() {
this._editor && this._editor.setDecorations(annotationDecoration, []);
dispose() {
this._clearAnnotations(this._editor, true); this._activeEditorLineDisposable && this._activeEditorLineDisposable.dispose();
this._statusBarItem && this._statusBarItem.dispose();
this._activeEditorLineDisposable && this._activeEditorLineDisposable.dispose(); this._disposable && this._disposable.dispose();
this._statusBarItem && this._statusBarItem.dispose(); }
this._disposable && this._disposable.dispose();
} private _onConfigurationChanged() {
const cfg = workspace.getConfiguration().get<IConfig>(ExtensionKey)!;
private _onConfigurationChanged() {
const cfg = workspace.getConfiguration().get<IConfig>(ExtensionKey)!; let changed = false;
let changed = false; if (!Objects.areEquivalent(cfg.blame.line, this._config && this._config.blame.line) ||
!Objects.areEquivalent(cfg.annotations.line.trailing, this._config && this._config.annotations.line.trailing) ||
if (!Objects.areEquivalent(cfg.blame.line, this._config && this._config.blame.line) || !Objects.areEquivalent(cfg.annotations.line.hover, this._config && this._config.annotations.line.hover) ||
!Objects.areEquivalent(cfg.annotations.line.trailing, this._config && this._config.annotations.line.trailing) || !Objects.areEquivalent(cfg.theme.annotations.line.trailing, this._config && this._config.theme.annotations.line.trailing)) {
!Objects.areEquivalent(cfg.annotations.line.hover, this._config && this._config.annotations.line.hover) || changed = true;
!Objects.areEquivalent(cfg.theme.annotations.line.trailing, this._config && this._config.theme.annotations.line.trailing)) { if (this._editor) {
changed = true; this._editor.setDecorations(annotationDecoration, []);
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;
if (editor === undefined || !this.isEditorBlameable(editor)) { previousEditor && previousEditor.setDecorations(annotationDecoration, []);
this.clear(editor);
this._editor = undefined; if (editor === undefined || !this.isEditorBlameable(editor)) {
this.clear(editor);
return;
} this._editor = undefined;
this._blameable = editor !== undefined && editor.document !== undefined && !editor.document.isDirty; return;
this._editor = editor; }
this._uri = await GitUri.fromUri(editor.document.uri, this.git);
this._blameable = editor !== undefined && editor.document !== undefined && !editor.document.isDirty;
const maxLines = this._config.advanced.caching.maxLines; this._editor = editor;
// If caching is on and the file is small enough -- kick off a blame for the whole file this._uri = await GitUri.fromUri(editor.document.uri, this.git);
if (this._config.advanced.caching.enabled && (maxLines <= 0 || editor.document.lineCount <= maxLines)) {
this.git.getBlameForFile(this._uri); const maxLines = this._config.advanced.caching.maxLines;
} // 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._updateBlameDebounced(editor.selection.active.line, editor); this.git.getBlameForFile(this._uri);
} }
private _onBlameabilityChanged(e: BlameabilityChangeEvent) { this._updateBlameDebounced(editor.selection.active.line, editor);
this._blameable = e.blameable; }
if (!e.blameable || !this._editor) {
this.clear(e.editor); private _onBlameabilityChanged(e: BlameabilityChangeEvent) {
return; this._blameable = e.blameable;
} if (!e.blameable || !this._editor) {
this.clear(e.editor);
// Make sure this is for the editor we are tracking return;
if (!TextEditorComparer.equals(this._editor, e.editor)) return; }
this._updateBlameDebounced(this._editor.selection.active.line, this._editor); // Make sure this is for the editor we are tracking
} if (!TextEditorComparer.equals(this._editor, e.editor)) return;
private _onAnnotationsToggled() { this._updateBlameDebounced(this._editor.selection.active.line, this._editor);
this._onActiveTextEditorChanged(window.activeTextEditor); }
}
private _onAnnotationsToggled() {
private _onGitCacheChanged() { this._onActiveTextEditorChanged(window.activeTextEditor);
this._onActiveTextEditorChanged(window.activeTextEditor); }
}
private _onGitCacheChanged() {
private async _onTextEditorSelectionChanged(e: TextEditorSelectionChangeEvent): Promise<void> { this._onActiveTextEditorChanged(window.activeTextEditor);
// 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> {
const line = e.selections[0].active.line; // Make sure this is for the editor we are tracking
if (line === this._currentLine) return; if (!this._blameable || !TextEditorComparer.equals(this._editor, e.textEditor)) return;
this._currentLine = line; const line = e.selections[0].active.line;
if (line === this._currentLine) return;
if (!this._uri && e.textEditor !== undefined) { this._currentLine = line;
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) {
line = line - this._uri.offset; private async _updateBlame(line: number, editor: TextEditor) {
line = line - this._uri.offset;
let commit: GitCommit | undefined = undefined;
let commitLine: IGitCommitLine | undefined = undefined; let commit: GitCommit | undefined = undefined;
// Since blame information isn't valid when there are unsaved changes -- don't show any status let commitLine: IGitCommitLine | undefined = undefined;
if (this._blameable && line >= 0) { // Since blame information isn't valid when there are unsaved changes -- don't show any status
const blameLine = await this.git.getBlameForLine(this._uri, line); if (this._blameable && line >= 0) {
commitLine = blameLine === undefined ? undefined : blameLine.line; const blameLine = await this.git.getBlameForLine(this._uri, line);
commit = blameLine === undefined ? undefined : blameLine.commit; commitLine = blameLine === undefined ? undefined : blameLine.line;
} commit = blameLine === undefined ? undefined : blameLine.commit;
}
if (commit !== undefined && commitLine !== undefined) {
this.show(commit, commitLine, editor); if (commit !== undefined && commitLine !== undefined) {
} this.show(commit, commitLine, editor);
else { }
this.clear(editor); else {
} this.clear(editor);
} }
}
async clear(editor: TextEditor | undefined) {
this._clearAnnotations(editor, true); async clear(editor: TextEditor | undefined, previousEditor?: TextEditor) {
this._statusBarItem && this._statusBarItem.hide(); this._clearAnnotations(editor, previousEditor);
} this._statusBarItem && this._statusBarItem.hide();
}
private async _clearAnnotations(editor: TextEditor | undefined, force: boolean = false) {
if (editor === undefined || (!this._isAnnotating && !force)) return; private async _clearAnnotations(editor: TextEditor | undefined, previousEditor?: TextEditor) {
editor && editor.setDecorations(annotationDecoration, []);
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
this._isAnnotating = false; if (editor !== undefined) {
await Functions.wait(1);
if (!force) return; 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 }
await Functions.wait(1);
editor.setDecorations(annotationDecoration, []); async show(commit: GitCommit, blameLine: IGitCommitLine, editor: TextEditor) {
} // 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) {
// I have no idea why I need this protection -- but it happens this._updateStatusBar(commit);
if (editor.document === undefined) return; await this._updateAnnotations(commit, blameLine, editor);
}
this._updateStatusBar(commit);
await this._updateAnnotations(commit, blameLine, editor); async showAnnotations(editor: TextEditor, type: LineAnnotationType) {
} if (editor === undefined) return;
async showAnnotations(editor: TextEditor, type: LineAnnotationType) { const cfg = this._config.blame.line;
if (editor === undefined) return; if (!cfg.enabled || cfg.annotationType !== type) {
cfg.enabled = true;
const cfg = this._config.blame.line; cfg.annotationType = type;
if (!cfg.enabled || cfg.annotationType !== type) {
cfg.enabled = true; await this._clearAnnotations(editor);
cfg.annotationType = type; await this._updateBlame(editor.selection.active.line, editor);
}
await this._clearAnnotations(editor); }
await this._updateBlame(editor.selection.active.line, editor);
} async toggleAnnotations(editor: TextEditor, type: LineAnnotationType) {
} if (editor === undefined) return;
async toggleAnnotations(editor: TextEditor, type: LineAnnotationType) { const cfg = this._config.blame.line;
if (editor === undefined) return; cfg.enabled = !cfg.enabled;
cfg.annotationType = type;
const cfg = this._config.blame.line;
cfg.enabled = !cfg.enabled; await this._clearAnnotations(editor);
cfg.annotationType = type; await this._updateBlame(editor.selection.active.line, editor);
}
await this._clearAnnotations(editor);
await this._updateBlame(editor.selection.active.line, editor); private async _updateAnnotations(commit: GitCommit, blameLine: IGitCommitLine, editor: TextEditor) {
} const cfg = this._config.blame.line;
if (!cfg.enabled) return;
private async _updateAnnotations(commit: GitCommit, blameLine: IGitCommitLine, editor: TextEditor) {
const cfg = this._config.blame.line; const line = blameLine.line + this._uri.offset;
if (!cfg.enabled) return;
const decorationOptions: DecorationOptions[] = [];
const line = blameLine.line + this._uri.offset;
let showChanges = false;
const decorationOptions: DecorationOptions[] = []; let showChangesStartIndex = 0;
let showChangesInStartingWhitespace = false;
let showChanges = false;
let showChangesStartIndex = 0; let showDetails = false;
let showChangesInStartingWhitespace = false; let showDetailsStartIndex = 0;
let showDetailsInStartingWhitespace = false;
let showDetails = false;
let showDetailsStartIndex = 0; switch (cfg.annotationType) {
let showDetailsInStartingWhitespace = false; case LineAnnotationType.Trailing: {
const cfgAnnotations = this._config.annotations.line.trailing;
switch (cfg.annotationType) {
case LineAnnotationType.Trailing: { showChanges = cfgAnnotations.hover.changes;
const cfgAnnotations = this._config.annotations.line.trailing; showDetails = cfgAnnotations.hover.details;
showChanges = cfgAnnotations.hover.changes; if (cfgAnnotations.hover.wholeLine) {
showDetails = cfgAnnotations.hover.details; showChangesStartIndex = 0;
showChangesInStartingWhitespace = false;
if (cfgAnnotations.hover.wholeLine) {
showChangesStartIndex = 0; showDetailsStartIndex = 0;
showChangesInStartingWhitespace = false; showDetailsInStartingWhitespace = false;
}
showDetailsStartIndex = 0; else {
showDetailsInStartingWhitespace = false; showChangesStartIndex = endOfLineIndex;
} showChangesInStartingWhitespace = true;
else {
showChangesStartIndex = endOfLineIndex; showDetailsStartIndex = endOfLineIndex;
showChangesInStartingWhitespace = true; showDetailsInStartingWhitespace = true;
}
showDetailsStartIndex = endOfLineIndex;
showDetailsInStartingWhitespace = true; const decoration = Annotations.trailing(commit, cfgAnnotations.format, cfgAnnotations.dateFormat, this._config.theme);
} 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);
decoration.range = editor.document.validateRange(new Range(line, endOfLineIndex, line, endOfLineIndex)); break;
decorationOptions.push(decoration); }
case LineAnnotationType.Hover: {
break; const cfgAnnotations = this._config.annotations.line.hover;
}
case LineAnnotationType.Hover: { showChanges = cfgAnnotations.changes;
const cfgAnnotations = this._config.annotations.line.hover; showChangesStartIndex = 0;
showChangesInStartingWhitespace = false;
showChanges = cfgAnnotations.changes;
showChangesStartIndex = 0; showDetails = cfgAnnotations.details;
showChangesInStartingWhitespace = false; showDetailsStartIndex = 0;
showDetailsInStartingWhitespace = false;
showDetails = cfgAnnotations.details;
showDetailsStartIndex = 0; break;
showDetailsInStartingWhitespace = false; }
}
break;
} if (showDetails || showChanges) {
} const annotationType = this.annotationController.getAnnotationType(editor);
if (showDetails || showChanges) { const firstNonWhitespace = editor.document.lineAt(line).firstNonWhitespaceCharacterIndex;
const annotationType = this.annotationController.getAnnotationType(editor);
switch (annotationType) {
const firstNonWhitespace = editor.document.lineAt(line).firstNonWhitespaceCharacterIndex; case FileAnnotationType.Gutter: {
const cfgHover = this._config.annotations.file.gutter.hover;
switch (annotationType) { if (cfgHover.details) {
case FileAnnotationType.Gutter: { showDetailsInStartingWhitespace = false;
const cfgHover = this._config.annotations.file.gutter.hover; if (cfgHover.wholeLine) {
if (cfgHover.details) { // Avoid double annotations if we are showing the whole-file hover blame annotations
showDetailsInStartingWhitespace = false; showDetails = false;
if (cfgHover.wholeLine) { }
// Avoid double annotations if we are showing the whole-file hover blame annotations else {
showDetails = false; if (showDetailsStartIndex === 0) {
} showDetailsStartIndex = firstNonWhitespace === 0 ? 1 : firstNonWhitespace;
else { }
if (showDetailsStartIndex === 0) { if (showChangesStartIndex === 0) {
showDetailsStartIndex = firstNonWhitespace === 0 ? 1 : firstNonWhitespace; showChangesInStartingWhitespace = true;
} showChangesStartIndex = firstNonWhitespace === 0 ? 1 : firstNonWhitespace;
if (showChangesStartIndex === 0) { }
showChangesInStartingWhitespace = true; }
showChangesStartIndex = firstNonWhitespace === 0 ? 1 : firstNonWhitespace; }
}
} break;
} }
case FileAnnotationType.Hover: {
break; const cfgHover = this._config.annotations.file.hover;
} showDetailsInStartingWhitespace = false;
case FileAnnotationType.Hover: { if (cfgHover.wholeLine) {
const cfgHover = this._config.annotations.file.hover; // Avoid double annotations if we are showing the whole-file hover blame annotations
showDetailsInStartingWhitespace = false; showDetails = false;
if (cfgHover.wholeLine) { showChangesStartIndex = 0;
// Avoid double annotations if we are showing the whole-file hover blame annotations }
showDetails = false; else {
showChangesStartIndex = 0; if (showDetailsStartIndex === 0) {
} showDetailsStartIndex = firstNonWhitespace === 0 ? 1 : firstNonWhitespace;
else { }
if (showDetailsStartIndex === 0) { if (showChangesStartIndex === 0) {
showDetailsStartIndex = firstNonWhitespace === 0 ? 1 : firstNonWhitespace; showChangesInStartingWhitespace = true;
} 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 (showDetails) { if (!commit.isUncommitted) {
// Get the full commit message -- since blame only returns the summary logCommit = await this.git.getLogCommit(this._uri.repoPath, this._uri.fsPath, commit.sha);
let logCommit: GitCommit | undefined = undefined; }
if (!commit.isUncommitted) {
logCommit = await this.git.getLogCommit(this._uri.repoPath, this._uri.fsPath, commit.sha); // I have no idea why I need this protection -- but it happens
} if (editor.document === undefined) return;
// I have no idea why I need this protection -- but it happens const decoration = Annotations.detailsHover(logCommit || commit);
if (editor.document === undefined) return; decoration.range = editor.document.validateRange(new Range(line, showDetailsStartIndex, line, endOfLineIndex));
decorationOptions.push(decoration);
const decoration = Annotations.detailsHover(logCommit || commit);
decoration.range = editor.document.validateRange(new Range(line, showDetailsStartIndex, line, endOfLineIndex)); if (showDetailsInStartingWhitespace && showDetailsStartIndex !== 0) {
decorationOptions.push(decoration); decorationOptions.push(Annotations.withRange(decoration, 0, firstNonWhitespace));
}
if (showDetailsInStartingWhitespace && showDetailsStartIndex !== 0) { }
decorationOptions.push(Annotations.withRange(decoration, 0, firstNonWhitespace));
} if (showChanges) {
} const decoration = await Annotations.changesHover(commit, line, this._uri, this.git);
if (showChanges) { // I have no idea why I need this protection -- but it happens
const decoration = await Annotations.changesHover(commit, line, this._uri, this.git); if (editor.document === undefined) return;
// I have no idea why I need this protection -- but it happens decoration.range = editor.document.validateRange(new Range(line, showChangesStartIndex, line, endOfLineIndex));
if (editor.document === undefined) return; decorationOptions.push(decoration);
decoration.range = editor.document.validateRange(new Range(line, showChangesStartIndex, line, endOfLineIndex)); if (showChangesInStartingWhitespace && showChangesStartIndex !== 0) {
decorationOptions.push(decoration); decorationOptions.push(Annotations.withRange(decoration, 0, firstNonWhitespace));
}
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);
this._isAnnotating = true; private _updateStatusBar(commit: GitCommit) {
} const cfg = this._config.statusBar;
} if (!cfg.enabled || this._statusBarItem === undefined) return;
private _updateStatusBar(commit: GitCommit) { this._statusBarItem.text = `$(git-commit) ${CommitFormatter.fromTemplate(cfg.format, commit, cfg.dateFormat)}`;
const cfg = this._config.statusBar;
if (!cfg.enabled || this._statusBarItem === undefined) return; switch (cfg.command) {
case StatusBarCommand.BlameAnnotate:
this._statusBarItem.text = `$(git-commit) ${CommitFormatter.fromTemplate(cfg.format, commit, cfg.dateFormat)}`; this._statusBarItem.tooltip = 'Toggle Blame Annotations';
break;
switch (cfg.command) { case StatusBarCommand.ShowBlameHistory:
case StatusBarCommand.BlameAnnotate: this._statusBarItem.tooltip = 'Open Blame History Explorer';
this._statusBarItem.tooltip = 'Toggle Blame Annotations'; break;
break; case StatusBarCommand.ShowFileHistory:
case StatusBarCommand.ShowBlameHistory: this._statusBarItem.tooltip = 'Open File History Explorer';
this._statusBarItem.tooltip = 'Open Blame History Explorer'; break;
break; case StatusBarCommand.DiffWithPrevious:
case StatusBarCommand.ShowFileHistory: this._statusBarItem.command = Commands.DiffLineWithPrevious;
this._statusBarItem.tooltip = 'Open File History Explorer'; this._statusBarItem.tooltip = 'Compare Line Commit with Previous';
break; break;
case StatusBarCommand.DiffWithPrevious: case StatusBarCommand.DiffWithWorking:
this._statusBarItem.command = Commands.DiffLineWithPrevious; this._statusBarItem.command = Commands.DiffLineWithWorking;
this._statusBarItem.tooltip = 'Compare Line Commit with Previous'; this._statusBarItem.tooltip = 'Compare Line Commit with Working Tree';
break; break;
case StatusBarCommand.DiffWithWorking: case StatusBarCommand.ToggleCodeLens:
this._statusBarItem.command = Commands.DiffLineWithWorking; this._statusBarItem.tooltip = 'Toggle Git CodeLens';
this._statusBarItem.tooltip = 'Compare Line Commit with Working Tree'; break;
break; case StatusBarCommand.ShowQuickCommitDetails:
case StatusBarCommand.ToggleCodeLens: this._statusBarItem.tooltip = 'Show Commit Details';
this._statusBarItem.tooltip = 'Toggle Git CodeLens'; break;
break; case StatusBarCommand.ShowQuickCommitFileDetails:
case StatusBarCommand.ShowQuickCommitDetails: this._statusBarItem.tooltip = 'Show Line Commit Details';
this._statusBarItem.tooltip = 'Show Commit Details'; break;
break; case StatusBarCommand.ShowQuickFileHistory:
case StatusBarCommand.ShowQuickCommitFileDetails: this._statusBarItem.tooltip = 'Show File History';
this._statusBarItem.tooltip = 'Show Line Commit Details'; break;
break; case StatusBarCommand.ShowQuickCurrentBranchHistory:
case StatusBarCommand.ShowQuickFileHistory: this._statusBarItem.tooltip = 'Show Branch History';
this._statusBarItem.tooltip = 'Show File History'; break;
break; }
case StatusBarCommand.ShowQuickCurrentBranchHistory:
this._statusBarItem.tooltip = 'Show Branch History'; this._statusBarItem.show();
break; }
}
this._statusBarItem.show();
}
} }

View File

@@ -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 { BlameLineHighlightLocations, CodeLensLocations, IConfig, LineAnnotationType } from './configuration'; import { IConfig } 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,12 +61,9 @@ 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);
@@ -127,130 +124,6 @@ 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 {
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;
@@ -270,6 +143,8 @@ 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('.');

View File

@@ -134,7 +134,7 @@ export class CommitFormatter {
options = dateFormatOrOptions; options = dateFormatOrOptions;
} }
return Strings.interpolate(template, new CommitFormatter(commit, options)); return Strings.interpolateLazy(template, new CommitFormatter(commit, options));
} }
static toHoverAnnotation(commit: GitCommit, dateFormat: string = 'MMMM Do, YYYY h:MMa'): string | string[] { static toHoverAnnotation(commit: GitCommit, dateFormat: string = 'MMMM Do, YYYY h:MMa'): string | string[] {

View File

@@ -75,7 +75,6 @@ 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);
} }

View File

@@ -1,5 +1,5 @@
'use strict'; 'use strict';
import { Functions, Iterables } from './system'; import { Functions, Iterables, Strings } 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,8 +184,17 @@ 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;
// Anchor the code lens to the end of the line -- so they are somewhat consistenly placed let startChar = -1;
let startChar = line.range.end.character - 1; try {
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) {
@@ -237,13 +246,13 @@ export class GitCodeLensProvider implements CodeLensProvider {
let title: string; let title: string;
if (this._documentIsDirty) { if (this._documentIsDirty) {
if (this._config.codeLens.recentChange.enabled && this._config.codeLens.authors.enabled) { if (this._config.codeLens.recentChange.enabled && this._config.codeLens.authors.enabled) {
title = this._config.strings.codeLens.unsavedChanges.recentChangeAndAuthors; title = 'Cannot determine recent change or authors (unsaved changes)';
} }
else if (this._config.codeLens.recentChange.enabled) { else if (this._config.codeLens.recentChange.enabled) {
title = this._config.strings.codeLens.unsavedChanges.recentChangeOnly; title = 'Cannot determine recent change (unsaved changes)';
} }
else { else {
title = this._config.strings.codeLens.unsavedChanges.authorsOnly; title = 'Cannot determine authors (unsaved changes)';
} }
lens.command = { title: title } as Command; lens.command = { title: title } as Command;
@@ -256,7 +265,7 @@ export class GitCodeLensProvider implements CodeLensProvider {
const recentCommit = Iterables.first(blame.commits.values()); const recentCommit = Iterables.first(blame.commits.values());
title = `${recentCommit.author}, ${moment(recentCommit.date).fromNow()}`; title = `${recentCommit.author}, ${moment(recentCommit.date).fromNow()}`;
if (this._config.codeLens.debug) { if (this._config.codeLens.debug) {
title += ` [${SymbolKind[lens.symbolKind]}(${lens.range.start.character}-${lens.range.end.character}), Lines (${lens.blameRange.start.line + 1}-${lens.blameRange.end.line + 1}), Commit (${recentCommit.shortSha})]`; title += ` [${SymbolKind[lens.symbolKind]}(${lens.blameRange.start.line + 1}-${lens.blameRange.end.line + 1}), Commit (${recentCommit.shortSha})]`;
} }
switch (this._config.codeLens.recentChange.command) { switch (this._config.codeLens.recentChange.command) {
@@ -279,7 +288,7 @@ export class GitCodeLensProvider implements CodeLensProvider {
const count = blame.authors.size; const count = blame.authors.size;
let title = `${count} ${count > 1 ? 'authors' : 'author'} (${Iterables.first(blame.authors.values()).name}${count > 1 ? ' and others' : ''})`; let title = `${count} ${count > 1 ? 'authors' : 'author'} (${Iterables.first(blame.authors.values()).name}${count > 1 ? ' and others' : ''})`;
if (this._config.codeLens.debug) { if (this._config.codeLens.debug) {
title += ` [${SymbolKind[lens.symbolKind]}(${lens.range.start.character}-${lens.range.end.character}), Lines (${lens.blameRange.start.line + 1}-${lens.blameRange.end.line + 1}), Authors (${Iterables.join(Iterables.map(blame.authors.values(), _ => _.name), ', ')})]`; title += ` [${SymbolKind[lens.symbolKind]}(${lens.blameRange.start.line + 1}-${lens.blameRange.end.line + 1}), Authors (${Iterables.join(Iterables.map(blame.authors.values(), _ => _.name), ', ')})]`;
} }
switch (this._config.codeLens.authors.command) { switch (this._config.codeLens.authors.command) {

View File

@@ -214,7 +214,6 @@ 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

View File

@@ -1,4 +1,5 @@
'use strict'; 'use strict';
import { Objects } from './object';
const _escapeRegExp = require('lodash.escaperegexp'); const _escapeRegExp = require('lodash.escaperegexp');
export namespace Strings { export namespace Strings {
@@ -36,11 +37,13 @@ export namespace Strings {
return tokens; return tokens;
} }
export function interpolate(template: string, context: object): string { export function interpolate(template: string, tokens: { [key: string]: any }): string {
if (!template) return template; return new Function(...Object.keys(tokens), `return \`${template}\`;`)(...Objects.values(tokens));
}
template = template.replace(TokenSanitizeRegex, '$${this.$1}'); export function interpolateLazy(template: string, context: object): string {
return new Function(`return \`${template}\`;`).call(context); template = template.replace(TokenSanitizeRegex, '$${c.$1}');
return new Function('c', `return \`${template}\`;`)(context);
} }
export function padLeft(s: string, padTo: number, padding: string = '\u00a0') { export function padLeft(s: string, padTo: number, padding: string = '\u00a0') {

View File

@@ -1,6 +1,5 @@
'use strict'; 'use strict';
import { Disposable, env, version, workspace } from 'vscode'; import { Disposable, env, version, workspace } from 'vscode';
import { ExtensionKey, IConfig } from './configuration';
import * as os from 'os'; import * as os from 'os';
let _reporter: TelemetryReporter; let _reporter: TelemetryReporter;
@@ -8,28 +7,21 @@ let _reporter: TelemetryReporter;
export class Telemetry extends Disposable { export class Telemetry extends Disposable {
static configure(key: string) { static configure(key: string) {
const cfg = workspace.getConfiguration().get<IConfig>(ExtensionKey)!; if (!workspace.getConfiguration('telemetry').get<boolean>('enableTelemetry', true)) return;
if (!cfg.advanced.telemetry.enabled || !workspace.getConfiguration('telemetry').get<boolean>('enableTelemetry', true)) return;
_reporter = new TelemetryReporter(key); _reporter = new TelemetryReporter(key);
} }
static setContext(context?: { [key: string]: string }) { static setContext(context?: { [key: string]: string }) {
if (_reporter === undefined) return; _reporter && _reporter.setContext(context);
_reporter.setContext(context);
} }
static trackEvent(name: string, properties?: { [key: string]: string }, measurements?: { [key: string]: number; }) { static trackEvent(name: string, properties?: { [key: string]: string }, measurements?: { [key: string]: number; }) {
if (_reporter === undefined) return; _reporter && _reporter.trackEvent(name, properties, measurements);
_reporter.trackEvent(name, properties, measurements);
} }
static trackException(ex: Error) { static trackException(ex: Error) {
if (_reporter === undefined) return; _reporter && _reporter.trackException(ex);
_reporter.trackException(ex);
} }
} }
@@ -52,12 +44,11 @@ export class TelemetryReporter {
} }
else { else {
this._client = this.appInsights.setup(key) this._client = this.appInsights.setup(key)
.setAutoCollectRequests(false)
.setAutoCollectPerformance(false)
.setAutoCollectExceptions(false)
.setAutoCollectDependencies(false)
.setAutoCollectConsole(false) .setAutoCollectConsole(false)
.setAutoDependencyCorrelation(false) .setAutoCollectDependencies(false)
.setAutoCollectExceptions(false)
.setAutoCollectPerformance(false)
.setAutoCollectRequests(false)
.setOfflineMode(true) .setOfflineMode(true)
.start() .start()
.client; .client;