whitequark/sublime-ocp-index — pull request #4 by TheSpyder (2014-02-18 07:51:57+00:00)
Title: Display the type at the cursor with alt+a

This wasn't difficult to achieve, the only real change to make the existing code work with `ocp-index type` was that instead of cutting the line off at the cursor, we extend it to the end of the current word using sublime's `view.word()` function.

After that, everything else was refactoring:
* Type checking requires specific build detail that completion just searches for, so I had to make a way to provide the `--build` parameter before it worked in my project.
* A single class can't be used as both a Sublime event listener and command listener, and I didn't want to make everything top-level, so I extracted the logic to a new class.
* The old code was rearranged into query extraction, ocp-index execution, and completion-specific logic. This lets `query_type` be a very simple method. There are probably better ways to achieve this, I'm not a complete python guru :)

I've done command line experiments with `--context` to solve the limitation I mention in the readme, but extracting that information from sublime could be tricky. I want to get your feedback on the bulk of the change before I spend any more time on it :)