michael-hoke commented on code in PR #1354:
URL: https://github.com/apache/daffodil-vscode/pull/1354#discussion_r2270676955


##########
src/adapter/activateDaffodilDebug.ts:
##########
@@ -143,12 +144,17 @@ async function createDebugRunFileConfigs(
   tdmlAction: string | undefined,
   runLast = false
 ) {
-  let targetResource = resource
+  let targetResource: vscode.Uri | undefined = resource

Review Comment:
   I like the idea of this, but this does seem to open up a can of worms that I 
would really prefer to avoid in this PR. This call to this function (and, 
therefore the argument) comes from a function set up with the 
vscode.commands.registerCommand() function. The VSCode API will automatically 
provide a Uri as an argument to registered functions. However, it is apparently 
possible for the Uri to be undefined, which we are not handling in any of these 
functions.
   
   That being said, I believe that we are likely restricting the use of these 
commands to cases where the Uri is always going to be defined (file opened and 
active in window). So, I'd agree that we should be handling the possibility of 
an undefined Uri, just in case there are holes in how we are exposing the 
commands to the user, but I think this should be a larger fix than what you've 
suggested.



-- 
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