LLDB mainline
DefaultHighlighter.h
Go to the documentation of this file.
1//===----------------------------------------------------------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLDB_SOURCE_PLUGINS_HIGHLIGHTER_DEFAULT_DEFAULTHIGHLIGHTER_H
10#define LLDB_SOURCE_PLUGINS_HIGHLIGHTER_DEFAULT_DEFAULTHIGHLIGHTER_H
11
13
14namespace lldb_private {
15
16/// A default highlighter that only highlights the user cursor, but doesn't
17/// do any other highlighting.
19public:
20 llvm::StringRef GetName() const override { return "none"; }
21
22 void Highlight(const HighlightStyle &options, llvm::StringRef line,
23 std::optional<size_t> cursor_pos,
24 llvm::StringRef previous_lines, Stream &s) const override;
25
27
28 static void Terminate();
29 static void Initialize();
30
31 static llvm::StringRef GetPluginNameStatic() { return "Default Highlighter"; }
32 llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
33};
34
35} // namespace lldb_private
36
37#endif
A default highlighter that only highlights the user cursor, but doesn't do any other highlighting.
static llvm::StringRef GetPluginNameStatic()
llvm::StringRef GetPluginName() override
llvm::StringRef GetName() const override
Returns a human readable name for the selected highlighter.
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.
Annotates source code with color attributes.
Definition Highlighter.h:96
A stream class that can stream formatted output to a file.
Definition Stream.h:28
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.
Definition Highlighter.h:25