If I enter the follow JavaScript code in Aptana Studio 3 then I expect some errors but it show nothing.
/**
* @type {string}
*/
var abc = 23;
abc.doesNotExists();
How can I enable the support for closure type annotation?
If I enter the follow JavaScript code in Aptana Studio 3 then I expect some errors but it show nothing.
/**
* @type {string}
*/
var abc = 23;
abc.doesNotExists();
How can I enable the support for closure type annotation?
Currently Aptana supports only the annotations but not also the actual type checking. In order to type check you have to compile that code using the google closure compiler. If you set the compiler to the full optimized mode it will yell the warning that abc is a string ( as you placed it in the annotation comment ), but you have set a number value instead. In order to be able to take this from the command line of the closure compiler and integrate it into aptana you would need a plugin, but as far as i know, the closure plugin for eclipse/aptana has not been updated for the last 1 or 2 years, and also this feature that you would like to have was not implemented in the latest release of that plugin.
In other words, either you run the closure compiler separately and check the for warnings or errors in certain files, OR you fork the repo of the eclipse closure plugin and implement this feature yourself.
I had the same issue as you, but having too much work to do pushed me into opting for the first solution ( running the closure compiler separately in a console ). I had even placed a hook so each time i would save a file in that project it would run the compiler in the console view of aptana so i could check if i had introduced new errors or warnings.
© 2022 - 2024 — McMap. All rights reserved.
23
is a valid value for a variable. – Papule