[llvm-branch-commits] [lldb] [lldb] Add tree-sitter based Rust syntax highlighting (PR #181282)
Michael Buch via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Fri Feb 13 04:58:50 PST 2026
================
@@ -0,0 +1,206 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "RustTreeSitterHighlighter.h"
+#include "lldb/Target/Language.h"
+
+LLDB_PLUGIN_DEFINE_ADV(RustTreeSitterHighlighter, HighlighterTreeSitterRust)
+
+extern "C" {
+const TSLanguage *tree_sitter_rust();
+}
+
+using namespace lldb_private;
+
+const TSLanguage *RustTreeSitterHighlighter::GetLanguage() const {
+ return tree_sitter_rust();
+}
+
+llvm::StringRef RustTreeSitterHighlighter::GetHighlightQuery() const {
+ static constexpr const llvm::StringLiteral query = R"__(
+; Identifiers
+
+(type_identifier) @type
----------------
Michael137 wrote:
Where does this come from? Is there some sort of repository of these?
https://github.com/llvm/llvm-project/pull/181282
More information about the llvm-branch-commits
mailing list