Highlighting syntax support for SpeedScript

Posted by Admin on 05-Dec-2007 06:50

Hi!

Does anyone knows if there is any way to have highlighting (color) syntax support on HTML files which includes SpeedScript, JavaScript code?

I'm using OpenEdge Architect 10.1B and all HTML files with this kind of code are getting showed with plain black color.

I know that this is available through WebSpeed but I though that Architect editor should also have it. I'm just wondering if there is a way to have this feature through some properties values or an add-on.

Best regards,

Andreas

All Replies

Posted by Matt Baker on 05-Dec-2007 07:18

Andreas,

The editor in OEA for ABL files doesn't recognize html syntax. I would suggest that you visit the eclipse.org website and download one of the plugins from the WST project that supports html and javascript in the same editor.

You can also configure OEA to compile .htm files on save.

Posted by vjug on 05-Dec-2007 08:59

The best way to do this is to separate your UI (HTML, JS, CSS) and SpeedScript logic. Then you'll have standard syntax coloring in .p files with the logic and you can use WTP from Eclipse or Aptana for HTML syntax coloring. In my opinion the best way to do this is using eScript web object.

Posted by Admin on 12-Mar-2008 03:38

So, the final answer is that there is no way to accomplish this without taking 6 months reworking your whole application and separate the presentation from the logic. This indeed is a good idea but not an option in my case.

I use the wst html editor for the html editing and would like to plug the .p editor into that one, the same way the javascript editor handle certain partition types, is that possible? something the oea team is working on? I also would like the context sensitive support the .p editor is offering in my ".p" partitions. Any more comments/suggestions around this issue?

Thanks

Andreas

Posted by Thomas Mercer-Hursh on 12-Mar-2008 11:50

While I can understand why you don't like the answer, think about it a little... As far as I know, all editors are either targeted at a specific languages (if they other features like syntax-aware coloration) or, at best, they offer support for multiple languages, but one at a time. What you want is to mush two together. No reason that couldn't be done, of course, but if one considers that good design would indicate that they be separate, it isn't very likely that someone is going to invest the effort to do the mushing.

With an editor like ED4W, where the files controlling coloration and such are documented and editable, you might be able to create a combined version, but I think you would pretty much have to take on the task yourself.

Posted by Håvard Danielsen on 12-Mar-2008 14:12

Just for the record, hybrid source editing is listed under architectural principles on Eclipse's wst subproject page.

http://www.eclipse.org/webtools/wst/main.php

This does not mean that we are going to support Embedded SpeedScript editing in the IDE, but we might not need to start from scratch if we decided to.

I agree that keeping HTML and ABL separate typically provides for a better design, even if the main point of Webspeed is to allow ABL code to produce HTML.

Posted by Thomas Mercer-Hursh on 12-Mar-2008 15:29

The one difficult thing about supporting multiple styles in the same editor is that the syntax-appropriate coloration is based on syntax analysis of the code, so to do two languages in the same editor, the syntax analysis has to be able to tell which set of rules to apply at which point.

Posted by jankeir on 13-Mar-2008 03:03

There are many editors that can do it for both javascript and HTML. AppBuilder can even do it for HTML, javascript and webspeed, all in the same code (although you have to disable abhack for this to work.)

I would also like to see support for an editor that supports HTML, Javascript, CSS and speedscript in the same code.

I'm aware that it's not the best way to design an application, but that's not the point. There are many applications written that way, Andreas has one, I also have one (luckily I rarely have to change it so it's not a big issue for me) and I'm sure there are many more.

OE Architect has the best framework for a good IDE to work on these files, but needs improvement to make it work well. I think it's worth the effort to at least have a look at how hard it would be. Given that there are eclipse editors that do similar things for other languages I think it might be easier than it sounds at first and if it isn't as problematic as it sounds it would be a great help.

Posted by Thomas Mercer-Hursh on 13-Mar-2008 11:17

I think the bottom line here is that:

1. Clearly it is possible;

2. It is in keeping with the Eclipse statement of direction;

3. It isn't trivial; and

4. It mostly isn't needed if one is following best practice coding.

The last point is the real killer since getting PSC interested in the investment means convincing them that there is a market driver. In this case, the market driver seems to be applications which need transformation more than they need an enhanced editor ... at least from the PSC perspective.

This thread is closed