File tree Expand file tree Collapse file tree 5 files changed +22
-19
lines changed Expand file tree Collapse file tree 5 files changed +22
-19
lines changed Original file line number Diff line number Diff line change @@ -5,11 +5,10 @@ import { relative } from "node:path";
5
5
import { Logger } from "../util/logger.js" ;
6
6
import { blameProcess , getRevsFile } from "./util/git-command.js" ;
7
7
import {
8
+ type CommitRegistry ,
8
9
type LineAttachedCommit ,
9
- CommitRegistry ,
10
10
processChunk ,
11
11
} from "./util/stream-parsing.js" ;
12
- import { Duplex , PassThrough } from "node:stream" ;
13
12
14
13
export type Blame = Map < number , LineAttachedCommit | undefined > ;
15
14
@@ -31,9 +30,7 @@ export class File {
31
30
this . killed = true ;
32
31
}
33
32
34
- private async * run (
35
- realFileName : string ,
36
- ) : AsyncGenerator < LineAttachedCommit > {
33
+ private async * run ( realFileName : string ) : AsyncGenerator < LineAttachedCommit > {
37
34
this . process = blameProcess ( realFileName , await getRevsFile ( realFileName ) ) ;
38
35
39
36
for await ( const chunk of this . process ?. stdout ?? [ ] ) {
Original file line number Diff line number Diff line change @@ -5,13 +5,12 @@ import { dirname, join } from "node:path";
5
5
import { extensions } from "vscode" ;
6
6
7
7
import type { GitExtension } from "../../../types/git.js" ;
8
- import { validEditor } from "../../util/valid-editor.js" ;
9
8
import { execute } from "../../util/execute.js" ;
10
9
import { getActiveTextEditor } from "../../util/get-active.js" ;
11
10
import { Logger } from "../../util/logger.js" ;
12
11
import { getProperty } from "../../util/property.js" ;
13
12
import { split } from "../../util/split.js" ;
14
- import { Stream } from "node:stream " ;
13
+ import { validEditor } from "../../util/valid-editor.js " ;
15
14
16
15
export const getGitCommand = ( ) : string => {
17
16
const vscodeGit = extensions . getExtension < GitExtension > ( "vscode.git" ) ;
@@ -114,11 +113,10 @@ export const getRevsFile = async (
114
113
. map ( ( path ) => access ( path ) . then ( ( ) => path ) ) ,
115
114
) ;
116
115
117
- return revsFiles
118
- . filter (
119
- ( promise ) : promise is PromiseFulfilledResult < string > =>
120
- promise . status === "fulfilled" ,
121
- ) [ 0 ] ?. value
116
+ return revsFiles . filter (
117
+ ( promise ) : promise is PromiseFulfilledResult < string > =>
118
+ promise . status === "fulfilled" ,
119
+ ) [ 0 ] ?. value ;
122
120
} ;
123
121
124
122
export const getRelativePathOfActiveFile = async ( ) : Promise < string > => {
Original file line number Diff line number Diff line change @@ -51,9 +51,7 @@ const newCommitInfo = (hash: string): Commit => ({
51
51
summary : "" ,
52
52
} ) ;
53
53
54
- const newLocationAttachedCommit = (
55
- commitInfo : Commit ,
56
- ) : FileAttachedCommit => ( {
54
+ const newLocationAttachedCommit = ( commitInfo : Commit ) : FileAttachedCommit => ( {
57
55
commit : commitInfo ,
58
56
filename : "" ,
59
57
} ) ;
Original file line number Diff line number Diff line change @@ -4,7 +4,10 @@ import type {
4
4
TextEditor ,
5
5
} from "vscode" ;
6
6
7
- export type Document = Pick < TextDocument , "uri" | "isUntitled" | "fileName" | "lineCount" > ;
7
+ export type Document = Pick <
8
+ TextDocument ,
9
+ "uri" | "isUntitled" | "fileName" | "lineCount"
10
+ > ;
8
11
export type Position = Pick < FullPosition , "line" > ;
9
12
export type PartialSelection = {
10
13
active : Position ;
Original file line number Diff line number Diff line change @@ -13,10 +13,13 @@ import {
13
13
import type { Commit } from "./git/util/stream-parsing.js" ;
14
14
15
15
import { isUncommitted } from "./git/util/is-hash.js" ;
16
- import { type PartialTextEditor , validEditor } from "./util/valid-editor.js" ;
17
16
import { getActiveTextEditor } from "./util/get-active.js" ;
18
17
import { getProperty } from "./util/property.js" ;
19
- import { toInlineTextView , toStatusBarTextView } from "./util/text-decorator.js" ;
18
+ import {
19
+ toInlineTextView ,
20
+ toStatusBarTextView ,
21
+ } from "./util/text-decorator.js" ;
22
+ import { type PartialTextEditor , validEditor } from "./util/valid-editor.js" ;
20
23
21
24
const MESSAGE_NO_INFO = "No info about the current line" ;
22
25
@@ -55,7 +58,11 @@ export class StatusBarView {
55
58
if ( ! commit ) {
56
59
this . clear ( ) ;
57
60
} else if ( isUncommitted ( commit ) ) {
58
- this . text ( getProperty ( "statusBarMessageNoCommit" ) , false , MESSAGE_NO_INFO ) ;
61
+ this . text (
62
+ getProperty ( "statusBarMessageNoCommit" ) ,
63
+ false ,
64
+ MESSAGE_NO_INFO ,
65
+ ) ;
59
66
if ( editor ) {
60
67
void this . createLineDecoration (
61
68
getProperty ( "inlineMessageNoCommit" ) ,
You can’t perform that action at this time.
0 commit comments