From a73bf9136c8c11830fff5ccda83e70ac20fed283 Mon Sep 17 00:00:00 2001 From: Matheus Aguiar Date: Mon, 4 Jul 2022 19:01:30 -0300 Subject: [PATCH] Remove "garbage" code snippet from error message when in import-ast mode. --- liblangutil/SourceReferenceFormatter.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/liblangutil/SourceReferenceFormatter.cpp b/liblangutil/SourceReferenceFormatter.cpp index 0edd551b8..a38c5e617 100644 --- a/liblangutil/SourceReferenceFormatter.cpp +++ b/liblangutil/SourceReferenceFormatter.cpp @@ -124,6 +124,9 @@ void SourceReferenceFormatter::printSourceLocation(SourceReference const& _ref) string_view text = _ref.text; + if (m_charStreamProvider.charStream(_ref.sourceName).isImportedFromAST()) + return; + if (!_ref.multiline) { size_t const locationLength = static_cast(_ref.endColumn - _ref.startColumn);