Javascript intellisense with Dojo/Dijit is Visual Studio 2008 - javascript

I know that Visual Studio 2008 support JavaScript intellisense as I am using it with Jquery. I am wondering if anyone has ever explored how to get other libraries like Dojo and Dijit to work with it as well. I would assume you would have to provide the ///reference tag to your custom code but would still need a vsdoc for visual studio to look in.
Just curious if anyone has tried this or has any suggestions. I might have to hand roll the vsdoc, which might not be too hard based on the api.xml documentation. Thanks for the help!

There is no official Intellisense file for Dojo unfortunately. We could look up the spec and formulate something specific (like we do with Komodo .cix), it is just a matter of using the existing doc parser to scan over the code and generate whatever needs generated.
If you do hand-roll a vsdoc completion file, we'd love to have it. Or if you need any assistance using the doc parser to generate it feel free to contact me offlist (I'm 'dante' # the toolkit domain) and we can see about getting something out there.

We use Visual Assist plugin, and it does pretty well, only thing it lacks is list methods function because of the way you declare objects in Dojo with functions as property values, VA has trouble parsing these. Its OK with old school prototypes though.

They are not officially supported for VS2008, but you may be able to get them to work. Of course, they don't have any of the meta comments in them. If you get any errors, you can create a -vsdoc version of the library and try to edit it to get past the error messages.
JavaScript IntelliSense in VS2010 will be much more robust and you will be able to get good IntelliSense (again without the meta-data) on a much wider range of 3rd party libraries.

Related

How to use localizations in SCEditor? (and general feedback & experiences)

I'm currently evaluating javascript based BBCode editors for a project.
The SCEditor seems to be realy great and got a lot of usefull features.
But can anyone tell me how to use the localizations? I could not find any localization files so I don't know if there are any prebuild languages existing or if i have to create them for my own, and in this case, how they have to look like.
I also could not find any documentation for this, there is just this hint the documentation.
And in general:
How are your experiances with this editor? And are there any other suggestions i maybe should have a look at?
In order to use the localization, that is actually all you need to do. Just include the correct .js localization file and that will be the localization that SCEditor will use for that webpage.
Have you tried doing that?

Code Assist for Javascript Canvas object

I'm stuck (after hours of trying to get unstuck). Main problem is that I would like to have class-specific code assist for javascript objects I retrieve from the DOM. For example,
if I retrieve a element using document.getElementById("theCanvas"), I only get code assist for a generic DOM object (which is logical). I would like to be able to "tell" the javascript editor that this object is actually a Canvas, so that I could then get code assist for the Canvas object.
I've installed Aptana and JSEclipse. With Aptana, I can't even find an Aptana (or Django) editor to associate with .js files. In the JSEclipse documentation (what of it there is), it mentions that you can enable this with JSDoc, but I have been unable to make this work. Also, JSEclipse doesn't seem to support formatting, which seems really odd.
Does anyone know if it is possible to get code assist for this case and/or how to access the Aptana js editor and/or how to get JSEclipse to format? I was thinking maybe you could cast the element object (a la Java), but the only documentation I could find on this says you can only do 3 casts in Javascript (Number, Boolean and String).
Platform: Eclipse Indigo for Java EE Developers (including WTP), Aptana 3.0.8, jdk 1.6.25, JSEclipse 1.5.5
Thanks in advance.
Well, Javascript isn`t strongly-typed and not compilated, this way is more difficult to IDEs to understand what are you meaning while you are writing.
But fortunately, you can use the Console of Google Chrome to help you with that. It knows the attributes and methods of the objects you are using

Generating Haxe externs for EaselJS

Being new to both JavaScript and Haxe, this may have a simple answer, but I've discovered that Haxe has externs port on GoogleCode for EaselJS, but they are out of date and correspond to an earlier version. I've been able to fix errors as they occur during compile time, but I'm still wary that I didn't catch al the new variables and function names.
My question is: is there a simple way to generate externs for a large JS library like EaselJS?
You might want to take a look at Joshua Granick's work with BuildJS:
http://www.joshuagranick.com/blog/2011/10/14/use-buildjs-to-make-externs-for-haxe-js-automatically/
Basically there's a tool called JSDuck which is supposed to compile documentation for JavaScript libraries, and it can output to JSON. He's used the output from JSON, combined with his "buildjs" library to build haxe externs.
He's used it for Sencha Touch, and I've used it for ExtJS, but both of those are Sencha products and their coding style is known to work with JSDuck. You can give it a go with EaselJS, if it works then BuildJS should generate pretty accurate externs.
Otherwise, you might try find the author of the original EaselJS externs and see if they can provide an update, or give you help creating an accurate update. Most of the haxe developers you can contact easily enough using the mailing list or google groups:
http://groups.google.com/group/haxelang?hl=en
I'm a bit late with the answer but you can find the latest (v0.5.0) externs for EaselJs here:
https://github.com/Fintan/easelhx
I generated them using BuildHx (https://github.com/jgranick/buildhx) which is now able to parse YUIDoc comments and then tested them by porting some of the code samples that accompany the EaselJs source.
Right, I did try and install Joshua's tool, but I'm running into an issue with JSDuck.
In the example you linked to, JSDuck is supposed to have a --json param, but the latest version seems to have deprecated that. I'm trying some others using the config file:
{
"--out": "out",
"--guides": "json",
"--warnings": ["all"],
"--": [
"src/easeljs/"
]}
But that doesn't work. The guides param seems to fail no matter what I try.
Creating the json file gives me this ouput:
C:/Users/mycmp/AppData/Local/Temp/ocr374A.tmp/lib/ruby/gems/1.8/gems/jsduck-3.3.0/lib/jsduck/json_duck.rb:36:in `read': Permission denied - K:/Vault/Haxe/myproj/json (Errno::EACCES)
So I'm not sure what to do next. It'd be great to get this working for lots of libraries.
By the way, I'm using the latest JSDuck and Windows 7.

