angularjs-eclipse
angularjs-eclipse copied to clipboard
Use "angular1.4" insead of using "angular" in .tern-project
Today when project is converted to AngularJS Project", it updates the.tern.projectwith ''
{
"plugins": {
"angular": {}
}
}
So it load the tern plugin https://github.com/angelozerr/tern.java/blob/master/core/ternjs/node_modules/tern/plugin/angular.js which is a fork of the official angular tern plugin https://github.com/ternjs/tern/blob/master/plugin/angular.js
So it's not possible for the user to create her own tern repository with npm install tern. I would like to change that and generate:
{
"plugins": {
"angular1.4": {}
}
}
where angular1.4 is a new tern plugin https://github.com/angelozerr/tern-angularjs and add too my POC for angular2 https://github.com/angelozerr/tern-angular2
@mickaelistria @piotrtomiak @paulvi @dgolovin @vrubezhny @maxandersen it's a very important change, because if I do that, AngularJS Eclipse user will have to change at hand their .tern-project with "angular1.4", otherwise her project will have not Angular nature and the angular completion, validation inside HTML editor will not work (it's my angular fork which manage that). Are you OK with that?
Two things:
-
shouldn't this be pushed to the upstream or have a different name instead of just a version appended the name ?
-
requiring users to manually update settings is always bad. I don't know the full impact but is there no better way to detect/fix this ?
Concatenating name and version into 1 string is usually bad idea, because to analyze, one need to read and break into 2 peaces again.
Why can't there be
{
"plugins": {
"angular": {"version":1.4}
}
}
and default version = 1.4 (so if it not present, there's no problem or need to manually change)
@angelozerr, pardon my ignorance, but I am not following the usecase. Where the user supposed to run
npm install tern
to get this conflict between forked angular plug-in from ternjs bundle in eclipse and original tern plug-in?
But I agree with Max, we should figure out how to keep backward compatibility to avoid forcing user do manual changes in .tern.project file after releasing update for tern.java.
Thanks for your answer!
- shouldn't this be pushed to the upstream or have a different name instead of just a version appended the name ?
Concatenating name and version into 1 string is usually bad idea, because to analyze, one need to read and break into 2 peaces again.
At first it works like this today. I analyze the name, to provide Tern Modules with version combo box. I have done that, because I have already a discussion https://github.com/ternjs/tern/issues/441 and ternjs doesn't want to support version. So I have decided to concatenate name + version to support it inside tern.java
@angelozerr, pardon my ignorance, but I am not following the usecase. Where the user supposed to run "npm install tern"
Sorry @dgolovin, I have not very welll explained. tern.java works with tern repository which hosts tern, and other tern plugins. By defaut tern.java provided this repository https://github.com/angelozerr/tern.java/tree/master/core/ternjs, but user can create their own repository (with npm install) and use it if he wishes.
But I agree with Max, we should figure out how to keep backward compatibility to avoid forcing user do manual changes in .tern.project file after releasing update for tern.java.
Ok, so the idea is to develop a dialog which checks if .tern-project contains "angular" and display a dialog like "Your .tern-project must be updated, are you OK?"
Please don't raise dialog.
Imagine, user has 10 projects in workspace, then updates Angular-Eclipse. Then after restart, will he/she get 10 messages for every .tern-project file? The user may have other thing to do in his mind, having pop-up question is distracting focus.
The should be reasonable default, e.g. to 1.4 in this plugin case.
@paulvi my idea was to check if the activated angularjs project must be updated to 1.4. In this case it display a popup "Your .tern-project must be updated, are you OK?" and add an option (which is checked by default) to update the whole projects of the workspace.
I still don't like IDE asking questions. Besides if code has angular 2.0 library inside, why those question should be asked?
And if there's really need to ask, it should be in a form of checking preferences,
e.g. "Default version for AngularJS has changed. Please check plugin preferences, OK Cancel "
@paulvi you mean that AngularJS Eclipse must update.tern-project without dialog? If it that, it will be more easy to develop that.
If everybody are OK with that, I will do that.
@angelozerr @paulvi You may add an informational message to the error log instead of having dialog to be shown. This will inform user and wouldn't make him/her to click "OK" for every project in workspace.
:+1: second @vrubezhny for idea, but with a little change: Error Log VIew, I think, is shown by default only when PDE plugin installed, while Problems VIew ,I guess, shown in all dev perspectives
@paulvi @angelozerr - Paul is correct, Having a Warning Marker on resource is to be shown not only in Problem view, it might be displayed in Project View as well.