Renaming project name shown in JetBrains Toolbox - jetbrains-ide

I've recently made a new Empty Project in IntelliJ IDEA and added a couple Gradle based modules to it. The project and the modules are under W:\IJ Workspace\ProjectName directory - the project itself is in W:\IJ Workspace\ProjectName\ProjectName folder, and the modules are in W:\IJ Workspace\ProjectName\ModuleName folders.
JetBrains Toolbox shows the project and its correct directory (W:\IJ Workspace\ProjectName\ProjectName) but the name it displays - is the name of first module I created in the project, not ProjectName. Is there any way to change the name Toolbox is displaying for that project? Or is there a way to manually add a project to Toolbox, forcing it to use its actual name?

Do this while IDE is closed (at very least while that project is closed).
Locate a folder with project settings (.idea subfolder, usually that would be PROJECT_ROOT/.idea).
See if you have .name file there. If not -- create new one.
Open that .name file in any text editor and write desired project name there -- it's a plain text file with a single line of text (no new lines).
Save the file and launch IDE.
Next time you open that project is should use the name from that .name file.
P.S. This works in PhpStorm (where IDE also has a special "Rename Project" action) but should work in IntelliJ IDEA (and other IDEA-based IDEs) as well.

Related

Sublime Text 3: How do I have multiple workspaces associated with the same project file?

Say, I have two windows, each containing several open tabs, and I want that "structure" to be viewed as one – either a project or a workspace, I do not care. All I want is to be able to close and then re-open both the windows via a single "open" operation.
As far as I understand, usually a workspace corresponds to one window (possibly with multiple tabs); on the other hand, I've seen it mentioned several times that multiple workspaces can correspond to the same project (file).
How do I achieve that?
If I try to add a new workspace to an existing project via Project → New workspace for project, that seems to work at first, but then if I, say, close the project, close the editor, open a new empty window and use "Open project…" – I end up with just one of my two windows re-opened.
The created .sublime-project file is essentially empty: all it has is "{}". What shall I place there to have two workspaces associated with that one project?
Thank you!
Project or workspace in sublime is essentially about paths, for saying if you are working on the a project in /depot/project_a/..., you can set up a sublime project under /depot/project_a/project_a.sublime-project, then in that project you add "." as your folder. then you can set up another sublime project under /depot/project_a.sublime-project and add "project_a" as your folder in that second project. Sublime text will recognize them as different project although they are literally the same one.
Then you can have 2 windows on the same project but have their own files opened.
I help I explain clearly and it will help you.

Missing project.gradle in Android View