Break up JavaScript file into more manageable, or using different IDE

I use Dreamweaver for development, mostly PHP, html, css, javascript. Is there anyway to break up JavaScript files? or maybe a better IDE that makes it easier to work with? It just becomes quickly difficult to read and find what I'm looking for.
Thank you!
Intellij and/or Webstorm by Jetbrains has the best JS tools I have found. It has very good (as good as it gets, for JS) intellisense (autocomplete for variables and methods) as well as refactoring for variables and methods. You can cmd+click into method definitions from anywhere, as well. Unfortunately you need to pay for them, but if you are using Dreamweaver you had to pay for that. If you are only doing html/css/javascript Webstorm is the way to go.
Yes, you should break up your javascript files into relevant parts just like you break up your php files into relevant parts. The one key factor here is they should be combined and minified before being served up to the browser so the user does not have to make several network calls to your server for each .js file.
Check out Google Minify for an easy solution to that issue.
Take a look at the JQuery source to see how they divvy up their files. Now look at their combined framework, and of course their minified framework. What is actually served up to the user looks nothing like the source.
Uh, Dreamweaver?
Definitely use a different IDE. Aptana won the poll here :)

What is a good javascript editor for editing custom DSL code?

I'm looking for a nice / customisable editor to put on a web page for editing scripts for a custom DSL. Ideally with syntax highlighting (and intellisense would be great! )
Anyone know of anything suitable?
For syntax highlighting, look at EditArea. Intellisense could be written as a plugin.
maybe you should have a look at codemirror:
http://codemirror.net/
it's "just" an editor-component and you will probably have to put some work into it. but it's easy to enhance and integrate it.
You should take a look at Bespin. You have a good description here:
http:// mozillalabs.com/bespin/2010/01/15/bespin-embedded-0-6-released-now-in-two-great-flavors/
It has a full support for being embedded. See the embedding doc :
https:// bespin.mozilla.com/docs/embedding/index.html
You can write a custom syntax highlighting plugin pretty easily if needed.
You can probably fork and adapt one of the built-in syntax highlighters.
The editor itself and its plugins are written in Javascript.
The project is aimed at being a complete web-based & collaborative code editor, so intellisense-like features should make their way in soon if they're no alreay present.
The successor of the Mozilla Skywriter (Bespin) project is ACE: http://ace.ajax.org/

Categories