How do I expand the changes to view it normally after updating project from Git? - intellij-idea

So me and my class mates have recently started using Github to update our project in IntelliJ and it's going great, except I have this really annoying thing where all of the changes are collapsed when I go to the changed class and I can't expand them the usual way.
https://gyazo.com/06e77193750ce9a48cca14bfaa00cd54 This is all I can actually see, but there are 40 lines of code inside the class and 6 lines of imports above the class header, but I can't actually expand the changes to view them like I would in normal code, instead it gives me a pop-up type menu with no option to accept the changes.
Please can someone point me in the right direction? It's driving me insane.

Idea is marking deleted segments (lines) in your code with these grey triangles. It means you have somehow removed these lines (probably unintentionally), and these deletions are now in your working copy (waiting to be commited). You can undo this by selecting Git / Uncommited Changes / Rollback... menu in Idea. It will display a dialog with the changed files you can rollback to the last commited state. You can also right click on each file and select Show Diff to see the changed lines. Be sure not to rollback any changes done intentionally.
Alternatively you can also rollback the changes one-by-one by clicking the grey triangles and pressing the rollback button:

Related

What's the little square ahead of the project name in intellij idea, with a number in

I'm using idea as my java ide. I don't know which keys I have pressed, There appeared a little square ahead of the project name.
Is there anyone help tell what's this and what impact it has.
You bookmarked the folder and you may view it in favorites. After you open favorites, you may delete it by clicking the (-) on the bottom left corner.
Also there is a bug i think. If it still shows-up after you remove from the bookmarks - switch theme to another one and go back to original one again. It disappears.

Refactored "MySettings" to "Settings" on accident. Cannot revert back to normal

I was trying to troubleshoot why my default settings. Settings values weren't updating. Visual Studio showed me a recommended fix of refactoring "MySettings" to "Settings" and now every reference to My.Settings is broken and the word settings has turned green (used to be white).
I tried just hitting the undo button, and then closing without saving. But it didn't fix anything. Makes me think it isn't a project issue but a VS2016 issue.
My.Settings.ActiveDrive = My.Settings.Default.ActiveDrive
My.Settings.Save()
This is the code I was altering. I was trying to error proof my code and reset the value to the default to simulate a new user with no saved settings yet. Then I switched Settings to MySettings to see if that'd do anything and VS asked if I wanted to refactor MySettings to just Settings. I said yes... And now the code is broken.
I just want Settings to go back to normal. The way it worked before I hit "refactor MySettings".
I was actually able to figure it out.
For anyone out there that runs into this issue in the future (Since I found 0 results on google about this), you simply go to your solution explorer in the top right, click the drop down icon next to Settings.settings, double click on Settings.Designer.vb, ctrl+f and search for "settings" and rename any class designated "Settings" result back to "MySettings". Don't rename the other "Settings" appearances otherwise it'll break again.
Then your code will go back to having a read-only "settings" option and a class option called "MySettings".

Undo, Redo is jumping around and unpredictable (Test on PHPStorm)

I'm using PHPStrom v 8.0.2
While i was hit command-Z to undo thing.
The editor jump around to somewhere but not to the cursor as illustrated image.
That makes me very annoyed.
Is this a bug or have i setting something wrong?
HERE IS HOW TO REPRODUCE
Edit any line
Place the cursor far... far away from the edit line
Hit command-Z to UNDO thing <-- The editor will jump to the edited line
Hit command-shift-Z to REDO thing, the editor jump back to the line in (2) <--- NO... IT SHOULD NOT
Seem like Jetbrains does fix this in PHPStorm v9 EAP.
But that program will expired after 30 days, Any where to implement this in PHPStorm v8.0.3 please?
One more thing, I can't find any keyboard shortcut key for auto indent for the whole document, please advise.
Best Regards,
This seems to be Intellij default behavior; it treats cursor movements as edit actions and as such they are being undone and redone.
See this post

Temporarily Remove Or Hide Code in Intellij

Is there a way to temporarily hide or remove a file from Intellij? I used to work in c# and I remember there was some way in visual studio to temporarily remove a project from the build then add it back later. I am just trying to figure out what parts of code are necessary for certain features.
This is a perfect use case for git stash.
If you're not using a git repo, hit Ctrl+Shift+A and type "Create Git Repository", then hit enter to initialize git tracking on your current project.
Initially, you'll want to add your important files to git. Hit Alt+1 to navigate to the Project View, then select all the files.
In order to add a file to git, press Ctrl+Alt+A, you should see the filename turn from red to green. It is now being tracked.
Now you'll want to make your first commit. Hit Ctrl+K, and IDEA will guide you through this.
Finally, once everything's all checked in, you can start messing around a little. If you make a few changes, say delete a file, and want to temporarily revert to the last commit, hit Ctrl+Shift+A, then "Stash". Select "Stash changes", write a little message for yourself, and you'll immediately jump back to the last commit.
Now say you want to go back to those changes you stashed. Hit Ctrl+Shift+A again, type "Unstash" then select "Unstash changes". Find the stash, check "Pop stash" and hit Enter.
This is a pretty common workflow for temporarily saving, removing and reverting changes in Git. You can read more about git stash here, and version control on IntelliJ IDEA from Martin Balliauw.

In Intellij IDEA how do I reload file content's from disk?

In vim I can type :e and reload a file's contents from disk overwriting any changes I've made. It's a nice way to reset in case I've gotten lost or just want to undo all my changes. This obviously doesn't take into account any kind of refactoring, I just want to nuke all changes to buffer. Not even closing and reopening a tab will work.
How do I do this with Intellij IDEA? I'm using Intellij IDEA Ultimate 13 and I've disabled any kind of auto save.
File > Synchronize (Ctrl+Alt+Y)
It will load the file from the file system. If you have unsaved changes, it will ask if you want to discard them.
⌥⌘Y - Synchronize for Mac users
What I do in a similar situation:
Simple - Ctrl+Z, Ctrl+Shift+Z many times to quickly navigate the editing history
VCS rollback - either for the whole file or for the area being edited (by clicking green areas on the left)
Local History. Well, yes, for you case it's granularity is not sufficient, so first might be an option
There is also an option to put a label into Local History if you need to rollback to a specific point in time.
For those who use autosave - it is being triggered when code editor loses focus. So doing Alt-Tab during long editing without compiling or running the code makes sense.
Open the file in another editor, make an insignificant change and save it. PHPStorm will ask you what to do because the file system and in memory copies of the file have diverged. Click "Load File System Changes".
Note, I was unable to use my undo history as it had become corrupt.
Since what I want isn't really possible I wrote an extension to do it for me:
https://github.com/btipling/DiskRead/
I'll add it to the Jetbrains plugin repository, it's called "DiskRead".
I wrote a blog post about how I created this if anyone is curious.