Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[orion-dev] HTML content assist

I just released basic HTML content assist in master. It relies on some fixes/enhancements to the content assist infrastructure that is also in master, so you will need all the latest and greatest client code to run it. Some notes:

 - It currently just auto-completes on HTML element names. It doesn't fill in attributes except for some of the most common cases (image, anchor)
 - Only the elements in the HTML 5 spec are included
 - For elements that typically start a multi-line block, it will insert a new line and appropriate indentation
 - For elements that have a closing tag, the completion will position the cursor between the open/close elements. For empty elements like <br>, <hr>, etc, it positions the cursor at the end
 - If you hit Ctrl+Space in a completely empty HTML file it will auto-complete a basic well-formed HTML5 document (good for demos!)

I'll probably keep hacking on it next week, but in the meantime feel free to try it out and report bugs/enhancements against Orion > Client in bugzilla.

As an aside, I think this was good validation of how easy to use the Orion language extension model is. I just had to write one 130 line script that generated all the proposals, and the orion infrastructure did all the rest of the work. Most of our content assist before now was just flat lists of keywords, but writing a more context aware proposal engine with indentation, cursor positioning, etc, was not a big step up. For anyone curious, here is the complete source:

http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/tree/bundles/org.eclipse.orion.client.core/web/plugins/webEditingPlugin/htmlContentAssist.js

John

Back to the top