Skip to content

Commit

Permalink
Reject attach launch configurations (#79)
Browse files Browse the repository at this point in the history
* Aborting when 'attach' run configuration is detected

* Lint fix

* Changelog entry
  • Loading branch information
Razz4780 authored Oct 17, 2023
1 parent cecb168 commit bbdc8c7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.d/+reject-attach.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mirrord now shows an error notification when the user tries to use it with an `attach` launch configuration.
7 changes: 7 additions & 0 deletions src/debugger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,13 @@ async function main(
return config;
}

if (config.request === "attach") {
new NotificationBuilder()
.withMessage("mirrord cannot be used with `attach` launch configurations")
.error();
return null;
}

// For some reason resolveDebugConfiguration runs twice for Node projects. __parentId is populated.
if (config.__parentId || config.env?.["__MIRRORD_EXT_INJECTED"] === 'true') {
return config;
Expand Down
2 changes: 1 addition & 1 deletion src/tests/e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ describe("mirrord sample flow test", function () {
try {
await ew.closeEditor('Welcome');
} catch (error) {
console.log("Welcome page is not displayed" + error)
console.log("Welcome page is not displayed" + error);
// continue - Welcome page is not displayed
}
await ew.openEditor('app_flask.py');
Expand Down

0 comments on commit bbdc8c7

Please sign in to comment.