Skip to content

Commit

Permalink
Fixes tracker on startup
Browse files Browse the repository at this point in the history
Resolves chcken/egg issue with tracker and git service
  • Loading branch information
eamodio committed Jan 18, 2018
1 parent e50fe69 commit eeb1957
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
## [Unreleased]
### Fixed
- Fixes [#247](https://github.com/eamodio/vscode-gitlens/issues/247) - File annotations button or ESC key does not turn off file annotations
- Fixes issue where sometimes blame context wasn't available for the open editor when starting vscode

## [7.5.4] - 2018-01-17
### Fixed
Expand Down
4 changes: 4 additions & 0 deletions src/container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ export class Container {

context.subscriptions.push(Container._tracker = new DocumentTracker<GitDocumentState>());
context.subscriptions.push(Container._git = new GitService());

// Since there is a chicken/egg problem with the DocumentTracker and the GitService, initialize the tracker once the GitService is loaded
Container._tracker.initialize();

context.subscriptions.push(Container._annotationController = new AnnotationController());
context.subscriptions.push(Container._currentLineController = new CurrentLineController());
context.subscriptions.push(Container._codeLensController = new CodeLensController());
Expand Down
4 changes: 4 additions & 0 deletions src/trackers/documentTracker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ export class DocumentTracker<T> extends Disposable {
this.clear();
}

initialize() {
this.onActiveTextEditorChanged(window.activeTextEditor);
}

private onConfigurationChanged(e: ConfigurationChangeEvent) {
const initializing = configuration.initializing(e);

Expand Down

0 comments on commit eeb1957

Please sign in to comment.