Browse Source

Fixes decorator resolvers & adds logging

main
Eric Amodio 2 years ago
parent
commit
4b06589d4d
3 changed files with 11 additions and 8 deletions
  1. +2
    -2
      src/env/node/git/localGitProvider.ts
  2. +3
    -2
      src/git/gitProviderService.ts
  3. +6
    -4
      src/plus/github/githubGitProvider.ts

+ 2
- 2
src/env/node/git/localGitProvider.ts View File

@ -1074,7 +1074,7 @@ export class LocalGitProvider implements GitProvider, Disposable {
}
@gate<LocalGitProvider['getBlame']>((u, d) => `${u.toString()}|${d?.isDirty}`)
@log()
@log<LocalGitProvider['getBlame']>({ args: { 1: d => d?.isDirty } })
async getBlame(uri: GitUri, document?: TextDocument | undefined): Promise<GitBlame | undefined> {
const cc = Logger.getCorrelationContext();
@ -1241,7 +1241,7 @@ export class LocalGitProvider implements GitProvider, Disposable {
@gate<LocalGitProvider['getBlameForLine']>(
(u, l, d, o) => `${u.toString()}|${l}|${d?.isDirty}|${o?.forceSingleLine}`,
)
@log()
@log<LocalGitProvider['getBlameForLine']>({ args: { 2: d => d?.isDirty } })
async getBlameForLine(
uri: GitUri,
editorLine: number, // 0-based, Git is 1-based

+ 3
- 2
src/git/gitProviderService.ts View File

@ -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<void> {
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<GitProviderService['getBlame']>({ 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<GitProviderService['getBlameForLine']>({ args: { 2: d => d?.isDirty } })
/**
* Returns the blame of a single line
* @param uri Uri of the file to blame

+ 6
- 4
src/plus/github/githubGitProvider.ts View File

@ -408,8 +408,8 @@ export class GitHubGitProvider implements GitProvider, Disposable {
return undefined;
}
@gate()
@log()
@gate<GitHubGitProvider['getBlame']>((u, d) => `${u.toString()}|${d?.isDirty}`)
@log<GitHubGitProvider['getBlame']>({ args: { 1: d => d?.isDirty } })
async getBlame(uri: GitUri, document?: TextDocument | undefined): Promise<GitBlame | undefined> {
const cc = Logger.getCorrelationContext();
@ -573,8 +573,10 @@ export class GitHubGitProvider implements GitProvider, Disposable {
return undefined; //this.getBlame(uri);
}
@gate()
@log()
@gate<GitHubGitProvider['getBlameForLine']>(
(u, l, d, o) => `${u.toString()}|${l}|${d?.isDirty}|${o?.forceSingleLine}`,
)
@log<GitHubGitProvider['getBlameForLine']>({ args: { 2: d => d?.isDirty } })
async getBlameForLine(
uri: GitUri,
editorLine: number, // 0-based, Git is 1-based

Loading…
Cancel
Save