3

I've tried to get Aptana studio 3 to provide dojo 1.7.1 code-assist without success.

AMD - Asynchronous Module Definition.

Using asynchronous module loading (via AMD support in dojo 1.7) on a simple web page:

require([ "dojo/dom", "dojo/fx", "dojo/_base/fx", "dojo/_base/array", "dojo/domReady!"], 
    function(dom, fx, fxbase, array) { ... });

How do I get code-assist on variables dom, fx, fxbase, ...?

hugomg
  • 68,213
  • 24
  • 160
  • 246
shawnT
  • 398
  • 2
  • 8
  • I don't know what you are using "AMD" for, but I can tell you that you are the only one using it so in the first twenty results for http://stackoverflow.com/questions/tagged/amd . Perhaps you should expand it, just in case the acronym is widely used to designate something programming-related other than what you mean. – Pascal Cuoq Dec 28 '11 at 19:37
  • @Complicatedseebio: He is referring to [AMD modules](http://requirejs.org/docs/whyamd.html), one of the big new features in Dojo 1.7. I don't know what is the correct SO tag for it though. – hugomg Dec 28 '11 at 19:56
  • @missingno Let's try "dojo-amd" and see if it catches on. – Pascal Cuoq Dec 28 '11 at 20:06
  • I'm newbie with javascript documentation, but I wonder if the AMD api is _fundamentally incompatible_ with javascript 'code assist' techniques. Unless the IDE understands `require()` syntax, how can it know the types of variables 'dom', 'fx', and so forth, and hence provide code-assist? – shawnT Dec 28 '11 at 20:16
  • 1
    @Complicatedseebio: turns out there already is a "js-amd" tag that fits the bill – hugomg Dec 28 '11 at 20:40

1 Answers1

2

Aptana may not be able to deal with AMD on its own, as the syntax is relatively new. However, Aptana used to be able to consume a metadata file from Dojo's release. That wouldn't help you with code completion for your own AMD code, but it might help with Dojo methods. It might have been this one, but I'm not sure what the process was for Aptana to consume the file.

peller
  • 4,435
  • 19
  • 21
  • thanks for the link, but I've tried that file and it doesn't seem to help with code like my example. That's why I tried to be specific with the "dom, fx, array" variables which are injected instances of dojo's dojo/dom, dojo/fx, and dojo/_base/array respectively. I'm after code completion for those established interfaces. – shawnT Dec 28 '11 at 22:00