angelozerr / tern.java Goto Github PK
View Code? Open in Web Editor NEWUse tern.js in Java context
Home Page: http://ternjs.net/
License: Other
Use tern.js in Java context
Home Page: http://ternjs.net/
License: Other
try and write results here
Manage validation with tern. See start of this feature with the tern plugin https://github.com/angelozerr/tern.java/blob/master/core/tern.server.nodejs/node_modules/tern/plugin/lint.js and see demo at https://github.com/angelozerr/tern.java/blob/master/core/tern.core.tests/CodeMirror/codemirror-javascript/demo/tern-lint.html
Here a screenshot of this demo:
Posted this idea on tern ternjs/tern#297 and backet adobe/brackets#7090 (comment)
tern.eclipse.ide.server.nodejs.embed.linux.gtk.x86_64 plugin should have arch attribute in plugin declaration
There is a problem when TernServer instance is used in several threads, because the
TernFileManager which update a list of files which are indexed is not synchronized (so the files could be indexed several times). TernFileManager should be improved :
Tern gives the capability to rename variable. See demo at http://ternjs.net/doc/demo.html
Implement this feature in tern.java
I see that some libraries (Rhino & json-simple) are copied in the repository. Are they modified compared to the official releases of these libraries? Would it be possible to consume directly the one shipped by Eclipse Orbit ?
If you don't see any issue with using Orbit bundles and OSGi reference in MANIFEST (instead of lib inclusion), I could provide a pull request.
cc @dgolovin.as related to https://issues.jboss.org/browse/JBIDE-17160
When tern is started with node.js starts, it waits 1 seconds (can be configurated in settings) and try to get the port of the started of node.js to know the URL of the server.
With big Tern plugin (like AUI, YUI), 1 sec is not enough. To fix that, we can configure settings to 2 sec, but I think we should add new settings (number of times that it must retry to get the port) to avoid waiting 2 sec each time.
Add custom JSON Tern definition
Show several completions item for optional parameter.
Parse JS file of tern doc with monitor
D:\workspaces\Enide-Studio-2014-011\tern.java-CRLF>git checkout -f HEAD
fatal: cannot create directory at 'eclipse/tern.eclipse.ide.server.nodejs.embed.linux.gtk.x86/nodejs/node-v0.10.22-linux-x86/lib/node_modules/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream': Filename too long
FYI, on Windows 7 32bit
There were no such problem before on Windows.
It would be great if there were instructions in the readme concerning how to set up tern with Eclipse.
while reading https://github.com/angelozerr/tern.java/wiki/Tern-Eclipse-IDE-Node.js
Well, with Nodeclipse Node.js is to be already installed.
Please make external Node.js as default.
(or default if org.nodeclipse.debug
plugin is installed, and otherwise use bundled Node.js, that should be always installed )
Or possible configurable externally (more efforts).
Tern IDE should work out of box (though possibly not in optimal mode)
Today tern.js (defs, lib, plugins) are hosted in the node.js tern server implementation tern.java\core\tern.server.nodejs\node_modules.
Other tren server implementation (like Rhino) doesn't use this tern.js files. It should be better to provide a new plugin "Tern runtime plugin" like tern.eclipse.ide.runtime which hosts tern.js files. With this plugin, every tern server implementation can share the same tern.js files.
An idea is to provide to the capability to override tern.js files by customizing with Runtime Add in the Preferences, a folder which contains custom tern.js files.
Since #48 have a dependency to Ant to unzip node.js install files. And it seems that JUnit doesn't work because we need to unzip node.js filesbefore executing JUNit.
I think we should :
After apply of completion function, it shoud be good to :
Manage Hyperlink inside JS editor by using tern definition query.
Some tern plugin wait some options. It should be good to customize those options with UI.
To know the options of each tern plugin, I have created ternjs/tern#330 otherwise I will manage that in tern.java
Configure start timeout path in Node.js Preferences page
Display message inside tern console with different colors :
Display in the console view tern request/response
Wizard to generate tern defs/plugin
Provide an extension point to Customize image for completion item according the origin (ecma5, angular, etc)
Ex : for "angular" completion item, displays the angular icon.
Today, we have 2 treeviews for tern definition and tern plugin. I think it should be better to merge those treeview in one treeview.
What do you think about that?
Which names could we use? Tern Plugins? Tern facets? Tern features? Tern capabilities?
Some tern defs, plugisn depends on other tern defs. For instance 'jquery' tern def depends on Element structure declared in the 'browser' tern def.
It should be cool
To know those dependencies, I have created ternjs/tern#330 otherwise I will do that in tern.java
See http://ternjs.net/doc/manual.html#server (--persistent)
Like #41, provides a wizard which generates an HTML page with Orion & Tern by using https://github.com/angelozerr/tern.orion
Support Tern Completion inside JSP
Expand functions with optional parameters for completion
When completion is done in JS Editor, some JS files must be parsed by tern (if those files are not already parsed). Today the only JS file which is parsed is teh JS coming from the editor. The compeltion in JS Editor should use the script paths defined in the preferences to load it.
Perhaps it's interesting to replace json-simple by minimal-json https://github.com/ralfstx/minimal-json because :
Configure node path in Node.js Preferences page
Provide a wizard to generate HTML page with Tern & CodeMirror/ACE/Orion.
Finish button generate a folder which contains :
This wizard will be very useful to generate demo or gives a good start to integrate CodeMirror/ACE editor with tern in a Web Application.
Note : for ACE+tern, see https://github.com/angelozerr/tern.ace
Integrate tern plugin for meteor https://github.com/Slava/tern-meteor
Customize image + description for tern defs+plugins
When selecting a custom Node.js install (Node.js install: -- Choose your node.js install --) the following NullPointerException occurs:
!ENTRY org.eclipse.ui 4 0 2014-03-22 00:42:39.731
!MESSAGE Unhandled event loop exception
!STACK 0
java.lang.NullPointerException
at tern.eclipse.ide.server.nodejs.internal.ui.preferences.TernNodejsPreferencesPage$1.fireValueChanged(TernNodejsPreferencesPage.java:88)
at org.eclipse.jface.preference.ComboFieldEditor$1.widgetSelected(ComboFieldEditor.java:180)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:248)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4425)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1388)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3773)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3393)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:832)
at org.eclipse.jface.window.Window.open(Window.java:808)
at org.eclipse.ui.internal.dialogs.WorkbenchPreferenceDialog.open(WorkbenchPreferenceDialog.java:215)
at org.eclipse.ui.internal.OpenPreferencesAction.run(OpenPreferencesAction.java:65)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:519)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:595)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:511)
at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:420)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4425)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1388)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3773)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3393)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1119)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1003)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:147)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:630)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:574)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:125)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:133)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:103)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:378)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:232)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
at org.eclipse.equinox.launcher.Main.run(Main.java:1462)
at org.eclipse.equinox.launcher.Main.main(Main.java:1438)
Call nodejs tern server process with --no-port-file to avoid generating .tern-port
Today it exists "Add Page" in the Tern->Script path property to add an HTML/JSP file which contains script elements.
But loading script can be done with sevreal mean (requireJS, head.js, etc). I think it's hard to provide all frameworks which loads JS. I think a generci mean is to manage a "folder" script path. A new button "Add Folder"could select a folder which contains JS files to load.
When completion is done, the full js content is sent to the tern server. It can be slow if js file is big. To fix this problem, "partial" tern doc should be managed (only sent the update of the js editor).
Similarly to what SWT does, it would be better to use fragments for platform-specific artifacts. Then all those fragments could be part of the same feature, and installing the feature would select the right fragment to install.
This would avoid having platform-specific features and would make consumption easier.
Develop JUnit for node.js tern server.
@pascalleclercq : initialize maven to do JUnit and JUnit must work with any OS (start the well node exe).
@angelozerr : develop JUnit for Develop JUnit for node.js tern server.
Please take a look at
https://github.com/borisyankov/DefinitelyTyped/blob/master/angularjs/angular.d.ts
that is static lbrary description.
As I remember tern does it dynamically by analyzing.
Create a tern plugin for MongoDB Shell. + MongoDB MapReduce.
@paulvi what do you think about that?
Create Tern Plugin for Grunt by using :
This issue is about tern limitation that I find and I create this issues if some company (JBoss, Liferay?) wishes to sponsor tern.js to pay @marijnh for developping missing features in tern :
Create YUI and AlloyUI Tern Plugin
Add custom Tern Plugin
Today tern.java provides several tern defs/plugin (official (jquery, browser, ecma5, etc) and not official (liferay, aui/yui, grunt, cordova). But it's possible to develop your own tern def/plugin. This issue is about improving tern.java to support custom tern defs/plugin, but too to help and explain how to develop custom tern defs/plugin.
Tern IDE must be improved with thoses issues :
Tern defs is a JSON type definition which describes the JS object structures. See for instance https://github.com/marijnh/tern/blob/master/defs/browser.json
Tern IDE could provide a wizard which initialize tern def (but it's not very important).
Done -> https://github.com/angelozerr/tern.java/wiki/Tern-Toolings#json-type-definitions
Tern plugin uses tern def and gives the capability to add some behaviour on some functions (like inject some value).
Tern IDE should provide a wizard which create tern plugin (more interesting than tern def wizard).
Done -> https://github.com/angelozerr/tern.java/wiki/Tern-Toolings#server-plugins
In my case I'm developping tern def/plugin with Chrome Web Browser to debug tern plugin (I use CodeMirror addon => https://github.com/angelozerr/tern.java/tree/master/core/tern.core.tests/CodeMirror/codemirror-javascript/demo)
The issue #41 can be useful to generate HTML page with CodeMirror/ACE and tern.js with customtern defs/plugins.
Tern IDE provides tern console (active tern console in the tern project preferences). Select your tern def and after try it with JS editor. If you change your tern def file, stop the server with "Stop" button of the console.
@paulvi : do you think it's possible to launch tern server with node.js in debug mode with nodeclipse? If it's possible we could debug tern plugin with Eclipse IDE.
Add a "stop" button to stop in the tern console to stop a tern server from a given project.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.