How to use the abap-adt-api.parentTypeId function in abap-adt-api

To help you get started, we’ve selected a few abap-adt-api examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github marcellourbani / vscode_abap_remote_fs / client / src / adt / operations / AdtObjectCreator.ts View on Github external
private async getObjectDetails(uri: Uri | undefined): Promise<details> {
    const hierarchy = this.getHierarchy(uri)
    let devclass: string = this.guessParentByType(hierarchy, PACKAGE)
    const objType = await this.guessOrSelectObjectType(hierarchy)
    // user didn't pick one...
    if (!objType) return
    const name = await this.askName(objType.typeId)
    if (!name) return
    const description = await this.askInput("description", false)
    if (!description) return
    const responsible = this.server.client.username.toUpperCase()
    const parentType = parentTypeId(objType.typeId)
    let parentName
    if (parentType !== PACKAGE) {
      parentName = this.guessParentByType(hierarchy, "FUGR/F")
      if (!parentName) [parentName, devclass] = await this.askParent(parentType)
      if (!parentName) return
    }

    if (!devclass) {
      const packageResult = await this.server.objectFinder.findObject(
        "Select package",
        PACKAGE
      )
      if (!packageResult) return
      devclass = packageResult.name
    }
    if (parentType === PACKAGE) parentName = devclass</details>