modes in refactored ace

17 views
Skip to first unread message

Harutyun Amirjanyan

unread,
Oct 5, 2011, 4:48:39 AM10/5/11
to Ace Internals Dev
plan for refactoring ace
https://github.com/ajaxorg/ace/blob/devel/doc/refactor.md
looks really great

it doesn't say anything about language modes yet, and here are some
thoughts/question about improving them

language mode doesn't contain any session specific data
it must contain only behaviors and be shared by all sessions in editor

(it should be possible to e.g enable autoclosing and disable wrapping
selection with brackets, and this change must apply to all sessions
using js mode not just some of them )

* so instead of having to do

`docs.js.setMode(new JavaScriptMode());`

`docs.js.setMode("javasscript"); // or docs.js.setMode("mylib/mode/
mylang");`

which will asynchronously load mode and add it to session


* also outdent and behaviour shouldn't be new objects on mode, it
would be better to have them as librarieslending some functions to
mode

* outdent needs to become a behavior and not be handled separately

* modes must be able to add commands and keybindings, which will
enable better integration with zencoding and similar plugins

* there must be way for commands to let triggering key event to
propagate further to other keybindings and browser

* maybe bracket matching/highlighting code should be moved to modes as
well, to recognize regexps and work with xml tags/python blocks.

* i think it would be good to again split commands and keybindings, it
should be possible to add commands the way it's done now but storing
them separately, and adding default keybindings separately was much
cleaner imo


btw: sublimeText 2 has a new command palette with fuzzy matching,
which is great for autocompletion and as a simple commandline/menu
do you think it will be good to have something like this in ace or it
is better to be handled separately?
Reply all
Reply to author
Forward
0 new messages