Commit 611968d
authored
Remove unnecessary catch which caused confusing error when iteration scopes were missing (#2740)
Today's implementation when you say something like `take every item`
will show an error message `Couldn't find containing collectionItem.`
even if it's the iteration scope that is missing.
This change makes it so that we get the error message `Couldn't find
containing iteration scope for collectionItem.` instead. This greatly
helps us with diagnosing what actually went wrong.
For program languages were a scope is defined in Tree sitter the current
error message makes little sense. You could use `take scope` and it
works fine, but when you say `take every scope` you get an error message
that there is no scope. Much better to actually show that this language
is missing an iteration scope.
## Checklist
- [/] 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 cheatsheet1 parent 8874c87 commit 611968d
File tree
1 file changed
+7
-14
lines changed- packages/cursorless-engine/src/processTargets/modifiers
1 file changed
+7
-14
lines changedLines changed: 7 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
90 | 83 | | |
91 | 84 | | |
92 | 85 | | |
| |||
0 commit comments