I am creating a plugin that needs to load a web-types JSON file from a URL and use the file to assist with type hinting and autocompletion.
From looking at the documentation (here and here), I need to use
which works fine, but I seem to be getting stuck, considering the following use cases;
- The framework which I am trying to support does not follow versioning, so it can change, meaning the plugin will need to re-fetch the web types file once in a while to keep up to date, since the framework releases periodically
- The plugin has an environment switch to toggle between a production version and a test version of the web-types file, so the plugin will need to switch environments & re-fetch the web types file
That means that I will need to support fetching the web types dynamically, making me believe that I cannot do this in the XML file, because that is static and won't change.
I might be mistaken, but I think it is not possible to write to the resources folder of my plugin. So my question is as follows.
How can I programmatically supply the web-types symbol parser with a web-types JSON file, and make it reload the file afterwards?