Skip to content

Commit e6b3c96

Browse files
committed
Adds using support & removes classes for parsers
1 parent 1dbd860 commit e6b3c96

20 files changed

+1272
-1326
lines changed

src/annotations/gutterBlameAnnotationProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export class GutterBlameAnnotationProvider extends BlameAnnotationProviderBase {
4848
const blame = await this.getBlame();
4949
if (blame == null) return false;
5050

51-
const sw = maybeStopWatch(scope);
51+
using sw = maybeStopWatch(scope);
5252

5353
const cfg = configuration.get('blame');
5454

src/annotations/gutterChangesAnnotationProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ export class GutterChangesAnnotationProvider extends AnnotationProviderBase<Chan
156156
).filter(<T>(d?: T): d is T => Boolean(d));
157157
if (!diffs?.length) return false;
158158

159-
const sw = maybeStopWatch(scope);
159+
using sw = maybeStopWatch(scope);
160160

161161
const decorationsMap = new Map<
162162
string,

src/annotations/gutterHeatmapBlameAnnotationProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export class GutterHeatmapBlameAnnotationProvider extends BlameAnnotationProvide
2626
const blame = await this.getBlame();
2727
if (blame == null) return false;
2828

29-
const sw = maybeStopWatch(scope);
29+
using sw = maybeStopWatch(scope);
3030

3131
const decorationsMap = new Map<
3232
string,

src/env/node/git/git.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ import type { GitDir } from '../../../git/gitProvider';
2424
import type { GitDiffFilter } from '../../../git/models/diff';
2525
import { isUncommitted, isUncommittedStaged, shortenRevision } from '../../../git/models/reference';
2626
import type { GitUser } from '../../../git/models/user';
27-
import { GitBranchParser } from '../../../git/parsers/branchParser';
28-
import { GitLogParser } from '../../../git/parsers/logParser';
29-
import { GitReflogParser } from '../../../git/parsers/reflogParser';
27+
import { parseGitBranchesDefaultFormat } from '../../../git/parsers/branchParser';
28+
import { parseGitLogAllFormat, parseGitLogDefaultFormat } from '../../../git/parsers/logParser';
29+
import { parseGitRefLogDefaultFormat } from '../../../git/parsers/reflogParser';
3030
import { parseGitRemoteUrl } from '../../../git/parsers/remoteParser';
31-
import { GitTagParser } from '../../../git/parsers/tagParser';
31+
import { parseGitTagsDefaultFormat } from '../../../git/parsers/tagParser';
3232
import { splitAt } from '../../../system/array';
3333
import { configuration } from '../../../system/configuration';
3434
import { log } from '../../../system/decorators/log';
@@ -1011,7 +1011,7 @@ export class Git {
10111011
}
10121012

10131013
for_each_ref__branch(repoPath: string, options: { all: boolean } = { all: false }) {
1014-
const params = ['for-each-ref', `--format=${GitBranchParser.defaultFormat}`, 'refs/heads'];
1014+
const params = ['for-each-ref', `--format=${parseGitBranchesDefaultFormat}`, 'refs/heads'];
10151015
if (options.all) {
10161016
params.push('refs/remotes');
10171017
}
@@ -1045,7 +1045,7 @@ export class Git {
10451045
},
10461046
) {
10471047
if (argsOrFormat == null) {
1048-
argsOrFormat = ['--name-status', `--format=${all ? GitLogParser.allFormat : GitLogParser.defaultFormat}`];
1048+
argsOrFormat = ['--name-status', `--format=${all ? parseGitLogAllFormat : parseGitLogDefaultFormat}`];
10491049
}
10501050

10511051
if (typeof argsOrFormat === 'string') {
@@ -1242,7 +1242,7 @@ export class Git {
12421242
const [file, root] = splitPath(fileName, repoPath, true);
12431243

12441244
if (argsOrFormat == null) {
1245-
argsOrFormat = [`--format=${all ? GitLogParser.allFormat : GitLogParser.defaultFormat}`];
1245+
argsOrFormat = [`--format=${all ? parseGitLogAllFormat : parseGitLogDefaultFormat}`];
12461246
}
12471247

12481248
if (typeof argsOrFormat === 'string') {
@@ -1438,7 +1438,7 @@ export class Git {
14381438
'show',
14391439
'--stdin',
14401440
'--name-status',
1441-
`--format=${GitLogParser.defaultFormat}`,
1441+
`--format=${parseGitLogDefaultFormat}`,
14421442
'--use-mailmap',
14431443
);
14441444
}
@@ -1451,7 +1451,7 @@ export class Git {
14511451
'log',
14521452
...(options?.stdin ? ['--stdin'] : emptyArray),
14531453
'--name-status',
1454-
`--format=${GitLogParser.defaultFormat}`,
1454+
`--format=${parseGitLogDefaultFormat}`,
14551455
'--use-mailmap',
14561456
...search,
14571457
...(options?.ordering ? [`--${options.ordering}-order`] : emptyArray),
@@ -1542,7 +1542,7 @@ export class Git {
15421542
skip?: number;
15431543
} = {},
15441544
): Promise<string> {
1545-
const params = ['log', '--walk-reflogs', `--format=${GitReflogParser.defaultFormat}`, '--date=iso8601'];
1545+
const params = ['log', '--walk-reflogs', `--format=${parseGitRefLogDefaultFormat}`, '--date=iso8601'];
15461546

15471547
if (ordering) {
15481548
params.push(`--${ordering}-order`);
@@ -2139,7 +2139,7 @@ export class Git {
21392139
}
21402140

21412141
tag(repoPath: string) {
2142-
return this.git<string>({ cwd: repoPath }, 'tag', '-l', `--format=${GitTagParser.defaultFormat}`);
2142+
return this.git<string>({ cwd: repoPath }, 'tag', '-l', `--format=${parseGitTagsDefaultFormat}`);
21432143
}
21442144

21452145
worktree__add(

0 commit comments

Comments
 (0)