schemely icon indicating copy to clipboard operation
schemely copied to clipboard

Complete current statement

Open rubenbarroso opened this issue 14 years ago • 0 comments

The editor action for completing the current statement is really useful when editing languages not based on S-Expressions, and I consider that it would bring even greater value to lispy languages.

For example:

(define list-length
   (lambda (lst)
   (if (null? lst)
       0
       (+ 1 (list-length (cdr lst)_<-- caret here

Using at that point the key combination -or whatever is assigned for completing the current statement- cmd+shift+enter would include the remaining closing parentheses.

(define list-length
  (lambda (lst)
  (if (null? lst)
      0
      (+ 1 (list-length (cdr lst))))))
_<-- caret here

This action is certainly not context-free, and it may be addressed in several ways. For instance, in the example above, it could also close just the expression corresponding to list-length:

(define list-length
   (lambda (lst)
   (if (null? lst)
       0
       (+ 1 (list-length (cdr lst))_<-- caret here

All in all, something to investigate that could uplift the editor capability set.

rubenbarroso avatar Mar 04 '11 09:03 rubenbarroso