88 workspace ,
99} from "vscode" ;
1010import CssClassDefinition from "./common/css-class-definition" ;
11- import CssClassesStorage from "./css-classes-storage" ;
1211import Fetcher from "./fetcher" ;
1312import Notifier from "./notifier" ;
1413import ParseEngineGateway from "./parse-engine-gateway" ;
@@ -18,7 +17,7 @@ let uniqueDefinitions: CssClassDefinition[] = [];
1817
1918const completionTriggerChars = [ '"' , "'" , " " , "." ] ;
2019
21- let caching : boolean = false ;
20+ let caching = false ;
2221
2322const emmetDisposables : Array < { dispose ( ) : any } > = [ ] ;
2423
@@ -38,9 +37,9 @@ async function cache(): Promise<void> {
3837 console . log ( "Found all parseable documents." ) ;
3938 const definitions : CssClassDefinition [ ] = [ ] ;
4039
41- let filesParsed : number = 0 ;
42- let failedLogs : string = "" ;
43- let failedLogsCount : number = 0 ;
40+ let filesParsed = 0 ;
41+ let failedLogs = "" ;
42+ let failedLogsCount = 0 ;
4443
4544 console . log ( "Parsing documents and looking for CSS class definitions..." ) ;
4645
@@ -150,9 +149,9 @@ export async function activate(context: ExtensionContext): Promise<void> {
150149 isEnabled ? enableEmmetSupport ( emmetDisposables ) : disableEmmetSupport ( emmetDisposables ) ;
151150 }
152151 } catch ( err ) {
153- err = new VError ( err , "Failed to automatically reload the extension after the configuration change" ) ;
154- console . error ( err ) ;
155- window . showErrorMessage ( err . message ) ;
152+ const newErr = new VError ( err , "Failed to automatically reload the extension after the configuration change" ) ;
153+ console . error ( newErr ) ;
154+ window . showErrorMessage ( newErr . message ) ;
156155 }
157156 } , null , disposables ) ;
158157 context . subscriptions . push ( ...disposables ) ;
@@ -166,9 +165,9 @@ export async function activate(context: ExtensionContext): Promise<void> {
166165 try {
167166 await cache ( ) ;
168167 } catch ( err ) {
169- err = new VError ( err , "Failed to cache the CSS classes in the workspace" ) ;
170- console . error ( err ) ;
171- window . showErrorMessage ( err . message ) ;
168+ const newErr = new VError ( err , "Failed to cache the CSS classes in the workspace" ) ;
169+ console . error ( newErr ) ;
170+ window . showErrorMessage ( newErr . message ) ;
172171 } finally {
173172 caching = false ;
174173 }
@@ -200,9 +199,9 @@ export async function activate(context: ExtensionContext): Promise<void> {
200199 try {
201200 await cache ( ) ;
202201 } catch ( err ) {
203- err = new VError ( err , "Failed to cache the CSS classes in the workspace for the first time" ) ;
204- console . error ( err ) ;
205- window . showErrorMessage ( err . message ) ;
202+ const newErr = new VError ( err , "Failed to cache the CSS classes in the workspace for the first time" ) ;
203+ console . error ( newErr ) ;
204+ window . showErrorMessage ( newErr . message ) ;
206205 } finally {
207206 caching = false ;
208207 }
0 commit comments