Skip to content

Commit eeb1957

Browse files
committed
Fixes tracker on startup
Resolves chcken/egg issue with tracker and git service
1 parent e50fe69 commit eeb1957

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
77
## [Unreleased]
88
### Fixed
99
- Fixes [#247](https://github.com/eamodio/vscode-gitlens/issues/247) - File annotations button or ESC key does not turn off file annotations
10+
- Fixes issue where sometimes blame context wasn't available for the open editor when starting vscode
1011

1112
## [7.5.4] - 2018-01-17
1213
### Fixed

src/container.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ export class Container {
1919

2020
context.subscriptions.push(Container._tracker = new DocumentTracker<GitDocumentState>());
2121
context.subscriptions.push(Container._git = new GitService());
22+
23+
// Since there is a chicken/egg problem with the DocumentTracker and the GitService, initialize the tracker once the GitService is loaded
24+
Container._tracker.initialize();
25+
2226
context.subscriptions.push(Container._annotationController = new AnnotationController());
2327
context.subscriptions.push(Container._currentLineController = new CurrentLineController());
2428
context.subscriptions.push(Container._codeLensController = new CodeLensController());

src/trackers/documentTracker.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ export class DocumentTracker<T> extends Disposable {
6363
this.clear();
6464
}
6565

66+
initialize() {
67+
this.onActiveTextEditorChanged(window.activeTextEditor);
68+
}
69+
6670
private onConfigurationChanged(e: ConfigurationChangeEvent) {
6771
const initializing = configuration.initializing(e);
6872

0 commit comments

Comments
 (0)