Move getDebugLocation to ScopDetectionDiagnostic