Browse Source

Removes Emitter from event emitter names

main
Eric Amodio 8 years ago
parent
commit
0cf107a817
3 changed files with 15 additions and 15 deletions
  1. +4
    -4
      src/blameAnnotationController.ts
  2. +3
    -3
      src/gitCodeLensProvider.ts
  3. +8
    -8
      src/gitService.ts

+ 4
- 4
src/blameAnnotationController.ts View File

@ -22,9 +22,9 @@ export const BlameDecorations = {
export class BlameAnnotationController extends Disposable { export class BlameAnnotationController extends Disposable {
private _onDidToggleBlameAnnotationsEmitter = new EventEmitter<void>();
private _onDidToggleBlameAnnotations = new EventEmitter<void>();
get onDidToggleBlameAnnotations(): Event<void> { get onDidToggleBlameAnnotations(): Event<void> {
return this._onDidToggleBlameAnnotationsEmitter.event;
return this._onDidToggleBlameAnnotations.event;
} }
private _annotationProviders: Map<number, BlameAnnotationProvider> = new Map(); private _annotationProviders: Map<number, BlameAnnotationProvider> = new Map();
@ -148,7 +148,7 @@ export class BlameAnnotationController extends Disposable {
this._blameAnnotationsDisposable = undefined; this._blameAnnotationsDisposable = undefined;
} }
this._onDidToggleBlameAnnotationsEmitter.fire();
this._onDidToggleBlameAnnotations.fire();
} }
async showBlameAnnotation(editor: TextEditor, shaOrLine?: string | number): Promise<boolean> { async showBlameAnnotation(editor: TextEditor, shaOrLine?: string | number): Promise<boolean> {
@ -183,7 +183,7 @@ export class BlameAnnotationController extends Disposable {
this._annotationProviders.set(editor.viewColumn || -1, provider); this._annotationProviders.set(editor.viewColumn || -1, provider);
if (await provider.provideBlameAnnotation(shaOrLine)) { if (await provider.provideBlameAnnotation(shaOrLine)) {
this._onDidToggleBlameAnnotationsEmitter.fire();
this._onDidToggleBlameAnnotations.fire();
return true; return true;
} }
return false; return false;

+ 3
- 3
src/gitCodeLensProvider.ts View File

@ -32,9 +32,9 @@ export class GitAuthorsCodeLens extends CodeLens {
export class GitCodeLensProvider implements CodeLensProvider { export class GitCodeLensProvider implements CodeLensProvider {
private _onDidChangeCodeLensesEmitter = new EventEmitter<void>();
private _onDidChangeCodeLenses = new EventEmitter<void>();
public get onDidChangeCodeLenses(): Event<void> { public get onDidChangeCodeLenses(): Event<void> {
return this._onDidChangeCodeLensesEmitter.event;
return this._onDidChangeCodeLenses.event;
} }
static selector: DocumentSelector = { scheme: DocumentSchemes.File }; static selector: DocumentSelector = { scheme: DocumentSchemes.File };
@ -50,7 +50,7 @@ export class GitCodeLensProvider implements CodeLensProvider {
this._config = workspace.getConfiguration('').get<IConfig>('gitlens'); this._config = workspace.getConfiguration('').get<IConfig>('gitlens');
Logger.log('Triggering a reset of the git CodeLens provider'); Logger.log('Triggering a reset of the git CodeLens provider');
this._onDidChangeCodeLensesEmitter.fire();
this._onDidChangeCodeLenses.fire();
} }
async provideCodeLenses(document: TextDocument, token: CancellationToken): Promise<CodeLens[]> { async provideCodeLenses(document: TextDocument, token: CancellationToken): Promise<CodeLens[]> {

+ 8
- 8
src/gitService.ts View File

@ -58,14 +58,14 @@ export const GitRepoSearchBy = {
export class GitService extends Disposable { export class GitService extends Disposable {
private _onDidChangeGitCacheEmitter = new EventEmitter<void>();
private _onDidChangeGitCache = new EventEmitter<void>();
get onDidChangeGitCache(): Event<void> { get onDidChangeGitCache(): Event<void> {
return this._onDidChangeGitCacheEmitter.event;
return this._onDidChangeGitCache.event;
} }
private _onDidBlameFailEmitter = new EventEmitter<string>();
private _onDidBlameFail = new EventEmitter<string>();
get onDidBlameFail(): Event<string> { get onDidBlameFail(): Event<string> {
return this._onDidBlameFailEmitter.event;
return this._onDidBlameFail.event;
} }
private _gitCache: Map<string, GitCacheEntry> | undefined; private _gitCache: Map<string, GitCacheEntry> | undefined;
@ -207,7 +207,7 @@ export class GitService extends Disposable {
private _onGitChanged() { private _onGitChanged() {
this._gitCache && this._gitCache.clear(); this._gitCache && this._gitCache.clear();
this._onDidChangeGitCacheEmitter.fire();
this._onDidChangeGitCache.fire();
this._codeLensProvider && this._codeLensProvider.reset(); this._codeLensProvider && this._codeLensProvider.reset();
} }
@ -227,7 +227,7 @@ export class GitService extends Disposable {
Logger.log(`Clear cache entry for '${cacheKey}', reason=${RemoveCacheReason[reason]}`); Logger.log(`Clear cache entry for '${cacheKey}', reason=${RemoveCacheReason[reason]}`);
if (reason === RemoveCacheReason.DocumentSaved) { if (reason === RemoveCacheReason.DocumentSaved) {
this._onDidChangeGitCacheEmitter.fire();
this._onDidChangeGitCache.fire();
// Refresh the codelenses with the updated blame // Refresh the codelenses with the updated blame
this._codeLensProvider && this._codeLensProvider.reset(); this._codeLensProvider && this._codeLensProvider.reset();
@ -353,7 +353,7 @@ export class GitService extends Disposable {
if (ignore && !ignore.filter([file]).length) { if (ignore && !ignore.filter([file]).length) {
Logger.log(`Skipping blame; '${fileName}' is gitignored`); Logger.log(`Skipping blame; '${fileName}' is gitignored`);
if (entry && entry.key) { if (entry && entry.key) {
this._onDidBlameFailEmitter.fire(entry.key);
this._onDidBlameFail.fire(entry.key);
} }
return await GitService.EmptyPromise as IGitBlame; return await GitService.EmptyPromise as IGitBlame;
} }
@ -374,7 +374,7 @@ export class GitService extends Disposable {
errorMessage: msg errorMessage: msg
} as ICachedBlame; } as ICachedBlame;
this._onDidBlameFailEmitter.fire(entry.key);
this._onDidBlameFail.fire(entry.key);
this._gitCache.set(entry.key, entry); this._gitCache.set(entry.key, entry);
return await GitService.EmptyPromise as IGitBlame; return await GitService.EmptyPromise as IGitBlame;
} }

Loading…
Cancel
Save