From 4b06589d4d839fdc28af143af6ec766433384529 Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Mon, 1 Aug 2022 20:04:12 -0400 Subject: [PATCH] Fixes decorator resolvers & adds logging --- src/env/node/git/localGitProvider.ts | 4 ++-- src/git/gitProviderService.ts | 5 +++-- src/plus/github/githubGitProvider.ts | 10 ++++++---- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/env/node/git/localGitProvider.ts b/src/env/node/git/localGitProvider.ts index 0dffcc2..5a24312 100644 --- a/src/env/node/git/localGitProvider.ts +++ b/src/env/node/git/localGitProvider.ts @@ -1074,7 +1074,7 @@ export class LocalGitProvider implements GitProvider, Disposable { } @gate((u, d) => `${u.toString()}|${d?.isDirty}`) - @log() + @log({ args: { 1: d => d?.isDirty } }) async getBlame(uri: GitUri, document?: TextDocument | undefined): Promise { const cc = Logger.getCorrelationContext(); @@ -1241,7 +1241,7 @@ export class LocalGitProvider implements GitProvider, Disposable { @gate( (u, l, d, o) => `${u.toString()}|${l}|${d?.isDirty}|${o?.forceSingleLine}`, ) - @log() + @log({ args: { 2: d => d?.isDirty } }) async getBlameForLine( uri: GitUri, editorLine: number, // 0-based, Git is 1-based diff --git a/src/git/gitProviderService.ts b/src/git/gitProviderService.ts index f951131..3a06f13 100644 --- a/src/git/gitProviderService.ts +++ b/src/git/gitProviderService.ts @@ -726,6 +726,7 @@ export class GitProviderService implements Disposable { private _context: { enabled: boolean; disabled: boolean } = { enabled: false, disabled: false }; + @debug() async setEnabledContext(enabled: boolean): Promise { let disabled = !enabled; // If we think we should be disabled during startup, check if we have a saved value from the last time this repo was loaded @@ -1093,7 +1094,7 @@ export class GitProviderService implements Disposable { return provider.getAheadBehindCommitCount(path, refs); } - @log() + @log({ args: { 1: d => d?.isDirty } }) /** * Returns the blame of a file * @param uri Uri of the file to blame @@ -1115,7 +1116,7 @@ export class GitProviderService implements Disposable { return provider.getBlameContents(uri, contents); } - @log() + @log({ args: { 2: d => d?.isDirty } }) /** * Returns the blame of a single line * @param uri Uri of the file to blame diff --git a/src/plus/github/githubGitProvider.ts b/src/plus/github/githubGitProvider.ts index 396da7f..b6328ae 100644 --- a/src/plus/github/githubGitProvider.ts +++ b/src/plus/github/githubGitProvider.ts @@ -408,8 +408,8 @@ export class GitHubGitProvider implements GitProvider, Disposable { return undefined; } - @gate() - @log() + @gate((u, d) => `${u.toString()}|${d?.isDirty}`) + @log({ args: { 1: d => d?.isDirty } }) async getBlame(uri: GitUri, document?: TextDocument | undefined): Promise { const cc = Logger.getCorrelationContext(); @@ -573,8 +573,10 @@ export class GitHubGitProvider implements GitProvider, Disposable { return undefined; //this.getBlame(uri); } - @gate() - @log() + @gate( + (u, l, d, o) => `${u.toString()}|${l}|${d?.isDirty}|${o?.forceSingleLine}`, + ) + @log({ args: { 2: d => d?.isDirty } }) async getBlameForLine( uri: GitUri, editorLine: number, // 0-based, Git is 1-based