Skip to content

externalXmlSettings.xmlFileAssociations not used in getXMLSettings #698

@JuneStepp

Description

@JuneStepp

It looks like getXMLSettings doesn't use external XML file associations, causing that part of the Typescript API to be broken.

Currently, the code is:

//applying externalXmlSettings to the xmlSettings
  externalXmlSettings.xmlCatalogs.forEach(catalog => {
    if (!xml['xml']['catalogs'].includes(catalog)) {
      xml['xml']['catalogs'].push(catalog);
    }
  })

when it probably should be something like:

  //applying externalXmlSettings to the xmlSettings
  externalXmlSettings.xmlCatalogs.forEach(catalog => {
    if (!xml['xml']['catalogs'].includes(catalog)) {
      xml['xml']['catalogs'].push(catalog);
    }
  })
  externalXmlSettings.xmlFileAssociations.forEach(element => {
    if (!xml['xml']['fileAssociations'].some(fileAssociation => fileAssociation.systemId === element.systemId)) {
      xml['xml']['fileAssociations'].push(element);
    }
  });

This was the only way I was able to get the addXMLFileAssociations function of the API to work, but please tell me if I'm just missing something. I have practically no experience with typescript or vscode extensions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions