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

Add support for single files #321

Closed
ranolfi opened this Issue Mar 20, 2018 · 7 comments

Comments

Projects
None yet
3 participants
@ranolfi

ranolfi commented Mar 20, 2018

Followup of #317 (comments).

Currently, GitLens features are only available when a directory is opened within the editor.

It would be useful if it'd work for single files as well, like the native Git integration in VS Code.

@eamodio eamodio added the feature label Mar 21, 2018

@eamodio eamodio added this to the Backlog milestone Mar 21, 2018

@corydwood

This comment has been minimized.

corydwood commented May 22, 2018

I'll add that this was already working with a previous version of GitLens/VS Code. I don't remember which version though.

@eamodio

This comment has been minimized.

Owner

eamodio commented May 23, 2018

Yeah, it was quite a while ago, and unfortunately that ability was lost in the massive rework to support multi-root workspaces. I would like to bring it back, but sadly it isn't a trivial thing.

@eamodio

This comment has been minimized.

Owner

eamodio commented May 23, 2018

I might have lied -- dug into it more and it looks like it was pretty easy to get working again (oops). I'd need to give it more burn in before I'd be ready to release it. Would any of you be willing to try out a private build for it?

@eamodio eamodio self-assigned this May 23, 2018

@eamodio eamodio modified the milestones: Backlog, Soon™ May 23, 2018

@ranolfi

This comment has been minimized.

ranolfi commented May 23, 2018

@eamodio I'm willing to try it out.

@eamodio

This comment has been minimized.

Owner

eamodio commented May 26, 2018

Can you try this private build and see if it resolves the issue for you:
gitlens-8.3.3-beta.vsix.zip

To install it, remove the .zip from the filename (needed that to make GitHub attach it), and then in the Extensions view click the ... menu and choose Install from VSIX...

Thanks!

@ranolfi

This comment has been minimized.

ranolfi commented May 29, 2018

Looking alright so far.

Although I noticed that, upon closing the file in VS Code, the repository will remain active in the "GitLens" section under "Source Control" view in the activity bar, until another file is open.

But I also noticed the same is true for the native Git integration, anyway.

@eamodio

This comment has been minimized.

Owner

eamodio commented May 30, 2018

Yeah, it gets a bit tricky to reliably track when the repository should close (if you open multiple files, etc). I have added support to "close" a repository which won't completely remove it, will hide it from the GitLens explorer from then on.

I have also discovered that vscode doesn't provide a way to watch for file changes outside the folder(s) opened, so if you open single files, the repository for it doesn't update properly to reflect changes.

The work to fix that is non-trivial and nothing I want to tackle at this point, but if Microsoft/vscode#3025 is added, then I can easily add that support.

@eamodio eamodio closed this in cbd5612 May 31, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment