cs-education / sysbuild

A system programming learning environment in the browser
https://cs-education.github.io/sys/
Other
36 stars 35 forks source link

Enable Live Autocomplete in Ace Editor #62

Open anant-singh opened 9 years ago

anant-singh commented 9 years ago

After enabling the live auto-complete feature in Ace editor through the documentation given here: https://github.com/ajaxorg/ace/wiki/How-to-enable-Autocomplete-in-the-Ace-editor , the auto-indenting feature creates unexpected results.

Note: Basic auto-complete will still work but live-autocomplete interferes with auto-indenting.

Enabling auto-complete in Ace is a pre-requisite to #22.

angrave commented 9 years ago

On 12/14/14 7:34 PM, Anant Kumar Singh wrote:

After enabling the live auto-complete feature in Ace editor through the documentation given here: https://github.com/ajaxorg/ace/wiki/How-to-enable-Autocomplete-in-the-Ace-editor , the auto-indenting feature creates unexpected results.

Note: Basic auto-complete will still work but live-autocomplete interferes with auto-indenting.

— Reply to this email directly or view it on GitHub https://github.com/cs-education/sysbuild/issues/62.

  1. I would be suspicious of our new auto indent feature

e.g. I think it may also be interfering with copy-paste and multiple undo. (at least it used to)

  1. by the way. please add a new bug (or report an ACE bug) for the following indent

if(0) { /* next line should be indented / char m= "this line is not indented"; // due to dumb indent parsing }

my guess is that { and } are ignored if a comment token /* is in the line somewhere. Making the indenter a little less braindead in this corner case would be nice.

Lawrence

anant-singh commented 9 years ago

I think there is an inherent problem in using any live auto-feature or using the on 'change' event to trigger any change. Maybe why the multiple undo is failing is because the auto-indent may also be registering as a change.

Also, for every live features that we put in, it keeps switching the focus based on the random order of execution of event listeners, the reason why the suggestion drop drown for auto-complete loses focus almost instantly and disappears.

neelabhg commented 9 years ago

Is simple keyboard-triggered auto-complete also having this problem? Or is this happening only with live auto-complete, in which suggestions automatically pop up as the user types?

In any case, it is beneficial to address the issue and enable both normal and live auto-complete. I think then we should provide the user with a settings option to enable live suggestions or not (some users like it, some find it annoying). What do you think?

neelabhg commented 9 years ago

FYI, I created a new issue (#67) to follow-up on point 2 in @angrave's comment above.