findPossibleLocalVariableConflicts method
Returns names of elements that might conflict with a new local variable
declared at offset.
Implementation
Set<String> findPossibleLocalVariableConflicts(int offset) {
final enclosingNode = nodeCovering(offset: offset)!;
final enclosingBlock = enclosingNode.thisOrAncestorOfType<Block>();
if (enclosingBlock == null) {
return {};
}
final visitor = _ReferencedUnprefixedNamesCollector();
enclosingBlock.accept(visitor);
return visitor.names;
}