In Android Studio, project.gradle file is not show when in Android View, but is when in Project view
Android View
Project View
How can I fix this ??
From the Gradle Tool Window in Android Studio (View > Tool Window > Gradle),
Right click on the the project's Gradle config with (root) next to its name.
Click on Ignore Gradle project,
and right click again then click on Unignore Gradle project.
The trigger to this 'buggy' phenomenon actually lies outside your project folder.
Assuming a project name of 'SilverBirch', try this:
(a) Close the project in Android Studio 3.0.1.
(b) Rename your project folder (inside the workspace folder) to 'SilverBitch'
(c) Re-open it via Android Studio (you obviously can't do so using 'recent projects')
(d) You should get a window titled Import Gradle Projects with text that reads: The modules below are not imported from Gradle anymore. Check those to be removed from the ide project too:
(e) Tick the (old) project name and click OK.
(f) At last your 'Android' view shows build.gradle(Project:SilverBitch)
(g) Repeat whole process, renaming back to original.
Alternatively, if you're insane, do this:
Locate the project.dat file AND folder for your project - it will have a path that looks something like this (assuming Windows)
C:\Users\<userid>\.AndroidStudio3.0\system\gradle\Projects\5be1ee38\project.dat
[The system-generated hex-string container name will vary, but the file is always project.dat]
The first line of this file references the 'missing' build.gradle and will clearly identify the owning project.
Delete the file AND its containing folder then re-open the project via Android Studio.
Because googling 'project.dat' yielded nothing, and because I made a rude assumption that this contained only system-generated data, and because I couldn't resist 'seeing what happens' I actually deleted
the entire Projects file [C:\Users\<userid>\.AndroidStudio3.0\system\gradle\Projects]
So far, so good - no serious side-effects yet! Maybe those plugins needed re-specifying anyway? etc.
Close Android Studio -> Remove project .idea folder -> Open Android Studio -> Open your project. This worked for me!
NOTE: when you remove .idea folder you will also lose project related preferences (such as XML code style for project)
Right Click on "Gradle Scripts"
Click Load/Unload modules
Load unloaded project module
Done
In my case, I found that my project.iml located in project/.idea
So I move it to project/
and change one line like following:
<module fileurl="file://$PROJECT_DIR$/My_Project.iml" filepath="$PROJECT_DIR$/My_Project.iml" />
the old one should look like this:
<module fileurl="file://$PROJECT_DIR$/.idea/My_Project.iml" filepath="$PROJECT_DIR$/.idea/My_Project.iml" />
After that, go back to android studio, every thing seems perfect!
This worked for me:
In your root project folder, open the *.iml file, and make sure that the value in module external.linked.project.id=, the *.iml filename, and the project directory name are all the same.
Now my build.gradle (Project: X) shows.
This worked for me.
Simply go to your AndroidStudioProjects Directory.
Search for your Project
Rename it with some other name
Strat your Android Studio, and then Import Project (Gradle, Eclipse ADT, etc.)
mode. let the Gradle Build Finish.
And that's it.

old file name stuck at the top of sublimetext

Very strange issue here, it's not causing problems but is aesthetically annoying. I had the kindle plugged into my windows machine as to edit the kindle's files. One of the kindle file names is now listed after the name of the python program I'm working on in sublime text. To paint a picture, above the menu drop downs in sublime text, there is the path to the document (IE python program) I'm working on, followed by the random file from the kindle.
The kindle file is no longer on my computer and never had anything to do with sublime text. I've tried restarting the computer and reinstalling sublime text, neither worked. Any ideas what might be going on??? Thanks!
The sublime text window caption shows you the name of the currently open file, followed by the name of the current project in parentheses (if you have a project open at all), followed by the name of the program.
Based on the screenshot in your image:
You currently have the file softmax.py open and it is stored in a folder on your desktop named machine learning\python programs\test\newyorktest\
The name of the Sublime project file is Casting the Circle_A Woman's Book of Ritual_B009FKTQD8_sample.sdr.sublime-project (the caption doesn't show the sublime-project part because that's redundant).
I would imagine that when you set up the project you accidentally chose that name as the name of the project file.
In order to fix your problem, select Project > Save Project As... from the menu and enter a different name for it. The location that you save the file in doesn't matter (it can be inside the folder of your project or in some other location), all that is important is that it has the extension .sublime-project.
Once you pick the new name, Sublime will immediately swap to using the new project file instead of the old one, which will keep your current set of open files, etc, and the caption will change.
You can then seek out and delete the other project file if you want.

How to create new res folder in Android Studio

I want to add localized strings for my android app. Therefore I need a values-xx folder in my Res folder.
The original values folder has a blue dot, so I tried creating a new Package, but a package can't contain a hyphen so this must be wrong. Instead I tried right-clicking res and choosing New -> Android resource directory, but this time nothing happens. No dialog or reaction of any sort as I can see.
How do I create a values-xx folder?
Edit: I can create the folder from file explorer and it all works good. It is just irritating to not be able to do it from inside Android Studio.
Edit2: This bug is fixed in newer versions of Android Studio.
When you are in the Android view (rather than Project or Packages) in Android studio, you just need to right click the "values" directory and choose New > "Values resource file".
That gives you a chose of different resources you can add. For example, if you want to add a different language to your app you can choose the Language option and press the ">>" button. If you want Swahili then select that from the list, type "strings" for the file name, and press OK.
Android Studio will automatically create a values-sw directory with the new strings.xml file in it. And in your Android file view you conveniently see both strings files together.
And it is a similar process for adding other types of resources (see my other example). You no longer have to manually add the directories (but you can do that too by right clicking the res directory and choosing New > Android resource directory).
I had the same problem, what I did was create a values-xx folder inside the main directory (main>>right click>>new>>directory) and then moved that folder to res/ directory.
It's not beautiful but it is a workaround to create a folder with Android studio.
This bug is fixed in newer versions of Android Studio.
The values-xx folder we created is not showing, but when we create a file its asking
=>I have created values-21 folder and then tried with creating an xml and it asks for choosing a directory
=>I have updated to Android 1.02
Check the values-21
Lets assume i Want to create a folder named "Daylight" under res.
Step 1:
Right click on res.
Step 2:
Then go to New.
Step 3:
Then go to Folder.
Step 4:
Then go to Res Folder Option and select.
A window will be open.
Step 5:
At that window check the unchecked box "Change Folder Location"
and as assumed we have to create folder "Daylight"
Step 6:
SO name the newly created folder as daylight, in this format. src/main/res/Daylight
Step 7:
Then, Finally Click finish.
If you have already created a new directory but just don't see it in the Project Tools window. Do this
Click on Project Tools window >> Android(Drop Down) >> Click Project.
Now you'll see all your Directories in res. See the picture:
Its very simple. I too had trouble initially.
Lets break it stepwise:-
1) Open your project
2) Right click the res folder
3) Choose New
4) Chose Directory
5) Name the directory.
Thats it!! It works for a fresh project everytime!
For those finding this answer when trying to add a new res folder to a library.
Right-click java/kotlin folder > New > Folder > Res Folder

