visitConstructorDeclaration method

  1. @override
void visitConstructorDeclaration(
  1. ConstructorDeclaration node
)
override

Implementation

@override
void visitConstructorDeclaration(ConstructorDeclaration node) {
  final name = node.name?.lexeme;
  final constructorName = name != null ? (_currentContainer! + '.' + name) : _currentContainer!;
  final constructorId = SymbolNode.buildId(filePath, constructorName);

  graph.addSymbol(SymbolNode(
    id: constructorId,
    filePath: filePath,
    symbolName: constructorName,
    containerName: _currentContainer,
    symbolType: 'constructor',
    isTest: filePath.startsWith('test/'),
  ));

  final oldSymbolId = _currentSymbolId;
  _currentSymbolId = constructorId;

  super.visitConstructorDeclaration(node);

  _currentSymbolId = oldSymbolId;
}