Webstorm Intellisense not working on a named function.

I am learning the basics and ran across this issue.
This is a training course.
Has a js, src="js/animal.js", file with a function:

var Animal = function () {
    this.name = "";
    this.legCount = 0;
    this.feed  = function (food) {
        console.log(this.name + " fed " + food);
    };
};

The html page has these js files referenced as follows:

<script src="js/animal.js" type="text/javascript"></script>
<script src="js/index.js" type="text/javascript"></script>

 

According to the course, if I create an object in js/index.js,

var dog = new A (Intellisense is to occur here to show the function Animal located in animal.js)

But it does not.
If I complete the statement, The parameters for the functions are Intellisensed

I am using Webstorm 2017.3.2

I seem to have the same problem with the jquery.js file. Intellisense does not seem to follow the course.

 

0
6 comments

Works fine for me:

Does completion appear on hitting Ctrl+Space after `A`?

0

You are correct. I started two new projects.

One using the template HTML5 Boilerplate and one Empty Project.
Both worked. So what stops this form working?

The original project: I stripped it of all it's code and entered a new html page referencing only 2 JavaScript files, in correct order, and it does not work.
Webstorm is a great program from what I am learning about it. It has a lot options and features.

I loaded a new project from the files provided by the course, and it works.

There must be an option I set wrong. Any idea what option controls this? Or did a play around so much, I just messed it up?

 

0

>The original project: I stripped it of all it's code and entered a new html page referencing only 2 JavaScript files, in correct order, and it does not work.

Please share a project where this doesn't work (put it on some file server and provide a link here).

Make sure to zip the whole project directory, including your .js files, .html and .idea foilder

0

I zipped it up here: http://hlsm.com/PizzaShop_backup.zip

The index.js just keeps on indexing.

I rem out the jquery call and it stops.

 

0

works fine for me - no extra indexing, completion works as expected:

 

Please try invalidating caches (File | Invalidate caches, Invalidate and restart)

1

I trashed the project. Started a new one works fine.

The index.js was in a loop when the project started. It was indexing and complete and then index and complete.

It was stuck in the that loop.

Thank you. You have been very helpful.

 

0

Please sign in to leave a comment.