You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Export-macro recovery: project-level override for the candidate rule (follow-up to #2005) #2049
Follow-up to #2005 (refs #1989), which recovers C/C++ type definitions hidden behind build-system export macros (class MOD_API Foo, UE's MODULE_API, CMake's <lib>_EXPORT) by detecting candidate macro names from a built-in shape rule — identifiers ending in _API / _EXPORT / _IMPORT / _DLLEXPORT / _DEPRECATED with a prefix of at least two characters, at most 32 per file — and defining them empty in the preprocessing second pass.
That heuristic was accepted as the zero-config default (it is what most real codebases need and it costs users nothing). What is missing is the explicit path the original report called option 2: a way for a project to override the rule when the shape rule is wrong for it.
Scope of the ask:
add project-level configuration to extend the candidate set with explicit export-macro names (or additional suffixes) that the shape rule does not match — e.g. a project whose export macro is EXPORTED or PUBLIC_SYMBOL;
add the matching way to exclude a name the rule matches but that is a genuine symbol in that project (the one known failure mode: an all-caps identifier with one of those suffixes used as a real symbol would be defined empty for that file);
document it next to the existing preprocessing/defines configuration; tests for extend, exclude, and precedence.
Not a blocker for #2005 — this is the escape hatch on top of it. @XIYBHK, since you know this code best now: would you like to take it? No pressure on timing.
Thanks for filing this follow-up. I understand #2049 as the project-level escape hatch layered on top of #2005: keep the accepted zero-config heuristic as the default, then allow a project to extend the candidate set and exclude names that the heuristic would misclassify. I would also preserve the existing precedence of caller-provided defines over inferred candidates.
Before implementing, could you please confirm the intended configuration contract?
Should this live only in the project .codebase-memory.json, or also in the global config?
Is exact-name include/exclude sufficient for this PR, or should additional suffixes be supported too?
If both global and project settings are supported, should they merge, with project exclusions taking precedence?
Should the existing 32-candidate cap apply to built-in and configured candidates together?
Should configured names be considered only when they occur as code tokens in the current file?
Should the existing fail-open config behavior and semantic-manifest invalidation remain unchanged?
Once those points are settled, I can prepare a focused implementation and tests for extend, exclude, and precedence.
Activity
XIYBHK commentedon Sep 5, 2026
Thanks for filing this follow-up. I understand #2049 as the project-level escape hatch layered on top of #2005: keep the accepted zero-config heuristic as the default, then allow a project to extend the candidate set and exclude names that the heuristic would misclassify. I would also preserve the existing precedence of caller-provided defines over inferred candidates.
Before implementing, could you please confirm the intended configuration contract?
.codebase-memory.json, or also in the global config?include/excludesufficient for this PR, or should additional suffixes be supported too?Once those points are settled, I can prepare a focused implementation and tests for extend, exclude, and precedence.