From 796a7f0e4def73ddb253665887c5b7135427c095 Mon Sep 17 00:00:00 2001 From: Venelin Bakalov Date: Wed, 10 Apr 2024 09:41:06 +0300 Subject: [PATCH] IAC-807 - Add hinting for all plugin objects --- .../request/collection/ServerCollection.ts | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/packages/node/vro-language-server/src/server/request/collection/ServerCollection.ts b/packages/node/vro-language-server/src/server/request/collection/ServerCollection.ts index 21304fc5..a15f5e01 100644 --- a/packages/node/vro-language-server/src/server/request/collection/ServerCollection.ts +++ b/packages/node/vro-language-server/src/server/request/collection/ServerCollection.ts @@ -3,14 +3,14 @@ * SPDX-License-Identifier: MIT */ -import { CancellationToken } from "vscode-languageserver" import { AutoWire, HintAction, HintModule, HintPlugin, Logger, sleep, VroRestClient } from "@vmware/vrdt-common" +import { CancellationToken } from "vscode-languageserver" +import { Timeout } from "../../../constants" +import { vmw } from "../../../proto" import { remote } from "../../../public" import { ConnectionLocator, Environment, HintLookup, Settings } from "../../core" import { WorkspaceCollection } from "./WorkspaceCollection" -import { vmw } from "../../../proto" -import { Timeout } from "../../../constants" @AutoWire export class CollectionStatus { @@ -141,6 +141,13 @@ export class ServerCollection { }) } + /** + * Collect all vRO Scripting API (Plugin) objects like VcPlugin, ActiveDirectory, etc. + * Function is asynchronous and usually take 5-10 mins since the full list of plugin details + * is huge (approximately 370 000 lines of JSON definitions) + * + * @returns vmw.pscoe.hints.IClass[] + */ async getVroObjects() { this.logger.info("Collecting vRO objects...") @@ -164,9 +171,14 @@ export class ServerCollection { } const parsedLink = link[0].substring(9).toString() // always retrieve and parse the first occurrence const pluginDetails = await this.restClient.getPluginDetails(parsedLink) + for (const pluginObject of pluginDetails["objects"]) { const object: vmw.pscoe.hints.IClass = { - name: pluginObject["name"] + name: pluginObject["name"], + description: pluginObject["description"], + constructors: pluginObject["constructors"], + properties: pluginObject["attributes"], + methods: pluginObject["methods"] } allObjects.push(object) }