8
8
workspace ,
9
9
} from "vscode" ;
10
10
import CssClassDefinition from "./common/css-class-definition" ;
11
- import CssClassesStorage from "./css-classes-storage" ;
12
11
import Fetcher from "./fetcher" ;
13
12
import Notifier from "./notifier" ;
14
13
import ParseEngineGateway from "./parse-engine-gateway" ;
@@ -18,7 +17,7 @@ let uniqueDefinitions: CssClassDefinition[] = [];
18
17
19
18
const completionTriggerChars = [ '"' , "'" , " " , "." ] ;
20
19
21
- let caching : boolean = false ;
20
+ let caching = false ;
22
21
23
22
const emmetDisposables : Array < { dispose ( ) : any } > = [ ] ;
24
23
@@ -38,9 +37,9 @@ async function cache(): Promise<void> {
38
37
console . log ( "Found all parseable documents." ) ;
39
38
const definitions : CssClassDefinition [ ] = [ ] ;
40
39
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 ;
44
43
45
44
console . log ( "Parsing documents and looking for CSS class definitions..." ) ;
46
45
@@ -150,9 +149,9 @@ export async function activate(context: ExtensionContext): Promise<void> {
150
149
isEnabled ? enableEmmetSupport ( emmetDisposables ) : disableEmmetSupport ( emmetDisposables ) ;
151
150
}
152
151
} 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 ) ;
156
155
}
157
156
} , null , disposables ) ;
158
157
context . subscriptions . push ( ...disposables ) ;
@@ -166,9 +165,9 @@ export async function activate(context: ExtensionContext): Promise<void> {
166
165
try {
167
166
await cache ( ) ;
168
167
} 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 ) ;
172
171
} finally {
173
172
caching = false ;
174
173
}
@@ -200,9 +199,9 @@ export async function activate(context: ExtensionContext): Promise<void> {
200
199
try {
201
200
await cache ( ) ;
202
201
} 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 ) ;
206
205
} finally {
207
206
caching = false ;
208
207
}
0 commit comments