findVariableDefinitions method

List<DartBlockVariableDefinition> findVariableDefinitions(
  1. int key, {
  2. bool includeNode = false,
})

Implementation

List<DartBlockVariableDefinition> findVariableDefinitions(
  int key, {
  bool includeNode = false,
}) {
  var containingNode = findNodeByKey(key);

  if (!includeNode) {
    containingNode = containingNode?.parent;
  }
  if (containingNode != null) {
    return containingNode
        ._findVariableDefinitions(_getInherentVariableDefinitions())
        .toSet()
        .toList();
  } else {
    if (includeNode) {
      return _getInherentVariableDefinitions();
    } else {
      return [];
    }
  }
}