Context
src/extractors/cuda.ts defines CUDA_PRIMITIVE_TYPES and src/extractors/cpp.ts defines CPP_PRIMITIVE_TYPES. Both sets are identical (24 members: int, long, short, unsigned, signed, float, double, char, bool, void, wchar_t, auto, size_t, uint8_t–uint64_t, int8_t–int64_t, ptrdiff_t, intptr_t, uintptr_t).
Noted during review of PR #1503 (Greptile summary).
Fix
Extract a single C_PRIMITIVE_TYPES constant in a shared location (e.g. src/extractors/helpers.ts) and import it in both cpp.ts and cuda.ts. Update isCudaPrimitiveType and isPrimitiveCppType to reference the shared set.
Impact
Pure refactor — no behavioral change. Eliminates the risk of the two sets drifting apart if C++ or CUDA adds new primitive types in future tree-sitter grammar versions.
Context
src/extractors/cuda.tsdefinesCUDA_PRIMITIVE_TYPESandsrc/extractors/cpp.tsdefinesCPP_PRIMITIVE_TYPES. Both sets are identical (24 members: int, long, short, unsigned, signed, float, double, char, bool, void, wchar_t, auto, size_t, uint8_t–uint64_t, int8_t–int64_t, ptrdiff_t, intptr_t, uintptr_t).Noted during review of PR #1503 (Greptile summary).
Fix
Extract a single
C_PRIMITIVE_TYPESconstant in a shared location (e.g.src/extractors/helpers.ts) and import it in bothcpp.tsandcuda.ts. UpdateisCudaPrimitiveTypeandisPrimitiveCppTypeto reference the shared set.Impact
Pure refactor — no behavioral change. Eliminates the risk of the two sets drifting apart if C++ or CUDA adds new primitive types in future tree-sitter grammar versions.