开发者

Eclipse JavaScript project "was not validated since its include path is incomplete."

开发者 https://www.devze.com 2022-12-08 16:28 出处:网络
I am using Eclipse and would like to start using the JavaScript validation tools which are now available. I think this is version 3.4, but Help|About... doesn\'t show the version number, only tells me

I am using Eclipse and would like to start using the JavaScript validation tools which are now available. I think this is version 3.4, but Help|About... doesn't show the version number, only tells me that it's build 20090920-1017.

This is a pre-existing EJB/JSP application to which I added the "JavaScript Toolkit" facet.

The issue at hand is that JavaScript validation doesn't run. It shows a single Error under "JavaScript Problems" with the message:

The project was not validated since its include path is incomplete. Cannot find the class definition for String. Please fix the include path then try validating this project

In Window|Preferences|Web|JavaScript|Include Path, "JavaScript global context root" is set to "Project" (the default). "User Libraries" is empty.

In the Project Properties under 开发者_开发百科"JavaScript|Libraries" there are four tabs: "Libraries", "Global SuperType", "Source", and "Projects. There is no "Include Path" setting here.

The "Libraries" tab contains "ECMAScript Built-in Library", "Web Project support for JSDT", "ECMA 3", Firefox and Internet Explorer "Browser Support Library". Selecting "Add JavaScript Library" shows not additional options beyond these.

The "Global SuperType" tab lists the three support libraries (all unchecked) and shows the "Default 'SuperType' as "Global() in ECMAScript System Libraries".

The "Source" tag shows "Included: (All)" and "Excluded: *********/*******.ycomp.js;*********/*******.jsp"

The "Projects" tab's "Referenced Projects" list is empty.

All JavaScript settings are default, with the exception of the "Excluded" path and addition of the Firefox and Internet Explorer libraries. The error appears regardless of these settings, however.

Questions:

  1. Are the Preferences and project settings correct (most are defaults)?
  2. What settings are missing or incorrect?
  3. Are there other related settings which I should look at?
  4. What is missing from the include path?
  5. How to correct the configuration so that JavaScript validation can be used?

EDIT: this is version 3.5. Found it by opening Help|Report Bug or Enhancement|Eclipse.org|Eclipse Platform, and it pre-filled the version number in the bug report form. Is this really the only way to find the version of an Eclipse install? I'm really surprised not to see it in Help|About.

EDIT: I can run validations manually, and I get lots of other errors:

  • Array cannot be resolved to a type.
  • HttpRequest cannot be resolved to a type.
  • The type Function cannot be resolved. It is indirectly referenced from required library files.
  • The type Number cannot be resolved. It is indirectly referenced from required library files.
  • The type Object cannot be resolved. It is indirectly referenced from required library files.
  • The type String cannot be resolved. It is indirectly referenced from required library files.
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号