[Lldb-commits] [lldb] [lldb] Pass the frame's language type to the highlighter (PR #181094)

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Thu Feb 12 09:11:14 PST 2026


================
@@ -706,7 +708,8 @@ size_t SourceManager::File::DisplaySourceLines(uint32_t line,
       GetSupportFile()->GetSpecOnly().GetPath(/*denormalize*/ false);
   // FIXME: Find a way to get the definitive language this file was written in
   // and pass it to the highlighter.
-  const auto &h = mgr.getHighlighterFor(lldb::eLanguageTypeUnknown, path);
+  const auto &h = mgr.getHighlighterFor(
+      language_type.value_or(lldb::eLanguageTypeUnknown), path);
----------------
JDevlieghere wrote:

Fair point. I was on the fence and went with optional to convey the intent, but `eLanguageTypeUnknown` would work equally well. I'll take the fact that you asked a sign that at least you lean that way, which is enough motivation to change it. 

https://github.com/llvm/llvm-project/pull/181094


More information about the lldb-commits mailing list