Skip to content

Conversation

AndreasArvidsson
Copy link
Member

@AndreasArvidsson AndreasArvidsson commented Dec 5, 2023

Fixes #1607

Tested with "from visible chuck every instance air" and folded regions will be untouched.

Checklist

  • I have added tests
  • [-] I have updated the docs and cheatsheet
  • [-] I have not broken the cheatsheet

Copy link
Collaborator

@josharian josharian left a 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.

Copy link
Member

@pokey pokey left a 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", {
Copy link
Member

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

@AndreasArvidsson
Copy link
Member Author

fixed

import { PlainTarget } from "../targets";

export class VisibleStage implements ModifierStage {
constructor(private modifier: VisibleModifier) {}
Copy link
Member

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

Copy link
Member Author

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?

Copy link
Member

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

Copy link
Member

@pokey pokey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@pokey pokey enabled auto-merge December 5, 2023 15:32
@pokey pokey added this pull request to the merge queue Dec 5, 2023
Merged via the queue into main with commit bce929c Dec 5, 2023
@pokey pokey deleted the visible branch December 5, 2023 15:57
cursorless-bot pushed a commit that referenced this pull request Dec 5, 2023
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
thetomcraig-aya pushed a commit to thetomcraig/cursorless that referenced this pull request Mar 27, 2024
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add "visible" scope

3 participants