Something went wrong. Try again.
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829import { declarationSymbols } from './shared';import type { LanguageAdapter } from '../types';
const kinds = new Map([ ['function_declaration', 'function'], ['class_declaration', 'class'], ['interface_declaration', 'interface'], ['type_alias_declaration', 'type'], ['enum_declaration', 'enum'], ['lexical_declaration', 'variable'], ['export_statement', 'export'],]);const nestedKinds = new Map([ ['method_definition', 'method'], ['method_signature', 'method'],]);const containers = new Set(['class_declaration', 'interface_declaration', 'type_alias_declaration']);
function make(grammarName: string, extensions: string[]): LanguageAdapter { return { extensions, grammarName, symbols: (node, source) => declarationSymbols(node, source, kinds, nestedKinds, containers), };}
export const typescriptAdapter = make('typescript', ['.ts']);export const tsxAdapter = make('tsx', ['.tsx']);