WEB-47394 WEB-43188 WEB-37193 Fix issue with Angular schematics not showing up and...
[idea/contrib.git] / AngularJS / src / ngCli / schematicsProvider90.ts
index f9773cdbc1f887587ffec43900175db377dbff56..325eab35d9595c8f3acf7c6d75b09ae1b6f0963d 100644 (file)
@@ -2,12 +2,12 @@
 import {Collection, Schematic} from '@angular-devkit/schematics';
 import {SchematicsProvider} from "./schematicsProvider";
 import {SchematicCommand} from "@angular/cli/models/schematic-command";
-import {getWorkspace} from "@angular/cli/utilities/config"
+import {getWorkspaceDetails} from "@angular/cli/utilities/project"
 
 const schematicsProvider: Promise<SchematicsProvider> = (async function () {
-  let workspace = await getWorkspace('local');
+  let workspace = await getWorkspaceDetails()
   let command = new (SchematicCommand as any)({workspace: workspace}, null, null);
-  let engineHost = (await command.createWorkflow({interactive: false})).engineHost;
+  let {listSchematicNames} = (await command.createWorkflow({interactive: false})).engineHost;
   let defaultSchematicCollection = await command.getDefaultSchematicCollection()
 
   return {
@@ -15,7 +15,7 @@ const schematicsProvider: Promise<SchematicsProvider> = (async function () {
       return command.getCollection(collectionName);
     },
     listSchematics(collection): string[] {
-      return engineHost.listSchematicNames(collection.description)
+      return listSchematicNames(collection.description)
     },
     getSchematic(collection: Collection<any, any>, schematicName: string, allowPrivate?: boolean): Schematic<any, any> {
       return command.getSchematic(collection, schematicName, allowPrivate);