17 std::optional<
size_t> cursor_pos,
18 llvm::StringRef previous_lines,
21 if (!cursor_pos || *cursor_pos >= line.size()) {
30 size_t column = *cursor_pos;
32 s << line.substr(0, column);
34 options.selected.Apply(s, line.substr(column, 1));
36 s << line.substr(column + 1U);
#define LLDB_PLUGIN_DEFINE_ADV(ClassName, PluginName)
A default highlighter that only highlights the user cursor, but doesn't do any other highlighting.
static llvm::StringRef GetPluginNameStatic()
static Highlighter * CreateInstance(lldb::LanguageType language)
void Highlight(const HighlightStyle &options, llvm::StringRef line, std::optional< size_t > cursor_pos, llvm::StringRef previous_lines, Stream &s) const override
Highlights the given line.
static bool RegisterPlugin(llvm::StringRef name, llvm::StringRef description, ABICreateInstance create_callback)
static bool UnregisterPlugin(ABICreateInstance create_callback)
A stream class that can stream formatted output to a file.
A class that represents a running process on the host machine.
LanguageType
Programming language type.
Represents style that the highlighter should apply to the given source code.