Ver código fonte

Removes Emitter from event emitter names

main
Eric Amodio 7 anos atrás
pai
commit
0cf107a817
3 arquivos alterados com 15 adições e 15 exclusões
  1. +4
    -4
      src/blameAnnotationController.ts
  2. +3
    -3
      src/gitCodeLensProvider.ts
  3. +8
    -8
      src/gitService.ts

+ 4
- 4
src/blameAnnotationController.ts Ver arquivo

@ -22,9 +22,9 @@ export const BlameDecorations = {
export class BlameAnnotationController extends Disposable {
private _onDidToggleBlameAnnotationsEmitter = new EventEmitter<void>();
private _onDidToggleBlameAnnotations = new EventEmitter<void>();
get onDidToggleBlameAnnotations(): Event<void> {
return this._onDidToggleBlameAnnotationsEmitter.event;
return this._onDidToggleBlameAnnotations.event;
}
private _annotationProviders: Map<number, BlameAnnotationProvider> = new Map();
@ -148,7 +148,7 @@ export class BlameAnnotationController extends Disposable {
this._blameAnnotationsDisposable = undefined;
}
this._onDidToggleBlameAnnotationsEmitter.fire();
this._onDidToggleBlameAnnotations.fire();
}
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);
if (await provider.provideBlameAnnotation(shaOrLine)) {
this._onDidToggleBlameAnnotationsEmitter.fire();
this._onDidToggleBlameAnnotations.fire();
return true;
}
return false;

+ 3
- 3
src/gitCodeLensProvider.ts Ver arquivo

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

+ 8
- 8
src/gitService.ts Ver arquivo

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

Carregando…
Cancelar
Salvar