Introduce line editor library.

Press ? to show keyboard shortcuts.
Committed
pccJan 31 2014, 3:46 PM
Differential Revision
D2200: Introduce line editor library.
Parents
rL200594: Introduce llvm::sys::path::home_directory.
Branches
Unknown
Tags
Unknown
Description

Introduce line editor library.

This library will be used by clang-query. I can imagine LLDB becoming another
client of this library, so I think LLVM is a sensible place for it to live.
It wraps libedit, and adds tab completion support.

The code is loosely based on the line editor bits in LLDB, with a few
improvements:

  • Polymorphism for retrieving the list of tab completions, based on the concept pattern from the new pass manager.
  • Tab completion doesn't corrupt terminal output if the input covers multiple lines. Unfortunately this can only be done in a truly horrible way, as far as I can tell. But since the alternative is to implement our own line editor (which I don't think LLVM should be in the business of doing, at least for now) I think it may be acceptable.
  • Includes a fallback for the case where the user doesn't have libedit installed.

Note that this uses C stdio, mainly because libedit also uses C stdio.

Differential Revision: http://llvm-reviews.chandlerc.com/D2200

rL200595

llvm/trunk/autoconf/configure.ac

Loading...

llvm/trunk/cmake/config-ix.cmake

Loading...

llvm/trunk/configure

Loading...

llvm/trunk/include/llvm/Config/config.h.cmake

Loading...

llvm/trunk/include/llvm/Config/config.h.in

Loading...

llvm/trunk/include/llvm/LineEditor/

Loading...

llvm/trunk/include/llvm/LineEditor/LineEditor.h

Loading...

llvm/trunk/lib/CMakeLists.txt

Loading...

llvm/trunk/lib/LLVMBuild.txt

Loading...

llvm/trunk/lib/LineEditor/

Loading...

llvm/trunk/lib/LineEditor/CMakeLists.txt

Loading...

llvm/trunk/lib/LineEditor/LLVMBuild.txt

Loading...

llvm/trunk/lib/LineEditor/LineEditor.cpp

Loading...

llvm/trunk/lib/LineEditor/Makefile

Loading...

llvm/trunk/lib/Makefile

Loading...

llvm/trunk/unittests/CMakeLists.txt

Loading...

llvm/trunk/unittests/LineEditor/

Loading...

llvm/trunk/unittests/LineEditor/CMakeLists.txt

Loading...

llvm/trunk/unittests/LineEditor/LineEditor.cpp

Loading...

llvm/trunk/unittests/LineEditor/Makefile

Loading...

llvm/trunk/unittests/Makefile

Loading...

Add Comment