|
LLDB mainline
|
#include <ClangHighlighter.h>
Public Member Functions | |
| ClangHighlighter () | |
| llvm::StringRef | GetName () const override |
| Returns a human readable name for the selected highlighter. | |
| 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. | |
| bool | isKeyword (llvm::StringRef token) const |
| Returns true if the given string represents a keywords in any Clang supported language. | |
| llvm::StringRef | GetPluginName () override |
| Public Member Functions inherited from lldb_private::Highlighter | |
| Highlighter ()=default | |
| virtual | ~Highlighter ()=default |
| Highlighter (const Highlighter &)=delete | |
| const Highlighter & | operator= (const Highlighter &)=delete |
| std::string | Highlight (const HighlightStyle &options, llvm::StringRef line, std::optional< size_t > cursor_pos, llvm::StringRef previous_lines="") const |
| Utility method for calling Highlight without a stream. | |
| Public Member Functions inherited from lldb_private::PluginInterface | |
| PluginInterface ()=default | |
| virtual | ~PluginInterface ()=default |
| PluginInterface (const PluginInterface &)=delete | |
| PluginInterface & | operator= (const PluginInterface &)=delete |
Static Public Member Functions | |
| static Highlighter * | CreateInstance (lldb::LanguageType language) |
| static void | Terminate () |
| static void | Initialize () |
| static llvm::StringRef | GetPluginNameStatic () |
Private Attributes | |
| llvm::StringSet | keywords |
Definition at line 20 of file ClangHighlighter.h.
| ClangHighlighter::ClangHighlighter | ( | ) |
Definition at line 32 of file ClangHighlighter.cpp.
Referenced by CreateInstance(), and isKeyword().
|
static |
Definition at line 262 of file ClangHighlighter.cpp.
References ClangHighlighter(), lldb_private::Highlighter::Highlighter(), and lldb_private::Language::LanguageIsCFamily().
Referenced by Initialize(), and Terminate().
|
inlineoverridevirtual |
Returns a human readable name for the selected highlighter.
Implements lldb_private::Highlighter.
Definition at line 25 of file ClangHighlighter.h.
|
inlineoverridevirtual |
Implements lldb_private::PluginInterface.
Definition at line 41 of file ClangHighlighter.h.
References GetPluginNameStatic().
|
inlinestatic |
Definition at line 40 of file ClangHighlighter.h.
Referenced by GetPluginName(), and Initialize().
|
overridevirtual |
Highlights the given line.
| options | The highlight options. |
| line | The user supplied line that needs to be highlighted. |
| cursor_pos | The cursor position of the user in this line, starting at 0 (which means the cursor is on the first character in 'line'). |
| previous_lines | Any previous lines the user has written which we should only use for getting the context of the Highlighting right. |
| s | The stream to which the highlighted version of the user string should be written. |
Implements lldb_private::Highlighter.
Definition at line 136 of file ClangHighlighter.cpp.
References lldb_private::HighlightStyle::ColorStyle::Apply(), determineClangStyle(), lldb_private::StreamString::GetString(), lldb_private::FileSystem::Instance(), and lldb_private::HighlightStyle::selected.
|
static |
Definition at line 268 of file ClangHighlighter.cpp.
References CreateInstance(), GetPluginNameStatic(), and lldb_private::PluginManager::RegisterPlugin().
| bool ClangHighlighter::isKeyword | ( | llvm::StringRef | token | ) | const |
Returns true if the given string represents a keywords in any Clang supported language.
Definition at line 28 of file ClangHighlighter.cpp.
References ClangHighlighter(), isKeyword(), and keywords.
Referenced by determineClangStyle(), and isKeyword().
|
static |
Definition at line 273 of file ClangHighlighter.cpp.
References CreateInstance(), and lldb_private::PluginManager::UnregisterPlugin().
|
private |
Definition at line 21 of file ClangHighlighter.h.
Referenced by isKeyword().