Skip to content

Fix value scope nesting in Typescript #1929

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

Merged
merged 2 commits into from
Oct 5, 2023

Conversation

pokey
Copy link
Member

@pokey pokey commented Oct 4, 2023

We only want nested value scopes if there is more than one declarator in a statement.

Before:

image

After:

image

Unfortunately we have no good way to test this change until we have #1524

Edit: I found a way to test it, but it's a bit hacky.

Checklist

@pokey pokey marked this pull request as ready for review October 4, 2023 17:22
@pokey pokey enabled auto-merge October 4, 2023 17:22
Copy link
Member Author

@pokey pokey Oct 4, 2023

Choose a reason for hiding this comment

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

When you say "next value" from the start of the statement, if there's a nested value, you'll get it; if not, you'll end up with the value from the next line. It's a bit opaque, but this test would fail on main

@pokey pokey added this pull request to the merge queue Oct 5, 2023
Merged via the queue into main with commit f1ba894 Oct 5, 2023
@pokey pokey deleted the pokey/fix-value-scope-nesting-in-typescript branch October 5, 2023 05:34
fidgetingbits pushed a commit to fidgetingbits/cursorless that referenced this pull request Nov 3, 2023
We only want nested value scopes if there is more than one declarator in
a statement.

Before:

<img width="186" alt="image"
src="https://github.com/cursorless-dev/cursorless/assets/755842/0aaf4491-2c68-4be2-849d-ff5c72ac968a">

After:

<img width="185" alt="image"
src="https://github.com/cursorless-dev/cursorless/assets/755842/3058a007-73b0-48cc-81dd-6f5b126fa07a">

Unfortunately we have no good way to test this change until we have
cursorless-dev#1524

**Edit**: I found a way to test it, but it's a bit hacky.

## 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 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.

2 participants