Skip to content

Fix "instance first three chars" #1520

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 1 commit into from
Jun 13, 2023
Merged

Conversation

pokey
Copy link
Member

@pokey pokey commented Jun 8, 2023

The problem was that constructing a character range inadvertently resulted in a target with isToken = true, because when we clone the anchor target to create the new range target, we forgot to include the isToken = false.

Checklist

protected getCloneParameters() {
return {
...this.state,
isToken: this.isToken,
Copy link
Member Author

Choose a reason for hiding this comment

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

We really gotta figure out a way to make the clone parameters have a stronger type. Forgetting to include custom parameters is something that has hit us multiple times

@pokey pokey marked this pull request as ready for review June 8, 2023 10:44
@pokey pokey requested a review from AndreasArvidsson June 8, 2023 10:44
@pokey pokey added this pull request to the merge queue Jun 11, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jun 11, 2023
@pokey pokey added this pull request to the merge queue Jun 12, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jun 12, 2023
@pokey pokey added this pull request to the merge queue Jun 13, 2023
Merged via the queue into main with commit dada878 Jun 13, 2023
@pokey pokey deleted the pokey/fix-instance-first-three-chars branch June 13, 2023 13:34
pokey pushed a commit that referenced this pull request Jun 17, 2023
## Context


#1520 (comment)

## What

This adds a generic to `BaseTarget`, which is expected to receive the
type of the subclass' parameters. This tries its best to enforce that is
the case, and ensures implementations of `getCloneParameters` return
that declared type.

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