Ctrl+click on function call shows declaration definitions in Scratches files

I don't understand this. Scratches and Consoles are not part of committed code, they shouldn't be considered part of the traceable code for the project. The app has no access to the Scratches folder on my local box. My deployed code will not be on a server containing a PHPStorm Scratches folder. There's zero reason files there should be connected to code files when trying to figure out which declared function is being called.

I run into this if I have a file in Scratches and Consoles that happens to contain a function that matches one in a repo file. You can emulate this yourself by copying a code file (procedural or class-based) and pasting it into a Scratches folder. Upon reindexing, Ctrl+clicking a function call in a file in the repo will show two declarations, one from the repo and the other from the Scratches file. This makes no sense.

I understand that scratches have some unique purpose related to the project, but I see no reason why code tracing should check for files there when there's no way anybody's going to copy over their PHPStorm Scratches folder to a production server, that's silly. I'm using the folder for notes and tmp files (like scratch notes in a physical notepad). Relating tracing is like saying the scratch note on your notepad on your kitchen counter is going to be referenced in a board meeting's keynote presentation, but of course that note won't be there. That's ridiculous. 

1 comment
Comment actions Permalink

Can't reproduce this: https://i.gyazo.com/720eaea98eb24e7bdb1e3b8bc802d515.mp4.

I'd appreciate if you could provide a similar screencast or set of screenshots that would show this.

Also, please make sure you're running the latest IDE version.


Please sign in to leave a comment.