You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix bug with injected ide in test case recorder (#1359)
This PR fixes a bug with our test case recorder. If an exception is
thrown during command processing before we inject a spy ide during
`TestCaseRecorder.preCommandHook`, we don't set the `originalIde` member
variable on `TestCaseRecorder`. During `TestCaseRecorder.finallyHook`,
we unconditionally call `injectIde(this.originalIde)` even in the case
of an error, which means that we will inject an `undefined` ide, so
Cursorless becomes completely broken, because `ide()` is now
`undefined`, so we get an error about not having injected ide for every
single subsequent command
This PR just checks that `this.originalIde != null` before trying to
inject it
## Checklist
- [x] I have added
[tests](https://www.cursorless.org/docs/contributing/test-case-recorder/)
- [ ] I have updated the
[docs](https://github.com/cursorless-dev/cursorless/tree/main/docs) and
[cheatsheet](https://github.com/cursorless-dev/cursorless/tree/main/cursorless-talon/src/cheatsheet)
- [ ] I have not broken the cheatsheet
0 commit comments