-
-
Notifications
You must be signed in to change notification settings - Fork 91
Added visible modifier #2094
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added visible modifier #2094
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yay, thanks! Excited to have this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Let's get a spoken form test; should be easy with our mechanism for custom spoken form tests eg add an entry to
...synonymousSpokenFormsFixture, | |
...talonApiFixture, | |
...multiActionFixture, |
or just add a recorded test. Either way
} | ||
|
||
function openEditor() { | ||
return openNewEditor("// 1\n\nfunction myFunk() {\n\t// 2\n}\n\n// 3", { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this would be much clearer as a constant like
const content = `
function myFunk() {
...
}
You could strip it if you don't want leading / trailing newline
fixed |
import { PlainTarget } from "../targets"; | ||
|
||
export class VisibleStage implements ModifierStage { | ||
constructor(private modifier: VisibleModifier) {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not worth changing for this PR, esp since we do this all over the place, but don't feel compelled to pass in modifier if it's not actually used. Gives a nice signal we don't use it if we don't even pass it in. I think one of the benefits of our DI setup is that we don't enforce uniformity like other DI mechanisms
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting. I kinda had the opposite reaction. If we force a modifier of the correct type then we can't accidentally in the previous switch statement instantiate the wrong modifier. The more strictly typed the better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I guess that's fair; hadn't thought bout that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Fixes #1607 Tested with `"from visible chuck every instance air"` and folded regions will be untouched. ## 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
Fixes cursorless-dev#1607 Tested with `"from visible chuck every instance air"` and folded regions will be untouched. ## 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
Fixes #1607
Tested with
"from visible chuck every instance air"
and folded regions will be untouched.Checklist