Skip to content

Commit d01a5ed

Browse files
committed
Adding Paths to tsconfig. Continuing work on waderyan#15
1 parent 2caff70 commit d01a5ed

25 files changed

+90
-222
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## 2.3.0 (March xx, 2018) [WIP]
44

5-
* Feature: Atempting to auto detect if you use a known git web interface [#15](https://github.com/Sertion/vscode-gitblame/issues/15) (Thanks to [@Fidge123](https://github.com/Fidge123), [@sabrehagen](https://github.com/sabrehagen), [@henvic](https://github.com/henvic), and [@neerolyte](https://github.com/neerolyte))
5+
* Feature: Atempting to auto detect if you use a known git web interface [#15](https://github.com/Sertion/vscode-gitblame/issues/15) (Thanks to [@Fidge123](https://github.com/Fidge123), [@sabrehagen](https://github.com/sabrehagen), [@henvic](https://github.com/henvic), and an extra thanks to [@neerolyte](https://github.com/neerolyte))
66
* Feature: Added `gitblame.statusBarPositionPriority` for moving the status bar view [#25](https://github.com/Sertion/vscode-gitblame/issues/25) (Thanks to [@jvoigt](https://github.com/jvoigt))
77
* Fix: Merging `GitBlame` and `GitBlameController` to `GitBlame`
88
* Fix: Renaming `GitBlameFile*` to `GitFile*`

src/git/blame.ts

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ import {
99
workspace,
1010
} from "vscode";
1111

12-
import { HASH_NO_COMMIT_GIT, TITLE_VIEW_ONLINE } from "../constants";
13-
import { IGitBlameInfo, IGitCommitInfo } from "../interfaces";
14-
import { ActionableMessageItem } from "../util/actionablemessageitem";
15-
import { isActiveEditorValid } from "../util/editorvalidator";
16-
import { ErrorHandler } from "../util/errorhandler";
17-
import { Properties, Property } from "../util/property";
18-
import { TextDecorator } from "../util/textdecorator";
19-
import { StatusBarView } from "../view";
20-
import { GitFile } from "./file";
21-
import { GitFileFactory } from "./filefactory";
12+
import { HASH_NO_COMMIT_GIT, TITLE_VIEW_ONLINE } from "@/constants";
13+
import { IGitBlameInfo, IGitCommitInfo } from "@/interfaces";
14+
import { StatusBarView } from "@/view";
15+
import { GitFile } from "git/file";
16+
import { GitFileFactory } from "git/filefactory";
17+
import { ActionableMessageItem } from "util/actionablemessageitem";
18+
import { isActiveEditorValid } from "util/editorvalidator";
19+
import { ErrorHandler } from "util/errorhandler";
20+
import { Properties, Property } from "util/property";
21+
import { TextDecorator } from "util/textdecorator";
2222

2323
export class GitBlame {
2424
public static blankBlameInfo(): IGitBlameInfo {
@@ -156,14 +156,21 @@ export class GitBlame {
156156

157157
const actionedItem = await window.showInformationMessage(
158158
message,
159-
...extraActions,
159+
...(await extraActions),
160160
);
161161

162162
if (actionedItem) {
163163
actionedItem.takeAction();
164164
}
165165
}
166166

167+
public defaultWebPath(url: string, hash: string): string {
168+
return url.replace(
169+
/^(git@|https:\/\/)([^:\/]+)[:\/](.*)\.git$/,
170+
`https://$2/$3/commit/${ hash }`,
171+
);
172+
}
173+
167174
public dispose(): void {
168175
Disposable.from(...Object.values(this.files)).dispose();
169176
this.disposable.dispose();
@@ -182,9 +189,9 @@ export class GitBlame {
182189
);
183190
}
184191

185-
private generateMessageActions(
192+
private async generateMessageActions(
186193
commitInfo: IGitCommitInfo,
187-
): ActionableMessageItem[] {
194+
): Promise<ActionableMessageItem[]> {
188195
const commitToolUrl = this.getToolUrl(commitInfo);
189196
const extraActions: ActionableMessageItem[] = [];
190197

@@ -281,7 +288,7 @@ export class GitBlame {
281288
}
282289
}
283290

284-
private generateDisposeFunction(fileName) {
291+
private generateDisposeFunction(fileName): () => void {
285292
return () => {
286293
delete this.files[fileName];
287294
};

src/git/file.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { Uri, window, workspace } from "vscode";
22

3-
import { TIME_CACHE_LIFETIME } from "../constants";
4-
import { IGitBlameInfo } from "../interfaces";
5-
import { ErrorHandler } from "../util/errorhandler";
6-
import { GitBlame } from "./blame";
3+
import { TIME_CACHE_LIFETIME } from "@/constants";
4+
import { IGitBlameInfo } from "@/interfaces";
5+
import { GitBlame } from "git/blame";
6+
import { ErrorHandler } from "util/errorhandler";
77

88
export class GitFile {
99
public fileName: Uri;

src/git/filedummy.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { ErrorHandler } from "../util/errorhandler";
2-
import { GitFile } from "./file";
1+
import { GitFile } from "git/file";
2+
import { ErrorHandler } from "util/errorhandler";
33

44
export class GitFileDummy extends GitFile {
55
constructor(fileName: string, disposeCallback: () => void) {

src/git/filefactory.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { Uri, workspace } from "vscode";
22

3-
import { GitFile } from "./file";
4-
import { GitFileDummy } from "./filedummy";
5-
import { GitFilePhysical } from "./filephysical";
3+
import { GitFile } from "git/file";
4+
import { GitFileDummy } from "git/filedummy";
5+
import { GitFilePhysical } from "git/filephysical";
66

77
export class GitFileFactory {
88
public static create(

src/git/filephysical.ts

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ import { dirname, join, normalize, relative } from "path";
22

33
import { FileSystemWatcher, Uri, workspace } from "vscode";
44

5-
import { FS_EVENT_TYPE_CHANGE, FS_EVENT_TYPE_REMOVE } from "../constants";
6-
import { IGitBlameInfo, IGitCommitInfo } from "../interfaces";
7-
import { ErrorHandler } from "../util/errorhandler";
8-
import { execute } from "../util/execcommand";
9-
import { getGitCommand } from "../util/gitcommand";
10-
import { StatusBarView } from "../view";
11-
import { GitBlame } from "./blame";
12-
import { GitFile } from "./file";
13-
import { GitBlameStream } from "./stream";
5+
import { FS_EVENT_TYPE_CHANGE, FS_EVENT_TYPE_REMOVE } from "@/constants";
6+
import { IGitBlameInfo, IGitCommitInfo } from "@/interfaces";
7+
import { StatusBarView } from "@/view";
8+
import { GitBlame } from "git/blame";
9+
import { GitFile } from "git/file";
10+
import { GitBlameStream } from "git/stream";
11+
import { ErrorHandler } from "util/errorhandler";
12+
import { execute } from "util/execcommand";
13+
import { getGitCommand } from "util/gitcommand";
1414

1515
export class GitFilePhysical extends GitFile {
1616
private blameInfoPromise: Promise<IGitBlameInfo>;
@@ -125,7 +125,10 @@ export class GitFilePhysical extends GitFile {
125125
"commit",
126126
this.gitAddCommit(blameInfo),
127127
);
128-
this.blameProcess.on("line", this.gitAddLine(blameInfo));
128+
this.blameProcess.on(
129+
"line",
130+
this.gitAddLine(blameInfo),
131+
);
129132
this.blameProcess.on(
130133
"end",
131134
this.gitStreamOver(
@@ -183,7 +186,9 @@ export class GitFilePhysical extends GitFile {
183186
resolve(GitBlame.blankBlameInfo());
184187
} else {
185188
ErrorHandler.logInfo(
186-
`Blamed file "${this.fileName.fsPath}" and found ${
189+
`Blamed file "${
190+
this.fileName.fsPath
191+
}" and found ${
187192
Object.keys(blameInfo.commits).length
188193
} commits`,
189194
);

src/git/stream.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ import { EventEmitter } from "events";
33

44
import { Uri } from "vscode";
55

6-
import { IGitCommitAuthor, IGitCommitInfo } from "../interfaces";
7-
import { ErrorHandler } from "../util/errorhandler";
8-
import { getGitCommand } from "../util/gitcommand";
9-
import { Properties, Property } from "../util/property";
10-
import { GitBlame } from "./blame";
6+
import { IGitCommitAuthor, IGitCommitInfo } from "@/interfaces";
7+
import { GitBlame } from "git/blame";
8+
import { ErrorHandler } from "util/errorhandler";
9+
import { getGitCommand } from "util/gitcommand";
10+
import { Properties, Property } from "util/property";
1111

1212
export class GitBlameStream extends EventEmitter {
1313
private static readonly HASH_PATTERN: RegExp = /[a-z0-9]{40}/;

src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { commands, ExtensionContext, workspace } from "vscode";
2-
import { GitBlame } from "./git/blame";
2+
3+
import { GitBlame } from "git/blame";
34

45
export async function activate(context: ExtensionContext): Promise<void> {
56
if (workspace.workspaceFolders) {

src/util/gitplatformdetector.ts

Lines changed: 0 additions & 43 deletions
This file was deleted.
File renamed without changes.

0 commit comments

Comments
 (0)