Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Move" refactoring in IntelliJ doesn't works with input

I am using Python plugin to handle Python code inside an IntelliJ Java project.

I have selected refactoring "Move -> move everything to another directory..." but it doesn't update the imports!

Example, I have:

import my_server.my_project.helpers.cumulative_functions as cf

That instead should be now

import my_project.helpers.cumulative_functions as cf

Have I done something wrong? Is there a way to fix that?

like image 237
Lore Avatar asked May 27 '20 09:05

Lore


People also ask

How do I refactor imports in Intellij?

Press Ctrl+Alt+S to open the IDE settings and select Tools | Actions on Save. Enable the Optimize imports option. Additionally, from the All file types list, select the types of files in which you want to optimize imports. Apply the changes and close the dialog.

How do I refactor a method in Intellij?

Press Ctrl+Alt+M or from the main menu, select Refactor | Extract | Method. In the dialog that opens, configure a method options, such as visibility, parameters, and so on. You can also change a name of the method if you need. Click OK.

How do I move a package in Intellij?

Move Package Dialog Click the ellipsis button, and select the target package in the Choose Destination Package dialog that shows a tree view of all packages within the project. The content of a package is moved along with the package from the old location to the new destination package.


1 Answers

This is common in PyCharm and IntelliJ

The problem here is working directory and run/debug config

Even when you move files, wd stays the same

It is a confirmed bug, but it's not still fixed

You can vote for it to be fixed faster

like image 99
A random guy Avatar answered Oct 26 '22 10:10

A random guy