Using IntelliJ for a PHP project without having to select a JDK?

Answered

Hi,

 

I am working on a PHP project in IntelliJ Ultimate 2019.2 and it seems that I need to setup a JDK if I want to be able to dp a "right click, analyze, inspect code" on the whole project, even tho I deactivated all "Java" inspections in the settings for this project.

So I selected a JDK (I picked 12) and I now have some "random" CSS classes in the auto-completion, and some random JS variables in there too, coming apparently from that JDK.

 

So is there a way to have no JDK and still being able to run "analyze / inspections" on the project?
If not, is there some "blank" JDK I could use so the CSS and JS completions are not showing up stuff from the JDK?

 

Note that I cannot "remove" Java support from IDE, as I need it to develop some other projects (including a PHP plugin).

 

Thanks!

0
2 comments

It looks like you are using Java modules instead of the Static Web modules, hence the problem. Please see https://stackoverflow.com/a/49250636/104891 for the solution.

0
Avatar
Permanently deleted user

Ooooooh, neat! Excellent, I was indeed using Java instead of Static Web module. Thanks a lot !

 

Edit: Last thing still, how can I tell intellij that my "sources/www" folder is my web root directory? With java module, I only had to mark it as "resources root", and I got autocompletion of <img src="..."/> and such. I did the same with "Static web" project, and marked "sources/www" as "resources root" (it turned purple), but I don't have the completion?

0

Please sign in to leave a comment.