code: function _setDirectoryOpen(treeData, path, open) {
          var objectPath = _filePathToObjectPath(treeData, path),
              directory = treeData.getIn(objectPath);
  
          if (!objectPath) {
              return {
                  needsLoading: true,
                  treeData: treeData
              };
          }
  
          if (isFile(directory)) {
              return;
          }
  
          var alreadyOpen = directory.get("open") === true;
  
          if ((alreadyOpen && open) || (!alreadyOpen && !open)) {
              return;
          }
  
          treeData = treeData.updateIn(objectPath, function (directory) {
              if (open) {
                  return directory.set("open", true);
              } else {
                  return directory.delete("open");
              }
          });
  
          if (open && (directory.get("children") === null || directory.get("notFullyLoaded"))) {
              return {
                  needsLoading: true,
                  treeData: treeData
              };
          }
          return {
              needsLoading: false,
              treeData: treeData
          };
      }
docs: @private
  
  See `FileTreeViewModel.setDirectoryOpen`