Structure for hybrid files

I got some files that contain JS code as well as PHP code with the file extension .js.php .

IDEA correctly inspects PHP and JS as that language they are.

I handle those files as JS files with some implemented PHP code, but IDEA treats them as php and thus only builds the structure (in the structure view) for php.

Is there a way to manually set it to "this is a js file with a php extension"?

I have tried setting the file type for .js.php to JavaScript but that had only the effect that I got many xml and statement related errors, becuase the PHP code was treated as wrong JS code.

 

(An alternate way would be to exclude/comment certain lines from being analyzed so that the "wrong" PHP lines do not disturb the JS code flow when .js.php is recognized as a JS file.)

Please sign in to leave a comment.