ialexivy / vscode-angular2-files

vscode extension generating angular files with angular cli
MIT License
61 stars 36 forks source link

Pluggin loads the wrong angular.json file #43

Open asinino opened 5 years ago

asinino commented 5 years ago

What's happening When Visual Code boots up an error appears with the message "Invalid schema detected in .angular-cli.json, please correct and try again!", with no indication from wich extension this error comes from (I'm kind suggesting to make some indication, it will be easier to identify the problem). Then no action from the menus (that are added by this extension) are working, they just skip any action requested.

Problem found The extension tries to find the angular.json (Angular 6 in my case) in all folders from the workspace, including node_modules that in my configuration I have a template angular.json file in one of node modules (nx from nrwl project). The extension finds this file first and when it tries to parse the JSON file and it emits an error because it's a malformed JSON.

Possible solution Instead of find the angular.json file in all folders just try to find it in the root folder as it is the correct place for it work with angularcli module. Another possible solution is just ignore some folders in search for angular.json file, like: [_nodemodules, dist, .*]