From 854535fec614399f4fc9b7989b2694a151698b3a Mon Sep 17 00:00:00 2001 From: paxcut <53811119+paxcut@users.noreply.github.com> Date: Fri, 20 Mar 2026 10:45:01 -0700 Subject: [PATCH] fix: Some variables are incorrectly highlighted as errors (#2690) Non-auto function arguments of custom types defined inside a namespace made the highlighter unable to check if member uses inside the function are valid. Argument types were not parsed as fully qualified types and the problem is corrected by making sure that fully qualified names are used when they are found in function arguments. An example of a pattern that shows the error is id3.hexpat in the which uses unqualified types. In order to obtain the correct highlighting then you have to add the namespace to all custom types even if they are being used inside the namespace. Type names without namespace are considered by the syntax highlighting code as belonging to the global scope regardless of where the use takes place. --- .../source/content/text_highlighting/pattern_language.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/builtin/source/content/text_highlighting/pattern_language.cpp b/plugins/builtin/source/content/text_highlighting/pattern_language.cpp index 7304706bf..8076a572e 100644 --- a/plugins/builtin/source/content/text_highlighting/pattern_language.cpp +++ b/plugins/builtin/source/content/text_highlighting/pattern_language.cpp @@ -1909,8 +1909,10 @@ namespace hex::plugin::builtin { if (peek(tkn::ValueType::Any)) typeStr = Token::getTypeName(*getValue(0)); - else if (peek(tkn::Literal::Identifier)) - typeStr = getValue(0)->get(); + else if (peek(tkn::Literal::Identifier)) { + std::vector identifiers; + getQualifiedName(typeStr, identifiers, true, false); + } m_curr = curr; return typeStr;