Nodeclipse / nodeclipse

Nodeclipse-1 : Eclipse plugin for Node.js, PhantomJS development (Nodeclipse core plugin); Maven and Gradle (with Android) plugins
https://nodeclipse.github.io/
158 stars 78 forks source link

Tern - get .tern-project default value #165

Closed paulvi closed 10 years ago

paulvi commented 10 years ago

continuation to #160

@angelozerr how to get .tern-project default value ?

{"libs":["ecma5"],"plugins":{"node":{}},"ide":{}}
paulvi commented 10 years ago

As referenced in https://github.com/angelozerr/angularjs-eclipse/blob/master/org.eclipse.angularjs.core/src/org/eclipse/angularjs/core/AngularNature.java#L62

there should be something like

IIDETernProject ternProject = AngularProject.getTernProject(project);
ternProject.addLib(TernDef.node);
ternProject.addLib(TernDef.ecma5);
try {
    ternProject.saveIfNeeded();

Could to execute that ? Could to execute that without getting dependent on TernIDE (i.e. only if TernIDE plugin is installed)

angelozerr commented 10 years ago

Why not using ternNatureAdapters extension point? https://github.com/angelozerr/tern.java/wiki/Tern-IDE-Extension#user-content-ternnatureadapters

paulvi commented 10 years ago

https://github.com/liferay/liferay-ide/blob/2db3aa2335081122716307585a73a2a9dc8f350b/jsdt/plugins/com.liferay.ide.alloy.core/src/com/liferay/ide/alloy/core/jsp/AlloyJSPFileConfiguration.java seems nice.

But it is not yet integration but promotion and option for users.
Plus I don't really know how to consume that extension point. I guess it will add dependency like tern.eclipse.ide.core;bundle-version="0.6.0", https://github.com/liferay/liferay-ide/blob/2db3aa2335081122716307585a73a2a9dc8f350b/jsdt/plugins/com.liferay.ide.alloy.core/META-INF/MANIFEST.MF#L13

angelozerr commented 10 years ago

https://github.com/liferay/liferay-ide/blob/2db3aa2335081122716307585a73a2a9dc8f350b/jsdt/plugins/com.liferay.ide.alloy.core/src/com/liferay/ide/alloy/core/jsp/AlloyJSPFileConfiguration.java seems nice.

But it is not yet integration but promotion and option for users.

Yes, this extension point is used for JSP files to set script inside custom elements (ex : aui:script).

Plus I don't really know how to consume that extension point.

Everything is explained at https://github.com/angelozerr/tern.java/wiki/Tern-IDE-Extension#user-content-ternnatureadapters

@PaulVI could you tell me exactly what you wish to do? I don't understand why you cannot use ternNatureAdapters ?

paulvi commented 10 years ago

I want to facilitate using Tern as promotion and option for users.

But I don't want so far to get TernIDE as dependency. It would be other issue how to get Nodeclipse and TernIDE installed at once...

angelozerr commented 10 years ago

If you want to have none dependencies to tern ide, you should try to initialize tern project at hand when a node.js project is created. Do do that, you must :

</projectDescription>
    <natures>
                .....
        <nature>tern.eclipse.ide.core.ternnature</nature>
    </natures>
</projectDescription>
paulvi commented 10 years ago

If you want to have none dependencies to tern ide, you should try to initialize tern project at hand ...

That what is now, but the value used is different

 {"libs":["ecma5"],"plugins":{"node":{}},"ide":{}}
angelozerr commented 10 years ago

That what is now, but the value used is different

Ok, so I think tern is integrated inside nodeclipse, no?

how to get .tern-project default value ?

What do mean with default value, some preferences ?

paulvi commented 10 years ago

Well, we should stop here. The only tiny question left is whether {"libs":["ecma5"],"plugins":{"node":{}},"ide":{}} will make difference against {"libs":["ecma5"],"plugins":{"node":{}}

that is what would "ide":{} mean. But it is empty anyway, so it should not.

angelozerr commented 10 years ago

{"libs":["ecma5"],"plugins":{"node":{}} is information used by tern.js

"ide":{} is information used by tern ide. I could create an Eclipse preferences settings for tern, but I have decided to add ide. The ide JSON object contains list of script paths https://github.com/angelozerr/tern.java/wiki/Tern-Script-Path

But since 0.6.0, you can customize your script path with JSDT Include Path https://github.com/angelozerr/tern.java/wiki/New-and-Noteworthy-0.6.0#user-content-using-jsdt-include-path-for-tern-script-path In this case ide is empty because information about path are stored inside JSDT

paulvi commented 10 years ago

Great. I hope Nodeclipse 0.17 comes out this month with Tern as option,
then see what kind of questions are raised and what should be next.