14 Commits

Author SHA1 Message Date
Eric Amodio
068b34b781 Adds settings migration support 2017-06-07 00:27:33 -04:00
Eric Amodio
5328e56230 Preps v4.0.0-beta 2017-06-06 17:01:01 -04:00
Eric Amodio
0fb718804e Anchors the code lens to the end of the line 2017-06-06 16:50:06 -04:00
Eric Amodio
516bcf7eef Updates dependencies 2017-06-06 13:29:50 -04:00
Eric Amodio
f9bbc9af0a Attempts to fix #80 - on line with link, annotation gets underlined 2017-06-06 13:29:38 -04:00
Eric Amodio
9cc96d4041 Fixes #81 - Current line annotation is too sticky 2017-06-06 13:27:54 -04:00
Eric Amodio
41785f6872 Adds better formatting of settings 2017-06-06 13:25:36 -04:00
Eric Amodio
f72ea0005c Updates screenshots 2017-06-06 02:45:39 -04:00
Eric Amodio
b3f0d19e48 Adds another screenshot to README 2017-06-06 02:37:40 -04:00
Eric Amodio
60702ff314 Adds vscode issue TODO 2017-06-06 02:29:22 -04:00
Eric Amodio
b72d22032c Adds more screenshots to README 2017-06-06 02:28:40 -04:00
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
11 changed files with 36 additions and 91 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/).
## [4.0.0-beta.2] - 2017-06-07
## [4.0.0-beta] - 2017-06-06
### Added
- 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)
@@ -21,9 +21,6 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
- Adds `Show File Blame Annotations` command (`gitlens.showFileBlame`) - shows the file blame annotations
- Adds `Open File in Remote` command (`gitlens.openFileInRemote`) to the `editor/title` context menu
- Adds `Open Repo in Remote` command (`gitlens.openRepoInRemote`) to the `editor/title` context menu
- Adds `gitlens.strings.*` settings to allow for the customization of certain strings displayed
- Adds `gitlens.theme.*` settings to allow for the theming of certain elements
- Adds `gitlens.advanced.telemetry.enabled` settings to explicitly opt-in or out of telemetry, but still ultimately honors the `telemetry.enableTelemetry` setting
### 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)`
@@ -38,11 +35,6 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
### 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
### Added

View File

