Intellij scratch files - how to delete them? - android-studio

I have created a few scratch files in android studio (fork of Intellij). by going to tools-->new scratch file.
But now i have soo many scratch files and i dont know how to delete them since they auto save. Can anyone help ?
Some info: scratch files are used to prototype code without it actually mingling with your exisiting code. Its like a notepad which auto saves.

To delete a scratch file or buffer, follow these steps:
Switch to the Scratches view of the Project tool window.
Under the Scratches pseudo-folder, right-click the scratch to be deleted, and choose Delete on the context menu.
Confirm deletion.
Source:
https://www.jetbrains.com/help/idea/15.0/scratches.html?origin=old_help#d640596e253
I was also able to do it by pressing cmd+E (for mac) to open the recent files popup. Then select the line and hit the delete key.

Switch to the Scratches view of the Project tool window.
Under the Scratches pseudo-folder, right-click the scratch to be deleted, and choose
Delete on the context menu.
Confirm deletion.

Related

.gradle\caches\6.1.1\file-changes\last-build.bin (Access is denied)

I've tried to delete .gradle folder or delete last-build.bin file, but it isn't work. Could everyone have the solution to this problem ? thank you...
One simple solution is
I believe that another solution for that could as much be related to hidden folders. If that is the problem:
Check if your User folder is not hidden C:/User..
On the tab menu, select View.
On your far right there will be Options, select.
It will display Folder Options with the following tabs: General, View and Search. Here again, be sure to select View.
Navigate to Hidden files and folders.
And under that folder, just select Show hidden files and folders radio button.
Should that not do the trick, then move on to check if ALL the folders related to that path all the way to Caches are not hidden. The culprit here, should be that the: .gradle\caches is hidden.
Therefore, tap on the folder and unhide it activating the Caches folder(don't open it - just select it) and clicking View once again. Just next to Options on your far right, there should be Unhide selected items on the left. Of course, Unhide them and wait until the attributes are well applied. Now you are good to go, you should not experience that problem any longer.
I think that should do the trick if by any means your folder got hidden. Be sure to do that first, before following any of those technical steps. If your folders are hidden, Android Studio or Intelli j for that matters, cannot access the path in question.
Goto File -> Invalidate caches / Restart
Shutdown Android Studio
Rename/remove .gradle folder in the user home directory
Restart Android Studio (It will download gradle metadata and data)
Gradle build succeed
Rebuild project. Done.
reference

Cannot add Sublime project preferences after opening repo via Github Desktop

I have been happy to notice that Github Desktop lets me open a repo in Sublime Text. It seems to open the repo as a project but I have a hard time figuring out how to edit the project preferences for the repo. Specifically, I would like to add file_exclude_patterns.
I have tried Project > Save Project As... in Sublime, but then when I open the repo through Github Desktop it opens two Sublime windows: one that respects my project preferences and one that ignores them.
From your problem description, it sounds like you might be running into issues with the hot_exit setting. When that setting is turned on (which is the default), then whenever you quit Sublime, it saves the state of all open windows into a session file before it quits.
That session file contains a list of every window that's open, what files are open in each, their scroll position, selection, any unsaved changes to files, and so on. When you restart Sublime, it loads the session file and restores its state back to what it was previously, seamlessly putting you back to where you were before.
One of the potentially unintended side effects of this is that the session is always restored every time you start Sublime. So if you have a project open in a window, and you quit, Sublime keeps a record that you had one window containing that project. If you start it and tell it to open the same project, it will first restore the session and then open the project, resulting in two windows.
As such, turning off hot_exit may solve this problem for you. When it's off, the session information isn't saved, and Sublime starts in a more or less "fresh" state every time. The downside to this is that you will be prompted to save all unsaved files, your list of open files is lost, etc. Depending on your use case, this may or may not be an issue.
If you already have that setting off and this still happens, then the issue would be that GitHub for Windows is opening both the project and the folder, which would result in two windows. In that case there's not a lot to do but poke the people in charge of GitHub for Windows and tell them to fix their code.
On the other hand, if you turn off hot_exit and you get one window, but it doesn't respect your project preferences, then the problem is that GitHub for Windows is only opening the folder, not the sublime-project file.
In that case, there's not a whole lot to be done, unfortunately. Sublime won't load a sublime-project file just because it happens to be contained in a folder, since there can conceivably be many of them in there (many people keep their project files in a single folder, for example).
If Sublime is associated with sublime-project files, then opening the sublime-project file would result in Sublime opening the project for you, so that may be a possibility as well.
Beyond that, you're more or less in the realm of things like using Project > Switch Project or Project > Quick Switch Project to get the window to display what you want; that's not very handy with regards to just opening the project, though.

Recovering files deleted by Android studio?

I'm working on an app at the moment, and one of the final steps was to get it built and signed in Android studio.
Unfortunately I was having some problems, and one of the recommended solutions was to remove the project and start again, however when I did this it took all of my files with it, and they're not in the trash (OSX) either.
Is there anyway to recover these files, or are they lost forever? :(
In my case I was looking for the file named 'landing_page222.java' which I deleted one day back.
Following Steps can help you to find your previously deleted files in Android Studio.
Step 1: Right Click on the folder where you deleted the file
Step 2: Find option for Local History and Click Show History.
Step 3: Find your File from Given List.
Hopefully it will be available in Instance
Step 4: Copy the code back as per need.
You can try:
looking for those files in the file system (perhaps they are still in your Android Studio projects folder)
looking in your OS's temp folder
using Android Studio's history feature (right-click on the Project tab > Local History > Show history)
Click whereever you want in the left frame (for example "drawable" file is ok) and then press CTRL+z. You are going to see "Undo delete popup" window.
And as you understand, when you press CTRL+z in Android Studio, which (XML or Java) file is active, you will undo the action on that tab. So, if you click any file on the left side and press the CTRL+z combination, you will undo the action at the file structure.
Go to View > Recent Changes > Click on the file you want to recover > Click "Revert"
Im late but this works. Go to the folder where u want to recover. right-click, local history. select ones you deleted and click revert. :)

Visual Studio 2012- How do you delete a new file?

I have Visual Studio 2012 with TFS. I created a new file (call it "x.h") and before I checked it in I decided I didn't need it.
MSDN makes it sound so simple:
In either Solution Explorer or Source Control Explorer, browse to the folder or file that you want to delete.
Select the items that you want to delete, open their shortcut menu, and choose Delete.
When you are ready, check in your changes.
So I went to Source Control Explorer, right-clicked the file, and chose Delete. It was removed from source control and my pending changes but is still on disk and in the Solution Explorer. When I right-click the file in Solution Explorer, Delete is not an option and Exclude From Project is disabled.
I might have more luck if I check it in first then delete it but that seems very unnecessary. Hopefully I'm just missing something obvious!
How do I delete this new file ("x.h") from my solution?
Yep. It was something obvious.
You can't delete files from the Solution while it is building.
I just tried again and the Delete option magically reappeared. I realized that it has stopped a build since I last tried.
In short, there are three different angles that a user can try to delete a file while a build is occurring and the behavior is different for each.
Undo the file add from Pending Changes -> Nice error messages are given.
Delete the file from Source Control Explorer -> It lets you remove the file as I described in the question but leaves it on disk and in Solution Explorer (same behavior regardless of whether or not a build happening).
Delete the file from Solution Explorer -> It quietly prevents you from shooting yourself in the foot and doesn't explain why.
The right way to do this is to cancel the build (or let it complete), then delete from Source Control AND from Solution Explorer.

How to tell VS2012 C# debugger where to find sources

I'm trying to debug a third-party library. I have it's .pdb and sources. I put .pdb near my dlls. When I step-into third-party code for the first time, VS2012 asks where are the sources. I pick the correct file and everything is fine. Now, I'm rebuilding my code with another version of the same third-party lib. I have another version's .pdb and sources. When I step-into, it doesn't ask where are the sources, instead, it just connects to the SAME SOURCES it connected at the first place. I can close the file and open file from new sources, but each time I press F11 to step-into another file, it continues to open files from the old location.
Visual Studio remembered the selection you made and stored it in the hidden .suo file in the solution directory. You can edit it. First ensure that the Solution Explorer window displays the solution name (similar to "Solution 'name' (x projects)"). If not then use Tools + Options, Projects and Solutions, tick the "Always show solution" checkbox.
Right-click the solution in the Solution Explorer window, Properties, Debug Source Files setting. You should see the directory you added in the original debug sessions. Delete it and add the new directory.

Resources