Conversation
|
I actually had some code that does work in this area lying around in a branch (remember when you asked me what I'd charge for implementing this, but never got back to me when I made an offer? I did that work as part of the research for that quote.) I've merged it in now, since I guess no one is going to pay for it anyway. Could you take a look at the current master branch and see whether it solves the problems you were trying to address here? |
I'm sorry @marijnh I had no news about that, so I hav etried to implement it -( Many thank's!
I have tried it and it seems compeltion works only when you know teh property, My initial sample requirejs.config({
// here ctrl + space must shows baseUrl, paths, shim, etc properties.
})I will try to investigate why it doesn't work. |
|
@marijnh in my case when I execute tests, it fails: |
|
Yes, you need to update Acorn to the latest git master branch. Sorry about that. I'll bring out a new Acorn version and bump the dependency version soon. |
|
If you do an |
|
Ok I have updated acorn, and it work's great. |
This PR gives the capability to support completion for object literal properties for known type. This PR includes the update of requirejs plugin to support completion for config properties (baseUrl, paths, etc).
Here a screenshot of completion for requirejs config :
The basic idea is to attach to the node of object literal a new property expObjType (expected object type). So the node of object literal have objType and expObjType which comes from !type fn declaration.
expObjType is updated inside the 2 visitors which uses CallExpression.
The completion for object literal uses expObjType. expObjType could be use too to use for 'documentation' for instance or findTypeAt (to fill the type with documentation, url).
Note that it misses some requirejs config properties (tell me if you wish I fill it)