File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -189,7 +189,7 @@ export function activate(context: vsc.ExtensionContext) {
189189
190190 if ( vsc . workspace . rootPath ) {
191191 let resourceJson = path . resolve ( vsc . workspace . rootPath , 'resource.json' ) ;
192- let hasResourceJson = false ;
192+ let resourceJsonPaths = [ ] ;
193193
194194 fs . readFile ( resourceJson , 'utf8' , function ( err : any , data : string ) {
195195 let glob = '**/*.css' ;
@@ -206,21 +206,21 @@ export function activate(context: vsc.ExtensionContext) {
206206 for ( let key in resources . css ) {
207207 for ( let resource of resources . css [ key ] ) {
208208 let uri = vsc . Uri . file ( path . resolve ( vsc . workspace . rootPath , resource ) ) ;
209+ resourceJsonPaths . push ( uri . fsPath ) ;
209210 parse ( uri ) ;
210211 }
211212 }
212- hasResourceJson = true ;
213213 }
214214
215215 let watcher = vsc . workspace . createFileSystemWatcher ( glob ) ; // TODO
216216
217217 watcher . onDidCreate ( function ( uri : vsc . Uri ) {
218- if ( ! hasResourceJson || map [ uri . fsPath ] ) {
218+ if ( resourceJsonPaths . length === 0 || resourceJsonPaths . indexOf ( uri . fsPath ) !== - 1 ) {
219219 parse ( uri ) ;
220220 }
221221 } ) ;
222222 watcher . onDidChange ( function ( uri : vsc . Uri ) {
223- if ( ! hasResourceJson || map [ uri . fsPath ] ) {
223+ if ( resourceJsonPaths . length === 0 || resourceJsonPaths . indexOf ( uri . fsPath ) !== - 1 ) {
224224 parse ( uri ) ;
225225 }
226226 } ) ;
You can’t perform that action at this time.
0 commit comments