Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuring PHPStorm for Platform #55

Open
AngryWookie opened this issue Aug 7, 2014 · 6 comments
Open

Configuring PHPStorm for Platform #55

AngryWookie opened this issue Aug 7, 2014 · 6 comments

Comments

@AngryWookie
Copy link

Since I have started using Platform I've been running into an issue that has caused frustration and I wanted to get feedback from the Platform team, or anyone that has run into this, as to how we handle this issue. The issue has to do with the way Platform creates a new folder in the 'builds' directory then uses a symlink for the www directory to actually display the site. This is causing a number of issues in my IDE (PHPStorm) and I have yet to find a good way to resolve it. By having so many items in the builds folder it makes things like object search and jumping to a declaration a bit trickier because I end up getting presented with a dialog asking me which object or declaration I'd like to look at, this list continues to grow as more builds are created. This adds a bit of extra time and adds the possibility I might click on the wrong one and be looking at out of date information. The number of builds also increases index time which can sometimes bog down the IDE/machine.

I've tried marking the builds folder as excluded in my PHPStorm project but when I do that it makes debugging more complex. Each time a request is made to index.php it throws an error because that is now outside the scope of the project. I can configure PHPStorm to map the symlink properly but the next time I do a build I have to recreate that mapping in the IDE.

I'd just like to know if there are any suggestions on how to work around this. So far I've just accepted it but I'm afraid this is the sort of thing that might push people off when they try Platform.

@Kazanir
Copy link
Contributor

Kazanir commented Sep 4, 2014

At a minimum this should be easier with the recently-implemented project:clean command. I'll get with you and try to work out some of the other use cases in the near future.

@DuaelFr
Copy link
Contributor

DuaelFr commented Oct 2, 2014

I suggest you to open the repository folder in phpStorm, not the root folder. Then, you can just add the www folder as an external library when you enable the Drupal support.

@pjcdawkins
Copy link
Collaborator

@DuaelFr good tip

If you do open the project's root folder, you should mark the builds directory as Excluded, and mark www as a Resource.

@marcvangend
Copy link

I can't get this to work properly, it seems that every approach has one or more disadvantages.

The suggestion made by @DuaelFr will probably work for certain projects, but not for mine, because we have some 3rd party php libraries in www.

The method of @pjcdawkins has the disadvantage that PhpStorm keeps popping up a dialog when I want to navigate to a function delaration (Ctrl-click or Ctrl-B) in a custom module. You can solve that by marking the respository directory as excluded as well, but then you don't get the built in Git status and diff because you always open files from the www directory.

I did try other solutions but I only got tangled up in path mappings, errors, and debugging problems. All help is appreciated.

@pjcdawkins
Copy link
Collaborator

Hm. With my method I'm not getting a dialog for function declarations. Just to confirm, it looks a bit like this:

Screenshot

@jurgenhaas
Copy link

@pjcdawkins that'S correct, declaring the builds directory excluded does solve that one problem but it leaves us with the problem that the debugger is complaining because the debugger doesn't know about the sym-linked directory, it comes from the original build directory.

What would solve the problem is if the --copy option to the build command would work as expected, but it doesn't seem to work - or I mis-read the documentation. I have reported an issue for this at #344

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants