Implement getNameOrDottedNameSpan for new compiler