mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-02-13 19:48:35 -05:00
Removes git-blame document scheme
Removes git-blame content provider Fixes some CodeLens issues Adds support for git uris in more places Adds git content CodeLens provider
This commit is contained in:
@@ -32,7 +32,7 @@ export default class DiffWithPreviousCommand extends EditorCommand {
|
||||
const gitUri = GitUri.fromUri(uri);
|
||||
|
||||
try {
|
||||
const log = await this.git.getLogForFile(gitUri.fsPath, <Range>rangeOrLine);
|
||||
const log = await this.git.getLogForFile(gitUri.fsPath, gitUri.sha, gitUri.repoPath, <Range>rangeOrLine);
|
||||
if (!log) return window.showWarningMessage(`Unable to open diff. File is probably not under source control`);
|
||||
|
||||
const sha = (commit && commit.sha) || gitUri.sha;
|
||||
|
||||
@@ -26,7 +26,7 @@ export default class DiffWithWorkingCommand extends EditorCommand {
|
||||
const gitUri = GitUri.fromUri(uri);
|
||||
|
||||
try {
|
||||
const log = await this.git.getLogForFile(gitUri.fsPath);
|
||||
const log = await this.git.getLogForFile(gitUri.fsPath, gitUri.sha, gitUri.repoPath);
|
||||
if (!log) return window.showWarningMessage(`Unable to open diff. File is probably not under source control`);
|
||||
|
||||
commit = (gitUri.sha && log.commits.get(gitUri.sha)) || Iterables.first(log.commits.values());
|
||||
|
||||
@@ -10,7 +10,7 @@ export default class ShowBlameHistoryCommand extends EditorCommand {
|
||||
super(Commands.ShowBlameHistory);
|
||||
}
|
||||
|
||||
async execute(editor: TextEditor, edit: TextEditorEdit, uri?: Uri, range?: Range, position?: Position) {
|
||||
async execute(editor: TextEditor, edit: TextEditorEdit, uri?: Uri, range?: Range, position?: Position, sha?: string, line?: number) {
|
||||
if (!(uri instanceof Uri)) {
|
||||
if (!editor.document) return undefined;
|
||||
uri = editor.document.uri;
|
||||
@@ -23,7 +23,7 @@ export default class ShowBlameHistoryCommand extends EditorCommand {
|
||||
const gitUri = GitUri.fromUri(uri);
|
||||
|
||||
try {
|
||||
const locations = await this.git.getBlameLocations(gitUri.fsPath, range);
|
||||
const locations = await this.git.getBlameLocations(gitUri.fsPath, range, gitUri.sha, gitUri.repoPath, sha, line);
|
||||
if (!locations) return window.showWarningMessage(`Unable to show blame history. File is probably not under source control`);
|
||||
|
||||
return commands.executeCommand(BuiltInCommands.ShowReferences, uri, position, locations);
|
||||
|
||||
@@ -22,7 +22,7 @@ export default class ShowFileHistoryCommand extends EditorCommand {
|
||||
const gitUri = GitUri.fromUri(uri);
|
||||
|
||||
try {
|
||||
const locations = await this.git.getLogLocations(gitUri.fsPath, sha, line);
|
||||
const locations = await this.git.getLogLocations(gitUri.fsPath, gitUri.sha, gitUri.repoPath, sha, line);
|
||||
if (!locations) return window.showWarningMessage(`Unable to show history. File is probably not under source control`);
|
||||
|
||||
return commands.executeCommand(BuiltInCommands.ShowReferences, uri, position, locations);
|
||||
|
||||
Reference in New Issue
Block a user