[npm] support serverless & cleanup

This commit is contained in:
Martin Aeschlimann
2020-06-17 11:39:14 +02:00
parent d2f06fbcec
commit e32da59d30
10 changed files with 146 additions and 88 deletions

View File

@@ -30,8 +30,8 @@ export interface IJSONContribution {
resolveSuggestion?(item: CompletionItem): Thenable<CompletionItem | null> | null;
}
export function addJSONProviders(xhr: XHRRequest): Disposable {
const contributions = [new PackageJSONContribution(xhr), new BowerJSONContribution(xhr)];
export function addJSONProviders(xhr: XHRRequest, canRunNPM: boolean): Disposable {
const contributions = [new PackageJSONContribution(xhr, canRunNPM), new BowerJSONContribution(xhr)];
const subscriptions: Disposable[] = [];
contributions.forEach(contribution => {
const selector = contribution.getDocumentSelector();