MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / isMemberOfDefault

Function isMemberOfDefault

src/resolution/type-parameters.ts:100–105  ·  view source on GitHub ↗

Whether the resolved target is a member of the class a C++ template parameter defaults to (`= TcParser`, `= std::allocator `).

(result: ResolvedRef, fallback: string | undefined, context: ResolutionContext)

Source from the content-addressed store, hash-verified

98
99/** Whether the resolved target is a member of the class a C++ template parameter defaults to (`= TcParser`, `= std::allocator<T>`). */
100function isMemberOfDefault(result: ResolvedRef, fallback: string | undefined, context: ResolutionContext): boolean {
101 const type = fallback === undefined ? undefined : /([A-Za-z_]\w*)\s*(?:<[\s\S]*>)?\s*$/.exec(fallback)?.[1];
102 if (!type) return false;
103 const segments = context.getNodeById?.(result.targetNodeId)?.qualifiedName.split('::') ?? [];
104 return segments.length >= 2 && segments[segments.length - 2] === type;
105}
106
107const SCALA_OWNER_KINDS: ReadonlySet<string> = new Set(['class', 'trait', 'module', 'interface', 'struct', 'enum']);
108const SCALA_TYPE_KINDS: ReadonlySet<string> = new Set(['class', 'trait', 'interface', 'struct', 'enum', 'type_alias']);

Callers 1

gateTypeParameterFunction · 0.85

Calls 2

execMethod · 0.65
getNodeByIdMethod · 0.65

Tested by

no test coverage detected