Xcode 6 Merge: Line Editing

If you’ve used the Xcode 6 Swift REPL you may have noticed a number of changes to the way we handle line editing, particularly for text spanning multiple lines. I intend to merge back the relevant line editing changes in the next few days and wanted to provide some advance warning that this is coming. This completely replaces editline.h/cpp and makes non-trivial changes to IOHandler.h/cpp. There are also minor changes to the command interpreter. From the original commit log:

Complete rewrite of interactive editing support for single- and multi-line input.

Improvements include:

  • Use of libedit’s wide character support, which is imperfect but a distinct improvement over ASCII-only
  • Use of "faint” colorization for line prompts
  • Breaking lines and insert new lines in the middle of a batch by simply pressing return
  • Joining lines with forward and backward character deletion
  • Detection of paste to suppress automatic formatting and statement completion tests
  • Correctly reformatting when lines grow or shrink to occupy different numbers of rows
  • Saving multi-line history, and correctly preserving the “tip” of history during editing
  • Displaying visible ^C and ^D indications when interrupting input or sending EOF
  • VI support for multi-line editing
  • General correctness and reliability improvements

The most obvious caveat here is that while these changes have been exercised on OS X, it’s certainly possible that we’ll see issues crop up on other platforms as a result.

Kate Stone k8stone@apple.com
 Xcode Runtime Analysis Tools

Hey Kate,

Might you be able to put up the patches (say on reviews.llvm.org) a bit ahead of time and we can maybe have a chance to address any issues on the Linux side before it goes into top of tree? Or if reviews.llvm.org is inconvenient, we could either do an svn branch, or I’d be happy to clone from a github (or create a github branch you could patch into at github.com/tfiala/lldb). Not a big deal either way, but we’ve hit a number of hiccups on the non-Apple side with the IOHandler work in the past, and this might speed up our ability to address any issues ahead of time.

In any event, thanks for the heads up!

-Todd

Will do. It turns out they’re somewhat intertwined with some of Greg’s changes, so we’ll sort them out first thing next week and post a patch.

Kate Stone k8stone@apple.com
 Xcode Runtime Analysis Tools

Great, thanks Kate!

Life, work, illness, and a surprise last-minute merge with colliding changes slowed the process down, but as promised I’ve posted the proposed change:

http://reviews.llvm.org/D5835

Kate Stone k8stone@apple.com
 Xcode Runtime Analysis Tools

Moreover, it is totally unacceptable to drop code without review like this.

Please post the patch for review, and review it in the open.

Look at how the ARM64 backend was posted. It wasn't just "merged back". =/

I think that’s what Kate meant when she said “Will do.” to Todd.

Sean

Ok, it really didn't come across that way.

This entire email seems really hostile to the LLVM development policies
around code review. =/

I’m sorry I missed this tail end of the exchange. My intention in giving a heads-up and starting the code review process was absolutely to make sure the community had a chance to understand the changes. We try to do as much development out in the open as possible on LLDB but occasionally work is intertwined with unannounced projects, so we do our best to reconcile divergence quickly following a release.

Kate Stone k8stone@apple.com
 Xcode Runtime Analysis Tools