diff --git a/src/Parsers/ASTDictionary.cpp b/src/Parsers/ASTDictionary.cpp index 66c1c3791b8..5716a713c0c 100644 --- a/src/Parsers/ASTDictionary.cpp +++ b/src/Parsers/ASTDictionary.cpp @@ -161,8 +161,8 @@ void ASTDictionary::formatImpl(const FormatSettings & settings, FormatState & st if (source) { - settings.ostr << (settings.hilite ? hilite_keyword : "") << settings.nl_or_ws << "SOURCE(" - << (settings.hilite ? hilite_none : ""); + settings.ostr << (settings.hilite ? hilite_keyword : "") << settings.nl_or_ws << "SOURCE" + << (settings.hilite ? hilite_none : "") << "("; source->formatImpl(settings, state, frame); settings.ostr << ")"; } diff --git a/src/Parsers/ASTDictionaryAttributeDeclaration.cpp b/src/Parsers/ASTDictionaryAttributeDeclaration.cpp index 760b96b0927..127b07fa685 100644 --- a/src/Parsers/ASTDictionaryAttributeDeclaration.cpp +++ b/src/Parsers/ASTDictionaryAttributeDeclaration.cpp @@ -66,6 +66,8 @@ void ASTDictionaryAttributeDeclaration::formatImpl(const FormatSettings & settin if (is_object_id) settings.ostr << ' ' << (settings.hilite ? hilite_keyword : "") << "IS_OBJECT_ID"; + + settings.ostr << (settings.hilite ? hilite_none : ""); } } diff --git a/src/Parsers/ASTFunction.cpp b/src/Parsers/ASTFunction.cpp index fa4874d89b6..b3d2a262695 100644 --- a/src/Parsers/ASTFunction.cpp +++ b/src/Parsers/ASTFunction.cpp @@ -692,7 +692,7 @@ void ASTFunction::formatImplWithoutAlias(const FormatSettings & settings, Format { std::string nl_or_nothing = settings.one_line ? "" : "\n"; std::string indent_str = settings.one_line ? "" : std::string(4u * frame.indent, ' '); - settings.ostr << (settings.hilite ? hilite_function : "") << name << "(" << nl_or_nothing; + settings.ostr << (settings.hilite ? hilite_function : "") << name << (settings.hilite ? hilite_none : "") << "(" << nl_or_nothing; FormatStateStacked frame_nested = frame; frame_nested.need_parens = false; ++frame_nested.indent; diff --git a/src/Parsers/ASTKillQueryQuery.cpp b/src/Parsers/ASTKillQueryQuery.cpp index 8bf99312544..a3c0f48f28a 100644 --- a/src/Parsers/ASTKillQueryQuery.cpp +++ b/src/Parsers/ASTKillQueryQuery.cpp @@ -29,11 +29,13 @@ void ASTKillQueryQuery::formatQueryImpl(const FormatSettings & settings, FormatS break; } + settings.ostr << (settings.hilite ? hilite_none : ""); + formatOnCluster(settings); if (where_expression) { - settings.ostr << " WHERE " << (settings.hilite ? hilite_none : ""); + settings.ostr << (settings.hilite ? hilite_keyword : "") << " WHERE " << (settings.hilite ? hilite_none : ""); where_expression->formatImpl(settings, state, frame); } diff --git a/src/Parsers/ASTWithAlias.cpp b/src/Parsers/ASTWithAlias.cpp index 88f6568a719..1b5397654fd 100644 --- a/src/Parsers/ASTWithAlias.cpp +++ b/src/Parsers/ASTWithAlias.cpp @@ -20,7 +20,9 @@ void ASTWithAlias::formatImpl(const FormatSettings & settings, FormatState & sta /// This is needed because the query can become extraordinary large after substitution of aliases. if (!alias.empty() && !state.printed_asts_with_alias.emplace(frame.current_select, alias, getTreeHash()).second) { + settings.ostr << (settings.hilite ? IAST::hilite_identifier : ""); settings.writeIdentifier(alias); + settings.ostr << (settings.hilite ? IAST::hilite_none : ""); } else { diff --git a/src/Parsers/ASTWithElement.cpp b/src/Parsers/ASTWithElement.cpp index b517509c4bc..1cc669e36da 100644 --- a/src/Parsers/ASTWithElement.cpp +++ b/src/Parsers/ASTWithElement.cpp @@ -18,6 +18,7 @@ void ASTWithElement::formatImpl(const FormatSettings & settings, FormatState & s { std::string indent_str = settings.one_line ? "" : std::string(4 * frame.indent, ' '); + settings.ostr << (settings.hilite ? hilite_alias : ""); settings.writeIdentifier(name); settings.ostr << (settings.hilite ? hilite_keyword : "") << " AS" << (settings.hilite ? hilite_none : ""); settings.ostr << settings.nl_or_ws << indent_str;