22 Commits

Author SHA1 Message Date
Eric Amodio
016c561ead Preps v4.0.0-beta.2 2017-06-07 12:55:07 -04:00
Eric Amodio
9cf86a41ec Adds setting to explicitly control telemetry
Disables zone.js monkey patching by application insights
2017-06-07 12:52:56 -04:00
Eric Amodio
4eb1c3e36a Renames interpolation method 2017-06-07 12:52:56 -04:00
Eric Amodio
95e0a6c71b Adds code lens range to debug info 2017-06-07 12:52:56 -04:00
Eric Amodio
35ca8106c9 Adds customizable code lens strings 2017-06-07 12:52:56 -04:00
Eric Amodio
948a75de79 Don't wait for settings message before continuing 2017-06-07 12:52:56 -04:00
Eric Amodio
4b0891b949 Adds settings migration support 2017-06-07 12:52:56 -04:00
Eric Amodio
a9d94868e7 Preps v4.0.0-beta 2017-06-07 12:52:56 -04:00
Eric Amodio
3c45c7e049 Anchors the code lens to the end of the line 2017-06-07 12:51:00 -04:00
Eric Amodio
ba0d55d5d4 Updates dependencies 2017-06-07 12:50:59 -04:00
Eric Amodio
d2dc172042 Attempts to fix #80 - on line with link, annotation gets underlined 2017-06-07 12:49:52 -04:00
Eric Amodio
e5e582d300 Fixes #81 - Current line annotation is too sticky 2017-06-07 12:49:52 -04:00
Eric Amodio
7c9e4b911c Adds better formatting of settings 2017-06-07 12:49:52 -04:00
Eric Amodio
42fdf9f327 Updates screenshots 2017-06-07 12:49:52 -04:00
Eric Amodio
547d50fed6 Adds another screenshot to README 2017-06-07 12:49:52 -04:00
Eric Amodio
6c33686335 Adds vscode issue TODO 2017-06-07 12:49:52 -04:00
Eric Amodio
28355d41b6 Adds more screenshots to README 2017-06-07 12:49:52 -04:00
Eric Amodio
6e5bb2343e Preps v4.0.0-alpha.2 2017-06-07 12:49:51 -04:00
Eric Amodio
d01c592533 Adds welcome message for first-time users 2017-06-07 12:48:22 -04:00
Eric Amodio
37e48ded2d 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-07 12:48:22 -04:00
Eric Amodio
e3e7605268 Preps v3.6.1 2017-06-07 12:43:22 -04:00
Eric Amodio
f16c3857e5 Fixes zone.js monkey patching by application-insights 2017-06-07 12:42:33 -04:00
11 changed files with 91 additions and 36 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] - 2017-06-06
## [4.0.0-beta.2] - 2017-06-07
### 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,6 +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 `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)`
@@ -35,6 +38,11 @@ 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,6 +271,14 @@ GitLens is highly customizable and provides many configuration settings to allow
|`gitlens.statusBar.format`|Specifies the format of the blame information on the status bar<br />Available tokens<br />`${id}` - commit id<br />`${author}` - commit author<br />`${message}` - commit message<br />`${ago}` - relative commit date (e.g. 1 day ago)<br />`${date}` - formatted commit date (format specified by `gitlens.statusBar.dateFormat`)<br />See https://github.com/eamodio/vscode-gitlens/wiki/Advanced-Formatting for advanced formatting
|`gitlens.statusBar.dateFormat`|Specifies the date format of absolute dates shown in the blame information on the status bar<br />See https://momentjs.com/docs/#/displaying/format/ for valid formats
### Strings Settings
|Name | Description
|-----|------------
|`gitlens.strings.codeLens.unsavedChanges.recentChangeAndAuthors`|Specifies the string to be shown in place of both the `recent change` and `authors` code lens when there are unsaved changes
|`gitlens.strings.codeLens.unsavedChanges.recentChangeOnly`|Specifies the string to be shown in place of the `recent change` code lens when there are unsaved changes
|`gitlens.strings.codeLens.unsavedChanges.authorsOnly`|Specifies the string to be shown in place of the `authors` code lens when there are unsaved changes
### Theme Settings
|Name | Description
@@ -297,6 +305,7 @@ 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,14 +1,8 @@
{
"name": "gitlens",
"version": "4.0.0-beta",
"version": "4.0.0-beta.2",
"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",
"version": "4.0.0-beta.2",
"author": {
"name": "Eric Amodio",
"email": "eamodio@gmail.com"
@@ -408,6 +408,21 @@
"default": null,
"description": "Specifies the date format of absolute dates shown in the blame information on the status bar. See https://momentjs.com/docs/#/displaying/format/ for valid formats"
},
"gitlens.strings.codeLens.unsavedChanges.recentChangeAndAuthors": {
"type": "string",
"default": "Cannot determine recent change or authors (unsaved changes)",
"description": "Specifies the string to be shown in place of both the `recent change` and `authors` code lens when there are unsaved changes"
},
"gitlens.strings.codeLens.unsavedChanges.recentChangeOnly": {
"type": "string",
"default": "Cannot determine recent change (unsaved changes)",
"description": "Specifies the string to be shown in place of the `recent change` code lens when there are unsaved changes"
},
"gitlens.strings.codeLens.unsavedChanges.authorsOnly": {
"type": "string",
"default": "Cannot determine authors (unsaved changes)",
"description": "Specifies the string to be shown in place of the `authors` code lens when there are unsaved changes"
},
"gitlens.theme.annotations.file.gutter.separateLines": {
"type": "boolean",
"default": true,
@@ -676,6 +691,11 @@
"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,
@@ -1258,7 +1278,6 @@
"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,7 +374,8 @@ 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.
@@ -503,6 +504,11 @@ interface ApplicationInsights {
*
*/
setOfflineMode(value: boolean, resentIntervall?: number): ApplicationInsights;
/**
*
*/
setAutoDependencyCorrelation(value: boolean): ApplicationInsights;
}
declare module "applicationinsights" {

View File

@@ -98,6 +98,9 @@ export interface IAdvancedConfig {
quickPick: {
closeOnFocusOut: boolean;
};
telemetry: {
enabled: boolean;
};
toggleWhitespace: {
enabled: boolean;
};
@@ -284,6 +287,16 @@ 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 {
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.`);
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.interpolateLazy(template, new CommitFormatter(commit, options));
return Strings.interpolate(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 = 'Cannot determine recent change or authors (unsaved changes)';
title = this._config.strings.codeLens.unsavedChanges.recentChangeAndAuthors;
}
else if (this._config.codeLens.recentChange.enabled) {
title = 'Cannot determine recent change (unsaved changes)';
title = this._config.strings.codeLens.unsavedChanges.recentChangeOnly;
}
else {
title = 'Cannot determine authors (unsaved changes)';
title = this._config.strings.codeLens.unsavedChanges.authorsOnly;
}
lens.command = { title: title } as Command;
@@ -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.blameRange.start.line + 1}-${lens.blameRange.end.line + 1}), Commit (${recentCommit.shortSha})]`;
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})]`;
}
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.blameRange.start.line + 1}-${lens.blameRange.end.line + 1}), Authors (${Iterables.join(Iterables.map(blame.authors.values(), _ => _.name), ', ')})]`;
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), ', ')})]`;
}
switch (this._config.codeLens.authors.command) {

View File

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

View File

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