Closed ghost closed 13 years ago
My position on autocomplete is that it won't be part of CodeMirror, but CodeMirror should provide the tools to implement it as an add-on. You can add an key event handler to the frame, use cursorCoords to find out where to position your drop-down, and use the API to insert code at the right place.
As for auto-paren-insertion, that's definitely not going to become a default feature (too annoying). If you want to add it as an option, feel free to submit a patch.
by the way, just an idea: that annoyance can be highly eliminated if the editor overwrites the next char if the typed char and the next char are both closing paranthesis. example: (helloworld-cursorishere-) => I type ")" => (helloworld)-cursorishere-
An example of how I would envision this being implemented is by how ActiveState's Komodo EDIT and IDE applications handle auto parens. It's both intuitive and non-invasive. And it could be turned off.
I'll look into creating a patch.
quplo has added what they call The Common Sense Code Completion
Blog post, demo, and source can be found here:
It would be great if the editor completed keywords, constructs, or common names.
It would also be great if parenthesis, brackets, and braces were also automatically terminated.