stevedlawrence commented on issue #1460:
URL: 
https://github.com/apache/daffodil-vscode/issues/1460#issuecomment-3437718863

   I don't know enough about about vsix to know if there's an appropriate place 
to store it, so I don't think I have a strong opinion there. Maybe 
`dist/daffodil/*` to differentiate it from the debugger jars which I think are 
now in `dist/debuggers`?
   
   As to stored compressed or not, maybe one advantage of storing uncompressed 
is you could avoid the need to uncompress and copy to global storage? You would 
just set --daffodilPath to wherever the extension files live. Note that the 
majority of files inside the daffodil zips are jars which are already 
compressed, so I don't think storing compressed vs uncompressed is going to 
matter too much from a size perspective.
   
   As to the logic, I would suggest we first check to see if we've bundled the 
requested version--no need to reach out to the internet if we already have what 
we need. If that doesn't exist, then we check if we've already downloaded and 
cached the version in global storage. And if that doesn't exist, then we try to 
download the version to global storage and use that. So maybe something like:
   
   ```ts
   def getDaffodilPath(daffodiVersion) {
     const daffodilPath = `daffodil/apache-daffodil-${daffodilVersion}-bin/`;
     const extensionPath = `${extensionPath}/dist/${daffodilPath}`;
     const globalStoragePath = `${globalStoragePath}/${daffodilPath}`;
     if (fileExists(extensionPath)) {
       return extensionPath;
     } else if (fileExists($globalStoragePath)) {
       return globalStoragePath;
     } else {
        downloadAndExtractToGlobalStorage(daffodilVersion);
        return globalStoragePath;
     }
   }
   ```
   
   And the result of that function is passed to `--daffodilPath`. Doesn't have 
to be that exact logic and functions, but something along those lines is maybe 
what I'd recommend.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to