@@ -271,14 +271,6 @@ GitLens is highly customizable and provides many configuration settings to allow
|`gitlens.statusBar.format`|Specifies the format of the blame information on the status bar<br />Available tokens<br />`${id}` - commit id<br />`${author}` - commit author<br />`${message}` - commit message<br />`${ago}` - relative commit date (e.g. 1 day ago)<br />`${date}` - formatted commit date (format specified by `gitlens.statusBar.dateFormat`)<br />See https://github.com/eamodio/vscode-gitlens/wiki/Advanced-Formatting for advanced formatting
|`gitlens.statusBar.dateFormat`|Specifies the date format of absolute dates shown in the blame information on the status bar<br />See https://momentjs.com/docs/#/displaying/format/ for valid formats
### Strings Settings
|Name | Description
|-----|------------
|`gitlens.strings.codeLens.unsavedChanges.recentChangeAndAuthors`|Specifies the string to be shown in place of both the `recent change` and `authors` code lens when there are unsaved changes
|`gitlens.strings.codeLens.unsavedChanges.recentChangeOnly`|Specifies the string to be shown in place of the `recent change` code lens when there are unsaved changes
|`gitlens.strings.codeLens.unsavedChanges.authorsOnly`|Specifies the string to be shown in place of the `authors` code lens when there are unsaved changes
### Theme Settings
|Name | Description
@@ -305,7 +297,6 @@ GitLens is highly customizable and provides many configuration settings to allow
|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.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.caching.enabled`|Specifies whether git output will be cached
|`gitlens.advanced.caching.maxLines`|Specifies the threshold for caching larger documents

8
package-lock.json generated
View File

@@ -1,8 +1,14 @@
{
"name": "gitlens",
"version": "4.0.0-beta.2",
"version": "4.0.0-beta",
"lockfileVersion": 1,
"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": {
"version": "1.1.30",
"resolved": "https://registry.npmjs.org/@types/copy-paste/-/copy-paste-1.1.30.tgz",

View File

@@ -1,6 +1,6 @@
{
"name": "gitlens",
"version": "4.0.0-beta.2",
"version": "4.0.0-beta",
"author": {
"name": "Eric Amodio",
"email": "eamodio@gmail.com"
@@ -408,21 +408,6 @@
"default": null,
"description": "Specifies the date format of absolute dates shown in the blame information on the status bar. See https://momentjs.com/docs/#/displaying/format/ for valid formats"
},
"gitlens.strings.codeLens.unsavedChanges.recentChangeAndAuthors": {
"type": "string",
"default": "Cannot determine recent change or authors (unsaved changes)",
"description": "Specifies the string to be shown in place of both the `recent change` and `authors` code lens when there are unsaved changes"
},
"gitlens.strings.codeLens.unsavedChanges.recentChangeOnly": {
"type": "string",
"default": "Cannot determine recent change (unsaved changes)",
"description": "Specifies the string to be shown in place of the `recent change` code lens when there are unsaved changes"
},
"gitlens.strings.codeLens.unsavedChanges.authorsOnly": {
"type": "string",
"default": "Cannot determine authors (unsaved changes)",
"description": "Specifies the string to be shown in place of the `authors` code lens when there are unsaved changes"
},
"gitlens.theme.annotations.file.gutter.separateLines": {
"type": "boolean",
"default": true,
@@ -691,11 +676,6 @@
"default": true,
"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": {
"type": "boolean",
"default": false,
@@ -1278,6 +1258,7 @@
"tmp": "0.0.31"
},
"devDependencies": {
"@types/applicationinsights": "0.15.33",
"@types/copy-paste": "1.1.30",
"@types/iconv-lite": "0.0.1",
"@types/mocha": "2.2.41",

View File

@@ -16,9 +16,9 @@ interface AutoCollectConsole {
}
interface AutoCollectExceptions {
constructor(client: Client): AutoCollectExceptions;
constructor(client:Client): AutoCollectExceptions;
isInitialized(): boolean;
enable(isEnabled: boolean): void;
enable(isEnabled:boolean): void;
}
interface AutoCollectPerformance {
@@ -348,7 +348,7 @@ interface Client {
* @param max the max sample for this 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;
}): void;
@@ -374,8 +374,7 @@ interface Client {
* @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?: {
[key: string]: string;
}, error?: any): void;
[key: string]: string;}, 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.
@@ -504,11 +503,6 @@ interface ApplicationInsights {
*
*/
setOfflineMode(value: boolean, resentIntervall?: number): ApplicationInsights;
/**
*
*/
setAutoDependencyCorrelation(value: boolean): ApplicationInsights;
}
declare module "applicationinsights" {

View File

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

View File

@@ -247,7 +247,7 @@ async function migrateSettings(context: ExtensionContext) {
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.`);
await window.showInformationMessage(`GitLens v4 adds many new settings and removes a few old ones, so please review your settings to ensure they are configured properly.`);
}
}

View File

@@ -134,7 +134,7 @@ export class CommitFormatter {
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[] {

View File

@@ -237,13 +237,13 @@ export class GitCodeLensProvider implements CodeLensProvider {
let title: string;
if (this._documentIsDirty) {
if (this._config.codeLens.recentChange.enabled && this._config.codeLens.authors.enabled) {
title = this._config.strings.codeLens.unsavedChanges.recentChangeAndAuthors;
title = 'Cannot determine recent change or authors (unsaved changes)';
}
else if (this._config.codeLens.recentChange.enabled) {
title = this._config.strings.codeLens.unsavedChanges.recentChangeOnly;
title = 'Cannot determine recent change (unsaved changes)';
}
else {
title = this._config.strings.codeLens.unsavedChanges.authorsOnly;
title = 'Cannot determine authors (unsaved changes)';
}
lens.command = { title: title } as Command;
@@ -256,7 +256,7 @@ export class GitCodeLensProvider implements CodeLensProvider {
const recentCommit = Iterables.first(blame.commits.values());
title = `${recentCommit.author}, ${moment(recentCommit.date).fromNow()}`;
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) {
@@ -279,7 +279,7 @@ export class GitCodeLensProvider implements CodeLensProvider {
const count = blame.authors.size;
let title = `${count} ${count > 1 ? 'authors' : 'author'} (${Iterables.first(blame.authors.values()).name}${count > 1 ? ' and others' : ''})`;
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) {

View File

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

View File

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