jrburke / requirejs-intellisense

Enables Visual Studio Intellisense for RequireJS and AMD modules
47 stars 22 forks source link

Anyway to get intellisense into define blocks as well? #1

Open david-driscoll opened 12 years ago

david-driscoll commented 12 years ago

This is a pretty cool little addition. I've tried to hack onto it a little bit, to get intellisense also when working inside define blocks, but I've had no luck so far.

Is there any chance that is a pretty quick fix to make this also work inside define blocks?

jrburke commented 12 years ago

Glad to hear someone trying it out. This is still "under construction".

I'm still getting set up with windows 8 (my vm was too small to install the visual studio beta), so I'm a bit behind on this. @lostintangent might have an idea though in the meantime.

david-driscoll commented 12 years ago

I figured it was very much still alpha, pre-alpha considering VS11 is still in beta itself. I just thought maybe you have some insight. I'll have another shot at it in a week or so, depends on how much work takes of my spare time.

I think the behaviour has to do with what happens inside RequireJS when define is called, instead of require. Obviously it makes sense, since define doesn't invoke the code block until it's required.

I tried to make define fake a require call in the intellisense portion and occasionally that worked, other times it would outright crash VS11. I probably just need a better way to fake the require, so it only happens for the first define, and none of the others that come after it.

We have a pretty complex dependency graph, so being able to access intellisense inside define blocks would be pretty nice.

gudmundurh commented 12 years ago

I'm pretty excited as well - but havn't had any luck getting this to work. Is it VS11 only? (A link to some reference of the mysterious intellisense global would be most welcome, I can't seem to find anything on it.)

Keep up the good work!

jrburke commented 12 years ago

@gudmundurh I believe this is only for the visual studio beta that can be installed into the Windows 8 consumer preview, so for that version of visual studio.

david-driscoll commented 12 years ago

It works with VS11 beta in general. The intellisene object has proper definitions for its methods, it just doesn't show up as attached to the window ( and it shouldn't it is a vs convention. )

I still have yet to find a reliable way for it to work in define blocks but for now I'm leaving it alone, I'm waiting to see if some more bugs get fixed in a later release. On Apr 29, 2012 1:12 PM, "James Burke" < reply@reply.github.com> wrote:

@gudmundurh I believe this is only for the visual studio beta that can be installed into the Windows 8 consumer preview, so for that version of visual studio.


Reply to this email directly or view it on GitHub:

https://github.com/jrburke/requirejs-intellisense/issues/1#issuecomment-5407680

orand commented 12 years ago

@gudmundurh Documentation for the intellisense object can be found here.

orand commented 12 years ago

I just submittted a pull request that makes intellisense work inside define, at least on my machine.