Shanedell commented on a change in pull request #41:
URL: https://github.com/apache/daffodil-vscode/pull/41#discussion_r732024157
##########
File path: src/daffodilDebugger.ts
##########
@@ -104,42 +101,25 @@ export async function getDebugger(config:
vscode.DebugConfiguration) {
// Code for downloading and setting up daffodil-debugger files
if (!fs.existsSync(`${rootPath}/${artifact.name}`)) {
- // Get daffodil-debugger of version entered using http client
- const client = new HttpClient('client') // TODO: supply daffodil
version from config
- const artifactUrl = artifact.archiveUrl(backend)
- const response = await client.get(artifactUrl)
-
- if (response.message.statusCode !== 200) {
- const err: Error = new Error(
- `Couldn't download the Daffodil debugger backend from
${artifactUrl}.`
+ // Get daffodil-debugger zip from extension files
+ const filePath = path
+ .join(
+ context.asAbsolutePath('./server/core/target/universal'),
+ artifact.archive
)
- err['httpStatusCode'] = response.message.statusCode
- throw err
+ .toString()
+
+ // If debugging the extension without vsix installed make sure
debugger is created
+ if (!filePath.includes('.vscode/extension')) {
+ if (!fs.existsSync(filePath)) {
+ let baseFolder = context.asAbsolutePath('./')
+ child_process.execSync(
+ `cd ${baseFolder} && sbt universal:packageBin`
Review comment:
so the `filePath` is only created if it doesn't exist already. So if you
ran a development environment already for `daffodil-debugger-3.1.0-1.0.0.zip`
then the folder `${DATA_FOLDER}/daffodil-dap/daffodil-debugger-3.1.0-1.0.0/`
will have been created so when you run it again it already exists so it will
not do anything. So if you update Scala code in between without changing the
version in `package.json` you will need to run `sbt universal:packageBin` then
move that folder the contents of that new folder into the already made folder.
From what I know there is not unless we make a `launch` option like `env`
and if its set to `dev` it will tell the extension to run `sbt
universal:packageBin`, or `yarn sbt` whenever its merged in, and unzip the
package and replace the contents of that folder
--
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]