Renaming Controller classes in MonoTouch MonoDevelop

What is the the best way to rename a class which inherits a UIViewController and has a designer.cs class linked to a storyboard?
I first tried to Rename the .cs file in MonoDevelop. This worked but the designer.cs file did not get renamed with it, and neither did the class name.
I then renamed the class name. This successfully changed the class name in both the .cs and .designer.cs files but still did not change the .designer.cs filename. It also did not change the name of the "Custom Class" for the controller in Xcode.
So in XCode I changed the name of the Custom Class and saved then switched back to MonoDevelop , to my horror it had created a new .cs with the same name as the renamed one and a new .designer.cs file which it put under the original (renamed) .cs file next to the old (not renamed) a.designer.cs file!
Can anyone tell me the sequence of steps I should have taken?
Renaming the file is tricky, since MD doesn't support renaming grouped files. You'd have to manually edit the csproj, or remove the files from the project, rename in Finder, and add them back.
Renaming the class is somewhat easier, but the key is to understand that the class actually has two names - the .NET name, and the Obj-C name. Renaming the .NET name should be easy, you can simply use the rename command in MD.
The Obj-C name is applied to the class on the [Register("SomeName")] attribute, and is the name that's used in xibs and in Xcode. However, beware that MonoDevelop will attempt to create .NET counterparts of any classes that it thinks were created in Xcode. This means you should change the Obj-C name in MonoDevelop first, then switch to Xcode and change the Custom Class there.
You have to go into the .csproj file and add a tag. For example:
<Compile Include="MainWindow.cs" />
<Compile Include="MainWindow.designer.cs">
<DependentUpon>MainWindow.cs</DependentUpon>
</Compile>
This will then show the correct relationship between the files in the MonoDevelop project window.
Incidentally, my experience so far is that this dependency is purely for convenience. Add the new designer.cs file into the solution and the code compiles just fine: dependency seems to be a sort of documentation.
ALSO: To delete or rename these dependent files, you can't do that in the MonoDevelop project pane: you do have to go to Finder (if you're in OSX, Explorer if you're in Windows) and deal with the files there, to rename or otherwise manipulate them, THEN repair the MonoDevelop csproj file by hand. The good news is, it's not hard, and it works fine when you do this, and you get a cool new hardcore understanding about how the project is knit together.
Many people also has to think about the version control system. This way works for me:
Quit MonoDevelop
In the version control system, rename the files
Open the csproj file in a text editor - search&replace
Open MonoDevelop
Open the XxxViewController.cs - search&replace
Open the XxxViewController.designer.cs - search&replace
Open the XxxViewController.xib - search&replace
You might be tempted to use Refactor/Rename instead of search & replace in step 5 but that will cause MonoDevelop to rename XxxViewController.designer.cs to XxxViewController_1.cs for some reason.
Also, you might be tempted to remove the files from the project before renaming them in the version control system and then add them back into your project again (so that you won't have to edit the csproj file manually). This will work but the "DependentUpon" part will disappear from the csproj file, which causes the designer file to not be below its counterpart. No big deal but it looks less nice in the Solution Explorer.
I tried all the solutions above and didn't work. Finally I just used the "Replace in Files" looking the whole solution. After that I did a "Rebuild" in the project and worked fine.

Resources