Recognizing Javascript function
I think a made some fundamental mistake in organizing a new project.
My main page (index.php) is loading a JavaScript file (ajax.js) with all my functions. The page uses ajax (and PHP) to change what the user is seeing.
In one of those Ajax PHP scripts (gettours.php) I use a JavaScript function from the ajax.js file but PHPStorm does not recognize the function. I get the warning "Expression statement is not assignment or call" in the gettours.php file and the "Unused function" in the ajax.js file.
Please sign in to leave a comment.
Was it working before? In some cases PhpStorm is unable to find function definitions inside injected JS fragments, e.g.: https://youtrack.jetbrains.com/issue/WI-43607. We would need to take a look at the project to be sure what's causing the problem.
No it was not working before.
How would I provied the project so that you could look after it?
You can archive & upload it using our file hosting: https://uploads.jetbrains.com. Files aren't publically visible, just let us know the ID of the upload
Thanks. The ID is 2020_10_22_2e3m2wp5Th91VwAt
Thanks for the example! That's exactly https://youtrack.jetbrains.com/issue/WI-43607. Happens because of concatenated argument in the switch_unload argument.
I've added this case as a private comment to the bug report.