stricklandrbls commented on code in PR #1354:
URL: https://github.com/apache/daffodil-vscode/pull/1354#discussion_r2270656819
##########
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
let noDebug = runOrDebug === 'run'
- if (!targetResource && vscode.window.activeTextEditor) {
- targetResource = vscode.window.activeTextEditor.document.uri
+ if (!targetResource) {
Review Comment:
I would suggest shorthanding this assignment as:
```ts
targetResource = vscode.window.activeTextEditor
? vscode.window.activeTextEditor.document.uri
: TDMLProvider.getDocumentUri()
```
This conditional also has 2 validity checks but what would happen if both
conditions are `false`?
--
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]