@@ -21,12 +21,12 @@ module.exports = class Snippets {
2121 : undefined ) ,
2222 atom . commands . add ( 'atom-text-editor' , 'snippets:available' , ( ) =>
2323 this . availableSnippetsView . toggle ( atom . workspace . getActiveTextEditor ( ) ) ) ,
24- atom . packages . onDidActivatePackage ( bundle => this . loadPackage ( bundle ) ) ,
25- atom . packages . onDidDeactivatePackage ( bundle => this . unloadPackage ( bundle ) ) )
24+ atom . packages . onDidActivatePackage ( pack => this . loadPackage ( pack ) ) ,
25+ atom . packages . onDidDeactivatePackage ( pack => this . unloadPackage ( pack ) ) )
2626
2727 await ( this . loaded = Promise . all ( [
2828 this . loadUserSnippets ( ) ,
29- ...atom . packages . getActivePackages ( ) . map ( bundle => this . loadPackage ( bundle ) )
29+ ...atom . packages . getActivePackages ( ) . map ( pack => this . loadPackage ( pack ) )
3030 ] ) . then ( ( ) => true ) )
3131 }
3232
@@ -75,17 +75,17 @@ module.exports = class Snippets {
7575 }
7676 }
7777
78- static async loadPackage ( bundle ) {
79- const snippetsDirectory = path . join ( bundle . path , 'snippets' )
78+ static async loadPackage ( pack ) {
79+ const snippetsDirectory = path . join ( pack . path , 'snippets' )
8080 try {
8181 const files = await fs . promises . readdir ( snippetsDirectory )
8282 files . forEach ( async file => {
8383 const snippetsFile = path . join ( snippetsDirectory , file )
8484 try {
8585 const disposable = await this . loadSnippetsFile ( snippetsFile )
86- this . packageDisposables . has ( bundle )
87- ? this . packageDisposables . get ( bundle ) . add ( disposable )
88- : this . packageDisposables . set ( bundle , new CompositeDisposable ( disposable ) )
86+ this . packageDisposables . has ( pack )
87+ ? this . packageDisposables . get ( pack ) . add ( disposable )
88+ : this . packageDisposables . set ( pack , new CompositeDisposable ( disposable ) )
8989 } catch ( error ) {
9090 atom . notifications . addWarning ( `Unable to load snippets from: '${ snippetsFile } '` , {
9191 description : 'Make sure you have permissions to access the directory and file.' ,
@@ -107,10 +107,10 @@ module.exports = class Snippets {
107107 }
108108 }
109109
110- static unloadPackage ( bundle ) {
111- if ( this . packageDisposables . has ( bundle ) ) {
112- this . packageDisposables . get ( bundle ) . dispose ( )
113- this . packageDisposables . delete ( bundle )
110+ static unloadPackage ( pack ) {
111+ if ( this . packageDisposables . has ( pack ) ) {
112+ this . packageDisposables . get ( pack ) . dispose ( )
113+ this . packageDisposables . delete ( pack )
114114 }
115115 }
116116
0 commit comments