fix: imported patterns used for inheritance were not highlighted. (#2356)

The problem was that imported files didn't have token sequences to
obtain the UDT variables. The fix was to create maps from the file name
to the token sequence and then process each imported file to obtain all
the variables needed. Function variables are skipped since they can be
part of the code.
There are also some minor code style corrections and a fix in the text
editor where the last line of a selection was not being deleted.
This commit is contained in:
paxcut
2025-07-25 12:16:02 -07:00
committed by GitHub
parent 68804a357d
commit 8f3d07ea69
4 changed files with 93 additions and 98 deletions

View File

@@ -74,9 +74,11 @@ namespace hex::plugin::builtin {
Scopes m_globalTokenRange;
VariableMap m_UDTVariables;
VariableMap m_ImportedUDTVariables;
VariableMap m_functionVariables;
Variables m_globalVariables;
std::map<std::string, std::vector<Token>> m_parsedImports;
std::map<std::string,std::string> m_attributeFunctionArgumentType;
std::map<std::string,std::string> m_typeDefMap;
std::map<std::string,std::string> m_typeDefInvMap;
@@ -157,6 +159,8 @@ namespace hex::plugin::builtin {
* @brief Entry point to syntax highlighting
*/
void highlightSourceCode();
void processSource();
void clearVariables();
/**
* @brief Syntax highlighting from parser