Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make this plugin compatible with JSP Editor #2

Closed
lastnico opened this issue Dec 16, 2013 · 17 comments
Closed

Make this plugin compatible with JSP Editor #2

lastnico opened this issue Dec 16, 2013 · 17 comments

Comments

@lastnico
Copy link

First, thanks for this great idea.

Second, unfortunately, I have troubles with your Eclipse plugin when I try opening a JSP file, either with the standard JSP Editor or with the AngularJs Editor: the ng- attributes are not recognized, while this is the case if I open an ".html" file extension.

I have tried opening either with the "Open With" feature or modifying the file association with editors, and, unfortunately, it does not change anything.

Any ideas?

Thanks.

HTML File
image

JSP File
image

JSP File (even with Open With)
image

By the way, the project has been converted to an AngularJs Project, as required.

Versions:
Eclipse Java EE IDE for Web Developers.
Version: Kepler Service Release 1
Build id: 20130919-0819

Eclipse Web Developer Tools
Version: 3.5.1.v201307171524-7O7QG2NEMkBS3C2az0gQwwALctEj3DZPgTEZceV4
Build id: 20110922230524

@angelozerr
Copy link
Owner

I'm afraid that's it's not possible to give AngularJS support with JSP editor easily. AngularJS Eclipse override the HTML DOM to manage AngularJS feature (completion, validation, etc). More the lexer was rewritten to manage {{}} regions.

If we want to support JSP, we need to do the same thing than HTML, but for the moment it's not in my scope because I would like to provide a stable version with HTML editor.

I'm working on completion in HTML editor with modules, directives and models.

@lastnico
Copy link
Author

What a pity!

So, in Eclipse IDE, you have different editor implementations, and you could not "plug" additional language/technology support on them? Do you know why it is the case?

Just as a side question: I hope that HTML / Javascript / CSS support is not duplicated in JSP and HTML editors too?

Thanks anyway!

@angelozerr
Copy link
Owner

AngularJS Eclipse uses WTP HTML Editor. It can be extended a lot (completion, hover, etc) that I have used. But if you wish to add your custom region (like angular with {{}}) you must rewrite the parser/lexer like I have done https://github.com/angelozerr/angularjs-eclipse/blob/master/org.eclipse.angularjs.core/Resource/parserTools/highlighting/AngularTokenizer.jflex

The WTP XML/HTML editor uses her own parser/lexer. JSP has redefines her own parser/lexer to manage JSP expression, directive, etc

I think it's possible to manage some angular features (like directive compltion like in your case) in JSP, HTML editor without rewritten the lexer. But we lost for instance the higlight capability of the {{}} expression.

I will study how to we can support JSP Editor (without highlight) for AngularJS, but my first goal today is to manage completion in angular expression.

@angelozerr
Copy link
Owner

Ok I have commited 4939313

You should have completion (on attr name for directive+ attr value for module, controller...), hyperlink, validator which works for JSP. Highlight doesn't work because as I have explained, the lexer of JSP should be rewritten (hard task).

Tell me if it works.

@lastnico
Copy link
Author

lastnico commented Jan 8, 2014

Hi Angelo,

Thanks for this update, I am trying your changes right now and the only current thing I can notice is the autocompletion of the right brackets when I start writing an Angular expression. What did you mean exactly about "attr name for directive+ attr value for module, controller..." ?

Thanks

@angelozerr
Copy link
Owner

If you see https://github.com/angelozerr/angularjs-eclipse/wiki/HTML-Features, for JSP completion should work with those usecases :

  • Completion for directive name
  • Completion for modules (declared in an external JS)
  • Completion for controllers (declared in an external JS)
  • Completion for angular expression doesn't work if it is inside node text ({{remai<=Ctrl+Space doesn't work) but works if it is inside attribute value (<span class="done-{{tod<=Ctrl+Space should working).

I will try to fix the case with angular expression inside node text soon.

@angelozerr
Copy link
Owner

I have fixed the problem with JSP with completion for angular expression node text. See my commit
11ba36a

Tell me if completion works.

@lastnico
Copy link
Author

Hi Angelo,

After retrying I do have autocompletion for ng-* DOM tag attributes... but nothing more.

Do I need to include the related Javascript files containing my modules as part of the page I want to have autocompletion to allow its modules/controllers/... to be detected, or is it just a global index which built from all detected Javascript files in the project?

Thanks.

@angelozerr
Copy link
Owner

Do I need to include the related Javascript files containing my modules
Yes you need that. Your JS must be declared without JSP expression (in order the plugin can resolve it and find the file).

For "HTML Templates" (declared in the router), it doesn't work for the moment but it will work soon with "Angular Explorer" view https://github.com/angelozerr/angularjs-eclipse/wiki/Angular-Explorer-View

If you have some problems, please attach your project (or gives me some github link), in order to I study your problem. More I think it should be more easy for us to discuss together if we have the same JSP project.

@angelozerr
Copy link
Owner

I close this issue because JSP Editor works with AngularJS (even if they are not the whole feature like syntax coloring and hover).

@naveenkumar123
Copy link

Hi,, all
AngularJs tags and expression ex:- {{ username }} not working in JSP(JAVA SERVER PAGE).
Please provide some solution.

@angelozerr
Copy link
Owner

Please provide more information. In my case it work's. Do you have added AngularJS Nature in your project?

@lastnico
Copy link
Author

Hi,

I am pretty sure he has troubles because the script URL is computed in his page (or not even present, i.e. in a ng-view content), and hence, the AngularJs Eclipse plugin cannot guess what module is enabled (I do have the same issue ;).

@angelozerr
Copy link
Owner

To load well JS, you must define script paths as folder. Please read https://github.com/angelozerr/angularjs-eclipse/wiki/Angular-Explorer-View

@async3
Copy link

async3 commented Aug 29, 2014

Thank you for this functionality. Is it possible to have it working on php files?

@angelozerr
Copy link
Owner

Thank you for this functionality. Is it possible to have it working on php files?

I think PDT is based on WTP, so perhaps it's possible. Please create a new issue for that. Thank's

@angelozerr
Copy link
Owner

OK I have created a new issue for PHP support at #90

I think this feature will be possible and I think I can implement it quicly. I plan this feature for 0.6.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants