Rename project folder

已回答

Neither renaming the project (File > Project Structure > Project name) nor the module (Refactor > Rename) changes the folder name at /Users/USERNAME/IdeaProjects.

Must it be done manually or is there a way in-app?

7

You can rename from inside the IDE via "Project files" view of the project tool window: 

5

I just tested on a new project. It was originally named "untitled" and I used Refactor to rename to "untitledRenamed", but the folder remained "untitled"; see attached screenshots.

1

See the top pink arrow on my previous screenshot. 

It is needed to choose "Project files" in the dropdown where you have "Project"

4

Ah. That works. Thanks!

0

I'm using IntelliJ IDEA 2022.1 (Community Edition) and if I follow Konstantin's steps, clicking on the root directory named "Java-Tutorial-Expressions,-Statements,-Code-blocks,-Methods-and-more-Keywords-And-Expressions-Source-code"  and choosing refactor/rename KeywordsAndExpressions, the end result is



Directory remains "Java-Tutorial-Expressions,-Statements,-Code-blocks,-Methods-and-more-Keywords-And-Expressions-Source-code", project name changes to "KeywordsAndExpressions"
Searching the project, I can see the new project name appears in .idea/modules.xml and .idea/workspace.xml


0

Ricardo,

Have you switched from "Project" to "Project Files"?

1

Hi @...

I tried your suggestion and after switching to project files and trying to rename the folder I get an exception

0

Could you please check error in idea.log ("Help | Show Log in...")?

0

I'm not sure which error could be related to it as the log is huge but I managed to figure out the reason. If the terminal is open on the bottom and you try to rename the project directory, it can't do it. Closing the terminal allowed it to rename the project directory.

There is a catch though. The mappings in remote hosts still point to the old directory and I had to manually alter them.

Also if the directory contains dots in the name, you need to click on the lower end because it shows a tree structure that doesn't actuallyexist

0

Thanks for information!

There is general issue about project renaming: https://youtrack.jetbrains.com/issue/IDEA-144652/Renaming-projects-and-modules-is-too-complicated

If folder is located under sources root then dot is threated as packages separator.

0

It is impossible to choose “Project files”.  See screencast.

0

Hello! 
Project and Project Files are scopes in Project tool window. You can find more information about this in the documentation: https://www.jetbrains.com/help/idea/project-tool-window.html#views

In RustRover, Refactoring cargo package  updates the package name in the Cargo.toml file under the [package] section.

0

请先登录再写评论。