Adds .gitignore checks to reduce blame calls

Caches failed blames to reduce blame calls
Only clear failed blames from cache on change/save
Add better error messages and handling
This commit is contained in:
Eric Amodio
2016-09-14 13:30:14 -04:00
parent dfd17a8f17
commit fba6def3e4
7 changed files with 190 additions and 82 deletions

View File

@@ -153,7 +153,7 @@ class GitBlameEditorController extends Disposable {
applyBlame(sha?: string) {
return this._blame.then(blame => {
if (!blame.lines.length) return;
if (!blame || !blame.lines.length) return;
// HACK: Until https://github.com/Microsoft/vscode/issues/11485 is fixed -- toggle whitespace off
this._toggleWhitespace = workspace.getConfiguration('editor').get('renderWhitespace') as boolean;
@@ -212,7 +212,7 @@ class GitBlameEditorController extends Disposable {
applyHighlight(sha: string) {
return this._blame.then(blame => {
if (!blame.lines.length) return;
if (!blame || !blame.lines.length) return;
const highlightDecorationRanges = blame.lines
.filter(l => l.sha === sha)