Skip to content

Commit 2986c81

Browse files
committed
fix(lint): remove unused TypeMapEntry imports; expand primitive-type sets to one-per-line
Biome flagged TypeMapEntry as an unused import in both cpp.ts and cuda.ts (ctx.typeMap.set is typed via ExtractorOutput, not via a direct TypeMapEntry annotation). Also reformatted CPP_PRIMITIVE_TYPES / CUDA_PRIMITIVE_TYPES to one element per line, which is what the Biome formatter requires.
1 parent 9320ed2 commit 2986c81

2 files changed

Lines changed: 48 additions & 10 deletions

File tree

src/extractors/cpp.ts

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import type {
44
SubDeclaration,
55
TreeSitterNode,
66
TreeSitterTree,
7-
TypeMapEntry,
87
} from '../types.js';
98
import { extractModifierVisibility, findChild, nodeEndLine } from './helpers.js';
109

@@ -363,10 +362,30 @@ function extractCppClassFields(classNode: TreeSitterNode): SubDeclaration[] {
363362
* into typeMap would cause spurious receiver edges (e.g. `int x` → `int`).
364363
*/
365364
const CPP_PRIMITIVE_TYPES = new Set([
366-
'int', 'long', 'short', 'unsigned', 'signed', 'float', 'double',
367-
'char', 'bool', 'void', 'wchar_t', 'auto', 'size_t', 'uint8_t',
368-
'uint16_t', 'uint32_t', 'uint64_t', 'int8_t', 'int16_t', 'int32_t',
369-
'int64_t', 'ptrdiff_t', 'intptr_t', 'uintptr_t',
365+
'int',
366+
'long',
367+
'short',
368+
'unsigned',
369+
'signed',
370+
'float',
371+
'double',
372+
'char',
373+
'bool',
374+
'void',
375+
'wchar_t',
376+
'auto',
377+
'size_t',
378+
'uint8_t',
379+
'uint16_t',
380+
'uint32_t',
381+
'uint64_t',
382+
'int8_t',
383+
'int16_t',
384+
'int32_t',
385+
'int64_t',
386+
'ptrdiff_t',
387+
'intptr_t',
388+
'uintptr_t',
370389
]);
371390

372391
function isPrimitiveCppType(typeName: string): boolean {

src/extractors/cuda.ts

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import type {
44
SubDeclaration,
55
TreeSitterNode,
66
TreeSitterTree,
7-
TypeMapEntry,
87
} from '../types.js';
98
import { extractModifierVisibility, findChild, nodeEndLine } from './helpers.js';
109

@@ -413,10 +412,30 @@ function innerCudaDeclarator(node: TreeSitterNode): TreeSitterNode | null {
413412
* these into typeMap would produce spurious receiver edges (e.g. `int x` → `int`).
414413
*/
415414
const CUDA_PRIMITIVE_TYPES = new Set([
416-
'int', 'long', 'short', 'unsigned', 'signed', 'float', 'double',
417-
'char', 'bool', 'void', 'wchar_t', 'auto', 'size_t', 'uint8_t',
418-
'uint16_t', 'uint32_t', 'uint64_t', 'int8_t', 'int16_t', 'int32_t',
419-
'int64_t', 'ptrdiff_t', 'intptr_t', 'uintptr_t',
415+
'int',
416+
'long',
417+
'short',
418+
'unsigned',
419+
'signed',
420+
'float',
421+
'double',
422+
'char',
423+
'bool',
424+
'void',
425+
'wchar_t',
426+
'auto',
427+
'size_t',
428+
'uint8_t',
429+
'uint16_t',
430+
'uint32_t',
431+
'uint64_t',
432+
'int8_t',
433+
'int16_t',
434+
'int32_t',
435+
'int64_t',
436+
'ptrdiff_t',
437+
'intptr_t',
438+
'uintptr_t',
420439
]);
421440

422441
function isCudaPrimitiveType(typeName: string): boolean {

0 commit comments

Comments
 (0)