PistonDevelopers/VisualRust — pull request #66 by andersforsgren (2014-12-08 21:55:34+00:00)
Title: Racer autocomplete

fixes #6

Known limitations:

- Racer doesn't provide completions without a prefix. In VS you can hit ctrl+space on any (empty) line to get completions for local vars, keywords etc.
- Keyword completion: included those as C# does that, but unhappy with the criteria for when they show up. Currently they are always included, but in places where only identifiers would be valid such as after a dot, keywords make no sense. The VS autocomplete handles this properly, but I'm unsure how to go about that.
- Zero tests. I think I could mock the VS extension things but haven't.

Open questions:

- Racer requires an environment var to point to the rust sources. In this PR there is no warning if this isn't set, there probably should be some way of setting this up, or a warning if it isn't.
- Deployment of racer: currently binary is included (as a file) in project and included in msi/vsix. Not sure if this is the right thing to do (does llicense allow this? Where should it be documented what revision of racer is shipped etc.).
- Autocomplete triggering: Currently mimics VS/C# autocomplete which is the most eager version completing on most keystrokes. One could imagine being less aggressive (especially if it was configurable)
- Glyphs/icons for the completion items: didn't include any new icons, instead tried to make a mapping to the icons from VS/C#. Not all things map 1-1 of course.
- Error handling and timeouts/performance. It currently calls synchronously into racer with a timeout (set att 3 sec). One could imagine instead doing it async anc cancelling on the next keystroke. I haven't pushed performance e.g. by trying huge files. If racer crashes, it should fail silently in release mode and just not display the completions.
- Keep the keyword autocompletion?