Skip to content

Commit 45abf87

Browse files
Ecmel ErcanEcmel Ercan
authored andcommitted
Fixes
1 parent df7b186 commit 45abf87

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/extension.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff 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
});

0 commit comments

Comments
 (0)