Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to auto-import namespaces for whole PHP file in phpStorm?

How can I do something like NetBeans does with "Fix Uses..." (Ctrl+Shift+I) in PHPStorm, so I can fix FCQN in my project files?

What I already found is Alt+Enter on class name, but how can I do it for whole file?

like image 490
Jarek Jakubowski Avatar asked Jun 03 '15 10:06

Jarek Jakubowski


People also ask

How to import in PhpStorm?

Import multiple CSV files into a databaseNavigate to the files that contain delimiter-separated values, select them, and click Open. In the Import "file_name" File dialog, specify the data conversion settings for every file. You can go through the files in the Sources pane. Click Import to import the files.

How do I automatically import packages in Intellij?

In the Settings/Preferences dialog ( Ctrl+Alt+S ), click Editor | General | Auto Import. Select the Add unambiguous imports on the fly checkbox, and apply the changes.

How do you auto import on Webstorm?

In the Settings/Preferences dialog ( Ctrl+Alt+S ), go to Editor | General | Auto Import. On the Auto Import page that opens, use the checkboxes in the TypeScript/JavaScript area to enable or disable import generation on code completion.

How do I sort imports in Webstorm?

If we want to go a step further and sort the imports, we can go to Preferences / Settings | Editor | Code Style | JavaScript or TypeScript and select Sort imports by modules on the Imports tab.


1 Answers

Currently you can't do this for a whole file. You are able to import on the fly, as documented here, but not for a pre-existing file. You might consider making a feature request for this.

like image 118
Quentin Skousen Avatar answered Sep 28 '22 09:09

Quentin Skousen