Is there a better workflow to find scripts using templates?

I'm working on a project with a LOT of template files, usually mapped 1:1 to script files.

 

When fixing bugs, we do a text search for some text that might be in a template, then work backwards to find the script. Our workflow is as follows:

  1. Find the text (CTRL+SHIFT+F)
  2. Select in Project View (Alt+F1 + click Project View) 
  3. Find usages (with file selected in project view, hit Alt + F7)
  4. Open files (hit return or double-click results in Find Usages panel)

I'm wondering if there's a way to combine steps 1 - 3, so you're just in a file, then you something like:

  • Open related files

I've tried using a macro, but it doesn't seem to setect the correct keystrokes / clicks, or do them in the right place, so rather than opening a file using ENTER it wil just add a new line to the currently opened file.

Many thanks,

Dave

0

Hi there,

I might be completely wrong here (ideas that would not work for you .. or you have tried them already) but anyway...

  • Instead of Find the text .. why don't you try looking by file name ("Navigate | File...")? Obviously, I do not know the importance of that text piece here...
  • If template file name is anywhere in the actual script -- you may try Ctrl+Click on it (with "Navigate From Literal" plugin -- works in PHP files in string parameters, at least). It's not going to be direct jump .. and in some cases might produce too many results (as it looks for files based on file name alone and ignores the path .. so for many files with the same name it will be a problem to use it)
  • To navigate back -- Ctrl+E ("View | Recent Files") .. or another one of that "Recent" family
  • If you have some time (or somebody else in your team) and know Java (or possibly Kotlin) -- you may write custom plugin for such 1-to-1 jumps. For example: http://stackoverflow.com/q/40261275/783119 (you may ask the guy for a source code and see what he will say)
0

Hey Andriy,

Thanks for the input :)

The reason we do the text search, is that it's usually in response to a browser error, so we find the element on the page with Chrome's inspector, then back in PHPStorm search for any text we saw, such as an attribute name, or english-language text like "You have items in your cart".

Once we have the template, we can then work backwards to the script, using the workflow outlined above.

It's not a big deal, to be honest having "Find all usages" is brilliant-enough as it is.

It's a shame macros don't work here - they would be perfect!

0
Avatar
Permanently deleted user

Hello Dave,

Feel free to submit the feature request to our tracking system here: http://youtrack.jetbrains.com/issues/IDEA#newissue=yes.

Pass there all details you mentioned in that post, please.

0

请先登录再写评论。