Open ghost opened 10 years ago
Yes we could support the both. But a generator could be usefull for that because there is so methods for node-mongodb-native to write it at hand.
Yes - mongodb API is MUCH bigger than express so it's a better candidate for a generator.
@angelozerr: I don't know where this generator idea above leads you but if I had to do it by hand I would used mongo shell methods documentation from here: http://docs.mongodb.org/manual/reference/method/
Do we have the time to handle this before tern 0.7.0 is released?
What is generator in this context?
@nodeleaf, @PaulVI let's me time to finish my work, I will explain you more the idea about generator.
You can see a dox folder api.json is the JSON generated from mongo js sources. If you open the html file https://github.com/angelozerr/tern-node-mongodb/blob/master/dox/api2tern.html you will see the tern JSON Type Def generated from api.json
I have copied/pasted the content of this HTML page into https://github.com/angelozerr/tern-node-mongodb/blob/master/node-mongodb.js
I have not commited but I have started to do that for mongoose.
When I will commit I will explain you how we could work together.
I don't know where this generator idea above leads you but if I had to do it by hand I would used mongo shell methods documentation from here: http://docs.mongodb.org/manual/reference/method/
It seems that it's for Mongo Shell. Is it the same thing for mongo node native (that I have generated)?
Perhaps we should create a new project tern-mongodb-shell for that and this project could be used for completion inside Eclipse Console (I don't know if it's possible?)
Perhaps we should create a new project tern-mongodb-shell for that and this project could be used for completion inside Eclipse Console (I don't know if it's possible?)
Nodeclipse has support for running .js with Mongo Shell, so it would be possible to use use completion in Eclipse. However nobody except for @nodeleaf Patrick had ever commented on Nodeclipse Mongo Shell support, so I don't know is it really used.
ref https://github.com/Nodeclipse/nodeclipse-1/issues/110 https://github.com/Nodeclipse/nodeclipse-1/issues/111 https://github.com/Nodeclipse/nodeclipse-1/issues/112
But once there is such support there will be of cause more reason to author Mongo Shell scripts inside Eclipse
About MongoDB, we have several different cases actually.
As @PaulVI outlined above, a first one is about running mongo shell script from Nodeclipse: here we have javascript code that could be also edited in IDE like any other javascript file and mongodb syntax tern support would be nice — this would be a tern-mongo-shell case.
But regarding MongoDB the core issue to me is nodejs native mongodb driver (tern-nodejs-mongodb) or mongoose (tern-nodejs-mongoose) support.
What I mean is: from a MEAN stack perspective, running a shell script is hardly relevant.
Here we are talking about nodejs applications that are using MongoDB as data store and do this from application code in javascript using nodejs native mongodb driver or the mongoose module.
Created new separate issue https://github.com/angelozerr/tern.java/issues/144 Mongo Shell support
@nodeleaf @PaulVI I have commited my work about generator :
@nodeleaf @PaulVI I have commited my work about the generator. I have explained how to generate the tern plugin from JS sources at https://github.com/angelozerr/tern-node-mongoose/wiki/Contributing (it's the same thing for mongodb).
Do you think there is a chance that you contribute to tern node-mongoose or node-mongodb-native ? Tell me, otherwise I will do it when I will have time. Thank's!
I have mentioned before, that currently I am actually not doing Node.js development, but Android. That is why you see some Gradle stuff http://www.nodeclipse.org/projects/gradle/
So I will not contribute. I'd like to know current situation, but no guarantee that I actually read and understand conversation
By the way, I finally decided to learn AngularJS (and spend about a week for that), so you can see stream of issues raised.
How could I contribute now that you are using dox to generate json data from original documentation?
How could I contribute now that you are using dox to generate json data from original documentation?
@nodeleaf please read https://github.com/angelozerr/tern-node-mongoose/wiki/Contributing#how-to-contribute- section. It's the same thing for tern-node-mongodb-native project
I had read it before asking: I just don't see what I could bring to this project.
I had read it before asking: I just don't see what I could bring to this project.
I know it's not a very exciting work, but the idea is to generate the perfect JSON Type Definition !type in order plugin works with callback. As mongoose and node-mongodb-native uses a lot of callback (where fn parameters type are not commented), we need to override !type to declare the well parameters in order to tern inject it and after you benefit from completion for parameter function inside callback.
The idea is to create some HTML page demo and fixes step by step the !type.
I am using Tern IDE from Nodeclipse: I don't think I can test it with tern 0.6.0 – is this correct? When do you expect tern 0.7.0 with callback completion will reach me?
I am using Tern IDE from Nodeclipse: I don't think I can test it with tern 0.6.0 – is this correct?
When I say "callback", it's not about https://github.com/angelozerr/tern.java/wiki/Tern-Advanced-Completion#generate-anonymous-function I mean that https://github.com/angelozerr/tern-node-mongoose/wiki/Contributing#modelsave
To test completion I suggest you that you copy/paste https://github.com/angelozerr/tern-node-mongodb-native/blob/master/demos/mongodb.html and change the content of the textarea with a new demo (where there is some trouble) and fix it by modifying https://github.com/angelozerr/tern-node-mongodb-native/blob/master/generator/dox2tern_mongodb.js
When do you expect tern 0.7.0 with callback completion will reach me?
If you mean https://github.com/angelozerr/tern.java/wiki/Tern-Advanced-Completion#generate-anonymous-function it's available and you can install 0.7.0 SNAPSHOT (see https://github.com/angelozerr/tern.java/wiki/Installation-Update-Site) This version contains too the integration of the 3 node tern plugins that you can select inside modules.
This is an issue inherent to this project: are we using node native mongodb driver or mongoose npm module? Node native driver is working fine for most use cases but when your node application is strongly bound to mongodb data it make sense to use mongoose instead. Therefore I would have both if possible: maybe as a tern-node-mongodb-native + a tern-node-mongodb-mongoose tern plugins?