angelozerr / tern-node-express

A Tern plugin adding support for express web application framework for node.
http://expressjs.com/
MIT License
56 stars 4 forks source link

tern-express as an example #1

Closed paulvi closed 9 years ago

paulvi commented 9 years ago

started in https://github.com/angelozerr/tern.java/issues/131

Wouldn't it be better to have this or an other tern-IDE module as an example https://github.com/angelozerr/tern.java/issues/125

angelozerr commented 9 years ago

Before integrating tern-express inside tern.java, you can use WebBrowser to develop it. Open https://github.com/angelozerr/tern-express/blob/master/demos/express.html and you will see

ternexpresswithcodemirror

To improve this plugin, we need to fill the JSON Type Definitions (see defs in https://github.com/angelozerr/tern-express/blob/master/express.js)

I have started to fill the JSON Type Definition by using :

I think the best mean to fill the JSON Type Definition (if it's possible) is to generate it from api doc. But I have not found api doc formatted with JSON, or XML. The only doc I found is https://github.com/strongloop/expressjs.com/blob/gh-pages/4x/api.html which is HTML. So the idea is to parse this HTML file and generate JSON Type Definition.

I think tern-gas does that with JS https://github.com/aki2o/tern-gas. I have done that with Java for https://github.com/angelozerr/tern.googleapi (GMaps)

But I think before trying to generate something, you should to fill JSON Type Definition at hand by using https://github.com/strongloop/expressjs.com/blob/gh-pages/4x/api.html

Don't hesitate to tell me, if you need help!

paulvi commented 9 years ago

I will not follow this. Possibly @nodeleaf would.

https://github.com/angelozerr/tern.java/issues/125 should give clear instructions how (possibly linking to this repo as example)

angelozerr commented 9 years ago

I will not follow this. Possibly @nodeleaf would.

OK

angelozerr/tern.java#125 should give clear instructions how (possibly linking to this repo as example)

I will do it when I will implement the possibility to add custom tern module inside tern.java

ghost commented 9 years ago

@angelozerr: if I follow you correctly what I have to do next is to complete the defs json object in express.js file (line 17) following Express 4 API doc – testing within the CodeMirror field from demos/express.html...

angelozerr commented 9 years ago

@nodeleaf exactly!

ghost commented 9 years ago

I don't know if this is relevant but I have this error in Eclipse error log:

eclipse.buildId=4.4.0.I20140606-1215 java.version=1.8.0_05 java.vendor=Oracle Corporation BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_US Framework arguments: -product org.eclipse.epp.package.jee.product -keyring . . . Command-line arguments: -os macosx -ws cocoa -arch x86_64 -product org.eclipse.epp.package.jee.product -keyring . . .

tern.eclipse.ide.ui Error Mon Sep 29 12:45:33 CEST 2014 Could not load ternDescriptor: browser

java.lang.NullPointerException
    at org.eclipse.jface.resource.JFaceResources.getResources(JFaceResources.java:210)
    at org.eclipse.jface.resource.ImageRegistry.<init>(ImageRegistry.java:156)
    at org.eclipse.jface.resource.ImageRegistry.<init>(ImageRegistry.java:128)
    at tern.eclipse.ide.ui.ImageResource.initializeImageRegistry(ImageResource.java:128)
    at tern.eclipse.ide.ui.ImageResource.registerImageDescriptor(ImageResource.java:162)
    at tern.eclipse.ide.internal.ui.descriptors.TernDescriptor.getImageKey(TernDescriptor.java:50)
    at tern.eclipse.ide.internal.ui.descriptors.TernDescriptor.<init>(TernDescriptor.java:33)
    at tern.eclipse.ide.internal.ui.descriptors.TernDescriptorManager.addTernDescriptors(TernDescriptorManager.java:146)
    at tern.eclipse.ide.internal.ui.descriptors.TernDescriptorManager.loadTernDescriptors(TernDescriptorManager.java:131)
    at tern.eclipse.ide.internal.ui.descriptors.TernDescriptorManager.getTernDescriptor(TernDescriptorManager.java:112)
    at tern.eclipse.ide.internal.ui.descriptors.TernDescriptorManager.getImageDescriptor(TernDescriptorManager.java:96)
    at tern.eclipse.ide.internal.ui.descriptors.TernDescriptorManager.getImageDescriptor(TernDescriptorManager.java:229)
    at tern.eclipse.ide.ui.utils.HTMLTernPrinter.getAdditionalProposalInfo(HTMLTernPrinter.java:50)
    at tern.eclipse.ide.ui.hover.HTMLTernTypeCollector.setType(HTMLTernTypeCollector.java:38)
    at tern.server.nodejs.NodejsTernServer.request(NodejsTernServer.java:311)
    at tern.eclipse.ide.core.IDETernProject.request(IDETernProject.java:729)
    at tern.eclipse.ide.core.IDETernProject.request(IDETernProject.java:723)
    at tern.eclipse.ide.ui.hover.TernHover.getHoverInfo2(TernHover.java:70)
    at tern.eclipse.ide.ui.hover.TernHover.getHoverInfo(TernHover.java:45)
angelozerr commented 9 years ago

It's an issue about tern.java, please create an issue for that by setting teh version of tern.java. Thank's

ghost commented 9 years ago

Done: https://github.com/angelozerr/tern.java/issues/133

angelozerr commented 9 years ago

Ok I close this issue.