Search code examples
phpstormjetbrains-ide

Console command for opening files inside already opened project in PhpStorm


I've faced the problem. I use PhpStorm to edit files from FTP server using WinSCP client. In WinSCP client I've set command for using external editor. So, when I try to open php-file from remote FTP server WinSCP downloads this file in temporary file and open it using command provided by me - "C:\Program Files\JetBrains\PhpStorm 2020.1.1\bin\phpstorm64.exe" "!.!"

Earlier, when I used PhpStorm 2019 or 2018, it opened file in already opened window/project. But when I've upgraded to PhpStorm 2020, it started to open file from FTP in separate windows. It's so annoying and some functionality doesn't work in such case (auto suggestions and others).

I know that I can use built-in remote files browser within PhpStorm to view and edit remote files, but I accustomed to use separate FTP client for such purposes.

Does somebody know how to fix this problem? What console command should I use so as to open separate file in already opened window/project?

enter image description here

enter image description here


Solution

  • It's a LightEdit mode: https://blog.jetbrains.com/idea/2020/04/lightedit-mode/

    Since 2020.2 you can use the -p (--project) option instead to force opening files in already opened project windows. For example idea -p myfile.txt. IDEA-237118


    You can also permanently disable that mode by following these steps:

    • Invoke Help | Find Action... (or via Search Anywhere: use Double Shift and switch to Actions tab)
    • Search for Registry... action and select it
    • Once in the Registry dialog locate light.edit.file.open.enabled entry (just start typing, speed search will narrow it down) and set it to false (uncheck the box).
    • Not sure if IDE restart is needed (probably not).