Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "VJET/JS code assist and validation for two or more js files"
(5 intermediate revisions by one other user not shown) | |||
Line 31: | Line 31: | ||
Here is the example project that you can import into eclipse and try it out yourself. | Here is the example project that you can import into eclipse and try it out yourself. | ||
− | [[ | + | [[Media:jsassistacrossfilesexample.zip|jsassistacrossfilesexample.zip]] |
− | [[Category:VJET]] | + | [[Category:VJET|JsCodeAssist]] |
Latest revision as of 01:10, 17 January 2013
For code assist and validation to work between 2 or more js files you must add a vjetdoc comment at the top of the file. Below illustrates how this works.
1. Create a VJET project with two JS files firstfile.js and secondfile.js
src/firstfile.js
src/secondfile.js
2. Add the contents such as the following:
3. Create files secondfile.js and at the top of secondfile.js add this line
//< needs(firstfile)
Then type control + space. Now you will see functions and variables from firstfile.js
That's is it for 2 files.. now if you want to support more than 2 you can add as many needs statements that you want.
Let's update the contents of secondFile.js and add the result variable.
Now we create thirdfile.js and need firstfile.js and secondFile.js (note: the needs statement is case sensitive)
Here is the example project that you can import into eclipse and try it out yourself.
jsassistacrossfilesexample.zip