dynamically refresh the view when the npm.exclude setting changes

This commit is contained in:
Erich Gamma 2018-05-17 10:45:43 +02:00
parent 49323b3798
commit a323b399d6

View file

@ -15,10 +15,16 @@ let taskProvider: vscode.Disposable | undefined;
export async function activate(context: vscode.ExtensionContext): Promise<void> {
taskProvider = registerTaskProvider(context);
registerExplorer(context);
const treeDataProvider = registerExplorer(context);
configureHttpRequest();
vscode.workspace.onDidChangeConfiguration(() => {
vscode.workspace.onDidChangeConfiguration((e) => {
configureHttpRequest();
if (e.affectsConfiguration('npm.exclude')) {
invalidateScriptsCache();
if (treeDataProvider) {
treeDataProvider.refresh();
}
}
});
context.subscriptions.push(addJSONProviders(httpRequest.xhr));
}