scanProject method

void scanProject(
  1. String projectPath
)

Public method or function.

Implementation

void scanProject(String projectPath) {
  if (_scanned) return;
  final libPath = fs.join(projectPath, 'lib');
  if (!fs.exists(libPath) || !fs.isDirectory(libPath)) {
    _scanned = true;
    return;
  }
  _dartFiles[projectPath] = _findDartFiles(libPath);
  for (final filePath in _dartFiles[projectPath]!) {
    final content = fs.readAsString(filePath);
    _dartContent[filePath] = content;
    final cleaned = _stripCommentsAndStrings(content);
    _dartCleaned[filePath] = cleaned;
    _dartLines[filePath] = cleaned.split('\n');
  }
  _scanned = true;
}