jrburke / requirejs-intellisense

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

intellisense inside define #3

Closed orand closed 12 years ago

orand commented 12 years ago

These changes make intellisense work inside define, at least on my machine with Visual Studio 2012 RTM. It's possible there are unintended consequences, but so far, so good. I opted to not use setTimeout and it works fine. I tried removing setTimeout from window.require and that also seemed to be fine, but I left that out of my commit, leaving that decision up to you since there must be a reason you used it.

chafey commented 12 years ago

FYI - This worked for me - thanks!

jrburke commented 12 years ago

Thanks for looking into this. I tried a bit over the weekend to look more into the internals to get this to go -- I feel like it would be better to trigger the load event and call onScriptLoad as part of the define call (probably in a setTimeout to allow current script to finish executing) then immediately do a require for that module, to get it to run.

So I did a pass at that, but I seem to have trouble knowing when the changes I do to require.intellisense.js get applied -- how to manually kick the system into doing the new logic. So I end up closing and reopening the project. So I'm open to other suggestions in this area. But I am looking into this, I want to get it to work well. If you like, I can post what I have in a branch if you want to comment/code review it to make sure I'm on the right track. I'll be trying in the next couple of hours to do more work on this though.

jrburke commented 12 years ago

I merged this pull request, since my efforts have not been successful. I'll take this approach for now, but work on the the other path via a branch and will do pull requests to elicit comments. Thanks for taking the time to look into this.