Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Git decorations not shown in Explorer on startup #12223

Open
colin-grant-work opened this issue Feb 24, 2023 · 0 comments
Open

Git decorations not shown in Explorer on startup #12223

colin-grant-work opened this issue Feb 24, 2023 · 0 comments
Labels
git issues related to git navigator issues related to the navigator/explorer

Comments

@colin-grant-work
Copy link
Contributor

Bug Description:

Steps to Reproduce:

  1. In a source controlled folder...
  2. Add a file.
  3. Start the application with that folder as your workspace (and no editors open - recommended but usually not required)
  4. Observe that the new file is not marked as untracked in the explorer.
  5. Trigger a Git event (e.g. check out a different commit)
  6. Observe that the file is now marked as untracked.

Additional Information

A few lifecycle issues contribute to this problem:

The Git decorations are contributed to the core DecorationsService here:

onStart(): void {
this.updateStatusBar();
this.repositoryTracker.onGitEvent(() => this.updateStatusBar());
this.syncService.onDidChange(() => this.updateStatusBar());
this.decorationsService.registerDecorationsProvider(this.gitDecorationProvider);
}

But that onStart method may be (and usually is) called after Git has started up and the gitDecorationProvider has fired its first few events.

Then the decorations from the DecorationsService reach the Explorer via the FileTreeDecoratorAdapter here:

this.decorationsService.onDidChangeDecorations(newDecorations => {
this.updateDecorations(this.decorationsByUri.keys(), newDecorations.keys());
this.fireDidChangeDecorations();
});

But again, if the DecorationsService has already fired events by the time the FileTreeDecoratorAdapter is constructed, the latter won't catch those events, and the DecorationsService provides no API to discover all known decorations at a given time.

  • Operating System: RHEL7
  • Theia Version: 1.34.1
@colin-grant-work colin-grant-work added git issues related to git navigator issues related to the navigator/explorer labels Feb 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
git issues related to git navigator issues related to the navigator/explorer
Projects
None yet
Development

No branches or pull requests

1 participant