Fixes (read: hacks) blame with visible whitespace

Adds diff menu commands always
Attempts to move the diff file to the correct line number
Fixes code action provider -- works again
Deletes deprecated code
This commit is contained in:
Eric Amodio
2016-09-05 16:40:38 -04:00
parent d04696ac1d
commit b7920f3c3d
12 changed files with 179 additions and 236 deletions

View File

@@ -1,6 +1,6 @@
'use strict';
import {CancellationToken, CodeLens, CodeLensProvider, commands, DocumentSelector, ExtensionContext, Location, Position, Range, SymbolInformation, SymbolKind, TextDocument, Uri, window} from 'vscode';
import {Commands, DocumentSchemes, VsCodeCommands, WorkspaceState} from './constants';
import {BuiltInCommands, Commands, DocumentSchemes, WorkspaceState} from './constants';
import GitProvider, {IGitBlame, IGitBlameLines, IGitCommit} from './gitProvider';
import * as moment from 'moment';
@@ -41,7 +41,7 @@ export default class GitCodeLensProvider implements CodeLensProvider {
provideCodeLenses(document: TextDocument, token: CancellationToken): CodeLens[] | Thenable<CodeLens[]> {
const fileName = document.fileName;
const promise = Promise.all([this.git.getBlameForFile(fileName) as Promise<any>, (commands.executeCommand(VsCodeCommands.ExecuteDocumentSymbolProvider, document.uri) as Promise<any>)]);
const promise = Promise.all([this.git.getBlameForFile(fileName) as Promise<any>, (commands.executeCommand(BuiltInCommands.ExecuteDocumentSymbolProvider, document.uri) as Promise<any>)]);
return promise.then(values => {
const blame = values[0] as IGitBlame;
@@ -122,7 +122,7 @@ export default class GitCodeLensProvider implements CodeLensProvider {
const recentCommit = blame.commits.values().next().value;
lens.command = {
title: `${recentCommit.author}, ${moment(recentCommit.date).fromNow()}`, // - lines(${lens.blameRange.start.line + 1}-${lens.blameRange.end.line + 1})`,
command: Commands.ShowHistory,
command: Commands.ShowBlameHistory,
arguments: [Uri.file(lens.fileName), lens.blameRange, lens.range.start]
};
return lens;