@@ -920,21 +920,6 @@ define(function (require, exports, module) {
920
920
return result . promise ( ) ;
921
921
}
922
922
923
- /**
924
- * @private
925
- * @type {?$.Promise } Resolves when the currently running instance of
926
- * _refreshFileTreeInternal completes, or null if there is no currently
927
- * running instance.
928
- */
929
- var _refreshFileTreePromise = null ;
930
-
931
- /**
932
- * @type {boolean } If refreshFileTree is called before _refreshFileTreePromise
933
- * has resolved then _refreshPending is set, which indicates that
934
- * refreshFileTree should be called again once the promise resolves.
935
- */
936
- var _refreshPending = false ;
937
-
938
923
/**
939
924
* @const
940
925
* @private
@@ -944,38 +929,16 @@ define(function (require, exports, module) {
944
929
945
930
/**
946
931
* Refresh the project's file tree, maintaining the current selection.
947
- *
948
- * @return {$.Promise } A promise object that will be resolved when the
949
- * project tree is reloaded, or rejected if the project path
950
- * fails to reload. If the previous selected entry is not found,
951
- * the promise is still resolved.
932
+ *
933
+ * Note that the original implementation of this returned a promise to be resolved when the refresh is complete.
934
+ * That use is deprecated and `refreshFileTree` is now a "fire and forget" kind of function.
952
935
*/
953
- function refreshFileTree ( ) {
954
- if ( ! _refreshFileTreePromise ) {
955
- var internalRefreshPromise = model . refresh ( ) ,
956
- deferred = new $ . Deferred ( ) ;
957
-
958
- _refreshFileTreePromise = deferred . promise ( ) ;
959
-
960
- _refreshFileTreePromise . always ( function ( ) {
961
- _refreshFileTreePromise = null ;
962
-
963
- if ( _refreshPending ) {
964
- _refreshPending = false ;
965
- refreshFileTree ( ) ;
966
- }
967
- } ) ;
968
-
969
- // Wait at least one second before resolving the promise
970
- window . setTimeout ( function ( ) {
971
- internalRefreshPromise . then ( deferred . resolve , deferred . reject ) ;
972
- } , _refreshDelay ) ;
973
- } else {
974
- _refreshPending = true ;
975
- }
976
-
977
- return _refreshFileTreePromise ;
978
- }
936
+ var refreshFileTree = function refreshFileTree ( ) {
937
+ FileSystem . clearAllCaches ( ) ;
938
+ return new $ . Deferred ( ) . resolve ( ) . promise ( ) ;
939
+ } ;
940
+
941
+ refreshFileTree = _ . debounce ( refreshFileTree , _refreshDelay ) ;
979
942
980
943
/**
981
944
* Expands tree nodes to show the given file or folder and selects it. Silently no-ops if the
0 commit comments