code: function getCandidateFiles(scope) {
          function filter(file) {
              return _subtreeFilter(file, scope) && _isReadableText(file.fullPath);
          }
  
          // If the scope is a single file, just check if the file passes the filter directly rather than
          // trying to use ProjectManager.getAllFiles(), both for performance and because an individual
          // in-memory file might be an untitled document that doesn't show up in getAllFiles().
          if (scope && scope.isFile) {
              return new $.Deferred().resolve(filter(scope) ? [scope] : []).promise();
          } else {
              return ProjectManager.getAllFiles(filter, true, true);
          }
      }
docs: Finds all candidate files to search in the given scope's subtree that are not binary content. Does NOT apply
  the current filter yet.
  @param {?FileSystemEntry} scope Search scope, or null if whole project
  @return {$.Promise} A promise that will be resolved with the list of files in the scope. Never rejected.