Navigation

 ·   Wiki Home
 ·   Wiki Help
 ·   Categories
 ·   Title List
 ·   Uncategorized Pages
 ·   Random Page
 ·   Recent Changes
 ·   RSS
 ·   Atom
 ·   What Links Here

Active Members:

 ·  Derek Reynolds

Search:

 

Create or Find Page:

 

View Espresso Wiki

Welcome! This Wiki will be updated gradually to document Espresso’s Sugar capabilities, so you can extend it to do new and cool things. To discuss sugar development, join the forums or pop into IRC!

New to Espresso?

If you have just started working with Espresso, see our Intro to Espresso for useful resources. This wiki mostly contains documentation for creating your own Sugars at the moment.

What’s New?

In Espresso Engine Preview 2, sugar developers can now work with CocoaSugars and SyntaxThemes.

For more details about recent releases, see the Release Notes.

Sugar Documentation

  • StateOfSDK — an overview of what can be done with the current Espresso SDK (updated as it improves)
  • SugarBasics — the starting point for making Sugars
  • Syntaxes — documentation for language syntaxes
  • Selectors — documentation for syntax selectors
  • CodeSense — documentation for adding auto-completion to your Sugars
  • Itemizers — documentation for itemizer recipes
  • Snippets — documentation for sugar snippets
  • SyntaxThemes — documentation for syntax themes
  • CocoaSugars — documentation for the Cocoa API

Introduction to Espresso’s engine

Espresso has a regular-expressions-based syntax core, much like TextMate (in fact, developers of TextMate language plists will be able to convert them). Espresso reads XML-based syntaxes, then uses those rules to generate a syntax tree for opened text documents. Each syntax zone in that tree has a type identifier (similar to CSS class names in HTML) that can be targeted using CSS-like selectors. This selector targeting is used all over Espresso, for various subsystems like syntax coloring and CodeSense.

That first layer has been done before, so while Espresso’s implementation is quite powerful (especially its selectors), the contextual information usually stays very local and somewhat limited. To remedy that, Espresso layers an “itemizer” above the syntax core. Itemizer definitions group syntax zones into semantical blocks that behave like an “item”, a logical piece of the document.

Itemizing currently brings along two features: the Navigator and great code folding. CSSEdit-like structure listings are now possible for any language, as long as someone takes the time to create a good itemizer definition. Any language offering an itemizer also gets code folding support for free.

This multi-layered design delivers excellent performance while still allowing high-level representations of a document that are actually useful to the user.