0

I've modified a line so it looks like this:

enter image description here

Now I'm wondering what that used to say. I can tab to a command line and use git to find out, but it would be more convenient if I could see this in the Visual Studio editor without having to tab out. That yellow line suggests that all I'd have to do is click on it to see what used to be there, but clicking on it isn't having any effect.

I'm using the 2017 Community Edition.

Daniel Kaplan
  • 62,768
  • 50
  • 234
  • 356
  • By used to say, do you mean the contents of that line number in revision history? – Austin Brunkhorst Mar 14 '19 at 21:42
  • @AustinBrunkhorst Yes. What it would say if I did a `git reset --hard` – Daniel Kaplan Mar 14 '19 at 21:42
  • Do you have source control configured within Visual Studio? i.e. are you able to push commits from within Visual Studio? – Austin Brunkhorst Mar 14 '19 at 21:44
  • @AustinBrunkhorst it looks like it's configured, but when I try to push, it says `failed to acquire credentials.` and I don't see anywhere in the settings where it lets me enter the username and password... – Daniel Kaplan Mar 14 '19 at 21:54
  • @AustinBrunkhorst I don't really care about pushing and pulling from my IDE. I can view the local history from my IDE though, suggesting the IDE is capable of knowing my changes locally, at least. Shouldn't this be sufficient to be able to view local changes in the IDE? – Daniel Kaplan Mar 14 '19 at 22:09
  • 1
    @TaW no... I expect to click on that yellow line and see what line was there before my modification, then have the option to revert that line, copy it, etc. That's what you get from IntelliJ and others. – Daniel Kaplan Mar 14 '19 at 22:51

1 Answers1

1

There is the LocalHistory extension which does approximately what you want do: https://marketplace.visualstudio.com/items?itemName=AronDCurzon.LocalHistoryforVisualStudio

D.R.
  • 20,268
  • 21
  • 102
  • 205
  • Interesting. I guess I'll get this. What is that yellow line there for though? What functionality does it provide? – Daniel Kaplan Mar 14 '19 at 22:36
  • Actually that doesn't help me that much because I auto save when I lose focus. I want to compare my changes to HEAD, not my changes to the last save. – Daniel Kaplan Mar 14 '19 at 22:38
  • Hmm, I guess there is no built-in feature. Everybody uses source control nowadays and therefore has some kind of IDE integration for his/her source control system which does this job out-of-the-box. – D.R. Mar 14 '19 at 22:40
  • I'm using source control, too. Git, one of the most popular source control systems there is. I'm confused by your statement. My question is, "where is the IDE integration?" – Daniel Kaplan Mar 14 '19 at 22:43
  • I'm using GitExtensions which comes with a VS plugin which supports right click -> Show file history. The built-in feature in VS is called "Code Lens" but it seems to be supported from the Professional version up only. Check out https://stackoverflow.com/questions/42991430/how-to-enable-codelens-for-visual-studio-2017-community for more information. – D.R. Mar 14 '19 at 22:46
  • Ah, that explains everything. Thank you. – Daniel Kaplan Mar 14 '19 at 22:49
  • 1
    Funny enough it seems to be the only feature difference between Community/Professional if you have a look at https://visualstudio.microsoft.com/vs/compare/ – D.R. Mar 14 '19 at 22:51
  • Is it actually alive? – TaW Mar 14 '19 at 22:56