hammerlab/cycledash — pull request #205 by danvk (2014-11-14 19:07:03+00:00)
Title: Typeahead support for CQL

This uses the `SyntaxError` objects generated by PEG.js to create a set of possible completions. These are winnowed down using the parser. The comment in `QueryCompletion.js` has more detail.

This also includes a "playground" for iterating on the completion logic & UI. I found this helpful for exploring the `expectation` objects that PEG.js returns and for quickly determining which query patterns did and didn't work. The only fancy notable thing about it is the `require.js` file I took from [Smoothie](https://github.com/flowyapps/smoothie), which lets us use node.js-style `require` statements in the browser.

![screen recording 2014-11-13 at 03 58 pm](https://cloud.githubusercontent.com/assets/98301/5051599/72bb0fb4-6c07-11e4-9adb-7d0a52ced07f.gif)