This repository was archived by the owner on May 25, 2019. It is now read-only.
File tree 2 files changed +23
-0
lines changed
2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -440,6 +440,25 @@ def run(self):
440
440
ng .projects_index_cache = {}
441
441
442
442
443
+ class AngularjsPruneCacheCommand (sublime_plugin .WindowCommand ):
444
+ global ng
445
+
446
+ def run (self ):
447
+ indx = ng .get_current_project_indexes ()
448
+ missing_files = []
449
+ for definition in indx ['definitions' ]:
450
+ if not os .path .isfile (definition [1 ]):
451
+ missing_files .append (definition )
452
+ missing_len = len (missing_files )
453
+ message .alert ('Removed %s files from index.' % missing_len )
454
+ if missing_len :
455
+ for f in missing_files :
456
+ indx ['definitions' ].remove (f )
457
+ j_data = open (ng .index_cache_location , 'w' )
458
+ j_data .write (json .dumps (ng .projects_index_cache ))
459
+ j_data .close ()
460
+
461
+
443
462
class AngularjsFileIndexCommand (sublime_plugin .WindowCommand ):
444
463
445
464
global ng
Original file line number Diff line number Diff line change 7
7
"caption" : " AngularJS: Delete Cache" ,
8
8
"command" : " angularjs_delete_cache"
9
9
},
10
+ {
11
+ "caption" : " AngularJS: Prune Cache" ,
12
+ "command" : " angularjs_prune_cache"
13
+ },
10
14
{
11
15
"caption" : " AngularJS: Look Up Definition" ,
12
16
"command" : " angularjs_find"
You can’t perform that action at this time.
0 commit comments