IntelliJ IDEA Can't Resolve Directory

Answered

 

I have a web site project folder that looks something like this:

/
/css/
/includes/public.cfm
/js/jquery.js
index.cfm

My index.cfm file includes the content from the /includes/public.cfm file. The public.cfm file has references to various .css and .js files in it like this:

/includes/public.cfm
------------------------
<base href="http://localhost/mysite/">
<script type="text/javascript" src="js/jquery.js"></script>

The problem is that IDEA can't find the file /js/jquery.js and shows a "cannot resolve directory" inspection error even though the file does exist in the project structure.

How can I tell IDEA to always look at my project root for resolving directory locations? It would be great if it could first look relative to the current folder and then look relative to the project root.

Note: when the web site gets deployed to production, it will reside at www.mydomain.com but it should also be able to reside in a sub folder for development purposes.

2 comments

Hello,

We have related request on YouTrack: https://youtrack.jetbrains.com/issue/IDEA-83147

Feel free to vote for it and leave comments.

 

0

Thank you Yaroslav.  I see that feature request was created way back in 2010. Hopefully it is something that can be implemented in the near future.

0

Please sign in to leave a comment.