File tree Expand file tree Collapse file tree 2 files changed +17
-15
lines changed Expand file tree Collapse file tree 2 files changed +17
-15
lines changed Original file line number Diff line number Diff line change 11/**
22 * Extension module.
33 *
4- * This sets up the extension's command entry point and applies the
5- * prepare commit message module to a target branch.
4+ * This sets up the extension's command entry point and applies the prepare commit message module to
5+ * a target branch.
66 */
77import * as vscode from "vscode" ;
8- import { API , GitExtension } from "./api/git" ;
8+ import { API } from "./api/git" ;
99import { makeAndFillCommitMsg } from "./autofill" ;
10-
11- /**
12- * Return VS Code's builtin Git extension.
13- */
14- function getGitExtension ( ) {
15- const vscodeGit = vscode . extensions . getExtension < GitExtension > ( "vscode.git" ) ;
16- const gitExtension = vscodeGit && vscodeGit . exports ;
17-
18- return gitExtension && gitExtension . getAPI ( 1 ) ;
19- }
10+ import { getGitExtension } from "./gitExtension" ;
2011
2112/**
2213 * Flow for multiple repos in workspace and selecting just one. This is a rare flow.
Original file line number Diff line number Diff line change 11/**
22 * Git extension module.
33 *
4- * Perform tasks related to the builtin Git extension.
4+ * Perform tasks related to the built-in Git extension.
55 *
66 * This module takes care of the high-level flow of the extension, after a repo is selected in
77 * extension.ts module.
88 *
99 * This module handles reading git output, processes it with the logic in the generate module and
1010 * then finally sets it in the UI message box.
1111 */
12- import { Repository } from "./api/git" ;
12+ import * as vscode from "vscode" ;
13+ import { GitExtension , Repository } from "./api/git" ;
1314
1415/**
1516 * Fetch the commit message in the Git Extension.
@@ -28,3 +29,13 @@ export function getCommitMsg(repository: Repository): string {
2829export function setCommitMsg ( repository : Repository , msg : string ) {
2930 repository . inputBox . value = msg ;
3031}
32+
33+ /**
34+ * Return VS Code's built-in Git extension.
35+ */
36+ export function getGitExtension ( ) {
37+ const vscodeGit = vscode . extensions . getExtension < GitExtension > ( "vscode.git" ) ;
38+ const gitExtension = vscodeGit && vscodeGit . exports ;
39+
40+ return gitExtension && gitExtension . getAPI ( 1 ) ;
41+ }
You can’t perform that action at this time.
0 commit comments